File: //var/packages/UniversalViewer/target/dist/uv.application.js
(function(){"use strict";var r=document.createElement("style");r.textContent=`.syno-uv-window{box-shadow:none}.syno-uv-window .x-window-header .x-window-header-text{color:#fff}.syno-uv-window .x-window-header:not(:focus-visible){opacity:1}.syno-uv-window .x-window-tl{background-color:#292929;border-bottom-color:#ffffff1f}.syno-uv-window.x-panel-ghost ul{background-color:#282a2c}
/*$vite$:1*/`,document.head.appendChild(r),Ext.ns("SYNO.SDS.UniversalViewer"),Ext.define("SYNO.SDS.UniversalViewer.Application",{extend:"SYNO.SDS.AppInstance",appWindowName:"SYNO.SDS.UniversalViewer.Window"}),Ext.define("SYNO.SDS.UniversalViewer.Window",{extend:"SYNO.SDS.AppWindow",pinable:!1,constructor(e){SYNO.SDS.AppWindow.prototype.constructor.call(this,this.fillConfig(e)),this.uvPromise=null,this.uv=null},fillConfig(e){return{cls:"syno-uv-window",width:800,height:520,minWidth:680,minHeight:520,showHelp:!1,closable:!0,itemId:"universal-viewer-window",...e}},getPreviewTitle(){var e;return(e=this.uv)==null?void 0:e.getActiveDisplayName()},genPreviewNode(){const e=document.createElement("div");e.style.width="128px",e.style.height="128px",e.style.position="absolute";const n=e.appendChild(document.createElement("img"));return n.src="webman/3rdparty/UniversalViewer/pkg_icons/Universal_Viewer_256.png",n.style.width="100%",e},focus(){var e;(e=this.uvPromise)==null||e.then(n=>{n==null||n.focus()})},load(e){return this.uvPromise=this.uvPromise||SYNO.SDS.UniversalViewer.createUniversalViewer({lang:_S("lang"),preventClose:{default:!0,hotkey:!1},...e,rootEl:this.body.dom,forwardEvents:{pointerdown:()=>this.toFront()}}).catch(n=>(console.log(n),null)).then(n=>n?(this.uv=n,n.on("hide",()=>this.close()),n):null)},open(e){const n=e.uv||{},{config:i,selector:o}=n;i&&o&&this.load(i).then(t=>{t&&t.show(o)}),SYNO.SDS.AppWindow.prototype.open.call(this)},getUVPromise(){return this.uvPromise??Promise.resolve(null)}}),SYNO.SDS.UniversalViewer.launchAppInstance=async function(e,n,i){return new Promise(o=>{SYNO.SDS.AppLaunch("SYNO.SDS.UniversalViewer.Application",{...i,uv:{config:e,selector:n}},!0,t=>{const s=t.window;s.getUVPromise().then(l=>{o({instance:t,win:s,uv:l})})})})}})();