1 (self.webpackChunkpleroma_fe=self.webpackChunkpleroma_fe||[]).push([[5948],{25771:(e,t,r)=>{"use strict";r.d(t,{M:()=>i,i:()=>a});var n=r(57458),o=r.n(n),i=function(e){var t=e.filename,r=void 0===t?"data":t,n=e.getExportedObject;return{exportData:function(){var e=o().encode(JSON.stringify(n(),null,2)),t=document.createElement("a");t.setAttribute("download","".concat(r,".json")),t.setAttribute("href","data:application/json;base64,"+window.btoa(e)),t.style.display="none",document.body.appendChild(t),t.click(),document.body.removeChild(t)}}},a=function(e){var t=e.onImport,r=e.onImportFailure,n=e.validator,o=void 0===n?function(){return!0}:n;return{importData:function(){var e=document.createElement("input");e.setAttribute("type","file"),e.setAttribute("accept",".json"),e.addEventListener("change",(function(e){if(e.target.files[0]){var n=new FileReader;n.onload=function(e){var n=e.target;try{var i=JSON.parse(n.result),a=o(i);!0===a?t(i):r({validationResult:a})}catch(e){r({error:e})}},n.readAsText(e.target.files[0])}})),document.body.appendChild(e),e.click(),document.body.removeChild(e)}}}},57458:(e,t)=>{!function(e){var t,r,n,o=String.fromCharCode;function i(e){for(var t,r,n=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(r=e.charCodeAt(o++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),o--):n.push(t);return n}function a(e){if(e>=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function s(e,t){return o(e>>t&63|128)}function c(e){if(0==(4294967168&e))return o(e);var t="";return 0==(4294965248&e)?t=o(e>>6&31|192):0==(4294901760&e)?(a(e),t=o(e>>12&15|224),t+=s(e,6)):0==(4292870144&e)&&(t=o(e>>18&7|240),t+=s(e,12),t+=s(e,6)),t+o(63&e|128)}function l(){if(n>=r)throw Error("Invalid byte index");var e=255&t[n];if(n++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function u(){var e,o;if(n>r)throw Error("Invalid byte index");if(n==r)return!1;if(e=255&t[n],n++,0==(128&e))return e;if(192==(224&e)){if((o=(31&e)<<6|l())>=128)return o;throw Error("Invalid continuation byte")}if(224==(240&e)){if((o=(15&e)<<12|l()<<6|l())>=2048)return a(o),o;throw Error("Invalid continuation byte")}if(240==(248&e)&&(o=(7&e)<<18|l()<<12|l()<<6|l())>=65536&&o<=1114111)return o;throw Error("Invalid UTF-8 detected")}e.version="3.0.0",e.encode=function(e){for(var t=i(e),r=t.length,n=-1,o="";++n<r;)o+=c(t[n]);return o},e.decode=function(e){t=i(e),r=t.length,n=0;for(var a,s=[];!1!==(a=u());)s.push(a);return function(e){for(var t,r=e.length,n=-1,i="";++n<r;)(t=e[n])>65535&&(i+=o((t-=65536)>>>10&1023|55296),t=56320|1023&t),i+=o(t);return i}(s)}}(t)},75948:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>L});var n=r(66252),o=r(3577),i=r(49963),a={class:"settings-modal-panel panel"},s={class:"panel-heading"},c={class:"title"},l=["title"],u=["title"],d={class:"panel-body"},p={class:"panel-footer settings-footer"},f=["title"],m={class:"dropdown-menu"},g=["onClick"],v=["onClick"],h=["onClick"],b=(0,n._)("span",{id:"unscrolled-content",class:"extra-content"},null,-1),_=r(4942),w=r(29439),y=r(50361),k=r.n(y),O=r(48328),x=r(29187),j={class:"async-component-error"};const C={emits:["resetAsyncComponent"],methods:{retry:function(){this.$emit("resetAsyncComponent")}}};var S=r(83744);const $=(0,S.Z)(C,[["render",function(e,t,r,i,a,s){return(0,n.wg)(),(0,n.iD)("div",j,[(0,n._)("div",null,[(0,n._)("h4",null,(0,o.zw)(e.$t("general.generic_error")),1),(0,n._)("p",null,(0,o.zw)(e.$t("general.error_retry")),1),(0,n._)("button",{class:"btn button-default",onClick:t[0]||(t[0]=function(){return s.retry&&s.retry.apply(s,arguments)})},(0,o.zw)(e.$t("general.retry")),1)])])}]]);var M=r(2262);function E(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}var P=r(91447),I=r(90350),A=r(9382),D=r(25771),z=r(84131),N=r(5737);function W(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function T(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?W(Object(r),!0).forEach((function(t){(0,_.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):W(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}A.vI.add(z.NBC,N.IQi,z.Y9i,z.kwI,z.ptq);const Z={data:function(){var e=this;return{dataImporter:(0,D.i)({validator:this.importValidator,onImport:this.onImport,onImportFailure:this.onImportFailure}),dataThemeExporter:(0,D.M)({filename:"pleromafe_settings.full",getExportedObject:function(){return e.generateExport(!0)}}),dataExporter:(0,D.M)({filename:"pleromafe_settings",getExportedObject:function(){return e.generateExport()}})}},components:{Modal:O.Z,Popover:P.default,Checkbox:I.Z,SettingsModalContent:(F=function(){return Promise.all([r.e(48),r.e(9114)]).then(r.bind(r,9114))},U={loadingComponent:x.Z,errorComponent:$,delay:0},K=function(){return function(){return(0,n.RC)(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?E(Object(r),!0).forEach((function(t){(0,_.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):E(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({loader:F},U))}},R=(0,M.Um)({c:K()}),{render:function(){return(0,n.h)(R.c(),{onResetAsyncComponent:function(){R.c=K()}})}})},methods:{closeModal:function(){this.$store.dispatch("closeSettingsModal")},peekModal:function(){this.$store.dispatch("togglePeekSettingsModal")},importValidator:function(e){if(!Array.isArray(e._pleroma_settings_version))return{messageKey:"settings.file_import_export.invalid_file"};var t=(0,w.Z)(e._pleroma_settings_version,2),r=t[0],n=t[1];return r>1?{messageKey:"settings.file_export_import.errors.file_too_new",messageArgs:{fileMajor:r,feMajor:1}}:r<1?{messageKey:"settings.file_export_import.errors.file_too_old",messageArgs:{fileMajor:r,feMajor:1}}:(n>0&&this.$store.dispatch("pushGlobalNotice",{level:"warning",messageKey:"settings.file_export_import.errors.file_slightly_new"}),!0)},onImportFailure:function(e){e.error?this.$store.dispatch("pushGlobalNotice",{messageKey:"settings.invalid_settings_imported",level:"error"}):this.$store.dispatch("pushGlobalNotice",T(T({},e.validationResult),{},{level:"error"}))},onImport:function(e){e&&this.$store.dispatch("loadSettings",e)},restore:function(){this.dataImporter.importData()},backup:function(){this.dataExporter.exportData()},backupWithTheme:function(){this.dataThemeExporter.exportData()},generateExport:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.$store.state.config,r=t;if(!e){var n=new Set(["customTheme","customThemeSource","colors"]);r=Object.fromEntries(Object.entries(r).filter((function(e){var t=(0,w.Z)(e,1)[0];return!n.has(t)})))}var o=k()(r);return o._pleroma_settings_version=[1,0],o}},computed:{currentSaveStateNotice:function(){return this.$store.state.interface.settings.currentSaveStateNotice},modalActivated:function(){return"hidden"!==this.$store.state.interface.settingsModalState},modalOpenedOnce:function(){return this.$store.state.interface.settingsModalLoaded},modalPeeked:function(){return"minimized"===this.$store.state.interface.settingsModalState},expertLevel:{get:function(){return this.$store.state.config.expertLevel>0},set:function(e){console.log(e),this.$store.dispatch("setOption",{name:"expertLevel",value:e?1:0})}}}},L=(0,S.Z)(Z,[["render",function(e,t,r,_,w,y){var k=(0,n.up)("FAIcon"),O=(0,n.up)("SettingsModalContent"),x=(0,n.up)("Popover"),j=(0,n.up)("Checkbox"),C=(0,n.up)("Modal");return(0,n.wg)(),(0,n.j4)(C,{"is-open":e.modalActivated,class:(0,o.C_)(["settings-modal",{peek:e.modalPeeked}]),"no-background":e.modalPeeked},{default:(0,n.w5)((function(){return[(0,n._)("div",a,[(0,n._)("div",s,[(0,n._)("span",c,(0,o.zw)(e.$t("settings.settings")),1),(0,n.Wm)(i.uT,{name:"fade"},{default:(0,n.w5)((function(){return[e.currentSaveStateNotice?((0,n.wg)(),(0,n.iD)("div",{key:0,class:(0,o.C_)(["alert",{transparent:!e.currentSaveStateNotice.error,error:e.currentSaveStateNotice.error}]),onClick:t[0]||(t[0]=(0,i.iM)((function(){}),["prevent"]))},(0,o.zw)(e.currentSaveStateNotice.error?e.$t("settings.saving_err"):e.$t("settings.saving_ok")),3)):(0,n.kq)("",!0)]})),_:1}),(0,n._)("button",{class:"btn button-default",title:e.$t("general.peek"),onClick:t[1]||(t[1]=function(){return e.peekModal&&e.peekModal.apply(e,arguments)})},[(0,n.Wm)(k,{icon:["far","window-minimize"],"fixed-width":""})],8,l),(0,n._)("button",{class:"btn button-default",title:e.$t("general.close"),onClick:t[2]||(t[2]=function(){return e.closeModal&&e.closeModal.apply(e,arguments)})},[(0,n.Wm)(k,{icon:"times","fixed-width":""})],8,u)]),(0,n._)("div",d,[e.modalOpenedOnce?((0,n.wg)(),(0,n.j4)(O,{key:0})):(0,n.kq)("",!0)]),(0,n._)("div",p,[(0,n.Wm)(x,{class:"export",trigger:"click",placement:"top",offset:{y:5,x:5},"bound-to":{x:"container"},"remove-padding":""},{trigger:(0,n.w5)((function(){return[(0,n._)("button",{class:"btn button-default",title:e.$t("general.close")},[(0,n._)("span",null,(0,o.zw)(e.$t("settings.file_export_import.backup_restore")),1),(0,n.Uk)(" "+(0,o.zw)(" ")+" "),(0,n.Wm)(k,{icon:"chevron-down"})],8,f)]})),content:(0,n.w5)((function(r){var a=r.close;return[(0,n._)("div",m,[(0,n._)("button",{class:"button-default dropdown-item dropdown-item-icon",onClick:[t[3]||(t[3]=(0,i.iM)((function(){return e.backup&&e.backup.apply(e,arguments)}),["prevent"])),a]},[(0,n.Wm)(k,{icon:"file-download","fixed-width":""}),(0,n._)("span",null,(0,o.zw)(e.$t("settings.file_export_import.backup_settings")),1)],8,g),(0,n._)("button",{class:"button-default dropdown-item dropdown-item-icon",onClick:[t[4]||(t[4]=(0,i.iM)((function(){return e.backupWithTheme&&e.backupWithTheme.apply(e,arguments)}),["prevent"])),a]},[(0,n.Wm)(k,{icon:"file-download","fixed-width":""}),(0,n._)("span",null,(0,o.zw)(e.$t("settings.file_export_import.backup_settings_theme")),1)],8,v),(0,n._)("button",{class:"button-default dropdown-item dropdown-item-icon",onClick:[t[5]||(t[5]=(0,i.iM)((function(){return e.restore&&e.restore.apply(e,arguments)}),["prevent"])),a]},[(0,n.Wm)(k,{icon:"file-upload","fixed-width":""}),(0,n._)("span",null,(0,o.zw)(e.$t("settings.file_export_import.restore_settings")),1)],8,h)])]})),_:1}),(0,n.Wm)(j,{"model-value":!!e.expertLevel,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.expertLevel=Number(t)})},{default:(0,n.w5)((function(){return[(0,n.Uk)((0,o.zw)(e.$t("settings.expert_mode")),1)]})),_:1},8,["model-value"]),b])])]})),_:1},8,["is-open","class","no-background"])}]]);var F,U,K,R}}]);