D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
stickain
/
davidsteele.com
/
wp-content
/
plugins
/
alidswoo
/
assets
/
js
/
aliexpress
/
Filename :
update.min.js
back
Copy
!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="/",r(r.s=247)}({247:function(t,e,r){t.exports=r(248)},248:function(t,e){function r(){"use strict";r=function(){return e};var t,e={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},u=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",l=a.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 p(t,e,r,n){var o=e&&e.prototype instanceof w?e:w,a=Object.create(o.prototype),c=new A(n||[]);return i(a,"_invoke",{value:L(t,r,c)}),a}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=p;var h="suspendedStart",v="executing",y="completed",m={};function w(){}function g(){}function b(){}var _={};f(_,u,(function(){return this}));var j=Object.getPrototypeOf,x=j&&j(j(T([])));x&&x!==n&&o.call(x,u)&&(_=x);var O=b.prototype=w.prototype=Object.create(_);function S(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function P(t,e){function r(n,i,a,u){var s=d(t[n],t,i);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==c(f)&&o.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,u)}),(function(t){r("throw",t,a,u)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,u)}))}u(s.arg)}var n;i(this,"_invoke",{value:function(t,o){function i(){return new e((function(e,n){r(t,o,e,n)}))}return n=n?n.then(i,i):i()}})}function L(e,r,n){var o=h;return function(i,a){if(o===v)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=E(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var s=d(e,r,n);if("normal"===s.type){if(o=n.done?y:"suspendedYield",s.arg===m)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=y,n.method="throw",n.arg=s.arg)}}}function E(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,E(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=d(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function D(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 k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(D,this),this.reset(!0)}function T(e){if(e||""===e){var r=e[u];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function r(){for(;++n<e.length;)if(o.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(c(e)+" is not iterable")}return g.prototype=b,i(O,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:g,configurable:!0}),g.displayName=f(b,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,b):(t.__proto__=b,f(t,l,"GeneratorFunction")),t.prototype=Object.create(O),t},e.awrap=function(t){return{__await:t}},S(P.prototype),f(P.prototype,s,(function(){return this})),e.AsyncIterator=P,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new P(p(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(O),f(O,l,"Generator"),f(O,u,(function(){return this})),f(O,"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=T,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(k),!e)for(var r in this)"t"===r.charAt(0)&&o.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 n(n,o){return c.type="throw",c.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),s=o.call(a,"finallyLoc");if(u&&s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},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),m},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),k(r),m}},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;k(r)}return o}}throw new 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),m}},e}function n(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 o(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){i(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function i(t,e,r){var n;return n=function(t,e){if("object"!=c(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(e,"string"),(e="symbol"==c(n)?n:String(n))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function c(t){return(c="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)}jQuery((function(t){var e=!1;(function(){var n="#total_item",i="#current_item",u="#ads_setting-form",s="#ads_activities-list",l="#activity-list",f="#js-saveSettings",p="#js-startNow",d="#js-getNext",h={settings:t("#ali-update-settings").html(),item:t("#item-product-template").html()};function v(e){var r=t(u);if(e)if(e.hasOwnProperty("error"))window.ADS.notify(e.error,"danger");else{r.html(window.ADS.objTotmpl(h.settings,e)),setTimeout(window.ADS.switchery(r),300);var o=parseInt(t(n).val()),a=parseInt(t(i).val());a>0&&o>0&&window.ADS.progress(t(l),o,a);var c=t('#ads_setting-form [name="applyto"]').val();c=c?c.split(","):[],t("#ads_setting-form .js-select-cat").find('[multiple="multiple"]').multiselect("select",c),_(),e.hasOwnProperty("message")&&window.ADS.notify(e.message,"success"),t.event.trigger({type:"request:done",obj:"#"+t(u).attr("id")})}}function y(e,r,n){r=""!==r&&"object"===c(r)?window.ADS.serialize(r):r,t.ajaxQueue({url:ajaxurl,data:{action:"ads_update_product",ads_action:e,args:r},type:"POST",dataType:"json",success:n})}function m(e){var r=t(s).find('[data-post_id="'+e.post_id+'"]');r.find(".status-message").html(t("<span/>",{class:e.notice_color}).text(e.notice));var n=r.find(".price-item");n.html(e.html_price),e.changePrice&&n.addClass("price-"+e.changePrice),e.changeQuantity&&n.addClass("quantity-"+e.changeQuantity),g(e)}function w(e,r){clearTimeout(null);var n,o,i,a={post_id:r.post_id,products:e.products,setting:{status:t("#status").val(),variant:t("#variant").val(),cost:t("#cost").val(),stock:t("#stock").val()}};n="update_product_suppliers",o=a,i=m,t.ajaxQueue({url:ajaxurl,data:{action:"ads_update_product",ads_action:n,args:o},type:"POST",dataType:"json",success:i})}function g(n){if(n.hasOwnProperty("error"))window.ADS.notify(n.error,"danger"),window.ADS.btnUnLock(e),e=!1;else if(n.hasOwnProperty("message"))window.ADS.notify(n.message,"success"),window.ADS.progress(t(l),10,10),window.ADS.btnUnLock(e),e=!1;else{var c=t(s);c.find(".table-container").length||c.html(t("<div/>",{class:"table-container"})),c=c.find(".table-container"),window.ADS.progress(t(l),n.total,n.current);var u=c.find(".review-item");if(u.length>=15&&u.last().remove(),n.row.post_id&&c.prepend(window.ADS.objTotmpl(h.item,n.row)),t(i).val(n.current),n.hasOwnProperty("row")&&n.row.hasOwnProperty("url")&&n.row.url&&n.row.url.includes("aliexpress.ru")&&(t('[data-post_id="'+n.row.post_id+'"]').find(".status-message").html(""),b(!1)),n.row.url){var f={post_id:n.row.post_id,url:n.row.url,product_id:n.row.product_id},p=[{post_id:n.row.post_id,productUrl:n.row.url,product_id:n.row.product_id,type:"product"}];for(var d in n.row.suppliers)p.push({post_id:n.row.post_id,productUrl:n.row.suppliers[d].productUrl,product_id:n.row.suppliers[d].product_id,type:"supplier"});var v=[];return new Promise(function(){var t,e=(t=r().mark((function t(e){var i,a,c,u,s;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=0,a=p;case 1:if(!(i<a.length)){t.next=15;break}return c=a[i],t.next=5,window.ADS.aliExtension.productAli(c.productUrl);case 5:if(!1!==(u=t.sent).code){t.next=8;break}return t.abrupt("return",Promise.reject());case 8:s=u.product,u.code&&404===u.code?(s={id:c.product_id}).available_product=!1:(s.description="",s.available_product=!0),u.product=window.ADS.b64EncodeUnicode(JSON.stringify(s)),v.push(o(o({},c),{},{data:u}));case 12:i++,t.next=1;break;case 15:w({post_id:n.row.post_id,products:v},f),e();case 18:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function c(t){a(i,n,o,c,u,"next",t)}function u(t){a(i,n,o,c,u,"throw",t)}c(void 0)}))});return function(t){return e.apply(this,arguments)}}())}n.row.post_id&&t('[data-post_id="'+n.row.post_id+'"]').find(".status-message").html(""),b(!1)}}function b(e){y(e?"first_product":"next_product",t(u),g)}function _(){if(t("#ads_setting-form .js-select-cat").hide(),"categories"==t('#ads_setting-form [name="prod_type"]').val()){var e=[];t("option:selected","#ads_setting-form .js-select-cat").each((function(){e.push(t(this).val())})),t('#ads_setting-form [name="applyto"]').val(e.join()),t("#ads_setting-form .js-select-cat").show()}}return{init:function(){this,window.ADS.aliExtension.sleepTask(1),window.ADS.aliExtension.enableAjax(),y("setting_form","",v),t(document).on("click",p,(function(r){r.preventDefault(),t(s).html(""),t(d).remove(),e=t(this),window.ADS.btnLock(e),t(i).val(0),window.ADS.progress(t(l),0,0),b(!0)})),t(document).on("click",d,(function(r){r.preventDefault(),t(s).html(""),t(d).remove(),e=t(p),window.ADS.btnLock(e),b()})),t(document).on("click",f,(function(r){r.preventDefault(),e=t(this),window.ADS.btnLock(e),y("save_form",t(u),v)})),t(document).on("request:done",(function(e){var r;e.obj===u&&(r=t("#interval").parents(".form-group"),t(document).find("#enabled").is(":checked")?r.show():r.hide())})),t(document).on("click","#enabled",(function(){var e=t("#interval").parents(".form-group");t(this).is(":checked")?e.show():e.hide()})),t(document).on("change",'#ads_setting-form [name="prod_type"]',(function(){t('#ads_review-form [name="applyto"]').val(""),_()})),t(document).on("change","#ads_setting-form .js-select-cat",(function(){_()}))}}})().init()}))}});