import{d as ma,a as Ra,f as si,x as ui,r as ci,G as fi,c as li,h as ne,u as vi}from"./index-e450010e.js";function hi(e,r,t,n){function a(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function u(f){try{s(n.next(f))}catch(l){o(l)}}function c(f){try{s(n.throw(f))}catch(l){o(l)}}function s(f){f.done?i(f.value):a(f.value).then(u,c)}s((n=n.apply(e,r||[])).next())})}function di(e,r){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=u(0),o.throw=u(1),o.return=u(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(s){return function(f){return c([s,f])}}function c(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(t=0)),t;)try{if(n=1,a&&(i=s[0]&2?a.return:s[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,s[1])).done)return i;switch(a=0,i&&(s=[s[0]&2,i.value]),s[0]){case 0:case 1:i=s;break;case 4:return t.label++,{value:s[1],done:!1};case 5:t.label++,a=s[1],s=[0];continue;case 7:s=t.ops.pop(),t.trys.pop();continue;default:if(i=t.trys,!(i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]-1}return ce=r,ce}var fe,wt;function mi(){if(wt)return fe;wt=1;var e=X();function r(t,n){var a=this.__data__,i=e(a,t);return i<0?(++this.size,a.push([t,n])):a[i][1]=n,this}return fe=r,fe}var le,Tt;function Z(){if(Tt)return le;Tt=1;var e=yi(),r=gi(),t=bi(),n=qi(),a=mi();function i(o){var u=-1,c=o==null?0:o.length;for(this.clear();++u-1&&n%1==0&&n-1&&t%1==0&&t<=e}return or=r,or}var sr,Cn;function eo(){if(Cn)return sr;Cn=1;var e=Q(),r=Oa(),t=N(),n="[object Arguments]",a="[object Array]",i="[object Boolean]",o="[object Date]",u="[object Error]",c="[object Function]",s="[object Map]",f="[object Number]",l="[object Object]",p="[object RegExp]",y="[object Set]",b="[object String]",q="[object WeakMap]",m="[object ArrayBuffer]",R="[object DataView]",d="[object Float32Array]",C="[object Float64Array]",w="[object Int8Array]",T="[object Int16Array]",I="[object Int32Array]",F="[object Uint8Array]",L="[object Uint8ClampedArray]",A="[object Uint16Array]",G="[object Uint32Array]",v={};v[d]=v[C]=v[w]=v[T]=v[I]=v[F]=v[L]=v[A]=v[G]=!0,v[n]=v[a]=v[m]=v[i]=v[R]=v[o]=v[u]=v[c]=v[s]=v[f]=v[l]=v[p]=v[y]=v[b]=v[q]=!1;function j(U){return t(U)&&r(U.length)&&!!v[e(U)]}return sr=j,sr}var ur,wn;function at(){if(wn)return ur;wn=1;function e(r){return function(t){return r(t)}}return ur=e,ur}var B={exports:{}};B.exports;var Tn;function it(){return Tn||(Tn=1,function(e,r){var t=Sa(),n=r&&!r.nodeType&&r,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,o=i&&t.process,u=function(){try{var c=a&&a.require&&a.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=u}(B,B.exports)),B.exports}var cr,In;function ro(){if(In)return cr;In=1;var e=eo(),r=at(),t=it(),n=t&&t.isTypedArray,a=n?r(n):e;return cr=a,cr}var fr,jn;function Ea(){if(jn)return fr;jn=1;var e=Ji(),r=Xi(),t=nt(),n=ja(),a=Qi(),i=ro(),o=Object.prototype,u=o.hasOwnProperty;function c(s,f){var l=t(s),p=!l&&r(s),y=!l&&!p&&n(s),b=!l&&!p&&!y&&i(s),q=l||p||y||b,m=q?e(s.length,String):[],R=m.length;for(var d in s)(f||u.call(s,d))&&!(q&&(d=="length"||y&&(d=="offset"||d=="parent")||b&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||a(d,R)))&&m.push(d);return m}return fr=c,fr}var lr,On;function ot(){if(On)return lr;On=1;var e=Object.prototype;function r(t){var n=t&&t.constructor,a=typeof n=="function"&&n.prototype||e;return t===a}return lr=r,lr}var vr,En;function Da(){if(En)return vr;En=1;function e(r,t){return function(n){return r(t(n))}}return vr=e,vr}var hr,Dn;function to(){if(Dn)return hr;Dn=1;var e=Da(),r=e(Object.keys,Object);return hr=r,hr}var dr,Pn;function no(){if(Pn)return dr;Pn=1;var e=ot(),r=to(),t=Object.prototype,n=t.hasOwnProperty;function a(i){if(!e(i))return r(i);var o=[];for(var u in Object(i))n.call(i,u)&&u!="constructor"&&o.push(u);return o}return dr=a,dr}var _r,xn;function Pa(){if(xn)return _r;xn=1;var e=Ca(),r=Oa();function t(n){return n!=null&&r(n.length)&&!e(n)}return _r=t,_r}var pr,Mn;function st(){if(Mn)return pr;Mn=1;var e=Ea(),r=no(),t=Pa();function n(a){return t(a)?e(a):r(a)}return pr=n,pr}var yr,kn;function ao(){if(kn)return yr;kn=1;var e=te(),r=st();function t(n,a){return n&&e(a,r(a),n)}return yr=t,yr}var gr,Fn;function io(){if(Fn)return gr;Fn=1;function e(r){var t=[];if(r!=null)for(var n in Object(r))t.push(n);return t}return gr=e,gr}var br,Ln;function oo(){if(Ln)return br;Ln=1;var e=H(),r=ot(),t=io(),n=Object.prototype,a=n.hasOwnProperty;function i(o){if(!e(o))return t(o);var u=r(o),c=[];for(var s in o)s=="constructor"&&(u||!a.call(o,s))||c.push(s);return c}return br=i,br}var qr,Gn;function ut(){if(Gn)return qr;Gn=1;var e=Ea(),r=oo(),t=Pa();function n(a){return t(a)?e(a,!0):r(a)}return qr=n,qr}var mr,Un;function so(){if(Un)return mr;Un=1;var e=te(),r=ut();function t(n,a){return n&&e(a,r(a),n)}return mr=t,mr}var V={exports:{}};V.exports;var Kn;function uo(){return Kn||(Kn=1,function(e,r){var t=S(),n=r&&!r.nodeType&&r,a=n&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===n,o=i?t.Buffer:void 0,u=o?o.allocUnsafe:void 0;function c(s,f){if(f)return s.slice();var l=s.length,p=u?u(l):new s.constructor(l);return s.copy(p),p}e.exports=c}(V,V.exports)),V.exports}var Rr,Bn;function co(){if(Bn)return Rr;Bn=1;function e(r,t){var n=-1,a=r.length;for(t||(t=Array(a));++n"u"?console.error(r):this.onLoadComponentError(e,r)},onAppReady:function(){var e=this.id||"";this.events_onAppReady(window.DocEditor.instances[e])},onChangeProps:function(){var e,r=this.id||"";!((e=window==null?void 0:window.DocEditor)===null||e===void 0)&&e.instances[r]&&(window.DocEditor.instances[r].destroyEditor(),window.DocEditor.instances[r]=void 0,console.log("Important props have been changed. Load new Editor."),this.onLoad())}}});const Fo=["id"];function Lo(e,r,t,n,a,i){return Ra(),si("div",{id:e.id},null,8,Fo)}vt.render=Lo;vt.__file="src/components/DocumentEditor.vue";const Uo=ma({__name:"onlyoffice",props:{fileurl:{}},setup(e){const r=vi(),t=ui(),n=document.location.origin,a="/hxpan/api",i="https://gyhlw.hxgk.group/onlyoffice",o=ci({document:{title:"Example Document Title.docx",url:"",key:""},documentType:"word",editorConfig:{lang:"zh-CN",mode:"view",callbackUrl:`${n}${a}/matter/save`,user:{id:t.userInfoCont.number,name:t.userInfoCont.nickname}}});function u(c,s){switch(c){case-1:alert(s);break;case-2:alert(s);break;case-3:alert(s);break}}return fi(()=>{var s,f,l;const c=r.query;if(c.fileurl){const p=((s=c.info)==null?void 0:s.toString())??"error",y=decodeURIComponent(atob(p)),b=decodeURIComponent(c.fileurl),q=((f=c.name)==null?void 0:f.toString())??"",m=((l=c.dtype)==null?void 0:l.toString())??"word";if(y.includes(q)){o.value.document.url=b,o.value.document.title=q;const R=b.match(/(\w+-\w+-\w+)/)[0];if(R&&(o.value.document.key=R),o.value.documentType=m,o.value.editorConfig.callbackUrl+=`?info=${y}`,!c.verify)return;const d=atob(c.verify);d.endsWith("true")&&R.includes(d.replace("true",""))&&(o.value.editorConfig.mode="edit")}}}),(c,s)=>(Ra(),li(ne(vt),{id:"docEditor",style:{height:"inherit"},documentServerUrl:ne(i),config:ne(o),onLoadComponentError:u},null,8,["documentServerUrl","config"]))}});export{Uo as default};