(()=>{var t,e,n,i={15340:()=>{},39656:(t,e,n)=>{"use strict";var i=n(21777),s=n(53334),a=n(85471),o=n(19051),r=n(85168),l=n(81222),c=n(63814),d=n(32073),u=n(88837),f=n(74095),p=n(16879),m=n(88289),g=n(31133),v=n(95101);const h=(0,n(35947).YK)().setApp("files").detectUser().build();var b;!function(t){t[t.Unknown=0]="Unknown",t[t.Scheduled=1]="Scheduled",t[t.Running=2]="Running",t[t.Done=3]="Done",t[t.Error=4]="Error"}(b||(b={}));const A=(0,a.pM)({__name:"SettingsSanitizeFilenames",setup(t){const{status:e}=(0,l.C)("files","filesCompatibilitySettings"),n=(0,a.KR)(!1),i=(0,a.KR)(10),d=(0,a.KR)(e.status),u=(0,a.KR)(e.processed),A=(0,a.KR)(e.total),S=(0,a.IJ)(e.errors||{}),y=(0,a.EW)(()=>u.value>0?Math.round(100*u.value/A.value):0),w=(0,a.EW)(()=>d.value===b.Scheduled||d.value===b.Running);return{__sfc:!0,initialStatus:e,loading:n,renameLimit:i,status:d,processedUsers:u,totalUsers:A,errors:S,progress:y,isRunning:w,startSanitization:async function(){if(!w.value)try{n.value=!0,await o.Ay.post((0,c.KT)("apps/files/api/v1/filenames/sanitization"),{limit:i.value}),d.value=b.Scheduled}catch(t){h.error("Failed to start filename sanitization.",{error:t}),(0,o.F0)(t)&&t.response?.data?.ocs?(0,r.Qg)(t.response.data.ocs.meta.message):(0,r.Qg)((0,s.t)("files","Failed to start filename sanitization."))}finally{n.value=!1}},refreshStatus:async function(){if(!n.value)try{n.value=!0;const{data:t}=await o.Ay.get((0,c.KT)("apps/files/api/v1/filenames/sanitization"));d.value=t.ocs.data.status,A.value=t.ocs.data.total,u.value=t.ocs.data.processed,S.value=t.ocs.data.errors||{}}catch(t){h.error("Failed to refresh filename sanitization status.",{error:t}),(0,r.Qg)((0,s.t)("files","Failed to refresh filename sanitization status."))}finally{n.value=!1}},t:s.t,NcButton:f.A,NcInputField:p.A,NcLoadingIcon:m.A,NcNoteCard:g.A,NcProgressBar:v.A,SanitizeFilenameStatus:b}}});var S=n(85072),y=n.n(S),w=n(97825),_=n.n(w),x=n(77659),C=n.n(x),N=n(55056),z=n.n(N),k=n(10540),F=n.n(k),R=n(41113),U=n.n(R),W=n(46549),E={};E.styleTagTransform=U(),E.setAttributes=z(),E.insert=C().bind(null,"head"),E.domAPI=_(),E.insertStyleElement=F(),y()(W.A,E),W.A&&W.A.locals&&W.A.locals;var P=n(14486);const O=(0,P.A)(A,function(){var t=this,e=t._self._c,n=t._self._setupProxy;return n.isRunning?e(n.NcNoteCard,[e("div",{staticClass:"sanitize-filenames__progress-container"},[e("p",[t._v("\n\t\t\t"+t._s(n.t("files","Filename sanitization in progress."))+"\n\t\t\t"),e("br"),t._v(" "),n.processedUsers>0?[t._v("\n\t\t\t\t"+t._s(n.t("files","Currently {processedUsers} of {totalUsers} accounts are already processed.",{processedUsers:n.processedUsers,totalUsers:n.totalUsers}))+"\n\t\t\t")]:[t._v("\n\t\t\t\t"+t._s(n.t("files","Preparing …"))+"\n\t\t\t")]],2),t._v(" "),e(n.NcProgressBar,{attrs:{value:n.progress,size:12}}),t._v(" "),e(n.NcButton,{attrs:{variant:"tertiary"},on:{click:n.refreshStatus},scopedSlots:t._u([n.loading?{key:"icon",fn:function(){return[e(n.NcLoadingIcon)]},proxy:!0}:null],null,!0)},[t._v("\n\t\t\t"+t._s(n.t("files","Refresh"))+"\n\t\t")])],1)]):n.status===n.SanitizeFilenameStatus.Done?e(n.NcNoteCard,{attrs:{type:"success"}},[t._v("\n\t"+t._s(n.t("files","All files have been santized for Windows filename support."))+"\n")]):e("form",{staticClass:"sanitize-filenames__form",attrs:{disabled:n.loading},on:{submit:function(t){return t.stopPropagation(),t.preventDefault(),n.startSanitization.apply(null,arguments)}}},[n.status===n.SanitizeFilenameStatus.Error?e(n.NcNoteCard,{attrs:{type:"error"}},[t._v("\n\t\t"+t._s(n.t("files","Some files could not be sanitized, please check your logs."))+"\n\t\t"),e("ul",{staticClass:"sanitize-filenames__errors",attrs:{"aria-label":n.t("files","Sanitization errors")}},t._l(Object.entries(n.errors),function([i,s]){return e("li",{key:i},[e("h4",[t._v(t._s(i)+":")]),t._v(" "),e("ul",{attrs:{"aria-label":n.t("files","Not sanitized filenames")}},t._l(s,function(n){return e("li",{key:n},[t._v("\n\t\t\t\t\t\t"+t._s(n)+"\n\t\t\t\t\t")])}),0)])}),0)]):t._e(),t._v(" "),e(n.NcNoteCard,[t._v("\n\t\t"+t._s(n.t("files","Windows filename support has been enabled."))+"\n\t\t"),e("br"),t._v("\n\t\t"+t._s(n.t("files","While this blocks users from creating new files with unsupported filenames, existing files are not yet renamed and thus still may break sync on Windows."))+"\n\t\t"+t._s(n.t("files","You can trigger a rename of files with invalid filenames, this will be done in the background and may take some time."))+"\n\t\t"+t._s(n.t("files","Please note that this may cause high workload on the sync clients."))+"\n\t")]),t._v(" "),e("fieldset",{staticClass:"sanitize-filenames__fields"},[e(n.NcInputField,{attrs:{label:n.t("files","Limit"),"helper-text":n.t("files","This allows to configure how many users should be processed in one background job run."),min:"1",type:"number"},model:{value:n.renameLimit,callback:function(t){n.renameLimit=t},expression:"renameLimit"}}),t._v(" "),e(n.NcButton,{attrs:{type:"submit",variant:"error"},scopedSlots:t._u([n.loading?{key:"icon",fn:function(){return[e(n.NcLoadingIcon)]},proxy:!0}:null],null,!0)},[t._v("\n\t\t\t"+t._s(n.t("files","Sanitize filenames"))+"\n\t\t\t"),n.loading?e("span",{staticClass:"hidden-visually"},[t._v("\n\t\t\t\t"+t._s(n.t("files","(starting)"))+"\n\t\t\t")]):t._e()])],1)],1)},[],!1,null,"3c9d3bfa",null).exports,B=(0,a.pM)({__name:"SettingsAdmin",setup(t){const{docUrl:e,isRunningSanitization:n,windowsSupport:i}=(0,l.C)("files","filesCompatibilitySettings"),f=(0,s.t)("files","Allow to restrict filenames to ensure files can be synced with all clients. By default all filenames valid on POSIX (e.g. Linux or macOS) are allowed.")+"\n"+(0,s.t)("files","After enabling the Windows compatible filenames, existing files cannot be modified anymore but can be renamed to valid new names by their owner."),p=(0,a.KR)(!1),m=(0,a.KR)(i);return{__sfc:!0,docUrl:e,isRunningSanitization:n,windowsSupport:i,description:f,loading:p,hasWindowsSupport:m,toggleWindowsFilenameSupport:async function(t){if(!p.value)try{p.value=!0,await o.Ay.post((0,c.KT)("apps/files/api/v1/filenames/windows-compatibility"),{enabled:t}),m.value=t}catch(t){(0,r.Qg)((0,s.t)("files","Failed to toggle Windows filename support")),h.error("Failed to toggle Windows filename support",{error:t})}finally{p.value=!1}},t:s.t,NcCheckboxRadioSwitch:d.A,NcSettingsSection:u.A,SettingsSanitizeFilenames:O}}});var L=n(48081),T={};T.styleTagTransform=U(),T.setAttributes=z(),T.insert=C().bind(null,"head"),T.domAPI=_(),T.insertStyleElement=F(),y()(L.A,T),L.A&&L.A.locals&&L.A.locals;const I=(0,P.A)(B,function(){var t=this,e=t._self._c,n=t._self._setupProxy;return e(n.NcSettingsSection,{attrs:{"doc-url":n.docUrl,name:n.t("files","Files compatibility"),description:n.description}},[e(n.NcCheckboxRadioSwitch,{attrs:{"model-value":n.hasWindowsSupport,disabled:n.isRunningSanitization,loading:n.loading,type:"switch"},on:{"update:model-value":n.toggleWindowsFilenameSupport}},[t._v("\n\t\t"+t._s(n.t("files","Enforce Windows compatibility"))+"\n\t")]),t._v(" "),e("p",{staticClass:"hint"},[t._v("\n\t\t"+t._s(n.t("files","This will block filenames not valid on Windows systems, like using reserved names or special characters. But this will not enforce compatibility of case sensitivity."))+"\n\t")]),t._v(" "),n.hasWindowsSupport?e(n.SettingsSanitizeFilenames):t._e()],1)},[],!1,null,"269e4f0c",null).exports;n.nc=(0,i.aV)(),a.Ay.prototype.t=s.t,(new(a.Ay.extend(I))).$mount("#files-admin-settings")},46549:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});var i=n(71354),s=n.n(i),a=n(76314),o=n.n(a)()(s());o.push([t.id,"\n.sanitize-filenames__progress-container[data-v-3c9d3bfa] {\n\talign-items: end;\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: var(--default-grid-baseline);\n}\n.sanitize-filenames__form[data-v-3c9d3bfa] {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: var(--default-grid-baseline);\n}\n.sanitize-filenames__fields[data-v-3c9d3bfa] {\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: var(--default-grid-baseline);\n\n\talign-items: end;\n\tmax-width: 400px;\n}\n","",{version:3,sources:["webpack://./apps/files/src/components/Settings/SettingsSanitizeFilenames.vue"],names:[],mappings:";AAkKA;CACA,gBAAA;CACA,aAAA;CACA,sBAAA;CACA,iCAAA;AACA;AAEA;CACA,aAAA;CACA,sBAAA;CACA,iCAAA;AACA;AAEA;CACA,aAAA;CACA,sBAAA;CACA,iCAAA;;CAEA,gBAAA;CACA,gBAAA;AACA",sourcesContent:["\x3c!--\n - SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n--\x3e\n\n