WP Retina 2x - Version 6.3.6

Version Description

(2022/11/25) = * Update: Still going towards a better UI organization. * Info: If you enjoy this plugin, please share some love by writing a little review here. And since I read them all, don't hesitate to drop a few remarks and feature requests in those reviews. Thank you :)

Download this release

Release Info

Developer TigrouMeow
Plugin Icon 128x128 WP Retina 2x
Version 6.3.6
Comparing to
See all releases

Code changes from version 6.3.5 to 6.3.6

Files changed (6) hide show
  1. app/index.js +1 -1
  2. classes/core.php +78 -0
  3. classes/optimize.php +3 -0
  4. classes/rest.php +32 -13
  5. readme.txt +3 -3
  6. wp-retina-2x.php +3 -3
app/index.js CHANGED
@@ -1,3 +1,3 @@
1
  /*! For license information please see index.js.LICENSE.txt */
2
- !function(){"use strict";var e,t={9714:function(e,t,n){n.d(t,{Ay:function(){return m.A},BP:function(){return y.B},CA:function(){return R.C},CB:function(){return P.ZP},Fq:function(){return j.Fq},Ge:function(){return R.G},Hq:function(){return l.H},Ii:function(){return x.I},JH:function(){return g.J},LI:function(){return k.L},Ln:function(){return I.Ln},Np:function(){return p.N},O9:function(){return b.O},P$:function(){return O.P},PQ:function(){return f.P},Ps:function(){return S.P},Qo:function(){return v.Q},SG:function(){return I.SG},Sx:function(){return w.S},UJ:function(){return d.U},ZB:function(){return p.Z},ZL:function(){return I.ZL},_Z:function(){return a._},_h:function(){return E._},aR:function(){return L.a},c4:function(){return S.c},cf:function(){return j.cf},h:function(){return w.h},jh:function(){return o.j},lQ:function(){return h.l},oY:function(){return s.o},pK:function(){return o.p},qj:function(){return j.qj},rR:function(){return u.r},si:function(){return i.s},u0:function(){return _.u},vg:function(){return r.Z},vj:function(){return c.v},wY:function(){return I.wY},zc:function(){return s.z}});var r=n(5833),a=n(7818),o=n(6071),i=n(1254),c=n(537),l=n(9137),u=n(749),s=(n(3534),n(5979)),f=n(4694),h=n(1630),m=n(1492),p=(n(3895),n(3565)),d=(n(5235),n(9378),n(9422),n(4696),n(8725),n(8281)),y=n(7172),v=n(776),g=n(6536),b=n(6160),w=n(3103),E=n(8406),R=n(3506),x=n(7198),_=(n(2625),n(8519)),k=(n(5307),n(3545),n(1203)),L=(n(858),n(3676)),S=n(1488),O=(n(8263),n(5231)),P=n(9995),j=n(4291),I=n(5149)},4533:function(e,t,n){var r=n(8100),a=n(9714),o=n(2788),i=n(7363),c=wr2x_retina.prefix,l=wr2x_retina.domain,u=wr2x_retina.rest_url.replace(/\/+$/,""),s=wr2x_retina.api_url.replace(/\/+$/,""),f=wr2x_retina.plugin_url.replace(/\/+$/,""),h=wr2x_retina.upload_url.replace(/\/+$/,""),m="1"===wr2x_retina.is_pro,p=m&&"1"===wr2x_retina.is_registered,d=wr2x_retina.rest_nonce,y=(wr2x_retina.home_url.replace(/\/+$/,""),wr2x_retina.site_url.replace(/\/+$/,"")),v=wr2x_retina.options;function g(e){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g(e)}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,c=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){c=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(c)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(e,t):void 0}}(e,t)||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 w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach((function(t){x(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function x(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _(){_=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,a){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new S(a||[]);return r(i,"_invoke",{value:R(e,n,c)}),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f={};function h(){}function m(){}function p(){}var d={};l(d,o,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(O([])));v&&v!==t&&n.call(v,o)&&(d=v);var b=p.prototype=h.prototype=Object.create(d);function w(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function a(r,o,i,c){var l=s(e[r],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==g(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){a("next",e,i,c)}),(function(e){a("throw",e,i,c)})):t.resolve(f).then((function(e){u.value=e,i(u)}),(function(e){return a("throw",e,i,c)}))}c(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){a(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function R(e,t,n){var r="suspendedStart";return function(a,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw o;return{value:void 0,done:!0}}for(n.method=a,n.arg=o;;){var i=n.delegate;if(i){var c=x(i,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function x(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return f;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,f;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function O(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:P}}function P(){return{value:void 0,done:!0}}return m.prototype=p,r(b,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:m,configurable:!0}),m.displayName=l(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,c,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},w(E.prototype),l(E.prototype,i,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,o){void 0===o&&(o=Promise);var i=new E(u(t,n,r,a),o);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},w(b),l(b,c,"Generator"),l(b,o,(function(){return this})),l(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=O,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(L),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return i.type="throw",i.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){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"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),L(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;L(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:O(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}function k(e,t,n,r,a,o,i){try{var c=e[o](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,a)}function L(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){k(o,r,a,i,c,"next",e)}function c(e){k(o,r,a,i,c,"throw",e)}i(void 0)}))}}var S,O,P={issues:"-",ignored:"-",all:"-",optimizeIssue:"-"},j=0,I={filterBy:"all",page:1,limit:10,busy:!1,stats:P,sort:{accessor:"id",by:"asc"},search:"",apiErrors:null,status:"",entries:[],totalEntries:0,options:v,wr2xSizes:v.sizes,wr2xRetinaSizes:v.retina_sizes,wr2xDisabledSizes:v.disabled_sizes,wr2xMethod:v.method,wr2xFullSize:v.full_size,wr2xPicturefillKeepSrc:v.picturefill_keep_src,wr2xPicturefillLazysizes:v.picturefill_lazysizes,wr2xPicturefillCssBackground:v.picturefill_css_background,wr2xPicturefillNoscript:v.picturefill_noscript,wr2xAutoGenerate:v.auto_generate,wr2xOverHttpCheck:v.over_http_check,wr2xDebug:v.debug,wr2xDisableResponsive:v.disable_responsive,wr2xImageReplace:v.image_replace,wr2xCdnDomain:v.cdn_domain,wr2xEasyioDomain:v.easyio_domain,wr2xEasyioLossless:v.easyio_lossless,wr2xBigImageSizeThreshold:v.big_image_size_threshold,wr2xHideRetinaColumn:v.hide_retina_column,wr2xHideRetinaDashboard:v.hide_retina_dashboard,wr2xHideOptimize:v.hide_optimize,modals:{uploadRetinaFullsize:!1},mutateEntries:(O=L(_().mark((function e(){return _().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(){return O.apply(this,arguments)}),mutateStats:(S=L(_().mark((function e(){return _().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(){return S.apply(this,arguments)})},T="PAGE_UPDATED",z="LIMIT_UPDATED",A="FILTER_UPDATED",C="SORT_UPDATED",N="SEARCH_UPDATED",F="TOGGLE_MODAL",D="PUSH_BUSY",B="POP_BUSY",G="ENTRIES_UPDATED",M="TOTAL_ENTRIES_UPDATED",Z="STATS_UPDATED",U="STATUS_UPDATED",q="ERROR_UPDATED",Y="SET_ENTRIES_MUTATE",W="SET_STATS_MUTATE",H=function(e,t){switch(t.type){case G:var n=t.entries;return R(R({},e),{},{entries:n});case M:var r=t.totalEntries;return R(R({},e),{},{totalEntries:r});case Z:var a=t.stats;return R(R({},e),{},{stats:a});case"SETTINGS_UPDATED":var o,i,c,l,u,s,f,h,m,p,d,y,v,g,b,w,E,x,_=t.options,k=null!==(o=_.sizes)&&void 0!==o?o:[],L=_.retina_sizes,S=_.disabled_sizes,O=_.method,P=null!==(i=_.full_size)&&void 0!==i&&i,H=null!==(c=_.picturefill_keep_src)&&void 0!==c&&c,Q=null!==(l=_.picturefill_lazysizes)&&void 0!==l&&l,$=null!==(u=_.picturefill_css_background)&&void 0!==u&&u,J=null!==(s=_.picturefill_noscript)&&void 0!==s&&s,K=null!==(f=_.auto_generate)&&void 0!==f&&f,V=null!==(h=_.over_http_check)&&void 0!==h&&h,X=null!==(m=_.debug)&&void 0!==m&&m,ee=null!==(p=_.disable_responsive)&&void 0!==p&&p,te=null!==(d=_.image_replace)&&void 0!==d&&d,ne=null!==(y=_.cdn_domain)&&void 0!==y?y:"",re=null!==(v=_.easyio_domain)&&void 0!==v?v:"",ae=null!==(g=_.easyio_lossless)&&void 0!==g?g:"",oe=null!==(b=_.big_image_size_threshold)&&void 0!==b&&b,ie=null!==(w=_.hide_retina_column)&&void 0!==w&&w,ce=null!==(E=_.hide_retina_dashboard)&&void 0!==E&&E,le=null!==(x=_.hide_optimize)&&void 0!==x&&x,ue=ie?"all":"issues";return R(R({},e),{},{options:_,wr2xSizes:k,wr2xRetinaSizes:L,wr2xDisabledSizes:S,wr2xMethod:O,wr2xFullSize:P,wr2xPicturefillKeepSrc:H,wr2xPicturefillLazysizes:Q,wr2xPicturefillCssBackground:$,wr2xPicturefillNoscript:J,wr2xAutoGenerate:K,wr2xOverHttpCheck:V,wr2xDebug:X,wr2xDisableResponsive:ee,wr2xImageReplace:te,wr2xCdnDomain:ne,wr2xEasyioDomain:re,wr2xEasyioLossless:ae,wr2xBigImageSizeThreshold:oe,wr2xHideRetinaColumn:ie,wr2xHideRetinaDashboard:ce,wr2xHideOptimize:le,filterBy:ue});case q:var se=t.apiErrors;return R(R({},e),{},{apiErrors:se});case T:var fe=t.page;return R(R({},e),{},{page:fe});case Y:var he=t.mutateEntries;return R(R({},e),{},{mutateEntries:he});case W:var me=t.mutateStats;return R(R({},e),{},{mutateStats:me});case z:var pe=t.limit;return R(R({},e),{},{limit:pe});case A:var de=t.filter;return R(R({},e),{},{filterBy:de});case C:var ye=t.sort;return R(R({},e),{},{sort:ye});case N:var ve=t.search;return R(R({},e),{},{search:ve});case U:var ge=t.status;return R(R({},e),{},{status:ge});case F:var be=t.modal,we=t.enable;if(!be){var Ee=R({},e);return Ee.modals=R({},I.modals),Ee}if(void 0===e.modals[be])return alert("The modal ".concat(be," doesn't exist.")),e;void 0===we&&(we=!e.modals[be]);var Re=R({},e);return Re.modals=R({},Re.modals),Re.modals[be]=we,Re;case D:return R(R({},e),{},{busy:++j>0});case B:return R(R({},e),{},{busy:--j>0});default:return e}},Q=(0,i.createContext)(),$=function(e){var t=e.children,n=b((0,i.useReducer)(H,I),2),o=n[0],c=n[1],l=o.filterBy,u=o.limit,f=o.page,h=o.sort,m=o.search,p=(0,i.useMemo)((function(){return[(0,a.Ln)("".concat(s,"/media"),{limit:u,skip:(f-1)*u,filterBy:l,orderBy:h.accessor,order:h.by,search:m}),{headers:{"X-WP-Nonce":d}}]}),[l,u,f,h,m,s,d,a.Ln]),y=(0,i.useMemo)((function(){return[(0,a.Ln)("".concat(s,"/stats"),{search:m}),{headers:{"X-WP-Nonce":d}}]}),[m,s,d,a.Ln]),v=(0,r.ZP)(p,a.SG),g=v.data,w=v.mutate;(0,i.useEffect)((function(){c({type:Y,mutateEntries:w})}),[w]),(0,i.useEffect)((function(){c({type:W,mutateStats:O})}),[O]);var E=(0,a.Fq)(g,[],!0),R=E.busy,x=E.data,_=E.total,k=E.error;(0,i.useEffect)((function(){c({type:R?D:B})}),[R]),(0,i.useEffect)((function(){c({type:G,entries:x})}),[x]),(0,i.useEffect)((function(){c({type:M,totalEntries:_})}),[_]),(0,i.useEffect)((function(){c({type:q,apiError:k})}),[k]);var L=(0,r.ZP)(y,a.SG),S=L.data,O=L.mutate,j=(0,a.Fq)(S,P,!0),T=j.busy,z=j.data,A=j.error;return(0,i.useEffect)((function(){c({type:T?D:B})}),[T]),(0,i.useEffect)((function(){c({type:Z,stats:z})}),[z]),(0,i.useEffect)((function(){c({type:q,apiError:A})}),[A]),React.createElement(Q.Provider,{value:[o,c]},t)},J=function(){var e={},t=b((0,i.useContext)(Q),2),n=t[0],r=t[1];return e.setStatus=function(e){r({type:U,status:e})},e.setPage=function(e){r({type:T,page:e})},e.setLimit=function(e){r({type:z,limit:e})},e.setFilter=function(e){r({type:A,filter:e})},e.setSort=function(e){r({type:C,sort:e})},e.setSearch=function(e){r({type:N,search:e})},e.toggleModal=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;r({type:F,modal:e,enable:t})},e.pushBusy=function(){r({type:D})},e.popBusy=function(){r({type:B})},R(R({},n),e)},K=wp.i18n.__,V={};V.GENERATE=K("Generate","wp-retina-2x"),V.DASHBOARD=K("Dashboard","wp-retina-2x"),V.PENDING=K("Pending","wp-retina-2x"),V.RENAMED=K("Renamed","wp-retina-2x"),V.ALL=K("All","wp-retina-2x"),V.THUMB=K("Thumb","wp-retina-2x"),V.TITLE_REPLACE=K("Replace / Title / Size","wp-retina-2x"),V.ATTACHED_TO=K("Attached To","wp-retina-2x"),V.FILENAME=K("Filename","wp-retina-2x");var X,ee=V;function te(e){return te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},te(e)}function ne(){ne=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,a){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new k(a||[]);return r(i,"_invoke",{value:E(e,n,c)}),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f={};function h(){}function m(){}function p(){}var d={};l(d,o,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(L([])));v&&v!==t&&n.call(v,o)&&(d=v);var g=p.prototype=h.prototype=Object.create(d);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function a(r,o,i,c){var l=s(e[r],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==te(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){a("next",e,i,c)}),(function(e){a("throw",e,i,c)})):t.resolve(f).then((function(e){u.value=e,i(u)}),(function(e){return a("throw",e,i,c)}))}c(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){a(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function E(e,t,n){var r="suspendedStart";return function(a,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw o;return{value:void 0,done:!0}}for(n.method=a,n.arg=o;;){var i=n.delegate;if(i){var c=R(i,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function R(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,R(e,t),"throw"===t.method))return f;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,f;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:S}}function S(){return{value:void 0,done:!0}}return m.prototype=p,r(g,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:m,configurable:!0}),m.displayName=l(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,c,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},b(w.prototype),l(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,a,o){void 0===o&&(o=Promise);var i=new w(u(t,n,r,a),o);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(g),l(g,c,"Generator"),l(g,o,(function(){return this})),l(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=L,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return i.type="throw",i.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){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"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;_(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:L(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}function re(e,t,n,r,a,o,i){try{var c=e[o](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,a)}function ae(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){re(o,r,a,i,c,"next",e)}function c(e){re(o,r,a,i,c,"throw",e)}i(void 0)}))}}function oe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,c=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){c=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(c)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ie(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ie(e,t):void 0}}(e,t)||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 ie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ce,le,ue,se=wp.element,fe=se.useState,he=se.useEffect,me=o.ZP.div(X||(ce=["\n display: block;\n color: white;\n padding: 8px 0px;\n font-size: 10px;\n text-align: center;\n width: 24px;\n height: 24px;\n line-height: 8px;\n margin-left: 2px;\n margin-right: -6px;\n box-sizing: border-box;\n margin-bottom: 2px;\n background: ",";\n border-radius: 25px;\n box-shadow: 0px 0px 3px white;\n cursor: pointer;\n\n &.disabled {\n background: gray;\n }\n\n &.missing {\n background: ",";\n }\n\n &.cannot {\n background: ",";\n }\n\n &.pending {\n background: ",";\n }\n\n &.ignored {\n background: gray;\n }\n\n &:last-child {\n margin-right: 6px;\n }\n"],le||(le=ce.slice(0)),X=Object.freeze(Object.defineProperties(ce,{raw:{value:Object.freeze(le)}}))),a.CB.blue,a.CB.red,a.CB.red,a.CB.orange),pe=function(e){var t=e.mutate,n=e.actionButton,r=void 0===n||n,o=e.displaySizes,i=void 0===o||o,c=e.displayFullSize,l=void 0===c||c,u=oe(fe(e.entry),2),f=u[0],h=u[1],m=oe(fe(!1),2),p=m[0],y=m[1],v=(0,a.cf)({concurrency:2}).runTask;he((function(){e.entry?h(e.entry):e.mediaId&&g(e.mediaId)}),[e.entry]);var g=function(){var e=ae(ne().mark((function e(t){var n;return ne().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return y((function(e){return e+1})),e.next=3,v(ae(ne().mark((function e(){return ne().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,a.ZL)("".concat(s,"/details"),{json:{mediaId:t},nonce:d}));case 1:case"end":return e.stop()}}),e)}))));case 3:n=e.sent,h(n.data),y((function(e){return e-1}));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),b=function(){var e=ae(ne().mark((function e(n){return ne().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:h(n),t&&t();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),w=function(){var t=ae(ne().mark((function t(){var n;return ne().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return y((function(e){return e+1})),t.next=3,(0,a.ZL)("".concat(s,"/build_retina"),{json:{mediaId:e.mediaId},nonce:d});case 3:n=t.sent,b(n.data),y((function(e){return e-1}));case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),E=function(e,t){return"CANNOT"===t.status?"".concat(t.name,": The Full-Size is too small to generate this size. A Full-Size of at least ").concat(t.required.width,"×").concat(t.required.height," is required."):"PENDING"===t.status?"".concat(t.name,": The retina can be generated."):t.name};return React.createElement(a.vg,{busy:p},React.createElement("div",{style:{display:"flex",alignItems:"center"}},r&&React.createElement(a._Z,{style:{marginLeft:0},title:"Generate",onClick:w},ee.GENERATE),i&&f&&f.filter((function(e){return"IGNORED"!==e.status&&"full-size"!==e.name})).map((function(e){return React.createElement(React.Fragment,null,React.createElement(me,{className:e.status.toLowerCase(),title:E(0,e)},e.shortname))})),l&&f&&f.filter((function(e){return"IGNORED"!==e.status&&"full-size"===e.name})).map((function(e){return React.createElement(React.Fragment,null,React.createElement(me,{className:e.status.toLowerCase(),title:E(0,e)},e.shortname))}))))};function de(e){return de="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},de(e)}function ye(){ye=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,a){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new k(a||[]);return r(i,"_invoke",{value:E(e,n,c)}),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f={};function h(){}function m(){}function p(){}var d={};l(d,o,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(L([])));v&&v!==t&&n.call(v,o)&&(d=v);var g=p.prototype=h.prototype=Object.create(d);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function a(r,o,i,c){var l=s(e[r],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==de(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){a("next",e,i,c)}),(function(e){a("throw",e,i,c)})):t.resolve(f).then((function(e){u.value=e,i(u)}),(function(e){return a("throw",e,i,c)}))}c(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){a(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function E(e,t,n){var r="suspendedStart";return function(a,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw o;return{value:void 0,done:!0}}for(n.method=a,n.arg=o;;){var i=n.delegate;if(i){var c=R(i,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function R(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,R(e,t),"throw"===t.method))return f;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,f;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:S}}function S(){return{value:void 0,done:!0}}return m.prototype=p,r(g,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:m,configurable:!0}),m.displayName=l(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,c,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},b(w.prototype),l(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,a,o){void 0===o&&(o=Promise);var i=new w(u(t,n,r,a),o);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(g),l(g,c,"Generator"),l(g,o,(function(){return this})),l(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=L,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return i.type="throw",i.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){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"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;_(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:L(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}function ve(e,t,n,r,a,o,i){try{var c=e[o](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,a)}function ge(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){ve(o,r,a,i,c,"next",e)}function c(e){ve(o,r,a,i,c,"throw",e)}i(void 0)}))}}function be(e){return function(e){if(Array.isArray(e))return Re(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Ee(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function we(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,c=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){c=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(c)throw a}}return o}}(e,t)||Ee(e,t)||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 Ee(e,t){if(e){if("string"==typeof e)return Re(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Re(e,t):void 0}}function Re(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var xe,_e,ke,Le,Se,Oe=wp.element,Pe=Oe.useState,je=Oe.useEffect,Ie=Oe.useMemo,Te=Oe.useCallback,ze=!!v.full_size,Ae=v.retina_sizes.length>0||ze,Ce={width:40,height:40,objectFit:"cover"},Ne=[{accessor:"thumbnail_url",title:"",style:{width:16}},{accessor:"title_metadata",title:ee.TITLE_REPLACE,sortable:!0,style:{width:280}},{accessor:"metadata",title:"Thumbnails (Retina in Colors)",style:{width:280}},{accessor:"retina_full",title:"Retina for Full-Size",visible:Ae&&ze},{accessor:"optimized",title:"Optimized"},{accessor:"actions",title:"Actions"}],Fe={accessor:"id",by:"asc"},De=o.ZP.div(ue||(ue=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n display: block;\n color: white;\n padding: 8px 0px;\n font-size: 10px;\n text-align: center;\n width: 24px;\n height: 24px;\n line-height: 8px;\n margin-left: 2px;\n margin-right: -6px;\n box-sizing: border-box;\n margin-bottom: 2px;\n background: ",";\n border-radius: 25px;\n box-shadow: 0px 0px 3px white;\n cursor: pointer;\n\n &.disabled {\n background: #a6ceea;\n }\n\n &.missing {\n background: ",";\n }\n\n &.cannot {\n background: ",";\n }\n\n &.pending {\n background: ",";\n }\n\n &.ignored {\n background: #a6ceea;\n }\n\n\n"])),a.CB.blue,a.CB.red,a.CB.red,a.CB.orange),Be=function(e){var t=e.entry,n=e.metadata;if(!n.sizes||!n.file)return null;var r=Object.keys(n.sizes),o=h+"/"+n.file.replace(/[^/]*$/,"");return React.createElement(React.Fragment,null,r.map((function(e){var r=n.sizes[e],i=r.width,c=r.height,l=r.shortname,u=r.file,s=o+u,f=t.find((function(t){return t.name===e}));return React.createElement(a.u0,{text:React.createElement(React.Fragment,null,"Size Name: ",e," (",l,")",React.createElement("br",null),"Dimension: ",i,"×",c,React.createElement("br",null),"Retina: ",f?f.status:"MISSING")},React.createElement(De,{className:f?f.status.toLowerCase():"missing",onClick:function(){return e=s,void console.log(e);var e}},l))})))},Ge=function(){var e=J(),t=e.entries,n=e.totalEntries,r=e.stats,o=e.busy,i=e.wr2xImageReplace,c=e.filterBy,l=e.modals,u=e.search,f=e.status,h=e.sort,m=e.page,y=e.limit,v=e.apiErrors,g=e.wr2xHideOptimize,b=e.wr2xHideRetinaColumn,w=J(),E=w.mutateStats,R=w.mutateEntries,x=w.setFilter,_=w.toggleModal,k=w.setSearch,L=w.setStatus,S=w.setSort,O=w.setPage,P=w.setLimit,j=we(Pe(),2),I=j[0],T=(j[1],we(Pe([]),2)),z=T[0],A=T[1],C=we(Pe(!1),2),N=C[0],F=C[1],D=we(Pe(""),2),B=D[0],G=D[1],M=(0,a.qj)(),Z=o||N,U=g?Ne.filter((function(e){return"optimized"!==e.accessor})):Ne,q=i,Y=Te((function(e,n){var r=be(t),a=r.findIndex((function(t){return t.ID===e}));r[a]=n,R({success:!0,data:r},!1),E()}),[t,R,E]),W=function(e){var t=e.mediaId;return React.createElement(a.Ii,{height:40,width:40,iconSize:16,style:{marginRight:5},onFailure:function(e){alert(e.message)},onSuccess:function(e){_(null),Y(t,e.data),E()},apiUrl:"".concat(s,"/replace"),apiConfig:{json:{mediaId:t},nonce:d}})},H=function(e){var t=e.mediaId;return React.createElement(a.Ii,{height:40,width:40,iconSize:16,style:{marginRight:5},onFailure:function(e){alert(e.message)},onSuccess:function(e){Y(t,e.data),E()},apiUrl:"".concat(s,"/upload_retina_fullsize"),apiConfig:{json:{mediaId:t},nonce:d}})},Q=Ie((function(){return t.map((function(e){var t=e.info.filter((function(e){return"EXISTS"===e.status&&"full-size"===e.name})).length>0;return e.info.filter((function(e){return"MISSING"===e.status||"CANNOT"===e.status})).length,{id:e.ID,thumbnail_url:React.createElement("img",{src:"".concat(e.thumbnail_url,"?version=").concat(e.version),style:Ce}),title_metadata:React.createElement("div",{style:{display:"flex",alignItems:"center"}},!!q&&React.createElement(W,{mediaId:e.ID}),React.createElement("div",{style:{display:"flex",flexDirection:"column"}},React.createElement("a",{href:"post.php?post=".concat(e.ID,"&action=edit")},e.post_title),React.createElement("small",null,"Full-Size: ",e.metadata.width,"×",e.metadata.height," (",e.filesize,")"))),metadata:React.createElement("div",{style:{display:"flex",alignItems:"center"}},React.createElement(Be,{entry:e.info,metadata:e.metadata})),retina_full:React.createElement("div",{style:{display:"flex",alignItems:"center"}},(ze||t)&&React.createElement("div",{style:{display:"flex",alignItems:"center"}},!t&&React.createElement(H,{mediaId:e.ID}),React.createElement(pe,{actionButton:!1,displaySizes:!1,displayFullSize:!0,entry:e.info}))),optimized:React.createElement("div",null,React.createElement(a.JH,{icon:e.optimized?"check":"close",color:e.optimized?a.CB.green:a.CB.red,width:20,height:20}),e.optimized&&React.createElement(a.O9,null,Math.floor((e.optimized.before-e.optimized.after)/e.optimized.before*1e4)/100,"%")),actions:React.createElement("div",{style:{display:"flex",justifyContent:"end"}},!g&&React.createElement(a._Z,{title:"Optimize the Image and Thumbnails",onClick:function(){return re([e.ID])}},"Optimize"),React.createElement(a._Z,{title:"Regenerate Thumbnails, Metadata and Build Retina",onClick:function(){return ne([e.ID])}},"Build Thumbnails"),React.createElement(a._Z,{title:"Build Retina Images",onClick:function(){return V([e.ID])}},"Build Retina"),t&&React.createElement(a._Z,{onClick:function(){confirm("Are you sure?")&&ee([e.ID])}},"Delete ",React.createElement("small",null,"Full-Size Retina")),"issues"===c&&React.createElement(a._Z,{onClick:function(){return X(e.ID)}},"Ignore"),"ignored"===c&&React.createElement(a._Z,{onClick:function(){return X(e.ID)}},"Un-Ignore"))}}))}),[t]);je((function(){A([]),S(Fe),O(1)}),[c,u]),je((function(){if(null!==M.busy&&(F(M.busy),!M.busy)){var e=M.getErrorCount();e>0&&G("The process has finished, but ".concat(e," error(s) occurred (check your console).")),M.reset(),A([]),R(),E()}}),[M.busy]);var $=function(){var e=ge(ye().mark((function e(t){var n;return ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,a.ZL)("".concat(s,"/get_all_ids"),{json:{issuesOnly:t},nonce:d});case 2:if((n=e.sent).success){e.next=6;break}return alert(n.message),e.abrupt("return",[]);case 6:return e.abrupt("return",n.data);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),K=function(){var e=ge(ye().mark((function e(){return ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return F(!0),e.next=3,(0,a.ZL)("".concat(s,"/refresh"),{nonce:d});case 3:R(),E(),F(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),V=function(){var e=ge(ye().mark((function e(){var t,n,r,o=arguments;return ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>0&&void 0!==o[0]?o[0]:null,L("Preparing..."),F(!0),!t){e.next=7;break}e.t0=t,e.next=10;break;case 7:return e.next=9,$(!0);case 9:e.t0=e.sent;case 10:if(!(n=e.t0)){e.next=16;break}return r=n.map((function(e){return function(){var t=ge(ye().mark((function t(n){var r;return ye().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return L("Build Retina for #".concat(e)),t.next=3,(0,a.ZL)("".concat(s,"/build_retina"),{json:{mediaId:e},nonce:d,signal:n});case 3:return(r=t.sent).success?Y(e,r.data):alert("Error!"),t.abrupt("return",r);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),e.next=15,M.start(r);case 15:E();case 16:F(!1);case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),X=function(){var e=ge(ye().mark((function e(t){var n;return ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return F(!0),e.next=3,(0,a.ZL)("".concat(s,"/ignore"),{json:{mediaId:t},nonce:d});case 3:return(n=e.sent).success?(E(),R()):alert("Error!"),F(!1),e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ee=function(){var e=ge(ye().mark((function e(){var t,n,r,o=arguments;return ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>0&&void 0!==o[0]?o[0]:null,L("Preparing..."),F(!0),!t){e.next=7;break}e.t0=t,e.next=10;break;case 7:return e.next=9,$();case 9:e.t0=e.sent;case 10:if(!(n=e.t0)){e.next=16;break}return r=n.map((function(e){return function(){var t=ge(ye().mark((function t(n){var r;return ye().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return L("Delete Full-Size Retina for #".concat(e)),t.next=3,(0,a.ZL)("".concat(s,"/delete_retina_fullsize"),{json:{mediaId:e},nonce:d,signal:n});case 3:return(r=t.sent).success?Y(e,r.data):alert("Error!"),t.abrupt("return",r);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),e.next=15,M.start(r);case 15:E();case 16:F(!1);case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),te=function(){var e=ge(ye().mark((function e(){var t,n,r,o=arguments;return ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>0&&void 0!==o[0]?o[0]:null,L("Preparing..."),F(!0),!t){e.next=7;break}e.t0=t,e.next=10;break;case 7:return e.next=9,$();case 9:e.t0=e.sent;case 10:if(!(n=e.t0)){e.next=16;break}return r=n.map((function(e){return function(){var t=ge(ye().mark((function t(n){var r;return ye().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return L("Delete Retina for #".concat(e)),t.next=3,(0,a.ZL)("".concat(s,"/delete_retina"),{json:{mediaId:e},nonce:d,signal:n});case 3:return(r=t.sent).success?Y(e,r.data):alert("Error!"),t.abrupt("return",r);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),e.next=15,M.start(r);case 15:E();case 16:F(!1);case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ne=function(){var e=ge(ye().mark((function e(){var t,n,r,o=arguments;return ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>0&&void 0!==o[0]?o[0]:null,L("Preparing..."),F(!0),!t){e.next=7;break}e.t0=t,e.next=10;break;case 7:return e.next=9,$();case 9:e.t0=e.sent;case 10:if(!(n=e.t0)){e.next=16;break}return r=n.map((function(e){return function(){var t=ge(ye().mark((function t(n){var r;return ye().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return L("Regenerate #".concat(e)),t.next=3,(0,a.ZL)("".concat(s,"/regenerate"),{json:{mediaId:e},nonce:d,signal:n});case 3:return(r=t.sent).success?Y(e,r.data):alert("Error!"),t.abrupt("return",r);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),e.next=15,M.start(r);case 15:E();case 16:F(!1);case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),re=function(){var e=ge(ye().mark((function e(){var t,n,r,o=arguments;return ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>0&&void 0!==o[0]?o[0]:null,L("Preparing..."),F(!0),!t){e.next=7;break}e.t0=t,e.next=10;break;case 7:return e.next=9,$();case 9:e.t0=e.sent;case 10:if(!(n=e.t0)){e.next=16;break}return r=n.map((function(e){return function(){var t=ge(ye().mark((function t(n){var r;return ye().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return L("Optimize #".concat(e)),t.next=3,(0,a.ZL)("".concat(s,"/optimize"),{json:{mediaId:e},nonce:d,signal:n});case 3:return(r=t.sent).success?Y(e,r.data):alert("Error!"),t.abrupt("return",r);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),e.next=15,M.start(r);case 15:E();case 16:F(!1);case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ae=React.createElement(React.Fragment,null,React.createElement(a._Z,{className:"secondary",onClick:function(){return window.open("https://meowapps.com/plugin/wp-retina-2x/","_blank")}},"Get the Pro Version"),React.createElement(a._Z,{className:"primary",onClick:function(){return window.open("https://meowapps.com/wp-retina-2x-tutorial/","_blank")}},"Read the tutorial"));return React.createElement(a.si,{nekoErrors:[v]},React.createElement(a.BP,{title:"Perfect Images | Dashboard",subtitle:"By Jordy Meow"},React.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},React.createElement(a._Z,{className:"header",onClick:function(){return window.open("https://meowapps.com/wp-retina-2x-tutorial/","_blank")}},"Tutorial"),React.createElement(a._Z,{icon:"dashboard",className:"header",onClick:function(){return location.href="admin.php?page=wr2x_settings"}},"Settings"))),React.createElement(a.oY,null,React.createElement(a.zc,{full:!0},React.createElement(a.Hq,{footer:!p&&ae},React.createElement(a.O9,{p:!0},"Welcome to the new version of the former WP Retina 2x, now ",React.createElement("b",null,"Perfect Images"),". The goal is to make your images sizes and thumbnails more manageable, with Retina support. Please let me know if this dashboard is not clear enough, or if you have ideas how to make it even better.")),React.createElement(a.P$,null,React.createElement(a._Z,{onClick:function(){return K()}},"Refresh Stats"),!Z&&z.length>0&&React.createElement(React.Fragment,null,!g&&React.createElement(a._Z,{className:"secondary",onClick:function(){return re(z)}},"Optimize for ",React.createElement("strong",null,z.length," Entries")),React.createElement(a._Z,{className:"secondary",onClick:function(){return V(z)}},"Build Retina for ",React.createElement("strong",null,z.length," Entries")),React.createElement(a._Z,{className:"secondary",title:"Regenerate Thumbnails, Metadata and Build Retina",onClick:function(){return ne(z)}},"Regenerate ",React.createElement("strong",null,z.length," Entries")),React.createElement(a._Z,{className:"danger",onClick:function(){return te(z)}},"Delete Retina for ",React.createElement("strong",null,z.length," Entries"))),React.createElement("div",{style:{flex:1}},N&&React.createElement(a.UJ,{status:function(e){return"".concat(f," (").concat(e,"%)")},busy:N,value:M.value,max:M.max,onStopClick:M.stop})),!Z&&React.createElement(React.Fragment,null,React.createElement(a.Ay,{onBlur:function(e){k(e)},value:u,onEnter:function(e){k(e)}}),!u&&React.createElement(a.JH,{icon:"search",width:24,style:{position:"relative",left:-34,marginRight:-22},color:"#5a5a5a82"}),u&&React.createElement(a.JH,{icon:"close",width:24,style:{position:"relative",left:-34,marginRight:-22},color:a.CB.blue,onClick:function(){k("")}})),!Z&&0===z.length&&React.createElement(React.Fragment,null,React.createElement(a.jh,{title:"Bulk Actions",style:{minWidth:180}},!g&&React.createElement(a.pK,{className:"primary",onClick:function(){return re()}},"Optimize for ",React.createElement("strong",null,"All Entries")),React.createElement(a.pK,{className:"primary",onClick:function(){return V()}},"Build Retina for ",React.createElement("strong",null,"All Issues")),React.createElement(a.pK,{className:"primary",title:"Regenerate Thumbnails, Metadata and Build Retina",onClick:function(){return ne()}},"Regenerate ",React.createElement("strong",null,"All Entries")),React.createElement(a.pK,{className:"danger",onClick:function(){return te()}},"Delete Retina for ",React.createElement("strong",null,"All"))))),React.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginTop:10,marginBottom:10}},React.createElement(a.h,{value:c,busy:Z,onChange:function(e){x(e),O(1)}},React.createElement(a.Sx,{title:"All",value:"all",count:r.all}),!b&&React.createElement(a.Sx,{title:"Retina Issues",value:"issues",count:r.issues}),React.createElement(a.Sx,{title:"Ignored",value:"ignored",count:r.ignored})),React.createElement(a.Qo,{currentPage:m,limit:y,total:n,onCurrentPageChanged:function(e){return O(e)},onClick:function(e){return O(e)}})),React.createElement(a.aR,{busy:Z,data:Q,columns:U,sort:h,onSortChange:function(e,t){S({accessor:e,by:t})},onSelect:function(e){A([].concat(be(z),be(e)))},onUnselect:function(e){A(be(z.filter((function(t){return!e.includes(t)}))))},selectedItems:z,emptyMessage:React.createElement(React.Fragment,null,"It's all clean & nice here! 👍",React.createElement("br",null),"Why not trying to give a boost ot your DB with ",React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/database-cleaner/"},"Database Cleaner"),"? 😌")}),React.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginTop:10}},React.createElement(a.Np,{scrolldown:!0,value:y,onChange:function(e){P(e),O(1)}},React.createElement(a.ZB,{value:10,label:"10 items per page"}),React.createElement(a.ZB,{value:25,label:"25 items per page"}),React.createElement(a.ZB,{value:50,label:"50 items per page"}),React.createElement(a.ZB,{value:100,label:"100 items per page"}),React.createElement(a.ZB,{value:250,label:"250 items per page"})),React.createElement(a.Qo,{currentPage:m,limit:y,total:n,onClick:function(e){return O(e)}}))),React.createElement(a.LI,{isOpen:l.uploadRetinaFullsize,onRequestClose:function(){_(null)},title:"Upload Retina for Full-Size",content:React.createElement(React.Fragment,null,React.createElement(a.Ii,{height:200,onFailure:function(e){alert(e.message)},onSuccess:function(e){_(null),Y(I,e.data),E()},apiUrl:"".concat(s,"/upload_retina_fullsize"),apiConfig:{json:{mediaId:I},nonce:d}}),React.createElement("p",{style:{marginTop:20,marginBottom:-20}},"Drop your image here! If the thumbnails could not be created before, the plugin will also use this image to create the missing Retina Images."))}),React.createElement(a.LI,{isOpen:B,title:"Success",ok:"Close",content:B,onOkClick:function(){G(""),M.reset()}})))};function Me(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Ze=o.ZP.div(xe||(xe=Me(["\n color: white;\n padding: 15px;\n margin-bottom: -15px;\n\n a {\n color: #7dedff;\n text-decoration: none;\n }\n\n p {\n font-size: 15px;\n }\n"]))),Ue=(0,o.ZP)(a.vj)(_e||(_e=Me(["\n\n .nui-block-title {\n display: none;\n }\n\n .nui-block-content {\n display: flex;\n padding: 10px;\n\n h2 {\n color: #055082;\n font-size: 16px;\n margin: 5px 0 5px 0;\n\n a {\n text-decoration: none;\n }\n }\n\n p {\n margin: 0px;\n line-height: 18px;\n }\n }\n"]))),qe=o.ZP.img(ke||(ke=Me(["\n width: 85px;\n height: 85px;\n padding-right: 10px;\n"]))),Ye=o.ZP.div(Le||(Le=Me(["\n\n margin: 15px;\n\n .center {\n background: white;\n border-radius: 10px;\n padding: 10px;\n max-width: 100%\n overflow: none;\n\n h2 {\n font-size: 26px;\n }\n\n table {\n width: 100%;\n\n tr td:first-child {\n width: 220px;\n font-weight: bold;\n color: #1e7cba;\n }\n\n * {\n overflow-wrap: anywhere;\n }\n }\n }\n\n hr {\n border-color: #1e7cba;\n }\n"]))),We=o.ZP.ul(Se||(Se=Me(["\n margin-top: 10px;\n background: rgb(0, 72, 88);\n padding: 10px;\n color: rgb(58, 212, 58);\n max-height: 600px;\n min-height: 200px;\n display: block;\n font-family: monospace;\n font-size: 12px;\n white-space: pre;\n overflow-x: auto;\n width: calc(100vw - 276px);\n\n .log-date {\n color: white;\n margin-left: 8px;\n }\n\n .log-type {\n background: #0000004d;\n padding: 2px 5px;\n border-radius: 8px;\n text-transform: uppercase;\n }\n\n .log-content {\n display: block;\n }\n\n .log-warning .log-type {\n background: #ccb028;\n color: white;\n }\n\n .log-fatal .log-type {\n background: #cc2828;\n color: white;\n }\n"])));function He(e){return He="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},He(e)}function Qe(){Qe=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,a){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new k(a||[]);return r(i,"_invoke",{value:E(e,n,c)}),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f={};function h(){}function m(){}function p(){}var d={};l(d,o,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(L([])));v&&v!==t&&n.call(v,o)&&(d=v);var g=p.prototype=h.prototype=Object.create(d);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function a(r,o,i,c){var l=s(e[r],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==He(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){a("next",e,i,c)}),(function(e){a("throw",e,i,c)})):t.resolve(f).then((function(e){u.value=e,i(u)}),(function(e){return a("throw",e,i,c)}))}c(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){a(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function E(e,t,n){var r="suspendedStart";return function(a,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw o;return{value:void 0,done:!0}}for(n.method=a,n.arg=o;;){var i=n.delegate;if(i){var c=R(i,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function R(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,R(e,t),"throw"===t.method))return f;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,f;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:S}}function S(){return{value:void 0,done:!0}}return m.prototype=p,r(g,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:m,configurable:!0}),m.displayName=l(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,c,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},b(w.prototype),l(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,a,o){void 0===o&&(o=Promise);var i=new w(u(t,n,r,a),o);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(g),l(g,c,"Generator"),l(g,o,(function(){return this})),l(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=L,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return i.type="throw",i.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){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"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;_(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:L(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}function $e(e,t,n,r,a,o,i){try{var c=e[o](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,a)}function Je(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){$e(o,r,a,i,c,"next",e)}function c(e){$e(o,r,a,i,c,"throw",e)}i(void 0)}))}}function Ke(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,c=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){c=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(c)throw a}}return o}}(e,t)||Ve(e,t)||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 Ve(e,t){if(e){if("string"==typeof e)return Xe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xe(e,t):void 0}}function Xe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var et=wp.element,tt=et.useState,nt=et.useEffect,rt="".concat(u,"/meow-common/v1"),at=function(e){var t=e.request,n=e.title,r=e.max,o=Ke(tt(!1),2),i=o[0],c=o[1],l=Ke(tt([]),2),u=l[0],s=l[1],f=u.length>0?u.reduce((function(e,t){return e+t})):0,h=u.length>0?Math.ceil(f/u.length):0,m=!u.length&&i;return nt((function(){i&&setTimeout(Je(Qe().mark((function e(){var n,r,o;return Qe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(new Date).getTime(),e.next=3,(0,a.ZL)("".concat(rt,"/").concat(t),{nonce:d});case 3:r=(new Date).getTime(),o=r-n,s((function(e){return[].concat(function(e){if(Array.isArray(e))return Xe(e)}(t=e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||Ve(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[o]);var t}));case 6:case"end":return e.stop()}}),e)}))),1e3)}),[u]),React.createElement(Ze,{style:{width:200,textAlign:"center"}},React.createElement(a.O9,{h2:!0,style:{color:"white"}},n),React.createElement(a._h,{size:200,value:m?r:h,max:r},React.createElement("span",{style:{fontSize:20}},m?"START":h+" ms"),React.createElement("span",{style:{fontSize:12}},m?"YOUR ENGINE":u.length+" requests")),React.createElement(a._Z,{style:{width:"100%",marginTop:10},color:i?"#cc3627":"#ccb027",onClick:function(){i||s([]),c(!i)}},i?"Stop":"Start"))};function ot(e){return ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ot(e)}function it(){it=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,a){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new k(a||[]);return r(i,"_invoke",{value:E(e,n,c)}),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f={};function h(){}function m(){}function p(){}var d={};l(d,o,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(L([])));v&&v!==t&&n.call(v,o)&&(d=v);var g=p.prototype=h.prototype=Object.create(d);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function a(r,o,i,c){var l=s(e[r],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==ot(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){a("next",e,i,c)}),(function(e){a("throw",e,i,c)})):t.resolve(f).then((function(e){u.value=e,i(u)}),(function(e){return a("throw",e,i,c)}))}c(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){a(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function E(e,t,n){var r="suspendedStart";return function(a,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw o;return{value:void 0,done:!0}}for(n.method=a,n.arg=o;;){var i=n.delegate;if(i){var c=R(i,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function R(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,R(e,t),"throw"===t.method))return f;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,f;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:S}}function S(){return{value:void 0,done:!0}}return m.prototype=p,r(g,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:m,configurable:!0}),m.displayName=l(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,c,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},b(w.prototype),l(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,a,o){void 0===o&&(o=Promise);var i=new w(u(t,n,r,a),o);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(g),l(g,c,"Generator"),l(g,o,(function(){return this})),l(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=L,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return i.type="throw",i.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){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"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;_(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:L(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}function ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function lt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ct(Object(n),!0).forEach((function(t){ut(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ct(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ut(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function st(e,t,n,r,a,o,i){try{var c=e[o](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,a)}function ft(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){st(o,r,a,i,c,"next",e)}function c(e){st(o,r,a,i,c,"throw",e)}i(void 0)}))}}function ht(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,c=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){c=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(c)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return mt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mt(e,t):void 0}}(e,t)||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 mt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var pt=wp.element,dt=pt.useState,yt=pt.useEffect;s&&u&&f||console.error("[@common/dashboard] apiUrl, restUrl and pluginUrl are mandatory.");var vt="".concat(u,"/meow-common/v1"),gt=React.createElement(Ze,null,React.createElement(a.O9,{p:!0},"Meow Apps is run by Jordy Meow, a photographer and software developer living in Japan (and taking ",React.createElement("a",{target:"_blank",href:"https://offbeatjapan.org"},"a lot of photos"),"). Meow Apps proposes a suite of plugins focusing on photography, imaging, optimization and SEO. The ultimate goal is to make your website better, faster, while making it easy. Meow Apps also teams up with the best players in the community. For more information, please check ",React.createElement("a",{href:"http://meowapps.com",target:"_blank"},"Meow Apps"),".")),bt=React.createElement(Ze,null,React.createElement(a.O9,{p:!0},"The ",React.createElement("b",null,"Empty Request Time")," helps you analyzing the raw performance of your install by giving you the average time it takes to run an empty request to your server. You can try to disable some plugins (or change their options) then Start this again to see how it influences the results. An excellent install would have an Empty Request Time of less than 500 ms. Keep it absolutely under 2,000 ms! For more information, ",React.createElement("a",{href:"https://meowapps.com/clean-optimize-wordpress/#Optimize_your_Empty_Request_Time",target:"_blank"},"click here"),"."),React.createElement(a.O9,{p:!0},React.createElement("b",null,"File Operation Time")," creates a temporary size of 10MB every time. ",React.createElement("b",null,"SQL Request Time")," counts the number of posts. Those two should be very fast, and almost the same as the ",React.createElement("b",null,"Empty Request Time"),".")),wt=React.createElement(Ze,null,React.createElement(a.O9,{p:!0},"Too many WordPress installs are blown-up with useless and/or heavy plugins, and not aware of best practices. That's not the fault of the users; WordPress pretends to be simple but it is in fact very complex, and the immensity and diversity of the community around it makes it a real jungle where everything is possible."),React.createElement(a.O9,{p:!0},"A rule of thumb is to keep your WordPress install as simple as possible, with the least number of plugins installed (run away from the heavy ones) and an excellent hosting service. Avoid VPS or self-hosted solutions; you must be a professional to actually set them up so that they are actually performant."),React.createElement(a.O9,{p:!0},"On the Meow Apps website, you will find articles which are always updated with the latest recommendations.",React.createElement("ul",null,React.createElement("li",null,"☘️  ",React.createElement("a",{href:"https://meowapps.com/how-to-debug-wordpress-errors/",target:"_blank"},"How To Debug WordPress")),React.createElement("li",null,"☘️  ",React.createElement("a",{href:"https://meowapps.com/tutorial-improve-seo-wordpress/",target:"_blank"},"SEO Checklist & Optimization")),React.createElement("li",null,"☘️  ",React.createElement("a",{href:"https://meowapps.com/tutorial-faster-wordpress-optimize/",target:"_blank"},"Optimize your WordPress Speed")),React.createElement("li",null,"☘️  ",React.createElement("a",{href:"https://meowapps.com/tutorial-optimize-images-wordpress/",target:"_blank"},"Optimize Images (CDN, and so on)")),React.createElement("li",null,"☘️  ",React.createElement("a",{href:"https://meowapps.com/tutorial-hosting-service-wordpress/",target:"_blank"},"Best Hosting Services for WordPress"))))),Et=["".concat(vt,"/all_settings/"),{headers:{"X-WP-Nonce":d}}],Rt=function(){var e=ht(dt(!1),2),t=e[0],n=e[1],o=(0,r.ZP)(Et,a.SG),i=o.data,c=o.mutate,l=o.error,u=null==i?void 0:i.data,s=null==u?void 0:u.meowapps_hide_meowapps,h=null==u?void 0:u.force_sslverify,m=ht(dt(!1),2),p=m[0],y=m[1],v=ht(dt([]),2),g=v[0],b=v[1],w=ht(dt(""),2),E=w[0],R=w[1];yt((function(){l&&!t&&(n(!0),console.error("Error from UseSWR",l.message))}),[l]),yt((function(){var e=document.getElementById("meow-common-phpinfo");R(e.innerHTML)}),[]);var x=function(){var e=ft(it().mark((function e(t,n){var r,o;return it().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=lt({},i.data))[n]=t,c(lt(lt({},i),{},{data:r}),!1),y(!0),e.next=6,(0,a.ZL)("".concat(vt,"/update_option"),{json:{name:n,value:t},nonce:d});case 6:o=e.sent,y(!1),o.success||alert(o.message),c();case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),_=function(){var e=ft(it().mark((function e(){var t,n;return it().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return y(!0),e.next=3,(0,a.ZL)("".concat(vt,"/error_logs"),{nonce:d});case 3:t=e.sent,n=t&&t.data?t.data:[],b(n.reverse()),y(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),k=React.createElement(a.rR,{title:"Main Menu"},React.createElement(a.lQ,{max:"1"},React.createElement(a.PQ,{id:"meowapps_hide_meowapps",label:"Hide (Not Recommended)",description:React.createElement(a.O9,{p:!0},"This will hide the Meow Apps Menu (on the left side) and everything it contains. You can re-enable it through though an option that will be added in Settings → General."),value:"1",disabled:p,checked:s,onChange:x}))),L=React.createElement(a.rR,{title:"SSL Verify"},React.createElement(a.lQ,{max:"1"},React.createElement(a.PQ,{id:"force_sslverify",label:"Force (Not Recommended)",description:React.createElement(a.O9,{p:!0},"This will enforce the usage of SSL when checking the license or updating the plugin."),value:"1",disabled:p,checked:h,onChange:x})));return React.createElement(a.si,{showRestError:t},React.createElement(a.BP,{title:"The Dashboard"}),React.createElement(a.oY,null,React.createElement(a.zc,{full:!0},React.createElement(a.c4,null,React.createElement(a.Ps,{title:"Meow Apps"},gt,React.createElement(a.oY,null,React.createElement(a.zc,{minimal:!0},React.createElement(Ue,{title:"Media Cleaner",className:"primary"},React.createElement(qe,{src:"".concat(f,"/common/img/media-cleaner.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/media-cleaner/"},"Media Cleaner")),React.createElement("p",null,"The Cleaner analyzes your WordPress entirely to find out which files are not used. You can trash them, before deleting them permanently. Your WordPress will breath again :)"))),React.createElement(Ue,{title:"Database Cleaner",className:"primary"},React.createElement(qe,{src:"".concat(f,"/common/img/database-cleaner.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/database-cleaner/"},"Database Cleaner")),React.createElement("p",null,"Clean your WordPress database. This plugin is simple, handles risk levels, and aims to work even on oversized databases on which other plugins fail to operate."))),React.createElement(Ue,{title:"Media File Renamer",className:"primary"},React.createElement(qe,{src:"".concat(f,"/common/img/media-file-renamer.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/media-file-renamer/"},"Media File Renamer")),React.createElement("p",null,"The Renamer will help you in getting nicer filenames for an improved SEO and a tidier filesystem. It's mostly automatic and very fun to use."))),React.createElement(Ue,{title:"Social Engine",className:"primary"},React.createElement(qe,{src:"".concat(f,"/common/img/social-engine.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/social-engine/"},"Social Engine")),React.createElement("p",null,"Organize, schedule and automate the publishing of your content and photos on social accounts. Similar to Buffer, TweetDeck, etc, but without all the limitations, and in your WordPress."))),React.createElement(Ue,{title:"Meow Analytics",className:"primary"},React.createElement(qe,{src:"".concat(f,"/common/img/meow-analytics.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/meow-analytics/"},"Meow Analytics")),React.createElement("p",null,"Are you tired of those heavy plugins, accessing your Google Analytics deliberately? Switch to Meow Analytics!")))),React.createElement(a.zc,{minimal:!0},React.createElement(Ue,{title:"Photo Engine",className:"primary"},React.createElement(qe,{src:"".concat(f,"/common/img/wplr-sync.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/wplr-sync/"},"Photo Engine")),React.createElement("p",null,"Are you using Lightroom? So you know Photo Engine already. Wait, you don't? You must try it! This plugin will be your favorite very soon."))),React.createElement(Ue,{title:"Meow Gallery",className:"primary"},React.createElement(qe,{src:"".concat(f,"/common/img/meow-gallery.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/meow-gallery/"},"Meow Gallery")),React.createElement("p",null,"This is the fastest gallery system... and it is pretty as well! It is 100% compatible with the native WordPress galleries and therefore, works right away."))),React.createElement(Ue,{title:"Meow Lightbox",className:"primary"},React.createElement(qe,{src:"".concat(f,"/common/img/meow-lightbox.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/meow-lightbox/"},"Meow Lightbox")),React.createElement("p",null,"A very sleek and performant Lightbox which will also display your EXIF data (camera, lens, aperture...). Photographers love it."))),React.createElement(Ue,{title:"Perfect Images (Retina)",className:"primary"},React.createElement(qe,{src:"".concat(f,"/common/img/wp-retina-2x.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/wp-retina-2x/"},"Perfect Images")),React.createElement("p",null,"It handles Retina, help you managing the Image Sizes registered in your WP, and much more."))),React.createElement(Ue,{title:"Contact Form Block",className:"primary"},React.createElement(qe,{src:"".concat(f,"/common/img/contact-form-block.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/contact-form-block/"},"Contact Form Block")),React.createElement("p",null,"A simple, pretty and superlight contact form. If you simply want your visitors to get in touch with you, this contact form will be perfect for you and your WordPress.")))))),React.createElement(a.Ps,{title:"Performance"},bt,React.createElement("div",{style:{display:"flex",justifyContent:"space-around",marginBottom:25}},React.createElement(at,{title:"Empty Request Time",request:"empty_request",max:2500}),React.createElement(at,{title:"File Operation Time",request:"file_operation",max:2600}),React.createElement(at,{title:"SQL Request Time",request:"sql_request",max:2800}))),React.createElement(a.Ps,{title:"Recommendations"},wt),React.createElement(a.Ps,{title:"PHP Info"},React.createElement(Ye,{dangerouslySetInnerHTML:{__html:E}})),React.createElement(a.Ps,{title:"PHP Error Logs"},React.createElement(Ze,null,React.createElement(a._Z,{style:{marginBottom:10},color:"#ccb027",onClick:_},"Load PHP Error Logs"),React.createElement(We,null,g.map((function(e){return React.createElement("li",{class:"log-".concat(e.type)},React.createElement("span",{class:"log-type"},e.type),React.createElement("span",{class:"log-date"},e.date),React.createElement("span",{class:"log-content"},e.content))}))))),React.createElement(a.Ps,{title:"Settings"},React.createElement(a.vj,{title:"Settings",className:"primary"},k,L))))))};function xt(e){return xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xt(e)}function _t(){_t=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,a){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new k(a||[]);return r(i,"_invoke",{value:E(e,n,c)}),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f={};function h(){}function m(){}function p(){}var d={};l(d,o,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(L([])));v&&v!==t&&n.call(v,o)&&(d=v);var g=p.prototype=h.prototype=Object.create(d);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function a(r,o,i,c){var l=s(e[r],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==xt(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){a("next",e,i,c)}),(function(e){a("throw",e,i,c)})):t.resolve(f).then((function(e){u.value=e,i(u)}),(function(e){return a("throw",e,i,c)}))}c(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){a(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function E(e,t,n){var r="suspendedStart";return function(a,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw o;return{value:void 0,done:!0}}for(n.method=a,n.arg=o;;){var i=n.delegate;if(i){var c=R(i,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function R(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,R(e,t),"throw"===t.method))return f;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,f;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:S}}function S(){return{value:void 0,done:!0}}return m.prototype=p,r(g,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:m,configurable:!0}),m.displayName=l(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,c,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},b(w.prototype),l(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,a,o){void 0===o&&(o=Promise);var i=new w(u(t,n,r,a),o);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(g),l(g,c,"Generator"),l(g,o,(function(){return this})),l(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=L,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return i.type="throw",i.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){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"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;_(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:L(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}function kt(e,t,n,r,a,o,i){try{var c=e[o](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,a)}function Lt(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){kt(o,r,a,i,c,"next",e)}function c(e){kt(o,r,a,i,c,"throw",e)}i(void 0)}))}}function St(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,c=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){c=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(c)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ot(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ot(e,t):void 0}}(e,t)||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 Ot(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Pt=wp.element,jt=Pt.useState,It=Pt.useEffect,Tt="".concat(u,"/meow-licenser/").concat(c,"/v1"),zt=function(){var e=St(jt(!1),2),t=e[0],n=e[1],r=St(jt(!1),2),o=r[0],i=r[1],c=St(jt(null),2),l=c[0],u=c[1],s=St(jt(null),2),f=s[0],h=s[1],y=St(jt(""),2),v=y[0],g=y[1],b=p&&(!f||"valid"!==f.license),w=function(){var e=Lt(_t().mark((function e(){var t;return _t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(m){e.next=2;break}return e.abrupt("return");case 2:return n(!0),e.next=5,(0,a.ZL)("".concat(Tt,"/get_license"),{nonce:d});case 5:t=e.sent,h(t.data),t.data.key&&g(t.data.key),n(!1);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),E=function(){var e=Lt(_t().mark((function e(){return _t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n(!0),e.next=3,(0,a.ZL)("".concat(Tt,"/set_license"),{nonce:d,json:{serialKey:null}});case 3:e.sent.success&&(g(""),h(null),u("licenseRemoved")),n(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),R=function(){var e=Lt(_t().mark((function e(){var t;return _t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n(!0),e.next=3,(0,a.ZL)("".concat(Tt,"/set_license"),{nonce:d,json:{serialKey:v,override:!0}});case 3:(t=e.sent).success&&(h(t.data),t.data&&!t.data.issue&&u("licenseAdded")),n(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),x=function(){var e=Lt(_t().mark((function e(){var t;return _t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("MEOW_OVERRIDE"!==v){e.next=5;break}return i(!0),h(null),g(""),e.abrupt("return");case 5:return n(!0),e.next=8,(0,a.ZL)("".concat(Tt,"/set_license"),{nonce:d,json:{serialKey:v}});case 8:(t=e.sent).success&&(h(t.data),t.data&&!t.data.issue&&u("licenseAdded")),n(!1);case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();It((function(){w()}),[]);var _=b?"Forced License":p?"Enabled":"Disabled",k=b||f&&"valid"===f.license,L="Your license is active. Thanks a lot for your support :)";b&&f&&f.check_url&&(L=React.createElement(React.Fragment,null,React.createElement("span",null,L),React.createElement("br",null),React.createElement("small",null,"This license was enabled manually. To check your license status, please click ",React.createElement("a",{target:"_blank",href:f.check_url+"&cache="+642e3*Math.random()},"here"),"."))),k||(f?"no_activations_left"===f.issue?L=React.createElement("span",null,"There are no activations left for this license. You can visit your account at the ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com"},"Meow Apps Store"),", unregister a site, and click on ",React.createElement("i",null,"Retry to validate"),"."):"expired"===f.issue?L=React.createElement("span",null,"Your license has expired. You can get another license or renew the current one by visiting your account at the ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com"},"Meow Apps Store"),"."):"missing"===f.issue?L="This license does not exist.":"disabled"===f.issue?L="This license has been disabled.":"item_name_mismatch"===f.issue?L="This license seems to be for a different plugin... isn't it? :)":"forced"===f.issue?L="ABC":(L=React.createElement("span",null,"There is an unknown error related to the system or this serial key. Really sorry about this! Make sure your security plugins and systems are off temporarily. If you are still experiencing an issue, please ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com/contact/"},"contact us"),"."),console.error({license:f})):L="Unknown error :(");var S=React.createElement(a.vj,{title:"Pro Version (Not Installed)",className:"primary"},"You will find more information about the Pro Version ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com"},"here"),". If you actually bought the Pro Version already, please remove the current plugin and download the Pro Version from your account at the ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com/"},"Meow Apps Store"),"."),O=React.createElement(a.vj,{title:"Pro Version (".concat(_,")"),busy:t,className:"primary"},React.createElement(a.rR,{title:"Serial Key",style:{fontWeight:"bold"}},React.createElement(a.Ay,{id:"mfrh_pro_serial",name:"mfrh_pro_serial",disabled:t,value:v,onChange:function(e){return g(e)},placeholder:""})),f&&!k&&React.createElement(a.Ge,null,L),f&&k&&React.createElement(a.CA,null,L),!f&&React.createElement(a.O9,{p:!0},"Insert your serial key above. If you don't have one yet, you can get one ",React.createElement("a",{href:"https://meowapps.com"},"here"),". If there was an error during the validation, try the ",React.createElement("i",null,"Retry")," to ",React.createElement("i",null,"validate")," button."),React.createElement(a.rR,{contentAlign:"right"},f&&!k&&React.createElement(a._Z,{className:"secondary",disabled:t||!v,onClick:x},"Retry to validate"),f&&f.key===v&&React.createElement(a._Z,{className:"secondary",disabled:t||!v,onClick:E},"Remove License"),React.createElement(a._Z,{disabled:t||!v||f&&f.key===v,onClick:x},"Validate License"),o&&!k&&React.createElement(a._Z,{disabled:t||!v||f&&f.key===v,onClick:R,className:"danger"},"Force License")),React.createElement(a.LI,{isOpen:"licenseAdded"===l,title:"Thank you :)",content:"The Pro features have been enabled. This page should be now reloaded.",ok:"Reload",onOkClick:function(){return location.reload()}}),React.createElement(a.LI,{isOpen:"licenseRemoved"===l,title:"Goodbye :(",content:"The Pro features have been disabled. This page should be now reloaded.",ok:"Reload",onOkClick:function(){return location.reload()}}));return m?O:S},At=wp.element.render;function Ct(e){return Ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ct(e)}function Nt(e){return function(e){if(Array.isArray(e))return Yt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||qt(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ft(){Ft=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,a){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new k(a||[]);return r(i,"_invoke",{value:E(e,n,c)}),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f={};function h(){}function m(){}function p(){}var d={};l(d,o,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(L([])));v&&v!==t&&n.call(v,o)&&(d=v);var g=p.prototype=h.prototype=Object.create(d);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function a(r,o,i,c){var l=s(e[r],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==Ct(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){a("next",e,i,c)}),(function(e){a("throw",e,i,c)})):t.resolve(f).then((function(e){u.value=e,i(u)}),(function(e){return a("throw",e,i,c)}))}c(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){a(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function E(e,t,n){var r="suspendedStart";return function(a,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw o;return{value:void 0,done:!0}}for(n.method=a,n.arg=o;;){var i=n.delegate;if(i){var c=R(i,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function R(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,R(e,t),"throw"===t.method))return f;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,f;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function L(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:S}}function S(){return{value:void 0,done:!0}}return m.prototype=p,r(g,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:m,configurable:!0}),m.displayName=l(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,c,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},b(w.prototype),l(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,a,o){void 0===o&&(o=Promise);var i=new w(u(t,n,r,a),o);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(g),l(g,c,"Generator"),l(g,o,(function(){return this})),l(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=L,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return i.type="throw",i.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){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"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;_(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:L(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}function Dt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Dt(Object(n),!0).forEach((function(t){Gt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Gt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mt(e,t,n,r,a,o,i){try{var c=e[o](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,a)}function Zt(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){Mt(o,r,a,i,c,"next",e)}function c(e){Mt(o,r,a,i,c,"throw",e)}i(void 0)}))}}function Ut(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,c=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){c=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(c)throw a}}return o}}(e,t)||qt(e,t)||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 qt(e,t){if(e){if("string"==typeof e)return Yt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yt(e,t):void 0}}function Yt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}document.meowDashboardLoaded||(document.meowDashboardLoaded=!0,document.addEventListener("DOMContentLoaded",(function(e){var t=document.getElementById("meow-common-dashboard");t&&At(React.createElement(Rt,null),t)})));var Wt=wp.element,Ht=Wt.useState,Qt=Wt.useEffect,$t=function(e,t){if(0==e)return"0 Bytes";var n=t||2,r=Math.floor(Math.log(e)/Math.log(1e3));return parseFloat((e/Math.pow(1e3,r)).toFixed(n))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][r]},Jt=function(){var e=Ut(Ht(!1),2),t=e[0],n=e[1],r=Ut(Ht(null),2),o=r[0],i=r[1],u=Ut(Ht(null),2),f=u[0],h=u[1],g=Ut(Ht(v),2),b=g[0],w=g[1],E=t,R=b.method,x=b.sizes,_=b.retina_sizes,k=b.disabled_sizes,L=b.full_size,S=b.picturefill_keep_src,O=b.picturefill_lazysizes,P=b.picturefill_css_background,j=b.picturefill_noscript,I=b.auto_generate,T=b.over_http_check,z=b.debug,A=b.disable_responsive,C=b.cdn_domain,N=b.big_image_size_threshold,F=b.module_retina_enabled,D=b.module_optimize_enabled,B=b.module_ui_enabled,G=b.hide_retina_column,M=b.hide_retina_dashboard,Z=b.hide_optimize,U=b.image_replace,q=b.easyio_domain,Y=b.easyio_lossless,W="none"===R,H=function(){var e=Zt(Ft().mark((function e(t,r){var o,i;return Ft().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=Bt(Bt({},b),{},Gt({},r,t)),n(!0),e.prev=2,e.next=5,(0,a.ZL)("".concat(s,"/update_option"),{json:{options:o},nonce:d});case 5:(i=e.sent).success&&w(i.options),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),alert(e.t0.message);case 12:n(!1);case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t,n){return e.apply(this,arguments)}}(),Q=function(){var e=Zt(Ft().mark((function e(){var t;return Ft().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n(!0),e.prev=1,e.next=4,(0,a.wY)("".concat(s,"/all_settings"),null,null,d);case 4:(t=e.sent).success&&w(t.data),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),alert(e.t0.message);case 11:n(!1);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(){return e.apply(this,arguments)}}(),$=[{value:"Responsive",label:React.createElement("span",null,"Responsive Images")},{value:"Picturefill",label:React.createElement("span",null,"Picturefill (Hybrid)")},{value:"retina.js",label:React.createElement("span",null,"Retina.js (Client-side)")},{value:"HTML Rewrite",label:React.createElement("span",null,"HTML Rewrite (Not Recommended)")},{value:"Retina-Images",label:React.createElement("span",null,"Retina-Images (Not Recommended)")},{value:"none",label:React.createElement("span",null,"None")}],J=function(){var e=Zt(Ft().mark((function e(){var t;return Ft().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!q){e.next=7;break}return e.next=4,(0,a.ZL)("".concat(s,"/easy_io_stats"),{nonce:d});case 4:null!=(t=e.sent)&&t.stats.original&&null!=t&&t.stats.savings&&i(t.stats),null!=t&&t.stats.bandwidth&&null!=t&&t.stats.quota&&h(t.stats);case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),alert(e.t0.message);case 12:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(){return e.apply(this,arguments)}}();Qt((function(){J()}),[q]);var K=function(){var e=Zt(Ft().mark((function e(t,n){var r;return Ft().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t?Nt(k.filter((function(e){return e!==n}))):[].concat(Nt(k),[n]),H(r,"disabled_sizes");case 2:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),V=function(){var e=Zt(Ft().mark((function e(t,n){var r;return Ft().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t?[].concat(Nt(_),[n]):Nt(_.filter((function(e){return e!==n}))),H(r,"retina_sizes");case 2:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),X=function(){var e=Zt(Ft().mark((function e(){return Ft().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n(!0),e.prev=1,e.next=4,(0,a.ZL)("".concat(s,"/easy_io_link"),{nonce:d});case 4:e.sent,Q(),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),alert(e.t0.message);case 11:n(!1);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(){return e.apply(this,arguments)}}(),ee=function(){var e=Zt(Ft().mark((function e(){return Ft().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n(!0),e.prev=1,e.next=4,(0,a.ZL)("".concat(s,"/easy_io_unlink"),{nonce:d});case 4:e.sent,Q(),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),alert(e.t0.message);case 11:n(!1);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(){return e.apply(this,arguments)}}(),te=React.createElement(a.rR,null,React.createElement("table",{style:{width:"100%"}},React.createElement("thead",null,React.createElement("tr",null,React.createElement("th",{style:{textAlign:"left"}}),React.createElement("th",{style:{textAlign:"left"}},"Name"),React.createElement("th",{style:{textAlign:"left"}},"Dimensions"),React.createElement("th",{style:{textAlign:"left"}},"Retina"))),React.createElement("tbody",null,x&&x.map((function(e){return React.createElement("tr",{key:"sizes-"+e.name},React.createElement("td",null,e.shortname),React.createElement("td",{style:{color:"#007cb9"}},e.name),React.createElement("td",null,e.width?React.createElement(React.Fragment,null,e.width,"x",e.height):React.createElement("small",null,"Unknown (disabled)")),React.createElement("td",null,React.createElement(a.PQ,{id:"retina-"+e.name,disabled:E||!e.enabled,value:"1",checked:e.retina,onChange:function(){return V(!e.retina,e.name)}})))}))))),ne=React.createElement(a.rR,null,React.createElement("table",{style:{width:"100%"}},React.createElement("thead",null,React.createElement("tr",null,React.createElement("th",{style:{textAlign:"left"}}),React.createElement("th",{style:{textAlign:"left"}},"Name"),React.createElement("th",{style:{textAlign:"left"}},"Dimensions"),React.createElement("th",{style:{textAlign:"left"}},"Enabled"))),React.createElement("tbody",null,x&&x.map((function(e){return React.createElement("tr",{key:"sizes-"+e.name},React.createElement("td",null,e.shortname),React.createElement("td",{style:{color:"#007cb9"}},e.name),React.createElement("td",null,e.width?React.createElement(React.Fragment,null,e.width,"x",e.height):React.createElement("small",null,"Unknown (disabled)")),React.createElement("td",null,React.createElement(a.PQ,{id:"enabled-"+e.name,disabled:E,value:"1",checked:e.enabled,onChange:function(){return K(!e.enabled,e.name)}})))}))))),re=React.createElement(a.rR,{title:"Delivery Method"},React.createElement(a.Np,{scrolldown:!0,id:"method",name:"method",disabled:E,value:R,description:"",onChange:H},$.map((function(e){return React.createElement(a.ZB,{key:e.id,id:e.id,value:e.value,label:e.label,requirePro:e.requirePro})})))),ae=React.createElement(a.rR,{title:"Full-Size Retina"},React.createElement(a.PQ,{id:"full_size",disabled:E,label:"Enable",description:React.createElement(React.Fragment,null,"Enable Retina for Full-Size. A ",React.createElement("i",null,"Upload Retina for Full-Size")," button is also added in the ",React.createElement("i",null,"Perfect Images Dashboard"),"."),value:"1",requirePro:!p,checked:L,onChange:H})),oe=React.createElement(a.rR,{title:"Keep IMG SRC"},React.createElement(a.PQ,{id:"picturefill_keep_src",disabled:E,label:"Enable",description:React.createElement(React.Fragment,null,"With PictureFill, ",React.createElement("b",null,"src")," tags are replaced by ",React.createElement("b",null,"src-set")," tags, but Google might fail to reference those images. This option will keep the SRC for SEO purpose, but that will force the download of two images (standard, then retina) by the browsers. Please use the ",React.createElement("b",null,"Lazy Retina")," option below as it avoid this to happen (as well as making it loading lazily)."),value:"1",checked:S,onChange:H})),ie=React.createElement(a.rR,{title:"Responsive Images"},React.createElement(a.PQ,{id:"picturefill_lazysizes",disabled:E,label:"Enable Lazy",description:React.createElement(React.Fragment,null,"Images (including Retina Images) will not be loaded until the visitor gets closer to them. The result will be a ",React.createElement("b",null,"faster")," website that consumes less bandwidth."),value:"1",requirePro:!p,checked:O,onChange:H})),ce=React.createElement(a.rR,{title:"CSS Background"},React.createElement(a.PQ,{id:"picturefill_css_background",disabled:E,label:"Retina-ize",description:React.createElement(React.Fragment,null,"In your HTML, inline CSS Background will be replaced by the Retina version of the image."),value:"1",requirePro:!p,checked:P,onChange:H})),le=React.createElement(a.rR,{title:"Polyfill Script"},React.createElement(a.PQ,{id:"picturefill_noscript",disabled:E,label:"Do not load",description:React.createElement(React.Fragment,null,"Only ",React.createElement("a",{rel:"noreferrer",target:"_blank",href:"https://caniuse.com/srcset"},"the browsers with src-set support")," will display Retina images. You can also choose this if you want to load the Picturefill Polyfill script manually or if it is already loaded by your theme."),value:"1",checked:j,onChange:H})),ue=React.createElement(a.rR,{title:"Retina Images"},React.createElement(a.PQ,{id:"auto_generate",disabled:E,label:"Build Automatically",description:React.createElement(React.Fragment,null,"The Retina Images will be built automatically every time the thumbnails as generated or regenerated."),value:"1",checked:I,onChange:H})),se=React.createElement(a.rR,{title:"Over HTTP Check"},React.createElement(a.PQ,{id:"over_http_check",disabled:E,label:"Enable",description:React.createElement(React.Fragment,null,"This will check the existence of retina images on remote servers. This is useful if your images are hosted on a different server than your WordPress. ",T?React.createElement("b",null,"This option slows down processing dramatically; therefore, caching is absolutely necessary."):""),value:"1",requirePro:!p,checked:!W&&T,onChange:H})),fe=React.createElement(a.rR,{title:"Debug"},React.createElement(a.PQ,{id:"debug",disabled:E,label:"Force Retina + Logging",description:React.createElement(React.Fragment,null,"Displays retina and creates a log file in the plugin folder."),value:"1",checked:z,onChange:H})),he=React.createElement(a.rR,{title:"Responsive Images"},React.createElement(a.PQ,{id:"disable_responsive",disabled:E,label:"Disable",description:React.createElement(React.Fragment,null,"Disable the natural Responsive Images feature built in WordPress. For developers only."),value:"1",checked:A,onChange:H})),me=React.createElement(a.rR,{title:"CDN Domain",requirePro:!p},React.createElement(a.Ay,{id:"cdn_domain",type:"text",disabled:E,value:C,onEnter:H,onBlur:H,description:React.createElement(React.Fragment,null,"If not empty, your site domain will be replaced with this CDN domain.")})),pe=React.createElement(React.Fragment,null,React.createElement(a.rR,{title:"Status"},React.createElement("div",{style:{display:"flex",flexDirection:"column"}},React.createElement("div",{style:{marginBottom:5}},React.createElement(a.O9,null,q&&React.createElement("div",null,React.createElement("b",null,"Easy IO is active."),React.createElement("br",null),React.createElement("small",null,"This is your CDN domain: ",q,".")),!q&&React.createElement("b",null,"Not linked with Easy IO."),!q&&React.createElement("ul",null,React.createElement("li",null,"1. Check the offer and create your account at ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://ewww.io/easy-perfect/ref/6/?campaign=EasyPerfect"},"Perfect Images + Easy IO"),"."),React.createElement("li",null,"2. Use the [",React.createElement("b",null,"PERFECT20"),"] coupon and you will get ",React.createElement("b",null,"20% off"),"."),React.createElement("li",null,"3. Register this website [",React.createElement("b",null,y),"] in the ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://ewww.io/manage-sites/"},"Easy IO Dashboard"),"."),React.createElement("li",null,"4. Click on the button below, and it's all done! 🏁")))),q&&React.createElement("div",null,React.createElement(a._Z,{className:"danger",onClick:ee},"Disable Easy IO")),!q&&React.createElement("div",null,React.createElement(a._Z,{onClick:X},"Verify & Enable Easy IO"))))),de=q?React.createElement(a.rR,{title:"Stats"},React.createElement("div",{style:{display:"flex",flexDirection:"column",fontSize:14}},React.createElement(a.O9,null,React.createElement("span",null,"Bandwidth Usage: "),!f&&React.createElement("span",null,"N/A"),f&&React.createElement("span",null,$t(f.bandwidth)," of ",$t(f.quota)," (",Math.round(f.bandwidth/f.quota*100)+"%",")")),React.createElement(a.O9,null,React.createElement("span",null,"Image Size Reduction: "),!o&&React.createElement("span",null,"N/A"),o&&React.createElement("span",null,Math.round(o.savings/o.original*100)+"%")))):null,ye=q?React.createElement(a.rR,{title:"Lossless Quality"},React.createElement(a.PQ,{id:"easyio_lossless",disabled:!q||E,label:"Enable",description:React.createElement(React.Fragment,null,"Make sure that the visual quality of your images is the same as the original, while still being optimized."),value:"1",checked:Y,onChange:H})):null,ve=React.createElement(a.rR,{title:"Image Threshold"},React.createElement(a.PQ,{id:"big_image_size_threshold",disabled:E,label:"Disable",value:"1",checked:N,onChange:H})),ge=React.createElement(React.Fragment,null,React.createElement(a.rR,{title:"Retina"},React.createElement(a.PQ,{id:"module_retina_enabled",disabled:E,label:"Enabled",value:"1",checked:F,onChange:H})),React.createElement(a.rR,{title:"Optimize"},React.createElement(a.PQ,{id:"module_optimize_enabled",disabled:E,label:"Enabled",value:"1",checked:D,onChange:H})),React.createElement(a.rR,{title:"UI"},React.createElement(a.PQ,{id:"module_ui_enabled",disabled:E,label:"Enabled",value:"1",checked:B,onChange:H}))),be=React.createElement(a.rR,{title:"Image Replace"},React.createElement(a.PQ,{id:"image_replace",disabled:E,label:"Enable",description:React.createElement(React.Fragment,null,"You will then be able to drag & drop an image to replace another in the Perfect Images Dashboard."),requirePro:!p,value:"1",checked:U,onChange:H})),we=React.createElement(a.rR,{title:"Retina Column"},React.createElement(a.PQ,{id:"hide_retina_column",disabled:E,label:"Enable",description:React.createElement(React.Fragment,null,"Add a ",React.createElement("i",null,"Retina")," column in the Media Library."),value:"1",checked:!G,onChange:function(e,t){return H(!e,t)}})),Ee=React.createElement(a.rR,{title:"Dashboard"},React.createElement(a.PQ,{id:"hide_retina_dashboard",disabled:E,label:"Enable",description:React.createElement(React.Fragment,null,"Activate the ",React.createElement("i",null,"Perfect Images Dashboard"),". From there, you can do lot of things!"),value:"1",checked:!M,onChange:function(e,t){return H(!e,t)}})),Re=React.createElement(a.rR,{title:"Optimize Features"},React.createElement(a.PQ,{id:"hide_optimize",disabled:!0,label:"Enable (Beta)",description:React.createElement(React.Fragment,null,"Show the ",React.createElement("i",null,"Optimize Column")," and the related buttons in the Media Library. Those features will work with the binaries and libraries provided by your server, if available."),value:"1",checked:!Z,onChange:function(e,t){return H(!e,t)}}));return React.createElement(a.si,null,React.createElement(a.BP,{title:"Perfect Images + Retina | Settings",subtitle:"By Jordy Meow"},React.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},React.createElement(a._Z,{className:"header",onClick:function(){return window.open("https://meowapps.com/wp-retina-2x-tutorial/","_blank")}},"Tutorial"),!M&&React.createElement(a._Z,{icon:"dashboard",className:"header",onClick:function(){return location.href="admin.php?page=wr2x_dashboard"}},"Dashboard"))),React.createElement(a.oY,null,React.createElement(a.zc,{full:!0},React.createElement(a.Hq,null,React.createElement(a.O9,{p:!0},"Perfect Images works out of the box. However, to make your install really nice and smooth, you should really take a look at the ",React.createElement("a",{rel:"noreferrer",target:"_blank",href:"https://meowapps.com/wp-retina-2x-tutorial/"},"tutorial"),". Take a bit of time and you will enjoy managing your images with WordPress even more! :)")),React.createElement(a.c4,null,React.createElement(a.Ps,{title:"General"},React.createElement(a.oY,null,React.createElement(a.zc,{minimal:!0},React.createElement(a.vj,{busy:E,title:"Image Sizes",className:"primary"},React.createElement(a.O9,{p:!0},"In this screen, you can disable sizes not only the default sizes added by WordPress, but also the ones added by your theme or other plugins."),ne)),React.createElement(a.zc,{minimal:!0},React.createElement(a.vj,{busy:E,title:"Big Image Threshold",className:"primary"},React.createElement(a.O9,{p:!0},"Since WordPress 5.3, images bigger than 2560px are resized automatically and renamed with ",React.createElement("i",null,"-scaled"),". To learn more about this, have a look at this article: ",React.createElement("a",{rel:"noreferrer",target:"_blank",href:"https://meowapps.com/wordpress-images-sizes/#The_Big_Image_Treshold"},"The WordPress Image Sizes"),"."),ve),React.createElement(a.vj,{busy:E,title:"Modules",className:"primary"},ge)))),B&&React.createElement(a.Ps,{title:"UI"},React.createElement(a.oY,null,React.createElement(a.zc,{minimal:!0},React.createElement(a.vj,{busy:E,title:"UI Features",className:"primary"},Ee,we,Re,be)),React.createElement(a.zc,{minimal:!0}))),F&&React.createElement(a.Ps,{title:"Retinize"},React.createElement(a.oY,null,React.createElement(a.zc,{minimal:!0},React.createElement(a.vj,{busy:E,title:"Image Sizes",className:"primary"},React.createElement(a.O9,{p:!0},"For each of those sizes, you can choose whether or not you would like the Retina image to be generated for it."),te,ue),React.createElement(a.vj,{busy:E,title:"For Full Size",className:"primary"},ae)),React.createElement(a.zc,{minimal:!0},React.createElement(a.vj,{busy:E,title:"Basics",className:"primary"},React.createElement(a.O9,{p:!0},"This controls how the retina images are integrated into your content and delivered to your visitors. The ",React.createElement("b",null,"Responsive Images")," method is recommended. If your theme and plugins are not using WordPress latest evolutions, you might have to try ",React.createElement("b",null,"PictureFill")," or ",React.createElement("b",null,"Retina.js"),"."),re,se)),"Picturefill"===R&&React.createElement(a.zc,{minimal:!0},React.createElement(a.vj,{busy:E,title:"PictureFill",className:"primary"},oe,ce,le)))),D&&React.createElement(a.Ps,{title:"Optimize"},React.createElement(a.oY,null,React.createElement(a.zc,{minimal:!0},React.createElement(a.vj,{busy:E,title:"Perfect Images + Easy IO",className:"primary"},!q&&React.createElement(a.O9,{p:!0},"Are you interested in optimizing your images (including WebP) without slowing down your own server, while using a powerful CDN? This all-in-one solution now exists and is very affordable thanks to an unique partnership between Meow Apps and Easy IO (EWWW). More information is available ",React.createElement("a",{target:"_blank",href:"https://meowapps.com/wp-retina-2x-tutorial/#Optimize_your_Images_and_Use_a_CDN"},"here"),"."),pe,de,ye)),React.createElement(a.zc,{minimal:!0},React.createElement(a.vj,{busy:E,title:"Lazy Loading",className:"primary"},React.createElement(a.O9,{p:!0},"Since WordPress 5.5, images are automatically lazy, and it is also using a feature included in the modern browser. It is recommended to use this new feature instead of customized one (through other plugins, or this option) since it is using no script and does not require any modification. If there is an problem with it, you can still enable the option below."),ie)))),React.createElement(a.Ps,{title:"Advanced"},React.createElement(a.oY,null,React.createElement(a.zc,{minimal:!0},React.createElement(a.vj,{busy:E,className:"primary"},he,fe)),React.createElement(a.zc,{minimal:!0},React.createElement(a.vj,{busy:E,className:"primary"},React.createElement(a.O9,{p:!0},"If you are using a CDN, enter your CDN subdomain here. If you are using Easy IO CDN, you don't need this, and you can directly use the options available in ",React.createElement("i",null,"Optimization & Speed"),"."),me)))),React.createElement(a.Ps,{title:"Pro Version"},React.createElement(zt,{domain:l,prefix:c,isPro:m,isRegistered:p}))))))},Kt=function(){return React.createElement(React.Fragment,null,React.createElement("h1",{style:{marginTop:20}},"Upload New Retina Image"),React.createElement("p",null,"The Retina Image you upload here will become your Retina Image for Full-Size. Automatically, WP Retina 2x will generate the normal Full-Size image which will be basically divided by two. The thumbnails and retina thumbnails will also be generated based on your options. ",React.createElement("b",null,"For now, this uploader only works with one by one file.")),React.createElement(a.Ii,{style:{border:"4px dashed #b4b9be"},height:200,onFailure:function(e){alert(e.message)},onSuccess:function(){alert("Uploaded!")},apiUrl:"".concat(s,"/upload_retina"),apiConfig:{nonce:d}}))},Vt=wp.element.render,Xt={fetcher:a.SG,revalidateOnFocus:!1};function en(){Array.from(document.getElementsByClassName("wr2x-retina-field")).forEach((function(e){var t=e.getAttribute("data-id");Vt(React.createElement(r.J$,{value:Xt},React.createElement(pe,{natural:!0,mediaId:t})),e)}))}document.addEventListener("DOMContentLoaded",(function(){var e,t;new window.MutationObserver((function(){en()})).observe(document.documentElement,{childList:!0,subtree:!0}),(e=document.getElementById("wr2x-admin-settings"))&&Vt(React.createElement(r.J$,{value:Xt},React.createElement(Jt,null)),e),(t=document.getElementById("wr2x-dashboard"))&&Vt(React.createElement(r.J$,{value:Xt},React.createElement($,null,React.createElement(Ge,null))),t),en(),function(){var e=document.getElementById("wr2x-fullsize-uploader");e&&Vt(React.createElement(r.J$,{value:Xt},React.createElement(Kt,null)),e)}()}))},7363:function(e){e.exports=React},1533:function(e){e.exports=ReactDOM}},n={};function r(e){var a=n[e];if(void 0!==a)return a.exports;var o=n[e]={exports:{}};return t[e](o,o.exports,r),o.exports}r.m=t,r.amdO={},e=[],r.O=function(t,n,a,o){if(!n){var i=1/0;for(s=0;s<e.length;s++){n=e[s][0],a=e[s][1],o=e[s][2];for(var c=!0,l=0;l<n.length;l++)(!1&o||i>=o)&&Object.keys(r.O).every((function(e){return r.O[e](n[l])}))?n.splice(l--,1):(c=!1,o<i&&(i=o));if(c){e.splice(s--,1);var u=a();void 0!==u&&(t=u)}}return t}o=o||0;for(var s=e.length;s>0&&e[s-1][2]>o;s--)e[s]=e[s-1];e[s]=[n,a,o]},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={826:0};r.O.j=function(t){return 0===e[t]};var t=function(t,n){var a,o,i=n[0],c=n[1],l=n[2],u=0;if(i.some((function(t){return 0!==e[t]}))){for(a in c)r.o(c,a)&&(r.m[a]=c[a]);if(l)var s=l(r)}for(t&&t(n);u<i.length;u++)o=i[u],r.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return r.O(s)},n=self.wpJsonWr2x=self.wpJsonWr2x||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}(),r.nc=void 0;var a=r.O(void 0,[736],(function(){return r(4533)}));a=r.O(a)}();
3
  //# sourceMappingURL=index.js.map
1
  /*! For license information please see index.js.LICENSE.txt */
2
+ !function(){"use strict";var e,t={9714:function(e,t,n){n.d(t,{Ay:function(){return m.A},BP:function(){return y.B},CA:function(){return R.C},CB:function(){return P.ZP},Fq:function(){return j.Fq},Ge:function(){return R.G},Hq:function(){return l.H},Ii:function(){return x.I},JH:function(){return g.J},LI:function(){return k.L},Ln:function(){return I.Ln},Np:function(){return p.N},O9:function(){return b.O},P$:function(){return O.P},PQ:function(){return f.P},Ps:function(){return L.P},Qo:function(){return v.Q},SG:function(){return I.SG},Sx:function(){return w.S},UJ:function(){return d.U},ZB:function(){return p.Z},ZL:function(){return I.ZL},_Z:function(){return a._},_h:function(){return E._},aR:function(){return S.a},c4:function(){return L.c},cf:function(){return j.cf},h:function(){return w.h},jh:function(){return o.j},lQ:function(){return h.l},oY:function(){return s.o},pK:function(){return o.p},qj:function(){return j.qj},rR:function(){return u.r},si:function(){return i.s},u0:function(){return _.u},vg:function(){return r.Z},vj:function(){return c.v},wY:function(){return I.wY},zc:function(){return s.z}});var r=n(5833),a=n(7818),o=n(6071),i=n(1254),c=n(537),l=n(9137),u=n(749),s=(n(3534),n(5979)),f=n(4694),h=n(1630),m=n(1492),p=(n(3895),n(3565)),d=(n(5235),n(9378),n(9422),n(4696),n(8725),n(8281)),y=n(7172),v=n(776),g=n(6536),b=n(6160),w=n(3103),E=n(8406),R=n(3506),x=n(7198),_=(n(2625),n(8519)),k=(n(5307),n(3545),n(1203)),S=(n(858),n(3676)),L=n(1488),O=(n(8263),n(5231)),P=n(9995),j=n(4291),I=n(5149)},4533:function(e,t,n){var r=n(8100),a=n(9714),o=n(2788),i=n(7363),c=wr2x_retina.prefix,l=wr2x_retina.domain,u=wr2x_retina.rest_url.replace(/\/+$/,""),s=wr2x_retina.api_url.replace(/\/+$/,""),f=wr2x_retina.plugin_url.replace(/\/+$/,""),h=wr2x_retina.upload_url.replace(/\/+$/,""),m="1"===wr2x_retina.is_pro,p=m&&"1"===wr2x_retina.is_registered,d=wr2x_retina.rest_nonce,y=(wr2x_retina.home_url.replace(/\/+$/,""),wr2x_retina.site_url.replace(/\/+$/,"")),v=wr2x_retina.options;function g(e){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g(e)}function b(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,c=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){c=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(c)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return w(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?w(e,t):void 0}}(e,t)||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 w(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function E(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function R(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?E(Object(n),!0).forEach((function(t){x(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):E(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function x(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _(){_=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,a){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new L(a||[]);return r(i,"_invoke",{value:R(e,n,c)}),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f={};function h(){}function m(){}function p(){}var d={};l(d,o,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(O([])));v&&v!==t&&n.call(v,o)&&(d=v);var b=p.prototype=h.prototype=Object.create(d);function w(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function a(r,o,i,c){var l=s(e[r],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==g(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){a("next",e,i,c)}),(function(e){a("throw",e,i,c)})):t.resolve(f).then((function(e){u.value=e,i(u)}),(function(e){return a("throw",e,i,c)}))}c(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){a(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function R(e,t,n){var r="suspendedStart";return function(a,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw o;return{value:void 0,done:!0}}for(n.method=a,n.arg=o;;){var i=n.delegate;if(i){var c=x(i,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function x(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return f;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,f;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function O(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:P}}function P(){return{value:void 0,done:!0}}return m.prototype=p,r(b,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:m,configurable:!0}),m.displayName=l(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,c,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},w(E.prototype),l(E.prototype,i,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,a,o){void 0===o&&(o=Promise);var i=new E(u(t,n,r,a),o);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},w(b),l(b,c,"Generator"),l(b,o,(function(){return this})),l(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=O,L.prototype={constructor:L,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return i.type="throw",i.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){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"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;S(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:O(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}function k(e,t,n,r,a,o,i){try{var c=e[o](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,a)}function S(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){k(o,r,a,i,c,"next",e)}function c(e){k(o,r,a,i,c,"throw",e)}i(void 0)}))}}var L,O,P={issues:"-",ignored:"-",all:"-",optimizeIssues:"-"},j=0,I={filterBy:"all",page:1,limit:10,busy:!1,stats:P,sort:{accessor:"id",by:"asc"},search:"",apiErrors:null,status:"",entries:[],totalEntries:0,options:v,wr2xSizes:v.sizes,wr2xRetinaSizes:v.retina_sizes,wr2xDisabledSizes:v.disabled_sizes,wr2xMethod:v.method,wr2xFullSize:v.full_size,wr2xPicturefillKeepSrc:v.picturefill_keep_src,wr2xPicturefillLazysizes:v.picturefill_lazysizes,wr2xPicturefillCssBackground:v.picturefill_css_background,wr2xPicturefillNoscript:v.picturefill_noscript,wr2xAutoGenerate:v.auto_generate,wr2xOverHttpCheck:v.over_http_check,wr2xDebug:v.debug,wr2xDisableResponsive:v.disable_responsive,wr2xImageReplace:v.image_replace,wr2xCdnDomain:v.cdn_domain,wr2xEasyioDomain:v.easyio_domain,wr2xEasyioLossless:v.easyio_lossless,wr2xBigImageSizeThreshold:v.big_image_size_threshold,wr2xHideRetinaColumn:v.hide_retina_column,wr2xHideRetinaDashboard:v.hide_retina_dashboard,wr2xHideOptimize:v.hide_optimize,modals:{uploadRetinaFullsize:!1},mutateEntries:(O=S(_().mark((function e(){return _().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(){return O.apply(this,arguments)}),mutateStats:(L=S(_().mark((function e(){return _().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case"end":return e.stop()}}),e)}))),function(){return L.apply(this,arguments)})},T="PAGE_UPDATED",z="LIMIT_UPDATED",A="FILTER_UPDATED",C="SORT_UPDATED",N="SEARCH_UPDATED",F="TOGGLE_MODAL",D="PUSH_BUSY",B="POP_BUSY",G="ENTRIES_UPDATED",M="TOTAL_ENTRIES_UPDATED",Z="STATS_UPDATED",U="STATUS_UPDATED",q="ERROR_UPDATED",Y="SET_ENTRIES_MUTATE",W="SET_STATS_MUTATE",H=function(e,t){switch(t.type){case G:var n=t.entries;return R(R({},e),{},{entries:n});case M:var r=t.totalEntries;return R(R({},e),{},{totalEntries:r});case Z:var a=t.stats;return R(R({},e),{},{stats:a});case"SETTINGS_UPDATED":var o,i,c,l,u,s,f,h,m,p,d,y,v,g,b,w,E,x,_=t.options,k=null!==(o=_.sizes)&&void 0!==o?o:[],S=_.retina_sizes,L=_.disabled_sizes,O=_.method,P=null!==(i=_.full_size)&&void 0!==i&&i,H=null!==(c=_.picturefill_keep_src)&&void 0!==c&&c,Q=null!==(l=_.picturefill_lazysizes)&&void 0!==l&&l,$=null!==(u=_.picturefill_css_background)&&void 0!==u&&u,J=null!==(s=_.picturefill_noscript)&&void 0!==s&&s,K=null!==(f=_.auto_generate)&&void 0!==f&&f,V=null!==(h=_.over_http_check)&&void 0!==h&&h,X=null!==(m=_.debug)&&void 0!==m&&m,ee=null!==(p=_.disable_responsive)&&void 0!==p&&p,te=null!==(d=_.image_replace)&&void 0!==d&&d,ne=null!==(y=_.cdn_domain)&&void 0!==y?y:"",re=null!==(v=_.easyio_domain)&&void 0!==v?v:"",ae=null!==(g=_.easyio_lossless)&&void 0!==g?g:"",oe=null!==(b=_.big_image_size_threshold)&&void 0!==b&&b,ie=null!==(w=_.hide_retina_column)&&void 0!==w&&w,ce=null!==(E=_.hide_retina_dashboard)&&void 0!==E&&E,le=null!==(x=_.hide_optimize)&&void 0!==x&&x,ue=ie?"all":"issues";return R(R({},e),{},{options:_,wr2xSizes:k,wr2xRetinaSizes:S,wr2xDisabledSizes:L,wr2xMethod:O,wr2xFullSize:P,wr2xPicturefillKeepSrc:H,wr2xPicturefillLazysizes:Q,wr2xPicturefillCssBackground:$,wr2xPicturefillNoscript:J,wr2xAutoGenerate:K,wr2xOverHttpCheck:V,wr2xDebug:X,wr2xDisableResponsive:ee,wr2xImageReplace:te,wr2xCdnDomain:ne,wr2xEasyioDomain:re,wr2xEasyioLossless:ae,wr2xBigImageSizeThreshold:oe,wr2xHideRetinaColumn:ie,wr2xHideRetinaDashboard:ce,wr2xHideOptimize:le,filterBy:ue});case q:var se=t.apiErrors;return R(R({},e),{},{apiErrors:se});case T:var fe=t.page;return R(R({},e),{},{page:fe});case Y:var he=t.mutateEntries;return R(R({},e),{},{mutateEntries:he});case W:var me=t.mutateStats;return R(R({},e),{},{mutateStats:me});case z:var pe=t.limit;return R(R({},e),{},{limit:pe});case A:var de=t.filter;return R(R({},e),{},{filterBy:de});case C:var ye=t.sort;return R(R({},e),{},{sort:ye});case N:var ve=t.search;return R(R({},e),{},{search:ve});case U:var ge=t.status;return R(R({},e),{},{status:ge});case F:var be=t.modal,we=t.enable;if(!be){var Ee=R({},e);return Ee.modals=R({},I.modals),Ee}if(void 0===e.modals[be])return alert("The modal ".concat(be," doesn't exist.")),e;void 0===we&&(we=!e.modals[be]);var Re=R({},e);return Re.modals=R({},Re.modals),Re.modals[be]=we,Re;case D:return R(R({},e),{},{busy:++j>0});case B:return R(R({},e),{},{busy:--j>0});default:return e}},Q=(0,i.createContext)(),$=function(e){var t=e.children,n=b((0,i.useReducer)(H,I),2),o=n[0],c=n[1],l=o.filterBy,u=o.limit,f=o.page,h=o.sort,m=o.search,p=(0,i.useMemo)((function(){return[(0,a.Ln)("".concat(s,"/media"),{limit:u,skip:(f-1)*u,filterBy:l,orderBy:h.accessor,order:h.by,search:m}),{headers:{"X-WP-Nonce":d}}]}),[l,u,f,h,m,s,d,a.Ln]),y=(0,i.useMemo)((function(){return[(0,a.Ln)("".concat(s,"/stats"),{search:m}),{headers:{"X-WP-Nonce":d}}]}),[m,s,d,a.Ln]),v=(0,r.ZP)(p,a.SG),g=v.data,w=v.mutate;(0,i.useEffect)((function(){c({type:Y,mutateEntries:w})}),[w]),(0,i.useEffect)((function(){c({type:W,mutateStats:O})}),[O]);var E=(0,a.Fq)(g,[],!0),R=E.busy,x=E.data,_=E.total,k=E.error;(0,i.useEffect)((function(){c({type:R?D:B})}),[R]),(0,i.useEffect)((function(){c({type:G,entries:x})}),[x]),(0,i.useEffect)((function(){c({type:M,totalEntries:_})}),[_]),(0,i.useEffect)((function(){c({type:q,apiError:k})}),[k]);var S=(0,r.ZP)(y,a.SG),L=S.data,O=S.mutate,j=(0,a.Fq)(L,P,!0),T=j.busy,z=j.data,A=j.error;return(0,i.useEffect)((function(){c({type:T?D:B})}),[T]),(0,i.useEffect)((function(){c({type:Z,stats:z})}),[z]),(0,i.useEffect)((function(){c({type:q,apiError:A})}),[A]),React.createElement(Q.Provider,{value:[o,c]},t)},J=function(){var e={},t=b((0,i.useContext)(Q),2),n=t[0],r=t[1];return e.setStatus=function(e){r({type:U,status:e})},e.setPage=function(e){r({type:T,page:e})},e.setLimit=function(e){r({type:z,limit:e})},e.setFilter=function(e){r({type:A,filter:e})},e.setSort=function(e){r({type:C,sort:e})},e.setSearch=function(e){r({type:N,search:e})},e.toggleModal=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;r({type:F,modal:e,enable:t})},e.pushBusy=function(){r({type:D})},e.popBusy=function(){r({type:B})},R(R({},n),e)},K=wp.i18n.__,V={};V.GENERATE=K("Generate","wp-retina-2x"),V.DASHBOARD=K("Dashboard","wp-retina-2x"),V.PENDING=K("Pending","wp-retina-2x"),V.RENAMED=K("Renamed","wp-retina-2x"),V.ALL=K("All","wp-retina-2x"),V.THUMB=K("Thumb","wp-retina-2x"),V.TITLE_REPLACE=K("Replace / Title / Size","wp-retina-2x"),V.ATTACHED_TO=K("Attached To","wp-retina-2x"),V.FILENAME=K("Filename","wp-retina-2x");var X,ee=V;function te(e){return te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},te(e)}function ne(){ne=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,a){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new k(a||[]);return r(i,"_invoke",{value:E(e,n,c)}),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f={};function h(){}function m(){}function p(){}var d={};l(d,o,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(S([])));v&&v!==t&&n.call(v,o)&&(d=v);var g=p.prototype=h.prototype=Object.create(d);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function a(r,o,i,c){var l=s(e[r],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==te(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){a("next",e,i,c)}),(function(e){a("throw",e,i,c)})):t.resolve(f).then((function(e){u.value=e,i(u)}),(function(e){return a("throw",e,i,c)}))}c(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){a(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function E(e,t,n){var r="suspendedStart";return function(a,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw o;return{value:void 0,done:!0}}for(n.method=a,n.arg=o;;){var i=n.delegate;if(i){var c=R(i,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function R(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,R(e,t),"throw"===t.method))return f;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,f;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:L}}function L(){return{value:void 0,done:!0}}return m.prototype=p,r(g,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:m,configurable:!0}),m.displayName=l(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,c,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},b(w.prototype),l(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,a,o){void 0===o&&(o=Promise);var i=new w(u(t,n,r,a),o);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(g),l(g,c,"Generator"),l(g,o,(function(){return this})),l(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=S,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return i.type="throw",i.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){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"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;_(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}function re(e,t,n,r,a,o,i){try{var c=e[o](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,a)}function ae(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){re(o,r,a,i,c,"next",e)}function c(e){re(o,r,a,i,c,"throw",e)}i(void 0)}))}}function oe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,c=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){c=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(c)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ie(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ie(e,t):void 0}}(e,t)||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 ie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ce,le,ue,se=wp.element,fe=se.useState,he=se.useEffect,me=o.ZP.div(X||(ce=["\n display: block;\n color: white;\n padding: 8px 0px;\n font-size: 10px;\n text-align: center;\n width: 24px;\n height: 24px;\n line-height: 8px;\n margin-left: 2px;\n margin-right: -6px;\n box-sizing: border-box;\n margin-bottom: 2px;\n background: ",";\n border-radius: 25px;\n box-shadow: 0px 0px 3px white;\n cursor: pointer;\n\n &.disabled {\n background: gray;\n }\n\n &.missing {\n background: ",";\n }\n\n &.cannot {\n background: ",";\n }\n\n &.pending {\n background: ",";\n }\n\n &.ignored {\n background: gray;\n }\n\n &:last-child {\n margin-right: 6px;\n }\n"],le||(le=ce.slice(0)),X=Object.freeze(Object.defineProperties(ce,{raw:{value:Object.freeze(le)}}))),a.CB.blue,a.CB.red,a.CB.red,a.CB.orange),pe=function(e){var t=e.mutate,n=e.actionButton,r=void 0===n||n,o=e.displaySizes,i=void 0===o||o,c=e.displayFullSize,l=void 0===c||c,u=oe(fe(e.entry),2),f=u[0],h=u[1],m=oe(fe(!1),2),p=m[0],y=m[1],v=(0,a.cf)({concurrency:2}).runTask;he((function(){e.entry?h(e.entry):e.mediaId&&g(e.mediaId)}),[e.entry]);var g=function(){var e=ae(ne().mark((function e(t){var n;return ne().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return y((function(e){return e+1})),e.next=3,v(ae(ne().mark((function e(){return ne().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,a.ZL)("".concat(s,"/details"),{json:{mediaId:t},nonce:d}));case 1:case"end":return e.stop()}}),e)}))));case 3:n=e.sent,h(n.data),y((function(e){return e-1}));case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),b=function(){var e=ae(ne().mark((function e(n){return ne().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:h(n),t&&t();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),w=function(){var t=ae(ne().mark((function t(){var n;return ne().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return y((function(e){return e+1})),t.next=3,(0,a.ZL)("".concat(s,"/build_retina"),{json:{mediaId:e.mediaId},nonce:d});case 3:n=t.sent,b(n.data),y((function(e){return e-1}));case 6:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),E=function(e,t){return"CANNOT"===t.status?"".concat(t.name,": The Full-Size is too small to generate this size. A Full-Size of at least ").concat(t.required.width,"×").concat(t.required.height," is required."):"PENDING"===t.status?"".concat(t.name,": The retina can be generated."):t.name};return React.createElement(a.vg,{busy:p},React.createElement("div",{style:{display:"flex",alignItems:"center"}},r&&React.createElement(a._Z,{style:{marginLeft:0},title:"Generate",onClick:w},ee.GENERATE),i&&f&&f.filter((function(e){return"IGNORED"!==e.status&&"full-size"!==e.name})).map((function(e){return React.createElement(React.Fragment,null,React.createElement(me,{className:e.status.toLowerCase(),title:E(0,e)},e.shortname))})),l&&f&&f.filter((function(e){return"IGNORED"!==e.status&&"full-size"===e.name})).map((function(e){return React.createElement(React.Fragment,null,React.createElement(me,{className:e.status.toLowerCase(),title:E(0,e)},e.shortname))}))))};function de(e){return de="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},de(e)}function ye(){ye=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,a){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new k(a||[]);return r(i,"_invoke",{value:E(e,n,c)}),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f={};function h(){}function m(){}function p(){}var d={};l(d,o,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(S([])));v&&v!==t&&n.call(v,o)&&(d=v);var g=p.prototype=h.prototype=Object.create(d);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function a(r,o,i,c){var l=s(e[r],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==de(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){a("next",e,i,c)}),(function(e){a("throw",e,i,c)})):t.resolve(f).then((function(e){u.value=e,i(u)}),(function(e){return a("throw",e,i,c)}))}c(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){a(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function E(e,t,n){var r="suspendedStart";return function(a,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw o;return{value:void 0,done:!0}}for(n.method=a,n.arg=o;;){var i=n.delegate;if(i){var c=R(i,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function R(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,R(e,t),"throw"===t.method))return f;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,f;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:L}}function L(){return{value:void 0,done:!0}}return m.prototype=p,r(g,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:m,configurable:!0}),m.displayName=l(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,c,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},b(w.prototype),l(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,a,o){void 0===o&&(o=Promise);var i=new w(u(t,n,r,a),o);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(g),l(g,c,"Generator"),l(g,o,(function(){return this})),l(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=S,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return i.type="throw",i.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){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"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;_(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}function ve(e,t,n,r,a,o,i){try{var c=e[o](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,a)}function ge(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){ve(o,r,a,i,c,"next",e)}function c(e){ve(o,r,a,i,c,"throw",e)}i(void 0)}))}}function be(e){return function(e){if(Array.isArray(e))return Re(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Ee(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function we(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,c=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){c=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(c)throw a}}return o}}(e,t)||Ee(e,t)||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 Ee(e,t){if(e){if("string"==typeof e)return Re(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Re(e,t):void 0}}function Re(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var xe,_e,ke,Se,Le,Oe=wp.element,Pe=Oe.useState,je=Oe.useEffect,Ie=Oe.useMemo,Te=Oe.useCallback,ze=!!v.full_size,Ae=v.retina_sizes.length>0||ze,Ce={width:40,height:40,objectFit:"cover"},Ne=[{accessor:"thumbnail_url",title:"",style:{width:16}},{accessor:"title_metadata",title:ee.TITLE_REPLACE,sortable:!0,style:{width:280}},{accessor:"metadata",title:"Thumbnails (Retina in Colors)",style:{width:280}},{accessor:"retina_full",title:"Retina for Full-Size",visible:Ae&&ze},{accessor:"optimized",title:"Optimized"},{accessor:"actions",title:"Actions"}],Fe={accessor:"id",by:"asc"},De=o.ZP.div(ue||(ue=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n display: block;\n color: white;\n padding: 8px 0px;\n font-size: 10px;\n text-align: center;\n width: 24px;\n height: 24px;\n line-height: 8px;\n margin-left: 2px;\n margin-right: -6px;\n box-sizing: border-box;\n margin-bottom: 2px;\n background: ",";\n border-radius: 25px;\n box-shadow: 0px 0px 3px white;\n cursor: pointer;\n\n &.disabled {\n background: #a6ceea;\n }\n\n &.missing {\n background: ",";\n }\n\n &.cannot {\n background: ",";\n }\n\n &.pending {\n background: ",";\n }\n\n &.ignored {\n background: #a6ceea;\n }\n\n\n"])),a.CB.blue,a.CB.red,a.CB.red,a.CB.orange),Be=function(e){var t=e.entry,n=e.metadata;if(!n.sizes||!n.file)return null;var r=Object.keys(n.sizes),o=h+"/"+n.file.replace(/[^/]*$/,"");return React.createElement(React.Fragment,null,r.map((function(e){var r=n.sizes[e],i=r.width,c=r.height,l=r.shortname,u=r.file,s=o+u,f=t.find((function(t){return t.name===e}));return React.createElement(a.u0,{text:React.createElement(React.Fragment,null,"Size Name: ",e," (",l,")",React.createElement("br",null),"Dimension: ",i,"×",c,React.createElement("br",null),"Retina: ",f?f.status:"MISSING")},React.createElement(De,{className:f?f.status.toLowerCase():"missing",onClick:function(){return e=s,void console.log(e);var e}},l))})))},Ge=function(){var e=J(),t=e.entries,n=e.totalEntries,r=e.stats,o=e.busy,i=e.wr2xImageReplace,c=e.filterBy,l=e.modals,u=e.search,f=e.status,h=e.sort,m=e.page,y=e.limit,v=e.apiErrors,g=e.wr2xHideOptimize,b=e.wr2xHideRetinaColumn,w=J(),E=w.mutateStats,R=w.mutateEntries,x=w.setFilter,_=w.toggleModal,k=w.setSearch,S=w.setStatus,L=w.setSort,O=w.setPage,P=w.setLimit,j=we(Pe(),2),I=j[0],T=(j[1],we(Pe([]),2)),z=T[0],A=T[1],C=we(Pe(!1),2),N=C[0],F=C[1],D=we(Pe(""),2),B=D[0],G=D[1],M=(0,a.qj)(),Z=o||N,U=g?Ne.filter((function(e){return"optimized"!==e.accessor})):Ne,q=i,Y=Te((function(e,n){var r=be(t),a=r.findIndex((function(t){return t.ID===e}));r[a]=n,R({success:!0,data:r},!1),E()}),[t,R,E]),W=function(e){var t=e.mediaId;return React.createElement(a.Ii,{height:40,width:40,iconSize:16,style:{marginRight:5},onFailure:function(e){alert(e.message)},onSuccess:function(e){_(null),Y(t,e.data),E()},apiUrl:"".concat(s,"/replace"),apiConfig:{json:{mediaId:t},nonce:d}})},H=function(e){var t=e.mediaId;return React.createElement(a.Ii,{height:40,width:40,iconSize:16,style:{marginRight:5},onFailure:function(e){alert(e.message)},onSuccess:function(e){Y(t,e.data),E()},apiUrl:"".concat(s,"/upload_retina_fullsize"),apiConfig:{json:{mediaId:t},nonce:d}})},Q=Ie((function(){return t.map((function(e){var t=e.info.filter((function(e){return"EXISTS"===e.status&&"full-size"===e.name})).length>0;return e.info.filter((function(e){return"MISSING"===e.status||"CANNOT"===e.status})).length,{id:e.ID,thumbnail_url:React.createElement("img",{src:"".concat(e.thumbnail_url,"?version=").concat(e.version),style:Ce}),title_metadata:React.createElement("div",{style:{display:"flex",alignItems:"center"}},!!q&&React.createElement(W,{mediaId:e.ID}),React.createElement("div",{style:{display:"flex",flexDirection:"column"}},React.createElement("a",{href:"post.php?post=".concat(e.ID,"&action=edit")},e.post_title),React.createElement("small",null,"Full-Size: ",e.metadata.width,"×",e.metadata.height," (",e.filesize,")"))),metadata:React.createElement("div",{style:{display:"flex",alignItems:"center"}},React.createElement(Be,{entry:e.info,metadata:e.metadata})),retina_full:React.createElement("div",{style:{display:"flex",alignItems:"center"}},(ze||t)&&React.createElement("div",{style:{display:"flex",alignItems:"center"}},!t&&React.createElement(H,{mediaId:e.ID}),React.createElement(pe,{actionButton:!1,displaySizes:!1,displayFullSize:!0,entry:e.info}))),optimized:React.createElement("div",null,React.createElement(a.JH,{icon:e.optimized?"check":"close",color:e.optimized?a.CB.green:a.CB.red,width:20,height:20}),e.optimized&&React.createElement(a.O9,null,Math.floor((e.optimized.before-e.optimized.after)/e.optimized.before*1e4)/100,"%")),actions:React.createElement("div",{style:{display:"flex",justifyContent:"end"}},!g&&React.createElement(a._Z,{title:"Optimize the Image and Thumbnails",onClick:function(){return re([e.ID])}},"Optimize"),React.createElement(a._Z,{title:"Regenerate Thumbnails, Metadata and Build Retina",onClick:function(){return ne([e.ID])}},"Build Thumbnails"),React.createElement(a._Z,{title:"Build Retina Images",onClick:function(){return V([e.ID])}},"Build Retina"),t&&React.createElement(a._Z,{onClick:function(){confirm("Are you sure?")&&ee([e.ID])}},"Delete ",React.createElement("small",null,"Full-Size Retina")),"issues"===c&&React.createElement(a._Z,{onClick:function(){return X(e.ID)}},"Ignore"),"ignored"===c&&React.createElement(a._Z,{onClick:function(){return X(e.ID)}},"Un-Ignore"))}}))}),[t]);je((function(){A([]),L(Fe),O(1)}),[c,u]),je((function(){if(null!==M.busy&&(F(M.busy),!M.busy)){var e=M.getErrorCount();e>0&&G("The process has finished, but ".concat(e," error(s) occurred (check your console).")),M.reset(),A([]),R(),E()}}),[M.busy]);var $=function(){var e=ge(ye().mark((function e(t){var n;return ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,a.ZL)("".concat(s,"/get_all_ids"),{json:{issuesOnly:t},nonce:d});case 2:if((n=e.sent).success){e.next=6;break}return alert(n.message),e.abrupt("return",[]);case 6:return e.abrupt("return",n.data);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),K=function(){var e=ge(ye().mark((function e(){return ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return F(!0),e.next=3,(0,a.ZL)("".concat(s,"/refresh"),{nonce:d});case 3:R(),E(),F(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),V=function(){var e=ge(ye().mark((function e(){var t,n,r,o=arguments;return ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>0&&void 0!==o[0]?o[0]:null,S("Preparing..."),F(!0),!t){e.next=7;break}e.t0=t,e.next=10;break;case 7:return e.next=9,$(!0);case 9:e.t0=e.sent;case 10:if(!(n=e.t0)){e.next=16;break}return r=n.map((function(e){return function(){var t=ge(ye().mark((function t(n){var r;return ye().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return S("Build Retina for #".concat(e)),t.next=3,(0,a.ZL)("".concat(s,"/build_retina"),{json:{mediaId:e},nonce:d,signal:n});case 3:return(r=t.sent).success?Y(e,r.data):alert("Error!"),t.abrupt("return",r);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),e.next=15,M.start(r);case 15:E();case 16:F(!1);case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),X=function(){var e=ge(ye().mark((function e(t){var n;return ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return F(!0),e.next=3,(0,a.ZL)("".concat(s,"/ignore"),{json:{mediaId:t},nonce:d});case 3:return(n=e.sent).success?(E(),R()):alert("Error!"),F(!1),e.abrupt("return",n);case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),ee=function(){var e=ge(ye().mark((function e(){var t,n,r,o=arguments;return ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>0&&void 0!==o[0]?o[0]:null,S("Preparing..."),F(!0),!t){e.next=7;break}e.t0=t,e.next=10;break;case 7:return e.next=9,$();case 9:e.t0=e.sent;case 10:if(!(n=e.t0)){e.next=16;break}return r=n.map((function(e){return function(){var t=ge(ye().mark((function t(n){var r;return ye().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return S("Delete Full-Size Retina for #".concat(e)),t.next=3,(0,a.ZL)("".concat(s,"/delete_retina_fullsize"),{json:{mediaId:e},nonce:d,signal:n});case 3:return(r=t.sent).success?Y(e,r.data):alert("Error!"),t.abrupt("return",r);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),e.next=15,M.start(r);case 15:E();case 16:F(!1);case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),te=function(){var e=ge(ye().mark((function e(){var t,n,r,o=arguments;return ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>0&&void 0!==o[0]?o[0]:null,S("Preparing..."),F(!0),!t){e.next=7;break}e.t0=t,e.next=10;break;case 7:return e.next=9,$();case 9:e.t0=e.sent;case 10:if(!(n=e.t0)){e.next=16;break}return r=n.map((function(e){return function(){var t=ge(ye().mark((function t(n){var r;return ye().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return S("Delete Retina for #".concat(e)),t.next=3,(0,a.ZL)("".concat(s,"/delete_retina"),{json:{mediaId:e},nonce:d,signal:n});case 3:return(r=t.sent).success?Y(e,r.data):alert("Error!"),t.abrupt("return",r);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),e.next=15,M.start(r);case 15:E();case 16:F(!1);case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ne=function(){var e=ge(ye().mark((function e(){var t,n,r,o=arguments;return ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>0&&void 0!==o[0]?o[0]:null,S("Preparing..."),F(!0),!t){e.next=7;break}e.t0=t,e.next=10;break;case 7:return e.next=9,$();case 9:e.t0=e.sent;case 10:if(!(n=e.t0)){e.next=16;break}return r=n.map((function(e){return function(){var t=ge(ye().mark((function t(n){var r;return ye().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return S("Regenerate #".concat(e)),t.next=3,(0,a.ZL)("".concat(s,"/regenerate"),{json:{mediaId:e},nonce:d,signal:n});case 3:return(r=t.sent).success?Y(e,r.data):alert("Error!"),t.abrupt("return",r);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),e.next=15,M.start(r);case 15:E();case 16:F(!1);case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),re=function(){var e=ge(ye().mark((function e(){var t,n,r,o=arguments;return ye().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=o.length>0&&void 0!==o[0]?o[0]:null,S("Preparing..."),F(!0),!t){e.next=7;break}e.t0=t,e.next=10;break;case 7:return e.next=9,$();case 9:e.t0=e.sent;case 10:if(!(n=e.t0)){e.next=16;break}return r=n.map((function(e){return function(){var t=ge(ye().mark((function t(n){var r;return ye().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return S("Optimize #".concat(e)),t.next=3,(0,a.ZL)("".concat(s,"/optimize"),{json:{mediaId:e},nonce:d,signal:n});case 3:return(r=t.sent).success?Y(e,r.data):alert("Error!"),t.abrupt("return",r);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()})),e.next=15,M.start(r);case 15:E();case 16:F(!1);case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ae=React.createElement(React.Fragment,null,React.createElement(a._Z,{className:"secondary",onClick:function(){return window.open("https://meowapps.com/plugin/wp-retina-2x/","_blank")}},"Get the Pro Version"),React.createElement(a._Z,{className:"primary",onClick:function(){return window.open("https://meowapps.com/wp-retina-2x-tutorial/","_blank")}},"Read the tutorial"));return React.createElement(a.si,{nekoErrors:[v]},React.createElement(a.BP,{title:"Perfect Images | Dashboard",subtitle:"By Jordy Meow"},React.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},React.createElement(a._Z,{className:"header",onClick:function(){return window.open("https://meowapps.com/wp-retina-2x-tutorial/","_blank")}},"Tutorial"),React.createElement(a._Z,{icon:"dashboard",className:"header",onClick:function(){return location.href="admin.php?page=wr2x_settings"}},"Settings"))),React.createElement(a.oY,null,React.createElement(a.zc,{full:!0},React.createElement(a.Hq,{footer:!p&&ae},React.createElement(a.O9,{p:!0},"Welcome to the new version of the former WP Retina 2x, now ",React.createElement("b",null,"Perfect Images"),". The goal is to make your images sizes and thumbnails more manageable, with Retina support. Please let me know if this dashboard is not clear enough, or if you have ideas how to make it even better.")),React.createElement(a.P$,null,React.createElement(a._Z,{onClick:function(){return K()}},"Refresh Stats"),!Z&&z.length>0&&React.createElement(React.Fragment,null,!g&&React.createElement(a._Z,{className:"secondary",onClick:function(){return re(z)}},"Optimize for ",React.createElement("strong",null,z.length," Entries")),React.createElement(a._Z,{className:"secondary",onClick:function(){return V(z)}},"Build Retina for ",React.createElement("strong",null,z.length," Entries")),React.createElement(a._Z,{className:"secondary",title:"Regenerate Thumbnails, Metadata and Build Retina",onClick:function(){return ne(z)}},"Regenerate ",React.createElement("strong",null,z.length," Entries")),React.createElement(a._Z,{className:"danger",onClick:function(){return te(z)}},"Delete Retina for ",React.createElement("strong",null,z.length," Entries"))),React.createElement("div",{style:{flex:1}},N&&React.createElement(a.UJ,{status:function(e){return"".concat(f," (").concat(e,"%)")},busy:N,value:M.value,max:M.max,onStopClick:M.stop})),!Z&&React.createElement(React.Fragment,null,React.createElement(a.Ay,{onBlur:function(e){k(e)},value:u,onEnter:function(e){k(e)}}),!u&&React.createElement(a.JH,{icon:"search",width:24,style:{position:"relative",left:-34,marginRight:-22},color:"#5a5a5a82"}),u&&React.createElement(a.JH,{icon:"close",width:24,style:{position:"relative",left:-34,marginRight:-22},color:a.CB.blue,onClick:function(){k("")}})),!Z&&0===z.length&&React.createElement(React.Fragment,null,React.createElement(a.jh,{title:"Bulk Actions",style:{minWidth:180}},!g&&React.createElement(a.pK,{className:"primary",onClick:function(){return re()}},"Optimize for ",React.createElement("strong",null,"All Entries")),React.createElement(a.pK,{className:"primary",onClick:function(){return V()}},"Build Retina for ",React.createElement("strong",null,"All Issues")),React.createElement(a.pK,{className:"primary",title:"Regenerate Thumbnails, Metadata and Build Retina",onClick:function(){return ne()}},"Regenerate ",React.createElement("strong",null,"All Entries")),React.createElement(a.pK,{className:"danger",onClick:function(){return te()}},"Delete Retina for ",React.createElement("strong",null,"All"))))),React.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginTop:10,marginBottom:10}},React.createElement(a.h,{value:c,busy:Z,onChange:function(e){x(e),O(1)}},React.createElement(a.Sx,{title:"All",value:"all",count:r.all}),!b&&React.createElement(a.Sx,{title:"Retina Issues",value:"issues",count:r.issues}),!g&&React.createElement(a.Sx,{title:"Optimize Issues",value:"optimizeIssues",count:r.optimizeIssues}),React.createElement(a.Sx,{title:"Ignored",value:"ignored",count:r.ignored})),React.createElement(a.Qo,{currentPage:m,limit:y,total:n,onCurrentPageChanged:function(e){return O(e)},onClick:function(e){return O(e)}})),React.createElement(a.aR,{busy:Z,data:Q,columns:U,sort:h,onSortChange:function(e,t){L({accessor:e,by:t})},onSelect:function(e){A([].concat(be(z),be(e)))},onUnselect:function(e){A(be(z.filter((function(t){return!e.includes(t)}))))},selectedItems:z,emptyMessage:React.createElement(React.Fragment,null,"It's all clean & nice here! 👍",React.createElement("br",null),"Why not trying to give a boost ot your DB with ",React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/database-cleaner/"},"Database Cleaner"),"? 😌")}),React.createElement("div",{style:{display:"flex",justifyContent:"space-between",marginTop:10}},React.createElement(a.Np,{scrolldown:!0,value:y,onChange:function(e){P(e),O(1)}},React.createElement(a.ZB,{value:10,label:"10 items per page"}),React.createElement(a.ZB,{value:25,label:"25 items per page"}),React.createElement(a.ZB,{value:50,label:"50 items per page"}),React.createElement(a.ZB,{value:100,label:"100 items per page"}),React.createElement(a.ZB,{value:250,label:"250 items per page"})),React.createElement(a.Qo,{currentPage:m,limit:y,total:n,onClick:function(e){return O(e)}}))),React.createElement(a.LI,{isOpen:l.uploadRetinaFullsize,onRequestClose:function(){_(null)},title:"Upload Retina for Full-Size",content:React.createElement(React.Fragment,null,React.createElement(a.Ii,{height:200,onFailure:function(e){alert(e.message)},onSuccess:function(e){_(null),Y(I,e.data),E()},apiUrl:"".concat(s,"/upload_retina_fullsize"),apiConfig:{json:{mediaId:I},nonce:d}}),React.createElement("p",{style:{marginTop:20,marginBottom:-20}},"Drop your image here! If the thumbnails could not be created before, the plugin will also use this image to create the missing Retina Images."))}),React.createElement(a.LI,{isOpen:B,title:"Success",ok:"Close",content:B,onOkClick:function(){G(""),M.reset()}})))};function Me(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Ze=o.ZP.div(xe||(xe=Me(["\n color: white;\n padding: 15px;\n margin-bottom: -15px;\n\n a {\n color: #7dedff;\n text-decoration: none;\n }\n\n p {\n font-size: 15px;\n }\n"]))),Ue=(0,o.ZP)(a.vj)(_e||(_e=Me(["\n\n .nui-block-title {\n display: none;\n }\n\n .nui-block-content {\n display: flex;\n padding: 10px;\n\n h2 {\n color: #055082;\n font-size: 16px;\n margin: 5px 0 5px 0;\n\n a {\n text-decoration: none;\n }\n }\n\n p {\n margin: 0px;\n line-height: 18px;\n }\n }\n"]))),qe=o.ZP.img(ke||(ke=Me(["\n width: 85px;\n height: 85px;\n padding-right: 10px;\n"]))),Ye=o.ZP.div(Se||(Se=Me(["\n\n margin: 15px;\n\n .center {\n background: white;\n border-radius: 10px;\n padding: 10px;\n max-width: 100%\n overflow: none;\n\n h2 {\n font-size: 26px;\n }\n\n table {\n width: 100%;\n\n tr td:first-child {\n width: 220px;\n font-weight: bold;\n color: #1e7cba;\n }\n\n * {\n overflow-wrap: anywhere;\n }\n }\n }\n\n hr {\n border-color: #1e7cba;\n }\n"]))),We=o.ZP.ul(Le||(Le=Me(["\n margin-top: 10px;\n background: rgb(0, 72, 88);\n padding: 10px;\n color: rgb(58, 212, 58);\n max-height: 600px;\n min-height: 200px;\n display: block;\n font-family: monospace;\n font-size: 12px;\n white-space: pre;\n overflow-x: auto;\n width: calc(100vw - 276px);\n\n .log-date {\n color: white;\n margin-left: 8px;\n }\n\n .log-type {\n background: #0000004d;\n padding: 2px 5px;\n border-radius: 8px;\n text-transform: uppercase;\n }\n\n .log-content {\n display: block;\n }\n\n .log-warning .log-type {\n background: #ccb028;\n color: white;\n }\n\n .log-fatal .log-type {\n background: #cc2828;\n color: white;\n }\n"])));function He(e){return He="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},He(e)}function Qe(){Qe=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,a){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new k(a||[]);return r(i,"_invoke",{value:E(e,n,c)}),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f={};function h(){}function m(){}function p(){}var d={};l(d,o,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(S([])));v&&v!==t&&n.call(v,o)&&(d=v);var g=p.prototype=h.prototype=Object.create(d);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function a(r,o,i,c){var l=s(e[r],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==He(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){a("next",e,i,c)}),(function(e){a("throw",e,i,c)})):t.resolve(f).then((function(e){u.value=e,i(u)}),(function(e){return a("throw",e,i,c)}))}c(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){a(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function E(e,t,n){var r="suspendedStart";return function(a,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw o;return{value:void 0,done:!0}}for(n.method=a,n.arg=o;;){var i=n.delegate;if(i){var c=R(i,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function R(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,R(e,t),"throw"===t.method))return f;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,f;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:L}}function L(){return{value:void 0,done:!0}}return m.prototype=p,r(g,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:m,configurable:!0}),m.displayName=l(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,c,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},b(w.prototype),l(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,a,o){void 0===o&&(o=Promise);var i=new w(u(t,n,r,a),o);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(g),l(g,c,"Generator"),l(g,o,(function(){return this})),l(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=S,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return i.type="throw",i.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){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"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;_(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}function $e(e,t,n,r,a,o,i){try{var c=e[o](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,a)}function Je(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){$e(o,r,a,i,c,"next",e)}function c(e){$e(o,r,a,i,c,"throw",e)}i(void 0)}))}}function Ke(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,c=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){c=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(c)throw a}}return o}}(e,t)||Ve(e,t)||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 Ve(e,t){if(e){if("string"==typeof e)return Xe(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xe(e,t):void 0}}function Xe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var et=wp.element,tt=et.useState,nt=et.useEffect,rt="".concat(u,"/meow-common/v1"),at=function(e){var t=e.request,n=e.title,r=e.max,o=Ke(tt(!1),2),i=o[0],c=o[1],l=Ke(tt([]),2),u=l[0],s=l[1],f=u.length>0?u.reduce((function(e,t){return e+t})):0,h=u.length>0?Math.ceil(f/u.length):0,m=!u.length&&i;return nt((function(){i&&setTimeout(Je(Qe().mark((function e(){var n,r,o;return Qe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(new Date).getTime(),e.next=3,(0,a.ZL)("".concat(rt,"/").concat(t),{nonce:d});case 3:r=(new Date).getTime(),o=r-n,s((function(e){return[].concat(function(e){if(Array.isArray(e))return Xe(e)}(t=e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||Ve(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[o]);var t}));case 6:case"end":return e.stop()}}),e)}))),1e3)}),[u]),React.createElement(Ze,{style:{width:200,textAlign:"center"}},React.createElement(a.O9,{h2:!0,style:{color:"white"}},n),React.createElement(a._h,{size:200,value:m?r:h,max:r},React.createElement("span",{style:{fontSize:20}},m?"START":h+" ms"),React.createElement("span",{style:{fontSize:12}},m?"YOUR ENGINE":u.length+" requests")),React.createElement(a._Z,{style:{width:"100%",marginTop:10},color:i?"#cc3627":"#ccb027",onClick:function(){i||s([]),c(!i)}},i?"Stop":"Start"))};function ot(e){return ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ot(e)}function it(){it=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,a){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new k(a||[]);return r(i,"_invoke",{value:E(e,n,c)}),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f={};function h(){}function m(){}function p(){}var d={};l(d,o,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(S([])));v&&v!==t&&n.call(v,o)&&(d=v);var g=p.prototype=h.prototype=Object.create(d);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function a(r,o,i,c){var l=s(e[r],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==ot(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){a("next",e,i,c)}),(function(e){a("throw",e,i,c)})):t.resolve(f).then((function(e){u.value=e,i(u)}),(function(e){return a("throw",e,i,c)}))}c(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){a(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function E(e,t,n){var r="suspendedStart";return function(a,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw o;return{value:void 0,done:!0}}for(n.method=a,n.arg=o;;){var i=n.delegate;if(i){var c=R(i,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function R(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,R(e,t),"throw"===t.method))return f;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,f;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:L}}function L(){return{value:void 0,done:!0}}return m.prototype=p,r(g,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:m,configurable:!0}),m.displayName=l(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,c,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},b(w.prototype),l(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,a,o){void 0===o&&(o=Promise);var i=new w(u(t,n,r,a),o);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(g),l(g,c,"Generator"),l(g,o,(function(){return this})),l(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=S,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return i.type="throw",i.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){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"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;_(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}function ct(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function lt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ct(Object(n),!0).forEach((function(t){ut(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ct(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ut(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function st(e,t,n,r,a,o,i){try{var c=e[o](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,a)}function ft(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){st(o,r,a,i,c,"next",e)}function c(e){st(o,r,a,i,c,"throw",e)}i(void 0)}))}}function ht(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,c=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){c=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(c)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return mt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mt(e,t):void 0}}(e,t)||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 mt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var pt=wp.element,dt=pt.useState,yt=pt.useEffect;s&&u&&f||console.error("[@common/dashboard] apiUrl, restUrl and pluginUrl are mandatory.");var vt="".concat(u,"/meow-common/v1"),gt=React.createElement(Ze,null,React.createElement(a.O9,{p:!0},"Meow Apps is run by Jordy Meow, a photographer and software developer living in Japan (and taking ",React.createElement("a",{target:"_blank",href:"https://offbeatjapan.org"},"a lot of photos"),"). Meow Apps proposes a suite of plugins focusing on photography, imaging, optimization and SEO. The ultimate goal is to make your website better, faster, while making it easy. Meow Apps also teams up with the best players in the community. For more information, please check ",React.createElement("a",{href:"http://meowapps.com",target:"_blank"},"Meow Apps"),".")),bt=React.createElement(Ze,null,React.createElement(a.O9,{p:!0},"The ",React.createElement("b",null,"Empty Request Time")," helps you analyzing the raw performance of your install by giving you the average time it takes to run an empty request to your server. You can try to disable some plugins (or change their options) then Start this again to see how it influences the results. An excellent install would have an Empty Request Time of less than 500 ms. Keep it absolutely under 2,000 ms! For more information, ",React.createElement("a",{href:"https://meowapps.com/clean-optimize-wordpress/#Optimize_your_Empty_Request_Time",target:"_blank"},"click here"),"."),React.createElement(a.O9,{p:!0},React.createElement("b",null,"File Operation Time")," creates a temporary size of 10MB every time. ",React.createElement("b",null,"SQL Request Time")," counts the number of posts. Those two should be very fast, and almost the same as the ",React.createElement("b",null,"Empty Request Time"),".")),wt=React.createElement(Ze,null,React.createElement(a.O9,{p:!0},"Too many WordPress installs are blown-up with useless and/or heavy plugins, and not aware of best practices. That's not the fault of the users; WordPress pretends to be simple but it is in fact very complex, and the immensity and diversity of the community around it makes it a real jungle where everything is possible."),React.createElement(a.O9,{p:!0},"A rule of thumb is to keep your WordPress install as simple as possible, with the least number of plugins installed (run away from the heavy ones) and an excellent hosting service. Avoid VPS or self-hosted solutions; you must be a professional to actually set them up so that they are actually performant."),React.createElement(a.O9,{p:!0},"On the Meow Apps website, you will find articles which are always updated with the latest recommendations.",React.createElement("ul",null,React.createElement("li",null,"☘️  ",React.createElement("a",{href:"https://meowapps.com/how-to-debug-wordpress-errors/",target:"_blank"},"How To Debug WordPress")),React.createElement("li",null,"☘️  ",React.createElement("a",{href:"https://meowapps.com/tutorial-improve-seo-wordpress/",target:"_blank"},"SEO Checklist & Optimization")),React.createElement("li",null,"☘️  ",React.createElement("a",{href:"https://meowapps.com/tutorial-faster-wordpress-optimize/",target:"_blank"},"Optimize your WordPress Speed")),React.createElement("li",null,"☘️  ",React.createElement("a",{href:"https://meowapps.com/tutorial-optimize-images-wordpress/",target:"_blank"},"Optimize Images (CDN, and so on)")),React.createElement("li",null,"☘️  ",React.createElement("a",{href:"https://meowapps.com/tutorial-hosting-service-wordpress/",target:"_blank"},"Best Hosting Services for WordPress"))))),Et=["".concat(vt,"/all_settings/"),{headers:{"X-WP-Nonce":d}}],Rt=function(){var e=ht(dt(!1),2),t=e[0],n=e[1],o=(0,r.ZP)(Et,a.SG),i=o.data,c=o.mutate,l=o.error,u=null==i?void 0:i.data,s=null==u?void 0:u.meowapps_hide_meowapps,h=null==u?void 0:u.force_sslverify,m=ht(dt(!1),2),p=m[0],y=m[1],v=ht(dt([]),2),g=v[0],b=v[1],w=ht(dt(""),2),E=w[0],R=w[1];yt((function(){l&&!t&&(n(!0),console.error("Error from UseSWR",l.message))}),[l]),yt((function(){var e=document.getElementById("meow-common-phpinfo");R(e.innerHTML)}),[]);var x=function(){var e=ft(it().mark((function e(t,n){var r,o;return it().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=lt({},i.data))[n]=t,c(lt(lt({},i),{},{data:r}),!1),y(!0),e.next=6,(0,a.ZL)("".concat(vt,"/update_option"),{json:{name:n,value:t},nonce:d});case 6:o=e.sent,y(!1),o.success||alert(o.message),c();case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),_=function(){var e=ft(it().mark((function e(){var t,n;return it().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return y(!0),e.next=3,(0,a.ZL)("".concat(vt,"/error_logs"),{nonce:d});case 3:t=e.sent,n=t&&t.data?t.data:[],b(n.reverse()),y(!1);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),k=React.createElement(a.rR,{title:"Main Menu"},React.createElement(a.lQ,{max:"1"},React.createElement(a.PQ,{id:"meowapps_hide_meowapps",label:"Hide (Not Recommended)",description:React.createElement(a.O9,{p:!0},"This will hide the Meow Apps Menu (on the left side) and everything it contains. You can re-enable it through though an option that will be added in Settings → General."),value:"1",disabled:p,checked:s,onChange:x}))),S=React.createElement(a.rR,{title:"SSL Verify"},React.createElement(a.lQ,{max:"1"},React.createElement(a.PQ,{id:"force_sslverify",label:"Force (Not Recommended)",description:React.createElement(a.O9,{p:!0},"This will enforce the usage of SSL when checking the license or updating the plugin."),value:"1",disabled:p,checked:h,onChange:x})));return React.createElement(a.si,{showRestError:t},React.createElement(a.BP,{title:"The Dashboard"}),React.createElement(a.oY,null,React.createElement(a.zc,{full:!0},React.createElement(a.c4,null,React.createElement(a.Ps,{title:"Meow Apps"},gt,React.createElement(a.oY,null,React.createElement(a.zc,{minimal:!0},React.createElement(Ue,{title:"Media Cleaner",className:"primary"},React.createElement(qe,{src:"".concat(f,"/common/img/media-cleaner.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/media-cleaner/"},"Media Cleaner")),React.createElement("p",null,"The Cleaner analyzes your WordPress entirely to find out which files are not used. You can trash them, before deleting them permanently. Your WordPress will breath again :)"))),React.createElement(Ue,{title:"Database Cleaner",className:"primary"},React.createElement(qe,{src:"".concat(f,"/common/img/database-cleaner.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/database-cleaner/"},"Database Cleaner")),React.createElement("p",null,"Clean your WordPress database. This plugin is simple, handles risk levels, and aims to work even on oversized databases on which other plugins fail to operate."))),React.createElement(Ue,{title:"Media File Renamer",className:"primary"},React.createElement(qe,{src:"".concat(f,"/common/img/media-file-renamer.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/media-file-renamer/"},"Media File Renamer")),React.createElement("p",null,"The Renamer will help you in getting nicer filenames for an improved SEO and a tidier filesystem. It's mostly automatic and very fun to use."))),React.createElement(Ue,{title:"Social Engine",className:"primary"},React.createElement(qe,{src:"".concat(f,"/common/img/social-engine.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/social-engine/"},"Social Engine")),React.createElement("p",null,"Organize, schedule and automate the publishing of your content and photos on social accounts. Similar to Buffer, TweetDeck, etc, but without all the limitations, and in your WordPress."))),React.createElement(Ue,{title:"Meow Analytics",className:"primary"},React.createElement(qe,{src:"".concat(f,"/common/img/meow-analytics.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/meow-analytics/"},"Meow Analytics")),React.createElement("p",null,"Are you tired of those heavy plugins, accessing your Google Analytics deliberately? Switch to Meow Analytics!")))),React.createElement(a.zc,{minimal:!0},React.createElement(Ue,{title:"Photo Engine",className:"primary"},React.createElement(qe,{src:"".concat(f,"/common/img/wplr-sync.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/wplr-sync/"},"Photo Engine")),React.createElement("p",null,"Are you using Lightroom? So you know Photo Engine already. Wait, you don't? You must try it! This plugin will be your favorite very soon."))),React.createElement(Ue,{title:"Meow Gallery",className:"primary"},React.createElement(qe,{src:"".concat(f,"/common/img/meow-gallery.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/meow-gallery/"},"Meow Gallery")),React.createElement("p",null,"This is the fastest gallery system... and it is pretty as well! It is 100% compatible with the native WordPress galleries and therefore, works right away."))),React.createElement(Ue,{title:"Meow Lightbox",className:"primary"},React.createElement(qe,{src:"".concat(f,"/common/img/meow-lightbox.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/meow-lightbox/"},"Meow Lightbox")),React.createElement("p",null,"A very sleek and performant Lightbox which will also display your EXIF data (camera, lens, aperture...). Photographers love it."))),React.createElement(Ue,{title:"Perfect Images (Retina)",className:"primary"},React.createElement(qe,{src:"".concat(f,"/common/img/wp-retina-2x.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/wp-retina-2x/"},"Perfect Images")),React.createElement("p",null,"It handles Retina, help you managing the Image Sizes registered in your WP, and much more."))),React.createElement(Ue,{title:"Contact Form Block",className:"primary"},React.createElement(qe,{src:"".concat(f,"/common/img/contact-form-block.png")}),React.createElement("div",null,React.createElement("h2",null,React.createElement("a",{target:"_blank",href:"https://wordpress.org/plugins/contact-form-block/"},"Contact Form Block")),React.createElement("p",null,"A simple, pretty and superlight contact form. If you simply want your visitors to get in touch with you, this contact form will be perfect for you and your WordPress.")))))),React.createElement(a.Ps,{title:"Performance"},bt,React.createElement("div",{style:{display:"flex",justifyContent:"space-around",marginBottom:25}},React.createElement(at,{title:"Empty Request Time",request:"empty_request",max:2500}),React.createElement(at,{title:"File Operation Time",request:"file_operation",max:2600}),React.createElement(at,{title:"SQL Request Time",request:"sql_request",max:2800}))),React.createElement(a.Ps,{title:"Recommendations"},wt),React.createElement(a.Ps,{title:"PHP Info"},React.createElement(Ye,{dangerouslySetInnerHTML:{__html:E}})),React.createElement(a.Ps,{title:"PHP Error Logs"},React.createElement(Ze,null,React.createElement(a._Z,{style:{marginBottom:10},color:"#ccb027",onClick:_},"Load PHP Error Logs"),React.createElement(We,null,g.map((function(e){return React.createElement("li",{class:"log-".concat(e.type)},React.createElement("span",{class:"log-type"},e.type),React.createElement("span",{class:"log-date"},e.date),React.createElement("span",{class:"log-content"},e.content))}))))),React.createElement(a.Ps,{title:"Settings"},React.createElement(a.vj,{title:"Settings",className:"primary"},k,S))))))};function xt(e){return xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xt(e)}function _t(){_t=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,a){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new k(a||[]);return r(i,"_invoke",{value:E(e,n,c)}),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f={};function h(){}function m(){}function p(){}var d={};l(d,o,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(S([])));v&&v!==t&&n.call(v,o)&&(d=v);var g=p.prototype=h.prototype=Object.create(d);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function a(r,o,i,c){var l=s(e[r],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==xt(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){a("next",e,i,c)}),(function(e){a("throw",e,i,c)})):t.resolve(f).then((function(e){u.value=e,i(u)}),(function(e){return a("throw",e,i,c)}))}c(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){a(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function E(e,t,n){var r="suspendedStart";return function(a,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw o;return{value:void 0,done:!0}}for(n.method=a,n.arg=o;;){var i=n.delegate;if(i){var c=R(i,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function R(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,R(e,t),"throw"===t.method))return f;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,f;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:L}}function L(){return{value:void 0,done:!0}}return m.prototype=p,r(g,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:m,configurable:!0}),m.displayName=l(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,c,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},b(w.prototype),l(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,a,o){void 0===o&&(o=Promise);var i=new w(u(t,n,r,a),o);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(g),l(g,c,"Generator"),l(g,o,(function(){return this})),l(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=S,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return i.type="throw",i.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){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"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;_(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}function kt(e,t,n,r,a,o,i){try{var c=e[o](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,a)}function St(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){kt(o,r,a,i,c,"next",e)}function c(e){kt(o,r,a,i,c,"throw",e)}i(void 0)}))}}function Lt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,c=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){c=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(c)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ot(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ot(e,t):void 0}}(e,t)||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 Ot(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Pt=wp.element,jt=Pt.useState,It=Pt.useEffect,Tt="".concat(u,"/meow-licenser/").concat(c,"/v1"),zt=function(){var e=Lt(jt(!1),2),t=e[0],n=e[1],r=Lt(jt(!1),2),o=r[0],i=r[1],c=Lt(jt(null),2),l=c[0],u=c[1],s=Lt(jt(null),2),f=s[0],h=s[1],y=Lt(jt(""),2),v=y[0],g=y[1],b=p&&(!f||"valid"!==f.license),w=function(){var e=St(_t().mark((function e(){var t;return _t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(m){e.next=2;break}return e.abrupt("return");case 2:return n(!0),e.next=5,(0,a.ZL)("".concat(Tt,"/get_license"),{nonce:d});case 5:t=e.sent,h(t.data),t.data.key&&g(t.data.key),n(!1);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),E=function(){var e=St(_t().mark((function e(){return _t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n(!0),e.next=3,(0,a.ZL)("".concat(Tt,"/set_license"),{nonce:d,json:{serialKey:null}});case 3:e.sent.success&&(g(""),h(null),u("licenseRemoved")),n(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),R=function(){var e=St(_t().mark((function e(){var t;return _t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n(!0),e.next=3,(0,a.ZL)("".concat(Tt,"/set_license"),{nonce:d,json:{serialKey:v,override:!0}});case 3:(t=e.sent).success&&(h(t.data),t.data&&!t.data.issue&&u("licenseAdded")),n(!1);case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),x=function(){var e=St(_t().mark((function e(){var t;return _t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("MEOW_OVERRIDE"!==v){e.next=5;break}return i(!0),h(null),g(""),e.abrupt("return");case 5:return n(!0),e.next=8,(0,a.ZL)("".concat(Tt,"/set_license"),{nonce:d,json:{serialKey:v}});case 8:(t=e.sent).success&&(h(t.data),t.data&&!t.data.issue&&u("licenseAdded")),n(!1);case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();It((function(){w()}),[]);var _=b?"Forced License":p?"Enabled":"Disabled",k=b||f&&"valid"===f.license,S="Your license is active. Thanks a lot for your support :)";b&&f&&f.check_url&&(S=React.createElement(React.Fragment,null,React.createElement("span",null,S),React.createElement("br",null),React.createElement("small",null,"This license was enabled manually. To check your license status, please click ",React.createElement("a",{target:"_blank",href:f.check_url+"&cache="+642e3*Math.random()},"here"),"."))),k||(f?"no_activations_left"===f.issue?S=React.createElement("span",null,"There are no activations left for this license. You can visit your account at the ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com"},"Meow Apps Store"),", unregister a site, and click on ",React.createElement("i",null,"Retry to validate"),"."):"expired"===f.issue?S=React.createElement("span",null,"Your license has expired. You can get another license or renew the current one by visiting your account at the ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com"},"Meow Apps Store"),"."):"missing"===f.issue?S="This license does not exist.":"disabled"===f.issue?S="This license has been disabled.":"item_name_mismatch"===f.issue?S="This license seems to be for a different plugin... isn't it? :)":"forced"===f.issue?S="ABC":(S=React.createElement("span",null,"There is an unknown error related to the system or this serial key. Really sorry about this! Make sure your security plugins and systems are off temporarily. If you are still experiencing an issue, please ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com/contact/"},"contact us"),"."),console.error({license:f})):S="Unknown error :(");var L=React.createElement(a.vj,{title:"Pro Version (Not Installed)",className:"primary"},"You will find more information about the Pro Version ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com"},"here"),". If you actually bought the Pro Version already, please remove the current plugin and download the Pro Version from your account at the ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://meowapps.com/"},"Meow Apps Store"),"."),O=React.createElement(a.vj,{title:"Pro Version (".concat(_,")"),busy:t,className:"primary"},React.createElement(a.rR,{title:"Serial Key",style:{fontWeight:"bold"}},React.createElement(a.Ay,{id:"mfrh_pro_serial",name:"mfrh_pro_serial",disabled:t,value:v,onChange:function(e){return g(e)},placeholder:""})),f&&!k&&React.createElement(a.Ge,null,S),f&&k&&React.createElement(a.CA,null,S),!f&&React.createElement(a.O9,{p:!0},"Insert your serial key above. If you don't have one yet, you can get one ",React.createElement("a",{href:"https://meowapps.com"},"here"),". If there was an error during the validation, try the ",React.createElement("i",null,"Retry")," to ",React.createElement("i",null,"validate")," button."),React.createElement(a.rR,{contentAlign:"right"},f&&!k&&React.createElement(a._Z,{className:"secondary",disabled:t||!v,onClick:x},"Retry to validate"),f&&f.key===v&&React.createElement(a._Z,{className:"secondary",disabled:t||!v,onClick:E},"Remove License"),React.createElement(a._Z,{disabled:t||!v||f&&f.key===v,onClick:x},"Validate License"),o&&!k&&React.createElement(a._Z,{disabled:t||!v||f&&f.key===v,onClick:R,className:"danger"},"Force License")),React.createElement(a.LI,{isOpen:"licenseAdded"===l,title:"Thank you :)",content:"The Pro features have been enabled. This page should be now reloaded.",ok:"Reload",onOkClick:function(){return location.reload()}}),React.createElement(a.LI,{isOpen:"licenseRemoved"===l,title:"Goodbye :(",content:"The Pro features have been disabled. This page should be now reloaded.",ok:"Reload",onOkClick:function(){return location.reload()}}));return m?O:L},At=wp.element.render;function Ct(e){return Ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ct(e)}function Nt(e){return function(e){if(Array.isArray(e))return Yt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||qt(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ft(){Ft=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",i=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function u(e,t,n,a){var o=t&&t.prototype instanceof h?t:h,i=Object.create(o.prototype),c=new k(a||[]);return r(i,"_invoke",{value:E(e,n,c)}),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var f={};function h(){}function m(){}function p(){}var d={};l(d,o,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(S([])));v&&v!==t&&n.call(v,o)&&(d=v);var g=p.prototype=h.prototype=Object.create(d);function b(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function a(r,o,i,c){var l=s(e[r],e,o);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==Ct(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){a("next",e,i,c)}),(function(e){a("throw",e,i,c)})):t.resolve(f).then((function(e){u.value=e,i(u)}),(function(e){return a("throw",e,i,c)}))}c(l.arg)}var o;r(this,"_invoke",{value:function(e,n){function r(){return new t((function(t,r){a(e,n,t,r)}))}return o=o?o.then(r,r):r()}})}function E(e,t,n){var r="suspendedStart";return function(a,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw o;return{value:void 0,done:!0}}for(n.method=a,n.arg=o;;){var i=n.delegate;if(i){var c=R(i,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=s(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function R(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,R(e,t),"throw"===t.method))return f;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,f;var a=r.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function S(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,a=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return a.next=a}}return{next:L}}function L(){return{value:void 0,done:!0}}return m.prototype=p,r(g,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:m,configurable:!0}),m.displayName=l(p,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===m||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,l(e,c,"GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},b(w.prototype),l(w.prototype,i,(function(){return this})),e.AsyncIterator=w,e.async=function(t,n,r,a,o){void 0===o&&(o=Promise);var i=new w(u(t,n,r,a),o);return e.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(g),l(g,c,"Generator"),l(g,o,(function(){return this})),l(g,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=S,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return i.type="throw",i.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=n.call(o,"catchLoc"),l=n.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){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"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;_(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},e}function Dt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Bt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Dt(Object(n),!0).forEach((function(t){Gt(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dt(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Gt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mt(e,t,n,r,a,o,i){try{var c=e[o](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,a)}function Zt(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var o=e.apply(t,n);function i(e){Mt(o,r,a,i,c,"next",e)}function c(e){Mt(o,r,a,i,c,"throw",e)}i(void 0)}))}}function Ut(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],i=!0,c=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);i=!0);}catch(e){c=!0,a=e}finally{try{i||null==n.return||n.return()}finally{if(c)throw a}}return o}}(e,t)||qt(e,t)||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 qt(e,t){if(e){if("string"==typeof e)return Yt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yt(e,t):void 0}}function Yt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}document.meowDashboardLoaded||(document.meowDashboardLoaded=!0,document.addEventListener("DOMContentLoaded",(function(e){var t=document.getElementById("meow-common-dashboard");t&&At(React.createElement(Rt,null),t)})));var Wt=wp.element,Ht=Wt.useState,Qt=Wt.useEffect,$t=function(e,t){if(0==e)return"0 Bytes";var n=t||2,r=Math.floor(Math.log(e)/Math.log(1e3));return parseFloat((e/Math.pow(1e3,r)).toFixed(n))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][r]},Jt=function(){var e=Ut(Ht(!1),2),t=e[0],n=e[1],r=Ut(Ht(null),2),o=r[0],i=r[1],u=Ut(Ht(null),2),f=u[0],h=u[1],g=Ut(Ht(v),2),b=g[0],w=g[1],E=t,R=b.method,x=b.sizes,_=b.retina_sizes,k=b.disabled_sizes,S=b.full_size,L=b.picturefill_keep_src,O=b.picturefill_lazysizes,P=b.picturefill_css_background,j=b.picturefill_noscript,I=b.auto_generate,T=b.over_http_check,z=b.debug,A=b.disable_responsive,C=b.cdn_domain,N=b.big_image_size_threshold,F=b.module_retina_enabled,D=b.module_optimize_enabled,B=b.module_ui_enabled,G=b.hide_retina_column,M=b.hide_retina_dashboard,Z=b.hide_optimize,U=b.image_replace,q=b.easyio_domain,Y=b.easyio_lossless,W="none"===R,H=function(){var e=Zt(Ft().mark((function e(t,r){var o,i;return Ft().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=Bt(Bt({},b),{},Gt({},r,t)),n(!0),e.prev=2,e.next=5,(0,a.ZL)("".concat(s,"/update_option"),{json:{options:o},nonce:d});case 5:(i=e.sent).success&&w(i.options),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(2),alert(e.t0.message);case 12:n(!1);case 13:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t,n){return e.apply(this,arguments)}}(),Q=function(){var e=Zt(Ft().mark((function e(){var t;return Ft().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n(!0),e.prev=1,e.next=4,(0,a.wY)("".concat(s,"/all_settings"),null,null,d);case 4:(t=e.sent).success&&w(t.data),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),alert(e.t0.message);case 11:n(!1);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(){return e.apply(this,arguments)}}(),$=[{value:"Responsive",label:React.createElement("span",null,"Responsive Images")},{value:"Picturefill",label:React.createElement("span",null,"Picturefill (Hybrid)")},{value:"retina.js",label:React.createElement("span",null,"Retina.js (Client-side)")},{value:"HTML Rewrite",label:React.createElement("span",null,"HTML Rewrite (Not Recommended)")},{value:"Retina-Images",label:React.createElement("span",null,"Retina-Images (Not Recommended)")},{value:"none",label:React.createElement("span",null,"None")}],J=function(){var e=Zt(Ft().mark((function e(){var t;return Ft().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!q){e.next=7;break}return e.next=4,(0,a.ZL)("".concat(s,"/easy_io_stats"),{nonce:d});case 4:null!=(t=e.sent)&&t.stats.original&&null!=t&&t.stats.savings&&i(t.stats),null!=t&&t.stats.bandwidth&&null!=t&&t.stats.quota&&h(t.stats);case 7:e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),alert(e.t0.message);case 12:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(){return e.apply(this,arguments)}}();Qt((function(){J()}),[q]);var K=function(){var e=Zt(Ft().mark((function e(t,n){var r;return Ft().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t?Nt(k.filter((function(e){return e!==n}))):[].concat(Nt(k),[n]),H(r,"disabled_sizes");case 2:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),V=function(){var e=Zt(Ft().mark((function e(t,n){var r;return Ft().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t?[].concat(Nt(_),[n]):Nt(_.filter((function(e){return e!==n}))),H(r,"retina_sizes");case 2:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),X=function(){var e=Zt(Ft().mark((function e(){return Ft().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n(!0),e.prev=1,e.next=4,(0,a.ZL)("".concat(s,"/easy_io_link"),{nonce:d});case 4:e.sent,Q(),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),alert(e.t0.message);case 11:n(!1);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(){return e.apply(this,arguments)}}(),ee=function(){var e=Zt(Ft().mark((function e(){return Ft().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n(!0),e.prev=1,e.next=4,(0,a.ZL)("".concat(s,"/easy_io_unlink"),{nonce:d});case 4:e.sent,Q(),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),alert(e.t0.message);case 11:n(!1);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(){return e.apply(this,arguments)}}(),te=React.createElement(a.rR,null,React.createElement("table",{style:{width:"100%"}},React.createElement("thead",null,React.createElement("tr",null,React.createElement("th",{style:{textAlign:"left"}}),React.createElement("th",{style:{textAlign:"left"}},"Name"),React.createElement("th",{style:{textAlign:"left"}},"Dimensions"),React.createElement("th",{style:{textAlign:"left"}},"Retina"))),React.createElement("tbody",null,x&&x.map((function(e){return React.createElement("tr",{key:"sizes-"+e.name},React.createElement("td",null,e.shortname),React.createElement("td",{style:{color:"#007cb9"}},e.name),React.createElement("td",null,e.width?React.createElement(React.Fragment,null,e.width,"x",e.height):React.createElement("small",null,"Unknown (disabled)")),React.createElement("td",null,React.createElement(a.PQ,{id:"retina-"+e.name,disabled:E||!e.enabled,value:"1",checked:e.retina,onChange:function(){return V(!e.retina,e.name)}})))}))))),ne=React.createElement(a.rR,null,React.createElement("table",{style:{width:"100%"}},React.createElement("thead",null,React.createElement("tr",null,React.createElement("th",{style:{textAlign:"left"}}),React.createElement("th",{style:{textAlign:"left"}},"Name"),React.createElement("th",{style:{textAlign:"left"}},"Dimensions"),React.createElement("th",{style:{textAlign:"left"}},"Enabled"))),React.createElement("tbody",null,x&&x.map((function(e){return React.createElement("tr",{key:"sizes-"+e.name},React.createElement("td",null,e.shortname),React.createElement("td",{style:{color:"#007cb9"}},e.name),React.createElement("td",null,e.width?React.createElement(React.Fragment,null,e.width,"x",e.height):React.createElement("small",null,"Unknown (disabled)")),React.createElement("td",null,React.createElement(a.PQ,{id:"enabled-"+e.name,disabled:E,value:"1",checked:e.enabled,onChange:function(){return K(!e.enabled,e.name)}})))}))))),re=React.createElement(a.rR,{title:"Delivery Method"},React.createElement(a.Np,{scrolldown:!0,id:"method",name:"method",disabled:E,value:R,description:"",onChange:H},$.map((function(e){return React.createElement(a.ZB,{key:e.id,id:e.id,value:e.value,label:e.label,requirePro:e.requirePro})})))),ae=React.createElement(a.rR,{title:"Full-Size Retina"},React.createElement(a.PQ,{id:"full_size",disabled:E,label:"Enable",description:React.createElement(React.Fragment,null,"Enable Retina for Full-Size. A ",React.createElement("i",null,"Upload Retina for Full-Size")," button is also added in the ",React.createElement("i",null,"Perfect Images Dashboard"),"."),value:"1",requirePro:!p,checked:S,onChange:H})),oe=React.createElement(a.rR,{title:"Keep IMG SRC"},React.createElement(a.PQ,{id:"picturefill_keep_src",disabled:E,label:"Enable",description:React.createElement(React.Fragment,null,"With PictureFill, ",React.createElement("b",null,"src")," tags are replaced by ",React.createElement("b",null,"src-set")," tags, but Google might fail to reference those images. This option will keep the SRC for SEO purpose, but that will force the download of two images (standard, then retina) by the browsers. Please use the ",React.createElement("b",null,"Lazy Retina")," option below as it avoid this to happen (as well as making it loading lazily)."),value:"1",checked:L,onChange:H})),ie=React.createElement(a.rR,{title:"Responsive Images"},React.createElement(a.PQ,{id:"picturefill_lazysizes",disabled:E,label:"Enable Lazy",description:React.createElement(React.Fragment,null,"Images (including Retina Images) will not be loaded until the visitor gets closer to them. The result will be a ",React.createElement("b",null,"faster")," website that consumes less bandwidth."),value:"1",requirePro:!p,checked:O,onChange:H})),ce=React.createElement(a.rR,{title:"CSS Background"},React.createElement(a.PQ,{id:"picturefill_css_background",disabled:E,label:"Retina-ize",description:React.createElement(React.Fragment,null,"In your HTML, inline CSS Background will be replaced by the Retina version of the image."),value:"1",requirePro:!p,checked:P,onChange:H})),le=React.createElement(a.rR,{title:"Polyfill Script"},React.createElement(a.PQ,{id:"picturefill_noscript",disabled:E,label:"Do not load",description:React.createElement(React.Fragment,null,"Only ",React.createElement("a",{rel:"noreferrer",target:"_blank",href:"https://caniuse.com/srcset"},"the browsers with src-set support")," will display Retina images. You can also choose this if you want to load the Picturefill Polyfill script manually or if it is already loaded by your theme."),value:"1",checked:j,onChange:H})),ue=React.createElement(a.rR,{title:"Retina Images"},React.createElement(a.PQ,{id:"auto_generate",disabled:E,label:"Build Automatically",description:React.createElement(React.Fragment,null,"The Retina Images will be built automatically every time the thumbnails as generated or regenerated."),value:"1",checked:I,onChange:H})),se=React.createElement(a.rR,{title:"Over HTTP Check"},React.createElement(a.PQ,{id:"over_http_check",disabled:E,label:"Enable",description:React.createElement(React.Fragment,null,"This will check the existence of retina images on remote servers. This is useful if your images are hosted on a different server than your WordPress. ",T?React.createElement("b",null,"This option slows down processing dramatically; therefore, caching is absolutely necessary."):""),value:"1",requirePro:!p,checked:!W&&T,onChange:H})),fe=React.createElement(a.rR,{title:"Debug"},React.createElement(a.PQ,{id:"debug",disabled:E,label:"Force Retina + Logging",description:React.createElement(React.Fragment,null,"Displays retina and creates a log file in the plugin folder."),value:"1",checked:z,onChange:H})),he=React.createElement(a.rR,{title:"Responsive Images"},React.createElement(a.PQ,{id:"disable_responsive",disabled:E,label:"Disable",description:React.createElement(React.Fragment,null,"Disable the natural Responsive Images feature built in WordPress. For developers only."),value:"1",checked:A,onChange:H})),me=React.createElement(a.rR,{title:"CDN Domain",requirePro:!p},React.createElement(a.Ay,{id:"cdn_domain",type:"text",disabled:E,value:C,onEnter:H,onBlur:H,description:React.createElement(React.Fragment,null,"If not empty, your site domain will be replaced with this CDN domain.")})),pe=React.createElement(React.Fragment,null,React.createElement(a.rR,{title:"Status"},React.createElement("div",{style:{display:"flex",flexDirection:"column"}},React.createElement("div",{style:{marginBottom:5}},React.createElement(a.O9,null,q&&React.createElement("div",null,React.createElement("b",null,"Easy IO is active."),React.createElement("br",null),React.createElement("small",null,"This is your CDN domain: ",q,".")),!q&&React.createElement("b",null,"Not linked with Easy IO."),!q&&React.createElement("ul",null,React.createElement("li",null,"1. Check the offer and create your account at ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://ewww.io/easy-perfect/ref/6/?campaign=EasyPerfect"},"Perfect Images + Easy IO"),"."),React.createElement("li",null,"2. Use the [",React.createElement("b",null,"PERFECT20"),"] coupon and you will get ",React.createElement("b",null,"20% off"),"."),React.createElement("li",null,"3. Register this website [",React.createElement("b",null,y),"] in the ",React.createElement("a",{target:"_blank",rel:"noreferrer",href:"https://ewww.io/manage-sites/"},"Easy IO Dashboard"),"."),React.createElement("li",null,"4. Click on the button below, and it's all done! 🏁")))),q&&React.createElement("div",null,React.createElement(a._Z,{className:"danger",onClick:ee},"Disable Easy IO")),!q&&React.createElement("div",null,React.createElement(a._Z,{onClick:X},"Verify & Enable Easy IO"))))),de=q?React.createElement(a.rR,{title:"Stats"},React.createElement("div",{style:{display:"flex",flexDirection:"column",fontSize:14}},React.createElement(a.O9,null,React.createElement("span",null,"Bandwidth Usage: "),!f&&React.createElement("span",null,"N/A"),f&&React.createElement("span",null,$t(f.bandwidth)," of ",$t(f.quota)," (",Math.round(f.bandwidth/f.quota*100)+"%",")")),React.createElement(a.O9,null,React.createElement("span",null,"Image Size Reduction: "),!o&&React.createElement("span",null,"N/A"),o&&React.createElement("span",null,Math.round(o.savings/o.original*100)+"%")))):null,ye=q?React.createElement(a.rR,{title:"Lossless Quality"},React.createElement(a.PQ,{id:"easyio_lossless",disabled:!q||E,label:"Enable",description:React.createElement(React.Fragment,null,"Make sure that the visual quality of your images is the same as the original, while still being optimized."),value:"1",checked:Y,onChange:H})):null,ve=React.createElement(a.rR,{title:"Image Threshold"},React.createElement(a.PQ,{id:"big_image_size_threshold",disabled:E,label:"Disable",value:"1",checked:N,onChange:H})),ge=React.createElement(React.Fragment,null,React.createElement(a.rR,{title:"Retina"},React.createElement(a.PQ,{id:"module_retina_enabled",disabled:E,label:"Enabled",value:"1",checked:F,onChange:H})),React.createElement(a.rR,{title:"Optimize"},React.createElement(a.PQ,{id:"module_optimize_enabled",disabled:E,label:"Enabled",value:"1",checked:D,onChange:H})),React.createElement(a.rR,{title:"UI"},React.createElement(a.PQ,{id:"module_ui_enabled",disabled:E,label:"Enabled",value:"1",checked:B,onChange:H}))),be=React.createElement(a.rR,{title:"Image Replace"},React.createElement(a.PQ,{id:"image_replace",disabled:E,label:"Enable",description:React.createElement(React.Fragment,null,"You will then be able to drag & drop an image to replace another in the Perfect Images Dashboard."),requirePro:!p,value:"1",checked:U,onChange:H})),we=React.createElement(a.rR,{title:"Retina Column"},React.createElement(a.PQ,{id:"hide_retina_column",disabled:E,label:"Enable",description:React.createElement(React.Fragment,null,"Add a ",React.createElement("i",null,"Retina")," column in the Media Library."),value:"1",checked:!G,onChange:function(e,t){return H(!e,t)}})),Ee=React.createElement(a.rR,{title:"Dashboard"},React.createElement(a.PQ,{id:"hide_retina_dashboard",disabled:E,label:"Enable",description:React.createElement(React.Fragment,null,"Activate the ",React.createElement("i",null,"Perfect Images Dashboard"),". From there, you can do lot of things!"),value:"1",checked:!M,onChange:function(e,t){return H(!e,t)}})),Re=React.createElement(a.rR,{title:"Optimize Features"},React.createElement(a.PQ,{id:"hide_optimize",disabled:!0,label:"Enable (Beta)",description:React.createElement(React.Fragment,null,"Show the ",React.createElement("i",null,"Optimize Column")," and the related buttons in the Media Library. Those features will work with the binaries and libraries provided by your server, if available."),value:"1",checked:!Z,onChange:function(e,t){return H(!e,t)}}));return React.createElement(a.si,null,React.createElement(a.BP,{title:"Perfect Images + Retina | Settings",subtitle:"By Jordy Meow"},React.createElement("div",{style:{display:"flex",justifyContent:"flex-end"}},React.createElement(a._Z,{className:"header",onClick:function(){return window.open("https://meowapps.com/wp-retina-2x-tutorial/","_blank")}},"Tutorial"),!M&&React.createElement(a._Z,{icon:"dashboard",className:"header",onClick:function(){return location.href="admin.php?page=wr2x_dashboard"}},"Dashboard"))),React.createElement(a.oY,null,React.createElement(a.zc,{full:!0},React.createElement(a.Hq,null,React.createElement(a.O9,{p:!0},"Perfect Images works out of the box. However, to make your install really nice and smooth, you should really take a look at the ",React.createElement("a",{rel:"noreferrer",target:"_blank",href:"https://meowapps.com/wp-retina-2x-tutorial/"},"tutorial"),". Take a bit of time and you will enjoy managing your images with WordPress even more! :)")),React.createElement(a.c4,null,React.createElement(a.Ps,{title:"General"},React.createElement(a.oY,null,React.createElement(a.zc,{minimal:!0},React.createElement(a.vj,{busy:E,title:"Image Sizes",className:"primary"},React.createElement(a.O9,{p:!0},"In this screen, you can disable sizes not only the default sizes added by WordPress, but also the ones added by your theme or other plugins."),ne)),React.createElement(a.zc,{minimal:!0},React.createElement(a.vj,{busy:E,title:"Big Image Threshold",className:"primary"},React.createElement(a.O9,{p:!0},"Since WordPress 5.3, images bigger than 2560px are resized automatically and renamed with ",React.createElement("i",null,"-scaled"),". To learn more about this, have a look at this article: ",React.createElement("a",{rel:"noreferrer",target:"_blank",href:"https://meowapps.com/wordpress-images-sizes/#The_Big_Image_Treshold"},"The WordPress Image Sizes"),"."),ve),React.createElement(a.vj,{busy:E,title:"Modules",className:"primary"},ge)))),B&&React.createElement(a.Ps,{title:"UI"},React.createElement(a.oY,null,React.createElement(a.zc,{minimal:!0},React.createElement(a.vj,{busy:E,title:"UI Features",className:"primary"},Ee,we,Re,be)),React.createElement(a.zc,{minimal:!0}))),F&&React.createElement(a.Ps,{title:"Retinize"},React.createElement(a.oY,null,React.createElement(a.zc,{minimal:!0},React.createElement(a.vj,{busy:E,title:"Image Sizes",className:"primary"},React.createElement(a.O9,{p:!0},"For each of those sizes, you can choose whether or not you would like the Retina image to be generated for it."),te,ue),React.createElement(a.vj,{busy:E,title:"For Full Size",className:"primary"},ae)),React.createElement(a.zc,{minimal:!0},React.createElement(a.vj,{busy:E,title:"Basics",className:"primary"},React.createElement(a.O9,{p:!0},"This controls how the retina images are integrated into your content and delivered to your visitors. The ",React.createElement("b",null,"Responsive Images")," method is recommended. If your theme and plugins are not using WordPress latest evolutions, you might have to try ",React.createElement("b",null,"PictureFill")," or ",React.createElement("b",null,"Retina.js"),"."),re,se)),"Picturefill"===R&&React.createElement(a.zc,{minimal:!0},React.createElement(a.vj,{busy:E,title:"PictureFill",className:"primary"},oe,ce,le)))),D&&React.createElement(a.Ps,{title:"Optimize"},React.createElement(a.oY,null,React.createElement(a.zc,{minimal:!0},React.createElement(a.vj,{busy:E,title:"Perfect Images + Easy IO",className:"primary"},!q&&React.createElement(a.O9,{p:!0},"Are you interested in optimizing your images (including WebP) without slowing down your own server, while using a powerful CDN? This all-in-one solution now exists and is very affordable thanks to an unique partnership between Meow Apps and Easy IO (EWWW). More information is available ",React.createElement("a",{target:"_blank",href:"https://meowapps.com/wp-retina-2x-tutorial/#Optimize_your_Images_and_Use_a_CDN"},"here"),"."),pe,de,ye)),React.createElement(a.zc,{minimal:!0},React.createElement(a.vj,{busy:E,title:"Lazy Loading",className:"primary"},React.createElement(a.O9,{p:!0},"Since WordPress 5.5, images are automatically lazy, and it is also using a feature included in the modern browser. It is recommended to use this new feature instead of customized one (through other plugins, or this option) since it is using no script and does not require any modification. If there is an problem with it, you can still enable the option below."),ie)))),React.createElement(a.Ps,{title:"Advanced"},React.createElement(a.oY,null,React.createElement(a.zc,{minimal:!0},React.createElement(a.vj,{busy:E,className:"primary"},he,fe)),React.createElement(a.zc,{minimal:!0},React.createElement(a.vj,{busy:E,className:"primary"},React.createElement(a.O9,{p:!0},"If you are using a CDN, enter your CDN subdomain here. If you are using Easy IO CDN, you don't need this, and you can directly use the options available in ",React.createElement("i",null,"Optimization & Speed"),"."),me)))),React.createElement(a.Ps,{title:"Pro Version"},React.createElement(zt,{domain:l,prefix:c,isPro:m,isRegistered:p}))))))},Kt=function(){return React.createElement(React.Fragment,null,React.createElement("h1",{style:{marginTop:20}},"Upload New Retina Image"),React.createElement("p",null,"The Retina Image you upload here will become your Retina Image for Full-Size. Automatically, WP Retina 2x will generate the normal Full-Size image which will be basically divided by two. The thumbnails and retina thumbnails will also be generated based on your options. ",React.createElement("b",null,"For now, this uploader only works with one by one file.")),React.createElement(a.Ii,{style:{border:"4px dashed #b4b9be"},height:200,onFailure:function(e){alert(e.message)},onSuccess:function(){alert("Uploaded!")},apiUrl:"".concat(s,"/upload_retina"),apiConfig:{nonce:d}}))},Vt=wp.element.render,Xt={fetcher:a.SG,revalidateOnFocus:!1};function en(){Array.from(document.getElementsByClassName("wr2x-retina-field")).forEach((function(e){var t=e.getAttribute("data-id");Vt(React.createElement(r.J$,{value:Xt},React.createElement(pe,{natural:!0,mediaId:t})),e)}))}document.addEventListener("DOMContentLoaded",(function(){var e,t;new window.MutationObserver((function(){en()})).observe(document.documentElement,{childList:!0,subtree:!0}),(e=document.getElementById("wr2x-admin-settings"))&&Vt(React.createElement(r.J$,{value:Xt},React.createElement(Jt,null)),e),(t=document.getElementById("wr2x-dashboard"))&&Vt(React.createElement(r.J$,{value:Xt},React.createElement($,null,React.createElement(Ge,null))),t),en(),function(){var e=document.getElementById("wr2x-fullsize-uploader");e&&Vt(React.createElement(r.J$,{value:Xt},React.createElement(Kt,null)),e)}()}))},7363:function(e){e.exports=React},1533:function(e){e.exports=ReactDOM}},n={};function r(e){var a=n[e];if(void 0!==a)return a.exports;var o=n[e]={exports:{}};return t[e](o,o.exports,r),o.exports}r.m=t,r.amdO={},e=[],r.O=function(t,n,a,o){if(!n){var i=1/0;for(s=0;s<e.length;s++){n=e[s][0],a=e[s][1],o=e[s][2];for(var c=!0,l=0;l<n.length;l++)(!1&o||i>=o)&&Object.keys(r.O).every((function(e){return r.O[e](n[l])}))?n.splice(l--,1):(c=!1,o<i&&(i=o));if(c){e.splice(s--,1);var u=a();void 0!==u&&(t=u)}}return t}o=o||0;for(var s=e.length;s>0&&e[s-1][2]>o;s--)e[s]=e[s-1];e[s]=[n,a,o]},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e={826:0};r.O.j=function(t){return 0===e[t]};var t=function(t,n){var a,o,i=n[0],c=n[1],l=n[2],u=0;if(i.some((function(t){return 0!==e[t]}))){for(a in c)r.o(c,a)&&(r.m[a]=c[a]);if(l)var s=l(r)}for(t&&t(n);u<i.length;u++)o=i[u],r.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return r.O(s)},n=self.wpJsonWr2x=self.wpJsonWr2x||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}(),r.nc=void 0;var a=r.O(void 0,[736],(function(){return r(4533)}));a=r.O(a)}();
3
  //# sourceMappingURL=index.js.map
classes/core.php CHANGED
@@ -596,6 +596,84 @@ class Meow_WR2X_Core {
596
  return $ignores;
597
  }
598
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
599
  /**
600
  *
601
  * GET DETAILS / INFO
596
  return $ignores;
597
  }
598
 
599
+ // OPTIMIZE ISSUES
600
+
601
+ function get_optimize_issues( $search = '' ) {
602
+ if ( $search ) {
603
+ return $this->calculate_issues_by_search( $search );
604
+ }
605
+ $optimize_issues = get_transient( 'wr2x_optimize_issues' );
606
+ if ( !$optimize_issues || !is_array( $optimize_issues ) ) {
607
+ $optimize_issues = $this->calculate_optimize_issues();
608
+ }
609
+ return $optimize_issues;
610
+ }
611
+
612
+ function calculate_optimize_issues() {
613
+ global $wpdb;
614
+ $postids = $wpdb->get_col( "
615
+ SELECT p.ID FROM $wpdb->posts p
616
+ WHERE post_status = 'inherit'
617
+ AND post_type = 'attachment'" . $this->create_sql_if_wpml_original() . "
618
+ AND ( post_mime_type = 'image/jpeg' OR
619
+ post_mime_type = 'image/jpg' OR
620
+ post_mime_type = 'image/png' OR
621
+ post_mime_type = 'image/gif' )
622
+ AND NOT EXISTS ( SELECT meta_id FROM $wpdb->postmeta WHERE post_id = p.ID AND meta_key = '_wr2x_optimize' )
623
+ " );
624
+ $ignored = $this->get_ignores();
625
+ $optimize_issues = array_filter( $postids, fn ( $id ) => !in_array( $id, $ignored ) );
626
+ set_transient( 'wr2x_optimize_issues', $optimize_issues );
627
+
628
+ return $optimize_issues;
629
+ }
630
+
631
+ function calculate_optimize_issues_by_search( $search ) {
632
+ global $wpdb;
633
+ $postids = $wpdb->get_col( $wpdb->prepare( "
634
+ SELECT p.ID FROM $wpdb->posts p
635
+ WHERE post_status = 'inherit'
636
+ AND p.post_title LIKE %s
637
+ AND post_type = 'attachment'" . $this->create_sql_if_wpml_original() . "
638
+ AND ( post_mime_type = 'image/jpeg' OR
639
+ post_mime_type = 'image/jpg' OR
640
+ post_mime_type = 'image/png' OR
641
+ post_mime_type = 'image/gif' )
642
+ AND NOT EXISTS ( SELECT meta_id FROM $wpdb->postmeta WHERE post_id = p.ID AND meta_key = '_wr2x_optimize' )
643
+ ", ( '%' . $search . '%' ) ) );
644
+ $ignored = $this->get_ignores();
645
+ return array_filter( $postids, fn ( $id ) => in_array( $id, $ignored ) );
646
+ }
647
+
648
+ function add_optimize_issue( $attachmentId ) {
649
+ if ( $this->is_ignore( $attachmentId ) )
650
+ return;
651
+ $optimize_issues = $this->get_optimize_issues();
652
+ if ( !in_array( $attachmentId, $optimize_issues ) ) {
653
+ array_push( $optimize_issues, $attachmentId );
654
+ set_transient( 'wr2x_optimize_issues', $optimize_issues );
655
+ }
656
+ return $optimize_issues;
657
+ }
658
+
659
+ function remove_optimize_issue( $attachmentId ) {
660
+ $optimize_issues = array_diff( $this->get_optimize_issues(), array( $attachmentId ) );
661
+ set_transient( 'wr2x_optimize_issues', $optimize_issues );
662
+ return $optimize_issues;
663
+ }
664
+
665
+ function update_optimise_issue_status( $attachment_id ) {
666
+ $optimize_issues = $this->get_optimize_issues();
667
+ $considered_optimize_issue = in_array( $attachment_id, $optimize_issues );
668
+ $optimize_post_meta = get_post_meta( $attachment_id, '_wr2x_optimize', true );
669
+ $is_optimized = !empty( $optimize_post_meta );
670
+
671
+ if ( $considered_optimize_issue && $is_optimized )
672
+ $this->remove_optimize_issue( $attachment_id );
673
+ else if ( !$considered_optimize_issue && !$is_optimized )
674
+ $this->add_optimize_issue( $attachment_id );
675
+ }
676
+
677
  /**
678
  *
679
  * GET DETAILS / INFO
classes/optimize.php CHANGED
@@ -125,6 +125,9 @@ class Meow_WR2X_Optimize
125
  $normal_file_optimized_result = $this->optimize($normal_file);
126
  $retina_file_optimized_result = $this->optimize($retina_file);
127
  }
 
 
 
128
  }
129
 
130
  /**
125
  $normal_file_optimized_result = $this->optimize($normal_file);
126
  $retina_file_optimized_result = $this->optimize($retina_file);
127
  }
128
+
129
+ // Update optimize issue status
130
+ $this->core->update_optimise_issue_status( $media_id );
131
  }
132
 
133
  /**
classes/rest.php CHANGED
@@ -133,6 +133,10 @@ class Meow_WR2X_Rest
133
  return count( $this->core->get_ignores($search) );
134
  }
135
 
 
 
 
 
136
  function count_all($search) {
137
  global $wpdb;
138
  $whereSql = '';
@@ -145,12 +149,13 @@ class Meow_WR2X_Rest
145
  );
146
  }
147
 
148
- function rest_get_stats($request) {
149
  $search = sanitize_text_field( $request->get_param('search') );
150
  return new WP_REST_Response( [ 'success' => true, 'data' => array(
151
- 'issues' => $this->count_issues($search),
152
- 'ignored' => $this->count_ignored($search),
153
- 'all' => $this->count_all($search)
 
154
  ) ], 200 );
155
  }
156
 
@@ -177,6 +182,7 @@ class Meow_WR2X_Rest
177
 
178
  function rest_refresh() {
179
  $this->core->calculate_issues();
 
180
  return new WP_REST_Response( [ 'success' => true ], 200 );
181
  }
182
 
@@ -190,15 +196,8 @@ class Meow_WR2X_Rest
190
  function get_media_status( $skip = 0, $limit = 10, $filterBy = 'all', $orderBy = 'id', $order = 'desc', $search = '' ) {
191
  global $wpdb;
192
  $whereIsIn = '';
193
- if ( $filterBy === 'issues' ) {
194
- $in = $this->core->get_issues();
195
- if ( empty( $in ) ) {
196
- return array();
197
- }
198
- $whereIsIn = 'AND p.ID IN (' . implode( ',', $in ) . ')';
199
- }
200
- else if ( $filterBy === 'ignored' ) {
201
- $in = $this->core->get_ignores();
202
  if ( empty( $in ) ) {
203
  return array();
204
  }
@@ -256,6 +255,26 @@ class Meow_WR2X_Rest
256
  return $entries;
257
  }
258
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
  function rest_media( $request ) {
260
  $limit = trim( $request->get_param('limit') );
261
  $skip = trim( $request->get_param('skip') );
133
  return count( $this->core->get_ignores($search) );
134
  }
135
 
136
+ function count_optimize_issues( $search ) {
137
+ return count( $this->core->get_optimize_issues( $search ) );
138
+ }
139
+
140
  function count_all($search) {
141
  global $wpdb;
142
  $whereSql = '';
149
  );
150
  }
151
 
152
+ function rest_get_stats( $request ) {
153
  $search = sanitize_text_field( $request->get_param('search') );
154
  return new WP_REST_Response( [ 'success' => true, 'data' => array(
155
+ 'issues' => $this->count_issues( $search ),
156
+ 'ignored' => $this->count_ignored( $search ),
157
+ 'optimizeIssues' => $this->count_optimize_issues( $search ),
158
+ 'all' => $this->count_all( $search )
159
  ) ], 200 );
160
  }
161
 
182
 
183
  function rest_refresh() {
184
  $this->core->calculate_issues();
185
+ $this->core->calculate_optimize_issues();
186
  return new WP_REST_Response( [ 'success' => true ], 200 );
187
  }
188
 
196
  function get_media_status( $skip = 0, $limit = 10, $filterBy = 'all', $orderBy = 'id', $order = 'desc', $search = '' ) {
197
  global $wpdb;
198
  $whereIsIn = '';
199
+ if ( $filterBy !== 'all' ) {
200
+ $in = $this->get_filtered_post_ids( $filterBy );
 
 
 
 
 
 
 
201
  if ( empty( $in ) ) {
202
  return array();
203
  }
255
  return $entries;
256
  }
257
 
258
+ function get_filtered_post_ids( $filterBy ) {
259
+ switch ( $filterBy ) {
260
+ case 'issues':
261
+ return $this->core->get_issues();
262
+ break;
263
+
264
+ case 'ignored':
265
+ return $this->core->get_ignores();
266
+ break;
267
+
268
+ case 'optimizeIssues':
269
+ return $this->core->get_optimize_issues();
270
+ break;
271
+
272
+ default:
273
+ return null;
274
+ break;
275
+ }
276
+ }
277
+
278
  function rest_media( $request ) {
279
  $limit = trim( $request->get_param('limit') );
280
  $skip = trim( $request->get_param('skip') );
readme.txt CHANGED
@@ -1,11 +1,11 @@
1
- === Perfect Images - Media Replace, Generate Thumbnails, Image Sizes, Optimization & Retina! ===
2
  Contributors: TigrouMeow
3
  Tags: retina, images, replace, size, thumbnail, regenerate, sizes, high-dpi
4
  Donate link: https://meowapps.com/donation/
5
  Requires at least: 5.0
6
  Tested up to: 6.1
7
  Requires PHP: 7.4.30
8
- Stable tag: 6.3.5
9
 
10
  Manage your images the right way: set your sizes, optimize, retinize, replace, and more! Everything you need for perfect images.
11
 
@@ -51,7 +51,7 @@ The Pro version adds support for Retina for full-size, support for lazy-loading
51
 
52
  == Changelog ==
53
 
54
- = 6.3.5 (2022/11/15) =
55
  * Update: Still going towards a better UI organization.
56
  * Info: If you enjoy this plugin, please share some love by [writing a little review here](https://wordpress.org/support/plugin/wp-retina-2x/reviews/?rate=5#new-post). And since I read them all, don't hesitate to drop a few remarks and feature requests in those reviews. Thank you :)
57
 
1
+ === Perfect Images (Media Replace Generate Thumbnails Image Sizes Optimize HighDPI) ===
2
  Contributors: TigrouMeow
3
  Tags: retina, images, replace, size, thumbnail, regenerate, sizes, high-dpi
4
  Donate link: https://meowapps.com/donation/
5
  Requires at least: 5.0
6
  Tested up to: 6.1
7
  Requires PHP: 7.4.30
8
+ Stable tag: 6.3.6
9
 
10
  Manage your images the right way: set your sizes, optimize, retinize, replace, and more! Everything you need for perfect images.
11
 
51
 
52
  == Changelog ==
53
 
54
+ = 6.3.6 (2022/11/25) =
55
  * Update: Still going towards a better UI organization.
56
  * Info: If you enjoy this plugin, please share some love by [writing a little review here](https://wordpress.org/support/plugin/wp-retina-2x/reviews/?rate=5#new-post). And since I read them all, don't hesitate to drop a few remarks and feature requests in those reviews. Thank you :)
57
 
wp-retina-2x.php CHANGED
@@ -1,9 +1,9 @@
1
  <?php
2
  /*
3
- Plugin Name: Perfect Images - Media Replace, Generate Thumbnails, Image Sizes, Optimization & Retina!
4
  Plugin URI: https://meowapps.com
5
  Description: Manage your images the right way: set your sizes, optimize, retinize, replace, and more! Everything you need for perfect images.
6
- Version: 6.3.5
7
  Author: Jordy Meow
8
  Author URI: https://meowapps.com
9
  Text Domain: wp-retina-2x
@@ -15,7 +15,7 @@ Originally developed for two of my websites:
15
  */
16
 
17
  if ( !defined( 'WR2X_VERSION' ) ) {
18
- define( 'WR2X_VERSION', '6.3.5' );
19
  define( 'WR2X_PREFIX', 'wr2x' );
20
  define( 'WR2X_DOMAIN', ' wp-retina-2x' );
21
  define( 'WR2X_ENTRY', __FILE__ );
1
  <?php
2
  /*
3
+ Plugin Name: Perfect Images (Media Replace Generate Thumbnails Image Sizes Optimize • HighDPI)
4
  Plugin URI: https://meowapps.com
5
  Description: Manage your images the right way: set your sizes, optimize, retinize, replace, and more! Everything you need for perfect images.
6
+ Version: 6.3.6
7
  Author: Jordy Meow
8
  Author URI: https://meowapps.com
9
  Text Domain: wp-retina-2x
15
  */
16
 
17
  if ( !defined( 'WR2X_VERSION' ) ) {
18
+ define( 'WR2X_VERSION', '6.3.6' );
19
  define( 'WR2X_PREFIX', 'wr2x' );
20
  define( 'WR2X_DOMAIN', ' wp-retina-2x' );
21
  define( 'WR2X_ENTRY', __FILE__ );