(window.mailpoetJsonp=window.mailpoetJsonp||[]).push([[2,3],{114:function(e,t,a){e.exports=a(143)},143:function(e,t,a){e.exports=a(144)},144:function(e,t,a){a(145);var n=a(26);e.exports=n.Number.isNaN},145:function(e,t,a){a(17)({target:"Number",stat:!0},{isNaN:function(e){return e!=e}})},27:function(e,t,a){
/**!

 @license
 handlebars v4.5.3

Copyright (C) 2011-2017 by Yehuda Katz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

*/
var n;n=function(){return function(e){var t={};function a(n){if(t[n])return t[n].exports;var r=t[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,a),r.loaded=!0,r.exports}return a.m=e,a.c=t,a.p="",a(0)}([function(e,t,a){"use strict";var n=a(1).default;t.__esModule=!0;var r=n(a(2)),i=n(a(40)),s=a(41),o=a(46),l=n(a(49)),c=n(a(44)),u=n(a(39)),p=r.default.create;function d(){var e=p();return e.compile=function(t,a){return o.compile(t,a,e)},e.precompile=function(t,a){return o.precompile(t,a,e)},e.AST=i.default,e.Compiler=o.Compiler,e.JavaScriptCompiler=l.default,e.Parser=s.parser,e.parse=s.parse,e.parseWithoutProcessing=s.parseWithoutProcessing,e}var m=d();m.create=d,u.default(m),m.Visitor=c.default,m.default=m,t.default=m,e.exports=t.default},function(e,t){"use strict";t.default=function(e){return e&&e.__esModule?e:{default:e}},t.__esModule=!0},function(e,t,a){"use strict";var n=a(3).default,r=a(1).default;t.__esModule=!0;var i=n(a(4)),s=r(a(33)),o=r(a(6)),l=n(a(5)),c=n(a(34)),u=r(a(39));function p(){var e=new i.HandlebarsEnvironment;return l.extend(e,i),e.SafeString=s.default,e.Exception=o.default,e.Utils=l,e.escapeExpression=l.escapeExpression,e.VM=c,e.template=function(t){return c.template(t,e)},e}var d=p();d.create=p,u.default(d),d.default=d,t.default=d,e.exports=t.default},function(e,t){"use strict";t.default=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t.default=e,t},t.__esModule=!0},function(e,t,a){"use strict";var n=a(1).default;t.__esModule=!0,t.HandlebarsEnvironment=c;var r=a(5),i=n(a(6)),s=a(10),o=a(30),l=n(a(32));function c(e,t,a){this.helpers=e||{},this.partials=t||{},this.decorators=a||{},s.registerDefaultHelpers(this),o.registerDefaultDecorators(this)}t.VERSION="4.5.3",t.COMPILER_REVISION=8,t.LAST_COMPATIBLE_COMPILER_REVISION=7,t.REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"},c.prototype={constructor:c,logger:l.default,log:l.default.log,registerHelper:function(e,t){if("[object Object]"===r.toString.call(e)){if(t)throw new i.default("Arg not supported with multiple helpers");r.extend(this.helpers,e)}else this.helpers[e]=t},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,t){if("[object Object]"===r.toString.call(e))r.extend(this.partials,e);else{if(void 0===t)throw new i.default('Attempting to register a partial called "'+e+'" as undefined');this.partials[e]=t}},unregisterPartial:function(e){delete this.partials[e]},registerDecorator:function(e,t){if("[object Object]"===r.toString.call(e)){if(t)throw new i.default("Arg not supported with multiple decorators");r.extend(this.decorators,e)}else this.decorators[e]=t},unregisterDecorator:function(e){delete this.decorators[e]}};var u=l.default.log;t.log=u,t.createFrame=r.createFrame,t.logger=l.default},function(e,t){"use strict";t.__esModule=!0,t.extend=s,t.indexOf=function(e,t){for(var a=0,n=e.length;a<n;a++)if(e[a]===t)return a;return-1},t.escapeExpression=function(e){if("string"!=typeof e){if(e&&e.toHTML)return e.toHTML();if(null==e)return"";if(!e)return e+"";e=""+e}return r.test(e)?e.replace(n,i):e},t.isEmpty=function(e){return!e&&0!==e||!(!c(e)||0!==e.length)},t.createFrame=function(e){var t=s({},e);return t._parent=e,t},t.blockParams=function(e,t){return e.path=t,e},t.appendContextPath=function(e,t){return(e?e+".":"")+t};var a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;","=":"&#x3D;"},n=/[&<>"'`=]/g,r=/[&<>"'`=]/;function i(e){return a[e]}function s(e){for(var t=1;t<arguments.length;t++)for(var a in arguments[t])Object.prototype.hasOwnProperty.call(arguments[t],a)&&(e[a]=arguments[t][a]);return e}var o=Object.prototype.toString;t.toString=o;var l=function(e){return"function"==typeof e};l(/x/)&&(t.isFunction=l=function(e){return"function"==typeof e&&"[object Function]"===o.call(e)}),t.isFunction=l;var c=Array.isArray||function(e){return!(!e||"object"!=typeof e)&&"[object Array]"===o.call(e)};t.isArray=c},function(e,t,a){"use strict";var n=a(7).default;t.__esModule=!0;var r=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function i(e,t){var a=t&&t.loc,s=void 0,o=void 0,l=void 0,c=void 0;a&&(s=a.start.line,o=a.end.line,l=a.start.column,c=a.end.column,e+=" - "+s+":"+l);for(var u=Error.prototype.constructor.call(this,e),p=0;p<r.length;p++)this[r[p]]=u[r[p]];Error.captureStackTrace&&Error.captureStackTrace(this,i);try{a&&(this.lineNumber=s,this.endLineNumber=o,n?(Object.defineProperty(this,"column",{value:l,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:c,enumerable:!0})):(this.column=l,this.endColumn=c))}catch(e){}}i.prototype=new Error,t.default=i,e.exports=t.default},function(e,t,a){e.exports={default:a(8),__esModule:!0}},function(e,t,a){var n=a(9);e.exports=function(e,t,a){return n.setDesc(e,t,a)}},function(e,t){var a=Object;e.exports={create:a.create,getProto:a.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:a.getOwnPropertyDescriptor,setDesc:a.defineProperty,setDescs:a.defineProperties,getKeys:a.keys,getNames:a.getOwnPropertyNames,getSymbols:a.getOwnPropertySymbols,each:[].forEach}},function(e,t,a){"use strict";var n=a(1).default;t.__esModule=!0,t.registerDefaultHelpers=function(e){r.default(e),i.default(e),s.default(e),o.default(e),l.default(e),c.default(e),u.default(e)},t.moveHelperToHooks=function(e,t,a){e.helpers[t]&&(e.hooks[t]=e.helpers[t],a||delete e.helpers[t])};var r=n(a(11)),i=n(a(12)),s=n(a(25)),o=n(a(26)),l=n(a(27)),c=n(a(28)),u=n(a(29))},function(e,t,a){"use strict";t.__esModule=!0;var n=a(5);t.default=function(e){e.registerHelper("blockHelperMissing",(function(t,a){var r=a.inverse,i=a.fn;if(!0===t)return i(this);if(!1===t||null==t)return r(this);if(n.isArray(t))return t.length>0?(a.ids&&(a.ids=[a.name]),e.helpers.each(t,a)):r(this);if(a.data&&a.ids){var s=n.createFrame(a.data);s.contextPath=n.appendContextPath(a.data.contextPath,a.name),a={data:s}}return i(t,a)}))},e.exports=t.default},function(e,t,a){(function(n){"use strict";var r=a(13).default,i=a(1).default;t.__esModule=!0;var s=a(5),o=i(a(6));t.default=function(e){e.registerHelper("each",(function(e,t){if(!t)throw new o.default("Must pass iterator to #each");var a,i=t.fn,l=t.inverse,c=0,u="",p=void 0,d=void 0;function m(t,a,n){p&&(p.key=t,p.index=a,p.first=0===a,p.last=!!n,d&&(p.contextPath=d+t)),u+=i(e[t],{data:p,blockParams:s.blockParams([e[t],t],[d+t,null])})}if(t.data&&t.ids&&(d=s.appendContextPath(t.data.contextPath,t.ids[0])+"."),s.isFunction(e)&&(e=e.call(this)),t.data&&(p=s.createFrame(t.data)),e&&"object"==typeof e)if(s.isArray(e))for(var h=e.length;c<h;c++)c in e&&m(c,c,c===e.length-1);else if(n.Symbol&&e[n.Symbol.iterator]){for(var f=[],g=e[n.Symbol.iterator](),v=g.next();!v.done;v=g.next())f.push(v.value);for(h=(e=f).length;c<h;c++)m(c,c,c===e.length-1)}else a=void 0,r(e).forEach((function(e){void 0!==a&&m(a,c-1),a=e,c++})),void 0!==a&&m(a,c-1,!0);return 0===c&&(u=l(this)),u}))},e.exports=t.default}).call(t,function(){return this}())},function(e,t,a){e.exports={default:a(14),__esModule:!0}},function(e,t,a){a(15),e.exports=a(21).Object.keys},function(e,t,a){var n=a(16);a(18)("keys",(function(e){return function(t){return e(n(t))}}))},function(e,t,a){var n=a(17);e.exports=function(e){return Object(n(e))}},function(e,t){e.exports=function(e){if(null==e)throw TypeError("Can't call method on  "+e);return e}},function(e,t,a){var n=a(19),r=a(21),i=a(24);e.exports=function(e,t){var a=(r.Object||{})[e]||Object[e],s={};s[e]=t(a),n(n.S+n.F*i((function(){a(1)})),"Object",s)}},function(e,t,a){var n=a(20),r=a(21),i=a(22),s=function(e,t,a){var o,l,c,u=e&s.F,p=e&s.G,d=e&s.S,m=e&s.P,h=e&s.B,f=e&s.W,g=p?r:r[t]||(r[t]={}),v=p?n:d?n[t]:(n[t]||{}).prototype;for(o in p&&(a=t),a)(l=!u&&v&&o in v)&&o in g||(c=l?v[o]:a[o],g[o]=p&&"function"!=typeof v[o]?a[o]:h&&l?i(c,n):f&&v[o]==c?function(e){var t=function(t){return this instanceof e?new e(t):e(t)};return t.prototype=e.prototype,t}(c):m&&"function"==typeof c?i(Function.call,c):c,m&&((g.prototype||(g.prototype={}))[o]=c))};s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,e.exports=s},function(e,t){var a=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=a)},function(e,t){var a=e.exports={version:"1.2.6"};"number"==typeof __e&&(__e=a)},function(e,t,a){var n=a(23);e.exports=function(e,t,a){if(n(e),void 0===t)return e;switch(a){case 1:return function(a){return e.call(t,a)};case 2:return function(a,n){return e.call(t,a,n)};case 3:return function(a,n,r){return e.call(t,a,n,r)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t,a){"use strict";var n=a(1).default;t.__esModule=!0;var r=n(a(6));t.default=function(e){e.registerHelper("helperMissing",(function(){if(1!==arguments.length)throw new r.default('Missing helper: "'+arguments[arguments.length-1].name+'"')}))},e.exports=t.default},function(e,t,a){"use strict";var n=a(1).default;t.__esModule=!0;var r=a(5),i=n(a(6));t.default=function(e){e.registerHelper("if",(function(e,t){if(2!=arguments.length)throw new i.default("#if requires exactly one argument");return r.isFunction(e)&&(e=e.call(this)),!t.hash.includeZero&&!e||r.isEmpty(e)?t.inverse(this):t.fn(this)})),e.registerHelper("unless",(function(t,a){if(2!=arguments.length)throw new i.default("#unless requires exactly one argument");return e.helpers.if.call(this,t,{fn:a.inverse,inverse:a.fn,hash:a.hash})}))},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0,t.default=function(e){e.registerHelper("log",(function(){for(var t=[void 0],a=arguments[arguments.length-1],n=0;n<arguments.length-1;n++)t.push(arguments[n]);var r=1;null!=a.hash.level?r=a.hash.level:a.data&&null!=a.data.level&&(r=a.data.level),t[0]=r,e.log.apply(e,t)}))},e.exports=t.default},function(e,t){"use strict";t.__esModule=!0;var a=/^(constructor|__defineGetter__|__defineSetter__|__lookupGetter__|__proto__)$/;t.dangerousPropertyRegex=a,t.default=function(e){e.registerHelper("lookup",(function(e,t){return e?!a.test(String(t))||Object.prototype.propertyIsEnumerable.call(e,t)?e[t]:void 0:e}))}},function(e,t,a){"use strict";var n=a(1).default;t.__esModule=!0;var r=a(5),i=n(a(6));t.default=function(e){e.registerHelper("with",(function(e,t){if(2!=arguments.length)throw new i.default("#with requires exactly one argument");r.isFunction(e)&&(e=e.call(this));var a=t.fn;if(r.isEmpty(e))return t.inverse(this);var n=t.data;return t.data&&t.ids&&((n=r.createFrame(t.data)).contextPath=r.appendContextPath(t.data.contextPath,t.ids[0])),a(e,{data:n,blockParams:r.blockParams([e],[n&&n.contextPath])})}))},e.exports=t.default},function(e,t,a){"use strict";var n=a(1).default;t.__esModule=!0,t.registerDefaultDecorators=function(e){r.default(e)};var r=n(a(31))},function(e,t,a){"use strict";t.__esModule=!0;var n=a(5);t.default=function(e){e.registerDecorator("inline",(function(e,t,a,r){var i=e;return t.partials||(t.partials={},i=function(r,i){var s=a.partials;a.partials=n.extend({},s,t.partials);var o=e(r,i);return a.partials=s,o}),t.partials[r.args[0]]=r.fn,i}))},e.exports=t.default},function(e,t,a){"use strict";t.__esModule=!0;var n=a(5),r={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(e){if("string"==typeof e){var t=n.indexOf(r.methodMap,e.toLowerCase());e=t>=0?t:parseInt(e,10)}return e},log:function(e){if(e=r.lookupLevel(e),"undefined"!=typeof console&&r.lookupLevel(r.level)<=e){var t=r.methodMap[e];console[t]||(t="log");for(var a=arguments.length,n=Array(a>1?a-1:0),i=1;i<a;i++)n[i-1]=arguments[i];console[t].apply(console,n)}}};t.default=r,e.exports=t.default},function(e,t){"use strict";function a(e){this.string=e}t.__esModule=!0,a.prototype.toString=a.prototype.toHTML=function(){return""+this.string},t.default=a,e.exports=t.default},function(e,t,a){"use strict";var n=a(35).default,r=a(3).default,i=a(1).default;t.__esModule=!0,t.checkRevision=function(e){var t=e&&e[0]||1,a=l.COMPILER_REVISION;if(!(t>=l.LAST_COMPATIBLE_COMPILER_REVISION&&t<=l.COMPILER_REVISION)){if(t<l.LAST_COMPATIBLE_COMPILER_REVISION){var n=l.REVISION_CHANGES[a],r=l.REVISION_CHANGES[t];throw new o.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+n+") or downgrade your runtime to an older version ("+r+").")}throw new o.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+e[1]+").")}},t.template=function(e,t){if(!t)throw new o.default("No environment passed to template");if(!e||!e.main)throw new o.default("Unknown template object: "+typeof e);e.main.decorator=e.main_d,t.VM.checkRevision(e.compiler);var a=e.compiler&&7===e.compiler[0],r={strict:function(e,t,a){if(!(e&&t in e))throw new o.default('"'+t+'" not defined in '+e,{loc:a});return e[t]},lookup:function(e,t){for(var a=e.length,n=0;n<a;n++)if(e[n]&&null!=e[n][t])return e[n][t]},lambda:function(e,t){return"function"==typeof e?e.call(t):e},escapeExpression:s.escapeExpression,invokePartial:function(a,n,r){r.hash&&(n=s.extend({},n,r.hash),r.ids&&(r.ids[0]=!0)),a=t.VM.resolvePartial.call(this,a,n,r);var i=s.extend({},r,{hooks:this.hooks}),l=t.VM.invokePartial.call(this,a,n,i);if(null==l&&t.compile&&(r.partials[r.name]=t.compile(a,e.compilerOptions,t),l=r.partials[r.name](n,i)),null!=l){if(r.indent){for(var c=l.split("\n"),u=0,p=c.length;u<p&&(c[u]||u+1!==p);u++)c[u]=r.indent+c[u];l=c.join("\n")}return l}throw new o.default("The partial "+r.name+" could not be compiled when running in runtime-only mode")},fn:function(t){var a=e[t];return a.decorator=e[t+"_d"],a},programs:[],program:function(e,t,a,n,r){var i=this.programs[e],s=this.fn(e);return t||r||n||a?i=u(this,e,s,t,a,n,r):i||(i=this.programs[e]=u(this,e,s)),i},data:function(e,t){for(;e&&t--;)e=e._parent;return e},nullContext:n({}),noop:t.VM.noop,compilerInfo:e.compiler};function i(t){var a=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],n=a.data;i._setup(a),!a.partial&&e.useData&&(n=function(e,t){return t&&"root"in t||((t=t?l.createFrame(t):{}).root=e),t}(t,n));var s=void 0,o=e.useBlockParams?[]:void 0;function c(t){return""+e.main(r,t,r.helpers,r.partials,n,o,s)}return e.useDepths&&(s=a.depths?t!=a.depths[0]?[t].concat(a.depths):a.depths:[t]),(c=d(e.main,c,r,a.depths||[],n,o))(t,a)}return i.isTop=!0,i._setup=function(n){if(n.partial)r.helpers=n.helpers,r.partials=n.partials,r.decorators=n.decorators,r.hooks=n.hooks;else{r.helpers=s.extend({},t.helpers,n.helpers),e.usePartial&&(r.partials=s.extend({},t.partials,n.partials)),(e.usePartial||e.useDecorators)&&(r.decorators=s.extend({},t.decorators,n.decorators)),r.hooks={};var i=n.allowCallsToHelperMissing||a;c.moveHelperToHooks(r,"helperMissing",i),c.moveHelperToHooks(r,"blockHelperMissing",i)}},i._child=function(t,a,n,i){if(e.useBlockParams&&!n)throw new o.default("must pass block params");if(e.useDepths&&!i)throw new o.default("must pass parent depths");return u(r,t,e[t],a,0,n,i)},i},t.wrapProgram=u,t.resolvePartial=function(e,t,a){return e?e.call||a.name||(a.name=e,e=a.partials[e]):e="@partial-block"===a.name?a.data["partial-block"]:a.partials[a.name],e},t.invokePartial=function(e,t,a){var n=a.data&&a.data["partial-block"];a.partial=!0,a.ids&&(a.data.contextPath=a.ids[0]||a.data.contextPath);var r=void 0;if(a.fn&&a.fn!==p&&function(){a.data=l.createFrame(a.data);var e=a.fn;r=a.data["partial-block"]=function(t){var a=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return a.data=l.createFrame(a.data),a.data["partial-block"]=n,e(t,a)},e.partials&&(a.partials=s.extend({},a.partials,e.partials))}(),void 0===e&&r&&(e=r),void 0===e)throw new o.default("The partial "+a.name+" could not be found");if(e instanceof Function)return e(t,a)},t.noop=p;var s=r(a(5)),o=i(a(6)),l=a(4),c=a(10);function u(e,t,a,n,r,i,s){function o(t){var r=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],o=s;return!s||t==s[0]||t===e.nullContext&&null===s[0]||(o=[t].concat(s)),a(e,t,e.helpers,e.partials,r.data||n,i&&[r.blockParams].concat(i),o)}return(o=d(a,o,e,s,n,i)).program=t,o.depth=s?s.length:0,o.blockParams=r||0,o}function p(){return""}function d(e,t,a,n,r,i){if(e.decorator){var o={};t=e.decorator(t,o,a,n&&n[0],r,i,n),s.extend(t,o)}return t}},function(e,t,a){e.exports={default:a(36),__esModule:!0}},function(e,t,a){a(37),e.exports=a(21).Object.seal},function(e,t,a){var n=a(38);a(18)("seal",(function(e){return function(t){return e&&n(t)?e(t):t}}))},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t){(function(a){"use strict";t.__esModule=!0,t.default=function(e){var t=void 0!==a?a:window,n=t.Handlebars;e.noConflict=function(){return t.Handlebars===e&&(t.Handlebars=n),e}},e.exports=t.default}).call(t,function(){return this}())},function(e,t){"use strict";t.__esModule=!0;var a={helpers:{helperExpression:function(e){return"SubExpression"===e.type||("MustacheStatement"===e.type||"BlockStatement"===e.type)&&!!(e.params&&e.params.length||e.hash)},scopedId:function(e){return/^\.|this\b/.test(e.original)},simpleId:function(e){return 1===e.parts.length&&!a.helpers.scopedId(e)&&!e.depth}}};t.default=a,e.exports=t.default},function(e,t,a){"use strict";var n=a(1).default,r=a(3).default;t.__esModule=!0,t.parseWithoutProcessing=u,t.parse=function(e,t){var a=u(e,t);return new s.default(t).accept(a)};var i=n(a(42)),s=n(a(43)),o=r(a(45)),l=a(5);t.parser=i.default;var c={};function u(e,t){return"Program"===e.type?e:(i.default.yy=c,c.locInfo=function(e){return new c.SourceLocation(t&&t.srcName,e)},i.default.parse(e))}l.extend(c,o)},function(e,t){"use strict";t.__esModule=!0;var a=function(){var e={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(e,t,a,n,r,i,s){var o=i.length-1;switch(r){case 1:return i[o-1];case 2:this.$=n.prepareProgram(i[o]);break;case 3:case 4:case 5:case 6:case 7:case 8:this.$=i[o];break;case 9:this.$={type:"CommentStatement",value:n.stripComment(i[o]),strip:n.stripFlags(i[o],i[o]),loc:n.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:i[o],value:i[o],loc:n.locInfo(this._$)};break;case 11:this.$=n.prepareRawBlock(i[o-2],i[o-1],i[o],this._$);break;case 12:this.$={path:i[o-3],params:i[o-2],hash:i[o-1]};break;case 13:this.$=n.prepareBlock(i[o-3],i[o-2],i[o-1],i[o],!1,this._$);break;case 14:this.$=n.prepareBlock(i[o-3],i[o-2],i[o-1],i[o],!0,this._$);break;case 15:this.$={open:i[o-5],path:i[o-4],params:i[o-3],hash:i[o-2],blockParams:i[o-1],strip:n.stripFlags(i[o-5],i[o])};break;case 16:case 17:this.$={path:i[o-4],params:i[o-3],hash:i[o-2],blockParams:i[o-1],strip:n.stripFlags(i[o-5],i[o])};break;case 18:this.$={strip:n.stripFlags(i[o-1],i[o-1]),program:i[o]};break;case 19:var l=n.prepareBlock(i[o-2],i[o-1],i[o],i[o],!1,this._$),c=n.prepareProgram([l],i[o-1].loc);c.chained=!0,this.$={strip:i[o-2].strip,program:c,chain:!0};break;case 20:this.$=i[o];break;case 21:this.$={path:i[o-1],strip:n.stripFlags(i[o-2],i[o])};break;case 22:case 23:this.$=n.prepareMustache(i[o-3],i[o-2],i[o-1],i[o-4],n.stripFlags(i[o-4],i[o]),this._$);break;case 24:this.$={type:"PartialStatement",name:i[o-3],params:i[o-2],hash:i[o-1],indent:"",strip:n.stripFlags(i[o-4],i[o]),loc:n.locInfo(this._$)};break;case 25:this.$=n.preparePartialBlock(i[o-2],i[o-1],i[o],this._$);break;case 26:this.$={path:i[o-3],params:i[o-2],hash:i[o-1],strip:n.stripFlags(i[o-4],i[o])};break;case 27:case 28:this.$=i[o];break;case 29:this.$={type:"SubExpression",path:i[o-3],params:i[o-2],hash:i[o-1],loc:n.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:i[o],loc:n.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:n.id(i[o-2]),value:i[o],loc:n.locInfo(this._$)};break;case 32:this.$=n.id(i[o-1]);break;case 33:case 34:this.$=i[o];break;case 35:this.$={type:"StringLiteral",value:i[o],original:i[o],loc:n.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(i[o]),original:Number(i[o]),loc:n.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:"true"===i[o],original:"true"===i[o],loc:n.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:n.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:n.locInfo(this._$)};break;case 40:case 41:this.$=i[o];break;case 42:this.$=n.preparePath(!0,i[o],this._$);break;case 43:this.$=n.preparePath(!1,i[o],this._$);break;case 44:i[o-2].push({part:n.id(i[o]),original:i[o],separator:i[o-1]}),this.$=i[o-2];break;case 45:this.$=[{part:n.id(i[o]),original:i[o]}];break;case 46:this.$=[];break;case 47:i[o-1].push(i[o]);break;case 48:this.$=[];break;case 49:i[o-1].push(i[o]);break;case 50:this.$=[];break;case 51:i[o-1].push(i[o]);break;case 58:this.$=[];break;case 59:i[o-1].push(i[o]);break;case 64:this.$=[];break;case 65:i[o-1].push(i[o]);break;case 70:this.$=[];break;case 71:i[o-1].push(i[o]);break;case 78:this.$=[];break;case 79:i[o-1].push(i[o]);break;case 82:this.$=[];break;case 83:i[o-1].push(i[o]);break;case 86:this.$=[];break;case 87:i[o-1].push(i[o]);break;case 90:this.$=[];break;case 91:i[o-1].push(i[o]);break;case 94:this.$=[];break;case 95:i[o-1].push(i[o]);break;case 98:this.$=[i[o]];break;case 99:i[o-1].push(i[o]);break;case 100:this.$=[i[o]];break;case 101:i[o-1].push(i[o])}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(e,t){throw new Error(e)},parse:function(e){var t=this,a=[0],n=[null],r=[],i=this.table,s="",o=0,l=0,c=0;this.lexer.setInput(e),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,void 0===this.lexer.yylloc&&(this.lexer.yylloc={});var u=this.lexer.yylloc;r.push(u);var p=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var d,m,h,f,g,v,b,_,y,w,E={};;){if(h=a[a.length-1],this.defaultActions[h]?f=this.defaultActions[h]:(null==d&&(w=void 0,"number"!=typeof(w=t.lexer.lex()||1)&&(w=t.symbols_[w]||w),d=w),f=i[h]&&i[h][d]),void 0===f||!f.length||!f[0]){var k="";if(!c){for(v in y=[],i[h])this.terminals_[v]&&v>2&&y.push("'"+this.terminals_[v]+"'");k=this.lexer.showPosition?"Parse error on line "+(o+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+y.join(", ")+", got '"+(this.terminals_[d]||d)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==d?"end of input":"'"+(this.terminals_[d]||d)+"'"),this.parseError(k,{text:this.lexer.match,token:this.terminals_[d]||d,line:this.lexer.yylineno,loc:u,expected:y})}}if(f[0]instanceof Array&&f.length>1)throw new Error("Parse Error: multiple actions possible at state: "+h+", token: "+d);switch(f[0]){case 1:a.push(d),n.push(this.lexer.yytext),r.push(this.lexer.yylloc),a.push(f[1]),d=null,m?(d=m,m=null):(l=this.lexer.yyleng,s=this.lexer.yytext,o=this.lexer.yylineno,u=this.lexer.yylloc,c>0&&c--);break;case 2:if(b=this.productions_[f[1]][1],E.$=n[n.length-b],E._$={first_line:r[r.length-(b||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(b||1)].first_column,last_column:r[r.length-1].last_column},p&&(E._$.range=[r[r.length-(b||1)].range[0],r[r.length-1].range[1]]),void 0!==(g=this.performAction.call(E,s,l,o,this.yy,f[1],n,r)))return g;b&&(a=a.slice(0,-1*b*2),n=n.slice(0,-1*b),r=r.slice(0,-1*b)),a.push(this.productions_[f[1]][0]),n.push(E.$),r.push(E._$),_=i[a[a.length-2]][a[a.length-1]],a.push(_);break;case 3:return!0}}return!0}},t=function(){var e={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e){return this._input=e,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,a=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t-1),this.offset-=t;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===n.length?this.yylloc.first_column:0)+n[n.length-a.length].length-a[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-t]),this},more:function(){return this._more=!0,this},less:function(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done)return this.EOF;var e,t,a,n,r;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),s=0;s<i.length&&(!(a=this._input.match(this.rules[i[s]]))||t&&!(a[0].length>t[0].length)||(t=a,n=s,this.options.flex));s++);return t?((r=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=r.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:r?r[r.length-1].length-r[r.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,i[n],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e||void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return void 0!==e?e:this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(e){this.begin(e)},options:{},performAction:function(e,t,a,n){function r(e,a){return t.yytext=t.yytext.substring(e,t.yyleng-a+e)}switch(a){case 0:if("\\\\"===t.yytext.slice(-2)?(r(0,1),this.begin("mu")):"\\"===t.yytext.slice(-1)?(r(0,1),this.begin("emu")):this.begin("mu"),t.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),"raw"===this.conditionStack[this.conditionStack.length-1]?15:(r(5,9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(t.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return t.yytext=r(1,2).replace(/\\"/g,'"'),80;case 32:return t.yytext=r(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return t.yytext=t.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},rules:[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^\/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],conditions:{mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}}};return e}();function a(){this.yy={}}return e.lexer=t,a.prototype=e,e.Parser=a,new a}();t.default=a,e.exports=t.default},function(e,t,a){"use strict";var n=a(1).default;t.__esModule=!0;var r=n(a(44));function i(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.options=e}function s(e,t,a){void 0===t&&(t=e.length);var n=e[t-1],r=e[t-2];return n?"ContentStatement"===n.type?(r||!a?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(n.original):void 0:a}function o(e,t,a){void 0===t&&(t=-1);var n=e[t+1],r=e[t+2];return n?"ContentStatement"===n.type?(r||!a?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(n.original):void 0:a}function l(e,t,a){var n=e[null==t?0:t+1];if(n&&"ContentStatement"===n.type&&(a||!n.rightStripped)){var r=n.value;n.value=n.value.replace(a?/^\s+/:/^[ \t]*\r?\n?/,""),n.rightStripped=n.value!==r}}function c(e,t,a){var n=e[null==t?e.length-1:t-1];if(n&&"ContentStatement"===n.type&&(a||!n.leftStripped)){var r=n.value;return n.value=n.value.replace(a?/\s+$/:/[ \t]+$/,""),n.leftStripped=n.value!==r,n.leftStripped}}i.prototype=new r.default,i.prototype.Program=function(e){var t=!this.options.ignoreStandalone,a=!this.isRootSeen;this.isRootSeen=!0;for(var n=e.body,r=0,i=n.length;r<i;r++){var u=n[r],p=this.accept(u);if(p){var d=s(n,r,a),m=o(n,r,a),h=p.openStandalone&&d,f=p.closeStandalone&&m,g=p.inlineStandalone&&d&&m;p.close&&l(n,r,!0),p.open&&c(n,r,!0),t&&g&&(l(n,r),c(n,r)&&"PartialStatement"===u.type&&(u.indent=/([ \t]+$)/.exec(n[r-1].original)[1])),t&&h&&(l((u.program||u.inverse).body),c(n,r)),t&&f&&(l(n,r),c((u.inverse||u.program).body))}}return e},i.prototype.BlockStatement=i.prototype.DecoratorBlock=i.prototype.PartialBlockStatement=function(e){this.accept(e.program),this.accept(e.inverse);var t=e.program||e.inverse,a=e.program&&e.inverse,n=a,r=a;if(a&&a.chained)for(n=a.body[0].program;r.chained;)r=r.body[r.body.length-1].program;var i={open:e.openStrip.open,close:e.closeStrip.close,openStandalone:o(t.body),closeStandalone:s((n||t).body)};if(e.openStrip.close&&l(t.body,null,!0),a){var u=e.inverseStrip;u.open&&c(t.body,null,!0),u.close&&l(n.body,null,!0),e.closeStrip.open&&c(r.body,null,!0),!this.options.ignoreStandalone&&s(t.body)&&o(n.body)&&(c(t.body),l(n.body))}else e.closeStrip.open&&c(t.body,null,!0);return i},i.prototype.Decorator=i.prototype.MustacheStatement=function(e){return e.strip},i.prototype.PartialStatement=i.prototype.CommentStatement=function(e){var t=e.strip||{};return{inlineStandalone:!0,open:t.open,close:t.close}},t.default=i,e.exports=t.default},function(e,t,a){"use strict";var n=a(1).default;t.__esModule=!0;var r=n(a(6));function i(){this.parents=[]}function s(e){this.acceptRequired(e,"path"),this.acceptArray(e.params),this.acceptKey(e,"hash")}function o(e){s.call(this,e),this.acceptKey(e,"program"),this.acceptKey(e,"inverse")}function l(e){this.acceptRequired(e,"name"),this.acceptArray(e.params),this.acceptKey(e,"hash")}i.prototype={constructor:i,mutating:!1,acceptKey:function(e,t){var a=this.accept(e[t]);if(this.mutating){if(a&&!i.prototype[a.type])throw new r.default('Unexpected node type "'+a.type+'" found when accepting '+t+" on "+e.type);e[t]=a}},acceptRequired:function(e,t){if(this.acceptKey(e,t),!e[t])throw new r.default(e.type+" requires "+t)},acceptArray:function(e){for(var t=0,a=e.length;t<a;t++)this.acceptKey(e,t),e[t]||(e.splice(t,1),t--,a--)},accept:function(e){if(e){if(!this[e.type])throw new r.default("Unknown type: "+e.type,e);this.current&&this.parents.unshift(this.current),this.current=e;var t=this[e.type](e);return this.current=this.parents.shift(),!this.mutating||t?t:!1!==t?e:void 0}},Program:function(e){this.acceptArray(e.body)},MustacheStatement:s,Decorator:s,BlockStatement:o,DecoratorBlock:o,PartialStatement:l,PartialBlockStatement:function(e){l.call(this,e),this.acceptKey(e,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:s,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(e){this.acceptArray(e.pairs)},HashPair:function(e){this.acceptRequired(e,"value")}},t.default=i,e.exports=t.default},function(e,t,a){"use strict";var n=a(1).default;t.__esModule=!0,t.SourceLocation=function(e,t){this.source=e,this.start={line:t.first_line,column:t.first_column},this.end={line:t.last_line,column:t.last_column}},t.id=function(e){return/^\[.*\]$/.test(e)?e.substring(1,e.length-1):e},t.stripFlags=function(e,t){return{open:"~"===e.charAt(2),close:"~"===t.charAt(t.length-3)}},t.stripComment=function(e){return e.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")},t.preparePath=function(e,t,a){a=this.locInfo(a);for(var n=e?"@":"",i=[],s=0,o=0,l=t.length;o<l;o++){var c=t[o].part,u=t[o].original!==c;if(n+=(t[o].separator||"")+c,u||".."!==c&&"."!==c&&"this"!==c)i.push(c);else{if(i.length>0)throw new r.default("Invalid path: "+n,{loc:a});".."===c&&s++}}return{type:"PathExpression",data:e,depth:s,parts:i,original:n,loc:a}},t.prepareMustache=function(e,t,a,n,r,i){var s=n.charAt(3)||n.charAt(2),o="{"!==s&&"&"!==s;return{type:/\*/.test(n)?"Decorator":"MustacheStatement",path:e,params:t,hash:a,escaped:o,strip:r,loc:this.locInfo(i)}},t.prepareRawBlock=function(e,t,a,n){i(e,a),n=this.locInfo(n);var r={type:"Program",body:t,strip:{},loc:n};return{type:"BlockStatement",path:e.path,params:e.params,hash:e.hash,program:r,openStrip:{},inverseStrip:{},closeStrip:{},loc:n}},t.prepareBlock=function(e,t,a,n,s,o){n&&n.path&&i(e,n);var l=/\*/.test(e.open);t.blockParams=e.blockParams;var c=void 0,u=void 0;if(a){if(l)throw new r.default("Unexpected inverse block on decorator",a);a.chain&&(a.program.body[0].closeStrip=n.strip),u=a.strip,c=a.program}return s&&(s=c,c=t,t=s),{type:l?"DecoratorBlock":"BlockStatement",path:e.path,params:e.params,hash:e.hash,program:t,inverse:c,openStrip:e.strip,inverseStrip:u,closeStrip:n&&n.strip,loc:this.locInfo(o)}},t.prepareProgram=function(e,t){if(!t&&e.length){var a=e[0].loc,n=e[e.length-1].loc;a&&n&&(t={source:a.source,start:{line:a.start.line,column:a.start.column},end:{line:n.end.line,column:n.end.column}})}return{type:"Program",body:e,strip:{},loc:t}},t.preparePartialBlock=function(e,t,a,n){return i(e,a),{type:"PartialBlockStatement",name:e.path,params:e.params,hash:e.hash,program:t,openStrip:e.strip,closeStrip:a&&a.strip,loc:this.locInfo(n)}};var r=n(a(6));function i(e,t){if(t=t.path?t.path.original:t,e.path.original!==t){var a={loc:e.path.loc};throw new r.default(e.path.original+" doesn't match "+t,a)}}},function(e,t,a){"use strict";var n=a(47).default,r=a(1).default;t.__esModule=!0,t.Compiler=c,t.precompile=function(e,t,a){if(null==e||"string"!=typeof e&&"Program"!==e.type)throw new i.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+e);"data"in(t=t||{})||(t.data=!0),t.compat&&(t.useDepths=!0);var n=a.parse(e,t),r=(new a.Compiler).compile(n,t);return(new a.JavaScriptCompiler).compile(r,t)},t.compile=function(e,t,a){if(void 0===t&&(t={}),null==e||"string"!=typeof e&&"Program"!==e.type)throw new i.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+e);"data"in(t=s.extend({},t))||(t.data=!0),t.compat&&(t.useDepths=!0);var n=void 0;function r(){var n=a.parse(e,t),r=(new a.Compiler).compile(n,t),i=(new a.JavaScriptCompiler).compile(r,t,void 0,!0);return a.template(i)}function o(e,t){return n||(n=r()),n.call(this,e,t)}return o._setup=function(e){return n||(n=r()),n._setup(e)},o._child=function(e,t,a,i){return n||(n=r()),n._child(e,t,a,i)},o};var i=r(a(6)),s=a(5),o=r(a(40)),l=[].slice;function c(){}function u(e,t){if(e===t)return!0;if(s.isArray(e)&&s.isArray(t)&&e.length===t.length){for(var a=0;a<e.length;a++)if(!u(e[a],t[a]))return!1;return!0}}function p(e){if(!e.path.parts){var t=e.path;e.path={type:"PathExpression",data:!1,depth:0,parts:[t.original+""],original:t.original+"",loc:t.loc}}}c.prototype={compiler:c,equals:function(e){var t=this.opcodes.length;if(e.opcodes.length!==t)return!1;for(var a=0;a<t;a++){var n=this.opcodes[a],r=e.opcodes[a];if(n.opcode!==r.opcode||!u(n.args,r.args))return!1}for(t=this.children.length,a=0;a<t;a++)if(!this.children[a].equals(e.children[a]))return!1;return!0},guid:0,compile:function(e,t){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=t,this.stringParams=t.stringParams,this.trackIds=t.trackIds,t.blockParams=t.blockParams||[],t.knownHelpers=s.extend(n(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},t.knownHelpers),this.accept(e)},compileProgram:function(e){var t=(new this.compiler).compile(e,this.options),a=this.guid++;return this.usePartial=this.usePartial||t.usePartial,this.children[a]=t,this.useDepths=this.useDepths||t.useDepths,a},accept:function(e){if(!this[e.type])throw new i.default("Unknown type: "+e.type,e);this.sourceNode.unshift(e);var t=this[e.type](e);return this.sourceNode.shift(),t},Program:function(e){this.options.blockParams.unshift(e.blockParams);for(var t=e.body,a=t.length,n=0;n<a;n++)this.accept(t[n]);return this.options.blockParams.shift(),this.isSimple=1===a,this.blockParams=e.blockParams?e.blockParams.length:0,this},BlockStatement:function(e){p(e);var t=e.program,a=e.inverse;t=t&&this.compileProgram(t),a=a&&this.compileProgram(a);var n=this.classifySexpr(e);"helper"===n?this.helperSexpr(e,t,a):"simple"===n?(this.simpleSexpr(e),this.opcode("pushProgram",t),this.opcode("pushProgram",a),this.opcode("emptyHash"),this.opcode("blockValue",e.path.original)):(this.ambiguousSexpr(e,t,a),this.opcode("pushProgram",t),this.opcode("pushProgram",a),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(e){var t=e.program&&this.compileProgram(e.program),a=this.setupFullMustacheParams(e,t,void 0),n=e.path;this.useDecorators=!0,this.opcode("registerDecorator",a.length,n.original)},PartialStatement:function(e){this.usePartial=!0;var t=e.program;t&&(t=this.compileProgram(e.program));var a=e.params;if(a.length>1)throw new i.default("Unsupported number of partial arguments: "+a.length,e);a.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):a.push({type:"PathExpression",parts:[],depth:0}));var n=e.name.original,r="SubExpression"===e.name.type;r&&this.accept(e.name),this.setupFullMustacheParams(e,t,void 0,!0);var s=e.indent||"";this.options.preventIndent&&s&&(this.opcode("appendContent",s),s=""),this.opcode("invokePartial",r,n,s),this.opcode("append")},PartialBlockStatement:function(e){this.PartialStatement(e)},MustacheStatement:function(e){this.SubExpression(e),e.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(e){this.DecoratorBlock(e)},ContentStatement:function(e){e.value&&this.opcode("appendContent",e.value)},CommentStatement:function(){},SubExpression:function(e){p(e);var t=this.classifySexpr(e);"simple"===t?this.simpleSexpr(e):"helper"===t?this.helperSexpr(e):this.ambiguousSexpr(e)},ambiguousSexpr:function(e,t,a){var n=e.path,r=n.parts[0],i=null!=t||null!=a;this.opcode("getContext",n.depth),this.opcode("pushProgram",t),this.opcode("pushProgram",a),n.strict=!0,this.accept(n),this.opcode("invokeAmbiguous",r,i)},simpleSexpr:function(e){var t=e.path;t.strict=!0,this.accept(t),this.opcode("resolvePossibleLambda")},helperSexpr:function(e,t,a){var n=this.setupFullMustacheParams(e,t,a),r=e.path,s=r.parts[0];if(this.options.knownHelpers[s])this.opcode("invokeKnownHelper",n.length,s);else{if(this.options.knownHelpersOnly)throw new i.default("You specified knownHelpersOnly, but used the unknown helper "+s,e);r.strict=!0,r.falsy=!0,this.accept(r),this.opcode("invokeHelper",n.length,r.original,o.default.helpers.simpleId(r))}},PathExpression:function(e){this.addDepth(e.depth),this.opcode("getContext",e.depth);var t=e.parts[0],a=o.default.helpers.scopedId(e),n=!e.depth&&!a&&this.blockParamIndex(t);n?this.opcode("lookupBlockParam",n,e.parts):t?e.data?(this.options.data=!0,this.opcode("lookupData",e.depth,e.parts,e.strict)):this.opcode("lookupOnContext",e.parts,e.falsy,e.strict,a):this.opcode("pushContext")},StringLiteral:function(e){this.opcode("pushString",e.value)},NumberLiteral:function(e){this.opcode("pushLiteral",e.value)},BooleanLiteral:function(e){this.opcode("pushLiteral",e.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(e){var t=e.pairs,a=0,n=t.length;for(this.opcode("pushHash");a<n;a++)this.pushParam(t[a].value);for(;a--;)this.opcode("assignToHash",t[a].key);this.opcode("popHash")},opcode:function(e){this.opcodes.push({opcode:e,args:l.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(e){e&&(this.useDepths=!0)},classifySexpr:function(e){var t=o.default.helpers.simpleId(e.path),a=t&&!!this.blockParamIndex(e.path.parts[0]),n=!a&&o.default.helpers.helperExpression(e),r=!a&&(n||t);if(r&&!n){var i=e.path.parts[0],s=this.options;s.knownHelpers[i]?n=!0:s.knownHelpersOnly&&(r=!1)}return n?"helper":r?"ambiguous":"simple"},pushParams:function(e){for(var t=0,a=e.length;t<a;t++)this.pushParam(e[t])},pushParam:function(e){var t=null!=e.value?e.value:e.original||"";if(this.stringParams)t.replace&&(t=t.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),e.depth&&this.addDepth(e.depth),this.opcode("getContext",e.depth||0),this.opcode("pushStringParam",t,e.type),"SubExpression"===e.type&&this.accept(e);else{if(this.trackIds){var a=void 0;if(!e.parts||o.default.helpers.scopedId(e)||e.depth||(a=this.blockParamIndex(e.parts[0])),a){var n=e.parts.slice(1).join(".");this.opcode("pushId","BlockParam",a,n)}else(t=e.original||t).replace&&(t=t.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",e.type,t)}this.accept(e)}},setupFullMustacheParams:function(e,t,a,n){var r=e.params;return this.pushParams(r),this.opcode("pushProgram",t),this.opcode("pushProgram",a),e.hash?this.accept(e.hash):this.opcode("emptyHash",n),r},blockParamIndex:function(e){for(var t=0,a=this.options.blockParams.length;t<a;t++){var n=this.options.blockParams[t],r=n&&s.indexOf(n,e);if(n&&r>=0)return[t,r]}}}},function(e,t,a){e.exports={default:a(48),__esModule:!0}},function(e,t,a){var n=a(9);e.exports=function(e,t){return n.create(e,t)}},function(e,t,a){"use strict";var n=a(13).default,r=a(1).default;t.__esModule=!0;var i=a(4),s=r(a(6)),o=a(5),l=r(a(50)),c=a(28);function u(e){this.value=e}function p(){}p.prototype={nameLookup:function(e,t){return c.dangerousPropertyRegex.test(t)?["(",[this.aliasable("container.propertyIsEnumerable"),".call(",e,",",JSON.stringify(t),")"],"?",a()," : undefined)"]:a();function a(){return p.isValidJavaScriptVariableName(t)?[e,".",t]:[e,"[",JSON.stringify(t),"]"]}},depthedLookup:function(e){return[this.aliasable("container.lookup"),'(depths, "',e,'")']},compilerInfo:function(){var e=i.COMPILER_REVISION;return[e,i.REVISION_CHANGES[e]]},appendToBuffer:function(e,t,a){return o.isArray(e)||(e=[e]),e=this.source.wrap(e,t),this.environment.isSimple?["return ",e,";"]:a?["buffer += ",e,";"]:(e.appendToBuffer=!0,e)},initializeBuffer:function(){return this.quotedString("")},compile:function(e,t,a,n){this.environment=e,this.options=t,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!n,this.name=this.environment.name,this.isChild=!!a,this.context=a||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(e,t),this.useDepths=this.useDepths||e.useDepths||e.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||e.useBlockParams;var r=e.opcodes,i=void 0,o=void 0,l=void 0,c=void 0;for(l=0,c=r.length;l<c;l++)i=r[l],this.source.currentLocation=i.loc,o=o||i.loc,this[i.opcode].apply(this,i.args);if(this.source.currentLocation=o,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new s.default("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend("var decorators = container.decorators;\n"),this.decorators.push("return fn;"),n?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend("function(fn, props, container, depth0, data, blockParams, depths) {\n"),this.decorators.push("}\n"),this.decorators=this.decorators.merge()));var u=this.createFunctionContext(n);if(this.isChild)return u;var p={compiler:this.compilerInfo(),main:u};this.decorators&&(p.main_d=this.decorators,p.useDecorators=!0);var d=this.context,m=d.programs,h=d.decorators;for(l=0,c=m.length;l<c;l++)m[l]&&(p[l]=m[l],h[l]&&(p[l+"_d"]=h[l],p.useDecorators=!0));return this.environment.usePartial&&(p.usePartial=!0),this.options.data&&(p.useData=!0),this.useDepths&&(p.useDepths=!0),this.useBlockParams&&(p.useBlockParams=!0),this.options.compat&&(p.compat=!0),n?p.compilerOptions=this.options:(p.compiler=JSON.stringify(p.compiler),this.source.currentLocation={start:{line:1,column:0}},p=this.objectLiteral(p),t.srcName?(p=p.toStringWithSourceMap({file:t.destName})).map=p.map&&p.map.toString():p=p.toString()),p},preamble:function(){this.lastContext=0,this.source=new l.default(this.options.srcName),this.decorators=new l.default(this.options.srcName)},createFunctionContext:function(e){var t=this,a="",r=this.stackVars.concat(this.registers.list);r.length>0&&(a+=", "+r.join(", "));var i=0;n(this.aliases).forEach((function(e){var n=t.aliases[e];n.children&&n.referenceCount>1&&(a+=", alias"+ ++i+"="+e,n.children[0]="alias"+i)}));var s=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&s.push("blockParams"),this.useDepths&&s.push("depths");var o=this.mergeSource(a);return e?(s.push(o),Function.apply(this,s)):this.source.wrap(["function(",s.join(","),") {\n  ",o,"}"])},mergeSource:function(e){var t=this.environment.isSimple,a=!this.forceBuffer,n=void 0,r=void 0,i=void 0,s=void 0;return this.source.each((function(e){e.appendToBuffer?(i?e.prepend("  + "):i=e,s=e):(i&&(r?i.prepend("buffer += "):n=!0,s.add(";"),i=s=void 0),r=!0,t||(a=!1))})),a?i?(i.prepend("return "),s.add(";")):r||this.source.push('return "";'):(e+=", buffer = "+(n?"":this.initializeBuffer()),i?(i.prepend("return buffer + "),s.add(";")):this.source.push("return buffer;")),e&&this.source.prepend("var "+e.substring(2)+(n?"":";\n")),this.source.merge()},blockValue:function(e){var t=this.aliasable("container.hooks.blockHelperMissing"),a=[this.contextName(0)];this.setupHelperArgs(e,0,a);var n=this.popStack();a.splice(1,0,n),this.push(this.source.functionCall(t,"call",a))},ambiguousBlockValue:function(){var e=this.aliasable("container.hooks.blockHelperMissing"),t=[this.contextName(0)];this.setupHelperArgs("",0,t,!0),this.flushInline();var a=this.topStack();t.splice(1,0,a),this.pushSource(["if (!",this.lastHelper,") { ",a," = ",this.source.functionCall(e,"call",t),"}"])},appendContent:function(e){this.pendingContent?e=this.pendingContent+e:this.pendingLocation=this.source.currentLocation,this.pendingContent=e},append:function(){if(this.isInline())this.replaceStack((function(e){return[" != null ? ",e,' : ""']})),this.pushSource(this.appendToBuffer(this.popStack()));else{var e=this.popStack();this.pushSource(["if (",e," != null) { ",this.appendToBuffer(e,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(e){this.lastContext=e},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(e,t,a,n){var r=0;n||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(e[r++])),this.resolvePath("context",e,r,t,a)},lookupBlockParam:function(e,t){this.useBlockParams=!0,this.push(["blockParams[",e[0],"][",e[1],"]"]),this.resolvePath("context",t,1)},lookupData:function(e,t,a){e?this.pushStackLiteral("container.data(data, "+e+")"):this.pushStackLiteral("data"),this.resolvePath("data",t,0,!0,a)},resolvePath:function(e,t,a,n,r){var i=this;if(this.options.strict||this.options.assumeObjects)this.push(function(e,t,a,n){var r=t.popStack(),i=0,s=a.length;for(e&&s--;i<s;i++)r=t.nameLookup(r,a[i],n);return e?[t.aliasable("container.strict"),"(",r,", ",t.quotedString(a[i]),", ",JSON.stringify(t.source.currentLocation)," )"]:r}(this.options.strict&&r,this,t,e));else for(var s=t.length;a<s;a++)this.replaceStack((function(r){var s=i.nameLookup(r,t[a],e);return n?[" && ",s]:[" != null ? ",s," : ",r]}))},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(e,t){this.pushContext(),this.pushString(t),"SubExpression"!==t&&("string"==typeof e?this.pushString(e):this.pushStackLiteral(e))},emptyHash:function(e){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(e?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var e=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(e.ids)),this.stringParams&&(this.push(this.objectLiteral(e.contexts)),this.push(this.objectLiteral(e.types))),this.push(this.objectLiteral(e.values))},pushString:function(e){this.pushStackLiteral(this.quotedString(e))},pushLiteral:function(e){this.pushStackLiteral(e)},pushProgram:function(e){null!=e?this.pushStackLiteral(this.programExpression(e)):this.pushStackLiteral(null)},registerDecorator:function(e,t){var a=this.nameLookup("decorators",t,"decorator"),n=this.setupHelperArgs(t,e);this.decorators.push(["fn = ",this.decorators.functionCall(a,"",["fn","props","container",n])," || fn;"])},invokeHelper:function(e,t,a){var n=this.popStack(),r=this.setupHelper(e,t),i=[];a&&i.push(r.name),i.push(n),this.options.strict||i.push(this.aliasable("container.hooks.helperMissing"));var s=["(",this.itemsSeparatedBy(i,"||"),")"],o=this.source.functionCall(s,"call",r.callParams);this.push(o)},itemsSeparatedBy:function(e,t){var a=[];a.push(e[0]);for(var n=1;n<e.length;n++)a.push(t,e[n]);return a},invokeKnownHelper:function(e,t){var a=this.setupHelper(e,t);this.push(this.source.functionCall(a.name,"call",a.callParams))},invokeAmbiguous:function(e,t){this.useRegister("helper");var a=this.popStack();this.emptyHash();var n=this.setupHelper(0,e,t),r=["(","(helper = ",this.lastHelper=this.nameLookup("helpers",e,"helper")," || ",a,")"];this.options.strict||(r[0]="(helper = ",r.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",r,n.paramsInit?["),(",n.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",n.callParams)," : helper))"])},invokePartial:function(e,t,a){var n=[],r=this.setupParams(t,1,n);e&&(t=this.popStack(),delete r.name),a&&(r.indent=JSON.stringify(a)),r.helpers="helpers",r.partials="partials",r.decorators="container.decorators",e?n.unshift(t):n.unshift(this.nameLookup("partials",t,"partial")),this.options.compat&&(r.depths="depths"),r=this.objectLiteral(r),n.push(r),this.push(this.source.functionCall("container.invokePartial","",n))},assignToHash:function(e){var t=this.popStack(),a=void 0,n=void 0,r=void 0;this.trackIds&&(r=this.popStack()),this.stringParams&&(n=this.popStack(),a=this.popStack());var i=this.hash;a&&(i.contexts[e]=a),n&&(i.types[e]=n),r&&(i.ids[e]=r),i.values[e]=t},pushId:function(e,t,a){"BlockParam"===e?this.pushStackLiteral("blockParams["+t[0]+"].path["+t[1]+"]"+(a?" + "+JSON.stringify("."+a):"")):"PathExpression"===e?this.pushString(t):"SubExpression"===e?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:p,compileChildren:function(e,t){for(var a=e.children,n=void 0,r=void 0,i=0,s=a.length;i<s;i++){n=a[i],r=new this.compiler;var o=this.matchExistingProgram(n);if(null==o){this.context.programs.push("");var l=this.context.programs.length;n.index=l,n.name="program"+l,this.context.programs[l]=r.compile(n,t,this.context,!this.precompile),this.context.decorators[l]=r.decorators,this.context.environments[l]=n,this.useDepths=this.useDepths||r.useDepths,this.useBlockParams=this.useBlockParams||r.useBlockParams,n.useDepths=this.useDepths,n.useBlockParams=this.useBlockParams}else n.index=o.index,n.name="program"+o.index,this.useDepths=this.useDepths||o.useDepths,this.useBlockParams=this.useBlockParams||o.useBlockParams}},matchExistingProgram:function(e){for(var t=0,a=this.context.environments.length;t<a;t++){var n=this.context.environments[t];if(n&&n.equals(e))return n}},programExpression:function(e){var t=this.environment.children[e],a=[t.index,"data",t.blockParams];return(this.useBlockParams||this.useDepths)&&a.push("blockParams"),this.useDepths&&a.push("depths"),"container.program("+a.join(", ")+")"},useRegister:function(e){this.registers[e]||(this.registers[e]=!0,this.registers.list.push(e))},push:function(e){return e instanceof u||(e=this.source.wrap(e)),this.inlineStack.push(e),e},pushStackLiteral:function(e){this.push(new u(e))},pushSource:function(e){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),e&&this.source.push(e)},replaceStack:function(e){var t=["("],a=void 0,n=void 0,r=void 0;if(!this.isInline())throw new s.default("replaceStack on non-inline");var i=this.popStack(!0);if(i instanceof u)t=["(",a=[i.value]],r=!0;else{n=!0;var o=this.incrStack();t=["((",this.push(o)," = ",i,")"],a=this.topStack()}var l=e.call(this,a);r||this.popStack(),n&&this.stackSlot--,this.push(t.concat(l,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var e=this.inlineStack;this.inlineStack=[];for(var t=0,a=e.length;t<a;t++){var n=e[t];if(n instanceof u)this.compileStack.push(n);else{var r=this.incrStack();this.pushSource([r," = ",n,";"]),this.compileStack.push(r)}}},isInline:function(){return this.inlineStack.length},popStack:function(e){var t=this.isInline(),a=(t?this.inlineStack:this.compileStack).pop();if(!e&&a instanceof u)return a.value;if(!t){if(!this.stackSlot)throw new s.default("Invalid stack pop");this.stackSlot--}return a},topStack:function(){var e=this.isInline()?this.inlineStack:this.compileStack,t=e[e.length-1];return t instanceof u?t.value:t},contextName:function(e){return this.useDepths&&e?"depths["+e+"]":"depth"+e},quotedString:function(e){return this.source.quotedString(e)},objectLiteral:function(e){return this.source.objectLiteral(e)},aliasable:function(e){var t=this.aliases[e];return t?(t.referenceCount++,t):((t=this.aliases[e]=this.source.wrap(e)).aliasable=!0,t.referenceCount=1,t)},setupHelper:function(e,t,a){var n=[];return{params:n,paramsInit:this.setupHelperArgs(t,e,n,a),name:this.nameLookup("helpers",t,"helper"),callParams:[this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})")].concat(n)}},setupParams:function(e,t,a){var n={},r=[],i=[],s=[],o=!a,l=void 0;o&&(a=[]),n.name=this.quotedString(e),n.hash=this.popStack(),this.trackIds&&(n.hashIds=this.popStack()),this.stringParams&&(n.hashTypes=this.popStack(),n.hashContexts=this.popStack());var c=this.popStack(),u=this.popStack();(u||c)&&(n.fn=u||"container.noop",n.inverse=c||"container.noop");for(var p=t;p--;)l=this.popStack(),a[p]=l,this.trackIds&&(s[p]=this.popStack()),this.stringParams&&(i[p]=this.popStack(),r[p]=this.popStack());return o&&(n.args=this.source.generateArray(a)),this.trackIds&&(n.ids=this.source.generateArray(s)),this.stringParams&&(n.types=this.source.generateArray(i),n.contexts=this.source.generateArray(r)),this.options.data&&(n.data="data"),this.useBlockParams&&(n.blockParams="blockParams"),n},setupHelperArgs:function(e,t,a,n){var r=this.setupParams(e,t,a);return r.loc=JSON.stringify(this.source.currentLocation),r=this.objectLiteral(r),n?(this.useRegister("options"),a.push("options"),["options=",r]):a?(a.push(r),""):r}},function(){for(var e="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),t=p.RESERVED_WORDS={},a=0,n=e.length;a<n;a++)t[e[a]]=!0}(),p.isValidJavaScriptVariableName=function(e){return!p.RESERVED_WORDS[e]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(e)},t.default=p,e.exports=t.default},function(e,t,a){"use strict";var n=a(13).default;t.__esModule=!0;var r=a(5),i=void 0;function s(e,t,a){if(r.isArray(e)){for(var n=[],i=0,s=e.length;i<s;i++)n.push(t.wrap(e[i],a));return n}return"boolean"==typeof e||"number"==typeof e?e+"":e}function o(e){this.srcFile=e,this.source=[]}i||((i=function(e,t,a,n){this.src="",n&&this.add(n)}).prototype={add:function(e){r.isArray(e)&&(e=e.join("")),this.src+=e},prepend:function(e){r.isArray(e)&&(e=e.join("")),this.src=e+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}}),o.prototype={isEmpty:function(){return!this.source.length},prepend:function(e,t){this.source.unshift(this.wrap(e,t))},push:function(e,t){this.source.push(this.wrap(e,t))},merge:function(){var e=this.empty();return this.each((function(t){e.add(["  ",t,"\n"])})),e},each:function(e){for(var t=0,a=this.source.length;t<a;t++)e(this.source[t])},empty:function(){var e=this.currentLocation||{start:{}};return new i(e.start.line,e.start.column,this.srcFile)},wrap:function(e){var t=arguments.length<=1||void 0===arguments[1]?this.currentLocation||{start:{}}:arguments[1];return e instanceof i?e:(e=s(e,this,t),new i(t.start.line,t.start.column,this.srcFile,e))},functionCall:function(e,t,a){return a=this.generateList(a),this.wrap([e,t?"."+t+"(":"(",a,")"])},quotedString:function(e){return'"'+(e+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(e){var t=this,a=[];n(e).forEach((function(n){var r=s(e[n],t);"undefined"!==r&&a.push([t.quotedString(n),":",r])}));var r=this.generateList(a);return r.prepend("{"),r.add("}"),r},generateList:function(e){for(var t=this.empty(),a=0,n=e.length;a<n;a++)a&&t.add(","),t.add(s(e[a],this));return t},generateArray:function(e){var t=this.generateList(e);return t.prepend("["),t.add("]"),t}},t.default=o,e.exports=t.default}])},e.exports=n()},294:function(e,t,a){"use strict";e.exports=a(573)},317:function(e,t,a){e.exports=a(574)},319:function(e,t,a){e.exports=a(564)},4:function(e,t){e.exports=jQuery},460:function(e,t,a){e.exports=a(625)},472:function(e,t,a){a(563);var n=a(26);e.exports=n.Object.assign},473:function(e,t,a){var n=a(41),r=a(91),i=a(52),s=a(89).f,o=function(e){return function(t){for(var a,o=i(t),l=r(o),c=l.length,u=0,p=[];c>u;)a=l[u++],n&&!s.call(o,a)||p.push(e?[a,o[a]]:o[a]);return p}};e.exports={entries:o(!0),values:o(!1)}},477:function(e,t,a){e.exports=a(589)},480:function(e,t,a){e.exports=a(565)},481:function(e,t){e.exports=function(e){if(!window.satismeter){window.satismeter=function(){var e=[];function t(){e.push(arguments)}return t.q=e,t}();var t=document.createElement("script"),a=document.getElementsByTagName("script")[0].parentNode;t.async=1,t.src="https://app.satismeter.com/satismeter.js",a.appendChild(t)}return window.satismeter(e)}},482:function(e,t,a){var n=a(477),r=a(590),i=a(592);e.exports=function(e,t){if(null==e)return{};var a,s,o=i(e,t);if(r){var l=r(e);for(s=0;s<l.length;s++)a=l[s],n(t).call(t,a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(o[a]=e[a])}return o}},483:function(e,t,a){e.exports=a(595)},485:function(e,t,a){var n;n=function(){var e=JSON.parse('{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I","į":"i","İ":"I","ı":"i","Ķ":"k","ķ":"k","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ũ":"U","ũ":"u","Ū":"u","ū":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","ǈ":"LJ","ǉ":"lj","ǋ":"NJ","ǌ":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","ѝ":"u","џ":"dz","Ґ":"G","ґ":"g","Ғ":"GH","ғ":"gh","Қ":"KH","қ":"kh","Ң":"NG","ң":"ng","Ү":"UE","ү":"ue","Ұ":"U","ұ":"u","Һ":"H","һ":"h","Ә":"AE","ә":"ae","Ө":"OE","ө":"oe","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","Ẁ":"W","ẁ":"w","Ẃ":"W","ẃ":"w","Ẅ":"W","ẅ":"w","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","Ỡ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","ủ":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","ử":"u","Ữ":"U","ữ":"u","Ự":"U","ự":"u","Ỳ":"Y","ỳ":"y","Ỵ":"Y","ỵ":"y","Ỷ":"Y","ỷ":"y","Ỹ":"Y","ỹ":"y","‘":"\'","’":"\'","“":"\\"","”":"\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","₧":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₸":"kazakhstani tenge","₹":"indian rupee","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","﷼":"rial"}'),t=JSON.parse('{"vi":{"Đ":"D","đ":"d"}}');function a(a,n){if("string"!=typeof a)throw new Error("slugify: string argument expected");var r=t[(n="string"==typeof n?{replacement:n}:n||{}).locale]||{},i=a.split("").reduce((function(t,a){return t+(r[a]||e[a]||a).replace(n.remove||/[^\w\s$*_+~.()'"!\-:@]/g,"")}),"").trim().replace(/[-\s]+/g,n.replacement||"-");return n.lower?i.toLowerCase():i}return a.extend=function(t){for(var a in t)e[a]=t[a]},a},e.exports=n(),e.exports.default=n()},486:function(e,t,a){e.exports=a(607)},487:function(e,t,a){
/*!
	Papa Parse
	v4.1.1
	https://github.com/mholt/PapaParse
*/
!function(t){"use strict";function a(e){this._handle=null,this._paused=!1,this._finished=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this._completeResults={data:[],errors:[],meta:{}},function(e){var t=p(e);t.chunkSize=parseInt(t.chunkSize),this._handle=new s(t),this._handle.streamer=this,this._config=t}.call(this,e),this.parseChunk=function(e){var a=this._partialLine+e;this._partialLine="";var n=this._handle.parse(a,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var r=n.meta.cursor;this._finished||(this._partialLine=a.substring(r-this._baseIndex),this._baseIndex=r),n&&n.data&&(this._rowCount+=n.data.length);var i=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(f)t.postMessage({results:n,workerId:_.WORKER_ID,finished:i});else if(m(this._config.chunk)){if(this._config.chunk(n,this._handle),this._paused)return;n=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(n.data),this._completeResults.errors=this._completeResults.errors.concat(n.errors),this._completeResults.meta=n.meta),!i||!m(this._config.complete)||n&&n.meta.aborted||this._config.complete(this._completeResults),i||n&&n.meta.paused||this._nextChunk(),n}},this._sendError=function(e){m(this._config.error)?this._config.error(e):f&&this._config.error&&t.postMessage({workerId:_.WORKER_ID,error:e,finished:!1})}}function n(e){var t;(e=e||{}).chunkSize||(e.chunkSize=_.RemoteChunkSize),a.call(this,e),this._nextChunk=f?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(t=new XMLHttpRequest,f||(t.onload=d(this._chunkLoaded,this),t.onerror=d(this._chunkError,this)),t.open("GET",this._input,!f),this._config.chunkSize){var e=this._start+this._config.chunkSize-1;t.setRequestHeader("Range","bytes="+this._start+"-"+e),t.setRequestHeader("If-None-Match","webkit-no-cache")}try{t.send()}catch(e){this._chunkError(e.message)}f&&0==t.status?this._chunkError():this._start+=this._config.chunkSize}},this._chunkLoaded=function(){if(4==t.readyState){if(t.status<200||t.status>=400)return void this._chunkError();this._finished=!this._config.chunkSize||this._start>function(e){var t=e.getResponseHeader("Content-Range");return parseInt(t.substr(t.lastIndexOf("/")+1))}(t),this.parseChunk(t.responseText)}},this._chunkError=function(e){var a=t.statusText||e;this._sendError(a)}}function r(e){(e=e||{}).chunkSize||(e.chunkSize=_.LocalChunkSize),a.call(this,e);var t,n,r="undefined"!=typeof FileReader;this.stream=function(e){this._input=e,n=e.slice||e.webkitSlice||e.mozSlice,r?((t=new FileReader).onload=d(this._chunkLoaded,this),t.onerror=d(this._chunkError,this)):t=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var e=this._input;if(this._config.chunkSize){var a=Math.min(this._start+this._config.chunkSize,this._input.size);e=n.call(e,this._start,a)}var i=t.readAsText(e,this._config.encoding);r||this._chunkLoaded({target:{result:i}})},this._chunkLoaded=function(e){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(t.error)}}function i(e){var t;e=e||{},a.call(this,e),this.stream=function(e){return e,t=e,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var e=this._config.chunkSize,a=e?t.substr(0,e):t;return t=e?t.substr(e):"",this._finished=!t,this.parseChunk(a)}}}function s(e){function t(){if(v&&l&&(r("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+_.DefaultDelimiter+"'"),l=!1),e.skipEmptyLines)for(var t=0;t<v.data.length;t++)1==v.data[t].length&&""==v.data[t][0]&&v.data.splice(t--,1);return a()&&function(){if(v){for(var e=0;a()&&e<v.data.length;e++)for(var t=0;t<v.data[e].length;t++)g.push(v.data[e][t]);v.data.splice(0,1)}}(),function(){if(!v||!e.header&&!e.dynamicTyping)return v;for(var t=0;t<v.data.length;t++){for(var a={},i=0;i<v.data[t].length;i++){if(e.dynamicTyping){var s=v.data[t][i];v.data[t][i]="true"==s||"TRUE"==s||"false"!=s&&"FALSE"!=s&&n(s)}e.header&&(i>=g.length?(a.__parsed_extra||(a.__parsed_extra=[]),a.__parsed_extra.push(v.data[t][i])):a[g[i]]=v.data[t][i])}e.header&&(v.data[t]=a,i>g.length?r("FieldMismatch","TooManyFields","Too many fields: expected "+g.length+" fields but parsed "+i,t):i<g.length&&r("FieldMismatch","TooFewFields","Too few fields: expected "+g.length+" fields but parsed "+i,t))}return e.header&&v.meta&&(v.meta.fields=g),v}()}function a(){return e.header&&0==g.length}function n(e){return c.test(e)?parseFloat(e):e}function r(e,t,a,n){v.errors.push({type:e,code:t,message:a,row:n})}var i,s,l,c=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i,u=this,d=0,h=!1,f=!1,g=[],v={data:[],errors:[],meta:{}};if(m(e.step)){var b=e.step;e.step=function(n){if(v=n,a())t();else{if(t(),0==v.data.length)return;d+=n.data.length,e.preview&&d>e.preview?s.abort():b(v,u)}}}this.parse=function(a,n,r){if(e.newline||(e.newline=function(e){var t=(e=e.substr(0,1048576)).split("\r");if(1==t.length)return"\n";for(var a=0,n=0;n<t.length;n++)"\n"==t[n][0]&&a++;return a>=t.length/2?"\r\n":"\r"}(a)),l=!1,!e.delimiter){var c=function(t){for(var a,n,r,i=[",","\t","|",";",_.RECORD_SEP,_.UNIT_SEP],s=0;s<i.length;s++){var l=i[s],c=0,u=0;r=void 0;for(var p=new o({delimiter:l,preview:10}).parse(t),d=0;d<p.data.length;d++){var m=p.data[d].length;u+=m,void 0!==r?m>1&&(c+=Math.abs(m-r),r=m):r=m}u/=p.data.length,(void 0===n||n>c)&&u>1.99&&(n=c,a=l)}return e.delimiter=a,{successful:!!a,bestDelimiter:a}}(a);c.successful?e.delimiter=c.bestDelimiter:(l=!0,e.delimiter=_.DefaultDelimiter),v.meta.delimiter=e.delimiter}var u=p(e);return e.preview&&e.header&&u.preview++,i=a,s=new o(u),v=s.parse(i,n,r),t(),h?{meta:{paused:!0}}:v||{meta:{paused:!1}}},this.paused=function(){return h},this.pause=function(){h=!0,s.abort(),i=i.substr(s.getCharIndex())},this.resume=function(){h=!1,u.streamer.parseChunk(i)},this.aborted=function(){return f},this.abort=function(){f=!0,s.abort(),v.meta.aborted=!0,m(e.complete)&&e.complete(v),i=""}}function o(e){var t=(e=e||{}).delimiter,a=e.newline,n=e.comments,r=e.step,i=e.preview,s=e.fastMode;if(("string"!=typeof t||_.BAD_DELIMITERS.indexOf(t)>-1)&&(t=","),n===t)throw"Comment character same as delimiter";!0===n?n="#":("string"!=typeof n||_.BAD_DELIMITERS.indexOf(n)>-1)&&(n=!1),"\n"!=a&&"\r"!=a&&"\r\n"!=a&&(a="\n");var o=0,l=!1;this.parse=function(e,c,u){function p(e){w.push(e),I=o}function d(t){return u?h():(t||(t=e.substr(o)),k.push(t),o=g,p(k),y&&f(),h())}function m(t){o=t,p(k),k=[],x=e.indexOf(a,o)}function h(e){return{data:w,errors:E,meta:{delimiter:t,linebreak:a,aborted:l,truncated:!!e,cursor:I+(c||0)}}}function f(){r(h()),w=[],E=[]}if("string"!=typeof e)throw"Input must be a string";var g=e.length,v=t.length,b=a.length,_=n.length,y="function"==typeof r;o=0;var w=[],E=[],k=[],I=0;if(!e)return h();if(s||!1!==s&&-1===e.indexOf('"')){for(var S=e.split(a),C=0;C<S.length;C++){k=S[C];if(o+=k.length,C!==S.length-1)o+=a.length;else if(u)return h();if(!n||k.substr(0,_)!=n){if(y){if(w=[],p(k.split(t)),f(),l)return h()}else p(k.split(t));if(i&&C>=i)return w=w.slice(0,i),h(!0)}}return h()}for(var N=e.indexOf(t,o),x=e.indexOf(a,o);;)if('"'!=e[o])if(n&&0===k.length&&e.substr(o,_)===n){if(-1==x)return h();o=x+b,x=e.indexOf(a,o),N=e.indexOf(t,o)}else if(-1!==N&&(x>N||-1===x))k.push(e.substring(o,N)),o=N+v,N=e.indexOf(t,o);else{if(-1===x)break;if(k.push(e.substring(o,x)),m(x+b),y&&(f(),l))return h();if(i&&w.length>=i)return h(!0)}else{var T=o;for(o++;;){if(-1===(T=e.indexOf('"',T+1)))return u||E.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:w.length,index:o}),d();if(T===g-1)return d(e.substring(o,T).replace(/""/g,'"'));if('"'!=e[T+1]){if(e[T+1]==t){k.push(e.substring(o,T).replace(/""/g,'"')),o=T+1+v,N=e.indexOf(t,o),x=e.indexOf(a,o);break}if(e.substr(T+1,b)===a){if(k.push(e.substring(o,T).replace(/""/g,'"')),m(T+1+b),N=e.indexOf(t,o),y&&(f(),l))return h();if(i&&w.length>=i)return h(!0);break}}else T++}}return d()},this.abort=function(){l=!0},this.getCharIndex=function(){return o}}function l(e){var t=e.data,a=v[t.workerId],n=!1;if(t.error)a.userError(t.error,t.file);else if(t.results&&t.results.data){var r={abort:function(){n=!0,c(t.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:u,resume:u};if(m(a.userStep)){for(var i=0;i<t.results.data.length&&(a.userStep({data:[t.results.data[i]],errors:t.results.errors,meta:t.results.meta},r),!n);i++);delete t.results}else m(a.userChunk)&&(a.userChunk(t.results,r,t.file),delete t.results)}t.finished&&!n&&c(t.workerId,t.results)}function c(e,t){var a=v[e];m(a.userComplete)&&a.userComplete(t),a.terminate(),delete v[e]}function u(){throw"Not implemented."}function p(e){if("object"!=typeof e)return e;var t=e instanceof Array?[]:{};for(var a in e)t[a]=p(e[a]);return t}function d(e,t){return function(){e.apply(t,arguments)}}function m(e){return"function"==typeof e}var h,f=!t.document&&!!t.postMessage,g=!1,v={},b=0,_={parse:function(e,a){if((a=a||{}).worker&&_.WORKERS_SUPPORTED){var s=function(){if(!_.WORKERS_SUPPORTED)return!1;if(!g&&null===_.SCRIPT_PATH)throw new Error("Script path cannot be determined automatically when Papa Parse is loaded asynchronously. You need to set Papa.SCRIPT_PATH manually.");var e=new t.Worker(_.SCRIPT_PATH||h);return e.onmessage=l,e.id=b++,v[e.id]=e,e}();return s.userStep=a.step,s.userChunk=a.chunk,s.userComplete=a.complete,s.userError=a.error,a.step=m(a.step),a.chunk=m(a.chunk),a.complete=m(a.complete),a.error=m(a.error),delete a.worker,void s.postMessage({input:e,config:a,workerId:s.id})}var o=null;return"string"==typeof e?o=a.download?new n(a):new i(a):(t.File&&e instanceof File||e instanceof Object)&&(o=new r(a)),o.stream(e)},unparse:function(e,t){function a(e){if("object"!=typeof e)return[];var t=[];for(var a in e)t.push(a);return t}function n(e,t){var a="";"string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t));var n=e instanceof Array&&e.length>0,i=!(t[0]instanceof Array);if(n){for(var l=0;l<e.length;l++)l>0&&(a+=s),a+=r(e[l],l);t.length>0&&(a+=o)}for(var c=0;c<t.length;c++){for(var u=n?e.length:t[c].length,p=0;u>p;p++){p>0&&(a+=s);var d=n&&i?e[p]:p;a+=r(t[c][d],p)}c<t.length-1&&(a+=o)}return a}function r(e,t){return null==e?"":(e=e.toString().replace(/"/g,'""'),"boolean"==typeof i&&i||i instanceof Array&&i[t]||function(e,t){for(var a=0;a<t.length;a++)if(e.indexOf(t[a])>-1)return!0;return!1}(e,_.BAD_DELIMITERS)||e.indexOf(s)>-1||" "==e.charAt(0)||" "==e.charAt(e.length-1)?'"'+e+'"':e)}var i=!1,s=",",o="\r\n";if("object"==typeof t&&("string"==typeof t.delimiter&&1==t.delimiter.length&&-1==_.BAD_DELIMITERS.indexOf(t.delimiter)&&(s=t.delimiter),("boolean"==typeof t.quotes||t.quotes instanceof Array)&&(i=t.quotes),"string"==typeof t.newline&&(o=t.newline)),"string"==typeof e&&(e=JSON.parse(e)),e instanceof Array){if(!e.length||e[0]instanceof Array)return n(null,e);if("object"==typeof e[0])return n(a(e[0]),e)}else if("object"==typeof e)return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),e.data instanceof Array&&(e.fields||(e.fields=e.data[0]instanceof Array?e.fields:a(e.data[0])),e.data[0]instanceof Array||"object"==typeof e.data[0]||(e.data=[e.data])),n(e.fields||[],e.data||[]);throw"exception: Unable to serialize unrecognized input"}};if(_.RECORD_SEP=String.fromCharCode(30),_.UNIT_SEP=String.fromCharCode(31),_.BYTE_ORDER_MARK="\ufeff",_.BAD_DELIMITERS=["\r","\n",'"',_.BYTE_ORDER_MARK],_.WORKERS_SUPPORTED=!!t.Worker,_.SCRIPT_PATH=null,_.LocalChunkSize=10485760,_.RemoteChunkSize=5242880,_.DefaultDelimiter=",",_.Parser=o,_.ParserHandle=s,_.NetworkStreamer=n,_.FileStreamer=r,_.StringStreamer=i,e.exports?e.exports=_:m(t.define)&&t.define.amd?t.define((function(){return _})):t.Papa=_,t.jQuery){var y=t.jQuery;y.fn.parse=function(e){function a(){if(0!=i.length){var t=i[0];if(m(e.before)){var a=e.before(t.file,t.inputElem);if("object"==typeof a){if("abort"==a.action)return void function(t,a,n,r){m(e.error)&&e.error({name:t},a,n,r)}("AbortError",t.file,t.inputElem,a.reason);if("skip"==a.action)return void n();"object"==typeof a.config&&(t.instanceConfig=y.extend(t.instanceConfig,a.config))}else if("skip"==a)return void n()}var r=t.instanceConfig.complete;t.instanceConfig.complete=function(e){m(r)&&r(e,t.file,t.inputElem),n()},_.parse(t.file,t.instanceConfig)}else m(e.complete)&&e.complete()}function n(){i.splice(0,1),a()}var r=e.config||{},i=[];return this.each((function(){if(!("INPUT"==y(this).prop("tagName").toUpperCase()&&"file"==y(this).attr("type").toLowerCase()&&t.FileReader)||!this.files||0==this.files.length)return!0;for(var e=0;e<this.files.length;e++)i.push({file:this.files[e],inputElem:this,instanceConfig:y.extend({},r)})})),a(),this}}f?t.onmessage=function(e){var a=e.data;if(void 0===_.WORKER_ID&&a&&(_.WORKER_ID=a.workerId),"string"==typeof a.input)t.postMessage({workerId:_.WORKER_ID,results:_.parse(a.input,a.config),finished:!0});else if(t.File&&a.input instanceof File||a.input instanceof Object){var n=_.parse(a.input,a.config);n&&t.postMessage({workerId:_.WORKER_ID,results:n,finished:!0})}}:_.WORKERS_SUPPORTED&&(h=function(){var e=document.getElementsByTagName("script");return e.length?e[e.length-1].src:""}(),document.body?document.addEventListener("DOMContentLoaded",(function(){g=!0}),!0):g=!0),n.prototype=Object.create(a.prototype),n.prototype.constructor=n,r.prototype=Object.create(a.prototype),r.prototype.constructor=r,i.prototype=Object.create(i.prototype),i.prototype.constructor=i}("undefined"!=typeof window?window:this)},488:function(e,t,a){e.exports=a(615)},489:function(e,t,a){e.exports=a(619)},50:function(e,t,a){var n=a(561);function r(){return e.exports=r=n||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},r.apply(this,arguments)}e.exports=r},561:function(e,t,a){e.exports=a(562)},562:function(e,t,a){e.exports=a(472)},563:function(e,t,a){var n=a(17),r=a(304);n({target:"Object",stat:!0,forced:Object.assign!==r},{assign:r})},564:function(e,t,a){e.exports=a(472)},565:function(e,t,a){e.exports=a(566)},566:function(e,t,a){a(567);var n=a(26);e.exports=n.Object.entries},567:function(e,t,a){var n=a(17),r=a(473).entries;n({target:"Object",stat:!0},{entries:function(e){return r(e)}})},568:function(e,t,a){e.exports=a(569)},569:function(e,t,a){var n=a(570),r=Array.prototype;e.exports=function(e){var t=e.reduce;return e===r||e instanceof Array&&t===r.reduce?n:t}},570:function(e,t,a){a(571);var n=a(43);e.exports=n("Array").reduce},571:function(e,t,a){"use strict";var n=a(17),r=a(572).left;n({target:"Array",proto:!0,forced:a(110)("reduce")},{reduce:function(e){return r(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})},572:function(e,t,a){var n=a(72),r=a(53),i=a(90),s=a(58),o=function(e){return function(t,a,o,l){n(a);var c=r(t),u=i(c),p=s(c.length),d=e?p-1:0,m=e?-1:1;if(o<2)for(;;){if(d in u){l=u[d],d+=m;break}if(d+=m,e?d<0:p<=d)throw TypeError("Reduce of empty array with no initial value")}for(;e?d>=0:p>d;d+=m)d in u&&(l=a(l,u[d],d,c));return l}};e.exports={left:o(!1),right:o(!0)}},573:function(e,t,a){"use strict";
/** @license React v16.12.0
 * react-dom-server.browser.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var n=a(138),r=a(0);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,a=1;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s="function"==typeof Symbol&&Symbol.for,o=s?Symbol.for("react.portal"):60106,l=s?Symbol.for("react.fragment"):60107,c=s?Symbol.for("react.strict_mode"):60108,u=s?Symbol.for("react.profiler"):60114,p=s?Symbol.for("react.provider"):60109,d=s?Symbol.for("react.context"):60110,m=s?Symbol.for("react.concurrent_mode"):60111,h=s?Symbol.for("react.forward_ref"):60112,f=s?Symbol.for("react.suspense"):60113,g=s?Symbol.for("react.suspense_list"):60120,v=s?Symbol.for("react.memo"):60115,b=s?Symbol.for("react.lazy"):60116,_=s?Symbol.for("react.fundamental"):60117,y=s?Symbol.for("react.scope"):60119,w=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case l:return"Fragment";case o:return"Portal";case u:return"Profiler";case c:return"StrictMode";case f:return"Suspense";case g:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case d:return"Context.Consumer";case p:return"Context.Provider";case h:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case v:return E(e.type);case b:if(e=1===e._status?e._result:null)return E(e)}return null}w.hasOwnProperty("ReactCurrentDispatcher")||(w.ReactCurrentDispatcher={current:null}),w.hasOwnProperty("ReactCurrentBatchConfig")||(w.ReactCurrentBatchConfig={suspense:null});var k={};function I(e,t){for(var a=0|e._threadCount;a<=t;a++)e[a]=e._currentValue2,e._threadCount=a+1}for(var S=new Uint16Array(16),C=0;15>C;C++)S[C]=C+1;S[15]=0;var N=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,x=Object.prototype.hasOwnProperty,T={},R={};function P(e){return!!x.call(R,e)||!x.call(T,e)&&(N.test(e)?R[e]=!0:(T[e]=!0,!1))}function O(e,t,a,n,r,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=n,this.attributeNamespace=r,this.mustUseProperty=a,this.propertyName=e,this.type=t,this.sanitizeURL=i}var D={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){D[e]=new O(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];D[t]=new O(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){D[e]=new O(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){D[e]=new O(e,2,!1,e,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){D[e]=new O(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){D[e]=new O(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){D[e]=new O(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){D[e]=new O(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){D[e]=new O(e,5,!1,e.toLowerCase(),null,!1)}));var A=/[\-:]([a-z])/g;function q(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(A,q);D[t]=new O(t,1,!1,e,null,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(A,q);D[t]=new O(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(A,q);D[t]=new O(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)})),["tabIndex","crossOrigin"].forEach((function(e){D[e]=new O(e,1,!1,e.toLowerCase(),null,!1)})),D.xlinkHref=new O("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach((function(e){D[e]=new O(e,1,!1,e.toLowerCase(),null,!0)}));var L=/["'&<>]/;function F(e){if("boolean"==typeof e||"number"==typeof e)return""+e;e=""+e;var t=L.exec(e);if(t){var a,n="",r=0;for(a=t.index;a<e.length;a++){switch(e.charCodeAt(a)){case 34:t="&quot;";break;case 38:t="&amp;";break;case 39:t="&#x27;";break;case 60:t="&lt;";break;case 62:t="&gt;";break;default:continue}r!==a&&(n+=e.substring(r,a)),r=a+1,n+=t}e=r!==a?n+e.substring(r,a):n}return e}function j(e,t){var a,n=D.hasOwnProperty(e)?D[e]:null;return(a="style"!==e)&&(a=null!==n?0===n.type:2<e.length&&("o"===e[0]||"O"===e[0])&&("n"===e[1]||"N"===e[1])),a||function(e,t,a,n){if(null==t||function(e,t,a,n){if(null!==a&&0===a.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!n&&(null!==a?!a.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,a,n))return!0;if(n)return!1;if(null!==a)switch(a.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(e,t,n,!1)?"":null!==n?(e=n.attributeName,3===(a=n.type)||4===a&&!0===t?e+'=""':(n.sanitizeURL&&(t=""+t),e+'="'+F(t)+'"')):P(e)?e+'="'+F(t)+'"':""}var M="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},V=null,B=null,z=null,U=!1,$=!1,W=null,H=0;function K(){if(null===V)throw Error(i(321));return V}function G(){if(0<H)throw Error(i(312));return{memoizedState:null,queue:null,next:null}}function Y(){return null===z?null===B?(U=!1,B=z=G()):(U=!0,z=B):null===z.next?(U=!1,z=z.next=G()):(U=!0,z=z.next),z}function J(e,t,a,n){for(;$;)$=!1,H+=1,z=null,a=e(t,n);return B=V=null,H=0,z=W=null,a}function Q(e,t){return"function"==typeof t?t(e):t}function Z(e,t,a){if(V=K(),z=Y(),U){var n=z.queue;if(t=n.dispatch,null!==W&&void 0!==(a=W.get(n))){W.delete(n),n=z.memoizedState;do{n=e(n,a.action),a=a.next}while(null!==a);return z.memoizedState=n,[n,t]}return[z.memoizedState,t]}return e=e===Q?"function"==typeof t?t():t:void 0!==a?a(t):t,z.memoizedState=e,e=(e=z.queue={last:null,dispatch:null}).dispatch=X.bind(null,V,e),[z.memoizedState,e]}function X(e,t,a){if(!(25>H))throw Error(i(301));if(e===V)if($=!0,e={action:a,next:null},null===W&&(W=new Map),void 0===(a=W.get(t)))W.set(t,e);else{for(t=a;null!==t.next;)t=t.next;t.next=e}}function ee(){}var te=0,ae={readContext:function(e){var t=te;return I(e,t),e[t]},useContext:function(e){K();var t=te;return I(e,t),e[t]},useMemo:function(e,t){if(V=K(),t=void 0===t?null:t,null!==(z=Y())){var a=z.memoizedState;if(null!==a&&null!==t){e:{var n=a[1];if(null===n)n=!1;else{for(var r=0;r<n.length&&r<t.length;r++)if(!M(t[r],n[r])){n=!1;break e}n=!0}}if(n)return a[0]}}return e=e(),z.memoizedState=[e,t],e},useReducer:Z,useRef:function(e){V=K();var t=(z=Y()).memoizedState;return null===t?(e={current:e},z.memoizedState=e):t},useState:function(e){return Z(Q,e)},useLayoutEffect:function(){},useCallback:function(e){return e},useImperativeHandle:ee,useEffect:ee,useDebugValue:ee,useResponder:function(e,t){return{props:t,responder:e}},useDeferredValue:function(e){return K(),e},useTransition:function(){return K(),[function(e){e()},!1]}},ne={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function re(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}var ie={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},se=n({menuitem:!0},ie),oe={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},le=["Webkit","ms","Moz","O"];Object.keys(oe).forEach((function(e){le.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),oe[t]=oe[e]}))}));var ce=/([A-Z])/g,ue=/^ms-/,pe=r.Children.toArray,de=w.ReactCurrentDispatcher,me={listing:!0,pre:!0,textarea:!0},he=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,fe={},ge={};var ve=Object.prototype.hasOwnProperty,be={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null};function _e(e,t){if(void 0===e)throw Error(i(152,E(t)||"Component"))}function ye(e,t,a){function s(r,s){var o=s.prototype&&s.prototype.isReactComponent,l=function(e,t,a,n){if(n&&("object"==typeof(n=e.contextType)&&null!==n))return I(n,a),n[a];if(e=e.contextTypes){for(var r in a={},e)a[r]=t[r];t=a}else t=k;return t}(s,t,a,o),c=[],u=!1,p={isMounted:function(){return!1},enqueueForceUpdate:function(){if(null===c)return null},enqueueReplaceState:function(e,t){u=!0,c=[t]},enqueueSetState:function(e,t){if(null===c)return null;c.push(t)}};if(o){if(o=new s(r.props,l,p),"function"==typeof s.getDerivedStateFromProps){var d=s.getDerivedStateFromProps.call(null,r.props,o.state);null!=d&&(o.state=n({},o.state,d))}}else if(V={},o=s(r.props,l,p),null==(o=J(s,r.props,o,l))||null==o.render)return void _e(e=o,s);if(o.props=r.props,o.context=l,o.updater=p,void 0===(p=o.state)&&(o.state=p=null),"function"==typeof o.UNSAFE_componentWillMount||"function"==typeof o.componentWillMount)if("function"==typeof o.componentWillMount&&"function"!=typeof s.getDerivedStateFromProps&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&"function"!=typeof s.getDerivedStateFromProps&&o.UNSAFE_componentWillMount(),c.length){p=c;var m=u;if(c=null,u=!1,m&&1===p.length)o.state=p[0];else{d=m?p[0]:o.state;var h=!0;for(m=m?1:0;m<p.length;m++){var f=p[m];null!=(f="function"==typeof f?f.call(o,d,r.props,l):f)&&(h?(h=!1,d=n({},d,f)):n(d,f))}o.state=d}}else c=null;if(_e(e=o.render(),s),"function"==typeof o.getChildContext&&"object"==typeof(r=s.childContextTypes)){var g=o.getChildContext();for(var v in g)if(!(v in r))throw Error(i(108,E(s)||"Unknown",v))}g&&(t=n({},t,g))}for(;r.isValidElement(e);){var o=e,l=o.type;if("function"!=typeof l)break;s(o,l)}return{child:e,context:t}}var we=function(){function e(e,t){r.isValidElement(e)?e.type!==l?e=[e]:(e=e.props.children,e=r.isValidElement(e)?[e]:pe(e)):e=pe(e),e={type:null,domNamespace:ne.html,children:e,childIndex:0,context:k,footer:""};var a=S[0];if(0===a){var n=S,s=2*(a=n.length);if(!(65536>=s))throw Error(i(304));var o=new Uint16Array(s);for(o.set(n),(S=o)[0]=a+1,n=a;n<s-1;n++)S[n]=n+1;S[s-1]=0}else S[0]=S[a];this.threadID=a,this.stack=[e],this.exhausted=!1,this.currentSelectValue=null,this.previousWasTextNode=!1,this.makeStaticMarkup=t,this.suspenseDepth=0,this.contextIndex=-1,this.contextStack=[],this.contextValueStack=[]}var t=e.prototype;return t.destroy=function(){if(!this.exhausted){this.exhausted=!0,this.clearProviders();var e=this.threadID;S[e]=S[0],S[0]=e}},t.pushProvider=function(e){var t=++this.contextIndex,a=e.type._context,n=this.threadID;I(a,n);var r=a[n];this.contextStack[t]=a,this.contextValueStack[t]=r,a[n]=e.props.value},t.popProvider=function(){var e=this.contextIndex,t=this.contextStack[e],a=this.contextValueStack[e];this.contextStack[e]=null,this.contextValueStack[e]=null,this.contextIndex--,t[this.threadID]=a},t.clearProviders=function(){for(var e=this.contextIndex;0<=e;e--)this.contextStack[e][this.threadID]=this.contextValueStack[e]},t.read=function(e){if(this.exhausted)return null;var t=te;te=this.threadID;var a=de.current;de.current=ae;try{for(var n=[""],r=!1;n[0].length<e;){if(0===this.stack.length){this.exhausted=!0;var s=this.threadID;S[s]=S[0],S[0]=s;break}var o=this.stack[this.stack.length-1];if(r||o.childIndex>=o.children.length){var l=o.footer;if(""!==l&&(this.previousWasTextNode=!1),this.stack.pop(),"select"===o.type)this.currentSelectValue=null;else if(null!=o.type&&null!=o.type.type&&o.type.type.$$typeof===p)this.popProvider(o.type);else if(o.type===f){this.suspenseDepth--;var c=n.pop();if(r){r=!1;var u=o.fallbackFrame;if(!u)throw Error(i(303));this.stack.push(u),n[this.suspenseDepth]+="\x3c!--$!--\x3e";continue}n[this.suspenseDepth]+=c}n[this.suspenseDepth]+=l}else{var d=o.children[o.childIndex++],m="";try{m+=this.render(d,o.context,o.domNamespace)}catch(e){if(null!=e&&"function"==typeof e.then)throw Error(i(294));throw e}n.length<=this.suspenseDepth&&n.push(""),n[this.suspenseDepth]+=m}}return n[0]}finally{de.current=a,te=t}},t.render=function(e,t,a){if("string"==typeof e||"number"==typeof e)return""===(a=""+e)?"":this.makeStaticMarkup?F(a):this.previousWasTextNode?"\x3c!-- --\x3e"+F(a):(this.previousWasTextNode=!0,F(a));if(e=(t=ye(e,t,this.threadID)).child,t=t.context,null===e||!1===e)return"";if(!r.isValidElement(e)){if(null!=e&&null!=e.$$typeof){if((a=e.$$typeof)===o)throw Error(i(257));throw Error(i(258,a.toString()))}return e=pe(e),this.stack.push({type:null,domNamespace:a,children:e,childIndex:0,context:t,footer:""}),""}var s=e.type;if("string"==typeof s)return this.renderDOM(e,t,a);switch(s){case c:case m:case u:case g:case l:return e=pe(e.props.children),this.stack.push({type:null,domNamespace:a,children:e,childIndex:0,context:t,footer:""}),"";case f:throw Error(i(294))}if("object"==typeof s&&null!==s)switch(s.$$typeof){case h:V={};var w=s.render(e.props,e.ref);return w=J(s.render,e.props,w,e.ref),w=pe(w),this.stack.push({type:null,domNamespace:a,children:w,childIndex:0,context:t,footer:""}),"";case v:return e=[r.createElement(s.type,n({ref:e.ref},e.props))],this.stack.push({type:null,domNamespace:a,children:e,childIndex:0,context:t,footer:""}),"";case p:return a={type:e,domNamespace:a,children:s=pe(e.props.children),childIndex:0,context:t,footer:""},this.pushProvider(e),this.stack.push(a),"";case d:s=e.type,w=e.props;var E=this.threadID;return I(s,E),s=pe(w.children(s[E])),this.stack.push({type:e,domNamespace:a,children:s,childIndex:0,context:t,footer:""}),"";case _:throw Error(i(338));case b:switch(function(e){if(-1===e._status){e._status=0;var t=e._ctor;t=t(),e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}}(s=e.type),s._status){case 1:return e=[r.createElement(s._result,n({ref:e.ref},e.props))],this.stack.push({type:null,domNamespace:a,children:e,childIndex:0,context:t,footer:""}),"";case 2:throw s._result;default:throw Error(i(295))}case y:throw Error(i(343))}throw Error(i(130,null==s?s:typeof s,""))},t.renderDOM=function(e,t,a){var s=e.type.toLowerCase();if(a===ne.html&&re(s),!fe.hasOwnProperty(s)){if(!he.test(s))throw Error(i(65,s));fe[s]=!0}var o=e.props;if("input"===s)o=n({type:void 0},o,{defaultChecked:void 0,defaultValue:void 0,value:null!=o.value?o.value:o.defaultValue,checked:null!=o.checked?o.checked:o.defaultChecked});else if("textarea"===s){var l=o.value;if(null==l){l=o.defaultValue;var c=o.children;if(null!=c){if(null!=l)throw Error(i(92));if(Array.isArray(c)){if(!(1>=c.length))throw Error(i(93));c=c[0]}l=""+c}null==l&&(l="")}o=n({},o,{value:void 0,children:""+l})}else if("select"===s)this.currentSelectValue=null!=o.value?o.value:o.defaultValue,o=n({},o,{value:void 0});else if("option"===s){c=this.currentSelectValue;var u=function(e){if(null==e)return e;var t="";return r.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(o.children);if(null!=c){var p=null!=o.value?o.value+"":u;if(l=!1,Array.isArray(c)){for(var d=0;d<c.length;d++)if(""+c[d]===p){l=!0;break}}else l=""+c===p;o=n({selected:void 0,children:void 0},o,{selected:l,children:u})}}if(l=o){if(se[s]&&(null!=l.children||null!=l.dangerouslySetInnerHTML))throw Error(i(137,s,""));if(null!=l.dangerouslySetInnerHTML){if(null!=l.children)throw Error(i(60));if(!("object"==typeof l.dangerouslySetInnerHTML&&"__html"in l.dangerouslySetInnerHTML))throw Error(i(61))}if(null!=l.style&&"object"!=typeof l.style)throw Error(i(62,""))}for(y in l=o,c=this.makeStaticMarkup,u=1===this.stack.length,p="<"+e.type,l)if(ve.call(l,y)){var m=l[y];if(null!=m){if("style"===y){d=void 0;var h="",f="";for(d in m)if(m.hasOwnProperty(d)){var g=0===d.indexOf("--"),v=m[d];if(null!=v){if(g)var b=d;else if(b=d,ge.hasOwnProperty(b))b=ge[b];else{var _=b.replace(ce,"-$1").toLowerCase().replace(ue,"-ms-");b=ge[b]=_}h+=f+b+":",f=d,h+=g=null==v||"boolean"==typeof v||""===v?"":g||"number"!=typeof v||0===v||oe.hasOwnProperty(f)&&oe[f]?(""+v).trim():v+"px",f=";"}}m=h||null}d=null;e:if(g=s,v=l,-1===g.indexOf("-"))g="string"==typeof v.is;else switch(g){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":g=!1;break e;default:g=!0}g?be.hasOwnProperty(y)||(d=P(d=y)&&null!=m?d+'="'+F(m)+'"':""):d=j(y,m),d&&(p+=" "+d)}}c||u&&(p+=' data-reactroot=""');var y=p;l="",ie.hasOwnProperty(s)?y+="/>":(y+=">",l="</"+e.type+">");e:{if(null!=(c=o.dangerouslySetInnerHTML)){if(null!=c.__html){c=c.__html;break e}}else if("string"==typeof(c=o.children)||"number"==typeof c){c=F(c);break e}c=null}return null!=c?(o=[],me[s]&&"\n"===c.charAt(0)&&(y+="\n"),y+=c):o=pe(o.children),e=e.type,a=null==a||"http://www.w3.org/1999/xhtml"===a?re(e):"http://www.w3.org/2000/svg"===a&&"foreignObject"===e?"http://www.w3.org/1999/xhtml":a,this.stack.push({domNamespace:a,type:s,children:o,childIndex:0,context:t,footer:l}),this.previousWasTextNode=!1,y},e}(),Ee={renderToString:function(e){e=new we(e,!1);try{return e.read(1/0)}finally{e.destroy()}},renderToStaticMarkup:function(e){e=new we(e,!0);try{return e.read(1/0)}finally{e.destroy()}},renderToNodeStream:function(){throw Error(i(207))},renderToStaticNodeStream:function(){throw Error(i(208))},version:"16.12.0"},ke={default:Ee},Ie=ke&&Ee||ke;e.exports=Ie.default||Ie},574:function(e,t,a){e.exports=a(575)},575:function(e,t,a){a(576);var n=a(26);e.exports=n.Date.now},576:function(e,t,a){a(17)({target:"Date",stat:!0},{now:function(){return(new Date).getTime()}})},589:function(e,t,a){e.exports=a(298)},590:function(e,t,a){e.exports=a(591)},591:function(e,t,a){e.exports=a(470)},592:function(e,t,a){var n=a(477),r=a(593);e.exports=function(e,t){if(null==e)return{};var a,i,s={},o=r(e);for(i=0;i<o.length;i++)a=o[i],n(t).call(t,a)>=0||(s[a]=e[a]);return s}},593:function(e,t,a){e.exports=a(594)},594:function(e,t,a){e.exports=a(303)},595:function(e,t,a){e.exports=a(596)},596:function(e,t,a){var n=a(597),r=Array.prototype;e.exports=function(e){var t=e.sort;return e===r||e instanceof Array&&t===r.sort?n:t}},597:function(e,t,a){a(598);var n=a(43);e.exports=n("Array").sort},598:function(e,t,a){"use strict";var n=a(17),r=a(72),i=a(53),s=a(33),o=a(110),l=[].sort,c=[1,2,3],u=s((function(){c.sort(void 0)})),p=s((function(){c.sort(null)})),d=o("sort");n({target:"Array",proto:!0,forced:u||!p||d},{sort:function(e){return void 0===e?l.call(i(this)):l.call(i(this),r(e))}})},60:function(e,t,a){e.exports=a(568)},607:function(e,t,a){e.exports=a(608)},608:function(e,t,a){a(609);var n=a(26);e.exports=n.Number.isFinite},609:function(e,t,a){a(17)({target:"Number",stat:!0},{isFinite:a(610)})},610:function(e,t,a){var n=a(32).isFinite;e.exports=Number.isFinite||function(e){return"number"==typeof e&&n(e)}},615:function(e,t,a){e.exports=a(616)},616:function(e,t,a){var n=a(617),r=Array.prototype;e.exports=function(e){var t=e.slice;return e===r||e instanceof Array&&t===r.slice?n:t}},617:function(e,t,a){a(618);var n=a(43);e.exports=n("Array").slice},618:function(e,t,a){"use strict";var n=a(17),r=a(42),i=a(94),s=a(109),o=a(58),l=a(52),c=a(112),u=a(103),p=a(34)("species"),d=[].slice,m=Math.max;n({target:"Array",proto:!0,forced:!u("slice")},{slice:function(e,t){var a,n,u,h=l(this),f=o(h.length),g=s(e,f),v=s(void 0===t?f:t,f);if(i(h)&&("function"!=typeof(a=h.constructor)||a!==Array&&!i(a.prototype)?r(a)&&null===(a=a[p])&&(a=void 0):a=void 0,a===Array||void 0===a))return d.call(h,g,v);for(n=new(void 0===a?Array:a)(m(v-g,0)),u=0;g<v;g++,u++)g in h&&c(n,u,h[g]);return n.length=u,n}})},619:function(e,t,a){e.exports=a(620)},620:function(e,t,a){var n=a(621),r=Array.prototype;e.exports=function(e){var t=e.fill;return e===r||e instanceof Array&&t===r.fill?n:t}},621:function(e,t,a){a(622);var n=a(43);e.exports=n("Array").fill},622:function(e,t,a){var n=a(17),r=a(623),i=a(111);n({target:"Array",proto:!0},{fill:r}),i("fill")},623:function(e,t,a){"use strict";var n=a(53),r=a(109),i=a(58);e.exports=function(e){for(var t=n(this),a=i(t.length),s=arguments.length,o=r(s>1?arguments[1]:void 0,a),l=s>2?arguments[2]:void 0,c=void 0===l?a:r(l,a);c>o;)t[o++]=e;return t}},624:function(e,t){jQuery.AsyncQueue=function(){var e,t,a,n,r=this,s=[],o=!1;return n=function(){var e=s.shift();e?(e.apply(r,[r]),!1===o&&n()):t&&t.apply(r)},this.onFailure=function(t){e=t},this.onComplete=function(e){t=e},this.add=function(e){return s.push(e),this},this.storeData=function(e){return a=e,this},this.lastCallbackData=function(){return a},this.run=function(){o=!1,n()},this.pause=function(){return o=!0,this},this.failure=function(){if(o=!0,e){var t=[r];for(i=0;i<arguments.length;i++)t.push(arguments[i]);e.apply(r,t)}},this}},625:function(e,t,a){e.exports=a(626)},626:function(e,t,a){a(627);var n=a(26);e.exports=n.Object.values},627:function(e,t,a){var n=a(17),r=a(473).values;n({target:"Object",stat:!0},{values:function(e){return r(e)}})},648:function(e,t,a){"use strict";a.r(t);var n=a(95),r=a.n(n),i=a(96),s=a.n(i),o=a(69),l=a.n(o),c=a(24),u=a.n(c),p=a(70),d=a.n(p),m=a(18),h=a.n(m),f=a(71),g=a.n(f),v=a(28),b=a.n(v),_=a(8),y=a.n(_),w=a(15),E=a.n(w),k=a(61),I=a.n(k),S=a(29),C=a.n(S),N=a(7),x=a.n(N),T=a(0),R=a.n(T),P=a(3),O=a.n(P),D=a(25),A=a.n(D),q=a(1),L=a(9),F=a.n(L),j=a(11),M=a.n(j),V=a(10),B=a.n(V),z=a(12),U=a.n(z),$=a(13),W=a.n($),H=a(6),K=a.n(H),G=a(14),Y=a.n(G),J=a(64),Q=a(2),Z=a.n(Q);function X(e){var t=[{name:"type",label:q.a.I18n.t("selectType")},{name:"events",label:q.a.I18n.t("events")},{name:"conditions",label:q.a.I18n.t("conditions")},{name:"template",label:q.a.I18n.t("template")},{name:"editor",label:q.a.I18n.t("designer")},{name:"send",label:q.a.I18n.t("send")}];return R.a.createElement(J.a,{step:e.step,steps:t})}X.propTypes={step:Z.a.string.isRequired};var ee=X,te=function(e){function t(){return M()(this,t),U()(this,W()(t).apply(this,arguments))}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t=this.props.event,a=t.soon;if(this.props.premium)e=R.a.createElement("a",{href:"?page=mailpoet-premium",target:"_blank"},q.a.I18n.t("premiumFeatureLink"));else if(t.actionButtonLink&&t.actionButtonTitle)e=R.a.createElement("a",{href:t.actionButtonLink,target:"_blank",rel:"noopener noreferrer"},t.actionButtonTitle);else{var n=a?null:O.a.partial(this.props.eventsConfigurator,t.slug);e=R.a.createElement("a",{className:"button button-primary",disabled:a,onClick:n,role:"presentation","data-automation-id":"create_".concat(t.slug),onKeyDown:function(e){var t,a;C()(t=["keydown","keypress"]).call(t,e.type)&&C()(a=["Enter"," "]).call(a,e.key)&&(e.preventDefault(),n())}},t.actionButtonTitle||q.a.I18n.t("setUp"))}return R.a.createElement("li",{"data-type":t.slug},R.a.createElement("div",{className:"mailpoet_thumbnail"},t.thumbnailImage?R.a.createElement("img",{src:t.thumbnailImage,alt:""}):null),R.a.createElement("div",{className:"mailpoet_boxes_content"},R.a.createElement("div",{className:"mailpoet_description"},R.a.createElement("div",{className:"title_and_badge"},R.a.createElement("h3",null,t.title," ",t.soon?"(".concat(q.a.I18n.t("soon"),")"):""),t.badge?R.a.createElement("span",{className:"mailpoet_badge mailpoet_badge_".concat(t.badge.style)},t.badge.text):""),R.a.createElement("p",null,t.description)),R.a.createElement("div",{className:"mailpoet_actions"},e)))}}]),t}(R.a.PureComponent);te.defaultProps={premium:!1},te.propTypes={premium:Z.a.bool,eventsConfigurator:Z.a.func.isRequired,event:Z.a.shape({slug:Z.a.string.isRequired,thumbnailImage:Z.a.string,actionButtonLink:Z.a.string,title:Z.a.string.isRequired,soon:Z.a.bool,badge:Z.a.shape({style:Z.a.string,text:Z.a.string}),description:Z.a.string.isRequired,actionButtonTitle:Z.a.string}).isRequired};var ae=te,ne=a(105),re=function(e){function t(e){var a,n;return M()(this,t),(n=U()(this,W()(t).call(this,e))).email=n.props.email,n.emailEvents=n.email.events,n.eventsConfigurator=F()(a=n.eventsConfigurator).call(a,K()(n)),n}return Y()(t,e),B()(t,[{key:"eventsConfigurator",value:function(e){var t;q.a.trackEvent("Emails > Automatic Type selected",{"MailPoet Free version":window.mailpoet_version,"MailPoet Premium version":window.mailpoet_premium_version,"Email type":e}),this.props.history.push(E()(t="/new/".concat(this.email.slug,"/")).call(t,e,"/conditions"))}},{key:"displayEvents",value:function(){var e=this,t=x()(O.a).call(O.a,this.emailEvents,(function(t,a){return R.a.createElement(ae,{premium:e.email.premium,event:t,key:a,eventsConfigurator:e.eventsConfigurator})}));return R.a.createElement("ul",{className:"mailpoet_boxes woocommerce clearfix"},t)}},{key:"render",value:function(){var e=q.a.I18n.t("selectAutomaticEmailsEventsHeading").replace("%$1s",this.email.title);return R.a.createElement("div",null,R.a.createElement("h1",null,e),R.a.createElement(ee,{step:"events"}),this.displayEvents())}}]),t}(R.a.Component);re.propTypes={email:Z.a.shape({title:Z.a.string.isRequired,slug:Z.a.string.isRequired,premium:Z.a.bool}).isRequired,history:Z.a.shape({push:Z.a.func.isRequired}).isRequired};var ie=Object(ne.withRouter)(re),se=a(30),oe=a.n(se),le=a(40),ce=a.n(le),ue=a(50),pe=a.n(ue),de=a(35),me=a.n(de),he=a(319),fe=a.n(he),ge=a(4),ve=a.n(ge),be=a(39),_e=a.n(be),ye=(a(456),function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"getFieldId",(function(e){var t=e||a.props;return t.field.id||t.field.name})),y()(K()(a),"getSelectedValues",(function(){if(void 0!==a.props.field.selected)return a.props.field.selected(a.props.item);if(void 0!==a.props.item&&void 0!==a.props.field.name){if(!a.allowMultipleValues())return a.props.item[a.props.field.name];var e;if(O.a.isArray(a.props.item[a.props.field.name]))return x()(e=a.props.item[a.props.field.name]).call(e,(function(e){return e.id}))}return null})),y()(K()(a),"getItems",(function(){var e;return void 0!==window["mailpoet_".concat(a.props.field.endpoint)]?e=window["mailpoet_".concat(a.props.field.endpoint)]:void 0!==ce()(a.props.field)&&(e=ce()(a.props.field)),O.a.isArray(e)&&void 0!==h()(a.props.field)&&(e=h()(e).call(e,h()(a.props.field))),e})),y()(K()(a),"getLabel",(function(e){return void 0!==a.props.field.getLabel?a.props.field.getLabel(e,a.props.item):e.name})),y()(K()(a),"getSearchLabel",(function(e){return void 0!==a.props.field.getSearchLabel?a.props.field.getSearchLabel(e,a.props.item):null})),y()(K()(a),"getValue",(function(e){return void 0!==a.props.field.getValue?a.props.field.getValue(e,a.props.item):e.id})),y()(K()(a),"setupSelect2",(function(){if(!a.isSelect2Initialized()){var e={disabled:a.props.disabled||!1,width:a.props.width||"",placeholder:{id:"",text:a.props.field.placeholder},templateResult:function(e){return e.element&&e.element.selected?null:e.title?e.title:e.text}},t=a.props.field.remoteQuery||null;t&&(e=fe()(e,{ajax:{url:window.ajaxurl,type:"POST",dataType:"json",data:function(e){return{action:"mailpoet",api_version:window.mailpoet_api_version,token:window.mailpoet_token,endpoint:t.endpoint,method:t.method,data:fe()(t.data,{query:e.term})}},processResults:function(e){var t,a;O.a.has(e,"data")?t=x()(a=e.data).call(a,(function(e){return{id:e.id||e.value,text:e.name||e.text}})):t=[];return{results:t}}},minimumInputLength:t.minimumInputLength||2})),void 0!==a.props.field.extendSelect2Options&&(e=fe()(e,a.props.field.extendSelect2Options));var n=ve()("#".concat(a.selectRef.current.id)).select2(e),r=!1;n.on("select2:unselecting",(function(){r=!0})),n.on("select2:opening",(function(e){!0===r&&(r=!1,e.preventDefault())})),n.on("change",a.handleChange)}})),y()(K()(a),"resetSelect2",(function(){a.destroySelect2(),a.setupSelect2()})),y()(K()(a),"destroySelect2",(function(){a.isSelect2Initialized()&&(ve()("#".concat(a.selectRef.current.id)).select2("destroy"),a.cleanupAfterSelect2())})),y()(K()(a),"cleanupAfterSelect2",(function(){var e;me()(e=ve()("#".concat(a.selectRef.current.id))).call(e,"option:not(.default)").remove(),ve()("#".concat(a.selectRef.current.id)).off("select2:unselecting").off("select2:opening")})),y()(K()(a),"allowMultipleValues",(function(){return!0===a.props.field.multiple})),y()(K()(a),"isSelect2Initialized",(function(){return!0===ve()("#".concat(a.selectRef.current.id)).hasClass("select2-hidden-accessible")})),y()(K()(a),"isSelect2Component",(function(){return a.allowMultipleValues()||a.props.field.forceSelect2})),y()(K()(a),"handleChange",(function(e){var t;if(void 0!==a.props.onValueChange){var n=x()(t=ve()("#".concat(a.selectRef.current.id)).children(":selected")).call(t,(function(){return{id:ve()(this).val(),text:ve()(this).text()}})),r=a.props.field.multiple?O.a.pluck(n,"id"):O.a.pluck(n,"id").toString(),i=a.transformChangedValue(r,n);a.props.onValueChange({target:{value:i,name:a.props.field.name,id:e.target.id}})}})),y()(K()(a),"transformChangedValue",(function(e,t){return"function"==typeof a.props.field.transformChangedValue?a.props.field.transformChangedValue.call(K()(a),e,t):e})),y()(K()(a),"insertEmptyOption",(function(){if(!a.allowMultipleValues())return a.props.field.placeholder?R.a.createElement("option",{className:"default"}):void 0})),a.selectRef=R.a.createRef(),a}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){this.isSelect2Component()&&this.setupSelect2()}},{key:"componentDidUpdate",value:function(e){void 0!==this.props.item&&void 0!==e.item&&this.props.item.id!==e.item.id&&ve()("#".concat(this.selectRef.current.id)).val(this.getSelectedValues()).trigger("change"),this.isSelect2Initialized()&&this.getFieldId(this.props)!==this.getFieldId(e)&&void 0!==this.props.field.resetSelect2OnUpdate&&this.resetSelect2()}},{key:"componentWillUnmount",value:function(){this.isSelect2Component()&&this.destroySelect2()}},{key:"render",value:function(){var e=this,t=this.getItems(this.props.field),a=this.getSelectedValues(),n=x()(t).call(t,(function(t){var a=e.getLabel(t),n=e.getSearchLabel(t),r=e.getValue(t);return R.a.createElement("option",{key:"option-".concat(t.id),className:"default",value:r,title:n},a)}));return R.a.createElement("select",pe()({id:this.getFieldId(),ref:this.selectRef,disabled:this.props.field.disabled,"data-placeholder":this.props.field.placeholder,multiple:this.props.field.multiple,defaultValue:a},this.props.field.validation),this.insertEmptyOption(),n)}}]),t}(R.a.Component));ye.propTypes={onValueChange:Z.a.func,field:Z.a.shape({name:Z.a.string.isRequired,values:Z.a.oneOfType([Z.a.object,Z.a.array]),getLabel:Z.a.func,resetSelect2OnUpdate:Z.a.bool,selected:Z.a.func,endpoint:Z.a.string,filter:Z.a.func,getSearchLabel:Z.a.func,getValue:Z.a.func,placeholder:Z.a.string,remoteQuery:Z.a.object,extendSelect2Options:Z.a.object,multiple:Z.a.bool,forceSelect2:Z.a.bool,transformChangedValue:Z.a.func,disabled:Z.a.bool,validation:Z.a.object}).isRequired,item:Z.a.object,disabled:Z.a.bool,width:Z.a.string},ye.defaultProps={onValueChange:function(){},disabled:!1,width:"",item:void 0};var we=ye,Ee=a(114),ke=a.n(Ee),Ie=a(23),Se=a.n(Ie),Ce=a(21),Ne=a.n(Ce),xe=a(480),Te=a.n(xe),Re=a(60),Pe=a.n(Re),Oe=function(e){function t(){return M()(this,t),U()(this,W()(t).apply(this,arguments))}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t,a=this.props.field.name||null,n=this.props.item||{};this.props.onValueChange instanceof Function&&(e=void 0===(e=n[this.props.field.name])?this.props.field.defaultValue||"":e),!e&&this.props.field.defaultValue&&(t=this.props.field.defaultValue);var r=this.props.field.id||null;!r&&this.props.field.name&&(r="field_".concat(this.props.field.name));var i=this.props.field.class||null;return i||this.props.field.size||(i="regular-text"),R.a.createElement("input",pe()({type:"text",disabled:void 0!==this.props.field.disabled&&this.props.field.disabled(this.props.item),className:i,size:"auto"!==this.props.field.size&&this.props.field.size>0?this.props.field.size:null,name:a,id:r,value:e,defaultValue:t,placeholder:this.props.field.placeholder,onChange:this.props.onValueChange},this.props.field.validation))}}]),t}(R.a.Component);Oe.propTypes={onValueChange:Z.a.func,field:Z.a.shape({name:Z.a.string.isRequired,defaultValue:Z.a.string,id:Z.a.string,class:Z.a.string,size:Z.a.oneOfType([Z.a.string,Z.a.number]),disabled:Z.a.func,placeholder:Z.a.string,validation:Z.a.object}).isRequired,item:Z.a.object.isRequired},Oe.defaultProps={onValueChange:function(){}};var De=Oe,Ae=window.mailpoet_time_format||"H:i",qe={immediate:q.a.I18n.t("delayImmediately"),hours:q.a.I18n.t("delayHoursAfter"),days:q.a.I18n.t("delayDaysAfter"),weeks:q.a.I18n.t("delayWeeksAfter")},Le={daily:q.a.I18n.t("daily"),weekly:q.a.I18n.t("weekly"),monthly:q.a.I18n.t("monthly"),nthWeekDay:q.a.I18n.t("monthlyEvery"),immediately:q.a.I18n.t("immediately")},Fe=O.a.object(x()(O.a).call(O.a,O.a.times(24,(function(e){return 3600*e})),(function(e){var t=new Date(null);return t.setSeconds(e),[e,q.a.Date.format(t,{format:Ae,offset:0})]}))),je={0:q.a.I18n.t("sunday"),1:q.a.I18n.t("monday"),2:q.a.I18n.t("tuesday"),3:q.a.I18n.t("wednesday"),4:q.a.I18n.t("thursday"),5:q.a.I18n.t("friday"),6:q.a.I18n.t("saturday")},Me=O.a.object(x()(O.a).call(O.a,O.a.times(28,(function(e){return e})),(function(e){var t={0:q.a.I18n.t("first"),1:q.a.I18n.t("second"),2:q.a.I18n.t("third")};return[e+1,void 0!==t[e]?t[e]:q.a.I18n.t("nth").replace("%$1d",e+1)]}))),Ve={1:q.a.I18n.t("first"),2:q.a.I18n.t("second"),3:q.a.I18n.t("third"),L:q.a.I18n.t("last")},Be="immediate",ze=1,Ue=30,$e=function(e){function t(e){var a,n;M()(this,t);var r=(n=U()(this,W()(t).call(this,e))).props,i=r.item,s=r.event;n.handleChange=F()(a=n.handleChange).call(a,K()(n));var o=i.afterTimeType||s.defaultAfterTimeType||Be,l="minutes"===o?Ue:ze,c=i.afterTimeNumber||l;return n.state={afterTimeType:o,afterTimeNumber:c},i.afterTimeNumber===c&&i.afterTimeType===o||n.propagateChange(n.state),n}return Y()(t,e),B()(t,[{key:"displayAfterTimeNumberField",value:function(){var e=this.props,t=e.afterTimeNumberSize,a=e.event,n=this.state,r=n.afterTimeType,i=n.afterTimeNumber;if("immediate"===r)return null;if(a.timeDelayValues&&a.timeDelayValues[r]&&!a.timeDelayValues[r].displayAfterTimeNumberField)return null;var s={field:{id:"scheduling_time_duration",name:"scheduling_time_duration",defaultValue:i?i.toString():"",size:t},item:{},onValueChange:O.a.partial(this.handleChange,O.a,"afterTimeNumber")};return R.a.createElement(De,{field:s.field,item:s.item,onValueChange:s.onValueChange})}},{key:"displayAfterTimeTypeOptions",value:function(){var e,t=this.props.event,a=qe;t.timeDelayValues&&(a=Pe()(e=Te()(t.timeDelayValues)).call(e,(function(e,t){var a=Ne()(t,2),n=a[0],r=a[1];return e[n]=r.text,e}),{}));var n=this.state.afterTimeType,r={field:{id:"scheduling_time_interval",name:"scheduling_time_interval",forceSelect2:!0,values:x()(O.a).call(O.a,a,(function(e,t){return{name:e,id:t}})),extendSelect2Options:{minimumResultsForSearch:1/0},selected:function(){return n}},onValueChange:O.a.partial(this.handleChange,O.a,"afterTimeType")};return R.a.createElement(we,{field:r.field,onValueChange:r.onValueChange})}},{key:"handleChange",value:function(e,t){var a=e.target.value;"afterTimeNumber"===t&&(a=Se()(e.target.value,10),a=ke()(a)?null:a);var n=y()({},t,a),r=this.state.afterTimeType;"afterTimeType"===t&&r!==a&&("minutes"===r&&(n.afterTimeNumber=ze),"minutes"===a&&(n.afterTimeNumber=Ue)),this.setState(n,this.propagateChange(n))}},{key:"propagateChange",value:function(e){var t=this.props.onValueChange;t&&t(e)}},{key:"render",value:function(){var e=this.props.event;return R.a.createElement(R.a.Fragment,null,R.a.createElement("div",{className:"event-scheduling-time-duration-selection"},this.displayAfterTimeNumberField()),R.a.createElement("div",{className:"event-scheduling-time-interval-selection"},this.displayAfterTimeTypeOptions()),e.schedulingReadMoreLink&&R.a.createElement("a",{href:e.schedulingReadMoreLink.link,target:"_blank",rel:"noopener noreferrer",className:"event-scheduling-read-more-link"},e.schedulingReadMoreLink.text))}}]),t}(R.a.Component);$e.propTypes={item:Z.a.shape({afterTimeType:Z.a.string.isRequired,afterTimeNumber:Z.a.number}).isRequired,afterTimeNumberSize:Z.a.number,onValueChange:Z.a.func,event:Z.a.shape({defaultAfterTimeType:Z.a.string,timeDelayValues:Z.a.objectOf(Z.a.shape({text:Z.a.string,displayAfterTimeNumberField:Z.a.bool})),schedulingReadMoreLink:Z.a.shape({link:Z.a.string.isRequired,text:Z.a.string.isRequired})}).isRequired},$e.defaultProps={afterTimeNumberSize:3,onValueChange:null};var We=$e,He=function(e){function t(e){var a,n;return M()(this,t),(n=U()(this,W()(t).call(this,e))).handleEventOptionChange=F()(a=n.handleEventOptionChange).call(a,K()(n)),n}return Y()(t,e),B()(t,null,[{key:"getEventOptionsValues",value:function(e){var t=e&&ce()(e)?ce()(e):[];return t?x()(t).call(t,(function(e){return{id:e.id,name:e.name}})):t}}]),B()(t,[{key:"displayEventOptions",value:function(){var e=this.props,t=e.eventOptions,a=e.eventSlug,n=e.selected,r=e.emailSlug;if(!t)return t;var i={field:{id:"event_options_".concat(a),name:"event_options_".concat(a),forceSelect2:!0,resetSelect2OnUpdate:!0,values:this.constructor.getEventOptionsValues(t),multiple:t.multiple||!1,placeholder:t.placeholder||!1,extendSelect2Options:{minimumResultsForSearch:1/0},transformChangedValue:function(e,t){return x()(O.a).call(O.a,t,(function(e){return{id:e.id,name:e.text}}))},selected:function(){return n}},onValueChange:this.handleEventOptionChange};return"remote"===t.type&&(i.field=O.a.extend(i.field,{remoteQuery:{minimumInputLength:t.remoteQueryMinimumInputLength||null,endpoint:"automatic_emails",method:"get_event_options",data:{filter:t.remoteQueryFilter||null,email_slug:r,event_slug:a}}})),R.a.createElement(we,{field:i.field,onValueChange:i.onValueChange})}},{key:"handleEventOptionChange",value:function(e){var t=this.props.onValueChange;t&&t({eventOptionValue:e.target.value})}},{key:"render",value:function(){return R.a.createElement("div",null,R.a.createElement("div",{className:"event-option-selection"},this.displayEventOptions()))}}]),t}(R.a.Component);He.propTypes={selected:Z.a.array,eventOptions:Z.a.object,eventSlug:Z.a.string.isRequired,emailSlug:Z.a.string.isRequired,onValueChange:Z.a.func},He.defaultProps={eventOptions:null,selected:[],onValueChange:null};var Ke=He,Ge=a(22),Ye="immediate",Je=function(e){function t(e){var a,n,r;M()(this,t),r=U()(this,W()(t).call(this,e));var i=e.email,s=e.name;r.handleChange=F()(a=r.handleChange).call(a,K()(r)),r.handleNextStep=F()(n=r.handleNextStep).call(n,K()(r)),r.email=i,r.emailEvents=r.email.events,r.segments=h()(O.a).call(O.a,window.mailpoet_segments,(function(e){return null===e.deleted_at}));var o=r.getEvent(s),l=r.constructor.getEventOptions(o),c=r.constructor.getEventOptionsFirstValue(l);return r.state={event:o,eventSlug:o.slug,eventOptionValue:c,segment:o.sendToLists?r.constructor.getFirstSegment():null,afterTimeType:o.defaultAfterTimeType||Ye,afterTimeNumber:null},r}return Y()(t,e),B()(t,null,[{key:"getEventOptions",value:function(e){return e.options||null}},{key:"getEventOptionsFirstValue",value:function(e){return e&&O.a.isArray(ce()(e))&&ce()(e)[0].id?ce()(e)[0].id:null}},{key:"displayBreadcrumbs",value:function(){return R.a.createElement(ee,{step:"conditions"})}}]),B()(t,[{key:"getEvent",value:function(e){return this.emailEvents[e]}},{key:"getFirstSegment",value:function(){return O.a.isArray(this.segments)&&this.segments[0].id?this.segments[0].id:null}},{key:"displayHeader",value:function(){return this.state.event.title}},{key:"displayEventOptions",value:function(){var e=this.state,t=e.eventSlug,a=e.event,n={emailSlug:this.email.slug,eventSlug:t,eventOptions:this.constructor.getEventOptions(a),onValueChange:this.handleChange};return R.a.createElement(Ke,{emailSlug:n.emailSlug,eventSlug:n.eventSlug,eventOptions:n.eventOptions,onValueChange:n.onValueChange})}},{key:"displaySegments",value:function(){var e=this;if(!this.state.event.sendToLists)return null;var t={field:{id:"segments",forceSelect2:!0,values:this.segments,extendSelect2Options:{minimumResultsForSearch:1/0}},onValueChange:function(t){return e.handleChange({segment:t.target.value})}};return R.a.createElement("div",{className:"event-segment-selection"},R.a.createElement(we,{field:t.field,onValueChange:t.onValueChange}))}},{key:"displayScheduling",value:function(){var e=this.state,t={item:{afterTimeNumber:e.afterTimeNumber,afterTimeType:e.afterTimeType},event:e.event,onValueChange:this.handleChange};return R.a.createElement(We,{item:t.item,event:t.event,onValueChange:t.onValueChange})}},{key:"displayEventTip",value:function(){var e=this.state.event;return e.tip?R.a.createElement("p",{className:"description"},R.a.createElement("strong",null,q.a.I18n.t("tip"))," ",e.tip):null}},{key:"handleChange",value:function(e){var t=this.state,a=t.segment,n=t.afterTimeNumber,r=e;if(r.eventSlug){r.event=this.getEvent(r.eventSlug),r.segment=r.event.sendToLists?a||this.constructor.getFirstSegment():null;var i=this.constructor.getEventOptions(r.event);r.eventOptionValue=i?this.constructor.getEventOptionsFirstValue(i):null}r.afterTimeType&&"immediate"===r.afterTimeType?r.afterTimeNumber=null:!r.afterTimeType||r.afterTimeNumber||n||(r.afterTimeNumber=1),this.setState(r)}},{key:"handleNextStep",value:function(){var e=this,t=this.props.history,a=this.state,n=a.eventSlug,r=a.afterTimeType,i=a.afterTimeNumber,s=a.event,o=a.segment,l=a.eventOptionValue,c={group:this.email.slug,event:n,afterTimeType:r};i&&(c.afterTimeNumber=i),c.sendTo=s.sendToLists?"segment":"user",o&&(c.segment=o),l&&(c.meta=oe()({option:l})),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"create",data:{type:"automatic",subject:q.a.I18n.t("draftNewsletterTitle"),options:c}}).done((function(e){q.a.trackEvent("Emails > New Automatic Email Created",{"MailPoet Premium version":window.mailpoet_premium_version,"MailPoet Free version":window.mailpoet_version,"Event type":c.event,"Schedule type":c.afterTimeType,"Schedule value":c.afterTimeNumber}),t.push("/template/".concat(e.data.id))})).fail((function(t){var a;t.errors.length>0&&e.context.notices.error(x()(a=t.errors).call(a,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0})}))}},{key:"render",value:function(){var e=q.a.I18n.t("selectAutomaticEmailsEventsConditionsHeading").replace("%1s",this.email.title);return R.a.createElement("div",null,R.a.createElement("h1",null,e),this.constructor.displayBreadcrumbs(),R.a.createElement("div",{className:"events-conditions-container"},R.a.createElement("h1",null,this.displayHeader()),R.a.createElement("div",null,this.displayEventOptions()),R.a.createElement("div",null,this.displaySegments()),R.a.createElement("div",null,this.displayScheduling())),R.a.createElement("p",{className:"submit"},R.a.createElement("input",{className:"button button-primary",type:"button",onClick:this.handleNextStep,value:q.a.I18n.t("next")})),this.displayEventTip())}}]),t}(R.a.Component);Je.contextType=Ge.a,Je.propTypes={history:Z.a.shape({push:Z.a.func.isRequired}).isRequired,name:Z.a.string.isRequired,email:Z.a.shape({title:Z.a.string.isRequired,slug:Z.a.string.isRequired}).isRequired};var Qe=Je,Ze="immediate",Xe=1,et=function(e){function t(e){var a,n;M()(this,t),n=U()(this,W()(t).call(this,e));var r=e.field;n.handleChange=F()(a=n.handleChange).call(a,K()(n)),n.email=r.email,n.emailOptions=r.emailOptions,n.events=O.a.indexBy(n.email.events,"slug"),n.segments=h()(O.a).call(O.a,window.mailpoet_segments,(function(e){return null===e.deleted_at}));var i=n.events[n.emailOptions.event],s=n.emailOptions.afterTimeType||i.defaultAfterTimeType||Ze;return n.state={event:i,afterTimeType:s,eventSlug:n.emailOptions.event,eventOptionValue:null,afterTimeNumber:n.emailOptions.afterTimeNumber||Xe,segment:n.emailOptions.segment?n.emailOptions.segment:null},n}return Y()(t,e),B()(t,[{key:"displayHeader",value:function(){return this.state.event.title}},{key:"displayEventOptions",value:function(){var e,t=this.state,a=t.event,n=t.eventSlug;try{e=JSON.parse(this.emailOptions.meta||null)}catch(t){e=this.emailOptions.meta||null}var r={emailSlug:this.email.slug,eventSlug:n,onValueChange:this.handleChange,eventOptions:a.options||null};return e&&e.option&&("remote"===r.eventOptions.type&&(r.eventOptions.values=e.option),r.selected=x()(O.a).call(O.a,e.option,(function(e){return e.id}))),R.a.createElement(Ke,{emailSlug:r.emailSlug,eventSlug:r.eventSlug,eventOptions:r.eventOptions,onValueChange:r.onValueChange,selected:r.selected})}},{key:"displaySegments",value:function(){var e=this,t=this.state.segment;if("user"===this.emailOptions.sendTo)return null;var a={field:{id:"segments",forceSelect2:!0,values:this.segments,extendSelect2Options:{minimumResultsForSearch:1/0},selected:function(){return t}},onValueChange:function(t){return e.handleChange({segment:t.target.value})}};return R.a.createElement("div",{className:"event-segment-selection"},R.a.createElement(we,{field:a.field,onValueChange:a.onValueChange}))}},{key:"displayScheduling",value:function(){var e=this.state,t={item:{afterTimeNumber:e.afterTimeNumber,afterTimeType:e.afterTimeType},event:e.event,onValueChange:this.handleChange};return R.a.createElement(We,{item:t.item,event:t.event,onValueChange:t.onValueChange})}},{key:"handleChange",value:function(e){var t=this.state.afterTimeNumber,a=e;a.afterTimeType&&"immediate"===a.afterTimeType?a.afterTimeNumber=null:!a.afterTimeType||a.afterTimeNumber||t||(a.afterTimeNumber=Xe),this.setState(e,this.propagateChange)}},{key:"propagateChange",value:function(){var e=this.state,t=e.eventSlug,a=e.afterTimeType,n=e.afterTimeNumber,r=e.segment,i=e.eventOptionValue,s=this.props.onValueChange;if(s){var o={group:this.email.slug,event:t,afterTimeType:a};n&&(o.afterTimeNumber=n),r&&(o.segment=r),i&&(o.meta=oe()({option:this.state.eventOptionValue})),s({target:{name:"options",value:o}})}}},{key:"render",value:function(){return R.a.createElement("div",null,R.a.createElement("div",{className:"events-conditions-header"},this.displayHeader()),R.a.createElement("div",{className:"events-conditions-container"},R.a.createElement("div",null,this.displayEventOptions()),R.a.createElement("div",null,this.displaySegments()),R.a.createElement("div",null,this.displayScheduling())))}}]),t}(R.a.Component);et.propTypes={field:Z.a.shape({email:Z.a.shape({events:Z.a.object.isRequired}).isRequired,emailOptions:Z.a.object.isRequired}).isRequired,onValueChange:Z.a.func},et.defaultProps={onValueChange:null};var tt=et,at=a(59),nt=a.n(at),rt=a(48),it=a.n(rt),st=a(16),ot=a(20),lt=a.n(ot),ct=a(294),ut=a.n(ct),pt=a(481),dt=a.n(pt),mt=function(e){var t=e.installedDaysAgo,a=t>30?q.a.I18n.t("reviewRequestUsingForMonths").replace("[months]",Math.round(t/30)):q.a.I18n.t("reviewRequestUsingForDays").replace("[days]",t);return R.a.createElement("div",{className:"mailpoet_review_request"},R.a.createElement("img",{src:e.reviewRequestIllustrationUrl,height:"280",width:"280",alt:""}),R.a.createElement("h2",null,q.a.I18n.t("reviewRequestHeading")),R.a.createElement("p",null,q.a.I18n.t("reviewRequestDidYouKnow").replace("[username]",e.username)),R.a.createElement("p",null,a),R.a.createElement("p",null,R.a.createElement("a",{href:"http://bit.ly/2Bi124o",target:"_blank",rel:"noopener noreferrer",className:"button button-primary"},q.a.I18n.t("reviewRequestRateUsNow"))),R.a.createElement("p",null,R.a.createElement("a",{id:"mailpoet_review_request_not_now"},q.a.I18n.t("reviewRequestNotNow"))))};mt.propTypes={installedDaysAgo:Z.a.number.isRequired,reviewRequestIllustrationUrl:Z.a.string.isRequired,username:Z.a.string.isRequired};var ht=mt,ft=null;var gt=function(){return ft||(ft=q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"analytics",action:"getTrackingData"})),ft},vt=function(){return Object(T.useLayoutEffect)((function(){var e=function(e){var t;t=window.mailpoet_display_nps_form?"EqOgKsgZd832Sz9w":window.mailpoet_is_new_user?"6L479eVPXk7pBn6S":"k0aJAsQAWI2ERyGv",dt()({writeKey:t,userId:window.mailpoet_current_wp_user.ID+window.mailpoet_site_url,traits:{name:window.mailpoet_current_wp_user.user_nicename,email:window.mailpoet_current_wp_user.user_email,mailpoetVersion:window.mailpoet_version,mailpoetPremiumIsActive:window.mailpoet_premium_active,createdAt:e.installedAtIso,newslettersSent:e.newslettersSent,welcomeEmails:e.welcomeEmails,postnotificationEmails:e.postnotificationEmails,woocommerceEmails:e.woocommerceEmails,subscribers:e.subscribers,lists:e.lists,sendingMethod:e.sendingMethod,woocommerceIsInstalled:e.woocommerceIsInstalled},events:{submit:function(e){e.rating>=9&&e.completed&&q.a.Modal.popup({width:800,template:ut.a.renderToString(ht({username:window.mailpoet_current_wp_user_firstname||window.mailpoet_current_wp_user.user_login,reviewRequestIllustrationUrl:window.mailpoet_review_request_illustration_url,installedDaysAgo:window.mailpoet_installed_days_ago})),onInit:function(){document.getElementById("mailpoet_review_request_not_now").addEventListener("click",(function(){return q.a.Modal.close()}))}})}}})};window.mailpoet_display_nps_poll&&gt().then((function(t){var a=t.data;return e(a)}))}),[]),null},bt=function(e){return function(t){return vt(),R.a.createElement(e,t)}},_t=function(e){function t(e){var a;return M()(this,t),(a=U()(this,W()(t).call(this,e))).state={tabs:A.a.applyFilters("mailpoet_newsletters_listings_tabs",[{name:"standard",label:q.a.I18n.t("tabStandardTitle"),link:"/standard"},{name:"welcome",label:q.a.I18n.t("tabWelcomeTitle"),link:"/welcome"},{name:"notification",label:q.a.I18n.t("tabNotificationTitle"),link:"/notification"}])},a}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t=this,a=x()(e=this.state.tabs).call(e,(function(e){if(!1===e.display)return null;var a=lt()("nav-tab",{"nav-tab-active":t.props.tab===e.name});return R.a.createElement(st.b,{key:"tab-".concat(e.label),className:a,"data-automation-id":"tab-".concat(e.label),to:e.link,onClick:function(){return q.a.trackEvent("Tab Emails > ".concat(e.name," clicked"),{"MailPoet Free version":window.mailpoet_version})}},e.label)}));return R.a.createElement("h2",{className:"nav-tab-wrapper","data-automation-id":"newsletters_listing_tabs"},a)}}]),t}(R.a.Component);_t.propTypes={tab:Z.a.string.isRequired};var yt=bt(_t),wt=function(){return R.a.createElement("div",null,R.a.createElement("h1",{className:"title"},q.a.I18n.t("pageTitle"),R.a.createElement(st.b,{id:"mailpoet-new-email",className:"page-title-action",to:"/new",onClick:function(){return q.a.trackEvent("Emails > Add New",{"MailPoet Free version":window.mailpoet_version})},"data-automation-id":"new_email"},q.a.I18n.t("new"))))},Et=a(317),kt=a.n(Et),It=a(36),St=a.n(It),Ct=function(e){function t(e){var a,n,r,i;return M()(this,t),(i=U()(this,W()(t).call(this,e))).loadBeamer=F()(a=i.loadBeamer).call(a,K()(i)),i.beamerCallback=F()(n=i.beamerCallback).call(n,K()(i)),i.showBeamer=F()(r=i.showBeamer).call(r,K()(i)),i.state={showDot:e.hasNews,beamerLoaded:void 0!==window.Beamer,beamerInitialized:!1},i}return Y()(t,e),B()(t,null,[{key:"updateLastAnnouncementSeenValue",value:function(){var e={last_announcement_seen:Math.floor(kt()()/1e3)};q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"user_flags",action:"set",data:e})}},{key:"showPluginUpdateNotice",value:function(){if(window.mailpoet_update_available&&!document.getElementById("mailpoet_update_notice")){var e=St()(q.a.I18n.t("updateMailPoetNotice"),/\[link\](.*?)\[\/link\]/,(function(e){return'<a href="update-core.php">'.concat(e,"</a>")})).join("");ve()("#beamerOverlay").append('<p id="mailpoet_update_notice" class="mailpoet_in_beamer_update_notice">'.concat(e,"</p>"))}}}]),B()(t,[{key:"loadBeamer",value:function(){window.beamer_config={product_id:"VvHbhYWy7118",selector:"#beamer-empty-element",language:window.mailpoet_user_locale,callback:this.beamerCallback},window.mailpoet_woocommerce_active&&(window.beamer_config.filter="woocommerce"),q.a.Modal.loading(!0),window.mailpoet_feature_announcement_has_news=!1,this.setState({beamerLoaded:!0});var e=document.createElement("script");e.type="text/javascript",e.src="https://app.getbeamer.com/js/beamer-embed.js",document.getElementsByTagName("body")[0].appendChild(e)}},{key:"beamerCallback",value:function(){this.state.beamerInitialized||(this.showBeamer(),this.setState({beamerInitialized:!0}))}},{key:"showBeamer",value:function(e){e&&e.preventDefault(),this.state.beamerLoaded?(this.setState({showDot:!1}),q.a.Modal.loading(!1),window.Beamer.show(),t.updateLastAnnouncementSeenValue(),t.showPluginUpdateNotice()):this.loadBeamer()}},{key:"render",value:function(){var e=lt()("button mailpoet_feature_announcement_button",this.state.showDot?"mailpoet_feature_announcement_dot":"");return R.a.createElement("div",{className:"mailpoet_feature_announcement"},R.a.createElement("button",{type:"button",onClick:this.showBeamer,className:e,title:q.a.I18n.t("whatsNew")},R.a.createElement("span",{className:"mailpoet_feature_announcement_icon dashicons dashicons-carrot"})),R.a.createElement("span",{id:"beamer-empty-element"}))}}]),t}(R.a.Component);Ct.propTypes={hasNews:Z.a.bool},Ct.defaultProps={hasNews:!1};var Nt=Ct,xt=function(){q.a.trackEvent("User has clicked a CTA to view detailed stats",{"MailPoet Free version":window.mailpoet_version})},Tt=function(e){return e.unshift({name:"stats",link:function(e){return R.a.createElement(st.b,{to:"/stats/".concat(e.id),onClick:A.a.applyFilters("mailpoet_newsletters_listing_stats_tracking",xt)},q.a.I18n.t("statsListingActionTitle"))},display:function(e){var t=e.queue&&e.queue.count_processed;return Number(e.total_sent||t)>0}}),e},Rt=function(e){e.meta.mta_log.error&&"authorization"===e.meta.mta_log.error.operation&&(q.a.Notice.hide("mailpoet_notice_being_sent"),q.a.Notice.error(e.meta.mta_log.error.error_message,{static:!0,id:"mailpoet_authorization_error"}),ve()(".js-button-resume-sending").on("click",(function(){ve()('[data-id="mailpoet_authorization_error"]').slideUp()})))},Pt=function(e){if(!1===e.meta.cron_accessible){var t=St()(q.a.I18n.t("cronNotAccessibleNotice"),/\[link\](.*?)\[\/link\]/g,(function(e){return R.a.createElement("a",{href:"https://kb.mailpoet.com/article/231-sending-does-not-work","data-beacon-article":"5a0257ac2c7d3a272c0d7ad6",target:"_blank",rel:"noopener noreferrer",key:"check-cron"},e)}));q.a.Notice.error("",{static:!0,id:"mailpoet_cron_error"}),_e.a.render(R.a.createElement("div",null,R.a.createElement("p",null,t)),ve()('[data-id="mailpoet_cron_error"]')[0])}else q.a.Notice.hide("mailpoet_cron_error")},Ot=a(5),Dt=a.n(Ot),At=a(63),qt=a.n(At),Lt=a(116),Ft=a.n(Lt),jt=function(e){var t=e.newsletter,a=e.isSent,n=e.currentTime,r=a;if(void 0===r&&(r=t.statistics&&t.queue&&"scheduled"!==t.queue.status),!r)return R.a.createElement("span",null,q.a.I18n.t("notSentYet"));var i={link:"/stats/".concat(t.id),onClick:A.a.applyFilters("mailpoet_newsletters_listing_stats_tracking",xt)},s=Number(t.total_sent||t.queue.count_processed),o=0,l=0,c=0,u=null;s>0&&(o=100*t.statistics.clicked/s,l=100*t.statistics.opened/s,c=100*t.statistics.unsubscribed/s,u=t.statistics.revenue);var p,d,m,h,f,g=q.a.Num.toLocaleFixed(o,1),v=q.a.Num.toLocaleFixed(l,1),b=q.a.Num.toLocaleFixed(c,1);void 0!==n?(p=6,d=t.queue.scheduled_at||t.queue.created_at,h=(m=Dt()(n).diff(Dt()(d),"hours"))<p,f=!0):(h=!1,f=!1);var _;_=s>=20&&t.statistics.opened>=5&&!h?R.a.createElement("div",{className:"mailpoet_stats_text"},R.a.createElement("div",null,R.a.createElement("span",null,v,"%"," "),R.a.createElement(Ft.a,{stat:"opened",rate:l,tooltipId:"opened-".concat(t.id)})),R.a.createElement("div",null,R.a.createElement("span",null,g,"%"," "),R.a.createElement(Ft.a,{stat:"clicked",rate:o,tooltipId:"clicked-".concat(t.id)})),R.a.createElement("div",null,R.a.createElement("span",{className:"mailpoet_stat_hidden"},b,"%"))):R.a.createElement("div",null,R.a.createElement("span",{className:"mailpoet_stats_text"},v,"%,"," ",g,"%",R.a.createElement("span",{className:"mailpoet_stat_hidden"},","," ",b,"%")));var y,w=function(e,a){var n;return function(e,t,a,n){return n<=0||!t.link?e:t.externalLink?R.a.createElement("a",{key:"stats-".concat(a),href:t.link,onClick:t.onClick||null},e):R.a.createElement(st.b,{key:"stats-".concat(a),to:t.link,onClick:t.onClick||null},e)}(e,i,E()(n="".concat(a,"-")).call(n,t.id),s)},k=R.a.createElement(R.a.Fragment,null,w(_,"opened-and-clicked"),null!==u&&u.value>0&&R.a.createElement("div",{className:"mailpoet_stats_text"},w(u.formatted,"revenue")," ",R.a.createElement(qt.a,{tooltip:q.a.I18n.t("revenueStatsTooltip"),place:"left",tooltipId:"helpTooltipStatsRevenue"})),h&&w(R.a.createElement("div",{className:"mailpoet_badge mailpoet_badge_green"},q.a.I18n.t("checkBackInHours").replace("%$1d",p-m)),"check-back"));return f&&l<5&&m>=24&&s>=10&&(y=R.a.createElement("div",null,R.a.createElement("a",{href:"https://kb.mailpoet.com/article/191-how-to-improve-my-open-and-click-rates","data-beacon-article":"58f671152c7d3a057f8858e8",target:"_blank",rel:"noopener noreferrer",className:"mailpoet_stat_link_small"},q.a.I18n.t("improveThisLinkText")))),R.a.createElement("div",null,k,y)},Mt=Z.a.shape({clicked:Z.a.number,opened:Z.a.number,unsubscribed:Z.a.number,revenue:Z.a.shape({count:Z.a.number,currency:Z.a.string,formatted:Z.a.string,value:Z.a.number})}),Vt=Z.a.shape({status:Z.a.string,count_processed:Z.a.string.isRequired,count_total:Z.a.string.isRequired,created_at:Z.a.string,scheduled_at:Z.a.string});jt.propTypes={newsletter:Z.a.shape({id:Z.a.number.isRequired,queue:Z.a.oneOfType([Vt,Z.a.bool]),total_sent:Z.a.number,statistics:Z.a.oneOfType([Mt,Z.a.bool])}).isRequired,isSent:Z.a.bool,currentTime:Z.a.string},jt.defaultProps={isSent:void 0,currentTime:void 0};var Bt=jt,zt=a(51),Ut=a.n(zt),$t=a(78),Wt=a.n($t),Ht=function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"setupNewsletter",(function(e){void 0!==e&&(a.props.history.push("/new/".concat(e)),q.a.trackEvent("Emails > Type selected",{"MailPoet Free version":window.mailpoet_version,"Email type":e}))})),y()(K()(a),"getAutomaticEmails",(function(){return window.mailpoet_automatic_emails?x()(O.a).call(O.a,window.mailpoet_automatic_emails,(function(e){var t=e,n=O.a.partial(a.setupNewsletter,e.slug);return t.action=R.a.createElement("div",null,R.a.createElement("a",{className:"button button-primary",onClick:n,role:"button",tabIndex:0,disabled:a.state.isCreating,onKeyDown:function(e){var t,n;C()(t=["keydown","keypress"]).call(t,e.type)&&C()(n=["Enter"," "]).call(n,e.key)&&(e.preventDefault(),a.onClick())}},q.a.I18n.t("setUp"))),t})):[]})),y()(K()(a),"getAdditionalTypes",(function(){return window.mailpoet_woocommerce_active?[{slug:"wc_transactional",title:q.a.I18n.t("wooCommerceCustomizerTypeTitle"),description:q.a.I18n.t("wooCommerceCustomizerTypeDescription"),action:R.a.createElement("a",{className:"button button-primary","data-automation-id":"customize_woocommerce",onClick:a.openWooCommerceCustomizer,role:"button",tabIndex:0,onKeyDown:function(e){var t,n;C()(t=["keydown","keypress"]).call(t,e.type)&&C()(n=["Enter"," "]).call(n,e.key)&&(e.preventDefault(),a.openWooCommerceCustomizer())}},q.a.I18n.t("customize"))}]:[]})),y()(K()(a),"openWooCommerceCustomizer",Wt()(Ut.a.mark((function e(){var t,n,r;return Ut.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(q.a.trackEvent("Emails > Type selected",{"MailPoet Free version":window.mailpoet_version,"Email type":"wc_transactional"}),t=window.mailpoet_woocommerce_transactional_email_id){e.next=15;break}return e.prev=3,e.next=6,q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"settings",action:"set",data:{"woocommerce.use_mailpoet_editor":1}});case 6:n=e.sent,t=n.data.woocommerce.transactional_email_id,q.a.trackEvent("Emails > WooCommerce email customizer enabled",{"MailPoet Free version":window.mailpoet_version}),e.next=15;break;case 11:return e.prev=11,e.t0=e.catch(3),e.t0.errors.length>0&&a.context.notices.error(x()(r=e.t0.errors).call(r,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0}),e.abrupt("return");case 15:window.location.href="?page=mailpoet-newsletter-editor&id=".concat(t);case 16:case"end":return e.stop()}}),e,null,[[3,11]])})))),y()(K()(a),"createNewsletter",(function(e){a.setState({isCreating:!0}),q.a.trackEvent("Emails > Type selected",{"MailPoet Free version":window.mailpoet_version,"Email type":e}),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"create",data:{type:e,subject:q.a.I18n.t("draftNewsletterTitle")}}).done((function(e){a.props.history.push("/template/".concat(e.data.id))})).fail((function(e){var t;(a.setState({isCreating:!1}),e.errors.length>0)&&a.context.notices.error(x()(t=e.errors).call(t,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0})}))})),a.state={isCreating:!1},a}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t=O.a.partial(this.createNewsletter,"standard"),a=O.a.partial(this.setupNewsletter,"notification"),n=O.a.partial(this.setupNewsletter,"welcome"),r=[{slug:"standard",title:q.a.I18n.t("regularNewsletterTypeTitle"),description:q.a.I18n.t("regularNewsletterTypeDescription"),action:R.a.createElement("a",{className:"button button-primary","data-automation-id":"create_standard",onClick:t,role:"button",tabIndex:0,disabled:this.state.isCreating,onKeyDown:function(e){var a,n;C()(a=["keydown","keypress"]).call(a,e.type)&&C()(n=["Enter"," "]).call(n,e.key)&&(e.preventDefault(),t())}},q.a.I18n.t("create"))},{slug:"welcome",title:q.a.I18n.t("welcomeNewsletterTypeTitle"),description:q.a.I18n.t("welcomeNewsletterTypeDescription"),videoGuide:"https://kb.mailpoet.com/article/254-video-guide-to-welcome-emails",videoGuideBeacon:"5b05ebf20428635ba8b2aa53",action:R.a.createElement("a",{className:"button button-primary",onClick:n,"data-automation-id":"create_welcome",disabled:this.state.isCreating,onKeyDown:function(e){var t,a;C()(t=["keydown","keypress"]).call(t,e.type)&&C()(a=["Enter"," "]).call(a,e.key)&&(e.preventDefault(),n())},role:"button",tabIndex:0},q.a.I18n.t("setUp"))},{slug:"notification",title:q.a.I18n.t("postNotificationNewsletterTypeTitle"),description:q.a.I18n.t("postNotificationNewsletterTypeDescription"),videoGuide:"https://kb.mailpoet.com/article/210-video-guide-to-post-notifications",videoGuideBeacon:"59ba6fb3042863033a1cd5a5",action:R.a.createElement("a",{className:"button button-primary","data-automation-id":"create_notification",onClick:a,role:"button",disabled:this.state.isCreating,tabIndex:0,onKeyDown:function(e){var t,n;C()(t=["keydown","keypress"]).call(t,e.type)&&C()(n=["Enter"," "]).call(n,e.key)&&(e.preventDefault(),a())}},q.a.I18n.t("setUp"))}],i=A.a.applyFilters("mailpoet_newsletters_types",E()(e=[]).call(e,r,I()(this.getAutomaticEmails())),this);i=E()(i).call(i,this.getAdditionalTypes()),h()(this.props)&&(i=h()(i).call(i,h()(this.props)));var s=!0===window.mailpoet_is_new_user?"mailpoet_badge mailpoet_badge_video":"mailpoet_badge mailpoet_badge_video mailpoet_badge_video_grey",o=q.a.Ajax.constructGetUrl({api_version:window.mailpoet_api_version,endpoint:"newsletterTemplates",action:"getAll"});return R.a.createElement("div",null,R.a.createElement("link",{rel:"prefetch",href:window.mailpoet_editor_javascript_url,as:"script"}),this.props.showHeader&&R.a.createElement(R.a.Fragment,null,R.a.createElement("h1",null,q.a.I18n.t(0===window.mailpoet_newsletters_count?"createFirstEmailTitle":"pickCampaignType")),R.a.createElement(J.a,{step:"type"})),R.a.createElement("ul",{className:"mailpoet_boxes mailpoet_boxes_types"},x()(i).call(i,(function(e){return R.a.createElement("li",{key:e.slug,"data-type":e.slug,className:"mailpoet_newsletter_types"},R.a.createElement("div",{className:"mailpoet_thumbnail"},e.thumbnailImage?R.a.createElement("img",{src:e.thumbnailImage,alt:""}):null),R.a.createElement("div",{className:"mailpoet_boxes_content"},R.a.createElement("div",{className:"mailpoet_description"},R.a.createElement("h3",null,e.title," ",e.beta?"(".concat(q.a.I18n.t("beta"),")"):""),R.a.createElement("p",null,e.description),e.videoGuide&&R.a.createElement("a",{className:s,href:e.videoGuide,"data-beacon-article":e.videoGuideBeacon,target:"_blank",rel:"noopener noreferrer"},R.a.createElement("span",{className:"dashicons dashicons-format-video"}),q.a.I18n.t("seeVideoGuide"))),R.a.createElement("div",{className:"mailpoet_actions"},e.action)))}),this)),R.a.createElement("link",{rel:"prefetch",href:o,as:"fetch"}))}}]),t}(R.a.Component);Ht.contextType=Ge.a,Ht.propTypes={filter:Z.a.func,history:Z.a.shape({push:Z.a.func.isRequired}).isRequired,showHeader:Z.a.bool},Ht.defaultProps={filter:null,showHeader:!0};var Kt=Object(ne.withRouter)(Ht),Gt=a(47),Yt=a.n(Gt),Jt=function(e){var t=e.onClose,a=e.onDisplay,n=e.renderInPlace,r=e.timeout,i=e.scroll,s=e.children,o=e.closable,l=e.type,c=R.a.useState(!1),u=Ne()(c,2),p=u[0],d=u[1],m=R.a.useRef(null),h=R.a.useRef(null),f=R.a.useCallback((function(){t&&t(),d(!0)}),[t]);if(R.a.useEffect((function(){return r&&(h.current=Yt()(f,r)),function(){return h.current?clearTimeout(h.current):null}}),[f,r]),R.a.useLayoutEffect((function(){i&&m.current&&m.current.scrollIntoView(!1)}),[i]),R.a.useLayoutEffect((function(){a&&a()}),[a]),p)return null;var g=R.a.createElement("div",{ref:m,className:"mailpoet_base_notice mailpoet_".concat(l,"_notice")},s,o&&R.a.createElement("button",{type:"button",className:"notice-dismiss",onClick:f},R.a.createElement("span",{className:"screen-reader-text"},q.a.I18n.t("dismissNotice"))));return n?g:_e.a.createPortal(g,document.getElementById("mailpoet_notices"))};Jt.propTypes={type:Z.a.oneOf(["success","info","warning","error"]).isRequired,children:Z.a.node.isRequired,scroll:Z.a.bool,closable:Z.a.bool,renderInPlace:Z.a.bool,onDisplay:Z.a.func,onClose:Z.a.func,timeout:Z.a.oneOfType([Z.a.number,Z.a.oneOf([!1])])},Jt.defaultProps={timeout:1e4,scroll:!1,closable:!0,renderInPlace:!1,onDisplay:void 0,onClose:void 0};var Qt=Jt,Zt=function(){if(!window.mailpoet_subscribers_limit_reached)return null;var e=window.mailpoet_has_valid_api_key,t=q.a.I18n.t("subscribersLimitNoticeTitle").replace("[subscribersLimit]",window.mailpoet_subscribers_limit),a=q.a.I18n.t(e?"yourPlanLimit":"freeVersionLimit").replace("[subscribersLimit]",window.mailpoet_subscribers_limit),n=e?"https://account.mailpoet.com/upgrade":"https://account.mailpoet.com/?s=".concat(window.mailpoet_subscribers_count+1),r=function(){var e=Wt()(Ut.a.mark((function e(){return Ut.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"services",action:"recheckKeys"});case 2:window.location.reload();case 3:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return R.a.createElement(Qt,{type:"error",timeout:!1,closable:!1,renderInPlace:!0},R.a.createElement("h3",null,t),R.a.createElement("p",null,a," ",q.a.I18n.t("youNeedToUpgrade")),R.a.createElement("p",null,R.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",className:"button button-primary",href:n},q.a.I18n.t("upgradeNow")),e&&R.a.createElement(R.a.Fragment,null," ",R.a.createElement("button",{type:"button",className:"button",onClick:r},q.a.I18n.t("refreshMySubscribers")))))},Xt=function(e){var t=e.mssKeyInvalid,a=e.subscribersCount;return t?R.a.createElement(Qt,{type:"error",timeout:!1,closable:!1,renderInPlace:!0},R.a.createElement("h3",null,q.a.I18n.t("allSendingPausedHeader")),R.a.createElement("p",null,q.a.I18n.t("allSendingPausedBody")),R.a.createElement("p",null,R.a.createElement("a",{href:"https://account.mailpoet.com?s=".concat(a),className:"button button-primary",target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("allSendingPausedLink")))):null};Xt.propTypes={mssKeyInvalid:Z.a.bool.isRequired,subscribersCount:Z.a.number.isRequired};var ea=Xt,ta=!!window.mailpoet_tracking_enabled,aa=window.mailpoet_woocommerce_automatic_emails||{},na={onTrash:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterTrashed"):q.a.I18n.t("multipleNewslettersTrashed").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onDelete:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterDeleted"):q.a.I18n.t("multipleNewslettersDeleted").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onRestore:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterRestored"):q.a.I18n.t("multipleNewslettersRestored").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)}},ra=[{name:"subject",label:q.a.I18n.t("subject"),sortable:!0},{name:"status",label:q.a.I18n.t("status"),width:145},{name:"settings",label:q.a.I18n.t("settings")},{name:"statistics",label:q.a.I18n.t("statistics"),display:ta},{name:"updated_at",label:q.a.I18n.t("lastModifiedOn"),sortable:!0}],ia=[{name:"trash",label:q.a.I18n.t("moveToTrash"),onSuccess:na.onTrash}],sa=[{name:"view",link:function(e){return R.a.createElement("a",{href:e.preview_url,target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("preview"))}},{name:"edit",link:function(e){return R.a.createElement("a",{href:"?page=mailpoet-newsletter-editor&id=".concat(e.id)},q.a.I18n.t("edit"))}},{name:"duplicate",label:q.a.I18n.t("duplicate"),onClick:function(e,t){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"duplicate",data:{id:e.id}}).done((function(e){q.a.Notice.success(q.a.I18n.t("newsletterDuplicated").replace("%$1s",e.data.subject)),t()})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))}},{name:"trash"}];A.a.addFilter("mailpoet_newsletters_listings_automatic_email_actions","mailpoet",Tt);var oa=function(e){function t(e){var a,n;return M()(this,t),n=U()(this,W()(t).call(this,e)),y()(K()(n),"updateStatus",(function(e){e.persist(),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"setStatus",data:{id:Number(e.target.getAttribute("data-id")),status:e.target.value}}).done((function(e){"active"===e.data.status&&q.a.Notice.success(q.a.I18n.t("automaticEmailActivated")),n.forceUpdate()})).fail((function(t){q.a.Notice.showApiErrorNotice(t),e.target.value=t.status}))})),y()(K()(n),"renderStatus",(function(e){var t=Se()(e.total_sent,10)?q.a.I18n.t("sentToXCustomers").replace("%$1d",e.total_sent.toLocaleString()):q.a.I18n.t("notSentYet");return R.a.createElement("div",null,R.a.createElement("p",null,R.a.createElement("select",{"data-id":e.id,defaultValue:e.status,onChange:n.updateStatus},R.a.createElement("option",{value:"active"},q.a.I18n.t("active")),R.a.createElement("option",{value:"draft"},q.a.I18n.t("inactive")))),R.a.createElement("p",null,R.a.createElement(st.b,{to:"/sending-status/".concat(e.id)},t)))})),y()(K()(n),"renderSettings",(function(e){var t,a=aa[e.options.group].events[e.options.event];try{t=JSON.parse(e.options.meta||null)}catch(a){t=e.options.meta||null}var n,r,i=t&&t.option?O.a.pluck(t.option,"name"):[];if(t&&O.a.isEmpty(i))return R.a.createElement("span",{className:"mailpoet_error"},q.a.I18n.t("automaticEmailEventOptionsNotConfigured"));if((n=i.length>1&&"listingScheduleDisplayTextPlural"in a?a.listingScheduleDisplayTextPlural.replace("%s",i.join(", ")):a.listingScheduleDisplayText.replace("%s",i.join(", ")))&&"immediate"!==e.options.afterTimeType)switch(e.options.afterTimeType){case"minutes":r=q.a.I18n.t("sendingDelayMinutes").replace("%$1d",e.options.afterTimeNumber);break;case"hours":r=q.a.I18n.t("sendingDelayHours").replace("%$1d",e.options.afterTimeNumber);break;case"days":r=q.a.I18n.t("sendingDelayDays").replace("%$1d",e.options.afterTimeNumber);break;case"weeks":r=q.a.I18n.t("sendingDelayWeeks").replace("%$1d",e.options.afterTimeNumber);break;default:r=q.a.I18n.t("sendingDelayInvalid")}return R.a.createElement("span",null,n,r&&R.a.createElement(R.a.Fragment,null,R.a.createElement("br",null),r))})),y()(K()(n),"renderItem",(function(e,t){var a=lt()("manage-column","column-primary","has-row-actions");return R.a.createElement("div",null,R.a.createElement("td",{className:a},R.a.createElement("strong",null,R.a.createElement("a",{className:"row-title",href:"?page=mailpoet-newsletter-editor&id=".concat(e.id)},e.subject)),t),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("status")},n.renderStatus(e)),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("settings")},n.renderSettings(e)),!0===ta?R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("statistics")},R.a.createElement(Bt,{newsletter:e,isSent:e.total_sent>0&&!!e.statistics})):null,R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("lastModifiedOn")},R.a.createElement("abbr",null,q.a.Date.format(e.updated_at))))})),n.state={eventCounts:{},newslettersCount:void 0},n.afterGetItems=F()(a=n.afterGetItems).call(a,K()(n)),n}return Y()(t,e),B()(t,[{key:"afterGetItems",value:function(e){Rt(e),this.countEmailTypes(e)}},{key:"countEmailTypes",value:function(e){if(nt()(e.items)){var t,a,n=Pe()(t=x()(a=e.items).call(a,(function(e){return e.options.event}))).call(t,(function(e,t){return e[t]?e[t]+=1:e[t]=1,e}),{woocommerce_product_purchased:0,woocommerce_product_purchased_in_category:0,woocommerce_first_purchase:0});this.setState({eventCounts:n})}}},{key:"renderWarning",value:function(){var e=this.state.eventCounts;return e.woocommerce_product_purchased+e.woocommerce_product_purchased_in_category+e.woocommerce_first_purchase?"1"===window.mailpoet_woocommerce_optin_on_checkout?null:R.a.createElement("div",{className:"mailpoet_base_notice mailpoet_error_notice"},R.a.createElement("p",null,q.a.I18n.t("wooCommerceEmailsWarning")),R.a.createElement("p",null,R.a.createElement("a",{href:"?page=mailpoet-settings#woocommerce"},q.a.I18n.t("wooCommerceEmailsWarningLink")))):null}},{key:"render",value:function(){var e=this,t=this.props,a=t.match,n=t.location;return R.a.createElement("div",null,R.a.createElement(wt,null),R.a.createElement(Nt,{hasNews:window.mailpoet_feature_announcement_has_news}),R.a.createElement(Zt,null),R.a.createElement(ea,{mssKeyInvalid:window.mailpoet_mss_key_invalid,subscribersCount:window.mailpoet_subscribers_count}),R.a.createElement(yt,{tab:"woocommerce"}),this.renderWarning(),0===this.state.newslettersCount&&R.a.createElement(Kt,{filter:function(e){return"woocommerce"===e.slug},showHeader:!1}),0!==this.state.newslettersCount&&R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:n,params:a.params,endpoint:"newsletters",type:"automatic",base_url:"woocommerce",onRenderItem:this.renderItem,columns:ra,bulk_actions:ia,item_actions:sa,messages:na,auto_refresh:!0,sort_by:"updated_at",sort_order:"desc",afterGetItems:function(t){if(!t.loading){var a,n=Pe()(a=t.groups).call(a,(function(e,t){return e+t.count}),0);e.setState({newslettersCount:n})}e.afterGetItems(t)}}))}}]),t}(R.a.Component);oa.propTypes={match:Z.a.shape({params:Z.a.shape({tab:Z.a.string}).isRequired}).isRequired,location:Z.a.object.isRequired};var la=oa,ca=O.a.once((function(){return q.a.trackEvent("User has typed a GA campaign name",{"MailPoet Premium version":window.mailpoet_premium_version})})),ua=St()(q.a.I18n.t("gaCampaignTip"),/\[link\](.*?)\[\/link\]/g,(function(e,t){return R.a.createElement("a",{key:t,href:"https://kb.mailpoet.com/article/187-track-your-newsletters-subscribers-in-google-analytics","data-beacon-article":"58b597d12c7d3a576d359144",target:"_blank",rel:"noopener noreferrer"},e)})),pa={name:"ga_campaign",label:q.a.I18n.t("gaCampaignLine"),tip:ua,type:"text",onBeforeChange:ca};function da(e,t){var a=b()(e);if(g.a){var n=g()(e);t&&(n=h()(n).call(n,(function(t){return d()(e,t).enumerable}))),a.push.apply(a,n)}return a}function ma(e){for(var t=1;t<arguments.length;t++){var a,n=null!=arguments[t]?arguments[t]:{};if(t%2)u()(a=da(Object(n),!0)).call(a,(function(t){y()(e,t,n[t])}));else if(l.a)s()(e,l()(n));else{var i;u()(i=da(Object(n))).call(i,(function(t){r()(e,t,d()(n,t))}))}}return e}var ha=window.mailpoet_woocommerce_automatic_emails||[];if(document.getElementById("newsletters_container")&&!O.a.isEmpty(ha)){A.a.addFilter("mailpoet_newsletters_types","mailpoet",(function(e,t){var a,n=O.a.reject(e,(function(e){return O.a.has(ha,e.slug)})),r=x()(O.a).call(O.a,ha,(function(e){var a=e,n=O.a.partial(t.setupNewsletter,e.slug);return a.action=R.a.createElement("div",null,R.a.createElement("span",{className:"button button-primary",onClick:n,onKeyDown:function(e){var t,a;C()(t=["keydown","keypress"]).call(t,e.type)&&C()(a=["Enter"," "]).call(a,e.key)&&(e.preventDefault(),n())},role:"button","data-automation-id":"create_woocommerce",tabIndex:0},e.actionButtonTitle||q.a.I18n.t("setUp"))),a}));return E()(a=[]).call(a,I()(n),I()(r))})),A.a.addFilter("mailpoet_newsletters_before_router","mailpoet",(function(e){var t,a=O.a.reject(e,(function(e){return O.a.has(ha,e.name)})),n=[],r=[],i=[];return O.a.each(ha,(function(e){var t=e.events;O.a.isObject(t)&&O.a.each(t,(function(t){var a;r.push({path:E()(a="/new/".concat(e.slug,"/")).call(a,t.slug,"/conditions"),name:t.slug,render:function(a){var n=ma({},a,{email:e,name:t.slug});return R.a.createElement(Qe,n)}})})),n.push({path:"/new/".concat(e.slug),name:e.slug,render:function(t){var a=ma({},t,{email:e});return R.a.createElement(ie,a)}}),i.push({path:"/".concat(e.slug,"/(.*)?"),params:{tab:e.slug},component:la})})),E()(t=[]).call(t,r,n,i,I()(a))}))}A.a.addFilter("mailpoet_newsletters_listings_tabs","mailpoet",(function(e){var t,a=[];return O.a.each(ha,(function(e){a.push({name:e.slug,label:e.title,link:"/".concat(e.slug),display:window.mailpoet_woocommerce_active})})),E()(t=[]).call(t,I()(e),a)}));var fa=function(e,t,a){return"automatic"===t?R.a.createElement(ee,{step:a}):e};A.a.addFilter("mailpoet_newsletters_template_breadcrumb","mailpoet",fa),A.a.addFilter("mailpoet_newsletters_editor_breadcrumb","mailpoet",fa),A.a.addFilter("mailpoet_newsletters_send_breadcrumb","mailpoet",fa);A.a.addFilter("mailpoet_newsletters_editor_extend_config","mailpoet",(function(e,t){if("automatic"!==t.type)return e;var a=e;return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"automatic_emails",action:"get_event_shortcodes",data:{email_slug:t.options.group,event_slug:t.options.event}}).then((function(e){return O.a.isObject(e)&&e.data?(a.shortcodes=ma({},a.shortcodes,{},e.data),a):a})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0,static:!0})}))}));A.a.addFilter("mailpoet_newsletters_send_newsletter_fields","mailpoet",(function(e,t){if("automatic"!==t.type)return e;var a=ha[t.options.group];if(!a)return e;var n=t.options,r=[{name:"subject",label:q.a.I18n.t("subjectLine"),tip:q.a.I18n.t("subjectLineTip"),type:"text",validation:{"data-parsley-required":!0,"data-parsley-required-message":q.a.I18n.t("emptySubjectLineError")}},{name:"options",label:q.a.I18n.t("sendAutomaticEmailWhenHeading").replace("%1s",a.title),type:"reactComponent",component:tt,email:a,emailOptions:n},{name:"sender",label:q.a.I18n.t("sender"),tip:q.a.I18n.t("senderTip"),fields:[{name:"sender_name",type:"text",placeholder:q.a.I18n.t("senderNamePlaceholder"),validation:{"data-parsley-required":!0}},{name:"sender_address",type:"text",placeholder:q.a.I18n.t("senderAddressPlaceholder"),validation:{"data-parsley-required":!0,"data-parsley-type":"email"}}]},{name:"reply-to",label:q.a.I18n.t("replyTo"),tip:q.a.I18n.t("replyToTip"),inline:!0,fields:[{name:"reply_to_name",type:"text",placeholder:q.a.I18n.t("replyToNamePlaceholder")},{name:"reply_to_address",type:"text",placeholder:q.a.I18n.t("replyToAddressPlaceholder"),validation:{"data-parsley-type":"email"}}]},pa];return{getFields:function(){return r},getSendButtonOptions:function(){return{value:q.a.I18n.t("activate")}}}}));A.a.addFilter("mailpoet_newsletters_send_server_request_parameters","mailpoet",(function(e,t){return"automatic"===t.type?{api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"setStatus",data:{id:t.id,status:"active"}}:e}));A.a.addFilter("mailpoet_newsletters_send_server_request_response_redirect","mailpoet",(function(e,t){return"automatic"===t.type?"/".concat(t.options.group):e}));A.a.addFilter("mailpoet_newsletters_send_server_request_response","mailpoet",(function(e){if("automatic"!==e.type)return null;var t=ha[e.options.group];return t?function(){q.a.Notice.success(q.a.I18n.t("automaticEmailActivated").replace("%1s",t.title))}:null}));var ga=function(e){var t=e.subscribersInPlan,a=e.hasValidApiKey;return t&&a?R.a.createElement("h3",null,q.a.I18n.t("subscribersInPlan").replace("%$1d",t.toLocaleString())," ",R.a.createElement(qt.a,{tooltip:q.a.I18n.t("subscribersInPlanTooltip"),place:"right"})):null};ga.propTypes={subscribersInPlan:Z.a.oneOfType([Z.a.number,Z.a.oneOf([!1])]).isRequired,hasValidApiKey:Z.a.bool.isRequired};var va=ga,ba=[{name:"email",label:q.a.I18n.t("subscriber"),sortable:!0},{name:"status",label:q.a.I18n.t("status"),sortable:!0},{name:"segments",label:q.a.I18n.t("lists")},{name:"created_at",label:q.a.I18n.t("subscribedOn"),sortable:!0}],_a={onTrash:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneSubscriberTrashed"):q.a.I18n.t("multipleSubscribersTrashed").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onDelete:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneSubscriberDeleted"):q.a.I18n.t("multipleSubscribersDeleted").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onRestore:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneSubscriberRestored"):q.a.I18n.t("multipleSubscribersRestored").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onNoItemsFound:function(e){return"bounced"===e&&!window.mailpoet_premium_active&&!window.mss_active&&R.a.createElement("div",null,R.a.createElement("p",null,q.a.I18n.t("bouncedSubscribersHelp")),R.a.createElement("p",null,R.a.createElement("a",{href:"admin.php?page=mailpoet-premium",className:"button-primary"},q.a.I18n.t("bouncedSubscribersPremiumButtonText"))))}},ya=[{name:"moveToList",label:q.a.I18n.t("moveToList"),onSelect:function(){return R.a.createElement(we,{field:{id:"move_to_segment",name:"move_to_segment",endpoint:"segments",filter:function(e){return!(e.deleted_at||"default"!==e.type)}}})},getData:function(){return{segment_id:Number(ve()("#move_to_segment").val())}},onSuccess:function(e){q.a.Notice.success(q.a.I18n.t("multipleSubscribersMovedToList").replace("%$1d",Number(e.meta.count).toLocaleString()).replace("%$2s",e.meta.segment))}},{name:"addToList",label:q.a.I18n.t("addToList"),onSelect:function(){return R.a.createElement(we,{field:{id:"add_to_segment",name:"add_to_segment",endpoint:"segments",filter:function(e){return!(e.deleted_at||"default"!==e.type)}}})},getData:function(){return{segment_id:Number(ve()("#add_to_segment").val())}},onSuccess:function(e){q.a.Notice.success(q.a.I18n.t("multipleSubscribersAddedToList").replace("%$1d",Number(e.meta.count).toLocaleString()).replace("%$2s",e.meta.segment))}},{name:"removeFromList",label:q.a.I18n.t("removeFromList"),onSelect:function(){return R.a.createElement(we,{field:{id:"remove_from_segment",name:"remove_from_segment",endpoint:"segments",filter:function(e){return!("default"!==e.type)}}})},getData:function(){return{segment_id:Number(ve()("#remove_from_segment").val())}},onSuccess:function(e){q.a.Notice.success(q.a.I18n.t("multipleSubscribersRemovedFromList").replace("%$1d",Number(e.meta.count).toLocaleString()).replace("%$2s",e.meta.segment))}},{name:"removeFromAllLists",label:q.a.I18n.t("removeFromAllLists"),onSuccess:function(e){q.a.Notice.success(q.a.I18n.t("multipleSubscribersRemovedFromAllLists").replace("%$1d",Number(e.meta.count).toLocaleString()))}},{name:"trash",label:q.a.I18n.t("moveToTrash"),onSuccess:_a.onTrash}],wa=[{name:"edit",label:q.a.I18n.t("edit"),link:function(e){return R.a.createElement(st.b,{to:"/edit/".concat(e.id)},q.a.I18n.t("edit"))}},{name:"sendConfirmationEmail",label:q.a.I18n.t("resendConfirmationEmail"),display:function(e){return"unconfirmed"===e.status&&e.count_confirmations<window.mailpoet_max_confirmation_emails},onClick:function(e){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"subscribers",action:"sendConfirmationEmail",data:{id:e.id}}).done((function(){return q.a.Notice.success(q.a.I18n.t("oneConfirmationEmailSent"))})).fail((function(e){return q.a.Notice.showApiErrorNotice(e)}))}},{name:"trash",display:function(e){return 0===Number(e.wp_user_id)&&0===Number(e.is_woocommerce_user)}}],Ea=function(e){function t(){var e,a,n;M()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=U()(this,(e=W()(t)).call.apply(e,E()(a=[this]).call(a,i))),y()(K()(n),"getSegmentFromId",(function(e){var t,a=!1;return u()(t=window.mailpoet_segments).call(t,(function(t){t.id===e&&(a=t)})),a})),y()(K()(n),"renderItem",(function(e,t){var a=lt()("manage-column","column-primary","has-row-actions","column-username"),r="";switch(e.status){case"subscribed":r=q.a.I18n.t("subscribed");break;case"unconfirmed":r=q.a.I18n.t("unconfirmed");break;case"unsubscribed":r=q.a.I18n.t("unsubscribed");break;case"inactive":r=q.a.I18n.t("inactive");break;case"bounced":r=q.a.I18n.t("bounced");break;default:r="Invalid"}var i=!1;if(e.subscriptions.length>0){var s,o=[];u()(s=e.subscriptions).call(s,(function(e){var t=n.getSegmentFromId(e.segment_id);!1!==t&&"subscribed"===e.status&&o.push(t.name)})),i=R.a.createElement("span",null,o.join(", "))}return R.a.createElement("div",null,R.a.createElement("td",{className:a},R.a.createElement("strong",null,R.a.createElement(st.b,{className:"row-title",to:"/edit/".concat(e.id)},e.email)),R.a.createElement("p",{style:{margin:0}},e.first_name," ",e.last_name),t),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("status")},r),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("lists")},i),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("subscribedOn")},R.a.createElement("abbr",null,q.a.Date.format(e.created_at))))})),n}return Y()(t,e),B()(t,[{key:"render",value:function(){return R.a.createElement("div",null,R.a.createElement("h1",{className:"title"},q.a.I18n.t("pageTitle")," ",R.a.createElement(st.b,{className:"page-title-action",to:"/new"},q.a.I18n.t("new")),R.a.createElement("a",{className:"page-title-action",href:"?page=mailpoet-import","data-automation-id":"import-subscribers-button"},q.a.I18n.t("import")),R.a.createElement("a",{id:"mailpoet_export_button",className:"page-title-action",href:"?page=mailpoet-export"},q.a.I18n.t("export"))),R.a.createElement(va,{subscribersInPlan:window.mailpoet_subscribers_in_plan_count,hasValidApiKey:window.mailpoet_has_valid_api_key}),R.a.createElement(Zt,null),R.a.createElement(ea,{mssKeyInvalid:window.mailpoet_mss_key_invalid,subscribersCount:window.mailpoet_subscribers_count}),R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,endpoint:"subscribers",onRenderItem:this.renderItem,columns:ba,bulk_actions:ya,item_actions:wa,messages:_a,sort_by:"created_at",sort_order:"desc"}))}}]),t}(R.a.Component);Ea.propTypes={location:Z.a.object.isRequired,match:Z.a.shape({params:Z.a.object}).isRequired};var ka=Ea,Ia=a(129),Sa=a.n(Ia),Ca=function(e){return R.a.createElement("textarea",pe()({type:"text",className:"regular-text",name:e.field.name,id:"field_".concat(e.field.name),value:e.item[e.field.name],placeholder:e.field.placeholder,defaultValue:e.field.defaultValue,onChange:e.onValueChange},e.field.validation))};Ca.propTypes={item:Z.a.object.isRequired,field:Z.a.shape({name:Z.a.string,placeholder:Z.a.string,defaultValue:Z.a.string,validation:Z.a.object}).isRequired,onValueChange:Z.a.func.isRequired};var Na=Ca,xa=function(e){function t(){return M()(this,t),U()(this,W()(t).apply(this,arguments))}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t=this;if(void 0===ce()(this.props.field))return!1;var a,n=!1,r=!1,i=!1;void 0!==this.props.field.placeholder&&(r=R.a.createElement("option",{value:""},this.props.field.placeholder)),void 0!==h()(this.props.field)&&(n=h()(this.props.field)),O.a.isFunction(this.props.field.sortBy)&&(i=this.props.field.sortBy),a=i?x()(O.a).call(O.a,O.a.sortBy(O.a.pairs(ce()(this.props.field)),(function(e){return i(e[0],e[1])})),(function(e){return e[0]})):b()(ce()(this.props.field));var s=x()(e=h()(a).call(a,(function(e){return!1===n||n(t.props.item,e)}))).call(e,(function(e){return R.a.createElement("option",{key:"option-".concat(e),value:e},ce()(t.props.field)[e])}));return R.a.createElement("select",pe()({name:this.props.field.name,id:"field_".concat(this.props.field.name),value:this.props.item[this.props.field.name]||"",onChange:this.props.onValueChange,"data-automation-id":this.props.automationId},this.props.field.validation),r,s)}}]),t}(R.a.Component);xa.propTypes={onValueChange:Z.a.func,field:Z.a.shape({name:Z.a.string.isRequired,values:Z.a.object,placeholder:Z.a.string,filter:Z.a.func,sortBy:Z.a.func,validation:Z.a.object}).isRequired,item:Z.a.object.isRequired,automationId:Z.a.string},xa.defaultProps={automationId:"",onValueChange:function(){}};var Ta=xa,Ra=function(e){function t(){return M()(this,t),U()(this,W()(t).apply(this,arguments))}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t=this;if(void 0===ce()(this.props.field))return!1;var a=this.props.item[this.props.field.name],n=x()(e=b()(ce()(this.props.field))).call(e,(function(e){return R.a.createElement("p",{key:"radio-".concat(e)},R.a.createElement("label",{htmlFor:t.props.field.name},R.a.createElement("input",{type:"radio",checked:a===e,value:e,onChange:t.props.onValueChange,name:t.props.field.name,id:t.props.field.name}),ce()(t.props.field)[e]))}));return R.a.createElement("div",null,n)}}]),t}(R.a.Component);Ra.propTypes={onValueChange:Z.a.func,field:Z.a.shape({name:Z.a.string.isRequired,values:Z.a.object}).isRequired,item:Z.a.object.isRequired},Ra.defaultProps={onValueChange:function(){}};var Pa=Ra,Oa=function(e){function t(e){var a,n;return M()(this,t),n=U()(this,W()(t).call(this,e)),y()(K()(n),"onValueChange",(function(e){return e.target.value=n.checkboxRef.current.checked?"1":"0",n.props.onValueChange(e)})),n.checkboxRef=R.a.createRef(),n.onValueChange=F()(a=n.onValueChange).call(a,K()(n)),n}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t=this;if(void 0===ce()(this.props.field))return!1;var a=!!Number(this.props.item[this.props.field.name]),n=x()(e=b()(ce()(this.props.field))).call(e,(function(e){return R.a.createElement("p",{key:"checkbox-".concat(e)},R.a.createElement("label",{htmlFor:t.props.field.name},R.a.createElement("input",{ref:t.checkboxRef,type:"checkbox",value:"1",checked:a,onChange:t.onValueChange,name:t.props.field.name,id:t.props.field.name}),ce()(t.props.field)[e]))}));return R.a.createElement("div",null,n)}}]),t}(R.a.Component);Oa.propTypes={onValueChange:Z.a.func.isRequired,field:Z.a.shape({name:Z.a.string.isRequired,values:Z.a.object.isRequired}).isRequired,item:Z.a.object.isRequired};var Da=Oa,Aa=a(49),qa=a.n(Aa);function La(e){var t=[];void 0!==e.placeholder&&t.push(R.a.createElement("option",{value:"",key:0},e.placeholder));for(var a=Dt()().year(),n=a;n>=a-100;n-=1)t.push(R.a.createElement("option",{key:n,value:n},n));return R.a.createElement("select",{name:"".concat(e.name,"[year]"),value:e.year,onChange:e.onValueChange,className:lt()({mailpoet_date_year:e.addDefaultClasses})},t)}function Fa(e){var t=[];void 0!==e.placeholder&&t.push(R.a.createElement("option",{value:"",key:0},e.placeholder));for(var a=1;a<=12;a+=1)t.push(R.a.createElement("option",{key:a,value:a},e.monthNames[a-1]));return R.a.createElement("select",{name:"".concat(e.name,"[month]"),value:e.month,onChange:e.onValueChange,className:lt()({mailpoet_date_month:e.addDefaultClasses})},t)}function ja(e){var t=[];void 0!==e.placeholder&&t.push(R.a.createElement("option",{value:"",key:0},e.placeholder));for(var a=1;a<=31;a+=1)t.push(R.a.createElement("option",{key:a,value:a},a));return R.a.createElement("select",{name:"".concat(e.name,"[day]"),value:e.day,onChange:e.onValueChange,className:lt()({mailpoet_date_day:e.addDefaultClasses})},t)}La.propTypes={name:Z.a.string.isRequired,placeholder:Z.a.string.isRequired,onValueChange:Z.a.func.isRequired,year:Z.a.oneOfType([Z.a.string,Z.a.number]).isRequired,addDefaultClasses:Z.a.bool.isRequired},Fa.propTypes={name:Z.a.string.isRequired,placeholder:Z.a.string.isRequired,onValueChange:Z.a.func.isRequired,month:Z.a.oneOfType([Z.a.string,Z.a.number]).isRequired,monthNames:Z.a.arrayOf(Z.a.string).isRequired,addDefaultClasses:Z.a.bool.isRequired},ja.propTypes={name:Z.a.string.isRequired,placeholder:Z.a.string.isRequired,onValueChange:Z.a.func.isRequired,day:Z.a.oneOfType([Z.a.string,Z.a.number]).isRequired,addDefaultClasses:Z.a.bool.isRequired};var Ma=function(e){function t(e){var a,n;return M()(this,t),(n=U()(this,W()(t).call(this,e))).state={year:"",month:"",day:""},n.onValueChange=F()(a=n.onValueChange).call(a,K()(n)),n}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){this.extractDateParts()}},{key:"componentDidUpdate",value:function(e){void 0!==this.props.item&&void 0!==e.item&&this.props.item.id!==e.item.id&&this.extractDateParts()}},{key:"onValueChange",value:function(e){var t=this,a=e.target.name.match(/(.*?)\[(.*?)\]/),n=null,r=null;if(null!==a&&3===a.length){var i=Ne()(a,3);n=i[1],r=i[2];var s=Number(e.target.value);this.setState(y()({},"".concat(r),s),(function(){t.props.onValueChange({target:{name:n,value:t.formatValue()}})}))}}},{key:"formatValue",value:function(){var e;switch(this.props.field.params.date_type){case"year_month_day":e={year:this.state.year,month:this.state.month,day:this.state.day};break;case"year_month":e={year:this.state.year,month:this.state.month};break;case"month":e={month:this.state.month};break;case"year":e={year:this.state.year};break;default:e={value:"invalid type"}}return e}},{key:"extractDateParts",value:function(){var e,t=void 0!==this.props.item[this.props.field.name]?qa()(e=this.props.item[this.props.field.name]).call(e):"";if(""!==t){var a=Dt()(t);this.setState({year:a.format("YYYY"),month:a.format("M"),day:a.format("D")})}}},{key:"render",value:function(){var e=this,t=window.mailpoet_month_names||[],a=(window.mailpoet_date_formats||{})[this.props.field.params.date_type][0];this.props.field.params.date_format&&(a=this.props.field.params.date_format);var n=a.split("/"),r=x()(n).call(n,(function(a){switch(a){case"YYYY":return R.a.createElement(La,{onValueChange:e.onValueChange,key:"year",name:e.props.field.name,addDefaultClasses:e.props.addDefaultClasses,year:e.state.year,placeholder:e.props.field.year_placeholder});case"MM":return R.a.createElement(Fa,{onValueChange:e.onValueChange,key:"month",name:e.props.field.name,addDefaultClasses:e.props.addDefaultClasses,month:e.state.month,monthNames:t,placeholder:e.props.field.month_placeholder});case"DD":return R.a.createElement(ja,{onValueChange:e.onValueChange,key:"day",name:e.props.field.name,addDefaultClasses:e.props.addDefaultClasses,day:e.state.day,placeholder:e.props.field.day_placeholder});default:return R.a.createElement("div",null,"Invalid date type")}}));return R.a.createElement("div",null,r)}}]),t}(R.a.Component);Ma.propTypes={item:Z.a.object.isRequired,field:Z.a.shape({name:Z.a.string,day_placeholder:Z.a.string,month_placeholder:Z.a.string,year_placeholder:Z.a.string,params:Z.a.object}).isRequired,onValueChange:Z.a.func.isRequired,addDefaultClasses:Z.a.bool},Ma.defaultProps={addDefaultClasses:!1};var Va=Ma,Ba=function(e){function t(){var e,a,n;M()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=U()(this,(e=W()(t)).call.apply(e,E()(a=[this]).call(a,i))),y()(K()(n),"renderField",(function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=!1;e.field.description&&(a=R.a.createElement("p",{className:"description"},e.field.description));var n=!1,r=e.field;switch(void 0!==e.field.field&&(r=ve.a.merge(r,e.field.field)),r.type){case"text":n=R.a.createElement(De,{onValueChange:e.onValueChange,field:e.field,item:e.item,automationId:e.automationId,inline:e.inline,description:e.description});break;case"textarea":n=R.a.createElement(Na,{onValueChange:e.onValueChange,field:e.field,item:e.item,automationId:e.automationId,inline:e.inline,description:e.description});break;case"select":n=R.a.createElement(Ta,{onValueChange:e.onValueChange,field:e.field,item:e.item,automationId:e.automationId,inline:e.inline,description:e.description});break;case"radio":n=R.a.createElement(Pa,{onValueChange:e.onValueChange,field:e.field,item:e.item,automationId:e.automationId,inline:e.inline,description:e.description});break;case"checkbox":n=R.a.createElement(Da,{onValueChange:e.onValueChange,field:e.field,item:e.item,automationId:e.automationId,inline:e.inline,description:e.description});break;case"selection":n=R.a.createElement(we,{key:"selection-field-".concat(r.name),onValueChange:e.onValueChange,field:e.field,automationId:e.automationId,inline:e.inline,description:e.description,item:e.item});break;case"date":n=R.a.createElement(Va,{onValueChange:e.onValueChange,field:e.field,item:e.item,automationId:e.automationId,inline:e.inline,description:e.description});break;case"reactComponent":n=R.a.createElement(e.field.component,{onValueChange:e.onValueChange,field:e.field,item:e.item,automationId:e.automationId,inline:e.inline,description:e.description});break;default:n="invalid"}return!0===t?R.a.createElement("span",{key:"field-".concat(e.index||0)},n,a):R.a.createElement("div",{key:"field-".concat(e.index||0)},n,a)})),n}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t=this,a=!1;void 0!==this.props.field.fields?a=x()(e=this.props.field.fields).call(e,(function(e,a){return t.renderField({index:a,field:e,item:t.props.item,onValueChange:t.props.onValueChange||!1})})):a=this.renderField(this.props);var n=!1;return this.props.field.tip&&(n=R.a.createElement("p",{className:"description"},this.props.field.tip)),R.a.createElement("tr",{className:"form-field-row-".concat(this.props.field.name)},R.a.createElement("th",{scope:"row"},R.a.createElement("label",{htmlFor:"field_".concat(this.props.field.name)},this.props.field.label,n)),R.a.createElement("td",null,a))}}]),t}(R.a.Component);Ba.propTypes={onValueChange:Z.a.func,field:Z.a.shape({name:Z.a.string.isRequired,values:Z.a.object,tip:Z.a.oneOfType([Z.a.array,Z.a.string]),label:Z.a.string,fields:Z.a.array,description:Z.a.string}).isRequired,item:Z.a.object.isRequired},Ba.defaultProps={onValueChange:function(){}};var za=Ba,Ua=function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"getValues",(function(){return a.props.item||a.state.item})),y()(K()(a),"getErrors",(function(){return a.props.errors||a.state.errors})),y()(K()(a),"loadItem",(function(e){a.setState({loading:!0}),a.props.endpoint&&q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:a.props.endpoint,action:"get",data:{id:e}}).done((function(e){a.setState({loading:!1,item:e.data}),"function"==typeof a.props.onItemLoad&&a.props.onItemLoad(e.data)})).fail((function(){a.setState({loading:!1,item:{}},(function(){this.props.history.push("/new")}))}))})),y()(K()(a),"handleSubmit",(function(e){var t;if(e.preventDefault(),void 0===a.props.isValid||!1!==a.props.isValid()){a.setState({loading:!0});var n={};u()(t=a.props.fields).call(t,(function(e){var t;void 0!==e.fields?u()(t=e.fields).call(t,(function(e){n[e.name]=a.state.item[e.name]})):n[e.name]=a.state.item[e.name]})),void 0!==a.props.params.id&&(n.id=a.props.params.id),a.props.endpoint&&q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:a.props.endpoint,action:"save",data:n}).always((function(){a.setState({loading:!1})})).done((function(){void 0!==a.props.onSuccess?a.props.onSuccess():a.props.history.push("/"),void 0!==a.props.params.id?a.props.messages.onUpdate():a.props.messages.onCreate()})).fail((function(e){e.errors.length>0&&a.setState({errors:e.errors})}))}})),y()(K()(a),"handleValueChange",(function(e){var t=e.target,n=t.name,r=t.value;return a.props.onChange?a.props.onChange(e):(a.setState((function(e){var t=e.item;return t[n]=r,{item:t}})),!0)})),a.formRef=R.a.createRef(),a.state={loading:!1,errors:[],item:{}},a}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){var e=this;void 0!==this.props.params.id?this.loadItem(this.props.params.id):Sa()((function(){e.setState({item:ve()(".mailpoet_form").mailpoetSerializeObject()})}))}},{key:"componentDidUpdate",value:function(){var e=this;void 0===this.props.params.id&&this.state.loading&&(Sa()((function(){e.setState({loading:!1,item:{}})})),void 0===this.props.item&&this.formRef.current.reset())}},{key:"render",value:function(){var e,t,a,n=this;void 0!==this.getErrors()&&(t=x()(a=this.getErrors()).call(a,(function(e){return R.a.createElement("div",{className:"mailpoet_notice notice inline error is-dismissible",key:"error-".concat(e.message)},R.a.createElement("p",null,e.message))})));var r=lt()("mailpoet_form",{mailpoet_form_loading:this.state.loading||this.props.loading}),i=!1,s=!1;void 0!==this.props.beforeFormContent&&(i=this.props.beforeFormContent(this.getValues())),void 0!==this.props.afterFormContent&&(s=this.props.afterFormContent(this.getValues()));var o=x()(e=this.props.fields).call(e,(function(e){var t=n.handleValueChange;return e.onBeforeChange&&(t=function(t){return e.onBeforeChange(t),n.handleValueChange(t)}),R.a.createElement(za,{field:e,item:n.getValues(),onValueChange:t,key:"field-".concat(e.name),automationId:e.automationId})})),l=!1;return l=this.props.children?this.props.children:R.a.createElement("input",{className:"button button-primary",type:"submit",value:q.a.I18n.t("save"),disabled:this.state.loading}),R.a.createElement("div",null,i,R.a.createElement("form",{id:this.props.id,ref:this.formRef,className:r,onSubmit:void 0!==this.props.onSubmit?this.props.onSubmit:this.handleSubmit,"data-automation-id":this.props.automationId},t,R.a.createElement("table",{className:"form-table"},R.a.createElement("tbody",null,o)),l),s)}}]),t}(R.a.Component);Ua.propTypes={params:Z.a.shape({id:Z.a.string}),item:Z.a.object,errors:Z.a.arrayOf(Z.a.object),endpoint:Z.a.string,fields:Z.a.arrayOf(Z.a.object),messages:Z.a.shape({onUpdate:Z.a.func,onCreate:Z.a.func}),loading:Z.a.bool,children:Z.a.array,id:Z.a.string,automationId:Z.a.string,beforeFormContent:Z.a.func,afterFormContent:Z.a.func,onItemLoad:Z.a.func,isValid:Z.a.func,onChange:Z.a.func,onSubmit:Z.a.func,onSuccess:Z.a.func,history:Z.a.shape({push:Z.a.func.isRequired}).isRequired},Ua.defaultProps={params:{},errors:void 0,fields:void 0,item:void 0,onItemLoad:void 0,isValid:void 0,onSuccess:void 0,onChange:void 0,loading:!1,beforeFormContent:void 0,afterFormContent:void 0,children:void 0,id:"",onSubmit:void 0,automationId:"",messages:{onUpdate:function(){},onCreate:function(){}},endpoint:void 0};var $a=Object(ne.withRouter)(Ua),Wa=[{name:"email",label:q.a.I18n.t("email"),type:"text",disabled:function(e){return Number(e.wp_user_id>0)||1===Number(e.is_woocommerce_user)}},{name:"first_name",label:q.a.I18n.t("firstname"),type:"text",disabled:function(e){return Number(e.wp_user_id>0)||1===Number(e.is_woocommerce_user)}},{name:"last_name",label:q.a.I18n.t("lastname"),type:"text",disabled:function(e){return Number(e.wp_user_id>0)||1===Number(e.is_woocommerce_user)}},{name:"status",label:q.a.I18n.t("status"),type:"select",automationId:"subscriber-status",values:{subscribed:q.a.I18n.t("subscribed"),unconfirmed:q.a.I18n.t("unconfirmed"),unsubscribed:q.a.I18n.t("unsubscribed"),inactive:q.a.I18n.t("inactive"),bounced:q.a.I18n.t("bounced")}},{name:"segments",label:q.a.I18n.t("lists"),type:"selection",placeholder:q.a.I18n.t("selectList"),tip:q.a.I18n.t("welcomeEmailTip"),api_version:window.mailpoet_api_version,endpoint:"segments",multiple:!0,selected:function(e){var t,a;return!1===nt()(e.subscriptions)?null:x()(t=h()(a=e.subscriptions).call(a,(function(e){return"subscribed"===e.status}))).call(t,(function(e){return e.segment_id}))},filter:function(e){return!e.deleted_at&&"default"===e.type},getLabel:function(e){var t;return E()(t="".concat(e.name," (")).call(t,e.subscribers,")")},getSearchLabel:function(e,t){var a,n="";void 0!==t.subscriptions&&u()(a=t.subscriptions).call(a,(function(t){if(e.id===t.segment_id&&(n=e.name,"unsubscribed"===t.status)){var a=q.a.Date.format(t.updated_at);n+=" (%$1s)".replace("%$1s",q.a.I18n.t("unsubscribedOn").replace("%$1s",a))}}));return n}}],Ha=window.mailpoet_custom_fields||[];u()(Ha).call(Ha,(function(e){var t={name:"cf_".concat(e.id),label:e.name,type:e.type};switch(e.params&&(t.params=e.params),ce()(e.params)&&(t.values=ce()(e.params)),e.type){case"date":t.year_placeholder=q.a.I18n.t("year"),t.month_placeholder=q.a.I18n.t("month"),t.day_placeholder=q.a.I18n.t("day");break;case"select":t.placeholder="-";break;default:t.placeholder=""}Wa.push(t)}));var Ka={onUpdate:function(){q.a.Notice.success(q.a.I18n.t("subscriberUpdated"))},onCreate:function(){q.a.Notice.success(q.a.I18n.t("subscriberAdded")),q.a.trackEvent("Subscribers > Add new",{"MailPoet Free version":window.mailpoet_version})}};function Ga(e){if(Number(e.wp_user_id)>0)return R.a.createElement("p",{className:"description"},St()(q.a.I18n.t("WPUserEditNotice"),/\[link\](.*?)\[\/link\]/g,(function(t,a){return R.a.createElement("a",{key:a,href:"user-edit.php?user_id=".concat(e.wp_user_id)},t)})))}function Ya(){return R.a.createElement("p",{className:"description"},R.a.createElement("strong",null,q.a.I18n.t("tip"))," ",q.a.I18n.t("customFieldsTip"))}var Ja=function(e){function t(){return M()(this,t),U()(this,W()(t).apply(this,arguments))}return Y()(t,e),B()(t,[{key:"render",value:function(){return R.a.createElement("div",null,R.a.createElement("h1",{className:"title"},q.a.I18n.t("subscriber"),R.a.createElement(st.b,{className:"page-title-action",to:"/"},q.a.I18n.t("backToList"))),R.a.createElement(Zt,null),R.a.createElement($a,{automationId:"subscriber_edit_form",endpoint:"subscribers",fields:Wa,params:this.props.match.params,messages:Ka,beforeFormContent:Ga,afterFormContent:Ya}))}}]),t}(R.a.Component);Ja.propTypes={match:Z.a.shape({params:Z.a.shape({id:Z.a.string}).isRequired}).isRequired};var Qa=Ja,Za=a(482),Xa=a.n(Za),en=function(){var e,t=R.a.useContext(Ge.a).notices;return x()(e=t.items).call(e,(function(e){var t=e.id,a=Xa()(e,["id"]);return R.a.createElement(Qt,pe()({key:t},a))}))},tn=document.getElementById("subscribers_container");tn&&_e.a.render(R.a.createElement((function(){return R.a.createElement(Ge.a.Provider,{value:Object(Ge.b)(window)},R.a.createElement(st.a,null,R.a.createElement(en,null),R.a.createElement(ne.Switch,null,R.a.createElement(ne.Route,{path:"/new",component:Qa}),R.a.createElement(ne.Route,{path:"/edit/:id",component:Qa}),R.a.createElement(ne.Route,{path:"*",component:ka}))))}),null),tn);var an=a(483),nn=a.n(an),rn=a(31),sn=a.n(rn),on=function(e){function t(){return M()(this,t),U()(this,W()(t).apply(this,arguments))}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){q.a.Modal.loading(!0)}},{key:"componentWillUnmount",value:function(){q.a.Modal.loading(!1)}},{key:"render",value:function(){return null}}]),t}(R.a.Component),ln=function(e){var t=e.tabs,a=e.selected,n=e.select;return R.a.createElement("div",{className:"wp-filter hide-if-no-js"},R.a.createElement("ul",{className:"filter-links"},x()(t).call(t,(function(e){var t=e.name,r=e.label;return R.a.createElement("li",{key:t},R.a.createElement("a",{href:"#",className:a===t?"current":"",onClick:function(e){e.preventDefault(),n(t)}}," ",r))}))))};ln.propTypes={selected:Z.a.string.isRequired,select:Z.a.func.isRequired,tabs:Z.a.arrayOf(Z.a.shape({label:Z.a.string.isRequired,name:Z.a.string.isRequired}).isRequired).isRequired};var cn=ln,un=function(e){return q.a.Modal.popup({title:e.title,template:ut.a.renderToString(R.a.createElement(R.a.Fragment,null,R.a.createElement("p",null,e.message),R.a.createElement("button",{id:"mailpoet_alert_cancel",className:"button button-secondary",type:"button"},e.cancelLabel),R.a.createElement("button",{id:"mailpoet_alert_confirm",className:"button button-primary",type:"submit"},e.confirmLabel))),onInit:function(){document.getElementById("mailpoet_alert_confirm").addEventListener("click",(function(){q.a.Modal.close(),e.onConfirm()})),document.getElementById("mailpoet_alert_cancel").addEventListener("click",(function(){return q.a.Modal.close()}))}}),null};function pn(e){ut.a.renderToString(R.a.createElement(un,{title:e.title,message:e.message,cancelLabel:e.cancelLabel,confirmLabel:e.confirmLabel,onConfirm:e.onConfirm}))}un.propTypes={title:Z.a.string,message:Z.a.string.isRequired,cancelLabel:Z.a.string,confirmLabel:Z.a.string,onConfirm:Z.a.func.isRequired},un.defaultProps={title:q.a.I18n.t("confirmTitle"),cancelLabel:q.a.I18n.t("cancelLabel"),confirmLabel:q.a.I18n.t("confirmLabel")};var dn=function(e){function t(e){var a,n,r,i;return M()(this,t),(i=U()(this,W()(t).call(this,e))).onPreview=F()(a=i.onPreview).call(a,K()(i)),i.onDelete=F()(n=i.onDelete).call(n,K()(i)),i.onSelect=F()(r=i.onSelect).call(r,K()(i)),i}return Y()(t,e),B()(t,[{key:"onDelete",value:function(){var e=this,t=this.props,a=t.id,n=t.name,r=t.beforeDelete,i=t.afterDelete;pn({message:q.a.I18n.t("confirmTemplateDeletion").replace("%$1s",n),onConfirm:function(){r(),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletterTemplates",action:"delete",data:{id:a}}).done((function(){i(!0,a)})).fail((function(t){var a;t.errors.length>0&&e.context.notices.error(x()(a=t.errors).call(a,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0});i(!1)}))}})}},{key:"onPreview",value:function(){q.a.Modal.popup({title:this.props.name,template:'<img src="{{ thumbnail }}" />',data:this.props})}},{key:"onSelect",value:function(){var e=this,t=this.props,a=t.newsletterId,n=t.name,r=t.beforeSelect,i=t.afterSelect;r(),q.a.trackEvent("Emails > Template selected",{"MailPoet Free version":window.mailpoet_version,"Email name":n}),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"save",data:{id:a,template_id:this.props.id}}).done((function(e){i(!0,e.data.id)})).fail((function(t){var a;t.errors.length>0&&e.context.notices.error(x()(a=t.errors).call(a,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0});i(!1)}))}},{key:"render",value:function(){var e=this,t=this.props,a=t.index,n=t.name,r=t.thumbnail,i=t.readonly,s=R.a.createElement("button",{className:"mailpoet_delete button button-secondary",onClick:this.onDelete,type:"button"},q.a.I18n.t("delete")),o="";return"string"==typeof r&&r.length>0&&(o=R.a.createElement("a",{href:"#",onClick:function(t){t.preventDefault(),e.onPreview(t)}},R.a.createElement("img",{src:r,alt:q.a.I18n.t("templatePreview"),loading:"lazy"}),R.a.createElement("div",{className:"mailpoet_overlay"},R.a.createElement("p",{className:"mailpoet_more_details"},q.a.I18n.t("zoom"))))),R.a.createElement("li",{className:"mailpoet_template_boxes","data-automation-id":"select_template_box"},R.a.createElement("div",{className:"mailpoet_thumbnail"},o),R.a.createElement("div",{className:"mailpoet_template_content"},R.a.createElement("div",{className:"mailpoet_description"},R.a.createElement("h3",null,n)),R.a.createElement("div",{className:"mailpoet_actions"},!0!==i&&s,R.a.createElement("a",{className:"button button-primary","data-automation-id":"select_template_".concat(a),onClick:this.onSelect,role:"button",tabIndex:0,onKeyDown:function(t){var a,n;C()(a=["keydown","keypress"]).call(a,t.type)&&C()(n=["Enter"," "]).call(n,t.key)&&(t.preventDefault(),e.onSelect())}}," ",q.a.I18n.t("select")," "))))}}]),t}(R.a.Component);dn.contextType=Ge.a,dn.propTypes={index:Z.a.number.isRequired,id:Z.a.number.isRequired,newsletterId:Z.a.string.isRequired,name:Z.a.string.isRequired,thumbnail:Z.a.string.isRequired,readonly:Z.a.bool.isRequired,beforeDelete:Z.a.func.isRequired,afterDelete:Z.a.func.isRequired,beforeSelect:Z.a.func.isRequired,afterSelect:Z.a.func.isRequired};var mn=dn,hn=function(e){function t(e){var a,n;return M()(this,t),(n=U()(this,W()(t).call(this,e))).fileRef=R.a.createRef(),n.handleSubmit=F()(a=n.handleSubmit).call(a,K()(n)),n}return Y()(t,e),B()(t,[{key:"saveTemplate",value:function(e){var t,a,n,r,i=this,s=e,o=this.props,l=o.beforeImport,c=o.afterImport;O.a.isUndefined(s.body)||(s.body=oe()(s.body));try{s.categories=JSON.parse(s.categories)}catch(e){s.categories=[]}-1===sn()(t=s.categories).call(t,"saved")&&s.categories.push("saved"),-1===sn()(a=s.categories).call(a,"standard")&&-1===sn()(n=s.categories).call(n,"welcome")&&-1===sn()(r=s.categories).call(r,"notification")&&s.categories.push("standard"),s.categories=oe()(s.categories),l(),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletterTemplates",action:"save",data:s}).done((function(e){c(!0,e.data)})).fail((function(e){var t;e.errors.length>0&&i.context.notices.error(x()(t=e.errors).call(t,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0});c(!1)}))}},{key:"handleSubmit",value:function(e){var t=this;if(e.preventDefault(),O.a.size(this.fileRef.current.files)<=0)return!1;var a=O.a.first(this.fileRef.current.files),n=new FileReader;return n.onload=function(e){try{t.saveTemplate(JSON.parse(e.target.result)),q.a.trackEvent("Emails > Template imported",{"MailPoet Free version":window.mailpoet_version})}catch(e){t.context.notices.error(R.a.createElement("p",null,q.a.I18n.t("templateFileMalformedError")))}},n.readAsText(a),!0}},{key:"render",value:function(){return R.a.createElement("div",null,R.a.createElement("h2",null,q.a.I18n.t("importTemplateTitle"),R.a.createElement(qt.a,{tooltip:q.a.I18n.t("helpTooltipTemplateUpload"),place:"right",className:"tooltip-help-import-template"})),R.a.createElement("form",{onSubmit:this.handleSubmit},R.a.createElement("input",{type:"file",placeholder:q.a.I18n.t("selectJsonFileToUpload"),ref:this.fileRef}),R.a.createElement("p",{className:"submit"},R.a.createElement("input",{className:"button button-primary",type:"submit",value:q.a.I18n.t("upload")}))))}}]),t}(R.a.Component);hn.contextType=Ge.a,hn.propTypes={beforeImport:Z.a.func.isRequired,afterImport:Z.a.func.isRequired};var fn=hn,gn=[{name:"standard",label:q.a.I18n.t("tabStandardTitle")},{name:"welcome",label:q.a.I18n.t("tabWelcomeTitle")},{name:"notification",label:q.a.I18n.t("tabNotificationTitle")},{name:"blank",label:q.a.I18n.t("tabBlankTitle")}];window.mailpoet_woocommerce_active&&gn.push({name:"woocommerce",label:q.a.I18n.t("tabWoocommerceTitle")}),gn.push.apply(gn,[{name:"recent",label:q.a.I18n.t("recentlySent")},{name:"saved",label:q.a.I18n.t("savedTemplates")}]);var vn=function(e){function t(e){var a,n,r,i,s;return M()(this,t),(s=U()(this,W()(t).call(this,e))).state={loading:!0,templates:{},emailType:null,selectedTab:""},s.templates={},s.addTemplate=F()(a=s.addTemplate).call(a,K()(s)),s.afterTemplateDelete=F()(n=s.afterTemplateDelete).call(n,K()(s)),s.afterTemplateSelect=F()(r=s.afterTemplateSelect).call(r,K()(s)),s.afterTemplateImport=F()(i=s.afterTemplateImport).call(i,K()(s)),s}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){var e=this;q.a.Ajax.get({api_version:window.mailpoet_api_version,endpoint:"newsletterTemplates",action:"getAll"}).done((function(t){var a;0===t.data.length&&(t.data=[{name:q.a.I18n.t("mailpoetGuideTemplateTitle"),categories:'["welcome", "notification", "standard", "woocommerce"]',readonly:!0}]),u()(a=t.data).call(a,e.addTemplate),e.sortTemplates()})).fail((function(t){var a;t.errors.length>0&&e.context.notices.error(x()(a=t.errors).call(a,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0})})).always((function(){e.selectInitialTab()}))}},{key:"addTemplate",value:function(e){var t,a=this,n=x()(gn).call(gn,(function(e){return e.name}));-1===sn()(n).call(n,"woocommerce")&&n.push("woocommerce");try{var r;t=h()(r=JSON.parse(e.categories)).call(r,(function(e){return-1!==sn()(n).call(n,e)}))}catch(e){t=[]}0===t.length&&t.push("saved"),u()(t).call(t,(function(t){void 0===a.templates[t]&&(a.templates[t]=[]),a.templates[t].unshift(e)}))}},{key:"sortTemplates",value:function(){var e,t=this;u()(e=b()(this.templates)).call(e,(function(e){var a;nn()(a=t.templates[e]).call(a,(function(e,t){return e.id<t.id?1:-1}))}))}},{key:"selectInitialTab",value:function(){var e,t=this,a="standard";q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"get",data:{id:this.props.match.params.id}}).done((function(t){e=t.data.type,O.a.findWhere(gn,{name:t.data.type})?a=t.data.type:"automatic"===t.data.type&&O.a.findWhere(gn,{name:t.data.options.group})&&(a=t.data.options.group)})).fail((function(e){var a;e.errors.length>0&&t.context.notices.error(x()(a=e.errors).call(a,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0})})).always((function(){t.setState({templates:t.templates,emailType:e,selectedTab:a,loading:!1})}))}},{key:"afterTemplateDelete",value:function(e,t){var a,n=this;e&&u()(a=b()(this.templates)).call(a,(function(e){var a;n.templates[e]=h()(a=n.templates[e]).call(a,(function(e){return e.id!==t}))}));this.setState({templates:this.templates,loading:!1})}},{key:"afterTemplateSelect",value:function(e,t){e?window.location=function(e){return"admin.php?page=mailpoet-newsletter-editor&id=".concat(e)}(t):this.setState({loading:!1})}},{key:"afterTemplateImport",value:function(e,t){e&&this.addTemplate(t),this.setState({templates:this.templates,selectedTab:e?"saved":"import",loading:!1})}},{key:"render",value:function(){var e=this;if(this.state.loading)return R.a.createElement(on,null);var t=E()(gn).call(gn,{name:"import",label:q.a.I18n.t("tabImportTitle")}),a=null;if("import"===this.state.selectedTab)a=R.a.createElement(fn,{beforeImport:function(){return e.setState({loading:!0})},afterImport:this.afterTemplateImport});else{var n=this.state.templates[this.state.selectedTab]||[];n=0===n.length?this.state.loading?null:R.a.createElement("p",null,q.a.I18n.t("noTemplates")):x()(n).call(n,(function(t,a){return R.a.createElement(mn,{key:t.id,index:a,newsletterId:e.props.match.params.id,beforeDelete:function(){return e.setState({loading:!0})},afterDelete:e.afterTemplateDelete,beforeSelect:function(){return e.setState({loading:!0})},afterSelect:e.afterTemplateSelect,id:t.id,name:t.name,thumbnail:t.thumbnail,readonly:t.readonly})})),a=R.a.createElement("ul",{className:"mailpoet_boxes clearfix"},n)}var r=A.a.applyFilters("mailpoet_newsletters_template_breadcrumb",R.a.createElement(J.a,{step:"template"}),this.state.emailType,"template");return R.a.createElement("div",null,R.a.createElement("h1",null,q.a.I18n.t("selectTemplateTitle")),r,R.a.createElement(cn,{tabs:t,selected:this.state.selectedTab,select:function(t){return e.setState({selectedTab:t})}}),a)}}]),t}(R.a.Component);vn.contextType=Ge.a,vn.propTypes={match:Z.a.shape({params:Z.a.shape({id:Z.a.string}).isRequired}).isRequired};var bn=vn,_n=a(54),yn=a.n(_n),wn={closeText:q.a.I18n.t("close"),currentText:q.a.I18n.t("today"),nextText:q.a.I18n.t("next"),prevText:q.a.I18n.t("previous"),monthNames:[q.a.I18n.t("january"),q.a.I18n.t("february"),q.a.I18n.t("march"),q.a.I18n.t("april"),q.a.I18n.t("may"),q.a.I18n.t("june"),q.a.I18n.t("july"),q.a.I18n.t("august"),q.a.I18n.t("september"),q.a.I18n.t("october"),q.a.I18n.t("november"),q.a.I18n.t("december")],monthNamesShort:[q.a.I18n.t("januaryShort"),q.a.I18n.t("februaryShort"),q.a.I18n.t("marchShort"),q.a.I18n.t("aprilShort"),q.a.I18n.t("mayShort"),q.a.I18n.t("juneShort"),q.a.I18n.t("julyShort"),q.a.I18n.t("augustShort"),q.a.I18n.t("septemberShort"),q.a.I18n.t("octoberShort"),q.a.I18n.t("novemberShort"),q.a.I18n.t("decemberShort")],dayNames:[q.a.I18n.t("sunday"),q.a.I18n.t("monday"),q.a.I18n.t("tuesday"),q.a.I18n.t("wednesday"),q.a.I18n.t("thursday"),q.a.I18n.t("friday"),q.a.I18n.t("saturday")],dayNamesShort:[q.a.I18n.t("sundayShort"),q.a.I18n.t("mondayShort"),q.a.I18n.t("tuesdayShort"),q.a.I18n.t("wednesdayShort"),q.a.I18n.t("thursdayShort"),q.a.I18n.t("fridayShort"),q.a.I18n.t("saturdayShort")],dayNamesMin:[q.a.I18n.t("sundayMin"),q.a.I18n.t("mondayMin"),q.a.I18n.t("tuesdayMin"),q.a.I18n.t("wednesdayMin"),q.a.I18n.t("thursdayMin"),q.a.I18n.t("fridayMin"),q.a.I18n.t("saturdayMin")]},En=function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"onChange",(function(e){var t=e,n=t.target.value,r=a.getStorageDate(n);t.target.value=r,a.props.onChange(t)})),y()(K()(a),"getFieldName",(function(){return a.props.name||"date"})),y()(K()(a),"getDisplayDate",(function(e){var t={parseFormat:a.props.storageFormat,format:a.props.displayFormat};return q.a.Date.format(e,t)})),y()(K()(a),"getStorageDate",(function(e){var t={parseFormat:a.props.displayFormat,format:a.props.storageFormat};return q.a.Date.format(e,t)})),a.dateInput=R.a.createRef(),a}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){var e=ve()(this.dateInput.current),t=this;e.datepicker&&(ve.a.datepicker.parseDate=function(e,t){return q.a.Date.toDate(t,{parseFormat:this.props.displayFormat,format:e})},ve.a.datepicker.formatDate=function(e,t){return q.a.Date.format(t,{format:e})},e.datepicker(O.a.extend({dateFormat:this.props.displayFormat,firstDay:window.mailpoet_start_of_week,isRTL:!1,onSelect:function(e){t.onChange({target:{name:t.getFieldName(),value:e}})}},wn)),this.datepickerInitialized=!0)}},{key:"componentWillUnmount",value:function(){this.datepickerInitialized&&ve()(this.dateInput.current).datepicker("destroy")}},{key:"render",value:function(){return R.a.createElement("input",pe()({type:"text",size:"30",name:this.getFieldName(),value:this.getDisplayDate(this.props.value),readOnly:!0,disabled:this.props.disabled,onChange:this.onChange,ref:this.dateInput},this.props.validation))}}]),t}(R.a.Component);En.propTypes={displayFormat:Z.a.string.isRequired,onChange:Z.a.func.isRequired,name:Z.a.string,storageFormat:Z.a.string.isRequired,value:Z.a.string.isRequired,disabled:Z.a.bool.isRequired,validation:Z.a.object.isRequired},En.defaultProps={name:"date"};var kn=En,In=function(e){function t(){return M()(this,t),U()(this,W()(t).apply(this,arguments))}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t=this,a=x()(e=b()(this.props.timeOfDayItems)).call(e,(function(e){return R.a.createElement("option",{key:"option-".concat(t.props.timeOfDayItems[e]),value:e},t.props.timeOfDayItems[e])}));return R.a.createElement("select",pe()({name:this.props.name||"time",value:this.props.value,disabled:this.props.disabled,onChange:this.props.onChange},this.props.validation),a)}}]),t}(R.a.Component);In.propTypes={timeOfDayItems:Z.a.objectOf(Z.a.string).isRequired,name:Z.a.string,value:Z.a.string.isRequired,disabled:Z.a.bool,onChange:Z.a.func.isRequired,validation:Z.a.object},In.defaultProps={name:"time",disabled:!1,validation:{}};var Sn=In,Cn=function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"DATE_TIME_SEPARATOR"," "),y()(K()(a),"getDateTime",(function(){return[a.state.date,a.state.time].join(a.DATE_TIME_SEPARATOR)})),y()(K()(a),"buildStateFromProps",(function(e){var t=(e.value||a.props.defaultDateTime).split(a.DATE_TIME_SEPARATOR),n=Ne()(t,2);return{date:n[0],time:n[1]}})),y()(K()(a),"handleChange",(function(e){var t={};t[e.target.name]=e.target.value,a.setState(t,a.propagateChange)})),y()(K()(a),"propagateChange",(function(){a.props.onChange&&a.props.onChange({target:{name:a.props.name||"",value:a.getDateTime()}})})),a.state=a.buildStateFromProps(e),a}return Y()(t,e),B()(t,[{key:"componentDidUpdate",value:function(e){var t=this;this.props.value===e.value&&this.props.defaultDateTime===e.defaultDateTime||Sa()((function(){t.setState(t.buildStateFromProps(t.props))}))}},{key:"render",value:function(){return R.a.createElement("span",null,R.a.createElement(kn,{name:"date",value:this.state.date,onChange:this.handleChange,displayFormat:this.props.dateDisplayFormat,storageFormat:this.props.dateStorageFormat,disabled:this.props.disabled,validation:this.props.dateValidation}),R.a.createElement(Sn,{name:"time",value:this.state.time,onChange:this.handleChange,disabled:this.props.disabled,validation:this.props.timeValidation,timeOfDayItems:this.props.timeOfDayItems}))}}]),t}(R.a.Component);Cn.propTypes={value:Z.a.string,defaultDateTime:Z.a.string.isRequired,dateDisplayFormat:Z.a.string.isRequired,dateStorageFormat:Z.a.string.isRequired,onChange:Z.a.func,name:Z.a.string,disabled:Z.a.bool,dateValidation:Z.a.object.isRequired,timeValidation:Z.a.any,timeOfDayItems:Z.a.objectOf(Z.a.string).isRequired},Cn.defaultProps={onChange:void 0,name:"",disabled:!1,timeValidation:void 0,value:void 0};var Nn=Cn,xn=window.location.hostname.replace("www.",""),Tn="contact@".concat(xn),Rn=function(e){var t,a=e.emailAddress;if(e.mssActive)return null;var n=a.split("@").pop().toLowerCase();return sn()(t=window.mailpoet_free_domains).call(t,n)>-1?R.a.createElement(R.a.Fragment,null,R.a.createElement("p",{className:"sender_email_address_warning","data-acceptance-id":"freemail-sender-warning-old-installation"},q.a.I18n.t("senderEmailAddressWarning1")),R.a.createElement("p",{className:"sender_email_address_warning"},St()(q.a.I18n.t("senderEmailAddressWarning2"),/(%1\$s|%2\$s|<em>.*<\/em>)/,(function(e){return"%1$s"===e?Tn:"%2$s"===e?R.a.createElement("em",{key:"sender-email"},a):R.a.createElement("em",{key:"reply-to"},e.replace(/<\/?em>/g,""))}))),R.a.createElement("p",{className:"sender_email_address_warning"},R.a.createElement("a",{href:"https://kb.mailpoet.com/article/259-your-from-address-cannot-be-yahoo-com-gmail-com-outlook-com","data-beacon-article":"5be5911104286304a71c176e",target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("senderEmailAddressWarning3")))):null};Rn.propTypes={emailAddress:Z.a.string.isRequired,mssActive:Z.a.bool.isRequired};var Pn=Rn,On=function(e){function t(e){var a,n;return M()(this,t),(n=U()(this,W()(t).call(this,e))).state={emailAddress:e.item.sender_address},n.onChange=F()(a=n.onChange).call(a,K()(n)),n}return Y()(t,e),B()(t,[{key:"onChange",value:function(e){this.setState({emailAddress:e.target.value}),this.props.onValueChange(e)}},{key:"render",value:function(){return R.a.createElement(R.a.Fragment,null,R.a.createElement(De,{item:this.props.item,field:this.props.field,onValueChange:this.onChange}),R.a.createElement("div",{className:"regular-text"},R.a.createElement(Pn,{emailAddress:this.state.emailAddress,mssActive:window.mailpoet_mss_active})))}}]),t}(R.a.Component);On.propTypes={field:Z.a.object.isRequired,item:Z.a.shape({sender_address:Z.a.string.isRequired}).isRequired,onValueChange:Z.a.func},On.defaultProps={onValueChange:function(){}};var Dn=On,An=window.mailpoet_current_time||"00:00",qn="".concat(window.mailpoet_current_date," 00:00:00"),Ln=window.mailpoet_schedule_time_of_day,Fn=window.mailpoet_date_display_format,jn=window.mailpoet_date_storage_format,Mn=function(e){function t(){var e,a,n;M()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=U()(this,(e=W()(t)).call.apply(e,E()(a=[this]).call(a,i))),y()(K()(n),"getCurrentValue",(function(){var e={isScheduled:"0",scheduledAt:qn};return O.a.defaults(n.props.item[n.props.field.name]||{},e)})),y()(K()(n),"getDateValidation",(function(){return{"data-parsley-required":!0,"data-parsley-required-message":q.a.I18n.t("noScheduledDateError"),"data-parsley-errors-container":"#mailpoet_scheduling"}})),y()(K()(n),"isScheduled",(function(){return"1"===n.getCurrentValue().isScheduled})),y()(K()(n),"handleCheckboxChange",(function(e){var t=e;return t.target.value=e.target.checked?"1":"0",n.handleValueChange(t)})),y()(K()(n),"handleValueChange",(function(e){var t=n.getCurrentValue(),a={};return a[e.target.name]=e.target.value,n.props.onValueChange({target:{name:n.props.field.name,value:O.a.extend({},t,a)}})})),n}return Y()(t,e),B()(t,[{key:"render",value:function(){var e;return this.isScheduled()&&(e=R.a.createElement("span",{id:"mailpoet_scheduling"},R.a.createElement(Nn,{name:"scheduledAt",value:this.getCurrentValue().scheduledAt,onChange:this.handleValueChange,disabled:this.props.field.disabled,dateValidation:this.getDateValidation(),defaultDateTime:qn,timeOfDayItems:Ln,dateDisplayFormat:Fn,dateStorageFormat:jn})," ",R.a.createElement("span",null,q.a.I18n.t("websiteTimeIs")," ",R.a.createElement("code",null,An)))),R.a.createElement("div",null,R.a.createElement("input",{type:"checkbox",value:"1",checked:this.isScheduled(),disabled:this.props.field.disabled,name:"isScheduled",onChange:this.handleCheckboxChange}),e)}}]),t}(R.a.Component);Mn.propTypes={item:Z.a.object,field:Z.a.shape({name:Z.a.string.isRequired,disabled:Z.a.bool}).isRequired,onValueChange:Z.a.func.isRequired},Mn.defaultProps={item:{}};var Vn=[{name:"subject",label:q.a.I18n.t("subjectLine"),tip:q.a.I18n.t("subjectLineTip"),type:"text",validation:{"data-parsley-required":!0,"data-parsley-required-message":q.a.I18n.t("emptySubjectLineError")}},{name:"segments",label:q.a.I18n.t("segments"),tip:q.a.I18n.t("segmentsTip"),type:"selection",placeholder:q.a.I18n.t("selectSegmentPlaceholder"),id:"mailpoet_segments",api_version:window.mailpoet_api_version,endpoint:"segments",multiple:!0,filter:function(e){return!e.deleted_at},getLabel:function(e){var t;return E()(t="".concat(e.name," (")).call(t,Se()(e.subscribers,10).toLocaleString(),")")},transformChangedValue:function(e){var t=this.getItems();return x()(O.a).call(O.a,e,(function(e){return me()(O.a).call(O.a,t,(function(t){return t.id===e}))}))},validation:{"data-parsley-required":!0,"data-parsley-required-message":q.a.I18n.t("noSegmentsSelectedError")}},{name:"sender",label:q.a.I18n.t("sender"),tip:q.a.I18n.t("senderTip"),fields:[{name:"sender_name",type:"text",placeholder:q.a.I18n.t("senderNamePlaceholder"),validation:{"data-parsley-required":!0}},{name:"sender_address",type:"reactComponent",component:Dn,placeholder:q.a.I18n.t("senderAddressPlaceholder"),validation:{"data-parsley-required":!0,"data-parsley-type":"email"}}]},{name:"reply-to",label:q.a.I18n.t("replyTo"),tip:q.a.I18n.t("replyToTip"),inline:!0,fields:[{name:"reply_to_name",type:"text",placeholder:q.a.I18n.t("replyToNamePlaceholder")},{name:"reply_to_address",type:"text",placeholder:q.a.I18n.t("replyToAddressPlaceholder"),validation:{"data-parsley-type":"email"}}]},pa,{name:"options",label:q.a.I18n.t("scheduleIt"),type:"reactComponent",component:Mn}];Vn=A.a.applyFilters("mailpoet_newsletters_3rd_step_fields",Vn);var Bn={getFields:function(){return Vn},getSendButtonOptions:function(e){var t=e||{},a={value:"object"===yn()(t.options)&&"1"===t.options.isScheduled?q.a.I18n.t("schedule"):q.a.I18n.t("send")};return"sent"!==t.status&&"sending"!==t.status||(a.disabled="disabled"),a}},zn={name:"intervalType",values:Le},Un={name:"timeOfDay",values:Fe},$n={name:"weekDay",values:je},Wn={name:"monthDay",values:Me},Hn={name:"nthWeekDay",values:Ve},Kn=function(e){function t(){var e,a,n;M()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=U()(this,(e=W()(t)).call.apply(e,E()(a=[this]).call(a,i))),y()(K()(n),"getCurrentValue",(function(){return n.props.item[n.props.field.name]||{}})),y()(K()(n),"handleValueChanges",(function(e){var t=n.getCurrentValue();return n.props.onValueChange({target:{name:n.props.field.name,value:O.a.extend({},t,e)}})})),y()(K()(n),"handleIntervalChange",(function(e){var t=e.target.value,a={};a.intervalType=t,"monthly"===t&&(a.monthDay="1"),n.handleValueChanges(a)})),y()(K()(n),"handleTimeOfDayChange",(function(e){return n.handleValueChanges({timeOfDay:e.target.value})})),y()(K()(n),"handleWeekDayChange",(function(e){return n.handleValueChanges({weekDay:e.target.value})})),y()(K()(n),"handleMonthDayChange",(function(e){return n.handleValueChanges({monthDay:e.target.value})})),y()(K()(n),"handleNthWeekDayChange",(function(e){return n.handleValueChanges({nthWeekDay:e.target.value})})),n}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t,a,n,r=this.getCurrentValue();return"immediately"!==r.intervalType&&(e=R.a.createElement(Ta,{field:Un,item:this.getCurrentValue(),onValueChange:this.handleTimeOfDayChange})),"weekly"!==r.intervalType&&"nthWeekDay"!==r.intervalType||(t=R.a.createElement(Ta,{field:$n,item:this.getCurrentValue(),onValueChange:this.handleWeekDayChange})),"monthly"===r.intervalType&&(a=R.a.createElement(Ta,{field:Wn,item:this.getCurrentValue(),onValueChange:this.handleMonthDayChange})),"nthWeekDay"===r.intervalType&&(n=R.a.createElement(Ta,{field:Hn,item:this.getCurrentValue(),onValueChange:this.handleNthWeekDayChange})),R.a.createElement("div",null,R.a.createElement(Ta,{field:zn,item:this.getCurrentValue(),onValueChange:this.handleIntervalChange,automationId:"newsletter_interval_type"}),n,a,t,e)}}]),t}(R.a.Component);Kn.propTypes={item:Z.a.object.isRequired,field:Z.a.shape({name:Z.a.string}).isRequired,onValueChange:Z.a.func.isRequired};var Gn=Kn,Yn=[{name:"subject",label:q.a.I18n.t("subjectLine"),tip:q.a.I18n.t("postNotificationSubjectLineTip"),type:"text",validation:{"data-parsley-required":!0,"data-parsley-required-message":q.a.I18n.t("emptySubjectLineError")}},{name:"options",label:q.a.I18n.t("selectFrequency"),type:"reactComponent",component:Gn},{name:"segments",label:q.a.I18n.t("segments"),tip:q.a.I18n.t("segmentsTip"),type:"selection",placeholder:q.a.I18n.t("selectSegmentPlaceholder"),id:"mailpoet_segments",api_version:window.mailpoet_api_version,endpoint:"segments",multiple:!0,filter:function(e){return!e.deleted_at},getLabel:function(e){var t;return E()(t="".concat(e.name," (")).call(t,Se()(e.subscribers,10).toLocaleString(),")")},transformChangedValue:function(e){var t=this.getItems();return x()(O.a).call(O.a,e,(function(e){return me()(O.a).call(O.a,t,(function(t){return t.id===e}))}))},validation:{"data-parsley-required":!0,"data-parsley-required-message":q.a.I18n.t("noSegmentsSelectedError")}},{name:"sender",label:q.a.I18n.t("sender"),tip:q.a.I18n.t("senderTip"),fields:[{name:"sender_name",type:"text",placeholder:q.a.I18n.t("senderNamePlaceholder"),validation:{"data-parsley-required":!0}},{name:"sender_address",type:"reactComponent",component:Dn,placeholder:q.a.I18n.t("senderAddressPlaceholder"),validation:{"data-parsley-required":!0,"data-parsley-type":"email"}}]},{name:"reply-to",label:q.a.I18n.t("replyTo"),tip:q.a.I18n.t("replyToTip"),inline:!0,fields:[{name:"reply_to_name",type:"text",placeholder:q.a.I18n.t("replyToNamePlaceholder")},{name:"reply_to_address",type:"text",placeholder:q.a.I18n.t("replyToAddressPlaceholder"),validation:{"data-parsley-type":"email"}}]},pa];Yn=A.a.applyFilters("mailpoet_newsletters_3rd_step_fields",Yn);var Jn={getFields:function(){return Yn},getSendButtonOptions:function(){return{value:q.a.I18n.t("activate")}}},Qn=window.mailpoet_roles||{},Zn=h()(O.a).call(O.a,window.mailpoet_segments||[],(function(e){return"default"===e.type})),Xn={name:"event",values:{segment:q.a.I18n.t("onSubscriptionToList"),user:q.a.I18n.t("onWPUserRegistration")}},er={name:"segment",values:O.a.object(x()(O.a).call(O.a,Zn,(function(e){var t,a=E()(t="".concat(e.name," (")).call(t,Se()(e.subscribers,10).toLocaleString(),")");return[e.id,a]}))),sortBy:function(e,t){return t.toLowerCase()}},tr={name:"role",values:Qn},ar={name:"afterTimeNumber",size:3},nr={name:"afterTimeType",values:qe},rr=function(e){function t(){var e,a,n;M()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=U()(this,(e=W()(t)).call.apply(e,E()(a=[this]).call(a,i))),y()(K()(n),"getCurrentValue",(function(){return n.props.item[n.props.field.name]||{}})),y()(K()(n),"handleValueChange",(function(e,t){var a=n.getCurrentValue(),r={};return r[e]=t,n.props.onValueChange({target:{name:n.props.field.name,value:O.a.extend({},a,r)}})})),y()(K()(n),"handleEventChange",(function(e){return n.handleValueChange("event",e.target.value)})),y()(K()(n),"handleSegmentChange",(function(e){return n.handleValueChange("segment",e.target.value)})),y()(K()(n),"handleRoleChange",(function(e){return n.handleValueChange("role",e.target.value)})),y()(K()(n),"handleAfterTimeNumberChange",(function(e){return n.handleValueChange("afterTimeNumber",e.target.value)})),y()(K()(n),"handleAfterTimeTypeChange",(function(e){return n.handleValueChange("afterTimeType",e.target.value)})),y()(K()(n),"handleNext",(function(){q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"create",data:{type:"welcome",options:n.state}}).done((function(e){n.showTemplateSelection(e.data.id)})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))})),y()(K()(n),"showTemplateSelection",(function(e){n.props.history.push("/template/".concat(e))})),n}return Y()(t,e),B()(t,[{key:"render",value:function(){var e,t,a=this.getCurrentValue();return e="user"===a.event?R.a.createElement(Ta,{field:tr,item:this.getCurrentValue(),onValueChange:this.handleRoleChange}):R.a.createElement(Ta,{field:er,item:this.getCurrentValue(),onValueChange:this.handleSegmentChange}),"immediate"!==a.afterTimeType&&(t=R.a.createElement(De,{field:ar,item:this.getCurrentValue(),onValueChange:this.handleAfterTimeNumberChange})),R.a.createElement("div",null,R.a.createElement(Ta,{field:Xn,item:this.getCurrentValue(),onValueChange:this.handleEventChange}),e,t,R.a.createElement(Ta,{field:nr,item:this.getCurrentValue(),onValueChange:this.handleAfterTimeTypeChange}))}}]),t}(R.a.Component);rr.propTypes={history:Z.a.shape({push:Z.a.func.isRequired}).isRequired,item:Z.a.object.isRequired,field:Z.a.shape({name:Z.a.string}).isRequired,onValueChange:Z.a.func.isRequired};var ir=Object(ne.withRouter)(rr),sr=[{name:"subject",label:q.a.I18n.t("subjectLine"),tip:q.a.I18n.t("subjectLineTip"),type:"text",validation:{"data-parsley-required":!0,"data-parsley-required-message":q.a.I18n.t("emptySubjectLineError")}},{name:"options",label:q.a.I18n.t("sendWelcomeEmailWhen"),type:"reactComponent",component:ir},{name:"sender",label:q.a.I18n.t("sender"),tip:q.a.I18n.t("senderTip"),fields:[{name:"sender_name",type:"text",placeholder:q.a.I18n.t("senderNamePlaceholder"),validation:{"data-parsley-required":!0}},{name:"sender_address",type:"reactComponent",component:Dn,placeholder:q.a.I18n.t("senderAddressPlaceholder"),validation:{"data-parsley-required":!0,"data-parsley-type":"email"}}]},{name:"reply-to",label:q.a.I18n.t("replyTo"),tip:q.a.I18n.t("replyToTip"),inline:!0,fields:[{name:"reply_to_name",type:"text",placeholder:q.a.I18n.t("replyToNamePlaceholder")},{name:"reply_to_address",type:"text",placeholder:q.a.I18n.t("replyToAddressPlaceholder"),validation:{"data-parsley-type":"email"}}]},pa];sr=A.a.applyFilters("mailpoet_newsletters_3rd_step_fields",sr);var or={getFields:function(){return sr},getSendButtonOptions:function(){return{value:q.a.I18n.t("activate")}}},lr=a(295),cr=a(485),ur=a.n(cr),pr=function(e,t){var a,n=ur()(t,{lower:!0}).replace(/[^a-z0-9]+/g,"-").replace(/-$/,"");return E()(a="".concat(n||"newsletter","_")).call(a,e)},dr=function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"getFieldsByNewsletter",(function(e){return a.getSubtype(e).getFields(e)})),y()(K()(a),"getSendButtonOptions",(function(){return a.getSubtype(a.state.item).getSendButtonOptions(a.state.item)})),y()(K()(a),"getSubtype",(function(e){switch(e.type){case"notification":return Jn;case"welcome":return or;default:return A.a.applyFilters("mailpoet_newsletters_send_newsletter_fields",Bn,e)}})),y()(K()(a),"getThumbnailPromise",(function(e){return a.state.thumbnailPromise?a.state.thumbnailPromise:Object(lr.b)(e)})),y()(K()(a),"isValid",(function(){return ve()("#mailpoet_newsletter").parsley().isValid()})),y()(K()(a),"isValidFromAddress",Wt()(Ut.a.mark((function e(){var t,n;return Ut.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("MailPoet"===window.mailpoet_mta_method){e.next=2;break}return e.abrupt("return",!0);case 2:return e.next=4,a.loadAuthorizedEmailAddresses();case 4:return t=e.sent,n=a.state.item.sender_address,e.abrupt("return",-1!==sn()(t).call(t,n));case 7:case"end":return e.stop()}}),e)})))),y()(K()(a),"showInvalidFromAddressError",(function(){var e=St()(q.a.I18n.t("newsletterInvalidFromAddress"),"%$1s",(function(){return a.state.item.sender_address}));e=St()(e,/\[link\](.*?)\[\/link\]/g,(function(e){return'<a href="https://account.mailpoet.com/authorization" target="_blank" rel="noopener noreferrer">'.concat(e,"</a>")})),ve()("#field_sender_address").parsley().addError("invalidFromAddress",{message:e.join(""),updateClass:!0})})),y()(K()(a),"removeInvalidFromAddressError",(function(){ve()("#field_sender_address").parsley().removeError("invalidFromAddress",{updateClass:!0})})),y()(K()(a),"loadItem",(function(e){return a.setState({loading:!0}),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"get",data:{id:e}}).done((function(e){var t="draft"===e.data.status?a.getThumbnailPromise(e.meta.preview_url):null,n=e.data;n.ga_campaign||(n.ga_campaign=pr(n.id,n.subject)),a.setState({item:e.data,fields:a.getFieldsByNewsletter(e.data),thumbnailPromise:t})})).fail((function(){a.setState({item:{}},(function(){a.props.history.push("/new")}))}))})),y()(K()(a),"saveTemplate",(function(e,t){a.getThumbnailPromise(e.meta.preview_url).then((function(n){q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletterTemplates",action:"save",data:{newsletter_id:e.data.id,name:e.data.subject,thumbnail:n,body:oe()(e.data.body),categories:'["recent"]'}}).fail((function(e){a.showError(e),a.setState({loading:!1}),q.a.Modal.loading(!1)})),t()})).catch((function(e){a.showError({errors:[e]})}))})),y()(K()(a),"loadAuthorizedEmailAddresses",Wt()(Ut.a.mark((function e(){var t;return Ut.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("MailPoet"===window.mailpoet_mta_method){e.next=2;break}return e.abrupt("return",[]);case 2:return e.next=4,q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"mailer",action:"getAuthorizedEmailAddresses"});case 4:return t=e.sent,e.abrupt("return",t.data||[]);case 6:case"end":return e.stop()}}),e)})))),y()(K()(a),"handleSend",(function(e){return e.preventDefault(),a.removeInvalidFromAddressError(),a.isValid()?(q.a.Modal.loading(!0),a.isValidFromAddress().then((function(t){return t?a.saveNewsletter(e).done((function(){a.setState({loading:!0})})).done((function(e){switch(e.data.type){case"notification":case"welcome":return a.activateNewsletter(e);default:return a.sendNewsletter(e)}})).fail((function(e){a.showError(e),a.setState({loading:!1}),q.a.Modal.loading(!1)})):(a.showInvalidFromAddressError(),q.a.Modal.loading(!1))}))):ve()("#mailpoet_newsletter").parsley().validate()})),y()(K()(a),"sendNewsletter",(function(e){return q.a.Ajax.post(A.a.applyFilters("mailpoet_newsletters_send_server_request_parameters",{api_version:window.mailpoet_api_version,endpoint:"sendingQueue",action:"add",data:{newsletter_id:a.state.item.id}},a.state.item)).done((function(t){a.saveTemplate(e,(function(){if(window.mailpoet_show_congratulate_after_first_newsletter)return q.a.Modal.loading(!1),void a.props.history.push("/send/congratulate/".concat(a.state.item.id));a.props.history.push(A.a.applyFilters("mailpoet_newsletters_send_server_request_response_redirect","/".concat(a.state.item.type||""),a.state.item));var e=A.a.applyFilters("mailpoet_newsletters_send_server_request_response",a.state.item,t);O.a.isFunction(e)?e():"scheduled"===t.data.status?(a.context.notices.success(R.a.createElement("p",null,q.a.I18n.t("newsletterHasBeenScheduled"))),q.a.trackEvent("Emails > Newsletter sent",{scheduled:!0,"MailPoet Free version":window.mailpoet_version})):(a.context.notices.success(R.a.createElement("p",null,q.a.I18n.t("newsletterBeingSent")),{id:"mailpoet_notice_being_sent"}),q.a.trackEvent("Emails > Newsletter sent",{scheduled:!1,"MailPoet Free version":window.mailpoet_version})),q.a.Modal.loading(!1)}))})).fail((function(e){a.showError(e),a.setState({loading:!1}),q.a.Modal.loading(!1)}))})),y()(K()(a),"activateNewsletter",(function(e){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"setStatus",data:{id:a.props.match.params.id,status:"active"}}).done((function(t){a.saveTemplate(e,(function(){if(window.mailpoet_show_congratulate_after_first_newsletter)return q.a.Modal.loading(!1),void a.props.history.push("/send/congratulate/".concat(a.state.item.id));a.props.history.push("/".concat(a.state.item.type||""));var e,n=a.state.item.options;"welcome"===t.data.type?(a.context.notices.success(R.a.createElement("p",null,q.a.I18n.t("welcomeEmailActivated"))),q.a.trackEvent("Emails > Welcome email activated",{"MailPoet Free version":window.mailpoet_version,"List type":n.event,Delay:E()(e="".concat(n.afterTimeNumber," ")).call(e,n.afterTimeType)})):"notification"===t.data.type&&(a.context.notices.success(R.a.createElement("p",null,q.a.I18n.t("postNotificationActivated"))),q.a.trackEvent("Emails > Post notifications activated",{"MailPoet Free version":window.mailpoet_version,Frequency:n.intervalType}));q.a.Modal.loading(!1)}))})).fail((function(e){a.showError(e),a.setState({loading:!1}),q.a.Modal.loading(!1)}))})),y()(K()(a),"handleResume",(function(e){return e.preventDefault(),a.isValid()?a.saveNewsletter(e).done((function(){a.setState({loading:!0})})).done((function(){q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"sendingQueue",action:"resume",data:{newsletter_id:a.state.item.id}}).done((function(){a.props.history.push("/".concat(a.state.item.type||"")),a.context.notices.success(R.a.createElement("p",null,q.a.I18n.t("newsletterSendingHasBeenResumed")))})).fail((function(e){a.showError(e)}))})).fail((function(e){a.showError(e)})).always((function(){a.setState({loading:!1})})):ve()("#mailpoet_newsletter").parsley().validate(),!1})),y()(K()(a),"handleSave",(function(e){e.preventDefault(),a.saveNewsletter(e).done((function(){a.context.notices.success(R.a.createElement("p",null,q.a.I18n.t("newsletterUpdated")))})).done((function(){var e="automatic"===a.state.item.type?a.state.item.options.group:a.state.item.type;a.props.history.push("/".concat(e||""))})).fail((function(e){a.showError(e)}))})),y()(K()(a),"handleRedirectToDesign",(function(e){e.preventDefault();var t=e.target.href;a.saveNewsletter(e).done((function(){a.context.notices.success(R.a.createElement("p",null,q.a.I18n.t("newsletterUpdated")))})).done((function(){window.location=t})).fail((function(e){a.showError(e)}))})),y()(K()(a),"saveNewsletter",(function(){var e=a.state.item;e.queue=void 0,a.setState({loading:!0});var t=O.a.omit(e,["preheader","body","created_at","deleted_at","hash","status","updated_at","type"]);return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"save",data:t})})),y()(K()(a),"showError",(function(e){var t;e.errors.length>0&&a.context.notices.error(x()(t=e.errors).call(t,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0})})),y()(K()(a),"handleFormChange",(function(e){var t=e.target.name,n=e.target.value;return a.setState((function(e){var a=e.item,r=a.subject,i=a.ga_campaign;(a[t]=n,"subject"===t)&&(i===pr(a.id,r)&&(a.ga_campaign=pr(a.id,n)));return{item:a}})),!0})),a.state={fields:[],item:{},loading:!0,thumbnailPromise:null},a}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){var e=this;this.loadItem(this.props.match.params.id).always((function(){e.setState({loading:!1})})),ve()("#mailpoet_newsletter").parsley()}},{key:"componentDidUpdate",value:function(e){var t=this;this.props.match.params.id!==e.match.params.id&&this.loadItem(this.props.match.params.id).always((function(){t.setState({loading:!1})}))}},{key:"render",value:function(){var e,t="sending"===this.state.item.status&&this.state.item.queue&&"paused"===this.state.item.queue.status,a=x()(e=this.state.fields).call(e,(function(e){var a=e;return"segments"!==e.name&&"options"!==e.name||(a.disabled=t),a})),n=this.getSendButtonOptions(),r=A.a.applyFilters("mailpoet_newsletters_send_breadcrumb",R.a.createElement(J.a,{step:"send"}),this.state.item.type,"send"),i=window.mailpoet_subscribers_limit_reached||window.mailpoet_mss_key_pending_approval;return R.a.createElement("div",null,R.a.createElement("h1",null,q.a.I18n.t("finalNewsletterStep")),r,R.a.createElement($a,{id:"mailpoet_newsletter",fields:a,automationId:"newsletter_send_form",item:this.state.item,loading:this.state.loading,onChange:this.handleFormChange,onSubmit:this.handleSave},R.a.createElement(Zt,null),R.a.createElement(ea,{mssKeyInvalid:window.mailpoet_mss_key_invalid,subscribersCount:window.mailpoet_subscribers_count}),R.a.createElement("p",{className:"submit"},t?R.a.createElement("input",{className:"button button-primary",type:"button",onClick:this.handleResume,value:q.a.I18n.t("resume"),disabled:i}):R.a.createElement("input",pe()({className:"button button-primary",type:"button",onClick:this.handleSend,value:q.a.I18n.t("send")},n,{disabled:i}))," ",R.a.createElement("input",{className:"button button-secondary",type:"submit",value:q.a.I18n.t("saveDraftAndClose")})," ",q.a.I18n.t("orSimply")," ",R.a.createElement("a",{href:"?page=mailpoet-newsletter-editor&id=".concat(this.props.match.params.id),onClick:this.handleRedirectToDesign},q.a.I18n.t("goBackToDesign")),"."),!t&&n.disabled&&"disabled"===n.disabled&&R.a.createElement(qt.a,{tooltip:q.a.I18n.t("helpTooltipSendEmail"),tooltipId:"helpTooltipSendEmail"}),window.mailpoet_mss_key_pending_approval&&R.a.createElement("div",{className:"mailpoet_error"},St()(q.a.I18n.t("pendingKeyApprovalNotice"),/\[link\](.*?)\[\/link\]/g,(function(e){return R.a.createElement("a",{key:"pendingKeyApprovalNoticeLink",href:"https://account.mailpoet.com/authorization",target:"_blank",rel:"noopener noreferrer"},e)})))))}}]),t}(R.a.Component);dr.contextType=Ge.a,dr.propTypes={match:Z.a.shape({params:Z.a.shape({id:Z.a.string}).isRequired}).isRequired,history:Z.a.shape({push:Z.a.func.isRequired}).isRequired};var mr=Object(ne.withRouter)(dr);function hr(e){return R.a.createElement("div",{className:"mailpoet_congratulate_success"},R.a.createElement("h1",null,"welcome"===(t=e.newsletter).type?q.a.I18n.t("congratulationsWelcomeEmailSuccessHeader"):"notification"===t.type?q.a.I18n.t("congratulationsPostNotificationSuccessHeader"):"automatic"===t.type?q.a.I18n.t("congratulationsWooSuccessHeader"):"scheduled"===t.status?q.a.I18n.t("congratulationsScheduleSuccessHeader"):q.a.I18n.t("congratulationsSendSuccessHeader")),R.a.createElement("img",{src:e.illustrationImageUrl,alt:"",width:"750",height:"250"}),R.a.createElement("button",{type:"button",className:"button",onClick:e.successClicked},q.a.I18n.t("close")));var t}hr.propTypes={successClicked:Z.a.func.isRequired,illustrationImageUrl:Z.a.string.isRequired,newsletter:Z.a.shape({status:Z.a.string.isRequired,type:Z.a.string.isRequired}).isRequired};var fr=hr,gr=a(67),vr=a.n(gr),br=function(e){var t,a;return e.step>e.steps_count?null:R.a.createElement("div",{className:"mailpoet_stepped_progress_bar"},x()(t=I()(vr()(a=Array(e.steps_count)).call(a))).call(t,(function(t){var a;return R.a.createElement("div",{className:E()(a="\n              mailpoet_stepped_progress_bar_step ".concat(t<e.step?"active":""," ")).call(a,t===e.step-1?"current":"","\n             "),key:"step_".concat(t)})})))};br.propTypes={steps_count:Z.a.number.isRequired,step:Z.a.number.isRequired};var _r=br,yr=function(e){return R.a.createElement("div",{className:"mailpoet_welcome_wizard_flex"},R.a.createElement("div",{className:"mailpoet_welcome_wizard_illustration"},R.a.createElement("img",{src:e.illustrationUrl,alt:""})),R.a.createElement("div",{className:"mailpoet_welcome_wizard_step"},e.displayProgressBar&&e.step<=e.stepsCount?R.a.createElement(_r,{steps_count:e.stepsCount,step:e.step}):null,e.children))};yr.propTypes={illustrationUrl:Z.a.string.isRequired,displayProgressBar:Z.a.bool,step:Z.a.number,stepsCount:Z.a.number,children:Z.a.oneOfType([Z.a.arrayOf(Z.a.node),Z.a.node]).isRequired},yr.defaultProps={displayProgressBar:!0,step:0,stepsCount:-1};var wr=yr,Er=function(){return R.a.createElement("ul",{className:"welcome_wizard_tracking_list"},R.a.createElement("li",null,q.a.I18n.t("welcomeWizardMSSList1")),R.a.createElement("li",null,q.a.I18n.t("welcomeWizardMSSList2")),R.a.createElement("li",null,q.a.I18n.t("welcomeWizardMSSList4")),R.a.createElement("li",null,q.a.I18n.t("welcomeWizardMSSList5")))},kr=function(e){return R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_controls"},R.a.createElement("p",null,R.a.createElement("a",{href:e.mailpoetAccountUrl,target:"_blank",rel:"noopener noreferrer",className:"button button-primary",onClick:function(t){t.preventDefault(),window.open(e.mailpoetAccountUrl),e.next()}},e.nextButtonText)),R.a.createElement("p",null,R.a.createElement("a",{onClick:e.next,role:"button",tabIndex:0,onKeyDown:function(t){var a,n;C()(a=["keydown","keypress"]).call(a,t.type)&&C()(n=["Enter"," "]).call(n,t.key)&&(t.preventDefault(),e.next())}},q.a.I18n.t("welcomeWizardMSSNoThanks"))))};kr.propTypes={mailpoetAccountUrl:Z.a.string.isRequired,next:Z.a.func.isRequired,nextButtonText:Z.a.string.isRequired};var Ir=function(e){return R.a.createElement(R.a.Fragment,null,R.a.createElement("h1",null,q.a.I18n.t("welcomeWizardMSSFreeTitle")),R.a.createElement("p",null,q.a.I18n.t("welcomeWizardMSSFreeSubtitle")),R.a.createElement("p",null,q.a.I18n.t("welcomeWizardMSSFreeListTitle"),":"),R.a.createElement(Er,null),R.a.createElement(kr,{mailpoetAccountUrl:e.mailpoetAccountUrl,next:e.next,nextButtonText:q.a.I18n.t("welcomeWizardMSSFreeButton")}))};Ir.propTypes={mailpoetAccountUrl:Z.a.string.isRequired,next:Z.a.func.isRequired};var Sr=function(e){return R.a.createElement(R.a.Fragment,null,R.a.createElement("h1",null,q.a.I18n.t("welcomeWizardMSSNotFreeTitle")),R.a.createElement("p",null,q.a.I18n.t("welcomeWizardMSSNotFreeSubtitle"),":"),R.a.createElement("p",null,q.a.I18n.t("welcomeWizardMSSFreeListTitle"),":"),R.a.createElement(Er,null),R.a.createElement(kr,{mailpoetAccountUrl:e.mailpoetAccountUrl,next:e.next,nextButtonText:q.a.I18n.t("welcomeWizardMSSNotFreeButton")}))};Sr.propTypes={mailpoetAccountUrl:Z.a.string.isRequired,next:Z.a.func.isRequired};var Cr=function(e){return R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_content"},e.subscribersCount<1e3?R.a.createElement(Ir,{mailpoetAccountUrl:e.mailpoetAccountUrl,next:e.next}):R.a.createElement(Sr,{mailpoetAccountUrl:e.mailpoetAccountUrl,next:e.next}))};Cr.propTypes={next:Z.a.func.isRequired,subscribersCount:Z.a.number.isRequired,mailpoetAccountUrl:Z.a.string.isRequired};var Nr=Cr;function xr(e){return R.a.createElement("div",{className:"mailpoet_congratulate_success mailpoet_congratulate_mss_pitch"},R.a.createElement(wr,{illustrationUrl:e.MSSPitchIllustrationUrl,displayProgressBar:!1},R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_content"},R.a.createElement("h1",null,q.a.I18n.t("congratulationsMSSPitchHeader")),R.a.createElement("h2",null,q.a.I18n.t("congratulationsMSSPitchSubHeader")),R.a.createElement("p",null,q.a.I18n.t(e.subscribersCount<1e3?"welcomeWizardMSSFreeSubtitle":"welcomeWizardMSSNotFreeSubtitle")),R.a.createElement("p",null,q.a.I18n.t("welcomeWizardMSSFreeListTitle"),":"),R.a.createElement(Er,null),R.a.createElement(kr,{mailpoetAccountUrl:e.mailpoetAccountUrl,next:e.onFinish,nextButtonText:q.a.I18n.t("welcomeWizardMSSFreeButton")}))))}xr.propTypes={MSSPitchIllustrationUrl:Z.a.string.isRequired,onFinish:Z.a.func.isRequired,subscribersCount:Z.a.number.isRequired,mailpoetAccountUrl:Z.a.string.isRequired};var Tr=xr;function Rr(e){return window.has_mss_key_specified?R.a.createElement(fr,{successClicked:e.successClicked,illustrationImageUrl:e.illustrationImageUrl,newsletter:e.newsletter}):R.a.createElement(Tr,{MSSPitchIllustrationUrl:e.MSSPitchIllustrationUrl,onFinish:e.successClicked,subscribersCount:e.subscribersCount,mailpoetAccountUrl:e.mailpoetAccountUrl})}function Pr(e){return R.a.createElement(Rr,{successClicked:e.successClicked,illustrationImageUrl:e.illustrationImageUrl,MSSPitchIllustrationUrl:e.MSSPitchIllustrationUrl,newsletter:e.newsletter,subscribersCount:e.subscribersCount,mailpoetAccountUrl:e.mailpoetAccountUrl})}Pr.propTypes={successClicked:Z.a.func.isRequired,illustrationImageUrl:Z.a.string.isRequired,MSSPitchIllustrationUrl:Z.a.string.isRequired,newsletter:Z.a.shape({status:Z.a.string.isRequired,type:Z.a.string.isRequired}).isRequired,subscribersCount:Z.a.number.isRequired,mailpoetAccountUrl:Z.a.string.isRequired},Rr.propTypes={successClicked:Z.a.func.isRequired,illustrationImageUrl:Z.a.string.isRequired,MSSPitchIllustrationUrl:Z.a.string.isRequired,newsletter:Z.a.shape({status:Z.a.string.isRequired,type:Z.a.string.isRequired}).isRequired,subscribersCount:Z.a.number.isRequired,mailpoetAccountUrl:Z.a.string.isRequired};var Or=Pr;function Dr(e){return R.a.createElement("div",{className:"mailpoet_centered"},R.a.createElement("h1",null,q.a.I18n.t("congratulationsSendFailHeader")),R.a.createElement("p",null,St()(q.a.I18n.t("congratulationsSendFailExplain"),/\[link\](.*?)\[\/link\]/g,(function(e,t){return R.a.createElement("a",{key:t,target:"_blank",rel:"noopener noreferrer",href:"https://kb.mailpoet.com/article/231-sending-does-not-work","data-beacon-article":"5a0257ac2c7d3a272c0d7ad6"},e)}))),R.a.createElement("button",{type:"button",className:"button",onClick:e.failClicked},q.a.I18n.t("close")))}Dr.propTypes={failClicked:Z.a.func.isRequired};var Ar=Dr;var qr=function(){return R.a.createElement("div",{className:"mailpoet_loading"},R.a.createElement("div",{className:"mailpoet_modal_loading mailpoet_modal_loading_1"}),R.a.createElement("div",{className:"mailpoet_modal_loading mailpoet_modal_loading_2"}),R.a.createElement("div",{className:"mailpoet_modal_loading mailpoet_modal_loading_3"}))};function Lr(e){return R.a.createElement("div",{className:"mailpoet_newsletter_loading"},R.a.createElement(qr,null),(t=e.showRichLoadingScreen,a=e.illustrationImageUrl,t?R.a.createElement("div",null,R.a.createElement("h1",{className:"mailpoet_newsletter_loading_header"},q.a.I18n.t("congratulationsLoadingHeader")),R.a.createElement("img",{src:a,alt:"",width:"800px",height:"266px"})):R.a.createElement("div",null)));var t,a}Lr.propTypes={illustrationImageUrl:Z.a.string.isRequired,showRichLoadingScreen:Z.a.bool.isRequired};var Fr=Lr;function jr(){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"settings",action:"set",data:{show_congratulate_after_first_newsletter:!1}}).always((function(){window.location=window.mailpoet_main_page}))}var Mr=function(e){function t(e){var a,n;return M()(this,t),(n=U()(this,W()(t).call(this,e))).state={loading:!0,newsletter:null,testingPassed:!1,timeStart:Dt()(),minimumLoadingTimePassed:!1},n.tick=F()(a=n.tick).call(a,K()(n)),n}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){this.loadNewsletter(this.props.match.params.id),this.tick()}},{key:"componentDidUpdate",value:function(e){e.match.params.id!==this.props.match.params.id&&this.loadNewsletter(this.props.match.params.id)}},{key:"tick",value:function(){Dt()().subtract(20,"second").isAfter(this.state.timeStart)&&this.setState({error:!0,loading:!1}),this.state.loading&&this.loadNewsletter(this.props.match.params.id),Dt()().subtract(6,"seconds").isAfter(this.state.timeStart)&&this.setState({minimumLoadingTimePassed:!0}),!this.state.loading&&this.state.minimumLoadingTimePassed||Yt()(this.tick,2e3)}},{key:"loadNewsletter",value:function(e){var t=this;q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"get",data:{id:e}}).done((function(e){return t.newsletterLoaded(e.data)}))}},{key:"newsletterLoaded",value:function(e){"standard"!==e.type||"scheduled"===e.status?this.setState({newsletter:e,loading:!1,minimumLoadingTimePassed:!0}):"sent"===e.status||"sending"===e.status?this.setState({newsletter:e,loading:!1,testingPassed:!0}):this.setState({newsletter:e})}},{key:"renderContent",value:function(){return this.state.loading||!this.state.minimumLoadingTimePassed?(e=!!this.state.newsletter,R.a.createElement(Fr,{illustrationImageUrl:window.mailpoet_congratulations_loading_image,successClicked:jr,showRichLoadingScreen:e})):this.state.error?(q.a.trackEvent("Cron testing done",{"Cron is working":"false"}),R.a.createElement(Ar,{failClicked:function(){window.location=window.mailpoet_main_page}})):(t=this.state.newsletter,this.state.testingPassed&&q.a.trackEvent("Cron testing done",{"Cron is working":"true"}),R.a.createElement(Or,{illustrationImageUrl:window.mailpoet_congratulations_success_image,MSSPitchIllustrationUrl:window.MSS_pitch_illustration_url,successClicked:jr,newsletter:t,isWoocommerceActive:window.mailpoet_woocommerce_active,subscribersCount:window.mailpoet_subscribers_count,mailpoetAccountUrl:window.mailpoet_account_url}));var e,t}},{key:"render",value:function(){return R.a.createElement("div",{className:"newsletter_congratulate_page"},this.renderContent())}}]),t}(R.a.Component);Mr.propTypes={match:Z.a.shape({params:Z.a.shape({id:Z.a.string}).isRequired}).isRequired};var Vr=Mr,Br=function(e){function t(){var e,a,n;M()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=U()(this,(e=W()(t)).call.apply(e,E()(a=[this]).call(a,i))),y()(K()(n),"showTemplateSelection",(function(e){n.props.history.push("/template/".concat(e))})),n}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){var e=this;q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"create",data:{type:"standard"}}).done((function(t){e.showTemplateSelection(t.data.id)})).fail((function(t){var a;t.errors.length>0&&e.context.notices.error(x()(a=t.errors).call(a,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0})}))}},{key:"render",value:function(){return R.a.createElement("div",null,R.a.createElement("h1",null,q.a.I18n.t("regularNewsletterTypeTitle")),R.a.createElement(J.a,{step:"type"}))}}]),t}(R.a.Component);Br.contextType=Ge.a,Br.propTypes={history:Z.a.shape({push:Z.a.func.isRequired}).isRequired};var zr=Object(ne.withRouter)(Br),Ur={name:"options",type:"reactComponent",component:Gn},$r=function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"handleValueChange",(function(e){var t=a.state;t[e.target.name]=e.target.value,a.setState(t)})),y()(K()(a),"handleNext",(function(){q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"create",data:O.a.extend({},a.state,{type:"notification",subject:q.a.I18n.t("draftPostNotificationTitle")})}).done((function(e){a.showTemplateSelection(e.data.id)})).fail((function(e){var t;e.errors.length>0&&a.context.notices.error(x()(t=e.errors).call(t,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0})}))})),y()(K()(a),"showTemplateSelection",(function(e){a.props.history.push("/template/".concat(e))})),a.state={options:{intervalType:"daily",timeOfDay:0,weekDay:1,monthDay:0,nthWeekDay:1}},a}return Y()(t,e),B()(t,[{key:"render",value:function(){return R.a.createElement("div",null,R.a.createElement("h1",null,q.a.I18n.t("postNotificationNewsletterTypeTitle")),R.a.createElement(J.a,{step:"type"}),R.a.createElement("h3",null,q.a.I18n.t("selectFrequency")),R.a.createElement(Gn,{item:this.state,field:Ur,onValueChange:this.handleValueChange}),R.a.createElement("p",{className:"submit"},R.a.createElement("input",{className:"button button-primary",type:"button",onClick:this.handleNext,value:q.a.I18n.t("next")})))}}]),t}(R.a.Component);$r.contextType=Ge.a,$r.propTypes={history:Z.a.shape({push:Z.a.func.isRequired}).isRequired};var Wr=Object(ne.withRouter)($r),Hr={name:"options",label:"Event",type:"reactComponent",component:ir},Kr=function(e){function t(e){var a,n,r;M()(this,t),r=U()(this,W()(t).call(this,e));var i=window.mailpoet_segments||[],s=1;return i=h()(i).call(i,(function(e){return"default"===e.type})),O.a.size(i)>0&&(s=O.a.first(i).id),r.state={options:{event:"segment",segment:s,role:"subscriber",afterTimeNumber:1,afterTimeType:"immediate"}},r.handleValueChange=F()(a=r.handleValueChange).call(a,K()(r)),r.handleNext=F()(n=r.handleNext).call(n,K()(r)),r}return Y()(t,e),B()(t,[{key:"handleValueChange",value:function(e){var t=this.state;t[e.target.name]=e.target.value,this.setState(t)}},{key:"handleNext",value:function(){var e=this;q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"create",data:O.a.extend({},this.state,{type:"welcome",subject:q.a.I18n.t("draftNewsletterTitle")})}).done((function(t){e.showTemplateSelection(t.data.id)})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))}},{key:"showTemplateSelection",value:function(e){this.props.history.push("/template/".concat(e))}},{key:"render",value:function(){return R.a.createElement("div",null,R.a.createElement("h1",null,q.a.I18n.t("welcomeNewsletterTypeTitle")),R.a.createElement(J.a,{step:"type"}),R.a.createElement("h3",null,q.a.I18n.t("selectEventToSendWelcomeEmail")),R.a.createElement(ir,{item:this.state,field:Hr,onValueChange:this.handleValueChange}),R.a.createElement("p",{className:"submit"},R.a.createElement("input",{className:"button button-primary",type:"button",onClick:this.handleNext,value:q.a.I18n.t("next")})))}}]),t}(R.a.Component);Kr.propTypes={history:Z.a.shape({push:Z.a.func.isRequired}).isRequired};var Gr=Kr,Yr=a(486),Jr=a.n(Yr),Qr=function(e){var t=e.errors;return t.length<1?null:R.a.createElement(Qt,{type:"error",closable:!1},x()(t).call(t,(function(e){return R.a.createElement("p",{key:e.message},e.message)})))};Qr.propTypes={errors:Z.a.arrayOf(Z.a.shape({message:Z.a.string.isRequired})).isRequired};var Zr=Qr,Xr=Z.a.shape({status:Z.a.string,count_processed:Z.a.string.isRequired,count_total:Z.a.string.isRequired,scheduled_at:Z.a.string}),ei=Z.a.shape({id:Z.a.number.isRequired,queue:Z.a.oneOfType([Xr,Z.a.bool])}),ti=function(e){var t=e.queue,a=lt()("mailpoet_progress",{mailpoet_progress_complete:"completed"===t.status}),n=Math.round(100*t.count_processed/t.count_total),r=0;return Jr()(n)?(r=n,n+="%"):n=q.a.I18n.t("noSubscribers"),R.a.createElement("div",{className:a},R.a.createElement("span",{className:"mailpoet_progress_bar",style:{width:"".concat(r,"%")}}),R.a.createElement("span",{className:"mailpoet_progress_label"},n))};ti.propTypes={queue:Xr.isRequired};var ai=function(e){var t=e.newsletter;return R.a.createElement(st.b,{to:"/sending-status/".concat(t.id),"data-automation-id":"sending_status_".concat(t.id)},R.a.createElement("span",null,q.a.I18n.t("newsletterQueueCompleted").replace("%$1d",Se()(t.queue.count_processed,10).toLocaleString()).replace("%$2d",Se()(t.queue.count_total,10).toLocaleString())))};ai.propTypes={newsletter:ei.isRequired};var ni=function(e){var t=e.className,a=e.onClick,n=e.children;return R.a.createElement("a",{className:lt()("button",t),style:{display:"inline-block"},href:"#",onClick:function(e){e.preventDefault(),a(e)}},n)};ni.propTypes={className:Z.a.string,onClick:Z.a.func.isRequired,children:Z.a.string.isRequired},ni.defaultProps={className:""};var ri=function(e){var t=e.newsletter,a=R.a.useState("paused"===t.queue.status),n=Ne()(a,2),r=n[0],i=n[1],s=R.a.useState([]),o=Ne()(s,2),l=o[0],c=o[1];return R.a.createElement(R.a.Fragment,null,R.a.createElement(Zr,{errors:l}),R.a.createElement("span",null,Se()(t.queue.count_processed,10).toLocaleString(),"/",Se()(t.queue.count_total,10).toLocaleString(),"  ",r&&R.a.createElement(ni,{onClick:function(){c([]),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"sendingQueue",action:"resume",data:{newsletter_id:t.id}}).done((function(){return i(!1)})).fail((function(e){return c(e.errors)}))}},q.a.I18n.t("resume")),!r&&R.a.createElement(ni,{className:"mailpoet_pause",onClick:function(){c([]),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"sendingQueue",action:"pause",data:{newsletter_id:t.id}}).done((function(){return i(!0)})).fail((function(e){return c(e.errors)}))}},q.a.I18n.t("pause"))))};ri.propTypes={newsletter:ei.isRequired};var ii=function(e){var t=e.newsletter,a=e.mailerLog;return t.queue?"paused"===a.status&&"completed"!==t.queue.status?R.a.createElement("span",null,q.a.I18n.t("paused")):"scheduled"===t.queue.status?R.a.createElement("span",null,q.a.I18n.t("scheduledFor")," ",q.a.Date.format(t.queue.scheduled_at)):R.a.createElement("div",null,R.a.createElement(ti,{queue:t.queue}),R.a.createElement("p",{style:{textAlign:"center"}},"completed"===t.queue.status&&R.a.createElement(ai,{newsletter:t}),"completed"!==t.queue.status&&R.a.createElement(ri,{newsletter:t}))):R.a.createElement("span",null,q.a.I18n.t("notSentYet"))};ii.propTypes={newsletter:ei.isRequired,mailerLog:Z.a.shape({status:Z.a.string}).isRequired};var si=ii,oi=function(e){var t=e.mailpoetInstalledDaysAgo,a=e.sendTransactionalEmails,n=e.mtaMethod,r=e.noticeDismissed,i=e.apiVersion,s=Object(T.useState)(!1),o=Ne()(s,2),l=o[0],c=o[1],u=function(){q.a.Ajax.post({api_version:i,endpoint:"UserFlags",action:"set",data:{transactional_emails_opt_in_notice_dismissed:"1"}})};return t<30?null:a?null:"PHPMail"===n?null:"1"===r?null:l?null:R.a.createElement(Qt,{type:"success",timeout:!1,onClose:u},R.a.createElement("h3",null,q.a.I18n.t("transactionalEmailNoticeTitle")),R.a.createElement("p",null,q.a.I18n.t("transactionalEmailNoticeBody")," ",R.a.createElement("a",{href:"https://kb.mailpoet.com/article/292-choose-how-to-send-your-wordpress-websites-emails",target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("transactionalEmailNoticeBodyReadMore"))),R.a.createElement("p",null,R.a.createElement("button",{type:"button",className:"button",onClick:function(){c(!0),q.a.Ajax.post({api_version:i,endpoint:"settings",action:"set",data:{send_transactional_emails:"1"}}),u()}},q.a.I18n.t("transactionalEmailNoticeCTA"))))};oi.propTypes={mailpoetInstalledDaysAgo:Z.a.number.isRequired,sendTransactionalEmails:Z.a.bool.isRequired,noticeDismissed:Z.a.string.isRequired,mtaMethod:Z.a.string.isRequired,apiVersion:Z.a.string.isRequired};var li=oi,ci=!!window.mailpoet_tracking_enabled,ui={onNoItemsFound:function(e,t){return q.a.I18n.t(t?"noItemsFound":"emptyListing")},onTrash:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterTrashed"):q.a.I18n.t("multipleNewslettersTrashed").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onDelete:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterDeleted"):q.a.I18n.t("multipleNewslettersDeleted").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onRestore:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterRestored"):q.a.I18n.t("multipleNewslettersRestored").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)}},pi=[{name:"subject",label:q.a.I18n.t("subject"),sortable:!0},{name:"status",label:q.a.I18n.t("status")},{name:"segments",label:q.a.I18n.t("lists")},{name:"statistics",label:q.a.I18n.t("statistics"),display:ci},{name:"sent_at",label:q.a.I18n.t("sentOn"),sortable:!0}],di=[{name:"trash",label:q.a.I18n.t("moveToTrash"),onSuccess:ui.onTrash}],mi=function(e){var t=function(){window.location.href="?page=mailpoet-newsletter-editor&id=".concat(e.id)};e.queue&&"sending"===e.status&&null===e.queue.status?pn({message:q.a.I18n.t("confirmEdit"),onConfirm:t}):t()},hi=[{name:"view",link:function(e){return R.a.createElement("a",{href:e.preview_url,target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("preview"))}},{name:"edit",label:q.a.I18n.t("edit"),onClick:mi},{name:"duplicate",label:q.a.I18n.t("duplicate"),onClick:function(e,t){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"duplicate",data:{id:e.id}}).done((function(e){q.a.Notice.success(q.a.I18n.t("newsletterDuplicated").replace("%$1s",e.data.subject)),t()})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))}},{name:"trash"}];hi=Tt(hi);var fi=function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"renderItem",(function(e,t,a){var n,r=lt()("manage-column","column-primary","has-row-actions"),i=x()(n=e.segments).call(n,(function(e){return e.name})).join(", ");return R.a.createElement("div",null,R.a.createElement("td",{className:r},R.a.createElement("strong",null,R.a.createElement("a",{className:"row-title",href:"#",onClick:function(t){t.preventDefault(),mi(e)}},e.queue.newsletter_rendered_subject||e.subject)),t),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("status")},R.a.createElement(si,{newsletter:e,mailerLog:a.mta_log})),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("lists")},i),!0===ci?R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("statistics")},R.a.createElement(Bt,{newsletter:e,currentTime:a.current_time})):null,R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("sentOn")},R.a.createElement("abbr",null,e.sent_at?q.a.Date.format(e.sent_at):q.a.I18n.t("notSentYet"))))})),a.state={newslettersCount:void 0},a}return Y()(t,e),B()(t,[{key:"render",value:function(){var e=this;return R.a.createElement("div",null,R.a.createElement(wt,null),R.a.createElement(Nt,{hasNews:window.mailpoet_feature_announcement_has_news}),R.a.createElement(Zt,null),R.a.createElement(li,{mailpoetInstalledDaysAgo:window.mailpoet_installed_days_ago,sendTransactionalEmails:window.mailpoet_send_transactional_emails,mtaMethod:window.mailpoet_mta_method,apiVersion:window.mailpoet_api_version,noticeDismissed:window.mailpoet_transactional_emails_opt_in_notice_dismissed}),R.a.createElement(ea,{mssKeyInvalid:window.mailpoet_mss_key_invalid,subscribersCount:window.mailpoet_subscribers_count}),R.a.createElement(yt,{tab:"standard"}),0===this.state.newslettersCount&&R.a.createElement(Kt,{filter:function(e){return"standard"===e.slug},showHeader:!1}),0!==this.state.newslettersCount&&R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,endpoint:"newsletters",type:"standard",base_url:"standard",onRenderItem:this.renderItem,columns:pi,bulk_actions:di,item_actions:hi,messages:ui,auto_refresh:!0,sort_by:"sent_at",sort_order:"desc",afterGetItems:function(t){if(!t.loading){var a,n=Pe()(a=t.groups).call(a,(function(e,t){return e+t.count}),0);e.setState({newslettersCount:n})}Rt(t),Pt(t)}}))}}]),t}(R.a.Component);fi.contextType=Ge.a,fi.propTypes={location:Z.a.object.isRequired,match:Z.a.shape({params:Z.a.object}).isRequired};var gi=fi,vi=window.mailpoet_roles||{},bi=window.mailpoet_segments||{},_i=!!window.mailpoet_tracking_enabled,yi={onNoItemsFound:function(e,t){return q.a.I18n.t(t?"noItemsFound":"emptyListing")},onTrash:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterTrashed"):q.a.I18n.t("multipleNewslettersTrashed").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onDelete:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterDeleted"):q.a.I18n.t("multipleNewslettersDeleted").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onRestore:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterRestored"):q.a.I18n.t("multipleNewslettersRestored").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)}},wi=[{name:"subject",label:q.a.I18n.t("subject"),sortable:!0},{name:"status",label:q.a.I18n.t("status"),width:145},{name:"settings",label:q.a.I18n.t("settings")},{name:"statistics",label:q.a.I18n.t("statistics"),display:_i},{name:"updated_at",label:q.a.I18n.t("lastModifiedOn"),sortable:!0}],Ei=[{name:"trash",label:q.a.I18n.t("moveToTrash"),onSuccess:yi.onTrash}],ki=[{name:"view",link:function(e){return R.a.createElement("a",{href:e.preview_url,target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("preview"))}},{name:"duplicate",label:q.a.I18n.t("duplicate"),onClick:function(e,t){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"duplicate",data:{id:e.id}}).done((function(e){q.a.Notice.success(q.a.I18n.t("newsletterDuplicated").replace("%$1s",e.data.subject)),t()})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))}},{name:"edit",link:function(e){return R.a.createElement("a",{href:"?page=mailpoet-newsletter-editor&id=".concat(e.id)},q.a.I18n.t("edit"))}},{name:"trash"}];ki=Tt(ki);var Ii=function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"updateStatus",(function(e){e.persist(),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"setStatus",data:{id:Number(e.target.getAttribute("data-id")),status:e.target.value}}).done((function(e){"active"===e.data.status&&q.a.Notice.success(q.a.I18n.t("welcomeEmailActivated")),a.forceUpdate()})).fail((function(t){q.a.Notice.showApiErrorNotice(t),e.target.value=t.status}))})),y()(K()(a),"renderStatus",(function(e){var t=q.a.I18n.t("sentToXSubscribers").replace("%$1d",e.total_sent.toLocaleString()),n=q.a.I18n.t("scheduledToXSubscribers").replace("%$1d",e.total_scheduled.toLocaleString());return R.a.createElement("div",null,R.a.createElement("p",null,R.a.createElement("select",{"data-id":e.id,defaultValue:e.status,onChange:a.updateStatus},R.a.createElement("option",{value:"active"},q.a.I18n.t("active")),R.a.createElement("option",{value:"draft"},q.a.I18n.t("inactive")))),R.a.createElement("p",null,R.a.createElement(st.b,{to:"/sending-status/".concat(e.id),"data-automation-id":"sending_status_".concat(e.id)},t)," ",R.a.createElement("br",null),n))})),y()(K()(a),"renderSettings",(function(e){var t,a,n;switch(e.options.event){case"user":t="mailpoet_all"===e.options.role?q.a.I18n.t("welcomeEventWPUserAnyRole"):q.a.I18n.t("welcomeEventWPUserWithRole").replace("%$1s",vi[e.options.role]);break;default:if(void 0===(n=me()(O.a).call(O.a,bi,(function(t){return Number(t.id)===Number(e.options.segment)}))))return R.a.createElement("span",{className:"mailpoet_error"},q.a.I18n.t("sendingToSegmentsNotSpecified"));t=q.a.I18n.t("welcomeEventSegment").replace("%$1s",n.name)}if(t&&"immediate"!==e.options.afterTimeType){switch(e.options.afterTimeType){case"minutes":a=q.a.I18n.t("sendingDelayMinutes").replace("%$1d",e.options.afterTimeNumber);break;case"hours":a=q.a.I18n.t("sendingDelayHours").replace("%$1d",e.options.afterTimeNumber);break;case"days":a=q.a.I18n.t("sendingDelayDays").replace("%$1d",e.options.afterTimeNumber);break;case"weeks":a=q.a.I18n.t("sendingDelayWeeks").replace("%$1d",e.options.afterTimeNumber);break;default:a=q.a.I18n.t("sendingDelayInvalid")}t+=" [".concat(a,"].")}return R.a.createElement("span",null,t)})),y()(K()(a),"renderItem",(function(e,t){var n=lt()("manage-column","column-primary","has-row-actions");return R.a.createElement("div",null,R.a.createElement("td",{className:n},R.a.createElement("strong",null,R.a.createElement("a",{className:"row-title",href:"?page=mailpoet-newsletter-editor&id=".concat(e.id)},e.subject)),t),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("status")},a.renderStatus(e)),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("settings")},a.renderSettings(e)),!0===_i?R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("statistics")},R.a.createElement(Bt,{newsletter:e,isSent:e.total_sent>0&&!!e.statistics})):null,R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("lastModifiedOn")},R.a.createElement("abbr",null,q.a.Date.format(e.updated_at))))})),a.state={newslettersCount:void 0},a}return Y()(t,e),B()(t,[{key:"render",value:function(){var e=this;return R.a.createElement("div",null,R.a.createElement(wt,null),R.a.createElement(Nt,{hasNews:window.mailpoet_feature_announcement_has_news}),R.a.createElement(Zt,null),R.a.createElement(ea,{mssKeyInvalid:window.mailpoet_mss_key_invalid,subscribersCount:window.mailpoet_subscribers_count}),R.a.createElement(yt,{tab:"welcome"}),0===this.state.newslettersCount&&R.a.createElement(Kt,{filter:function(e){return"welcome"===e.slug},showHeader:!1}),0!==this.state.newslettersCount&&R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,endpoint:"newsletters",type:"welcome",base_url:"welcome",onRenderItem:this.renderItem,columns:wi,bulk_actions:Ei,item_actions:ki,messages:yi,auto_refresh:!0,sort_by:"updated_at",sort_order:"desc",afterGetItems:function(t){if(!t.loading){var a,n=Pe()(a=t.groups).call(a,(function(e,t){return e+t.count}),0);e.setState({newslettersCount:n})}Rt(t),Pt(t)}}))}}]),t}(R.a.Component);Ii.propTypes={location:Z.a.object.isRequired,match:Z.a.shape({params:Z.a.object}).isRequired};var Si=Ii,Ci={onNoItemsFound:function(e,t){return q.a.I18n.t(t?"noItemsFound":"emptyListing")},onTrash:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterTrashed"):q.a.I18n.t("multipleNewslettersTrashed").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onDelete:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterDeleted"):q.a.I18n.t("multipleNewslettersDeleted").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onRestore:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterRestored"):q.a.I18n.t("multipleNewslettersRestored").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)}},Ni=[{name:"subject",label:q.a.I18n.t("subject"),sortable:!0},{name:"status",label:q.a.I18n.t("status"),width:100},{name:"settings",label:q.a.I18n.t("settings")},{name:"history",label:q.a.I18n.t("history"),width:100},{name:"updated_at",label:q.a.I18n.t("lastModifiedOn"),sortable:!0}],xi=[{name:"trash",label:q.a.I18n.t("moveToTrash"),onSuccess:Ci.onTrash}],Ti=[{name:"view",link:function(e){return R.a.createElement("a",{href:e.preview_url,target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("preview"))}},{name:"edit",link:function(e){return R.a.createElement("a",{href:"?page=mailpoet-newsletter-editor&id=".concat(e.id)},q.a.I18n.t("edit"))}},{name:"duplicate",label:q.a.I18n.t("duplicate"),onClick:function(e,t){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"duplicate",data:{id:e.id}}).done((function(e){q.a.Notice.success(q.a.I18n.t("newsletterDuplicated").replace("%$1s",e.data.subject)),t()})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))}},{name:"trash"}],Ri=function(e){function t(e){var a;return M()(this,t),a=U()(this,W()(t).call(this,e)),y()(K()(a),"updateStatus",(function(e){e.persist(),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"setStatus",data:{id:Number(e.target.getAttribute("data-id")),status:e.target.value}}).done((function(e){"active"===e.data.status&&q.a.Notice.success(q.a.I18n.t("postNotificationActivated")),a.forceUpdate()})).fail((function(t){q.a.Notice.showApiErrorNotice(t),e.target.value=t.status}))})),y()(K()(a),"renderStatus",(function(e){return R.a.createElement("select",{"data-id":e.id,defaultValue:e.status,onChange:a.updateStatus},R.a.createElement("option",{value:"active"},q.a.I18n.t("active")),R.a.createElement("option",{value:"draft"},q.a.I18n.t("inactive")))})),y()(K()(a),"renderSettings",(function(e){var t,a,n=x()(t=e.segments).call(t,(function(e){return e.name})),r=q.a.I18n.t("ifNewContentToSegments").replace("%$1s",n.join(", "));if(0===n.length)return R.a.createElement("span",{className:"mailpoet_error"},q.a.I18n.t("sendingToSegmentsNotSpecified"));switch(e.options.intervalType){case"daily":a=q.a.I18n.t("sendDaily").replace("%$1s",Fe[e.options.timeOfDay]);break;case"weekly":a=q.a.I18n.t("sendWeekly").replace("%$1s",je[e.options.weekDay]).replace("%$2s",Fe[e.options.timeOfDay]);break;case"monthly":a=q.a.I18n.t("sendMonthly").replace("%$1s",Me[e.options.monthDay]).replace("%$2s",Fe[e.options.timeOfDay]);break;case"nthWeekDay":a=q.a.I18n.t("sendNthWeekDay").replace("%$1s",Ve[e.options.nthWeekDay]).replace("%$2s",je[e.options.weekDay]).replace("%$3s",Fe[e.options.timeOfDay]);break;case"immediately":a=q.a.I18n.t("sendImmediately");break;default:a="Invalid sending frequency"}return R.a.createElement("span",null,a," ",r)})),y()(K()(a),"renderHistoryLink",(function(e){return 0===Number(e.children_count)?q.a.I18n.t("notSentYet"):R.a.createElement(st.b,{"data-automation-id":"history-".concat(e.id),to:"/notification/history/".concat(e.id)},q.a.I18n.t("viewHistory"))})),y()(K()(a),"renderItem",(function(e,t){var n=lt()("manage-column","column-primary","has-row-actions");return R.a.createElement("div",null,R.a.createElement("td",{className:n},R.a.createElement("strong",null,R.a.createElement("a",{className:"row-title",href:"?page=mailpoet-newsletter-editor&id=".concat(e.id)},e.subject)),t),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("status")},a.renderStatus(e)),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("settings")},a.renderSettings(e)),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("history")},a.renderHistoryLink(e)),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("lastModifiedOn")},R.a.createElement("abbr",null,q.a.Date.format(e.updated_at))))})),a.state={newslettersCount:void 0},a}return Y()(t,e),B()(t,[{key:"render",value:function(){var e=this;return R.a.createElement("div",null,R.a.createElement(wt,null),R.a.createElement(Nt,{hasNews:window.mailpoet_feature_announcement_has_news}),R.a.createElement(Zt,null),R.a.createElement(ea,{mssKeyInvalid:window.mailpoet_mss_key_invalid,subscribersCount:window.mailpoet_subscribers_count}),R.a.createElement(yt,{tab:"notification"}),0===this.state.newslettersCount&&R.a.createElement(Kt,{filter:function(e){return"notification"===e.slug},showHeader:!1}),0!==this.state.newslettersCount&&R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,endpoint:"newsletters",type:"notification",base_url:"notification",onRenderItem:this.renderItem,columns:Ni,bulk_actions:xi,item_actions:Ti,messages:Ci,auto_refresh:!0,sort_by:"updated_at",sort_order:"desc",afterGetItems:function(t){if(!t.loading){var a,n=Pe()(a=t.groups).call(a,(function(e,t){return e+t.count}),0);e.setState({newslettersCount:n})}Rt(t),Pt(t)}}))}}]),t}(R.a.Component);Ri.propTypes={location:Z.a.object.isRequired,match:Z.a.shape({params:Z.a.object}).isRequired};var Pi=Ri,Oi=!!window.mailpoet_tracking_enabled,Di=[{name:"subject",label:q.a.I18n.t("subject")},{name:"status",label:q.a.I18n.t("status")},{name:"segments",label:q.a.I18n.t("lists")},{name:"statistics",label:q.a.I18n.t("statistics"),display:Oi},{name:"sent_at",label:q.a.I18n.t("sentOn")}],Ai={onNoItemsFound:function(e,t){return q.a.I18n.t(t?"noItemsFound":"emptyListing")},onTrash:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterTrashed"):q.a.I18n.t("multipleNewslettersTrashed").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onDelete:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterDeleted"):q.a.I18n.t("multipleNewslettersDeleted").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onRestore:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneNewsletterRestored"):q.a.I18n.t("multipleNewslettersRestored").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)}},qi=[{name:"trash",label:q.a.I18n.t("moveToTrash"),onSuccess:Ai.onTrash}],Li=Tt([{name:"view",link:function(e){return R.a.createElement("a",{href:e.preview_url,target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("preview"))}},{name:"trash"}]),Fi=function(e,t,a){var n,r=lt()("manage-column","column-primary","has-row-actions"),i=x()(n=e.segments).call(n,(function(e){return e.name})).join(", ");return R.a.createElement(R.a.Fragment,null,R.a.createElement("td",{className:r},R.a.createElement("strong",null,R.a.createElement("a",{href:e.preview_url,target:"_blank",rel:"noopener noreferrer"},e.queue.newsletter_rendered_subject||e.subject)),t),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("status")},R.a.createElement(si,{newsletter:e,mailerLog:a.mta_log})),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("lists")},i),!0===Oi?R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("statistics")},R.a.createElement(Bt,{newsletter:e,currentTime:a.current_time})):null,R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("sentOn")},e.sent_at?q.a.Date.format(e.sent_at):q.a.I18n.t("notSentYet")))},ji=function(e){return R.a.createElement(R.a.Fragment,null,R.a.createElement(wt,null),R.a.createElement(Nt,{hasNews:window.mailpoet_feature_announcement_has_news}),R.a.createElement(yt,{tab:"notification"}),R.a.createElement(st.b,{className:"page-title-action",to:"/notification"},q.a.I18n.t("backToPostNotifications")),R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:e.location,params:e.match.params,endpoint:"newsletters",type:"notification_history",base_url:"notification/history/:parent_id",onRenderItem:Fi,columns:Di,messages:Ai,item_actions:Li,bulk_actions:qi,auto_refresh:!0,sort_by:"sent_at",sort_order:"desc",afterGetItems:function(e){Rt(e),Pt(e)}}))};ji.propTypes={location:Z.a.shape({pathname:Z.a.string}).isRequired,match:Z.a.shape({params:Z.a.shape({id:Z.a.string})}).isRequired};var Mi=ji,Vi=[{name:"subscriber_id",label:q.a.I18n.t("subscriber"),sortable:!0},{name:"status",label:q.a.I18n.t("sendingStatus")},{name:"failureReason",label:q.a.I18n.t("failureReason")}],Bi={onNoItemsFound:function(){return q.a.I18n.t("noSendingTaskFound")}},zi=function(e){var t=R.a.useState({id:e.match.params.id,subject:"",sent:!1}),a=Ne()(t,2),n=a[0],r=a[1];return R.a.useEffect((function(){q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletters",action:"get",data:{id:n.id}}).done((function(e){return r({id:n.id,subject:e.data.subject,sent:null!==e.data.sent_at})})).fail((function(e){return q.a.Notice.showApiErrorNotice(e)}))}),[n.id]),R.a.createElement(R.a.Fragment,null,R.a.createElement("h1",null,q.a.I18n.t("sendingStatusTitle")),R.a.createElement($i,{newsletter:n}),R.a.createElement(Ui,{location:e.location,params:e.match.params}))};zi.propTypes={location:Z.a.shape({pathname:Z.a.string}).isRequired,match:Z.a.shape({params:Z.a.shape({id:Z.a.string.isRequired}).isRequired}).isRequired};var Ui=R.a.memo((function(e){var t=e.location,a=e.params;return R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:t,params:a,endpoint:"sending_task_subscribers",base_url:"sending-status/:id",onRenderItem:function(e){return R.a.createElement("div",null,R.a.createElement(Wi,e))},getListingItemKey:function(e){var t;return E()(t="".concat(e.taskId,"-")).call(t,e.subscriberId)},columns:Vi,messages:Bi,auto_refresh:!0,sort_by:"failed",sort_order:"desc",afterGetItems:function(e){Rt(e),Pt(e)}})}),(function(e,t){return e.location.pathname===t.location.pathname&&e.params.id===t.params.id}));Ui.propTypes={location:Z.a.shape({pathname:Z.a.string}).isRequired,params:Z.a.shape({id:Z.a.string.isRequired}).isRequired};var $i=function(e){var t=e.newsletter;return t.id&&t.subject&&t.sent?R.a.createElement("p",null,R.a.createElement(st.b,{to:"/stats/".concat(t.id)},t.subject)):null};$i.propTypes={newsletter:Z.a.shape({id:Z.a.string,subject:Z.a.string,sent:Z.a.bool})},$i.defaultProps={newsletter:{id:null,subject:null,sent:!1}};var Wi=function(e){var t,a,n,r,i=e.error,s=e.failed,o=e.taskId,l=e.processed,c=e.email,u=e.subscriberId,p=e.lastName,d=e.firstName,m=lt()("manage-column","column-primary","has-row-actions"),h=q.a.I18n.t("unprocessed");return"1"===l&&(h="1"===s?R.a.createElement("span",null,q.a.I18n.t("failed"),R.a.createElement("br",null),R.a.createElement("a",{className:"button",href:"#",onClick:function(e){e.preventDefault(),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"sending_task_subscribers",action:"resend",data:{taskId:o,subscriberId:u}}).done((function(){return window.mailpoet_listing.forceUpdate()})).fail((function(e){return q.a.Notice.showApiErrorNotice(e)}))}},q.a.I18n.t("resend"))):q.a.I18n.t("sent")),R.a.createElement(R.a.Fragment,null,R.a.createElement("td",{"data-automation-id":E()(t="name_".concat(o,"_")).call(t,u),className:m},R.a.createElement("strong",null,R.a.createElement("a",{className:"row-title",href:"admin.php?page=mailpoet-subscribers#/edit/".concat(u)},c)),R.a.createElement("p",{style:{margin:0}},E()(a="".concat(d," ")).call(a,p))),R.a.createElement("td",{className:"column","data-automation-id":E()(n="status_".concat(o,"_")).call(n,u),"data-colname":q.a.I18n.t("sendingStatus")},h),R.a.createElement("td",{className:"column","data-automation-id":E()(r="error_".concat(o,"_")).call(r,u),"data-colname":q.a.I18n.t("failureReason")},i))};Wi.propTypes={error:Z.a.string,email:Z.a.string.isRequired,failed:Z.a.string.isRequired,taskId:Z.a.string.isRequired,lastName:Z.a.string.isRequired,firstName:Z.a.string.isRequired,processed:Z.a.string.isRequired,subscriberId:Z.a.string.isRequired},Wi.defaultProps={error:""};var Hi=zi,Ki=function(e){var t,a,n,r=e.newsletter,i=r.total_sent||0,s=0,o=0,l=0;i>0&&(s=100*r.statistics.clicked/i,o=100*r.statistics.opened/i,l=100*r.statistics.unsubscribed/i);var c,u=q.a.Num.toLocaleFixed(s,1),p=q.a.Num.toLocaleFixed(o,1),d=q.a.Num.toLocaleFixed(l,1),m=E()(t="".concat(p,"% ")).call(t,q.a.I18n.t("percentageOpened")),h=E()(a="".concat(u,"% ")).call(a,q.a.I18n.t("percentageClicked")),f=E()(n="".concat(d,"% ")).call(n,q.a.I18n.t("percentageUnsubscribed"));return c=i>=20&&r.statistics.opened>=5?R.a.createElement("div",{className:"mailpoet_stat_grey"},R.a.createElement("div",{className:"mailpoet_stat_big mailpoet_stat_spaced"},R.a.createElement(Ft.a,{stat:"opened",rate:o,headline:m})),R.a.createElement("div",{className:"mailpoet_stat_big mailpoet_stat_spaced"},R.a.createElement(Ft.a,{stat:"clicked",rate:s,headline:h})),A.a.applyFilters("mailpoet_newsletters_revenues_stats",null,r.statistics.revenue),R.a.createElement("div",null,R.a.createElement(Ft.a,{stat:"unsubscribed",rate:l,headline:f}))):R.a.createElement("div",{className:"mailpoet_stat_grey"},R.a.createElement("div",{className:"mailpoet_stat_big mailpoet_stat_spaced"},m),R.a.createElement("div",{className:"mailpoet_stat_big mailpoet_stat_spaced"},h),A.a.applyFilters("mailpoet_newsletters_revenues_stats",null,r.statistics.revenue),R.a.createElement("div",null,f)),R.a.createElement("div",null,R.a.createElement("p",{className:"mailpoet_stat_grey mailpoet_stat_big"},q.a.I18n.t("statsTotalSent")," ",Se()(i,10).toLocaleString()),c,r.ga_campaign&&R.a.createElement("p",null,q.a.I18n.t("googleAnalytics"),": ",r.ga_campaign),R.a.createElement("p",null,R.a.createElement("a",{href:"https://kb.mailpoet.com/article/190-whats-a-good-email-open-rate",target:"_blank",rel:"noopener noreferrer","data-beacon-article":"58f671152c7d3a057f8858e8"},q.a.I18n.t("readMoreOnStats"))))};Ki.propTypes={newsletter:Z.a.shape({ga_campaign:Z.a.string,total_sent:Z.a.number,statistics:Z.a.shape({clicked:Z.a.number,opened:Z.a.number,unsubscribed:Z.a.number,revenue:Z.a.shape({currency:Z.a.string.isRequired,value:Z.a.number.isRequired,formatted:Z.a.string.isRequired,count:Z.a.number.isRequired})}).isRequired}).isRequired};var Gi=Ki;function Yi(e,t){var a,n="";e&&(n=t?E()(a="".concat(t," <")).call(a,e,">"):e);return n}function Ji(e){var t,a=e.newsletter,n=a.queue.scheduled_at||a.queue.created_at,r=Yi(a.sender_address||"",a.sender_name||""),i=Yi(a.reply_to_address||"",a.reply_to_name||""),s=x()(t=a.segments||[]).call(t,(function(e){return e.name})).join(", ");return R.a.createElement("div",null,R.a.createElement("div",{className:"mailpoet_stat_spaced"},R.a.createElement("a",{href:a.preview_url,className:"button-secondary",target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("statsPreviewNewsletter"))),R.a.createElement("p",null,q.a.I18n.t("statsDateSent"),":"," ",q.a.Date.format(n)),s&&R.a.createElement("p",null,q.a.I18n.t("statsToSegments"),":"," ",s),R.a.createElement("p",null,q.a.I18n.t("statsFromAddress"),":"," ",r),i&&R.a.createElement("p",null,q.a.I18n.t("statsReplyToAddress"),":"," ",i))}Ji.propTypes={newsletter:Z.a.shape({queue:Z.a.shape({scheduled_at:Z.a.string,created_at:Z.a.string}).isRequired,sender_address:Z.a.string,sender_name:Z.a.string,reply_to_address:Z.a.string,preview_url:Z.a.string,reply_to_name:Z.a.string,segments:Z.a.array}).isRequired};var Qi=Ji,Zi=function(){if(!window.mailpoet_display_detailed_stats){var e=R.a.createElement("a",{className:"button",href:q.a.MailPoetComUrlFactory.getFreePlanUrl({utm_medium:"stats",utm_campaign:"signup"}),target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("premiumBannerCtaFree"));return R.a.createElement("div",{className:"mailpoet_stats_premium_banner"},R.a.createElement("h1",null,q.a.I18n.t("premiumBannerTitle")),R.a.createElement("p",null,e),R.a.createElement("a",{href:"admin.php?page=mailpoet-premium"},q.a.I18n.t("premiumBannerLink")))}if(window.mailpoet_subscribers_limit_reached){var t=window.mailpoet_has_valid_api_key,a=q.a.I18n.t("subscribersLimitNoticeTitle").replace("[subscribersLimit]",window.mailpoet_subscribers_limit),n=q.a.I18n.t(t?"yourPlanLimit":"freeVersionLimit").replace("[subscribersLimit]",window.mailpoet_subscribers_limit),r=t?"https://account.mailpoet.com/upgrade":"https://account.mailpoet.com/?s=".concat(window.mailpoet_subscribers_count+1);return R.a.createElement("div",{className:"mailpoet_stats_premium_banner"},R.a.createElement("h1",null,a),R.a.createElement("p",null,n),R.a.createElement("p",null,R.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",className:"button",href:r},q.a.I18n.t("upgradeNow"))))}return null},Xi=function(e){function t(e){var a;return M()(this,t),(a=U()(this,W()(t).call(this,e))).state={item:{},loading:!0},a}return Y()(t,e),B()(t,[{key:"componentDidMount",value:function(){var e=this.props.match;window.scrollTo(0,0),this.loadItem(e.params.id)}},{key:"componentDidUpdate",value:function(e){e.match.params.id!==this.props.match.params.id&&this.loadItem(this.props.match.params.id)}},{key:"loadItem",value:function(e){var t=this,a=this.props.history;this.setState({loading:!0}),q.a.Modal.loading(!0),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:window.mailpoet_display_detailed_stats?"stats":"newsletters",action:window.mailpoet_display_detailed_stats?"get":"getWithStats",data:{id:e}}).always((function(){q.a.Modal.loading(!1)})).done((function(e){t.setState({loading:!1,item:e.data})})).fail((function(e){var n;q.a.Notice.error(x()(n=e.errors).call(n,(function(e){return e.message})),{scroll:!0}),t.setState({loading:!1,item:{}},(function(){a.push("/")}))}))}},{key:"render",value:function(){var e,t=this.state,a=t.item,n=t.loading,r=a,i=this.props,s=i.match,o=i.location;return n||!r.queue?R.a.createElement("div",null,R.a.createElement("h1",{className:"title"},q.a.I18n.t("statsTitle"),R.a.createElement(st.b,{className:"page-title-action",to:"/"},q.a.I18n.t("backToList")))):R.a.createElement("div",null,R.a.createElement("h1",{className:"title"},E()(e="".concat(q.a.I18n.t("statsTitle"),": ")).call(e,r.subject),R.a.createElement(st.b,{className:"page-title-action",to:"/"},q.a.I18n.t("backToList"))),R.a.createElement(ea,{mssKeyInvalid:window.mailpoet_mss_key_invalid,subscribersCount:window.mailpoet_subscribers_count}),R.a.createElement("div",{className:"mailpoet_stat_triple-spaced"},R.a.createElement("div",{className:"mailpoet_stat_info"},R.a.createElement(Qi,{newsletter:r})),R.a.createElement("div",{className:"mailpoet_stat_general"},R.a.createElement(Gi,{newsletter:r})),R.a.createElement("div",{style:{clear:"both"}})),R.a.createElement("h2",null,q.a.I18n.t("clickedLinks")),R.a.createElement("div",{className:"mailpoet_stat_triple-spaced"},A.a.applyFilters("mailpoet_newsletters_clicked_links_table",R.a.createElement(Zi,null),r.clicked_links)),R.a.createElement("div",{className:"mailpoet_stat_triple-spaced"},A.a.applyFilters("mailpoet_newsletters_purchased_products",null,r)),R.a.createElement("h2",null,q.a.I18n.t("subscriberEngagement")),A.a.applyFilters("mailpoet_newsletters_subscriber_engagement",R.a.createElement(Zi,null),o,s.params,r))}}]),t}(R.a.Component);Xi.propTypes={match:Z.a.shape({params:Z.a.object.isRequired}).isRequired,location:Z.a.object.isRequired,history:Z.a.shape({push:Z.a.func.isRequired}).isRequired};var es,ts=Object(ne.withRouter)(Xi),as=A.a.applyFilters("mailpoet_newsletters_before_router",E()(es=[{path:"/standard/(.*)?",component:gi},{path:"/welcome/(.*)?",component:Si},{path:"/notification/history/:parent_id/(.*)?",component:Mi},{path:"/notification/(.*)?",component:Pi},{path:"/new/standard",component:zr},{path:"/new/notification",component:Wr},{path:"/new/welcome",component:Gr},{path:"/new",component:Kt},{name:"template",path:"/template/:id",component:bn},{path:"/send/congratulate/:id",component:Vr},{path:"/send/:id",component:mr},{path:"/sending-status/:id/(.*)?",component:Hi},{path:"/stats/:id/(.*)?",component:ts}]).call(es,I()(window.mailpoet_automatic_emails?x()(O.a).call(O.a,window.mailpoet_automatic_emails,(function(e){return{path:"new/".concat(e.slug),name:e.slug,component:ie,data:{email:e}}})):[]))),ns=document.getElementById("newsletters_container");ns&&(window.mailpoet_listing=_e.a.render(R.a.createElement((function(){return R.a.createElement(Ge.a.Provider,{value:Object(Ge.b)(window)},R.a.createElement(st.a,null,R.a.createElement(en,null),R.a.createElement(ne.Switch,null,R.a.createElement(ne.Route,{exact:!0,path:"/",render:function(){return R.a.createElement(ne.Redirect,{to:0===window.mailpoet_newsletters_count?"/new":"/standard"})}}),x()(as).call(as,(function(e){return R.a.createElement(ne.Route,{key:e.path,path:e.path,component:e.component,name:e.name||null,data:e.data||null,render:e.render})})))))}),null),ns));var rs=function(){var e=Object(ne.useLocation)().pathname.split("/"),t=Ne()(e,2)[1];return R.a.createElement("h2",{className:"nav-tab-wrapper"},R.a.createElement(st.b,{to:"/",className:lt()("nav-tab",{"nav-tab-active":"segments"!==t})},q.a.I18n.t("pageTitle")),R.a.createElement(st.b,{to:"/segments","data-automation-id":"dynamic-segments-tab",className:lt()("nav-tab",{"nav-tab-active":"segments"===t})},q.a.I18n.t("pageTitleSegments")))},is=function(e){return"wp_users"===e.type},ss=function(e){return"woocommerce_users"===e.type},os=function(e){return is(e)||ss(e)},ls=[{name:"name",label:q.a.I18n.t("name"),sortable:!0},{name:"description",label:q.a.I18n.t("description")},{name:"subscribed",label:q.a.I18n.t("subscribed")},{name:"unconfirmed",label:q.a.I18n.t("unconfirmed")},{name:"unsubscribed",label:q.a.I18n.t("unsubscribed")},{name:"inactive",label:q.a.I18n.t("inactive")},{name:"bounced",label:q.a.I18n.t("bounced")},{name:"created_at",label:q.a.I18n.t("createdOn"),sortable:!0}],cs={onTrash:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneSegmentTrashed"):q.a.I18n.t("multipleSegmentsTrashed").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onDelete:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneSegmentDeleted"):q.a.I18n.t("multipleSegmentsDeleted").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onRestore:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneSegmentRestored"):q.a.I18n.t("multipleSegmentsRestored").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)}},us=[{name:"trash",label:q.a.I18n.t("moveToTrash"),onSuccess:cs.onTrash}],ps=[{name:"edit",link:function(e){return R.a.createElement(st.b,{to:"/edit/".concat(e.id)},q.a.I18n.t("edit"))},display:function(e){return!os(e)}},{name:"duplicate_segment",label:q.a.I18n.t("duplicate"),onClick:function(e,t){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"segments",action:"duplicate",data:{id:e.id}}).done((function(e){q.a.Notice.success(q.a.I18n.t("listDuplicated").replace("%$1s",e.data.name)),t()})).fail((function(e){var t;q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))},display:function(e){return!os(e)}},{name:"read_more",link:function(){return R.a.createElement("a",{href:"https://kb.mailpoet.com/article/133-the-wordpress-users-list",target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("readMore"))},display:function(e){return is(e)}},{name:"synchronize_segment",label:q.a.I18n.t("forceSync"),onClick:function(e,t){q.a.Modal.loading(!0),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"segments",action:"synchronize",data:{type:e.type}}).done((function(){q.a.Modal.loading(!1),q.a.Notice.success(q.a.I18n.t("listSynchronized").replace("%$1s",e.name)),t()})).fail((function(e){var t;(q.a.Modal.loading(!1),e.errors.length>0)&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))},display:function(e){return is(e)||ss(e)}},{name:"view_subscribers",link:function(e){return R.a.createElement("a",{href:e.subscribers_url,"data-automation-id":"view_subscribers_".concat(e.name)},q.a.I18n.t("viewSubscribers"))}},{name:"trash",display:function(e){return!os(e)&&0===e.automated_emails_subjects.length}},{name:"delete",label:q.a.I18n.t("moveToTrash"),onClick:function(e){var t;q.a.Notice.error(q.a.I18n.t("trashDisallowed").replace("%$1s",x()(t=e.automated_emails_subjects).call(t,(function(e){return"'".concat(e,"'")})).join(", ")),{scroll:!0})},display:function(e){return!os(e)&&e.automated_emails_subjects.length>0}}],ds=function(e){function t(){var e,a,n;M()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=U()(this,(e=W()(t)).call.apply(e,E()(a=[this]).call(a,i))),y()(K()(n),"renderItem",(function(e,t){var a,n=lt()("manage-column","column-primary","has-row-actions"),r=Number(e.subscribers_count.subscribed||0),i=Number(e.subscribers_count.unconfirmed||0),s=Number(e.subscribers_count.unsubscribed||0),o=Number(e.subscribers_count.inactive||0),l=Number(e.subscribers_count.bounced||0);return a=os(e)?R.a.createElement("span",{className:"row-title"},e.name):R.a.createElement(st.b,{className:"row-title",to:"/edit/".concat(e.id)},e.name),R.a.createElement("div",null,R.a.createElement("td",{className:n,"data-automation-id":"segment_name_".concat(e.name)},R.a.createElement("strong",null,a),t),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("description")},R.a.createElement("abbr",null,e.description)),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("subscribed")},R.a.createElement("abbr",null,r.toLocaleString())),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("unconfirmed")},R.a.createElement("abbr",null,i.toLocaleString())),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("unsubscribed")},R.a.createElement("abbr",null,s.toLocaleString())),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("inactive")},R.a.createElement("abbr",null,o.toLocaleString())),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("bounced")},R.a.createElement("abbr",null,l.toLocaleString())),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("createdOn")},R.a.createElement("abbr",null,q.a.Date.format(e.created_at))))})),n}return Y()(t,e),B()(t,[{key:"render",value:function(){return R.a.createElement("div",{className:"mailpoet-segments-listing"},R.a.createElement("h1",{className:"title"},q.a.I18n.t("pageTitle")," ",R.a.createElement(st.b,{className:"page-title-action",to:"/new"},q.a.I18n.t("new")),R.a.createElement(st.b,{className:"page-title-action",to:"/new-segment","data-automation-id":"new-segment"},q.a.I18n.t("newSegment"))),R.a.createElement(va,{subscribersInPlan:window.mailpoet_subscribers_in_plan_count,hasValidApiKey:window.mailpoet_has_valid_api_key}),R.a.createElement(Zt,null),R.a.createElement(ea,{mssKeyInvalid:window.mailpoet_mss_key_invalid,subscribersCount:window.mailpoet_subscribers_count}),R.a.createElement(rs,null),R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,messages:cs,search:!1,endpoint:"segments",onRenderItem:this.renderItem,columns:ls,bulk_actions:us,item_actions:ps,sort_by:"name",sort_order:"asc"}))}}]),t}(R.a.Component);ds.propTypes={location:Z.a.object.isRequired,match:Z.a.shape({params:Z.a.object}).isRequired};var ms=ds,hs=[{name:"name",label:q.a.I18n.t("nameColumn"),sortable:!0},{name:"count",label:q.a.I18n.t("subscribersCountColumn"),sortable:!1},{name:"updated_at",label:q.a.I18n.t("updatedAtColumn"),sortable:!0}],fs={onLoadingItems:function(){return q.a.I18n.t("loadingDynamicSegmentItems")},onNoItemsFound:function(){return q.a.I18n.t("noDynamicSegmentItemsFound")},onTrash:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneDynamicSegmentTrashed"):q.a.I18n.t("multipleDynamicSegmentsTrashed").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onDelete:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneDynamicSegmentDeleted"):q.a.I18n.t("multipleDynamicSegmentsDeleted").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onRestore:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneDynamicSegmentRestored"):q.a.I18n.t("multipleDynamicSegmentsRestored").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)}},gs=[{name:"edit",link:function(e){return R.a.createElement(st.b,{to:"/edit-segment/".concat(e.id)},q.a.I18n.t("edit"))}},{name:"view_subscribers",link:function(e){return R.a.createElement("a",{href:e.subscribers_url},q.a.I18n.t("viewSubscribers"))}},{name:"trash"}];function vs(e,t){return R.a.createElement(R.a.Fragment,null,R.a.createElement("td",{"data-colname":q.a.I18n.t("nameColumn")},R.a.createElement("strong",null,e.name),t),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("subscribersCountColumn")},Se()(e.count,10).toLocaleString()),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("updatedAtColumn")},q.a.Date.format(e.updated_at)))}function bs(e){return R.a.createElement(R.a.Fragment,null,R.a.createElement("h1",{className:"pageTitle"},q.a.I18n.t("pageTitleSegments")," ",R.a.createElement(st.b,{className:"page-title-action",to:"/new"},q.a.I18n.t("new")),R.a.createElement(st.b,{className:"page-title-action",to:"/new-segment","data-automation-id":"new-segment"},q.a.I18n.t("newSegment"))),R.a.createElement(va,{subscribersInPlan:window.mailpoet_subscribers_in_plan_count,hasValidApiKey:window.mailpoet_has_valid_api_key}),R.a.createElement(rs,null),R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:e.location,params:e.match.params,search:!0,onRenderItem:vs,endpoint:"dynamic_segments",base_url:"segments",columns:hs,messages:fs,sort_by:"created_at",sort_order:"desc",item_actions:gs}),R.a.createElement("p",{className:"mailpoet_sending_methods_help help"},R.a.createElement("b",null,q.a.I18n.t("segmentsTip"),":")," ",q.a.I18n.t("segmentsTipText")," ",R.a.createElement("a",{href:"https://kb.mailpoet.com/article/237-guide-to-subscriber-segmentation?utm_source=plugin&utm_medium=segments&utm_campaign=helpdocs","data-beacon-article":"5a574bd92c7d3a194368233e",target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("segmentsTipLink"))))}bs.propTypes={location:Z.a.object.isRequired,match:Z.a.shape({params:Z.a.object}).isRequired};var _s=bs,ys=[{name:"name",label:q.a.I18n.t("name"),type:"text"},{name:"description",label:q.a.I18n.t("description"),type:"textarea",tip:q.a.I18n.t("segmentDescriptionTip")}],ws={onUpdate:function(){q.a.Notice.success(q.a.I18n.t("segmentUpdated"))},onCreate:function(){q.a.Notice.success(q.a.I18n.t("segmentAdded")),q.a.trackEvent("Lists > Add new",{"MailPoet Free version":window.mailpoet_version})}},Es=function(e){return R.a.createElement("div",null,R.a.createElement("h1",{className:"title"},q.a.I18n.t("segment"),R.a.createElement(st.b,{className:"page-title-action",to:"/"},q.a.I18n.t("backToList"))),R.a.createElement(Zt,null),R.a.createElement($a,{endpoint:"segments",fields:ys,params:e.match.params,messages:ws}))};Es.propTypes={match:Z.a.shape({params:Z.a.shape({id:Z.a.string}).isRequired}).isRequired};var ks=Es,Is=a(79),Ss=a.n(Is),Cs={};var Ns=function(e){return function(e){return"clicked"!==e.action&&"notClicked"!==e.action?Ss.a.resolve():e.newsletter_id?void 0!==Cs[e.newsletter_id]?Ss.a.resolve(Cs[e.newsletter_id]):q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"newsletter_links",action:"get",data:{newsletterId:e.newsletter_id}}).then((function(t){var a=t.data;return Cs[e.newsletter_id]=a,a})).fail((function(e){var t;q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})})):Ss.a.resolve()}(e).then((function(e){var t,a=[{name:"action",type:"select",values:{"":q.a.I18n.t("selectActionPlaceholder"),opened:q.a.I18n.t("emailActionOpened"),notOpened:q.a.I18n.t("emailActionNotOpened"),clicked:q.a.I18n.t("emailActionClicked"),notClicked:q.a.I18n.t("emailActionNotClicked")}},{name:"newsletter_id",type:"selection",resetSelect2OnUpdate:!0,endpoint:"newsletters_list",placeholder:q.a.I18n.t("selectNewsletterPlaceholder"),forceSelect2:!0,getLabel:function(e){var t,a=e.sent_at?q.a.Date.format(e.sent_at):q.a.I18n.t("notSentYet");return E()(t="".concat(e.subject," (")).call(t,a,")")}}];return e?E()(t=[]).call(t,a,[{name:"link_id",type:"selection",placeholder:q.a.I18n.t("selectLinkPlaceholder"),forceSelect2:!0,getLabel:function(e){return e.url},values:e}]):a}))},xs={name:"action",type:"select",values:{"":q.a.I18n.t("selectActionPlaceholder"),purchasedCategory:q.a.I18n.t("wooPurchasedCategory"),purchasedProduct:q.a.I18n.t("wooPurchasedProduct")}},Ts={name:"category_id",type:"selection",endpoint:"product_categories",resetSelect2OnUpdate:!0,placeholder:q.a.I18n.t("selectWooPurchasedCategory"),forceSelect2:!0,getLabel:O.a.property("cat_name"),getValue:O.a.property("term_id")},Rs={name:"product_id",type:"selection",endpoint:"products",resetSelect2OnUpdate:!0,placeholder:q.a.I18n.t("selectWooPurchasedProduct"),forceSelect2:!0,getLabel:O.a.property("title"),getValue:O.a.property("ID")},Ps={onUpdate:function(){return q.a.Notice.success(q.a.I18n.t("segmentUpdated"))},onCreate:function(e){q.a.Notice.success(q.a.I18n.t("segmentAdded")),q.a.trackEvent("Segments > Add new",{"MailPoet Free version":window.mailpoet_version,type:e.segmentType||"unknown type",subtype:e.action||e.wordpressRole||"unknown subtype"})}};var Os=function(e){function t(e){var a,n,r,i;return M()(this,t),(i=U()(this,W()(t).call(this,e))).state={item:{segmentType:"email"},childFields:[],errors:void 0},i.loadFields(),i.handleValueChange=F()(a=i.handleValueChange).call(a,K()(i)),i.handleSave=F()(n=i.handleSave).call(n,K()(i)),i.onItemLoad=F()(r=i.onItemLoad).call(r,K()(i)),i}return Y()(t,e),B()(t,[{key:"onItemLoad",value:function(e){var t=O.a.mapObject(e,(function(e){return O.a.isNull(e)?"":e}));this.setState({item:t},this.loadFields)}},{key:"getFields",value:function(){var e,t,a=this.state.childFields;return[{name:"name",label:q.a.I18n.t("name"),type:"text"},{name:"description",label:q.a.I18n.t("description"),type:"textarea",tip:q.a.I18n.t("descriptionTip")},{name:"filters",description:"main",label:q.a.I18n.t("formSegmentTitle"),fields:E()(e=[{name:"segmentType",type:"select",values:(t={email:q.a.I18n.t("email"),userRole:q.a.I18n.t("wpUserRole")},window.is_woocommerce_active&&(t.woocommerce=q.a.I18n.t("woocommerce")),t)}]).call(e,I()(a))}]}},{key:"getChildFields",value:function(){var e,t,a,n=this.state.item;switch(n.segmentType){case"userRole":return Ss.a.resolve([{name:"wordpressRole",type:"select",placeholder:q.a.I18n.t("selectUserRolePlaceholder"),values:Pe()(a=window.wordpress_editable_roles_list).call(a,(function(e,t){return O.a.extend({},e,y()({},t.role_id,t.role_name))}),{})}]);case"email":return Ns(n);case"woocommerce":return t=[xs],"purchasedCategory"===(e=n).action&&t.push(Ts),"purchasedProduct"===e.action&&t.push(Rs),Ss.a.resolve(t);default:return[]}}},{key:"loadFields",value:function(){var e=this;this.getChildFields().then((function(t){return e.setState({childFields:t})}))}},{key:"handleValueChange",value:function(e){var t=this.state.item;return t[e.target.name]=e.target.value,this.setState({item:t}),this.loadFields(),!0}},{key:"handleSave",value:function(e){var t=this,a=this.state.item,n=this.props,r=n.history,i=n.match;e.preventDefault(),this.setState({errors:void 0}),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"dynamic_segments",action:"save",data:a}).done((function(){r.push("/segments"),void 0!==i.params.id?Ps.onUpdate():Ps.onCreate(a)})).fail((function(e){e.errors.length>0&&t.setState({errors:e.errors})}))}},{key:"render",value:function(){var e=this.getFields(),t=this.props.match,a=this.state,n=a.item,r=a.errors;return R.a.createElement(R.a.Fragment,null,R.a.createElement("h1",{className:"title"},q.a.I18n.t("formPageTitle")," ",R.a.createElement(st.b,{className:"page-title-action",to:"/segments"},q.a.I18n.t("backToList"))),R.a.createElement($a,{endpoint:"dynamic_segments",fields:e,params:t.params,messages:Ps,onChange:this.handleValueChange,onSubmit:this.handleSave,onItemLoad:this.onItemLoad,item:n,errors:r}))}}]),t}(R.a.Component);Os.propTypes={match:Z.a.shape({params:Z.a.shape({id:Z.a.string}).isRequired}).isRequired,history:Z.a.shape({push:Z.a.func.isRequired}).isRequired};var Ds=Object(ne.withRouter)(Os),As=document.getElementById("segments_container");As&&_e.a.render(R.a.createElement((function(){return R.a.createElement(Ge.a.Provider,{value:Object(Ge.b)(window)},R.a.createElement(st.a,null,R.a.createElement(en,null),R.a.createElement(ne.Switch,null,R.a.createElement(ne.Route,{path:"/new",component:ks}),R.a.createElement(ne.Route,{path:"/edit/:id",component:ks}),R.a.createElement(ne.Route,{path:"/new-segment",component:Ds}),R.a.createElement(ne.Route,{path:"/edit-segment/:id",component:Ds}),R.a.createElement(ne.Route,{path:"/segments/(.*)?",component:_s}),R.a.createElement(ne.Route,{path:"*",component:ms}))))}),null),As);var qs=[{name:"name",label:q.a.I18n.t("formName"),sortable:!0},{name:"segments",label:q.a.I18n.t("segments")},{name:"signups",label:q.a.I18n.t("signups")},{name:"created_at",label:q.a.I18n.t("createdOn"),sortable:!0}],Ls={onTrash:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneFormTrashed"):q.a.I18n.t("multipleFormsTrashed").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onDelete:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneFormDeleted"):q.a.I18n.t("multipleFormsDeleted").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)},onRestore:function(e){var t=Number(e.meta.count),a=null;a=1===t?q.a.I18n.t("oneFormRestored"):q.a.I18n.t("multipleFormsRestored").replace("%$1d",t.toLocaleString()),q.a.Notice.success(a)}},Fs=[{name:"trash",label:q.a.I18n.t("moveToTrash"),onSuccess:Ls.onTrash}],js=[{name:"edit",label:q.a.I18n.t("edit"),link:function(e){return R.a.createElement("a",{href:"admin.php?page=mailpoet-form-editor&id=".concat(e.id)},q.a.I18n.t("edit"))}},{name:"duplicate",label:q.a.I18n.t("duplicate"),onClick:function(e,t){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"forms",action:"duplicate",data:{id:e.id}}).done((function(e){var a=e.data.name?e.data.name:q.a.I18n.t("noName");q.a.Notice.success(q.a.I18n.t("formDuplicated").replace("%$1s",a)),t()})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))}},{name:"trash"}],Ms=function(e){function t(){var e,a,n;M()(this,t);for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];return n=U()(this,(e=W()(t)).call.apply(e,E()(a=[this]).call(a,i))),y()(K()(n),"createForm",(function(){q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"forms",action:"create"}).done((function(e){q.a.trackEvent("Forms > Add New",{"MailPoet Free version":window.mailpoet_version}),Yt()((function(){window.location=window.mailpoet_form_edit_url+e.data.id}),200)})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))})),y()(K()(n),"renderItem",(function(e,t){var a,n,r,i=lt()("manage-column","column-primary","has-row-actions"),s=x()(a=h()(n=window.mailpoet_segments).call(n,(function(t){return-1!==ve.a.inArray(t.id,e.segments)}))).call(a,(function(e){return e.name})).join(", ");"user"===e.settings.segments_selected_by&&(s=E()(r="".concat(q.a.I18n.t("userChoice")," ")).call(r,s));return R.a.createElement("div",null,R.a.createElement("td",{className:i},R.a.createElement("strong",null,R.a.createElement("a",{className:"row-title",href:"admin.php?page=mailpoet-form-editor&id=".concat(e.id)},e.name?e.name:"(".concat(q.a.I18n.t("noName"),")"))),t),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("segments")},s),R.a.createElement("td",{className:"column","data-colname":q.a.I18n.t("signups")},e.signups),R.a.createElement("td",{className:"column-date","data-colname":q.a.I18n.t("createdOn")},R.a.createElement("abbr",null,q.a.Date.format(e.created_at))))})),n}return Y()(t,e),B()(t,[{key:"render",value:function(){return R.a.createElement("div",null,R.a.createElement("h1",{className:"title"},q.a.I18n.t("pageTitle")," ",R.a.createElement("button",{className:"page-title-action",onClick:this.createForm,"data-automation-id":"create_new_form",type:"button"},q.a.I18n.t("new"))),R.a.createElement(it.a,{limit:window.mailpoet_listing_per_page,location:this.props.location,params:this.props.match.params,messages:Ls,search:!1,endpoint:"forms",onRenderItem:this.renderItem,columns:qs,bulk_actions:Fs,item_actions:js}))}}]),t}(R.a.Component);Ms.propTypes={location:Z.a.object.isRequired,match:Z.a.shape({params:Z.a.object}).isRequired};var Vs=bt(Ms),Bs=document.getElementById("forms_container");Bs&&_e.a.render(R.a.createElement((function(){return R.a.createElement(Ge.a.Provider,{value:Object(Ge.b)(window)},R.a.createElement(st.a,null,R.a.createElement(en,null),R.a.createElement(ne.Route,{path:"*",component:Vs})))}),null),Bs);var zs=[{name:"knowledgeBase",label:q.a.I18n.t("tabKnowledgeBaseTitle"),link:"/knowledgeBase"},{name:"systemStatus",label:q.a.I18n.t("tabSystemStatusTitle"),link:"/systemStatus"},{name:"systemInfo",label:q.a.I18n.t("tabSystemInfoTitle"),link:"/systemInfo"},{name:"yourPrivacy",label:q.a.I18n.t("tabYourPrivacyTitle"),link:"/yourPrivacy"}];function Us(e){var t=x()(zs).call(zs,(function(t){var a=lt()("nav-tab",{"nav-tab-active":e.tab===t.name});return R.a.createElement(st.b,{key:"tab-".concat(t.name),className:a,to:t.link},t.label)}));return R.a.createElement("h2",{className:"nav-tab-wrapper"},t)}Us.propTypes={tab:Z.a.string},Us.defaultProps={tab:"knowledgeBase"};var $s=Us;var Ws=function(){return R.a.createElement("div",null,R.a.createElement($s,{tab:"knowledgeBase"}),R.a.createElement("p",null,q.a.I18n.t("knowledgeBaseIntro")),R.a.createElement("ul",null,R.a.createElement("li",null,R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://kb.mailpoet.com/category/116-common-problems"},"Common Problems")),R.a.createElement("li",null,R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://kb.mailpoet.com/category/165-newsletters"},"Newsletters")),R.a.createElement("li",null,R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://kb.mailpoet.com/category/156-migration-questions"},"Migration Questions")),R.a.createElement("li",null,R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://kb.mailpoet.com/category/149-sending-methods"},"Sending Methods")),R.a.createElement("li",null,R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://kb.mailpoet.com/category/139-subscription-forms"},"Subscription Forms")),R.a.createElement("li",null,R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://kb.mailpoet.com/category/114-getting-started"},"Getting Started")),R.a.createElement("li",null,R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://kb.mailpoet.com/category/123-newsletter-designer"},"Newsletter Designer")),R.a.createElement("li",null,R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://kb.mailpoet.com/category/121-subscribers-and-lists"},"Subscribers and Lists"))),R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://kb.mailpoet.com/",className:"button button-primary"},q.a.I18n.t("knowledgeBaseButton")))};function Hs(e){e.target.select()}var Ks=function(){var e=window.systemInfoData;return R.a.createElement("div",null,R.a.createElement($s,{tab:"systemInfo"}),R.a.createElement("div",{className:"mailpoet_notice notice inline",style:{marginTop:"1em"}},R.a.createElement("p",null,q.a.I18n.t("systemInfoIntro"))),function(e){if(O.a.isObject(e)){var t,a=x()(t=b()(e)).call(t,(function(t){var a;return E()(a="".concat(t,": ")).call(a,e[t])}));return R.a.createElement("textarea",{readOnly:!0,onFocus:Hs,value:a.join("\n"),style:{width:"100%",height:"400px"}})}return R.a.createElement("p",null,q.a.I18n.t("systemInfoDataError"))}(e))},Gs=function(e){var t;return R.a.createElement("table",{className:"widefat fixed",style:{maxWidth:e.max_width}},R.a.createElement("tbody",null,x()(t=e.rows).call(t,(function(e){return R.a.createElement("tr",{key:"row_".concat(e.key)},R.a.createElement("td",{className:"row-title"},e.key),R.a.createElement("td",null,e.value))}))))};Gs.propTypes={max_width:Z.a.string,rows:Z.a.arrayOf(Z.a.shape({key:Z.a.string.isRequired,value:Z.a.oneOfType([Z.a.string,Z.a.number,Z.a.element]).isRequired})).isRequired},Gs.defaultProps={max_width:"auto"};var Ys=Gs,Js=function(e){return R.a.createElement("span",null,!0===e.children&&e.truthy||!1===e.children&&e.falsy||e.unknown)};Js.propTypes={truthy:Z.a.string,falsy:Z.a.string,unknown:Z.a.string,children:Z.a.bool},Js.defaultProps={truthy:q.a.I18n.t("yes"),falsy:q.a.I18n.t("no"),unknown:q.a.I18n.t("unknown"),children:null};var Qs=Js,Zs=function(e){var t,a=e.status_data,n={active:q.a.I18n.t("running"),inactive:q.a.I18n.t("cronWaiting")},r=nt()(a.last_error)?R.a.createElement(R.a.Fragment,null,x()(t=a.last_error).call(t,(function(e){return R.a.createElement("div",{key:e.worker},e.worker,":"," ",R.a.createElement("i",null,e.message))}))):a.last_error;return R.a.createElement("div",null,R.a.createElement("h2",null,q.a.I18n.t("systemStatusCronStatusTitle")),R.a.createElement(Ys,{max_width:"400px",rows:[{key:q.a.I18n.t("accessible"),value:R.a.createElement(Qs,null,a.accessible)},{key:q.a.I18n.t("status"),value:n[a.status]?n[a.status]:q.a.I18n.t("unknown")},{key:q.a.I18n.t("lastUpdated"),value:a.updated_at?q.a.Date.full(1e3*a.updated_at):q.a.I18n.t("unknown")},{key:q.a.I18n.t("lastRunStarted"),value:a.run_accessed_at?q.a.Date.full(1e3*a.run_started_at):q.a.I18n.t("unknown")},{key:q.a.I18n.t("lastRunCompleted"),value:a.run_completed_at?q.a.Date.full(1e3*a.run_completed_at):q.a.I18n.t("unknown")},{key:q.a.I18n.t("lastSeenError"),value:r||q.a.I18n.t("none")},{key:q.a.I18n.t("lastSeenErrorDate"),value:a.last_error_date?q.a.Date.full(1e3*a.last_error_date):q.a.I18n.t("unknown")}]}))};Zs.propTypes={status_data:Z.a.shape({accessible:Z.a.bool,last_error_date:Z.a.string,status:Z.a.string,updated_at:Z.a.number,run_accessed_at:Z.a.number,run_completed_at:Z.a.number,run_started_at:Z.a.number,last_error:Z.a.oneOfType([Z.a.string,Z.a.array])}).isRequired};var Xs=Zs,eo=function(e){return R.a.createElement("tr",null,R.a.createElement("td",{className:"column column-primary"},e.task.id),R.a.createElement("td",{className:"column"},e.task.type),R.a.createElement("td",{className:"column"},e.task.newsletter?R.a.createElement("a",{href:e.task.newsletter.preview_url,"data-newsletter-id":e.task.newsletter.newsletter_id,"data-queue-id":e.task.newsletter.queue_id,target:"_blank",rel:"noopener noreferrer"},e.task.newsletter.subject||q.a.I18n.t("preview")):q.a.I18n.t("none")),R.a.createElement("td",{className:"column"},e.task.priority),e.show_scheduled_at?R.a.createElement("td",{className:"column-date"},R.a.createElement("abbr",null,q.a.Date.format(1e3*e.task.scheduled_at))):null,R.a.createElement("td",{className:"column-date"},R.a.createElement("abbr",null,q.a.Date.format(1e3*e.task.updated_at))))};eo.propTypes={show_scheduled_at:Z.a.bool,task:Z.a.shape({id:Z.a.number.isRequired,type:Z.a.string.isRequired,priority:Z.a.number.isRequired,updated_at:Z.a.number.isRequired,scheduled_at:Z.a.number,status:Z.a.string,newsletter:Z.a.shape({newsletter_id:Z.a.number.isRequired,queue_id:Z.a.number.isRequired,preview_url:Z.a.string.isRequired,subject:Z.a.string})}).isRequired},eo.defaultProps={show_scheduled_at:!1};var to=eo,ao=function(e){return R.a.createElement("tr",null,R.a.createElement("th",{className:"row-title"},"Id"),R.a.createElement("th",{className:"row-title"},q.a.I18n.t("type")),R.a.createElement("th",{className:"row-title"},q.a.I18n.t("email")),R.a.createElement("th",{className:"row-title"},q.a.I18n.t("priority")),e.show_scheduled_at?R.a.createElement("th",{className:"row-title"},q.a.I18n.t("scheduledAt")):null,R.a.createElement("th",{className:"row-title"},q.a.I18n.t("updatedAt")))};ao.propTypes={show_scheduled_at:Z.a.bool},ao.defaultProps={show_scheduled_at:!1};var no=ao,ro=function(e){var t,a=e.show_scheduled_at?6:5;return R.a.createElement("table",{className:"widefat fixed striped"},R.a.createElement("thead",null,R.a.createElement(no,{show_scheduled_at:e.show_scheduled_at})),R.a.createElement("tbody",null,e.tasks.length?x()(t=e.tasks).call(t,(function(t){return R.a.createElement(to,{key:t.id,task:t,show_scheduled_at:e.show_scheduled_at})})):R.a.createElement("tr",{className:"no-items"},R.a.createElement("td",{colSpan:a},q.a.I18n.t("nothingToShow")))),R.a.createElement("tfoot",null,R.a.createElement(no,{show_scheduled_at:e.show_scheduled_at})))};ro.propTypes={show_scheduled_at:Z.a.bool,tasks:Z.a.arrayOf(to.propTypes.task).isRequired},ro.defaultProps={show_scheduled_at:!1};var io=ro,so=function(e){var t,a,n,r=e.status_data;return R.a.createElement("div",null,R.a.createElement("h2",null,q.a.I18n.t("systemStatusQueueTitle")),R.a.createElement(Ys,{max_width:"400px",rows:[{key:q.a.I18n.t("status"),value:"paused"===r.status?q.a.I18n.t("paused"):q.a.I18n.t("running")},{key:q.a.I18n.t("startedAt"),value:r.started?q.a.Date.full(1e3*r.started):q.a.I18n.t("unknown")},{key:q.a.I18n.t("sentEmails"),value:r.sent||0},{key:q.a.I18n.t("retryAttempt"),value:r.retry_attempt||q.a.I18n.t("none")},{key:q.a.I18n.t("retryAt"),value:r.retry_at?q.a.Date.full(1e3*r.retry_at):q.a.I18n.t("none")},{key:q.a.I18n.t("error"),value:r.error?r.error.error_message:q.a.I18n.t("none")},{key:q.a.I18n.t("totalCompletedTasks"),value:r.tasksStatusCounts.completed},{key:q.a.I18n.t("totalRunningTasks"),value:r.tasksStatusCounts.running},{key:q.a.I18n.t("totalPausedTasks"),value:r.tasksStatusCounts.paused},{key:q.a.I18n.t("totalScheduledTasks"),value:r.tasksStatusCounts.scheduled}]}),R.a.createElement("h4",null,q.a.I18n.t("scheduledTasks")),R.a.createElement(io,{show_scheduled_at:!0,tasks:h()(t=r.latestTasks).call(t,(function(e){return"scheduled"===e.status}))}),R.a.createElement("h4",null,q.a.I18n.t("runningTasks")),R.a.createElement(io,{tasks:h()(a=r.latestTasks).call(a,(function(e){return null===e.status}))}),R.a.createElement("h4",null,q.a.I18n.t("completedTasks")),R.a.createElement(io,{tasks:h()(n=r.latestTasks).call(n,(function(e){return"completed"===e.status}))}))};so.propTypes={status_data:Z.a.shape({status:Z.a.string,started:Z.a.number,sent:Z.a.number,retry_attempt:Z.a.number,retry_at:Z.a.number,error:Z.a.shape({operation:Z.a.string,error_message:Z.a.string}),tasksStatusCounts:Z.a.shape({completed:Z.a.number.isRequired,running:Z.a.number.isRequired,paused:Z.a.number.isRequired,scheduled:Z.a.number.isRequired}).isRequired,latestTasks:Z.a.arrayOf(to.propTypes.task).isRequired}).isRequired};var oo=so;function lo(e,t,a,n,r){var i,s=e?"success":"error",o=e?q.a.I18n.t("systemStatusConnectionSuccessful"):E()(i="".concat(q.a.I18n.t("systemStatusConnectionUnsuccessful")," ")).call(i,t);return a&&(o=St()(o,/\[link\](.*?)\[\/link\]/g,(function(e){return R.a.createElement("a",{href:a,"data-beacon-article":n,key:"kb-link"},e)}))),R.a.createElement("div",{className:"mailpoet_notice notice inline notice-".concat(s),style:{marginTop:"1em"}},R.a.createElement("p",null,o),r?R.a.createElement("p",null,R.a.createElement("i",null,r)):null)}var co=function(){var e,t,a,n,r,i=window.systemStatusData;return R.a.createElement("div",null,R.a.createElement($s,{tab:"systemStatus"}),R.a.createElement("div",{className:"mailpoet_notice notice inline",style:{marginTop:"1em"}},R.a.createElement("p",null,i.mss.enabled?q.a.I18n.t("systemStatusIntroCronMSS"):q.a.I18n.t("systemStatusIntroCron"))),(t=(e=i).cron.isReachable,a=e.cron.url,n=q.a.I18n.t("systemStatusCronConnectionUnsuccessfulInfo"),r=t?null:e.cron.pingResponse,R.a.createElement("div",null,R.a.createElement("h2",null,q.a.I18n.t("systemStatusCronTitle")),R.a.createElement("p",null,R.a.createElement("a",{href:a,target:"_blank",rel:"noopener noreferrer"},a)),lo(t,n,"https://kb.mailpoet.com/article/231-sending-does-not-work","5a0257ac2c7d3a272c0d7ad6",r))),function(e){if(e.mss.enabled){var t=e.mss.enabled.isReachable;return R.a.createElement("div",null,R.a.createElement("h2",null,q.a.I18n.t("systemStatusMSSTitle")),lo(t,q.a.I18n.t("systemStatusMSSConnectionUnsuccessfulInfo"),!1))}}(i),R.a.createElement(Xs,{status_data:i.cronStatus}),R.a.createElement(oo,{status_data:i.queueStatus}))};var uo=function(){return R.a.createElement("div",null,R.a.createElement($s,{tab:"yourPrivacy"}),R.a.createElement("p",null,q.a.I18n.t("yourPrivacyContent1")),R.a.createElement("p",null,q.a.I18n.t("yourPrivacyContent2")),R.a.createElement("p",null,q.a.I18n.t("yourPrivacyContent3")),R.a.createElement("a",{target:"_blank",rel:"noreferrer noopener",href:"https://www.mailpoet.com/privacy-notice/",className:"button button-primary"},q.a.I18n.t("yourPrivacyButton")))},po=document.getElementById("help_container");po&&_e.a.render(R.a.createElement((function(){return R.a.createElement(Ge.a.Provider,{value:Object(Ge.b)(window)},R.a.createElement(st.a,null,R.a.createElement(en,null),R.a.createElement(ne.Switch,null,R.a.createElement(ne.Route,{exact:!0,path:"/",render:function(){return R.a.createElement(ne.Redirect,{to:"/knowledgeBase"})}}),R.a.createElement(ne.Route,{path:"/knowledgeBase",component:Ws}),R.a.createElement(ne.Route,{path:"/systemStatus",component:co}),R.a.createElement(ne.Route,{path:"/systemInfo",component:Ks}),R.a.createElement(ne.Route,{path:"/yourPrivacy",component:uo}))))}),null),po);var mo=Object(ne.withRouter)((function(e){var t=e.children,a=e.location.pathname;return Object(T.useEffect)((function(){window.scrollTo(0,0)}),[a]),t||null}));function ho(e){var t=e.activeMethod,a=e.onMethodChange,n=R.a.useContext(Ge.a).users.isNewUser,r=lt()("mailpoet_badge","mailpoet_badge_video",{mailpoet_badge_video_grey:!n});return R.a.createElement(R.a.Fragment,null,R.a.createElement("form",{className:"mailpoet_import_selection_form"},R.a.createElement("span",{className:"mailpoet_import_heading"},q.a.I18n.t("methodSelectionHead")),R.a.createElement("label",{htmlFor:"import-paste-method"},R.a.createElement("input",{type:"radio",name:"select_method","data-automation-id":"import-paste-method",id:"import-paste-method",checked:"paste-method"===t,onChange:function(){return a("paste-method")}}),q.a.I18n.t("methodPaste")),R.a.createElement("label",{htmlFor:"import-csv-method"},R.a.createElement("input",{type:"radio",name:"select_method","data-automation-id":"import-csv-method",id:"import-csv-method",checked:"file-method"===t,onChange:function(){return a("file-method")}}),q.a.I18n.t("methodUpload")),R.a.createElement("label",{htmlFor:"import-mailchimp-method"},R.a.createElement("input",{type:"radio",name:"select_method","data-automation-id":"import-mailchimp-method",id:"import-mailchimp-method",checked:"mailchimp-method"===t,onChange:function(){return a("mailchimp-method")}}),q.a.I18n.t("methodMailChimp"))),R.a.createElement("a",{className:r,href:"https://kb.mailpoet.com/article/242-video-guide-importing-subscribers-using-a-csv-file","data-beacon-article":"5a8e8f0204286305fbc9be9a",target:"_blank",rel:"noopener noreferrer"},R.a.createElement("span",{className:"dashicons dashicons-format-video"}),q.a.I18n.t("seeVideo")))}ho.propTypes={activeMethod:Z.a.string,onMethodChange:Z.a.func.isRequired},ho.defaultProps={activeMethod:void 0};var fo=ho,go=function(e){var t=e.hidePrevious,a=e.canGoNext,n=e.onPreviousAction,r=e.onNextAction,i=lt()("button-primary","wysija",{"button-disabled":!a});return R.a.createElement("div",{className:"mailpoet_import_step_buttons"},!t&&R.a.createElement(R.a.Fragment,null,R.a.createElement("button",{className:"button-primary wysija button",type:"button",onClick:n},q.a.I18n.t("previousStep")),"  "),R.a.createElement("button",{type:"button","data-automation-id":"import-next-step",className:i,onClick:function(){a&&r()}},q.a.I18n.t("nextStep")))};go.propTypes={canGoNext:Z.a.bool,hidePrevious:Z.a.bool,onPreviousAction:Z.a.func,onNextAction:Z.a.func},go.defaultProps={hidePrevious:!1,canGoNext:!0,onPreviousAction:function(){},onNextAction:function(){}};var vo=go,bo=function(e){var t=e.onValueChange,a=e.canFinish,n=e.onFinish,r=e.data;return R.a.createElement(R.a.Fragment,null,R.a.createElement("label",{htmlFor:"paste_input",className:"mailpoet_import_method_paste"},R.a.createElement("div",{className:"mailpoet_import_paste_texts"},R.a.createElement("span",{className:"mailpoet_import_heading"},q.a.I18n.t("pasteLabel")),R.a.createElement("p",{className:"description"},St()(q.a.I18n.t("pasteDescription"),/\[link\](.*?)\[\/link\]/,(function(e){return R.a.createElement("a",{href:"".concat("https://kb.mailpoet.com/article/126-importing-subscribers-with-csv-files"),"data-beacon-article":"57ce079f903360649f6e56fc",key:"kb-link",target:"_blank",rel:"noopener noreferrer"},e)})))),R.a.createElement("textarea",{id:"paste_input",rows:"15",placeholder:"Email, First Name, Last Name\njohn@doe.com, John, Doe\nmary@smith.com, Mary, Smith\njohnny@walker.com, Johnny, Walker",className:"regular-text code",onChange:function(e){t(e.target.value)},defaultValue:r})),R.a.createElement(vo,{canGoNext:a,hidePrevious:!0,onNextAction:n}))};bo.propTypes={onFinish:Z.a.func,canFinish:Z.a.bool.isRequired,onValueChange:Z.a.func.isRequired,data:Z.a.string},bo.defaultProps={onFinish:function(){},data:""};var _o=bo,yo=function(e){var t=e.onValueChange,a=e.canFinish,n=e.onFinish;return R.a.createElement(R.a.Fragment,null,R.a.createElement("div",null,R.a.createElement("label",{htmlFor:"paste_input",className:"mailpoet_import_method_paste"},R.a.createElement("div",{className:"mailpoet_import_paste_texts"},R.a.createElement("span",{className:"mailpoet_import_heading"},q.a.I18n.t("methodUpload")),R.a.createElement("p",{className:"description"},St()(q.a.I18n.t("pasteDescription"),/\[link\](.*?)\[\/link\]/,(function(e){return R.a.createElement("a",{href:"".concat("https://kb.mailpoet.com/article/126-importing-subscribers-with-csv-files"),"data-beacon-article":"57ce079f903360649f6e56fc",key:"kb-link",target:"_blank",rel:"noopener noreferrer"},e)})))),R.a.createElement("input",{type:"file",id:"file_local",accept:".csv","data-automation-id":"import-file-upload-input",onChange:function(e){var a=e.target.value.match(/[^.]+$/);q.a.Notice.hide(),null===a||"csv"!==a[0].toLowerCase()?(q.a.Notice.error(q.a.I18n.t("wrongFileFormat")),t("")):t(e.target.files[0])}}))),R.a.createElement(vo,{canGoNext:a,hidePrevious:!0,onNextAction:n}))};yo.propTypes={canFinish:Z.a.bool.isRequired,onFinish:Z.a.func,onValueChange:Z.a.func.isRequired},yo.defaultProps={onFinish:function(){}};var wo=yo,Eo=function(e){var t=e.onFinish,a=Object(T.useState)(""),n=Ne()(a,2),r=n[0],i=n[1],s=Object(T.useState)(void 0),o=Ne()(s,2),l=o[0],c=o[1],u=Object(T.useState)([]),p=Ne()(u,2),d=p[0],m=p[1],h=lt()("mailpoet_mailchimp-key-status",{"mailpoet_mailchimp-ok":nt()(l)});return R.a.createElement("div",{className:"mailpoet_import_mailchimp"},R.a.createElement("div",{className:"mailpoet_mailchimp_key"},R.a.createElement("label",{htmlFor:"mailpoet_mailchimp_key_input",className:"mailpoet_mailchimp_key_input"},R.a.createElement("span",{className:"mailpoet_import_heading"},q.a.I18n.t("methodMailChimpLabel")),R.a.createElement("input",{id:"mailpoet_mailchimp_key_input",type:"text",onChange:function(e){var t;i(e.target.value),""===qa()(t=e.target.value).call(t)&&c(void 0)}})),R.a.createElement("button",{className:"button",type:"button",onClick:function(){q.a.Modal.loading(!0),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"importExport",action:"getMailChimpLists",data:{api_key:r}}).always((function(){q.a.Modal.loading(!1)})).done((function(e){return c(e.data)})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))}},q.a.I18n.t("methodMailChimpVerify")),R.a.createElement("span",{className:h},nt()(l)&&0===l.length?q.a.I18n.t("noMailChimpLists"):null)),l?R.a.createElement("div",{className:"mailpoet_mailchimp_lists"},R.a.createElement("span",{className:"mailpoet_import_heading"},q.a.I18n.t("methodMailChimpSelectList")),R.a.createElement(we,{field:{id:"segments",name:"list-selection",multiple:!0,placeholder:q.a.I18n.t("methodMailChimpSelectPlaceholder"),forceSelect2:!0,values:l},onValueChange:function(e){return m(e.target.value)}})):null,R.a.createElement(vo,{canGoNext:nt()(d)&&d.length>0,hidePrevious:!0,onNextAction:function(){q.a.Modal.loading(!0),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"importExport",action:"getMailChimpSubscribers",data:{api_key:r,lists:d}}).always((function(){q.a.Modal.loading(!1)})).done((function(e){return t(e.data)})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))}}))};Eo.propTypes={onFinish:Z.a.func},Eo.defaultProps={onFinish:function(){}};var ko=Eo,Io=a(487),So=a.n(Io),Co=a(318),No=a.n(Co),xo=a(139),To=a.n(xo),Ro=function(e){var t;return To()(t=window.roleBasedEmails).call(t,(function(t){return No()(e).call(e,"".concat(t,"@"))}))>=0},Po=function(e){var t,a,n,r=ve()("<div />").html(e).text();(r=r.toLowerCase().replace(/^["';.,\s]+|[^\x20-\x7E]+$|["';.,_\s]+$/g,"").replace(/\s+|%\d+|,+/g,""),t=/<(.*?)>/.exec(r))&&(r=qa()(a=t[1]).call(a));(t=/mailto:(?:\s+)?(.*)/.exec(r))&&(r=qa()(n=t[1]).call(n));return!!window.mailpoet_email_regex.test(r)&&(!Ro(r)&&r)};var Oo=function(e){var t,a,n,r,i,s=[],o=[],l=[],c=[],p=[],d=null,m=null,h=!1;return u()(t=b()(e)).call(t,(function(t){var f,g;(r=x()(f=e[t]).call(f,(function(e){return qa()(e).call(e)})),i=r.length,null===m&&(m=i),i===m)&&(null===d?(u()(g=b()(r)).call(g,(function(e){n=Po(r[e]),null===d&&window.mailpoet_email_regex.test(n)&&(d=e,o[n]=!0,r[e]=n,s[n]=r)})),null===d&&0===Se()(t,10)&&(h=!0,s[0]=r)):""!==r[d]&&(a=Po(r[d]),O.a.has(o,a)?l.push(a):Ro(r[d])?p.push(r[d]):window.mailpoet_email_regex.test(a)?(o[a]=!0,r[d]=a,s[a]=r):c.push(r[d])))})),(s=ce()(O.a).call(O.a,s))&&(h&&s.length>=2||!h&&s.length>=1)?{header:window.mailpoet_email_regex.test(s[0][d])?null:s.shift(),subscribers:s,subscribersCount:s.length,duplicate:O.a.uniq(l),invalid:O.a.uniq(c),role:O.a.uniq(p)}:null};var Do=function(e,t){var a=encodeURI(e).split(/%..|./).length-1;q.a.Notice.hide(),a>window.maxPostSizeBytes?q.a.Notice.error(q.a.I18n.t("maxPostSizeNotice")):(q.a.Modal.loading(!0),So.a.parse(e,function(e){return{skipEmptyLines:!0,error:function(){q.a.Notice.hide(),q.a.Notice.error(q.a.I18n.t("dataProcessingError"))},complete:function(t){var a=Oo(t.data);if(a)e(a);else{var n=q.a.I18n.t("noValidRecords");n=(n=n.replace("[link]",'<a href="https://kb.mailpoet.com/article/126-importing-subscribers-with-csv-files" data-beacon-article="57ce079f903360649f6e56fc">')).replace("[/link]","</a>"),q.a.Notice.error(n)}q.a.Modal.loading(!1)}}}(t)))},Ao=function(e,t,a){return void 0===e?"step_data_manipulation":void 0===e.subscribersCount?"step_data_manipulation":e.subscribersCount<t?"step_data_manipulation":"mailchimp-method"===a?"step_data_manipulation":"step_input_validation"};function qo(e){var t=e.history,a=e.setStepMethodSelectionData,n=e.subscribersLimitForValidation,r=Object(T.useState)(void 0),i=Ne()(r,2),s=i[0],o=i[1],l=Object(T.useState)(""),c=Ne()(l,2),u=c[0],p=c[1],d=Object(T.useState)(void 0),m=Ne()(d,2),h=m[0],f=m[1],g=function(e){a(e),t.push(Ao(e,n,s))},v=function(){Do("paste-method"===s?u:h,(function(e){q.a.trackEvent("Subscribers import started",{source:"file-method"===s?"file upload":"pasted data","MailPoet Free version":window.mailpoet_version}),g(e)}))};return R.a.createElement("div",{className:"mailpoet_method_selection_step"},R.a.createElement(fo,{activeMethod:s,onMethodChange:o}),"paste-method"===s&&R.a.createElement(_o,{onValueChange:p,onFinish:v,canFinish:!!qa()(u).call(u),data:u}),"file-method"===s&&R.a.createElement(wo,{onValueChange:f,onFinish:v,canFinish:!!h,data:h}),"mailchimp-method"===s&&R.a.createElement(ko,{onFinish:function(e){q.a.trackEvent("Subscribers import started",{source:"MailChimp","MailPoet Free version":window.mailpoet_version}),g(e)}}))}qo.propTypes={history:Z.a.shape({push:Z.a.func.isRequired}).isRequired,setStepMethodSelectionData:Z.a.func.isRequired,subscribersLimitForValidation:Z.a.number.isRequired};var Lo=Object(ne.withRouter)(qo);function Fo(e){var t=e.onSubmit,a=e.history,n=Object(T.useState)(void 0),r=Ne()(n,2),i=r[0],s=r[1];return R.a.createElement(R.a.Fragment,null,R.a.createElement("h2",null,q.a.I18n.t("validationStepHeading")),R.a.createElement("label",{htmlFor:"existing-list"},R.a.createElement("input",{"data-automation-id":"mailpoet_import_validation_step_option1",type:"radio",id:"existing-list",checked:"existing-list"===i,onChange:function(){return s("existing-list")}}),q.a.I18n.t("validationStepRadio1")),R.a.createElement("label",{htmlFor:"address-book"},R.a.createElement("input",{"data-automation-id":"mailpoet_import_validation_step_option2",type:"radio",id:"address-book",checked:"address-book"===i,onChange:function(){return s("address-book")}}),q.a.I18n.t("validationStepRadio2")),R.a.createElement(vo,{canGoNext:void 0!==i,onPreviousAction:function(){return a.push("step_method_selection")},onNextAction:function(){return t(i)}}))}Fo.propTypes={history:Z.a.shape({push:Z.a.func.isRequired}).isRequired,onSubmit:Z.a.func.isRequired};var jo=Fo;var Mo=function(){return R.a.createElement("div",{className:"mailpoet_import_block","data-automation-id":"import_wrong_source_block"},R.a.createElement("p",null,q.a.I18n.t("validationStepBlock1")),R.a.createElement("p",null,q.a.I18n.t("validationStepBlock2")),R.a.createElement("a",{href:"https://kb.mailpoet.com/article/269-reconfirm-subscribers-to-your-list",target:"_blank",rel:"noopener noreferrer",className:"button button-primary"},q.a.I18n.t("validationStepBlockButton")))};var Vo=function(){return R.a.createElement("div",{className:"mailpoet_import_block","data-automation-id":"import_old_list_block"},R.a.createElement("p",null,q.a.I18n.t("validationStepBlock1")),R.a.createElement("p",null,q.a.I18n.t("validationStepBlock3")),R.a.createElement("p",null,q.a.I18n.t("validationStepBlock4")),R.a.createElement("a",{href:"https://kb.mailpoet.com/article/269-reconfirm-subscribers-to-your-list",target:"_blank",rel:"noopener noreferrer",className:"button button-primary"},q.a.I18n.t("validationStepBlockButton")))};function Bo(e){var t=e.onSubmit,a=Object(T.useState)("over2years"),n=Ne()(a,2),r=n[0],i=n[1];return R.a.createElement(R.a.Fragment,null,R.a.createElement("h2",null,q.a.I18n.t("validationStepLastSentHeading")),R.a.createElement("select",{value:r,onChange:function(e){i(e.target.value)},className:"mailpoet_last_sent","data-automation-id":"last_sent_to_list"},R.a.createElement("option",{value:"over2years"},q.a.I18n.t("validationStepLastSentOption1")),R.a.createElement("option",{value:"1to2years"},q.a.I18n.t("validationStepLastSentOption2")),R.a.createElement("option",{value:"less1year"},q.a.I18n.t("validationStepLastSentOption3")),R.a.createElement("option",{value:"less3months"},q.a.I18n.t("validationStepLastSentOption4"))),R.a.createElement("button",{type:"button",className:"button button-primary","data-automation-id":"last_sent_to_list_next",onClick:function(){t("over2years"===r||"1to2years"===r?"notRecently":"recently")}},q.a.I18n.t("validationStepLastSentNext")))}Bo.propTypes={onSubmit:Z.a.func.isRequired};var zo=Bo;function Uo(e){var t=e.stepMethodSelectionData,a=e.history,n=Object(T.useState)(void 0),r=Ne()(n,2),i=r[0],s=r[1],o=Object(T.useState)(void 0),l=Ne()(o,2),c=l[0],u=l[1];return Object(T.useEffect)((function(){void 0===t&&a.replace("step_method_selection")}),[t,a]),R.a.createElement("div",{className:"mailpoet_import_validation_step","data-automation-id":"mailpoet_import_validation_step"},void 0===i&&R.a.createElement(jo,{onSubmit:s,history:a}),"address-book"===i&&R.a.createElement(Mo,null),"existing-list"===i&&void 0===c&&R.a.createElement(zo,{onSubmit:function(e){u(e),"recently"===e&&a.push("step_data_manipulation")}}),"existing-list"===i&&"notRecently"===c&&R.a.createElement(Vo,null))}Uo.propTypes={history:Z.a.shape({push:Z.a.func.isRequired,replace:Z.a.func.isRequired}).isRequired,stepMethodSelectionData:Z.a.shape({duplicate:Z.a.arrayOf(Z.a.string),header:Z.a.arrayOf(Z.a.string),invalid:Z.a.arrayOf(Z.a.string),role:Z.a.arrayOf(Z.a.string),subscribersCount:Z.a.number,subscribers:Z.a.arrayOf(Z.a.arrayOf(Z.a.string))})},Uo.defaultProps={stepMethodSelectionData:void 0};var $o=Object(ne.withRouter)(Uo),Wo=function(e){var t=e.translation,a=e.subscribers,n="";return a.length&&(n=St()(t.replace("%2$s",a.join(", ")),"%1$s",(function(){return R.a.createElement("strong",{key:t},a.length.toLocaleString())})),n=R.a.createElement("p",null,n)),n};Wo.propTypes={translation:Z.a.string.isRequired,subscribers:Z.a.arrayOf(Z.a.string).isRequired};var Ho=function(e){var t=e.stepMethodSelectionData,a=t.invalid,n=t.duplicate,r=t.role,i=Object(T.useState)(!1),s=Ne()(i,2),o=s[0],l=s[1],c=lt()("mailpoet_subscribers_data_parse_results_details",{mailpoet_hidden:!o}),u=R.a.createElement(Wo,{translation:q.a.I18n.t("importNoticeInvalid"),subscribers:a}),p=R.a.createElement(Wo,{translation:q.a.I18n.t("importNoticeDuplicate"),subscribers:n}),d="";if(r.length&&(d=St()(q.a.I18n.t("importNoticeRoleBased"),/(%1\$s|\[link\].*\[\/link\]|%2\$s)/,(function(e){return"%1$s"===e?R.a.createElement("strong",{key:"role-length"},r.length.toLocaleString()):"%2$s"===e?r.join(", "):R.a.createElement("a",{href:"https://kb.mailpoet.com/article/270-role-based-email-addresses-are-not-allowed","data-beacon-article":"5d0a1da404286318cac46fe5",target:"_blank",rel:"noopener noreferrer",key:e},e.replace("[link]","").replace("[/link]",""))})),d=R.a.createElement("p",null,d)),a.length||n.length||r.length){var m=a.length+n.length+r.length;return R.a.createElement("div",{className:"error"},R.a.createElement("p",null,St()(q.a.I18n.t("importNoticeSkipped"),"%1$s",(function(){return R.a.createElement("strong",{key:"lengths"},m.toLocaleString())}))," ",R.a.createElement("a",{className:"mailpoet_subscribers_data_parse_results_details_show","data-automation-id":"show-more-details",onClick:function(){return l(!o)},role:"button",tabIndex:0,onKeyDown:function(e){var t,a;C()(t=["keydown","keypress"]).call(t,e.type)&&C()(a=["Enter"," "]).call(a,e.key)&&(e.preventDefault(),l(!o))}},q.a.I18n.t("showMoreDetails"))),R.a.createElement("div",{className:c},R.a.createElement("hr",null),u,p,d))}return null};Ho.propTypes={stepMethodSelectionData:Z.a.shape({duplicate:Z.a.arrayOf(Z.a.string),invalid:Z.a.arrayOf(Z.a.string),role:Z.a.arrayOf(Z.a.string)})},Ho.defaultProps={stepMethodSelectionData:{invalid:[],duplicate:[],role:[]}};var Ko=Ho,Go=a(488),Yo=a.n(Go),Jo=a(489),Qo=a.n(Jo),Zo=function(){ve()("select.mailpoet_subscribers_column_data_match").select2({data:window.mailpoetColumnsSelect2,width:"15em",templateResult:function(e){return e.name},templateSelection:function(e){return e.name}}).on("select2:selecting",(function(e){var t=e.currentTarget,a=e.params.args.data.id;"create"===a?(e.preventDefault(),ve()(t).select2("close"),q.a.Modal.popup({title:q.a.I18n.t("addNewField"),template:ve()("#form_template_field_form").html()}),ve()("#form_field_new").parsley().on("form:submit",(function(){var e=ve()("#form_field_new").mailpoetSerializeObject();return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"customFields",action:"save",data:e}).done((function(e){var a={id:e.data.id,name:e.data.name,type:e.data.type,params:e.data.params,custom:!0};2===window.mailpoetColumnsSelect2.length&&window.mailpoetColumnsSelect2.push({name:q.a.I18n.t("userColumns"),children:[]}),window.mailpoetColumnsSelect2[2].children.push(a),window.mailpoetColumns.push(a),ve()("select.mailpoet_subscribers_column_data_match").each((function(){ve()(t).html("").select2("destroy").select2({data:window.mailpoetColumnsSelect2,width:"15em",templateResult:function(e){return e.name},templateSelection:function(e){return e.name}})})),ve()(t).data("column-id",a.id),q.a.Modal.close()})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{positionAfter:"#field_name"})})),!1}))):ve()("select.mailpoet_subscribers_column_data_match").each((function(){var n,r=t,i=ve()(r).val();i===a&&"ignore"!==i&&(confirm(E()(n="".concat(q.a.I18n.t("selectedValueAlreadyMatched")," ")).call(n,q.a.I18n.t("confirmCorrespondingColumn")))?ve()(r).data("column-id","ignore"):(e.preventDefault(),ve()(t).select2("close")))}))})).on("select2:select",(function(e){var t=e.currentTarget,a=e.params.data.id;ve()(t).data("column-id",a)})),x()(ve.a).call(ve.a,ve()(".mailpoet_subscribers_column_data_match"),(function(e){var t=ve()(e).data("column-id");ve()(e).val(t).trigger("change")}))},Xo=function(e,t){var a,n,r,i,s,o=[],l=[];return u()(a=b()(e[0])).call(a,(function(a){if(n=e[0][a],r="ignore",n%1!=0&&window.mailpoet_email_regex.test(n))r="email";else if(t){var c,u;i=t[a],-1!==(s=sn()(c=x()(u=window.mailpoetColumns).call(u,(function(e){return e.name}))).call(c,i))?r=window.mailpoetColumns[s].id:i&&(/first|first name|given name/i.test(i)?r="first_name":/last|last name/i.test(i)&&(r="last_name"))}r="ignore"!==r&&-1===sn()(l).call(l,r)?r:"ignore",o[a]={column_id:r},l.push(r)})),o},el=10;function tl(e){var t=e.header,a=e.subscribers,n=Xo(a,t);return R.a.createElement("tr",null,R.a.createElement("th",null,q.a.I18n.t("matchData")),x()(n).call(n,(function(e,t){return R.a.createElement("th",{key:e.column_id+t},R.a.createElement("select",{className:"mailpoet_subscribers_column_data_match","data-column-id":e.column_id,"data-column-index":t,id:"column_".concat(t)}))})))}function al(e){var t=e.header;return R.a.createElement("tr",{className:"mailpoet_header"},R.a.createElement("td",null),x()(t).call(t,(function(e){return R.a.createElement("td",{key:e},e)})))}function nl(e){var t=e.subscriber,a=e.index;return R.a.createElement(R.a.Fragment,null,R.a.createElement("td",null,a),x()(t).call(t,(function(e,t){var n,r;return R.a.createElement("td",{key:E()(n=E()(r="".concat(e,"-")).call(r,a,"-")).call(n,t)},e)})))}function rl(e){var t,a,n=e.subscribers,r=e.subscribersCount,i=Qo()(t=Array(n[0].length)).call(t,". . .");return R.a.createElement(R.a.Fragment,null,x()(a=Yo()(n).call(n,0,el)).call(a,(function(e,t){var a;return(R.a.createElement("tr",{key:E()(a="".concat(e[0],"-")).call(a,t)},R.a.createElement(nl,{subscriber:e,index:t+1})))})),r>el+1?R.a.createElement("tr",{key:"filler"},R.a.createElement(nl,{subscriber:i,index:". . ."})):null,r>el?R.a.createElement("tr",{key:n[r-1][0]},R.a.createElement(nl,{subscriber:n[r-1],index:r})):null)}function il(e){var t=e.subscribersCount,a=e.subscribers,n=e.header;return Object(T.useLayoutEffect)((function(){Zo()})),R.a.createElement("div",{className:"subscribers_data"},R.a.createElement("table",{className:"mailpoet_subscribers widefat fixed"},R.a.createElement("thead",null,R.a.createElement(tl,{header:n,subscribers:a})),R.a.createElement("tbody",null,n?R.a.createElement(al,{header:n}):null,R.a.createElement(rl,{subscribers:a,subscribersCount:t}))))}tl.propTypes={subscribers:Z.a.arrayOf(Z.a.arrayOf(Z.a.oneOfType([Z.a.string,Z.a.number]))).isRequired,header:Z.a.arrayOf(Z.a.string)},tl.defaultProps={header:[]},al.propTypes={header:Z.a.arrayOf(Z.a.string).isRequired},nl.propTypes={subscriber:Z.a.arrayOf(Z.a.oneOfType([Z.a.string,Z.a.number])).isRequired,index:Z.a.node.isRequired},rl.propTypes={subscribersCount:Z.a.number.isRequired,subscribers:Z.a.arrayOf(Z.a.arrayOf(Z.a.oneOfType([Z.a.string,Z.a.number]))).isRequired},il.propTypes={subscribersCount:Z.a.number,subscribers:Z.a.arrayOf(Z.a.arrayOf(Z.a.oneOfType([Z.a.string,Z.a.number]))),header:Z.a.arrayOf(Z.a.string)},il.defaultProps={subscribersCount:0,subscribers:[],header:[]};var sl=il;var ol=function(e){q.a.Modal.popup({title:q.a.I18n.t("addNewList"),template:ve()("#new_segment_template").html()}),ve()("#new_segment_name").keypress((function(e){13===e.which&&ve()("#new_segment_process").click()})),ve()("#new_segment_process").click((function(){var t,a,n=qa()(t=ve()("#new_segment_name").val()).call(t),r=qa()(a=ve()("#new_segment_description").val()).call(a);q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"ImportExport",action:"addSegment",data:{name:n,description:r}}).done((function(t){e({id:t.data.id,name:t.data.name,text:t.data.name,subscriberCount:0}),q.a.Modal.close()})).fail((function(e){var t;e.errors.length>0&&(q.a.Notice.hide(),q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{positionAfter:"#new_segment_name"}))}))})),ve()("#new_segment_cancel").click((function(){q.a.Modal.close()}))};function ll(e){var t=e.setSelectedSegments,a=Object(T.useContext)(Ge.a).segments.all,n=Object(T.useState)(a),r=Ne()(n,2),i=r[0],s=r[1];Object(T.useLayoutEffect)((function(){!function(e,t){var a=ve()("select#mailpoet_segments_select");a.data("select2")||(a.html(""),a.select2({data:e,width:"20em",templateResult:function(e){var t,a=e;return a.subscriberCount=Se()(a.subscriberCount,10),E()(t="".concat(a.name," (")).call(t,a.subscriberCount.toLocaleString(),")")},templateSelection:function(e){var t,a=e;return a.subscriberCount=Se()(a.subscriberCount,10),E()(t="".concat(a.name," (")).call(t,a.subscriberCount.toLocaleString(),")")}}).change((function(e){var n=ve()('[data-id="notice_segmentSelection"]');e.currentTarget.value?ve()('[data-id="notice_segmentSelection"]').remove():n.length||q.a.Notice.error(q.a.I18n.t("segmentSelectionRequired"),{static:!0,scroll:!0,id:"notice_segmentSelection",hideClose:!0});var r=O.a.pluck(a.select2("data"),"id");t(r)})))}(i,(function(e){t(e)}))}),[i,t]);var o=function(e){var a,n;(n=ve()("select#mailpoet_segments_select")).data("select2")&&(n.select2("destroy"),me()(n).call(n,"option").remove(),n.off("select2:unselecting").off("change").off("select2:opening")),t([]),s(E()(a=[]).call(a,I()(i),[e]))};return R.a.createElement("div",{className:"mailpoet_import_select_segment"},R.a.createElement("label",{htmlFor:"mailpoet_segments_select"},R.a.createElement("div",{className:"mailpoet_label_description"},R.a.createElement("b",null,q.a.I18n.t("pickLists")),R.a.createElement("p",{className:"description"},q.a.I18n.t("pickListsDescription"))),R.a.createElement("select",{id:"mailpoet_segments_select","data-placeholder":q.a.I18n.t("select"),multiple:"multiple"},R.a.createElement("option",null))),R.a.createElement("a",{className:"mailpoet_create_segment",onClick:function(){return ol(o)},role:"button",tabIndex:0,onKeyDown:function(e){var t,a;C()(t=["keydown","keypress"]).call(t,e.type)&&C()(a=["Enter"," "]).call(a,e.key)&&(e.preventDefault(),ol(o))}},q.a.I18n.t("createANewList")))}ll.propTypes={setSelectedSegments:Z.a.func.isRequired};var cl=ll;function ul(e){var t=e.updateExistingSubscribers,a=e.setUpdateExistingSubscribers;return R.a.createElement("div",{className:"mailpoet_update_existing_subscribers"},R.a.createElement("div",{className:"mailpoet_label_description"},q.a.I18n.t("updateExistingSubscribers")),R.a.createElement("label",{htmlFor:"update_existing_subscribers"},R.a.createElement("input",{id:"update_existing_subscribers",type:"radio",name:"update_existing_subscribers",checked:t,onChange:function(){return a(!0)}}),q.a.I18n.t("updateExistingSubscribersYes")),R.a.createElement("label",{htmlFor:"dont_update_existing_subscribers"},R.a.createElement("input",{id:"dont_update_existing_subscribers",type:"radio",name:"update_existing_subscribers",checked:!t,onChange:function(){return a(!1)}}),q.a.I18n.t("updateExistingSubscribersNo")))}ul.propTypes={setUpdateExistingSubscribers:Z.a.func.isRequired,updateExistingSubscribers:Z.a.bool.isRequired};var pl=ul,dl=(a(624),function(e,t,a,n){var r={},i=new ve.a.AsyncQueue,s=0,o=kt()()/1e3,l={created:0,updated:0,errors:[],segments:[]};q.a.Modal.loading(!0);var c,u,p=(c=e,u=2e3,Pe()(c).call(c,(function(e,t,a){return a%u==0&&e.push([]),e[e.length-1].push(t),e}),[]));O.a.each(ve()("select.mailpoet_subscribers_column_data_match"),(function(e,t){var a=ve()(e).data("column-id");"ignore"!==a&&(r[a]={index:t})})),O.a.each(p,(function(){i.add((function(e){e.pause(),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"ImportExport",action:"processImport",data:oe()({columns:r,subscribers:p[s],timestamp:o,segments:t,updateSubscribers:a})}).done((function(t){var a=t.data.added_to_segment_with_welcome_notification;l.created+=t.data.created,l.updated+=t.data.updated,l.segments=t.data.segments,l.added_to_segment_with_welcome_notification=a,e.run()})).fail((function(e){var t;(q.a.Modal.loading(!1),e.errors.length>0)&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})})),s+=1}))})),i.run(),i.onComplete((function(){q.a.Modal.loading(!1),l.errors.length>0&&!l.updated&&!l.created?q.a.Notice.error(O.a.flatten(l.errors)):(l.segments=x()(O.a).call(O.a,h()(O.a).call(O.a,l.segments,(function(e){return C()(t).call(t,e.id)})),(function(e){return e.name})),n(l))}))});function ml(e){var t=e.history,a=e.stepMethodSelectionData,n=e.subscribersLimitForValidation,r=e.setStepDataManipulationData,i=Object(T.useState)([]),s=Ne()(i,2),o=s[0],l=s[1],c=Object(T.useState)(!0),u=Ne()(c,2),p=u[0],d=u[1];Object(T.useEffect)((function(){void 0===a&&t.replace("step_method_selection")}),[a,t]);return void 0===a?null:R.a.createElement("div",{className:"mailpoet_data_manipulation_step","data-automation-id":"import_data_manipulation_step"},R.a.createElement(Ko,{stepMethodSelectionData:a}),R.a.createElement(sl,{subscribersCount:a.subscribersCount,subscribers:a.subscribers,header:a.header}),R.a.createElement(cl,{setSelectedSegments:l}),R.a.createElement(pl,{setUpdateExistingSubscribers:d,updateExistingSubscribers:p}),R.a.createElement(vo,{canGoNext:o.length>0,onPreviousAction:function(){return t.push(function(e,t){return void 0===e?"step_method_selection":void 0===e.subscribersCount?"step_method_selection":e.subscribersCount<t?"step_method_selection":"step_input_validation"}(a,n))},onNextAction:function(){dl(a.subscribers,o,p,(function(e){r(e),t.push("step_results")}))}}))}ml.propTypes={history:Z.a.shape({push:Z.a.func.isRequired,replace:Z.a.func.isRequired}).isRequired,stepMethodSelectionData:Z.a.shape({duplicate:Z.a.arrayOf(Z.a.string),header:Z.a.arrayOf(Z.a.string),invalid:Z.a.arrayOf(Z.a.string),role:Z.a.arrayOf(Z.a.string),subscribersCount:Z.a.number,subscribers:Z.a.arrayOf(Z.a.arrayOf(Z.a.oneOfType([Z.a.string,Z.a.number])))}),subscribersLimitForValidation:Z.a.number.isRequired,setStepDataManipulationData:Z.a.func.isRequired},ml.defaultProps={stepMethodSelectionData:void 0};var hl=Object(ne.withRouter)(ml),fl=function(e){return e.subscribersCount<2e3?null:R.a.createElement("div",{className:"mailpoet_offer_migration"},R.a.createElement("h2",null,q.a.I18n.t("offerMigrationHead")),R.a.createElement("p",null,q.a.I18n.t("offerMigrationSubhead"),":"),R.a.createElement("ul",{className:"default-list"},R.a.createElement("li",null,q.a.I18n.t("offerMigrationList1")),R.a.createElement("li",null,q.a.I18n.t("offerMigrationList2")),R.a.createElement("li",null,q.a.I18n.t("offerMigrationList3")),R.a.createElement("li",null,q.a.I18n.t("offerMigrationList4"))),R.a.createElement("a",{type:"button",className:"button-primary wysija",href:"https://www.mailpoet.com/concierge-migration/",target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("offerMigrationCTA")))};fl.propTypes={subscribersCount:Z.a.number.isRequired};var gl=fl;function vl(e){var t=e.subscribersCount,a=e.segments,n=e.initialMessage;if(t){var r=St()(n,"%1$s",(function(){return R.a.createElement("strong",{key:"%1$s"},t.toLocaleString())}));return r=St()(r,"%2$s",(function(){return'"'.concat(a.join('", "'),'"')})),R.a.createElement("p",null,r)}return null}function bl(e){var t=e.createdSubscribers,a=e.updatedSubscribers;return t||a?null:R.a.createElement("p",null,q.a.I18n.t("importNoAction"))}function _l(e){return e.addedToSegmentWithWelcomeNotification?R.a.createElement("p",null,q.a.I18n.t("importNoWelcomeEmail")):null}function yl(e){var t=e.errors,a=e.createdSubscribers,n=e.updatedSubscribers,r=e.segments,i=e.addedToSegmentWithWelcomeNotification,s=e.history;Object(T.useEffect)((function(){void 0===r&&0===t.length&&void 0===a&&void 0===n&&s.replace("step_method_selection")}),[r,a,t.length,s,n]),t.length&&q.a.Notice.error(O.a.flatten(t));var o=0;return null!=a&&(o+=a),null!=n&&(o+=n),R.a.createElement(R.a.Fragment,null,R.a.createElement("div",{className:"updated"},R.a.createElement(vl,{subscribersCount:a,segments:r,initialMessage:q.a.I18n.t("subscribersCreated")}),R.a.createElement(vl,{subscribersCount:n,segments:r,initialMessage:q.a.I18n.t("subscribersUpdated")}),R.a.createElement(bl,{createdSubscribers:a,updatedSubscribers:n}),R.a.createElement(_l,{addedToSegmentWithWelcomeNotification:i})),R.a.createElement("button",{type:"button",className:"button-primary wysija",onClick:function(){return s.push("step_method_selection")}},q.a.I18n.t("importAgain")),"  ",R.a.createElement("button",{type:"button",className:"button-primary wysija",onClick:function(){window.location.href="admin.php?page=mailpoet-subscribers"}},q.a.I18n.t("viewSubscribers")),R.a.createElement(gl,{subscribersCount:o}))}vl.propTypes={segments:Z.a.arrayOf(Z.a.string.isRequired),subscribersCount:Z.a.number,initialMessage:Z.a.string},vl.defaultProps={segments:[],subscribersCount:0,initialMessage:""},bl.propTypes={createdSubscribers:Z.a.number,updatedSubscribers:Z.a.number},bl.defaultProps={createdSubscribers:0,updatedSubscribers:0},_l.propTypes={addedToSegmentWithWelcomeNotification:Z.a.bool},_l.defaultProps={addedToSegmentWithWelcomeNotification:!1},yl.propTypes={history:Z.a.shape({push:Z.a.func.isRequired,replace:Z.a.func.isRequired}).isRequired,errors:Z.a.arrayOf(Z.a.string.isRequired),segments:Z.a.arrayOf(Z.a.string.isRequired),createdSubscribers:Z.a.number,updatedSubscribers:Z.a.number,addedToSegmentWithWelcomeNotification:Z.a.bool},yl.defaultProps={errors:[],segments:void 0,createdSubscribers:void 0,updatedSubscribers:void 0,addedToSegmentWithWelcomeNotification:void 0};var wl=Object(ne.withRouter)(yl),El=document.getElementById("import_container");El&&_e.a.render(R.a.createElement((function(){var e=Object(T.useState)(void 0),t=Ne()(e,2),a=t[0],n=t[1],r=Object(T.useState)({}),i=Ne()(r,2),s=i[0],o=i[1],l=Object(Ge.b)(window);return R.a.createElement(Ge.a.Provider,{value:l},R.a.createElement(st.a,null,R.a.createElement(en,null),R.a.createElement(mo,null,R.a.createElement(ne.Switch,null,R.a.createElement(ne.Route,{path:"/step_method_selection",render:function(e){return R.a.createElement(Lo,pe()({},e,{setStepMethodSelectionData:n,subscribersLimitForValidation:200}))}}),R.a.createElement(ne.Route,{path:"/step_input_validation",render:function(e){return R.a.createElement($o,pe()({},e,{stepMethodSelectionData:a}))}}),R.a.createElement(ne.Route,{path:"/step_data_manipulation",render:function(e){return R.a.createElement(hl,pe()({},e,{stepMethodSelectionData:a,subscribersLimitForValidation:200,setStepDataManipulationData:o}))}}),R.a.createElement(ne.Route,{path:"/step_results",render:function(e){return R.a.createElement(wl,pe()({},e,{errors:s.errors,createdSubscribers:s.created,updatedSubscribers:s.updated,segments:s.segments,addedToSegmentWithWelcomeNotification:s.added_to_segment_with_welcome_notification}))}}),R.a.createElement(ne.Route,{path:"*",render:function(){return R.a.createElement(ne.Redirect,{to:"/step_method_selection"})}})))))}),null),El);var kl=a(27),Il=a.n(kl);ve()(document).ready((function(){var e,t,a,n,r,i;function s(e){"on"===e?n.removeClass("button-disabled"):n.addClass("button-disabled")}ve()("#mailpoet_subscribers_export").length&&window.exportData.segments&&(i=Il.a.compile(ve()("#mailpoet_subscribers_export_template").html()),ve()("#mailpoet_subscribers_export > div.inside").html(i(window.exportData)),t=ve()("#export_lists"),a=ve()("#export_columns"),n=ve()("a.mailpoet_export_process"),r=function(e,n){e.data("select2")&&e.html("").select2("destroy"),e.select2({data:n,width:"20em",templateResult:function(e){return e.subscriberCount>0?e.name+" ("+Se()(e.subscriberCount,10).toLocaleString()+")":e.name},templateSelection:function(e){return e.subscriberCount>0?e.name+" ("+Se()(e.subscriberCount,10).toLocaleString()+")":e.name}}).on("select2:selecting",(function(t){var a,n=t.params.args.data.id,r=["select","deselect"];O.a.contains(r,n)&&(t.preventDefault(),"deselect"===n?ve()(this).val("").trigger("change"):(a=[],O.a.each(me()(e).call(e,"option"),(function(e){O.a.contains(r,e.value)||a.push(e.value)})),ve()(this).val(a).trigger("change")),ve()(this).select2("close"))})).on("change",(function(){window.exportData.segments&&t.select2("data").length&&a.select2("data").length||!window.exportData.segments&&a.select2("data").length?s("on"):s("off")}))},u()(e=window.segments).call(e,(function(e){t.append(ve()("<option></option>").attr("value",e.id).text(e.name))})),r(t,window.segments),r(a,window.subscriberFieldsSelect2),a.val(["email","first_name","last_name","list_status","global_status"]).trigger("change"),n.click((function(){var e;ve()(this).hasClass("button-disabled")||(q.a.Modal.loading(!0),e=ve()(':radio[name="option_format"]:checked').val(),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"ImportExport",action:"processExport",data:oe()({export_format_option:e,segments:!!window.exportData.segments&&t.val(),subscriber_fields:a.val()})}).always((function(){q.a.Modal.loading(!1)})).done((function(t){var a=q.a.I18n.t("exportMessage").replace("%1$s","<strong>"+Se()(t.data.totalExported,10).toLocaleString()+"</strong>").replace("[link]",'<a href="'+t.data.exportFileURL+'" target="_blank" >').replace("[/link]","</a>");ve()("#export_result_notice").html("<p>"+a+"</p>").show(),window.location.href=t.data.exportFileURL,q.a.trackEvent("Subscribers export completed",{"Total exported":t.data.totalExported,"File Format":e,"MailPoet Free version":window.mailpoet_version})})).fail((function(e){var t;e.errors.length>0&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})})))})))}));var Sl=function(e){return R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_content"},R.a.createElement("h1",null,q.a.I18n.t("welcomeWizardLetsStartTitle")),R.a.createElement("p",null,q.a.I18n.t("welcomeWizardSenderText")),R.a.createElement("form",{id:"mailpoet_sender_form",className:e.loading?"mailpoet_sender_form_loading":"",onSubmit:function(t){t.preventDefault(),ve()("#mailpoet_sender_form").parsley().validate()&&e.submit_sender()}},R.a.createElement("label",{htmlFor:"senderName"},q.a.I18n.t("senderName"),":",R.a.createElement("input",{name:"senderName",type:"text",placeholder:"John Doe",value:e.sender?e.sender.name:"","data-parsley-required":!0,onChange:function(t){return e.update_sender({name:t.target.value})}})),R.a.createElement("label",{htmlFor:"senderAddress"},q.a.I18n.t("senderAddress"),":",R.a.createElement("input",{name:"senderAddress",type:"text",placeholder:"john@doe.com",value:e.sender?e.sender.address:"","data-parsley-required":!0,"data-parsley-type":"email",onChange:function(t){return e.update_sender({address:t.target.value})}})),R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_controls"},R.a.createElement("input",{className:"button button-primary",type:"submit",value:q.a.I18n.t("next")})),R.a.createElement("a",{onClick:e.finish,href:"#finish",className:"sender_form_small"},q.a.I18n.t("noThanksSkip"))))};Sl.propTypes={finish:Z.a.func.isRequired,loading:Z.a.bool.isRequired,update_sender:Z.a.func.isRequired,submit_sender:Z.a.func.isRequired,sender:Z.a.shape({name:Z.a.string,address:Z.a.string})},Sl.defaultProps={sender:null};var Cl=Sl,Nl=function(e){return R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_content"},R.a.createElement("h1",null,q.a.I18n.t("welcomeWizardLetsStartTitle")),R.a.createElement("p",null,q.a.I18n.t("welcomeWizardSenderMigratedUserText")),R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_controls"},R.a.createElement("button",{type:"button",className:"button button-primary",onClick:e.next},q.a.I18n.t("next"))))};Nl.propTypes={next:Z.a.func.isRequired};var xl=Nl,Tl=function(e){return R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_content"},R.a.createElement("h1",null,q.a.I18n.t("welcomeWizardEmailCourseTitle")),R.a.createElement("p",null,q.a.I18n.t("welcomeWizardEmailCourseText")),R.a.createElement("iframe",{id:"mailpoet_form_iframe",width:"100%",scrolling:"no",frameBorder:"0",title:"Apply to course",src:"https://www.mailpoet.com?mailpoet_form_iframe=13",className:"mailpoet_form_iframe",marginWidth:"0",marginHeight:"0"}),R.a.createElement("button",{type:"button",className:"button button-primary",onClick:e.next},q.a.I18n.t("next")))};Tl.propTypes={next:Z.a.func.isRequired};var Rl=Tl,Pl=function(e){return R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_content"},R.a.createElement("h1",null,q.a.I18n.t("welcomeWizardUsageTrackingStepTitle")),R.a.createElement("p",null,q.a.I18n.t("welcomeWizardTrackingText")),R.a.createElement("h2",{className:"welcome_wizard_tracking_sub_title"},q.a.I18n.t("welcomeWizardUsageTrackingStepSubTitle")),R.a.createElement("ul",{className:"welcome_wizard_tracking_list"},R.a.createElement("li",null,q.a.I18n.t("welcomeWizardTrackingList1")),R.a.createElement("li",null,q.a.I18n.t("welcomeWizardTrackingList2")),R.a.createElement("li",null,q.a.I18n.t("welcomeWizardTrackingList3")),R.a.createElement("li",null,q.a.I18n.t("welcomeWizardTrackingList4")),R.a.createElement("li",null,q.a.I18n.t("welcomeWizardTrackingList5"))),R.a.createElement("a",{href:" https://kb.mailpoet.com/article/130-sharing-your-data-with-us","data-beacon-article":"57ce0aaac6979108399a0454",target:"_blank",rel:"noopener noreferrer"},q.a.I18n.t("welcomeWizardTrackingLink")),R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_controls\n        ".concat(e.loading?"mailpoet_welcome_wizard_step_controls_loading":"")},R.a.createElement("button",{type:"button",className:"button",onClick:e.skip_action,disabled:e.loading},q.a.I18n.t("skip")),R.a.createElement("button",{type:"button",className:"button button-primary",onClick:e.allow_action,disabled:e.loading},e.allow_text)))};Pl.propTypes={allow_action:Z.a.func.isRequired,allow_text:Z.a.string.isRequired,skip_action:Z.a.func.isRequired,loading:Z.a.bool.isRequired};var Ol=Pl,Dl=function(e){return R.a.createElement(R.a.Fragment,null,R.a.createElement("div",{className:"mailpoet_welcome_wizard_header"},R.a.createElement("img",{src:window.mailpoet_logo_url,width:"200",height:"87",alt:"MailPoet logo"})),R.a.createElement(wr,{illustrationUrl:e.illustrationUrl,step:e.step,stepsCount:e.stepsCount,displayProgressBar:e.displayProgressBar},e.children))};Dl.propTypes={illustrationUrl:Z.a.string.isRequired,step:Z.a.number.isRequired,displayProgressBar:Z.a.bool,stepsCount:Z.a.number.isRequired,children:Z.a.oneOfType([Z.a.arrayOf(Z.a.node),Z.a.node]).isRequired},Dl.defaultProps={displayProgressBar:!0};var Al=Dl,ql=function(e){var t,a=e.name,n=e.address,r=n.split("@").pop().toLowerCase();return sn()(t=window.mailpoet_free_domains).call(t,r)>-1?function(e){var t=e.name,a=e.address,n=window.location.hostname.replace("www.",""),r="wordpress@".concat(n);return{sender:{name:t,address:r},reply_to:{name:t,address:a},"signup_confirmation.from.address":r,"signup_confirmation.from.name":t,"signup_confirmation.reply_to.address":a,"signup_confirmation.reply_to.name":t}}({name:a,address:n}):function(e){var t=e.name,a=e.address;return{sender:{name:t,address:a},reply_to:{name:t,address:a},"signup_confirmation.from.address":a,"signup_confirmation.from.name":t,"signup_confirmation.reply_to.address":a,"signup_confirmation.reply_to.name":t}}({name:a,address:n})},Ll=function(){var e=3;return window.has_mss_key_specified||(e+=1),e},Fl=function(e,t,a){a<Ll()?e.push("/steps/".concat(a+1)):t()};function jl(e,t){var a=b()(e);if(g.a){var n=g()(e);t&&(n=h()(n).call(n,(function(t){return d()(e,t).enumerable}))),a.push.apply(a,n)}return a}var Ml=function(e){var t=Ll(),a=Se()(e.match.params.step,10),n=Object(T.useState)(!1),i=Ne()(n,2),o=i[0],c=i[1],p=Object(T.useState)(window.sender_data),m=Ne()(p,2),h=m[0],f=m[1];function g(){c(!0),window.location=window.finish_wizard_url}Object(T.useEffect)((function(){(a>t||a<1)&&e.history.push("/steps/1")}),[a,t,e.history]);var v=Object(P.partial)(Fl,e.history,g);function b(e){return c(!0),q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"settings",action:"set",data:e}).then((function(){return c(!1)})).fail((function(e){var t;(c(!1),e.errors.length>0)&&q.a.Notice.error(x()(t=e.errors).call(t,(function(e){return e.message})),{scroll:!0})}))}var _,w,E=(_=a,w=!window.is_mp2_migration_complete,1===_&&w?"WelcomeWizardSenderStep":1!==_||w?2===_?"WelcomeWizardEmailCourseStep":3===_?"WelcomeWizardUsageTrackingStep":"WelcomeWizardPitchMSSStep":"WelcomeWizardMigratedUserStep");return R.a.createElement("div",{className:"mailpoet_welcome_wizard_steps"},"WelcomeWizardSenderStep"===E?R.a.createElement(Al,{step:a,stepsCount:t,illustrationUrl:window.wizard_sender_illustration_url},R.a.createElement(Cl,{update_sender:function(e){f(function(e){for(var t=1;t<arguments.length;t++){var a,n=null!=arguments[t]?arguments[t]:{};if(t%2)u()(a=jl(Object(n),!0)).call(a,(function(t){y()(e,t,n[t])}));else if(l.a)s()(e,l()(n));else{var i;u()(i=jl(Object(n))).call(i,(function(t){r()(e,t,d()(n,t))}))}}return e}({},h,{},e))},submit_sender:function(){b(ql(h)).then((function(){return v(a)}))},finish:function(){c(!0),b(ql({address:window.admin_email,name:""})).then(g)},loading:o,sender:h})):null,"WelcomeWizardMigratedUserStep"===E?R.a.createElement(Al,{step:a,stepsCount:t,illustrationUrl:window.wizard_sender_illustration_url},R.a.createElement(xl,{next:function(){return v(a)}})):null,"WelcomeWizardEmailCourseStep"===E?R.a.createElement(Al,{step:a,stepsCount:t,illustrationUrl:window.wizard_email_course_illustration_url},R.a.createElement(Rl,{next:function(){return v(a)}})):null,"WelcomeWizardUsageTrackingStep"===E?R.a.createElement(Al,{step:a,stepsCount:t,illustrationUrl:window.wizard_tracking_illustration_url},R.a.createElement(Ol,{skip_action:function(){return v(a)},allow_action:function(){b({analytics:{enabled:!0}}).then((function(){return v(a)}))},allow_text:t>3?q.a.I18n.t("allowAndContinue"):q.a.I18n.t("allowAndFinish"),loading:o})):null,"WelcomeWizardPitchMSSStep"===E?R.a.createElement(Al,{step:a,stepsCount:t,illustrationUrl:window.wizard_MSS_pitch_illustration_url},R.a.createElement(Nr,{next:function(){return v(a)},subscribersCount:window.subscribers_count,mailpoetAccountUrl:window.mailpoet_account_url})):null)};Ml.propTypes={match:Z.a.shape({params:Z.a.shape({step:Z.a.string}).isRequired}).isRequired,history:Z.a.shape({push:Z.a.func.isRequired}).isRequired};var Vl=Ml,Bl=a(115),zl=a.n(Bl),Ul=function(e){function t(e){var a,n,r;return M()(this,t),(r=U()(this,W()(t).call(this,e))).state={importType:null},r.handleOptionChange=F()(a=r.handleOptionChange).call(a,K()(r)),r.submit=F()(n=r.submit).call(n,K()(r)),r}return Y()(t,e),B()(t,[{key:"handleOptionChange",value:function(e){this.setState({importType:e.target.value})}},{key:"submit",value:function(e){return e.preventDefault(),!!this.state.importType&&(this.props.submitForm(this.state.importType),!1)}},{key:"render",value:function(){return R.a.createElement("div",{className:"mailpoet_welcome_wizard_step_content mailpoet_welcome_wizard_centered_column"},R.a.createElement("h1",null,q.a.I18n.t("wooCommerceListImportTitle")),R.a.createElement("p",null,q.a.I18n.t("wooCommerceListImportInfo1")),R.a.createElement("p",null,q.a.I18n.t("wooCommerceListImportInfo2")),R.a.createElement("p",null,R.a.createElement("b",null,q.a.I18n.t("wooCommerceListImportInfo3"))),R.a.createElement("form",{onSubmit:this.submit,className:"mailpoet_wizard_woocommerce_list"},R.a.createElement("label",{htmlFor:"import_type_subscribed"},R.a.createElement("input",{id:"import_type_subscribed",type:"radio",name:"import_type",checked:"subscribed"===this.state.importType,onChange:this.handleOptionChange,value:"subscribed","data-automation-id":"import_as_subscribed"}),zl()(q.a.I18n.t("wooCommerceListImportCheckboxSubscribed"))),R.a.createElement("label",{htmlFor:"import_type_unsubscribed"},R.a.createElement("input",{id:"import_type_unsubscribed",type:"radio",name:"import_type",checked:"unsubscribed"===this.state.importType,onChange:this.handleOptionChange,value:"unsubscribed","data-automation-id":"import_as_unsubscribed"}),zl()(q.a.I18n.t("wooCommerceListImportCheckboxUnsubscribed"))),R.a.createElement("p",null,q.a.I18n.t("wooCommerceListImportInfo4")),R.a.createElement("input",{className:"button button-primary",type:"submit",value:q.a.I18n.t("wooCommerceListImportSubmit"),disabled:!this.state.importType||this.props.loading,"data-automation-id":"submit_woo_commerce_list_import"})))}}]),t}(R.a.Component);Ul.propTypes={submitForm:Z.a.func.isRequired,loading:Z.a.bool.isRequired};var $l=Ul,Wl=function(e){function t(e){var a,n,r,i,s;return M()(this,t),(s=U()(this,W()(t).call(this,e))).state={loading:!1},s.updateSettings=F()(a=s.updateSettings).call(a,K()(s)),s.scheduleImport=F()(n=s.scheduleImport).call(n,K()(s)),s.finishWizard=F()(r=s.finishWizard).call(r,K()(s)),s.submit=F()(i=s.submit).call(i,K()(s)),s}return Y()(t,e),B()(t,[{key:"finishWizard",value:function(){this.setState({loading:!0}),window.location=window.finish_wizard_url}},{key:"updateSettings",value:function(e){return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"settings",action:"set",data:e}).fail(this.handleApiError)}},{key:"scheduleImport",value:function(){var e=this;return q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"importExport",action:"setupWooCommerceInitialImport"}).then((function(){return e.setState({loading:!1})})).fail(this.handleApiError)}},{key:"handleApiError",value:function(e){this.setState({loading:!1}),q.a.Notice.showApiErrorNotice(e,{scroll:!0})}},{key:"submit",value:function(e){this.setState({loading:!0});var t={woocommerce_import_screen_displayed:1,"mailpoet_subscribe_old_woocommerce_customers.enabled":"subscribed"===e?1:0};this.updateSettings(t).then(this.scheduleImport).then(this.finishWizard)}},{key:"render",value:function(){return R.a.createElement("div",{className:"mailpoet_welcome_wizard_steps mailpoet_welcome_wizard_centered_column"},R.a.createElement("div",{className:"mailpoet_welcome_wizard_header"},R.a.createElement("img",{src:window.mailpoet_logo_url,width:"200",height:"87",alt:"MailPoet logo"})),R.a.createElement($l,{loading:this.state.loading,submitForm:this.submit}))}}]),t}(R.a.Component);Wl.propTypes={};var Hl=Wl;function Kl(e){var t=e.submitForm,a=e.loading,n=Object(T.useState)("true"),r=Ne()(n,2),i=r[0],s=r[1];return R.a.createElement("div",{className:" mailpoet_welcome_wizard_step_content mailpoet_welcome_wizard_step_revenue_tracking mailpoet_welcome_wizard_centered_column "},R.a.createElement("p",null,q.a.I18n.t("revenueTrackingInfo1")),R.a.createElement("p",null,q.a.I18n.t("revenueTrackingInfo2")),R.a.createElement("form",{onSubmit:function(e){return e.preventDefault(),void 0!==i&&(t("true"===i),!1)},className:"mailpoet_wizard_woocommerce_list"},R.a.createElement("label",{htmlFor:"tracking_allowed"},R.a.createElement("input",{id:"tracking_allowed",type:"radio",name:"import_type",checked:"true"===i,onChange:function(e){return s(e.target.value)},value:"true"}),q.a.I18n.t("revenueTrackingAllow")),R.a.createElement("label",{htmlFor:"tracking_not_allowed"},R.a.createElement("input",{id:"tracking_not_allowed",type:"radio",name:"import_type",checked:"false"===i,onChange:function(e){return s(e.target.value)},value:"false"}),q.a.I18n.t("revenueTrackingDontAllow")),R.a.createElement("input",{className:"button button-primary",type:"submit",value:q.a.I18n.t("revenueTrackingSubmit"),disabled:a})))}Kl.propTypes={submitForm:Z.a.func.isRequired,loading:Z.a.bool.isRequired};var Gl=Kl;var Yl=function(){var e=Object(T.useState)(!1),t=Ne()(e,2),a=t[0],n=t[1],r=function(e){n(!1),q.a.Notice.showApiErrorNotice(e,{scroll:!0})},i=function(){window.location=window.finish_wizard_url};return R.a.createElement("div",{className:"mailpoet_welcome_wizard_steps mailpoet_welcome_wizard_centered_column"},R.a.createElement("div",{className:"mailpoet_welcome_wizard_header"},R.a.createElement("img",{src:window.mailpoet_logo_url,width:"200",height:"87",alt:"MailPoet logo"})),R.a.createElement(Gl,{loading:a,submitForm:function(e){var t;n(!0),(t={"woocommerce.accept_cookie_revenue_tracking.enabled":e?1:0,"woocommerce.accept_cookie_revenue_tracking.set":1},q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"settings",action:"set",data:t}).fail(r)).then(i)}}))},Jl=document.getElementById("mailpoet_wizard_container");Jl&&_e.a.render(R.a.createElement((function(){var e,t,a="/steps/1";C()(e=window.location.search).call(e,"revenue-tracking-permission")?a="/revenue-tracking-permission":C()(t=window.location.search).call(t,"woocommerce-list-import")&&(a="/import");var n=Object(Ge.b)(window);return R.a.createElement(Ge.a.Provider,{value:n},R.a.createElement(st.a,null,R.a.createElement(en,null),R.a.createElement(ne.Switch,null,R.a.createElement(ne.Route,{path:"/steps/:step",component:Vl}),R.a.createElement(ne.Route,{path:"/import",component:Hl}),R.a.createElement(ne.Route,{path:"/revenue-tracking-permission",component:Yl}),R.a.createElement(ne.Route,{render:function(){return R.a.createElement(ne.Redirect,{to:a})}}))))}),null),Jl);var Ql=a(460),Zl=a.n(Ql);function Xl(e,t){var a=b()(e);if(g.a){var n=g()(e);t&&(n=h()(n).call(n,(function(t){return d()(e,t).enumerable}))),a.push.apply(a,n)}return a}function ec(e){for(var t=1;t<arguments.length;t++){var a,n=null!=arguments[t]?arguments[t]:{};if(t%2)u()(a=Xl(Object(n),!0)).call(a,(function(t){y()(e,t,n[t])}));else if(l.a)s()(e,l()(n));else{var i;u()(i=Xl(Object(n))).call(i,(function(t){r()(e,t,d()(n,t))}))}}return e}var tc=document.getElementById("experimental_features_container");tc&&_e.a.render(R.a.createElement((function(){var e,t=Object(T.useState)(null),a=Ne()(t,2),n=a[0],r=a[1],i=Object(Ge.b)(window),s=i.notices.error;function o(e){var t=e.target.name,a=e.target.checked;q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"featureFlags",action:"set",data:y()({},t,a?1:0)}).done((function(){var e,s=n[t];s.value=a,r(ec({},n,y()({},t,s)));var o=E()(e="Feature '".concat(t,"' was ")).call(e,a?"enabled":"disabled",".");i.notices.success(R.a.createElement("p",null,o))})).fail((function(e){var t;e.errors.length>0&&s(x()(t=e.errors).call(t,(function(e){return R.a.createElement("p",{key:e.message},e.message)})),{scroll:!0})}))}return Object(T.useEffect)((function(){q.a.Ajax.post({api_version:window.mailpoet_api_version,endpoint:"featureFlags",action:"getAll"}).done((function(e){var t,a=Pe()(t=e.data).call(t,(function(e,t){return ec({},e,y()({},t.name,t))}),{});r(a)})).fail((function(e){var t;e.errors.length>0&&s(R.a.createElement(R.a.Fragment,null,x()(t=e.errors).call(t,(function(e){return R.a.createElement("p",null,e.message)}))),{scroll:!0})}))}),[s]),null===n?R.a.createElement("p",null,"Loading experimental features..."):0===Zl()(n).length?R.a.createElement("p",null,"There are no experimental features at the moment."):R.a.createElement(Ge.a.Provider,{value:i},R.a.createElement(R.a.Fragment,null,R.a.createElement(en,null),x()(e=Zl()(n)).call(e,(function(e){var t="experimental-feature-".concat(e.name);return R.a.createElement("div",{key:e.name},R.a.createElement("label",{htmlFor:t},R.a.createElement("input",{id:t,type:"checkbox",name:e.name,defaultChecked:e.value,onChange:o})," ",e.name))}))))}),null),tc);var ac=27;function nc(e){var t=e.shouldCloseOnClickOutside,a=e.onRequestClose,n=e.shouldCloseOnEsc,r=e.overlayClassName,i=e.contentLabel,s=e.aria,o=s.describedby,l=s.labelledby,c=e.children,u=e.className,p=e.role,d=e.fullScreen,m=Object(T.useRef)(null);function h(e){a&&a(e)}return R.a.createElement("div",{className:lt()("mailpoet-modal-screen-overlay",r),onKeyDown:function(e){e.keyCode===ac&&function(e){n&&(e.stopPropagation(),h(e))}(e)},onClick:function(e){t&&m.current&&!m.current.contains(e.target)&&h(e)},role:"button",tabIndex:"0"},R.a.createElement("div",{ref:m,className:lt()("mailpoet-modal-frame",{"mailpoet-modal-full-screen":d},u),role:p,"aria-label":i,"aria-labelledby":i?null:l,"aria-describedby":o,tabIndex:"-1"},c))}nc.propTypes={onRequestClose:Z.a.func,shouldCloseOnEsc:Z.a.bool,fullScreen:Z.a.bool,shouldCloseOnClickOutside:Z.a.bool,role:Z.a.string,className:Z.a.string,contentLabel:Z.a.string,overlayClassName:Z.a.string,children:Z.a.node.isRequired,aria:Z.a.shape({describedby:Z.a.string,labelledby:Z.a.string})},nc.defaultProps={onRequestClose:function(){},role:"dialog",shouldCloseOnEsc:!0,fullScreen:!1,shouldCloseOnClickOutside:!0,className:"",aria:{describedby:"",labelledby:""},contentLabel:null,overlayClassName:""};var rc=nc,ic=R.a.createElement("svg",{viewBox:"0 0 48 48"},R.a.createElement("path",{d:"M42 6L6 42M6 6L42 42",strokeWidth:"12",strokeLinecap:"round"})),sc=function(e){var t=e.title,a=e.onClose,n=e.headingId,r=e.isDismissible;return R.a.createElement("div",{className:"mailpoet-modal-header"},R.a.createElement("div",{className:"mailpoet-modal-header-heading-container"},t&&R.a.createElement("h1",{id:n,className:"mailpoet-modal-header-heading"},t)),r&&R.a.createElement("button",{type:"button",onClick:a,className:"mailpoet-modal-close"},ic))};sc.propTypes={title:Z.a.string,headingId:Z.a.string,onClose:Z.a.func,isDismissible:Z.a.bool},sc.defaultProps={title:null,headingId:"heading-id",onClose:function(){},isDismissible:!0};var oc=sc;function lc(e){var t=e.onRequestClose,a=e.title,n=e.displayTitle,r=e.children,i=e.aria,s=e.isDismissible,o=e.shouldCloseOnEsc,l=e.shouldCloseOnClickOutside,c=e.role,u=e.contentClassName,p=e.contentLabel,d=e.overlayClassName,m=e.fullScreen,h=i.labelledby||"mailpoet-modal-header";return Object(be.createPortal)(R.a.createElement(rc,{onRequestClose:t,aria:{labelledby:a?h:null,describedby:i.describedby},shouldCloseOnEsc:o,shouldCloseOnClickOutside:l,role:c,className:u,contentLabel:p,overlayClassName:d,fullScreen:m},R.a.createElement("div",{className:"mailpoet-modal-content",role:"document"},n&&R.a.createElement(oc,{headingId:h,isDismissible:s,onClose:t,title:a}),r)),document.getElementById("mailpoet_modal"))}lc.propTypes={children:Z.a.node,aria:Z.a.shape({labelledby:Z.a.string,describedby:Z.a.string}),isDismissible:Z.a.bool,contentClassName:Z.a.string,contentLabel:Z.a.string,overlayClassName:Z.a.string,title:Z.a.string,onRequestClose:Z.a.func,displayTitle:Z.a.bool,fullScreen:Z.a.bool,focusOnMount:Z.a.bool,shouldCloseOnEsc:Z.a.bool,shouldCloseOnClickOutside:Z.a.bool,role:Z.a.string},lc.defaultProps={bodyOpenClassName:"modal-open",onRequestClose:function(){},role:"dialog",title:null,aria:{},focusOnMount:!0,shouldCloseOnEsc:!0,shouldCloseOnClickOutside:!0,isDismissible:!0,displayTitle:!0,fullScreen:!1};var cc=lc,uc=window.mailpoet_api_version,pc=function(){var e=Wt()(Ut.a.mark((function e(t){return Ut.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",q.a.Ajax.post({api_version:uc,endpoint:"settings",action:"setAuthorizedFromAddress",data:{address:t}}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),dc=function(e){return e?"unauthorized"===e.error?q.a.I18n.t("setFromAddressEmailNotAuthorized").replace(/\[link\](.*?)\[\/link\]/g,'<a href="https://account.mailpoet.com/authorization" target="_blank" rel="noopener noreferrer">$1</a>'):e.message||q.a.I18n.t("setFromAddressEmailUnknownError"):q.a.I18n.t("setFromAddressEmailUnknownError")},mc=function(){var e=document.querySelector('[data-notice="unauthorized-email-addresses-notice"]');e&&e.remove();var t=document.querySelector('[data-notice="unauthorized-email-in-newsletters-addresses-notice"]');t&&t.remove();var a=document.querySelector('[data-id="mailpoet_authorization_error"]');a&&a.remove()},hc=function(e){var t=e.onRequestClose,a=e.setAuthorizedAddress,n=Object(T.useState)(null),r=Ne()(n,2),i=r[0],s=r[1],o=R.a.useContext(Ge.a).notices;return R.a.createElement(cc,{title:q.a.I18n.t("setFromAddressModalTitle"),onRequestClose:t,contentClassName:"set-from-address-modal"},R.a.createElement("p",null,St()(q.a.I18n.t("setFromAddressModalDescription"),/\[link\](.*?)\[\/link\]/g,(function(e){return R.a.createElement("a",{key:"setFromAddressModalDescriptionLink",href:"https://account.mailpoet.com/authorization",target:"_blank",rel:"noopener noreferrer"},e)}))),R.a.createElement("input",{id:"mailpoet-set-from-address-modal-input",type:"text",placeholder:"from@mydomain.com","data-parsley-required":!0,"data-parsley-type":"email",onChange:function(e){var t;s(qa()(t=e.target.value).call(t)||null),ve()("#mailpoet-set-from-address-modal-input").parsley().removeError("saveError")}}),R.a.createElement("input",{className:"button button-primary",type:"submit",value:q.a.I18n.t("setFromAddressModalSave"),onClick:Wt()(Ut.a.mark((function e(){var n,r,s;return Ut.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=ve()("#mailpoet-set-from-address-modal-input").parsley()).validate(),n.isValid()){e.next=4;break}return e.abrupt("return");case 4:if(i){e.next=6;break}return e.abrupt("return");case 6:return e.prev=6,e.next=9,pc(i);case 9:a(i),t(),mc(),o.success(R.a.createElement("p",null,St()(q.a.I18n.t("setFromAddressEmailSuccess"),/\[link\](.*?)\[\/link\]/g,(function(e){return R.a.createElement("a",{key:"setFromAddressModalBasicsTabLink",href:"?page=mailpoet-settings#basics",rel:"noopener noreferrer"},e)}))),{timeout:!1}),e.next=20;break;case 15:e.prev=15,e.t0=e.catch(6),r=e.t0.errors&&e.t0.errors[0]?e.t0.errors[0]:null,s=dc(r),n.addError("saveError",{message:s});case 20:case"end":return e.stop()}}),e,null,[[6,15]])})))}))};hc.propTypes={onRequestClose:Z.a.func.isRequired,setAuthorizedAddress:Z.a.func},hc.defaultProps={setAuthorizedAddress:function(){}};var fc=hc,gc=function(e){var t=e.onRequestClose,a=Object(T.useState)(!1),n=Ne()(a,2),r=n[0],i=n[1];return ve()((function(e){e(document).on("click",".notice .mailpoet-js-button-fix-this",(function(){i(!0)}))})),R.a.createElement(Ge.a.Provider,{value:Object(Ge.b)(window)},R.a.createElement(en,null),r&&R.a.createElement(fc,{onRequestClose:function(){i(!1),t()}}))};gc.propTypes={onRequestClose:Z.a.func},gc.defaultProps={onRequestClose:function(){}};var vc=document.getElementById("mailpoet_set_from_address_modal");vc&&_e.a.render(R.a.createElement(gc,{onRequestClose:function(){var e;C()(e=window.location.href).call(e,"?page=mailpoet-settings")&&window.location.reload()}}),vc)}},[[648,0,1]]]);