- 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>
1 line
35 KiB
JavaScript
Executable File
1 line
35 KiB
JavaScript
Executable File
(window.webpackJsonp=window.webpackJsonp||[]).push([[55],{1100:function(t,e,r){"use strict";var n=r(50),a=r(3);function o(t){return(o="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"!=o(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==o(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,o=t.clearError;return l(l({},function(t,e){if(null==t)return{};var r,n,a=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 o=Object.getOwnPropertySymbols(t);for(n=0;n<o.length;n++)r=o[n],e.includes(r)||{}.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}(t,i)),{},{fetch:function(t){r("isLoading",!0),o(),e("GET",Object(a.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),a=r.n(n),o=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,a=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 o=Object.getOwnPropertySymbols(t);for(n=0;n<o.length;n++)r=o[n],e.includes(r)||{}.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}function f(){f=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",u=o.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 o=e&&e.prototype instanceof v?e:v,i=Object.create(o.prototype),c=new T(n||[]);return a(i,"_invoke",{value:k(t,r,c)}),i}function m(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var b="suspendedStart",h="executing",d="completed",y={};function v(){}function g(){}function O(){}var w={};s(w,i,(function(){return this}));var j=Object.getPrototypeOf,E=j&&j(j(D([])));E&&E!==r&&n.call(E,i)&&(w=E);var P=O.prototype=v.prototype=Object.create(w);function _(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function r(a,o,i,c){var u=m(t[a],t,o);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 o;a(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,a){r(t,n,e,a)}))}return o=o?o.then(a,a):a()}})}function k(e,r,n){var a=b;return function(o,i){if(a===h)throw Error("Generator is already running");if(a===d){if("throw"===o)throw i;return{value:t,done:!0}}for(n.method=o,n.arg=i;;){var c=n.delegate;if(c){var l=x(c,n);if(l){if(l===y)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===b)throw a=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=h;var u=m(e,r,n);if("normal"===u.type){if(a=n.done?d:"suspendedYield",u.arg===y)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(a=d,n.method="throw",n.arg=u.arg)}}}function x(e,r){var n=r.method,a=e.iterator[n];if(a===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")),y;var o=m(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,y;var i=o.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,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function L(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(L,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 a=-1,o=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(l(e)+" is not iterable")}return g.prototype=O,a(P,"constructor",{value:O,configurable:!0}),a(O,"constructor",{value:g,configurable:!0}),g.displayName=s(O,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,O):(t.__proto__=O,s(t,u,"GeneratorFunction")),t.prototype=Object.create(P),t},e.awrap=function(t){return{__await:t}},_(S.prototype),s(S.prototype,c,(function(){return this})),e.AsyncIterator=S,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new S(p(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},_(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 a(n,a){return c.type="throw",c.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return a("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 a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,y):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),y},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),y}},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 a=n.arg;N(r)}return a}}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),y}},e}function p(t,e,r,n,a,o,i){try{var c=t[o](i),l=c.value}catch(t){return void r(t)}c.done?e(l):Promise.resolve(l).then(n,a)}function m(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var o=t.apply(e,r);function i(t){p(o,n,a,i,c,"next",t)}function c(t){p(o,n,a,i,c,"throw",t)}i(void 0)}))}}e.a=function(t,e){var r,n,l,p,b=arguments.length>2&&void 0!==arguments[2]&&arguments[2],h=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",d=Object(i.a)(),y=d.setTemplateData;return{sendTestEmail:(p=m(f().mark((function t(e,r,n,i,c,l){var u,s,p,m,b,h=arguments;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=h.length>6&&void 0!==h[6]&&h[6],s=h.length>7&&void 0!==h[7]?h[7]:{},p=h.length>8&&void 0!==h[8]&&h[8],m=h.length>9&&void 0!==h[9]?h[9]:{},t.prev=4,b={email:e,content:JSON.stringify({subject:r,body:n,type:i,mail_data:c,preheader:l,utmEnabled:u,utmDetails:s,overRideSenderInfo:p,overRideInfo:m})},t.next=8,a()({method:"POST",path:Object(o.A)("/send-test-email"),data:b});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,a,o){return p.apply(this,arguments)}),saveEditorContent:(l=m(f().mark((function r(n){var i,l,p,m,d,v,g,O,w,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")&&(m=l.body,d=void 0===m?"":m,v=l.block,g=v.template,O=void 0===g?"":g,w=s(v,u),""!==O?i.template=l.block.template:""!==d&&(i.template=d),i.data.block=w),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)},h&&(E.lang=h),r.prev=9,r.next=12,a()({method:"POST",path:Object(o.A)("/".concat(b?"transactional-mail":"template","/").concat(t,"/save-email-content")),data:E}).then((function(t){200==t.code&&y(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=m(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,a()({method:"POST",path:Object(o.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=m(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)})}}},1426:function(t,e,r){},1449:function(t,e,r){"use strict";r.r(e);var n=r(0),a=r(2),o=r(1054),i=r(1),c=r(5),l=r(9),u=r.n(l),s=r(349),f=r(8),p=r(12),m=r(204),b=r(70),h=r(26),d=r(123),y=(r(1426),r(11)),v=r(1166),g=r(51),O=r(3);function w(t){return(w="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 j=["getStateProp"];function E(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 P(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?E(Object(r),!0).forEach((function(e){_(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function _(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=w(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=w(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==w(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var S={1:"rich",2:"wc",3:"html",4:"editor",5:"block"},k=function(){var t=Object(g.a)("emailSingleNotif"),e=t.getStateProp,r=function(t,e){if(null==t)return{};var r,n,a=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 o=Object.getOwnPropertySymbols(t);for(n=0;n<o.length;n++)r=o[n],e.includes(r)||{}.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}(t,j),n=Object(O.r)();return P(P({},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(a.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=S[t.mode]),t.hasOwnProperty("subject")&&(e.subject=t.subject),t.hasOwnProperty("updated_at")&&(e.last_updated=t.updated_at),t.hasOwnProperty("data")&&!Object(a.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}})},x=r(50);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 N=["fetch","setStateProp","clearError"];function T(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?T(Object(r),!0).forEach((function(e){I(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function I(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=L(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=L(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==L(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var G=function(){var t=Object(x.a)("emailSingleNotif"),e=t.fetch,r=t.setStateProp,n=t.clearError,a=function(t,e){if(null==t)return{};var r,n,a=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 o=Object.getOwnPropertySymbols(t);for(n=0;n<o.length;n++)r=o[n],e.includes(r)||{}.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}(t,N),o=(0,k().getTemplateData)();return D(D({},a),{},{fetch:function(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";r("isLoading",!0),n(),e("GET",Object(O.A)("/transactional-mail/".concat(t)+(""!==a?"?lang=".concat(a):"")))},setTemplateData:function(t){r("data",t)},setTemplateDataByKey:function(t,e){r("data",D(D({},o),{},I({},t,e)))},setTemplateListData:function(t){r("listData",t)},resetData:function(){r("data",[]),r("listData",[]),r("isLoading",!0)}})};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)}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 F(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){M(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 M(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}function B(){B=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",l=o.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 o=e&&e.prototype instanceof d?e:d,i=Object.create(o.prototype),c=new L(n||[]);return a(i,"_invoke",{value:_(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",b="completed",h={};function d(){}function y(){}function v(){}var g={};u(g,i,(function(){return this}));var O=Object.getPrototypeOf,w=O&&O(O(N([])));w&&w!==r&&n.call(w,i)&&(g=w);var j=v.prototype=d.prototype=Object.create(g);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(a,o,i,c){var l=f(t[a],t,o);if("throw"!==l.type){var u=l.arg,s=u.value;return s&&"object"==A(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 o;a(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,a){r(t,n,e,a)}))}return o=o?o.then(a,a):a()}})}function _(e,r,n){var a=p;return function(o,i){if(a===m)throw Error("Generator is already running");if(a===b){if("throw"===o)throw i;return{value:t,done:!0}}for(n.method=o,n.arg=i;;){var c=n.delegate;if(c){var l=S(c,n);if(l){if(l===h)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===p)throw a=b,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=m;var u=f(e,r,n);if("normal"===u.type){if(a=n.done?b:"suspendedYield",u.arg===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(a=b,n.method="throw",n.arg=u.arg)}}}function S(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,S(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var o=f(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,h;var i=o.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,h):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)}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 x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,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 a=-1,o=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(A(e)+" is not iterable")}return y.prototype=v,a(j,"constructor",{value:v,configurable:!0}),a(v,"constructor",{value:y,configurable:!0}),y.displayName=u(v,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"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,a,o){void 0===o&&(o=Promise);var i=new P(s(t,r,n,a),o);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,L.prototype={constructor:L,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(x),!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 a(n,a){return c.type="throw",c.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return a("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 a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):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),h},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),x(r),h}},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 a=n.arg;x(r)}return a}}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),h}},e}function U(t,e,r,n,a,o,i){try{var c=t[o](i),l=c.value}catch(t){return void r(t)}c.done?e(l):Promise.resolve(l).then(n,a)}function J(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var o=t.apply(e,r);function i(t){U(o,n,a,i,c,"next",t)}function c(t){U(o,n,a,i,c,"throw",t)}i(void 0)}))}}function R(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,a,o,i,c=[],l=!0,u=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==e);l=!0);}catch(t){u=!0,a=t}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw a}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Y(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)?Y(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 Y(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.default=function(){var t=Object(o.f)(),e=t.slug,r=void 0===e?"":e,l=t.language,g=void 0===l?"":l,w=Object(n.useContext)(O.h),j=R(Object(n.useState)([]),2),E=j[0],P=j[1],_=R(Object(n.useState)(!1),2),S=_[0],x=_[1],L=R(Object(n.useState)(!1),2),N=L[0],T=L[1];Object(s.a)(Object(i.__)("Transactional Emails","wp-marketing-automations"),"",0,"transactional");var D=k(),I=D.getTemplateData,A=D.getFormattedTemplateData,C=D.getLoading,M=D.getError,U=I(),Y=C(),H=M(),K=U.recipient,q=void 0===K?"":K,$=U.data,z=void 0===$?{}:$,Q=U.supported_block,V=void 0===Q?[]:Q,W=(Object(a.isObject)(z)?z:{}).other_recipients,X=void 0===W?"":W,Z=G(),tt=Z.setTemplateData,et=Z.resetData,rt=Z.fetch,nt=Z.setTemplateDataByKey;Object(n.useEffect)((function(){return""!==r&&rt(r,g),function(){et()}}),[]);var at,ot,it,ct,lt=function(){var t=J(B().mark((function t(){var e,n=arguments;return B().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=n.length>0&&void 0!==n[0]&&n[0],T(!0),t.prev=2,t.next=5,u()({path:Object(O.A)("/transactional-mail/".concat(r,"/status")),method:"POST",data:{status:e}}).then((function(t){if(200!==t.code)throw Error(Object(O.u)(null==t?void 0:t.message));w(t.message),nt("status",e),Object(O.Lb)(w,2e3),T(!1)}));case 5:t.next=13;break;case 7:t.prev=7,t.t0=t.catch(2),console.log(t.t0),w(t.t0.message),T(!1),Object(O.Lb)(w,2e3);case 13:case"end":return t.stop()}}),t,null,[[2,7]])})));return function(){return t.apply(this,arguments)}}(),ut=Object(v.a)(r,U,!0,g),st=function(){var t=J(B().mark((function t(){var e,n;return B().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!ft()){t.next=2;break}return t.abrupt("return");case 2:return x(!0),e={content:JSON.stringify(U),lang:g},t.prev=4,t.next=7,u()({path:Object(O.A)("/transactional-mail/".concat(r)),method:"POST",data:e});case 7:200===(n=t.sent).code?(w(n.message),Object(O.Lb)(w,3e3)):(w("".concat(Object(i.__)("Unexpected response","wp-marketing-automations"),": ").concat(n.message)),Object(O.Lb)(w,3e3)),t.next=15;break;case 11:t.prev=11,t.t0=t.catch(4),w("Error: ".concat(t.t0.message)),Object(O.Lb)(w,3e3);case 15:return t.prev=15,x(!1),t.finish(15);case 18:case"end":return t.stop()}}),t,null,[[4,11,15,18]])})));return function(){return t.apply(this,arguments)}}(),ft=function(){var t=[{field:"subject",message:Object(i.__)("Subject is required.","wp-marketing-automations")},{field:"template",message:Object(i.__)("Email content cannot be empty.","wp-marketing-automations")}].reduce((function(t,e){var r=e.field,n=e.message;return Object(a.has)(U,r)&&!Object(a.isEmpty)(U[r])||t.push(n),t}),[]);if(!Object(a.isEmpty)(X)){var e=X.split(","),r=!0;e.forEach((function(t){"{{admin_email}}"===t||Object(O.gc)(t)||(r=!1)})),r||t.push(Object(i.__)("Invalid email address in other recipients.","wp-marketing-automations"))}return P(t),!Object(a.isEmpty)(t)},pt={mergeTagsContext:U.hasOwnProperty("merge_tag")&&!Object(a.isEmpty)(U.merge_tag)?U.merge_tag:"",from_name:U.hasOwnProperty("data")&&!Object(a.isEmpty)(U.data)&&U.data.hasOwnProperty("from_email")?U.data.from_name:Object(O.P)("from_name"),from_email:U.hasOwnProperty("data")&&!Object(a.isEmpty)(U.data)&&U.data.hasOwnProperty("from_email")?U.data.from_email:Object(O.P)("from_email"),reply_to:U.hasOwnProperty("data")&&!Object(a.isEmpty)(U.data)&&U.data.hasOwnProperty("reply_to_email")?U.data.reply_to_email:Object(O.P)("reply_to_email")};return Object(n.createElement)("div",{className:"bwf-edit-notification-template"},(at=U.title,ot=void 0===at?"":at,it=U.status,ct=void 0!==it&&it,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(){var t={page:"autonami",path:"/transactional-emails"};""!==g&&(t.lang=g),Object(p.l)(t,"/",{})}},Object(n.createElement)(f.a,{icon:"arrow-left",width:24,height:24})),Y?Object(n.createElement)("span",{className:"bwf-placeholder-temp bwf-h-30 bwf-w-210"}):Object(n.createElement)("span",{className:"bwf-section-title"},ot||"-"),Object(n.createElement)("span",{className:"bwf-tags bwf-tag-light-blue"},Object(i.__)("Transactional Mail","wp-marketing-automations"))),Object(a.isEmpty)(H)&&Object(n.createElement)("div",{className:"bwf-section-right"},Y?Object(n.createElement)("span",{className:"bwf-placeholder-temp bwf-h-30 bwf-w-120"}):Object(n.createElement)(c.ToggleControl,{label:Object(i.__)("Enable/Disable","wp-marketing-automations"),className:"bwf-tooglecontrol-advance",disabled:S||N,onChange:lt,checked:ct})))),!Y&&!!(!Object(a.isEmpty)(U)&&U.hasOwnProperty("data")&&U.data.hasOwnProperty("block")&&U.data.block.hasOwnProperty("body")&&""!==U.data.block.body&&U.data.block.body.includes("\x3c!-- wp:email-block/coupon"))&&Object(n.createElement)("div",{className:"bwf-mb-24"},Object(n.createElement)(h.a,{status:"info",isDismissible:!1,className:"bwf-m-0"},Object(n.createElement)("strong",null,Object(i.__)("Coupon Usage Notice","wp-marketing-automations"),":")," ",Object(i.__)("A coupon is used in this email template. Please ensure that a valid coupon code is used.","wp-marketing-automations"))),Y||!Object(a.isEmpty)(H)?Object(a.isEmpty)(H)?Object(n.createElement)(d.a,{className:"bwf-template-card bwf-template-placeholder"},Object(n.createElement)("div",{className:"bwf-template-card-header bwf-h4"},Object(i.__)("Transactional Mail","wp-marketing-automations")),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",{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-display-flex bwf-j-end bwf-template-card-actions"},Object(n.createElement)("div",{className:"bwf-h-0"}),Object(n.createElement)("div",{className:"bwf-placeholder-temp bwf-h-30 "}))):Object(n.createElement)(h.a,{status:"error",isDismissible:!1,className:"bwf-m-0 bwf-mb-10"},H.hasOwnProperty("message")?H.message:Object(i.__)("Unable to load template","wp-marketing-automations")):Object(n.createElement)("div",{className:"bwf-template-card"},Object(n.createElement)("div",{className:"bwf_clear_16"}),Object(n.createElement)("div",{className:"bwf-template-card-header bwf-h4"},Object(i.__)("Transactional Mail","wp-marketing-automations")),!Object(a.isEmpty)(E)&&Object(n.createElement)("div",{className:"bwf-template-error"},Object(n.createElement)(b.a,null),Object(n.createElement)(h.a,{status:"error",isDismissible:!1,className:"bwf-m-0"},E.map((function(t,e){return Object(n.createElement)(n.Fragment,{key:"bwf-template-card-error-".concat(e)},t,Object(n.createElement)("br",null))})))),("admin"===q||1===Object(O.n)(bwfcrm_contacts_data.bwf_pro_version,"3.4.0"))&&Object(n.createElement)("div",{className:"bwf-p-24 bwf-pb-0"},Object(n.createElement)(c.TextControl,{placeholder:Object(i.__)("Type Here…","wp-marketing-automations"),label:"admin"===q?Object(i.__)("Recipient(s)","wp-marketing-automations"):Object(i.__)("Other Recipient(s)","wp-marketing-automations"),value:"admin"===q&&""===X?"{{admin_email}}":X,help:Object(i.__)("Use comma separated values to send email to multiple users.","wp-marketing-automations")+" "+("admin"===q?Object(i.__)("Use {{admin_email}} mergetag to send mail to site admin","wp-marketing-automations"):""),type:"email",onChange:function(t){return e=t,r=F({},U),Object(a.set)(r,"data.other_recipients",e),void tt(r);var e,r}})),Object(n.createElement)(m.a,{disableDefaultButtons:!0,initData:F({content:[A(U)]},pt),validateEmailContent:!1,apiMethods:ut,showSenderInfo:!0,showSaveTemplate:!1,showTemplateTypeSelector:!1,returnData:!0,setMailData:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=F({},U),i=t[1],c=function(t,e){Object(a.has)(i,t)&&Object(a.set)(o,e,Object(a.get)(i,t))};c("subject","subject"),c("preheader","data.preheader"),c("utmEnabled","data.utmEnabled"),c("utm","data.utm"),Object(a.set)(o,"data.from_name",e),Object(a.set)(o,"data.from_email",r),Object(a.set)(o,"data.reply_to_email",n);var l=Object(a.get)(i,"block",{});Object(a.isEmpty)(l)||(o.template=l.template||o.template,o.data.block=F(F({},l),{},{template:void 0})),tt(o)},showTab:!1,showTemplateButton:!1,hideBlockTemplate:!0,blockEnabled:Object(a.isEmpty)(V)?["user"]:V,conditionalEnabled:!1,transactionalEnabled:!0,removeTransactionalOpt:!0}),Object(n.createElement)("div",{className:"bwf-display-flex bwf-j-end bwf-template-card-actions"},Object(n.createElement)(y.a,{className:"is-primary",onClick:st,disabled:S||N,isBusy:S},Object(i.__)("Save","wp-marketing-automations")))))}}}]); |