(window.webpackJsonp=window.webpackJsonp||[]).push([[74],{1437:function(t,e,r){"use strict";r.r(e);var n=r(0),o=r(146),a=r(9),i=r.n(a),c=r(3),u=r(1),l=r(5),s=r(337),f=r(47),p=r(1063),h=r(2);function y(t){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function m(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 b(t){for(var e=1;e=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:N(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},e}function g(t,e,r,n,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function w(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function i(t){g(a,n,o,i,c,"next",t)}function c(t){g(a,n,o,i,c,"throw",t)}i(void 0)}))}}function O(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,l=!1;try{if(a=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return c}}(t,e)||j(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(t,e){if(t){if("string"==typeof t)return _(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_(t,e):void 0}}function _(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r0))return!1;var e,r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=j(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return i=t.done,t},e:function(t){c=!0,a=t},f:function(){try{i||null==r.return||r.return()}finally{if(c)throw a}}}}($);try{for(r.s();!(e=r.n()).done;){var n=e.value;if(n&&n.template_id&&parseInt(n.template_id)===parseInt(t))return n}}catch(t){r.e(t)}finally{r.f()}return!1},Z=function(t){if(!t)return"-";var e=X(parseInt(t));return 1===a&&e.subject?e.subject:"-"},tt=function(t,e){!function(t){var e=X(parseInt(t));if(e){var r="",o=!1;3==a&&e.hasOwnProperty("whatsAppImage")&&e.whatsAppImage&&e.hasOwnProperty("whatsAppImageSetting")&&e.whatsAppImageSetting.hasOwnProperty("position")&&!Object(h.isEmpty)(e.whatsAppImageSetting.position)&&e.whatsAppImageSetting.hasOwnProperty("imageURL")&&!Object(h.isEmpty)(e.whatsAppImageSetting.imageURL)&&(r="before"===e.whatsAppImageSetting.position?Object(n.createElement)(n.Fragment,null,Object(n.createElement)("img",{src:e.whatsAppImageSetting.imageURL,width:50,height:50}),Object(n.createElement)("div",{dangerouslySetInnerHTML:{__html:e.body}})):Object(n.createElement)(n.Fragment,null,Object(n.createElement)("div",{dangerouslySetInnerHTML:{__html:e.body}}),Object(n.createElement)("img",{src:e.whatsAppImageSetting.imageURL,width:50,height:50})),o=!1),o?r=Object(n.createElement)("div",{dangerouslySetInnerHTML:{__html:"editor"===e.type?e.editor.body:e.body}}):K({content:"editor"===e.type?e.editor.body:e.body,type:e.type}),F(b(b({},e),{},{body:r}))}else I(Object(u.__)("Content attached to this template not found","wp-marketing-automations"));k(!0)}(e),t.preventDefault()},et=Object(f.a)(Object(c.zb)()).formatAmount,rt=function(t){return parseFloat(t.revenue)>0?Object(n.createElement)(n.Fragment,null,parseInt(t.conversions)>0&&parseInt(t.conversions)," ",Object(n.createElement)("span",{className:"bwf-tags bwf-tag-green"},et(parseFloat(t.revenue)))):" - "},nt=function(t){var e=parseFloat(t.open_rate)?parseFloat(t.open_rate).toFixed(2):"0.00";return(parseInt(t.open_count)?parseInt(t.open_count):0)>0?"".concat(e,"%"):"-"},ot=function(t){var e=parseFloat(t.click_rate)?parseFloat(t.click_rate).toFixed(2):"0.00";return(parseInt(t.click_count)?parseInt(t.click_count):0)>0?"".concat(e,"%"):"-"},at=Array.isArray(_)&&_.length>0?_.map((function(t){var e=[];return 1===a&&e.push({display:Z(t.tid),value:Z(t.tid)}),e.push({display:t.sent?t.sent:"-",value:t.sent}),1===a&&e.push({display:nt(t),value:t.open_rate}),e.push({display:ot(t),value:t.click_rate}),Object(c.qc)()&&e.push({display:parseInt(t.conversions)>0?rt(t):"-",value:""}),e.push({display:Object(n.createElement)(l.Button,{isSecondary:!0,className:"bwf-btn-small is-light bwf-btn-gray",onClick:function(e){return tt(e,parseInt(t.tid))}},Object(u.__)("View","wp-marketing-automations")),value:t.tid}),e})):[];return Object(n.createElement)("div",{className:"bwf-table-with-border"},Object(n.createElement)(o.a,{isLoading:m,title:Object(u.__)("Details","wp-marketing-automations"),rows:at,headers:(W=[],1===a&&W.push({key:"subject",label:Object(u.__)("Subject","wp-marketing-automations"),isLeftAligned:!0}),W.push({key:"sent",label:Object(u.__)("Sent","wp-marketing-automations"),isLeftAligned:!1,cellClassName:"bwf-col-center"}),1===a&&W.push({key:"open",label:Object(u.__)("Open Rate","wp-marketing-automations"),isLeftAligned:!1,cellClassName:"bwf-col-center"}),W.push({key:"click",label:Object(u.__)("Click Rate","wp-marketing-automations"),isLeftAligned:!1,cellClassName:"bwf-col-center"}),Object(c.qc)()&&W.push({key:"conversion",label:Object(u.__)("Conversions","wp-marketing-automations"),isLeftAligned:!1,cellClassName:"bwf-col-center"}),W.push({key:"show-template",label:"",isLeftAligned:!0,cellClassName:"bwf-col-center"}),W),query:{page:1},rowsPerPage:3,totalRows:3,showMenu:!1,emptyMessage:Object(u.__)("No stats available","wp-marketing-automations")}),Object(n.createElement)(s.a,{isOpen:L,isLoading:C,onRequestClose:function(){return k(!1)},error:A,subject:q,body:D,type:J,sourceType:2,mode:a,utm:z,preHeader:B}))}}}]);