You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

theming-personal-theming.js 67KB

123
  1. /*! For license information please see theming-personal-theming.js.LICENSE.txt */
  2. !function(){var e,r,n,o={21613:function(e,r,n){"use strict";var o=n(77958),i=n(20144);function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var u=n(79753),c=n(43554),s=n(93664),l=n(71998),d=n(67912),f=n(64024),h=(n(97248),n(20296)),p=n.n(h),g=n(37776),m=n(1082),v=n.n(m),b=n(80419),y=n(82675),A={name:"ImageEditIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},_=n(51900),w=(0,_.Z)(A,(function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon image-edit-icon",attrs:{"aria-hidden":!t.title,"aria-label":t.title,role:"img"},on:{click:function(e){return t.$emit("click",e)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M22.7 14.3L21.7 15.3L19.7 13.3L20.7 12.3C20.8 12.2 20.9 12.1 21.1 12.1C21.2 12.1 21.4 12.2 21.5 12.3L22.8 13.6C22.9 13.8 22.9 14.1 22.7 14.3M13 19.9V22H15.1L21.2 15.9L19.2 13.9L13 19.9M21 5C21 3.9 20.1 3 19 3H5C3.9 3 3 3.9 3 5V19C3 20.1 3.9 21 5 21H11V19.1L12.1 18H5L8.5 13.5L11 16.5L14.5 12L16.1 14.1L21 9.1V5Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null).exports,k=n(25108);function C(t){return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C(t)}function x(){x=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),u=new L(o||[]);return n(a,"_invoke",{value:_(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var d={};function f(){}function h(){}function p(){}var g={};c(g,i,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(T([])));v&&v!==e&&r.call(v,i)&&(g=v);var b=p.prototype=f.prototype=Object.create(g);function y(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function o(n,i,a,u){var c=l(t[n],t,i);if("throw"!==c.type){var s=c.arg,d=s.value;return d&&"object"==C(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(d).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,u)}))}u(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function _(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=w(a,r);if(u){if(u===d)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===d)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function w(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function T(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:I}}function I(){return{value:void 0,done:!0}}return h.prototype=p,n(b,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:h,configurable:!0}),h.displayName=c(p,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,u,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},y(A.prototype),c(A.prototype,a,(function(){return this})),t.AsyncIterator=A,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new A(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},y(b),c(b,u,"Generator"),c(b,i,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=T,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:T(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},t}function S(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function L(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){S(i,n,o,a,u,"next",t)}function u(t){S(i,n,o,a,u,"throw",t)}a(void 0)}))}}function T(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var I=(0,c.j)("theming","backgroundImage"),D=(0,c.j)("theming","shippedBackgrounds"),E=(0,c.j)("theming","themingDefaultBackground"),O=(0,c.j)("theming","defaultShippedBackground"),j=function(t){return(0,u.generateFilePath)("theming","","img/background/")+t},P={name:"BackgroundSettings",components:{Check:b.default,Close:y.default,ImageEdit:w,NcColorPicker:g.Z},data:function(){return{loading:!1,Theming:(0,c.j)("theming","data",{}),backgroundImage:I}},computed:{shippedBackgrounds:function(){var t=this;return Object.keys(D).map((function(t){return{name:t,url:j(t),preview:j("preview/"+t),details:D[t]}})).filter((function(e){return!(!t.isGlobalBackgroundDeleted&&!t.isGlobalBackgroundDefault)||e.name!==O}))},isGlobalBackgroundDefault:function(){return!!E},isGlobalBackgroundDeleted:function(){return"backgroundColor"===E},isBackgroundDisabled:function(){return"disabled"===this.backgroundImage||!this.backgroundImage}},methods:{invertTextColor:function(t){return this.calculateLuma(t)>.6},calculateLuma:function(t){var e,r,n=(e=this.hexToRGB(t),r=3,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,u=[],c=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(u.push(n.value),u.length!==e);c=!0);}catch(t){s=!0,o=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return u}}(e,r)||function(t,e){if(t){if("string"==typeof t)return T(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?T(t,e):void 0}}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());return(.2126*n[0]+.7152*n[1]+.0722*n[2])/255},hexToRGB:function(t){var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]:null},update:function(t){var e=this;return L(x().mark((function r(){return x().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:e.backgroundImage=t.backgroundImage,e.Theming.color=t.backgroundColor,e.$emit("update:background"),e.loading=!1;case 4:case"end":return r.stop()}}),r)})))()},setDefault:function(){var t=this;return L(x().mark((function e(){var r;return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.loading="default",e.next=3,s.Z.post((0,u.generateUrl)("/apps/theming/background/default"));case 3:r=e.sent,t.update(r.data);case 5:case"end":return e.stop()}}),e)})))()},setShipped:function(t){var e=this;return L(x().mark((function r(){var n;return x().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return e.loading=t,r.next=3,s.Z.post((0,u.generateUrl)("/apps/theming/background/shipped"),{value:t});case 3:n=r.sent,e.update(n.data);case 5:case"end":return r.stop()}}),r)})))()},setFile:function(t){var e=arguments,r=this;return L(x().mark((function n(){var o,i;return x().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return o=e.length>1&&void 0!==e[1]?e[1]:null,r.loading="custom",n.next=4,s.Z.post((0,u.generateUrl)("/apps/theming/background/custom"),{value:t,color:o});case 4:i=n.sent,r.update(i.data);case 6:case"end":return n.stop()}}),n)})))()},removeBackground:function(){var t=this;return L(x().mark((function e(){var r;return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.loading="remove",e.next=3,s.Z.delete((0,u.generateUrl)("/apps/theming/background/custom"));case 3:r=e.sent,t.update(r.data);case 5:case"end":return e.stop()}}),e)})))()},pickColor:function(t){var e=this;return L(x().mark((function r(){var n,o,i,a;return x().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return e.loading="color",i=(null==t||null===(n=t.target)||void 0===n||null===(n=n.dataset)||void 0===n?void 0:n.color)||(null===(o=e.Theming)||void 0===o?void 0:o.color)||"#0082c9",r.next=4,s.Z.post((0,u.generateUrl)("/apps/theming/background/color"),{color:i});case 4:a=r.sent,e.update(a.data);case 6:case"end":return r.stop()}}),r)})))()},debouncePickColor:p()((function(){this.pickColor.apply(this,arguments)}),200),pickFile:function(){var e=this;(0,f.fn)(t("theming","Select a background from your files")).allowDirectories(!1).setMimeTypeFilter(["image/png","image/gif","image/jpeg","image/svg+xml","image/svg"]).setMultiSelect(!1).addButton({id:"select",label:t("theming","Select background"),callback:function(t){var r;e.applyFile(null===(r=t[0])||void 0===r?void 0:r.path)},type:"primary"}).build().pick()},applyFile:function(e){var r=this;return L(x().mark((function n(){var i,a,c,l,d,h;return x().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e&&"string"==typeof e&&0!==e.trim().length&&"/"!==e){n.next=4;break}return k.error("No valid background have been selected",{path:e}),(0,f.x2)(t("theming","No background has been selected")),n.abrupt("return");case 4:return r.loading="custom",i=null,a=null,n.prev=7,l=(0,u.generateRemoteUrl)("dav/files/"+(0,o.ts)().uid+e),n.next=11,s.Z.get(l,{responseType:"blob"});case 11:return i=n.sent,d=URL.createObjectURL(i.data),n.next=15,r.getColorPaletteFromBlob(d);case 15:h=n.sent,a=null==h||null===(c=h.DarkVibrant)||void 0===c?void 0:c.hex,r.setFile(e,a),k.debug("Extracted colour",a,"from custom image",e,h),n.next=25;break;case 21:n.prev=21,n.t0=n.catch(7),r.setFile(e),k.error("Unable to extract colour from custom image",{error:n.t0,path:e,response:i,color:a});case 25:case"end":return n.stop()}}),n,null,[[7,21]])})))()},getColorPaletteFromBlob:function(t){return new Promise((function(e,r){new(v())(t).getPalette((function(t,n){t&&r(t),e(n)}))}))}}},M=P,B=n(93379),F=n.n(B),N=n(7795),G=n.n(N),V=n(90569),U=n.n(V),R=n(3565),q=n.n(R),H=n(19216),Z=n.n(H),z=n(44589),W=n.n(z),$=n(28636),Y={};Y.styleTagTransform=W(),Y.setAttributes=q(),Y.insert=U().bind(null,"head"),Y.domAPI=G(),Y.insertStyleElement=Z(),F()($.Z,Y),$.Z&&$.Z.locals&&$.Z.locals;var K=(0,_.Z)(M,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"background-selector",attrs:{"data-user-theming-background-settings":""}},[e("button",{staticClass:"background background__filepicker",class:{"icon-loading":"custom"===t.loading,"background--active":"custom"===t.backgroundImage},attrs:{"data-color-bright":t.invertTextColor(t.Theming.color),"data-user-theming-background-custom":"",tabindex:"0"},on:{click:t.pickFile}},[t._v("\n\t\t"+t._s(t.t("theming","Custom background"))+"\n\t\t"),"custom"!==t.backgroundImage?e("ImageEdit",{attrs:{size:26}}):t._e(),t._v(" "),e("Check",{attrs:{size:44}})],1),t._v(" "),e("button",{staticClass:"background background__default",class:{"icon-loading":"default"===t.loading,"background--active":"default"===t.backgroundImage},style:{"--border-color":t.Theming.defaultColor},attrs:{"data-color-bright":t.invertTextColor(t.Theming.defaultColor),"data-user-theming-background-default":"",tabindex:"0"},on:{click:t.setDefault}},[t._v("\n\t\t"+t._s(t.t("theming","Default background"))+"\n\t\t"),e("Check",{attrs:{size:44}})],1),t._v(" "),e("NcColorPicker",{on:{input:t.debouncePickColor},model:{value:t.Theming.color,callback:function(e){t.$set(t.Theming,"color",e)},expression:"Theming.color"}},[e("button",{staticClass:"background background__color",style:{backgroundColor:t.Theming.color,"--border-color":t.Theming.color},attrs:{"data-color":t.Theming.color,"data-color-bright":t.invertTextColor(t.Theming.color),"data-user-theming-background-color":"",tabindex:"0"}},[t._v("\n\t\t\t"+t._s(t.t("theming","Change color"))+"\n\t\t")])]),t._v(" "),e("button",{staticClass:"background background__delete",class:{"background--active":t.isBackgroundDisabled},attrs:{"data-user-theming-background-clear":"",tabindex:"0"},on:{click:t.removeBackground}},[t._v("\n\t\t"+t._s(t.t("theming","No background"))+"\n\t\t"),t.isBackgroundDisabled?t._e():e("Close",{attrs:{size:32}}),t._v(" "),e("Check",{attrs:{size:44}})],1),t._v(" "),t._l(t.shippedBackgrounds,(function(r){return e("button",{key:r.name,staticClass:"background background__shipped",class:{"icon-loading":t.loading===r.name,"background--active":t.backgroundImage===r.name},style:{backgroundImage:"url("+r.preview+")","--border-color":r.details.primary_color},attrs:{title:r.details.attribution,"aria-label":r.details.attribution,"data-color-bright":"dark"===r.details.theming,"data-user-theming-background-shipped":r.name,tabindex:"0"},on:{click:function(e){return t.setShipped(r.name)}}},[e("Check",{attrs:{size:44}})],1)}))],2)}),[],!1,null,"4e3fc802",null).exports,Q=n(25108),X={name:"ItemPreview",components:{NcCheckboxRadioSwitch:l.Z},props:{enforced:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},theme:{type:Object,required:!0},type:{type:String,default:""},unique:{type:Boolean,default:!1}},computed:{switchType:function(){return this.unique?"switch":"radio"},name:function(){return this.unique?null:this.type},img:function(){return(0,u.generateFilePath)("theming","img",this.theme.id+".jpg")},checked:{get:function(){return this.selected},set:function(t){Q.debug("Changed theme",this.theme.id,t),this.unique?this.$emit("change",{enabled:!0===t,id:this.theme.id}):this.$emit("change",{enabled:!0,id:this.theme.id})}}},methods:{onToggle:function(){"radio"!==this.switchType?this.checked=!this.checked:this.checked=!0}}},J=n(22465),tt={};tt.styleTagTransform=W(),tt.setAttributes=q(),tt.insert=U().bind(null,"head"),tt.domAPI=G(),tt.insertStyleElement=Z(),F()(J.Z,tt),J.Z&&J.Z.locals&&J.Z.locals;var et=(0,_.Z)(X,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"theming__preview",class:"theming__preview--"+t.theme.id},[e("div",{staticClass:"theming__preview-image",style:{backgroundImage:"url("+t.img+")"},on:{click:t.onToggle}}),t._v(" "),e("div",{staticClass:"theming__preview-description"},[e("h3",[t._v(t._s(t.theme.title))]),t._v(" "),e("p",{staticClass:"theming__preview-explanation"},[t._v(t._s(t.theme.description))]),t._v(" "),t.enforced?e("span",{staticClass:"theming__preview-warning",attrs:{role:"note"}},[t._v("\n\t\t\t"+t._s(t.t("theming","Theme selection is enforced"))+"\n\t\t")]):t._e(),t._v(" "),e("NcCheckboxRadioSwitch",{staticClass:"theming__preview-toggle",attrs:{checked:t.checked,disabled:t.enforced,name:t.name,type:t.switchType},on:{"update:checked":function(e){t.checked=e}}},[t._v("\n\t\t\t"+t._s(t.theme.enableLabel)+"\n\t\t")])],1)])}),[],!1,null,"1a08e35a",null).exports,rt=n(25108);function nt(t){return nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nt(t)}function ot(){ot=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function s(t,e,r,o){var i=e&&e.prototype instanceof f?e:f,a=Object.create(i.prototype),u=new x(o||[]);return n(a,"_invoke",{value:_(t,r,u)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=s;var d={};function f(){}function h(){}function p(){}var g={};c(g,i,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(S([])));v&&v!==e&&r.call(v,i)&&(g=v);var b=p.prototype=f.prototype=Object.create(g);function y(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function A(t,e){function o(n,i,a,u){var c=l(t[n],t,i);if("throw"!==c.type){var s=c.arg,d=s.value;return d&&"object"==nt(d)&&r.call(d,"__await")?e.resolve(d.__await).then((function(t){o("next",t,a,u)}),(function(t){o("throw",t,a,u)})):e.resolve(d).then((function(t){s.value=t,a(s)}),(function(t){return o("throw",t,a,u)}))}u(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function _(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=w(a,r);if(u){if(u===d)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===d)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function w(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,d;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function x(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function S(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:L}}function L(){return{value:void 0,done:!0}}return h.prototype=p,n(b,"constructor",{value:p,configurable:!0}),n(p,"constructor",{value:h,configurable:!0}),h.displayName=c(p,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,c(t,u,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},y(A.prototype),c(A.prototype,a,(function(){return this})),t.AsyncIterator=A,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new A(s(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},y(b),c(b,u,"Generator"),c(b,i,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=S,x.prototype={constructor:x,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:S(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},t}function it(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function at(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){it(i,n,o,a,u,"next",t)}function u(t){it(i,n,o,a,u,"throw",t)}a(void 0)}))}}function ut(t){return function(t){if(Array.isArray(t))return ct(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return ct(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ct(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ct(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var st=(0,c.j)("theming","themes",[]),lt=(0,c.j)("theming","enforceTheme",""),dt=(0,c.j)("theming","shortcutsDisabled",!1),ft=(0,c.j)("theming","isUserThemingDisabled");rt.debug("Available themes",st);var ht={name:"UserThemes",components:{ItemPreview:et,NcCheckboxRadioSwitch:l.Z,NcSettingsSection:d.Z,BackgroundSettings:K},data:function(){return{availableThemes:st,enforceTheme:lt,shortcutsDisabled:dt,isUserThemingDisabled:ft}},computed:{themes:function(){return this.availableThemes.filter((function(t){return 1===t.type}))},fonts:function(){return this.availableThemes.filter((function(t){return 2===t.type}))},selectedTheme:function(){return this.themes.find((function(t){return!0===t.enabled}))||this.themes[0]},description:function(){return t("theming","Universal access is very important to us. We follow web standards and check to make everything usable also without mouse, and assistive software such as screenreaders. We aim to be compliant with the {guidelines}Web Content Accessibility Guidelines{linkend} 2.1 on AA level, with the high contrast theme even on AAA level.").replace("{guidelines}",this.guidelinesLink).replace("{linkend}","</a>")},guidelinesLink:function(){return'<a target="_blank" href="https://www.w3.org/WAI/standards-guidelines/wcag/" rel="noreferrer nofollow">'},descriptionDetail:function(){return t("theming","If you find any issues, do not hesitate to report them on {issuetracker}our issue tracker{linkend}. And if you want to get involved, come join {designteam}our design team{linkend}!").replace("{issuetracker}",this.issuetrackerLink).replace("{designteam}",this.designteamLink).replace(/\{linkend\}/g,"</a>")},issuetrackerLink:function(){return'<a target="_blank" href="https://github.com/nextcloud/server/issues/" rel="noreferrer nofollow">'},designteamLink:function(){return'<a target="_blank" href="https://nextcloud.com/design" rel="noreferrer nofollow">'}},watch:{shortcutsDisabled:function(t){this.changeShortcutsDisabled(t)}},methods:{refreshGlobalStyles:function(){ut(document.head.querySelectorAll("link.theme")).forEach((function(t){var e=new URL(t.href);e.searchParams.set("v",Date.now());var r=t.cloneNode();r.href=e.toString(),r.onload=function(){return t.remove()},document.head.append(r)}))},updateBackground:function(t){this.background="custom"===t.type||"default"===t.type?t.type:t.value,this.refreshGlobalStyles()},changeTheme:function(t){var e=t.enabled,r=t.id;this.themes.forEach((function(t){t.id===r&&e?t.enabled=!0:t.enabled=!1})),this.updateBodyAttributes(),this.selectItem(e,r)},changeFont:function(t){var e=t.enabled,r=t.id;this.fonts.forEach((function(t){t.id===r&&e?t.enabled=!0:t.enabled=!1})),this.updateBodyAttributes(),this.selectItem(e,r)},changeShortcutsDisabled:function(t){return at(ot().mark((function e(){return ot().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=5;break}return e.next=3,(0,s.Z)({url:(0,u.generateOcsUrl)("apps/provisioning_api/api/v1/config/users/{appId}/{configKey}",{appId:"theming",configKey:"shortcuts_disabled"}),data:{configValue:"yes"},method:"POST"});case 3:e.next=7;break;case 5:return e.next=7,(0,s.Z)({url:(0,u.generateOcsUrl)("apps/provisioning_api/api/v1/config/users/{appId}/{configKey}",{appId:"theming",configKey:"shortcuts_disabled"}),method:"DELETE"});case 7:case"end":return e.stop()}}),e)})))()},updateBodyAttributes:function(){var t=this.themes.filter((function(t){return!0===t.enabled})).map((function(t){return t.id})),e=this.fonts.filter((function(t){return!0===t.enabled})).map((function(t){return t.id}));this.themes.forEach((function(t){document.body.toggleAttribute("data-theme-".concat(t.id),t.enabled)})),this.fonts.forEach((function(t){document.body.toggleAttribute("data-theme-".concat(t.id),t.enabled)})),document.body.setAttribute("data-themes",[].concat(ut(t),ut(e)).join(","))},selectItem:function(e,r){return at(ot().mark((function n(){return ot().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,!e){n.next=6;break}return n.next=4,(0,s.Z)({url:(0,u.generateOcsUrl)("apps/theming/api/v1/theme/{themeId}/enable",{themeId:r}),method:"PUT"});case 4:n.next=8;break;case 6:return n.next=8,(0,s.Z)({url:(0,u.generateOcsUrl)("apps/theming/api/v1/theme/{themeId}",{themeId:r}),method:"DELETE"});case 8:n.next=14;break;case 10:n.prev=10,n.t0=n.catch(0),rt.error(n.t0,n.t0.response),OC.Notification.showTemporary(t("theming",n.t0.response.data.ocs.meta.message+". Unable to apply the setting."));case 14:case"end":return n.stop()}}),n,null,[[0,10]])})))()}}},pt=n(82599),gt={};gt.styleTagTransform=W(),gt.setAttributes=q(),gt.insert=U().bind(null,"head"),gt.domAPI=G(),gt.insertStyleElement=Z(),F()(pt.Z,gt),pt.Z&&pt.Z.locals&&pt.Z.locals;var mt=(0,_.Z)(ht,(function(){var t=this,e=t._self._c;return e("section",[e("NcSettingsSection",{staticClass:"theming",attrs:{name:t.t("theming","Appearance and accessibility"),"limit-width":!1}},[e("p",{domProps:{innerHTML:t._s(t.description)}}),t._v(" "),e("p",{domProps:{innerHTML:t._s(t.descriptionDetail)}}),t._v(" "),e("div",{staticClass:"theming__preview-list"},t._l(t.themes,(function(r){return e("ItemPreview",{key:r.id,attrs:{enforced:r.id===t.enforceTheme,selected:t.selectedTheme.id===r.id,theme:r,unique:1===t.themes.length,type:"theme"},on:{change:t.changeTheme}})})),1),t._v(" "),e("div",{staticClass:"theming__preview-list"},t._l(t.fonts,(function(r){return e("ItemPreview",{key:r.id,attrs:{selected:r.enabled,theme:r,unique:1===t.fonts.length,type:"font"},on:{change:t.changeFont}})})),1)]),t._v(" "),e("NcSettingsSection",{staticClass:"background",attrs:{name:t.t("theming","Background"),"data-user-theming-background-disabled":""}},[t.isUserThemingDisabled?[e("p",[t._v(t._s(t.t("theming","Customization has been disabled by your administrator")))])]:[e("p",[t._v(t._s(t.t("theming","Set a custom background")))]),t._v(" "),e("BackgroundSettings",{staticClass:"background__grid",on:{"update:background":t.refreshGlobalStyles}})]],2),t._v(" "),e("NcSettingsSection",{attrs:{name:t.t("theming","Keyboard shortcuts")}},[e("p",[t._v(t._s(t.t("theming","In some cases keyboard shortcuts can interfere with accessibility tools. In order to allow focusing on your tool correctly you can disable all keyboard shortcuts here. This will also disable all available shortcuts in apps.")))]),t._v(" "),e("NcCheckboxRadioSwitch",{staticClass:"theming__preview-toggle",attrs:{checked:t.shortcutsDisabled,name:"shortcuts_disabled",type:"switch"},on:{"update:checked":function(e){t.shortcutsDisabled=e},change:t.changeShortcutsDisabled}},[t._v("\n\t\t\t"+t._s(t.t("theming","Disable all keyboard shortcuts"))+"\n\t\t")])],1)],1)}),[],!1,null,"8a8d5388",null).exports;n.nc=btoa((0,o.IH)()),i.default.prototype.OC=OC,i.default.prototype.t=t;var vt=new(i.default.extend(mt));vt.$mount("#theming"),vt.$on("update:background",(function(){var t;(t=document.head.querySelectorAll("link.theme"),function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).forEach((function(t){var e=new URL(t.href);e.searchParams.set("v",Date.now());var r=t.cloneNode();r.href=e.toString(),r.onload=function(){return t.remove()},document.head.append(r)}))}))},82599:function(t,e,r){"use strict";var n=r(87537),o=r.n(n),i=r(23645),a=r.n(i)()(o());a.push([t.id,".theming p[data-v-8a8d5388]{max-width:800px}.theming[data-v-8a8d5388] a{font-weight:bold}.theming[data-v-8a8d5388] a:hover,.theming[data-v-8a8d5388] a:focus{text-decoration:underline}.theming__preview-list[data-v-8a8d5388]{--gap: 30px;display:grid;margin-top:var(--gap);column-gap:var(--gap);row-gap:var(--gap);grid-template-columns:1fr 1fr}.background__grid[data-v-8a8d5388]{margin-top:30px}@media(max-width: 1440px){.theming__preview-list[data-v-8a8d5388]{display:flex;flex-direction:column}}","",{version:3,sources:["webpack://./apps/theming/src/UserThemes.vue"],names:[],mappings:"AAGC,4BACC,eAAA,CAID,4BACC,gBAAA,CAEA,oEAEC,yBAAA,CAIF,wCACC,WAAA,CAEA,YAAA,CACA,qBAAA,CACA,qBAAA,CACA,kBAAA,CACA,6BAAA,CAKD,mCACC,eAAA,CAIF,0BACC,wCACC,YAAA,CACA,qBAAA,CAAA",sourcesContent:["\n.theming {\n\t// Limit width of settings sections for readability\n\tp {\n\t\tmax-width: 800px;\n\t}\n\n\t// Proper highlight for links and focus feedback\n\t&::v-deep a {\n\t\tfont-weight: bold;\n\n\t\t&:hover,\n\t\t&:focus {\n\t\t\ttext-decoration: underline;\n\t\t}\n\t}\n\n\t&__preview-list {\n\t\t--gap: 30px;\n\n\t\tdisplay: grid;\n\t\tmargin-top: var(--gap);\n\t\tcolumn-gap: var(--gap);\n\t\trow-gap: var(--gap);\n\t\tgrid-template-columns: 1fr 1fr;\n\t}\n}\n\n.background {\n\t&__grid {\n\t\tmargin-top: 30px;\n\t}\n}\n\n@media (max-width: 1440px) {\n\t.theming__preview-list {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t}\n}\n"],sourceRoot:""}]),e.Z=a},28636:function(t,e,r){"use strict";var n=r(87537),o=r.n(n),i=r(23645),a=r.n(i)()(o());a.push([t.id,".background-selector[data-v-4e3fc802]{display:flex;flex-wrap:wrap;justify-content:center}.background-selector .background[data-v-4e3fc802]{overflow:hidden;width:176px;height:96px;margin:8px;text-align:center;border:2px solid var(--color-main-background);border-radius:var(--border-radius-large);background-position:center center;background-size:cover}.background-selector .background__filepicker.background--active[data-v-4e3fc802]{color:#fff;background-image:var(--image-background)}.background-selector .background__default[data-v-4e3fc802]{background-color:var(--color-primary-default);background-image:linear-gradient(to bottom, rgba(23, 23, 23, 0.5), rgba(23, 23, 23, 0.5)),var(--image-background-plain, var(--image-background-default))}.background-selector .background__filepicker[data-v-4e3fc802],.background-selector .background__default[data-v-4e3fc802],.background-selector .background__color[data-v-4e3fc802]{border-color:var(--color-border)}.background-selector .background__color[data-v-4e3fc802]{color:var(--color-primary-text);background-color:var(--color-primary-default)}.background-selector .background__default[data-v-4e3fc802],.background-selector .background__shipped[data-v-4e3fc802]{color:#fff}.background-selector .background[data-color-bright][data-v-4e3fc802]{color:#000}.background-selector .background--active[data-v-4e3fc802],.background-selector .background[data-v-4e3fc802]:hover,.background-selector .background[data-v-4e3fc802]:focus{border:2px solid var(--border-color, var(--color-primary-element)) !important}.background-selector .background span[data-v-4e3fc802]{margin:4px}.background-selector .background .check-icon[data-v-4e3fc802]{display:none}.background-selector .background--active:not(.icon-loading) .check-icon[data-v-4e3fc802]{display:block !important}","",{version:3,sources:["webpack://./apps/theming/src/components/BackgroundSettings.vue"],names:[],mappings:"AACA,sCACC,YAAA,CACA,cAAA,CACA,sBAAA,CAEA,kDACC,eAAA,CACA,WAAA,CACA,WAAA,CACA,UAAA,CACA,iBAAA,CACA,6CAAA,CACA,wCAAA,CACA,iCAAA,CACA,qBAAA,CAGC,iFACC,UAAA,CACA,wCAAA,CAIF,2DACC,6CAAA,CACA,wJAAA,CAGD,kLACC,gCAAA,CAGD,yDACC,+BAAA,CACA,6CAAA,CAID,sHAEC,UAAA,CAID,qEACC,UAAA,CAGD,0KAIC,6EAAA,CAID,uDACC,UAAA,CAGD,8DACC,YAAA,CAIA,yFAEC,wBAAA",sourcesContent:["\n.background-selector {\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tjustify-content: center;\n\n\t.background {\n\t\toverflow: hidden;\n\t\twidth: 176px;\n\t\theight: 96px;\n\t\tmargin: 8px;\n\t\ttext-align: center;\n\t\tborder: 2px solid var(--color-main-background);\n\t\tborder-radius: var(--border-radius-large);\n\t\tbackground-position: center center;\n\t\tbackground-size: cover;\n\n\t\t&__filepicker {\n\t\t\t&.background--active {\n\t\t\t\tcolor: white;\n\t\t\t\tbackground-image: var(--image-background);\n\t\t\t}\n\t\t}\n\n\t\t&__default {\n\t\t\tbackground-color: var(--color-primary-default);\n\t\t\tbackground-image: linear-gradient(to bottom, rgba(23, 23, 23, 0.5), rgba(23, 23, 23, 0.5)), var(--image-background-plain, var(--image-background-default));\n\t\t}\n\n\t\t&__filepicker, &__default, &__color {\n\t\t\tborder-color: var(--color-border);\n\t\t}\n\n\t\t&__color {\n\t\t\tcolor: var(--color-primary-text);\n\t\t\tbackground-color: var(--color-primary-default);\n\t\t}\n\n\t\t// Over a background image\n\t\t&__default,\n\t\t&__shipped {\n\t\t\tcolor: white;\n\t\t}\n\n\t\t// Text and svg icon dark on bright background\n\t\t&[data-color-bright] {\n\t\t\tcolor: black;\n\t\t}\n\n\t\t&--active,\n\t\t&:hover,\n\t\t&:focus {\n\t\t\t// Use theme color primary, see inline css variable in template\n\t\t\tborder: 2px solid var(--border-color, var(--color-primary-element)) !important;\n\t\t}\n\n\t\t// Icon\n\t\tspan {\n\t\t\tmargin: 4px;\n\t\t}\n\n\t\t.check-icon {\n\t\t\tdisplay: none;\n\t\t}\n\n\t\t&--active:not(.icon-loading) {\n\t\t\t.check-icon {\n\t\t\t\t// Show checkmark\n\t\t\t\tdisplay: block !important;\n\t\t\t}\n\t\t}\n\t}\n}\n\n"],sourceRoot:""}]),e.Z=a},22465:function(t,e,r){"use strict";var n=r(87537),o=r.n(n),i=r(23645),a=r.n(i)()(o());a.push([t.id,".theming__preview[data-v-1a08e35a]{--ratio: 16;position:relative;display:flex;justify-content:flex-start;max-width:800px}.theming__preview[data-v-1a08e35a],.theming__preview *[data-v-1a08e35a]{user-select:none}.theming__preview-image[data-v-1a08e35a]{flex-basis:calc(16px*var(--ratio));flex-shrink:0;height:calc(10px*var(--ratio));margin-right:var(--gap);cursor:pointer;border-radius:var(--border-radius);background-repeat:no-repeat;background-position:top left;background-size:cover}.theming__preview-explanation[data-v-1a08e35a]{margin-bottom:10px}.theming__preview-description[data-v-1a08e35a]{display:flex;flex-direction:column}.theming__preview-description h3[data-v-1a08e35a]{font-weight:bold;margin-bottom:0}.theming__preview-description label[data-v-1a08e35a]{padding:12px 0}.theming__preview--default[data-v-1a08e35a]{grid-column:span 2}.theming__preview-warning[data-v-1a08e35a]{color:var(--color-warning)}@media(max-width: 682.6666666667px){.theming__preview[data-v-1a08e35a]{flex-direction:column}.theming__preview-image[data-v-1a08e35a]{margin:0}}","",{version:3,sources:["webpack://./apps/theming/src/components/ItemPreview.vue"],names:[],mappings:"AAGA,mCAEC,WAAA,CAEA,iBAAA,CACA,YAAA,CACA,0BAAA,CACA,eAAA,CAEA,wEAEC,gBAAA,CAGD,yCACC,kCAAA,CACA,aAAA,CACA,8BAAA,CACA,uBAAA,CACA,cAAA,CACA,kCAAA,CACA,2BAAA,CACA,4BAAA,CACA,qBAAA,CAGD,+CACC,kBAAA,CAGD,+CACC,YAAA,CACA,qBAAA,CAEA,kDACC,gBAAA,CACA,eAAA,CAGD,qDACC,cAAA,CAIF,4CACC,kBAAA,CAGD,2CACC,0BAAA,CAIF,oCACC,mCACC,qBAAA,CAEA,yCACC,QAAA,CAAA",sourcesContent:["\n@use 'sass:math';\n\n.theming__preview {\n\t// We make previews on 16/10 screens\n\t--ratio: 16;\n\n\tposition: relative;\n\tdisplay: flex;\n\tjustify-content: flex-start;\n\tmax-width: 800px;\n\n\t&,\n\t* {\n\t\tuser-select: none;\n\t}\n\n\t&-image {\n\t\tflex-basis: calc(16px * var(--ratio));\n\t\tflex-shrink: 0;\n\t\theight: calc(10px * var(--ratio));\n\t\tmargin-right: var(--gap);\n\t\tcursor: pointer;\n\t\tborder-radius: var(--border-radius);\n\t\tbackground-repeat: no-repeat;\n\t\tbackground-position: top left;\n\t\tbackground-size: cover;\n\t}\n\n\t&-explanation {\n\t\tmargin-bottom: 10px;\n\t}\n\n\t&-description {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\n\t\th3 {\n\t\t\tfont-weight: bold;\n\t\t\tmargin-bottom: 0;\n\t\t}\n\n\t\tlabel {\n\t\t\tpadding: 12px 0;\n\t\t}\n\t}\n\n\t&--default {\n\t\tgrid-column: span 2;\n\t}\n\n\t&-warning {\n\t\tcolor: var(--color-warning);\n\t}\n}\n\n@media (max-width: math.div(1024px, 1.5)) {\n\t.theming__preview {\n\t\tflex-direction: column;\n\n\t\t&-image {\n\t\t\tmargin: 0;\n\t\t}\n\t}\n}\n\n"],sourceRoot:""}]),e.Z=a},89881:function(t,e,r){var n=r(47816),o=r(99291)(n);t.exports=o},80760:function(t,e,r){var n=r(89881);t.exports=function(t,e){var r=[];return n(t,(function(t,n,o){e(t,n,o)&&r.push(t)})),r}},47816:function(t,e,r){var n=r(28483),o=r(3674);t.exports=function(t,e){return t&&n(t,e,o)}},99291:function(t,e,r){var n=r(98612);t.exports=function(t,e){return function(r,o){if(null==r)return r;if(!n(r))return t(r,o);for(var i=r.length,a=e?i:-1,u=Object(r);(e?a--:++a<i)&&!1!==o(u[a],a,u););return r}}},91747:function(t,e,r){var n=r(5976),o=r(77813),i=r(16612),a=r(81704),u=Object.prototype,c=u.hasOwnProperty,s=n((function(t,e){t=Object(t);var r=-1,n=e.length,s=n>2?e[2]:void 0;for(s&&i(e[0],e[1],s)&&(n=1);++r<n;)for(var l=e[r],d=a(l),f=-1,h=d.length;++f<h;){var p=d[f],g=t[p];(void 0===g||o(g,u[p])&&!c.call(t,p))&&(t[p]=l[p])}return t}));t.exports=s},63105:function(t,e,r){var n=r(34963),o=r(80760),i=r(67206),a=r(1469);t.exports=function(t,e){return(a(t)?n:o)(t,i(e,3))}},1082:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},o=n(r(8110)),i=n(r(21904));o.default.DefaultOpts.ImageClass=i.default,t.exports=o.default},31564:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=n(r(8110)),i=r(66678),a=function(){function t(t,e){void 0===e&&(e={}),this._src=t,this._opts=e,this._opts.filters=i(o.default.DefaultOpts.filters)}return t.prototype.maxColorCount=function(t){return this._opts.colorCount=t,this},t.prototype.maxDimension=function(t){return this._opts.maxDimension=t,this},t.prototype.addFilter=function(t){return this._opts.filters.push(t),this},t.prototype.removeFilter=function(t){var e=this._opts.filters.indexOf(t);return e>0&&this._opts.filters.splice(e),this},t.prototype.clearFilters=function(){return this._opts.filters=[],this},t.prototype.quality=function(t){return this._opts.quality=t,this},t.prototype.useImageClass=function(t){return this._opts.ImageClass=t,this},t.prototype.useGenerator=function(t){return this._opts.generator=t,this},t.prototype.useQuantizer=function(t){return this._opts.quantizer=t,this},t.prototype.build=function(){return new o.default(this._src,this._opts)},t.prototype.getPalette=function(t){return this.build().getPalette(t)},t.prototype.getSwatches=function(t){return this.build().getPalette(t)},t}();e.default=a},97248:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Swatch=void 0;var n=r(67294),o=r(63105),i=function(){function t(t,e){this._rgb=t,this._population=e}return t.applyFilter=function(t,e){return"function"==typeof e?o(t,(function(t){var r=t.r,n=t.g,o=t.b;return e(r,n,o,255)})):t},Object.defineProperty(t.prototype,"r",{get:function(){return this._rgb[0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"g",{get:function(){return this._rgb[1]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this._rgb[2]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgb",{get:function(){return this._rgb},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hsl",{get:function(){if(!this._hsl){var t=this._rgb,e=t[0],r=t[1],o=t[2];this._hsl=n.rgbToHsl(e,r,o)}return this._hsl},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hex",{get:function(){if(!this._hex){var t=this._rgb,e=t[0],r=t[1],o=t[2];this._hex=n.rgbToHex(e,r,o)}return this._hex},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"population",{get:function(){return this._population},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){return{rgb:this.rgb,population:this.population}},t.prototype.getRgb=function(){return this._rgb},t.prototype.getHsl=function(){return this.hsl},t.prototype.getPopulation=function(){return this._population},t.prototype.getHex=function(){return this.hex},t.prototype.getYiq=function(){if(!this._yiq){var t=this._rgb;this._yiq=(299*t[0]+587*t[1]+114*t[2])/1e3}return this._yiq},Object.defineProperty(t.prototype,"titleTextColor",{get:function(){return this._titleTextColor||(this._titleTextColor=this.getYiq()<200?"#fff":"#000"),this._titleTextColor},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bodyTextColor",{get:function(){return this._bodyTextColor||(this._bodyTextColor=this.getYiq()<150?"#fff":"#000"),this._bodyTextColor},enumerable:!1,configurable:!0}),t.prototype.getTitleTextColor=function(){return this.titleTextColor},t.prototype.getBodyTextColor=function(){return this.bodyTextColor},t}();e.Swatch=i},68498:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e,r,n){return n>=125&&!(t>250&&e>250&&r>250)}},63096:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.combineFilters=void 0;var n=r(68498);Object.defineProperty(e,"Default",{enumerable:!0,get:function(){return n.default}}),e.combineFilters=function(t){return Array.isArray(t)&&0!==t.length?function(e,r,n,o){if(0===o)return!1;for(var i=0;i<t.length;i++)if(!t[i](e,r,n,o))return!1;return!0}:null}},73977:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(97248),o=r(67294),i=r(91747),a={targetDarkLuma:.26,maxDarkLuma:.45,minLightLuma:.55,targetLightLuma:.74,minNormalLuma:.3,targetNormalLuma:.5,maxNormalLuma:.7,targetMutesSaturation:.3,maxMutesSaturation:.4,targetVibrantSaturation:1,minVibrantSaturation:.35,weightSaturation:3,weightLuma:6.5,weightPopulation:.5};function u(t,e,r,n,o,i,a,u,c,s){var l=null,d=0;return e.forEach((function(e){var f=e.getHsl(),h=f[1],p=f[2];if(h>=u&&h<=c&&p>=o&&p<=i&&!function(t,e){return t.Vibrant===e||t.DarkVibrant===e||t.LightVibrant===e||t.Muted===e||t.DarkMuted===e||t.LightMuted===e}(t,e)){var g=function(t,e,r,n,o,i,a){function u(t,e){return 1-Math.abs(t-e)}return function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=0,n=0,o=0;o<t.length;o+=2){var i=t[o],a=t[o+1];r+=i*a,n+=a}return r/n}(u(t,e),a.weightSaturation,u(r,n),a.weightLuma,o/i,a.weightPopulation)}(h,a,p,n,e.getPopulation(),r,s);(null===l||g>d)&&(l=e,d=g)}})),l}e.default=function(t,e){e=i({},e,a);var r=function(t){var e=0;return t.forEach((function(t){e=Math.max(e,t.getPopulation())})),e}(t),c=function(t,e,r){var n={};return n.Vibrant=u(n,t,e,r.targetNormalLuma,r.minNormalLuma,r.maxNormalLuma,r.targetVibrantSaturation,r.minVibrantSaturation,1,r),n.LightVibrant=u(n,t,e,r.targetLightLuma,r.minLightLuma,1,r.targetVibrantSaturation,r.minVibrantSaturation,1,r),n.DarkVibrant=u(n,t,e,r.targetDarkLuma,0,r.maxDarkLuma,r.targetVibrantSaturation,r.minVibrantSaturation,1,r),n.Muted=u(n,t,e,r.targetNormalLuma,r.minNormalLuma,r.maxNormalLuma,r.targetMutesSaturation,0,r.maxMutesSaturation,r),n.LightMuted=u(n,t,e,r.targetLightLuma,r.minLightLuma,1,r.targetMutesSaturation,0,r.maxMutesSaturation,r),n.DarkMuted=u(n,t,e,r.targetDarkLuma,0,r.maxDarkLuma,r.targetMutesSaturation,0,r.maxMutesSaturation,r),n}(t,r,e);return function(t,e,r){if(null===t.Vibrant&&null===t.DarkVibrant&&null===t.LightVibrant){if(null===t.DarkVibrant&&null!==t.DarkMuted){var i=t.DarkMuted.getHsl(),a=i[0],u=i[1],c=i[2];c=r.targetDarkLuma,t.DarkVibrant=new n.Swatch(o.hslToRgb(a,u,c),0)}if(null===t.LightVibrant&&null!==t.LightMuted){var s=t.LightMuted.getHsl();a=s[0],u=s[1],c=s[2],c=r.targetDarkLuma,t.DarkVibrant=new n.Swatch(o.hslToRgb(a,u,c),0)}}if(null===t.Vibrant&&null!==t.DarkVibrant){var l=t.DarkVibrant.getHsl();a=l[0],u=l[1],c=l[2],c=r.targetNormalLuma,t.Vibrant=new n.Swatch(o.hslToRgb(a,u,c),0)}else if(null===t.Vibrant&&null!==t.LightVibrant){var d=t.LightVibrant.getHsl();a=d[0],u=d[1],c=d[2],c=r.targetNormalLuma,t.Vibrant=new n.Swatch(o.hslToRgb(a,u,c),0)}if(null===t.DarkVibrant&&null!==t.Vibrant){var f=t.Vibrant.getHsl();a=f[0],u=f[1],c=f[2],c=r.targetDarkLuma,t.DarkVibrant=new n.Swatch(o.hslToRgb(a,u,c),0)}if(null===t.LightVibrant&&null!==t.Vibrant){var h=t.Vibrant.getHsl();a=h[0],u=h[1],c=h[2],c=r.targetLightLuma,t.LightVibrant=new n.Swatch(o.hslToRgb(a,u,c),0)}if(null===t.Muted&&null!==t.Vibrant){var p=t.Vibrant.getHsl();a=p[0],u=p[1],c=p[2],c=r.targetMutesSaturation,t.Muted=new n.Swatch(o.hslToRgb(a,u,c),0)}if(null===t.DarkMuted&&null!==t.DarkVibrant){var g=t.DarkVibrant.getHsl();a=g[0],u=g[1],c=g[2],c=r.targetMutesSaturation,t.DarkMuted=new n.Swatch(o.hslToRgb(a,u,c),0)}if(null===t.LightMuted&&null!==t.LightVibrant){var m=t.LightVibrant.getHsl();a=m[0],u=m[1],c=m[2],c=r.targetMutesSaturation,t.LightMuted=new n.Swatch(o.hslToRgb(a,u,c),0)}}(c,0,e),c}},77234:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(73977);Object.defineProperty(e,"Default",{enumerable:!0,get:function(){return n.default}})},83614:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ImageBase=void 0;var r=function(){function t(){}return t.prototype.scaleDown=function(t){var e=this.getWidth(),r=this.getHeight(),n=1;if(t.maxDimension>0){var o=Math.max(e,r);o>t.maxDimension&&(n=t.maxDimension/o)}else n=1/t.quality;n<1&&this.resize(e*n,r*n,n)},t.prototype.applyFilter=function(t){var e=this.getImageData();if("function"==typeof t)for(var r=e.data,n=r.length/4,o=void 0,i=0;i<n;i++)t(r[0+(o=4*i)],r[o+1],r[o+2],r[o+3])||(r[o+3]=0);return Promise.resolve(e)},t}();e.ImageBase=r},21904:function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},n(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),a=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),u=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&i(e,t,r);return a(e,t),e};Object.defineProperty(e,"__esModule",{value:!0});var c=r(83614),s=u(r(8575)),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype._initCanvas=function(){var t=this.image,e=this._canvas=document.createElement("canvas"),r=this._context=e.getContext("2d");e.className="vibrant-canvas",e.style.display="none",this._width=e.width=t.width,this._height=e.height=t.height,r.drawImage(t,0,0),document.body.appendChild(e)},e.prototype.load=function(t){var e,r,n,o,i,a,u=this,c=null,l=null;if("string"==typeof t)c=document.createElement("img"),i=t,null===(a=s.parse(i)).protocol&&null===a.host&&null===a.port||(e=window.location.href,r=t,n=s.parse(e),o=s.parse(r),n.protocol===o.protocol&&n.hostname===o.hostname&&n.port===o.port)||(c.crossOrigin="anonymous"),l=c.src=t;else{if(!(t instanceof HTMLImageElement))return Promise.reject(new Error("Cannot load buffer as an image in browser"));c=t,l=t.src}return this.image=c,new Promise((function(t,e){var r=function(){u._initCanvas(),t(u)};c.complete?r():(c.onload=r,c.onerror=function(t){return e(new Error("Fail to load image: "+l))})}))},e.prototype.clear=function(){this._context.clearRect(0,0,this._width,this._height)},e.prototype.update=function(t){this._context.putImageData(t,0,0)},e.prototype.getWidth=function(){return this._width},e.prototype.getHeight=function(){return this._height},e.prototype.resize=function(t,e,r){var n=this,o=n._canvas,i=n._context,a=n.image;this._width=o.width=t,this._height=o.height=e,i.scale(r,r),i.drawImage(a,0,0)},e.prototype.getPixelCount=function(){return this._width*this._height},e.prototype.getImageData=function(){return this._context.getImageData(0,0,this._width,this._height)},e.prototype.remove=function(){this._canvas&&this._canvas.parentNode&&this._canvas.parentNode.removeChild(this._canvas)},e}(c.ImageBase);e.default=l},14853:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WebWorker=void 0;var n=r(20628);Object.defineProperty(e,"MMCQ",{enumerable:!0,get:function(){return n.default}}),e.WebWorker=null},20628:function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=r(97248),i=n(r(5828)),a=n(r(37514));function u(t,e){for(var r=t.size();t.size()<e;){var n=t.pop();if(!(n&&n.count()>0))break;var o=n.split(),i=o[0],a=o[1];if(t.push(i),a&&a.count()>0&&t.push(a),t.size()===r)break;r=t.size()}}e.default=function(t,e){if(0===t.length||e.colorCount<2||e.colorCount>256)throw new Error("Wrong MMCQ parameters");var r=i.default.build(t),n=r.hist,c=(Object.keys(n).length,new a.default((function(t,e){return t.count()-e.count()})));c.push(r),u(c,.75*e.colorCount);var s=new a.default((function(t,e){return t.count()*t.volume()-e.count()*e.volume()}));return s.contents=c.contents,u(s,e.colorCount-s.size()),function(t){for(var e=[];t.size();){var r=t.pop(),n=r.avg();n[0],n[1],n[2],e.push(new o.Swatch(n,r.count()))}return e}(s)}},37514:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t){this._comparator=t,this.contents=[],this._sorted=!1}return t.prototype._sort=function(){this._sorted||(this.contents.sort(this._comparator),this._sorted=!0)},t.prototype.push=function(t){this.contents.push(t),this._sorted=!1},t.prototype.peek=function(t){return this._sort(),t="number"==typeof t?t:this.contents.length-1,this.contents[t]},t.prototype.pop=function(){return this._sort(),this.contents.pop()},t.prototype.size=function(){return this.contents.length},t.prototype.map=function(t){return this._sort(),this.contents.map(t)},t}();e.default=r},5828:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(67294),o=function(){function t(t,e,r,n,o,i,a){this._volume=-1,this._count=-1,this.dimension={r1:t,r2:e,g1:r,g2:n,b1:o,b2:i},this.hist=a}return t.build=function(e,r){var o,i,a,u,c,s,l,d,f,h=1<<3*n.SIGBITS,p=new Uint32Array(h);o=a=c=0,i=u=s=Number.MAX_VALUE;for(var g=e.length/4,m=0;m<g;){var v=4*m;m++,l=e[v+0],d=e[v+1],f=e[v+2],0!==e[v+3]&&(l>>=n.RSHIFT,d>>=n.RSHIFT,f>>=n.RSHIFT,p[n.getColorIndex(l,d,f)]+=1,l>o&&(o=l),l<i&&(i=l),d>a&&(a=d),d<u&&(u=d),f>c&&(c=f),f<s&&(s=f))}return new t(i,o,u,a,s,c,p)},t.prototype.invalidate=function(){this._volume=this._count=-1,this._avg=null},t.prototype.volume=function(){if(this._volume<0){var t=this.dimension,e=t.r1,r=t.r2,n=t.g1,o=t.g2,i=t.b1,a=t.b2;this._volume=(r-e+1)*(o-n+1)*(a-i+1)}return this._volume},t.prototype.count=function(){if(this._count<0){for(var t=this.hist,e=this.dimension,r=e.r1,o=e.r2,i=e.g1,a=e.g2,u=e.b1,c=e.b2,s=0,l=r;l<=o;l++)for(var d=i;d<=a;d++)for(var f=u;f<=c;f++)s+=t[n.getColorIndex(l,d,f)];this._count=s}return this._count},t.prototype.clone=function(){var e=this.hist,r=this.dimension;return new t(r.r1,r.r2,r.g1,r.g2,r.b1,r.b2,e)},t.prototype.avg=function(){if(!this._avg){var t=this.hist,e=this.dimension,r=e.r1,o=e.r2,i=e.g1,a=e.g2,u=e.b1,c=e.b2,s=0,l=1<<8-n.SIGBITS,d=void 0,f=void 0,h=void 0;d=f=h=0;for(var p=r;p<=o;p++)for(var g=i;g<=a;g++)for(var m=u;m<=c;m++){var v=t[n.getColorIndex(p,g,m)];s+=v,d+=v*(p+.5)*l,f+=v*(g+.5)*l,h+=v*(m+.5)*l}this._avg=s?[~~(d/s),~~(f/s),~~(h/s)]:[~~(l*(r+o+1)/2),~~(l*(i+a+1)/2),~~(l*(u+c+1)/2)]}return this._avg},t.prototype.contains=function(t){var e=t[0],r=t[1],o=t[2],i=this.dimension,a=i.r1,u=i.r2,c=i.g1,s=i.g2,l=i.b1,d=i.b2;return e>>=n.RSHIFT,r>>=n.RSHIFT,o>>=n.RSHIFT,e>=a&&e<=u&&r>=c&&r<=s&&o>=l&&o<=d},t.prototype.split=function(){var t=this.hist,e=this.dimension,r=e.r1,o=e.r2,i=e.g1,a=e.g2,u=e.b1,c=e.b2,s=this.count();if(!s)return[];if(1===s)return[this.clone()];var l,d,f=o-r+1,h=a-i+1,p=c-u+1,g=Math.max(f,h,p),m=null;l=d=0;var v=null;if(g===f){v="r",m=new Uint32Array(o+1);for(var b=r;b<=o;b++){l=0;for(var y=i;y<=a;y++)for(var A=u;A<=c;A++)l+=t[n.getColorIndex(b,y,A)];d+=l,m[b]=d}}else if(g===h)for(v="g",m=new Uint32Array(a+1),y=i;y<=a;y++){for(l=0,b=r;b<=o;b++)for(A=u;A<=c;A++)l+=t[n.getColorIndex(b,y,A)];d+=l,m[y]=d}else for(v="b",m=new Uint32Array(c+1),A=u;A<=c;A++){for(l=0,b=r;b<=o;b++)for(y=i;y<=a;y++)l+=t[n.getColorIndex(b,y,A)];d+=l,m[A]=d}for(var _=-1,w=new Uint32Array(m.length),k=0;k<m.length;k++){var C=m[k];_<0&&C>d/2&&(_=k),w[k]=d-C}var x=this;return function(t){var e=t+"1",r=t+"2",n=x.dimension[e],o=x.dimension[r],i=x.clone(),a=x.clone(),u=_-n,c=o-_;for(u<=c?(o=Math.min(o-1,~~(_+c/2)),o=Math.max(0,o)):(o=Math.max(n,~~(_-1-u/2)),o=Math.min(x.dimension[r],o));!m[o];)o++;for(var s=w[o];!s&&m[o-1];)s=w[--o];return i.dimension[r]=o,a.dimension[e]=o+1,[i,a]}(v)},t}();e.default=o},67294:function(t,e){"use strict";function r(t){var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return null===e?null:[e[1],e[2],e[3]].map((function(t){return parseInt(t,16)}))}function n(t,e,r){return e/=255,r/=255,t=(t/=255)>.04045?Math.pow((t+.005)/1.055,2.4):t/12.92,e=e>.04045?Math.pow((e+.005)/1.055,2.4):e/12.92,r=r>.04045?Math.pow((r+.005)/1.055,2.4):r/12.92,[.4124*(t*=100)+.3576*(e*=100)+.1805*(r*=100),.2126*t+.7152*e+.0722*r,.0193*t+.1192*e+.9505*r]}function o(t,e,r){return e/=100,r/=108.883,t=(t/=95.047)>.008856?Math.pow(t,1/3):7.787*t+16/116,[116*(e=e>.008856?Math.pow(e,1/3):7.787*e+16/116)-16,500*(t-e),200*(e-(r=r>.008856?Math.pow(r,1/3):7.787*r+16/116))]}function i(t,e,r){var i=n(t,e,r);return o(i[0],i[1],i[2])}function a(t,e){var r=t[0],n=t[1],o=t[2],i=e[0],a=e[1],u=e[2],c=r-i,s=n-a,l=o-u,d=Math.sqrt(n*n+o*o),f=i-r,h=Math.sqrt(a*a+u*u)-d,p=Math.sqrt(c*c+s*s+l*l),g=Math.sqrt(p)>Math.sqrt(Math.abs(f))+Math.sqrt(Math.abs(h))?Math.sqrt(p*p-f*f-h*h):0;return f/=1,h/=1*(1+.045*d),g/=1*(1+.015*d),Math.sqrt(f*f+h*h+g*g)}function u(t,e){return a(i.apply(void 0,t),i.apply(void 0,e))}Object.defineProperty(e,"__esModule",{value:!0}),e.getColorIndex=e.getColorDiffStatus=e.hexDiff=e.rgbDiff=e.deltaE94=e.rgbToCIELab=e.xyzToCIELab=e.rgbToXyz=e.hslToRgb=e.rgbToHsl=e.rgbToHex=e.hexToRgb=e.defer=e.RSHIFT=e.SIGBITS=e.DELTAE94_DIFF_STATUS=void 0,e.DELTAE94_DIFF_STATUS={NA:0,PERFECT:1,CLOSE:2,GOOD:10,SIMILAR:50},e.SIGBITS=5,e.RSHIFT=8-e.SIGBITS,e.defer=function(){var t,e,r=new Promise((function(r,n){t=r,e=n}));return{resolve:t,reject:e,promise:r}},e.hexToRgb=r,e.rgbToHex=function(t,e,r){return"#"+((1<<24)+(t<<16)+(e<<8)+r).toString(16).slice(1,7)},e.rgbToHsl=function(t,e,r){t/=255,e/=255,r/=255;var n,o,i=Math.max(t,e,r),a=Math.min(t,e,r),u=(i+a)/2;if(i===a)n=o=0;else{var c=i-a;switch(o=u>.5?c/(2-i-a):c/(i+a),i){case t:n=(e-r)/c+(e<r?6:0);break;case e:n=(r-t)/c+2;break;case r:n=(t-e)/c+4}n/=6}return[n,o,u]},e.hslToRgb=function(t,e,r){var n,o,i;function a(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}if(0===e)n=o=i=r;else{var u=r<.5?r*(1+e):r+e-r*e,c=2*r-u;n=a(c,u,t+1/3),o=a(c,u,t),i=a(c,u,t-1/3)}return[255*n,255*o,255*i]},e.rgbToXyz=n,e.xyzToCIELab=o,e.rgbToCIELab=i,e.deltaE94=a,e.rgbDiff=u,e.hexDiff=function(t,e){return u(r(t),r(e))},e.getColorDiffStatus=function(t){return t<e.DELTAE94_DIFF_STATUS.NA?"N/A":t<=e.DELTAE94_DIFF_STATUS.PERFECT?"Perfect":t<=e.DELTAE94_DIFF_STATUS.CLOSE?"Close":t<=e.DELTAE94_DIFF_STATUS.GOOD?"Good":t<e.DELTAE94_DIFF_STATUS.SIMILAR?"Similar":"Wrong"},e.getColorIndex=function(t,r,n){return(t<<2*e.SIGBITS)+(r<<e.SIGBITS)+n}},8110:function(t,e,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)"default"!==r&&Object.hasOwnProperty.call(t,r)&&n(e,t,r);return o(e,t),e},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var u=r(97248),c=a(r(31564)),s=i(r(67294)),l=i(r(14853)),d=i(r(77234)),f=i(r(63096)),h=r(91747),p=function(){function t(e,r){this._src=e,this.opts=h({},r,t.DefaultOpts),this.opts.combinedFilter=f.combineFilters(this.opts.filters)}return t.from=function(t){return new c.default(t)},t.prototype._process=function(t,e){var r=e.quantizer,n=e.generator;return t.scaleDown(e),t.applyFilter(e.combinedFilter).then((function(t){return r(t.data,e)})).then((function(t){return u.Swatch.applyFilter(t,e.combinedFilter)})).then((function(t){return Promise.resolve(n(t))}))},t.prototype.palette=function(){return this.swatches()},t.prototype.swatches=function(){return this._palette},t.prototype.getPalette=function(t){var e=this,r=new this.opts.ImageClass,n=r.load(this._src).then((function(t){return e._process(t,e.opts)})).then((function(t){return e._palette=t,r.remove(),t}),(function(t){throw r.remove(),t}));return t&&n.then((function(e){return t(null,e)}),(function(e){return t(e)})),n},t.Builder=c.default,t.Quantizer=l,t.Generator=d,t.Filter=f,t.Util=s,t.Swatch=u.Swatch,t.DefaultOpts={colorCount:64,quality:5,generator:d.Default,ImageClass:null,quantizer:l.MMCQ,filters:[f.Default]},t}();e.default=p},24654:function(){}},i={};function a(t){var e=i[t];if(void 0!==e)return e.exports;var r=i[t]={id:t,loaded:!1,exports:{}};return o[t].call(r.exports,r,r.exports,a),r.loaded=!0,r.exports}a.m=o,e=[],a.O=function(t,r,n,o){if(!r){var i=1/0;for(l=0;l<e.length;l++){r=e[l][0],n=e[l][1],o=e[l][2];for(var u=!0,c=0;c<r.length;c++)(!1&o||i>=o)&&Object.keys(a.O).every((function(t){return a.O[t](r[c])}))?r.splice(c--,1):(u=!1,o<i&&(i=o));if(u){e.splice(l--,1);var s=n();void 0!==s&&(t=s)}}return t}o=o||0;for(var l=e.length;l>0&&e[l-1][2]>o;l--)e[l]=e[l-1];e[l]=[r,n,o]},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,{a:e}),e},a.d=function(t,e){for(var r in e)a.o(e,r)&&!a.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},a.f={},a.e=function(t){return Promise.all(Object.keys(a.f).reduce((function(e,r){return a.f[r](t,e),e}),[]))},a.u=function(t){return t+"-"+t+".js?v=9712b63e6d8aa316e55f"},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r={},n="nextcloud:",a.l=function(t,e,o,i){if(r[t])r[t].push(e);else{var u,c;if(void 0!==o)for(var s=document.getElementsByTagName("script"),l=0;l<s.length;l++){var d=s[l];if(d.getAttribute("src")==t||d.getAttribute("data-webpack")==n+o){u=d;break}}u||(c=!0,(u=document.createElement("script")).charset="utf-8",u.timeout=120,a.nc&&u.setAttribute("nonce",a.nc),u.setAttribute("data-webpack",n+o),u.src=t),r[t]=[e];var f=function(e,n){u.onerror=u.onload=null,clearTimeout(h);var o=r[t];if(delete r[t],u.parentNode&&u.parentNode.removeChild(u),o&&o.forEach((function(t){return t(n)})),e)return e(n)},h=setTimeout(f.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=f.bind(null,u.onerror),u.onload=f.bind(null,u.onload),c&&document.head.appendChild(u)}},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.nmd=function(t){return t.paths=[],t.children||(t.children=[]),t},a.j=1474,function(){var t;a.g.importScripts&&(t=a.g.location+"");var e=a.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&!t;)t=r[n--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=t}(),function(){a.b=document.baseURI||self.location.href;var t={1474:0};a.f.j=function(e,r){var n=a.o(t,e)?t[e]:void 0;if(0!==n)if(n)r.push(n[2]);else{var o=new Promise((function(r,o){n=t[e]=[r,o]}));r.push(n[2]=o);var i=a.p+a.u(e),u=new Error;a.l(i,(function(r){if(a.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var o=r&&("load"===r.type?"missing":r.type),i=r&&r.target&&r.target.src;u.message="Loading chunk "+e+" failed.\n("+o+": "+i+")",u.name="ChunkLoadError",u.type=o,u.request=i,n[1](u)}}),"chunk-"+e,e)}},a.O.j=function(e){return 0===t[e]};var e=function(e,r){var n,o,i=r[0],u=r[1],c=r[2],s=0;if(i.some((function(e){return 0!==t[e]}))){for(n in u)a.o(u,n)&&(a.m[n]=u[n]);if(c)var l=c(a)}for(e&&e(r);s<i.length;s++)o=i[s],a.o(t,o)&&t[o]&&t[o][0](),t[o]=0;return a.O(l)},r=self.webpackChunknextcloud=self.webpackChunknextcloud||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))}(),a.nc=void 0;var u=a.O(void 0,[7874],(function(){return a(21613)}));u=a.O(u)}();
  3. //# sourceMappingURL=theming-personal-theming.js.map?v=618efccae579905b9d61