nextcloud-server/dist/files_sharing-init-public.js

2 lines
9.1 KiB
JavaScript

(()=>{"use strict";var e,t,r,i={50352:e=>{e.exports='<svg xmlns="http://www.w3.org/2000/svg" id="mdi-cloud-upload" viewBox="0 0 24 24"><path d="M11 20H6.5Q4.22 20 2.61 18.43 1 16.85 1 14.58 1 12.63 2.17 11.1 3.35 9.57 5.25 9.15 5.88 6.85 7.75 5.43 9.63 4 12 4 14.93 4 16.96 6.04 19 8.07 19 11 20.73 11.2 21.86 12.5 23 13.78 23 15.5 23 17.38 21.69 18.69 20.38 20 18.5 20H13V12.85L14.6 14.4L16 13L12 9L8 13L9.4 14.4L11 12.85Z" /></svg>'},51528:(e,t,r)=>{var i=r(61338),n=r(35810),o=r(32981),a=r(77815),s=r(53334),l=r(50352),u=r(85471);const c='<svg xmlns="http://www.w3.org/2000/svg" id="mdi-link" viewBox="0 0 24 24"><path d="M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z" /></svg>';var d=r(36117),p=r(43627);const f=(0,a.KU)();var h=r(35947);const g=(0,h.YK)().setApp("files").detectUser().build(),b=e=>(0,n.Al)(e),v=(e="/")=>{e=(0,p.join)(n.lJ,e);const t=new AbortController,r=(0,n.VL)();return new d.CancelablePromise((async(i,n,o)=>{o((()=>t.abort()));try{const n=await f.getDirectoryContents(e,{details:!0,data:r,includeSelf:!0,signal:t.signal}),o=n.data[0],a=n.data.slice(1);if(o.filename!==e&&`${o.filename}/`!==e)throw g.debug(`Exepected "${e}" but got filename "${o.filename}" instead.`),new Error("Root node does not match requested path");i({folder:b(o),contents:a.map((e=>{try{return b(e)}catch(t){return g.error(`Invalid node detected '${e.basename}'`,{error:t}),null}})).filter(Boolean)})}catch(e){n(e)}}))},m=(0,h.YK)().setApp("files_sharing").detectUser().build();var w=r(63814),y=r(82490),C=r(40173);const A=(0,o.C)("files_sharing","view"),T=(0,o.C)("files_sharing","sharingToken");u.Ay.use(C.Ay);const P=C.Ay.prototype.push;C.Ay.prototype.push=function(...e){return e.length>1?P.call(this,...e):P.call(this,e[0]).catch(O)};const _=C.Ay.prototype.replace;function O(e){if(!(0,C.Pq)(e,C.$c.duplicated))throw e;m.debug("Ignoring duplicated navigation from vue-router",{error:e})}C.Ay.prototype.replace=function(...e){return e.length>1?_.call(this,...e):_.call(this,e[0]).catch(O)};const k=new C.Ay({mode:"history",base:(0,w.Jv)("/s"),linkActiveClass:"active",routes:[{path:"/",redirect:{name:"filelist",params:{view:A,token:T}}},{path:"/:token",name:"filelist",props:!0}],stringifyQuery(e){const t=y.A.stringify(e).replace(/%2F/gim,"/");return t?"?"+t:""}});(()=>{const e=(0,o.C)("files_sharing","filename");let t,i;const c=new n.Ss({id:"public-file-drop",name:(0,s.Tl)("files_sharing","File drop"),caption:(0,s.Tl)("files_sharing","Upload files to {foldername}",{foldername:e}),icon:l,order:1,emptyView:async n=>{if(void 0===t){const{default:e}=await Promise.all([r.e(4208),r.e(4107)]).then(r.bind(r,84107));t=u.Ay.extend(e)}i&&i.$destroy(),i=new t({propsData:{foldername:e}}),i.$mount(n)},getContents:async()=>({contents:[],folder:new n.vd({id:0,source:`${a.Xn}${a.VA}`,root:a.VA,owner:null,permissions:n.aX.CREATE})})});(0,n.bh)().register(c)})(),(()=>{const e=new n.Ss({id:"public-share",name:(0,s.Tl)("files_sharing","Public share"),caption:(0,s.Tl)("files_sharing","Publicly shared files."),emptyTitle:(0,s.Tl)("files_sharing","No files"),emptyCaption:(0,s.Tl)("files_sharing","Files and folders shared with you will show up here"),icon:c,order:1,getContents:v});(0,n.bh)().register(e)})(),(()=>{const e=new n.Ss({id:"public-file-share",name:(0,s.Tl)("files_sharing","Public file share"),caption:(0,s.Tl)("files_sharing","Publicly shared file."),emptyTitle:(0,s.Tl)("files_sharing","No file"),emptyCaption:(0,s.Tl)("files_sharing","The file shared with you will show up here"),icon:c,order:1,getContents:()=>new d.CancelablePromise((async(e,t,r)=>{const i=new AbortController;r((()=>i.abort()));try{const t=await f.stat(n.lJ,{data:(0,n.VL)(),details:!0,signal:i.signal});e({contents:[(0,n.Al)(t.data)],folder:new n.vd({id:0,source:`${n.PY}${n.lJ}`,root:n.lJ,owner:null,permissions:n.aX.READ,attributes:{note:t.data.props?.note}})})}catch(e){m.error(e),t(e)}}))});(0,n.bh)().register(e)})();const S=(0,o.C)("files_sharing","view"),j=(0,n.bh)();j.setActive(j.views.find((({id:e})=>e===S))??null),window.OCP.Files=window.OCP.Files??{},window.OCP.Files.Router=new class{constructor(e){var t,r,i;t=this,i=void 0,(r=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(r="router"))in t?Object.defineProperty(t,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[r]=i,this.router=e}get name(){return this.router.currentRoute.name}get query(){return this.router.currentRoute.query||{}}get params(){return this.router.currentRoute.params||{}}get _router(){return this.router}goTo(e,t=!1){return this.router.push({path:e,replace:t})}goToRoute(e,t,r,i){return this.router.push({name:e,query:r,params:t,replace:i})}}(k);const x=(0,o.C)("files_sharing","fileId",null),E=(0,o.C)("files_sharing","sharingToken");null!==x&&window.OCP.Files.Router.goToRoute("filelist",{...window.OCP.Files.Router.params,token:E,fileid:String(x)},{...window.OCP.Files.Router.query,openfile:"true"}),(0,i.B1)("files:list:updated",(function e({folder:t}){if((0,i.al)("files:list:updated",e),t.attributes["share-attributes"]){const e=JSON.parse(t.attributes["share-attributes"]||"[]").find((({scope:e,key:t})=>"config"===e&&"grid_view"===t));void 0!==e&&(m.debug("Loading share attributes",{gridViewAttribute:e}),(0,i.Ic)("files:config:updated",{key:"grid_view",value:!0===e.value}))}}))}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={id:e,loaded:!1,exports:{}};return i[e].call(r.exports,r,r.exports,o),r.loaded=!0,r.exports}o.m=i,e=[],o.O=(t,r,i,n)=>{if(!r){var a=1/0;for(c=0;c<e.length;c++){for(var[r,i,n]=e[c],s=!0,l=0;l<r.length;l++)(!1&n||a>=n)&&Object.keys(o.O).every((e=>o.O[e](r[l])))?r.splice(l--,1):(s=!1,n<a&&(a=n));if(s){e.splice(c--,1);var u=i();void 0!==u&&(t=u)}}return t}n=n||0;for(var c=e.length;c>0&&e[c-1][2]>n;c--)e[c]=e[c-1];e[c]=[r,i,n]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,r)=>(o.f[r](e,t),t)),[])),o.u=e=>e+"-"+e+".js?v="+{3278:"8b4fe0854296793e7bfb",4107:"55ddb9da8e3426697668",4612:"aebb24cec040bc57223b",5664:"4b28558df62ae5fee1e5",6590:"0129bef94a456f87956c",7471:"6423b9b898ffefeb7d1d",9107:"09c3275a838a856e1307"}[e],o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},r="nextcloud:",o.l=(e,i,n,a)=>{if(t[e])t[e].push(i);else{var s,l;if(void 0!==n)for(var u=document.getElementsByTagName("script"),c=0;c<u.length;c++){var d=u[c];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==r+n){s=d;break}}s||(l=!0,(s=document.createElement("script")).charset="utf-8",o.nc&&s.setAttribute("nonce",o.nc),s.setAttribute("data-webpack",r+n),s.src=e),t[e]=[i];var p=(r,i)=>{s.onerror=s.onload=null,clearTimeout(f);var n=t[e];if(delete t[e],s.parentNode&&s.parentNode.removeChild(s),n&&n.forEach((e=>e(i))),r)return r(i)},f=setTimeout(p.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=p.bind(null,s.onerror),s.onload=p.bind(null,s.onload),l&&document.head.appendChild(s)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),o.j=5102,(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var i=r.length-1;i>-1&&(!e||!/^http(s?):/.test(e));)e=r[i--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),(()=>{o.b="undefined"!=typeof document&&document.baseURI||self.location.href;var e={5102:0};o.f.j=(t,r)=>{var i=o.o(e,t)?e[t]:void 0;if(0!==i)if(i)r.push(i[2]);else{var n=new Promise(((r,n)=>i=e[t]=[r,n]));r.push(i[2]=n);var a=o.p+o.u(t),s=new Error;o.l(a,(r=>{if(o.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var n=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+n+": "+a+")",s.name="ChunkLoadError",s.type=n,s.request=a,i[1](s)}}),"chunk-"+t,t)}},o.O.j=t=>0===e[t];var t=(t,r)=>{var i,n,[a,s,l]=r,u=0;if(a.some((t=>0!==e[t]))){for(i in s)o.o(s,i)&&(o.m[i]=s[i]);if(l)var c=l(o)}for(t&&t(r);u<a.length;u++)n=a[u],o.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return o.O(c)},r=self.webpackChunknextcloud=self.webpackChunknextcloud||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})(),o.nc=void 0;var a=o.O(void 0,[4208],(()=>o(51528)));a=o.O(a)})();
//# sourceMappingURL=files_sharing-init-public.js.map?v=5ccb88e4dc12166e532f