Regenerate Thumbnails - Version 3.0.0

Version Description

Download this release

Release Info

Developer Viper007Bond
Plugin Icon 128x128 Regenerate Thumbnails
Version 3.0.0
Comparing to
See all releases

Code changes from version 2.3.1 to 3.0.0

css/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png ADDED
Binary file
css/images/ui-bg_inset-hard_100_fcfdfd_1x100.png ADDED
Binary file
css/progressbar.css ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* This is based on jQuery UI */
2
+ #regenerate-thumbnails-app .ui-progressbar {
3
+ height: 2em;
4
+ text-align: center;
5
+ overflow: hidden;
6
+ }
7
+ #regenerate-thumbnails-app .ui-progressbar .ui-progressbar-value {
8
+ margin: -1px;
9
+ height: 100%;
10
+ transition-duration: 0.5s;
11
+ }
12
+ #regenerate-thumbnails-app .ui-widget.ui-widget-content {
13
+ border: 1px solid #c5dbec;
14
+ }
15
+ #regenerate-thumbnails-app .ui-widget-content {
16
+ border: 1px solid #a6c9e2;
17
+ background: #fcfdfd url("images/ui-bg_inset-hard_100_fcfdfd_1x100.png") 50% bottom repeat-x;
18
+ color: #222222;
19
+ }
20
+ #regenerate-thumbnails-app .ui-widget-header {
21
+ border: 1px solid #4297d7;
22
+ background: #5c9ccc url("images/ui-bg_gloss-wave_55_5c9ccc_500x100.png") 50% 50% repeat-x;
23
+ color: #ffffff;
24
+ font-weight: bold;
25
+ }
26
+ #regenerate-thumbnails-app .ui-corner-all {
27
+ border-radius: 5px;
28
+ }
29
+ #regenerate-thumbnails-app .ui-corner-left {
30
+ border-top-left-radius: 5px;
31
+ border-bottom-left-radius: 5px;
32
+ }
dist/build.js ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ !function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=12)}([function(e,t){e.exports=function(e,t,n,r,i,o){var a,s=e=e||{},u=typeof e.default;"object"!==u&&"function"!==u||(a=e,s=e.default);var c="function"==typeof s?s.options:s;t&&(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0),n&&(c.functional=!0),i&&(c._scopeId=i);var l;if(o?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(o)},c._ssrRegister=l):r&&(l=r),l){var f=c.functional,p=f?c.render:c.beforeCreate;f?(c._injectStyles=l,c.render=function(e,t){return l.call(t),p(e,t)}):c.beforeCreate=p?[].concat(p,l):[l]}return{esModule:a,exports:s,options:c}}},function(e,t,n){"use strict";var r="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};String.prototype.formatUnicorn=String.prototype.formatUnicorn||function(){var e=this.toString();if(arguments.length){var t,n=r(arguments[0]),i="string"===n||"number"===n?Array.prototype.slice.call(arguments):arguments[0];for(t in i)e=e.replace(new RegExp("\\{"+t+"\\}","gi"),i[t])}return e}},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(20),o=r(i),a=n(24),s=r(a);t.default={data:function(){return{currentView:o.default,settings:{}}},methods:{regenerate:function(e){o.default===this.currentView&&(this.settings={onlyMissing:document.getElementById("regenthumbs-regenopt-onlymissing").checked,updatePosts:document.getElementById("regenthumbs-regenopt-updateposts").checked,deleteOld:document.getElementById("regenthumbs-regenopt-deleteoldthumbnails").checked}),this.settings.regenerateWhat=e,this.currentView=s.default}},components:{HomeIntro:o.default}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(21),i=function(e){return e&&e.__esModule?e:{default:e}}(r);n(1),t.default={data:function(){return{regenerateThumbnails:regenerateThumbnails,usingFeaturedImages:!1,ButtonAllText:regenerateThumbnails.l10n.Home.RegenerateThumbnailsForAllAttachments,ButtonFeaturedImagesText:regenerateThumbnails.l10n.Home.RegenerateThumbnailsForFeaturedImagesOnly,checkboxOnlyMissing:regenerateThumbnails.options.onlyMissingThumbnails,checkboxUpdatePosts:regenerateThumbnails.options.updatePostContents,checkboxDeleteOld:regenerateThumbnails.options.deleteOldThumbnails}},computed:{alternativesText1:function(){return this.regenerateThumbnails.l10n.Home.alternativesText1.formatUnicorn({"url-cli":"https://en.wikipedia.org/wiki/Command-line_interface","url-wpcli":"https://wp-cli.org/","url-wpcli-regenerate":"https://developer.wordpress.org/cli/commands/media/regenerate/"})},alternativesText2:function(){return this.regenerateThumbnails.l10n.Home.alternativesText2.formatUnicorn({"url-photon":"https://jetpack.com/support/photon/","url-jetpack":"https://jetpack.com/"})}},created:function(){var e=this;this.regenerateThumbnails.data.thumbnailIDs||(wp.apiRequest({namespace:"wp/v2",endpoint:"media",data:{_fields:"id",is_regeneratable:1,exclude_site_icons:1,per_page:1},type:"GET",dataType:"json",cache:!1,context:this}).done(function(t,n,r){e.ButtonAllText=e.regenerateThumbnails.l10n.Home.RegenerateThumbnailsForAllXAttachments.formatUnicorn({attachmentCount:r.getResponseHeader("x-wp-total").toLocaleString()})}).fail(function(e,t,n){console.log("Regenerate Thumbnails: Error getting the total attachment count.",e,t,n)}),wp.apiRequest({namespace:"regenerate-thumbnails/v1",endpoint:"featuredimages",data:{per_page:1},type:"GET",dataType:"json",cache:!1,context:this}).done(function(t,n,r){e.ButtonAllText=e.regenerateThumbnails.l10n.Home.RegenerateThumbnailsForAllXAttachments.formatUnicorn({attachmentCount:r.getResponseHeader("x-wp-total").toLocaleString()}),r.getResponseHeader("x-wp-total")<1?e.usingFeaturedImages=!1:(e.ButtonFeaturedImagesText=e.regenerateThumbnails.l10n.Home.RegenerateThumbnailsForXFeaturedImagesOnly.formatUnicorn({attachmentCount:r.getResponseHeader("x-wp-total").toLocaleString()}),e.usingFeaturedImages=!0)}).fail(function(e,t,n){console.log("Regenerate Thumbnails: Error getting the total featured images count.",e,t,n)}))},methods:{regenerate:function(e){this.$emit("regenerate",e)},checkboxChange:function(e,t){this[e]=t.target.checked,"checkboxDeleteOld"===e&&this[e]&&(this.checkboxUpdatePosts=!0)}},components:{ThumbnailSize:i.default}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(1),t.default={props:["size","text","textCropped","textProportional"],computed:{thumbnail:function(){return this.size.cropMethod=this.size.crop?this.textCropped:this.textProportional,this.text.formatUnicorn(this.size)}}}},function(e,t){function n(e,t){var n=e[1]||"",i=e[3];if(!i)return n;if(t&&"function"==typeof btoa){var o=r(i);return[n].concat(i.sources.map(function(e){return"/*# sourceURL="+i.sourceRoot+e+" */"})).concat([o]).join("\n")}return[n].join("\n")}function r(e){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(e))))+" */"}e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var r=n(t,e);return t[2]?"@media "+t[2]+"{"+r+"}":r}).join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(r[o]=!0)}for(i=0;i<e.length;i++){var a=e[i];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(e,t,n){function r(e){for(var t=0;t<e.length;t++){var n=e[t],r=l[n.id];if(r){r.refs++;for(var i=0;i<r.parts.length;i++)r.parts[i](n.parts[i]);for(;i<n.parts.length;i++)r.parts.push(o(n.parts[i]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{for(var a=[],i=0;i<n.parts.length;i++)a.push(o(n.parts[i]));l[n.id]={id:n.id,refs:1,parts:a}}}}function i(){var e=document.createElement("style");return e.type="text/css",f.appendChild(e),e}function o(e){var t,n,r=document.querySelector('style[data-vue-ssr-id~="'+e.id+'"]');if(r){if(h)return v;r.parentNode.removeChild(r)}if(m){var o=d++;r=p||(p=i()),t=a.bind(null,r,o,!1),n=a.bind(null,r,o,!0)}else r=i(),t=s.bind(null,r),n=function(){r.parentNode.removeChild(r)};return t(e),function(r){if(r){if(r.css===e.css&&r.media===e.media&&r.sourceMap===e.sourceMap)return;t(e=r)}else n()}}function a(e,t,n,r){var i=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=g(t,i);else{var o=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(o,a[t]):e.appendChild(o)}}function s(e,t){var n=t.css,r=t.media,i=t.sourceMap;if(r&&e.setAttribute("media",r),i&&(n+="\n/*# sourceURL="+i.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}var u="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!u)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var c=n(27),l={},f=u&&(document.head||document.getElementsByTagName("head")[0]),p=null,d=0,h=!1,v=function(){},m="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());e.exports=function(e,t,n){h=n;var i=c(e,t);return r(i),function(t){for(var n=[],o=0;o<i.length;o++){var a=i[o],s=l[a.id];s.refs--,n.push(s)}t?(i=c(e,t),r(i)):i=[];for(var o=0;o<n.length;o++){var s=n[o];if(0===s.refs){for(var u=0;u<s.parts.length;u++)s.parts[u]();delete l[s.id]}}}};var g=function(){var e=[];return function(t,n){return e[t]=n,e.filter(Boolean).join("\n")}}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(28),i=function(e){return e&&e.__esModule?e:{default:e}}(r);n(1),t.default={props:["settings"],data:function(){return{regenerateThumbnails:regenerateThumbnails,listStart:1,progress:0,logItems:[],errorItems:[],isPaused:!1,finishedMessage:!1}},mounted:function(){function e(){var r="wp/v2",s="media",u={page:o,per_page:5};switch(n.settings.regenerateWhat){case"featured-images":r="regenerate-thumbnails/v1",s="featuredimages";break;case"all":default:u._fields="id",u.is_regeneratable=1,u.exclude_site_icons=1,u.orderby="id",u.order="asc"}wp.apiRequest({namespace:r,endpoint:s,data:u,type:"GET",dataType:"json",context:n}).done(function(e,n,r){c=3,i=r.getResponseHeader("x-wp-total"),a=r.getResponseHeader("x-wp-totalpages"),t(e)}).fail(function(t,r,i){console.log("Regenerate Thumbnails: Error getting a chunk of thumbnail IDs to process.",t,r,i),c>1?(c--,e()):n.finishedMessage=n.regenerateThumbnails.l10n.RegenerateMultiple.error})}function t(c){if(n.isPaused)return void setTimeout(function(){u+=1e3,t(c)},1e3);var p=c.shift();wp.apiRequest({namespace:"regenerate-thumbnails/v1",endpoint:"regenerate/"+p.id,data:{only_regenerate_missing_thumbnails:n.settings.onlyMissing,delete_unregistered_thumbnail_files:n.settings.deleteOld,update_usages_in_posts:n.settings.updatePosts},type:"POST",dataType:"json",context:n}).done(function(e,t,r){var i=document.createElement("a");i.href=e.edit_url,i.textContent=e.name,e.name=i.outerHTML,n.logItems.push({id:e.id,message:n.regenerateThumbnails.l10n.RegenerateMultiple.logRegeneratedItem.formatUnicorn(e)})}).fail(function(e,t,r){console.log("Regenerate Thumbnails: Error while trying to regenerate attachment ID "+p.id,e,t,r);var i={};i=void 0!==e.responseJSON.data.attachment?{id:e.responseJSON.data.attachment.ID,message:n.regenerateThumbnails.l10n.RegenerateMultiple.logSkippedItem.formatUnicorn({name:e.responseJSON.data.attachment.post_title,reason:e.responseJSON.message})}:{id:p.id,message:n.regenerateThumbnails.l10n.RegenerateMultiple.logSkippedItem.formatUnicorn({name:"Attachment ID "+p.id,reason:e.responseJSON.message})},console.log(i),n.logItems.push(i),n.errorItems.push(i)}).always(function(){if(r++,n.progress=Math.round(r/i*100),l.innerHTML=n.progress+"% | "+f,n.logItems.length>s&&(n.logItems=n.logItems.slice(-1*s),n.listStart=r-s+1),r==i){var p=(Date.now()-u)/1e3,d="";if(p>3600){var h=p/3600;d=n.regenerateThumbnails.l10n.RegenerateMultiple.hours.formatUnicorn({count:h.toFixed(1)})}else if(p>60){var v=p/3600;d=n.regenerateThumbnails.l10n.RegenerateMultiple.minutes.formatUnicorn({count:v.toFixed(1)})}else d=n.regenerateThumbnails.l10n.RegenerateMultiple.seconds.formatUnicorn({count:p.toFixed()});n.finishedMessage=n.regenerateThumbnails.l10n.RegenerateMultiple.duration.formatUnicorn({duration:d})}c.length>0?t(c):o<a&&(o++,e())})}var n=this,r=0,i=0,o=1,a=0,s=500,u=Date.now(),c=3,l=document.getElementsByTagName("title")[0],f=l.innerHTML;if(l.innerHTML=n.progress+"% | "+f,window.onbeforeunload=function(){return!0},Array.isArray(n.settings.regenerateWhat)){var p=[],d=!0,h=!1,v=void 0;try{for(var m,g=n.settings.regenerateWhat[Symbol.iterator]();!(d=(m=g.next()).done);d=!0){var y=m.value;p.push({id:y})}}catch(e){h=!0,v=e}finally{try{!d&&g.return&&g.return()}finally{if(h)throw v}}i=n.settings.regenerateWhat.length,t(p)}else e();window.onbeforeunload=void 0},updated:function(){this.$nextTick(function(){var e=document.getElementById("regenerate-thumbnails-log");e.scrollHeight-e.scrollTop<=e.clientHeight+25&&(e.scrollTop=e.scrollHeight-e.clientHeight)})},methods:{togglePause:function(){this.isPaused=!this.isPaused}},components:{ProgressBar:i.default}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={props:["progress"]}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(35),i=function(e){return e&&e.__esModule?e:{default:e}}(r);n(1),t.default={props:["id"],data:function(){return{regenerateThumbnails:regenerateThumbnails,dataLoaded:!1,errorText:!1,attachmentInfo:{},regenerationComplete:!1,regenerationError:!1}},created:function(){var e=this;wp.apiRequest({namespace:"regenerate-thumbnails/v1",endpoint:"attachmentinfo/"+this.id,type:"GET",dataType:"json",context:this}).done(function(t,n,r){e.attachmentInfo=t,void 0!==e.attachmentInfo.error?e.errorText=e.regenerateThumbnails.l10n.RegenerateSingle.errorWithMessage.formatUnicorn(e.attachmentInfo):document.getElementsByTagName("title")[0].innerHTML=e.regenerateThumbnails.l10n.RegenerateSingle.title.formatUnicorn(e.attachmentInfo),e.dataLoaded=!0}).fail(function(t,n,r){e.errorText=e.regenerateThumbnails.l10n.RegenerateSingle.errorWithMessage.formatUnicorn({error:t.responseJSON.message}),e.dataLoaded=!0,console.log("ERROR!",t,n,r)})},computed:{filenameAndDimensions:function(){return this.attachmentInfo.width&&this.attachmentInfo.height?this.regenerateThumbnails.l10n.RegenerateSingle.filenameAndDimensions.formatUnicorn({filename:this.attachmentInfo.relative_path,width:this.attachmentInfo.width,height:this.attachmentInfo.height}):"<code>"+this.attachmentInfo.relative_path+"</code>"}},methods:{regenerate:function(e){var t=this;if(this.regenerationComplete)return void history.back();e.target.disabled=!0,e.target.innerText=regenerateThumbnails.l10n.RegenerateSingle.regenerating,this.regenerateThumbnails.options.onlyMissingThumbnails=document.getElementById("regenthumbs-regenopt-onlymissing").checked,this.regenerateThumbnails.options.deleteOldThumbnails=document.getElementById("regenthumbs-regenopt-deleteoldthumbnails").checked,this.regenerateThumbnails.options.updatePostContents=document.getElementById("regenthumbs-regenopt-updateposts").checked,wp.apiRequest({namespace:"regenerate-thumbnails/v1",endpoint:"regenerate/"+this.id,data:{regeneration_args:{only_regenerate_missing_thumbnails:this.regenerateThumbnails.options.onlyMissingThumbnails,delete_unregistered_thumbnail_files:this.regenerateThumbnails.options.deleteOldThumbnails},update_usages_in_posts:this.regenerateThumbnails.options.updatePostContents},type:"POST",dataType:"json",context:this}).done(function(n,r,i){t.regenerationComplete=!0,t.attachmentInfo=n,e.target.innerText=regenerateThumbnails.l10n.RegenerateSingle.done,e.target.disabled=!1}).fail(function(n,r,i){e.target.innerText=regenerateThumbnails.l10n.RegenerateSingle.errorRegenerating,t.regenerationError=t.regenerateThumbnails.l10n.RegenerateSingle.errorRegeneratingMessage.formatUnicorn(n.responseJSON),console.log("ERROR!",n,r,i)})},checkUpdatePosts:function(e){e.target.checked&&(document.getElementById("regenthumbs-regenopt-updateposts").checked=!0)}},components:{ThumbnailStatus:i.default}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(1),t.default={props:["size","l10n"],computed:{thumbnailText:function(){return this.size.filename?void 0!==this.size.crop?(this.size.cropMethod=this.size.crop?this.l10n.common.thumbnailSizeItemIsCropped:this.l10n.common.thumbnailSizeItemIsProportional,this.l10n.common.thumbnailSizeItemWithCropMethod.formatUnicorn(this.size)):this.l10n.common.thumbnailSizeItemWithoutCropMethod.formatUnicorn(this.size):this.l10n.common.thumbnailSizeBiggerThanOriginal.formatUnicorn(this.size)}}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(13),o=r(i),a=n(17),s=r(a),u=n(18),c=r(u);o.default.use(s.default);var l=new s.default({routes:c.default});new o.default({router:l}).$mount("#regenerate-thumbnails-app")},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,n){function r(e){return void 0===e||null===e}function i(e){return void 0!==e&&null!==e}function o(e){return!0===e}function a(e){return!1===e}function s(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e}function u(e){return null!==e&&"object"==typeof e}function c(e){return"[object Object]"===to.call(e)}function l(e){return"[object RegExp]"===to.call(e)}function f(e){var t=parseFloat(String(e));return t>=0&&Math.floor(t)===t&&isFinite(e)}function p(e){return null==e?"":"object"==typeof e?JSON.stringify(e,null,2):String(e)}function d(e){var t=parseFloat(e);return isNaN(t)?e:t}function h(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i<r.length;i++)n[r[i]]=!0;return t?function(e){return n[e.toLowerCase()]}:function(e){return n[e]}}function v(e,t){if(e.length){var n=e.indexOf(t);if(n>-1)return e.splice(n,1)}}function m(e,t){return io.call(e,t)}function g(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}function y(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n}function b(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function _(e,t){for(var n in t)e[n]=t[n];return e}function w(e){for(var t={},n=0;n<e.length;n++)e[n]&&_(t,e[n]);return t}function x(e,t,n){}function T(e,t){if(e===t)return!0;var n=u(e),r=u(t);if(!n||!r)return!n&&!r&&String(e)===String(t);try{var i=Array.isArray(e),o=Array.isArray(t);if(i&&o)return e.length===t.length&&e.every(function(e,n){return T(e,t[n])});if(i||o)return!1;var a=Object.keys(e),s=Object.keys(t);return a.length===s.length&&a.every(function(n){return T(e[n],t[n])})}catch(e){return!1}}function C(e,t){for(var n=0;n<e.length;n++)if(T(e[n],t))return n;return-1}function k(e){var t=!1;return function(){t||(t=!0,e.apply(this,arguments))}}function $(e){var t=(e+"").charCodeAt(0);return 36===t||95===t}function O(e,t,n,r){Object.defineProperty(e,t,{value:n,enumerable:!!r,writable:!0,configurable:!0})}function A(e){if(!go.test(e)){var t=e.split(".");return function(e){for(var n=0;n<t.length;n++){if(!e)return;e=e[t[n]]}return e}}}function S(e){return"function"==typeof e&&/native code/.test(e.toString())}function E(e){Do.target&&Fo.push(Do.target),Do.target=e}function I(){Do.target=Fo.pop()}function M(e){return new Ho(void 0,void 0,void 0,String(e))}function R(e,t){var n=e.componentOptions,r=new Ho(e.tag,e.data,e.children,e.text,e.elm,e.context,n,e.asyncFactory);return r.ns=e.ns,r.isStatic=e.isStatic,r.key=e.key,r.isComment=e.isComment,r.fnContext=e.fnContext,r.fnOptions=e.fnOptions,r.fnScopeId=e.fnScopeId,r.isCloned=!0,t&&(e.children&&(r.children=j(e.children,!0)),n&&n.children&&(n.children=j(n.children,!0))),r}function j(e,t){for(var n=e.length,r=new Array(n),i=0;i<n;i++)r[i]=R(e[i],t);return r}function P(e,t,n){e.__proto__=t}function L(e,t,n){for(var r=0,i=n.length;r<i;r++){var o=n[r];O(e,o,t[o])}}function N(e,t){if(u(e)&&!(e instanceof Ho)){var n;return m(e,"__ob__")&&e.__ob__ instanceof Wo?n=e.__ob__:Jo.shouldConvert&&!Ro()&&(Array.isArray(e)||c(e))&&Object.isExtensible(e)&&!e._isVue&&(n=new Wo(e)),t&&n&&n.vmCount++,n}}function D(e,t,n,r,i){var o=new Do,a=Object.getOwnPropertyDescriptor(e,t);if(!a||!1!==a.configurable){var s=a&&a.get,u=a&&a.set,c=!i&&N(n);Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){var t=s?s.call(e):n;return Do.target&&(o.depend(),c&&(c.dep.depend(),Array.isArray(t)&&U(t))),t},set:function(t){var r=s?s.call(e):n;t===r||t!==t&&r!==r||(u?u.call(e,t):n=t,c=!i&&N(t),o.notify())}})}}function F(e,t,n){if(Array.isArray(e)&&f(t))return e.length=Math.max(e.length,t),e.splice(t,1,n),n;if(t in e&&!(t in Object.prototype))return e[t]=n,n;var r=e.__ob__;return e._isVue||r&&r.vmCount?n:r?(D(r.value,t,n),r.dep.notify(),n):(e[t]=n,n)}function H(e,t){if(Array.isArray(e)&&f(t))return void e.splice(t,1);var n=e.__ob__;e._isVue||n&&n.vmCount||m(e,t)&&(delete e[t],n&&n.dep.notify())}function U(e){for(var t=void 0,n=0,r=e.length;n<r;n++)t=e[n],t&&t.__ob__&&t.__ob__.dep.depend(),Array.isArray(t)&&U(t)}function z(e,t){if(!t)return e;for(var n,r,i,o=Object.keys(t),a=0;a<o.length;a++)n=o[a],r=e[n],i=t[n],m(e,n)?c(r)&&c(i)&&z(r,i):F(e,n,i);return e}function B(e,t,n){return n?function(){var r="function"==typeof t?t.call(n,n):t,i="function"==typeof e?e.call(n,n):e;return r?z(r,i):i}:t?e?function(){return z("function"==typeof t?t.call(this,this):t,"function"==typeof e?e.call(this,this):e)}:t:e}function q(e,t){return t?e?e.concat(t):Array.isArray(t)?t:[t]:e}function V(e,t,n,r){var i=Object.create(e||null);return t?_(i,t):i}function J(e,t){var n=e.props;if(n){var r,i,o,a={};if(Array.isArray(n))for(r=n.length;r--;)"string"==typeof(i=n[r])&&(o=ao(i),a[o]={type:null});else if(c(n))for(var s in n)i=n[s],o=ao(s),a[o]=c(i)?i:{type:i};e.props=a}}function W(e,t){var n=e.inject,r=e.inject={};if(Array.isArray(n))for(var i=0;i<n.length;i++)r[n[i]]={from:n[i]};else if(c(n))for(var o in n){var a=n[o];r[o]=c(a)?_({from:o},a):{from:a}}}function K(e){var t=e.directives;if(t)for(var n in t){var r=t[n];"function"==typeof r&&(t[n]={bind:r,update:r})}}function X(e,t,n){function r(r){var i=Ko[r]||Zo;u[r]=i(e[r],t[r],n,r)}"function"==typeof t&&(t=t.options),J(t,n),W(t,n),K(t);var i=t.extends;if(i&&(e=X(e,i,n)),t.mixins)for(var o=0,a=t.mixins.length;o<a;o++)e=X(e,t.mixins[o],n);var s,u={};for(s in e)r(s);for(s in t)m(e,s)||r(s);return u}function G(e,t,n,r){if("string"==typeof n){var i=e[t];if(m(i,n))return i[n];var o=ao(n);if(m(i,o))return i[o];var a=so(o);if(m(i,a))return i[a];return i[n]||i[o]||i[a]}}function Z(e,t,n,r){var i=t[e],o=!m(n,e),a=n[e];if(ee(Boolean,i.type)&&(o&&!m(i,"default")?a=!1:ee(String,i.type)||""!==a&&a!==co(e)||(a=!0)),void 0===a){a=Y(r,i,e);var s=Jo.shouldConvert;Jo.shouldConvert=!0,N(a),Jo.shouldConvert=s}return a}function Y(e,t,n){if(m(t,"default")){var r=t.default;return e&&e.$options.propsData&&void 0===e.$options.propsData[n]&&void 0!==e._props[n]?e._props[n]:"function"==typeof r&&"Function"!==Q(t.type)?r.call(e):r}}function Q(e){var t=e&&e.toString().match(/^\s*function (\w+)/);return t?t[1]:""}function ee(e,t){if(!Array.isArray(t))return Q(t)===Q(e);for(var n=0,r=t.length;n<r;n++)if(Q(t[n])===Q(e))return!0;return!1}function te(e,t,n){if(t)for(var r=t;r=r.$parent;){var i=r.$options.errorCaptured;if(i)for(var o=0;o<i.length;o++)try{var a=!1===i[o].call(r,e,t,n);if(a)return}catch(e){ne(e,r,"errorCaptured hook")}}ne(e,t,n)}function ne(e,t,n){if(mo.errorHandler)try{return mo.errorHandler.call(null,e,t,n)}catch(e){re(e,null,"config.errorHandler")}re(e,t,n)}function re(e,t,n){if(!bo&&!_o||"undefined"==typeof console)throw e;console.error(e)}function ie(){Qo=!1;var e=Yo.slice(0);Yo.length=0;for(var t=0;t<e.length;t++)e[t]()}function oe(e){return e._withTask||(e._withTask=function(){ea=!0;var t=e.apply(null,arguments);return ea=!1,t})}function ae(e,t){var n;if(Yo.push(function(){if(e)try{e.call(t)}catch(e){te(e,t,"nextTick")}else n&&n(t)}),Qo||(Qo=!0,ea?Go():Xo()),!e&&"undefined"!=typeof Promise)return new Promise(function(e){n=e})}function se(e){ue(e,oa),oa.clear()}function ue(e,t){var n,r,i=Array.isArray(e);if((i||u(e))&&!Object.isFrozen(e)){if(e.__ob__){var o=e.__ob__.dep.id;if(t.has(o))return;t.add(o)}if(i)for(n=e.length;n--;)ue(e[n],t);else for(r=Object.keys(e),n=r.length;n--;)ue(e[r[n]],t)}}function ce(e){function t(){var e=arguments,n=t.fns;if(!Array.isArray(n))return n.apply(null,arguments);for(var r=n.slice(),i=0;i<r.length;i++)r[i].apply(null,e)}return t.fns=e,t}function le(e,t,n,i,o){var a,s,u,c;for(a in e)s=e[a],u=t[a],c=aa(a),r(s)||(r(u)?(r(s.fns)&&(s=e[a]=ce(s)),n(c.name,s,c.once,c.capture,c.passive)):s!==u&&(u.fns=s,e[a]=u));for(a in t)r(e[a])&&(c=aa(a),i(c.name,t[a],c.capture))}function fe(e,t,n){function a(){n.apply(this,arguments),v(s.fns,a)}e instanceof Ho&&(e=e.data.hook||(e.data.hook={}));var s,u=e[t];r(u)?s=ce([a]):i(u.fns)&&o(u.merged)?(s=u,s.fns.push(a)):s=ce([u,a]),s.merged=!0,e[t]=s}function pe(e,t,n){var o=t.options.props;if(!r(o)){var a={},s=e.attrs,u=e.props;if(i(s)||i(u))for(var c in o){var l=co(c);de(a,u,c,l,!0)||de(a,s,c,l,!1)}return a}}function de(e,t,n,r,o){if(i(t)){if(m(t,n))return e[n]=t[n],o||delete t[n],!0;if(m(t,r))return e[n]=t[r],o||delete t[r],!0}return!1}function he(e){for(var t=0;t<e.length;t++)if(Array.isArray(e[t]))return Array.prototype.concat.apply([],e);return e}function ve(e){return s(e)?[M(e)]:Array.isArray(e)?ge(e):void 0}function me(e){return i(e)&&i(e.text)&&a(e.isComment)}function ge(e,t){var n,a,u,c,l=[];for(n=0;n<e.length;n++)a=e[n],r(a)||"boolean"==typeof a||(u=l.length-1,c=l[u],Array.isArray(a)?a.length>0&&(a=ge(a,(t||"")+"_"+n),me(a[0])&&me(c)&&(l[u]=M(c.text+a[0].text),a.shift()),l.push.apply(l,a)):s(a)?me(c)?l[u]=M(c.text+a):""!==a&&l.push(M(a)):me(a)&&me(c)?l[u]=M(c.text+a.text):(o(e._isVList)&&i(a.tag)&&r(a.key)&&i(t)&&(a.key="__vlist"+t+"_"+n+"__"),l.push(a)));return l}function ye(e,t){return(e.__esModule||Po&&"Module"===e[Symbol.toStringTag])&&(e=e.default),u(e)?t.extend(e):e}function be(e,t,n,r,i){var o=zo();return o.asyncFactory=e,o.asyncMeta={data:t,context:n,children:r,tag:i},o}function _e(e,t,n){if(o(e.error)&&i(e.errorComp))return e.errorComp;if(i(e.resolved))return e.resolved;if(o(e.loading)&&i(e.loadingComp))return e.loadingComp;if(!i(e.contexts)){var a=e.contexts=[n],s=!0,c=function(){for(var e=0,t=a.length;e<t;e++)a[e].$forceUpdate()},l=k(function(n){e.resolved=ye(n,t),s||c()}),f=k(function(t){i(e.errorComp)&&(e.error=!0,c())}),p=e(l,f);return u(p)&&("function"==typeof p.then?r(e.resolved)&&p.then(l,f):i(p.component)&&"function"==typeof p.component.then&&(p.component.then(l,f),i(p.error)&&(e.errorComp=ye(p.error,t)),i(p.loading)&&(e.loadingComp=ye(p.loading,t),0===p.delay?e.loading=!0:setTimeout(function(){r(e.resolved)&&r(e.error)&&(e.loading=!0,c())},p.delay||200)),i(p.timeout)&&setTimeout(function(){r(e.resolved)&&f(null)},p.timeout))),s=!1,e.loading?e.loadingComp:e.resolved}e.contexts.push(n)}function we(e){return e.isComment&&e.asyncFactory}function xe(e){if(Array.isArray(e))for(var t=0;t<e.length;t++){var n=e[t];if(i(n)&&(i(n.componentOptions)||we(n)))return n}}function Te(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&$e(e,t)}function Ce(e,t,n){n?ia.$once(e,t):ia.$on(e,t)}function ke(e,t){ia.$off(e,t)}function $e(e,t,n){ia=e,le(t,n||{},Ce,ke,e),ia=void 0}function Oe(e,t){var n={};if(!e)return n;for(var r=0,i=e.length;r<i;r++){var o=e[r],a=o.data;if(a&&a.attrs&&a.attrs.slot&&delete a.attrs.slot,o.context!==t&&o.fnContext!==t||!a||null==a.slot)(n.default||(n.default=[])).push(o);else{var s=a.slot,u=n[s]||(n[s]=[]);"template"===o.tag?u.push.apply(u,o.children||[]):u.push(o)}}for(var c in n)n[c].every(Ae)&&delete n[c];return n}function Ae(e){return e.isComment&&!e.asyncFactory||" "===e.text}function Se(e,t){t=t||{};for(var n=0;n<e.length;n++)Array.isArray(e[n])?Se(e[n],t):t[e[n].key]=e[n].fn;return t}function Ee(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}function Ie(e,t,n){e.$el=t,e.$options.render||(e.$options.render=zo),Le(e,"beforeMount");var r;return r=function(){e._update(e._render(),n)},new va(e,r,x,null,!0),n=!1,null==e.$vnode&&(e._isMounted=!0,Le(e,"mounted")),e}function Me(e,t,n,r,i){var o=!!(i||e.$options._renderChildren||r.data.scopedSlots||e.$scopedSlots!==eo);if(e.$options._parentVnode=r,e.$vnode=r,e._vnode&&(e._vnode.parent=r),e.$options._renderChildren=i,e.$attrs=r.data&&r.data.attrs||eo,e.$listeners=n||eo,t&&e.$options.props){Jo.shouldConvert=!1;for(var a=e._props,s=e.$options._propKeys||[],u=0;u<s.length;u++){var c=s[u];a[c]=Z(c,e.$options.props,t,e)}Jo.shouldConvert=!0,e.$options.propsData=t}if(n){var l=e.$options._parentListeners;e.$options._parentListeners=n,$e(e,n,l)}o&&(e.$slots=Oe(i,r.context),e.$forceUpdate())}function Re(e){for(;e&&(e=e.$parent);)if(e._inactive)return!0;return!1}function je(e,t){if(t){if(e._directInactive=!1,Re(e))return}else if(e._directInactive)return;if(e._inactive||null===e._inactive){e._inactive=!1;for(var n=0;n<e.$children.length;n++)je(e.$children[n]);Le(e,"activated")}}function Pe(e,t){if(!(t&&(e._directInactive=!0,Re(e))||e._inactive)){e._inactive=!0;for(var n=0;n<e.$children.length;n++)Pe(e.$children[n]);Le(e,"deactivated")}}function Le(e,t){var n=e.$options[t];if(n)for(var r=0,i=n.length;r<i;r++)try{n[r].call(e)}catch(n){te(n,e,t+" hook")}e._hasHookEvent&&e.$emit("hook:"+t)}function Ne(){da=ua.length=ca.length=0,la={},fa=pa=!1}function De(){pa=!0;var e,t;for(ua.sort(function(e,t){return e.id-t.id}),da=0;da<ua.length;da++)e=ua[da],t=e.id,la[t]=null,e.run();var n=ca.slice(),r=ua.slice();Ne(),Ue(n),Fe(r),jo&&mo.devtools&&jo.emit("flush")}function Fe(e){for(var t=e.length;t--;){var n=e[t],r=n.vm;r._watcher===n&&r._isMounted&&Le(r,"updated")}}function He(e){e._inactive=!1,ca.push(e)}function Ue(e){for(var t=0;t<e.length;t++)e[t]._inactive=!0,je(e[t],!0)}function ze(e){var t=e.id;if(null==la[t]){if(la[t]=!0,pa){for(var n=ua.length-1;n>da&&ua[n].id>e.id;)n--;ua.splice(n+1,0,e)}else ua.push(e);fa||(fa=!0,ae(De))}}function Be(e,t,n){ma.get=function(){return this[t][n]},ma.set=function(e){this[t][n]=e},Object.defineProperty(e,n,ma)}function qe(e){e._watchers=[];var t=e.$options;t.props&&Ve(e,t.props),t.methods&&Ze(e,t.methods),t.data?Je(e):N(e._data={},!0),t.computed&&Ke(e,t.computed),t.watch&&t.watch!==Ao&&Ye(e,t.watch)}function Ve(e,t){var n=e.$options.propsData||{},r=e._props={},i=e.$options._propKeys=[],o=!e.$parent;Jo.shouldConvert=o;for(var a in t)!function(o){i.push(o);var a=Z(o,t,n,e);D(r,o,a),o in e||Be(e,"_props",o)}(a);Jo.shouldConvert=!0}function Je(e){var t=e.$options.data;t=e._data="function"==typeof t?We(t,e):t||{},c(t)||(t={});for(var n=Object.keys(t),r=e.$options.props,i=(e.$options.methods,n.length);i--;){var o=n[i];r&&m(r,o)||$(o)||Be(e,"_data",o)}N(t,!0)}function We(e,t){try{return e.call(t,t)}catch(e){return te(e,t,"data()"),{}}}function Ke(e,t){var n=e._computedWatchers=Object.create(null),r=Ro();for(var i in t){var o=t[i],a="function"==typeof o?o:o.get;r||(n[i]=new va(e,a||x,x,ga)),i in e||Xe(e,i,o)}}function Xe(e,t,n){var r=!Ro();"function"==typeof n?(ma.get=r?Ge(t):n,ma.set=x):(ma.get=n.get?r&&!1!==n.cache?Ge(t):n.get:x,ma.set=n.set?n.set:x),Object.defineProperty(e,t,ma)}function Ge(e){return function(){var t=this._computedWatchers&&this._computedWatchers[e];if(t)return t.dirty&&t.evaluate(),Do.target&&t.depend(),t.value}}function Ze(e,t){e.$options.props;for(var n in t)e[n]=null==t[n]?x:y(t[n],e)}function Ye(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var i=0;i<r.length;i++)Qe(e,n,r[i]);else Qe(e,n,r)}}function Qe(e,t,n,r){return c(n)&&(r=n,n=n.handler),"string"==typeof n&&(n=e[n]),e.$watch(t,n,r)}function et(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}function tt(e){var t=nt(e.$options.inject,e);t&&(Jo.shouldConvert=!1,Object.keys(t).forEach(function(n){D(e,n,t[n])}),Jo.shouldConvert=!0)}function nt(e,t){if(e){for(var n=Object.create(null),r=Po?Reflect.ownKeys(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}):Object.keys(e),i=0;i<r.length;i++){for(var o=r[i],a=e[o].from,s=t;s;){if(s._provided&&a in s._provided){n[o]=s._provided[a];break}s=s.$parent}if(!s&&"default"in e[o]){var u=e[o].default;n[o]="function"==typeof u?u.call(t):u}}return n}}function rt(e,t){var n,r,o,a,s;if(Array.isArray(e)||"string"==typeof e)for(n=new Array(e.length),r=0,o=e.length;r<o;r++)n[r]=t(e[r],r);else if("number"==typeof e)for(n=new Array(e),r=0;r<e;r++)n[r]=t(r+1,r);else if(u(e))for(a=Object.keys(e),n=new Array(a.length),r=0,o=a.length;r<o;r++)s=a[r],n[r]=t(e[s],s,r);return i(n)&&(n._isVList=!0),n}function it(e,t,n,r){var i,o=this.$scopedSlots[e];if(o)n=n||{},r&&(n=_(_({},r),n)),i=o(n)||t;else{var a=this.$slots[e];a&&(a._rendered=!0),i=a||t}var s=n&&n.slot;return s?this.$createElement("template",{slot:s},i):i}function ot(e){return G(this.$options,"filters",e,!0)||fo}function at(e,t,n,r){var i=mo.keyCodes[t]||n;return i?Array.isArray(i)?-1===i.indexOf(e):i!==e:r?co(r)!==t:void 0}function st(e,t,n,r,i){if(n)if(u(n)){Array.isArray(n)&&(n=w(n));var o;for(var a in n)!function(a){if("class"===a||"style"===a||ro(a))o=e;else{var s=e.attrs&&e.attrs.type;o=r||mo.mustUseProp(t,s,a)?e.domProps||(e.domProps={}):e.attrs||(e.attrs={})}if(!(a in o)&&(o[a]=n[a],i)){(e.on||(e.on={}))["update:"+a]=function(e){n[a]=e}}}(a)}else;return e}function ut(e,t){var n=this._staticTrees||(this._staticTrees=[]),r=n[e];return r&&!t?Array.isArray(r)?j(r):R(r):(r=n[e]=this.$options.staticRenderFns[e].call(this._renderProxy,null,this),lt(r,"__static__"+e,!1),r)}function ct(e,t,n){return lt(e,"__once__"+t+(n?"_"+n:""),!0),e}function lt(e,t,n){if(Array.isArray(e))for(var r=0;r<e.length;r++)e[r]&&"string"!=typeof e[r]&&ft(e[r],t+"_"+r,n);else ft(e,t,n)}function ft(e,t,n){e.isStatic=!0,e.key=t,e.isOnce=n}function pt(e,t){if(t)if(c(t)){var n=e.on=e.on?_({},e.on):{};for(var r in t){var i=n[r],o=t[r];n[r]=i?[].concat(i,o):o}}else;return e}function dt(e){e._o=ct,e._n=d,e._s=p,e._l=rt,e._t=it,e._q=T,e._i=C,e._m=ut,e._f=ot,e._k=at,e._b=st,e._v=M,e._e=zo,e._u=Se,e._g=pt}function ht(e,t,n,r,i){var a=i.options;this.data=e,this.props=t,this.children=n,this.parent=r,this.listeners=e.on||eo,this.injections=nt(a.inject,r),this.slots=function(){return Oe(n,r)};var s=Object.create(r),u=o(a._compiled),c=!u;u&&(this.$options=a,this.$slots=this.slots(),this.$scopedSlots=e.scopedSlots||eo),a._scopeId?this._c=function(e,t,n,i){var o=xt(s,e,t,n,i,c);return o&&(o.fnScopeId=a._scopeId,o.fnContext=r),o}:this._c=function(e,t,n,r){return xt(s,e,t,n,r,c)}}function vt(e,t,n,r,o){var a=e.options,s={},u=a.props;if(i(u))for(var c in u)s[c]=Z(c,u,t||eo);else i(n.attrs)&&mt(s,n.attrs),i(n.props)&&mt(s,n.props);var l=new ht(n,s,o,r,e),f=a.render.call(null,l._c,l);return f instanceof Ho&&(f.fnContext=r,f.fnOptions=a,n.slot&&((f.data||(f.data={})).slot=n.slot)),f}function mt(e,t){for(var n in t)e[ao(n)]=t[n]}function gt(e,t,n,a,s){if(!r(e)){var c=n.$options._base;if(u(e)&&(e=c.extend(e)),"function"==typeof e){var l;if(r(e.cid)&&(l=e,void 0===(e=_e(l,c,n))))return be(l,t,n,a,s);t=t||{},Ot(e),i(t.model)&&wt(e.options,t);var f=pe(t,e,s);if(o(e.options.functional))return vt(e,f,t,n,a);var p=t.on;if(t.on=t.nativeOn,o(e.options.abstract)){var d=t.slot;t={},d&&(t.slot=d)}bt(t);var h=e.options.name||s;return new Ho("vue-component-"+e.cid+(h?"-"+h:""),t,void 0,void 0,void 0,n,{Ctor:e,propsData:f,listeners:p,tag:s,children:a},l)}}}function yt(e,t,n,r){var o={_isComponent:!0,parent:t,_parentVnode:e,_parentElm:n||null,_refElm:r||null},a=e.data.inlineTemplate;return i(a)&&(o.render=a.render,o.staticRenderFns=a.staticRenderFns),new e.componentOptions.Ctor(o)}function bt(e){e.hook||(e.hook={});for(var t=0;t<ba.length;t++){var n=ba[t],r=e.hook[n],i=ya[n];e.hook[n]=r?_t(i,r):i}}function _t(e,t){return function(n,r,i,o){e(n,r,i,o),t(n,r,i,o)}}function wt(e,t){var n=e.model&&e.model.prop||"value",r=e.model&&e.model.event||"input";(t.props||(t.props={}))[n]=t.model.value;var o=t.on||(t.on={});i(o[r])?o[r]=[t.model.callback].concat(o[r]):o[r]=t.model.callback}function xt(e,t,n,r,i,a){return(Array.isArray(n)||s(n))&&(i=r,r=n,n=void 0),o(a)&&(i=wa),Tt(e,t,n,r,i)}function Tt(e,t,n,r,o){if(i(n)&&i(n.__ob__))return zo();if(i(n)&&i(n.is)&&(t=n.is),!t)return zo();Array.isArray(r)&&"function"==typeof r[0]&&(n=n||{},n.scopedSlots={default:r[0]},r.length=0),o===wa?r=ve(r):o===_a&&(r=he(r));var a,s;if("string"==typeof t){var u;s=e.$vnode&&e.$vnode.ns||mo.getTagNamespace(t),a=mo.isReservedTag(t)?new Ho(mo.parsePlatformTagName(t),n,r,void 0,void 0,e):i(u=G(e.$options,"components",t))?gt(u,n,e,r,t):new Ho(t,n,r,void 0,void 0,e)}else a=gt(t,n,e,r);return i(a)?(s&&Ct(a,s),a):zo()}function Ct(e,t,n){if(e.ns=t,"foreignObject"===e.tag&&(t=void 0,n=!0),i(e.children))for(var a=0,s=e.children.length;a<s;a++){var u=e.children[a];i(u.tag)&&(r(u.ns)||o(n))&&Ct(u,t,n)}}function kt(e){e._vnode=null,e._staticTrees=null;var t=e.$options,n=e.$vnode=t._parentVnode,r=n&&n.context;e.$slots=Oe(t._renderChildren,r),e.$scopedSlots=eo,e._c=function(t,n,r,i){return xt(e,t,n,r,i,!1)},e.$createElement=function(t,n,r,i){return xt(e,t,n,r,i,!0)};var i=n&&n.data;D(e,"$attrs",i&&i.attrs||eo,null,!0),D(e,"$listeners",t._parentListeners||eo,null,!0)}function $t(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r,n._parentElm=t._parentElm,n._refElm=t._refElm;var i=r.componentOptions;n.propsData=i.propsData,n._parentListeners=i.listeners,n._renderChildren=i.children,n._componentTag=i.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}function Ot(e){var t=e.options;if(e.super){var n=Ot(e.super);if(n!==e.superOptions){e.superOptions=n;var r=At(e);r&&_(e.extendOptions,r),t=e.options=X(n,e.extendOptions),t.name&&(t.components[t.name]=e)}}return t}function At(e){var t,n=e.options,r=e.extendOptions,i=e.sealedOptions;for(var o in n)n[o]!==i[o]&&(t||(t={}),t[o]=St(n[o],r[o],i[o]));return t}function St(e,t,n){if(Array.isArray(e)){var r=[];n=Array.isArray(n)?n:[n],t=Array.isArray(t)?t:[t];for(var i=0;i<e.length;i++)(t.indexOf(e[i])>=0||n.indexOf(e[i])<0)&&r.push(e[i]);return r}return e}function Et(e){this._init(e)}function It(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=b(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}function Mt(e){e.mixin=function(e){return this.options=X(this.options,e),this}}function Rt(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,r=n.cid,i=e._Ctor||(e._Ctor={});if(i[r])return i[r];var o=e.name||n.options.name,a=function(e){this._init(e)};return a.prototype=Object.create(n.prototype),a.prototype.constructor=a,a.cid=t++,a.options=X(n.options,e),a.super=n,a.options.props&&jt(a),a.options.computed&&Pt(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,ho.forEach(function(e){a[e]=n[e]}),o&&(a.options.components[o]=a),a.superOptions=n.options,a.extendOptions=e,a.sealedOptions=_({},a.options),i[r]=a,a}}function jt(e){var t=e.options.props;for(var n in t)Be(e.prototype,"_props",n)}function Pt(e){var t=e.options.computed;for(var n in t)Xe(e.prototype,n,t[n])}function Lt(e){ho.forEach(function(t){e[t]=function(e,n){return n?("component"===t&&c(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}})}function Nt(e){return e&&(e.Ctor.options.name||e.tag)}function Dt(e,t){return Array.isArray(e)?e.indexOf(t)>-1:"string"==typeof e?e.split(",").indexOf(t)>-1:!!l(e)&&e.test(t)}function Ft(e,t){var n=e.cache,r=e.keys,i=e._vnode;for(var o in n){var a=n[o];if(a){var s=Nt(a.componentOptions);s&&!t(s)&&Ht(n,o,r,i)}}}function Ht(e,t,n,r){var i=e[t];!i||r&&i.tag===r.tag||i.componentInstance.$destroy(),e[t]=null,v(n,t)}function Ut(e){for(var t=e.data,n=e,r=e;i(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(t=zt(r.data,t));for(;i(n=n.parent);)n&&n.data&&(t=zt(t,n.data));return Bt(t.staticClass,t.class)}function zt(e,t){return{staticClass:qt(e.staticClass,t.staticClass),class:i(e.class)?[e.class,t.class]:t.class}}function Bt(e,t){return i(e)||i(t)?qt(e,Vt(t)):""}function qt(e,t){return e?t?e+" "+t:e:t||""}function Vt(e){return Array.isArray(e)?Jt(e):u(e)?Wt(e):"string"==typeof e?e:""}function Jt(e){for(var t,n="",r=0,o=e.length;r<o;r++)i(t=Vt(e[r]))&&""!==t&&(n&&(n+=" "),n+=t);return n}function Wt(e){var t="";for(var n in e)e[n]&&(t&&(t+=" "),t+=n);return t}function Kt(e){return Ja(e)?"svg":"math"===e?"math":void 0}function Xt(e){if(!bo)return!0;if(Ka(e))return!1;if(e=e.toLowerCase(),null!=Xa[e])return Xa[e];var t=document.createElement(e);return e.indexOf("-")>-1?Xa[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Xa[e]=/HTMLUnknownElement/.test(t.toString())}function Gt(e){if("string"==typeof e){var t=document.querySelector(e);return t||document.createElement("div")}return e}function Zt(e,t){var n=document.createElement(e);return"select"!==e?n:(t.data&&t.data.attrs&&void 0!==t.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)}function Yt(e,t){return document.createElementNS(qa[e],t)}function Qt(e){return document.createTextNode(e)}function en(e){return document.createComment(e)}function tn(e,t,n){e.insertBefore(t,n)}function nn(e,t){e.removeChild(t)}function rn(e,t){e.appendChild(t)}function on(e){return e.parentNode}function an(e){return e.nextSibling}function sn(e){return e.tagName}function un(e,t){e.textContent=t}function cn(e,t,n){e.setAttribute(t,n)}function ln(e,t){var n=e.data.ref;if(n){var r=e.context,i=e.componentInstance||e.elm,o=r.$refs;t?Array.isArray(o[n])?v(o[n],i):o[n]===i&&(o[n]=void 0):e.data.refInFor?Array.isArray(o[n])?o[n].indexOf(i)<0&&o[n].push(i):o[n]=[i]:o[n]=i}}function fn(e,t){return e.key===t.key&&(e.tag===t.tag&&e.isComment===t.isComment&&i(e.data)===i(t.data)&&pn(e,t)||o(e.isAsyncPlaceholder)&&e.asyncFactory===t.asyncFactory&&r(t.asyncFactory.error))}function pn(e,t){if("input"!==e.tag)return!0;var n,r=i(n=e.data)&&i(n=n.attrs)&&n.type,o=i(n=t.data)&&i(n=n.attrs)&&n.type;return r===o||Ga(r)&&Ga(o)}function dn(e,t,n){var r,o,a={};for(r=t;r<=n;++r)o=e[r].key,i(o)&&(a[o]=r);return a}function hn(e,t){(e.data.directives||t.data.directives)&&vn(e,t)}function vn(e,t){var n,r,i,o=e===Qa,a=t===Qa,s=mn(e.data.directives,e.context),u=mn(t.data.directives,t.context),c=[],l=[];for(n in u)r=s[n],i=u[n],r?(i.oldValue=r.value,yn(i,"update",t,e),i.def&&i.def.componentUpdated&&l.push(i)):(yn(i,"bind",t,e),i.def&&i.def.inserted&&c.push(i));if(c.length){var f=function(){for(var n=0;n<c.length;n++)yn(c[n],"inserted",t,e)};o?fe(t,"insert",f):f()}if(l.length&&fe(t,"postpatch",function(){for(var n=0;n<l.length;n++)yn(l[n],"componentUpdated",t,e)}),!o)for(n in s)u[n]||yn(s[n],"unbind",e,e,a)}function mn(e,t){var n=Object.create(null);if(!e)return n;var r,i;for(r=0;r<e.length;r++)i=e[r],i.modifiers||(i.modifiers=ns),n[gn(i)]=i,i.def=G(t.$options,"directives",i.name,!0);return n}function gn(e){return e.rawName||e.name+"."+Object.keys(e.modifiers||{}).join(".")}function yn(e,t,n,r,i){var o=e.def&&e.def[t];if(o)try{o(n.elm,e,n,r,i)}catch(r){te(r,n.context,"directive "+e.name+" "+t+" hook")}}function bn(e,t){var n=t.componentOptions;if(!(i(n)&&!1===n.Ctor.options.inheritAttrs||r(e.data.attrs)&&r(t.data.attrs))){var o,a,s=t.elm,u=e.data.attrs||{},c=t.data.attrs||{};i(c.__ob__)&&(c=t.data.attrs=_({},c));for(o in c)a=c[o],u[o]!==a&&_n(s,o,a);(To||ko)&&c.value!==u.value&&_n(s,"value",c.value);for(o in u)r(c[o])&&(Ua(o)?s.removeAttributeNS(Ha,za(o)):Da(o)||s.removeAttribute(o))}}function _n(e,t,n){if(Fa(t))Ba(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n));else if(Da(t))e.setAttribute(t,Ba(n)||"false"===n?"false":"true");else if(Ua(t))Ba(n)?e.removeAttributeNS(Ha,za(t)):e.setAttributeNS(Ha,t,n);else if(Ba(n))e.removeAttribute(t);else{if(To&&!Co&&"TEXTAREA"===e.tagName&&"placeholder"===t&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}function wn(e,t){var n=t.elm,o=t.data,a=e.data;if(!(r(o.staticClass)&&r(o.class)&&(r(a)||r(a.staticClass)&&r(a.class)))){var s=Ut(t),u=n._transitionClasses;i(u)&&(s=qt(s,Vt(u))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}function xn(e){function t(){(a||(a=[])).push(e.slice(h,i).trim()),h=i+1}var n,r,i,o,a,s=!1,u=!1,c=!1,l=!1,f=0,p=0,d=0,h=0;for(i=0;i<e.length;i++)if(r=n,n=e.charCodeAt(i),s)39===n&&92!==r&&(s=!1);else if(u)34===n&&92!==r&&(u=!1);else if(c)96===n&&92!==r&&(c=!1);else if(l)47===n&&92!==r&&(l=!1);else if(124!==n||124===e.charCodeAt(i+1)||124===e.charCodeAt(i-1)||f||p||d){switch(n){case 34:u=!0;break;case 39:s=!0;break;case 96:c=!0;break;case 40:d++;break;case 41:d--;break;case 91:p++;break;case 93:p--;break;case 123:f++;break;case 125:f--}if(47===n){for(var v=i-1,m=void 0;v>=0&&" "===(m=e.charAt(v));v--);m&&as.test(m)||(l=!0)}}else void 0===o?(h=i+1,o=e.slice(0,i).trim()):t();if(void 0===o?o=e.slice(0,i).trim():0!==h&&t(),a)for(i=0;i<a.length;i++)o=Tn(o,a[i]);return o}function Tn(e,t){var n=t.indexOf("(");return n<0?'_f("'+t+'")('+e+")":'_f("'+t.slice(0,n)+'")('+e+","+t.slice(n+1)}function Cn(e){console.error("[Vue compiler]: "+e)}function kn(e,t){return e?e.map(function(e){return e[t]}).filter(function(e){return e}):[]}function $n(e,t,n){(e.props||(e.props=[])).push({name:t,value:n})}function On(e,t,n){(e.attrs||(e.attrs=[])).push({name:t,value:n})}function An(e,t,n,r,i,o){(e.directives||(e.directives=[])).push({name:t,rawName:n,value:r,arg:i,modifiers:o})}function Sn(e,t,n,r,i,o){r=r||eo,r.capture&&(delete r.capture,t="!"+t),r.once&&(delete r.once,t="~"+t),r.passive&&(delete r.passive,t="&"+t),"click"===t&&(r.right?(t="contextmenu",delete r.right):r.middle&&(t="mouseup"));var a;r.native?(delete r.native,a=e.nativeEvents||(e.nativeEvents={})):a=e.events||(e.events={});var s={value:n};r!==eo&&(s.modifiers=r);var u=a[t];Array.isArray(u)?i?u.unshift(s):u.push(s):a[t]=u?i?[s,u]:[u,s]:s}function En(e,t,n){var r=In(e,":"+t)||In(e,"v-bind:"+t);if(null!=r)return xn(r);if(!1!==n){var i=In(e,t);if(null!=i)return JSON.stringify(i)}}function In(e,t,n){var r;if(null!=(r=e.attrsMap[t]))for(var i=e.attrsList,o=0,a=i.length;o<a;o++)if(i[o].name===t){i.splice(o,1);break}return n&&delete e.attrsMap[t],r}function Mn(e,t,n){var r=n||{},i=r.number,o=r.trim,a="$$v";o&&(a="(typeof $$v === 'string'? $$v.trim(): $$v)"),i&&(a="_n("+a+")");var s=Rn(t,a);e.model={value:"("+t+")",expression:'"'+t+'"',callback:"function ($$v) {"+s+"}"}}function Rn(e,t){var n=jn(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function jn(e){if($a=e.length,e.indexOf("[")<0||e.lastIndexOf("]")<$a-1)return Sa=e.lastIndexOf("."),Sa>-1?{exp:e.slice(0,Sa),key:'"'+e.slice(Sa+1)+'"'}:{exp:e,key:null};for(Oa=e,Sa=Ea=Ia=0;!Ln();)Aa=Pn(),Nn(Aa)?Fn(Aa):91===Aa&&Dn(Aa);return{exp:e.slice(0,Ea),key:e.slice(Ea+1,Ia)}}function Pn(){return Oa.charCodeAt(++Sa)}function Ln(){return Sa>=$a}function Nn(e){return 34===e||39===e}function Dn(e){var t=1;for(Ea=Sa;!Ln();)if(e=Pn(),Nn(e))Fn(e);else if(91===e&&t++,93===e&&t--,0===t){Ia=Sa;break}}function Fn(e){for(var t=e;!Ln()&&(e=Pn())!==t;);}function Hn(e,t,n){Ma=n;var r=t.value,i=t.modifiers,o=e.tag,a=e.attrsMap.type;if(e.component)return Mn(e,r,i),!1;if("select"===o)Bn(e,r,i);else if("input"===o&&"checkbox"===a)Un(e,r,i);else if("input"===o&&"radio"===a)zn(e,r,i);else if("input"===o||"textarea"===o)qn(e,r,i);else if(!mo.isReservedTag(o))return Mn(e,r,i),!1;return!0}function Un(e,t,n){var r=n&&n.number,i=En(e,"value")||"null",o=En(e,"true-value")||"true",a=En(e,"false-value")||"false";$n(e,"checked","Array.isArray("+t+")?_i("+t+","+i+")>-1"+("true"===o?":("+t+")":":_q("+t+","+o+")")),Sn(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+o+"):("+a+");if(Array.isArray($$a)){var $$v="+(r?"_n("+i+")":i)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+t+"=$$a.concat([$$v]))}else{$$i>-1&&("+t+"=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}}else{"+Rn(t,"$$c")+"}",null,!0)}function zn(e,t,n){var r=n&&n.number,i=En(e,"value")||"null";i=r?"_n("+i+")":i,$n(e,"checked","_q("+t+","+i+")"),Sn(e,"change",Rn(t,i),null,!0)}function Bn(e,t,n){var r=n&&n.number,i='Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return '+(r?"_n(val)":"val")+"})",o="var $$selectedVal = "+i+";";o=o+" "+Rn(t,"$event.target.multiple ? $$selectedVal : $$selectedVal[0]"),Sn(e,"change",o,null,!0)}function qn(e,t,n){var r=e.attrsMap.type,i=n||{},o=i.lazy,a=i.number,s=i.trim,u=!o&&"range"!==r,c=o?"change":"range"===r?ss:"input",l="$event.target.value";s&&(l="$event.target.value.trim()"),a&&(l="_n("+l+")");var f=Rn(t,l);u&&(f="if($event.target.composing)return;"+f),$n(e,"value","("+t+")"),Sn(e,c,f,null,!0),(s||a)&&Sn(e,"blur","$forceUpdate()")}function Vn(e){if(i(e[ss])){var t=To?"change":"input";e[t]=[].concat(e[ss],e[t]||[]),delete e[ss]}i(e[us])&&(e.change=[].concat(e[us],e.change||[]),delete e[us])}function Jn(e,t,n){var r=Ra;return function i(){null!==e.apply(null,arguments)&&Kn(t,i,n,r)}}function Wn(e,t,n,r,i){t=oe(t),n&&(t=Jn(t,e,r)),Ra.addEventListener(e,t,So?{capture:r,passive:i}:r)}function Kn(e,t,n,r){(r||Ra).removeEventListener(e,t._withTask||t,n)}function Xn(e,t){if(!r(e.data.on)||!r(t.data.on)){var n=t.data.on||{},i=e.data.on||{};Ra=t.elm,Vn(n),le(n,i,Wn,Kn,t.context),Ra=void 0}}function Gn(e,t){if(!r(e.data.domProps)||!r(t.data.domProps)){var n,o,a=t.elm,s=e.data.domProps||{},u=t.data.domProps||{};i(u.__ob__)&&(u=t.data.domProps=_({},u));for(n in s)r(u[n])&&(a[n]="");for(n in u){if(o=u[n],"textContent"===n||"innerHTML"===n){if(t.children&&(t.children.length=0),o===s[n])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===n){a._value=o;var c=r(o)?"":String(o);Zn(a,c)&&(a.value=c)}else a[n]=o}}}function Zn(e,t){return!e.composing&&("OPTION"===e.tagName||Yn(e,t)||Qn(e,t))}function Yn(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}function Qn(e,t){var n=e.value,r=e._vModifiers;if(i(r)){if(r.lazy)return!1;if(r.number)return d(n)!==d(t);if(r.trim)return n.trim()!==t.trim()}return n!==t}function er(e){var t=tr(e.style);return e.staticStyle?_(e.staticStyle,t):t}function tr(e){return Array.isArray(e)?w(e):"string"==typeof e?fs(e):e}function nr(e,t){var n,r={};if(t)for(var i=e;i.componentInstance;)(i=i.componentInstance._vnode)&&i.data&&(n=er(i.data))&&_(r,n);(n=er(e.data))&&_(r,n);for(var o=e;o=o.parent;)o.data&&(n=er(o.data))&&_(r,n);return r}function rr(e,t){var n=t.data,o=e.data;if(!(r(n.staticStyle)&&r(n.style)&&r(o.staticStyle)&&r(o.style))){var a,s,u=t.elm,c=o.staticStyle,l=o.normalizedStyle||o.style||{},f=c||l,p=tr(t.data.style)||{};t.data.normalizedStyle=i(p.__ob__)?_({},p):p;var d=nr(t,!0);for(s in f)r(d[s])&&hs(u,s,"");for(s in d)(a=d[s])!==f[s]&&hs(u,s,null==a?"":a)}}function ir(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(/\s+/).forEach(function(t){return e.classList.add(t)}):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function or(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(/\s+/).forEach(function(t){return e.classList.remove(t)}):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");n=n.trim(),n?e.setAttribute("class",n):e.removeAttribute("class")}}function ar(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&_(t,ys(e.name||"v")),_(t,e),t}return"string"==typeof e?ys(e):void 0}}function sr(e){$s(function(){$s(e)})}function ur(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),ir(e,t))}function cr(e,t){e._transitionClasses&&v(e._transitionClasses,t),or(e,t)}function lr(e,t,n){var r=fr(e,t),i=r.type,o=r.timeout,a=r.propCount;if(!i)return n();var s=i===_s?Ts:ks,u=0,c=function(){e.removeEventListener(s,l),n()},l=function(t){t.target===e&&++u>=a&&c()};setTimeout(function(){u<a&&c()},o+1),e.addEventListener(s,l)}function fr(e,t){var n,r=window.getComputedStyle(e),i=r[xs+"Delay"].split(", "),o=r[xs+"Duration"].split(", "),a=pr(i,o),s=r[Cs+"Delay"].split(", "),u=r[Cs+"Duration"].split(", "),c=pr(s,u),l=0,f=0;return t===_s?a>0&&(n=_s,l=a,f=o.length):t===ws?c>0&&(n=ws,l=c,f=u.length):(l=Math.max(a,c),n=l>0?a>c?_s:ws:null,f=n?n===_s?o.length:u.length:0),{type:n,timeout:l,propCount:f,hasTransform:n===_s&&Os.test(r[xs+"Property"])}}function pr(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max.apply(null,t.map(function(t,n){return dr(t)+dr(e[n])}))}function dr(e){return 1e3*Number(e.slice(0,-1))}function hr(e,t){var n=e.elm;i(n._leaveCb)&&(n._leaveCb.cancelled=!0,n._leaveCb());var o=ar(e.data.transition);if(!r(o)&&!i(n._enterCb)&&1===n.nodeType){for(var a=o.css,s=o.type,c=o.enterClass,l=o.enterToClass,f=o.enterActiveClass,p=o.appearClass,h=o.appearToClass,v=o.appearActiveClass,m=o.beforeEnter,g=o.enter,y=o.afterEnter,b=o.enterCancelled,_=o.beforeAppear,w=o.appear,x=o.afterAppear,T=o.appearCancelled,C=o.duration,$=sa,O=sa.$vnode;O&&O.parent;)O=O.parent,$=O.context;var A=!$._isMounted||!e.isRootInsert;if(!A||w||""===w){var S=A&&p?p:c,E=A&&v?v:f,I=A&&h?h:l,M=A?_||m:m,R=A&&"function"==typeof w?w:g,j=A?x||y:y,P=A?T||b:b,L=d(u(C)?C.enter:C),N=!1!==a&&!Co,D=gr(R),F=n._enterCb=k(function(){N&&(cr(n,I),cr(n,E)),F.cancelled?(N&&cr(n,S),P&&P(n)):j&&j(n),n._enterCb=null});e.data.show||fe(e,"insert",function(){var t=n.parentNode,r=t&&t._pending&&t._pending[e.key];r&&r.tag===e.tag&&r.elm._leaveCb&&r.elm._leaveCb(),R&&R(n,F)}),M&&M(n),N&&(ur(n,S),ur(n,E),sr(function(){ur(n,I),cr(n,S),F.cancelled||D||(mr(L)?setTimeout(F,L):lr(n,s,F))})),e.data.show&&(t&&t(),R&&R(n,F)),N||D||F()}}}function vr(e,t){function n(){T.cancelled||(e.data.show||((o.parentNode._pending||(o.parentNode._pending={}))[e.key]=e),h&&h(o),_&&(ur(o,l),ur(o,p),sr(function(){ur(o,f),cr(o,l),T.cancelled||w||(mr(x)?setTimeout(T,x):lr(o,c,T))})),v&&v(o,T),_||w||T())}var o=e.elm;i(o._enterCb)&&(o._enterCb.cancelled=!0,o._enterCb());var a=ar(e.data.transition);if(r(a)||1!==o.nodeType)return t();if(!i(o._leaveCb)){var s=a.css,c=a.type,l=a.leaveClass,f=a.leaveToClass,p=a.leaveActiveClass,h=a.beforeLeave,v=a.leave,m=a.afterLeave,g=a.leaveCancelled,y=a.delayLeave,b=a.duration,_=!1!==s&&!Co,w=gr(v),x=d(u(b)?b.leave:b),T=o._leaveCb=k(function(){o.parentNode&&o.parentNode._pending&&(o.parentNode._pending[e.key]=null),_&&(cr(o,f),cr(o,p)),T.cancelled?(_&&cr(o,l),g&&g(o)):(t(),m&&m(o)),o._leaveCb=null});y?y(n):n()}}function mr(e){return"number"==typeof e&&!isNaN(e)}function gr(e){if(r(e))return!1;var t=e.fns;return i(t)?gr(Array.isArray(t)?t[0]:t):(e._length||e.length)>1}function yr(e,t){!0!==t.data.show&&hr(t)}function br(e,t,n){_r(e,t,n),(To||ko)&&setTimeout(function(){_r(e,t,n)},0)}function _r(e,t,n){var r=t.value,i=e.multiple;if(!i||Array.isArray(r)){for(var o,a,s=0,u=e.options.length;s<u;s++)if(a=e.options[s],i)o=C(r,xr(a))>-1,a.selected!==o&&(a.selected=o);else if(T(xr(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));i||(e.selectedIndex=-1)}}function wr(e,t){return t.every(function(t){return!T(t,e)})}function xr(e){return"_value"in e?e._value:e.value}function Tr(e){e.target.composing=!0}function Cr(e){e.target.composing&&(e.target.composing=!1,kr(e.target,"input"))}function kr(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function $r(e){return!e.componentInstance||e.data&&e.data.transition?e:$r(e.componentInstance._vnode)}function Or(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Or(xe(t.children)):e}function Ar(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var i=n._parentListeners;for(var o in i)t[ao(o)]=i[o];return t}function Sr(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}function Er(e){for(;e=e.parent;)if(e.data.transition)return!0}function Ir(e,t){return t.key===e.key&&t.tag===e.tag}function Mr(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function Rr(e){e.data.newPos=e.elm.getBoundingClientRect()}function jr(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,i=t.top-n.top;if(r||i){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate("+r+"px,"+i+"px)",o.transitionDuration="0s"}}function Pr(e,t){var n=t?Bs(t):Us;if(n.test(e)){for(var r,i,o=[],a=n.lastIndex=0;r=n.exec(e);){i=r.index,i>a&&o.push(JSON.stringify(e.slice(a,i)));var s=xn(r[1].trim());o.push("_s("+s+")"),a=i+r[0].length}return a<e.length&&o.push(JSON.stringify(e.slice(a))),o.join("+")}}function Lr(e,t){var n=(t.warn,In(e,"class"));n&&(e.staticClass=JSON.stringify(n));var r=En(e,"class",!1);r&&(e.classBinding=r)}function Nr(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}function Dr(e,t){var n=(t.warn,In(e,"style"));if(n){e.staticStyle=JSON.stringify(fs(n))}var r=En(e,"style",!1);r&&(e.styleBinding=r)}function Fr(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}function Hr(e,t){var n=t?wu:_u;return e.replace(n,function(e){return bu[e]})}function Ur(e,t){function n(t){l+=t,e=e.substring(t)}function r(e,n,r){var i,s;if(null==n&&(n=l),null==r&&(r=l),e&&(s=e.toLowerCase()),e)for(i=a.length-1;i>=0&&a[i].lowerCasedTag!==s;i--);else i=0;if(i>=0){for(var u=a.length-1;u>=i;u--)t.end&&t.end(a[u].tag,n,r);a.length=i,o=i&&a[i-1].tag}else"br"===s?t.start&&t.start(e,[],!0,n,r):"p"===s&&(t.start&&t.start(e,[],!1,n,r),t.end&&t.end(e,n,r))}for(var i,o,a=[],s=t.expectHTML,u=t.isUnaryTag||lo,c=t.canBeLeftOpenTag||lo,l=0;e;){if(i=e,o&&gu(o)){var f=0,p=o.toLowerCase(),d=yu[p]||(yu[p]=new RegExp("([\\s\\S]*?)(</"+p+"[^>]*>)","i")),h=e.replace(d,function(e,n,r){return f=r.length,gu(p)||"noscript"===p||(n=n.replace(/<!--([\s\S]*?)-->/g,"$1").replace(/<!\[CDATA\[([\s\S]*?)]]>/g,"$1")),Tu(p,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""});l+=e.length-h.length,e=h,r(p,l-f,l)}else{var v=e.indexOf("<");if(0===v){if(ru.test(e)){var m=e.indexOf("--\x3e");if(m>=0){t.shouldKeepComment&&t.comment(e.substring(4,m)),n(m+3);continue}}if(iu.test(e)){var g=e.indexOf("]>");if(g>=0){n(g+2);continue}}var y=e.match(nu);if(y){n(y[0].length);continue}var b=e.match(tu);if(b){var _=l;n(b[0].length),r(b[1],_,l);continue}var w=function(){var t=e.match(Qs);if(t){var r={tagName:t[1],attrs:[],start:l};n(t[0].length);for(var i,o;!(i=e.match(eu))&&(o=e.match(Gs));)n(o[0].length),r.attrs.push(o);if(i)return r.unarySlash=i[1],n(i[0].length),r.end=l,r}}();if(w){!function(e){var n=e.tagName,i=e.unarySlash;s&&("p"===o&&Xs(n)&&r(o),c(n)&&o===n&&r(n));for(var l=u(n)||!!i,f=e.attrs.length,p=new Array(f),d=0;d<f;d++){var h=e.attrs[d];ou&&-1===h[0].indexOf('""')&&(""===h[3]&&delete h[3],""===h[4]&&delete h[4],""===h[5]&&delete h[5]);var v=h[3]||h[4]||h[5]||"",m="a"===n&&"href"===h[1]?t.shouldDecodeNewlinesForHref:t.shouldDecodeNewlines;p[d]={name:h[1],value:Hr(v,m)}}l||(a.push({tag:n,lowerCasedTag:n.toLowerCase(),attrs:p}),o=n),t.start&&t.start(n,p,l,e.start,e.end)}(w),Tu(o,e)&&n(1);continue}}var x=void 0,T=void 0,C=void 0;if(v>=0){for(T=e.slice(v);!(tu.test(T)||Qs.test(T)||ru.test(T)||iu.test(T)||(C=T.indexOf("<",1))<0);)v+=C,T=e.slice(v);x=e.substring(0,v),n(v)}v<0&&(x=e,e=""),t.chars&&x&&t.chars(x)}if(e===i){t.chars&&t.chars(e);break}}r()}function zr(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:ai(t),parent:n,children:[]}}function Br(e,t){function n(e){e.pre&&(s=!1),fu(e.tag)&&(u=!1)}au=t.warn||Cn,fu=t.isPreTag||lo,pu=t.mustUseProp||lo,du=t.getTagNamespace||lo,uu=kn(t.modules,"transformNode"),cu=kn(t.modules,"preTransformNode"),lu=kn(t.modules,"postTransformNode"),su=t.delimiters;var r,i,o=[],a=!1!==t.preserveWhitespace,s=!1,u=!1;return Ur(e,{warn:au,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,start:function(e,a,c){var l=i&&i.ns||du(e);To&&"svg"===l&&(a=ci(a));var f=zr(e,a,i);l&&(f.ns=l),ui(f)&&!Ro()&&(f.forbidden=!0);for(var p=0;p<cu.length;p++)f=cu[p](f,t)||f;if(s||(qr(f),f.pre&&(s=!0)),fu(f.tag)&&(u=!0),s?Vr(f):f.processed||(Xr(f),Gr(f),ei(f),Jr(f,t)),r?o.length||r.if&&(f.elseif||f.else)&&Qr(r,{exp:f.elseif,block:f}):r=f,i&&!f.forbidden)if(f.elseif||f.else)Zr(f,i);else if(f.slotScope){i.plain=!1;var d=f.slotTarget||'"default"';(i.scopedSlots||(i.scopedSlots={}))[d]=f}else i.children.push(f),f.parent=i;c?n(f):(i=f,o.push(f));for(var h=0;h<lu.length;h++)lu[h](f,t)},end:function(){var e=o[o.length-1],t=e.children[e.children.length-1];t&&3===t.type&&" "===t.text&&!u&&e.children.pop(),o.length-=1,i=o[o.length-1],n(e)},chars:function(e){if(i&&(!To||"textarea"!==i.tag||i.attrsMap.placeholder!==e)){var t=i.children;if(e=u||e.trim()?si(i)?e:Mu(e):a&&t.length?" ":""){var n;!s&&" "!==e&&(n=Pr(e,su))?t.push({type:2,expression:n,text:e}):" "===e&&t.length&&" "===t[t.length-1].text||t.push({type:3,text:e})}}},comment:function(e){i.children.push({type:3,text:e,isComment:!0})}}),r}function qr(e){null!=In(e,"v-pre")&&(e.pre=!0)}function Vr(e){var t=e.attrsList.length;if(t)for(var n=e.attrs=new Array(t),r=0;r<t;r++)n[r]={name:e.attrsList[r].name,value:JSON.stringify(e.attrsList[r].value)};else e.pre||(e.plain=!0)}function Jr(e,t){Wr(e),e.plain=!e.key&&!e.attrsList.length,Kr(e),ti(e),ni(e);for(var n=0;n<uu.length;n++)e=uu[n](e,t)||e;ri(e)}function Wr(e){var t=En(e,"key");t&&(e.key=t)}function Kr(e){var t=En(e,"ref");t&&(e.ref=t,e.refInFor=ii(e))}function Xr(e){var t;if(t=In(e,"v-for")){var n=t.match($u);if(!n)return;e.for=n[2].trim();var r=n[1].trim().replace(Au,""),i=r.match(Ou);i?(e.alias=r.replace(Ou,""),e.iterator1=i[1].trim(),i[2]&&(e.iterator2=i[2].trim())):e.alias=r}}function Gr(e){var t=In(e,"v-if");if(t)e.if=t,Qr(e,{exp:t,block:e});else{null!=In(e,"v-else")&&(e.else=!0);var n=In(e,"v-else-if");n&&(e.elseif=n)}}function Zr(e,t){var n=Yr(t.children);n&&n.if&&Qr(n,{exp:e.elseif,block:e})}function Yr(e){for(var t=e.length;t--;){if(1===e[t].type)return e[t];e.pop()}}function Qr(e,t){e.ifConditions||(e.ifConditions=[]),e.ifConditions.push(t)}function ei(e){null!=In(e,"v-once")&&(e.once=!0)}function ti(e){if("slot"===e.tag)e.slotName=En(e,"name");else{var t;"template"===e.tag?(t=In(e,"scope"),e.slotScope=t||In(e,"slot-scope")):(t=In(e,"slot-scope"))&&(e.slotScope=t);var n=En(e,"slot");n&&(e.slotTarget='""'===n?'"default"':n,"template"===e.tag||e.slotScope||On(e,"slot",n))}}function ni(e){var t;(t=En(e,"is"))&&(e.component=t),null!=In(e,"inline-template")&&(e.inlineTemplate=!0)}function ri(e){var t,n,r,i,o,a,s,u=e.attrsList;for(t=0,n=u.length;t<n;t++)if(r=i=u[t].name,o=u[t].value,ku.test(r))if(e.hasBindings=!0,a=oi(r),a&&(r=r.replace(Iu,"")),Eu.test(r))r=r.replace(Eu,""),o=xn(o),s=!1,a&&(a.prop&&(s=!0,"innerHtml"===(r=ao(r))&&(r="innerHTML")),a.camel&&(r=ao(r)),a.sync&&Sn(e,"update:"+ao(r),Rn(o,"$event"))),s||!e.component&&pu(e.tag,e.attrsMap.type,r)?$n(e,r,o):On(e,r,o);else if(Cu.test(r))r=r.replace(Cu,""),Sn(e,r,o,a,!1,au);else{r=r.replace(ku,"");var c=r.match(Su),l=c&&c[1];l&&(r=r.slice(0,-(l.length+1))),An(e,r,i,o,l,a)}else{On(e,r,JSON.stringify(o)),!e.component&&"muted"===r&&pu(e.tag,e.attrsMap.type,r)&&$n(e,r,"true")}}function ii(e){for(var t=e;t;){if(void 0!==t.for)return!0;t=t.parent}return!1}function oi(e){var t=e.match(Iu);if(t){var n={};return t.forEach(function(e){n[e.slice(1)]=!0}),n}}function ai(e){for(var t={},n=0,r=e.length;n<r;n++)t[e[n].name]=e[n].value;return t}function si(e){return"script"===e.tag||"style"===e.tag}function ui(e){return"style"===e.tag||"script"===e.tag&&(!e.attrsMap.type||"text/javascript"===e.attrsMap.type)}function ci(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];Ru.test(r.name)||(r.name=r.name.replace(ju,""),t.push(r))}return t}function li(e,t){if("input"===e.tag){var n=e.attrsMap;if(n["v-model"]&&(n["v-bind:type"]||n[":type"])){var r=En(e,"type"),i=In(e,"v-if",!0),o=i?"&&("+i+")":"",a=null!=In(e,"v-else",!0),s=In(e,"v-else-if",!0),u=fi(e);Xr(u),pi(u,"type","checkbox"),Jr(u,t),u.processed=!0,u.if="("+r+")==='checkbox'"+o,Qr(u,{exp:u.if,block:u});var c=fi(e);In(c,"v-for",!0),pi(c,"type","radio"),Jr(c,t),Qr(u,{exp:"("+r+")==='radio'"+o,block:c});var l=fi(e);return In(l,"v-for",!0),pi(l,":type",r),Jr(l,t),Qr(u,{exp:i,block:l}),a?u.else=!0:s&&(u.elseif=s),u}}}function fi(e){return zr(e.tag,e.attrsList.slice(),e.parent)}function pi(e,t,n){e.attrsMap[t]=n,e.attrsList.push({name:t,value:n})}function di(e,t){t.value&&$n(e,"textContent","_s("+t.value+")")}function hi(e,t){t.value&&$n(e,"innerHTML","_s("+t.value+")")}function vi(e,t){e&&(hu=Fu(t.staticKeys||""),vu=t.isReservedTag||lo,gi(e),yi(e,!1))}function mi(e){return h("type,tag,attrsList,attrsMap,plain,parent,children,attrs"+(e?","+e:""))}function gi(e){if(e.static=bi(e),1===e.type){if(!vu(e.tag)&&"slot"!==e.tag&&null==e.attrsMap["inline-template"])return;for(var t=0,n=e.children.length;t<n;t++){var r=e.children[t];gi(r),r.static||(e.static=!1)}if(e.ifConditions)for(var i=1,o=e.ifConditions.length;i<o;i++){var a=e.ifConditions[i].block;gi(a),a.static||(e.static=!1)}}}function yi(e,t){if(1===e.type){if((e.static||e.once)&&(e.staticInFor=t),e.static&&e.children.length&&(1!==e.children.length||3!==e.children[0].type))return void(e.staticRoot=!0);if(e.staticRoot=!1,e.children)for(var n=0,r=e.children.length;n<r;n++)yi(e.children[n],t||!!e.for);if(e.ifConditions)for(var i=1,o=e.ifConditions.length;i<o;i++)yi(e.ifConditions[i].block,t)}}function bi(e){return 2!==e.type&&(3===e.type||!(!e.pre&&(e.hasBindings||e.if||e.for||no(e.tag)||!vu(e.tag)||_i(e)||!Object.keys(e).every(hu))))}function _i(e){for(;e.parent;){if(e=e.parent,"template"!==e.tag)return!1;if(e.for)return!0}return!1}function wi(e,t,n){var r=t?"nativeOn:{":"on:{";for(var i in e)r+='"'+i+'":'+xi(i,e[i])+",";return r.slice(0,-1)+"}"}function xi(e,t){if(!t)return"function(){}";if(Array.isArray(t))return"["+t.map(function(t){return xi(e,t)}).join(",")+"]";var n=Uu.test(t.value),r=Hu.test(t.value);if(t.modifiers){var i="",o="",a=[];for(var s in t.modifiers)if(qu[s])o+=qu[s],zu[s]&&a.push(s);else if("exact"===s){var u=t.modifiers;o+=Bu(["ctrl","shift","alt","meta"].filter(function(e){return!u[e]}).map(function(e){return"$event."+e+"Key"}).join("||"))}else a.push(s);a.length&&(i+=Ti(a)),o&&(i+=o);return"function($event){"+i+(n?t.value+"($event)":r?"("+t.value+")($event)":t.value)+"}"}return n||r?t.value:"function($event){"+t.value+"}"}function Ti(e){return"if(!('button' in $event)&&"+e.map(Ci).join("&&")+")return null;"}function Ci(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=zu[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key)"}function ki(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}}function $i(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}}function Oi(e,t){var n=new Ju(t);return{render:"with(this){return "+(e?Ai(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function Ai(e,t){if(e.staticRoot&&!e.staticProcessed)return Si(e,t);if(e.once&&!e.onceProcessed)return Ei(e,t);if(e.for&&!e.forProcessed)return Ri(e,t);if(e.if&&!e.ifProcessed)return Ii(e,t);if("template"!==e.tag||e.slotTarget){if("slot"===e.tag)return Ji(e,t);var n;if(e.component)n=Wi(e.component,e,t);else{var r=e.plain?void 0:ji(e,t),i=e.inlineTemplate?null:Hi(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(i?","+i:"")+")"}for(var o=0;o<t.transforms.length;o++)n=t.transforms[o](e,n);return n}return Hi(e,t)||"void 0"}function Si(e,t){return e.staticProcessed=!0,t.staticRenderFns.push("with(this){return "+Ai(e,t)+"}"),"_m("+(t.staticRenderFns.length-1)+(e.staticInFor?",true":"")+")"}function Ei(e,t){if(e.onceProcessed=!0,e.if&&!e.ifProcessed)return Ii(e,t);if(e.staticInFor){for(var n="",r=e.parent;r;){if(r.for){n=r.key;break}r=r.parent}return n?"_o("+Ai(e,t)+","+t.onceId+++","+n+")":Ai(e,t)}return Si(e,t)}function Ii(e,t,n,r){return e.ifProcessed=!0,Mi(e.ifConditions.slice(),t,n,r)}function Mi(e,t,n,r){function i(e){return n?n(e,t):e.once?Ei(e,t):Ai(e,t)}if(!e.length)return r||"_e()";var o=e.shift();return o.exp?"("+o.exp+")?"+i(o.block)+":"+Mi(e,t,n,r):""+i(o.block)}function Ri(e,t,n,r){var i=e.for,o=e.alias,a=e.iterator1?","+e.iterator1:"",s=e.iterator2?","+e.iterator2:"";return e.forProcessed=!0,(r||"_l")+"(("+i+"),function("+o+a+s+"){return "+(n||Ai)(e,t)+"})"}function ji(e,t){var n="{",r=Pi(e,t);r&&(n+=r+","),e.key&&(n+="key:"+e.key+","),e.ref&&(n+="ref:"+e.ref+","),e.refInFor&&(n+="refInFor:true,"),e.pre&&(n+="pre:true,"),e.component&&(n+='tag:"'+e.tag+'",');for(var i=0;i<t.dataGenFns.length;i++)n+=t.dataGenFns[i](e);if(e.attrs&&(n+="attrs:{"+Ki(e.attrs)+"},"),e.props&&(n+="domProps:{"+Ki(e.props)+"},"),e.events&&(n+=wi(e.events,!1,t.warn)+","),e.nativeEvents&&(n+=wi(e.nativeEvents,!0,t.warn)+","),e.slotTarget&&!e.slotScope&&(n+="slot:"+e.slotTarget+","),e.scopedSlots&&(n+=Ni(e.scopedSlots,t)+","),e.model&&(n+="model:{value:"+e.model.value+",callback:"+e.model.callback+",expression:"+e.model.expression+"},"),e.inlineTemplate){var o=Li(e,t);o&&(n+=o+",")}return n=n.replace(/,$/,"")+"}",e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function Pi(e,t){var n=e.directives;if(n){var r,i,o,a,s="directives:[",u=!1;for(r=0,i=n.length;r<i;r++){o=n[r],a=!0;var c=t.directives[o.name];c&&(a=!!c(e,o,t.warn)),a&&(u=!0,s+='{name:"'+o.name+'",rawName:"'+o.rawName+'"'+(o.value?",value:("+o.value+"),expression:"+JSON.stringify(o.value):"")+(o.arg?',arg:"'+o.arg+'"':"")+(o.modifiers?",modifiers:"+JSON.stringify(o.modifiers):"")+"},")}return u?s.slice(0,-1)+"]":void 0}}function Li(e,t){var n=e.children[0];if(1===n.type){var r=Oi(n,t.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map(function(e){return"function(){"+e+"}"}).join(",")+"]}"}}function Ni(e,t){return"scopedSlots:_u(["+Object.keys(e).map(function(n){return Di(n,e[n],t)}).join(",")+"])"}function Di(e,t,n){return t.for&&!t.forProcessed?Fi(e,t,n):"{key:"+e+",fn:function("+String(t.slotScope)+"){return "+("template"===t.tag?t.if?t.if+"?"+(Hi(t,n)||"undefined")+":undefined":Hi(t,n)||"undefined":Ai(t,n))+"}}"}function Fi(e,t,n){var r=t.for,i=t.alias,o=t.iterator1?","+t.iterator1:"",a=t.iterator2?","+t.iterator2:"";return t.forProcessed=!0,"_l(("+r+"),function("+i+o+a+"){return "+Di(e,t,n)+"})"}function Hi(e,t,n,r,i){var o=e.children;if(o.length){var a=o[0];if(1===o.length&&a.for&&"template"!==a.tag&&"slot"!==a.tag)return(r||Ai)(a,t);var s=n?Ui(o,t.maybeComponent):0,u=i||Bi;return"["+o.map(function(e){return u(e,t)}).join(",")+"]"+(s?","+s:"")}}function Ui(e,t){for(var n=0,r=0;r<e.length;r++){var i=e[r];if(1===i.type){if(zi(i)||i.ifConditions&&i.ifConditions.some(function(e){return zi(e.block)})){n=2;break}(t(i)||i.ifConditions&&i.ifConditions.some(function(e){return t(e.block)}))&&(n=1)}}return n}function zi(e){return void 0!==e.for||"template"===e.tag||"slot"===e.tag}function Bi(e,t){return 1===e.type?Ai(e,t):3===e.type&&e.isComment?Vi(e):qi(e)}function qi(e){return"_v("+(2===e.type?e.expression:Xi(JSON.stringify(e.text)))+")"}function Vi(e){return"_e("+JSON.stringify(e.text)+")"}function Ji(e,t){var n=e.slotName||'"default"',r=Hi(e,t),i="_t("+n+(r?","+r:""),o=e.attrs&&"{"+e.attrs.map(function(e){return ao(e.name)+":"+e.value}).join(",")+"}",a=e.attrsMap["v-bind"];return!o&&!a||r||(i+=",null"),o&&(i+=","+o),a&&(i+=(o?"":",null")+","+a),i+")"}function Wi(e,t,n){var r=t.inlineTemplate?null:Hi(t,n,!0);return"_c("+e+","+ji(t,n)+(r?","+r:"")+")"}function Ki(e){for(var t="",n=0;n<e.length;n++){var r=e[n];t+='"'+r.name+'":'+Xi(r.value)+","}return t.slice(0,-1)}function Xi(e){return e.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function Gi(e,t){try{return new Function(e)}catch(n){return t.push({err:n,code:e}),x}}function Zi(e){var t=Object.create(null);return function(n,r,i){r=_({},r);r.warn;delete r.warn;var o=r.delimiters?String(r.delimiters)+n:n;if(t[o])return t[o];var a=e(n,r),s={},u=[];return s.render=Gi(a.render,u),s.staticRenderFns=a.staticRenderFns.map(function(e){return Gi(e,u)}),t[o]=s}}function Yi(e){return mu=mu||document.createElement("div"),mu.innerHTML=e?'<a href="\n"/>':'<div a="\n"/>',mu.innerHTML.indexOf("&#10;")>0}function Qi(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}/*!
2
+ * Vue.js v2.5.11
3
+ * (c) 2014-2017 Evan You
4
+ * Released under the MIT License.
5
+ */
6
+ var eo=Object.freeze({}),to=Object.prototype.toString,no=h("slot,component",!0),ro=h("key,ref,slot,slot-scope,is"),io=Object.prototype.hasOwnProperty,oo=/-(\w)/g,ao=g(function(e){return e.replace(oo,function(e,t){return t?t.toUpperCase():""})}),so=g(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}),uo=/\B([A-Z])/g,co=g(function(e){return e.replace(uo,"-$1").toLowerCase()}),lo=function(e,t,n){return!1},fo=function(e){return e},po="data-server-rendered",ho=["component","directive","filter"],vo=["beforeCreate","created","beforeMount","mounted","beforeUpdate","updated","beforeDestroy","destroyed","activated","deactivated","errorCaptured"],mo={optionMergeStrategies:Object.create(null),silent:!1,productionTip:!1,devtools:!1,performance:!1,errorHandler:null,warnHandler:null,ignoredElements:[],keyCodes:Object.create(null),isReservedTag:lo,isReservedAttr:lo,isUnknownElement:lo,getTagNamespace:x,parsePlatformTagName:fo,mustUseProp:lo,_lifecycleHooks:vo},go=/[^\w.$]/,yo="__proto__"in{},bo="undefined"!=typeof window,_o="undefined"!=typeof WXEnvironment&&!!WXEnvironment.platform,wo=_o&&WXEnvironment.platform.toLowerCase(),xo=bo&&window.navigator.userAgent.toLowerCase(),To=xo&&/msie|trident/.test(xo),Co=xo&&xo.indexOf("msie 9.0")>0,ko=xo&&xo.indexOf("edge/")>0,$o=xo&&xo.indexOf("android")>0||"android"===wo,Oo=xo&&/iphone|ipad|ipod|ios/.test(xo)||"ios"===wo,Ao=(xo&&/chrome\/\d+/.test(xo),{}.watch),So=!1;if(bo)try{var Eo={};Object.defineProperty(Eo,"passive",{get:function(){So=!0}}),window.addEventListener("test-passive",null,Eo)}catch(e){}var Io,Mo,Ro=function(){return void 0===Io&&(Io=!bo&&void 0!==e&&"server"===e.process.env.VUE_ENV),Io},jo=bo&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,Po="undefined"!=typeof Symbol&&S(Symbol)&&"undefined"!=typeof Reflect&&S(Reflect.ownKeys);Mo="undefined"!=typeof Set&&S(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var Lo=x,No=0,Do=function(){this.id=No++,this.subs=[]};Do.prototype.addSub=function(e){this.subs.push(e)},Do.prototype.removeSub=function(e){v(this.subs,e)},Do.prototype.depend=function(){Do.target&&Do.target.addDep(this)},Do.prototype.notify=function(){for(var e=this.subs.slice(),t=0,n=e.length;t<n;t++)e[t].update()},Do.target=null;var Fo=[],Ho=function(e,t,n,r,i,o,a,s){this.tag=e,this.data=t,this.children=n,this.text=r,this.elm=i,this.ns=void 0,this.context=o,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=a,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=s,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1},Uo={child:{configurable:!0}};Uo.child.get=function(){return this.componentInstance},Object.defineProperties(Ho.prototype,Uo);var zo=function(e){void 0===e&&(e="");var t=new Ho;return t.text=e,t.isComment=!0,t},Bo=Array.prototype,qo=Object.create(Bo);["push","pop","shift","unshift","splice","sort","reverse"].forEach(function(e){var t=Bo[e];O(qo,e,function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];var i,o=t.apply(this,n),a=this.__ob__;switch(e){case"push":case"unshift":i=n;break;case"splice":i=n.slice(2)}return i&&a.observeArray(i),a.dep.notify(),o})});var Vo=Object.getOwnPropertyNames(qo),Jo={shouldConvert:!0},Wo=function(e){if(this.value=e,this.dep=new Do,this.vmCount=0,O(e,"__ob__",this),Array.isArray(e)){(yo?P:L)(e,qo,Vo),this.observeArray(e)}else this.walk(e)};Wo.prototype.walk=function(e){for(var t=Object.keys(e),n=0;n<t.length;n++)D(e,t[n],e[t[n]])},Wo.prototype.observeArray=function(e){for(var t=0,n=e.length;t<n;t++)N(e[t])};var Ko=mo.optionMergeStrategies;Ko.data=function(e,t,n){return n?B(e,t,n):t&&"function"!=typeof t?e:B(e,t)},vo.forEach(function(e){Ko[e]=q}),ho.forEach(function(e){Ko[e+"s"]=V}),Ko.watch=function(e,t,n,r){if(e===Ao&&(e=void 0),t===Ao&&(t=void 0),!t)return Object.create(e||null);if(!e)return t;var i={};_(i,e);for(var o in t){var a=i[o],s=t[o];a&&!Array.isArray(a)&&(a=[a]),i[o]=a?a.concat(s):Array.isArray(s)?s:[s]}return i},Ko.props=Ko.methods=Ko.inject=Ko.computed=function(e,t,n,r){if(!e)return t;var i=Object.create(null);return _(i,e),t&&_(i,t),i},Ko.provide=B;var Xo,Go,Zo=function(e,t){return void 0===t?e:t},Yo=[],Qo=!1,ea=!1;if(void 0!==n&&S(n))Go=function(){n(ie)};else if("undefined"==typeof MessageChannel||!S(MessageChannel)&&"[object MessageChannelConstructor]"!==MessageChannel.toString())Go=function(){setTimeout(ie,0)};else{var ta=new MessageChannel,na=ta.port2;ta.port1.onmessage=ie,Go=function(){na.postMessage(1)}}if("undefined"!=typeof Promise&&S(Promise)){var ra=Promise.resolve();Xo=function(){ra.then(ie),Oo&&setTimeout(x)}}else Xo=Go;var ia,oa=new Mo,aa=g(function(e){var t="&"===e.charAt(0);e=t?e.slice(1):e;var n="~"===e.charAt(0);e=n?e.slice(1):e;var r="!"===e.charAt(0);return e=r?e.slice(1):e,{name:e,once:n,capture:r,passive:t}}),sa=null,ua=[],ca=[],la={},fa=!1,pa=!1,da=0,ha=0,va=function(e,t,n,r,i){this.vm=e,i&&(e._watcher=this),e._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++ha,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new Mo,this.newDepIds=new Mo,this.expression="","function"==typeof t?this.getter=t:(this.getter=A(t),this.getter||(this.getter=function(){})),this.value=this.lazy?void 0:this.get()};va.prototype.get=function(){E(this);var e,t=this.vm;try{e=this.getter.call(t,t)}catch(e){if(!this.user)throw e;te(e,t,'getter for watcher "'+this.expression+'"')}finally{this.deep&&se(e),I(),this.cleanupDeps()}return e},va.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},va.prototype.cleanupDeps=function(){for(var e=this,t=this.deps.length;t--;){var n=e.deps[t];e.newDepIds.has(n.id)||n.removeSub(e)}var r=this.depIds;this.depIds=this.newDepIds,this.newDepIds=r,this.newDepIds.clear(),r=this.deps,this.deps=this.newDeps,this.newDeps=r,this.newDeps.length=0},va.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():ze(this)},va.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||u(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){te(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},va.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},va.prototype.depend=function(){for(var e=this,t=this.deps.length;t--;)e.deps[t].depend()},va.prototype.teardown=function(){var e=this;if(this.active){this.vm._isBeingDestroyed||v(this.vm._watchers,this);for(var t=this.deps.length;t--;)e.deps[t].removeSub(e);this.active=!1}};var ma={enumerable:!0,configurable:!0,get:x,set:x},ga={lazy:!0};dt(ht.prototype);var ya={init:function(e,t,n,r){if(!e.componentInstance||e.componentInstance._isDestroyed){(e.componentInstance=yt(e,sa,n,r)).$mount(t?e.elm:void 0,t)}else if(e.data.keepAlive){var i=e;ya.prepatch(i,i)}},prepatch:function(e,t){var n=t.componentOptions;Me(t.componentInstance=e.componentInstance,n.propsData,n.listeners,t,n.children)},insert:function(e){var t=e.context,n=e.componentInstance;n._isMounted||(n._isMounted=!0,Le(n,"mounted")),e.data.keepAlive&&(t._isMounted?He(n):je(n,!0))},destroy:function(e){var t=e.componentInstance;t._isDestroyed||(e.data.keepAlive?Pe(t,!0):t.$destroy())}},ba=Object.keys(ya),_a=1,wa=2,xa=0;!function(e){e.prototype._init=function(e){var t=this;t._uid=xa++,t._isVue=!0,e&&e._isComponent?$t(t,e):t.$options=X(Ot(t.constructor),e||{},t),t._renderProxy=t,t._self=t,Ee(t),Te(t),kt(t),Le(t,"beforeCreate"),tt(t),qe(t),et(t),Le(t,"created"),t.$options.el&&t.$mount(t.$options.el)}}(Et),function(e){var t={};t.get=function(){return this._data};var n={};n.get=function(){return this._props},Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=F,e.prototype.$delete=H,e.prototype.$watch=function(e,t,n){var r=this;if(c(t))return Qe(r,e,t,n);n=n||{},n.user=!0;var i=new va(r,e,t,n);return n.immediate&&t.call(r,i.value),function(){i.teardown()}}}(Et),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this,i=this;if(Array.isArray(e))for(var o=0,a=e.length;o<a;o++)r.$on(e[o],n);else(i._events[e]||(i._events[e]=[])).push(n),t.test(e)&&(i._hasHookEvent=!0);return i},e.prototype.$once=function(e,t){function n(){r.$off(e,n),t.apply(r,arguments)}var r=this;return n.fn=t,r.$on(e,n),r},e.prototype.$off=function(e,t){var n=this,r=this;if(!arguments.length)return r._events=Object.create(null),r;if(Array.isArray(e)){for(var i=0,o=e.length;i<o;i++)n.$off(e[i],t);return r}var a=r._events[e];if(!a)return r;if(!t)return r._events[e]=null,r;if(t)for(var s,u=a.length;u--;)if((s=a[u])===t||s.fn===t){a.splice(u,1);break}return r},e.prototype.$emit=function(e){var t=this,n=t._events[e];if(n){n=n.length>1?b(n):n;for(var r=b(arguments,1),i=0,o=n.length;i<o;i++)try{n[i].apply(t,r)}catch(n){te(n,t,'event handler for "'+e+'"')}}return t}}(Et),function(e){e.prototype._update=function(e,t){var n=this;n._isMounted&&Le(n,"beforeUpdate");var r=n.$el,i=n._vnode,o=sa;sa=n,n._vnode=e,i?n.$el=n.__patch__(i,e):(n.$el=n.__patch__(n.$el,e,t,!1,n.$options._parentElm,n.$options._refElm),n.$options._parentElm=n.$options._refElm=null),sa=o,r&&(r.__vue__=null),n.$el&&(n.$el.__vue__=n),n.$vnode&&n.$parent&&n.$vnode===n.$parent._vnode&&(n.$parent.$el=n.$el)},e.prototype.$forceUpdate=function(){var e=this;e._watcher&&e._watcher.update()},e.prototype.$destroy=function(){var e=this;if(!e._isBeingDestroyed){Le(e,"beforeDestroy"),e._isBeingDestroyed=!0;var t=e.$parent;!t||t._isBeingDestroyed||e.$options.abstract||v(t.$children,e),e._watcher&&e._watcher.teardown();for(var n=e._watchers.length;n--;)e._watchers[n].teardown();e._data.__ob__&&e._data.__ob__.vmCount--,e._isDestroyed=!0,e.__patch__(e._vnode,null),Le(e,"destroyed"),e.$off(),e.$el&&(e.$el.__vue__=null),e.$vnode&&(e.$vnode.parent=null)}}}(Et),function(e){dt(e.prototype),e.prototype.$nextTick=function(e){return ae(e,this)},e.prototype._render=function(){var e=this,t=e.$options,n=t.render,r=t._parentVnode;if(e._isMounted)for(var i in e.$slots){var o=e.$slots[i];(o._rendered||o[0]&&o[0].elm)&&(e.$slots[i]=j(o,!0))}e.$scopedSlots=r&&r.data.scopedSlots||eo,e.$vnode=r;var a;try{a=n.call(e._renderProxy,e.$createElement)}catch(t){te(t,e,"render"),a=e._vnode}return a instanceof Ho||(a=zo()),a.parent=r,a}}(Et);var Ta=[String,RegExp,Array],Ca={name:"keep-alive",abstract:!0,props:{include:Ta,exclude:Ta,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){var e=this;for(var t in e.cache)Ht(e.cache,t,e.keys)},watch:{include:function(e){Ft(this,function(t){return Dt(e,t)})},exclude:function(e){Ft(this,function(t){return!Dt(e,t)})}},render:function(){var e=this.$slots.default,t=xe(e),n=t&&t.componentOptions;if(n){var r=Nt(n),i=this,o=i.include,a=i.exclude;if(o&&(!r||!Dt(o,r))||a&&r&&Dt(a,r))return t;var s=this,u=s.cache,c=s.keys,l=null==t.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):t.key;u[l]?(t.componentInstance=u[l].componentInstance,v(c,l),c.push(l)):(u[l]=t,c.push(l),this.max&&c.length>parseInt(this.max)&&Ht(u,c[0],c,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}},ka={KeepAlive:Ca};!function(e){var t={};t.get=function(){return mo},Object.defineProperty(e,"config",t),e.util={warn:Lo,extend:_,mergeOptions:X,defineReactive:D},e.set=F,e.delete=H,e.nextTick=ae,e.options=Object.create(null),ho.forEach(function(t){e.options[t+"s"]=Object.create(null)}),e.options._base=e,_(e.options.components,ka),It(e),Mt(e),Rt(e),Lt(e)}(Et),Object.defineProperty(Et.prototype,"$isServer",{get:Ro}),Object.defineProperty(Et.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Et.version="2.5.11";var $a,Oa,Aa,Sa,Ea,Ia,Ma,Ra,ja,Pa=h("style,class"),La=h("input,textarea,option,select,progress"),Na=function(e,t,n){return"value"===n&&La(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},Da=h("contenteditable,draggable,spellcheck"),Fa=h("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),Ha="http://www.w3.org/1999/xlink",Ua=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},za=function(e){return Ua(e)?e.slice(6,e.length):""},Ba=function(e){return null==e||!1===e},qa={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"},Va=h("html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,menuitem,summary,content,element,shadow,template,blockquote,iframe,tfoot"),Ja=h("svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view",!0),Wa=function(e){return"pre"===e},Ka=function(e){return Va(e)||Ja(e)},Xa=Object.create(null),Ga=h("text,number,password,search,email,tel,url"),Za=Object.freeze({createElement:Zt,createElementNS:Yt,createTextNode:Qt,createComment:en,insertBefore:tn,removeChild:nn,appendChild:rn,parentNode:on,nextSibling:an,tagName:sn,setTextContent:un,setAttribute:cn}),Ya={create:function(e,t){ln(t)},update:function(e,t){e.data.ref!==t.data.ref&&(ln(e,!0),ln(t))},destroy:function(e){ln(e,!0)}},Qa=new Ho("",{},[]),es=["create","activate","update","remove","destroy"],ts={create:hn,update:hn,destroy:function(e){hn(e,Qa)}},ns=Object.create(null),rs=[Ya,ts],is={create:bn,update:bn},os={create:wn,update:wn},as=/[\w).+\-_$\]]/,ss="__r",us="__c",cs={create:Xn,update:Xn},ls={create:Gn,update:Gn},fs=g(function(e){var t={},n=/;(?![^(]*\))/g,r=/:(.+)/;return e.split(n).forEach(function(e){if(e){var n=e.split(r);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}),ps=/^--/,ds=/\s*!important$/,hs=function(e,t,n){if(ps.test(t))e.style.setProperty(t,n);else if(ds.test(n))e.style.setProperty(t,n.replace(ds,""),"important");else{var r=ms(t);if(Array.isArray(n))for(var i=0,o=n.length;i<o;i++)e.style[r]=n[i];else e.style[r]=n}},vs=["Webkit","Moz","ms"],ms=g(function(e){if(ja=ja||document.createElement("div").style,"filter"!==(e=ao(e))&&e in ja)return e;for(var t=e.charAt(0).toUpperCase()+e.slice(1),n=0;n<vs.length;n++){var r=vs[n]+t;if(r in ja)return r}}),gs={create:rr,update:rr},ys=g(function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}}),bs=bo&&!Co,_s="transition",ws="animation",xs="transition",Ts="transitionend",Cs="animation",ks="animationend";bs&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(xs="WebkitTransition",Ts="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Cs="WebkitAnimation",ks="webkitAnimationEnd"));var $s=bo?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()},Os=/\b(transform|all)(,|$)/,As=bo?{create:yr,activate:yr,remove:function(e,t){!0!==e.data.show?vr(e,t):t()}}:{},Ss=[is,os,cs,ls,gs,As],Es=Ss.concat(rs),Is=function(e){function t(e){return new Ho(I.tagName(e).toLowerCase(),{},[],void 0,e)}function n(e,t){function n(){0==--n.listeners&&a(e)}return n.listeners=t,n}function a(e){var t=I.parentNode(e);i(t)&&I.removeChild(t,e)}function u(e,t,n,r,a){if(e.isRootInsert=!a,!c(e,t,n,r)){var s=e.data,u=e.children,l=e.tag;i(l)?(e.elm=e.ns?I.createElementNS(e.ns,l):I.createElement(l,e),g(e),d(e,u,t),i(s)&&m(e,t),p(n,e.elm,r)):o(e.isComment)?(e.elm=I.createComment(e.text),p(n,e.elm,r)):(e.elm=I.createTextNode(e.text),p(n,e.elm,r))}}function c(e,t,n,r){var a=e.data;if(i(a)){var s=i(e.componentInstance)&&a.keepAlive;if(i(a=a.hook)&&i(a=a.init)&&a(e,!1,n,r),i(e.componentInstance))return l(e,t),o(s)&&f(e,t,n,r),!0}}function l(e,t){i(e.data.pendingInsert)&&(t.push.apply(t,e.data.pendingInsert),e.data.pendingInsert=null),e.elm=e.componentInstance.$el,v(e)?(m(e,t),g(e)):(ln(e),t.push(e))}function f(e,t,n,r){for(var o,a=e;a.componentInstance;)if(a=a.componentInstance._vnode,i(o=a.data)&&i(o=o.transition)){for(o=0;o<S.activate.length;++o)S.activate[o](Qa,a);t.push(a);break}p(n,e.elm,r)}function p(e,t,n){i(e)&&(i(n)?n.parentNode===e&&I.insertBefore(e,t,n):I.appendChild(e,t))}function d(e,t,n){if(Array.isArray(t))for(var r=0;r<t.length;++r)u(t[r],n,e.elm,null,!0);else s(e.text)&&I.appendChild(e.elm,I.createTextNode(e.text))}function v(e){for(;e.componentInstance;)e=e.componentInstance._vnode;return i(e.tag)}function m(e,t){for(var n=0;n<S.create.length;++n)S.create[n](Qa,e);O=e.data.hook,i(O)&&(i(O.create)&&O.create(Qa,e),i(O.insert)&&t.push(e))}function g(e){var t;if(i(t=e.fnScopeId))I.setAttribute(e.elm,t,"");else for(var n=e;n;)i(t=n.context)&&i(t=t.$options._scopeId)&&I.setAttribute(e.elm,t,""),n=n.parent;i(t=sa)&&t!==e.context&&t!==e.fnContext&&i(t=t.$options._scopeId)&&I.setAttribute(e.elm,t,"")}function y(e,t,n,r,i,o){for(;r<=i;++r)u(n[r],o,e,t)}function b(e){var t,n,r=e.data;if(i(r))for(i(t=r.hook)&&i(t=t.destroy)&&t(e),t=0;t<S.destroy.length;++t)S.destroy[t](e);if(i(t=e.children))for(n=0;n<e.children.length;++n)b(e.children[n])}function _(e,t,n,r){for(;n<=r;++n){var o=t[n];i(o)&&(i(o.tag)?(w(o),b(o)):a(o.elm))}}function w(e,t){if(i(t)||i(e.data)){var r,o=S.remove.length+1;for(i(t)?t.listeners+=o:t=n(e.elm,o),i(r=e.componentInstance)&&i(r=r._vnode)&&i(r.data)&&w(r,t),r=0;r<S.remove.length;++r)S.remove[r](e,t);i(r=e.data.hook)&&i(r=r.remove)?r(e,t):t()}else a(e.elm)}function x(e,t,n,o,a){for(var s,c,l,f,p=0,d=0,h=t.length-1,v=t[0],m=t[h],g=n.length-1,b=n[0],w=n[g],x=!a;p<=h&&d<=g;)r(v)?v=t[++p]:r(m)?m=t[--h]:fn(v,b)?(C(v,b,o),v=t[++p],b=n[++d]):fn(m,w)?(C(m,w,o),m=t[--h],w=n[--g]):fn(v,w)?(C(v,w,o),x&&I.insertBefore(e,v.elm,I.nextSibling(m.elm)),v=t[++p],w=n[--g]):fn(m,b)?(C(m,b,o),x&&I.insertBefore(e,m.elm,v.elm),m=t[--h],b=n[++d]):(r(s)&&(s=dn(t,p,h)),c=i(b.key)?s[b.key]:T(b,t,p,h),r(c)?u(b,o,e,v.elm):(l=t[c],fn(l,b)?(C(l,b,o),t[c]=void 0,x&&I.insertBefore(e,l.elm,v.elm)):u(b,o,e,v.elm)),b=n[++d]);p>h?(f=r(n[g+1])?null:n[g+1].elm,y(e,f,n,d,g,o)):d>g&&_(e,t,p,h)}function T(e,t,n,r){for(var o=n;o<r;o++){var a=t[o];if(i(a)&&fn(e,a))return o}}function C(e,t,n,a){if(e!==t){var s=t.elm=e.elm;if(o(e.isAsyncPlaceholder))return void(i(t.asyncFactory.resolved)?$(e.elm,t,n):t.isAsyncPlaceholder=!0);if(o(t.isStatic)&&o(e.isStatic)&&t.key===e.key&&(o(t.isCloned)||o(t.isOnce)))return void(t.componentInstance=e.componentInstance);var u,c=t.data;i(c)&&i(u=c.hook)&&i(u=u.prepatch)&&u(e,t);var l=e.children,f=t.children;if(i(c)&&v(t)){for(u=0;u<S.update.length;++u)S.update[u](e,t);i(u=c.hook)&&i(u=u.update)&&u(e,t)}r(t.text)?i(l)&&i(f)?l!==f&&x(s,l,f,n,a):i(f)?(i(e.text)&&I.setTextContent(s,""),y(s,null,f,0,f.length-1,n)):i(l)?_(s,l,0,l.length-1):i(e.text)&&I.setTextContent(s,""):e.text!==t.text&&I.setTextContent(s,t.text),i(c)&&i(u=c.hook)&&i(u=u.postpatch)&&u(e,t)}}function k(e,t,n){if(o(n)&&i(e.parent))e.parent.data.pendingInsert=t;else for(var r=0;r<t.length;++r)t[r].data.hook.insert(t[r])}function $(e,t,n,r){var a,s=t.tag,u=t.data,c=t.children;if(r=r||u&&u.pre,t.elm=e,o(t.isComment)&&i(t.asyncFactory))return t.isAsyncPlaceholder=!0,!0;if(i(u)&&(i(a=u.hook)&&i(a=a.init)&&a(t,!0),i(a=t.componentInstance)))return l(t,n),!0;if(i(s)){if(i(c))if(e.hasChildNodes())if(i(a=u)&&i(a=a.domProps)&&i(a=a.innerHTML)){if(a!==e.innerHTML)return!1}else{for(var f=!0,p=e.firstChild,h=0;h<c.length;h++){if(!p||!$(p,c[h],n,r)){f=!1;break}p=p.nextSibling}if(!f||p)return!1}else d(t,c,n);if(i(u)){var v=!1;for(var g in u)if(!M(g)){v=!0,m(t,n);break}!v&&u.class&&se(u.class)}}else e.data!==t.text&&(e.data=t.text);return!0}var O,A,S={},E=e.modules,I=e.nodeOps;for(O=0;O<es.length;++O)for(S[es[O]]=[],A=0;A<E.length;++A)i(E[A][es[O]])&&S[es[O]].push(E[A][es[O]]);var M=h("attrs,class,staticClass,staticStyle,key");return function(e,n,a,s,c,l){if(r(n))return void(i(e)&&b(e));var f=!1,p=[];if(r(e))f=!0,u(n,p,c,l);else{var d=i(e.nodeType);if(!d&&fn(e,n))C(e,n,p,s);else{if(d){if(1===e.nodeType&&e.hasAttribute(po)&&(e.removeAttribute(po),a=!0),o(a)&&$(e,n,p))return k(n,p,!0),e;e=t(e)}var h=e.elm,m=I.parentNode(h);if(u(n,p,h._leaveCb?null:m,I.nextSibling(h)),i(n.parent))for(var g=n.parent,y=v(n);g;){for(var w=0;w<S.destroy.length;++w)S.destroy[w](g);if(g.elm=n.elm,y){for(var x=0;x<S.create.length;++x)S.create[x](Qa,g);var T=g.data.hook.insert;if(T.merged)for(var O=1;O<T.fns.length;O++)T.fns[O]()}else ln(g);g=g.parent}i(m)?_(m,[e],0,0):i(e.tag)&&b(e)}}return k(n,p,f),n.elm}}({nodeOps:Za,modules:Es});Co&&document.addEventListener("selectionchange",function(){var e=document.activeElement;e&&e.vmodel&&kr(e,"input")});var Ms={inserted:function(e,t,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?fe(n,"postpatch",function(){Ms.componentUpdated(e,t,n)}):br(e,t,n.context),e._vOptions=[].map.call(e.options,xr)):("textarea"===n.tag||Ga(e.type))&&(e._vModifiers=t.modifiers,t.modifiers.lazy||(e.addEventListener("change",Cr),$o||(e.addEventListener("compositionstart",Tr),e.addEventListener("compositionend",Cr)),Co&&(e.vmodel=!0)))},componentUpdated:function(e,t,n){if("select"===n.tag){br(e,t,n.context);var r=e._vOptions,i=e._vOptions=[].map.call(e.options,xr);if(i.some(function(e,t){return!T(e,r[t])})){(e.multiple?t.value.some(function(e){return wr(e,i)}):t.value!==t.oldValue&&wr(t.value,i))&&kr(e,"change")}}}},Rs={bind:function(e,t,n){var r=t.value;n=$r(n);var i=n.data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&i?(n.data.show=!0,hr(n,function(){e.style.display=o})):e.style.display=r?o:"none"},update:function(e,t,n){var r=t.value;r!==t.oldValue&&(n=$r(n),n.data&&n.data.transition?(n.data.show=!0,r?hr(n,function(){e.style.display=e.__vOriginalDisplay}):vr(n,function(){e.style.display="none"})):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,i){i||(e.style.display=e.__vOriginalDisplay)}},js={model:Ms,show:Rs},Ps={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]},Ls={name:"transition",props:Ps,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(function(e){return e.tag||we(e)}),n.length)){var r=this.mode,i=n[0];if(Er(this.$vnode))return i;var o=Or(i);if(!o)return i;if(this._leaving)return Sr(e,i);var a="__transition-"+this._uid+"-";o.key=null==o.key?o.isComment?a+"comment":a+o.tag:s(o.key)?0===String(o.key).indexOf(a)?o.key:a+o.key:o.key;var u=(o.data||(o.data={})).transition=Ar(this),c=this._vnode,l=Or(c);if(o.data.directives&&o.data.directives.some(function(e){return"show"===e.name})&&(o.data.show=!0),l&&l.data&&!Ir(o,l)&&!we(l)&&(!l.componentInstance||!l.componentInstance._vnode.isComment)){var f=l.data.transition=_({},u);if("out-in"===r)return this._leaving=!0,fe(f,"afterLeave",function(){t._leaving=!1,t.$forceUpdate()}),Sr(e,i);if("in-out"===r){if(we(o))return c;var p,d=function(){p()};fe(u,"afterEnter",d),fe(u,"enterCancelled",d),fe(f,"delayLeave",function(e){p=e})}}return i}}},Ns=_({tag:String,moveClass:String},Ps);delete Ns.mode;var Ds={props:Ns,render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,i=this.$slots.default||[],o=this.children=[],a=Ar(this),s=0;s<i.length;s++){var u=i[s];if(u.tag)if(null!=u.key&&0!==String(u.key).indexOf("__vlist"))o.push(u),n[u.key]=u,(u.data||(u.data={})).transition=a;else;}if(r){for(var c=[],l=[],f=0;f<r.length;f++){var p=r[f];p.data.transition=a,p.data.pos=p.elm.getBoundingClientRect(),n[p.key]?c.push(p):l.push(p)}this.kept=e(t,null,c),this.removed=l}return e(t,null,o)},beforeUpdate:function(){this.__patch__(this._vnode,this.kept,!1,!0),this._vnode=this.kept},updated:function(){var e=this.prevChildren,t=this.moveClass||(this.name||"v")+"-move";e.length&&this.hasMove(e[0].elm,t)&&(e.forEach(Mr),e.forEach(Rr),e.forEach(jr),this._reflow=document.body.offsetHeight,e.forEach(function(e){if(e.data.moved){var n=e.elm,r=n.style;ur(n,t),r.transform=r.WebkitTransform=r.transitionDuration="",n.addEventListener(Ts,n._moveCb=function e(r){r&&!/transform$/.test(r.propertyName)||(n.removeEventListener(Ts,e),n._moveCb=null,cr(n,t))})}}))},methods:{hasMove:function(e,t){if(!bs)return!1;if(this._hasMove)return this._hasMove;var n=e.cloneNode();e._transitionClasses&&e._transitionClasses.forEach(function(e){or(n,e)}),ir(n,t),n.style.display="none",this.$el.appendChild(n);var r=fr(n);return this.$el.removeChild(n),this._hasMove=r.hasTransform}}},Fs={Transition:Ls,TransitionGroup:Ds};Et.config.mustUseProp=Na,Et.config.isReservedTag=Ka,Et.config.isReservedAttr=Pa,Et.config.getTagNamespace=Kt,Et.config.isUnknownElement=Xt,_(Et.options.directives,js),_(Et.options.components,Fs),Et.prototype.__patch__=bo?Is:x,Et.prototype.$mount=function(e,t){return e=e&&bo?Gt(e):void 0,Ie(this,e,t)},Et.nextTick(function(){mo.devtools&&jo&&jo.emit("init",Et)},0);var Hs,Us=/\{\{((?:.|\n)+?)\}\}/g,zs=/[-.*+?^${}()|[\]\/\\]/g,Bs=g(function(e){var t=e[0].replace(zs,"\\$&"),n=e[1].replace(zs,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")}),qs={staticKeys:["staticClass"],transformNode:Lr,genData:Nr},Vs={staticKeys:["staticStyle"],transformNode:Dr,genData:Fr},Js={decode:function(e){return Hs=Hs||document.createElement("div"),Hs.innerHTML=e,Hs.textContent}},Ws=h("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),Ks=h("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),Xs=h("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),Gs=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Zs="[a-zA-Z_][\\w\\-\\.]*",Ys="((?:"+Zs+"\\:)?"+Zs+")",Qs=new RegExp("^<"+Ys),eu=/^\s*(\/?)>/,tu=new RegExp("^<\\/"+Ys+"[^>]*>"),nu=/^<!DOCTYPE [^>]+>/i,ru=/^<!--/,iu=/^<!\[/,ou=!1;"x".replace(/x(.)?/g,function(e,t){ou=""===t});var au,su,uu,cu,lu,fu,pu,du,hu,vu,mu,gu=h("script,style,textarea",!0),yu={},bu={"&lt;":"<","&gt;":">","&quot;":'"',"&amp;":"&","&#10;":"\n","&#9;":"\t"},_u=/&(?:lt|gt|quot|amp);/g,wu=/&(?:lt|gt|quot|amp|#10|#9);/g,xu=h("pre,textarea",!0),Tu=function(e,t){return e&&xu(e)&&"\n"===t[0]},Cu=/^@|^v-on:/,ku=/^v-|^@|^:/,$u=/(.*?)\s+(?:in|of)\s+(.*)/,Ou=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Au=/^\(|\)$/g,Su=/:(.*)$/,Eu=/^:|^v-bind:/,Iu=/\.[^.]+/g,Mu=g(Js.decode),Ru=/^xmlns:NS\d+/,ju=/^NS\d+:/,Pu={preTransformNode:li},Lu=[qs,Vs,Pu],Nu={model:Hn,text:di,html:hi},Du={expectHTML:!0,modules:Lu,directives:Nu,isPreTag:Wa,isUnaryTag:Ws,mustUseProp:Na,canBeLeftOpenTag:Ks,isReservedTag:Ka,getTagNamespace:Kt,staticKeys:function(e){return e.reduce(function(e,t){return e.concat(t.staticKeys||[])},[]).join(",")}(Lu)},Fu=g(mi),Hu=/^\s*([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/,Uu=/^\s*[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['.*?']|\[".*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*\s*$/,zu={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Bu=function(e){return"if("+e+")return null;"},qu={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:Bu("$event.target !== $event.currentTarget"),ctrl:Bu("!$event.ctrlKey"),shift:Bu("!$event.shiftKey"),alt:Bu("!$event.altKey"),meta:Bu("!$event.metaKey"),left:Bu("'button' in $event && $event.button !== 0"),middle:Bu("'button' in $event && $event.button !== 1"),right:Bu("'button' in $event && $event.button !== 2")},Vu={on:ki,bind:$i,cloak:x},Ju=function(e){this.options=e,this.warn=e.warn||Cn,this.transforms=kn(e.modules,"transformCode"),this.dataGenFns=kn(e.modules,"genData"),this.directives=_(_({},Vu),e.directives);var t=e.isReservedTag||lo;this.maybeComponent=function(e){return!t(e.tag)},this.onceId=0,this.staticRenderFns=[]},Wu=(new RegExp("\\b"+"do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,super,throw,while,yield,delete,export,import,return,switch,default,extends,finally,continue,debugger,function,arguments".split(",").join("\\b|\\b")+"\\b"),new RegExp("\\b"+"delete,typeof,void".split(",").join("\\s*\\([^\\)]*\\)|\\b")+"\\s*\\([^\\)]*\\)"),function(e){return function(t){function n(n,r){var i=Object.create(t),o=[],a=[];if(i.warn=function(e,t){(t?a:o).push(e)},r){r.modules&&(i.modules=(t.modules||[]).concat(r.modules)),r.directives&&(i.directives=_(Object.create(t.directives||null),r.directives));for(var s in r)"modules"!==s&&"directives"!==s&&(i[s]=r[s])}var u=e(n,i);return u.errors=o,u.tips=a,u}return{compile:n,compileToFunctions:Zi(n)}}}(function(e,t){var n=Br(e.trim(),t);vi(n,t);var r=Oi(n,t);return{ast:n,render:r.render,staticRenderFns:r.staticRenderFns}})),Ku=Wu(Du),Xu=Ku.compileToFunctions,Gu=!!bo&&Yi(!1),Zu=!!bo&&Yi(!0),Yu=g(function(e){var t=Gt(e);return t&&t.innerHTML}),Qu=Et.prototype.$mount;Et.prototype.$mount=function(e,t){if((e=e&&Gt(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=Yu(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=Qi(e));if(r){var i=Xu(r,{shouldDecodeNewlines:Gu,shouldDecodeNewlinesForHref:Zu,delimiters:n.delimiters,comments:n.comments},this),o=i.render,a=i.staticRenderFns;n.render=o,n.staticRenderFns=a}}return Qu.call(this,e,t)},Et.compile=Xu,t.default=Et}.call(t,n(2),n(14).setImmediate)},function(e,t,n){function r(e,t){this._id=e,this._clearFn=t}var i=Function.prototype.apply;t.setTimeout=function(){return new r(i.call(setTimeout,window,arguments),clearTimeout)},t.setInterval=function(){return new r(i.call(setInterval,window,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},r.prototype.unref=r.prototype.ref=function(){},r.prototype.close=function(){this._clearFn.call(window,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(15),t.setImmediate=setImmediate,t.clearImmediate=clearImmediate},function(e,t,n){(function(e,t){!function(e,n){"use strict";function r(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var r={callback:e,args:t};return c[u]=r,s(u),u++}function i(e){delete c[e]}function o(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(n,r)}}function a(e){if(l)setTimeout(a,0,e);else{var t=c[e];if(t){l=!0;try{o(t)}finally{i(e),l=!1}}}}if(!e.setImmediate){var s,u=1,c={},l=!1,f=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"==={}.toString.call(e.process)?function(){s=function(e){t.nextTick(function(){a(e)})}}():function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?function(){var t="setImmediate$"+Math.random()+"$",n=function(n){n.source===e&&"string"==typeof n.data&&0===n.data.indexOf(t)&&a(+n.data.slice(t.length))};e.addEventListener?e.addEventListener("message",n,!1):e.attachEvent("onmessage",n),s=function(n){e.postMessage(t+n,"*")}}():e.MessageChannel?function(){var e=new MessageChannel;e.port1.onmessage=function(e){a(e.data)},s=function(t){e.port2.postMessage(t)}}():f&&"onreadystatechange"in f.createElement("script")?function(){var e=f.documentElement;s=function(t){var n=f.createElement("script");n.onreadystatechange=function(){a(t),n.onreadystatechange=null,e.removeChild(n),n=null},e.appendChild(n)}}():function(){s=function(e){setTimeout(a,0,e)}}(),p.setImmediate=r,p.clearImmediate=i}}("undefined"==typeof self?void 0===e?this:e:self)}).call(t,n(2),n(16))},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(e){if(l===setTimeout)return setTimeout(e,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function o(e){if(f===clearTimeout)return clearTimeout(e);if((f===r||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(e);try{return f(e)}catch(t){try{return f.call(null,e)}catch(t){return f.call(this,e)}}}function a(){v&&d&&(v=!1,d.length?h=d.concat(h):m=-1,h.length&&s())}function s(){if(!v){var e=i(a);v=!0;for(var t=h.length;t;){for(d=h,h=[];++m<t;)d&&d[m].run();m=-1,t=h.length}d=null,v=!1,o(e)}}function u(e,t){this.fun=e,this.array=t}function c(){}var l,f,p=e.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:n}catch(e){l=n}try{f="function"==typeof clearTimeout?clearTimeout:r}catch(e){f=r}}();var d,h=[],v=!1,m=-1;p.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];h.push(new u(e,t)),1!==h.length||v||i(s)},u.prototype.run=function(){this.fun.apply(null,this.array)},p.title="browser",p.browser=!0,p.env={},p.argv=[],p.version="",p.versions={},p.on=c,p.addListener=c,p.once=c,p.off=c,p.removeListener=c,p.removeAllListeners=c,p.emit=c,p.prependListener=c,p.prependOnceListener=c,p.listeners=function(e){return[]},p.binding=function(e){throw new Error("process.binding is not supported")},p.cwd=function(){return"/"},p.chdir=function(e){throw new Error("process.chdir is not supported")},p.umask=function(){return 0}},function(e,t,n){"use strict";function r(e,t){}function i(e){return Object.prototype.toString.call(e).indexOf("Error")>-1}function o(e,t){switch(typeof t){case"undefined":return;case"object":return t;case"function":return t(e);case"boolean":return t?e.params:void 0}}function a(e,t){for(var n in t)e[n]=t[n];return e}function s(e,t,n){void 0===t&&(t={});var r,i=n||u;try{r=i(e||"")}catch(e){r={}}for(var o in t)r[o]=t[o];return r}function u(e){var t={};return(e=e.trim().replace(/^(\?|#|&)/,""))?(e.split("&").forEach(function(e){var n=e.replace(/\+/g," ").split("="),r=He(n.shift()),i=n.length>0?He(n.join("=")):null;void 0===t[r]?t[r]=i:Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]}),t):t}function c(e){var t=e?Object.keys(e).map(function(t){var n=e[t];if(void 0===n)return"";if(null===n)return Fe(t);if(Array.isArray(n)){var r=[];return n.forEach(function(e){void 0!==e&&(null===e?r.push(Fe(t)):r.push(Fe(t)+"="+Fe(e)))}),r.join("&")}return Fe(t)+"="+Fe(n)}).filter(function(e){return e.length>0}).join("&"):null;return t?"?"+t:""}function l(e,t,n,r){var i=r&&r.options.stringifyQuery,o=t.query||{};try{o=f(o)}catch(e){}var a={name:t.name||e&&e.name,meta:e&&e.meta||{},path:t.path||"/",hash:t.hash||"",query:o,params:t.params||{},fullPath:d(t,i),matched:e?p(e):[]};return n&&(a.redirectedFrom=d(n,i)),Object.freeze(a)}function f(e){if(Array.isArray(e))return e.map(f);if(e&&"object"==typeof e){var t={};for(var n in e)t[n]=f(e[n]);return t}return e}function p(e){for(var t=[];e;)t.unshift(e),e=e.parent;return t}function d(e,t){var n=e.path,r=e.query;void 0===r&&(r={});var i=e.hash;void 0===i&&(i="");var o=t||c;return(n||"/")+o(r)+i}function h(e,t){return t===ze?e===t:!!t&&(e.path&&t.path?e.path.replace(Ue,"")===t.path.replace(Ue,"")&&e.hash===t.hash&&v(e.query,t.query):!(!e.name||!t.name)&&(e.name===t.name&&e.hash===t.hash&&v(e.query,t.query)&&v(e.params,t.params)))}function v(e,t){if(void 0===e&&(e={}),void 0===t&&(t={}),!e||!t)return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every(function(n){var r=e[n],i=t[n];return"object"==typeof r&&"object"==typeof i?v(r,i):String(r)===String(i)})}function m(e,t){return 0===e.path.replace(Ue,"/").indexOf(t.path.replace(Ue,"/"))&&(!t.hash||e.hash===t.hash)&&g(e.query,t.query)}function g(e,t){for(var n in t)if(!(n in e))return!1;return!0}function y(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey||e.defaultPrevented||void 0!==e.button&&0!==e.button)){if(e.currentTarget&&e.currentTarget.getAttribute){if(/\b_blank\b/i.test(e.currentTarget.getAttribute("target")))return}return e.preventDefault&&e.preventDefault(),!0}}function b(e){if(e)for(var t,n=0;n<e.length;n++){if(t=e[n],"a"===t.tag)return t;if(t.children&&(t=b(t.children)))return t}}function _(e){if(!_.installed||je!==e){_.installed=!0,je=e;var t=function(e){return void 0!==e},n=function(e,n){var r=e.$options._parentVnode;t(r)&&t(r=r.data)&&t(r=r.registerRouteInstance)&&r(e,n)};e.mixin({beforeCreate:function(){t(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),e.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,n(this,this)},destroyed:function(){n(this)}}),Object.defineProperty(e.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(e.prototype,"$route",{get:function(){return this._routerRoot._route}}),e.component("router-view",Pe),e.component("router-link",Ve);var r=e.config.optionMergeStrategies;r.beforeRouteEnter=r.beforeRouteLeave=r.beforeRouteUpdate=r.created}}function w(e,t,n){var r=e.charAt(0);if("/"===r)return e;if("?"===r||"#"===r)return t+e;var i=t.split("/");n&&i[i.length-1]||i.pop();for(var o=e.replace(/^\//,"").split("/"),a=0;a<o.length;a++){var s=o[a];".."===s?i.pop():"."!==s&&i.push(s)}return""!==i[0]&&i.unshift(""),i.join("/")}function x(e){var t="",n="",r=e.indexOf("#");r>=0&&(t=e.slice(r),e=e.slice(0,r));var i=e.indexOf("?");return i>=0&&(n=e.slice(i+1),e=e.slice(0,i)),{path:e,query:n,hash:t}}function T(e){return e.replace(/\/\//g,"/")}function C(e,t){for(var n,r=[],i=0,o=0,a="",s=t&&t.delimiter||"/";null!=(n=Qe.exec(e));){var u=n[0],c=n[1],l=n.index;if(a+=e.slice(o,l),o=l+u.length,c)a+=c[1];else{var f=e[o],p=n[2],d=n[3],h=n[4],v=n[5],m=n[6],g=n[7];a&&(r.push(a),a="");var y=null!=p&&null!=f&&f!==p,b="+"===m||"*"===m,_="?"===m||"*"===m,w=n[2]||s,x=h||v;r.push({name:d||i++,prefix:p||"",delimiter:w,optional:_,repeat:b,partial:y,asterisk:!!g,pattern:x?E(x):g?".*":"[^"+S(w)+"]+?"})}}return o<e.length&&(a+=e.substr(o)),a&&r.push(a),r}function k(e,t){return A(C(e,t))}function $(e){return encodeURI(e).replace(/[\/?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function O(e){return encodeURI(e).replace(/[?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function A(e){for(var t=new Array(e.length),n=0;n<e.length;n++)"object"==typeof e[n]&&(t[n]=new RegExp("^(?:"+e[n].pattern+")$"));return function(n,r){for(var i="",o=n||{},a=r||{},s=a.pretty?$:encodeURIComponent,u=0;u<e.length;u++){var c=e[u];if("string"!=typeof c){var l,f=o[c.name];if(null==f){if(c.optional){c.partial&&(i+=c.prefix);continue}throw new TypeError('Expected "'+c.name+'" to be defined')}if(We(f)){if(!c.repeat)throw new TypeError('Expected "'+c.name+'" to not repeat, but received `'+JSON.stringify(f)+"`");if(0===f.length){if(c.optional)continue;throw new TypeError('Expected "'+c.name+'" to not be empty')}for(var p=0;p<f.length;p++){if(l=s(f[p]),!t[u].test(l))throw new TypeError('Expected all "'+c.name+'" to match "'+c.pattern+'", but received `'+JSON.stringify(l)+"`");i+=(0===p?c.prefix:c.delimiter)+l}}else{if(l=c.asterisk?O(f):s(f),!t[u].test(l))throw new TypeError('Expected "'+c.name+'" to match "'+c.pattern+'", but received "'+l+'"');i+=c.prefix+l}}else i+=c}return i}}function S(e){return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function E(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function I(e,t){return e.keys=t,e}function M(e){return e.sensitive?"":"i"}function R(e,t){var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return I(e,t)}function j(e,t,n){for(var r=[],i=0;i<e.length;i++)r.push(N(e[i],t,n).source);return I(new RegExp("(?:"+r.join("|")+")",M(n)),t)}function P(e,t,n){return L(C(e,n),t,n)}function L(e,t,n){We(t)||(n=t||n,t=[]),n=n||{};for(var r=n.strict,i=!1!==n.end,o="",a=0;a<e.length;a++){var s=e[a];if("string"==typeof s)o+=S(s);else{var u=S(s.prefix),c="(?:"+s.pattern+")";t.push(s),s.repeat&&(c+="(?:"+u+c+")*"),c=s.optional?s.partial?u+"("+c+")?":"(?:"+u+"("+c+"))?":u+"("+c+")",o+=c}}var l=S(n.delimiter||"/"),f=o.slice(-l.length)===l;return r||(o=(f?o.slice(0,-l.length):o)+"(?:"+l+"(?=$))?"),o+=i?"$":r&&f?"":"(?="+l+"|$)",I(new RegExp("^"+o,M(n)),t)}function N(e,t,n){return We(t)||(n=t||n,t=[]),n=n||{},e instanceof RegExp?R(e,t):We(e)?j(e,t,n):P(e,t,n)}function D(e,t,n){try{return(et[e]||(et[e]=Ke.compile(e)))(t||{},{pretty:!0})}catch(e){return""}}function F(e,t,n,r){var i=t||[],o=n||Object.create(null),a=r||Object.create(null);e.forEach(function(e){H(i,o,a,e)});for(var s=0,u=i.length;s<u;s++)"*"===i[s]&&(i.push(i.splice(s,1)[0]),u--,s--);return{pathList:i,pathMap:o,nameMap:a}}function H(e,t,n,r,i,o){var a=r.path,s=r.name,u=r.pathToRegexpOptions||{},c=z(a,i,u.strict);"boolean"==typeof r.caseSensitive&&(u.sensitive=r.caseSensitive);var l={path:c,regex:U(c,u),components:r.components||{default:r.component},instances:{},name:s,parent:i,matchAs:o,redirect:r.redirect,beforeEnter:r.beforeEnter,meta:r.meta||{},props:null==r.props?{}:r.components?r.props:{default:r.props}};if(r.children&&r.children.forEach(function(r){var i=o?T(o+"/"+r.path):void 0;H(e,t,n,r,l,i)}),void 0!==r.alias){(Array.isArray(r.alias)?r.alias:[r.alias]).forEach(function(o){var a={path:o,children:r.children};H(e,t,n,a,i,l.path||"/")})}t[l.path]||(e.push(l.path),t[l.path]=l),s&&(n[s]||(n[s]=l))}function U(e,t){var n=Ke(e,[],t);return n}function z(e,t,n){return n||(e=e.replace(/\/$/,"")),"/"===e[0]?e:null==t?e:T(t.path+"/"+e)}function B(e,t,n,r){var i="string"==typeof e?{path:e}:e;if(i.name||i._normalized)return i;if(!i.path&&i.params&&t){i=q({},i),i._normalized=!0;var o=q(q({},t.params),i.params);if(t.name)i.name=t.name,i.params=o;else if(t.matched.length){var a=t.matched[t.matched.length-1].path;i.path=D(a,o,"path "+t.path)}return i}var u=x(i.path||""),c=t&&t.path||"/",l=u.path?w(u.path,c,n||i.append):c,f=s(u.query,i.query,r&&r.options.parseQuery),p=i.hash||u.hash;return p&&"#"!==p.charAt(0)&&(p="#"+p),{_normalized:!0,path:l,query:f,hash:p}}function q(e,t){for(var n in t)e[n]=t[n];return e}function V(e,t){function n(e){F(e,u,c,f)}function r(e,n,r){var i=B(e,n,!1,t),o=i.name;if(o){var s=f[o];if(!s)return a(null,i);var l=s.regex.keys.filter(function(e){return!e.optional}).map(function(e){return e.name});if("object"!=typeof i.params&&(i.params={}),n&&"object"==typeof n.params)for(var p in n.params)!(p in i.params)&&l.indexOf(p)>-1&&(i.params[p]=n.params[p]);if(s)return i.path=D(s.path,i.params,'named route "'+o+'"'),a(s,i,r)}else if(i.path){i.params={};for(var d=0;d<u.length;d++){var h=u[d],v=c[h];if(J(v.regex,i.path,i.params))return a(v,i,r)}}return a(null,i)}function i(e,n){var i=e.redirect,o="function"==typeof i?i(l(e,n,null,t)):i;if("string"==typeof o&&(o={path:o}),!o||"object"!=typeof o)return a(null,n);var s=o,u=s.name,c=s.path,p=n.query,d=n.hash,h=n.params;if(p=s.hasOwnProperty("query")?s.query:p,d=s.hasOwnProperty("hash")?s.hash:d,h=s.hasOwnProperty("params")?s.params:h,u){f[u];return r({_normalized:!0,name:u,query:p,hash:d,params:h},void 0,n)}if(c){var v=W(c,e);return r({_normalized:!0,path:D(v,h,'redirect route with path "'+v+'"'),query:p,hash:d},void 0,n)}return a(null,n)}function o(e,t,n){var i=D(n,t.params,'aliased route with path "'+n+'"'),o=r({_normalized:!0,path:i});if(o){var s=o.matched,u=s[s.length-1];return t.params=o.params,a(u,t)}return a(null,t)}function a(e,n,r){return e&&e.redirect?i(e,r||n):e&&e.matchAs?o(e,n,e.matchAs):l(e,n,r,t)}var s=F(e),u=s.pathList,c=s.pathMap,f=s.nameMap;return{match:r,addRoutes:n}}function J(e,t,n){var r=t.match(e);if(!r)return!1;if(!n)return!0;for(var i=1,o=r.length;i<o;++i){var a=e.keys[i-1],s="string"==typeof r[i]?decodeURIComponent(r[i]):r[i];a&&(n[a.name]=s)}return!0}function W(e,t){return w(e,t.parent?t.parent.path:"/",!0)}function K(){window.history.replaceState({key:oe()},""),window.addEventListener("popstate",function(e){G(),e.state&&e.state.key&&ae(e.state.key)})}function X(e,t,n,r){if(e.app){var i=e.options.scrollBehavior;i&&e.app.$nextTick(function(){var e=Z(),o=i(t,n,r?e:null);o&&("function"==typeof o.then?o.then(function(t){re(t,e)}).catch(function(e){}):re(o,e))})}}function G(){var e=oe();e&&(tt[e]={x:window.pageXOffset,y:window.pageYOffset})}function Z(){var e=oe();if(e)return tt[e]}function Y(e,t){var n=document.documentElement,r=n.getBoundingClientRect(),i=e.getBoundingClientRect();return{x:i.left-r.left-t.x,y:i.top-r.top-t.y}}function Q(e){return ne(e.x)||ne(e.y)}function ee(e){return{x:ne(e.x)?e.x:window.pageXOffset,y:ne(e.y)?e.y:window.pageYOffset}}function te(e){return{x:ne(e.x)?e.x:0,y:ne(e.y)?e.y:0}}function ne(e){return"number"==typeof e}function re(e,t){var n="object"==typeof e;if(n&&"string"==typeof e.selector){var r=document.querySelector(e.selector);if(r){var i=e.offset&&"object"==typeof e.offset?e.offset:{};i=te(i),t=Y(r,i)}else Q(e)&&(t=ee(e))}else n&&Q(e)&&(t=ee(e));t&&window.scrollTo(t.x,t.y)}function ie(){return rt.now().toFixed(3)}function oe(){return it}function ae(e){it=e}function se(e,t){G();var n=window.history;try{t?n.replaceState({key:it},"",e):(it=ie(),n.pushState({key:it},"",e))}catch(n){window.location[t?"replace":"assign"](e)}}function ue(e){se(e,!0)}function ce(e,t,n){var r=function(i){i>=e.length?n():e[i]?t(e[i],function(){r(i+1)}):r(i+1)};r(0)}function le(e){return function(t,n,r){var o=!1,a=0,s=null;fe(e,function(e,t,n,u){if("function"==typeof e&&void 0===e.cid){o=!0,a++;var c,l=he(function(t){de(t)&&(t=t.default),e.resolved="function"==typeof t?t:je.extend(t),n.components[u]=t,--a<=0&&r()}),f=he(function(e){var t="Failed to resolve async component "+u+": "+e;s||(s=i(e)?e:new Error(t),r(s))});try{c=e(l,f)}catch(e){f(e)}if(c)if("function"==typeof c.then)c.then(l,f);else{var p=c.component;p&&"function"==typeof p.then&&p.then(l,f)}}}),o||r()}}function fe(e,t){return pe(e.map(function(e){return Object.keys(e.components).map(function(n){return t(e.components[n],e.instances[n],e,n)})}))}function pe(e){return Array.prototype.concat.apply([],e)}function de(e){return e.__esModule||ot&&"Module"===e[Symbol.toStringTag]}function he(e){var t=!1;return function(){for(var n=[],r=arguments.length;r--;)n[r]=arguments[r];if(!t)return t=!0,e.apply(this,n)}}function ve(e){if(!e)if(Je){var t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^https?:\/\/[^\/]+/,"")}else e="/";return"/"!==e.charAt(0)&&(e="/"+e),e.replace(/\/$/,"")}function me(e,t){var n,r=Math.max(e.length,t.length);for(n=0;n<r&&e[n]===t[n];n++);return{updated:t.slice(0,n),activated:t.slice(n),deactivated:e.slice(n)}}function ge(e,t,n,r){var i=fe(e,function(e,r,i,o){var a=ye(e,t);if(a)return Array.isArray(a)?a.map(function(e){return n(e,r,i,o)}):n(a,r,i,o)});return pe(r?i.reverse():i)}function ye(e,t){return"function"!=typeof e&&(e=je.extend(e)),e.options[t]}function be(e){return ge(e,"beforeRouteLeave",we,!0)}function _e(e){return ge(e,"beforeRouteUpdate",we)}function we(e,t){if(t)return function(){return e.apply(t,arguments)}}function xe(e,t,n){return ge(e,"beforeRouteEnter",function(e,r,i,o){return Te(e,i,o,t,n)})}function Te(e,t,n,r,i){return function(o,a,s){return e(o,a,function(e){s(e),"function"==typeof e&&r.push(function(){Ce(e,t.instances,n,i)})})}}function Ce(e,t,n,r){t[n]?e(t[n]):r()&&setTimeout(function(){Ce(e,t,n,r)},16)}function ke(e){var t=window.location.pathname;return e&&0===t.indexOf(e)&&(t=t.slice(e.length)),(t||"/")+window.location.search+window.location.hash}function $e(e){var t=ke(e);if(!/^\/#/.test(t))return window.location.replace(T(e+"/#"+t)),!0}function Oe(){var e=Ae();return"/"===e.charAt(0)||(Ie("/"+e),!1)}function Ae(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.slice(t+1)}function Se(e){var t=window.location.href,n=t.indexOf("#");return(n>=0?t.slice(0,n):t)+"#"+e}function Ee(e){nt?se(Se(e)):window.location.hash=e}function Ie(e){nt?ue(Se(e)):window.location.replace(Se(e))}function Me(e,t){return e.push(t),function(){var n=e.indexOf(t);n>-1&&e.splice(n,1)}}function Re(e,t,n){var r="hash"===n?"#"+t:t;return e?T(e+"/"+r):r}Object.defineProperty(t,"__esModule",{value:!0});var je,Pe={name:"router-view",functional:!0,props:{name:{type:String,default:"default"}},render:function(e,t){var n=t.props,r=t.children,i=t.parent,s=t.data;s.routerView=!0;for(var u=i.$createElement,c=n.name,l=i.$route,f=i._routerViewCache||(i._routerViewCache={}),p=0,d=!1;i&&i._routerRoot!==i;)i.$vnode&&i.$vnode.data.routerView&&p++,i._inactive&&(d=!0),i=i.$parent;if(s.routerViewDepth=p,d)return u(f[c],s,r);var h=l.matched[p];if(!h)return f[c]=null,u();var v=f[c]=h.components[c];s.registerRouteInstance=function(e,t){var n=h.instances[c];(t&&n!==e||!t&&n===e)&&(h.instances[c]=t)},(s.hook||(s.hook={})).prepatch=function(e,t){h.instances[c]=t.componentInstance};var m=s.props=o(l,h.props&&h.props[c]);if(m){m=s.props=a({},m);var g=s.attrs=s.attrs||{};for(var y in m)v.props&&y in v.props||(g[y]=m[y],delete m[y])}return u(v,s,r)}},Le=/[!'()*]/g,Ne=function(e){return"%"+e.charCodeAt(0).toString(16)},De=/%2C/g,Fe=function(e){return encodeURIComponent(e).replace(Le,Ne).replace(De,",")},He=decodeURIComponent,Ue=/\/?$/,ze=l(null,{path:"/"}),Be=[String,Object],qe=[String,Array],Ve={name:"router-link",props:{to:{type:Be,required:!0},tag:{type:String,default:"a"},exact:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,event:{type:qe,default:"click"}},render:function(e){var t=this,n=this.$router,r=this.$route,i=n.resolve(this.to,r,this.append),o=i.location,a=i.route,s=i.href,u={},c=n.options.linkActiveClass,f=n.options.linkExactActiveClass,p=null==c?"router-link-active":c,d=null==f?"router-link-exact-active":f,v=null==this.activeClass?p:this.activeClass,g=null==this.exactActiveClass?d:this.exactActiveClass,_=o.path?l(null,o,null,n):a;u[g]=h(r,_),u[v]=this.exact?u[g]:m(r,_);var w=function(e){y(e)&&(t.replace?n.replace(o):n.push(o))},x={click:y};Array.isArray(this.event)?this.event.forEach(function(e){x[e]=w}):x[this.event]=w;var T={class:u};if("a"===this.tag)T.on=x,T.attrs={href:s};else{var C=b(this.$slots.default);if(C){C.isStatic=!1;var k=je.util.extend;(C.data=k({},C.data)).on=x;(C.data.attrs=k({},C.data.attrs)).href=s}else T.on=x}return e(this.tag,T,this.$slots.default)}},Je="undefined"!=typeof window,We=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)},Ke=N,Xe=C,Ge=k,Ze=A,Ye=L,Qe=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");Ke.parse=Xe,Ke.compile=Ge,Ke.tokensToFunction=Ze,Ke.tokensToRegExp=Ye;var et=Object.create(null),tt=Object.create(null),nt=Je&&function(){var e=window.navigator.userAgent;return(-1===e.indexOf("Android 2.")&&-1===e.indexOf("Android 4.0")||-1===e.indexOf("Mobile Safari")||-1!==e.indexOf("Chrome")||-1!==e.indexOf("Windows Phone"))&&(window.history&&"pushState"in window.history)}(),rt=Je&&window.performance&&window.performance.now?window.performance:Date,it=ie(),ot="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,at=function(e,t){this.router=e,this.base=ve(t),this.current=ze,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[]};at.prototype.listen=function(e){this.cb=e},at.prototype.onReady=function(e,t){this.ready?e():(this.readyCbs.push(e),t&&this.readyErrorCbs.push(t))},at.prototype.onError=function(e){this.errorCbs.push(e)},at.prototype.transitionTo=function(e,t,n){var r=this,i=this.router.match(e,this.current);this.confirmTransition(i,function(){r.updateRoute(i),t&&t(i),r.ensureURL(),r.ready||(r.ready=!0,r.readyCbs.forEach(function(e){e(i)}))},function(e){n&&n(e),e&&!r.ready&&(r.ready=!0,r.readyErrorCbs.forEach(function(t){t(e)}))})},at.prototype.confirmTransition=function(e,t,n){var o=this,a=this.current,s=function(e){i(e)&&(o.errorCbs.length?o.errorCbs.forEach(function(t){t(e)}):(r(!1,"uncaught error during route navigation:"),console.error(e))),n&&n(e)};if(h(e,a)&&e.matched.length===a.matched.length)return this.ensureURL(),s();var u=me(this.current.matched,e.matched),c=u.updated,l=u.deactivated,f=u.activated,p=[].concat(be(l),this.router.beforeHooks,_e(c),f.map(function(e){return e.beforeEnter}),le(f));this.pending=e;var d=function(t,n){if(o.pending!==e)return s();try{t(e,a,function(e){!1===e||i(e)?(o.ensureURL(!0),s(e)):"string"==typeof e||"object"==typeof e&&("string"==typeof e.path||"string"==typeof e.name)?(s(),"object"==typeof e&&e.replace?o.replace(e):o.push(e)):n(e)})}catch(e){s(e)}};ce(p,d,function(){var n=[];ce(xe(f,n,function(){return o.current===e}).concat(o.router.resolveHooks),d,function(){if(o.pending!==e)return s();o.pending=null,t(e),o.router.app&&o.router.app.$nextTick(function(){n.forEach(function(e){e()})})})})},at.prototype.updateRoute=function(e){var t=this.current;this.current=e,this.cb&&this.cb(e),this.router.afterHooks.forEach(function(n){n&&n(e,t)})};var st=function(e){function t(t,n){var r=this;e.call(this,t,n);var i=t.options.scrollBehavior;i&&K();var o=ke(this.base);window.addEventListener("popstate",function(e){var n=r.current,a=ke(r.base);r.current===ze&&a===o||r.transitionTo(a,function(e){i&&X(t,e,n,!0)})})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.go=function(e){window.history.go(e)},t.prototype.push=function(e,t,n){var r=this,i=this,o=i.current;this.transitionTo(e,function(e){se(T(r.base+e.fullPath)),X(r.router,e,o,!1),t&&t(e)},n)},t.prototype.replace=function(e,t,n){var r=this,i=this,o=i.current;this.transitionTo(e,function(e){ue(T(r.base+e.fullPath)),X(r.router,e,o,!1),t&&t(e)},n)},t.prototype.ensureURL=function(e){if(ke(this.base)!==this.current.fullPath){var t=T(this.base+this.current.fullPath);e?se(t):ue(t)}},t.prototype.getCurrentLocation=function(){return ke(this.base)},t}(at),ut=function(e){function t(t,n,r){e.call(this,t,n),r&&$e(this.base)||Oe()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.setupListeners=function(){var e=this,t=this.router,n=t.options.scrollBehavior,r=nt&&n;r&&K(),window.addEventListener(nt?"popstate":"hashchange",function(){var t=e.current;Oe()&&e.transitionTo(Ae(),function(n){r&&X(e.router,n,t,!0),nt||Ie(n.fullPath)})})},t.prototype.push=function(e,t,n){var r=this,i=this,o=i.current;this.transitionTo(e,function(e){Ee(e.fullPath),X(r.router,e,o,!1),t&&t(e)},n)},t.prototype.replace=function(e,t,n){var r=this,i=this,o=i.current;this.transitionTo(e,function(e){Ie(e.fullPath),X(r.router,e,o,!1),t&&t(e)},n)},t.prototype.go=function(e){window.history.go(e)},t.prototype.ensureURL=function(e){var t=this.current.fullPath;Ae()!==t&&(e?Ee(t):Ie(t))},t.prototype.getCurrentLocation=function(){return Ae()},t}(at),ct=function(e){function t(t,n){e.call(this,t,n),this.stack=[],this.index=-1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.push=function(e,t,n){var r=this;this.transitionTo(e,function(e){r.stack=r.stack.slice(0,r.index+1).concat(e),r.index++,t&&t(e)},n)},t.prototype.replace=function(e,t,n){var r=this;this.transitionTo(e,function(e){r.stack=r.stack.slice(0,r.index).concat(e),t&&t(e)},n)},t.prototype.go=function(e){var t=this,n=this.index+e;if(!(n<0||n>=this.stack.length)){var r=this.stack[n];this.confirmTransition(r,function(){t.index=n,t.updateRoute(r)})}},t.prototype.getCurrentLocation=function(){var e=this.stack[this.stack.length-1];return e?e.fullPath:"/"},t.prototype.ensureURL=function(){},t}(at),lt=function(e){void 0===e&&(e={}),this.app=null,this.apps=[],this.options=e,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=V(e.routes||[],this);var t=e.mode||"hash";switch(this.fallback="history"===t&&!nt&&!1!==e.fallback,this.fallback&&(t="hash"),Je||(t="abstract"),this.mode=t,t){case"history":this.history=new st(this,e.base);break;case"hash":this.history=new ut(this,e.base,this.fallback);break;case"abstract":this.history=new ct(this,e.base)}},ft={currentRoute:{configurable:!0}};lt.prototype.match=function(e,t,n){return this.matcher.match(e,t,n)},ft.currentRoute.get=function(){return this.history&&this.history.current},lt.prototype.init=function(e){var t=this;if(this.apps.push(e),!this.app){this.app=e;var n=this.history;if(n instanceof st)n.transitionTo(n.getCurrentLocation());else if(n instanceof ut){var r=function(){n.setupListeners()};n.transitionTo(n.getCurrentLocation(),r,r)}n.listen(function(e){t.apps.forEach(function(t){t._route=e})})}},lt.prototype.beforeEach=function(e){return Me(this.beforeHooks,e)},lt.prototype.beforeResolve=function(e){return Me(this.resolveHooks,e)},lt.prototype.afterEach=function(e){return Me(this.afterHooks,e)},lt.prototype.onReady=function(e,t){this.history.onReady(e,t)},lt.prototype.onError=function(e){this.history.onError(e)},lt.prototype.push=function(e,t,n){this.history.push(e,t,n)},lt.prototype.replace=function(e,t,n){this.history.replace(e,t,n)},lt.prototype.go=function(e){this.history.go(e)},lt.prototype.back=function(){this.go(-1)},lt.prototype.forward=function(){this.go(1)},lt.prototype.getMatchedComponents=function(e){var t=e?e.matched?e:this.resolve(e).route:this.currentRoute;return t?[].concat.apply([],t.matched.map(function(e){return Object.keys(e.components).map(function(t){return e.components[t]})})):[]},lt.prototype.resolve=function(e,t,n){var r=B(e,t||this.history.current,n,this),i=this.match(r,t),o=i.redirectedFrom||i.fullPath;return{location:r,route:i,href:Re(this.history.base,o,this.mode),normalizedTo:r,resolved:i}},lt.prototype.addRoutes=function(e){this.matcher.addRoutes(e),this.history.current!==ze&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(lt.prototype,ft),lt.install=_,lt.version="3.0.1",Je&&window.Vue&&window.Vue.use(lt),t.default=lt},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(19),o=r(i),a=n(32),s=r(a);t.default=[{path:"/",name:"home",component:o.default},{path:"/regenerate/:id(\\d+)",name:"regenerate-single",component:s.default,props:!0},{path:"*",redirect:"/"}]},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(3),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);var a=n(31),s=n(0),u=s(i.a,a.a,!1,null,null,null);t.default=u.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);var a=n(23),s=n(0),u=s(i.a,a.a,!1,null,null,null);t.default=u.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(5),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);var a=n(22),s=n(0),u=s(i.a,a.a,!1,null,null,null);t.default=u.exports},function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement;return(e._self._c||t)("li",{domProps:{innerHTML:e._s(e.thumbnail)}})},i=[],o={render:r,staticRenderFns:i};t.a=o},function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("p",{domProps:{innerHTML:e._s(e.regenerateThumbnails.l10n.Home.intro1)}}),e._v(" "),n("p",{domProps:{innerHTML:e._s(e.regenerateThumbnails.l10n.Home.intro2)}}),e._v(" "),n("p",[n("label",[n("input",{attrs:{type:"checkbox",id:"regenthumbs-regenopt-onlymissing"},domProps:{checked:e.checkboxOnlyMissing},on:{change:function(t){e.checkboxChange("checkboxOnlyMissing",t)}}}),e._v("\n\t\t\t"+e._s(e.regenerateThumbnails.l10n.common.onlyRegenerateMissingThumbnails)+"\n\t\t")])]),e._v(" "),n("p",[n("label",[n("input",{attrs:{type:"checkbox",id:"regenthumbs-regenopt-updateposts"},domProps:{checked:e.checkboxUpdatePosts},on:{change:function(t){e.checkboxChange("checkboxUpdatePosts",t)}}}),e._v("\n\t\t\t"+e._s(e.regenerateThumbnails.l10n.Home.updatePostContents)+"\n\t\t")])]),e._v(" "),n("p",[n("label",[n("input",{attrs:{type:"checkbox",id:"regenthumbs-regenopt-deleteoldthumbnails"},domProps:{checked:e.checkboxDeleteOld},on:{change:function(t){e.checkboxChange("checkboxDeleteOld",t)}}}),e._v("\n\t\t\t"+e._s(e.regenerateThumbnails.l10n.common.deleteOldThumbnails)+"\n\t\t")])]),e._v(" "),e.regenerateThumbnails.data.thumbnailIDs?n("div",[n("p",[n("button",{staticClass:"button button-primary button-hero",on:{click:function(t){e.regenerate(e.regenerateThumbnails.data.thumbnailIDs)}}},[e._v("\n\t\t\t\t"+e._s(e.regenerateThumbnails.l10n.Home.RegenerateThumbnailsForXAttachments)+"\n\t\t\t")])])]):n("div",[n("p",[n("button",{staticClass:"button button-primary button-hero",on:{click:function(t){e.regenerate("all")}}},[e._v("\n\t\t\t\t"+e._s(e.ButtonAllText)+"\n\t\t\t")])]),e._v(" "),e.usingFeaturedImages?n("p",[n("button",{staticClass:"button button-primary button-hero",on:{click:function(t){e.regenerate("featured-images")}}},[e._v("\n\t\t\t\t"+e._s(e.ButtonFeaturedImagesText)+"\n\t\t\t")])]):e._e()]),e._v(" "),n("h2",{staticClass:"title"},[e._v(e._s(e.regenerateThumbnails.l10n.Home.thumbnailSizes))]),e._v(" "),n("p",[e._v(e._s(e.regenerateThumbnails.l10n.Home.thumbnailSizesDescription))]),e._v(" "),n("ul",e._l(e.regenerateThumbnails.data.thumbnailSizes,function(t,r){return n("thumbnail-size",{key:r,tag:"li",attrs:{size:t,text:e.regenerateThumbnails.l10n.common.thumbnailSizeItemWithCropMethodNoFilename,textCropped:e.regenerateThumbnails.l10n.common.thumbnailSizeItemIsCropped,textProportional:e.regenerateThumbnails.l10n.common.thumbnailSizeItemIsProportional}})})),e._v(" "),n("h2",[e._v(e._s(e.regenerateThumbnails.l10n.Home.alternatives))]),e._v(" "),n("p",{domProps:{innerHTML:e._s(e.alternativesText1)}}),e._v(" "),n("p",{domProps:{innerHTML:e._s(e.alternativesText2)}})])},i=[],o={render:r,staticRenderFns:i};t.a=o},function(e,t,n){"use strict";function r(e){n(25)}Object.defineProperty(t,"__esModule",{value:!0});var i=n(8),o=n.n(i);for(var a in i)"default"!==a&&function(e){n.d(t,e,function(){return i[e]})}(a);var s=n(30),u=n(0),c=r,l=u(o.a,s.a,!1,c,"data-v-14cbb363",null);t.default=l.exports},function(e,t,n){var r=n(26);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n(7)("16f8fe35",r,!0)},function(e,t,n){t=e.exports=n(6)(void 0),t.push([e.i,".ui-progressbar[data-v-14cbb363]{margin:20px auto}#regenerate-thumbnails-log[data-v-14cbb363]{height:495px;overflow:auto}#regenerate-thumbnails-error-log[data-v-14cbb363]{max-height:250px;overflow:auto}li[data-v-14cbb363]{margin-left:25px}",""])},function(e,t){e.exports=function(e,t){for(var n=[],r={},i=0;i<t.length;i++){var o=t[i],a=o[0],s=o[1],u=o[2],c=o[3],l={id:e+":"+i,css:s,media:u,sourceMap:c};r[a]?r[a].parts.push(l):n.push(r[a]={id:a,parts:[l]})}return n}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);var a=n(29),s=n(0),u=s(i.a,a.a,!1,null,null,null);t.default=u.exports},function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"ui-progressbar ui-widget ui-widget-content ui-corner-all",attrs:{role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":e.progress}},[n("div",{staticClass:"ui-progressbar-value ui-widget-header ui-corner-left",style:{width:e.progress+"%"}})])},i=[],o={render:r,staticRenderFns:i};t.a=o},function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("progress-bar",{attrs:{progress:e.progress}}),e._v(" "),n("p",[!e.finishedMessage&&e.progress<100?n("button",{staticClass:"button button-secondary button-large",on:{click:e.togglePause}},[e._v("\n\t\t\t"+e._s(e.isPaused?this.regenerateThumbnails.l10n.RegenerateMultiple.resume:this.regenerateThumbnails.l10n.RegenerateMultiple.pause)+"\n\t\t")]):e._e()]),e._v(" "),e.finishedMessage?n("div",[n("p",[n("strong",[e._v(e._s(e.finishedMessage))])]),e._v(" "),e.errorItems.length?n("div",{attrs:{id:"regenerate-thumbnails-error-log"}},[n("h2",{staticClass:"title"},[e._v(e._s(e.regenerateThumbnails.l10n.RegenerateMultiple.errorsEncountered))]),e._v(" "),n("ol",e._l(e.errorItems,function(t){return n("li",{key:t.id,domProps:{innerHTML:e._s(t.message)}})}))]):e._e()]):e._e(),e._v(" "),n("h2",{staticClass:"title"},[e._v(e._s(e.regenerateThumbnails.l10n.RegenerateMultiple.regenerationLog))]),e._v(" "),n("div",{attrs:{id:"regenerate-thumbnails-log"}},[e.logItems?n("ol",{attrs:{start:e.listStart}},e._l(e.logItems,function(t){return n("li",{key:t.id,domProps:{innerHTML:e._s(t.message)}})})):e._e()])],1)},i=[],o={render:r,staticRenderFns:i};t.a=o},function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement;return(e._self._c||t)(e.currentView,{tag:"component",attrs:{settings:e.settings},on:{regenerate:e.regenerate}})},i=[],o={render:r,staticRenderFns:i};t.a=o},function(e,t,n){"use strict";function r(e){n(33)}Object.defineProperty(t,"__esModule",{value:!0});var i=n(10),o=n.n(i);for(var a in i)"default"!==a&&function(e){n.d(t,e,function(){return i[e]})}(a);var s=n(37),u=n(0),c=r,l=u(o.a,s.a,!1,c,"data-v-6435a78a",null);t.default=l.exports},function(e,t,n){var r=n(34);"string"==typeof r&&(r=[[e.i,r,""]]),r.locals&&(e.exports=r.locals);n(7)("3a7f4e3b",r,!0)},function(e,t,n){t=e.exports=n(6)(void 0),t.push([e.i,'.image-preview[data-v-6435a78a]{max-width:500px;max-height:200px}li[data-v-6435a78a]{margin-left:25px}li.exists[data-v-6435a78a]{list-style:url("images/yes.png")}li.notexists[data-v-6435a78a]{list-style:url("images/no.png")}',""])},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(11),i=n.n(r);for(var o in r)"default"!==o&&function(e){n.d(t,e,function(){return r[e]})}(o);var a=n(36),s=n(0),u=s(i.a,a.a,!1,null,null,null);t.default=u.exports},function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement;return(e._self._c||t)("li",{class:[e.size.fileexists?"exists":"notexists"],domProps:{innerHTML:e._s(e.thumbnailText)}})},i=[],o={render:r,staticRenderFns:i};t.a=o},function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.dataLoaded?n("div",[e.errorText?n("div",[n("p",{domProps:{innerHTML:e._s(e.errorText)}})]):n("div",[n("h2",{staticClass:"title"},[e._v(e._s(e.attachmentInfo.name))]),e._v(" "),n("p",{domProps:{innerHTML:e._s(e.filenameAndDimensions)}}),e._v(" "),e.attachmentInfo.preview?n("img",{staticClass:"image-preview",attrs:{src:e.attachmentInfo.preview,alt:e.regenerateThumbnails.l10n.RegenerateSingle.preview}}):e._e(),e._v(" "),n("p",[n("label",[n("input",{attrs:{type:"checkbox",id:"regenthumbs-regenopt-onlymissing"},domProps:{checked:e.regenerateThumbnails.options.onlyMissingThumbnails}}),e._v("\n\t\t\t\t"+e._s(e.regenerateThumbnails.l10n.common.onlyRegenerateMissingThumbnails)+"\n\t\t\t")])]),e._v(" "),n("p",[n("label",[n("input",{attrs:{type:"checkbox",id:"regenthumbs-regenopt-updateposts"},domProps:{checked:e.regenerateThumbnails.options.updatePostContents}}),e._v("\n\t\t\t\t"+e._s(e.regenerateThumbnails.l10n.RegenerateSingle.updatePostContents)+"\n\t\t\t")])]),e._v(" "),n("p",[n("label",[n("input",{attrs:{type:"checkbox",id:"regenthumbs-regenopt-deleteoldthumbnails"},domProps:{checked:e.regenerateThumbnails.options.deleteOldThumbnails},on:{change:e.checkUpdatePosts}}),e._v("\n\t\t\t\t"+e._s(e.regenerateThumbnails.l10n.common.deleteOldThumbnails)+"\n\t\t\t")])]),e._v(" "),e.regenerationError?n("p",[n("strong",{domProps:{innerHTML:e._s(e.regenerationError)}})]):e._e(),e._v(" "),n("p",{staticClass:"submit"},[n("button",{staticClass:"button button-primary button-hero",on:{click:e.regenerate}},[e._v("\n\t\t\t\t"+e._s(e.regenerateThumbnails.l10n.common.regenerateThumbnails)+"\n\t\t\t")])]),e._v(" "),n("p",[e._v(e._s(e.regenerateThumbnails.l10n.RegenerateSingle.registeredSizes))]),e._v(" "),n("ul",e._l(e.attachmentInfo.registered_sizes,function(t){return n("thumbnail-status",{key:t.label,tag:"li",attrs:{size:t,l10n:e.regenerateThumbnails.l10n}})})),e._v(" "),e.attachmentInfo.unregistered_sizes.length?n("div",[n("p",[e._v(e._s(e.regenerateThumbnails.l10n.RegenerateSingle.unregisteredSizes))]),e._v(" "),n("ul",e._l(e.attachmentInfo.unregistered_sizes,function(t){return n("thumbnail-status",{key:t.label,tag:"li",attrs:{size:t,l10n:e.regenerateThumbnails.l10n}})}))]):e._e()])]):n("div",[n("p",[e._v(e._s(e.regenerateThumbnails.l10n.common.loading))])])},i=[],o={render:r,staticRenderFns:i};t.a=o}]);
includes/class-regeneratethumbnails-regenerator.php ADDED
@@ -0,0 +1,669 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Regenerate Thumbnails: Attachment regenerator class
4
+ *
5
+ * @package RegenerateThumbnails
6
+ * @since 3.0.0
7
+ */
8
+
9
+ /**
10
+ * Regenerates the thumbnails for a given attachment.
11
+ *
12
+ * @since 3.0.0
13
+ */
14
+ class RegenerateThumbnails_Regenerator {
15
+
16
+ /**
17
+ * The WP_Post object for the attachment that is being operated on.
18
+ *
19
+ * @since 3.0.0
20
+ *
21
+ * @var WP_Post
22
+ */
23
+ public $attachment;
24
+
25
+ /**
26
+ * The full path to the original image so that it can be passed between methods.
27
+ *
28
+ * @since 3.0.0
29
+ *
30
+ * @var string
31
+ */
32
+ public $fullsizepath;
33
+
34
+ /**
35
+ * An array of thumbnail size(s) that were skipped during regeneration due to already existing.
36
+ * A class variable is used so that the data can later be used to merge the size(s) back in.
37
+ *
38
+ * @since 3.0.0
39
+ *
40
+ * @var array
41
+ */
42
+ public $skipped_thumbnails = array();
43
+
44
+ /**
45
+ * Generates an instance of this class after doing some setup.
46
+ *
47
+ * MIME type is purposefully not validated in order to be more future proof and
48
+ * to avoid duplicating a ton of logic that already exists in WordPress core.
49
+ *
50
+ * @since 3.0.0
51
+ *
52
+ * @param int $attachment_id Attachment ID to process.
53
+ *
54
+ * @return RegenerateThumbnails_Regenerator|WP_Error A new instance of RegenerateThumbnails_Regenerator on success, or WP_Error on error.
55
+ */
56
+ public static function get_instance( $attachment_id ) {
57
+ $attachment = get_post( $attachment_id );
58
+
59
+ if ( ! $attachment ) {
60
+ return new WP_Error(
61
+ 'regenerate_thumbnails_regenerator_attachment_doesnt_exist',
62
+ __( 'No attachment exists with that ID.', 'regenerate-thumbnails' ),
63
+ array(
64
+ 'status' => 404,
65
+ )
66
+ );
67
+ }
68
+
69
+ // We can only regenerate thumbnails for attachments.
70
+ if ( 'attachment' !== get_post_type( $attachment ) ) {
71
+ return new WP_Error(
72
+ 'regenerate_thumbnails_regenerator_not_attachment',
73
+ __( 'This item is not an attachment.', 'regenerate-thumbnails' ),
74
+ array(
75
+ 'status' => 400,
76
+ )
77
+ );
78
+ }
79
+
80
+ // Don't touch any attachments that are being used as a site icon. Their thumbnails are usually custom cropped.
81
+ if ( self::is_site_icon( $attachment ) ) {
82
+ return new WP_Error(
83
+ 'regenerate_thumbnails_regenerator_is_site_icon',
84
+ __( "This attachment is a site icon and therefore the thumbnails shouldn't be touched.", 'regenerate-thumbnails' ),
85
+ array(
86
+ 'status' => 415,
87
+ 'attachment' => $attachment,
88
+ )
89
+ );
90
+ }
91
+
92
+ return new RegenerateThumbnails_Regenerator( $attachment );
93
+ }
94
+
95
+ /**
96
+ * The constructor for this class. Don't call this directly, see get_instance() instead.
97
+ * This is done so that WP_Error objects can be returned during class initiation.
98
+ *
99
+ * @since 3.0.0
100
+ *
101
+ * @param WP_Post $attachment The WP_Post object for the attachment that is being operated on.
102
+ */
103
+ private function __construct( WP_Post $attachment ) {
104
+ $this->attachment = $attachment;
105
+ }
106
+
107
+ /**
108
+ * Returns whether the attachment is or was a site icon.
109
+ *
110
+ * @since 3.0.0
111
+ *
112
+ * @param WP_Post $attachment The WP_Post object for the attachment that is being operated on.
113
+ *
114
+ * @return bool Whether the attachment is or was a site icon.
115
+ */
116
+ public static function is_site_icon( WP_Post $attachment ) {
117
+ return ( 'site-icon' === get_post_meta( $attachment->ID, '_wp_attachment_context', true ) );
118
+ }
119
+
120
+ /**
121
+ * Get the path to the fullsize attachment.
122
+ *
123
+ * @return string|WP_Error The path to the fullsize attachment, or a WP_Error object on error.
124
+ */
125
+ public function get_fullsizepath() {
126
+ if ( $this->fullsizepath ) {
127
+ return $this->fullsizepath;
128
+ }
129
+
130
+ $this->fullsizepath = get_attached_file( $this->attachment->ID );
131
+
132
+ if ( false === $this->fullsizepath || ! file_exists( $this->fullsizepath ) ) {
133
+ $error = new WP_Error(
134
+ 'regenerate_thumbnails_regenerator_file_not_found',
135
+ sprintf(
136
+ /* translators: The relative upload path to the attachment. */
137
+ __( "The fullsize image file cannot be found in your uploads directory at <code>%s</code>. Without it, new thumbnail images can't be generated.", 'regenerate-thumbnails' ),
138
+ _wp_relative_upload_path( $this->fullsizepath )
139
+ ),
140
+ array(
141
+ 'status' => 404,
142
+ 'fullsizepath' => _wp_relative_upload_path( $this->fullsizepath ),
143
+ 'attachment' => $this->attachment,
144
+ )
145
+ );
146
+
147
+ $this->fullsizepath = $error;
148
+ }
149
+
150
+ return $this->fullsizepath;
151
+ }
152
+
153
+ /**
154
+ * Regenerate the thumbnails for this instance's attachment.
155
+ *
156
+ * @since 3.0.0
157
+ *
158
+ * @param array|string $args {
159
+ * Optional. Array or string of arguments for thumbnail regeneration.
160
+ *
161
+ * @type bool $only_regenerate_missing_thumbnails Skip regenerating existing thumbnail files. Default true.
162
+ * @type bool $delete_unregistered_thumbnail_files Delete any thumbnail sizes that are no longer registered. Default false.
163
+ * }
164
+ *
165
+ * @return mixed|WP_Error Metadata for attachment (see wp_generate_attachment_metadata()), or WP_Error on error.
166
+ */
167
+ public function regenerate( $args = array() ) {
168
+ global $wpdb;
169
+
170
+ $args = wp_parse_args( $args, array(
171
+ 'only_regenerate_missing_thumbnails' => true,
172
+ 'delete_unregistered_thumbnail_files' => false,
173
+ ) );
174
+
175
+ $fullsizepath = $this->get_fullsizepath();
176
+ if ( is_wp_error( $fullsizepath ) ) {
177
+ $fullsizepath->add_data( array( 'attachment' => $this->attachment ) );
178
+
179
+ return $fullsizepath;
180
+ }
181
+
182
+ $old_metadata = wp_get_attachment_metadata( $this->attachment->ID );
183
+
184
+ if ( $args['only_regenerate_missing_thumbnails'] ) {
185
+ add_filter( 'intermediate_image_sizes_advanced', array( $this, 'filter_image_sizes_to_only_missing_thumbnails' ), 10, 2 );
186
+ }
187
+
188
+ require_once( ABSPATH . 'wp-admin/includes/admin.php' );
189
+ $new_metadata = wp_generate_attachment_metadata( $this->attachment->ID, $fullsizepath );
190
+
191
+ if ( $args['only_regenerate_missing_thumbnails'] ) {
192
+ // Thumbnail sizes that existed were removed and need to be added back to the metadata.
193
+ foreach ( $this->skipped_thumbnails as $skipped_thumbnail ) {
194
+ if ( ! empty( $old_metadata['sizes'][ $skipped_thumbnail ] ) ) {
195
+ $new_metadata['sizes'][ $skipped_thumbnail ] = $old_metadata['sizes'][ $skipped_thumbnail ];
196
+ }
197
+ }
198
+ $this->skipped_thumbnails = array();
199
+
200
+ remove_filter( 'intermediate_image_sizes_advanced', array( $this, 'filter_image_sizes_to_only_missing_thumbnails' ), 10 );
201
+ }
202
+
203
+ $wp_upload_dir = dirname( $fullsizepath ) . DIRECTORY_SEPARATOR;
204
+
205
+ if ( $args['delete_unregistered_thumbnail_files'] ) {
206
+ // Delete old sizes that are still in the metadata.
207
+ $intermediate_image_sizes = get_intermediate_image_sizes();
208
+ foreach ( $old_metadata['sizes'] as $old_size => $old_size_data ) {
209
+ if ( in_array( $old_size, $intermediate_image_sizes ) ) {
210
+ continue;
211
+ }
212
+
213
+ wp_delete_file( $wp_upload_dir . $old_size_data['file'] );
214
+
215
+ unset( $new_metadata['sizes'][ $old_size ] );
216
+ }
217
+
218
+ $relative_path = dirname( $new_metadata['file'] ) . DIRECTORY_SEPARATOR;
219
+
220
+ // It's possible to upload an image with a filename like image-123x456.jpg and it shouldn't be deleted.
221
+ $whitelist = $wpdb->get_col( $wpdb->prepare( "
222
+ SELECT
223
+ meta_value
224
+ FROM
225
+ {$wpdb->postmeta}
226
+ WHERE
227
+ meta_key = '_wp_attached_file'
228
+ AND meta_value REGEXP %s
229
+ /* Regenerate Thumbnails */
230
+ ",
231
+ '^' . preg_quote( $relative_path ) . '[^' . preg_quote( DIRECTORY_SEPARATOR ) . ']+-[0-9]+x[0-9]+\.'
232
+ ) );
233
+ $whitelist = array_map( 'basename', $whitelist );
234
+
235
+ $filelist = array();
236
+ foreach ( scandir( $wp_upload_dir ) as $file ) {
237
+ if ( '.' == $file || '..' == $file || ! is_file( $wp_upload_dir . $file ) ) {
238
+ continue;
239
+ }
240
+
241
+ $filelist[] = $file;
242
+ }
243
+
244
+ $registered_thumbnails = array();
245
+ foreach ( $new_metadata['sizes'] as $size ) {
246
+ $registered_thumbnails[] = $size['file'];
247
+ }
248
+
249
+ $fullsize_parts = pathinfo( $fullsizepath );
250
+
251
+ foreach ( $filelist as $file ) {
252
+ if ( in_array( $file, $whitelist ) || in_array( $file, $registered_thumbnails ) ) {
253
+ continue;
254
+ }
255
+
256
+ if ( ! preg_match( '#^' . preg_quote( $fullsize_parts['filename'], '#' ) . '-[0-9]+x[0-9]+\.' . preg_quote( $fullsize_parts['extension'], '#' ) . '$#', $file ) ) {
257
+ continue;
258
+ }
259
+
260
+ wp_delete_file( $wp_upload_dir . $file );
261
+ }
262
+ } elseif ( is_array( $old_metadata ) && is_array( $old_metadata['sizes'] ) ) {
263
+ // If not deleting, rename any size conflicts to avoid them being lost if the file still exists.
264
+ foreach ( $old_metadata['sizes'] as $old_size => $old_size_data ) {
265
+ if ( empty( $new_metadata['sizes'][ $old_size ] ) ) {
266
+ $new_metadata['sizes'][ $old_size ] = $old_metadata['sizes'][ $old_size ];
267
+ continue;
268
+ }
269
+
270
+ $new_size_data = $new_metadata['sizes'][ $old_size ];
271
+
272
+ if (
273
+ $new_size_data['width'] !== $old_size_data['width']
274
+ && $new_size_data['height'] !== $old_size_data['height']
275
+ && file_exists( $wp_upload_dir . $old_size_data['file'] )
276
+ ) {
277
+ $new_metadata['sizes'][ $old_size . '_old_' . $old_size_data['width'] . 'x' . $old_size_data['height'] ] = $old_size_data;
278
+ }
279
+ }
280
+ }
281
+
282
+ wp_update_attachment_metadata( $this->attachment->ID, $new_metadata );
283
+
284
+ return $new_metadata;
285
+ }
286
+
287
+ /**
288
+ * Filters the list of thumbnail sizes to only include those which have missing files.
289
+ *
290
+ * @since 3.0.0
291
+ *
292
+ * @param array $sizes An associative array of registered thumbnail image sizes.
293
+ * @param array $fullsize_metadata An associative array of fullsize image metadata: width, height, file.
294
+ *
295
+ * @return array An associative array of image sizes.
296
+ */
297
+ public function filter_image_sizes_to_only_missing_thumbnails( $sizes, $fullsize_metadata ) {
298
+ if ( ! $sizes ) {
299
+ return $sizes;
300
+ }
301
+
302
+ $fullsizepath = $this->get_fullsizepath();
303
+ if ( is_wp_error( $fullsizepath ) ) {
304
+ return $sizes;
305
+ }
306
+
307
+ $editor = wp_get_image_editor( $fullsizepath );
308
+ if ( is_wp_error( $editor ) ) {
309
+ return $sizes;
310
+ }
311
+
312
+ $metadata = wp_get_attachment_metadata( $this->attachment->ID );
313
+
314
+ // This is based on WP_Image_Editor_GD::multi_resize() and others.
315
+ foreach ( $sizes as $size => $size_data ) {
316
+ if ( empty( $metadata['sizes'][ $size ] ) ) {
317
+ continue;
318
+ }
319
+
320
+ if ( ! isset( $size_data['width'] ) && ! isset( $size_data['height'] ) ) {
321
+ continue;
322
+ }
323
+
324
+ if ( ! isset( $size_data['width'] ) ) {
325
+ $size_data['width'] = null;
326
+ }
327
+ if ( ! isset( $size_data['height'] ) ) {
328
+ $size_data['height'] = null;
329
+ }
330
+
331
+ if ( ! isset( $size_data['crop'] ) ) {
332
+ $size_data['crop'] = false;
333
+ }
334
+
335
+ $thumbnail = $this->get_thumbnail(
336
+ $editor,
337
+ $fullsize_metadata['width'],
338
+ $fullsize_metadata['height'],
339
+ $size_data['width'],
340
+ $size_data['height'],
341
+ $size_data['crop']
342
+ );
343
+
344
+ // The false check filters out thumbnails that would be larger than the fullsize image.
345
+ // The size comparison makes sure that the size is also correct.
346
+ if (
347
+ false === $thumbnail
348
+ || (
349
+ $thumbnail['width'] === $metadata['sizes'][ $size ]['width']
350
+ && $thumbnail['height'] === $metadata['sizes'][ $size ]['height']
351
+ && file_exists( $thumbnail['filename'] )
352
+ )
353
+ ) {
354
+ $this->skipped_thumbnails[] = $size;
355
+ unset( $sizes[ $size ] );
356
+ }
357
+ }
358
+
359
+ return $sizes;
360
+ }
361
+
362
+ /**
363
+ * Generate the thumbnail filename and dimensions for a given set of constraint dimensions.
364
+ *
365
+ * @since 3.0.0
366
+ *
367
+ * @param WP_Image_Editor|WP_Error $editor An instance of WP_Image_Editor, as returned by wp_get_image_editor().
368
+ * @param int $fullsize_width The width of the fullsize image.
369
+ * @param int $fullsize_height The height of the fullsize image.
370
+ * @param int $thumbnail_width The width of the thumbnail.
371
+ * @param int $thumbnail_height The height of the thumbnail.
372
+ * @param bool $crop Whether to crop or not.
373
+ *
374
+ * @return array|false An array of the filename, thumbnail width, and thumbnail height,
375
+ * or false on failure to resize such as the thumbnail being larger than the fullsize image.
376
+ */
377
+ public function get_thumbnail( $editor, $fullsize_width, $fullsize_height, $thumbnail_width, $thumbnail_height, $crop ) {
378
+ $dims = image_resize_dimensions( $fullsize_width, $fullsize_height, $thumbnail_width, $thumbnail_height, $crop );
379
+
380
+ if ( ! $dims ) {
381
+ return false;
382
+ }
383
+
384
+ list( $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h ) = $dims;
385
+
386
+ $suffix = "{$dst_w}x{$dst_h}";
387
+ $file_ext = strtolower( pathinfo( $this->get_fullsizepath(), PATHINFO_EXTENSION ) );
388
+
389
+ return array(
390
+ 'filename' => $editor->generate_filename( $suffix, null, $file_ext ),
391
+ 'width' => $dst_w,
392
+ 'height' => $dst_h,
393
+ );
394
+ }
395
+
396
+ /**
397
+ * Update the post content of any public post types (posts and pages by default)
398
+ * that make use of this attachment.
399
+ *
400
+ * @since 3.0.0
401
+ *
402
+ * @param array|string $args {
403
+ * Optional. Array or string of arguments for controlling the updating.
404
+ *
405
+ * @type array $post_type The post types to update. Defaults to public post types (posts and pages by default).
406
+ * @type array $post_ids Specific post IDs to update as opposed to any that uses the attachment.
407
+ * @type int $posts_per_loop How many posts to query at a time to keep memory usage down. You shouldn't need to modify this.
408
+ * }
409
+ *
410
+ * @return array List of post IDs that were modified. The key is the post ID and the value is either the post ID again or a WP_Error object if wp_update_post() failed.
411
+ */
412
+ public function update_usages_in_posts( $args = array() ) {
413
+ $args = wp_parse_args( $args, array(
414
+ 'post_type' => array(),
415
+ 'post_ids' => array(),
416
+ 'posts_per_loop' => 10,
417
+ ) );
418
+
419
+ if ( empty( $args['post_type'] ) ) {
420
+ $args['post_type'] = array_values( get_post_types( array( 'public' => true ) ) );
421
+ unset( $args['post_type']['attachment'] );
422
+ }
423
+
424
+ $offset = 0;
425
+ $posts_updated = array();
426
+
427
+ while ( true ) {
428
+ $posts = get_posts( array(
429
+ 'numberposts' => $args['posts_per_loop'],
430
+ 'offset' => $offset,
431
+ 'orderby' => 'ID',
432
+ 'order' => 'ASC',
433
+ 'include' => $args['post_ids'],
434
+ 'post_type' => $args['post_type'],
435
+ 's' => 'wp-image-' . $this->attachment->ID,
436
+
437
+ // For faster queries.
438
+ 'update_post_meta_cache' => false,
439
+ 'update_post_term_cache' => false,
440
+ ) );
441
+
442
+ if ( ! $posts ) {
443
+ break;
444
+ }
445
+
446
+ $offset += $args['posts_per_loop'];
447
+
448
+ foreach ( $posts as $post ) {
449
+ $content = $post->post_content;
450
+ $search = array();
451
+ $replace = array();
452
+
453
+ // Find all <img> tags for this attachment and update them.
454
+ preg_match_all(
455
+ '#<img [^>]+wp-image-' . $this->attachment->ID . '[^>]+/>#i',
456
+ $content,
457
+ $matches,
458
+ PREG_SET_ORDER
459
+ );
460
+ if ( $matches ) {
461
+ foreach ( $matches as $img_tag ) {
462
+ preg_match( '# class="([^"]+)?size-([^" ]+)#i', $img_tag[0], $thumbnail_size );
463
+
464
+ if ( $thumbnail_size ) {
465
+ $thumbnail = image_downsize( $this->attachment->ID, $thumbnail_size[2] );
466
+
467
+ if ( ! $thumbnail ) {
468
+ continue;
469
+ }
470
+
471
+ $search[] = $img_tag[0];
472
+
473
+ $img_tag[0] = preg_replace( '# src="[^"]+"#i', ' src="' . esc_url( $thumbnail[0] ) . '"', $img_tag[0] );
474
+ $img_tag[0] = preg_replace(
475
+ '# width="[^"]+" height="[^"]+"#i',
476
+ ' width="' . esc_attr( $thumbnail[1] ) . '" height="' . esc_attr( $thumbnail[2] ) . '"',
477
+ $img_tag[0]
478
+ );
479
+
480
+ $replace[] = $img_tag[0];
481
+ }
482
+ }
483
+ }
484
+ $content = str_replace( $search, $replace, $content );
485
+ $search = array();
486
+ $replace = array();
487
+
488
+ // Update the width in any [caption] shortcodes.
489
+ preg_match_all(
490
+ '#\[caption id="attachment_' . $this->attachment->ID . '"([^\]]+)? width="[^"]+"\]([^\[]+)size-([^" ]+)([^\[]+)\[\/caption\]#i',
491
+ $content,
492
+ $matches,
493
+ PREG_SET_ORDER
494
+ );
495
+ if ( $matches ) {
496
+ foreach ( $matches as $match ) {
497
+ $thumbnail = image_downsize( $this->attachment->ID, $match[3] );
498
+
499
+ if ( ! $thumbnail ) {
500
+ continue;
501
+ }
502
+
503
+ $search[] = $match[0];
504
+ $replace[] = '[caption id="attachment_' . $this->attachment->ID . '"' . $match[1] . ' width="' . esc_attr( $thumbnail[1] ) . '"]' . $match[2] . 'size-' . $match[3] . $match[4] . '[/caption]';
505
+ }
506
+ }
507
+ $content = str_replace( $search, $replace, $content );
508
+
509
+ $updated_post_object = (object) array(
510
+ 'ID' => $post->ID,
511
+ 'post_content' => $content,
512
+ );
513
+
514
+ $posts_updated[ $post->ID ] = wp_update_post( $updated_post_object, true );
515
+ }
516
+ }
517
+
518
+ return $posts_updated;
519
+ }
520
+
521
+ /**
522
+ * Returns information about the current attachment for use in the REST API.
523
+ *
524
+ * @since 3.0.0
525
+ *
526
+ * @return array|WP_Error The attachment name, fullsize URL, registered thumbnail size status, and any unregistered sizes, or WP_Error on error.
527
+ */
528
+ public function get_attachment_info() {
529
+ $fullsizepath = $this->get_fullsizepath();
530
+ if ( is_wp_error( $fullsizepath ) ) {
531
+ $fullsizepath->add_data( array( 'attachment' => $this->attachment ) );
532
+
533
+ return $fullsizepath;
534
+ }
535
+
536
+ $editor = wp_get_image_editor( $fullsizepath );
537
+ if ( is_wp_error( $editor ) ) {
538
+ // Display a more helpful error message.
539
+ if ( 'image_no_editor' === $editor->get_error_code() ) {
540
+ $editor = new WP_Error( 'image_no_editor', __( 'The current image editor cannot process this file type.', 'regenerate-thumbnails' ) );
541
+ }
542
+
543
+ $editor->add_data( array(
544
+ 'attachment' => $this->attachment,
545
+ 'status' => 415,
546
+ ) );
547
+
548
+ return $editor;
549
+ }
550
+
551
+ $metadata = wp_get_attachment_metadata( $this->attachment->ID );
552
+
553
+ // PDFs don't have width/height set.
554
+ $width = ( isset( $metadata['width'] ) ) ? $metadata['width'] : null;
555
+ $height = ( isset( $metadata['height'] ) ) ? $metadata['height'] : null;
556
+
557
+ require_once( ABSPATH . '/wp-admin/includes/image.php' );
558
+
559
+ if ( file_is_displayable_image( $fullsizepath ) ) {
560
+ $preview = wp_get_attachment_url( $this->attachment->ID );
561
+ } elseif (
562
+ is_array( $metadata['sizes']['full'] ) &&
563
+ file_exists( str_replace(
564
+ basename( $fullsizepath ),
565
+ $metadata['sizes']['full']['file'],
566
+ $fullsizepath
567
+ ) )
568
+ ) {
569
+ $preview = str_replace(
570
+ basename( $fullsizepath ),
571
+ $metadata['sizes']['full']['file'],
572
+ wp_get_attachment_url( $this->attachment->ID )
573
+ );
574
+ } else {
575
+ $preview = false;
576
+ }
577
+
578
+ $response = array(
579
+ 'name' => $this->attachment->post_title,
580
+ 'preview' => $preview,
581
+ 'relative_path' => _wp_get_attachment_relative_path( $fullsizepath ) . DIRECTORY_SEPARATOR . basename( $fullsizepath ),
582
+ 'edit_url' => get_edit_post_link( $this->attachment->ID, 'raw' ),
583
+ 'width' => $width,
584
+ 'height' => $height,
585
+ 'registered_sizes' => array(),
586
+ 'unregistered_sizes' => array(),
587
+ );
588
+
589
+ $wp_upload_dir = dirname( $fullsizepath ) . DIRECTORY_SEPARATOR;
590
+
591
+ $registered_sizes = RegenerateThumbnails()->get_thumbnail_sizes();
592
+
593
+ if ( 'application/pdf' === get_post_mime_type( $this->attachment ) ) {
594
+ $registered_sizes = array_intersect_key(
595
+ $registered_sizes,
596
+ array(
597
+ 'thumbnail' => true,
598
+ 'medium' => true,
599
+ 'large' => true,
600
+ )
601
+ );
602
+ }
603
+
604
+ // Check the status of all currently registered sizes.
605
+ foreach ( $registered_sizes as $size ) {
606
+ // Width and height are needed to generate the thumbnail filename.
607
+ if ( $width && $height ) {
608
+ $thumbnail = $this->get_thumbnail( $editor, $width, $height, $size['width'], $size['height'], $size['crop'] );
609
+
610
+ if ( $thumbnail ) {
611
+ $size['filename'] = basename( $thumbnail['filename'] );
612
+ $size['fileexists'] = file_exists( $thumbnail['filename'] );
613
+ } else {
614
+ $size['filename'] = false;
615
+ $size['fileexists'] = false;
616
+ }
617
+ }
618
+ // No width and height? Let's see if there's a filename in the metadata.
619
+ elseif ( ! empty( $metadata['sizes'][ $size['label'] ]['file'] ) ) {
620
+ $size['filename'] = basename( $metadata['sizes'][ $size['label'] ]['file'] );
621
+ $size['fileexists'] = file_exists( $wp_upload_dir . $metadata['sizes'][ $size['label'] ]['file'] );
622
+ } else {
623
+ $size['filename'] = false;
624
+ $size['fileexists'] = false;
625
+ }
626
+
627
+ $response['registered_sizes'][] = $size;
628
+ }
629
+
630
+ if ( ! $width && ! $height && is_array( $metadata['sizes']['full'] ) ) {
631
+ $response['registered_sizes'][] = array(
632
+ 'label' => 'full',
633
+ 'width' => $metadata['sizes']['full']['width'],
634
+ 'height' => $metadata['sizes']['full']['height'],
635
+ 'filename' => $metadata['sizes']['full']['file'],
636
+ 'fileexists' => file_exists( $wp_upload_dir . $metadata['sizes']['full']['file'] ),
637
+ );
638
+ }
639
+
640
+ // Look at the attachment metadata and see if we have any extra files from sizes that are no longer registered.
641
+ foreach ( $metadata['sizes'] as $label => $size ) {
642
+ if ( ! file_exists( $wp_upload_dir . $size['file'] ) ) {
643
+ continue;
644
+ }
645
+
646
+ // An unregistered size could match a registered size's dimensions. Ignore these.
647
+ foreach ( $response['registered_sizes'] as $registered_size ) {
648
+ if ( $size['file'] === $registered_size['filename'] ) {
649
+ continue 2;
650
+ }
651
+ }
652
+
653
+ if ( ! empty( $registered_sizes[ $label ] ) ) {
654
+ /* translators: Used for listing old sizes of currently registered thumbnails */
655
+ $label = sprintf( __( '%s (old)', 'regenerate-thumbnails' ), $label );
656
+ }
657
+
658
+ $response['unregistered_sizes'][] = array(
659
+ 'label' => $label,
660
+ 'width' => $size['width'],
661
+ 'height' => $size['height'],
662
+ 'filename' => $size['file'],
663
+ 'fileexists' => true,
664
+ );
665
+ }
666
+
667
+ return $response;
668
+ }
669
+ }
includes/class-regeneratethumbnails-rest-controller.php ADDED
@@ -0,0 +1,316 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Regenerate Thumbnails: REST API controller class
4
+ *
5
+ * @package RegenerateThumbnails
6
+ * @since 3.0.0
7
+ */
8
+
9
+ /**
10
+ * Registers new REST API endpoints.
11
+ *
12
+ * @since 3.0.0
13
+ */
14
+ class RegenerateThumbnails_REST_Controller extends WP_REST_Controller {
15
+ /**
16
+ * The namespace for the REST API routes.
17
+ *
18
+ * @since 3.0.0
19
+ *
20
+ * @var string
21
+ */
22
+ public $namespace = 'regenerate-thumbnails/v1';
23
+
24
+ /**
25
+ * Register the new routes and endpoints.
26
+ *
27
+ * @since 3.0.0
28
+ */
29
+ public function register_routes() {
30
+ register_rest_route( $this->namespace, '/regenerate/(?P<id>[\d]+)', array(
31
+ array(
32
+ 'methods' => WP_REST_Server::EDITABLE,
33
+ 'callback' => array( $this, 'regenerate_item' ),
34
+ 'permission_callback' => array( $this, 'permissions_check' ),
35
+ 'args' => array(
36
+ 'only_regenerate_missing_thumbnails' => array(
37
+ 'description' => __( "Whether to only regenerate missing thumbnails. It's faster with this enabled.", 'regenerate-thumbnails' ),
38
+ 'type' => 'boolean',
39
+ 'default' => true,
40
+ ),
41
+ 'delete_unregistered_thumbnail_files' => array(
42
+ 'description' => __( 'Whether to delete any old, now unregistered thumbnail files.', 'regenerate-thumbnails' ),
43
+ 'type' => 'boolean',
44
+ 'default' => false,
45
+ ),
46
+ 'update_usages_in_posts' => array(
47
+ 'description' => __( 'Whether to update the image tags in any posts that make use of this attachment.', 'regenerate-thumbnails' ),
48
+ 'type' => 'boolean',
49
+ 'default' => true,
50
+ ),
51
+ 'update_usages_in_posts_post_type' => array(
52
+ 'description' => __( 'The types of posts to update. Defaults to all public post types.', 'regenerate-thumbnails' ),
53
+ 'type' => 'array',
54
+ 'default' => array(),
55
+ 'validate_callback' => array( $this, 'is_array' ),
56
+ ),
57
+ 'update_usages_in_posts_post_ids' => array(
58
+ 'description' => __( 'Specific post IDs to update rather than any posts that use this attachment.', 'regenerate-thumbnails' ),
59
+ 'type' => 'array',
60
+ 'default' => array(),
61
+ 'validate_callback' => array( $this, 'is_array' ),
62
+ ),
63
+ 'update_usages_in_posts_posts_per_loop' => array(
64
+ 'description' => __( "Posts to process per loop. This is control memory usage and you likely don't need to adjust this.", 'regenerate-thumbnails' ),
65
+ 'type' => 'integer',
66
+ 'default' => 10,
67
+ 'sanitize_callback' => 'absint',
68
+ ),
69
+ ),
70
+ ),
71
+ ) );
72
+
73
+ register_rest_route( $this->namespace, '/attachmentinfo/(?P<id>[\d]+)', array(
74
+ array(
75
+ 'methods' => WP_REST_Server::READABLE,
76
+ 'callback' => array( $this, 'attachment_info' ),
77
+ 'permission_callback' => array( $this, 'permissions_check' ),
78
+ ),
79
+ ) );
80
+
81
+ register_rest_route( $this->namespace, '/featuredimages', array(
82
+ array(
83
+ 'methods' => WP_REST_Server::READABLE,
84
+ 'callback' => array( $this, 'featured_images' ),
85
+ 'permission_callback' => array( $this, 'permissions_check' ),
86
+ 'args' => $this->get_paging_collection_params(),
87
+ ),
88
+ ) );
89
+ }
90
+
91
+ /**
92
+ * Register a filter to allow excluding site icons via a query parameter.
93
+ *
94
+ * @since 3.0.0
95
+ */
96
+ public function register_filters() {
97
+ add_filter( 'rest_attachment_query', array( $this, 'maybe_filter_out_site_icons' ), 10, 2 );
98
+ add_filter( 'rest_attachment_query', array( $this, 'maybe_filter_mimes_types' ), 10, 2 );
99
+ }
100
+
101
+ /**
102
+ * If the exclude_site_icons parameter is set on a media (attachment) request,
103
+ * filter out any attachments that are or were being used as a site icon.
104
+ *
105
+ * @param array $args Key value array of query var to query value.
106
+ * @param WP_REST_Request $request The request used.
107
+ *
108
+ * @return array Key value array of query var to query value.
109
+ */
110
+ public function maybe_filter_out_site_icons( $args, $request ) {
111
+ if ( empty( $request['exclude_site_icons'] ) ) {
112
+ return $args;
113
+ }
114
+
115
+ if ( ! isset( $args['meta_query'] ) ) {
116
+ $args['meta_query'] = array();
117
+ }
118
+
119
+ $args['meta_query'][] = array(
120
+ 'key' => '_wp_attachment_context',
121
+ 'value' => 'site-icon',
122
+ 'compare' => 'NOT EXISTS',
123
+ );
124
+
125
+ return $args;
126
+ }
127
+
128
+ /**
129
+ * If the is_regeneratable parameter is set on a media (attachment) request,
130
+ * filter results to only include images and PDFs.
131
+ *
132
+ * @param array $args Key value array of query var to query value.
133
+ * @param WP_REST_Request $request The request used.
134
+ *
135
+ * @return array Key value array of query var to query value.
136
+ */
137
+ public function maybe_filter_mimes_types( $args, $request ) {
138
+ if ( empty( $request['is_regeneratable'] ) ) {
139
+ return $args;
140
+ }
141
+
142
+ $args['post_mime_type'] = array();
143
+ foreach ( get_allowed_mime_types() as $mime_type ) {
144
+ if ( 'application/pdf' == $mime_type || 'image/' == substr( $mime_type, 0, 6 ) ) {
145
+ $args['post_mime_type'][] = $mime_type;
146
+ }
147
+ }
148
+
149
+ return $args;
150
+ }
151
+
152
+ /**
153
+ * Retrieves the paging query params for the collections.
154
+ *
155
+ * @since 3.0.0
156
+ *
157
+ * @return array Query parameters for the collection.
158
+ */
159
+ public function get_paging_collection_params() {
160
+ return array_intersect_key(
161
+ parent::get_collection_params(),
162
+ array_flip( array( 'page', 'per_page' ) )
163
+ );
164
+ }
165
+
166
+ /**
167
+ * Regenerate the thumbnails for a specific media item.
168
+ *
169
+ * @since 3.0.0
170
+ *
171
+ * @param WP_REST_Request $request Full data about the request.
172
+ *
173
+ * @return true|WP_Error True on success, otherwise a WP_Error object.
174
+ */
175
+ public function regenerate_item( $request ) {
176
+ $regenerator = RegenerateThumbnails_Regenerator::get_instance( $request->get_param( 'id' ) );
177
+
178
+ if ( is_wp_error( $regenerator ) ) {
179
+ return $regenerator;
180
+ }
181
+
182
+ $result = $regenerator->regenerate( array(
183
+ 'only_regenerate_missing_thumbnails' => $request->get_param( 'only_regenerate_missing_thumbnails' ),
184
+ 'delete_unregistered_thumbnail_files' => $request->get_param( 'delete_unregistered_thumbnail_files' ),
185
+ ) );
186
+
187
+ if ( is_wp_error( $result ) ) {
188
+ return $result;
189
+ }
190
+
191
+ if ( $request->get_param( 'update_usages_in_posts' ) ) {
192
+ $posts_updated = $regenerator->update_usages_in_posts( array(
193
+ 'post_type' => $request->get_param( 'update_usages_in_posts_post_type' ),
194
+ 'post_ids' => $request->get_param( 'update_usages_in_posts_post_ids' ),
195
+ 'posts_per_loop' => $request->get_param( 'update_usages_in_posts_posts_per_loop' ),
196
+ ) );
197
+
198
+ // If wp_update_post() failed for any posts, return that error.
199
+ foreach ( $posts_updated as $post_updated_id => $post_updated_result ) {
200
+ if ( is_wp_error( $post_updated_result ) ) {
201
+ return $post_updated_result;
202
+ }
203
+ }
204
+ }
205
+
206
+ return $this->attachment_info( $request );
207
+ }
208
+
209
+ /**
210
+ * Return a bunch of information about the current attachment for use in the UI
211
+ * including details about the thumbnails.
212
+ *
213
+ * @since 3.0.0
214
+ *
215
+ * @param WP_REST_Request $request Full data about the request.
216
+ *
217
+ * @return array|WP_Error The data array or a WP_Error object on error.
218
+ */
219
+ public function attachment_info( $request ) {
220
+ $regenerator = RegenerateThumbnails_Regenerator::get_instance( $request->get_param( 'id' ) );
221
+
222
+ if ( is_wp_error( $regenerator ) ) {
223
+ return $regenerator;
224
+ }
225
+
226
+ return $regenerator->get_attachment_info();
227
+ }
228
+
229
+ /**
230
+ * Return attachment IDs that are being used as featured images.
231
+ *
232
+ * @since 3.0.0
233
+ *
234
+ * @param WP_REST_Request $request Full data about the request.
235
+ *
236
+ * @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
237
+ */
238
+ public function featured_images( $request ) {
239
+ global $wpdb;
240
+
241
+ $page = $request->get_param( 'page' );
242
+ $per_page = $request->get_param( 'per_page' );
243
+
244
+ $featured_image_ids = $wpdb->get_results( $wpdb->prepare(
245
+ "SELECT meta_value as id FROM $wpdb->postmeta WHERE meta_key = '_thumbnail_id' ORDER BY post_id LIMIT %d OFFSET %d",
246
+ $per_page,
247
+ ( $per_page * $page ) - $per_page
248
+ ) );
249
+
250
+ $total = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->postmeta WHERE meta_key = '_thumbnail_id'" );
251
+ $max_pages = ceil( $total / $per_page );
252
+
253
+ if ( $page > $max_pages && $total > 0 ) {
254
+ return new WP_Error( 'rest_post_invalid_page_number', __( 'The page number requested is larger than the number of pages available.' ), array( 'status' => 400 ) );
255
+ }
256
+
257
+ $response = rest_ensure_response( $featured_image_ids );
258
+
259
+ $response->header( 'X-WP-Total', (int) $total );
260
+ $response->header( 'X-WP-TotalPages', (int) $max_pages );
261
+
262
+ $request_params = $request->get_query_params();
263
+ $base = add_query_arg( $request_params, rest_url( $this->namespace . '/featuredimages' ) );
264
+
265
+ if ( $page > 1 ) {
266
+ $prev_page = $page - 1;
267
+
268
+ if ( $prev_page > $max_pages ) {
269
+ $prev_page = $max_pages;
270
+ }
271
+
272
+ $prev_link = add_query_arg( 'page', $prev_page, $base );
273
+ $response->link_header( 'prev', $prev_link );
274
+ }
275
+
276
+ if ( $max_pages > $page ) {
277
+ $next_page = $page + 1;
278
+ $next_link = add_query_arg( 'page', $next_page, $base );
279
+
280
+ $response->link_header( 'next', $next_link );
281
+ }
282
+
283
+ return $response;
284
+ }
285
+
286
+ /**
287
+ * Check to see if the current user is allowed to use this endpoint.
288
+ *
289
+ * @since 3.0.0
290
+ *
291
+ * @param WP_REST_Request $request Full data about the request.
292
+ *
293
+ * @return bool Whether the current user has permission to regenerate thumbnails.
294
+ */
295
+ public function permissions_check( $request ) {
296
+ return current_user_can( RegenerateThumbnails()->capability );
297
+ }
298
+
299
+ /**
300
+ * Returns whether a variable is an array or not. This is needed because 3 arguments are
301
+ * passed to validation callbacks but is_array() only accepts one argument.
302
+ *
303
+ * @since 3.0.0
304
+ *
305
+ * @see https://core.trac.wordpress.org/ticket/34659
306
+ *
307
+ * @param mixed $param The parameter value to validate.
308
+ * @param WP_REST_Request $request The REST request.
309
+ * @param string $key The parameter name.
310
+ *
311
+ * @return bool Whether the parameter is an array or not.
312
+ */
313
+ public function is_array( $param, $request, $key ) {
314
+ return is_array( $param );
315
+ }
316
+ }
jquery-ui/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png DELETED
Binary file
jquery-ui/redmond/images/ui-bg_flat_55_fbec88_40x100.png DELETED
Binary file
jquery-ui/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png DELETED
Binary file
jquery-ui/redmond/images/ui-bg_glass_85_dfeffc_1x400.png DELETED
Binary file
jquery-ui/redmond/images/ui-bg_glass_95_fef1ec_1x400.png DELETED
Binary file
jquery-ui/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png DELETED
Binary file
jquery-ui/redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png DELETED
Binary file
jquery-ui/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png DELETED
Binary file
jquery-ui/redmond/jquery-ui-1.7.2.custom.css DELETED
@@ -1,406 +0,0 @@
1
- /*
2
- * jQuery UI CSS Framework
3
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
4
- * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
5
- */
6
-
7
- /* Layout helpers
8
- ----------------------------------*/
9
- .ui-helper-hidden { display: none; }
10
- .ui-helper-hidden-accessible { position: absolute; left: -99999999px; }
11
- .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
12
- .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
13
- .ui-helper-clearfix { display: inline-block; }
14
- /* required comment for clearfix to work in Opera \*/
15
- * html .ui-helper-clearfix { height:1%; }
16
- .ui-helper-clearfix { display:block; }
17
- /* end clearfix */
18
- .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
19
-
20
-
21
- /* Interaction Cues
22
- ----------------------------------*/
23
- .ui-state-disabled { cursor: default !important; }
24
-
25
-
26
- /* Icons
27
- ----------------------------------*/
28
-
29
- /* states and images */
30
- .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
31
-
32
-
33
- /* Misc visuals
34
- ----------------------------------*/
35
-
36
- /* Overlays */
37
- .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
38
-
39
-
40
-
41
- /*
42
- * jQuery UI CSS Framework
43
- * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
44
- * Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses.
45
- * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Lucida%20Grande,%20Lucida%20Sans,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=5px&bgColorHeader=5c9ccc&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=55&borderColorHeader=4297d7&fcHeader=ffffff&iconColorHeader=d8e7f3&bgColorContent=fcfdfd&bgTextureContent=06_inset_hard.png&bgImgOpacityContent=100&borderColorContent=a6c9e2&fcContent=222222&iconColorContent=469bdd&bgColorDefault=dfeffc&bgTextureDefault=02_glass.png&bgImgOpacityDefault=85&borderColorDefault=c5dbec&fcDefault=2e6e9e&iconColorDefault=6da8d5&bgColorHover=d0e5f5&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=79b7e7&fcHover=1d5987&iconColorHover=217bc0&bgColorActive=f5f8f9&bgTextureActive=06_inset_hard.png&bgImgOpacityActive=100&borderColorActive=79b7e7&fcActive=e17009&iconColorActive=f9bd01&bgColorHighlight=fbec88&bgTextureHighlight=01_flat.png&bgImgOpacityHighlight=55&borderColorHighlight=fad42e&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
46
- */
47
-
48
-
49
- /* Component containers
50
- ----------------------------------*/
51
- .ui-widget { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1.1em; }
52
- .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Lucida Grande, Lucida Sans, Arial, sans-serif; font-size: 1em; }
53
- .ui-widget-content { border: 1px solid #a6c9e2; background: #fcfdfd url(images/ui-bg_inset-hard_100_fcfdfd_1x100.png) 50% bottom repeat-x; color: #222222; }
54
- .ui-widget-content a { color: #222222; }
55
- .ui-widget-header { border: 1px solid #4297d7; background: #5c9ccc url(images/ui-bg_gloss-wave_55_5c9ccc_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; }
56
- .ui-widget-header a { color: #ffffff; }
57
-
58
- /* Interaction states
59
- ----------------------------------*/
60
- .ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #c5dbec; background: #dfeffc url(images/ui-bg_glass_85_dfeffc_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #2e6e9e; outline: none; }
61
- .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #2e6e9e; text-decoration: none; outline: none; }
62
- .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #79b7e7; background: #d0e5f5 url(images/ui-bg_glass_75_d0e5f5_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1d5987; outline: none; }
63
- .ui-state-hover a, .ui-state-hover a:hover { color: #1d5987; text-decoration: none; outline: none; }
64
- .ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #79b7e7; background: #f5f8f9 url(images/ui-bg_inset-hard_100_f5f8f9_1x100.png) 50% 50% repeat-x; font-weight: bold; color: #e17009; outline: none; }
65
- .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #e17009; outline: none; text-decoration: none; }
66
-
67
- /* Interaction Cues
68
- ----------------------------------*/
69
- .ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fad42e; background: #fbec88 url(images/ui-bg_flat_55_fbec88_40x100.png) 50% 50% repeat-x; color: #363636; }
70
- .ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636; }
71
- .ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
72
- .ui-state-error a, .ui-widget-content .ui-state-error a { color: #cd0a0a; }
73
- .ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #cd0a0a; }
74
- .ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
75
- .ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; }
76
- .ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
77
-
78
- /* Icons
79
- ----------------------------------*/
80
-
81
- /* states and images */
82
- .ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_469bdd_256x240.png); }
83
- .ui-widget-content .ui-icon {background-image: url(images/ui-icons_469bdd_256x240.png); }
84
- .ui-widget-header .ui-icon {background-image: url(images/ui-icons_d8e7f3_256x240.png); }
85
- .ui-state-default .ui-icon { background-image: url(images/ui-icons_6da8d5_256x240.png); }
86
- .ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_217bc0_256x240.png); }
87
- .ui-state-active .ui-icon {background-image: url(images/ui-icons_f9bd01_256x240.png); }
88
- .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
89
- .ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
90
-
91
- /* positioning */
92
- .ui-icon-carat-1-n { background-position: 0 0; }
93
- .ui-icon-carat-1-ne { background-position: -16px 0; }
94
- .ui-icon-carat-1-e { background-position: -32px 0; }
95
- .ui-icon-carat-1-se { background-position: -48px 0; }
96
- .ui-icon-carat-1-s { background-position: -64px 0; }
97
- .ui-icon-carat-1-sw { background-position: -80px 0; }
98
- .ui-icon-carat-1-w { background-position: -96px 0; }
99
- .ui-icon-carat-1-nw { background-position: -112px 0; }
100
- .ui-icon-carat-2-n-s { background-position: -128px 0; }
101
- .ui-icon-carat-2-e-w { background-position: -144px 0; }
102
- .ui-icon-triangle-1-n { background-position: 0 -16px; }
103
- .ui-icon-triangle-1-ne { background-position: -16px -16px; }
104
- .ui-icon-triangle-1-e { background-position: -32px -16px; }
105
- .ui-icon-triangle-1-se { background-position: -48px -16px; }
106
- .ui-icon-triangle-1-s { background-position: -64px -16px; }
107
- .ui-icon-triangle-1-sw { background-position: -80px -16px; }
108
- .ui-icon-triangle-1-w { background-position: -96px -16px; }
109
- .ui-icon-triangle-1-nw { background-position: -112px -16px; }
110
- .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
111
- .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
112
- .ui-icon-arrow-1-n { background-position: 0 -32px; }
113
- .ui-icon-arrow-1-ne { background-position: -16px -32px; }
114
- .ui-icon-arrow-1-e { background-position: -32px -32px; }
115
- .ui-icon-arrow-1-se { background-position: -48px -32px; }
116
- .ui-icon-arrow-1-s { background-position: -64px -32px; }
117
- .ui-icon-arrow-1-sw { background-position: -80px -32px; }
118
- .ui-icon-arrow-1-w { background-position: -96px -32px; }
119
- .ui-icon-arrow-1-nw { background-position: -112px -32px; }
120
- .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
121
- .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
122
- .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
123
- .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
124
- .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
125
- .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
126
- .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
127
- .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
128
- .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
129
- .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
130
- .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
131
- .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
132
- .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
133
- .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
134
- .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
135
- .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
136
- .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
137
- .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
138
- .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
139
- .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
140
- .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
141
- .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
142
- .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
143
- .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
144
- .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
145
- .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
146
- .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
147
- .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
148
- .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
149
- .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
150
- .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
151
- .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
152
- .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
153
- .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
154
- .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
155
- .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
156
- .ui-icon-arrow-4 { background-position: 0 -80px; }
157
- .ui-icon-arrow-4-diag { background-position: -16px -80px; }
158
- .ui-icon-extlink { background-position: -32px -80px; }
159
- .ui-icon-newwin { background-position: -48px -80px; }
160
- .ui-icon-refresh { background-position: -64px -80px; }
161
- .ui-icon-shuffle { background-position: -80px -80px; }
162
- .ui-icon-transfer-e-w { background-position: -96px -80px; }
163
- .ui-icon-transferthick-e-w { background-position: -112px -80px; }
164
- .ui-icon-folder-collapsed { background-position: 0 -96px; }
165
- .ui-icon-folder-open { background-position: -16px -96px; }
166
- .ui-icon-document { background-position: -32px -96px; }
167
- .ui-icon-document-b { background-position: -48px -96px; }
168
- .ui-icon-note { background-position: -64px -96px; }
169
- .ui-icon-mail-closed { background-position: -80px -96px; }
170
- .ui-icon-mail-open { background-position: -96px -96px; }
171
- .ui-icon-suitcase { background-position: -112px -96px; }
172
- .ui-icon-comment { background-position: -128px -96px; }
173
- .ui-icon-person { background-position: -144px -96px; }
174
- .ui-icon-print { background-position: -160px -96px; }
175
- .ui-icon-trash { background-position: -176px -96px; }
176
- .ui-icon-locked { background-position: -192px -96px; }
177
- .ui-icon-unlocked { background-position: -208px -96px; }
178
- .ui-icon-bookmark { background-position: -224px -96px; }
179
- .ui-icon-tag { background-position: -240px -96px; }
180
- .ui-icon-home { background-position: 0 -112px; }
181
- .ui-icon-flag { background-position: -16px -112px; }
182
- .ui-icon-calendar { background-position: -32px -112px; }
183
- .ui-icon-cart { background-position: -48px -112px; }
184
- .ui-icon-pencil { background-position: -64px -112px; }
185
- .ui-icon-clock { background-position: -80px -112px; }
186
- .ui-icon-disk { background-position: -96px -112px; }
187
- .ui-icon-calculator { background-position: -112px -112px; }
188
- .ui-icon-zoomin { background-position: -128px -112px; }
189
- .ui-icon-zoomout { background-position: -144px -112px; }
190
- .ui-icon-search { background-position: -160px -112px; }
191
- .ui-icon-wrench { background-position: -176px -112px; }
192
- .ui-icon-gear { background-position: -192px -112px; }
193
- .ui-icon-heart { background-position: -208px -112px; }
194
- .ui-icon-star { background-position: -224px -112px; }
195
- .ui-icon-link { background-position: -240px -112px; }
196
- .ui-icon-cancel { background-position: 0 -128px; }
197
- .ui-icon-plus { background-position: -16px -128px; }
198
- .ui-icon-plusthick { background-position: -32px -128px; }
199
- .ui-icon-minus { background-position: -48px -128px; }
200
- .ui-icon-minusthick { background-position: -64px -128px; }
201
- .ui-icon-close { background-position: -80px -128px; }
202
- .ui-icon-closethick { background-position: -96px -128px; }
203
- .ui-icon-key { background-position: -112px -128px; }
204
- .ui-icon-lightbulb { background-position: -128px -128px; }
205
- .ui-icon-scissors { background-position: -144px -128px; }
206
- .ui-icon-clipboard { background-position: -160px -128px; }
207
- .ui-icon-copy { background-position: -176px -128px; }
208
- .ui-icon-contact { background-position: -192px -128px; }
209
- .ui-icon-image { background-position: -208px -128px; }
210
- .ui-icon-video { background-position: -224px -128px; }
211
- .ui-icon-script { background-position: -240px -128px; }
212
- .ui-icon-alert { background-position: 0 -144px; }
213
- .ui-icon-info { background-position: -16px -144px; }
214
- .ui-icon-notice { background-position: -32px -144px; }
215
- .ui-icon-help { background-position: -48px -144px; }
216
- .ui-icon-check { background-position: -64px -144px; }
217
- .ui-icon-bullet { background-position: -80px -144px; }
218
- .ui-icon-radio-off { background-position: -96px -144px; }
219
- .ui-icon-radio-on { background-position: -112px -144px; }
220
- .ui-icon-pin-w { background-position: -128px -144px; }
221
- .ui-icon-pin-s { background-position: -144px -144px; }
222
- .ui-icon-play { background-position: 0 -160px; }
223
- .ui-icon-pause { background-position: -16px -160px; }
224
- .ui-icon-seek-next { background-position: -32px -160px; }
225
- .ui-icon-seek-prev { background-position: -48px -160px; }
226
- .ui-icon-seek-end { background-position: -64px -160px; }
227
- .ui-icon-seek-first { background-position: -80px -160px; }
228
- .ui-icon-stop { background-position: -96px -160px; }
229
- .ui-icon-eject { background-position: -112px -160px; }
230
- .ui-icon-volume-off { background-position: -128px -160px; }
231
- .ui-icon-volume-on { background-position: -144px -160px; }
232
- .ui-icon-power { background-position: 0 -176px; }
233
- .ui-icon-signal-diag { background-position: -16px -176px; }
234
- .ui-icon-signal { background-position: -32px -176px; }
235
- .ui-icon-battery-0 { background-position: -48px -176px; }
236
- .ui-icon-battery-1 { background-position: -64px -176px; }
237
- .ui-icon-battery-2 { background-position: -80px -176px; }
238
- .ui-icon-battery-3 { background-position: -96px -176px; }
239
- .ui-icon-circle-plus { background-position: 0 -192px; }
240
- .ui-icon-circle-minus { background-position: -16px -192px; }
241
- .ui-icon-circle-close { background-position: -32px -192px; }
242
- .ui-icon-circle-triangle-e { background-position: -48px -192px; }
243
- .ui-icon-circle-triangle-s { background-position: -64px -192px; }
244
- .ui-icon-circle-triangle-w { background-position: -80px -192px; }
245
- .ui-icon-circle-triangle-n { background-position: -96px -192px; }
246
- .ui-icon-circle-arrow-e { background-position: -112px -192px; }
247
- .ui-icon-circle-arrow-s { background-position: -128px -192px; }
248
- .ui-icon-circle-arrow-w { background-position: -144px -192px; }
249
- .ui-icon-circle-arrow-n { background-position: -160px -192px; }
250
- .ui-icon-circle-zoomin { background-position: -176px -192px; }
251
- .ui-icon-circle-zoomout { background-position: -192px -192px; }
252
- .ui-icon-circle-check { background-position: -208px -192px; }
253
- .ui-icon-circlesmall-plus { background-position: 0 -208px; }
254
- .ui-icon-circlesmall-minus { background-position: -16px -208px; }
255
- .ui-icon-circlesmall-close { background-position: -32px -208px; }
256
- .ui-icon-squaresmall-plus { background-position: -48px -208px; }
257
- .ui-icon-squaresmall-minus { background-position: -64px -208px; }
258
- .ui-icon-squaresmall-close { background-position: -80px -208px; }
259
- .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
260
- .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
261
- .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
262
- .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
263
- .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
264
- .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
265
-
266
-
267
- /* Misc visuals
268
- ----------------------------------*/
269
-
270
- /* Corner radius */
271
- .ui-corner-tl { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; }
272
- .ui-corner-tr { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; }
273
- .ui-corner-bl { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; }
274
- .ui-corner-br { -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; }
275
- .ui-corner-top { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; }
276
- .ui-corner-bottom { -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; }
277
- .ui-corner-right { -moz-border-radius-topright: 5px; -webkit-border-top-right-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; }
278
- .ui-corner-left { -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; -moz-border-radius-bottomleft: 5px; -webkit-border-bottom-left-radius: 5px; }
279
- .ui-corner-all { -moz-border-radius: 5px; -webkit-border-radius: 5px; }
280
-
281
- /* Overlays */
282
- .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
283
- .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; }/* Accordion
284
- ----------------------------------*/
285
- .ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
286
- .ui-accordion .ui-accordion-li-fix { display: inline; }
287
- .ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
288
- .ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; }
289
- .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
290
- .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; }
291
- .ui-accordion .ui-accordion-content-active { display: block; }/* Datepicker
292
- ----------------------------------*/
293
- .ui-datepicker { width: 17em; padding: .2em .2em 0; }
294
- .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
295
- .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
296
- .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
297
- .ui-datepicker .ui-datepicker-prev { left:2px; }
298
- .ui-datepicker .ui-datepicker-next { right:2px; }
299
- .ui-datepicker .ui-datepicker-prev-hover { left:1px; }
300
- .ui-datepicker .ui-datepicker-next-hover { right:1px; }
301
- .ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
302
- .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
303
- .ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; }
304
- .ui-datepicker select.ui-datepicker-month-year {width: 100%;}
305
- .ui-datepicker select.ui-datepicker-month,
306
- .ui-datepicker select.ui-datepicker-year { width: 49%;}
307
- .ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; }
308
- .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
309
- .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
310
- .ui-datepicker td { border: 0; padding: 1px; }
311
- .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
312
- .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
313
- .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
314
- .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
315
-
316
- /* with multiple calendars */
317
- .ui-datepicker.ui-datepicker-multi { width:auto; }
318
- .ui-datepicker-multi .ui-datepicker-group { float:left; }
319
- .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
320
- .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
321
- .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
322
- .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
323
- .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
324
- .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
325
- .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
326
- .ui-datepicker-row-break { clear:both; width:100%; }
327
-
328
- /* RTL support */
329
- .ui-datepicker-rtl { direction: rtl; }
330
- .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
331
- .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
332
- .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
333
- .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
334
- .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
335
- .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
336
- .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
337
- .ui-datepicker-rtl .ui-datepicker-group { float:right; }
338
- .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
339
- .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
340
-
341
- /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
342
- .ui-datepicker-cover {
343
- display: none; /*sorry for IE5*/
344
- display/**/: block; /*sorry for IE5*/
345
- position: absolute; /*must have*/
346
- z-index: -1; /*must have*/
347
- filter: mask(); /*must have*/
348
- top: -4px; /*must have*/
349
- left: -4px; /*must have*/
350
- width: 200px; /*must have*/
351
- height: 200px; /*must have*/
352
- }/* Dialog
353
- ----------------------------------*/
354
- .ui-dialog { position: relative; padding: .2em; width: 300px; }
355
- .ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; }
356
- .ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; }
357
- .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
358
- .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
359
- .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
360
- .ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
361
- .ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
362
- .ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; }
363
- .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
364
- .ui-draggable .ui-dialog-titlebar { cursor: move; }
365
- /* Progressbar
366
- ----------------------------------*/
367
- .ui-progressbar { height:2em; text-align: left; }
368
- .ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }/* Resizable
369
- ----------------------------------*/
370
- .ui-resizable { position: relative;}
371
- .ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;}
372
- .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
373
- .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; }
374
- .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; }
375
- .ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; }
376
- .ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; }
377
- .ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
378
- .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
379
- .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
380
- .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Slider
381
- ----------------------------------*/
382
- .ui-slider { position: relative; text-align: left; }
383
- .ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
384
- .ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; }
385
-
386
- .ui-slider-horizontal { height: .8em; }
387
- .ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
388
- .ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
389
- .ui-slider-horizontal .ui-slider-range-min { left: 0; }
390
- .ui-slider-horizontal .ui-slider-range-max { right: 0; }
391
-
392
- .ui-slider-vertical { width: .8em; height: 100px; }
393
- .ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
394
- .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
395
- .ui-slider-vertical .ui-slider-range-min { bottom: 0; }
396
- .ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs
397
- ----------------------------------*/
398
- .ui-tabs { padding: .2em; zoom: 1; }
399
- .ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; }
400
- .ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; }
401
- .ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; }
402
- .ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; }
403
- .ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
404
- .ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
405
- .ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; }
406
- .ui-tabs .ui-tabs-hide { display: none !important; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/api-request.min.js ADDED
@@ -0,0 +1 @@
 
1
+ !function(a){function b(a){return a=b.buildAjaxOptions(a),b.transport(a)}var c=window.wpApiSettings;b.buildAjaxOptions=function(b){var d,e,f,g,h,i=b.url,j=b.path;if("string"==typeof b.namespace&&"string"==typeof b.endpoint&&(d=b.namespace.replace(/^\/|\/$/g,""),e=b.endpoint.replace(/^\//,""),j=e?d+"/"+e:d),"string"==typeof j&&(i=c.root+j.replace(/^\//,"")),g=!(b.data&&b.data._wpnonce),f=b.headers||{},g)for(h in f)if(f.hasOwnProperty(h)&&"x-wp-nonce"===h.toLowerCase()){g=!1;break}return g&&(f=a.extend({"X-WP-Nonce":c.nonce},f)),b=a.extend({},b,{headers:f,url:i}),delete b.path,delete b.namespace,delete b.endpoint,b},b.transport=a.ajax,window.wp=window.wp||{},window.wp.apiRequest=b}(jQuery);
readme.txt CHANGED
@@ -1,53 +1,68 @@
1
  === Regenerate Thumbnails ===
2
  Contributors: Viper007Bond
3
- Donate link: http://www.viper007bond.com/donate/
4
- Tags: thumbnail, thumbnails
5
- Requires at least: 3.2
6
  Tested up to: 4.9
 
7
  Stable tag: trunk
 
 
8
 
9
- Allows you to regenerate your thumbnails after changing the thumbnail sizes.
10
 
11
  == Description ==
12
 
13
- Regenerate Thumbnails allows you to regenerate the thumbnails for your image attachments. This is very handy if you've changed any of your thumbnail dimensions (via Settings -> Media) after previously uploading images or have changed to a theme with different featured post image dimensions.
14
 
15
- You can either regenerate the thumbnails for all image uploads, individual image uploads, or specific multiple image uploads.
16
 
17
- == Installation ==
 
 
18
 
19
- 1. Go to your admin area and select Plugins -> Add new from the menu.
20
- 2. Search for "Regenerate Thumbnails".
21
- 3. Click install.
22
- 4. Click activate.
23
 
24
- == Screenshots ==
25
 
26
- 1. The plugin at work regenerating thumbnails
27
- 2. You can resize single images by hovering over their row in the Media Library
28
- 2. You can resize specific multiples images using the checkboxes and the "Bulk Actions" dropdown
29
 
30
- == ChangeLog ==
 
 
31
 
32
- = Version 2.3.1 =
33
 
34
- * Fix PHP notice. ([#20](https://github.com/Viper007Bond/regenerate-thumbnails/issues/20))
35
 
36
- = Version 2.3.0 =
37
 
38
- Maintenance release. A [major rewrite](https://github.com/Viper007Bond/regenerate-thumbnails/tree/dev/v3-rewrite) is in the works on GitHub.
39
 
40
- * Add "Regenerate Thumbnails" button to the Edit Media submit metabox. Props [Brian Alexander](https://github.com/ironprogrammer) for inspiration.
41
- * Bump required WordPress version to v3.2 so that we don't need to bundle jQuery's progress bar plugin anymore.
42
- * Context for translators.
43
 
44
- = Version 2.2.6 =
 
 
45
 
46
- * PHP 7 compatibility.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
 
48
- = Version 2.2.5 =
49
 
50
- * Updates relating to plugin language pack support.
51
 
52
  = Version 2.2.4 =
53
 
1
  === Regenerate Thumbnails ===
2
  Contributors: Viper007Bond
3
+ Tags: thumbnail, thumbnails, post thumbnail, post thumbnails
4
+ Requires at least: 4.7
 
5
  Tested up to: 4.9
6
+ Requires PHP: 5.2.4
7
  Stable tag: trunk
8
+ License: GPLv2 or later
9
+ License URI: https://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Regenerate the thumbnails for one or more of your image uploads. Useful when changing their sizes or your theme.
12
 
13
  == Description ==
14
 
15
+ Regenerate Thumbnails allows you to regenerate all thumbnail sizes for one or more images that have been uploaded to your Media Library.
16
 
17
+ This is useful for situations such as:
18
 
19
+ * A new thumbnail size has been added and you want past uploads to have a thumbnail in that size.
20
+ * You've changed the dimensions of an existing thumbnail size, for example via Settings → Media.
21
+ * You've switched to a new WordPress theme that uses featured images of a different size.
22
 
23
+ = Alternatives =
 
 
 
24
 
25
+ **WP-CLI**
26
 
27
+ If you have command line access to your server, I highly recommend using [WP-CLI](https://wp-cli.org/) instead of this plugin as it's faster (no HTTP requests overhead) and can be run inside of a `screen` for those with many thumbnails. For details, see the documentation of its [`media regenerate` command](https://developer.wordpress.org/cli/commands/media/regenerate/).
 
 
28
 
29
+ **Jetpack's Photon Module**
30
+
31
+ [Jetpack](https://jetpack.com/) is a plugin by Automattic, makers of WordPress.com. It gives your self-hosted WordPress site some of the functionality that is available to WordPress.com-hosted sites.
32
 
33
+ [The Photon module](https://jetpack.com/support/photon/) makes the images on your site be served from WordPress.com's global content delivery network (CDN) which should speed up the loading of images. Importantly though it can create thumbnails on the fly which means you'll never need to use this plugin.
34
 
35
+ I personally use Photon on my own website.
36
 
37
+ *Disclaimer: I work for Automattic but I would recommend Photon even if I didn't.*
38
 
39
+ = Need Help? Found A Bug? Want To Contribute Code? =
40
 
41
+ Support for this plugin is provided via the [WordPress.org forums](https://wordpress.org/support/plugin/regenerate-thumbnails).
 
 
42
 
43
+ The source code for this plugin is available on [GitHub](https://github.com/Viper007Bond/regenerate-thumbnails).
44
+
45
+ == Installation ==
46
 
47
+ 1. Go to your admin area and select Plugins → Add New from the menu.
48
+ 2. Search for "Regenerate Thumbnails".
49
+ 3. Click install.
50
+ 4. Click activate.
51
+ 5. Navigate to Tools → Regenerate Thumbnails.
52
+
53
+ == Screenshots ==
54
+
55
+ 1. The main plugin interface.
56
+ 2. Regenerating in progress.
57
+ 3. Interface for regenerating a single attachment.
58
+ 4. Individual images can be regenerated from the media library in list view.
59
+ 5. They can also be regenerated from the edit attachment screen.
60
+
61
+ == ChangeLog ==
62
 
63
+ = Version 3.0.0 =
64
 
65
+ Complete rewrite from scratch using Vue.js and the WordPress REST API.
66
 
67
  = Version 2.2.4 =
68
 
regenerate-thumbnails.php CHANGED
@@ -3,105 +3,405 @@
3
  **************************************************************************
4
 
5
  Plugin Name: Regenerate Thumbnails
6
- Plugin URI: http://www.viper007bond.com/wordpress-plugins/regenerate-thumbnails/
7
- Description: Allows you to regenerate all thumbnails after changing the thumbnail sizes.
8
- Version: 2.3.1
9
  Author: Alex Mills (Viper007Bond)
10
- Author URI: http://www.viper007bond.com/
11
  Text Domain: regenerate-thumbnails
 
 
12
 
13
  **************************************************************************
14
 
15
- Copyright (C) 2008-2017 Alex Mills (Viper007Bond)
16
-
17
- This program is free software: you can redistribute it and/or modify
18
  it under the terms of the GNU General Public License as published by
19
- the Free Software Foundation, either version 3 of the License, or
20
- (at your option) any later version.
21
 
22
- This program is distributed in the hope that it will be useful,
23
  but WITHOUT ANY WARRANTY; without even the implied warranty of
24
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
  GNU General Public License for more details.
26
 
27
  You should have received a copy of the GNU General Public License
28
- along with this program. If not, see <http://www.gnu.org/licenses/>.
29
 
30
  **************************************************************************/
31
 
 
 
 
 
 
 
 
 
32
  class RegenerateThumbnails {
 
 
 
 
 
 
 
 
 
 
 
 
33
  public $menu_id;
34
 
35
- // Plugin initialization
36
- public function __construct() {
37
- // Load up the localization file if we're using WordPress in a different language
38
- load_plugin_textdomain( 'regenerate-thumbnails' );
39
-
40
- add_action( 'admin_menu', array( $this, 'add_admin_menu' ) );
41
- add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueues' ) );
42
- add_action( 'wp_ajax_regeneratethumbnail', array( $this, 'ajax_process_image' ) );
43
- add_filter( 'media_row_actions', array( $this, 'add_regenerate_link_to_media_list_view' ), 10, 2 );
44
- add_action( 'admin_head-upload.php', array( $this, 'add_bulk_actions_via_javascript' ) );
45
- add_action( 'admin_action_bulk_regenerate_thumbnails', array( $this, 'bulk_action_handler' ) ); // Top drowndown
46
- add_action( 'admin_action_-1', array( $this, 'bulk_action_handler' ) ); // Bottom dropdown (assumes top dropdown = default value)
47
- add_action( 'attachment_submitbox_misc_actions', array( $this, 'add_button_to_media_edit_page' ), 99 ); // Button on media edit screen
48
-
49
- // Add a regenerate button to the list of fields in the edit media modal
50
- // Ideally this would with the action links but I'm not good enough with JavaScript to do it
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  add_filter( 'attachment_fields_to_edit', array( $this, 'add_button_to_edit_media_modal_fields_area' ), 99, 2 );
52
 
53
- // Allow people to change what capability is required to use this plugin
54
- $this->capability = apply_filters( 'regenerate_thumbs_cap', 'manage_options' );
55
  }
56
 
 
 
 
 
 
 
 
 
57
 
58
- // Register the management page
 
 
59
  public function add_admin_menu() {
60
- $this->menu_id = add_management_page( __( 'Regenerate Thumbnails', 'regenerate-thumbnails' ), __( 'Regen. Thumbnails', 'regenerate-thumbnails' ), $this->capability, 'regenerate-thumbnails', array($this, 'regenerate_interface') );
61
- }
62
 
 
 
63
 
64
- // Enqueue the needed Javascript and CSS
 
 
 
 
65
  public function admin_enqueues( $hook_suffix ) {
66
  if ( $hook_suffix != $this->menu_id ) {
67
  return;
68
  }
69
 
70
- wp_enqueue_script( 'jquery-ui-progressbar' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
 
72
- wp_enqueue_style( 'jquery-ui-regenthumbs', plugins_url( 'jquery-ui/redmond/jquery-ui-1.7.2.custom.css', __FILE__ ), array(), '1.7.2' );
 
 
 
 
 
73
  }
74
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75
 
76
  /**
77
- * Creates a nonced URL to the plugin's admin page for a given set of attachment IDs.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  *
79
- * @param array $ids An array of attachment IDs that should be regenerated.
80
  *
81
- * @return string The nonced URL to the admin page.
82
  */
83
- public function create_page_url( $ids ) {
84
- $url_args = array(
85
- 'page' => 'regenerate-thumbnails',
86
- 'goback' => 1,
87
- 'ids' => implode( ',', $ids ),
88
- '_wpnonce' => wp_create_nonce( 'regenerate-thumbnails' ), // Can't use wp_nonce_url() as it escapes HTML entities
89
- );
 
 
 
 
 
 
 
 
 
 
 
90
 
91
- // https://core.trac.wordpress.org/ticket/17923
92
- $url_args = array_map( 'rawurlencode', $url_args );
 
93
 
94
- return add_query_arg( $url_args, admin_url( 'tools.php' ) );
95
- }
 
 
 
 
 
 
 
 
 
96
 
 
 
97
 
98
- // Add a "Regenerate Thumbnails" link to the media row actions
 
 
 
 
 
 
 
99
  public function add_regenerate_link_to_media_list_view( $actions, $post ) {
100
- if ( 'image/' != substr( $post->post_mime_type, 0, 6 ) || ! current_user_can( $this->capability ) )
101
  return $actions;
 
102
 
103
- $url = wp_nonce_url( admin_url( 'tools.php?page=regenerate-thumbnails&goback=1&ids=' . $post->ID ), 'regenerate-thumbnails' );
104
- $actions['regenerate_thumbnails'] = '<a href="' . esc_url( $url ) . '" title="' . esc_attr( __( "Regenerate the thumbnails for this single image", 'regenerate-thumbnails' ) ) . '">' . _x( 'Regenerate Thumbnails', 'action of regenerate thumbnails', 'regenerate-thumbnails' ) . '</a>';
105
 
106
  return $actions;
107
  }
@@ -112,16 +412,15 @@ class RegenerateThumbnails {
112
  public function add_button_to_media_edit_page() {
113
  global $post;
114
 
115
- if ( 'image/' != substr( $post->post_mime_type, 0, 6 ) || ! current_user_can( $this->capability ) ) {
116
  return;
117
  }
118
 
119
  echo '<div class="misc-pub-section misc-pub-regenerate-thumbnails">';
120
- echo '<a href="' . esc_url( $this->create_page_url( array( $post->ID ) ) ) . '" class="button-secondary button-large" title="' . esc_attr( __( "Regenerate the thumbnails for this single image", 'regenerate-thumbnails' ) ) . '">' . __( 'Regenerate Thumbnails', 'regenerate-thumbnails' ) . '</a>';
121
  echo '</div>';
122
  }
123
 
124
-
125
  /**
126
  * Adds a "Regenerate Thumbnails" button to the edit media modal view.
127
  *
@@ -129,16 +428,20 @@ class RegenerateThumbnails {
129
  * in order to be able to do it, so instead I'm adding it to the bottom of the list
130
  * of media fields. Pull requests to improve this are welcome!
131
  *
132
- * @param array $form_fields An array of existing form fields.
133
- * @param object $post The current media item, as a post object.
134
  *
135
  * @return array The new array of form fields.
136
  */
137
  public function add_button_to_edit_media_modal_fields_area( $form_fields, $post ) {
 
 
 
 
138
  $form_fields['regenerate_thumbnails'] = array(
139
  'label' => '',
140
  'input' => 'html',
141
- 'html' => '<a href="' . esc_url( $this->create_page_url( array( $post->ID ) ) ) . '" class="button-secondary button-large" title="' . esc_attr( __( "Regenerate the thumbnails for this single image", 'regenerate-thumbnails' ) ) . '">' . __( 'Regenerate Thumbnails', 'regenerate-thumbnails' ) . '</a>',
142
  'show_in_modal' => true,
143
  'show_in_edit' => false,
144
  );
@@ -146,306 +449,93 @@ class RegenerateThumbnails {
146
  return $form_fields;
147
  }
148
 
149
-
150
- // Add new items to the Bulk Actions using Javascript
151
- // A last minute change to the "bulk_actions-xxxxx" filter in 3.1 made it not possible to add items using that
152
  public function add_bulk_actions_via_javascript() {
153
- if ( ! current_user_can( $this->capability ) )
154
  return;
155
- ?>
 
 
156
  <script type="text/javascript">
157
- jQuery(document).ready(function($){
158
- $('select[name^="action"] option:last-child').before('<option value="bulk_regenerate_thumbnails"><?php echo esc_attr( _x( 'Regenerate Thumbnails', 'action of regenerate thumbnails', 'regenerate-thumbnails' ) ); ?></option>');
 
 
 
 
159
  });
160
  </script>
161
- <?php
162
  }
163
 
164
-
165
- // Handles the bulk actions POST
 
166
  public function bulk_action_handler() {
167
  if (
168
- empty( $_REQUEST['action'] ) ||
169
- empty( $_REQUEST['action2'] ) ||
170
- ( 'bulk_regenerate_thumbnails' != $_REQUEST['action'] && 'bulk_regenerate_thumbnails' != $_REQUEST['action2'] ) ||
171
- empty( $_REQUEST['media'] ) ||
172
- ! is_array( $_REQUEST['media'] )
173
  ) {
174
  return;
175
  }
176
 
177
  check_admin_referer( 'bulk-media' );
178
 
179
- $ids = implode( ',', array_map( 'intval', $_REQUEST['media'] ) );
 
 
 
 
 
 
 
 
180
 
181
- // Can't use wp_nonce_url() as it escapes HTML entities
182
- wp_redirect( add_query_arg( '_wpnonce', wp_create_nonce( 'regenerate-thumbnails' ), admin_url( 'tools.php?page=regenerate-thumbnails&goback=1&ids=' . $ids ) ) );
183
  exit();
184
  }
185
 
186
-
187
- // The user interface plus thumbnail regenerator
188
- public function regenerate_interface() {
189
- global $wpdb;
190
-
191
- ?>
192
-
193
- <div id="message" class="updated fade" style="display:none"></div>
194
-
195
- <div class="wrap regenthumbs">
196
- <h2><?php _e('Regenerate Thumbnails', 'regenerate-thumbnails'); ?></h2>
197
-
198
- <?php
199
-
200
- // If the button was clicked
201
- if ( ! empty( $_POST['regenerate-thumbnails'] ) || ! empty( $_REQUEST['ids'] ) ) {
202
- // Capability check
203
- if ( ! current_user_can( $this->capability ) )
204
- wp_die( __( 'Cheatin&#8217; uh?' ) );
205
-
206
- // Form nonce check
207
- check_admin_referer( 'regenerate-thumbnails' );
208
-
209
- // Create the list of image IDs
210
- if ( ! empty( $_REQUEST['ids'] ) ) {
211
- $images = array_map( 'intval', explode( ',', trim( $_REQUEST['ids'], ',' ) ) );
212
- $ids = implode( ',', $images );
213
- } else {
214
- // Directly querying the database is normally frowned upon, but all
215
- // of the API functions will return the full post objects which will
216
- // suck up lots of memory. This is best, just not as future proof.
217
- if ( ! $images = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE post_type = 'attachment' AND post_mime_type LIKE 'image/%' ORDER BY ID DESC" ) ) {
218
- echo ' <p>' . sprintf( __( "Unable to find any images. Are you sure <a href='%s'>some exist</a>?", 'regenerate-thumbnails' ), admin_url( 'upload.php?post_mime_type=image' ) ) . "</p></div>";
219
- return;
220
- }
221
-
222
- // Generate the list of IDs
223
- $ids = array();
224
- foreach ( $images as $image )
225
- $ids[] = $image->ID;
226
- $ids = implode( ',', $ids );
227
- }
228
-
229
- echo ' <p>' . __( "Please be patient while the thumbnails are regenerated. This can take a while if your server is slow (inexpensive hosting) or if you have many images. Do not navigate away from this page until this script is done or the thumbnails will not be resized. You will be notified via this page when the regenerating is completed.", 'regenerate-thumbnails' ) . '</p>';
230
-
231
- $count = count( $images );
232
-
233
- $text_goback = ( ! empty( $_GET['goback'] ) ) ? sprintf( __( 'To go back to the previous page, <a href="%s">click here</a>.', 'regenerate-thumbnails' ), 'javascript:history.go(-1)' ) : '';
234
- $text_failures = sprintf( __( 'All done! %1$s image(s) were successfully resized in %2$s seconds and there were %3$s failure(s). To try regenerating the failed images again, <a href="%4$s">click here</a>. %5$s', 'regenerate-thumbnails' ), "' + rt_successes + '", "' + rt_totaltime + '", "' + rt_errors + '", esc_url( wp_nonce_url( admin_url( 'tools.php?page=regenerate-thumbnails&goback=1' ), 'regenerate-thumbnails' ) . '&ids=' ) . "' + rt_failedlist + '", $text_goback );
235
- $text_nofailures = sprintf( __( 'All done! %1$s image(s) were successfully resized in %2$s seconds and there were 0 failures. %3$s', 'regenerate-thumbnails' ), "' + rt_successes + '", "' + rt_totaltime + '", $text_goback );
236
- ?>
237
-
238
-
239
- <noscript><p><em><?php _e( 'You must enable Javascript in order to proceed!', 'regenerate-thumbnails' ) ?></em></p></noscript>
240
-
241
- <div id="regenthumbs-bar" style="position:relative;height:25px;">
242
- <div id="regenthumbs-bar-percent" style="position:absolute;left:50%;top:50%;width:300px;margin-left:-150px;height:25px;margin-top:-9px;font-weight:bold;text-align:center;"></div>
243
- </div>
244
-
245
- <p><input type="button" class="button hide-if-no-js" name="regenthumbs-stop" id="regenthumbs-stop" value="<?php _e( 'Abort Resizing Images', 'regenerate-thumbnails' ) ?>" /></p>
246
-
247
- <h3 class="title"><?php _e( 'Debugging Information', 'regenerate-thumbnails' ) ?></h3>
248
-
249
- <p>
250
- <?php printf( __( 'Total Images: %s', 'regenerate-thumbnails' ), $count ); ?><br />
251
- <?php printf( __( 'Images Resized: %s', 'regenerate-thumbnails' ), '<span id="regenthumbs-debug-successcount">0</span>' ); ?><br />
252
- <?php printf( __( 'Resize Failures: %s', 'regenerate-thumbnails' ), '<span id="regenthumbs-debug-failurecount">0</span>' ); ?>
253
- </p>
254
-
255
- <ol id="regenthumbs-debuglist">
256
- <li style="display:none"></li>
257
- </ol>
258
-
259
- <script type="text/javascript">
260
- jQuery(document).ready(function($){
261
- var i;
262
- var rt_images = [<?php echo $ids; ?>];
263
- var rt_total = rt_images.length;
264
- var rt_count = 1;
265
- var rt_percent = 0;
266
- var rt_successes = 0;
267
- var rt_errors = 0;
268
- var rt_failedlist = '';
269
- var rt_resulttext = '';
270
- var rt_timestart = new Date().getTime();
271
- var rt_timeend = 0;
272
- var rt_totaltime = 0;
273
- var rt_continue = true;
274
-
275
- // Create the progress bar
276
- $("#regenthumbs-bar").progressbar();
277
- $("#regenthumbs-bar-percent").html( "0%" );
278
-
279
- // Stop button
280
- $("#regenthumbs-stop").click(function() {
281
- rt_continue = false;
282
- $('#regenthumbs-stop').val("<?php echo $this->esc_quotes( __( 'Stopping...', 'regenerate-thumbnails' ) ); ?>");
283
- });
284
-
285
- // Clear out the empty list element that's there for HTML validation purposes
286
- $("#regenthumbs-debuglist li").remove();
287
-
288
- // Called after each resize. Updates debug information and the progress bar.
289
- function RegenThumbsUpdateStatus( id, success, response ) {
290
- $("#regenthumbs-bar").progressbar( "value", ( rt_count / rt_total ) * 100 );
291
- $("#regenthumbs-bar-percent").html( Math.round( ( rt_count / rt_total ) * 1000 ) / 10 + "%" );
292
- rt_count = rt_count + 1;
293
-
294
- if ( success ) {
295
- rt_successes = rt_successes + 1;
296
- $("#regenthumbs-debug-successcount").html(rt_successes);
297
- $("#regenthumbs-debuglist").append("<li>" + response.success + "</li>");
298
- }
299
- else {
300
- rt_errors = rt_errors + 1;
301
- rt_failedlist = rt_failedlist + ',' + id;
302
- $("#regenthumbs-debug-failurecount").html(rt_errors);
303
- $("#regenthumbs-debuglist").append("<li>" + response.error + "</li>");
304
- }
305
- }
306
-
307
- // Called when all images have been processed. Shows the results and cleans up.
308
- function RegenThumbsFinishUp() {
309
- rt_timeend = new Date().getTime();
310
- rt_totaltime = Math.round( ( rt_timeend - rt_timestart ) / 1000 );
311
-
312
- $('#regenthumbs-stop').hide();
313
-
314
- if ( rt_errors > 0 ) {
315
- rt_resulttext = '<?php echo $text_failures; ?>';
316
- } else {
317
- rt_resulttext = '<?php echo $text_nofailures; ?>';
318
- }
319
-
320
- $("#message").html("<p><strong>" + rt_resulttext + "</strong></p>");
321
- $("#message").show();
322
- }
323
-
324
- // Regenerate a specified image via AJAX
325
- function RegenThumbs( id ) {
326
- $.ajax({
327
- type: 'POST',
328
- url: ajaxurl,
329
- data: { action: "regeneratethumbnail", id: id },
330
- success: function( response ) {
331
- if ( response !== Object( response ) || ( typeof response.success === "undefined" && typeof response.error === "undefined" ) ) {
332
- response = new Object;
333
- response.success = false;
334
- response.error = "<?php printf( esc_js( __( 'The resize request was abnormally terminated (ID %s). This is likely due to the image exceeding available memory or some other type of fatal error.', 'regenerate-thumbnails' ) ), '" + id + "' ); ?>";
335
- }
336
-
337
- if ( response.success ) {
338
- RegenThumbsUpdateStatus( id, true, response );
339
- }
340
- else {
341
- RegenThumbsUpdateStatus( id, false, response );
342
- }
343
-
344
- if ( rt_images.length && rt_continue ) {
345
- RegenThumbs( rt_images.shift() );
346
- }
347
- else {
348
- RegenThumbsFinishUp();
349
- }
350
- },
351
- error: function( response ) {
352
- RegenThumbsUpdateStatus( id, false, response );
353
-
354
- if ( rt_images.length && rt_continue ) {
355
- RegenThumbs( rt_images.shift() );
356
- }
357
- else {
358
- RegenThumbsFinishUp();
359
- }
360
- }
361
- });
362
  }
363
-
364
- RegenThumbs( rt_images.shift() );
365
- });
366
- </script>
367
- <?php
368
  }
369
 
370
- // No button click? Display the form.
371
- else {
372
- ?>
373
- <form method="post" action="">
374
- <?php wp_nonce_field('regenerate-thumbnails') ?>
375
-
376
- <p><?php printf( __( "Use this tool to regenerate thumbnails for all images that you have uploaded to your blog. This is useful if you've changed any of the thumbnail dimensions on the <a href='%s'>media settings page</a>. Old thumbnails will be kept to avoid any broken images due to hard-coded URLs.", 'regenerate-thumbnails' ), admin_url( 'options-media.php' ) ); ?></p>
377
-
378
- <p><?php printf( __( "You can regenerate specific images (rather than all images) from the <a href='%s'>Media</a> page. Hover over an image's row and click the link to resize just that one image or use the checkboxes and the &quot;Bulk Actions&quot; dropdown to resize multiple images (WordPress 3.1+ only).", 'regenerate-thumbnails'), admin_url( 'upload.php' ) ); ?></p>
379
-
380
- <p><?php _e( "Thumbnail regeneration is not reversible, but you can just change your thumbnail dimensions back to the old values and click the button again if you don't like the results.", 'regenerate-thumbnails' ); ?></p>
381
-
382
- <p><?php _e( 'To begin, just press the button below.', 'regenerate-thumbnails'); ?></p>
383
-
384
- <p><input type="submit" class="button hide-if-no-js" name="regenerate-thumbnails" id="regenerate-thumbnails" value="<?php _e( 'Regenerate All Thumbnails', 'regenerate-thumbnails' ) ?>" /></p>
385
-
386
- <noscript><p><em><?php _e( 'You must enable Javascript in order to proceed!', 'regenerate-thumbnails' ) ?></em></p></noscript>
387
-
388
- </form>
389
- <?php
390
- } // End if button
391
- ?>
392
- </div>
393
-
394
- <?php
395
- }
396
-
397
-
398
- // Process a single image ID (this is an AJAX handler)
399
- public function ajax_process_image() {
400
- @error_reporting( 0 ); // Don't break the JSON result
401
-
402
- header( 'Content-type: application/json' );
403
-
404
- $id = (int) $_REQUEST['id'];
405
- $image = get_post( $id );
406
-
407
- if ( ! $image || 'attachment' != $image->post_type || 'image/' != substr( $image->post_mime_type, 0, 6 ) )
408
- die( json_encode( array( 'error' => sprintf( __( 'Failed resize: %s is an invalid image ID.', 'regenerate-thumbnails' ), esc_html( $_REQUEST['id'] ) ) ) ) );
409
-
410
- if ( ! current_user_can( $this->capability ) )
411
- $this->die_json_error_msg( $image->ID, __( "Your user account doesn't have permission to resize images", 'regenerate-thumbnails' ) );
412
-
413
- $fullsizepath = get_attached_file( $image->ID );
414
-
415
- if ( false === $fullsizepath || ! file_exists( $fullsizepath ) )
416
- $this->die_json_error_msg( $image->ID, sprintf( __( 'The originally uploaded image file cannot be found at %s', 'regenerate-thumbnails' ), '<code>' . esc_html( $fullsizepath ) . '</code>' ) );
417
-
418
- @set_time_limit( 900 ); // 5 minutes per image should be PLENTY
419
-
420
- $metadata = wp_generate_attachment_metadata( $image->ID, $fullsizepath );
421
-
422
- if ( is_wp_error( $metadata ) )
423
- $this->die_json_error_msg( $image->ID, $metadata->get_error_message() );
424
- if ( empty( $metadata ) )
425
- $this->die_json_error_msg( $image->ID, __( 'Unknown failure reason.', 'regenerate-thumbnails' ) );
426
-
427
- // If this fails, then it just means that nothing was changed (old value == new value)
428
- wp_update_attachment_metadata( $image->ID, $metadata );
429
-
430
- die( json_encode( array( 'success' => sprintf( __( '&quot;%1$s&quot; (ID %2$s) was successfully resized in %3$s seconds.', 'regenerate-thumbnails' ), esc_html( get_the_title( $image->ID ) ), $image->ID, timer_stop() ) ) ) );
431
- }
432
-
433
-
434
- // Helper to make a JSON error message
435
- public function die_json_error_msg( $id, $message ) {
436
- die( json_encode( array( 'error' => sprintf( __( '&quot;%1$s&quot; (ID %2$s) failed to resize. The error message was: %3$s', 'regenerate-thumbnails' ), esc_html( get_the_title( $id ) ), $id, $message ) ) ) );
437
- }
438
-
439
-
440
- // Helper function to escape quotes in strings for use in Javascript
441
- public function esc_quotes( $string ) {
442
- return str_replace( '"', '\"', $string );
443
  }
444
  }
445
 
446
- // Start up this plugin
447
- add_action( 'init', 'RegenerateThumbnails' );
 
 
 
448
  function RegenerateThumbnails() {
449
- global $RegenerateThumbnails;
450
- $RegenerateThumbnails = new RegenerateThumbnails();
451
- }
 
 
 
 
3
  **************************************************************************
4
 
5
  Plugin Name: Regenerate Thumbnails
6
+ Description: Regenerate the thumbnails for one or more of your image uploads. Useful when changing their sizes or your theme.
7
+ Plugin URI: https://alex.blog/wordpress-plugins/regenerate-thumbnails/
8
+ Version: 3.0.0
9
  Author: Alex Mills (Viper007Bond)
10
+ Author URI: https://alex.blog/
11
  Text Domain: regenerate-thumbnails
12
+ License: GPL2
13
+ License URI: https://www.gnu.org/licenses/gpl-2.0.html
14
 
15
  **************************************************************************
16
 
17
+ Regenerate Thumbnails is free software: you can redistribute it and/or modify
 
 
18
  it under the terms of the GNU General Public License as published by
19
+ the Free Software Foundation, either version 2 of the License, or
20
+ any later version.
21
 
22
+ Regenerate Thumbnails is distributed in the hope that it will be useful,
23
  but WITHOUT ANY WARRANTY; without even the implied warranty of
24
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
  GNU General Public License for more details.
26
 
27
  You should have received a copy of the GNU General Public License
28
+ along with Regenerate Thumbnails. If not, see https://www.gnu.org/licenses/gpl-2.0.html.
29
 
30
  **************************************************************************/
31
 
32
+ require( dirname( __FILE__ ) . '/includes/class-regeneratethumbnails-regenerator.php' );
33
+ require( dirname( __FILE__ ) . '/includes/class-regeneratethumbnails-rest-controller.php' );
34
+
35
+ /**
36
+ * Main plugin class.
37
+ *
38
+ * @since 1.0.0
39
+ */
40
  class RegenerateThumbnails {
41
+ /**
42
+ * This plugin's version number. Used for busting caches.
43
+ *
44
+ * @var string
45
+ */
46
+ public $version = '3.0.0';
47
+
48
+ /**
49
+ * The menu ID of this plugin, as returned by add_management_page().
50
+ *
51
+ * @var string
52
+ */
53
  public $menu_id;
54
 
55
+ /**
56
+ * The capability required to use this plugin.
57
+ * Please don't change this directly. Use the "regenerate_thumbs_cap" filter instead.
58
+ *
59
+ * @var string
60
+ */
61
+ public $capability = 'manage_options';
62
+
63
+ /**
64
+ * The instance of the REST API controller class used to extend the REST API.
65
+ *
66
+ * @var RegenerateThumbnails_REST_Controller
67
+ */
68
+ public $rest_api;
69
+
70
+ /**
71
+ * The single instance of this plugin.
72
+ *
73
+ * @see RegenerateThumbnails()
74
+ *
75
+ * @access private
76
+ * @var RegenerateThumbnails
77
+ */
78
+ private static $instance;
79
+
80
+ /**
81
+ * Constructor. Doesn't actually do anything as instance() creates the class instance.
82
+ */
83
+ private function __construct() {}
84
+
85
+ /**
86
+ * Prevents the class from being cloned.
87
+ */
88
+ public function __clone() {
89
+ wp_die( "Please don't clone RegenerateThumbnails" );
90
+ }
91
+
92
+ /**
93
+ * Prints the class from being unserialized and woken up.
94
+ */
95
+ public function __wakeup() {
96
+ wp_die( "Please don't unserialize/wakeup RegenerateThumbnails" );
97
+ }
98
+
99
+ /**
100
+ * Creates a new instance of this class if one hasn't already been made
101
+ * and then returns the single instance of this class.
102
+ *
103
+ * @return RegenerateThumbnails
104
+ */
105
+ public static function instance() {
106
+ if ( ! isset( self::$instance ) ) {
107
+ self::$instance = new RegenerateThumbnails;
108
+ self::$instance->setup();
109
+ }
110
+
111
+ return self::$instance;
112
+ }
113
+
114
+ /**
115
+ * Register all of the needed hooks and actions.
116
+ */
117
+ public function setup() {
118
+ // Allow people to change what capability is required to use this plugin.
119
+ $this->capability = apply_filters( 'regenerate_thumbs_cap', $this->capability );
120
+
121
+ // Initialize the REST API routes.
122
+ add_action( 'rest_api_init', array( $this, 'rest_api_init' ) );
123
+
124
+ // Add a new item to the Tools menu in the admin menu.
125
+ add_action( 'admin_menu', array( $this, 'add_admin_menu' ) );
126
+
127
+ // Load the required JavaScript and CSS.
128
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueues' ) );
129
+
130
+ // For the bulk action dropdowns.
131
+ add_action( 'admin_head-upload.php', array( $this, 'add_bulk_actions_via_javascript' ) );
132
+ add_action( 'admin_action_bulk_regenerate_thumbnails', array( $this, 'bulk_action_handler' ) ); // Top drowndown.
133
+ add_action( 'admin_action_-1', array( $this, 'bulk_action_handler' ) ); // Bottom dropdown.
134
+
135
+ // Add a regenerate button to the non-modal edit media page.
136
+ add_action( 'attachment_submitbox_misc_actions', array( $this, 'add_button_to_media_edit_page' ), 99 );
137
+
138
+ // Add a regenerate button to the list of fields in the edit media modal.
139
+ // Ideally this would with the action links but I'm not good enough with JavaScript to do it.
140
  add_filter( 'attachment_fields_to_edit', array( $this, 'add_button_to_edit_media_modal_fields_area' ), 99, 2 );
141
 
142
+ // Add a regenerate link to actions list in the media list view.
143
+ add_filter( 'media_row_actions', array( $this, 'add_regenerate_link_to_media_list_view' ), 10, 2 );
144
  }
145
 
146
+ /**
147
+ * Initialize the REST API routes.
148
+ */
149
+ public function rest_api_init() {
150
+ $this->rest_api = new RegenerateThumbnails_REST_Controller();
151
+ $this->rest_api->register_routes();
152
+ $this->rest_api->register_filters();
153
+ }
154
 
155
+ /**
156
+ * Adds a the new item to the admin menu.
157
+ */
158
  public function add_admin_menu() {
159
+ $this->menu_id = add_management_page( __( 'Regenerate Thumbnails', 'regenerate-thumbnails' ), __( 'Regenerate Thumbnails', 'regenerate-thumbnails' ), $this->capability, 'regenerate-thumbnails', array( $this, 'regenerate_interface' ) );
 
160
 
161
+ add_action( 'admin_head-' . $this->menu_id, array( $this, 'add_admin_notice_if_resizing_not_supported' ) );
162
+ }
163
 
164
+ /**
165
+ * Enqueues the requires JavaScript file and stylesheet on the plugin's admin page.
166
+ *
167
+ * @param string $hook_suffix The current page's hook suffix as provided by admin-header.php.
168
+ */
169
  public function admin_enqueues( $hook_suffix ) {
170
  if ( $hook_suffix != $this->menu_id ) {
171
  return;
172
  }
173
 
174
+ // Pre-4.9 compatibility.
175
+ if ( ! wp_script_is( 'wp-api-request', 'registered' ) ) {
176
+ wp_register_script(
177
+ 'wp-api-request',
178
+ plugins_url( 'js/api-request.min.js', __FILE__ ),
179
+ array( 'jquery' ),
180
+ '4.9',
181
+ true
182
+ );
183
+
184
+ wp_localize_script( 'wp-api-request', 'wpApiSettings', array(
185
+ 'root' => esc_url_raw( get_rest_url() ),
186
+ 'nonce' => ( wp_installing() && ! is_multisite() ) ? '' : wp_create_nonce( 'wp_rest' ),
187
+ 'versionString' => 'wp/v2/',
188
+ ) );
189
+ }
190
+
191
+ wp_enqueue_script(
192
+ 'regenerate-thumbnails',
193
+ plugins_url( 'dist/build.js', __FILE__ ),
194
+ array( 'wp-api-request' ),
195
+ ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? filemtime( dirname( __FILE__ ) . '/dist/build.js' ) : $this->version,
196
+ true
197
+ );
198
+
199
+ $script_data = array(
200
+ 'data' => array(
201
+ 'thumbnailSizes' => $this->get_thumbnail_sizes(),
202
+ ),
203
+ 'options' => array(
204
+ 'onlyMissingThumbnails' => apply_filters( 'regenerate_thumbnails_options_onlymissingthumbnails', true ),
205
+ 'updatePostContents' => apply_filters( 'regenerate_thumbnails_options_updatepostcontents', true ),
206
+ 'deleteOldThumbnails' => apply_filters( 'regenerate_thumbnails_options_deleteoldthumbnails', false ),
207
+ ),
208
+ 'l10n' => array(
209
+ 'common' => array(
210
+ 'regenerateThumbnails' => __( 'Regenerate Thumbnails', 'regenerate-thumbnails' ),
211
+ 'loading' => __( 'Loading…', 'regenerate-thumbnails' ),
212
+ 'onlyRegenerateMissingThumbnails' => __( 'Skip regenerating existing correctly sized thumbnails (faster).', 'regenerate-thumbnails' ),
213
+ 'deleteOldThumbnails' => __( "Delete thumbnail files for old unregistered sizes in order to free up server space. You risk broken images if you do this so it's strongly recommended that you update the content of posts to reduce the risk.", 'regenerate-thumbnails' ),
214
+ 'thumbnailSizeItemWithCropMethodNoFilename' => __( '<strong>{label}:</strong> {width}×{height} pixels ({cropMethod})', 'regenerate-thumbnails' ),
215
+ 'thumbnailSizeItemWithCropMethod' => __( '<strong>{label}:</strong> {width}×{height} pixels ({cropMethod}) <code>{filename}</code>', 'regenerate-thumbnails' ),
216
+ 'thumbnailSizeItemWithoutCropMethod' => __( '<strong>{label}:</strong> {width}×{height} pixels <code>{filename}</code>', 'regenerate-thumbnails' ),
217
+ 'thumbnailSizeBiggerThanOriginal' => __( '<strong>{label}:</strong> {width}×{height} pixels (thumbnail would be larger than original)', 'regenerate-thumbnails' ),
218
+ 'thumbnailSizeItemIsCropped' => __( 'cropped to fit', 'regenerate-thumbnails' ),
219
+ 'thumbnailSizeItemIsProportional' => __( 'proportionally resized to fit inside dimensions', 'regenerate-thumbnails' ),
220
+ ),
221
+ 'Home' => array(
222
+ 'intro1' => sprintf(
223
+ __( 'When you change WordPress themes or change the sizes of your thumbnails at <a href="%s">Settings → Media</a>, images that you have previously uploaded to you media library will be missing thumbnail files for those new image sizes. This tool will allow you to create those missing thumbnail files for all images.', 'regenerate-thumbnails' ),
224
+ esc_url( admin_url( 'options-media.php' ) )
225
+ ),
226
+ 'intro2' => sprintf(
227
+ __( 'To process a specific image, visit your media library and click the &quot;Regenerate Thumbnails&quot; link or button. To process multiple specific images, make sure you\'re in the <a href="%s">list view</a> and then use the Bulk Actions dropdown after selecting one or more images.', 'regenerate-thumbnails' ),
228
+ esc_url( admin_url( 'upload.php?mode=list' ) )
229
+ ),
230
+ 'updatePostContents' => __( 'Update the content of posts to use the new sizes.', 'regenerate-thumbnails' ),
231
+ 'RegenerateThumbnailsForAllAttachments' => __( 'Regenerate Thumbnails For All Attachments', 'regenerate-thumbnails' ),
232
+ 'RegenerateThumbnailsForAllXAttachments' => __( 'Regenerate Thumbnails For All {attachmentCount} Attachments', 'regenerate-thumbnails' ),
233
+ 'RegenerateThumbnailsForFeaturedImagesOnly' => __( 'Regenerate Thumbnails For Featured Images Only', 'regenerate-thumbnails' ),
234
+ 'RegenerateThumbnailsForXFeaturedImagesOnly' => __( 'Regenerate Thumbnails For The {attachmentCount} Featured Images Only', 'regenerate-thumbnails' ),
235
+ 'thumbnailSizes' => __( 'Thumbnail Sizes', 'regenerate-thumbnails' ),
236
+ 'thumbnailSizesDescription' => __( 'These are all of the thumbnail sizes that are currently registered:', 'regenerate-thumbnails' ),
237
+ 'alternatives' => __( 'Alternatives', 'regenerate-thumbnails' ),
238
+ 'alternativesText1' => __( 'If you have <a href="{url-cli}">command-line</a> access to your site\'s server, consider using <a href="{url-wpcli}">WP-CLI</a> instead of this tool. It has a built-in <a href="{url-wpcli-regenerate}">regenerate command</a> that works similarly to this tool but should be significantly faster since it has the advantage of being a command-line tool.', 'regenerate-thumbnails' ),
239
+ 'alternativesText2' => __( 'Another alternative is to use the <a href="{url-photon}">Photon</a> functionality that comes with the <a href="{url-jetpack}">Jetpack</a> plugin. It generates thumbnails on-demand using WordPress.com\'s infrastructure. <em>Disclaimer: The author of this plugin, Regenerate Thumbnails, is an employee of the company behind WordPress.com and Jetpack but I would recommend it even if I wasn\'t.', 'regenerate-thumbnails' ),
240
+ ),
241
+ 'RegenerateSingle' => array(
242
+ /* translators: Admin screen title. */
243
+ 'title' => __( 'Regenerate Thumbnails: {name} — WordPress', 'regenerate-thumbnails' ),
244
+ 'errorWithMessage' => __( '<strong>ERROR:</strong> {error}', 'regenerate-thumbnails' ),
245
+ 'filenameAndDimensions' => __( '<code>{filename}</code> {width}×{height} pixels', 'regenerate-thumbnails' ),
246
+ 'preview' => __( 'Preview', 'regenerate-thumbnails' ),
247
+ 'updatePostContents' => __( 'Update the content of posts that use this attachment to use the new sizes.', 'regenerate-thumbnails' ),
248
+ 'regenerating' => __( 'Regenerating…', 'regenerate-thumbnails' ),
249
+ 'done' => __( 'Done! Click here to go back.', 'regenerate-thumbnails' ),
250
+ 'errorRegenerating' => __( 'Error Regenerating', 'regenerate-thumbnails' ),
251
+ 'errorRegeneratingMessage' => __( 'There was an error regenerating this attachment. The error was: <em>{message}</em>', 'regenerate-thumbnails' ),
252
+ 'registeredSizes' => __( 'These are the currently registered thumbnail sizes, whether they exist for this attachment, and their filenames:', 'regenerate-thumbnails' ),
253
+ 'unregisteredSizes' => __( 'The attachment says it also has these thumbnail sizes but they are no longer in use by WordPress. You can probably safely have this plugin delete them, especially if you have this plugin update any posts that make use of this attachment.', 'regenerate-thumbnails' ),
254
+ ),
255
+ 'RegenerateMultiple' => array(
256
+ 'errorsEncountered' => __( 'Errors Encountered', 'regenerate-thumbnails' ),
257
+ 'regenerationLog' => __( 'Regeneration Log', 'regenerate-thumbnails' ),
258
+ 'pause' => __( 'Pause', 'regenerate-thumbnails' ),
259
+ 'resume' => __( 'Resume', 'regenerate-thumbnails' ),
260
+ 'logRegeneratedItem' => __( 'Regenerated {name}', 'regenerate-thumbnails' ),
261
+ 'logSkippedItem' => __( 'Skipped {name}. {reason}', 'regenerate-thumbnails' ),
262
+ 'duration' => __( 'All done in {duration}.', 'regenerate-thumbnails' ),
263
+ 'hours' => __( '{count} hours', 'regenerate-thumbnails' ),
264
+ 'minutes' => __( '{count} minutes', 'regenerate-thumbnails' ),
265
+ 'seconds' => __( '{count} seconds', 'regenerate-thumbnails' ),
266
+ 'error' => __( "Unable to fetch a list of attachment IDs to process from the WordPress REST API. You can check your browser's console for details.", 'regenerate-thumbnails' ),
267
+ ),
268
+ ),
269
+ );
270
+
271
+ // Bulk regeneration.
272
+ if ( ! empty( $_GET['ids'] ) ) {
273
+ $script_data['data']['thumbnailIDs'] = array_map( 'intval', explode( ',', $_GET['ids'] ) );
274
+
275
+ $script_data['l10n']['Home']['RegenerateThumbnailsForXAttachments'] = sprintf(
276
+ __( 'Regenerate Thumbnails For The %d Selected Attachments', 'regenerate-thumbnails' ),
277
+ count( $script_data['data']['thumbnailIDs'] )
278
+ );
279
+ }
280
+
281
+ wp_localize_script( 'regenerate-thumbnails', 'regenerateThumbnails', $script_data );
282
 
283
+ wp_enqueue_style(
284
+ 'regenerate-thumbnails-progressbar',
285
+ plugins_url( 'css/progressbar.css', __FILE__ ),
286
+ array(),
287
+ ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? filemtime( dirname( __FILE__ ) . '/css/progressbar.css' ) : $this->version
288
+ );
289
  }
290
 
291
+ /**
292
+ * The main Regenerate Thumbnails interface, as displayed at Tools → Regenerate Thumbnails.
293
+ */
294
+ public function regenerate_interface() {
295
+ global $wp_version;
296
+
297
+ echo '<div class="wrap">';
298
+ echo '<h1>' . esc_html__( 'Regenerate Thumbnails', 'regenerate-thumbnails' ) . '</h1>';
299
+
300
+ if ( version_compare( $wp_version, '4.7', '<' ) ) {
301
+ echo '<p>' . sprintf(
302
+ __( 'This plugin requires WordPress 4.7 or newer. You are on version %1$s. Please <a href="%2$s">upgrade</a>.', 'regenerate-thumbnails' ),
303
+ esc_html( $wp_version ),
304
+ esc_url( admin_url( 'update-core.php' ) )
305
+ ) . '</p>';
306
+ } else {
307
+
308
+ ?>
309
+
310
+ <div id="regenerate-thumbnails-app">
311
+ <div class="notice notice-error hide-if-js">
312
+ <p><strong><?php esc_html_e( 'This tool requires that JavaScript be enabled to work.', 'regenerate-thumbnails' ); ?></strong></p>
313
+ </div>
314
+
315
+ <router-view><p class="hide-if-no-js"><?php esc_html_e( 'Loading…', 'regenerate-thumbnails' ); ?></p></router-view>
316
+ </div>
317
+
318
+ <?php
319
+
320
+ } // version_compare()
321
+
322
+ echo '</div>';
323
+ }
324
 
325
  /**
326
+ * If the image editor doesn't support image resizing (thumbnailing), then add an admin notice
327
+ * warning the user of this.
328
+ */
329
+ public function add_admin_notice_if_resizing_not_supported() {
330
+ if ( ! wp_image_editor_supports( array( 'methods' => array( 'resize' ) ) ) ) {
331
+ add_action( 'admin_notices', array( $this, 'admin_notices_resizing_not_supported' ) );
332
+ }
333
+ }
334
+
335
+ /**
336
+ * Outputs an admin notice stating that image resizing (thumbnailing) is not supported.
337
+ */
338
+ public function admin_notices_resizing_not_supported() {
339
+ ?>
340
+ <div class="notice notice-error">
341
+ <p><strong><?php esc_html_e( "This tool won't be able to do anything because your server doesn't support image editing which means that WordPress can't create thumbnail images. Please ask your host to install the Imagick or GD PHP extensions.", 'regenerate-thumbnails' ); ?></strong></p>
342
+ </div>
343
+ <?php
344
+ }
345
+
346
+ /**
347
+ * Helper function to create a URL to regenerate a single image.
348
  *
349
+ * @param int $id The attachment ID that should be regenerated.
350
  *
351
+ * @return string The URL to the admin page.
352
  */
353
+ public function create_page_url( $id ) {
354
+ return add_query_arg( 'page', 'regenerate-thumbnails', admin_url( 'tools.php' ) ) . '#/regenerate/' . $id;
355
+ }
356
+
357
+ /**
358
+ * Determines whether an attachment can have its thumbnails regenerated.
359
+ *
360
+ * This includes checking to see if non-images, such as PDFs, are supported
361
+ * by the current image editor.
362
+ *
363
+ * @param WP_Post $post An attachment's post object.
364
+ *
365
+ * @return bool Whether the given attachment can have its thumbnails regenerated.
366
+ */
367
+ public function is_regeneratable( $post ) {
368
+ if ( 'site-icon' === get_post_meta( $post->ID, '_wp_attachment_context', true ) ) {
369
+ return false;
370
+ }
371
 
372
+ if ( wp_attachment_is_image( $post ) ) {
373
+ return true;
374
+ }
375
 
376
+ $fullsize = get_attached_file( $post->ID );
377
+
378
+ if ( ! $fullsize || ! file_exists( $fullsize ) ) {
379
+ return false;
380
+ }
381
+
382
+ $editor = wp_get_image_editor( $fullsize );
383
+
384
+ if ( is_wp_error( $editor ) ) {
385
+ return false;
386
+ }
387
 
388
+ return true;
389
+ }
390
 
391
+ /**
392
+ * Adds "Regenerate Thumbnails" below each image in the media library list view.
393
+ *
394
+ * @param array $actions An array of current actions.
395
+ * @param WP_Post $post The current attachment's post object.
396
+ *
397
+ * @return array The new list of actions.
398
+ */
399
  public function add_regenerate_link_to_media_list_view( $actions, $post ) {
400
+ if ( ! current_user_can( $this->capability ) || ! $this->is_regeneratable( $post ) ) {
401
  return $actions;
402
+ }
403
 
404
+ $actions['regenerate_thumbnails'] = '<a href="' . esc_url( $this->create_page_url( $post->ID ) ) . '" title="' . esc_attr( __( 'Regenerate the thumbnails for this single image', 'regenerate-thumbnails' ) ) . '">' . __( 'Regenerate Thumbnails', 'regenerate-thumbnails' ) . '</a>';
 
405
 
406
  return $actions;
407
  }
412
  public function add_button_to_media_edit_page() {
413
  global $post;
414
 
415
+ if ( ! current_user_can( $this->capability ) || ! $this->is_regeneratable( $post ) ) {
416
  return;
417
  }
418
 
419
  echo '<div class="misc-pub-section misc-pub-regenerate-thumbnails">';
420
+ echo '<a href="' . esc_url( $this->create_page_url( $post->ID ) ) . '" class="button-secondary button-large" title="' . esc_attr( __( 'Regenerate the thumbnails for this single image', 'regenerate-thumbnails' ) ) . '">' . __( 'Regenerate Thumbnails', 'regenerate-thumbnails' ) . '</a>';
421
  echo '</div>';
422
  }
423
 
 
424
  /**
425
  * Adds a "Regenerate Thumbnails" button to the edit media modal view.
426
  *
428
  * in order to be able to do it, so instead I'm adding it to the bottom of the list
429
  * of media fields. Pull requests to improve this are welcome!
430
  *
431
+ * @param array $form_fields An array of existing form fields.
432
+ * @param WP_Post $post The current media item, as a post object.
433
  *
434
  * @return array The new array of form fields.
435
  */
436
  public function add_button_to_edit_media_modal_fields_area( $form_fields, $post ) {
437
+ if ( ! current_user_can( $this->capability ) || ! $this->is_regeneratable( $post ) ) {
438
+ return $form_fields;
439
+ }
440
+
441
  $form_fields['regenerate_thumbnails'] = array(
442
  'label' => '',
443
  'input' => 'html',
444
+ 'html' => '<a href="' . esc_url( $this->create_page_url( $post->ID ) ) . '" class="button-secondary button-large" title="' . esc_attr( __( 'Regenerate the thumbnails for this single image', 'regenerate-thumbnails' ) ) . '">' . __( 'Regenerate Thumbnails', 'regenerate-thumbnails' ) . '</a>',
445
  'show_in_modal' => true,
446
  'show_in_edit' => false,
447
  );
449
  return $form_fields;
450
  }
451
 
452
+ /**
453
+ * Add "Regenerate Thumbnails" to the bulk actions dropdown on the media list using Javascript.
454
+ */
455
  public function add_bulk_actions_via_javascript() {
456
+ if ( ! current_user_can( $this->capability ) ) {
457
  return;
458
+ }
459
+
460
+ ?>
461
  <script type="text/javascript">
462
+ jQuery(document).ready(function ($) {
463
+ $('select[name^="action"] option:last-child').before(
464
+ $('<option/>')
465
+ .attr('value', 'bulk_regenerate_thumbnails')
466
+ .text('<?php echo esc_js( __( 'Regenerate Thumbnails', 'regenerate-thumbnails' ) ); ?>')
467
+ );
468
  });
469
  </script>
470
+ <?php
471
  }
472
 
473
+ /**
474
+ * Handles the submission of the new bulk actions entry and redirects to the admin page with the selected attachment IDs.
475
+ */
476
  public function bulk_action_handler() {
477
  if (
478
+ empty( $_REQUEST['action'] ) ||
479
+ empty( $_REQUEST['action2'] ) ||
480
+ ( 'bulk_regenerate_thumbnails' != $_REQUEST['action'] && 'bulk_regenerate_thumbnails' != $_REQUEST['action2'] ) ||
481
+ empty( $_REQUEST['media'] ) ||
482
+ ! is_array( $_REQUEST['media'] )
483
  ) {
484
  return;
485
  }
486
 
487
  check_admin_referer( 'bulk-media' );
488
 
489
+ wp_safe_redirect(
490
+ add_query_arg(
491
+ array(
492
+ 'page' => 'regenerate-thumbnails',
493
+ 'ids' => rawurlencode( implode( ',', array_map( 'intval', $_REQUEST['media'] ) ) ),
494
+ ),
495
+ admin_url( 'tools.php' )
496
+ )
497
+ );
498
 
 
 
499
  exit();
500
  }
501
 
502
+ /**
503
+ * Returns an array of all thumbnail sizes, including their label, size, and crop setting.
504
+ *
505
+ * @return array An array, with the thumbnail label as the key and an array of thumbnail properties (width, height, crop).
506
+ */
507
+ public function get_thumbnail_sizes() {
508
+ global $_wp_additional_image_sizes;
509
+
510
+ $thumbnail_sizes = array();
511
+
512
+ foreach ( get_intermediate_image_sizes() as $size ) {
513
+ $thumbnail_sizes[ $size ]['label'] = $size;
514
+ if ( in_array( $size, array( 'thumbnail', 'medium', 'medium_large', 'large' ) ) ) {
515
+ $thumbnail_sizes[ $size ]['width'] = (int) get_option( $size . '_size_w' );
516
+ $thumbnail_sizes[ $size ]['height'] = (int) get_option( $size . '_size_h' );
517
+ $thumbnail_sizes[ $size ]['crop'] = ( 'thumbnail' == $size ) ? (bool) get_option( 'thumbnail_crop' ) : false;
518
+ } elseif ( ! empty( $_wp_additional_image_sizes ) && ! empty( $_wp_additional_image_sizes[ $size ] ) ) {
519
+ $thumbnail_sizes[ $size ]['width'] = (int) $_wp_additional_image_sizes[ $size ]['width'];
520
+ $thumbnail_sizes[ $size ]['height'] = (int) $_wp_additional_image_sizes[ $size ]['height'];
521
+ $thumbnail_sizes[ $size ]['crop'] = (bool) $_wp_additional_image_sizes[ $size ]['crop'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
522
  }
 
 
 
 
 
523
  }
524
 
525
+ return $thumbnail_sizes;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
526
  }
527
  }
528
 
529
+ /**
530
+ * Returns the single instance of this plugin, creating one if needed.
531
+ *
532
+ * @return RegenerateThumbnails
533
+ */
534
  function RegenerateThumbnails() {
535
+ return RegenerateThumbnails::instance();
536
+ }
537
+
538
+ /**
539
+ * Initialize this plugin once all other plugins have finished loading.
540
+ */
541
+ add_action( 'plugins_loaded', 'RegenerateThumbnails' );
screenshot-1.png DELETED
Binary file
screenshot-2.png DELETED
Binary file
screenshot-3.png DELETED
Binary file