/*! For license information please see theming-theming-settings.js.LICENSE.txt */ !function(){"use strict";var n,e={1222:function(n,e,r){var a=r(20144),o=r(79753),i=r(16453),c=r(4820),s=r(20571),u=r.n(s),d=r(13299),l=r.n(d),g=r(15168),p=r.n(g),h=function(n){return(0,o.generateFilePath)("theming","","img/background/")+n},m=function(n){var e,t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=(null===(e=window.OCA)||void 0===e||null===(t=e.Theming)||void 0===t?void 0:t.enabledThemes)||[],c=0===i.length||"default"===i[0]?window.matchMedia("(prefers-color-scheme: dark)").matches:-1!==i.join("").indexOf("dark");return"default"===n?a&&"backgroundColor"!==a?(0,o.generateUrl)("/apps/theming/image/background")+"?v="+window.OCA.Theming.cacheBuster:h(c?"eduardo-neves-pedra-azul.jpg":"kamil-porembinski-clouds.jpg"):"custom"===n?(0,o.generateUrl)("/apps/theming/background")+"?v="+r:h(n)};function A(n,e,t,r,a,o,i){try{var c=n[o](i),s=c.value}catch(n){return void t(n)}c.done?e(s):Promise.resolve(s).then(r,a)}function f(n){return function(){var e=this,t=arguments;return new Promise((function(r,a){var o=n.apply(e,t);function i(n){A(o,r,a,i,c,"next",n)}function c(n){A(o,r,a,i,c,"throw",n)}i(void 0)}))}}var b=(0,i.loadState)("theming","shippedBackgrounds"),v={name:"BackgroundSettings",directives:{Tooltip:p()},props:{background:{type:String,default:"default"},themingDefaultBackground:{type:String,default:""}},data:function(){return{backgroundImage:(0,o.generateUrl)("/apps/theming/background")+"?v="+Date.now(),loading:!1}},computed:{shippedBackgrounds:function(){return Object.keys(b).map((function(n){return{name:n,url:h(n),preview:h("preview/"+n),details:b[n]}}))}},methods:{update:function(n){var e=this;return f(regeneratorRuntime.mark((function t(){var r,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r="custom"===n.type||"default"===n.type?n.type:n.value,e.backgroundImage=m(r,n.version,e.themingDefaultBackground),"color"!==n.type&&("default"!==n.type||"backgroundColor"!==e.themingDefaultBackground)){t.next=6;break}return e.$emit("update:background",n),e.loading=!1,t.abrupt("return");case 6:(a=new Image).onload=function(){e.$emit("update:background",n),e.loading=!1},a.src=e.backgroundImage;case 9:case"end":return t.stop()}}),t)})))()},setDefault:function(){var n=this;return f(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.loading="default",e.next=3,c.default.post((0,o.generateUrl)("/apps/theming/background/default"));case 3:t=e.sent,n.update(t.data);case 5:case"end":return e.stop()}}),e)})))()},setShipped:function(n){var e=this;return f(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.loading=n,t.next=3,c.default.post((0,o.generateUrl)("/apps/theming/background/shipped"),{value:n});case 3:r=t.sent,e.update(r.data);case 5:case"end":return t.stop()}}),t)})))()},setFile:function(n){var e=this;return f(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.loading="custom",t.next=3,c.default.post((0,o.generateUrl)("/apps/theming/background/custom"),{value:n});case 3:r=t.sent,e.update(r.data);case 5:case"end":return t.stop()}}),t)})))()},pickColor:function(){var n=this;return f(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.loading="color",t=OCA&&OCA.Theming?OCA.Theming.color:"#0082c9",e.next=4,c.default.post((0,o.generateUrl)("/apps/theming/background/color"),{value:t});case 4:r=e.sent,n.update(r.data);case 6:case"end":return e.stop()}}),e)})))()},pickFile:function(){var n=this;window.OC.dialogs.filepicker(t("theming","Insert from {productName}",{productName:OC.theme.name}),(function(e,t){t===OC.dialogs.FILEPICKER_TYPE_CHOOSE&&n.setFile(e)}),!1,["image/png","image/gif","image/jpeg","image/svg"],!0,OC.dialogs.FILEPICKER_TYPE_CHOOSE)}}},k=v,C=r(93379),y=r.n(C),w=r(7795),_=r.n(w),x=r(90569),S=r.n(x),B=r(3565),I=r.n(B),T=r(19216),E=r.n(T),O=r(44589),P=r.n(O),D=r(33470),j={};j.styleTagTransform=P(),j.setAttributes=I(),j.insert=S().bind(null,"head"),j.domAPI=_(),j.insertStyleElement=E(),y()(D.Z,j),D.Z&&D.Z.locals&&D.Z.locals;var R=r(51900),q=(0,R.Z)(k,(function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("div",{staticClass:"background-selector"},[t("button",{staticClass:"background filepicker",class:{active:"custom"===n.background},attrs:{tabindex:"0"},on:{click:n.pickFile}},[n._v("\n\t\t"+n._s(n.t("theming","Pick from Files"))+"\n\t")]),n._v(" "),t("button",{staticClass:"background default",class:{"icon-loading":"default"===n.loading,active:"default"===n.background},attrs:{tabindex:"0"},on:{click:n.setDefault}},[n._v("\n\t\t"+n._s(n.t("theming","Default image"))+"\n\t")]),n._v(" "),t("button",{staticClass:"background color",class:{active:"custom"===n.background},attrs:{tabindex:"0"},on:{click:n.pickColor}},[n._v("\n\t\t"+n._s(n.t("theming","Plain background"))+"\n\t")]),n._v(" "),n._l(n.shippedBackgrounds,(function(e){return t("button",{directives:[{name:"tooltip",rawName:"v-tooltip",value:e.details.attribution,expression:"shippedBackground.details.attribution"}],key:e.name,staticClass:"background",class:{"icon-loading":n.loading===e.name,active:n.background===e.name},style:{"background-image":"url("+e.preview+")"},attrs:{tabindex:"0"},on:{click:function(t){return n.setShipped(e.name)}}})}))],2)}),[],!1,null,"50307d02",null).exports,Z={name:"ItemPreview",components:{NcCheckboxRadioSwitch:u()},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,o.generateFilePath)("theming","img",this.theme.id+".jpg")},checked:{get:function(){return this.selected},set:function(n){console.debug("Changed theme",this.theme.id,n),this.unique?this.$emit("change",{enabled:!0===n,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}}},U=r(83005),F={};F.styleTagTransform=P(),F.setAttributes=I(),F.insert=S().bind(null,"head"),F.domAPI=_(),F.insertStyleElement=E(),y()(U.Z,F),U.Z&&U.Z.locals&&U.Z.locals;var L=(0,R.Z)(Z,(function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("div",{staticClass:"theming__preview",class:"theming__preview--"+n.theme.id},[t("div",{staticClass:"theming__preview-image",style:{backgroundImage:"url("+n.img+")"},on:{click:n.onToggle}}),n._v(" "),t("div",{staticClass:"theming__preview-description"},[t("h3",[n._v(n._s(n.theme.title))]),n._v(" "),t("p",[n._v(n._s(n.theme.description))]),n._v(" "),n.enforced?t("span",{staticClass:"theming__preview-warning",attrs:{role:"note"}},[n._v("\n\t\t\t"+n._s(n.t("theming","Theme selection is enforced"))+"\n\t\t")]):n._e(),n._v(" "),t("NcCheckboxRadioSwitch",{staticClass:"theming__preview-toggle",attrs:{checked:n.checked,disabled:n.enforced,name:n.name,type:n.switchType},on:{"update:checked":function(e){n.checked=e}}},[n._v("\n\t\t\t"+n._s(n.theme.enableLabel)+"\n\t\t")])],1)])}),[],!1,null,"37ca8ab2",null).exports;function G(n){return function(n){if(Array.isArray(n))return N(n)}(n)||function(n){if("undefined"!=typeof Symbol&&null!=n[Symbol.iterator]||null!=n["@@iterator"])return Array.from(n)}(n)||function(n,e){if(n){if("string"==typeof n)return N(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);return"Object"===t&&n.constructor&&(t=n.constructor.name),"Map"===t||"Set"===t?Array.from(n):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?N(n,e):void 0}}(n)||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 N(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t")},guidelinesLink:function(){return''},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,"")},issuetrackerLink:function(){return''},designteamLink:function(){return''}},mounted:function(){this.updateGlobalStyles()},watch:{shortcutsDisabled:function(n){this.changeShortcutsDisabled(n)}},methods:{updateBackground:function(n){this.background="custom"===n.type||"default"===n.type?n.type:n.value,this.updateGlobalStyles()},updateGlobalStyles:function(){var n;"dark"===(null===(n=J[this.background])||void 0===n?void 0:n.theming)?(document.querySelector("#header").style.setProperty("--primary-invert-if-bright","invert(100%)"),document.querySelector("#header").style.setProperty("--color-primary-text","#000000")):(document.querySelector("#header").style.setProperty("--primary-invert-if-bright","no"),document.querySelector("#header").style.setProperty("--color-primary-text","#ffffff"));for(var e=0,t=[document.documentElement,document.querySelector("#header"),document.querySelector("body")];e=o)&&Object.keys(a.O).every((function(n){return a.O[n](t[s])}))?t.splice(s--,1):(c=!1,o0&&n[d-1][2]>o;d--)n[d]=n[d-1];n[d]=[t,r,o]},a.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return a.d(e,{a:e}),e},a.d=function(n,e){for(var t in e)a.o(e,t)&&!a.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:e[t]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(n){if("object"==typeof window)return window}}(),a.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},a.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},a.nmd=function(n){return n.paths=[],n.children||(n.children=[]),n},a.j=6755,function(){a.b=document.baseURI||self.location.href;var n={6755:0};a.O.j=function(e){return 0===n[e]};var e=function(e,t){var r,o,i=t[0],c=t[1],s=t[2],u=0;if(i.some((function(e){return 0!==n[e]}))){for(r in c)a.o(c,r)&&(a.m[r]=c[r]);if(s)var d=s(a)}for(e&&e(t);u