Files
roi-theme/wp-content/plugins/wp-marketing-automations/admin/frontend/dist/43.84371523f948942a56b2.js
root a22573bf0b Commit inicial - WordPress Análisis de Precios Unitarios
- WordPress core y plugins
- Tema Twenty Twenty-Four configurado
- Plugin allow-unfiltered-html.php simplificado
- .gitignore configurado para excluir wp-config.php y uploads

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-03 21:04:30 -06:00

1 line
44 KiB
JavaScript
Executable File

(window.webpackJsonp=window.webpackJsonp||[]).push([[43],{1081:function(t,e,r){"use strict";var n=r(0),o=r(5),a=r(3),i=r(2),c=r(1);r(1082);function l(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=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);l=!0);}catch(t){u=!0,o=t}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return u(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)?u(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 u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}e.a=function(t){var e=t.updateTitle,r=t.title,u=t.className,s=void 0===u?"":u,f=t.isDisabled,p=void 0!==f&&f,h=Object(n.useContext)(a.h),m=l(Object(n.useState)(!1),2),b=m[0],y=m[1],d=l(Object(n.useState)(""),2),v=d[0],w=d[1],g=Object(n.useRef)();Object(n.useEffect)((function(){w(r)}),[r]),Object(a.Qc)(g,(function(){O(v),y(!1)}));var O=function(t){if("string"==typeof t){var n=t.replace(/\s/g,"");y(!1),Object(i.isEmpty)(n)?(w(r),h(Object(c.__)("Title Cannot be empty","wp-marketing-automations")),Object(a.Lb)(h,3e3)):(w(null==t?void 0:t.trim()),e(t))}};return Object(n.useEffect)((function(){if(b&&g.current){var t=function(){this.style.width=this.value.length+2+"ch"};g.current.addEventListener("input",t),t.call(g.current)}}),[b]),Object(n.useEffect)((function(){var t;b&&(null==g||null===(t=g.current)||void 0===t||t.focus())}),[b]),b?Object(n.createElement)(n.Fragment,null,Object(n.createElement)(o.TextControl,{className:"bwf-editable-title ".concat(s),value:v,onChange:function(t){w(t)},ref:g,onBlur:O,autoComplete:"off",onKeyUp:function(t){"Enter"===t.key&&O(v)},disabled:p})):Object(n.createElement)("div",{onClick:function(){b||p||y(!0)},title:p?"":Object(c.__)("Click to edit","wp-marketing-automations"),className:"bwf-editable-title bwf-text ".concat(s," ").concat(p?"bwf-disable":"")},Object(n.createElement)("div",{dangerouslySetInnerHTML:{__html:v}}))}},1082:function(t,e,r){},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 l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?c(Object(r),!0).forEach((function(e){u(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):c(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function u(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=a(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==a(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}e.a=function(){var t=Object(n.a)("singleTemplateData"),e=t.fetch,r=t.setStateProp,a=t.clearError;return l(l({},function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.includes(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.includes(r)||{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,i)),{},{fetch:function(t){r("isLoading",!0),a(),e("GET",Object(o.A)("/template/".concat(t)))},setTemplateData:function(t){r("data",t)},setTemplateListData:function(t){r("listData",t)}})}},1166:function(t,e,r){"use strict";var n=r(9),o=r.n(n),a=r(3),i=r(1100),c=r(2);function l(t){return(l="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 u=["template"];function s(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.includes(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.includes(r)||{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}function f(){f=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 s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var a=e&&e.prototype instanceof v?e:v,i=Object.create(a.prototype),c=new T(n||[]);return o(i,"_invoke",{value:S(t,r,c)}),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var m="suspendedStart",b="executing",y="completed",d={};function v(){}function w(){}function g(){}var O={};s(O,i,(function(){return this}));var j=Object.getPrototypeOf,E=j&&j(j(D([])));E&&E!==r&&n.call(E,i)&&(O=E);var P=g.prototype=v.prototype=Object.create(O);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function L(t,e){function r(o,a,i,c){var u=h(t[o],t,a);if("throw"!==u.type){var s=u.arg,f=s.value;return f&&"object"==l(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(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 S(e,r,n){var o=m;return function(a,i){if(o===b)throw Error("Generator is already running");if(o===y){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var l=_(c,n);if(l){if(l===d)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=b;var u=h(e,r,n);if("normal"===u.type){if(o=n.done?y:"suspendedYield",u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=y,n.method="throw",n.arg=u.arg)}}}function _(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,_(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var a=h(o,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,d;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,d):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function k(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 N(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function D(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<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(l(e)+" is not iterable")}return w.prototype=g,o(P,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:w,configurable:!0}),w.displayName=s(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===w||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,s(t,u,"GeneratorFunction")),t.prototype=Object.create(P),t},e.awrap=function(t){return{__await:t}},x(L.prototype),s(L.prototype,c,(function(){return this})),e.AsyncIterator=L,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new L(p(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},x(P),s(P,u,"Generator"),s(P,i,(function(){return this})),s(P,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=D,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(l&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,d):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),N(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;N(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:D(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function p(t,e,r,n,o,a,i){try{var c=t[a](i),l=c.value}catch(t){return void r(t)}c.done?e(l):Promise.resolve(l).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){p(a,n,o,i,c,"next",t)}function c(t){p(a,n,o,i,c,"throw",t)}i(void 0)}))}}e.a=function(t,e){var r,n,l,p,m=arguments.length>2&&void 0!==arguments[2]&&arguments[2],b=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",y=Object(i.a)(),d=y.setTemplateData;return{sendTestEmail:(p=h(f().mark((function t(e,r,n,i,c,l){var u,s,p,h,m,b=arguments;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=b.length>6&&void 0!==b[6]&&b[6],s=b.length>7&&void 0!==b[7]?b[7]:{},p=b.length>8&&void 0!==b[8]&&b[8],h=b.length>9&&void 0!==b[9]?b[9]:{},t.prev=4,m={email:e,content:JSON.stringify({subject:r,body:n,type:i,mail_data:c,preheader:l,utmEnabled:u,utmDetails:s,overRideSenderInfo:p,overRideInfo:h})},t.next=8,o()({method:"POST",path:Object(a.A)("/send-test-email"),data:m});case 8:return t.abrupt("return",2);case 11:return t.prev=11,t.t0=t.catch(4),t.abrupt("return",3);case 14:case"end":return t.stop()}}),t,null,[[4,11]])}))),function(t,e,r,n,o,a){return p.apply(this,arguments)}),saveEditorContent:(l=h(f().mark((function r(n){var i,l,p,h,y,v,w,g,O,j,E;return f().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=e,l=Object(c.isEmpty)(n)?{}:n[0],p="","editor"===l.type?(l.hasOwnProperty("editor")&&(l.editor.hasOwnProperty("body")&&(i.template=l.editor.body),l.editor.hasOwnProperty("design")&&(i.data.design=l.editor.design)),p=4):"block"===l.type?(l.hasOwnProperty("block")&&(h=l.body,y=void 0===h?"":h,v=l.block,w=v.template,g=void 0===w?"":w,O=s(v,u),""!==g?i.template=l.block.template:""!==y&&(i.template=y),i.data.block=O),p=5):i.template=l.body,j={template:i.template,data:i.data,mode:p},l.hasOwnProperty("subject")&&(j.subject=l.subject),l.hasOwnProperty("preheader")&&(j.data.preheader=l.preheader),E={content:JSON.stringify(j)},b&&(E.lang=b),r.prev=9,r.next=12,o()({method:"POST",path:Object(a.A)("/".concat(m?"transactional-mail":"template","/").concat(t,"/save-email-content")),data:E}).then((function(t){200==t.code&&d(t.result)}));case 12:return r.abrupt("return",2);case 15:return r.prev=15,r.t0=r.catch(9),r.abrupt("return",3);case 18:case"end":return r.stop()}}),r,null,[[9,15]])}))),function(t){return l.apply(this,arguments)}),uploadImage:(n=h(f().mark((function t(e){var r,n;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(r=new FormData).append("image",e),t.prev=2,t.next=5,o()({method:"POST",path:Object(a.A)("/upload-image"),body:r});case 5:return n=t.sent,t.abrupt("return",n&&n.result?n.result:"");case 9:return t.prev=9,t.t0=t.catch(2),t.abrupt("return","");case 12:case"end":return t.stop()}}),t,null,[[2,9]])}))),function(t){return n.apply(this,arguments)}),fetchCurrentMailEditorContent:(r=h(f().mark((function t(){return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return","");case 1:case"end":return t.stop()}}),t)}))),function(){return r.apply(this,arguments)})}}},1413:function(t,e,r){},1444:function(t,e,r){"use strict";r.r(e);var n=r(0),o=r(3),a=r(76),i=r(12),c=r(1166),l=r(204),u=r(5),s=r(11),f=r(1100),p=r(51),h=r(2);function m(t){return(m="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 b=["getStateProp"];function y(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 d(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?y(Object(r),!0).forEach((function(e){v(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):y(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function v(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=m(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=m(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==m(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var w={1:"rich",2:"wc",3:"html",4:"editor",5:"block"},g=function(){var t=Object(p.a)("singleTemplateData"),e=t.getStateProp,r=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.includes(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.includes(r)||{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,b),n=Object(o.r)();return d(d({},r),{},{getTemplateData:function(){return e("data")},getListData:function(){return e("listData")},getFormattedTemplateData:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Object(h.isEmpty)(t))return{};var e={body:"",editor:{body:Object(o.Hb)(),design:Object(o.Gb)()},preheader:"",subject:"",type:"block",utm:n,utmEnabled:!1,last_updated:""};return t.hasOwnProperty("template")&&(t.hasOwnProperty("mode")&&4===parseInt(t.mode)?e.editor.body=t.template:e.body=t.template),t.hasOwnProperty("subject")&&(e.subject=t.subject),t.hasOwnProperty("mode")&&(e.type=w[t.mode]),t.hasOwnProperty("subject")&&(e.subject=t.subject),t.hasOwnProperty("updated_at")&&(e.last_updated=t.updated_at),t.hasOwnProperty("data")&&!Object(h.isEmpty)(t.data)&&(e.subject=t.subject,t.data.hasOwnProperty("preheader")&&(e.preheader=t.data.preheader),t.data.hasOwnProperty("utmEnabled")&&t.data.utmEnabled&&(e.utmEnabled=t.data.utmEnabled),t.data.hasOwnProperty("utm")&&(e.utm=t.data.utm),t.data.hasOwnProperty("design")&&4===parseInt(t.mode)&&(e.editor.design=t.data.design),t.data.hasOwnProperty("block")&&5===parseInt(t.mode)&&(e.block=t.data.block)),e}})},O=r(1),j=r(9),E=r.n(j),P=r(70),x=r(310),L=r.n(x),S=r(323),_=r(8),k=r(26),N=r(40),T=r(1081);function D(t){return(D="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 I(){I=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",l=a.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=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 k(n||[]);return o(i,"_invoke",{value:x(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",h="executing",m="completed",b={};function y(){}function d(){}function v(){}var w={};u(w,i,(function(){return this}));var g=Object.getPrototypeOf,O=g&&g(g(N([])));O&&O!==r&&n.call(O,i)&&(w=O);var j=v.prototype=y.prototype=Object.create(w);function E(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function P(t,e){function r(o,a,i,c){var l=f(t[o],t,a);if("throw"!==l.type){var u=l.arg,s=u.value;return s&&"object"==D(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){u.value=t,i(u)}),(function(t){return r("throw",t,i,c)}))}c(l.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 x(e,r,n){var o=p;return function(a,i){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var l=L(c,n);if(l){if(l===b)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?m:"suspendedYield",u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(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,L(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 S(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 _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function N(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<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(D(e)+" is not iterable")}return d.prototype=v,o(j,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:d,configurable:!0}),d.displayName=u(v,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,u(t,l,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},E(P.prototype),u(P.prototype,c,(function(){return this})),e.AsyncIterator=P,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new P(s(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},E(j),u(j,l,"Generator"),u(j,i,(function(){return this})),u(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=N,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(_),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(l&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),_(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;_(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},e}function A(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 C(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?A(Object(r),!0).forEach((function(e){F(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function F(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=D(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=D(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==D(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function G(t,e,r,n,o,a,i){try{var c=t[a](i),l=c.value}catch(t){return void r(t)}c.done?e(l):Promise.resolve(l).then(n,o)}var M=function(){var t,e=Object(n.useContext)(o.h),r=g(),a=r.getTemplateData,i=r.getListData,c=r.getError,l=Object(f.a)().setTemplateData,u=null!==(t=i())&&void 0!==t?t:"",s=a(),p=c(),m=null!=s?s:{},b=m.ID,y=void 0===b?"":b,d=m.title,v=void 0===d?"":d;if(!Object(h.isEmpty)(p))return null;var w=function(){var t,r=(t=I().mark((function t(){var r,n,a=arguments;return I().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(""!=(r=a.length>0&&void 0!==a[0]?a[0]:"")&&r!=v){t.next=3;break}return t.abrupt("return");case 3:return n=C({},s),t.prev=4,t.next=7,E()({path:Object(o.A)("/template/".concat(y)),method:"POST",data:{title:r,onlytitle:!0}}).then((function(t){if(200!=t.code)throw Error(Object(o.u)(null==t?void 0:t.message));l(C(C({},n),{},{title:r})),e(Object(O.__)("Title Updated","wp-marketing-automations")),Object(o.Lb)(e,3e3)}));case 7:t.next=12;break;case 9:t.prev=9,t.t0=t.catch(4),e(t.t0.message);case 12:Object(o.Lb)(e,3e3);case 13:case"end":return t.stop()}}),t,null,[[4,9]])})),function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){G(a,n,o,i,c,"next",t)}function c(t){G(a,n,o,i,c,"throw",t)}i(void 0)}))});return function(){return r.apply(this,arguments)}}();return Object(n.createElement)(n.Fragment,null,""!=v?Object(n.createElement)(T.a,{title:v,updateTitle:w}):""!=v?v:""!==u?u:Object(n.createElement)("div",{className:"bwf-placeholder-temp bwf-h-20 bwf-w-210"}))};function Y(t){return(Y="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 B=["template"];function R(){R=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",l=a.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=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 k(n||[]);return o(i,"_invoke",{value:x(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",h="executing",m="completed",b={};function y(){}function d(){}function v(){}var w={};u(w,i,(function(){return this}));var g=Object.getPrototypeOf,O=g&&g(g(N([])));O&&O!==r&&n.call(O,i)&&(w=O);var j=v.prototype=y.prototype=Object.create(w);function E(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function P(t,e){function r(o,a,i,c){var l=f(t[o],t,a);if("throw"!==l.type){var u=l.arg,s=u.value;return s&&"object"==Y(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){u.value=t,i(u)}),(function(t){return r("throw",t,i,c)}))}c(l.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 x(e,r,n){var o=p;return function(a,i){if(o===h)throw Error("Generator is already running");if(o===m){if("throw"===a)throw i;return{value:t,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var l=L(c,n);if(l){if(l===b)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=h;var u=f(e,r,n);if("normal"===u.type){if(o=n.done?m:"suspendedYield",u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=m,n.method="throw",n.arg=u.arg)}}}function L(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,L(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 S(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 _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function N(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<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(Y(e)+" is not iterable")}return d.prototype=v,o(j,"constructor",{value:v,configurable:!0}),o(v,"constructor",{value:d,configurable:!0}),d.displayName=u(v,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,u(t,l,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},E(P.prototype),u(P.prototype,c,(function(){return this})),e.AsyncIterator=P,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new P(s(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},E(j),u(j,l,"Generator"),u(j,i,(function(){return this})),u(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=N,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(_),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(l&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,b):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),_(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;_(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},e}function q(t,e,r,n,o,a,i){try{var c=t[a](i),l=c.value}catch(t){return void r(t)}c.done?e(l):Promise.resolve(l).then(n,o)}function J(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<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?J(Object(r),!0).forEach((function(e){z(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function z(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=Y(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Y(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function H(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=[],l=!0,u=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);l=!0);}catch(t){u=!0,o=t}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw o}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return $(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)?$(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 $(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var K=function(t){var e=t.templateId,r=Object(i.i)().editor,p=void 0===r?"":r,m=Object(n.useContext)(o.h),b=Object(f.a)(),y=b.fetch,d=b.setTemplateData,v=b.setTemplateListData,w=g(),j=w.getLoading,x=w.getTemplateData,T=w.getFormattedTemplateData,D=w.getListData,I=w.getError,A=D(),C={rich:1,wc:2,html:3,editor:4},F=Object(a.a)().setL2Title,G=H(Object(n.useState)(!1),2),Y=G[0],J=G[1],z=H(Object(n.useState)({loading:!1,status:!1}),2),$=z[0],K=z[1],Q=H(Object(n.useState)([]),2),W=Q[0],V=Q[1],X=I();Object(n.useEffect)((function(){return parseInt(e)>0&&y(e),function(){d({}),v("")}}),[]);var Z=j(),tt=x();Object(n.useEffect)((function(){F(tt.hasOwnProperty("title")?tt.title:""!=A?A:Object(n.createElement)("div",{className:"bwf-placeholder-temp bwf-h-15 bwf-w-90"}))}),[Z,tt]);var et=function(){var t,r=(t=R().mark((function t(){var r;return R().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(Object(o.ac)()){t.next=3;break}return J(!0),t.abrupt("return");case 3:if(rt()){t.next=16;break}return K({status:!0,loading:!0}),r={content:JSON.stringify(tt)},t.prev=6,t.next=9,E()({path:Object(o.A)("/template/".concat(e)),method:"POST",data:r}).then((function(t){200==t.code&&(m(t.message),Object(o.Lb)(m,3e3),K({}))}));case 9:t.next=16;break;case 11:t.prev=11,t.t0=t.catch(6),m(t.t0.message),Object(o.Lb)(m,3e3),K({});case 16:case"end":return t.stop()}}),t,null,[[6,11]])})),function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){q(a,n,o,i,c,"next",t)}function c(t){q(a,n,o,i,c,"throw",t)}i(void 0)}))});return function(){return r.apply(this,arguments)}}(),rt=function(){var t=!1,e=[];return tt.hasOwnProperty("title")&&!Object(h.isEmpty)(tt.title)||(t=!0,e.push(Object(O.__)("Name is required.","wp-marketing-automations"))),tt.hasOwnProperty("subject")&&!Object(h.isEmpty)(tt.subject)||(t=!0,e.push(Object(O.__)("Subject is required.","wp-marketing-automations"))),tt.hasOwnProperty("template")&&!Object(h.isEmpty)(tt.template)||(t=!0,e.push(Object(O.__)("Email content cannot be empty.","wp-marketing-automations"))),V(e),t};Object(n.useEffect)((function(){Object(h.isEmpty)(X)||d("isLoading",!1)}),[X]);var nt=Object(c.a)(e,tt,!1);return Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"bwf-section-header"},Object(n.createElement)("div",{className:"bwf-section-left"},Object(n.createElement)("span",{className:"bwf-svg-wrap",onClick:function(){Object(i.l)({page:"autonami",path:"/templates"},"/",{})}},Object(n.createElement)(_.a,{icon:"arrow-left",width:24,height:24})),Object(n.createElement)("span",{className:"bwf-section-title"},Object(n.createElement)(M,null)),Object(n.createElement)("span",{className:"bwf-tags bwf-tag-light-blue"},Object(O.__)("Template","wp-marketing-automations")))),Object(n.createElement)("div",{className:"bwf_clear_8"}),Object(n.createElement)("div",{className:"bwfcrm-overview-wrap bwf-crm-single-template-section"},!Object(h.isEmpty)(X)||Z||Object(h.isEmpty)(tt)?Object(h.isEmpty)(X)?"block"===p?Object(n.createElement)(u.Modal,{title:"",onRequestClose:function(){},overlayClassName:"bwf-recipe-preview-overlay bwf-fullscreen-overlay",className:"bwf-admin-modal bwf-admin-modal-no-header bwf-admin-modal-fullscreen bwf-c-block-save-content-loading",shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!1},Object(n.createElement)("div",{className:"bwf-c-save-content-loading"},Object(n.createElement)(L.a,{options:{loop:!0,autoplay:!0,animationData:S,rendererSettings:{preserveAspectRatio:"xMidYMid slice"}},height:480,width:480}),Object(n.createElement)("div",{style:{marginTop:"-60px",fontSize:"21px",fontWeight:"400",paddingLeft:"40px"}},Object(O.__)("Launching Editor","wp-marketing-automations")))):Object(n.createElement)(n.Fragment,null,Object(n.createElement)(u.Card,{className:"bwf-template-card bwf-template-placeholder"},Object(n.createElement)("div",{className:"bwf-template-card-header bwf-h4"},"Template"),Object(n.createElement)("div",{className:"bwf-p-15"},[1,2,3].map((function(t){return Object(n.createElement)("div",{key:t,className:"bwf-placeholder-temp"})})),Object(n.createElement)("div",{className:"bwf-display-flex bwf-space-between"},Object(n.createElement)("div",{className:"bwf-btn-section"},Object(n.createElement)("div",{className:"bwf-placeholder-temp bwf-btn "}),Object(n.createElement)("div",{className:"bwf-placeholder-temp bwf-btn "}),Object(n.createElement)("div",{className:"bwf-placeholder-temp bwf-btn"})),Object(n.createElement)("div",{className:"bwf-btn-section"},Object(n.createElement)("div",{className:"bwf-placeholder-temp bwf-btn btn-small"}),Object(n.createElement)("div",{className:"bwf-placeholder-temp bwf-btn btn-small"}))),Object(n.createElement)("div",{key:4,className:"bwf-editor-placeholder"}),Object(n.createElement)("div",{className:"bwf-placeholder-temp bwf-small"}),Object(n.createElement)("div",{className:"bwf-btn-section"},Object(n.createElement)("div",{className:"bwf-placeholder-temp bwf-btn"}),Object(n.createElement)("div",{className:"bwf-placeholder-temp bwf-btn"})),Object(n.createElement)("div",{className:"bwf_clear_30"}),Object(n.createElement)("div",{key:5,className:"bwf-placeholder-temp bwf-medium"}),Object(n.createElement)("div",{className:"bwf_clear_30"}))),Object(n.createElement)("div",{className:"bwf_clear_20"}),Object(n.createElement)("div",{className:"bwf-display-flex bwf-space-between"},Object(n.createElement)("div",{className:"bwf-h-0"}),Object(n.createElement)("div",{className:"bwf-placeholder-temp bwf-w-90 bwf-h-30"}))):Object(n.createElement)(k.a,{status:"error",isDismissible:!1,className:"bwf-m-0 bwf-mb-10"},X.hasOwnProperty("message")?X.message:Object(O.__)("Unable to load template","wp-marketing-automations")):Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{className:"bwf-template-card"},Object(n.createElement)("div",{className:"bwf-template-card-header bwf-h4"},Object(O.__)("Template","wp-marketing-automations")),!Object(h.isEmpty)(W)&&Object(n.createElement)(u.Card,{className:"bwf-name-card bwf-p-25"},Object(n.createElement)(P.a,null),Object(n.createElement)(k.a,{status:"error",isDismissible:!1,className:"bwf-m-0 bwf-mb-10"},W.map((function(t,e){return Object(n.createElement)(n.Fragment,{key:"bwf-template-card-error-".concat(e)},t,Object(n.createElement)("br",null))})))),Object(n.createElement)(l.a,{disableDefaultButtons:!0,initData:{content:[T(tt)]},validateEmailContent:!1,apiMethods:nt,showSenderInfo:!1,showSaveTemplate:!1,showTemplateTypeSelector:!0,returnData:!0,setMailData:function(t){var e=tt;if((t=t[1]).hasOwnProperty("subject")&&(e.subject=t.subject),t.hasOwnProperty("preheader")&&(e.data=U(U({},e.data),{},{preheader:t.preheader})),t.hasOwnProperty("type")&&C.hasOwnProperty(t.type)&&(e.mode=C[t.type]),t.hasOwnProperty("utmEnabled")&&(e.data=U(U({},e.data),{},{utmEnabled:t.utmEnabled})),t.hasOwnProperty("utm")&&(e.data=U(U({},e.data),{},{utm:t.utm})),"editor"===t.type)t.hasOwnProperty("editor")&&(t.editor.hasOwnProperty("body")&&(e.template=t.editor.body),t.editor.hasOwnProperty("design")&&(e.data.design=t.editor.design));else if("block"===t.type){if(t.hasOwnProperty("block")){var r=t.block,n=r.template,o=void 0===n?"":n,a=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.includes(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n<a.length;n++)r=a[n],e.includes(r)||{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(r,B);""!==o&&(e.template=t.block.template),e.data.block=a}}else e.template=t.body;d(U(U({},tt),e))},showTab:!1,disabled:$.loading,showTemplateButton:!1})),Object(n.createElement)("div",{className:"bwf_clear_20"}),Object(n.createElement)("div",{className:"bwf-display-flex bwf-j-end"},Object(n.createElement)(s.a,{isPrimary:!0,className:"bwf-crm-navigation-next bwf-display-flex",isBusy:$.loading,disabled:$.loading,onClick:function(){et()}},!Object(o.ac)()&&Object(n.createElement)(_.a,{icon:"king",size:"16",color:"#fff"}),Object(O.__)("Save","wp-marketing-automations"))))),!Object(o.ac)()&&Object(n.createElement)(N.b,{isOpen:Y,onRequestClose:function(){return J(!1)},modalContent:{isFeature:!0,featureTitle:Object(O.__)("Templates","wp-marketing-automations")}}))},Q=r(349);r(1413),e.default=function(t){var e=t.match.params.id,r=Object(i.i)(),c=Object(a.a)(),l=c.setBackLink,u=c.setBackLinkLabel;return Object(Q.a)(Object(O.__)("Templates","wp-marketing-automations")),Object(n.useEffect)((function(){Object(o.m)("Template #"+e),l(Object(i.f)({},"/templates",r)),u(Object(O.__)("All Templates","wp-marketing-automations"))})),Object(n.createElement)(n.Fragment,null,Object(n.createElement)(P.a,null),Object(n.createElement)(K,{templateId:e,query:r}))}}}]);