1
0

1762-1762.js 34 KB

12
  1. "use strict";(self.webpackChunknextcloud=self.webpackChunknextcloud||[]).push([[1762],{9165:(e,t,i)=>{i.d(t,{DvY:()=>a,NZC:()=>n,O1W:()=>l,ZL5:()=>r,fEr:()=>o});var l="M9,10H7V12H9V10M13,10H11V12H13V10M17,10H15V12H17V10M19,3H18V1H16V3H8V1H6V3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5A2,2 0 0,0 19,3M19,19H5V8H19V19Z",n="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M16.2,16.2L11,13V7H12.5V12.2L17,14.9L16.2,16.2Z",a="M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z",o="M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z",r="M12,17.27L18.18,21L16.54,13.97L22,9.24L14.81,8.62L12,2L9.19,8.62L2,9.24L7.45,13.97L5.82,21L12,17.27Z"},27518:e=>{e.exports="data:image/svg+xml,%3c%21--%20-%20SPDX-FileCopyrightText:%202020%20Google%20Inc.%20-%20SPDX-License-Identifier:%20Apache-2.0%20--%3e%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%2724%27%20height=%2724%27%20fill=%27%23222%27%3e%3cpath%20d=%27M15.4%2016.6L10.8%2012l4.6-4.6L14%206l-6%206%206%206%201.4-1.4z%27/%3e%3c/svg%3e"},27514:e=>{e.exports="data:image/svg+xml,%3c%21--%20-%20SPDX-FileCopyrightText:%202020%20Google%20Inc.%20-%20SPDX-License-Identifier:%20Apache-2.0%20--%3e%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%2724%27%20height=%2724%27%20fill=%27%23222%27%3e%3cpath%20d=%27M18.4%207.4L17%206l-6%206%206%206%201.4-1.4-4.6-4.6%204.6-4.6m-6%200L11%206l-6%206%206%206%201.4-1.4L7.8%2012l4.6-4.6z%27/%3e%3c/svg%3e"},79722:e=>{e.exports="data:image/svg+xml,%3c%21--%20-%20SPDX-FileCopyrightText:%202020%20Google%20Inc.%20-%20SPDX-License-Identifier:%20Apache-2.0%20--%3e%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%2724%27%20height=%2724%27%20fill=%27%23222%27%3e%3cpath%20d=%27M5.6%207.4L7%206l6%206-6%206-1.4-1.4%204.6-4.6-4.6-4.6m6%200L13%206l6%206-6%206-1.4-1.4%204.6-4.6-4.6-4.6z%27/%3e%3c/svg%3e"},86886:e=>{e.exports="data:image/svg+xml,%3c%21--%20-%20SPDX-FileCopyrightText:%202020%20Google%20Inc.%20-%20SPDX-License-Identifier:%20Apache-2.0%20--%3e%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20width=%2724%27%20height=%2724%27%20fill=%27%23222%27%3e%3cpath%20d=%27M8.6%2016.6l4.6-4.6-4.6-4.6L10%206l6%206-6%206-1.4-1.4z%27/%3e%3c/svg%3e"},11040:(e,t,i)=>{i.r(t),i.d(t,{default:()=>Ae});var l=i(85471),n=i(76887),a=i(35810),o=i(76333),r=i(32981),s=i(63814),c=i(82680);function u(e){return"function"==typeof e?e():(0,l.R1)(e)}function d(e){const t=Object.create(null);return i=>t[i]||(t[i]=e(i))}l.Ay.util.warn,i(96763),"undefined"!=typeof WorkerGlobalScope&&(globalThis,WorkerGlobalScope),Object.prototype.toString;const p=/\B([A-Z])/g,f=(d((e=>e.replace(p,"-$1").toLowerCase())),/-(\w)/g);d((e=>e.replace(f,((e,t)=>t?t.toUpperCase():""))));var v=i(65043),m=i(21777),g=i(54914),h=i(9165),w=i(61338),_=i(43627),y=i(36117),b=i(96763);const C={name:"FileIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var k=function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon file-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M13,9V3.5L18.5,9M6,2C4.89,2 4,2.89 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])},N=[];const S=(0,n.a)(C,k,N,!1,null,null,null,null).exports,F=()=>{var e,t,i;const a=(0,r.C)("files","config",null),o=(0,l.KR)(null==(e=null==a?void 0:a.show_hidden)||e),u=(0,l.KR)(null==(t=null==a?void 0:a.sort_favorites_first)||t),d=(0,l.KR)(null==(i=null==a?void 0:a.crop_image_previews)||i);return(0,l.sV)((async()=>{var e,t,i,l,a,r;if((0,c.f)())b.debug("Skip loading files settings - currently on public share");else try{const{data:n}=await v.Ay.get((0,s.Jv)("/apps/files/api/v1/configs"));o.value=null!=(t=null==(e=null==n?void 0:n.data)?void 0:e.show_hidden)&&t,u.value=null==(l=null==(i=null==n?void 0:n.data)?void 0:i.sort_favorites_first)||l,d.value=null==(r=null==(a=null==n?void 0:n.data)?void 0:a.crop_image_previews)||r}catch(e){b.error("Could not load files settings",e),(0,n.l)((0,n.t)("Could not load files settings"))}})),{showHiddenFiles:o,sortFavoritesFirst:u,cropImagePreviews:d}},x={name:"MenuUpIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var L=function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon menu-up-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M7,15L12,10L17,15H7Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])},A=[];const P=(0,n.a)(x,L,A,!1,null,null,null,null).exports,B={name:"MenuDownIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var V=function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon menu-down-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M7,10L12,15L17,10H7Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])},I=[];const z=(0,n.a)(B,V,I,!1,null,null,null,null).exports,H={"file-picker__file-icon":"_file-picker__file-icon_19mjt_9"},M=(0,l.pM)({__name:"LoadingTableRow",props:{showCheckbox:{type:Boolean}},setup:e=>({__sfc:!0,fileListIconStyles:H})});var E=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("tr",{staticClass:"file-picker__row loading-row",attrs:{"aria-hidden":"true"}},[e.showCheckbox?t("td",{staticClass:"row-checkbox"},[t("span")]):e._e(),t("td",{staticClass:"row-name"},[t("div",{staticClass:"row-wrapper"},[t("span",{class:i.fileListIconStyles["file-picker__file-icon"]}),t("span")])]),e._m(0),e._m(1)])},D=[function(){var e=this._self._c;return this._self._setupProxy,e("td",{staticClass:"row-size"},[e("span")])},function(){var e=this._self._c;return this._self._setupProxy,e("td",{staticClass:"row-modified"},[e("span")])}];const R=(0,n.a)(M,E,D,!1,null,"15187afc",null,null).exports,W={name:"FolderIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var K=function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon folder-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6H12L10,4Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])},$=[];const T=(0,n.a)(W,K,$,!1,null,null,null,null).exports,Z=(0,l.pM)({name:"FilePreview",props:{node:null,cropImagePreviews:{type:Boolean}},setup(e){const t=e,i=(0,l.KR)(H),n=(0,l.EW)((()=>function(e,t={}){var i;t={size:32,cropPreview:!1,mimeFallback:!0,...t};try{const l=(null==(i=e.attributes)?void 0:i.previewUrl)||(0,s.Jv)("/core/preview?fileId={fileid}",{fileid:e.fileid});let n;try{n=new URL(l)}catch(e){n=new URL(l,window.location.origin)}return n.searchParams.set("x","".concat(t.size)),n.searchParams.set("y","".concat(t.size)),n.searchParams.set("mimeFallback","".concat(t.mimeFallback)),n.searchParams.set("a",!0===t.cropPreview?"0":"1"),n.searchParams.set("c","".concat(e.attributes.etag)),n}catch(e){return null}}(t.node,{cropPreview:t.cropImagePreviews}))),o=(0,l.EW)((()=>t.node.type===a.pt.File)),r=(0,l.KR)(!1);return(0,l.nT)((()=>{if(r.value=!1,n.value){const e=new Image;e.src=n.value.href,e.onerror=()=>e.remove(),e.onload=()=>{r.value=!0,e.remove()}}})),{__sfc:!0,fileListIconStyles:i,props:t,previewURL:n,isFile:o,canLoadPreview:r,IconFile:S,IconFolder:T}}});var O=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("div",{class:i.fileListIconStyles["file-picker__file-icon"],style:i.canLoadPreview?{backgroundImage:"url(".concat(i.previewURL,")")}:void 0},[i.canLoadPreview?e._e():[i.isFile?t(i.IconFile,{attrs:{size:20}}):t(i.IconFolder,{attrs:{size:20}})]],2)},j=[];const U=(0,n.a)(Z,O,j,!1,null,null,null,null).exports,X=(0,l.pM)({__name:"FileListRow",props:{allowPickDirectory:{type:Boolean},selected:{type:Boolean},showCheckbox:{type:Boolean},canPick:{type:Boolean},node:null,cropImagePreviews:{type:Boolean}},emits:["update:selected","enter-directory"],setup(e,{emit:t}){const i=e,r=(0,l.EW)((()=>{var e;return(null==(e=i.node.attributes)?void 0:e.displayName)||i.node.basename.slice(0,i.node.extension?-i.node.extension.length:void 0)})),s=(0,l.EW)((()=>i.node.extension)),c=(0,l.EW)((()=>i.node.type===a.pt.Folder)),u=(0,l.EW)((()=>i.canPick&&(i.allowPickDirectory||!c.value)));function d(){t("update:selected",!i.selected)}function p(){c.value?t("enter-directory",i.node):d()}return{__sfc:!0,props:i,emit:t,displayName:r,fileExtension:s,isDirectory:c,isPickable:u,toggleSelected:d,handleClick:p,handleKeyDown:function(e){"Enter"===e.key&&p()},formatFileSize:a.v7,NcCheckboxRadioSwitch:o.AO,NcDateTime:o.lT,t:n.t,FilePreview:U}}});var J=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("tr",e._g({class:["file-picker__row",{"file-picker__row--selected":e.selected&&!e.showCheckbox}],attrs:{tabindex:e.showCheckbox&&!i.isDirectory?void 0:0,"aria-selected":i.isPickable?e.selected:void 0,"data-filename":e.node.basename,"data-testid":"file-list-row"}},{click:i.handleClick,...!e.showCheckbox||i.isDirectory?{keydown:i.handleKeyDown}:{}}),[e.showCheckbox?t("td",{staticClass:"row-checkbox",on:{click:function(e){return e.stopPropagation(),(()=>{}).apply(null,arguments)}}},[t(i.NcCheckboxRadioSwitch,{attrs:{"aria-label":i.t("Select the row for {nodename}",{nodename:i.displayName}),checked:e.selected,disabled:!i.isPickable,"data-testid":"row-checkbox"},on:{"update:checked":i.toggleSelected}})],1):e._e(),t("td",{staticClass:"row-name"},[t("div",{staticClass:"file-picker__name-container",attrs:{"data-testid":"row-name"}},[t(i.FilePreview,{attrs:{node:e.node,"crop-image-previews":e.cropImagePreviews}}),t("div",{staticClass:"file-picker__file-name",attrs:{title:i.displayName},domProps:{textContent:e._s(i.displayName)}}),t("div",{staticClass:"file-picker__file-extension",domProps:{textContent:e._s(i.fileExtension)}})],1)]),t("td",{staticClass:"row-size"},[e._v(" "+e._s(i.formatFileSize(e.node.size||0))+" ")]),t("td",{staticClass:"row-modified"},[t(i.NcDateTime,{attrs:{timestamp:e.node.mtime,"ignore-seconds":!0}})],1)])},G=[];const Q=(0,n.a)(X,J,G,!1,null,"cb12dccb",null,null).exports,Y=(0,l.pM)({__name:"FileList",props:{currentView:null,multiselect:{type:Boolean},allowPickDirectory:{type:Boolean},loading:{type:Boolean},files:null,selectedFiles:null,path:null},emits:["update:path","update:selectedFiles"],setup(e,{emit:t}){const i=e,d=(0,l.KR)(),{currentConfig:p}=(e=>{var t,i,a,o,d,p,f,m,g,h,w,_;const y=e=>"asc"===e?"ascending":"desc"===e?"descending":"none",C=(0,r.C)("files","viewConfigs",null),k=(0,l.KR)({sortBy:null!=(i=null==(t=null==C?void 0:C.files)?void 0:t.sorting_mode)?i:"basename",order:y(null!=(o=null==(a=null==C?void 0:C.files)?void 0:a.sorting_direction)?o:"asc")}),N=(0,l.KR)({sortBy:null!=(p=null==(d=null==C?void 0:C.recent)?void 0:d.sorting_mode)?p:"basename",order:y(null!=(m=null==(f=null==C?void 0:C.recent)?void 0:f.sorting_direction)?m:"asc")}),S=(0,l.KR)({sortBy:null!=(h=null==(g=null==C?void 0:C.favorites)?void 0:g.sorting_mode)?h:"basename",order:y(null!=(_=null==(w=null==C?void 0:C.favorites)?void 0:w.sorting_direction)?_:"asc")});(0,l.sV)((async()=>{var e,t,i,l,a,o,r,u,d,p,f,m,g,h,w;if((0,c.f)())b.debug("Skip loading files views - currently on public share");else try{const{data:n}=await v.Ay.get((0,s.Jv)("/apps/files/api/v1/views"));k.value={sortBy:null!=(i=null==(t=null==(e=null==n?void 0:n.data)?void 0:e.files)?void 0:t.sorting_mode)?i:"basename",order:y(null==(a=null==(l=null==n?void 0:n.data)?void 0:l.files)?void 0:a.sorting_direction)},S.value={sortBy:null!=(u=null==(r=null==(o=null==n?void 0:n.data)?void 0:o.favorites)?void 0:r.sorting_mode)?u:"basename",order:y(null==(p=null==(d=null==n?void 0:n.data)?void 0:d.favorites)?void 0:p.sorting_direction)},N.value={sortBy:null!=(g=null==(m=null==(f=null==n?void 0:n.data)?void 0:f.recent)?void 0:m.sorting_mode)?g:"basename",order:y(null==(w=null==(h=null==n?void 0:n.data)?void 0:h.recent)?void 0:w.sorting_direction)}}catch(e){b.error("Could not load files views",e),(0,n.l)((0,n.t)("Could not load files views"))}}));const F=(0,l.EW)((()=>"files"===u(e||"files")?k.value:"recent"===u(e)?N.value:S.value)),x=(0,l.EW)((()=>F.value.sortBy)),L=(0,l.EW)((()=>F.value.order));return{filesViewConfig:k,favoritesViewConfig:S,recentViewConfig:N,currentConfig:F,sortBy:x,order:L}})(i.currentView),f=(0,l.EW)((()=>{var e;return null!=(e=d.value)?e:p.value})),m=(0,l.EW)((()=>"basename"===f.value.sortBy?"none"===f.value.order?void 0:f.value.order:void 0)),g=(0,l.EW)((()=>"size"===f.value.sortBy?"none"===f.value.order?void 0:f.value.order:void 0)),h=(0,l.EW)((()=>"mtime"===f.value.sortBy?"none"===f.value.order?void 0:f.value.order:void 0)),{sortFavoritesFirst:w,cropImagePreviews:_}=F(),y=(0,l.EW)((()=>(0,a.ur)(i.files,{sortFoldersFirst:!0,sortFavoritesFirst:w.value,sortingOrder:"descending"===f.value.order?"desc":"asc",sortingMode:f.value.sortBy}))),C=(0,l.EW)((()=>i.files.filter((e=>i.allowPickDirectory||e.type!==a.pt.Folder)))),k=(0,l.EW)((()=>!i.loading&&i.selectedFiles.length>0&&i.selectedFiles.length>=C.value.length)),N=(0,l.KR)(4),S=(0,l.KR)();{const e=()=>(0,l.dY)((()=>{var e,t,i,l,n;const a=(null==(t=null==(e=S.value)?void 0:e.parentElement)?void 0:t.children)||[];let o=(null==(l=null==(i=S.value)?void 0:i.parentElement)?void 0:l.clientHeight)||450;for(let e=0;e<a.length;e++)(null==(n=S.value)?void 0:n.isSameNode(a[e]))||(o-=a[e].clientHeight);N.value=Math.max(1,Math.floor((o-50)/50))}));(0,l.sV)((()=>{window.addEventListener("resize",e),e()})),(0,l.hi)((()=>{window.removeEventListener("resize",e)}))}return{__sfc:!0,props:i,emit:t,customSortingConfig:d,filesAppSorting:p,sortingConfig:f,sortByName:m,sortBySize:g,sortByModified:h,toggleSorting:e=>{f.value.sortBy===e?"ascending"===f.value.order?d.value={sortBy:f.value.sortBy,order:"descending"}:d.value={sortBy:f.value.sortBy,order:"ascending"}:d.value={sortBy:e,order:"ascending"}},sortFavoritesFirst:w,cropImagePreviews:_,sortedFiles:y,selectableFiles:C,allSelected:k,onSelectAll:function(){i.selectedFiles.length<C.value.length?t("update:selectedFiles",C.value):t("update:selectedFiles",[])},onNodeSelected:function(e){i.selectedFiles.includes(e)?t("update:selectedFiles",i.selectedFiles.filter((t=>t.path!==e.path))):i.multiselect?t("update:selectedFiles",[...i.selectedFiles,e]):t("update:selectedFiles",[e])},onChangeDirectory:function(e){t("update:path",e.path)},skeletonNumber:N,fileContainer:S,NcButton:o.x1,NcCheckboxRadioSwitch:o.AO,t:n.t,IconSortAscending:P,IconSortDescending:z,LoadingTableRow:R,FileListRow:Q}}});var q=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t("div",{ref:"fileContainer",staticClass:"file-picker__files"},[t("table",[t("thead",[t("tr",[e.multiselect?t("th",{staticClass:"row-checkbox"},[t("span",{staticClass:"hidden-visually"},[e._v(" "+e._s(i.t("Select entry"))+" ")]),e.multiselect?t(i.NcCheckboxRadioSwitch,{attrs:{"aria-label":i.t("Select all entries"),checked:i.allSelected,"data-testid":"select-all-checkbox"},on:{"update:checked":i.onSelectAll}}):e._e()],1):e._e(),t("th",{staticClass:"row-name",attrs:{"aria-sort":i.sortByName}},[t("div",{staticClass:"header-wrapper"},[t("span",{staticClass:"file-picker__header-preview"}),t(i.NcButton,{attrs:{wide:!0,type:"tertiary","data-test":"file-picker_sort-name"},on:{click:function(e){return i.toggleSorting("basename")}},scopedSlots:e._u([{key:"icon",fn:function(){return["ascending"===i.sortByName?t(i.IconSortAscending,{attrs:{size:20}}):"descending"===i.sortByName?t(i.IconSortDescending,{attrs:{size:20}}):t("span",{staticStyle:{width:"44px"}})]},proxy:!0}])},[e._v(" "+e._s(i.t("Name"))+" ")])],1)]),t("th",{staticClass:"row-size",attrs:{"aria-sort":i.sortBySize}},[t(i.NcButton,{attrs:{wide:!0,type:"tertiary"},on:{click:function(e){return i.toggleSorting("size")}},scopedSlots:e._u([{key:"icon",fn:function(){return["ascending"===i.sortBySize?t(i.IconSortAscending,{attrs:{size:20}}):"descending"===i.sortBySize?t(i.IconSortDescending,{attrs:{size:20}}):t("span",{staticStyle:{width:"44px"}})]},proxy:!0}])},[e._v(" "+e._s(i.t("Size"))+" ")])],1),t("th",{staticClass:"row-modified",attrs:{"aria-sort":i.sortByModified}},[t(i.NcButton,{attrs:{wide:!0,type:"tertiary"},on:{click:function(e){return i.toggleSorting("mtime")}},scopedSlots:e._u([{key:"icon",fn:function(){return["ascending"===i.sortByModified?t(i.IconSortAscending,{attrs:{size:20}}):"descending"===i.sortByModified?t(i.IconSortDescending,{attrs:{size:20}}):t("span",{staticStyle:{width:"44px"}})]},proxy:!0}])},[e._v(" "+e._s(i.t("Modified"))+" ")])],1)])]),t("tbody",[e.loading?e._l(i.skeletonNumber,(function(l){return t(i.LoadingTableRow,{key:l,attrs:{"show-checkbox":e.multiselect}})})):e._l(i.sortedFiles,(function(l){return t(i.FileListRow,{key:l.fileid||l.path,attrs:{"allow-pick-directory":e.allowPickDirectory,"show-checkbox":e.multiselect,"can-pick":e.multiselect||0===e.selectedFiles.length||e.selectedFiles.includes(l),selected:e.selectedFiles.includes(l),node:l,"crop-image-previews":i.cropImagePreviews},on:{"update:selected":function(e){return i.onNodeSelected(l)},"enter-directory":i.onChangeDirectory}})}))],2)])])},ee=[];const te=(0,n.a)(Y,q,ee,!1,null,"006fdbd0",null,null).exports,ie={name:"HomeIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var le=function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon home-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])},ne=[];const ae=(0,n.a)(ie,le,ne,!1,null,null,null,null).exports,oe={name:"PlusIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var re=function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon plus-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])},se=[];const ce=(0,n.a)(oe,re,se,!1,null,null,null,null).exports,ue=(0,l.pM)({__name:"FilePickerBreadcrumbs",props:{path:null,showMenu:{type:Boolean}},emits:["update:path","create-node"],setup(e,{emit:t}){const i=e,a=(0,l.KR)(!1),r=(0,l.KR)(""),s=(0,l.KR)();function c(){var e,t,i,l;const a=r.value.trim(),o=null==(t=null==(e=s.value)?void 0:e.$el)?void 0:t.querySelector("input");let c="";return 0===a.length?c=(0,n.t)("Folder name cannot be empty."):a.includes("/")?c=(0,n.t)('"/" is not allowed inside a folder name.'):["..","."].includes(a)?c=(0,n.t)('"{name}" is an invalid folder name.',{name:a}):(null==(i=window.OC.config)?void 0:i.blacklist_files_regex)&&a.match(null==(l=window.OC.config)?void 0:l.blacklist_files_regex)&&(c=(0,n.t)('"{name}" is not an allowed folder name',{name:a})),o&&o.setCustomValidity(c),""===c}const u=(0,l.EW)((()=>i.path.split("/").filter((e=>""!==e)).map(((e,t,i)=>({name:e,path:"/"+i.slice(0,t+1).join("/")})))));return{__sfc:!0,props:i,emit:t,actionsOpen:a,newNodeName:r,nameInput:s,validateInput:c,onSubmit:function(){const e=r.value.trim();c()&&(a.value=!1,t("create-node",e),r.value="")},pathElements:u,IconFolder:T,IconHome:ae,IconPlus:ce,NcActions:o.B6,NcActionInput:o.Az,NcBreadcrumbs:o.Qz,NcBreadcrumb:o.R1,t:n.t}}});var de=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t(i.NcBreadcrumbs,{staticClass:"file-picker__breadcrumbs",scopedSlots:e._u([{key:"default",fn:function(){return[t(i.NcBreadcrumb,{attrs:{name:i.t("All files"),title:i.t("Home")},on:{click:function(e){return i.emit("update:path","/")}},scopedSlots:e._u([{key:"icon",fn:function(){return[t(i.IconHome,{attrs:{size:20}})]},proxy:!0}])}),e._l(i.pathElements,(function(e){return t(i.NcBreadcrumb,{key:e.path,attrs:{name:e.name,title:e.path},on:{click:function(t){return i.emit("update:path",e.path)}}})}))]},proxy:!0},e.showMenu?{key:"actions",fn:function(){return[t(i.NcActions,{attrs:{"aria-label":i.t("Create directory"),"force-menu":!0,"force-name":!0,"menu-name":i.t("New"),open:i.actionsOpen,type:"secondary"},on:{"update:open":function(e){i.actionsOpen=e},close:function(e){i.newNodeName=""}},scopedSlots:e._u([{key:"icon",fn:function(){return[t(i.IconPlus,{attrs:{size:20}})]},proxy:!0}],null,!1,2971667417)},[t(i.NcActionInput,{ref:"nameInput",attrs:{value:i.newNodeName,label:i.t("New folder"),placeholder:i.t("New folder name")},on:{"update:value":function(e){i.newNodeName=e},submit:i.onSubmit,input:i.validateInput},scopedSlots:e._u([{key:"icon",fn:function(){return[t(i.IconFolder,{attrs:{size:20}})]},proxy:!0}],null,!1,1614167509)})],1)]},proxy:!0}:null],null,!0)})},pe=[];const fe=(0,n.a)(ue,de,pe,!1,null,"b357227a",null,null).exports,ve={name:"CloseIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var me=function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon close-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])},ge=[];const he=(0,n.a)(ve,me,ge,!1,null,null,null,null).exports,we={name:"MagnifyIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var _e=function(){var e=this,t=e._self._c;return t("span",e._b({staticClass:"material-design-icon magnify-icon",attrs:{"aria-hidden":!e.title||null,"aria-label":e.title,role:"img"},on:{click:function(t){return e.$emit("click",t)}}},"span",e.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z"}},[e.title?t("title",[e._v(e._s(e.title))]):e._e()])])])},ye=[];const be=(0,n.a)(we,_e,ye,!1,null,null,null,null).exports,Ce=(0,l.pM)({__name:"FilePickerNavigation",props:{currentView:null,filterString:null,isCollapsed:{type:Boolean},disabledNavigation:{type:Boolean}},emits:["update:currentView","update:filterString"],setup(e,{emit:t}){const i=e,{availableViews:a}=(e=>{const t=[{id:"files",label:(0,n.t)("All files"),icon:h.fEr},{id:"recent",label:(0,n.t)("Recent"),icon:h.NZC},{id:"favorites",label:(0,n.t)("Favorites"),icon:h.ZL5}],i=e.value?t.filter((({id:e})=>"files"===e)):t;return{allViews:t,availableViews:i}})((0,l.KR)(null===(0,m.HW)())),r=(0,l.EW)((()=>{var e;return null!=(e=a.filter((e=>e.id===i.currentView))[0])?e:a[0]}));return{__sfc:!0,props:i,emit:t,availableViews:a,currentViewObject:r,updateFilterValue:e=>t("update:filterString",e),IconClose:he,IconMagnify:be,NcButton:o.x1,NcIconSvgWrapper:o.K1,NcSelect:o.EQ,NcTextField:o.v,Fragment:g.F,t:n.t}}});var ke=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t(i.Fragment,[t(i.NcTextField,{staticClass:"file-picker__filter-input",attrs:{value:e.filterString,label:i.t("Filter file list"),"show-trailing-button":!!e.filterString},on:{"update:value":i.updateFilterValue,"trailing-button-click":function(e){return i.updateFilterValue("")}},scopedSlots:e._u([{key:"trailing-button-icon",fn:function(){return[t(i.IconClose,{attrs:{size:16}})]},proxy:!0}])},[t(i.IconMagnify,{attrs:{size:16}})],1),i.availableViews.length>1&&!e.disabledNavigation?[e.isCollapsed?t(i.NcSelect,{attrs:{"aria-label":i.t("Current view selector"),clearable:!1,searchable:!1,options:i.availableViews,value:i.currentViewObject},on:{input:e=>i.emit("update:currentView",e.id)}}):t("ul",{staticClass:"file-picker__side"},e._l(i.availableViews,(function(l){return t("li",{key:l.id},[t(i.NcButton,{attrs:{type:e.currentView===l.id?"primary":"tertiary",wide:!0},on:{click:function(t){return e.$emit("update:currentView",l.id)}},scopedSlots:e._u([{key:"icon",fn:function(){return[t(i.NcIconSvgWrapper,{attrs:{path:l.icon,size:20}})]},proxy:!0}],null,!0)},[e._v(" "+e._s(l.label)+" ")])],1)})),0)]:e._e()],2)},Ne=[];const Se=(0,n.a)(Ce,ke,Ne,!1,null,"b42054b8",null,null).exports,Fe=(0,l.pM)({name:"FilePicker",props:{buttons:null,name:null,allowPickDirectory:{type:Boolean,default:!1},disabledNavigation:{type:Boolean,default:!1},container:{default:"body"},filterFn:{default:void 0},mimetypeFilter:{default:()=>[]},multiselect:{type:Boolean,default:!0},path:{default:void 0}},emits:["close"],setup(e,{emit:t}){const i=e,r=(0,l.KR)(!0),u=(0,l.EW)((()=>{const e=0===m.value.length&&i.allowPickDirectory&&L.value?[L.value]:m.value;return("function"==typeof i.buttons?i.buttons(e,C.value,f.value):i.buttons).map((t=>({...t,disabled:t.disabled||A.value,callback:()=>{d=!0,p(t.callback,e)}})))}));let d=!1;const p=async(e,i)=>{e(i),t("close",i),d=!1},f=(0,l.KR)("files"),v=(0,l.EW)((()=>"favorites"===f.value?(0,n.t)("Favorites"):"recent"===f.value?(0,n.t)("Recent"):"")),m=(0,l.IJ)([]),g=(0,l.KR)((null==window?void 0:window.sessionStorage.getItem("NC.FilePicker.LastPath"))||"/"),h=(0,l.KR)("");(0,l.wB)([h],(()=>{void 0===i.path&&h.value&&window.sessionStorage.setItem("NC.FilePicker.LastPath",h.value),m.value=[]}));const C=(0,l.EW)({get:()=>"files"===f.value?h.value||i.path||g.value:"/",set:e=>{h.value=e}}),k=(0,l.KR)(""),{isSupportedMimeType:N}=function(e){const t=(0,l.EW)((()=>e.value.map((e=>e.split("/")))));return{isSupportedMimeType:e=>{const i=e.split("/");return t.value.some((([e,t])=>!(i[0]!==e&&"*"!==e||i[1]!==t&&"*"!==t)))}}}((0,l.lW)(i,"mimetypeFilter")),{files:x,folder:L,isLoading:A,loadFiles:P,createDirectory:B}=function(e,t){const i=(0,c.f)(),n=i?"/":a.lJ,o=(0,l.EW)((()=>i?(0,s.dC)("webdav").replace("/remote.php","/public.php"):a.PY)),r=(0,l.EW)((()=>{if(i){const e=document.getElementById("sharingToken").value,t=btoa("".concat(e,":null"));return(0,a.H4)(o.value,{Authorization:"Basic ".concat(t)})}return(0,a.H4)()})),u=e=>(0,a.Al)(e,n,o.value),d=(0,l.IJ)([]),p=(0,l.IJ)(null),f=(0,l.KR)(!0),v=(0,l.KR)(null);async function m(){v.value&&v.value.cancel(),f.value=!0,"favorites"===e.value?v.value=(0,a.Q$)(r.value,t.value,n):"recent"===e.value?v.value=(()=>{const e=new AbortController,t=Math.round(Date.now()/1e3)-1209600;return new y.CancelablePromise((async(i,l,n)=>{n((()=>e.abort()));try{const{data:l}=await r.value.search("/",{signal:e.signal,details:!0,data:(0,a.R3)(t)});i(l.results.map(u))}catch(e){l(e)}}))})():v.value=(()=>{const e=new AbortController;return new y.CancelablePromise((async(i,l,o)=>{o((()=>e.abort()));try{const l=(await r.value.getDirectoryContents("".concat(n).concat(t.value),{signal:e.signal,details:!0,includeSelf:!0,data:(0,a.VL)()})).data.map(u);i({folder:l.find((e=>e.path===t.value)),contents:l.filter((e=>e.path!==t.value))})}catch(e){l(e)}}))})();const i=await v.value;"folder"in i?(p.value=i.folder,d.value=i.contents):(p.value=null,d.value=i),v.value=null,f.value=!1}return(0,l.wB)([e,t],(()=>m())),(0,l.sV)((()=>m())),{isLoading:f,files:d,folder:p,loadFiles:m,createDirectory:async function(e){const i=(0,_.join)(t.value,e);await r.value.createDirectory((0,_.join)(n,i));const l=await async function(e,t){t=null!=t?t:n;const{data:i}=await r.value.stat("".concat(t).concat(e),{details:!0,data:(0,a.VL)()});return u(i)}(i);return d.value=[...d.value,l],l}}}(f,C);(0,l.sV)((()=>P()));const{showHiddenFiles:V}=F(),I=(0,l.EW)((()=>{let e=x.value;return V.value||(e=e.filter((e=>!e.basename.startsWith(".")))),i.mimetypeFilter.length>0&&(e=e.filter((e=>"folder"===e.type||e.mime&&N(e.mime)))),k.value&&(e=e.filter((e=>e.basename.toLowerCase().includes(k.value.toLowerCase())))),i.filterFn&&(e=e.filter((e=>i.filterFn(e)))),e})),z=(0,l.EW)((()=>"files"===f.value?(0,n.t)("Upload some content or sync with your devices!"):"recent"===f.value?(0,n.t)("Files and folders you recently modified will show up here."):(0,n.t)("Files and folders you mark as favorite will show up here.")));return{__sfc:!0,props:i,emit:t,isOpen:r,dialogButtons:u,isHandlingCallback:d,handleButtonClick:p,currentView:f,viewHeadline:v,selectedFiles:m,savedPath:g,navigatedPath:h,currentPath:C,filterString:k,isSupportedMimeType:N,files:x,currentFolder:L,isLoading:A,loadFiles:P,createDirectory:B,showHiddenFiles:V,filteredFiles:I,noFilesDescription:z,onCreateFolder:async e=>{try{const t=await B(e);h.value=t.path,(0,w.Ic)("files:node:created",x.value.filter((t=>t.basename===e))[0])}catch(t){b.warn("Could not create new folder",{name:e,error:t}),(0,n.l)((0,n.t)("Could not create the new folder"))}},handleClose:e=>{e||d||t("close")},IconFile:S,FileList:te,FilePickerBreadcrumbs:fe,FilePickerNavigation:Se,NcDialog:o.i$,NcEmptyContent:o.yI,t:n.t}}});var xe=function(){var e=this,t=e._self._c,i=e._self._setupProxy;return t(i.NcDialog,{attrs:{container:e.container,buttons:i.dialogButtons,name:e.name,size:"large","content-classes":"file-picker__content","dialog-classes":"file-picker","navigation-classes":"file-picker__navigation",open:i.isOpen},on:{"update:open":[function(e){i.isOpen=e},i.handleClose]},scopedSlots:e._u([{key:"navigation",fn:function({isCollapsed:l}){return[t(i.FilePickerNavigation,{attrs:{"is-collapsed":l,"current-view":i.currentView,"filter-string":i.filterString,"disabled-navigation":e.disabledNavigation},on:{"update:currentView":function(e){i.currentView=e},"update:current-view":function(e){i.currentView=e},"update:filterString":function(e){i.filterString=e},"update:filter-string":function(e){i.filterString=e}}})]}}])},[t("div",{staticClass:"file-picker__main"},["files"===i.currentView?t(i.FilePickerBreadcrumbs,{attrs:{path:i.currentPath,"show-menu":e.allowPickDirectory},on:{"update:path":function(e){i.currentPath=e},"create-node":i.onCreateFolder}}):t("div",{staticClass:"file-picker__view"},[t("h3",[e._v(e._s(i.viewHeadline))])]),i.isLoading||i.filteredFiles.length>0?t(i.FileList,{attrs:{"allow-pick-directory":e.allowPickDirectory,"current-view":i.currentView,files:i.filteredFiles,multiselect:e.multiselect,loading:i.isLoading,path:i.currentPath,"selected-files":i.selectedFiles,name:i.viewHeadline},on:{"update:path":[function(e){i.currentPath=e},function(e){i.currentView="files"}],"update:selectedFiles":function(e){i.selectedFiles=e},"update:selected-files":function(e){i.selectedFiles=e}}}):i.filterString?t(i.NcEmptyContent,{attrs:{name:i.t("No matching files"),description:i.t("No files matching your filter were found.")},scopedSlots:e._u([{key:"icon",fn:function(){return[t(i.IconFile)]},proxy:!0}])}):t(i.NcEmptyContent,{attrs:{name:i.t("No files in here"),description:i.noFilesDescription},scopedSlots:e._u([{key:"icon",fn:function(){return[t(i.IconFile)]},proxy:!0}])})],1)])},Le=[];const Ae=(0,n.a)(Fe,xe,Le,!1,null,"20b719ba",null,null).exports},76333:(e,t,i)=>{i.d(t,{AO:()=>M.N,Az:()=>r.N,B6:()=>d.N,EQ:()=>ve.N,FH:()=>ae.A,K1:()=>ee.N,Qz:()=>z.N,R1:()=>I.N,i$:()=>j.N,lT:()=>T.N,ne:()=>ne.A,v:()=>me.N,x1:()=>H.A,yI:()=>G.A}),i(18911);var l=i(89257),n=i(94398),a=i(30567),o=i(1790),r=i(61893),s=i(73267),c=i(17452),u=i(93806),d=i(24997),p=i(80114),f=i(32831),v=i(98060),m=i(28907),g=i(47611),h=i(10363),w=i(72467),_=i(31474),y=i(20377),b=i(57074),C=i(80329),k=i(62720),N=i(7902),S=i(34379),F=i(57174),x=i(66687),L=i(69996),A=i(85948),P=i(35190),B=i(46503),V=i(18664),I=i(62081),z=i(75556),H=i(18740),M=i(22058),E=i(81886),D=i(63536),R=i(32061),W=i(21558),K=i(77622),$=i(38205),T=i(74723),Z=i(46168),O=i(31126),j=i(51568),U=i(43041),X=i(68296),J=i(41781),G=i(34196),Q=i(78298),Y=i(77312),q=i(26517),ee=i(96338),te=i(63407),ie=i(23570),le=i(11524),ne=i(84237),ae=i(68567),oe=i(80910),re=i(53297),se=i(17622),ce=i(79742),ue=i(83157),de=i(51681),pe=i(82126),fe=i(63431),ve=(i(40708),i(37382),i(65043),i(21777),i(26710)),me=i(44960),ge=(i(61338),i(94632)),he=i(6332),we=i(64084),_e=i(88534),ye=i(34816),be=i(42740),Ce=i(50211),ke=i(86719),Ne=i(49453),Se=i(23610),Fe=(i(23020),i(53429),i(94205),i(9050),i(63534),i(42892)),xe=i(65842),Le=(i(18300),i(75105),i(92471),i(16406),i(2508));l.A,n.N,a.A,o.A,r.N,s.A,c.A,u.A,p.A,f.A,v.A,d.N,m.N,g.A,h.A,w.N,_.N,y.A,b.N,C.A,k.A,N.N,S.N,F.N,x.A,L.N,A.A,P.N,B.A,pe.N,V.N,I.N,z.N,H.A,M.N,E.N,D.N,R.N,W.N,K.N,$.N,T.N,Z.A,O.A,j.N,U.N,X.A,J.N,G.A,Q.A,Y.N,q.N,ee.N,te.A,ie.N,le.N,ne.A,de.N,ae.A,oe.A,re.N,se.N,ce.N,ue.N,pe.a,fe.N,ge.N,ve.N,he.N,we.N,_e.N,ye.N,be.A,me.N,Ce.N,ke.N,Ne.N,Se.A,Symbol.toStringTag,Fe.u,xe.u,Le.yw,Symbol.toStringTag}}]);
  2. //# sourceMappingURL=1762-1762.js.map?v=bbbbaa3b4881da4c063c