diff --git a/css/main-qWpo4_XQ.chunk.css b/css/main-C8zYbCFh.chunk.css
similarity index 65%
rename from css/main-qWpo4_XQ.chunk.css
rename to css/main-C8zYbCFh.chunk.css
index 69d244923..e9db7848f 100644
--- a/css/main-qWpo4_XQ.chunk.css
+++ b/css/main-C8zYbCFh.chunk.css
@@ -7,4 +7,4 @@
*/._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}.viewer.modal-mask[data-v-eb117915]{transition:width ease .1s,background-color .3s ease}.viewer[data-v-eb117915] .modal-container,.viewer__content[data-v-eb117915]{overflow:visible!important;cursor:pointer}.viewer--split[data-v-eb117915]{display:flex}.viewer--split .viewer__file--active[data-v-eb117915]{width:50%;left:0;position:relative}.viewer[data-v-eb117915] .modal-wrapper .modal-container{top:var(--header-height);bottom:var(--header-height);height:auto;background-color:transparent;box-shadow:none}.viewer__content[data-v-eb117915]{width:100%;height:100%}.viewer__file-wrapper[data-v-eb117915]{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.viewer__file-wrapper--hidden[data-v-eb117915]{position:absolute;z-index:-1;left:-10000px}.viewer__file[data-v-eb117915]{transition:height .1s ease,width .1s ease}.viewer.theme--dark[data-v-eb117915] .button-vue--vue-tertiary:hover{background-color:#ffffff14!important}.viewer.theme--dark[data-v-eb117915] .button-vue--vue-tertiary:focus,.viewer.theme--dark[data-v-eb117915] .button-vue--vue-tertiary:focus-visible{background-color:#ffffff14!important;outline:2px solid var(--color-primary-element)!important}.viewer.theme--dark[data-v-eb117915] .button-vue--vue-tertiary.action-item__menutoggle{background-color:transparent}.viewer.theme--undefined.modal-mask[data-v-eb117915]{background-color:transparent!important}.viewer.theme--light.modal-mask[data-v-eb117915]{background-color:#ffffffeb!important}.viewer.theme--light[data-v-eb117915] .modal-header__name,.viewer.theme--light[data-v-eb117915] .modal-header .icons-menu button svg{color:#000!important}.viewer.theme--default.modal-mask[data-v-eb117915]{background-color:var(--color-main-background)!important}.viewer.theme--default[data-v-eb117915] .modal-header__name,.viewer.theme--default[data-v-eb117915] .modal-header .icons-menu{color:var(--color-main-text)!important}.viewer.theme--default[data-v-eb117915] .modal-header__name button svg,.viewer.theme--default[data-v-eb117915] .modal-header__name a,.viewer.theme--default[data-v-eb117915] .modal-header .icons-menu button svg,.viewer.theme--default[data-v-eb117915] .modal-header .icons-menu a{color:var(--color-main-text)!important}.viewer.image--fullscreen[data-v-eb117915] .modal-header .modal-header__name{opacity:0}.viewer.image--fullscreen[data-v-eb117915] .modal-header .icons-menu{background-color:#0003}.viewer.image--fullscreen[data-v-eb117915] .modal-wrapper .modal-container{top:0;bottom:0;height:100%}body:has(#viewer) #app-sidebar-vue{position:fixed;width:calc(var(--app-sidebar-width) + var(--body-container-margin))}body:has(#viewer) #header{visibility:hidden}.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}
+*/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}.viewer.modal-mask[data-v-79481d80]{transition:width ease .1s,background-color .3s ease}.viewer[data-v-79481d80] .modal-container,.viewer__content[data-v-79481d80]{overflow:visible!important;cursor:pointer}.viewer--split[data-v-79481d80]{display:flex}.viewer--split .viewer__file--active[data-v-79481d80]{width:50%;left:0;position:relative}.viewer[data-v-79481d80] .modal-wrapper .modal-container{top:var(--header-height);bottom:var(--header-height);height:auto;background-color:transparent;box-shadow:none}.viewer__content[data-v-79481d80]{width:100%;height:100%}.viewer__file-wrapper[data-v-79481d80]{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.viewer__file-wrapper--hidden[data-v-79481d80]{position:absolute;z-index:-1;left:-10000px}.viewer__file[data-v-79481d80]{transition:height .1s ease,width .1s ease}.viewer.theme--dark[data-v-79481d80] .button-vue--vue-tertiary:hover{background-color:#ffffff14!important}.viewer.theme--dark[data-v-79481d80] .button-vue--vue-tertiary:focus,.viewer.theme--dark[data-v-79481d80] .button-vue--vue-tertiary:focus-visible{background-color:#ffffff14!important;outline:2px solid var(--color-primary-element)!important}.viewer.theme--dark[data-v-79481d80] .button-vue--vue-tertiary.action-item__menutoggle{background-color:transparent}.viewer.theme--undefined.modal-mask[data-v-79481d80]{background-color:transparent!important}.viewer.theme--light.modal-mask[data-v-79481d80]{background-color:#ffffffeb!important}.viewer.theme--light[data-v-79481d80] .modal-header__name,.viewer.theme--light[data-v-79481d80] .modal-header .icons-menu button svg{color:#000!important}.viewer.theme--default.modal-mask[data-v-79481d80]{background-color:var(--color-main-background)!important}.viewer.theme--default[data-v-79481d80] .modal-header__name,.viewer.theme--default[data-v-79481d80] .modal-header .icons-menu{color:var(--color-main-text)!important}.viewer.theme--default[data-v-79481d80] .modal-header__name button svg,.viewer.theme--default[data-v-79481d80] .modal-header__name a,.viewer.theme--default[data-v-79481d80] .modal-header .icons-menu button svg,.viewer.theme--default[data-v-79481d80] .modal-header .icons-menu a{color:var(--color-main-text)!important}.viewer.image--fullscreen[data-v-79481d80] .modal-header .modal-header__name{opacity:0}.viewer.image--fullscreen[data-v-79481d80] .modal-header .icons-menu{background-color:#0003}.viewer.image--fullscreen[data-v-79481d80] .modal-wrapper .modal-container{top:0;bottom:0;height:100%}body:has(#viewer) #app-sidebar-vue{position:fixed;width:calc(var(--app-sidebar-width) + var(--body-container-margin))}body:has(#viewer) .app-navigation~#app-content-vue:has(~#app-sidebar-vue:not([style*="display: none"])){flex-basis:calc(100% - 300px - clamp(300px,27vw,500px))}body:has(#viewer) #app-content-vue:first-child:has(~#app-sidebar-vue:not([style*="display: none"])),body:has(#viewer) .app-navigation--close~#app-content-vue:has(~#app-sidebar-vue:not([style*="display: none"])),body:has(#viewer) .app-navigation--closed~#app-content-vue:has(~#app-sidebar-vue:not([style*="display: none"])){flex-basis:calc(100% - clamp(300px,27vw,500px))}body:has(#viewer) #header{visibility:hidden}.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 7807ac139..f02f420a1 100644
--- a/css/viewer-main.css
+++ b/css/viewer-main.css
@@ -1,3 +1,3 @@
/* extracted by css-entry-points-plugin */
-@import './main-qWpo4_XQ.chunk.css';
+@import './main-C8zYbCFh.chunk.css';
@import './previewUtils-6cpbKhU6.chunk.css';
\ No newline at end of file
diff --git a/js/viewer-main.mjs b/js/viewer-main.mjs
index aa0a92c6f..19cdb1af8 100644
--- a/js/viewer-main.mjs
+++ b/js/viewer-main.mjs
@@ -1,9 +1,9 @@
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('viewer', '', 'js/previewUtils-Bz9VYbC0.chunk.mjs'),window.OC.filePath('viewer', '', 'css/previewUtils-6cpbKhU6.chunk.css'),window.OC.filePath('viewer', '', 'js/NcActionLink-C2XlZe2R.chunk.mjs'),window.OC.filePath('viewer', '', 'js/actionText-fFcUPi2g-gjw6zxAU.chunk.mjs'),window.OC.filePath('viewer', '', 'css/NcActionLink-Cay-IPuV.chunk.css'),window.OC.filePath('viewer', '', 'js/NcActionButton-CN5NMb08.chunk.mjs'),window.OC.filePath('viewer', '', 'css/NcActionButton-DyH89PpO.chunk.css'),window.OC.filePath('viewer', '', 'css/index-CS3F8E0B.chunk.css')])))=>i.map(i=>d[i]);
-import{i as T,a as N,b as c,g as q,c as $,d as u,r as R,e as L,f as G,h as W,j as K,k as j,l as U,m as Z,o as A,p as J,q as Y,s as Q,t as X,u as ee,_ as y,v as s,w as g,F,x as b,y as _,V as w,z as k,A as te,B as ie,C as ne,D as v,E as h,G as se,H as re,I as le,J as oe}from"./previewUtils-Bz9VYbC0.chunk.mjs";const ae={computed:{isFullscreen(){return T.value}}},de={computed:{isMobile(){return N.value}}};function ce(e){if(e.hideDownload)return!1;const i=typeof e?.shareAttributes=="string"?JSON.parse(e.shareAttributes||"[]"):e?.shareAttributes;return i&&i.length>0?i.find(({scope:n,key:r})=>n==="permissions"&&r==="download")?.value!==!1:!0}const V=function(e){const i=new AbortController;return{request:async function(n,r){return e(n,{...r,signal:i.signal})},cancel:()=>i.abort()}},he={name:"Error",props:{name:{type:String,default:""}}};var ue=function(){var e=this,i=e._self._c;return i("div",{attrs:{id:"emptycontent"}},[i("div",{staticClass:"icon-error"}),i("h2",[e._t("default",function(){return[e._v(e._s(e.t("viewer","Error loading {name}",{name:e.name})))]})],2)])},me=[],pe=c(he,ue,me,!1,null,"6a8e09db");const fe=pe.exports,we=async e=>{e.startsWith("/")||(e=`/${e}`);const i=q(),n=$(),r=await i.stat(`${u()}${e}`,{details:!0,data:n});return R(r.data)};function p(e,i,n){const r={mime:i,modal:n,failed:!1,loaded:!1,davPath:L(e),source:e.source??L(e)};return Object.assign({},e,r)}async function ge(e,i={}){return(await G.getDirectoryContents(e,Object.assign({data:`
+import{i as T,a as N,b as c,g as q,c as $,d as u,r as R,e as S,f as G,h as W,j as K,k as j,l as U,m as Z,o as A,p as J,q as Y,s as Q,t as X,u as ee,_ as y,v as s,w as g,F,x as b,y as _,V as w,z as k,A as te,B as ie,C as ne,D as v,E as h,G as se,H as re,I as le,J as oe}from"./previewUtils-Bz9VYbC0.chunk.mjs";const ae={computed:{isFullscreen(){return T.value}}},de={computed:{isMobile(){return N.value}}};function ce(e){if(e.hideDownload)return!1;const i=typeof e?.shareAttributes=="string"?JSON.parse(e.shareAttributes||"[]"):e?.shareAttributes;return i&&i.length>0?i.find(({scope:n,key:r})=>n==="permissions"&&r==="download")?.value!==!1:!0}const V=function(e){const i=new AbortController;return{request:async function(n,r){return e(n,{...r,signal:i.signal})},cancel:()=>i.abort()}},he={name:"Error",props:{name:{type:String,default:""}}};var ue=function(){var e=this,i=e._self._c;return i("div",{attrs:{id:"emptycontent"}},[i("div",{staticClass:"icon-error"}),i("h2",[e._t("default",function(){return[e._v(e._s(e.t("viewer","Error loading {name}",{name:e.name})))]})],2)])},me=[],pe=c(he,ue,me,!1,null,"6a8e09db");const fe=pe.exports,we=async e=>{e.startsWith("/")||(e=`/${e}`);const i=q(),n=$(),r=await i.stat(`${u()}${e}`,{details:!0,data:n});return R(r.data)};function p(e,i,n){const r={mime:i,modal:n,failed:!1,loaded:!1,davPath:S(e),source:e.source??S(e)};return Object.assign({},e,r)}async function ge(e,i={}){return(await G.getDirectoryContents(e,Object.assign({data:`
${K()}
- `,details:!0},i))).data.map(j)}async function ve(){const e=await ye();if(!e)return{key:"basename",asc:!0};const i={mtime:"lastmod"}[e.sorting_mode]||e.sorting_mode||"basename",n=e.sorting_direction==="asc"||!e.sorting_direction;return{key:i,asc:n}}async function ye(){if(U())return null;const e=Z("apps/files/api/v1/views");return await A.get(e).then(i=>i.data.data?.files).catch(()=>null)}const Fe={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 L({filename:this.filename,basename:this.basename})}},methods:{getPreviewIfAny(e){return J(e)}}};var f={exports:{}},be=Y.platform==="win32",_e=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,S={};function xe(e){return _e.exec(e).slice(1)}S.parse=function(e){if(typeof e!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var i=xe(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 Ce=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,x={};function Le(e){return Ce.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=Le(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]}},be?f.exports=S.parse:f.exports=x.parse,f.exports.posix=x.parse,f.exports.win32=S.parse;var Se=f.exports;const H=Q(Se),Ee={inheritAttrs:!1,mixins:[Fe],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},canZoom:{type:Boolean,default:!1},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 H(this.basename).name},ext(){return H(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",X(()=>{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"),n=i.clientHeight,r=i.clientWidth,l=n/this.naturalHeight,d=r/this.naturalWidth;ld&&d<1?(this.width=r,this.height=Math.round(this.naturalHeight/this.naturalWidth*r)):(this.height=this.naturalHeight,this.width=this.naturalWidth)}else 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()}}},ke={name:"TrashCanOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Ve=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon trash-can-outline-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"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:"M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},He=[],Me=c(ke,Ve,He,!1,null,null);const Ae=Me.exports,Ie={name:"TrayArrowDownIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var ze=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon tray-arrow-down-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"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:"M2 12H4V17H20V12H22V17C22 18.11 21.11 19 20 19H4C2.9 19 2 18.11 2 17V12M12 15L17.55 9.54L16.13 8.13L13 11.25V2H11V11.25L7.88 8.13L6.46 9.55L12 15Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},Oe=[],De=c(Ie,ze,Oe,!1,null,null);const Pe=De.exports,Be={name:"FullscreenIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Te=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:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"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()])])])},Ne=[],qe=c(Be,Te,Ne,!1,null,null);const $e=qe.exports,Re={name:"FullscreenExitIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Ge=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:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"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()])])])},We=[],Ke=c(Re,Ge,We,!1,null,null);const je=Ke.exports,Ue={name:"PencilOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Ze=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon pencil-outline-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"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.06,9L15,9.94L5.92,19H5V18.08L14.06,9M17.66,3C17.41,3 17.15,3.1 16.96,3.29L15.13,5.12L18.88,8.87L20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18.17,3.09 17.92,3 17.66,3M14.06,6.19L3,17.25V21H6.75L17.81,9.94L14.06,6.19Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},Je=[],Ye=c(Ue,Ze,Je,!1,null,null);const Qe=Ye.exports,Xe={name:"DockRightIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var et=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon dock-right-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"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 4H4A2 2 0 0 0 2 6V18A2 2 0 0 0 4 20H20A2 2 0 0 0 22 18V6A2 2 0 0 0 20 4M15 18H4V6H15Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},tt=[],it=c(Xe,et,tt,!1,null,null);const nt=it.exports,st=()=>y(()=>import("./previewUtils-Bz9VYbC0.chunk.mjs").then(e=>e.bf),__vite__mapDeps([0,1]),import.meta.url),rt=()=>y(()=>import("./NcActionLink-C2XlZe2R.chunk.mjs"),__vite__mapDeps([2,3,0,1,4]),import.meta.url),lt=()=>y(()=>import("./NcActionButton-CN5NMb08.chunk.mjs"),__vite__mapDeps([5,0,1,3,6]),import.meta.url),ot=ee({name:"Viewer",components:{Delete:Ae,DockRight:nt,Download:Pe,Error:fe,Fullscreen:$e,FullscreenExit:je,NcActionButton:lt,NcActionLink:rt,NcModal:st,Pencil:Qe},mixins:[ae,de],data(){return{Viewer:OCA.Viewer,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,lightBackdrop:null,root:_,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},isStartOfList(){return this.currentIndex===0},isEndOfList(){return this.currentIndex===this.fileList.length-1},hasPreviousFile(){return Object.keys(this.previousFile).length>0},hasNextFile(){return Object.keys(this.nextFile).length>0},isImage(){return["image/jpeg","image/png","image/webp"].includes(this.currentFile?.mime)},sidebarOpenFilePath(){try{return this.currentFile?.davPath?.split(re)[1]?.split("/")?.map(decodeURIComponent)?.join("/")}catch{return!1}},canDelete(){return this.currentFile?.permissions?.includes("D")},canDownload(){return this.comparisonFile?!1:this.currentFile&&ce(this.currentFile)},canEdit(){return!this.isMobile&&this.canDownload&&this.currentFile?.permissions?.includes("W")&&this.isImage&&!this.comparisonFile&&(se("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||i===this.currentFile.filename||e&&e.fileid===this.currentFile.fileid&&e.mtime&&e.mtime===this.currentFile.mtime&&e.source&&e.source===this.currentFile.source)}},watch:{el(e){s.info(e),this.$nextTick(()=>{const i=document.getElementById("viewer");if(e){const n=document.querySelector(e);n?n.appendChild(i):s.warn("Could not find element ",{element:e})}else document.body.appendChild(i)})},file(e){e&&e.trim()!==""?(s.info("Opening viewer for file ",{path:e}),this.openFile(e,OCA.Viewer.overrideHandlerId)):this.cleanup()},fileInfo(e){e?(s.info("Opening viewer for fileInfo ",{fileInfo:e}),this.openFileInfo(e,OCA.Viewer.overrideHandlerId)):this.cleanup()},comparisonFileInfo(e){e?(s.info("Opening viewer for comparisonFileInfo ",{fileInfo:e}),this.compareFile(e)):this.cleanup()},files(e){if(!e||!Array.isArray(e)||e.length===0){s.warn("No files provided, skipping update");return}const i=e.findIndex(n=>n.filename===this.currentFile.filename);i>-1&&(this.currentIndex=i,s.debug("The files list changed, new current file index is "+i)),this.fileList=e},async isEndOfList(e){if(!(!e||this.el)&&this.loadMore&&typeof this.loadMore=="function"){s.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,this.isStandalone&&s.info("No OCP.Files app found, viewer is now in standalone mode"),document.addEventListener("DOMContentLoaded",()=>{window._oca_viewer_handlers&&window._oca_viewer_handlers.forEach(e=>{OCA.Viewer.registerHandler(e)}),this.handlers.forEach(e=>{this.registerHandler(e)}),this.handlers.forEach(e=>{this.registerHandlerAlias(e)}),this.isLoaded=!0,s.info(`${this.handlers.length} viewer handlers registered`,{handlers:this.handlers})}),window.addEventListener("resize",this.onResize)},mounted(){h("files:sidebar:opened",this.handleAppSidebarOpen),h("files:sidebar:closed",this.handleAppSidebarClose),h("files:node:updated",this.handleFileUpdated),h("viewer:trapElements:changed",this.handleTrapElementsChange),h("editor:toggle",this.toggleEditor),h("editor:file:created",this.handleNewFile),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),v("editor:toggle",this.toggleEditor),window.removeEventListener("keydown",this.keyboardDeleteFile),window.removeEventListener("keydown",this.keyboardDownloadFile),window.removeEventListener("keydown",this.keyboardEditFile),this.removeFullscreenEventListeners()},methods:{uniqueKey(e){return""+e.fileid+e.source},toggleEditor(e){ne(e),this.editing=e},preventContextMenu(e){this.canDownload||e.preventDefault()},async beforeOpen(){this.initiated=!0,OCA?.Files?.Sidebar?.setFullScreenMode&&OCA.Files.Sidebar.setFullScreenMode(!0),this.sortingConfig=await ve(),window.loadRoboto&&(s.debug("⚠️ Loading roboto font for visual regression tests"),y(()=>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)){s.debug("Viewer already opened with the same path, ignoring",{path:e});return}const{request:n,cancel:r}=V(le);this.cancelRequestFile=r;const[,l]=k(e);this.el||(document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden");const d=document.getElementsByTagName("head")[0].getElementsByTagName("title")[0];d&&!d.dataset.old&&l!==""&&(d.dataset.old=document.title,this.updateTitle(l));try{const a=await n(e);console.debug("File info for "+e+" fetched",a),await this.openFileInfo(a,i),!this.isStandalone&&this.canEdit&&window.OCP?.Files?.Router?.query?.editing==="true"&&this.toggleEditor(!0)}catch(a){a?.response?.status===404?(s.error("The file no longer exists, error: ",{error:a}),g(t("viewer","This file no longer exists")),this.close()):console.error("Could not open file "+e,a)}},async handleNewFile(e){let i;try{i=ie(e),this.openFile(i)}catch(n){s.error("Could not extract file path from source",{source:e,e:n})}try{const n=await we("/"+i);b("files:node:created",n)}catch(n){s.error("Could not fetch new file",{path:i,e:n})}},async openFileInfo(e,i=null){if(this.beforeOpen(),this.cancelRequestFolder(),this.isSameFile(e)){s.debug("Viewer already opened with the same fileInfo, ignoring",{fileInfo:e});return}const n=e.mime,r=n.split("/")[0];let l;if(i!==null&&(l=Object.values(this.registeredHandlers).find(m=>m.id===i)??l),l||(l=this.registeredHandlers[n]??this.registeredHandlers[r]),!l){s.error("The following file could not be displayed",{fileInfo:e}),g(t("viewer","There is no plugin available to display this file type")),this.close();return}this.theme=l.theme??"dark";const d=window.getComputedStyle(document.body).getPropertyValue("--background-invert-if-dark")!=="invert(100%)";this.lightBackdrop=l.theme==="light"||l.theme==="default"&&d,this.handlerId=l.id,this.currentFile=new p(e,n,l.component),this.comparisonFile=null,this.updatePreviousNext();const a=this.mimeGroups[n];if(this.files&&this.files.length>0)s.debug("A files list have been provided. No folder content will be fetched."),this.fileList=this.files,this.currentIndex=this.fileList.findIndex(m=>m.filename===e.filename);else if(a&&this.el===null){const m=this.mimeGroups[a]?this.mimeGroups[a]:[n],{request:I,cancel:z}=V(ge);this.cancelRequestFolder=z;const[O]=k(e.filename);this.currentIndex=0,this.fileList=[e];const E=(await I(O)).filter(o=>o.mime&&m.indexOf(o.mime)!==-1),D=E.map(o=>new F({source:_+u()+o.filename,id:o.fileid,displayname:o.displayname,mime:o.mime,mtime:new Date(o.lastmod),owner:this.currentFile.ownerId,root:u()})),P=te(D,{sortingMode:this.sortingConfig.key,sortingOrder:this.sortingConfig.asc?"asc":"desc"});this.fileList=P.map(o=>E.find(B=>B.filename===o.path)),this.currentIndex=this.fileList.findIndex(o=>o.filename===e.filename),this.updatePreviousNext()}else this.currentIndex=0,this.fileList=[e];this.changeSidebar()},openFileFromList(e){const i=e.mime;this.currentFile=new p(e,i,this.components[i]),this.changeSidebar(),this.updatePreviousNext()},async compareFile(e){this.comparisonFile=new p(e,e.mime,this.components[e.mime])},changeSidebar(){this.isSidebarShown&&this.showSidebar()},updatePreviousNext(){const e=this.fileList[this.currentIndex-1],i=this.fileList[this.currentIndex+1];if(e){const n=e.mime;this.components[n]&&(this.previousFile=new p(e,n,this.components[n]))}else this.previousFile={};if(i){const n=i.mime;this.components[n]&&(this.nextFile=new p(i,n,this.components[n]))}else this.nextFile={}},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){s.error("The following handler is already registered",{handler:e});return}if(!e.id||e.id.trim()===""||typeof e.id!="string"){s.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){s.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"){s.error("The following handler doesn't have a valid component",{handler:e});return}e.component.mixins=[...e?.component?.mixins??[],Ee],e.mimes&&e.mimes.forEach(i=>{if(this.components[i]){s.error("The following mime is already registered",{mime:i,handler:e});return}this.registerGroups({mime:i,group:e.group}),this.components[i]=e.component,w.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"){s.error("The following handler doesn't have a valid mimesAliases object",{handler:e});return}const n=e.mimesAliases[i];if(this.components[i]){s.error("The following mime is already registered",{mime:i,handler:e});return}if(!this.components[n]){s.error("The requested alias does not exists",{alias:n,mime:i,handler:e});return}this.registerGroups({mime:i,group:this.mimeGroups[n]}),this.components[i]=this.components[n],this.registeredHandlers[i]=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){e.key==="s"&&e.ctrlKey===!0&&(e.preventDefault(),this.canDownload&&this.onDownload())},keyboardEditFile(e){e.key==="e"&&e.ctrlKey===!0&&(e.preventDefault(),this.canEdit&&this.onEdit())},cleanup(){s.info("Cleaning up viewer"),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(){if(this.enableSidebar){const e=new F({source:_+u()+this.currentFile.filename,id:this.currentFile.fileid,displayname:this.currentFile.displayname,mime:this.currentFile.mime,mtime:new Date(this.currentFile.lastmod),owner:this.currentFile.ownerId,root:u()});b("viewer:sidebar:open",e),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:n})=>n===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.currentFile.source??this.currentFile.davPath,n=new F({source:i,id:e,mime:this.currentFile.mime,owner:this.currentFile.ownerId,root:i.includes("remote.php/dav")?u():void 0});await A.delete(i),b("files:node:deleted",n);const r=this.fileList.findIndex(l=>l.filename===this.currentFile.filename);this.hasPrevious||this.hasNext?(this.hasNext?this.next():this.previous(),this.fileList.splice(r,1)):this.close()}catch(e){console.error(e),g(e)}},onEdit(){this.toggleEditor(!0)},async onDownload(){if(!this.canDownload)return;const e=this.currentFile.mime,i=e?.split("/")[0],n=this.registeredHandlers[e]??this.registeredHandlers[i];if(n?.downloadCallback&&typeof n.downloadCallback=="function")try{s.debug("Calling handler downloadCallback before download"),await n.downloadCallback(this.currentFile)}catch(r){s.error("Failed to execute downloadCallback",{error:r}),g(t("viewer","Failed to save file before download"));return}this.performDownload()},performDownload(){s.debug("Performing download",{file:this.currentFile});const e=document.createElement("a");e.href=this.currentFile.source??this.currentFile.davPath,e.download=this.currentFile.basename,document.body.appendChild(e),e.click(),document.body.removeChild(e)},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 at=function(){var e=this,i=e._self._c;return e._self._setupProxy,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.uniqueKey(e.currentFile),ref:"content",tag:"component",staticClass:"viewer__file viewer__file--active",attrs:{active:!0,"can-swipe":!1,"can-zoom":!1,"file-list":[e.currentFile],"is-full-screen":!1,loaded:e.currentFile.loaded,"is-sidebar-shown":!1},on:{"update:loaded":function(n){return e.$set(e.currentFile,"loaded",n)},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,"light-backdrop":e.lightBackdrop,"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,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.sidebarOpenFilePath&&!e.isSidebarShown?i("NcActionButton",{attrs:{"close-after-click":""},on:{click:e.showSidebar},scopedSlots:e._u([{key:"icon",fn:function(){return[i("DockRight",{attrs:{size:20}})]},proxy:!0}],null,!1,151993963)},[e._v(" "+e._s(e.t("viewer","Open sidebar"))+" ")]):e._e(),e.canDownload?i("NcActionButton",{attrs:{"close-after-click":!0},on:{click:e.onDownload},scopedSlots:e._u([{key:"icon",fn:function(){return[i("Download",{attrs:{size:20}})]},proxy:!0}],null,!1,3312959228)},[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:20}})]},proxy:!0}],null,!1,2705356561)},[e._v(" "+e._s(e.t("viewer","Delete"))+" ")]):e._e()]},proxy:!0}])},[i("div",{staticClass:"viewer__content",class:e.contentClass,on:{click:function(n){return n.target!==n.currentTarget||n.ctrlKey||n.shiftKey||n.altKey||n.metaKey?null:e.close.apply(null,arguments)},contextmenu:e.preventContextMenu}},[e.comparisonFile&&!e.comparisonFile.failed&&e.showComparison?i("div",{staticClass:"viewer__file-wrapper"},[i(e.comparisonFile.modal,e._b({key:e.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(n){return e.$set(e.comparisonFile,"loaded",n)},error:e.comparisonFailed}},"component",e.comparisonFile,!1))],1):e._e(),e.hasPreviousFile?i("div",{key:e.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.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":!0,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(n){e.canSwipe=n},"update:can-swipe":function(n){e.canSwipe=n},"update:editing":[function(n){e.editing=n},e.toggleEditor],"update:loaded":function(n){return e.$set(e.currentFile,"loaded",n)},error:e.currentFailed}},"component",e.currentFile,!1))],1),e.hasNextFile?i("div",{key:e.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()},dt=[],ct=c(ot,at,dt,!1,null,"eb117915");const ht=ct.exports;w.mixin({methods:{t:oe}}),w.prototype.OC=window.OC,w.prototype.OCA=window.OCA;const M=document.createElement("div");M.id="viewer",document.body.appendChild(M);const C=document.createElement("div");C.innerHTML=' ',C.style.display="none",document.body.appendChild(C),new w({el:"#viewer",name:"ViewerRoot",render:e=>e(ht)});
+ `,details:!0},i))).data.map(j)}async function ve(){const e=await ye();if(!e)return{key:"basename",asc:!0};const i={mtime:"lastmod"}[e.sorting_mode]||e.sorting_mode||"basename",n=e.sorting_direction==="asc"||!e.sorting_direction;return{key:i,asc:n}}async function ye(){if(U())return null;const e=Z("apps/files/api/v1/views");return await A.get(e).then(i=>i.data.data?.files).catch(()=>null)}const Fe={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 S({filename:this.filename,basename:this.basename})}},methods:{getPreviewIfAny(e){return J(e)}}};var f={exports:{}},be=Y.platform==="win32",_e=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,L={};function xe(e){return _e.exec(e).slice(1)}L.parse=function(e){if(typeof e!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof e);var i=xe(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 Ce=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,x={};function Se(e){return Ce.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=Se(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]}},be?f.exports=L.parse:f.exports=x.parse,f.exports.posix=x.parse,f.exports.win32=L.parse;var Le=f.exports;const H=Q(Le),Ee={inheritAttrs:!1,mixins:[Fe],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},canZoom:{type:Boolean,default:!1},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 H(this.basename).name},ext(){return H(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",X(()=>{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"),n=i.clientHeight,r=i.clientWidth,l=n/this.naturalHeight,d=r/this.naturalWidth;ld&&d<1?(this.width=r,this.height=Math.round(this.naturalHeight/this.naturalWidth*r)):(this.height=this.naturalHeight,this.width=this.naturalWidth)}else 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()}}},ke={name:"TrashCanOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Ve=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon trash-can-outline-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"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:"M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},He=[],Me=c(ke,Ve,He,!1,null,null);const Ae=Me.exports,Ie={name:"TrayArrowDownIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var ze=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon tray-arrow-down-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"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:"M2 12H4V17H20V12H22V17C22 18.11 21.11 19 20 19H4C2.9 19 2 18.11 2 17V12M12 15L17.55 9.54L16.13 8.13L13 11.25V2H11V11.25L7.88 8.13L6.46 9.55L12 15Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},Oe=[],De=c(Ie,ze,Oe,!1,null,null);const Pe=De.exports,Be={name:"FullscreenIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Te=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:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"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()])])])},Ne=[],qe=c(Be,Te,Ne,!1,null,null);const $e=qe.exports,Re={name:"FullscreenExitIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Ge=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:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"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()])])])},We=[],Ke=c(Re,Ge,We,!1,null,null);const je=Ke.exports,Ue={name:"PencilOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var Ze=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon pencil-outline-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"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.06,9L15,9.94L5.92,19H5V18.08L14.06,9M17.66,3C17.41,3 17.15,3.1 16.96,3.29L15.13,5.12L18.88,8.87L20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18.17,3.09 17.92,3 17.66,3M14.06,6.19L3,17.25V21H6.75L17.81,9.94L14.06,6.19Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},Je=[],Ye=c(Ue,Ze,Je,!1,null,null);const Qe=Ye.exports,Xe={name:"DockRightIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var et=function(){var e=this,i=e._self._c;return i("span",e._b({staticClass:"material-design-icon dock-right-icon",attrs:{"aria-hidden":e.title?null:"true","aria-label":e.title,role:"img"},on:{click:function(n){return e.$emit("click",n)}}},"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 4H4A2 2 0 0 0 2 6V18A2 2 0 0 0 4 20H20A2 2 0 0 0 22 18V6A2 2 0 0 0 20 4M15 18H4V6H15Z"}},[e.title?i("title",[e._v(e._s(e.title))]):e._e()])])])},tt=[],it=c(Xe,et,tt,!1,null,null);const nt=it.exports,st=()=>y(()=>import("./previewUtils-Bz9VYbC0.chunk.mjs").then(e=>e.bf),__vite__mapDeps([0,1]),import.meta.url),rt=()=>y(()=>import("./NcActionLink-C2XlZe2R.chunk.mjs"),__vite__mapDeps([2,3,0,1,4]),import.meta.url),lt=()=>y(()=>import("./NcActionButton-CN5NMb08.chunk.mjs"),__vite__mapDeps([5,0,1,3,6]),import.meta.url),ot=ee({name:"Viewer",components:{Delete:Ae,DockRight:nt,Download:Pe,Error:fe,Fullscreen:$e,FullscreenExit:je,NcActionButton:lt,NcActionLink:rt,NcModal:st,Pencil:Qe},mixins:[ae,de],data(){return{Viewer:OCA.Viewer,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,lightBackdrop:null,root:_,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},isStartOfList(){return this.currentIndex===0},isEndOfList(){return this.currentIndex===this.fileList.length-1},hasPreviousFile(){return Object.keys(this.previousFile).length>0},hasNextFile(){return Object.keys(this.nextFile).length>0},isImage(){return["image/jpeg","image/png","image/webp"].includes(this.currentFile?.mime)},sidebarOpenFilePath(){try{return this.currentFile?.davPath?.split(re)[1]?.split("/")?.map(decodeURIComponent)?.join("/")}catch{return!1}},canDelete(){return this.currentFile?.permissions?.includes("D")},canDownload(){return this.comparisonFile?!1:this.currentFile&&ce(this.currentFile)},canEdit(){return!this.isMobile&&this.canDownload&&this.currentFile?.permissions?.includes("W")&&this.isImage&&!this.comparisonFile&&(se("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||i===this.currentFile.filename||e&&e.fileid===this.currentFile.fileid&&e.mtime&&e.mtime===this.currentFile.mtime&&e.source&&e.source===this.currentFile.source)}},watch:{el(e){s.info(e),this.$nextTick(()=>{const i=document.getElementById("viewer");if(e){const n=document.querySelector(e);n?n.appendChild(i):s.warn("Could not find element ",{element:e})}else document.body.appendChild(i)})},file(e){e&&e.trim()!==""?(s.info("Opening viewer for file ",{path:e}),this.openFile(e,OCA.Viewer.overrideHandlerId)):this.cleanup()},fileInfo(e){e?(s.info("Opening viewer for fileInfo ",{fileInfo:e}),this.openFileInfo(e,OCA.Viewer.overrideHandlerId)):this.cleanup()},comparisonFileInfo(e){e?(s.info("Opening viewer for comparisonFileInfo ",{fileInfo:e}),this.compareFile(e)):this.cleanup()},files(e){if(!e||!Array.isArray(e)||e.length===0){s.warn("No files provided, skipping update");return}const i=e.findIndex(n=>n.filename===this.currentFile.filename);i>-1&&(this.currentIndex=i,s.debug("The files list changed, new current file index is "+i)),this.fileList=e},async isEndOfList(e){if(!(!e||this.el)&&this.loadMore&&typeof this.loadMore=="function"){s.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,this.isStandalone&&s.info("No OCP.Files app found, viewer is now in standalone mode"),document.addEventListener("DOMContentLoaded",()=>{window._oca_viewer_handlers&&window._oca_viewer_handlers.forEach(e=>{OCA.Viewer.registerHandler(e)}),this.handlers.forEach(e=>{this.registerHandler(e)}),this.handlers.forEach(e=>{this.registerHandlerAlias(e)}),this.isLoaded=!0,s.info(`${this.handlers.length} viewer handlers registered`,{handlers:this.handlers})}),window.addEventListener("resize",this.onResize)},mounted(){h("files:sidebar:opened",this.handleAppSidebarOpen),h("files:sidebar:closed",this.handleAppSidebarClose),h("files:node:updated",this.handleFileUpdated),h("viewer:trapElements:changed",this.handleTrapElementsChange),h("editor:toggle",this.toggleEditor),h("editor:file:created",this.handleNewFile),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),v("editor:toggle",this.toggleEditor),window.removeEventListener("keydown",this.keyboardDeleteFile),window.removeEventListener("keydown",this.keyboardDownloadFile),window.removeEventListener("keydown",this.keyboardEditFile),this.removeFullscreenEventListeners()},methods:{uniqueKey(e){return""+e.fileid+e.source},toggleEditor(e){ne(e),this.editing=e},preventContextMenu(e){this.canDownload||e.preventDefault()},async beforeOpen(){this.initiated=!0;const e=document.querySelector("aside.app-sidebar");e&&e.style.display!=="none"?(this.isSidebarShown=!0,this.sidebarPosition=e.getBoundingClientRect().left,this.trapElements=[e]):(this.isSidebarShown=!1,this.trapElements=[]),OCA?.Files?.Sidebar?.setFullScreenMode&&OCA.Files.Sidebar.setFullScreenMode(!0),this.sortingConfig=await ve(),window.loadRoboto&&(s.debug("⚠️ Loading roboto font for visual regression tests"),y(()=>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)){s.debug("Viewer already opened with the same path, ignoring",{path:e});return}const{request:n,cancel:r}=V(le);this.cancelRequestFile=r;const[,l]=k(e);this.el||(document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden");const d=document.getElementsByTagName("head")[0].getElementsByTagName("title")[0];d&&!d.dataset.old&&l!==""&&(d.dataset.old=document.title,this.updateTitle(l));try{const a=await n(e);console.debug("File info for "+e+" fetched",a),await this.openFileInfo(a,i),!this.isStandalone&&this.canEdit&&window.OCP?.Files?.Router?.query?.editing==="true"&&this.toggleEditor(!0)}catch(a){a?.response?.status===404?(s.error("The file no longer exists, error: ",{error:a}),g(t("viewer","This file no longer exists")),this.close()):console.error("Could not open file "+e,a)}},async handleNewFile(e){let i;try{i=ie(e),this.openFile(i)}catch(n){s.error("Could not extract file path from source",{source:e,e:n})}try{const n=await we("/"+i);b("files:node:created",n)}catch(n){s.error("Could not fetch new file",{path:i,e:n})}},async openFileInfo(e,i=null){if(this.beforeOpen(),this.cancelRequestFolder(),this.isSameFile(e)){s.debug("Viewer already opened with the same fileInfo, ignoring",{fileInfo:e});return}const n=e.mime,r=n.split("/")[0];let l;if(i!==null&&(l=Object.values(this.registeredHandlers).find(m=>m.id===i)??l),l||(l=this.registeredHandlers[n]??this.registeredHandlers[r]),!l){s.error("The following file could not be displayed",{fileInfo:e}),g(t("viewer","There is no plugin available to display this file type")),this.close();return}this.theme=l.theme??"dark";const d=window.getComputedStyle(document.body).getPropertyValue("--background-invert-if-dark")!=="invert(100%)";this.lightBackdrop=l.theme==="light"||l.theme==="default"&&d,this.handlerId=l.id,this.currentFile=new p(e,n,l.component),this.comparisonFile=null,this.updatePreviousNext();const a=this.mimeGroups[n];if(this.files&&this.files.length>0)s.debug("A files list have been provided. No folder content will be fetched."),this.fileList=this.files,this.currentIndex=this.fileList.findIndex(m=>m.filename===e.filename);else if(a&&this.el===null){const m=this.mimeGroups[a]?this.mimeGroups[a]:[n],{request:I,cancel:z}=V(ge);this.cancelRequestFolder=z;const[O]=k(e.filename);this.currentIndex=0,this.fileList=[e];const E=(await I(O)).filter(o=>o.mime&&m.indexOf(o.mime)!==-1),D=E.map(o=>new F({source:_+u()+o.filename,id:o.fileid,displayname:o.displayname,mime:o.mime,mtime:new Date(o.lastmod),owner:this.currentFile.ownerId,root:u()})),P=te(D,{sortingMode:this.sortingConfig.key,sortingOrder:this.sortingConfig.asc?"asc":"desc"});this.fileList=P.map(o=>E.find(B=>B.filename===o.path)),this.currentIndex=this.fileList.findIndex(o=>o.filename===e.filename),this.updatePreviousNext()}else this.currentIndex=0,this.fileList=[e];this.changeSidebar()},openFileFromList(e){const i=e.mime;this.currentFile=new p(e,i,this.components[i]),this.changeSidebar(),this.updatePreviousNext()},async compareFile(e){this.comparisonFile=new p(e,e.mime,this.components[e.mime])},changeSidebar(){this.isSidebarShown&&this.showSidebar()},updatePreviousNext(){const e=this.fileList[this.currentIndex-1],i=this.fileList[this.currentIndex+1];if(e){const n=e.mime;this.components[n]&&(this.previousFile=new p(e,n,this.components[n]))}else this.previousFile={};if(i){const n=i.mime;this.components[n]&&(this.nextFile=new p(i,n,this.components[n]))}else this.nextFile={}},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){s.error("The following handler is already registered",{handler:e});return}if(!e.id||e.id.trim()===""||typeof e.id!="string"){s.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){s.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"){s.error("The following handler doesn't have a valid component",{handler:e});return}e.component.mixins=[...e?.component?.mixins??[],Ee],e.mimes&&e.mimes.forEach(i=>{if(this.components[i]){s.error("The following mime is already registered",{mime:i,handler:e});return}this.registerGroups({mime:i,group:e.group}),this.components[i]=e.component,w.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"){s.error("The following handler doesn't have a valid mimesAliases object",{handler:e});return}const n=e.mimesAliases[i];if(this.components[i]){s.error("The following mime is already registered",{mime:i,handler:e});return}if(!this.components[n]){s.error("The requested alias does not exists",{alias:n,mime:i,handler:e});return}this.registerGroups({mime:i,group:this.mimeGroups[n]}),this.components[i]=this.components[n],this.registeredHandlers[i]=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){e.key==="s"&&e.ctrlKey===!0&&(e.preventDefault(),this.canDownload&&this.onDownload())},keyboardEditFile(e){e.key==="e"&&e.ctrlKey===!0&&(e.preventDefault(),this.canEdit&&this.onEdit())},cleanup(){s.info("Cleaning up viewer"),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(){if(this.enableSidebar){const e=new F({source:_+u()+this.currentFile.filename,id:this.currentFile.fileid,displayname:this.currentFile.displayname,mime:this.currentFile.mime,mtime:new Date(this.currentFile.lastmod),owner:this.currentFile.ownerId,root:u()});b("viewer:sidebar:open",e),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:n})=>n===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.currentFile.source??this.currentFile.davPath,n=new F({source:i,id:e,mime:this.currentFile.mime,owner:this.currentFile.ownerId,root:i.includes("remote.php/dav")?u():void 0});await A.delete(i),b("files:node:deleted",n);const r=this.fileList.findIndex(l=>l.filename===this.currentFile.filename);this.hasPrevious||this.hasNext?(this.hasNext?this.next():this.previous(),this.fileList.splice(r,1)):this.close()}catch(e){console.error(e),g(e)}},onEdit(){this.toggleEditor(!0)},async onDownload(){if(!this.canDownload)return;const e=this.currentFile.mime,i=e?.split("/")[0],n=this.registeredHandlers[e]??this.registeredHandlers[i];if(n?.downloadCallback&&typeof n.downloadCallback=="function")try{s.debug("Calling handler downloadCallback before download"),await n.downloadCallback(this.currentFile)}catch(r){s.error("Failed to execute downloadCallback",{error:r}),g(t("viewer","Failed to save file before download"));return}this.performDownload()},performDownload(){s.debug("Performing download",{file:this.currentFile});const e=document.createElement("a");e.href=this.currentFile.source??this.currentFile.davPath,e.download=this.currentFile.basename,document.body.appendChild(e),e.click(),document.body.removeChild(e)},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 at=function(){var e=this,i=e._self._c;return e._self._setupProxy,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.uniqueKey(e.currentFile),ref:"content",tag:"component",staticClass:"viewer__file viewer__file--active",attrs:{active:!0,"can-swipe":!1,"can-zoom":!1,"file-list":[e.currentFile],"is-full-screen":!1,loaded:e.currentFile.loaded,"is-sidebar-shown":!1},on:{"update:loaded":function(n){return e.$set(e.currentFile,"loaded",n)},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,"light-backdrop":e.lightBackdrop,"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,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.sidebarOpenFilePath&&!e.isSidebarShown?i("NcActionButton",{attrs:{"close-after-click":""},on:{click:e.showSidebar},scopedSlots:e._u([{key:"icon",fn:function(){return[i("DockRight",{attrs:{size:20}})]},proxy:!0}],null,!1,151993963)},[e._v(" "+e._s(e.t("viewer","Open sidebar"))+" ")]):e._e(),e.canDownload?i("NcActionButton",{attrs:{"close-after-click":!0},on:{click:e.onDownload},scopedSlots:e._u([{key:"icon",fn:function(){return[i("Download",{attrs:{size:20}})]},proxy:!0}],null,!1,3312959228)},[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:20}})]},proxy:!0}],null,!1,2705356561)},[e._v(" "+e._s(e.t("viewer","Delete"))+" ")]):e._e()]},proxy:!0}])},[i("div",{staticClass:"viewer__content",class:e.contentClass,on:{click:function(n){return n.target!==n.currentTarget||n.ctrlKey||n.shiftKey||n.altKey||n.metaKey?null:e.close.apply(null,arguments)},contextmenu:e.preventContextMenu}},[e.comparisonFile&&!e.comparisonFile.failed&&e.showComparison?i("div",{staticClass:"viewer__file-wrapper"},[i(e.comparisonFile.modal,e._b({key:e.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(n){return e.$set(e.comparisonFile,"loaded",n)},error:e.comparisonFailed}},"component",e.comparisonFile,!1))],1):e._e(),e.hasPreviousFile?i("div",{key:e.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.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":!0,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(n){e.canSwipe=n},"update:can-swipe":function(n){e.canSwipe=n},"update:editing":[function(n){e.editing=n},e.toggleEditor],"update:loaded":function(n){return e.$set(e.currentFile,"loaded",n)},error:e.currentFailed}},"component",e.currentFile,!1))],1),e.hasNextFile?i("div",{key:e.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()},dt=[],ct=c(ot,at,dt,!1,null,"79481d80");const ht=ct.exports;w.mixin({methods:{t:oe}}),w.prototype.OC=window.OC,w.prototype.OCA=window.OCA;const M=document.createElement("div");M.id="viewer",document.body.appendChild(M);const C=document.createElement("div");C.innerHTML=' ',C.style.display="none",document.body.appendChild(C),new w({el:"#viewer",name:"ViewerRoot",render:e=>e(ht)});
//# sourceMappingURL=viewer-main.mjs.map
diff --git a/js/viewer-main.mjs.map b/js/viewer-main.mjs.map
index a85a11e39..8d38e9a06 100644
--- a/js/viewer-main.mjs.map
+++ b/js/viewer-main.mjs.map
@@ -1 +1 @@
-{"version":3,"mappings":";qTACA,MAAMA,GAAQ,CACZ,SAAU,CAKR,cAAe,CACb,OAAOC,EAAkB,KAC/B,CACA,CACA,ECVMD,GAAQ,CACZ,SAAU,CAKR,UAAW,CACT,OAAOE,EAAc,KAC3B,CACA,CACA,ECAO,SAASC,GAAYC,EAAoB,CAC/C,GAAIA,EAAS,aACL,SAKF,MAAAC,EAAkB,OAAOD,GAAU,iBAAoB,SAAW,KAAK,MAAMA,EAAS,iBAAmB,IAAI,EAAIA,GAAU,gBAE7H,OAAAC,GAAmBA,EAAgB,OAAS,EACrBA,EAAgB,KAAK,CAAC,CAAE,MAAAC,EAAO,IAAAC,CAAA,IAAUD,IAAU,eAAiBC,IAAQ,UAAU,GAEtF,QAAU,GAG9B,EACR,CChBA,MAAMC,EAAoB,SAASC,EAAS,CAC3C,MAAMC,EAAa,IAAI,gBAcvB,MAAO,CACN,QAPa,eAAeC,EAAKC,EAAS,CAC1C,OAAOH,EACNE,EACA,CAAE,GAAGC,EAAS,OAAQF,EAAW,MAAQ,CAC5C,CACA,EAGE,OAAQ,IAAMA,EAAW,MAAO,CAClC,CACA,ECfAG,GAAA,CACA,aAEA,OACA,MACA,YACA,UACA,CACA,CACA,0SCdeC,GAAA,MAAOC,GAAiC,CACjDA,EAAK,WAAW,GAAG,IACvBA,EAAO,IAAIA,CAAI,IAEhB,MAA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,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,2nBChBAA,GAAA,CACA,yBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,+pBChBAA,GAAA,CACA,sBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,8lBChBAA,GAAA,CACA,0BACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,kmBChBAA,GAAA,CACA,yBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,8uBChBAA,GAAA,CACA,qBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,imBCiLAqD,GAAA,IAAAC,EAAA,qDAAAC,KAAA,4CACAC,GAAA,IAAAF,EAAA,8FACAG,GAAA,IAAAH,EAAA,gGAEAtD,GAAA0D,GAAA,CACA,cAEA,YACA,OAAAC,GACA,UAAAC,GACA,SAAAC,GACA,MAAAC,GACA,WAAAC,GACA,eAAAC,GACA,eAAAP,GACA,aAAAD,GACA,QAAAH,GACA,OAAAY,EACA,EAEA,QAAAC,GAAAC,EAAA,EAEA,OACA,OAEA,kBACA,sCAGA,cACA,cACA,sBAGA,eACA,gBACA,eACA,oBACA,YACA,YACA,mBAGA,YACA,aACA,WAGA,yBACA,2BAGA,kBACA,kBACA,oBACA,YACA,gBACA,WACA,mBACA,KAAAC,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,gBACA,4BACA,EACA,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,EAIpC,MAAMC,EAAgB,SAAS,cAAc,KAAK,EAClDA,EAAc,UAAY,4pLAC1BA,EAAc,MAAM,QAAU,OAC9B,SAAS,KAAK,YAAYA,CAAa,EAGxB,IAAIP,EAAI,CACtB,GAAI,UAKJ,KAAM,aACN,OAAQd,GAAKA,EAAEsB,EAAe,CAC/B,CAAC","names":["index","isFullscreenState","isMobileState","canDownload","fileInfo","shareAttributes","scope","key","CancelableRequest","request","controller","url","options","_sfc_main","fetchNode","path","client","getClient","propfindPayload","getDefaultPropfind","result","getRootPath","resultToNode","File","mime","component","data","getDavPath","getFileList","getDavNameSpaces","getDavProperties","genFileInfo","getSortingConfig","viewConfigs","getViewConfigs","asc","isPublicShare","generateUrl","axios","response","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","defineComponent","Delete","DockRight","Download","Error","Fullscreen","FullscreenExit","Pencil","isFullscreen","isMobile","defaultRemoteURL","defaultRootPath","loadState","element","logger","viewerRoot","el","fileList","currentIndex","file","isEndOfList","list","handler","subscribe","unsubscribe","isOpen","toggleEditor","event","overrideHandlerId","fileRequest","cancelRequestFile","cancelableRequest","getFileInfo","fileName","extractFilePaths","title","error","showError","source","extractFilePathFromSource","node","emit","alias","h","defaultThemeIsLight","group","mimes","folderRequest","cancelRequestFolder","dirPath","filteredFiles","nodes","NcFile","sortedNodes","sortNodes","prev","next","Vue","sidebar","currentFileId","fileid","a","t","ViewerRoot","VideoControls","ViewerComponent"],"ignoreList":[0,1,10,12,13,14,15,16,17],"sources":["../node_modules/@nextcloud/vue/dist/Mixins/isFullscreen.mjs","../node_modules/@nextcloud/vue/dist/Mixins/isMobile.mjs","../src/utils/canDownload.ts","../src/utils/CancelableRequest.js","../src/components/Error.vue","../src/services/FetchFile.ts","../src/models/file.js","../src/services/FileList.ts","../src/services/FileSortingConfig.ts","../src/mixins/PreviewUrl.js","../node_modules/path-parse/index.js","../src/mixins/Mime.js","../node_modules/vue-material-design-icons/TrashCanOutline.vue","../node_modules/vue-material-design-icons/TrayArrowDown.vue","../node_modules/vue-material-design-icons/Fullscreen.vue","../node_modules/vue-material-design-icons/FullscreenExit.vue","../node_modules/vue-material-design-icons/PencilOutline.vue","../node_modules/vue-material-design-icons/DockRight.vue","../src/views/Viewer.vue","../src/main.js"],"sourcesContent":["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//# sourceMappingURL=isFullscreen.mjs.map\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//# sourceMappingURL=isMobile.mjs.map\n","/*!\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { FileInfo } from './fileUtils'\n\n/**\n * Check if download permissions are granted for a file\n * @param fileInfo The file info to check\n */\nexport function canDownload(fileInfo: FileInfo) {\n\tif (fileInfo.hideDownload) {\n\t\treturn false\n\t}\n\n\t// TODO: This should probably be part of `@nextcloud/sharing`\n\t// check share attributes\n\tconst shareAttributes = typeof fileInfo?.shareAttributes === 'string' ? JSON.parse(fileInfo.shareAttributes || '[]') : fileInfo?.shareAttributes\n\n\tif (shareAttributes && shareAttributes.length > 0) {\n\t\tconst downloadAttribute = shareAttributes.find(({ scope, key }) => scope === 'permissions' && key === 'download')\n\t\t// We only forbid download if the attribute is *explicitly* set to 'false'\n\t\treturn downloadAttribute?.value !== false\n\t}\n\t// otherwise return true (as the file needs read permission otherwise we would not have opened it)\n\treturn true\n}\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\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 * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { INode } from '@nextcloud/files'\nimport type { FileStat, ResponseDataDetailed } from 'webdav'\n\nimport { getClient, getDefaultPropfind, getRootPath, resultToNode } from '@nextcloud/files/dav'\n\nexport default async (path: string): Promise => {\n\tif (!path.startsWith('/')) {\n\t\tpath = `/${path}`\n\t}\n\tconst client = getClient()\n\tconst propfindPayload = getDefaultPropfind()\n\tconst result = await client.stat(`${getRootPath()}${path}`, {\n\t\tdetails: true,\n\t\tdata: propfindPayload,\n\t}) as ResponseDataDetailed\n\treturn resultToNode(result.data)\n}\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\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 * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { FileStat, ResponseDataDetailed } from 'webdav'\n\nimport { getDavNameSpaces, getDavProperties } from '@nextcloud/files/dav'\nimport { client } from './WebdavClient'\nimport { genFileInfo, type FileInfo } from '../utils/fileUtils'\n\n/**\n * Retrieve the files list\n * @param path\n * @param options\n */\nexport default async function(path: string, options = {}): Promise {\n\tconst response = await client.getDirectoryContents(path, 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 * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport axios from '@nextcloud/axios'\nimport { generateUrl } from '@nextcloud/router'\nimport { isPublicShare } from '@nextcloud/sharing/public'\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 (isPublicShare()) {\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","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\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 * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\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\tcanZoom: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\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} else {\n\t\t\t\tthis.height = this.naturalHeight\n\t\t\t\tthis.width = this.naturalWidth\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 \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\n\t\t\t\t\t \n\t\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 \n \n\n\n\n\n\n\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\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":";qTACA,MAAMA,GAAQ,CACZ,SAAU,CAKR,cAAe,CACb,OAAOC,EAAkB,KAC/B,CACA,CACA,ECVMD,GAAQ,CACZ,SAAU,CAKR,UAAW,CACT,OAAOE,EAAc,KAC3B,CACA,CACA,ECAO,SAASC,GAAYC,EAAoB,CAC/C,GAAIA,EAAS,aACL,SAKF,MAAAC,EAAkB,OAAOD,GAAU,iBAAoB,SAAW,KAAK,MAAMA,EAAS,iBAAmB,IAAI,EAAIA,GAAU,gBAE7H,OAAAC,GAAmBA,EAAgB,OAAS,EACrBA,EAAgB,KAAK,CAAC,CAAE,MAAAC,EAAO,IAAAC,CAAA,IAAUD,IAAU,eAAiBC,IAAQ,UAAU,GAEtF,QAAU,GAG9B,EACR,CChBA,MAAMC,EAAoB,SAASC,EAAS,CAC3C,MAAMC,EAAa,IAAI,gBAcvB,MAAO,CACN,QAPa,eAAeC,EAAKC,EAAS,CAC1C,OAAOH,EACNE,EACA,CAAE,GAAGC,EAAS,OAAQF,EAAW,MAAQ,CAC5C,CACA,EAGE,OAAQ,IAAMA,EAAW,MAAO,CAClC,CACA,ECfAG,GAAA,CACA,aAEA,OACA,MACA,YACA,UACA,CACA,CACA,0SCdeC,GAAA,MAAOC,GAAiC,CACjDA,EAAK,WAAW,GAAG,IACvBA,EAAO,IAAIA,CAAI,IAEhB,MAAMC,EAASC,EAAU,EACnBC,EAAkBC,EAAmB,EACrCC,EAAS,MAAMJ,EAAO,KAAK,GAAGK,EAAa,IAAGN,CAAI,GAAI,CAC3D,QAAS,GACT,KAAMG,CAAA,CACN,EACM,OAAAI,EAAaF,E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,CACA,+pBChBAA,GAAA,CACA,sBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,8lBChBAA,GAAA,CACA,0BACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,kmBChBAA,GAAA,CACA,yBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,8uBChBAA,GAAA,CACA,qBACA,gBACA,OACA,OACA,WACA,EACA,WACA,YACA,sBACA,EACA,MACA,YACA,UACA,CACA,CACA,imBCiLAqD,GAAA,IAAAC,EAAA,qDAAAC,KAAA,4CACAC,GAAA,IAAAF,EAAA,8FACAG,GAAA,IAAAH,EAAA,gGAEAtD,GAAA0D,GAAA,CACA,cAEA,YACA,OAAAC,GACA,UAAAC,GACA,SAAAC,GACA,MAAAC,GACA,WAAAC,GACA,eAAAC,GACA,eAAAP,GACA,aAAAD,GACA,QAAAH,GACA,OAAAY,EACA,EAEA,QAAAC,GAAAC,EAAA,EAEA,OACA,OAEA,kBACA,sCAGA,cACA,cACA,sBAGA,eACA,gBACA,eACA,oBACA,YACA,YACA,mBAGA,YACA,aACA,WAGA,yBACA,2BAGA,kBACA,kBACA,oBACA,YACA,gBACA,WACA,mBACA,KAAAC,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,gBACA,4BACA,EACA,cACA,iDACA,EAEA,kBAEA,8CACA,EACA,cAEA,0CACA,EAEA,UACA,8EACA,EAEA,sBACA,IAEA,OADA,iCAAAC,EAAA,MACA,8CACA,OACA,QACA,CACA,EAOA,YACA,mDACA,EAOA,cAEA,2BACA,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C1BA,EAAc,MAAM,QAAU,OAC9B,SAAS,KAAK,YAAYA,CAAa,EAGxB,IAAIN,EAAI,CACtB,GAAI,UAKJ,KAAM,aACN,OAAQd,GAAKA,EAAEqB,EAAe,CAC/B,CAAC","names":["index","isFullscreenState","isMobileState","canDownload","fileInfo","shareAttributes","scope","key","CancelableRequest","request","controller","url","options","_sfc_main","fetchNode","path","client","getClient","propfindPayload","getDefaultPropfind","result","getRootPath","resultToNode","File","mime","component","data","getDavPath","getFileList","getDavNameSpaces","getDavProperties","genFileInfo","getSortingConfig","viewConfigs","getViewConfigs","asc","isPublicShare","generateUrl","axios","response","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","defineComponent","Delete","DockRight","Download","Error","Fullscreen","FullscreenExit","Pencil","isFullscreen","isMobile","defaultRemoteURL","defaultRootPath","loadState","element","logger","viewerRoot","el","fileList","currentIndex","file","isEndOfList","list","handler","subscribe","unsubscribe","isOpen","toggleEditor","event","sidebar","overrideHandlerId","fileRequest","cancelRequestFile","cancelableRequest","getFileInfo","fileName","extractFilePaths","title","error","showError","source","extractFilePathFromSource","node","emit","alias","h","defaultThemeIsLight","group","mimes","folderRequest","cancelRequestFolder","dirPath","filteredFiles","nodes","NcFile","sortedNodes","sortNodes","prev","next","Vue","currentFileId","fileid","a","t","ViewerRoot","VideoControls","ViewerComponent"],"ignoreList":[0,1,10,12,13,14,15,16,17],"sources":["../node_modules/@nextcloud/vue/dist/Mixins/isFullscreen.mjs","../node_modules/@nextcloud/vue/dist/Mixins/isMobile.mjs","../src/utils/canDownload.ts","../src/utils/CancelableRequest.js","../src/components/Error.vue","../src/services/FetchFile.ts","../src/models/file.js","../src/services/FileList.ts","../src/services/FileSortingConfig.ts","../src/mixins/PreviewUrl.js","../node_modules/path-parse/index.js","../src/mixins/Mime.js","../node_modules/vue-material-design-icons/TrashCanOutline.vue","../node_modules/vue-material-design-icons/TrayArrowDown.vue","../node_modules/vue-material-design-icons/Fullscreen.vue","../node_modules/vue-material-design-icons/FullscreenExit.vue","../node_modules/vue-material-design-icons/PencilOutline.vue","../node_modules/vue-material-design-icons/DockRight.vue","../src/views/Viewer.vue","../src/main.js"],"sourcesContent":["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//# sourceMappingURL=isFullscreen.mjs.map\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//# sourceMappingURL=isMobile.mjs.map\n","/*!\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { FileInfo } from './fileUtils'\n\n/**\n * Check if download permissions are granted for a file\n * @param fileInfo The file info to check\n */\nexport function canDownload(fileInfo: FileInfo) {\n\tif (fileInfo.hideDownload) {\n\t\treturn false\n\t}\n\n\t// TODO: This should probably be part of `@nextcloud/sharing`\n\t// check share attributes\n\tconst shareAttributes = typeof fileInfo?.shareAttributes === 'string' ? JSON.parse(fileInfo.shareAttributes || '[]') : fileInfo?.shareAttributes\n\n\tif (shareAttributes && shareAttributes.length > 0) {\n\t\tconst downloadAttribute = shareAttributes.find(({ scope, key }) => scope === 'permissions' && key === 'download')\n\t\t// We only forbid download if the attribute is *explicitly* set to 'false'\n\t\treturn downloadAttribute?.value !== false\n\t}\n\t// otherwise return true (as the file needs read permission otherwise we would not have opened it)\n\treturn true\n}\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\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 * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { INode } from '@nextcloud/files'\nimport type { FileStat, ResponseDataDetailed } from 'webdav'\n\nimport { getClient, getDefaultPropfind, getRootPath, resultToNode } from '@nextcloud/files/dav'\n\nexport default async (path: string): Promise => {\n\tif (!path.startsWith('/')) {\n\t\tpath = `/${path}`\n\t}\n\tconst client = getClient()\n\tconst propfindPayload = getDefaultPropfind()\n\tconst result = await client.stat(`${getRootPath()}${path}`, {\n\t\tdetails: true,\n\t\tdata: propfindPayload,\n\t}) as ResponseDataDetailed\n\treturn resultToNode(result.data)\n}\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\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 * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { FileStat, ResponseDataDetailed } from 'webdav'\n\nimport { getDavNameSpaces, getDavProperties } from '@nextcloud/files/dav'\nimport { client } from './WebdavClient'\nimport { genFileInfo, type FileInfo } from '../utils/fileUtils'\n\n/**\n * Retrieve the files list\n * @param path\n * @param options\n */\nexport default async function(path: string, options = {}): Promise {\n\tconst response = await client.getDirectoryContents(path, 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 * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport axios from '@nextcloud/axios'\nimport { generateUrl } from '@nextcloud/router'\nimport { isPublicShare } from '@nextcloud/sharing/public'\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 (isPublicShare()) {\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","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\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 * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\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\tcanZoom: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\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} else {\n\t\t\t\tthis.height = this.naturalHeight\n\t\t\t\tthis.width = this.naturalWidth\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 \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\n\t\t\t\t\t \n\t\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 \n \n\n\n\n\n\n\n","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\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
diff --git a/src/views/Viewer.vue b/src/views/Viewer.vue
index 1ca8d7038..7c2245422 100644
--- a/src/views/Viewer.vue
+++ b/src/views/Viewer.vue
@@ -600,6 +600,16 @@ export default defineComponent({
// initial loading start
this.initiated = true
+ const sidebar = document.querySelector('aside.app-sidebar')
+ if (sidebar && sidebar.style.display !== 'none') {
+ this.isSidebarShown = true
+ this.sidebarPosition = sidebar.getBoundingClientRect().left
+ this.trapElements = [sidebar]
+ } else {
+ this.isSidebarShown = false
+ this.trapElements = []
+ }
+
if (OCA?.Files?.Sidebar?.setFullScreenMode) {
OCA.Files.Sidebar.setFullScreenMode(true)
}
@@ -1417,6 +1427,16 @@ body:has(#viewer) {
width: calc(var(--app-sidebar-width) + var(--body-container-margin));
}
+ .app-navigation ~ #app-content-vue:has(~ #app-sidebar-vue:not([style*="display: none"])) {
+ flex-basis: calc(100% - 300px - clamp(300px, 27vw, 500px));
+ }
+
+ #app-content-vue:first-child:has(~ #app-sidebar-vue:not([style*="display: none"])),
+ .app-navigation--close ~ #app-content-vue:has(~ #app-sidebar-vue:not([style*="display: none"])),
+ .app-navigation--closed ~ #app-content-vue:has(~ #app-sidebar-vue:not([style*="display: none"])) {
+ flex-basis: calc(100% - clamp(300px, 27vw, 500px));
+ }
+
#header {
visibility: hidden;
}