diff --git a/css/main-gfnbWJ0O.chunk.css b/css/main-gfnbWJ0O.chunk.css new file mode 100644 index 000000000..29b00d42c --- /dev/null +++ b/css/main-gfnbWJ0O.chunk.css @@ -0,0 +1,10 @@ +/*! + * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */.toastify.dialogs{min-width:200px;background:none;background-color:var(--color-main-background);color:var(--color-main-text);box-shadow:0 0 6px 0 var(--color-box-shadow);padding:0 12px;margin-top:45px;position:fixed;z-index:10100;border-radius:var(--border-radius);display:flex;align-items:center}.toastify.dialogs .toast-undo-container{display:flex;align-items:center}.toastify.dialogs .toast-undo-button,.toastify.dialogs .toast-close{position:static;overflow:hidden;box-sizing:border-box;min-width:44px;height:100%;padding:12px;white-space:nowrap;background-repeat:no-repeat;background-position:center;background-color:transparent;min-height:0}.toastify.dialogs .toast-undo-button.toast-close,.toastify.dialogs .toast-close.toast-close{text-indent:0;opacity:.4;border:none;min-height:44px;margin-left:10px;font-size:0}.toastify.dialogs .toast-undo-button.toast-close:before,.toastify.dialogs .toast-close.toast-close:before{background-image:url("data:image/svg+xml,%3csvg%20viewBox='0%200%2016%2016'%20height='16'%20width='16'%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2'%3e%3cpath%20d='M6.4%2019%205%2017.6l5.6-5.6L5%206.4%206.4%205l5.6%205.6L17.6%205%2019%206.4%2013.4%2012l5.6%205.6-1.4%201.4-5.6-5.6L6.4%2019Z'%20style='fill-rule:nonzero'%20transform='matrix(.85714%200%200%20.85714%20-2.286%20-2.286)'/%3e%3c/svg%3e");content:" ";filter:var(--background-invert-if-dark);display:inline-block;width:16px;height:16px}.toastify.dialogs .toast-undo-button.toast-undo-button,.toastify.dialogs .toast-close.toast-undo-button{height:calc(100% - 6px);margin:3px 3px 3px 12px}.toastify.dialogs .toast-undo-button:hover,.toastify.dialogs .toast-undo-button:focus,.toastify.dialogs .toast-undo-button:active,.toastify.dialogs .toast-close:hover,.toastify.dialogs .toast-close:focus,.toastify.dialogs .toast-close:active{cursor:pointer;opacity:1}.toastify.dialogs.toastify-top{right:10px}.toastify.dialogs.toast-with-click{cursor:pointer}.toastify.dialogs.toast-error{border-left:3px solid var(--color-error)}.toastify.dialogs.toast-info{border-left:3px solid var(--color-primary)}.toastify.dialogs.toast-warning{border-left:3px solid var(--color-warning)}.toastify.dialogs.toast-success,.toastify.dialogs.toast-undo{border-left:3px solid var(--color-success)}.theme--dark .toastify.dialogs .toast-close.toast-close:before{background-image:url("data:image/svg+xml,%3csvg%20viewBox='0%200%2016%2016'%20height='16'%20width='16'%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%20style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2'%3e%3cpath%20d='M6.4%2019%205%2017.6l5.6-5.6L5%206.4%206.4%205l5.6%205.6L17.6%205%2019%206.4%2013.4%2012l5.6%205.6-1.4%201.4-5.6-5.6L6.4%2019Z'%20style='fill:%23fff;fill-rule:nonzero'%20transform='matrix(.85714%200%200%20.85714%20-2.286%20-2.286)'/%3e%3c/svg%3e")}.nc-generic-dialog .dialog__actions{justify-content:space-between;min-width:calc(100% - 12px)}/*! + * SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */._file-picker__file-icon_19mjt_9{width:32px;height:32px;min-width:32px;min-height:32px;background-repeat:no-repeat;background-size:contain;display:flex;justify-content:center}tr.file-picker__row[data-v-15187afc]{height:var(--row-height, 50px)}tr.file-picker__row td[data-v-15187afc]{cursor:pointer;overflow:hidden;text-overflow:ellipsis;border-bottom:none}tr.file-picker__row td.row-checkbox[data-v-15187afc]{padding:0 2px}tr.file-picker__row td[data-v-15187afc]:not(.row-checkbox){padding-inline:14px 0}tr.file-picker__row td.row-size[data-v-15187afc]{text-align:end;padding-inline:0 14px}tr.file-picker__row td.row-name[data-v-15187afc]{padding-inline:2px 0}@keyframes gradient-15187afc{0%{background-position:0% 50%}50%{background-position:100% 50%}to{background-position:0% 50%}}.loading-row .row-checkbox[data-v-15187afc]{text-align:center!important}.loading-row span[data-v-15187afc]{display:inline-block;height:24px;background:linear-gradient(to right,var(--color-background-darker),var(--color-text-maxcontrast),var(--color-background-darker));background-size:600px 100%;border-radius:var(--border-radius);animation:gradient-15187afc 12s ease infinite}.loading-row .row-wrapper[data-v-15187afc]{display:inline-flex;align-items:center}.loading-row .row-checkbox span[data-v-15187afc]{width:24px}.loading-row .row-name span[data-v-15187afc]:last-of-type{margin-inline-start:6px;width:130px}.loading-row .row-size span[data-v-15187afc]{width:80px}.loading-row .row-modified span[data-v-15187afc]{width:90px}/*! +* SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors +* SPDX-License-Identifier: AGPL-3.0-or-later +*/tr.file-picker__row[data-v-cb12dccb]{height:var(--row-height, 50px)}tr.file-picker__row td[data-v-cb12dccb]{cursor:pointer;overflow:hidden;text-overflow:ellipsis;border-bottom:none}tr.file-picker__row td.row-checkbox[data-v-cb12dccb]{padding:0 2px}tr.file-picker__row td[data-v-cb12dccb]:not(.row-checkbox){padding-inline:14px 0}tr.file-picker__row td.row-size[data-v-cb12dccb]{text-align:end;padding-inline:0 14px}tr.file-picker__row td.row-name[data-v-cb12dccb]{padding-inline:2px 0}.file-picker__row--selected[data-v-cb12dccb]{background-color:var(--color-background-dark)}.file-picker__row[data-v-cb12dccb]:hover{background-color:var(--color-background-hover)}.file-picker__name-container[data-v-cb12dccb]{display:flex;justify-content:start;align-items:center;height:100%}.file-picker__file-name[data-v-cb12dccb]{padding-inline-start:6px;min-width:0;overflow:hidden;text-overflow:ellipsis}.file-picker__file-extension[data-v-cb12dccb]{color:var(--color-text-maxcontrast);min-width:fit-content}.file-picker__header-preview[data-v-006fdbd0]{width:22px;height:32px;flex:0 0 auto}.file-picker__files[data-v-006fdbd0]{margin:2px;margin-inline-start:12px;overflow:scroll auto}.file-picker__files table[data-v-006fdbd0]{width:100%;max-height:100%;table-layout:fixed}.file-picker__files th[data-v-006fdbd0]{position:sticky;z-index:1;top:0;background-color:var(--color-main-background);padding:2px}.file-picker__files th .header-wrapper[data-v-006fdbd0]{display:flex}.file-picker__files th.row-checkbox[data-v-006fdbd0]{width:44px}.file-picker__files th.row-name[data-v-006fdbd0]{width:230px}.file-picker__files th.row-size[data-v-006fdbd0]{width:100px}.file-picker__files th.row-modified[data-v-006fdbd0]{width:120px}.file-picker__files th[data-v-006fdbd0]:not(.row-size) .button-vue__wrapper{justify-content:start;flex-direction:row-reverse}.file-picker__files th[data-v-006fdbd0]:not(.row-size) .button-vue{padding-inline:16px 4px}.file-picker__files th.row-size[data-v-006fdbd0] .button-vue__wrapper{justify-content:end}.file-picker__files th[data-v-006fdbd0] .button-vue__wrapper{color:var(--color-text-maxcontrast)}.file-picker__files th[data-v-006fdbd0] .button-vue__wrapper .button-vue__text{font-weight:400}.file-picker__breadcrumbs[data-v-b357227a]{flex-grow:0!important}.file-picker__side[data-v-b42054b8]{display:flex;flex-direction:column;align-items:stretch;gap:.5rem;min-width:200px;padding:2px;margin-block-start:7px;overflow:auto}.file-picker__side[data-v-b42054b8] .button-vue__wrapper{justify-content:start}.file-picker__filter-input[data-v-b42054b8]{margin-block:7px;max-width:260px}@media (max-width: 736px){.file-picker__side[data-v-b42054b8]{flex-direction:row;min-width:unset}}@media (max-width: 512px){.file-picker__side[data-v-b42054b8]{flex-direction:row;min-width:unset}.file-picker__filter-input[data-v-b42054b8]{max-width:unset}}.file-picker__navigation{padding-inline:8px 2px}.file-picker__navigation,.file-picker__navigation *{box-sizing:border-box}.file-picker__navigation .v-select.select{min-width:220px}@media (min-width: 513px) and (max-width: 736px){.file-picker__navigation{gap:11px}}@media (max-width: 512px){.file-picker__navigation{flex-direction:column-reverse!important}}.file-picker__view[data-v-20b719ba]{height:50px;display:flex;justify-content:start;align-items:center}.file-picker__view h3[data-v-20b719ba]{font-weight:700;height:fit-content;margin:0}.file-picker__main[data-v-20b719ba]{box-sizing:border-box;width:100%;display:flex;flex-direction:column;min-height:0;flex:1;padding-inline:2px}.file-picker__main *[data-v-20b719ba]{box-sizing:border-box}[data-v-20b719ba] .file-picker{height:min(80vh,800px)!important}@media (max-width: 512px){[data-v-20b719ba] .file-picker{height:calc(100% - 16px - var(--default-clickable-area))!important}}[data-v-20b719ba] .file-picker__content{display:flex;flex-direction:column;overflow:hidden}#emptycontent[data-v-23ff8610]{margin:0;padding:10% 5%;background-color:var(--color-main-background)}.viewer.modal-mask[data-v-ffd4cf06]{transition:width ease .1s,background-color .3s ease}.viewer[data-v-ffd4cf06] .modal-container,.viewer__content[data-v-ffd4cf06]{overflow:visible!important;cursor:pointer}.viewer--split[data-v-ffd4cf06]{display:flex}.viewer--split .viewer__file--active[data-v-ffd4cf06]{width:50%;left:0;position:relative}.viewer[data-v-ffd4cf06] .modal-wrapper .modal-container{top:var(--header-height);bottom:var(--header-height);height:auto;background-color:transparent;box-shadow:none}.viewer__content[data-v-ffd4cf06]{width:100%;height:100%}.viewer__file-wrapper[data-v-ffd4cf06]{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.viewer__file-wrapper--hidden[data-v-ffd4cf06]{position:absolute;z-index:-1;left:-10000px}.viewer__file[data-v-ffd4cf06]{transition:height .1s ease,width .1s ease}.viewer.theme--dark[data-v-ffd4cf06] .button-vue--vue-tertiary:hover{background-color:#ffffff14!important}.viewer.theme--dark[data-v-ffd4cf06] .button-vue--vue-tertiary:focus,.viewer.theme--dark[data-v-ffd4cf06] .button-vue--vue-tertiary:focus-visible{background-color:#ffffff14!important;outline:2px solid var(--color-primary-element)!important}.viewer.theme--dark[data-v-ffd4cf06] .button-vue--vue-tertiary.action-item__menutoggle{background-color:transparent}.viewer.theme--undefined.modal-mask[data-v-ffd4cf06]{background-color:transparent!important}.viewer.theme--light.modal-mask[data-v-ffd4cf06]{background-color:#ffffffeb!important}.viewer.theme--light[data-v-ffd4cf06] .modal-header__name,.viewer.theme--light[data-v-ffd4cf06] .modal-header .icons-menu button svg{color:#000!important}.viewer.theme--default.modal-mask[data-v-ffd4cf06]{background-color:var(--color-main-background)!important}.viewer.theme--default[data-v-ffd4cf06] .modal-header__name,.viewer.theme--default[data-v-ffd4cf06] .modal-header .icons-menu{color:var(--color-main-text)!important}.viewer.theme--default[data-v-ffd4cf06] .modal-header__name button svg,.viewer.theme--default[data-v-ffd4cf06] .modal-header__name a,.viewer.theme--default[data-v-ffd4cf06] .modal-header .icons-menu button svg,.viewer.theme--default[data-v-ffd4cf06] .modal-header .icons-menu a{color:var(--color-main-text)!important}.viewer.image--fullscreen[data-v-ffd4cf06] .modal-header .modal-header__name{opacity:0}.viewer.image--fullscreen[data-v-ffd4cf06] .modal-header .icons-menu{background-color:#0003}.viewer.image--fullscreen[data-v-ffd4cf06] .modal-wrapper .modal-container{top:0;bottom:0;height:100%}.component-fade-enter-active,.component-fade-leave-active{transition:opacity .3s ease}.component-fade-enter,.component-fade-leave-to{opacity:0}#viewer.modal-mask--dark .action-item--single.icon-menu-sidebar{background-image:url("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='16'%20width='16'%20version='1.1'%20viewbox='0%200%2016%2016'%3e%3cpath%20d='m2%202c-0.554%200-1%200.446-1%201s0.446%201%201%201h12c0.554%200%201-0.446%201-1s-0.446-1-1-1h-12zm9.717%204.0059c-1.247%200-2.1428%201.0199-2.1428%201.998%200%200.9995%200.0726%201.7127%200.5718%202.4981%200.16%200.207%200.347%200.251%200.5%200.43%200.097%200.357%200.171%200.713%200.071%201.07-0.311%200.109-0.607%200.237-0.9065%200.357-0.364-0.195-0.7863-0.357-1.1503-0.5-0.05-0.2-0.0129-0.347%200.0371-0.535%200.0856-0.089%200.163-0.129%200.2558-0.215%200.2642-0.321%200.2793-0.864%200.2793-1.2496%200-0.5712-0.5135-0.9981-1.0703-0.9981-0.6211%200-1.0723%200.5126-1.0723%200.9981h-0.0136c0%200.4996%200.0353%200.8576%200.2851%201.2496%200.0714%200.107%200.1729%200.126%200.25%200.215%200.0481%200.179%200.0859%200.357%200.0352%200.535-0.4569%200.16-0.8863%200.357-1.2832%200.571-0.2999%200.214-0.1668%200.131-0.3574%200.822-0.0886%200.357%200.928%200.521%201.6562%200.578-0.0357%200.196-0.0857%200.457-0.2285%200.957-0.2285%200.893%203.1074%201.213%204.2834%201.213%201.735%200%204.507-0.325%204.269-1.213-0.371-1.385-0.15-1.221-0.701-1.642-0.778-0.467-1.749-0.834-2.568-1.143-0.107-0.398-0.03-0.692%200.07-1.07%200.168-0.179%200.357-0.259%200.514-0.43%200.492-0.6312%200.556-1.7299%200.556-2.4981%200-1.1323-1.019-1.998-2.14-1.998zm-9.717%200.9941c-0.554%200-1%200.446-1%201s0.446%201%201%201h4.2852c0.0891-0.1855%200.2-0.3648%200.3515-0.5195%200.3721-0.3801%200.9171-0.5988%201.4883-0.6192h0.0098%200.0097c0.1729%200.017%200.3042%200.0597%200.4297%200.1426%200-0.3488%200.0747-0.6853%200.1953-1.0039h-6.7695zm0%205c-0.554%200-1%200.446-1%201s0.446%201%201%201h3.25c-0.0375-0.049-0.0777-0.09-0.1113-0.152-0.1221-0.228-0.1706-0.568-0.1035-0.838l0.0019-0.012%200.0039-0.012c0.0822-0.298%200.0556-0.322%200.1445-0.615%200.0313-0.103%200.1114-0.245%200.1993-0.371h-3.3848z'%20fill='%23fff'/%3e%3c/svg%3e")}#viewer.modal-mask--dark .action-item--single.icon-download{background-image:var(--icon-download-fff)}.ui-autocomplete{z-index:2050!important} diff --git a/css/viewer-main.css b/css/viewer-main.css index 895077000..a8181f5a4 100644 --- a/css/viewer-main.css +++ b/css/viewer-main.css @@ -1,3 +1,3 @@ /* extracted by css-entry-points-plugin */ -@import './main-DnH6w7F4.chunk.css'; +@import './main-gfnbWJ0O.chunk.css'; @import './logger-B5Yp6f8I.chunk.css'; \ No newline at end of file diff --git a/js/vendor.LICENSE.txt b/js/vendor.LICENSE.txt index 7af4c1ac3..468e13991 100644 --- a/js/vendor.LICENSE.txt +++ b/js/vendor.LICENSE.txt @@ -21,11 +21,11 @@ version: 0.7.5 license: MIT @floating-ui/core -version: 0.3.1 +version: 1.6.0 license: MIT @floating-ui/dom -version: 0.1.10 +version: 1.6.3 license: MIT @floating-ui/utils @@ -73,7 +73,7 @@ version: 2.2.0 license: GPL-3.0-or-later @nextcloud/l10n -version: 2.2.0 +version: 3.1.0 license: GPL-3.0-or-later @nextcloud/logger diff --git a/js/viewer-main.mjs b/js/viewer-main.mjs index 2c869cb7f..ed03c9173 100644 --- a/js/viewer-main.mjs +++ b/js/viewer-main.mjs @@ -6,4 +6,4 @@ import{i as O,_ as P,c as V,a as B,b as D,n as d,g as _,e as T,d as q,f as N,h a ${$()} - `,details:!0},i))).data.map(R)}const ue={computed:{previewPath(){return this.getPreviewIfAny({fileid:this.fileid,filename:this.filename,previewUrl:this.previewUrl,hasPreview:this.hasPreview,davPath:this.davPath,etag:this.$attrs.etag})},davPath(){return _({filename:this.filename,basename:this.basename})}},methods:{getPreviewIfAny(e){return G(e)}}};var u={exports:{}},me=K.platform==="win32",pe=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,x={};function fe(e){return pe.exec(e).slice(1)}x.parse=function(e){if(typeof e!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var i=fe(e);if(!i||i.length!==5)throw new TypeError("Invalid path '"+e+"'");return{root:i[1],dir:i[0]===i[1]?i[0]:i[0].slice(0,-1),base:i[2],ext:i[4],name:i[3]}};var ve=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,F={};function we(e){return ve.exec(e).slice(1)}F.parse=function(e){if(typeof e!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var i=we(e);if(!i||i.length!==5)throw new TypeError("Invalid path '"+e+"'");return{root:i[1],dir:i[0].slice(0,-1),base:i[2],ext:i[4],name:i[3]}},me?u.exports=x.parse:u.exports=F.parse,u.exports.posix=F.parse,u.exports.win32=x.parse;var ge=u.exports;const E=U(ge),ye={inheritAttrs:!1,mixins:[ue],props:{active:{type:Boolean,default:!1},basename:{type:String,required:!0},filename:{type:String,required:!0},source:{type:String,default:void 0},previewUrl:{type:String,default:void 0},hasPreview:{type:Boolean,default:!1},fileid:{type:[Number,String],required:!1},fileList:{type:Array,default:()=>[]},mime:{type:String,required:!0},canSwipe:{type:Boolean,default:!0},loaded:{type:Boolean,default:!1},isSidebarShown:{type:Boolean,default:!1},isFullScreen:{type:Boolean,default:!1},metadataFilesLivePhoto:{type:Number,default:void 0}},data(){return{height:null,width:null,naturalHeight:null,naturalWidth:null,isLoaded:!1}},computed:{name(){return E(this.basename).name},ext(){return E(this.basename).ext},src(){return this.source??this.davPath}},watch:{active(e,i){e===!0&&i===!1&&this.isLoaded&&this.doneLoading()},isSidebarShown(){setTimeout(this.updateHeightWidth,200)}},mounted(){this.$el.addEventListener("error",e=>{console.error("Error loading",this.filename,e),this.$emit("error",e)}),window.addEventListener("resize",W(()=>{this.updateHeightWidth()},100))},methods:{doneLoading(){this.$emit("update:loaded",!0),this.isLoaded=!0},updateHeightWidth(){const e=this.$parent.$el.querySelector(".modal-wrapper");if(e&&this.naturalHeight>0&&this.naturalWidth>0){const i=e.querySelector(".modal-container"),s=i.clientHeight,r=i.clientWidth,l=s/this.naturalHeight,a=r/this.naturalWidth;la&&a<1?(this.width=r,this.height=Math.round(this.naturalHeight/this.naturalWidth*r)):(this.height=this.naturalHeight,this.width=this.naturalWidth)}},enableSwipe(){this.$emit("update:canSwipe",!0)},disableSwipe(){this.$emit("update:canSwipe",!1)},toggleFullScreen(){this.isFullScreen?document.exitFullscreen():this.$el.requestFullscreen()}}},Fe={name:"DeleteIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var be=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon delete-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(s){return e.$emit("click",s)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},_e=[],xe=d(Fe,be,_e,!1,null,null);const Ce=xe.exports,Se={name:"DownloadIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Le=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon download-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(s){return e.$emit("click",s)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},Ee=[],He=d(Se,Le,Ee,!1,null,null);const Ve=He.exports,ke={name:"FullscreenIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Ae=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon fullscreen-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(s){return e.$emit("click",s)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M5,5H10V7H7V10H5V5M14,5H19V10H17V7H14V5M17,14H19V19H14V17H17V14M10,17V19H5V14H7V17H10Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},Me=[],Ie=d(ke,Ae,Me,!1,null,null);const ze=Ie.exports,Oe={name:"FullscreenExitIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Pe=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon fullscreen-exit-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(s){return e.$emit("click",s)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M14,14H19V16H16V19H14V14M5,14H10V19H8V16H5V14M8,5H10V10H5V8H8V5M19,8V10H14V5H16V8H19Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},Be=[],De=d(Oe,Pe,Be,!1,null,null);const Te=De.exports,qe={name:"PencilIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Ne=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon pencil-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(s){return e.$emit("click",s)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},$e=[],Re=d(qe,Ne,$e,!1,null,null);const Ge=Re.exports,Ke=()=>f(()=>import("./logger-C5Dz8rqM.chunk.mjs").then(e=>e.bd),__vite__mapDeps([0,1]),import.meta.url),Ue=()=>f(()=>import("./NcActionLink-DxrEm3F2.chunk.mjs"),__vite__mapDeps([2,3,0,1,4]),import.meta.url),We=()=>f(()=>import("./NcActionButton-B8a5R-dS.chunk.mjs").then(e=>e.a),__vite__mapDeps([5,0,1,3,6]),import.meta.url),je={name:"Viewer",components:{Delete:Ce,Download:Ve,Error:de,Fullscreen:ze,FullscreenExit:Te,NcActionButton:We,NcActionLink:Ue,NcModal:Ke,Pencil:Ge},filters:{uniqueKey(e){return""+e.fileid+e.source}},mixins:[se,ne],data(){return{Viewer:OCA.Viewer,Sidebar:null,handlers:OCA.Viewer.availableHandlers,components:{},mimeGroups:{},registeredHandlers:{},currentIndex:0,previousFile:{},currentFile:{},comparisonFile:null,nextFile:{},fileList:[],sortingConfig:null,isLoaded:!1,initiated:!1,editing:!1,cancelRequestFile:()=>{},cancelRequestFolder:()=>{},sidebarPosition:0,isSidebarShown:!1,isFullscreenMode:!1,canSwipe:!0,isStandalone:!1,theme:null,root:j(),handlerId:"",trapElements:[]}},computed:{downloadPath(){return this.currentFile.source??this.currentFile.davPath},hasPrevious(){return this.fileList.length>1&&(this.canLoop||!this.isStartOfList)},hasNext(){return this.fileList.length>1&&(this.canLoop||!this.isEndOfList)},file(){return this.Viewer.file},fileInfo(){return this.Viewer.fileInfo},comparisonFileInfo(){return this.Viewer.compareFileInfo},files(){return this.Viewer.files},enableSidebar(){return this.Viewer.enableSidebar},el(){return this.Viewer.el},loadMore(){return this.Viewer.loadMore},canLoop(){return this.Viewer.canLoop},canZoom(){return!this.Viewer.el},isStartOfList(){return this.currentIndex===0},isEndOfList(){return this.currentIndex===this.fileList.length-1},isImage(){return["image/jpeg","image/png","image/webp"].includes(this.currentFile?.mime)},sidebarFile(){return this.Sidebar&&this.Sidebar.file},sidebarOpenFilePath(){try{return this.currentFile?.davPath?.split(Z())[1]?.split("/")?.map(decodeURIComponent)?.join("/")}catch{return!1}},canDelete(){return this.currentFile?.permissions?.includes("D")},canDownload(){return S()&&!this.comparisonFile},canEdit(){return!this.isMobile&&S()&&this.currentFile?.permissions?.includes("W")&&this.isImage&&!this.comparisonFile&&(Q("core","config",[])["enable_non-accessible_features"]??!0)},modalClass(){return{"icon-loading":!this.currentFile.loaded&&!this.currentFile.failed,"theme--undefined":this.theme===null,"theme--dark":this.theme==="dark","theme--light":this.theme==="light","theme--default":this.theme==="default","image--fullscreen":this.isImage&&this.isFullscreenMode}},showComparison(){return!this.isMobile},contentClass(){return{"viewer--split":this.comparisonFile}},isSameFile(){return(e=null,i=null)=>!!(i&&i===this.currentFile.path&&!this.currentFile.source||e&&e.fileid===this.currentFile.fileid&&e.mtime&&e.mtime===this.currentFile.mtime&&e.source&&e.source===this.currentFile.source)}},watch:{el(e){n.info(e),this.$nextTick(()=>{const i=document.getElementById("viewer");if(e){const s=document.querySelector(e);s?s.appendChild(i):n.warn("Could not find element ",{element:e})}else document.body.appendChild(i)})},file(e){e&&e.trim()!==""?(n.info("Opening viewer for file ",{path:e}),this.openFile(e,OCA.Viewer.overrideHandlerId)):this.cleanup()},fileInfo(e){e?(n.info("Opening viewer for fileInfo ",{fileInfo:e}),this.openFileInfo(e,OCA.Viewer.overrideHandlerId)):this.cleanup()},comparisonFileInfo(e){e?(n.info("Opening viewer for comparisonFileInfo ",{fileInfo:e}),this.compareFile(e)):this.cleanup()},files(e){const i=e.findIndex(s=>s.filename===this.currentFile.filename);i>-1&&(this.currentIndex=i,n.debug("The files list changed, new current file index is "+i)),this.fileList=e},async isEndOfList(e){if(e&&this.loadMore&&typeof this.loadMore=="function"){n.debug("Fetching additional files...");const i=await this.loadMore();Array.isArray(i)&&i.length>0&&this.fileList.push(...i)}}},beforeMount(){this.isStandalone=window.OCP?.Files===void 0&&window.OCA?.Files?.fileActions===void 0,this.isStandalone&&n.info("No OCP.Files app found, viewer is now in standalone mode"),document.addEventListener("DOMContentLoaded",()=>{this.handlers.forEach(e=>{this.registerHandler(e)}),this.handlers.forEach(e=>{this.registerHandlerAlias(e)}),this.isLoaded=!0,OCA?.Files?.Sidebar&&(this.Sidebar=OCA.Files.Sidebar.state),n.info(`${this.handlers.length} viewer handlers registered`,{handlers:this.handlers})}),window.addEventListener("resize",this.onResize)},mounted(){p("files:sidebar:opened",this.handleAppSidebarOpen),p("files:sidebar:closed",this.handleAppSidebarClose),p("files:node:updated",this.handleFileUpdated),p("viewer:trapElements:changed",this.handleTrapElementsChange),window.addEventListener("keydown",this.keyboardDeleteFile),window.addEventListener("keydown",this.keyboardDownloadFile),window.addEventListener("keydown",this.keyboardEditFile),this.addFullscreenEventListeners()},beforeDestroy(){window.removeEventListener("resize",this.onResize)},destroyed(){v("files:sidebar:opened",this.handleAppSidebarOpen),v("files:sidebar:closed",this.handleAppSidebarClose),v("viewer:trapElements:changed",this.handleTrapElementsChange),window.removeEventListener("keydown",this.keyboardDeleteFile),window.removeEventListener("keydown",this.keyboardDownloadFile),window.removeEventListener("keydown",this.keyboardEditFile),this.removeFullscreenEventListeners()},methods:{async beforeOpen(){this.initiated=!0,OCA?.Files?.Sidebar?.setFullScreenMode&&OCA.Files.Sidebar.setFullScreenMode(!0),this.sortingConfig=await te(),window.loadRoboto&&(n.debug("⚠️ Loading roboto font for visual regression tests"),f(()=>Promise.resolve({}),__vite__mapDeps([7]),import.meta.url),delete window.loadRoboto)},async openFile(e,i=null){if(await this.beforeOpen(),this.cancelRequestFile(),this.isSameFile(null,e))return;const{request:s,cancel:r}=L(X);this.cancelRequestFile=r;const[,l]=C(e);this.el||(document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden");const a=document.getElementsByTagName("head")[0].getElementsByTagName("title")[0];a&&!a.dataset.old&&(a.dataset.old=document.title,this.updateTitle(l));try{const o=await s(e);console.debug("File info for "+e+" fetched",o),await this.openFileInfo(o,i)}catch(o){o?.response?.status===404?(n.error("The file no longer exists, error: ",{error:o}),w(t("viewer","This file no longer exists")),this.close()):console.error("Could not open file "+e,o)}},async openFileInfo(e,i=null){if(this.beforeOpen(),this.cancelRequestFolder(),this.isSameFile(e))return;const s=e.mime,r=s.split("/")[0];let l;if(i!==null&&(l=Object.values(this.registeredHandlers).find(o=>o.id===i)??l),l||(l=this.registeredHandlers[s]??this.registeredHandlers[r]),!l){n.error("The following file could not be displayed",{fileInfo:e}),w(t("viewer","There is no plugin available to display this file type")),this.close();return}this.theme=l.theme??"dark",this.handlerId=l.id;const a=this.mimeGroups[s];if(this.files&&this.files.length>0)n.debug("A files list have been provided. No folder content will be fetched."),this.fileList=this.files,this.currentIndex=this.fileList.findIndex(o=>o.filename===e.filename);else if(a&&this.el===null){const o=this.mimeGroups[a]?this.mimeGroups[a]:[s],{request:k,cancel:A}=L(he);this.cancelRequestFolder=A;const[M]=C(e.filename),I=(await k(M)).filter(c=>c.mime&&o.indexOf(c.mime)!==-1);this.fileList=I.sort((c,z)=>Y(c,z,this.sortingConfig.key,this.sortingConfig.asc)),this.currentIndex=this.fileList.findIndex(c=>c.filename===e.filename)}else this.currentIndex=0,this.fileList=[e];e=this.fileList[this.currentIndex],this.currentFile=new h(e,s,l.component),this.comparisonFile=null,this.updatePreviousNext(),this.changeSidebar()},openFileFromList(e){const i=e.mime;this.currentFile=new h(e,i,this.components[i]),this.changeSidebar(),this.updatePreviousNext()},async compareFile(e){this.comparisonFile=new h(e,e.mime,this.components[e.mime])},changeSidebar(){this.sidebarFile&&this.showSidebar()},updatePreviousNext(){const e=this.fileList[this.currentIndex-1],i=this.fileList[this.currentIndex+1];if(e){const s=e.mime;this.components[s]&&(this.previousFile=new h(e,s,this.components[s]))}else this.previousFile=null;if(i){const s=i.mime;this.components[s]&&(this.nextFile=new h(i,s,this.components[s]))}else this.nextFile=null},updateTitle(e){document.title=`${e} - ${OCA.Theming?.name??oc_defaults.name}`},registerHandler(e){if(e.id&&Object.values(this.registeredHandlers).findIndex(i=>i.id===e.id)>-1){n.error("The following handler is already registered",{handler:e});return}if(!e.id||e.id.trim()===""||typeof e.id!="string"){n.error("The following handler doesn't have a valid id",{handler:e});return}if(!(!(e.mimes&&Array.isArray(e.mimes))&&e.mimesAliases)){if(!(e.mimes&&Array.isArray(e.mimes))&&!e.mimesAliases){n.error("The following handler doesn't have a valid mime array",{handler:e});return}if(!e.component||typeof e.component!="object"&&typeof e.component!="function"){n.error("The following handler doesn't have a valid component",{handler:e});return}e.component.mixins=[...e?.component?.mixins??[],ye],e.mimes&&e.mimes.forEach(i=>{if(this.components[i]){n.error("The following mime is already registered",{mime:i,handler:e});return}this.registerLegacyAction({mime:i,group:e.group}),this.registerGroups({mime:i,group:e.group}),this.components[i]=e.component,m.component(e.component.name,e.component),this.registeredHandlers[i]=e})}},registerHandlerAlias(e){e.mimesAliases&&Object.keys(e.mimesAliases).forEach(i=>{if(e.mimesAliases&&typeof e.mimesAliases!="object"){n.error("The following handler doesn't have a valid mimesAliases object",{handler:e});return}const s=e.mimesAliases[i];if(this.components[i]){n.error("The following mime is already registered",{mime:i,handler:e});return}if(!this.components[s]){n.error("The requested alias does not exists",{alias:s,mime:i,handler:e});return}this.registerLegacyAction({mime:i,group:this.mimeGroups[s]}),this.registerGroups({mime:i,group:this.mimeGroups[s]}),this.components[i]=this.components[s],this.registeredHandlers[i]=e})},registerLegacyAction({mime:e,group:i}){!this.isStandalone&&OCA?.Files?.fileActions&&(OCA.Files.fileActions.registerAction({name:"view",displayName:t("viewer","View"),mime:e,permissions:OC.PERMISSION_READ,actionHandler:ce}),OCA.Files.fileActions.setDefault(e,"view"),n.debug("Legacy file action registered for mime "+e,{mime:e,group:i})),i&&(this.mimeGroups[e]=i,this.mimeGroups[i]||(this.mimeGroups[i]=[]),this.mimeGroups[i].push(e))},registerGroups({mime:e,group:i}){i&&(this.mimeGroups[e]=i,this.mimeGroups[i]||(this.mimeGroups[i]=[]),this.mimeGroups[i].push(e))},close(){OCA.Viewer.close(),OCA?.Files?.Sidebar&&OCA.Files.Sidebar.setFullScreenMode(!1),this.isFullscreenMode&&this.exitFullscreen()},keyboardDeleteFile(e){this.canDelete&&e.key==="Delete"&&e.ctrlKey===!0&&this.onDelete()},keyboardDownloadFile(e){if(e.key==="s"&&e.ctrlKey===!0&&(e.preventDefault(),this.canDownload)){const i=document.createElement("a");i.href=this.currentFile.davPath,i.download=this.currentFile.basename,document.body.appendChild(i),i.click(),document.body.removeChild(i)}},keyboardEditFile(e){e.key==="e"&&e.ctrlKey===!0&&(e.preventDefault(),this.canEdit&&this.onEdit())},cleanup(){this.currentFile={},this.comparisonFile=null,this.currentModal=null,this.fileList=[],this.initiated=!1,this.theme=null,this.cancelRequestFile(),this.cancelRequestFolder(),document.body.style.overflow=null,document.documentElement.style.overflow=null,this.Viewer.onClose();const e=document.getElementsByTagName("head")[0].getElementsByTagName("title")[0];e&&e.dataset.old&&(document.title=e.dataset.old,delete e.dataset.old)},previous(){this.currentIndex--,this.currentIndex<0&&(this.currentIndex=this.fileList.length-1);const e=this.fileList[this.currentIndex];this.openFileFromList(e),this.Viewer.onPrev(e),this.updateTitle(this.currentFile.basename)},next(){this.currentIndex++,this.currentIndex>this.fileList.length-1&&(this.currentIndex=0);const e=this.fileList[this.currentIndex];this.openFileFromList(e),this.Viewer.onNext(e),this.updateTitle(this.currentFile.basename)},comparisonFailed(){this.comparisonFile.failed=!0},previousFailed(){this.previousFile.failed=!0},currentFailed(){this.currentFile.failed=!0},nextFailed(){this.nextFile.failed=!0},async showSidebar(){this.enableSidebar&&OCA?.Files?.Sidebar&&await OCA.Files.Sidebar.open(this.sidebarOpenFilePath)},handleAppSidebarOpen(){this.isSidebarShown=!0;const e=document.querySelector("aside.app-sidebar");e&&(this.sidebarPosition=e.getBoundingClientRect().left,this.trapElements=[e])},handleAppSidebarClose(){this.isSidebarShown=!1,this.trapElements=[]},async handleFileUpdated(e){const i=this.fileList.findIndex(({fileid:s})=>s===e.fileid);e.etag=e.attributes.etag,this.fileList.splice(i,1,e),e.fileid===this.currentFile.fileid&&(this.currentFile.etag=e.attributes.etag)},onResize(){const e=document.querySelector("aside.app-sidebar");e&&(this.sidebarPosition=e.getBoundingClientRect().left)},async onDelete(){try{const e=this.currentFile.fileid,i=this.source??this.currentFile.davPath;await V.delete(i),J("files:node:deleted",{fileid:e});const s=this.fileList.findIndex(r=>r.filename===this.currentFile.filename);this.hasPrevious||this.hasNext?(this.hasPrevious?this.previous():this.next(),this.fileList.splice(s,1)):this.close()}catch(e){console.error(e),w(e)}},onEdit(){this.editing=!0},handleTrapElementsChange(e){this.trapElements.push(e)},toggleFullScreen(){this.isFullscreenMode?this.exitFullscreen():this.requestFullscreen()},requestFullscreen(){const e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()},exitFullscreen(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()},addFullscreenEventListeners(){document.addEventListener("fullscreenchange",this.onFullscreenchange),document.addEventListener("webkitfullscreenchange",this.onFullscreenchange)},removeFullscreenEventListeners(){document.addEventListener("fullscreenchange",this.onFullscreenchange),document.addEventListener("webkitfullscreenchange",this.onFullscreenchange)},onFullscreenchange(){document.fullscreenElement===document.documentElement||document.webkitFullscreenElement===document.documentElement?this.isFullscreenMode=!0:this.isFullscreenMode=!1}}};var Ze=function(){var e=this,i=e._self._c;return e.el?i("div",{attrs:{id:"viewer","data-handler":e.handlerId}},[e.currentFile.failed?i("Error",{attrs:{name:e.currentFile.basename}}):i(e.currentFile.modal,e._b({key:e._f("uniqueKey")(e.currentFile),ref:"content",tag:"component",staticClass:"viewer__file viewer__file--active",attrs:{active:!0,"can-swipe":!1,"file-list":[e.currentFile],"is-full-screen":!1,loaded:e.currentFile.loaded,"is-sidebar-shown":!1},on:{"update:loaded":function(s){return e.$set(e.currentFile,"loaded",s)},error:e.currentFailed}},"component",e.currentFile,!1))],1):e.initiated||e.currentFile.modal?i("NcModal",{staticClass:"viewer",class:e.modalClass,style:{width:e.isSidebarShown?`${e.sidebarPosition}px`:null},attrs:{id:"viewer","additional-trap-elements":e.trapElements,"clear-view-delay":-1,"close-button-contained":!1,dark:!0,"data-handler":e.handlerId,"enable-slideshow":e.hasPrevious||e.hasNext,"slideshow-paused":e.editing,"enable-swipe":e.canSwipe&&!e.editing,"has-next":e.hasNext,"has-previous":e.hasPrevious,"inline-actions":e.canEdit?1:0,"spread-navigation":!0,name:e.currentFile.basename,view:e.currentFile.modal,size:"full"},on:{close:e.close,previous:e.previous,next:e.next},scopedSlots:e._u([{key:"actions",fn:function(){return[e.canEdit?i("NcActionButton",{attrs:{"close-after-click":!0},on:{click:e.onEdit},scopedSlots:e._u([{key:"icon",fn:function(){return[i("Pencil",{attrs:{size:20}})]},proxy:!0}],null,!1,580569589)},[e._v(" "+e._s(e.t("viewer","Edit"))+" ")]):e._e(),i("NcActionButton",{attrs:{"close-after-click":!0},on:{click:e.toggleFullScreen},scopedSlots:e._u([{key:"icon",fn:function(){return[e.isFullscreenMode?i("FullscreenExit",{attrs:{size:20}}):i("Fullscreen",{attrs:{size:20}})]},proxy:!0}])},[e._v(" "+e._s(e.isFullscreenMode?e.t("viewer","Exit full screen"):e.t("viewer","Full screen"))+" ")]),e.enableSidebar&&e.Sidebar&&e.sidebarOpenFilePath&&!e.isSidebarShown?i("NcActionButton",{attrs:{"close-after-click":!0,icon:"icon-menu-sidebar"},on:{click:e.showSidebar}},[e._v(" "+e._s(e.t("viewer","Open sidebar"))+" ")]):e._e(),e.canDownload?i("NcActionLink",{attrs:{download:e.currentFile.basename,"close-after-click":!0,href:e.downloadPath},scopedSlots:e._u([{key:"icon",fn:function(){return[i("Download",{attrs:{size:24}})]},proxy:!0}],null,!1,3874636280)},[e._v(" "+e._s(e.t("viewer","Download"))+" ")]):e._e(),e.canDelete?i("NcActionButton",{attrs:{"close-after-click":!0},on:{click:e.onDelete},scopedSlots:e._u([{key:"icon",fn:function(){return[i("Delete",{attrs:{size:22}})]},proxy:!0}],null,!1,2429175571)},[e._v(" "+e._s(e.t("viewer","Delete"))+" ")]):e._e()]},proxy:!0}])},[i("div",{staticClass:"viewer__content",class:e.contentClass,on:{click:function(s){return s.target!==s.currentTarget||s.ctrlKey||s.shiftKey||s.altKey||s.metaKey?null:e.close.apply(null,arguments)}}},[e.comparisonFile&&!e.comparisonFile.failed&&e.showComparison?i("div",{staticClass:"viewer__file-wrapper"},[i(e.comparisonFile.modal,e._b({key:e._f("uniqueKey")(e.comparisonFile),ref:"comparison-content",tag:"component",staticClass:"viewer__file viewer__file--active",attrs:{active:!0,"can-swipe":!1,"can-zoom":!1,editing:!1,"is-full-screen":e.isFullscreen,"is-sidebar-shown":e.isSidebarShown,loaded:e.comparisonFile.loaded},on:{"update:loaded":function(s){return e.$set(e.comparisonFile,"loaded",s)},error:e.comparisonFailed}},"component",e.comparisonFile,!1))],1):e._e(),e.previousFile?i("div",{key:e._f("uniqueKey")(e.previousFile),staticClass:"viewer__file-wrapper viewer__file-wrapper--hidden",attrs:{"aria-hidden":"true",inert:""}},[e.previousFile.failed?i("Error",{attrs:{name:e.previousFile.basename}}):i(e.previousFile.modal,e._b({ref:"previous-content",tag:"component",staticClass:"viewer__file",attrs:{"file-list":e.fileList},on:{error:e.previousFailed}},"component",e.previousFile,!1))],1):e._e(),i("div",{key:e._f("uniqueKey")(e.currentFile),staticClass:"viewer__file-wrapper"},[e.currentFile.failed?i("Error",{attrs:{name:e.currentFile.basename}}):i(e.currentFile.modal,e._b({ref:"content",tag:"component",staticClass:"viewer__file viewer__file--active",attrs:{active:!0,"can-swipe":e.canSwipe,"can-zoom":e.canZoom,editing:e.editing,"file-list":e.fileList,"is-full-screen":e.isFullscreen,"is-sidebar-shown":e.isSidebarShown,loaded:e.currentFile.loaded},on:{"update:canSwipe":function(s){e.canSwipe=s},"update:can-swipe":function(s){e.canSwipe=s},"update:editing":function(s){e.editing=s},"update:loaded":function(s){return e.$set(e.currentFile,"loaded",s)},error:e.currentFailed}},"component",e.currentFile,!1))],1),e.nextFile?i("div",{key:e._f("uniqueKey")(e.nextFile),staticClass:"viewer__file-wrapper viewer__file-wrapper--hidden",attrs:{"aria-hidden":"true",inert:""}},[e.nextFile.failed?i("Error",{attrs:{name:e.nextFile.basename}}):i(e.nextFile.modal,e._b({ref:"next-content",tag:"component",staticClass:"viewer__file",attrs:{"file-list":e.fileList},on:{error:e.nextFailed}},"component",e.nextFile,!1))],1):e._e()])]):e._e()},Qe=[],Ye=d(je,Ze,Qe,!1,null,"7e5fc6c2");const Je=Ye.exports;m.mixin({methods:{t:ee}}),m.prototype.OC=window.OC,m.prototype.OCA=window.OCA;const H=document.createElement("div");H.id="viewer",document.body.appendChild(H);const b=document.createElement("div");b.innerHTML='',b.style.display="none",document.body.appendChild(b),new m({el:"#viewer",name:"ViewerRoot",render:e=>e(Je)}); + `,details:!0},i))).data.map(R)}const ue={computed:{previewPath(){return this.getPreviewIfAny({fileid:this.fileid,filename:this.filename,previewUrl:this.previewUrl,hasPreview:this.hasPreview,davPath:this.davPath,etag:this.$attrs.etag})},davPath(){return _({filename:this.filename,basename:this.basename})}},methods:{getPreviewIfAny(e){return G(e)}}};var u={exports:{}},me=K.platform==="win32",pe=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,x={};function fe(e){return pe.exec(e).slice(1)}x.parse=function(e){if(typeof e!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var i=fe(e);if(!i||i.length!==5)throw new TypeError("Invalid path '"+e+"'");return{root:i[1],dir:i[0]===i[1]?i[0]:i[0].slice(0,-1),base:i[2],ext:i[4],name:i[3]}};var ve=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,F={};function we(e){return ve.exec(e).slice(1)}F.parse=function(e){if(typeof e!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var i=we(e);if(!i||i.length!==5)throw new TypeError("Invalid path '"+e+"'");return{root:i[1],dir:i[0].slice(0,-1),base:i[2],ext:i[4],name:i[3]}},me?u.exports=x.parse:u.exports=F.parse,u.exports.posix=F.parse,u.exports.win32=x.parse;var ge=u.exports;const E=U(ge),ye={inheritAttrs:!1,mixins:[ue],props:{active:{type:Boolean,default:!1},basename:{type:String,required:!0},filename:{type:String,required:!0},source:{type:String,default:void 0},previewUrl:{type:String,default:void 0},hasPreview:{type:Boolean,default:!1},fileid:{type:[Number,String],required:!1},fileList:{type:Array,default:()=>[]},mime:{type:String,required:!0},canSwipe:{type:Boolean,default:!0},loaded:{type:Boolean,default:!1},isSidebarShown:{type:Boolean,default:!1},isFullScreen:{type:Boolean,default:!1},metadataFilesLivePhoto:{type:Number,default:void 0}},data(){return{height:null,width:null,naturalHeight:null,naturalWidth:null,isLoaded:!1}},computed:{name(){return E(this.basename).name},ext(){return E(this.basename).ext},src(){return this.source??this.davPath}},watch:{active(e,i){e===!0&&i===!1&&this.isLoaded&&this.doneLoading()},isSidebarShown(){setTimeout(this.updateHeightWidth,200)}},mounted(){this.$el.addEventListener("error",e=>{console.error("Error loading",this.filename,e),this.$emit("error",e)}),window.addEventListener("resize",W(()=>{this.updateHeightWidth()},100))},methods:{doneLoading(){this.$emit("update:loaded",!0),this.isLoaded=!0},updateHeightWidth(){const e=this.$parent.$el.querySelector(".modal-wrapper");if(e&&this.naturalHeight>0&&this.naturalWidth>0){const i=e.querySelector(".modal-container"),s=i.clientHeight,r=i.clientWidth,l=s/this.naturalHeight,a=r/this.naturalWidth;la&&a<1?(this.width=r,this.height=Math.round(this.naturalHeight/this.naturalWidth*r)):(this.height=this.naturalHeight,this.width=this.naturalWidth)}},enableSwipe(){this.$emit("update:canSwipe",!0)},disableSwipe(){this.$emit("update:canSwipe",!1)},toggleFullScreen(){this.isFullScreen?document.exitFullscreen():this.$el.requestFullscreen()}}},Fe={name:"DeleteIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var be=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon delete-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(s){return e.$emit("click",s)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},_e=[],xe=d(Fe,be,_e,!1,null,null);const Ce=xe.exports,Se={name:"DownloadIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Le=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon download-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(s){return e.$emit("click",s)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},Ee=[],He=d(Se,Le,Ee,!1,null,null);const Ve=He.exports,ke={name:"FullscreenIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Ae=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon fullscreen-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(s){return e.$emit("click",s)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M5,5H10V7H7V10H5V5M14,5H19V10H17V7H14V5M17,14H19V19H14V17H17V14M10,17V19H5V14H7V17H10Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},Me=[],Ie=d(ke,Ae,Me,!1,null,null);const ze=Ie.exports,Oe={name:"FullscreenExitIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Pe=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon fullscreen-exit-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(s){return e.$emit("click",s)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M14,14H19V16H16V19H14V14M5,14H10V19H8V16H5V14M8,5H10V10H5V8H8V5M19,8V10H14V5H16V8H19Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},Be=[],De=d(Oe,Pe,Be,!1,null,null);const Te=De.exports,qe={name:"PencilIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Ne=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon pencil-icon",attrs:{"aria-hidden":e.title?null:!0,"aria-label":e.title,role:"img"},on:{click:function(s){return e.$emit("click",s)}}},"span",e.$attrs,!1),[i("svg",{staticClass:"material-design-icon__svg",attrs:{fill:e.fillColor,width:e.size,height:e.size,viewBox:"0 0 24 24"}},[i("path",{attrs:{d:"M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},$e=[],Re=d(qe,Ne,$e,!1,null,null);const Ge=Re.exports,Ke=()=>f(()=>import("./logger-C5Dz8rqM.chunk.mjs").then(e=>e.bd),__vite__mapDeps([0,1]),import.meta.url),Ue=()=>f(()=>import("./NcActionLink-DxrEm3F2.chunk.mjs"),__vite__mapDeps([2,3,0,1,4]),import.meta.url),We=()=>f(()=>import("./NcActionButton-B8a5R-dS.chunk.mjs").then(e=>e.a),__vite__mapDeps([5,0,1,3,6]),import.meta.url),je={name:"Viewer",components:{Delete:Ce,Download:Ve,Error:de,Fullscreen:ze,FullscreenExit:Te,NcActionButton:We,NcActionLink:Ue,NcModal:Ke,Pencil:Ge},filters:{uniqueKey(e){return""+e.fileid+e.source}},mixins:[se,ne],data(){return{Viewer:OCA.Viewer,Sidebar:null,handlers:OCA.Viewer.availableHandlers,components:{},mimeGroups:{},registeredHandlers:{},currentIndex:0,previousFile:{},currentFile:{},comparisonFile:null,nextFile:{},fileList:[],sortingConfig:null,isLoaded:!1,initiated:!1,editing:!1,cancelRequestFile:()=>{},cancelRequestFolder:()=>{},sidebarPosition:0,isSidebarShown:!1,isFullscreenMode:!1,canSwipe:!0,isStandalone:!1,theme:null,root:j(),handlerId:"",trapElements:[]}},computed:{downloadPath(){return this.currentFile.source??this.currentFile.davPath},hasPrevious(){return this.fileList.length>1&&(this.canLoop||!this.isStartOfList)},hasNext(){return this.fileList.length>1&&(this.canLoop||!this.isEndOfList)},file(){return this.Viewer.file},fileInfo(){return this.Viewer.fileInfo},comparisonFileInfo(){return this.Viewer.compareFileInfo},files(){return this.Viewer.files},enableSidebar(){return this.Viewer.enableSidebar},el(){return this.Viewer.el},loadMore(){return this.Viewer.loadMore},canLoop(){return this.Viewer.canLoop},canZoom(){return!this.Viewer.el},isStartOfList(){return this.currentIndex===0},isEndOfList(){return this.currentIndex===this.fileList.length-1},isImage(){return["image/jpeg","image/png","image/webp"].includes(this.currentFile?.mime)},sidebarFile(){return this.Sidebar&&this.Sidebar.file},sidebarOpenFilePath(){try{return this.currentFile?.davPath?.split(Z())[1]?.split("/")?.map(decodeURIComponent)?.join("/")}catch{return!1}},canDelete(){return this.currentFile?.permissions?.includes("D")},canDownload(){return S()&&!this.comparisonFile},canEdit(){return!this.isMobile&&S()&&this.currentFile?.permissions?.includes("W")&&this.isImage&&!this.comparisonFile&&(Q("core","config",[])["enable_non-accessible_features"]??!0)},modalClass(){return{"icon-loading":!this.currentFile.loaded&&!this.currentFile.failed,"theme--undefined":this.theme===null,"theme--dark":this.theme==="dark","theme--light":this.theme==="light","theme--default":this.theme==="default","image--fullscreen":this.isImage&&this.isFullscreenMode}},showComparison(){return!this.isMobile},contentClass(){return{"viewer--split":this.comparisonFile}},isSameFile(){return(e=null,i=null)=>!!(i&&i===this.currentFile.path&&!this.currentFile.source||e&&e.fileid===this.currentFile.fileid&&e.mtime&&e.mtime===this.currentFile.mtime&&e.source&&e.source===this.currentFile.source)}},watch:{el(e){n.info(e),this.$nextTick(()=>{const i=document.getElementById("viewer");if(e){const s=document.querySelector(e);s?s.appendChild(i):n.warn("Could not find element ",{element:e})}else document.body.appendChild(i)})},file(e){e&&e.trim()!==""?(n.info("Opening viewer for file ",{path:e}),this.openFile(e,OCA.Viewer.overrideHandlerId)):this.cleanup()},fileInfo(e){e?(n.info("Opening viewer for fileInfo ",{fileInfo:e}),this.openFileInfo(e,OCA.Viewer.overrideHandlerId)):this.cleanup()},comparisonFileInfo(e){e?(n.info("Opening viewer for comparisonFileInfo ",{fileInfo:e}),this.compareFile(e)):this.cleanup()},files(e){const i=e.findIndex(s=>s.filename===this.currentFile.filename);i>-1&&(this.currentIndex=i,n.debug("The files list changed, new current file index is "+i)),this.fileList=e},async isEndOfList(e){if(e&&this.loadMore&&typeof this.loadMore=="function"){n.debug("Fetching additional files...");const i=await this.loadMore();Array.isArray(i)&&i.length>0&&this.fileList.push(...i)}}},beforeMount(){this.isStandalone=window.OCP?.Files===void 0&&window.OCA?.Files?.fileActions===void 0,this.isStandalone&&n.info("No OCP.Files app found, viewer is now in standalone mode"),document.addEventListener("DOMContentLoaded",()=>{this.handlers.forEach(e=>{this.registerHandler(e)}),this.handlers.forEach(e=>{this.registerHandlerAlias(e)}),this.isLoaded=!0,OCA?.Files?.Sidebar&&(this.Sidebar=OCA.Files.Sidebar.state),n.info(`${this.handlers.length} viewer handlers registered`,{handlers:this.handlers})}),window.addEventListener("resize",this.onResize)},mounted(){p("files:sidebar:opened",this.handleAppSidebarOpen),p("files:sidebar:closed",this.handleAppSidebarClose),p("files:node:updated",this.handleFileUpdated),p("viewer:trapElements:changed",this.handleTrapElementsChange),window.addEventListener("keydown",this.keyboardDeleteFile),window.addEventListener("keydown",this.keyboardDownloadFile),window.addEventListener("keydown",this.keyboardEditFile),this.addFullscreenEventListeners()},beforeDestroy(){window.removeEventListener("resize",this.onResize)},destroyed(){v("files:sidebar:opened",this.handleAppSidebarOpen),v("files:sidebar:closed",this.handleAppSidebarClose),v("viewer:trapElements:changed",this.handleTrapElementsChange),window.removeEventListener("keydown",this.keyboardDeleteFile),window.removeEventListener("keydown",this.keyboardDownloadFile),window.removeEventListener("keydown",this.keyboardEditFile),this.removeFullscreenEventListeners()},methods:{async beforeOpen(){this.initiated=!0,OCA?.Files?.Sidebar?.setFullScreenMode&&OCA.Files.Sidebar.setFullScreenMode(!0),this.sortingConfig=await te(),window.loadRoboto&&(n.debug("⚠️ Loading roboto font for visual regression tests"),f(()=>Promise.resolve({}),__vite__mapDeps([7]),import.meta.url),delete window.loadRoboto)},async openFile(e,i=null){if(await this.beforeOpen(),this.cancelRequestFile(),this.isSameFile(null,e))return;const{request:s,cancel:r}=L(X);this.cancelRequestFile=r;const[,l]=C(e);this.el||(document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden");const a=document.getElementsByTagName("head")[0].getElementsByTagName("title")[0];a&&!a.dataset.old&&(a.dataset.old=document.title,this.updateTitle(l));try{const o=await s(e);console.debug("File info for "+e+" fetched",o),await this.openFileInfo(o,i)}catch(o){o?.response?.status===404?(n.error("The file no longer exists, error: ",{error:o}),w(t("viewer","This file no longer exists")),this.close()):console.error("Could not open file "+e,o)}},async openFileInfo(e,i=null){if(this.beforeOpen(),this.cancelRequestFolder(),this.isSameFile(e))return;const s=e.mime,r=s.split("/")[0];let l;if(i!==null&&(l=Object.values(this.registeredHandlers).find(o=>o.id===i)??l),l||(l=this.registeredHandlers[s]??this.registeredHandlers[r]),!l){n.error("The following file could not be displayed",{fileInfo:e}),w(t("viewer","There is no plugin available to display this file type")),this.close();return}this.theme=l.theme??"dark",this.handlerId=l.id;const a=this.mimeGroups[s];if(this.files&&this.files.length>0)n.debug("A files list have been provided. No folder content will be fetched."),this.fileList=this.files,this.currentIndex=this.fileList.findIndex(o=>o.filename===e.filename);else if(a&&this.el===null){const o=this.mimeGroups[a]?this.mimeGroups[a]:[s],{request:k,cancel:A}=L(he);this.cancelRequestFolder=A;const[M]=C(e.filename),I=(await k(M)).filter(c=>c.mime&&o.indexOf(c.mime)!==-1);this.fileList=I.sort((c,z)=>Y(c,z,this.sortingConfig.key,this.sortingConfig.asc)),this.currentIndex=this.fileList.findIndex(c=>c.filename===e.filename)}else this.currentIndex=0,this.fileList=[e];e=this.fileList[this.currentIndex],this.currentFile=new h(e,s,l.component),this.comparisonFile=null,this.updatePreviousNext(),this.changeSidebar()},openFileFromList(e){const i=e.mime;this.currentFile=new h(e,i,this.components[i]),this.changeSidebar(),this.updatePreviousNext()},async compareFile(e){this.comparisonFile=new h(e,e.mime,this.components[e.mime])},changeSidebar(){this.sidebarFile&&this.showSidebar()},updatePreviousNext(){const e=this.fileList[this.currentIndex-1],i=this.fileList[this.currentIndex+1];if(e){const s=e.mime;this.components[s]&&(this.previousFile=new h(e,s,this.components[s]))}else this.previousFile=null;if(i){const s=i.mime;this.components[s]&&(this.nextFile=new h(i,s,this.components[s]))}else this.nextFile=null},updateTitle(e){document.title=`${e} - ${OCA.Theming?.name??oc_defaults.name}`},registerHandler(e){if(e.id&&Object.values(this.registeredHandlers).findIndex(i=>i.id===e.id)>-1){n.error("The following handler is already registered",{handler:e});return}if(!e.id||e.id.trim()===""||typeof e.id!="string"){n.error("The following handler doesn't have a valid id",{handler:e});return}if(!(!(e.mimes&&Array.isArray(e.mimes))&&e.mimesAliases)){if(!(e.mimes&&Array.isArray(e.mimes))&&!e.mimesAliases){n.error("The following handler doesn't have a valid mime array",{handler:e});return}if(!e.component||typeof e.component!="object"&&typeof e.component!="function"){n.error("The following handler doesn't have a valid component",{handler:e});return}e.component.mixins=[...e?.component?.mixins??[],ye],e.mimes&&e.mimes.forEach(i=>{if(this.components[i]){n.error("The following mime is already registered",{mime:i,handler:e});return}this.registerLegacyAction({mime:i,group:e.group}),this.registerGroups({mime:i,group:e.group}),this.components[i]=e.component,m.component(e.component.name,e.component),this.registeredHandlers[i]=e})}},registerHandlerAlias(e){e.mimesAliases&&Object.keys(e.mimesAliases).forEach(i=>{if(e.mimesAliases&&typeof e.mimesAliases!="object"){n.error("The following handler doesn't have a valid mimesAliases object",{handler:e});return}const s=e.mimesAliases[i];if(this.components[i]){n.error("The following mime is already registered",{mime:i,handler:e});return}if(!this.components[s]){n.error("The requested alias does not exists",{alias:s,mime:i,handler:e});return}this.registerLegacyAction({mime:i,group:this.mimeGroups[s]}),this.registerGroups({mime:i,group:this.mimeGroups[s]}),this.components[i]=this.components[s],this.registeredHandlers[i]=e})},registerLegacyAction({mime:e,group:i}){!this.isStandalone&&OCA?.Files?.fileActions&&(OCA.Files.fileActions.registerAction({name:"view",displayName:t("viewer","View"),mime:e,permissions:OC.PERMISSION_READ,actionHandler:ce}),OCA.Files.fileActions.setDefault(e,"view"),n.debug("Legacy file action registered for mime "+e,{mime:e,group:i})),i&&(this.mimeGroups[e]=i,this.mimeGroups[i]||(this.mimeGroups[i]=[]),this.mimeGroups[i].push(e))},registerGroups({mime:e,group:i}){i&&(this.mimeGroups[e]=i,this.mimeGroups[i]||(this.mimeGroups[i]=[]),this.mimeGroups[i].push(e))},close(){OCA.Viewer.close(),OCA?.Files?.Sidebar&&OCA.Files.Sidebar.setFullScreenMode(!1),this.isFullscreenMode&&this.exitFullscreen()},keyboardDeleteFile(e){this.canDelete&&e.key==="Delete"&&e.ctrlKey===!0&&this.onDelete()},keyboardDownloadFile(e){if(e.key==="s"&&e.ctrlKey===!0&&(e.preventDefault(),this.canDownload)){const i=document.createElement("a");i.href=this.currentFile.davPath,i.download=this.currentFile.basename,document.body.appendChild(i),i.click(),document.body.removeChild(i)}},keyboardEditFile(e){e.key==="e"&&e.ctrlKey===!0&&(e.preventDefault(),this.canEdit&&this.onEdit())},cleanup(){this.currentFile={},this.comparisonFile=null,this.currentModal=null,this.fileList=[],this.initiated=!1,this.theme=null,this.cancelRequestFile(),this.cancelRequestFolder(),document.body.style.overflow=null,document.documentElement.style.overflow=null,this.Viewer.onClose();const e=document.getElementsByTagName("head")[0].getElementsByTagName("title")[0];e&&e.dataset.old&&(document.title=e.dataset.old,delete e.dataset.old)},previous(){this.currentIndex--,this.currentIndex<0&&(this.currentIndex=this.fileList.length-1);const e=this.fileList[this.currentIndex];this.openFileFromList(e),this.Viewer.onPrev(e),this.updateTitle(this.currentFile.basename)},next(){this.currentIndex++,this.currentIndex>this.fileList.length-1&&(this.currentIndex=0);const e=this.fileList[this.currentIndex];this.openFileFromList(e),this.Viewer.onNext(e),this.updateTitle(this.currentFile.basename)},comparisonFailed(){this.comparisonFile.failed=!0},previousFailed(){this.previousFile.failed=!0},currentFailed(){this.currentFile.failed=!0},nextFailed(){this.nextFile.failed=!0},async showSidebar(){this.enableSidebar&&OCA?.Files?.Sidebar&&await OCA.Files.Sidebar.open(this.sidebarOpenFilePath)},handleAppSidebarOpen(){this.isSidebarShown=!0;const e=document.querySelector("aside.app-sidebar");e&&(this.sidebarPosition=e.getBoundingClientRect().left,this.trapElements=[e])},handleAppSidebarClose(){this.isSidebarShown=!1,this.trapElements=[]},async handleFileUpdated(e){const i=this.fileList.findIndex(({fileid:s})=>s===e.fileid);e.etag=e.attributes.etag,this.fileList.splice(i,1,e),e.fileid===this.currentFile.fileid&&(this.currentFile.etag=e.attributes.etag)},onResize(){const e=document.querySelector("aside.app-sidebar");e&&(this.sidebarPosition=e.getBoundingClientRect().left)},async onDelete(){try{const e=this.currentFile.fileid,i=this.source??this.currentFile.davPath;await V.delete(i),J("files:node:deleted",{fileid:e});const s=this.fileList.findIndex(r=>r.filename===this.currentFile.filename);this.hasPrevious||this.hasNext?(this.hasPrevious?this.previous():this.next(),this.fileList.splice(s,1)):this.close()}catch(e){console.error(e),w(e)}},onEdit(){this.editing=!0},handleTrapElementsChange(e){this.trapElements.push(e)},toggleFullScreen(){this.isFullscreenMode?this.exitFullscreen():this.requestFullscreen()},requestFullscreen(){const e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen&&e.webkitRequestFullscreen()},exitFullscreen(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen&&document.webkitExitFullscreen()},addFullscreenEventListeners(){document.addEventListener("fullscreenchange",this.onFullscreenchange),document.addEventListener("webkitfullscreenchange",this.onFullscreenchange)},removeFullscreenEventListeners(){document.addEventListener("fullscreenchange",this.onFullscreenchange),document.addEventListener("webkitfullscreenchange",this.onFullscreenchange)},onFullscreenchange(){document.fullscreenElement===document.documentElement||document.webkitFullscreenElement===document.documentElement?this.isFullscreenMode=!0:this.isFullscreenMode=!1}}};var Ze=function(){var e=this,i=e._self._c;return e.el?i("div",{attrs:{id:"viewer","data-handler":e.handlerId}},[e.currentFile.failed?i("Error",{attrs:{name:e.currentFile.basename}}):i(e.currentFile.modal,e._b({key:e._f("uniqueKey")(e.currentFile),ref:"content",tag:"component",staticClass:"viewer__file viewer__file--active",attrs:{active:!0,"can-swipe":!1,"file-list":[e.currentFile],"is-full-screen":!1,loaded:e.currentFile.loaded,"is-sidebar-shown":!1},on:{"update:loaded":function(s){return e.$set(e.currentFile,"loaded",s)},error:e.currentFailed}},"component",e.currentFile,!1))],1):e.initiated||e.currentFile.modal?i("NcModal",{staticClass:"viewer",class:e.modalClass,style:{width:e.isSidebarShown?`${e.sidebarPosition}px`:null},attrs:{id:"viewer","additional-trap-elements":e.trapElements,"clear-view-delay":-1,"close-button-contained":!1,dark:!0,"data-handler":e.handlerId,"enable-slideshow":e.hasPrevious||e.hasNext,"slideshow-paused":e.editing,"enable-swipe":e.canSwipe&&!e.editing,"has-next":e.hasNext,"has-previous":e.hasPrevious,"inline-actions":e.canEdit?1:0,"spread-navigation":!0,name:e.currentFile.basename,view:e.currentFile.modal,size:"full"},on:{close:e.close,previous:e.previous,next:e.next},scopedSlots:e._u([{key:"actions",fn:function(){return[e.canEdit?i("NcActionButton",{attrs:{"close-after-click":!0},on:{click:e.onEdit},scopedSlots:e._u([{key:"icon",fn:function(){return[i("Pencil",{attrs:{size:20}})]},proxy:!0}],null,!1,580569589)},[e._v(" "+e._s(e.t("viewer","Edit"))+" ")]):e._e(),i("NcActionButton",{attrs:{"close-after-click":!0},on:{click:e.toggleFullScreen},scopedSlots:e._u([{key:"icon",fn:function(){return[e.isFullscreenMode?i("FullscreenExit",{attrs:{size:20}}):i("Fullscreen",{attrs:{size:20}})]},proxy:!0}])},[e._v(" "+e._s(e.isFullscreenMode?e.t("viewer","Exit full screen"):e.t("viewer","Full screen"))+" ")]),e.enableSidebar&&e.Sidebar&&e.sidebarOpenFilePath&&!e.isSidebarShown?i("NcActionButton",{attrs:{"close-after-click":!0,icon:"icon-menu-sidebar"},on:{click:e.showSidebar}},[e._v(" "+e._s(e.t("viewer","Open sidebar"))+" ")]):e._e(),e.canDownload?i("NcActionLink",{attrs:{download:e.currentFile.basename,"close-after-click":!0,href:e.downloadPath},scopedSlots:e._u([{key:"icon",fn:function(){return[i("Download",{attrs:{size:24}})]},proxy:!0}],null,!1,3874636280)},[e._v(" "+e._s(e.t("viewer","Download"))+" ")]):e._e(),e.canDelete?i("NcActionButton",{attrs:{"close-after-click":!0},on:{click:e.onDelete},scopedSlots:e._u([{key:"icon",fn:function(){return[i("Delete",{attrs:{size:22}})]},proxy:!0}],null,!1,2429175571)},[e._v(" "+e._s(e.t("viewer","Delete"))+" ")]):e._e()]},proxy:!0}])},[i("div",{staticClass:"viewer__content",class:e.contentClass,on:{click:function(s){return s.target!==s.currentTarget||s.ctrlKey||s.shiftKey||s.altKey||s.metaKey?null:e.close.apply(null,arguments)}}},[e.comparisonFile&&!e.comparisonFile.failed&&e.showComparison?i("div",{staticClass:"viewer__file-wrapper"},[i(e.comparisonFile.modal,e._b({key:e._f("uniqueKey")(e.comparisonFile),ref:"comparison-content",tag:"component",staticClass:"viewer__file viewer__file--active",attrs:{active:!0,"can-swipe":!1,"can-zoom":!1,editing:!1,"is-full-screen":e.isFullscreen,"is-sidebar-shown":e.isSidebarShown,loaded:e.comparisonFile.loaded},on:{"update:loaded":function(s){return e.$set(e.comparisonFile,"loaded",s)},error:e.comparisonFailed}},"component",e.comparisonFile,!1))],1):e._e(),e.previousFile?i("div",{key:e._f("uniqueKey")(e.previousFile),staticClass:"viewer__file-wrapper viewer__file-wrapper--hidden",attrs:{"aria-hidden":"true",inert:""}},[e.previousFile.failed?i("Error",{attrs:{name:e.previousFile.basename}}):i(e.previousFile.modal,e._b({ref:"previous-content",tag:"component",staticClass:"viewer__file",attrs:{"file-list":e.fileList},on:{error:e.previousFailed}},"component",e.previousFile,!1))],1):e._e(),i("div",{key:e._f("uniqueKey")(e.currentFile),staticClass:"viewer__file-wrapper"},[e.currentFile.failed?i("Error",{attrs:{name:e.currentFile.basename}}):i(e.currentFile.modal,e._b({ref:"content",tag:"component",staticClass:"viewer__file viewer__file--active",attrs:{active:!0,"can-swipe":e.canSwipe,"can-zoom":e.canZoom,editing:e.editing,"file-list":e.fileList,"is-full-screen":e.isFullscreen,"is-sidebar-shown":e.isSidebarShown,loaded:e.currentFile.loaded},on:{"update:canSwipe":function(s){e.canSwipe=s},"update:can-swipe":function(s){e.canSwipe=s},"update:editing":function(s){e.editing=s},"update:loaded":function(s){return e.$set(e.currentFile,"loaded",s)},error:e.currentFailed}},"component",e.currentFile,!1))],1),e.nextFile?i("div",{key:e._f("uniqueKey")(e.nextFile),staticClass:"viewer__file-wrapper viewer__file-wrapper--hidden",attrs:{"aria-hidden":"true",inert:""}},[e.nextFile.failed?i("Error",{attrs:{name:e.nextFile.basename}}):i(e.nextFile.modal,e._b({ref:"next-content",tag:"component",staticClass:"viewer__file",attrs:{"file-list":e.fileList},on:{error:e.nextFailed}},"component",e.nextFile,!1))],1):e._e()])]):e._e()},Qe=[],Ye=d(je,Ze,Qe,!1,null,"ffd4cf06");const Je=Ye.exports;m.mixin({methods:{t:ee}}),m.prototype.OC=window.OC,m.prototype.OCA=window.OCA;const H=document.createElement("div");H.id="viewer",document.body.appendChild(H);const b=document.createElement("div");b.innerHTML='',b.style.display="none",document.body.appendChild(b),new m({el:"#viewer",name:"ViewerRoot",render:e=>e(Je)}); diff --git a/js/viewer-main.mjs.map b/js/viewer-main.mjs.map index 1ced85b5d..60f7cb6cf 100644 --- a/js/viewer-main.mjs.map +++ b/js/viewer-main.mjs.map @@ -1 +1 @@ -{"version":3,"mappings":";;4PA6BA,eAA8BA,IAAmB,CAC1C,MAAAC,EAAc,MAAMC,KAE1B,GAAI,CAACD,EACJ,MAAO,CAAE,IAAK,WAAY,IAAK,EAAK,EAIrC,MAAME,EADS,CAAE,MAAO,WACLF,EAAY,YAAY,GAAKA,EAAY,cAAgB,WACtEG,EAAMH,EAAY,oBAAsB,OAAS,CAACA,EAAY,kBAE7D,OAAE,IAAAE,EAAK,IAAAC,EACf,CAKA,eAAeF,IAAiB,CAC/B,GAAIG,IACI,YAEF,MAAAC,EAAMC,EAAY,yBAAyB,EACjD,OAAO,MAAMC,EAAM,IAAIF,CAAG,EACxB,KAAMG,GACCA,EAAS,KAAK,MAAM,KAC3B,EACA,MAAM,IACC,IACP,CACH,CCzDA,MAAMC,GAAQ,CACZ,SAAU,CAKR,cAAe,CACb,OAAOC,EAAkB,KAC1B,CACF,CACH,ECVMD,GAAQ,CACZ,SAAU,CAKR,UAAW,CACT,OAAOE,EAAc,KACtB,CACF,CACH,ECWMC,EAAmB,SAAS,eAAe,cAAc,EAEhDC,EAAA,IAAM,CAACD,GAAqBA,G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,OAAS,KAAK,MAAM,KAAK,cAAgB,KAAK,aAAeA,CAAW,IAI7E,KAAK,OAAS,KAAK,cACnB,KAAK,MAAQ,KAAK,aAEnB,CACD,EAKD,aAAc,CACb,KAAK,MAAM,kBAAmB,EAAI,CAClC,EAKD,cAAe,CACd,KAAK,MAAM,kBAAmB,EAAK,CACnC,EAKD,kBAAmB,CACd,KAAK,aACR,SAAS,eAAgB,EAEzB,KAAK,IAAI,kBAAmB,CAE7B,CACD,CACF,EC/MAhD,GAAA,CACA,kBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,ilBChBAA,GAAA,CACA,oBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,2iBChBAA,GAAA,CACA,sBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,0lBChBAA,GAAA,CACA,0BACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,8lBChBAA,GAAA,CACA,kBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,mpBCyLAmD,GAAA,IAAAC,EAAA,WAGA,oCAAAC,KAAA,4CACAC,GAAA,oGACAC,GAAA,6DAAAF,KAAA,iDAEArD,GAAA,CACA,cAEA,YACA,OAAAwD,GACA,SAAAC,GACA,MAAAC,GACA,WAAAC,GACA,eAAAC,GACA,eAAAL,GACA,aAAAD,GACA,QAAAH,GACA,OAAAU,EACA,EAEA,SACA,UAAAC,EAAA,CACA,SAAAA,EAAA,OAAAA,EAAA,MACA,CACA,EAEA,QAAAC,GAAAC,EAAA,EAEA,OACA,OAEA,kBACA,aACA,sCAGA,cACA,cACA,sBAGA,eACA,gBACA,eACA,oBACA,YACA,YACA,mBAGA,YACA,aACA,WAGA,yBACA,2BAGA,kBACA,kBACA,oBACA,YACA,gBACA,WACA,KAAAC,EAAA,EACA,aAEA,eACA,CACA,EAEA,UACA,eACA,wDACA,EACA,cACA,gCACA,kCACA,EACA,UACA,gCACA,gCACA,EACA,OACA,uBACA,EACA,WACA,2BACA,EACA,qBACA,kCACA,EACA,QACA,wBACA,EACA,gBACA,gCACA,EACA,KACA,qBACA,EACA,WACA,2BACA,EACA,UACA,0BACA,EACA,UACA,qBACA,EACA,gBACA,4BACA,EACA,cACA,iDACA,EAEA,UACA,8EACA,EAWA,cACA,sCACA,EACA,sBACA,IAEA,OADA,iCAAAC,EAAA,OACA,8CACA,OACA,QACA,CACA,EAOA,YACA,mDACA,EAOA,cACA,OAAAvE,EAAA,uBACA,EAQA,UACA,sBACAA,EAAA,GACA,8CACA,cACA,uBACAwE,EAAA,0DACA,EAEA,aACA,OACA,kEACA,qCACA,kCACA,oCACA,wCACA,uDACA,CACA,EAEA,iBACA,oBACA,EAEA,eACA,OACA,mCACA,CACA,EAEA,aACA,OAAAjE,EAAA,KAAAQ,EAAA,OAEA,CAAAA,SAAA,uBACA,0BAMAR,KAAA,kCACAA,EAAA,OAAAA,EAAA,gCACAA,EAAA,QAAAA,EAAA,iCAOA,CACA,EAEA,OACA,GAAAkE,EAAA,CACAC,EAAA,KAAAD,CAAA,EACA,oBACA,MAAAE,EAAA,kCACA,GAAAF,EAAA,CACA,MAAAG,EAAA,uBAAAH,CAAA,EACAG,EACAA,EAAA,YAAAD,CAAA,EAEAD,EAAA,wCAAAD,CAAA,EAEA,MACA,0BAAAE,CAAA,CAEA,EACA,EAEA,KAAA5D,EAAA,CAEAA,KAAA,aACA2D,EAAA,sCAAA3D,CAAA,GACA,cAAAA,EAAA,+BAGA,cAEA,EAEA,SAAAR,EAAA,CACAA,GACAmE,EAAA,8CAAAnE,CAAA,GACA,kBAAAA,EAAA,+BAGA,cAEA,EAEA,mBAAAA,EAAA,CACAA,GACAmE,EAAA,wDAAAnE,CAAA,GACA,iBAAAA,CAAA,GAGA,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CACA,s7JCnpCA+B,EAAI,MAAM,CACT,QAAS,CACV,EAAEM,EACA,CACF,CAAC,EAEDN,EAAI,UAAU,GAAK,OAAO,GAC1BA,EAAI,UAAU,IAAM,OAAO,IAG3B,MAAMO,EAAa,SAAS,cAAc,KAAK,EAC/CA,EAAW,GAAK,SAChB,SAAS,KAAK,YAAYA,CAAU,EAIpC,MAAMC,EAAgB,SAAS,cAAc,KAAK,EAClDA,EAAc,UAAY,4pLAC1BA,EAAc,MAAM,QAAU,OAC9B,SAAS,KAAK,YAAYA,CAAa,EAGxB,IAAIR,EAAI,CACtB,GAAI,UAKJ,KAAM,aACN,OAAQZ,GAAKA,EAAEqB,EAAe,CAC/B,CAAC","names":["getSortingConfig","viewConfigs","getViewConfigs","key","asc","isPublic","url","generateUrl","axios","response","index","isFullscreenState","isMobileState","hideDownloadElmt","canDownload","CancelableRequest","request","controller","options","_sfc_main","File","fileInfo","mime","component","data","getDavPath","legacyFilesActionHandler","name","context","path","oldQuery","onClose","pushToHistory","fileid","params","dir","query","encodePath","getFileList","fixedPath","getClient","getDavNameSpaces","getDavProperties","genFileInfo","PreviewUrl","getPreviewIfAny","isWindows","process","splitWindowsRe","win32","win32SplitPath","filename","pathString","allParts","splitPathRe","posix","posixSplitPath","pathParseModule","Mime","parsePath","val","old","e","debounce","modalWrapper","modalContainer","parentHeight","parentWidth","heightRatio","widthRatio","NcModal","__vitePreload","n","NcActionLink","NcActionButton","Delete","Download","Error","Fullscreen","FullscreenExit","Pencil","file","isFullscreen","isMobile","getRootPath","getUserRoot","loadState","element","logger","viewerRoot","el","fileList","currentIndex","isEndOfList","list","handler","subscribe","unsubscribe","overrideHandlerId","fileRequest","cancelRequestFile","cancelableRequest","getFileInfo","fileName","extractFilePaths","title","error","showError","alias","h","group","mimes","folderRequest","cancelRequestFolder","dirPath","filteredFiles","a","b","sortCompare","prev","next","Vue","event","sidebar","node","currentFileId","emit","t","ViewerRoot","VideoControls","ViewerComponent"],"ignoreList":[1,2,10,12,13,14,15,16],"sources":["../src/services/FileSortingConfig.ts","../node_modules/@nextcloud/vue/dist/Mixins/isFullscreen.mjs","../node_modules/@nextcloud/vue/dist/Mixins/isMobile.mjs","../src/utils/canDownload.js","../src/utils/CancelableRequest.js","../src/components/Error.vue","../src/models/file.js","../src/services/LegacyFilesActionHandler.js","../src/services/FileList.ts","../src/mixins/PreviewUrl.js","../node_modules/path-parse/index.js","../src/mixins/Mime.js","../node_modules/vue-material-design-icons/Delete.vue","../node_modules/vue-material-design-icons/Download.vue","../node_modules/vue-material-design-icons/Fullscreen.vue","../node_modules/vue-material-design-icons/FullscreenExit.vue","../node_modules/vue-material-design-icons/Pencil.vue","../src/views/Viewer.vue","../src/main.js"],"sourcesContent":["/**\n * @copyright Copyright (c) 2023 Hamza Mahjoubi \n *\n * @author Hamza Mahjoubi \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\n\nimport axios from '@nextcloud/axios'\nimport { isPublic } from '../utils/davUtils'\nimport { generateUrl } from '@nextcloud/router'\n\n/**\n * @return {object}\n */\nexport default async function getSortingConfig() {\n\tconst viewConfigs = await getViewConfigs()\n\n\tif (!viewConfigs) {\n\t\treturn { key: 'basename', asc: true }\n\t}\n\n\tconst keyMap = { mtime: 'lastmod' }\n\tconst key = keyMap[viewConfigs.sorting_mode] || viewConfigs.sorting_mode || 'basename'\n\tconst asc = viewConfigs.sorting_direction === 'asc' || !viewConfigs.sorting_direction\n\n\treturn { key, asc }\n}\n\n/**\n * @return {object}\n */\nasync function getViewConfigs() {\n\tif (isPublic()) {\n\t\treturn null\n\t}\n\tconst url = generateUrl('apps/files/api/v1/views')\n\treturn await axios.get(url)\n\t\t.then((response) => {\n\t\t\treturn response.data.data?.files\n\t\t})\n\t\t.catch(() => {\n\t\t\treturn null\n\t\t})\n}\n","import { isFullscreenState } from \"../Composables/useIsFullscreen.mjs\";\nconst index = {\n computed: {\n /**\n * @deprecated Is to be removed in v9.0.0 with Vue 3 migration.\n * Use `composables/useIsFullscreen` instead.\n */\n isFullscreen() {\n return isFullscreenState.value;\n }\n }\n};\nexport {\n index as default\n};\n","import { isMobileState } from \"../Composables/useIsMobile.mjs\";\nconst index = {\n computed: {\n /**\n * @deprecated Is to be removed in v9.0.0 with Vue 3 migration.\n * Use `composables/useIsMobile` instead.\n */\n isMobile() {\n return isMobileState.value;\n }\n }\n};\nexport {\n index as default\n};\n","/**\n * @copyright Copyright (c) 2020 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\n\nconst hideDownloadElmt = document.getElementById('hideDownload')\n// true = hidden download\nexport default () => !hideDownloadElmt || (hideDownloadElmt && hideDownloadElmt.value !== 'true')\n","/**\n * @copyright Copyright (c) 2019 Marco Ambrosini \n *\n * @author Marco Ambrosini \n * @author John Molakvoæ \n * @author Louis Chemineau \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\n\n/**\n * Creates a cancelable axios 'request object'.\n *\n * @param {Function} request the axios promise request\n * @return {object}\n */\nconst CancelableRequest = function(request) {\n\tconst controller = new AbortController()\n\n\t/**\n\t * Execute the request\n\t *\n\t * @param {string} url the url to send the request to\n\t * @param {object} [options] optional config for the request\n\t */\n\tconst fetch = async function(url, options) {\n\t\treturn request(\n\t\t\turl,\n\t\t\t{ ...options, signal: controller.signal },\n\t\t)\n\t}\n\treturn {\n\t\trequest: fetch,\n\t\tcancel: () => controller.abort(),\n\t}\n}\n\nexport default CancelableRequest\n","\n\n\n\t\n\t\t\n\t\t\n\t\t\t{{ t('viewer', 'Error loading {name}', { name }) }}\n\t\t\n\t\n\n\n\n\n\n","/**\n * @copyright Copyright (c) 2019 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\nimport { getDavPath } from '../utils/fileUtils.ts'\n\n/**\n * @param {object} fileInfo a FileInfo object\n * @param {string} mime the file mime type\n * @param {object} component the component to render\n */\nexport default function(fileInfo, mime, component) {\n\tconst data = {\n\t\tmime,\n\t\tmodal: component,\n\t\tfailed: false,\n\t\tloaded: false,\n\t\tdavPath: getDavPath(fileInfo),\n\t\tsource: fileInfo.source ?? getDavPath(fileInfo),\n\t}\n\n\treturn Object.assign({}, fileInfo, data)\n}\n","/**\n * @copyright Copyright (c) 2020 Azul \n *\n * @author Azul \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\n\nimport { encodePath } from '@nextcloud/paths'\n\n/**\n * @param {string} name the file name\n * @param {object} context the file context\n */\nexport default function(name, context) {\n\t// replace potential leading double slashes\n\tconst path = `${context.dir}/${name}`.replace(/^\\/\\//, '/')\n\tconst oldQuery = location.search.replace(/^\\?/, '')\n\tconst onClose = () => OC.Util.History.pushState(oldQuery)\n\tif (!context.fileInfoModel && context.fileList) {\n\t\tcontext.fileInfoModel = context.fileList.getModelForFile(name)\n\t}\n\tif (context.fileInfoModel) {\n\t\tpushToHistory({ fileid: context.fileInfoModel.get('id') })\n\t}\n\tOCA.Viewer.open({ path, onPrev: pushToHistory, onNext: pushToHistory, onClose })\n}\n\n/**\n * @param {object} root destructuring object\n * @param {number} root.fileid the opened file ID\n */\nfunction pushToHistory({ fileid }) {\n\tconst params = OC.Util.History.parseUrlQuery()\n\tconst dir = params.dir\n\tdelete params.dir\n\tdelete params.fileid\n\tparams.openfile = fileid\n\tconst query = 'dir=' + encodePath(dir) + '&' + OC.buildQueryString(params)\n\tOC.Util.History.pushState(query)\n}\n","/**\n * @copyright Copyright (c) 2019 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\n\nimport { getDavNameSpaces, getDavProperties } from '@nextcloud/files'\nimport { getClient } from './WebdavClient'\nimport { genFileInfo, type FileInfo } from '../utils/fileUtils'\nimport type { FileStat, ResponseDataDetailed } from 'webdav'\n\n/**\n * Retrieve the files list\n * @param path\n * @param options\n */\nexport default async function(path: string, options = {}): Promise {\n\t// getDirectoryContents doesn't accept / for root\n\tconst fixedPath = path === '/' ? '' : path\n\n\tconst response = await getClient().getDirectoryContents(fixedPath, Object.assign({\n\t\tdata: `\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t${getDavProperties()}\n\t\t\t\t\n\t\t\t`,\n\t\tdetails: true,\n\t}, options)) as ResponseDataDetailed\n\n\treturn response.data.map(genFileInfo)\n}\n","/**\n * @copyright Copyright (c) 2019 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\nimport { getPreviewIfAny } from '../utils/previewUtils.ts'\nimport { getDavPath } from '../utils/fileUtils.ts'\n\nexport default {\n\tcomputed: {\n\t\t/**\n\t\t * Link to the preview path if the file have a preview\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tpreviewPath() {\n\t\t\treturn this.getPreviewIfAny({\n\t\t\t\tfileid: this.fileid,\n\t\t\t\tfilename: this.filename,\n\t\t\t\tpreviewUrl: this.previewUrl,\n\t\t\t\thasPreview: this.hasPreview,\n\t\t\t\tdavPath: this.davPath,\n\t\t\t\tetag: this.$attrs.etag,\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Absolute dav remote path of the file\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tdavPath() {\n\t\t\treturn getDavPath({\n\t\t\t\tfilename: this.filename,\n\t\t\t\tbasename: this.basename,\n\t\t\t})\n\t\t},\n\t},\n\tmethods: {\n\t\t/**\n\t\t * Return the preview url if the file have an existing\n\t\t * preview or the absolute dav remote path if none.\n\t\t *\n\t\t * @param {object} data destructuring object\n\t\t * @param {string} data.fileid the file id\n\t\t * @param {string} [data.previewUrl] URL of the file preview\n\t\t * @param {boolean} data.hasPreview have the file an existing preview ?\n\t\t * @param {string} data.davPath the absolute dav path\n\t\t * @param {string} data.filename the file name\n\t\t * @param {string|null} data.etag the etag of the file\n\t\t * @return {string} the absolute url\n\t\t */\n\t\tgetPreviewIfAny(data) {\n\t\t\treturn getPreviewIfAny(data)\n\t\t},\n\t},\n}\n","'use strict';\n\nvar isWindows = process.platform === 'win32';\n\n// Regex to split a windows path into into [dir, root, basename, name, ext]\nvar splitWindowsRe =\n /^(((?:[a-zA-Z]:|[\\\\\\/]{2}[^\\\\\\/]+[\\\\\\/]+[^\\\\\\/]+)?[\\\\\\/]?)(?:[^\\\\\\/]*[\\\\\\/])*)((\\.{1,2}|[^\\\\\\/]+?|)(\\.[^.\\/\\\\]*|))[\\\\\\/]*$/;\n\nvar win32 = {};\n\nfunction win32SplitPath(filename) {\n return splitWindowsRe.exec(filename).slice(1);\n}\n\nwin32.parse = function(pathString) {\n if (typeof pathString !== 'string') {\n throw new TypeError(\n \"Parameter 'pathString' must be a string, not \" + typeof pathString\n );\n }\n var allParts = win32SplitPath(pathString);\n if (!allParts || allParts.length !== 5) {\n throw new TypeError(\"Invalid path '\" + pathString + \"'\");\n }\n return {\n root: allParts[1],\n dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1),\n base: allParts[2],\n ext: allParts[4],\n name: allParts[3]\n };\n};\n\n\n\n// Split a filename into [dir, root, basename, name, ext], unix version\n// 'root' is just a slash, or nothing.\nvar splitPathRe =\n /^((\\/?)(?:[^\\/]*\\/)*)((\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))[\\/]*$/;\nvar posix = {};\n\n\nfunction posixSplitPath(filename) {\n return splitPathRe.exec(filename).slice(1);\n}\n\n\nposix.parse = function(pathString) {\n if (typeof pathString !== 'string') {\n throw new TypeError(\n \"Parameter 'pathString' must be a string, not \" + typeof pathString\n );\n }\n var allParts = posixSplitPath(pathString);\n if (!allParts || allParts.length !== 5) {\n throw new TypeError(\"Invalid path '\" + pathString + \"'\");\n }\n \n return {\n root: allParts[1],\n dir: allParts[0].slice(0, -1),\n base: allParts[2],\n ext: allParts[4],\n name: allParts[3],\n };\n};\n\n\nif (isWindows)\n module.exports = win32.parse;\nelse /* posix */\n module.exports = posix.parse;\n\nmodule.exports.posix = posix.parse;\nmodule.exports.win32 = win32.parse;\n","/**\n * @copyright Copyright (c) 2019 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\nimport debounce from 'debounce'\nimport PreviewUrl from '../mixins/PreviewUrl.js'\nimport parsePath from 'path-parse'\n\nexport default {\n\tinheritAttrs: false,\n\tmixins: [PreviewUrl],\n\tprops: {\n\t\t// Is the current component shown\n\t\tactive: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// file name\n\t\tbasename: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\t// file path relative to user folder\n\t\tfilename: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\t// file source to fetch contents from\n\t\tsource: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t// URL the file preview\n\t\tpreviewUrl: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t// should the standard core preview be used?\n\t\thasPreview: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// unique file id\n\t\tfileid: {\n\t\t\ttype: [Number, String],\n\t\t\trequired: false,\n\t\t},\n\t\t// list of all the visible files\n\t\tfileList: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\t\t// file mime (aliased if specified in the model)\n\t\tmime: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\t// can the user swipe\n\t\tcanSwipe: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\t\t// is the content loaded?\n\t\t// synced with parent\n\t\tloaded: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// is the sidebar currently opened ?\n\t\tisSidebarShown: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// are we in fullscreen mode ?\n\t\tisFullScreen: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// The file id of the peer live photo file\n\t\tmetadataFilesLivePhoto: {\n\t\t\ttype: Number,\n\t\t\tdefault: undefined,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\theight: null,\n\t\t\twidth: null,\n\t\t\tnaturalHeight: null,\n\t\t\tnaturalWidth: null,\n\t\t\tisLoaded: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tname() {\n\t\t\treturn parsePath(this.basename).name\n\t\t},\n\t\text() {\n\t\t\treturn parsePath(this.basename).ext\n\t\t},\n\t\tsrc() {\n\t\t\treturn this.source ?? this.davPath\n\t\t},\n\t},\n\n\twatch: {\n\t\tactive(val, old) {\n\t\t\t// the item was hidden before and is now the current view\n\t\t\tif (val === true && old === false) {\n\t\t\t\t// just in case the file was preloaded, let's warn the viewer\n\t\t\t\tif (this.isLoaded) {\n\t\t\t\t\tthis.doneLoading()\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t// update image size on sidebar toggle\n\t\tisSidebarShown() {\n\t\t\t// wait for transition to complete (100ms)\n\t\t\tsetTimeout(this.updateHeightWidth, 200)\n\t\t},\n\t},\n\n\tmounted() {\n\t\t// detect error and let the viewer know\n\t\tthis.$el.addEventListener('error', e => {\n\t\t\tconsole.error('Error loading', this.filename, e)\n\t\t\tthis.$emit('error', e)\n\t\t})\n\n\t\t// update image size on window resize\n\t\twindow.addEventListener('resize', debounce(() => {\n\t\t\tthis.updateHeightWidth()\n\t\t}, 100))\n\t},\n\n\tmethods: {\n\n\t\t/**\n\t\t * This is used to make the viewer know this file is complete or ready\n\t\t * ! you NEED to use it to make the viewer aware of the current loading state\n\t\t */\n\t\tdoneLoading() {\n\t\t\t// send the current state\n\t\t\tthis.$emit('update:loaded', true)\n\t\t\t// save the current state\n\t\t\tthis.isLoaded = true\n\t\t},\n\n\t\t/**\n\t\t * Updates the current height and width data\n\t\t * based on the viewer maximum size\n\t\t */\n\t\tupdateHeightWidth() {\n\t\t\tconst modalWrapper = this.$parent.$el.querySelector('.modal-wrapper')\n\t\t\tif (modalWrapper && this.naturalHeight > 0 && this.naturalWidth > 0) {\n\t\t\t\tconst modalContainer = modalWrapper.querySelector('.modal-container')\n\n\t\t\t\tconst parentHeight = modalContainer.clientHeight\n\t\t\t\tconst parentWidth = modalContainer.clientWidth\n\n\t\t\t\tconst heightRatio = parentHeight / this.naturalHeight\n\t\t\t\tconst widthRatio = parentWidth / this.naturalWidth\n\n\t\t\t\t// if the video height is capped by the parent height\n\t\t\t\t// AND the video is bigger than the parent\n\t\t\t\tif (heightRatio < widthRatio && heightRatio < 1) {\n\t\t\t\t\tthis.height = parentHeight\n\t\t\t\t\tthis.width = Math.round(this.naturalWidth / this.naturalHeight * parentHeight)\n\n\t\t\t\t// if the video width is capped by the parent width\n\t\t\t\t// AND the video is bigger than the parent\n\t\t\t\t} else if (heightRatio > widthRatio && widthRatio < 1) {\n\t\t\t\t\tthis.width = parentWidth\n\t\t\t\t\tthis.height = Math.round(this.naturalHeight / this.naturalWidth * parentWidth)\n\n\t\t\t\t// RESET\n\t\t\t\t} else {\n\t\t\t\t\tthis.height = this.naturalHeight\n\t\t\t\t\tthis.width = this.naturalWidth\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Enable the viewer swiping previous/next capability\n\t\t */\n\t\tenableSwipe() {\n\t\t\tthis.$emit('update:canSwipe', true)\n\t\t},\n\n\t\t/**\n\t\t * Disable the viewer swiping previous/next capability\n\t\t */\n\t\tdisableSwipe() {\n\t\t\tthis.$emit('update:canSwipe', false)\n\t\t},\n\n\t\t/**\n\t\t * Toggle the fullscreen on the current visible element\n\t\t */\n\t\ttoggleFullScreen() {\n\t\t\tif (this.isFullScreen) {\n\t\t\t\tdocument.exitFullscreen()\n\t\t\t} else {\n\t\t\t\tthis.$el.requestFullscreen()\n\t\t\t}\n\t\t},\n\t},\n}\n","\n \n \n \n {{ title }}\n \n \n \n\n\n","\n \n \n \n {{ title }}\n \n \n \n\n\n","\n \n \n \n {{ title }}\n \n \n \n\n\n","\n \n \n \n {{ title }}\n \n \n \n\n\n","\n \n \n \n {{ title }}\n \n \n \n\n\n","\n\n\n\t\n\t\n\t\t\n\t\t\n\t\n\n\t\n\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t{{ t('viewer', 'Edit') }}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t{{ isFullscreenMode ? t('viewer', 'Exit full screen') : t('viewer', 'Full screen') }}\n\t\t\t\n\t\t\t\n\t\t\t\t{{ t('viewer', 'Open sidebar') }}\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t{{ t('viewer', 'Download') }}\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t{{ t('viewer', 'Delete') }}\n\t\t\t\n\t\t\n\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\n\n\n\n\n\n\n\n","/**\n * @copyright Copyright (c) 2019 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\nimport { translate as t } from '@nextcloud/l10n'\nimport Vue from 'vue'\n\nimport ViewerComponent from './views/Viewer.vue'\n\nVue.mixin({\n\tmethods: {\n\t\tt,\n\t},\n})\n\nVue.prototype.OC = window.OC\nVue.prototype.OCA = window.OCA\n\n// Create document root\nconst ViewerRoot = document.createElement('div')\nViewerRoot.id = 'viewer'\ndocument.body.appendChild(ViewerRoot)\n\n// Put controls for video viewer\n// Needed as Firefox CSP blocks the loading of the svg through the normal plyr system\nconst VideoControls = document.createElement('div')\nVideoControls.innerHTML = PLYR_ICONS\nVideoControls.style.display = 'none'\ndocument.body.appendChild(VideoControls)\n\n// Init vue\nexport default new Vue({\n\tel: '#viewer',\n\t// When debugging the page, it's easier to find which app\n\t// is which. Especially when there is multiple apps\n\t// roots mounted o the same page!\n\t// eslint-disable-next-line vue/match-component-file-name\n\tname: 'ViewerRoot',\n\trender: h => h(ViewerComponent),\n})\n"],"file":"js/viewer-main.mjs"} \ No newline at end of file +{"version":3,"mappings":";;4PA6BA,eAA8BA,IAAmB,CAC1C,MAAAC,EAAc,MAAMC,KAE1B,GAAI,CAACD,EACJ,MAAO,CAAE,IAAK,WAAY,IAAK,EAAK,EAIrC,MAAME,EADS,CAAE,MAAO,WACLF,EAAY,YAAY,GAAKA,EAAY,cAAgB,WACtEG,EAAMH,EAAY,oBAAsB,OAAS,CAACA,EAAY,kBAE7D,OAAE,IAAAE,EAAK,IAAAC,EACf,CAKA,eAAeF,IAAiB,CAC/B,GAAIG,IACI,YAEF,MAAAC,EAAMC,EAAY,yBAAyB,EACjD,OAAO,MAAMC,EAAM,IAAIF,CAAG,EACxB,KAAMG,GACCA,EAAS,KAAK,MAAM,KAC3B,EACA,MAAM,IACC,IACP,CACH,CCzDA,MAAMC,GAAQ,CACZ,SAAU,CAKR,cAAe,CACb,OAAOC,EAAkB,KAC1B,CACF,CACH,ECVMD,GAAQ,CACZ,SAAU,CAKR,UAAW,CACT,OAAOE,EAAc,KACtB,CACF,CACH,ECWMC,EAAmB,SAAS,eAAe,cAAc,EAEhDC,EAAA,IAAM,CAACD,GAAqBA,GAAoBA,EAAiB,QAAU,OCMpFE,EAAoB,SAASC,EAAS,CAC3C,MAAMC,EAAa,IAAI,gBAcvB,MAAO,CACN,QAPa,eAAeX,EAAKY,EAAS,CAC1C,OAAOF,EACNV,EACA,CAAE,GAAGY,EAAS,OAAQD,EAAW,MAAQ,CACzC,CACD,EAGA,OAAQ,IAAMA,EAAW,MAAO,CAChC,CACF,ECjBAE,GAAA,CACA,aAEA,OACA,MACA,YACA,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AmB,CAE7B,CACD,CACF,EC/MAhD,GAAA,CACA,kBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,ilBChBAA,GAAA,CACA,oBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,2iBChBAA,GAAA,CACA,sBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,0lBChBAA,GAAA,CACA,0BACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,8lBChBAA,GAAA,CACA,kBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,mpBCyLAmD,GAAA,IAAAC,EAAA,WAGA,oCAAAC,KAAA,4CACAC,GAAA,oGACAC,GAAA,6DAAAF,KAAA,iDAEArD,GAAA,CACA,cAEA,YACA,OAAAwD,GACA,SAAAC,GACA,MAAAC,GACA,WAAAC,GACA,eAAAC,GACA,eAAAL,GACA,aAAAD,GACA,QAAAH,GACA,OAAAU,EACA,EAEA,SACA,UAAAC,EAAA,CACA,SAAAA,EAAA,OAAAA,EAAA,MACA,CACA,EAEA,QAAAC,GAAAC,EAAA,EAEA,OACA,OAEA,kBACA,aACA,sCAGA,cACA,cACA,sBAGA,eACA,gBACA,eACA,oBACA,YACA,YACA,mBAGA,YACA,aACA,WAGA,yBACA,2BAGA,kBACA,kBACA,oBACA,YACA,gBACA,WACA,KAAAC,EAAA,EACA,aAEA,eACA,CACA,EAEA,UACA,eACA,wDACA,EACA,cACA,gCACA,kCACA,EACA,UACA,gCACA,gCACA,EACA,OACA,uBACA,EACA,WACA,2BACA,EACA,qBACA,kCACA,EACA,QACA,wBACA,EACA,gBACA,gCACA,EACA,KACA,qBACA,EACA,WACA,2BACA,EACA,UACA,0BACA,EACA,UACA,qBACA,EACA,gBACA,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Y,4pLAC1BA,EAAc,MAAM,QAAU,OAC9B,SAAS,KAAK,YAAYA,CAAa,EAGxB,IAAIR,EAAI,CACtB,GAAI,UAKJ,KAAM,aACN,OAAQZ,GAAKA,EAAEqB,EAAe,CAC/B,CAAC","names":["getSortingConfig","viewConfigs","getViewConfigs","key","asc","isPublic","url","generateUrl","axios","response","index","isFullscreenState","isMobileState","hideDownloadElmt","canDownload","CancelableRequest","request","controller","options","_sfc_main","File","fileInfo","mime","component","data","getDavPath","legacyFilesActionHandler","name","context","path","oldQuery","onClose","pushToHistory","fileid","params","dir","query","encodePath","getFileList","fixedPath","getClient","getDavNameSpaces","getDavProperties","genFileInfo","PreviewUrl","getPreviewIfAny","isWindows","process","splitWindowsRe","win32","win32SplitPath","filename","pathString","allParts","splitPathRe","posix","posixSplitPath","pathParseModule","Mime","parsePath","val","old","e","debounce","modalWrapper","modalContainer","parentHeight","parentWidth","heightRatio","widthRatio","NcModal","__vitePreload","n","NcActionLink","NcActionButton","Delete","Download","Error","Fullscreen","FullscreenExit","Pencil","file","isFullscreen","isMobile","getRootPath","getUserRoot","loadState","element","logger","viewerRoot","el","fileList","currentIndex","isEndOfList","list","handler","subscribe","unsubscribe","overrideHandlerId","fileRequest","cancelRequestFile","cancelableRequest","getFileInfo","fileName","extractFilePaths","title","error","showError","alias","h","group","mimes","folderRequest","cancelRequestFolder","dirPath","filteredFiles","a","b","sortCompare","prev","next","Vue","event","sidebar","node","currentFileId","emit","t","ViewerRoot","VideoControls","ViewerComponent"],"ignoreList":[1,2,10,12,13,14,15,16],"sources":["../src/services/FileSortingConfig.ts","../node_modules/@nextcloud/vue/dist/Mixins/isFullscreen.mjs","../node_modules/@nextcloud/vue/dist/Mixins/isMobile.mjs","../src/utils/canDownload.js","../src/utils/CancelableRequest.js","../src/components/Error.vue","../src/models/file.js","../src/services/LegacyFilesActionHandler.js","../src/services/FileList.ts","../src/mixins/PreviewUrl.js","../node_modules/path-parse/index.js","../src/mixins/Mime.js","../node_modules/vue-material-design-icons/Delete.vue","../node_modules/vue-material-design-icons/Download.vue","../node_modules/vue-material-design-icons/Fullscreen.vue","../node_modules/vue-material-design-icons/FullscreenExit.vue","../node_modules/vue-material-design-icons/Pencil.vue","../src/views/Viewer.vue","../src/main.js"],"sourcesContent":["/**\n * @copyright Copyright (c) 2023 Hamza Mahjoubi \n *\n * @author Hamza Mahjoubi \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\n\nimport axios from '@nextcloud/axios'\nimport { isPublic } from '../utils/davUtils'\nimport { generateUrl } from '@nextcloud/router'\n\n/**\n * @return {object}\n */\nexport default async function getSortingConfig() {\n\tconst viewConfigs = await getViewConfigs()\n\n\tif (!viewConfigs) {\n\t\treturn { key: 'basename', asc: true }\n\t}\n\n\tconst keyMap = { mtime: 'lastmod' }\n\tconst key = keyMap[viewConfigs.sorting_mode] || viewConfigs.sorting_mode || 'basename'\n\tconst asc = viewConfigs.sorting_direction === 'asc' || !viewConfigs.sorting_direction\n\n\treturn { key, asc }\n}\n\n/**\n * @return {object}\n */\nasync function getViewConfigs() {\n\tif (isPublic()) {\n\t\treturn null\n\t}\n\tconst url = generateUrl('apps/files/api/v1/views')\n\treturn await axios.get(url)\n\t\t.then((response) => {\n\t\t\treturn response.data.data?.files\n\t\t})\n\t\t.catch(() => {\n\t\t\treturn null\n\t\t})\n}\n","import { isFullscreenState } from \"../Composables/useIsFullscreen.mjs\";\nconst index = {\n computed: {\n /**\n * @deprecated Is to be removed in v9.0.0 with Vue 3 migration.\n * Use `composables/useIsFullscreen` instead.\n */\n isFullscreen() {\n return isFullscreenState.value;\n }\n }\n};\nexport {\n index as default\n};\n","import { isMobileState } from \"../Composables/useIsMobile.mjs\";\nconst index = {\n computed: {\n /**\n * @deprecated Is to be removed in v9.0.0 with Vue 3 migration.\n * Use `composables/useIsMobile` instead.\n */\n isMobile() {\n return isMobileState.value;\n }\n }\n};\nexport {\n index as default\n};\n","/**\n * @copyright Copyright (c) 2020 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\n\nconst hideDownloadElmt = document.getElementById('hideDownload')\n// true = hidden download\nexport default () => !hideDownloadElmt || (hideDownloadElmt && hideDownloadElmt.value !== 'true')\n","/**\n * @copyright Copyright (c) 2019 Marco Ambrosini \n *\n * @author Marco Ambrosini \n * @author John Molakvoæ \n * @author Louis Chemineau \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\n\n/**\n * Creates a cancelable axios 'request object'.\n *\n * @param {Function} request the axios promise request\n * @return {object}\n */\nconst CancelableRequest = function(request) {\n\tconst controller = new AbortController()\n\n\t/**\n\t * Execute the request\n\t *\n\t * @param {string} url the url to send the request to\n\t * @param {object} [options] optional config for the request\n\t */\n\tconst fetch = async function(url, options) {\n\t\treturn request(\n\t\t\turl,\n\t\t\t{ ...options, signal: controller.signal },\n\t\t)\n\t}\n\treturn {\n\t\trequest: fetch,\n\t\tcancel: () => controller.abort(),\n\t}\n}\n\nexport default CancelableRequest\n","\n\n\n\t\n\t\t\n\t\t\n\t\t\t{{ t('viewer', 'Error loading {name}', { name }) }}\n\t\t\n\t\n\n\n\n\n\n","/**\n * @copyright Copyright (c) 2019 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\nimport { getDavPath } from '../utils/fileUtils.ts'\n\n/**\n * @param {object} fileInfo a FileInfo object\n * @param {string} mime the file mime type\n * @param {object} component the component to render\n */\nexport default function(fileInfo, mime, component) {\n\tconst data = {\n\t\tmime,\n\t\tmodal: component,\n\t\tfailed: false,\n\t\tloaded: false,\n\t\tdavPath: getDavPath(fileInfo),\n\t\tsource: fileInfo.source ?? getDavPath(fileInfo),\n\t}\n\n\treturn Object.assign({}, fileInfo, data)\n}\n","/**\n * @copyright Copyright (c) 2020 Azul \n *\n * @author Azul \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\n\nimport { encodePath } from '@nextcloud/paths'\n\n/**\n * @param {string} name the file name\n * @param {object} context the file context\n */\nexport default function(name, context) {\n\t// replace potential leading double slashes\n\tconst path = `${context.dir}/${name}`.replace(/^\\/\\//, '/')\n\tconst oldQuery = location.search.replace(/^\\?/, '')\n\tconst onClose = () => OC.Util.History.pushState(oldQuery)\n\tif (!context.fileInfoModel && context.fileList) {\n\t\tcontext.fileInfoModel = context.fileList.getModelForFile(name)\n\t}\n\tif (context.fileInfoModel) {\n\t\tpushToHistory({ fileid: context.fileInfoModel.get('id') })\n\t}\n\tOCA.Viewer.open({ path, onPrev: pushToHistory, onNext: pushToHistory, onClose })\n}\n\n/**\n * @param {object} root destructuring object\n * @param {number} root.fileid the opened file ID\n */\nfunction pushToHistory({ fileid }) {\n\tconst params = OC.Util.History.parseUrlQuery()\n\tconst dir = params.dir\n\tdelete params.dir\n\tdelete params.fileid\n\tparams.openfile = fileid\n\tconst query = 'dir=' + encodePath(dir) + '&' + OC.buildQueryString(params)\n\tOC.Util.History.pushState(query)\n}\n","/**\n * @copyright Copyright (c) 2019 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\n\nimport { getDavNameSpaces, getDavProperties } from '@nextcloud/files'\nimport { getClient } from './WebdavClient'\nimport { genFileInfo, type FileInfo } from '../utils/fileUtils'\nimport type { FileStat, ResponseDataDetailed } from 'webdav'\n\n/**\n * Retrieve the files list\n * @param path\n * @param options\n */\nexport default async function(path: string, options = {}): Promise {\n\t// getDirectoryContents doesn't accept / for root\n\tconst fixedPath = path === '/' ? '' : path\n\n\tconst response = await getClient().getDirectoryContents(fixedPath, Object.assign({\n\t\tdata: `\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t${getDavProperties()}\n\t\t\t\t\n\t\t\t`,\n\t\tdetails: true,\n\t}, options)) as ResponseDataDetailed\n\n\treturn response.data.map(genFileInfo)\n}\n","/**\n * @copyright Copyright (c) 2019 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\nimport { getPreviewIfAny } from '../utils/previewUtils.ts'\nimport { getDavPath } from '../utils/fileUtils.ts'\n\nexport default {\n\tcomputed: {\n\t\t/**\n\t\t * Link to the preview path if the file have a preview\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tpreviewPath() {\n\t\t\treturn this.getPreviewIfAny({\n\t\t\t\tfileid: this.fileid,\n\t\t\t\tfilename: this.filename,\n\t\t\t\tpreviewUrl: this.previewUrl,\n\t\t\t\thasPreview: this.hasPreview,\n\t\t\t\tdavPath: this.davPath,\n\t\t\t\tetag: this.$attrs.etag,\n\t\t\t})\n\t\t},\n\n\t\t/**\n\t\t * Absolute dav remote path of the file\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\tdavPath() {\n\t\t\treturn getDavPath({\n\t\t\t\tfilename: this.filename,\n\t\t\t\tbasename: this.basename,\n\t\t\t})\n\t\t},\n\t},\n\tmethods: {\n\t\t/**\n\t\t * Return the preview url if the file have an existing\n\t\t * preview or the absolute dav remote path if none.\n\t\t *\n\t\t * @param {object} data destructuring object\n\t\t * @param {string} data.fileid the file id\n\t\t * @param {string} [data.previewUrl] URL of the file preview\n\t\t * @param {boolean} data.hasPreview have the file an existing preview ?\n\t\t * @param {string} data.davPath the absolute dav path\n\t\t * @param {string} data.filename the file name\n\t\t * @param {string|null} data.etag the etag of the file\n\t\t * @return {string} the absolute url\n\t\t */\n\t\tgetPreviewIfAny(data) {\n\t\t\treturn getPreviewIfAny(data)\n\t\t},\n\t},\n}\n","'use strict';\n\nvar isWindows = process.platform === 'win32';\n\n// Regex to split a windows path into into [dir, root, basename, name, ext]\nvar splitWindowsRe =\n /^(((?:[a-zA-Z]:|[\\\\\\/]{2}[^\\\\\\/]+[\\\\\\/]+[^\\\\\\/]+)?[\\\\\\/]?)(?:[^\\\\\\/]*[\\\\\\/])*)((\\.{1,2}|[^\\\\\\/]+?|)(\\.[^.\\/\\\\]*|))[\\\\\\/]*$/;\n\nvar win32 = {};\n\nfunction win32SplitPath(filename) {\n return splitWindowsRe.exec(filename).slice(1);\n}\n\nwin32.parse = function(pathString) {\n if (typeof pathString !== 'string') {\n throw new TypeError(\n \"Parameter 'pathString' must be a string, not \" + typeof pathString\n );\n }\n var allParts = win32SplitPath(pathString);\n if (!allParts || allParts.length !== 5) {\n throw new TypeError(\"Invalid path '\" + pathString + \"'\");\n }\n return {\n root: allParts[1],\n dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1),\n base: allParts[2],\n ext: allParts[4],\n name: allParts[3]\n };\n};\n\n\n\n// Split a filename into [dir, root, basename, name, ext], unix version\n// 'root' is just a slash, or nothing.\nvar splitPathRe =\n /^((\\/?)(?:[^\\/]*\\/)*)((\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))[\\/]*$/;\nvar posix = {};\n\n\nfunction posixSplitPath(filename) {\n return splitPathRe.exec(filename).slice(1);\n}\n\n\nposix.parse = function(pathString) {\n if (typeof pathString !== 'string') {\n throw new TypeError(\n \"Parameter 'pathString' must be a string, not \" + typeof pathString\n );\n }\n var allParts = posixSplitPath(pathString);\n if (!allParts || allParts.length !== 5) {\n throw new TypeError(\"Invalid path '\" + pathString + \"'\");\n }\n \n return {\n root: allParts[1],\n dir: allParts[0].slice(0, -1),\n base: allParts[2],\n ext: allParts[4],\n name: allParts[3],\n };\n};\n\n\nif (isWindows)\n module.exports = win32.parse;\nelse /* posix */\n module.exports = posix.parse;\n\nmodule.exports.posix = posix.parse;\nmodule.exports.win32 = win32.parse;\n","/**\n * @copyright Copyright (c) 2019 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\nimport debounce from 'debounce'\nimport PreviewUrl from '../mixins/PreviewUrl.js'\nimport parsePath from 'path-parse'\n\nexport default {\n\tinheritAttrs: false,\n\tmixins: [PreviewUrl],\n\tprops: {\n\t\t// Is the current component shown\n\t\tactive: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// file name\n\t\tbasename: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\t// file path relative to user folder\n\t\tfilename: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\t// file source to fetch contents from\n\t\tsource: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t// URL the file preview\n\t\tpreviewUrl: {\n\t\t\ttype: String,\n\t\t\tdefault: undefined,\n\t\t},\n\t\t// should the standard core preview be used?\n\t\thasPreview: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// unique file id\n\t\tfileid: {\n\t\t\ttype: [Number, String],\n\t\t\trequired: false,\n\t\t},\n\t\t// list of all the visible files\n\t\tfileList: {\n\t\t\ttype: Array,\n\t\t\tdefault: () => [],\n\t\t},\n\t\t// file mime (aliased if specified in the model)\n\t\tmime: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\t// can the user swipe\n\t\tcanSwipe: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\t\t// is the content loaded?\n\t\t// synced with parent\n\t\tloaded: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// is the sidebar currently opened ?\n\t\tisSidebarShown: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// are we in fullscreen mode ?\n\t\tisFullScreen: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\t// The file id of the peer live photo file\n\t\tmetadataFilesLivePhoto: {\n\t\t\ttype: Number,\n\t\t\tdefault: undefined,\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\theight: null,\n\t\t\twidth: null,\n\t\t\tnaturalHeight: null,\n\t\t\tnaturalWidth: null,\n\t\t\tisLoaded: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tname() {\n\t\t\treturn parsePath(this.basename).name\n\t\t},\n\t\text() {\n\t\t\treturn parsePath(this.basename).ext\n\t\t},\n\t\tsrc() {\n\t\t\treturn this.source ?? this.davPath\n\t\t},\n\t},\n\n\twatch: {\n\t\tactive(val, old) {\n\t\t\t// the item was hidden before and is now the current view\n\t\t\tif (val === true && old === false) {\n\t\t\t\t// just in case the file was preloaded, let's warn the viewer\n\t\t\t\tif (this.isLoaded) {\n\t\t\t\t\tthis.doneLoading()\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t// update image size on sidebar toggle\n\t\tisSidebarShown() {\n\t\t\t// wait for transition to complete (100ms)\n\t\t\tsetTimeout(this.updateHeightWidth, 200)\n\t\t},\n\t},\n\n\tmounted() {\n\t\t// detect error and let the viewer know\n\t\tthis.$el.addEventListener('error', e => {\n\t\t\tconsole.error('Error loading', this.filename, e)\n\t\t\tthis.$emit('error', e)\n\t\t})\n\n\t\t// update image size on window resize\n\t\twindow.addEventListener('resize', debounce(() => {\n\t\t\tthis.updateHeightWidth()\n\t\t}, 100))\n\t},\n\n\tmethods: {\n\n\t\t/**\n\t\t * This is used to make the viewer know this file is complete or ready\n\t\t * ! you NEED to use it to make the viewer aware of the current loading state\n\t\t */\n\t\tdoneLoading() {\n\t\t\t// send the current state\n\t\t\tthis.$emit('update:loaded', true)\n\t\t\t// save the current state\n\t\t\tthis.isLoaded = true\n\t\t},\n\n\t\t/**\n\t\t * Updates the current height and width data\n\t\t * based on the viewer maximum size\n\t\t */\n\t\tupdateHeightWidth() {\n\t\t\tconst modalWrapper = this.$parent.$el.querySelector('.modal-wrapper')\n\t\t\tif (modalWrapper && this.naturalHeight > 0 && this.naturalWidth > 0) {\n\t\t\t\tconst modalContainer = modalWrapper.querySelector('.modal-container')\n\n\t\t\t\tconst parentHeight = modalContainer.clientHeight\n\t\t\t\tconst parentWidth = modalContainer.clientWidth\n\n\t\t\t\tconst heightRatio = parentHeight / this.naturalHeight\n\t\t\t\tconst widthRatio = parentWidth / this.naturalWidth\n\n\t\t\t\t// if the video height is capped by the parent height\n\t\t\t\t// AND the video is bigger than the parent\n\t\t\t\tif (heightRatio < widthRatio && heightRatio < 1) {\n\t\t\t\t\tthis.height = parentHeight\n\t\t\t\t\tthis.width = Math.round(this.naturalWidth / this.naturalHeight * parentHeight)\n\n\t\t\t\t// if the video width is capped by the parent width\n\t\t\t\t// AND the video is bigger than the parent\n\t\t\t\t} else if (heightRatio > widthRatio && widthRatio < 1) {\n\t\t\t\t\tthis.width = parentWidth\n\t\t\t\t\tthis.height = Math.round(this.naturalHeight / this.naturalWidth * parentWidth)\n\n\t\t\t\t// RESET\n\t\t\t\t} else {\n\t\t\t\t\tthis.height = this.naturalHeight\n\t\t\t\t\tthis.width = this.naturalWidth\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\n\t\t/**\n\t\t * Enable the viewer swiping previous/next capability\n\t\t */\n\t\tenableSwipe() {\n\t\t\tthis.$emit('update:canSwipe', true)\n\t\t},\n\n\t\t/**\n\t\t * Disable the viewer swiping previous/next capability\n\t\t */\n\t\tdisableSwipe() {\n\t\t\tthis.$emit('update:canSwipe', false)\n\t\t},\n\n\t\t/**\n\t\t * Toggle the fullscreen on the current visible element\n\t\t */\n\t\ttoggleFullScreen() {\n\t\t\tif (this.isFullScreen) {\n\t\t\t\tdocument.exitFullscreen()\n\t\t\t} else {\n\t\t\t\tthis.$el.requestFullscreen()\n\t\t\t}\n\t\t},\n\t},\n}\n","\n \n \n \n {{ title }}\n \n \n \n\n\n","\n \n \n \n {{ title }}\n \n \n \n\n\n","\n \n \n \n {{ title }}\n \n \n \n\n\n","\n \n \n \n {{ title }}\n \n \n \n\n\n","\n \n \n \n {{ title }}\n \n \n \n\n\n","\n\n\n\t\n\t\n\t\t\n\t\t\n\t\n\n\t\n\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t{{ t('viewer', 'Edit') }}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t{{ isFullscreenMode ? t('viewer', 'Exit full screen') : t('viewer', 'Full screen') }}\n\t\t\t\n\t\t\t\n\t\t\t\t{{ t('viewer', 'Open sidebar') }}\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t{{ t('viewer', 'Download') }}\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t{{ t('viewer', 'Delete') }}\n\t\t\t\n\t\t\n\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\n\n\n\n\n\n\n\n","/**\n * @copyright Copyright (c) 2019 John Molakvoæ \n *\n * @author John Molakvoæ \n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see .\n *\n */\nimport { translate as t } from '@nextcloud/l10n'\nimport Vue from 'vue'\n\nimport ViewerComponent from './views/Viewer.vue'\n\nVue.mixin({\n\tmethods: {\n\t\tt,\n\t},\n})\n\nVue.prototype.OC = window.OC\nVue.prototype.OCA = window.OCA\n\n// Create document root\nconst ViewerRoot = document.createElement('div')\nViewerRoot.id = 'viewer'\ndocument.body.appendChild(ViewerRoot)\n\n// Put controls for video viewer\n// Needed as Firefox CSP blocks the loading of the svg through the normal plyr system\nconst VideoControls = document.createElement('div')\nVideoControls.innerHTML = PLYR_ICONS\nVideoControls.style.display = 'none'\ndocument.body.appendChild(VideoControls)\n\n// Init vue\nexport default new Vue({\n\tel: '#viewer',\n\t// When debugging the page, it's easier to find which app\n\t// is which. Especially when there is multiple apps\n\t// roots mounted o the same page!\n\t// eslint-disable-next-line vue/match-component-file-name\n\tname: 'ViewerRoot',\n\trender: h => h(ViewerComponent),\n})\n"],"file":"js/viewer-main.mjs"} \ No newline at end of file