nextcloud/dist/files-sidebar.js
Ferdinand Thiessen 98a4b959ec
chore: compile assets
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2026-01-05 02:23:41 +01:00

2 lines
No EOL
16 KiB
JavaScript

(()=>{var e,r={63779(){},77199(){},85322(e,r,i){"use strict";var t,n,s,o,a=i(10810),E=i(61338),l=i(44013),c=i(380),u=i(20005),d=(i(53334),i(65606));function h(){if(n)return t;n=1;const e="object"==typeof d&&d.env&&d.env.NODE_DEBUG&&/\bsemver\b/i.test(d.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};return t=e}function p(){if(o)return s;o=1;const e=Number.MAX_SAFE_INTEGER||9007199254740991;return s={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:e,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}var f,I,R,v,w,N,L,O,A,m,$,T,b,S={exports:{}};function _(){if(L)return N;L=1;const e=h(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:i}=p(),{safeRe:t,t:n}=(f||(f=1,function(e,r){const{MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_BUILD_LENGTH:t,MAX_LENGTH:n}=p(),s=h(),o=(r=e.exports={}).re=[],a=r.safeRe=[],E=r.src=[],l=r.safeSrc=[],c=r.t={};let u=0;const d="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",n],[d,t]],I=(e,r,i)=>{const t=(e=>{for(const[r,i]of f)e=e.split(`${r}*`).join(`${r}{0,${i}}`).split(`${r}+`).join(`${r}{1,${i}}`);return e})(r),n=u++;s(e,n,r),c[e]=n,E[n]=r,l[n]=t,o[n]=new RegExp(r,i?"g":void 0),a[n]=new RegExp(t,i?"g":void 0)};I("NUMERICIDENTIFIER","0|[1-9]\\d*"),I("NUMERICIDENTIFIERLOOSE","\\d+"),I("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),I("MAINVERSION",`(${E[c.NUMERICIDENTIFIER]})\\.(${E[c.NUMERICIDENTIFIER]})\\.(${E[c.NUMERICIDENTIFIER]})`),I("MAINVERSIONLOOSE",`(${E[c.NUMERICIDENTIFIERLOOSE]})\\.(${E[c.NUMERICIDENTIFIERLOOSE]})\\.(${E[c.NUMERICIDENTIFIERLOOSE]})`),I("PRERELEASEIDENTIFIER",`(?:${E[c.NONNUMERICIDENTIFIER]}|${E[c.NUMERICIDENTIFIER]})`),I("PRERELEASEIDENTIFIERLOOSE",`(?:${E[c.NONNUMERICIDENTIFIER]}|${E[c.NUMERICIDENTIFIERLOOSE]})`),I("PRERELEASE",`(?:-(${E[c.PRERELEASEIDENTIFIER]}(?:\\.${E[c.PRERELEASEIDENTIFIER]})*))`),I("PRERELEASELOOSE",`(?:-?(${E[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${E[c.PRERELEASEIDENTIFIERLOOSE]})*))`),I("BUILDIDENTIFIER",`${d}+`),I("BUILD",`(?:\\+(${E[c.BUILDIDENTIFIER]}(?:\\.${E[c.BUILDIDENTIFIER]})*))`),I("FULLPLAIN",`v?${E[c.MAINVERSION]}${E[c.PRERELEASE]}?${E[c.BUILD]}?`),I("FULL",`^${E[c.FULLPLAIN]}$`),I("LOOSEPLAIN",`[v=\\s]*${E[c.MAINVERSIONLOOSE]}${E[c.PRERELEASELOOSE]}?${E[c.BUILD]}?`),I("LOOSE",`^${E[c.LOOSEPLAIN]}$`),I("GTLT","((?:<|>)?=?)"),I("XRANGEIDENTIFIERLOOSE",`${E[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),I("XRANGEIDENTIFIER",`${E[c.NUMERICIDENTIFIER]}|x|X|\\*`),I("XRANGEPLAIN",`[v=\\s]*(${E[c.XRANGEIDENTIFIER]})(?:\\.(${E[c.XRANGEIDENTIFIER]})(?:\\.(${E[c.XRANGEIDENTIFIER]})(?:${E[c.PRERELEASE]})?${E[c.BUILD]}?)?)?`),I("XRANGEPLAINLOOSE",`[v=\\s]*(${E[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${E[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${E[c.XRANGEIDENTIFIERLOOSE]})(?:${E[c.PRERELEASELOOSE]})?${E[c.BUILD]}?)?)?`),I("XRANGE",`^${E[c.GTLT]}\\s*${E[c.XRANGEPLAIN]}$`),I("XRANGELOOSE",`^${E[c.GTLT]}\\s*${E[c.XRANGEPLAINLOOSE]}$`),I("COERCEPLAIN",`(^|[^\\d])(\\d{1,${i}})(?:\\.(\\d{1,${i}}))?(?:\\.(\\d{1,${i}}))?`),I("COERCE",`${E[c.COERCEPLAIN]}(?:$|[^\\d])`),I("COERCEFULL",E[c.COERCEPLAIN]+`(?:${E[c.PRERELEASE]})?(?:${E[c.BUILD]})?(?:$|[^\\d])`),I("COERCERTL",E[c.COERCE],!0),I("COERCERTLFULL",E[c.COERCEFULL],!0),I("LONETILDE","(?:~>?)"),I("TILDETRIM",`(\\s*)${E[c.LONETILDE]}\\s+`,!0),r.tildeTrimReplace="$1~",I("TILDE",`^${E[c.LONETILDE]}${E[c.XRANGEPLAIN]}$`),I("TILDELOOSE",`^${E[c.LONETILDE]}${E[c.XRANGEPLAINLOOSE]}$`),I("LONECARET","(?:\\^)"),I("CARETTRIM",`(\\s*)${E[c.LONECARET]}\\s+`,!0),r.caretTrimReplace="$1^",I("CARET",`^${E[c.LONECARET]}${E[c.XRANGEPLAIN]}$`),I("CARETLOOSE",`^${E[c.LONECARET]}${E[c.XRANGEPLAINLOOSE]}$`),I("COMPARATORLOOSE",`^${E[c.GTLT]}\\s*(${E[c.LOOSEPLAIN]})$|^$`),I("COMPARATOR",`^${E[c.GTLT]}\\s*(${E[c.FULLPLAIN]})$|^$`),I("COMPARATORTRIM",`(\\s*)${E[c.GTLT]}\\s*(${E[c.LOOSEPLAIN]}|${E[c.XRANGEPLAIN]})`,!0),r.comparatorTrimReplace="$1$2$3",I("HYPHENRANGE",`^\\s*(${E[c.XRANGEPLAIN]})\\s+-\\s+(${E[c.XRANGEPLAIN]})\\s*$`),I("HYPHENRANGELOOSE",`^\\s*(${E[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${E[c.XRANGEPLAINLOOSE]})\\s*$`),I("STAR","(<|>)?=?\\s*\\*"),I("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),I("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(S,S.exports)),S.exports),s=function(){if(R)return I;R=1;const e=Object.freeze({loose:!0}),r=Object.freeze({});return I=i=>i?"object"!=typeof i?e:i:r}(),{compareIdentifiers:o}=function(){if(w)return v;w=1;const e=/^[0-9]+$/,r=(r,i)=>{if("number"==typeof r&&"number"==typeof i)return r===i?0:r<i?-1:1;const t=e.test(r),n=e.test(i);return t&&n&&(r=+r,i=+i),r===i?0:t&&!n?-1:n&&!t?1:r<i?-1:1};return v={compareIdentifiers:r,rcompareIdentifiers:(e,i)=>r(i,e)}}();class a{constructor(o,E){if(E=s(E),o instanceof a){if(o.loose===!!E.loose&&o.includePrerelease===!!E.includePrerelease)return o;o=o.version}else if("string"!=typeof o)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof o}".`);if(o.length>r)throw new TypeError(`version is longer than ${r} characters`);e("SemVer",o,E),this.options=E,this.loose=!!E.loose,this.includePrerelease=!!E.includePrerelease;const l=o.trim().match(E.loose?t[n.LOOSE]:t[n.FULL]);if(!l)throw new TypeError(`Invalid Version: ${o}`);if(this.raw=o,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>i||this.major<0)throw new TypeError("Invalid major version");if(this.minor>i||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>i||this.patch<0)throw new TypeError("Invalid patch version");l[4]?this.prerelease=l[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const r=+e;if(r>=0&&r<i)return r}return e}):this.prerelease=[],this.build=l[5]?l[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(r){if(e("SemVer.compare",this.version,this.options,r),!(r instanceof a)){if("string"==typeof r&&r===this.version)return 0;r=new a(r,this.options)}return r.version===this.version?0:this.compareMain(r)||this.comparePre(r)}compareMain(e){return e instanceof a||(e=new a(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(r){if(r instanceof a||(r=new a(r,this.options)),this.prerelease.length&&!r.prerelease.length)return-1;if(!this.prerelease.length&&r.prerelease.length)return 1;if(!this.prerelease.length&&!r.prerelease.length)return 0;let i=0;do{const t=this.prerelease[i],n=r.prerelease[i];if(e("prerelease compare",i,t,n),void 0===t&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===t)return-1;if(t!==n)return o(t,n)}while(++i)}compareBuild(r){r instanceof a||(r=new a(r,this.options));let i=0;do{const t=this.build[i],n=r.build[i];if(e("build compare",i,t,n),void 0===t&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===t)return-1;if(t!==n)return o(t,n)}while(++i)}inc(e,r,i){if(e.startsWith("pre")){if(!r&&!1===i)throw new Error("invalid increment argument: identifier is empty");if(r){const e=`-${r}`.match(this.options.loose?t[n.PRERELEASELOOSE]:t[n.PRERELEASE]);if(!e||e[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,i);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,i);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,i),this.inc("pre",r,i);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",r,i),this.inc("pre",r,i);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(i)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let t=this.prerelease.length;for(;--t>=0;)"number"==typeof this.prerelease[t]&&(this.prerelease[t]++,t=-2);if(-1===t){if(r===this.prerelease.join(".")&&!1===i)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(r){let t=[r,e];!1===i&&(t=[r]),0===o(this.prerelease[0],r)?isNaN(this.prerelease[1])&&(this.prerelease=t):this.prerelease=t}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return N=a}function g(e,r,i){if(void 0!==e[r])if("array"===i){if(!Array.isArray(e[r]))throw new Error(`View ${r} must be an array`)}else{if(typeof e[r]!==i)throw new Error(`View ${r} must be a ${i}`);if("object"===i&&(null===e[r]||Array.isArray(e[r])))throw new Error(`View ${r} must be an object`)}}function C(e){if("object"!=typeof e||null===e)throw new Error("View column must be an object");if(!e.id||"string"!=typeof e.id)throw new Error("A column id is required");if(!e.title||"string"!=typeof e.title)throw new Error("A column title is required");if(!e.render||"function"!=typeof e.render)throw new Error("A render function is required");g(e,"sort","function"),g(e,"summary","function")}!function(){if(A)return O;A=1;const e=_();O=(r,i)=>new e(r,i).major}(),function(){if(b)return T;b=1;const e=function(){if($)return m;$=1;const e=_();return m=(r,i,t=!1)=>{if(r instanceof e)return r;try{return new e(r,i)}catch(e){if(!t)return null;throw e}}}();T=(r,i)=>{const t=e(r,i);return t?t.version:null}}(),c.m;class P extends c.m{_views=[];_currentView=null;register(e){if(this._views.find(r=>r.id===e.id))throw new Error(`IView id ${e.id} is already registered`);(function(e){if(!e.icon||"string"!=typeof e.icon||!(0,u.A)(e.icon))throw new Error("View icon is required and must be a valid svg string");if(!e.id||"string"!=typeof e.id)throw new Error("View id is required and must be a string");if(!e.getContents||"function"!=typeof e.getContents)throw new Error("View getContents is required and must be a function");if(!e.name||"string"!=typeof e.name)throw new Error("View name is required and must be a string");if(g(e,"caption","string"),g(e,"columns","array"),g(e,"defaultSortKey","string"),g(e,"emptyCaption","string"),g(e,"emptyTitle","string"),g(e,"emptyView","function"),g(e,"expanded","boolean"),g(e,"hidden","boolean"),g(e,"loadChildViews","function"),g(e,"order","number"),g(e,"params","object"),g(e,"parent","string"),g(e,"sticky","boolean"),e.columns&&(e.columns.forEach(C),e.columns.reduce((e,r)=>e.add(r.id),new Set).size!==e.columns.length))throw new Error("View columns must have unique ids")})(e),this._views.push(e),this.dispatchTypedEvent("update",new CustomEvent("update"))}remove(e){const r=this._views.findIndex(r=>r.id===e);-1!==r&&(this._views.splice(r,1),this.dispatchTypedEvent("update",new CustomEvent("update")))}setActive(e){if(null===e)this._currentView=null;else{const r=this._views.find(({id:r})=>r===e);if(!r)throw new Error(`No view with ${e} registered`);this._currentView=r}const r=new CustomEvent("updateActive",{detail:this._currentView});this.dispatchTypedEvent("updateActive",r)}get active(){return this._currentView}get views(){return this._views}}Error;var F=i(85471);const y=(0,i(35947).YK)().setApp("files").detectUser().build(),D=(0,a.nY)("active",()=>{const e=(0,F.KR)(),r=(0,F.KR)(),i=(0,F.KR)(),t=(0,F.KR)();function n(e){i.value&&i.value.source===e.source&&(i.value=void 0)}function s(e=null){y.debug("Setting active view",{view:e}),t.value=e??void 0,i.value=void 0}return function(){const e=(void 0===window._nc_navigation&&(window._nc_navigation=new P,l.l.debug("Navigation service initialized")),window._nc_navigation);(0,E.B1)("files:node:deleted",n),s(e.active),e.addEventListener("updateActive",e=>{s(e.detail)})}(),{activeAction:e,activeFolder:r,activeNode:i,activeView:t}}),G=(0,a.nY)("sidebar",()=>{const e=(0,F.KR)(),r=(0,F.KR)(),i=(0,F.EW)(()=>!!r.value),t=D(),n=(0,F.EW)(()=>!!(r.value&&t.activeFolder&&t.activeView)),s=(0,F.EW)(()=>{if(n.value)return{node:r.value,folder:t.activeFolder,view:t.activeView}}),o=(0,F.EW)(()=>s.value?u(s.value):[]),a=(0,F.EW)(()=>s.value?c(s.value):[]);function l(){r.value=void 0}function c(e){let r=window._nc_files_sidebar_tabs?[...window._nc_files_sidebar_tabs.values()]:[];return e&&(r=r.filter(r=>r.enabled(e))),r.sort((e,r)=>e.order-r.order)}function u(e){let r=window._nc_files_sidebar_actions?[...window._nc_files_sidebar_actions.values()]:[];return e&&(r=r.filter(r=>r.enabled(e))),r.sort((e,r)=>e.order-r.order)}(0,E.B1)("files:node:updated",e=>{e.source===r.value?.source&&(r.value=e)}),(0,E.B1)("files:node:deleted",e=>{e.fileid===r.value?.fileid&&l()});let d=!1;return(0,E.B1)("files:list:updated",()=>{d||(d=!0,window.OCP.Files.Router._router.afterEach(e=>{e.query&&!("opendetails"in e.query)&&l()}))}),(0,F.wB)(r,e=>{const r={...window.OCP?.Files?.Router?.query??{}};if(!e&&"opendetails"in r&&(delete r.opendetails,window.OCP.Files.Router.goToRoute(null,{...window.OCP.Files.Router.params},{...r},!0)),e){const i=String(e.fileid);"opendetails"in r&&window.OCP.Files.Router.params.fileid===i||window.OCP.Files.Router.goToRoute(null,{...window.OCP.Files.Router.params,fileid:i},{...r,opendetails:"true"},!0)}}),{activeTab:e,currentActions:o,currentContext:s,currentNode:r,currentTabs:a,hasContext:n,isOpen:i,open:function(i,t){const n=D();if(!(i&&n.activeFolder&&n.activeView))throw y.debug("Cannot open sidebar because the active folder or view is not set.",{node:i,activeFolder:n.activeFolder,activeView:n.activeView}),new Error("Cannot open sidebar because the active folder or view is not set.");const s=c({node:i,folder:n.activeFolder,view:n.activeView});t&&!s.find(({id:e})=>e===t)?(y.warn(`Cannot open sidebar tab '${t}' because it is not available for the current context.`),e.value=s[0]?.id):e.value=t??s[0]?.id,r.value=i},close:l,getActions:u,getTabs:c,setActiveTab:function(r){if(!a.value.find(({id:e})=>e===r))throw new Error(`Cannot set sidebar tab '${r}' because it is not available for the current context.`);e.value=r}}});window.OCA.Files??={},window.OCA.Files._sidebar=()=>G((window._nc_files_pinia||(window._nc_files_pinia=(0,a.Ey)()),window._nc_files_pinia))}},i={};function t(e){var n=i[e];if(void 0!==n)return n.exports;var s=i[e]={id:e,loaded:!1,exports:{}};return r[e].call(s.exports,s,s.exports,t),s.loaded=!0,s.exports}t.m=r,e=[],t.O=(r,i,n,s)=>{if(!i){var o=1/0;for(c=0;c<e.length;c++){for(var[i,n,s]=e[c],a=!0,E=0;E<i.length;E++)(!1&s||o>=s)&&Object.keys(t.O).every(e=>t.O[e](i[E]))?i.splice(E--,1):(a=!1,s<o&&(o=s));if(a){e.splice(c--,1);var l=n();void 0!==l&&(r=l)}}return r}s=s||0;for(var c=e.length;c>0&&e[c-1][2]>s;c--)e[c]=e[c-1];e[c]=[i,n,s]},t.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},t.d=(e,r)=>{for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},t.e=()=>Promise.resolve(),t.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),t.j=4763,(()=>{t.b="undefined"!=typeof document&&document.baseURI||self.location.href;var e={4763:0};t.O.j=r=>0===e[r];var r=(r,i)=>{var n,s,[o,a,E]=i,l=0;if(o.some(r=>0!==e[r])){for(n in a)t.o(a,n)&&(t.m[n]=a[n]);if(E)var c=E(t)}for(r&&r(i);l<o.length;l++)s=o[l],t.o(e,s)&&e[s]&&e[s][0](),e[s]=0;return t.O(c)},i=globalThis.webpackChunknextcloud_ui_legacy=globalThis.webpackChunknextcloud_ui_legacy||[];i.forEach(r.bind(null,0)),i.push=r.bind(null,i.push.bind(i))})(),t.nc=void 0;var n=t.O(void 0,[4208],()=>t(85322));n=t.O(n)})();
//# sourceMappingURL=files-sidebar.js.map?v=340efcd4c3a2c7dc2ee8