import{a as f,q as l}from"./useSetting-bf1f702c.js";import{e as _,E as u}from"./request-14d7fed5.js";import{D as g,e as h,o as v,c as w,p as y,q as E,a as S}from"./index-25eb6331.js";import{c as O}from"./path-8ad564a3.js";import{_ as b}from"./_plugin-vue_export-helper-c27b6911.js";import"./file-5139c625.js";/* empty css                */import"./dialog-66decf59.js";import"./index-db57f3ab.js";import"./vnode-761469ca.js";import"./index-3bef6acb.js";import"./scroll-044a6ede.js";import"./button-c2afb424.js";import"./overlay-25bb32bf.js";import"./refs-e3c707bd.js";/* empty css                     *//* empty css               *//* empty css                  */import"./dropdown-item-13559a59.js";import"./index-51e1cffc.js";import"./index-b7ba0c9a.js";import"./dropdown-8894c5a8.js";import"./index-0746525e.js";import"./_initCloneObject-55db8b76.js";import"./directive-77ef4fb1.js";import"./index-98eb1092.js";import"./validator-551b2058.js";import"./index-02f3ff91.js";import"./base-00eb0fe9.js";const P=t=>_({url:"/onlyOffice/config/token",method:"post",data:t});const x=t=>(y("data-v-745b7c5e"),t=t(),E(),t),I={class:"zfile-office-viewer"},C=x(()=>S("div",{id:"office-body"},null,-1)),N=[C],j={__name:"OfficeViewer",props:{fileName:String},setup(t){const r=t;let{getPathPwd:s}=l(),n=f(),{storageKey:p,currentPath:c}=g();h(()=>{m("".concat(n.globalConfig.onlyOfficeUrl,"/web-apps/apps/api/documents/api.js"),()=>{let i=O(c.value,r.fileName),o={storageKey:p.value,path:i,password:s()};P(o).then(e=>{let a=e.data;new DocsAPI.DocEditor("office-body",a)})})});function m(i,o){let e=document.createElement("script"),a=document.getElementsByTagName("head")[0];e.type="text/javascript",e.charset="UTF-8",e.src=i,e.addEventListener?(e.addEventListener("load",function(){o()},!1),e.addEventListener("error",function(){u.warning("调用在线文档服务失败，请检查在线文档服务是否正常")},!1)):e.attachEvent&&e.attachEvent("onreadystatechange",function(){var d=window.event.srcElement;d.readyState==="loaded"&&o()}),a.appendChild(e)}return(i,o)=>(v(),w("div",I,N))}},se=b(j,[["__scopeId","data-v-745b7c5e"]]);export{se as default};
