(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{1466:function(t,e,r){"use strict";r.r(e);var n=r(0),a=r(1),o=r(2),c=r(9),i=r.n(c),l=r(1089),u=r(70),s=r(1106),f=r(354),b=r(11),m=r(3),p=r(1088),v=r(8),y=r(40);function h(t){return(h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d(){d=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},c=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,c=Object.create(o.prototype),i=new A(n||[]);return a(c,"_invoke",{value:S(t,r,i)}),c}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var b="suspendedStart",m="executing",p="completed",v={};function y(){}function O(){}function w(){}var j={};u(j,c,(function(){return this}));var g=Object.getPrototypeOf,E=g&&g(g(T([])));E&&E!==r&&n.call(E,c)&&(j=E);var _=w.prototype=y.prototype=Object.create(j);function k(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function N(t,e){function r(a,o,c,i){var l=f(t[a],t,o);if("throw"!==l.type){var u=l.arg,s=u.value;return s&&"object"==h(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,c,i)}),(function(t){r("throw",t,c,i)})):e.resolve(s).then((function(t){u.value=t,c(u)}),(function(t){return r("throw",t,c,i)}))}i(l.arg)}var o;a(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,a){r(t,n,e,a)}))}return o=o?o.then(a,a):a()}})}function S(e,r,n){var a=b;return function(o,c){if(a===m)throw Error("Generator is already running");if(a===p){if("throw"===o)throw c;return{value:t,done:!0}}for(n.method=o,n.arg=c;;){var i=n.delegate;if(i){var l=P(i,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===b)throw a=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=m;var u=f(e,r,n);if("normal"===u.type){if(a=n.done?p:"suspendedYield",u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(a=p,n.method="throw",n.arg=u.arg)}}}function P(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=f(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var c=o.arg;return c?c.done?(r[e.resultName]=c.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):c:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function r(){for(;++a=0;--o){var c=this.tryEntries[o],i=c.completion;if("root"===c.tryLoc)return a("end");if(c.tryLoc<=this.prev){var l=n.call(c,"catchLoc"),u=n.call(c,"finallyLoc");if(l&&u){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;L(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function O(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function w(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=Array(e);rt.length)&&(e=t.length);for(var r=0,n=Array(e);r1)})),Object(n.createElement)("div",null)),!Object(i.isEmpty)(e)&&Object(n.createElement)("div",{className:m?"bwf-custom-field-wrapper":""},m&&Object(n.createElement)("div",{className:"bwf-custom-fields-row bwf-display-flex",style:{justifyContent:"flex-start"}},Object(n.createElement)("b",{className:"bwf-w-210"},Object(a.__)("Field","wp-marketing-automations")),Object(n.createElement)("div",{className:"bwf-w-30"}),Object(n.createElement)("b",null,Object(a.__)("Value","wp-marketing-automations"))),Object(n.createElement)(s.b,{selectorValue:b,escapeArrowIcon:!0,data:e&&r.hasOwnProperty(e)?r[e]:{},setActionSelectorValue:function(t){var r=p({},l);r[e]=t,u(r)}}),!m&&Object(n.createElement)("div",{className:"bwf_clear_10"}),Object(n.createElement)("div",{className:"bwf-display-flex bwf-mt-10",style:{justifyContent:"flex-start"}},"new"!=e&&Object(n.createElement)(o.Button,{isPrimary:!0,onClick:function(){h("")},className:"bwf-mr-10",disabled:Object(i.isEmpty)(b)&&!Object(i.isEmpty)(r[e])},Object(a.__)("Save","wp-marketing-automations")),Object(n.createElement)(o.Button,{isSecondary:!0,onClick:function(){if("new"==e||Object(i.isEmpty)(b)){var t=p({},l);delete t[e],u(t)}h("")}},Object(a.__)("Cancel","wp-marketing-automations")))))},O=function(t){var e=t.actions,r=t.actionSchema,c=t.value,l=void 0===c?{}:c,u=t.group,s=void 0===u?{}:u,f=t.setActionValue,b=y(Object(n.useState)(l),2),m=b[0],v=b[1],h=y(Object(n.useState)(""),2),O=h[0],w=h[1];Object(n.useEffect)((function(){var t=Object(i.cloneDeep)(m);t.hasOwnProperty("new")&&delete t.new,Object(i.isEmpty)(t)&&w("new")}),[]),Object(n.useEffect)((function(){Object(i.isEmpty)(m)?(v({new:{}}),w("new")):f(m)}),[m]);var j;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(n.Fragment,null,Object.entries(m).map((function(t,a){var o=y(t,2),c=o[0],i=o[1],l=!1;return"new"!==c&&r.hasOwnProperty(c)&&r[c].hasOwnProperty("type")&&"bwfupdatefield"===r[c].type&&(l=!0),Object(n.createElement)(d,{index:c,actionInputType:r,actionData:m,setActionData:v,actionValue:i,customField:l,group:s,actions:e,isOverview:O!==c,setEdit:w,key:a})}))),(j=!1,e.map((function(t){m.hasOwnProperty(t.value)||(j=!0)})),j&&Object(i.isEmpty)(O)&&Object(n.createElement)("div",{onClick:function(){var t=p(p({},m),{},{new:{}});v(t),w("new")}},Object(n.createElement)("div",{className:"bwf_clear_20"}),Object(n.createElement)(o.Button,{className:"bwf-cursor-pointer",isPrimary:!0},Object(a.__)("Add","wp-marketing-automations")),Object(n.createElement)("div",{className:"bwf_clear_20"}))))},w=r(9),j=r.n(w),g=r(3),E=r(12),_=r(70),k=r(26);function N(t){return(N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function S(){S=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},c=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,c=Object.create(o.prototype),i=new A(n||[]);return a(c,"_invoke",{value:k(t,r,i)}),c}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var b="suspendedStart",m="executing",p="completed",v={};function y(){}function h(){}function d(){}var O={};u(O,c,(function(){return this}));var w=Object.getPrototypeOf,j=w&&w(w(T([])));j&&j!==r&&n.call(j,c)&&(O=j);var g=d.prototype=y.prototype=Object.create(O);function E(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(a,o,c,i){var l=f(t[a],t,o);if("throw"!==l.type){var u=l.arg,s=u.value;return s&&"object"==N(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,c,i)}),(function(t){r("throw",t,c,i)})):e.resolve(s).then((function(t){u.value=t,c(u)}),(function(t){return r("throw",t,c,i)}))}i(l.arg)}var o;a(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,a){r(t,n,e,a)}))}return o=o?o.then(a,a):a()}})}function k(e,r,n){var a=b;return function(o,c){if(a===m)throw Error("Generator is already running");if(a===p){if("throw"===o)throw c;return{value:t,done:!0}}for(n.method=o,n.arg=c;;){var i=n.delegate;if(i){var l=P(i,n);if(l){if(l===v)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===b)throw a=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=m;var u=f(e,r,n);if("normal"===u.type){if(a=n.done?p:"suspendedYield",u.arg===v)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(a=p,n.method="throw",n.arg=u.arg)}}}function P(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var o=f(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,v;var c=o.arg;return c?c.done?(r[e.resultName]=c.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):c:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function L(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function r(){for(;++a=0;--o){var c=this.tryEntries[o],i=c.completion;if("root"===c.tryLoc)return a("end");if(c.tryLoc<=this.prev){var l=n.call(c,"catchLoc"),u=n.call(c,"finallyLoc");if(l&&u){if(this.prev=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),L(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;L(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:T(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function P(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function x(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=Array(e);r