(window.webpackJsonp=window.webpackJsonp||[]).push([[46],{1066:function(t,e,r){"use strict";r.d(e,"a",(function(){return o}));var n=r(0);var o=function(t,e){var r=Object(n.useRef)();Object(n.useEffect)((function(){r.current=t}),[t]),Object(n.useEffect)((function(){if(null!==e){var t=setInterval((function(){r.current()}),e);return function(){return clearInterval(t)}}}),[e])}},1100:function(t,e,r){"use strict";var n=r(50),o=r(3);function a(t){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var i=["fetch","setStateProp","clearError"];function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function u(t){for(var e=1;e=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),T(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;T(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function h(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function b(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){h(a,n,o,i,c,"next",t)}function c(t){h(a,n,o,i,c,"throw",t)}i(void 0)}))}}function y(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return d(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},e}function F(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function G(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=Array(e);r0&&void 0!==arguments[0]?arguments[0]:"";return Object(n.createElement)(n.Fragment,null,"".concat(""!==t?t:"It seems there was an issue during the import",". For further help, contact "),Object(n.createElement)("a",{href:Object(i.fb)("support",{utm_medium:"Support+Recipe+Import+Failed"}),target:"_blank",rel:"noopener noreferrer"},Object(o.__)(" support. ","wp-marketing-automations")))},z=function(t){var e=t.onRequestClose,r=Object(c.i)(),a=R(Object(n.useState)({status:!1,modalTitle:Object(o.__)("Import Template","wp-marketing-automations")}),2),u=a[0],l=a[1],s=R(Object(n.useState)(null),2),f=s[0],p=s[1],m=function(){var t,a=(t=A().mark((function t(){var a;return A().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return l(G(G({},u),{},{loading:!0,title:Object(o.__)("Please wait…","wp-marketing-automations"),message:Object(n.createElement)(n.Fragment,null,Object(o.sprintf)(Object(o.__)("Please wait! We are importing %s data","wp-marketing-automations"),null==f?void 0:f.name))})),t.prev=1,(a=new FormData).append("files",f),t.next=6,S()({method:"POST",body:a,path:Object(i.A)("/templates/import")}).then((function(t){200==t.code?t.result.hasOwnProperty("template_id")?(l(G(G({},u),{},{status:!0,loading:!1,title:Object(o.__)("Importing Done","wp-marketing-automations"),message:Object(o.__)("Successfully Imported and added in your Template","wp-marketing-automations")})),setTimeout((function(){Object(c.l)({page:"autonami",path:"/template/".concat(t.result.template_id)},"/",{})}),1e3)):(Object(c.l)({path:"/templates/"},"/",r),e()):(p(null),l(G(G({},u),{},{status:!1,loading:!1,title:Object(o.__)("Importing Failed","wp-marketing-automations"),message:q(t.message)})))}));case 6:t.next=12;break;case 8:t.prev=8,t.t0=t.catch(1),p(null),l(G(G({},u),{},{status:!1,loading:!1,title:Object(o.__)("Importing Failed","wp-marketing-automations"),message:q(t.t0.message)}));case 12:case"end":return t.stop()}}),t,null,[[1,8]])})),function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){B(a,n,o,i,c,"next",t)}function c(t){B(a,n,o,i,c,"throw",t)}i(void 0)}))});return function(){return a.apply(this,arguments)}}();return Object(n.useEffect)((function(){f&&m()}),[f]),Object(n.createElement)(n.Fragment,null,Object(n.createElement)(D.Modal,{className:"bwf-admin-modal bwf-admin-modal-480 bwf-admin-modal-no-header",shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1},Object(n.createElement)("div",{className:"bwf-admin-m-header-new"},Object(n.createElement)("div",{className:"bwf-admin-m-title"},Object(o.__)("Import Template","wp-marketing-automations")),Object(n.createElement)("div",{className:"bwf-admin-m-close",onClick:e},Object(n.createElement)(P.a,{icon:"close",size:20}))),u.title&&Object(n.createElement)("div",{className:"bwf-import-modal-content bwf-t-center"},u.loading?Object(n.createElement)(P.a,{icon:"import-loading"}):Object(n.createElement)(P.a,{icon:u.status?"success-loader":"circle-close",size:48}),Object(n.createElement)("div",{className:"bwf-drop-import-content"},u.message)),!u.title&&Object(n.createElement)(C.a,{onFileSelected:function(t){return p(t)},filetypeArray:["application/json"],importText:Object(o.__)("Drag or Browse a json file to import template","wp-marketing-automations"),importInfo:"( "+Object(o.__)("File size 10 MB max","wp-marketing-automations")+" )"})))},Y=r(96);function V(t){return(V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function $(){$=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,i=Object.create(a.prototype),c=new S(n||[]);return o(i,"_invoke",{value:k(t,r,c)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",m="executing",h="completed",b={};function y(){}function d(){}function v(){}var g={};l(g,i,(function(){return this}));var O=Object.getPrototypeOf,w=O&&O(O(T([])));w&&w!==r&&n.call(w,i)&&(g=w);var j=v.prototype=y.prototype=Object.create(g);function E(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(o,a,i,c){var u=f(t[o],t,a);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==V(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function k(e,r,n){var o=p;return function(a,i){if(o===m)throw Error("Generator is already running");if(o===h){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=x(c,n);if(u){if(u===b)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?h:"suspendedYield",l.arg===b)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=h,n.method="throw",n.arg=l.arg)}}}function x(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,x(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=f(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},e}function J(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function H(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){J(a,n,o,i,c,"next",t)}function c(t){J(a,n,o,i,c,"throw",t)}i(void 0)}))}}var W=function(t){var e=t.isOpen,r=t.tasks,a=t.onSuccess,c=t.onError,u=t.onRequestClose,l=t.actionType,s=r?r.length:0,f=Object(Y.useMutation)(function(){var t=H($().mark((function t(e){return $().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,S()({path:Object(i.A)("/bulk-action/template"),method:"DELETE",data:{ids:e}});case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),{onSuccess:function(){setTimeout((function(){return f.reset()}),2500),a&&a()},onError:function(){c&&c()}}),p=function(){var t=H($().mark((function t(){return $().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.mutate(r.map((function(t){return t.ID})));case 2:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),m={delete:{title:Object(o._n)("Delete Template","Delete Templates",s,"wp-marketing-automations"),description:Object(n.createElement)(n.Fragment,null,Object(o.__)("You are about to delete ","wp-marketing-automations"),Object(o._n)("template","templates",s,"wp-marketing-automations"),Object(o.__)(". This action cannot be undone. Cancel to stop, Delete to proceed.","wp-marketing-automations")),confirmBtn:Object(o.__)("Delete","wp-marketing-automations"),cancelBtn:Object(o.__)("Cancel","wp-marketing-automations"),successMsg:Object(o.__)("Bulk action executed successfully","wp-marketing-automations"),errorMsg:Object(o.__)("Unable to delete template","wp-marketing-automations"),confirmDescription:Object(o.__)("This action is irreversible","wp-marketing-automations")}};return Object(n.createElement)(E.a,{modalTitle:m.hasOwnProperty(l)&&m[l].hasOwnProperty("title")?m[l].title:Object(o._n)("Perform Actions","Perform Actions",s,"wp-marketing-automations"),deleteDescriptionText:m.hasOwnProperty(l)&&m[l].hasOwnProperty("description")?m[l].description:"",confirmButtonText:m.hasOwnProperty(l)&&m[l].hasOwnProperty("confirmBtn")?m[l].confirmBtn:Object(o.__)("Confirm","wp-marketing-automations"),cancelButtonText:m.hasOwnProperty(l)&&m[l].hasOwnProperty("cancelBtn")?m[l].cancelBtn:Object(o.__)("Cancel","wp-marketing-automations"),onConfirm:p,isLoading:f.isLoading,successMessage:f.isSuccess&&(m.hasOwnProperty(l)&&m[l].hasOwnProperty("successMsg")?m[l].successMsg:Object(o.__)("Actions Done!","wp-marketing-automations")),errorMessage:f.isError&&(f.error&&f.error.message?f.error.message:m.hasOwnProperty(l)&&m[l].hasOwnProperty("errorMsg")?m[l].errorMsg:Object(o.__)("Unable to perform action","wp-marketing-automations")),onRequestClose:function(){return!!u&&u()},isOpen:e,confirmDescription:m.hasOwnProperty(l)&&m[l].hasOwnProperty("confirmDescription")?m[l].confirmDescription:"",isDelete:!0})},Q=r(1105),K=r(2),Z=r(44),X=r(195),tt=r(334),et=r(26),rt=r(11);function nt(t){return(nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function ot(){return(ot=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},e}function it(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ct(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=Array(e);r1&&void 0!==n[1]?n[1]:{},it(ct(ct({},r),{},{status:!0})),t.prev=2,t.next=5,S()({path:Object(i.A)("/template/".concat(e)),method:"DELETE"}).then((function(t){f(t.message),it({status:!1}),v(p,R,U)}));case 5:t.next=10;break;case 7:t.prev=7,t.t0=t.catch(2),it({status:!0,error:t.t0.message?t.t0.message:Object(o.__)("Error in deleting template","wp-marketing-automations")});case 10:Object(i.Lb)(f,3e3);case 11:case"end":return t.stop()}}),t,null,[[2,7]])})));return function(e){return t.apply(this,arguments)}}(),Dt=function(){var t=st(at().mark((function t(e){return at().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return f(Object(o.__)("Cloning…","wp-marketing-automations")),t.prev=1,t.next=4,S()({path:Object(i.A)("/template/".concat(e,"/clone")),method:"GET"}).then((function(t){200==t.code?(f(Object(o.__)("Template cloned","wp-marketing-automations")),v(p,0,U)):f(t.message)}));case 4:t.next=9;break;case 6:t.prev=6,t.t0=t.catch(1),f(t.t0.message);case 9:Object(i.Lb)(f,3e3);case 10:case"end":return t.stop()}}),t,null,[[1,6]])})));return function(e){return t.apply(this,arguments)}}(),It=function(t){return Object(n.createElement)(_.a,{label:Object(o.__)("Quick Actions","wp-marketing-automations"),menuPosition:"bottom right",renderContent:function(e){var r=e.onToggle;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(k.a,{isClickable:!0,onInvoke:function(){O(t.title),Object(c.l)({path:"/template/"+parseInt(t.ID)},"/",p),r()}},Object(n.createElement)(x.a,{justify:"space-between"},Object(n.createElement)(x.c,null,Object(o.__)("Edit","wp-marketing-automations")))),Object(n.createElement)(k.a,{isClickable:!0,onInvoke:function(){Object(i.ac)()?Dt(parseInt(t.ID)):s(!0),r()}},Object(n.createElement)(x.a,{justify:"space-between"},Object(n.createElement)(x.c,null,Object(o.__)("Duplicate","wp-marketing-automations")),!Object(i.ac)()&&Object(n.createElement)(x.c,null,i.e))),Object(n.createElement)(k.a,{isClickable:!0,onInvoke:function(){Object(i.ac)()?Wt(t.ID,t.title):s(!0),r()}},Object(n.createElement)(x.a,{justify:"space-between"},Object(n.createElement)(x.c,null,Object(o.__)("Export","wp-marketing-automations")),!Object(i.ac)()&&Object(n.createElement)(x.c,null,i.e))),Object(n.createElement)(k.a,{isClickable:!0,onInvoke:function(){var e={status:!0,modalTitle:Object(o.__)("Delete Template","wp-marketing-automations"),deleteEntityName:t.title,buttonConfirm:Object(o.__)("Delete","wp-marketing-automations"),buttonCancel:Object(o.__)("Cancel","wp-marketing-automations"),isDelete:!0};it(ct(ct({},e),{},{onConfirm:function(){return Ct(t.ID,e)}})),r()}},Object(n.createElement)(x.a,{justify:"flex-start"},Object(n.createElement)(x.c,null,Object(o.__)("Delete","wp-marketing-automations")))))}})},At=Object(n.useMemo)((function(){var t={};if(Array.isArray(B)){var e,r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=pt(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){c=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(c)throw a}}}}(B);try{for(r.s();!(e=r.n()).done;){var n=e.value;t[n.ID]=n}}catch(t){r.e(t)}finally{r.f()}}return t}),[B]),Ft=Object(T.b)(At),Gt=Ft.singleSelectProps,Mt=Ft.selectAllProps,Bt=Ft.floatingBarProps,Rt=Ft.resetSelection,Ut=Ft.selected,qt=Object.keys(Ut).filter((function(t){return Ut[t]})).length,zt=[{key:"select_template",label:Object(n.createElement)(Z.a,ot({type:"checkbox",checked:!1,onChange:function(){}},Mt)),isLeftAligned:!0,required:!0,cellClassName:"bwf-col-action bwf-w-30"},{key:"actions",label:"",isLeftAligned:!1,cellClassName:"bwf-col-action bwf-w-30"},{key:"name",label:Object(o.__)("Name","wp-marketing-automations"),isLeftAligned:!0},{key:"createdon",label:Object(o.__)("Created On","wp-marketing-automations"),isLeftAligned:!0,cellClassName:"bwf-w-240"},{key:"type",label:Object(o.__)("Type","wp-marketing-automations"),isLeftAligned:!0,cellClassName:"bwf-w-210"},{key:"updatedon",label:Object(o.__)("Last Update","wp-marketing-automations"),isLeftAligned:!0,cellClassName:"bwf-w-240"}],Yt=function(t){return Object(n.createElement)("a",{href:"admin.php?page=autonami&path=/template/"+t.ID,type:"bwf-crm",className:"bwf-a-no-underline",onClick:function(e){e.preventDefault(),O(t.title),Object(c.l)({path:"/template/"+parseInt(t.ID)},"/",p)}},Object(n.createElement)("b",null,t.title.charAt(0).toUpperCase()+t.title.slice(1)+" "))},Vt=B.map((function(t){return[{display:Gt.hasOwnProperty(t.ID)?Object(n.createElement)(Z.a,ot({type:"checkbox",checked:!1,onChange:function(){}},Gt[t.ID])):Object(n.createElement)(n.Fragment,null),value:null},{display:It(t),value:"action"},{display:t.title?Yt(t):"-",value:""},{display:Object(i.ib)(t.created_at),value:""},{display:y.hasOwnProperty(parseInt(t.mode))?Object(n.createElement)(n.Fragment,null,y[parseInt(t.mode)],5===parseInt(t.mode)&&Object(n.createElement)("span",{className:"bwf-tags bwf-tag-green bwf-ml-4"},Object(o.__)("New","wp-marketing-automations"))):"-",value:""},{display:Object(i.ib)(t.updated_at),value:""}]})),$t=function(t){t!==U&&g("limit",t)},Jt=function(t,e){var r="data:text/json;charset=utf-8,"+encodeURIComponent(t),n=document.createElement("a");n.setAttribute("href",r),n.setAttribute("download",e+".json"),document.body.appendChild(n),n.click(),n.remove()},Ht=function(){var t=st(at().mark((function t(){return at().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return f(Object(o.__)("Exporting…","wp-marketing-automations")),t.prev=1,t.next=4,S()({path:Object(i.A)("/export/action"),data:{type:"templates",action:"start",extra_data:{search:b}},method:"POST"}).then((function(t){if(200!==t.code)throw Error(Object(i.u)(null==t?void 0:t.message));t.hasOwnProperty("result")&&t.result.hasOwnProperty("data")&&!Object(K.isEmpty)(t.result.data)&&(bwfcrm_contacts_data.export_data=t.result.data,f(Object(o.__)("Template export has started","wp-marketing-automations"))),Object(i.Lb)(f,3e3)}));case 4:t.next=9;break;case 6:t.prev=6,t.t0=t.catch(1),Object(i.Lb)(f,3e3);case 9:case"end":return t.stop()}}),t,null,[[1,6]])})));return function(){return t.apply(this,arguments)}}(),Wt=function(){var t=st(at().mark((function t(){var e,r,n,a=arguments;return at().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=a.length>0&&void 0!==a[0]?a[0]:0,r=a.length>1&&void 0!==a[1]?a[1]:"templates",f(Object(o.__)("Exporting…","wp-marketing-automations")),n="",!Object(K.isArray)(e)&&parseInt(e)>0?n=Object(i.A)("/templates/".concat(e,"/export")):(n=Object(i.A)("/templates/export/"),Object(K.isEmpty)(e)||(n+="?ids=".concat(e.join(",")))),t.prev=5,t.next=8,S()({path:n,method:"GET"}).then((function(t){if(200!==t.code)throw Error(Object(i.u)(null==t?void 0:t.message));Jt(t.result,r),f(Object(o.__)("Template exported","wp-marketing-automations")),Object(K.isArray)(e)&&St(),Object(i.Lb)(f,3e3)}));case 8:t.next=14;break;case 10:t.prev=10,t.t0=t.catch(5),Object(i.Lb)(f,3e3),setTimeout((function(){it({status:!0,modalTitle:Object(o.__)("Export Template","wp-marketing-automations"),error:t.t0.message})}),[1500]);case 14:case"end":return t.stop()}}),t,null,[[5,10]])})));return function(){return t.apply(this,arguments)}}(),Qt=0===parseInt(qt)?Object(n.createElement)("div",{className:"bwf-display-flex gap-12"},J.hasOwnProperty("templates")&&Object(n.createElement)(Q.a,{type:"templates",localData:J.templates,onDismiss:function(){return mt(!0)}}),Object(n.createElement)(rt.a,{className:"bwf-btn-small is-light",title:Object(o.__)("Export","wp-marketing-automations"),onClick:function(){Object(i.ac)()?Ht():s(!0)},disabled:J.hasOwnProperty("templates")&&!lt},Object(n.createElement)("span",{className:"bwf-display-flex gap-4"},Object(n.createElement)(P.a,{icon:Object(i.ac)()?"export":"king",size:16}),Object(n.createElement)("span",null,Object(o.__)("Export All","wp-marketing-automations")))),Object(n.createElement)(rt.a,{className:"bwf-btn-small is-light",title:Object(o.__)("Import","wp-marketing-automations"),onClick:function(){Object(i.ac)()?yt(!0):s(!0)}},Object(n.createElement)("span",{className:"bwf-display-flex gap-4"},Object(n.createElement)(P.a,{icon:Object(i.ac)()?"import":"king",size:16}),Object(n.createElement)("span",null,Object(o.__)("Import","wp-marketing-automations"))))):Object(n.createElement)(n.Fragment,null),Kt=q||vt||0!==Y||""!==b||$;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"bwf-content-header-new"},Object(n.createElement)("div",{className:"bwf-content-header-left"},Object(n.createElement)("div",{className:"bwf-content-header-title"},Object(o.__)("Templates","wp-marketing-automations")),parseInt(Y)>0&&Object(n.createElement)("div",{className:"bwf-content-header-count"},Object(o.sprintf)(Object(o._n)("(%s Result)","(%s Results)",Y,"wp-marketing-automations"),Y))),Object(n.createElement)("div",{className:"bwf-content-header-right"},Kt&&!q&&r)),$&&Object(n.createElement)(et.a,{status:"error"},$.message),Kt?Object(n.createElement)(j.a,{className:"bwf-template-table has-search",title:"",rows:Vt,headers:zt,query:{paged:V},rowsPerPage:U,totalRows:Y,isLoading:q,onPageChange:function(t,e){g("offset",(t-1)*U)},onQueryChange:function(t){return"per_page"!==t?function(){}:$t},showMenu:!1,rowHeader:!0,actions:qt>0?[Object(n.createElement)(T.a,ot({key:"template-bulk-action",actions:(Tt=[],-1!==Object(i.n)(bwfcrm_contacts_data.bwf_pro_version,"2.9.5")&&Tt.push({id:"export",icon:"export",hint:Object(o.__)("Export","wp-marketing-automations"),isPro:!0}),Tt.push({id:"delete",icon:"trash",hint:Object(o.__)("Delete","wp-marketing-automations")}),Tt),onAction:Nt,inLine:!0,reset:St},Bt))]:[Object(n.createElement)(X.a,{key:"search",isLoading:q,searchTerm:null==p?void 0:p.s,showResultCount:!1,setSearchData:function(t){if(Object(K.size)(t))Object(c.l)({s:t},"/",p);else{var e=Object(K.cloneDeep)(p);e.hasOwnProperty("s")&&(null==e||delete e.s),gt(!0),Object(c.l)(e,"/",{})}}})],emptyMessage:Object(o.__)("No templates found","wp-marketing-automations"),extraSectionBeforefilterCol:Qt}):Object(n.createElement)(tt.a,{data:u}),Object(n.createElement)(E.a,{modalTitle:nt.modalTitle,deleteEntityName:nt.deleteEntityName,confirmText:nt.confirmText,confirmButtonText:nt.buttonConfirm,cancelButtonText:nt.buttonCancel,onConfirm:nt.onConfirm,isLoading:nt.loading,successMessage:nt.success,errorMessage:nt.error,content:nt.content,onRequestClose:function(){return it({status:!1})},isOpen:nt.status,isDelete:!nt.hasOwnProperty("isDelete")||nt.isDelete}),Object(n.createElement)(W,{tasks:wt,isOpen:_t,onSuccess:function(){v(p,R,U),St()},onError:St,onRequestClose:function(){return kt(!1)},screenType:"bulkaction",actionType:Pt}),bt&&Object(n.createElement)(z,{onRequestClose:function(){return yt(!1)}}))};r(345),r(347),r(48);function bt(t){return(bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function yt(){yt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var a=e&&e.prototype instanceof y?e:y,i=Object.create(a.prototype),c=new S(n||[]);return o(i,"_invoke",{value:k(t,r,c)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var p="suspendedStart",m="executing",h="completed",b={};function y(){}function d(){}function v(){}var g={};l(g,i,(function(){return this}));var O=Object.getPrototypeOf,w=O&&O(O(T([])));w&&w!==r&&n.call(w,i)&&(g=w);var j=v.prototype=y.prototype=Object.create(g);function E(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(o,a,i,c){var u=f(t[o],t,a);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==bt(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,c)}))}c(u.arg)}var a;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return a=a?a.then(o,o):o()}})}function k(e,r,n){var o=p;return function(a,i){if(o===m)throw Error("Generator is already running");if(o===h){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=x(c,n);if(u){if(u===b)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=m;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?h:"suspendedYield",l.arg===b)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=h,n.method="throw",n.arg=l.arg)}}}function x(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,x(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var a=f(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,b;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;L(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},e}function dt(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function vt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return gt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?gt(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);rt.length)&&(e=t.length);for(var r=0,n=Array(e);r