- WordPress core y plugins - Tema Twenty Twenty-Four configurado - Plugin allow-unfiltered-html.php simplificado - .gitignore configurado para excluir wp-config.php y uploads 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 line
29 KiB
JavaScript
Executable File
1 line
29 KiB
JavaScript
Executable File
(window.webpackJsonp=window.webpackJsonp||[]).push([[69],{1150:function(t,e,r){"use strict";var n=r(0),a=r(55),o=r(9),i=r.n(o),c=r(3),l=r(1);function u(t){return(u="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:{},i=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(t){f=function(t,e,r){return t[e]=r}}function h(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,i=Object.create(o.prototype),c=new N(n||[]);return a(i,"_invoke",{value:L(t,r,c)}),i}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=h;var m="suspendedStart",b="executing",y="completed",d={};function v(){}function g(){}function w(){}var O={};f(O,i,(function(){return this}));var j=Object.getPrototypeOf,_=j&&j(j(P([])));_&&_!==r&&n.call(_,i)&&(O=_);var E=w.prototype=v.prototype=Object.create(O);function k(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(a,o,i,c){var l=p(t[a],t,o);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==u(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(f).then((function(t){s.value=t,i(s)}),(function(t){return r("throw",t,i,c)}))}c(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 L(e,r,n){var a=m;return function(o,i){if(a===b)throw Error("Generator is already running");if(a===y){if("throw"===o)throw i;return{value:t,done:!0}}for(n.method=o,n.arg=i;;){var c=n.delegate;if(c){var l=S(c,n);if(l){if(l===d)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===m)throw a=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=b;var u=p(e,r,n);if("normal"===u.type){if(a=n.done?y:"suspendedYield",u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(a=y,n.method="throw",n.arg=u.arg)}}}function S(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,S(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var o=p(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,d;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function A(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 C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(A,this),this.reset(!0)}function P(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(u(e)+" is not iterable")}return g.prototype=w,a(E,"constructor",{value:w,configurable:!0}),a(w,"constructor",{value:g,configurable:!0}),g.displayName=f(w,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===g||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,f(t,l,"GeneratorFunction")),t.prototype=Object.create(E),t},e.awrap=function(t){return{__await:t}},k(x.prototype),f(x.prototype,c,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new x(h(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},k(E),f(E,l,"Generator"),f(E,i,(function(){return this})),f(E,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=P,N.prototype={constructor:N,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(C),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return c.type="throw",c.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(l&&u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var a=n.arg;C(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:P(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),d}},e}function f(t,e,r,n,a,o,i){try{var c=t[o](i),l=c.value}catch(t){return void r(t)}c.done?e(l):Promise.resolve(l).then(n,a)}function h(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,a,o,i,c=[],l=!0,u=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==e);l=!0);}catch(t){u=!0,a=t}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw a}}return c}}(t,e)||function(t,e){if(t){if("string"==typeof t)return p(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)?p(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}e.a=function(t){var e=Object(n.useContext)(c.h),r=h(Object(n.useState)(""),2),o=r[0],u=r[1],p=t.isOpen,m=t.cartId,b=t.onRequestClose,y=function(){var t,r=(t=s().mark((function t(){return s().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,i()({path:Object(c.A)("/carts"),method:"DELETE",data:{abandoned_ids:[m]}}).then((function(t){e(t.message)}));case 3:t.sent,d(),t.next=11;break;case 7:t.prev=7,t.t0=t.catch(0),u(t.t0&&t.t0.message?t.t0.message:Object(l.__)("Unknown error occurred","wp-marketing-automations")),console.log(o);case 11:Object(c.Lb)(e,3e3);case 12:case"end":return t.stop()}}),t,null,[[0,7]])})),function(){var e=this,r=arguments;return new Promise((function(n,a){var o=t.apply(e,r);function i(t){f(o,n,a,i,c,"next",t)}function c(t){f(o,n,a,i,c,"throw",t)}i(void 0)}))});return function(){return r.apply(this,arguments)}}(),d=function(){b(!o),u("")};return Object(n.createElement)(a.a,{modalTitle:Object(l.__)("Delete Cart","wp-marketing-automations"),deleteDescriptionText:Object(l.__)("You are about to delete cart. This action cannot be undone. Cancel to stop, Delete to proceed.","wp-marketing-automations"),confirmButtonText:Object(l.__)("Delete","wp-marketing-automations"),cancelButtonText:Object(l.__)("Cancel","wp-marketing-automations"),onConfirm:y,errorMessage:o,onRequestClose:d,isOpen:p,isDelete:!0})}},1463:function(t,e,r){"use strict";r.r(e);var n=r(0),a=r(3),o=r(1105),i=r(11),c=r(9),l=r.n(c),u=r(1),s=r(61),f=r(62),h=r(19),p=r(146),m=r(1115),b=r(149),y=r(47),d=r(1149),v=r(1150),g=r(335),w=r(33),O=r(6),j=r.n(O),_=r(2),E=r(70),k=r(12),x=r(8),L=r(334),S=r(148),A=r(1151),C=r(44),N=r(195),P=r(26),T=r(1113),I=r(40);function F(t){return(F="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 G(){return(G=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(null,arguments)}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:{},i=o.iterator||"@@iterator",c=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),c=new A(n||[]);return a(i,"_invoke",{value:k(t,r,c)}),i}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="executing",m="completed",b={};function y(){}function d(){}function v(){}var g={};u(g,i,(function(){return this}));var w=Object.getPrototypeOf,O=w&&w(w(C([])));O&&O!==r&&n.call(O,i)&&(g=O);var j=v.prototype=y.prototype=Object.create(g);function _(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(a,o,i,c){var l=f(t[a],t,o);if("throw"!==l.type){var u=l.arg,s=u.value;return s&&"object"==F(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):e.resolve(s).then((function(t){u.value=t,i(u)}),(function(t){return r("throw",t,i,c)}))}c(l.arg)}var o;a(this,"_invoke",{value:function(t,n){function a(){return new e((function(e,a){r(t,n,e,a)}))}return o=o?o.then(a,a):a()}})}function k(e,r,n){var a=h;return function(o,i){if(a===p)throw Error("Generator is already running");if(a===m){if("throw"===o)throw i;return{value:t,done:!0}}for(n.method=o,n.arg=i;;){var c=n.delegate;if(c){var l=x(c,n);if(l){if(l===b)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(a===h)throw a=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);a=p;var u=f(e,r,n);if("normal"===u.type){if(a=n.done?m:"suspendedYield",u.arg===b)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(a=m,n.method="throw",n.arg=u.arg)}}}function x(e,r){var n=r.method,a=e.iterator[n];if(a===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,x(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var o=f(a,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,b;var i=o.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,b):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function C(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,o=function r(){for(;++a<e.length;)if(n.call(e,a))return r.value=e[a],r.done=!1,r;return r.value=t,r.done=!0,r};return o.next=o}}throw new TypeError(F(e)+" is not iterable")}return d.prototype=v,a(j,"constructor",{value:v,configurable:!0}),a(v,"constructor",{value:d,configurable:!0}),d.displayName=u(v,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,u(t,l,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},_(E.prototype),u(E.prototype,c,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,a,o){void 0===o&&(o=Promise);var i=new E(s(t,r,n,a),o);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},_(j),u(j,l,"Generator"),u(j,i,(function(){return this})),u(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=C,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(S),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function a(n,a){return c.type="throw",c.arg=e,r.next=n,a&&(r.method="next",r.arg=t),!!a}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return a("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(l&&u){if(this.prev<i.catchLoc)return a(i.catchLoc,!0);if(this.prev<i.finallyLoc)return a(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return a(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return a(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var a=this.tryEntries[r];if(a.tryLoc<=this.prev&&n.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,b):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(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 a=n.arg;S(r)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},e}function R(t,e,r,n,a,o,i){try{var c=t[o](i),l=c.value}catch(t){return void r(t)}c.done?e(l):Promise.resolve(l).then(n,a)}function q(t){return function(){var e=this,r=arguments;return new Promise((function(n,a){var o=t.apply(e,r);function i(t){R(o,n,a,i,c,"next",t)}function c(t){R(o,n,a,i,c,"throw",t)}i(void 0)}))}}function M(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,a,o,i,c=[],l=!0,u=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(c.push(n.value),c.length!==e);l=!0);}catch(t){u=!0,a=t}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw a}}return c}}(t,e)||U(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function U(t,e){if(t){if("string"==typeof t)return B(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)?B(t,e):void 0}}function B(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}e.default=function(){var t=Object(n.useContext)(a.h),e=Object(k.i)(),r=M(Object(n.useState)(25),2),c=r[0],O=r[1],F=M(Object(n.useState)(0),2),R=F[0],B=F[1],Y=M(Object(n.useState)(0),2),Q=Y[0],z=Y[1],J=M(Object(n.useState)([]),2),$=J[0],H=J[1],V=M(Object(n.useState)([]),2),K=V[0],W=V[1],X=M(Object(n.useState)(!1),2),Z=X[0],tt=X[1],et=M(Object(n.useState)(),2),rt=et[0],nt=et[1],at=M(Object(n.useState)(!1),2),ot=at[0],it=at[1],ct=M(Object(n.useState)({status:!1}),2),lt=ct[0],ut=ct[1],st=M(Object(n.useState)(!1),2),ft=st[0],ht=st[1],pt=M(Object(n.useState)(0),2),mt=pt[0],bt=pt[1],yt=Object(a.Fb)();Object(m.a)("lost",K);var dt=e.s,vt=void 0===dt?"":dt,gt=Object(n.useRef)(new AbortController),wt=function(){var t=q(D().mark((function t(){var e,r,n,o,i,s,f,h=arguments;return D().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return h.length>0&&void 0!==h[0]?h[0]:{},tt(!0),t.prev=2,t.next=5,l()({method:"GET",path:Object(a.A)("/carts/lost?offset=".concat(R,"&limit=").concat(c,"&search=").concat(vt)),signal:gt.current.signal});case 5:if((e=t.sent)&&e.result&&Array.isArray(e.result)){t.next=9;break}return nt(Object(u.__)("Blank response returned","wp-marketing-automations")),t.abrupt("return");case 9:r=e.total_count,n=void 0===r?0:r,o=e.result,i=void 0===o?[]:o,s=e.limit,f=e.offset,z(parseInt(n)),H(i),s&&O(parseInt(s)),f&&B(parseInt(f)),e.hasOwnProperty("count_data")&&W(e.count_data),tt(!1),t.next=21;break;case 18:t.prev=18,t.t0=t.catch(2),"AbortError"===t.t0.name?console.log(t.t0.message):(nt(t.t0&&t.t0.message?t.t0.message:Object(u.__)("Unknown Error Occurred","wp-marketing-automations")),tt(!1));case 21:case"end":return t.stop()}}),t,null,[[2,18]])})));return function(){return t.apply(this,arguments)}}(),Ot=M(Object(n.useState)([]),2),jt=Ot[0],_t=Ot[1],Et=M(Object(n.useState)(!1),2),kt=Et[0],xt=Et[1],Lt=M(Object(n.useState)(""),2),St=Lt[0],At=Lt[1],Ct=function(){Dt&&Dt(),_t([])},Nt=Object(n.useCallback)((function(t,e){_t(e),At(t),xt(!0)}),[]);Object(n.useEffect)((function(){Object(a.m)(Object(u.__)("Lost Carts","wp-marketing-automations")),Object(a.Qb)()&&wt()}),[R,c,vt]),Object(n.useEffect)((function(){return Ct(),function(){gt.current.abort()}}),[]),Object(n.useLayoutEffect)((function(){H([]),tt(!0)}),[]);var Pt=Object(n.useMemo)((function(){var t={};if(Array.isArray($)){var e,r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=U(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,a=function(){};return{s:a,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:a}}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 o,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,o=t},f:function(){try{i||null==r.return||r.return()}finally{if(c)throw o}}}}($);try{for(r.s();!(e=r.n()).done;){var n=e.value;t[n.id]=n}}catch(t){r.e(t)}finally{r.f()}}return t}),[$]),Tt=Object(S.b)(Pt),It=Tt.singleSelectProps,Ft=Tt.selectAllProps,Gt=Tt.floatingBarProps,Dt=Tt.resetSelection,Rt=Tt.selected,qt=void 0===Rt?{}:Rt,Mt=Object.keys(qt).filter((function(t){return qt[t]})).length,Ut=[{key:"select",label:Object(n.createElement)(C.a,G({type:"checkbox",checked:!1,onChange:function(){}},Ft)),isLeftAligned:!0,required:!0,cellClassName:"bwf-col-action bwf-w-30 bwf-table-col-sticky bwf-sticky-left"},{key:"action",label:"",isLeftAligned:!0,required:!0,cellClassName:"bwf-col-action bwf-w-30 bwf-table-col-sticky bwf-sticky-left"},{key:"name",label:Object(u.__)("Contact","wp-marketing-automations"),isLeftAligned:!0,cellClassName:"bwf-w-210 bwf-table-col-sticky bwf-sticky-left"},{key:"contact",label:Object(u.__)("Details","wp-marketing-automations"),isLeftAligned:!0},{key:"created_date",label:Object(u.__)("Created On","wp-marketing-automations"),isLeftAligned:!0},{key:"items",label:Object(u.__)("Items","wp-marketing-automations"),isLeftAligned:!0,cellClassName:"bwf-max-w-360"},{key:"total",label:Object(u.__)("Total","wp-marketing-automations"),isLeftAligned:!0,cellClassName:"bwf-w-100"},{key:"show",label:Object(u.__)("Action","wp-marketing-automations"),isLeftAligned:!0,cellClassName:"bwf-w-100 bwf-table-col-sticky bwf-sticky-right"}],Bt=function(t){t!==c&&(B(0),O(t))},Yt=function(t){return Object(n.createElement)(s.a,{label:Object(u.__)("Quick Actions","wp-marketing-automations"),menuPosition:"bottom right",renderContent:function(r){var a=r.onToggle;return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(f.a,{isClickable:!0,onInvoke:function(){Object(k.l)({path:"/carts/lost/".concat(t.id,"/tasks")},"/",e),a()}},Object(n.createElement)(h.a,{justify:"flex-start"},Object(n.createElement)(h.c,null,Object(u.__)("View Automations","wp-marketing-automations")))),Object(n.createElement)(f.a,{isClickable:!0,onInvoke:function(){bt(t.id),ht(!0),a()}},Object(n.createElement)(h.a,{justify:"flex-start"},Object(n.createElement)(h.c,null,Object(u.__)("Delete","wp-marketing-automations")))))}})},Qt=function(t){return t.total?Object(n.createElement)("span",{className:"bwf-tags bwf-tag-red"},t.currency?Object(y.a)(t.currency).formatAmount(t.total):t.total):"-"},zt=function(t){return Object(n.createElement)("div",{className:"bwf-c-contact-details-cell"},t.hasOwnProperty("email")&&t.email&&Object(n.createElement)(h.a,{justify:"justify",align:"top"},Object(n.createElement)(h.c,null,t.email)),t.phone&&Object(n.createElement)(h.a,{justify:"justify",align:"top"},Object(n.createElement)(h.c,null,t.phone)),!t.phone&&!t.email&&Object(n.createElement)("span",null,"-"))},Jt=function(t){var r=Object(n.createElement)(g.a,{contact:{f_name:t.f_name?t.f_name:"",l_name:t.l_name?t.l_name:"",email:t.email},dateText:t.date&&t.diffstring?Object(u.__)("Last Active:","wp-marketing-automations"):"",lowerText:t.date&&t.diffstring?Object(n.createElement)(n.Fragment,null,Object(n.createElement)("span",{title:Object(a.ib)(t.date,!0)},t.diffstring)):""});return t.contact_id?Object(n.createElement)(w.a,{href:"admin.php?page=autonami&path=/contact/"+t.contact_id+"&return_to=".concat(e.path),type:"bwf-crm",className:"bwf-a-no-underline"},r):r},$t=Array.isArray($)?$.map((function(t){return[{display:It.hasOwnProperty(t.id)?Object(n.createElement)(C.a,G({type:"checkbox",checked:!1,onChange:function(){}},It[t.id])):Object(n.createElement)(n.Fragment,null),value:null},{display:Yt(t),value:""},{display:Jt(t),value:""},{display:zt(t),value:""},{display:(i=t,i.hasOwnProperty("created_on")?Object(a.ib)(i.created_on,!1,!1):"-"),value:""},{display:(e=t.items,r=[],o=[],Object.entries(e).map((function(t){var e=M(t,2),a=e[0],i=e[1];r.length<5&&r.push(Object(n.createElement)("a",{target:"_blank",className:"bwf-a-no-underline",href:"post.php?action=edit&post="+a,rel:"noreferrer"},i)),o.push(Object(n.createElement)("a",{target:"_blank",className:"bwf-a-no-underline",href:"post.php?action=edit&post="+a,rel:"noreferrer"},i))})),Object(n.createElement)("div",{className:"bwf-table-v-center"},!Object(_.isEmpty)(r)&&r.map((function(t,e){return Object(n.createElement)("span",{key:e},t,e!==r.length-1&&", ")})),!Object(_.isEmpty)(o)&&o.length>5&&Object(n.createElement)(b.a,{items:o,count:5}))),value:""},{display:Qt(t),value:t.total},{display:Object(n.createElement)(d.a,{cart:t}),value:""}];var e,r,o,i})):[],Ht=function(){var e=q(D().mark((function e(){return D().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t(Object(u.__)("Exporting…","wp-marketing-automations")),e.prev=1,e.next=4,l()({path:Object(a.A)("/export/action"),data:{type:"lost_carts",action:"start",extra_data:{search:vt}},method:"POST"}).then((function(e){if(200!==e.code)throw Error(Object(a.u)(null==e?void 0:e.message));e.hasOwnProperty("result")&&e.result.hasOwnProperty("data")&&!Object(_.isEmpty)(e.result.data)&&(bwfcrm_contacts_data.export_data=e.result.data,t(Object(u.__)("Cart export has started","wp-marketing-automations"))),Object(a.Lb)(t,3e3)}));case 4:e.next=10;break;case 6:e.prev=6,e.t0=e.catch(1),t(e.t0.hasOwnProperty("message")&&e.t0.message?e.t0.message:Object(u.__)("Unable to export","wp-marketing-automations")),Object(a.Lb)(t,3e3);case 10:case"end":return e.stop()}}),e,null,[[1,6]])})));return function(){return e.apply(this,arguments)}}();return Object(n.createElement)(n.Fragment,null,Object(n.createElement)(E.a,null),Object(n.createElement)("div",{className:"bwf-content-header-new"},Object(n.createElement)("div",{className:"bwf-content-header-left"},Object(n.createElement)("div",{className:"bwf-content-header-title"},Object(u.__)("Lost Carts","wp-marketing-automations")),parseInt(Q)>0&&Object(n.createElement)("div",{className:"bwf-content-header-count"},Object(u.sprintf)(Object(u._n)("(%s Result)","(%s Results)",Q,"wp-marketing-automations"),Q)))),Object(a.Qb)()?Object(n.createElement)(n.Fragment,null,rt&&Object(n.createElement)(P.a,{status:"error"},rt),Object(n.createElement)(p.a,{className:j()("bwfcrm-forms-list-table",{"has-search":!0}),rows:$t,headers:Ut,query:{paged:R/c+1},rowsPerPage:c,totalRows:Q,isLoading:Z,onPageChange:function(t,e){B((t-1)*c)},onQueryChange:function(t){return"per_page"!==t?function(){}:Bt},rowHeader:!0,showMenu:!1,actions:Mt>0?[Object(n.createElement)(S.a,G({key:"list-bulk-action",actions:[{id:"delete",icon:"trash",hint:Object(u.__)("Delete","wp-marketing-automations")}],onAction:Nt,inLine:!0,reset:Ct},Gt))]:[Object(n.createElement)(N.a,{key:"search",isLoading:Z,searchTerm:null==e?void 0:e.s,showResultCount:!1,setSearchData:function(t){if(Object(_.size)(t))Object(k.l)({s:encodeURIComponent(t)},"/",e);else{var r=Object(_.cloneDeep)(e);r.hasOwnProperty("s")&&(null==r||delete r.s),Object(k.l)(r,"/",{})}}})],emptyMessage:""!==vt?Object(u.__)("No results found","wp-marketing-automations"):Object(u.__)("No Data Available! Contact will appear in the list once customers abandonment the cart and cart expires as per settings ","wp-marketing-automations"),extraSectionBeforefilterCol:Z?null:Object(n.createElement)(n.Fragment,null,Object(a.ac)()&&-1!==Object(a.n)(bwfcrm_contacts_data.bwf_pro_version,"3.5.3")&&yt.hasOwnProperty("lost_carts")&&Object(n.createElement)(o.a,{type:"lost_carts",localData:yt.lost_carts,onDismiss:function(){return it(!0)}}),(!Object(a.ac)()||-1!==Object(a.n)(bwfcrm_contacts_data.bwf_pro_version,"3.5.3"))&&Object(n.createElement)(i.a,{className:"bwf-btn-small is-light",title:Object(u.__)("Export All","wp-marketing-automations"),onClick:function(){Object(a.ac)()?Ht():ut({status:!0,featureTitle:Object(u.__)("Export Cart","wp-marketing-automations"),isFeature:!0,proLink:Object(a.fb)("upgrade",{utm_medium:"Export+Lost+Cart+Upgrade+Modal"})})},disabled:Object(a.ac)()&&(0===parseInt(Q)||yt.hasOwnProperty("lost_carts")&&!ot)},Object(a.ac)()?Object(n.createElement)(x.a,{icon:"export",size:14}):Object(n.createElement)(x.a,{icon:"king",size:16}),Object(n.createElement)("span",{className:"bwf-ml-4"},Object(u.__)("Export All","wp-marketing-automations"))))}),Object(n.createElement)(v.a,{cartId:mt,isOpen:ft,onRequestClose:function(t){ht(!1),t&&wt()}}),Object(n.createElement)(A.a,{tasks:jt,isOpen:kt,onSuccess:function(){wt(),Ct()},onError:Ct,onRequestClose:function(){return xt(!1)},screenType:"cart",screenTypeId:"cart-bulk",actionType:St,type:"cart"}),!Object(a.ac)()&&Object(n.createElement)(I.b,{isOpen:lt.status,onRequestClose:function(){return ut({status:!1})},modalContent:lt})):Object(n.createElement)(L.a,{data:T.a}))}}}]); |