From 84d43025753358b09ef3f23631158b88dad6a635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <1005065+DeepDiver1975@users.noreply.github.com> Date: Thu, 9 Jul 2026 10:53:36 +0200 Subject: [PATCH] fix(deps): resolve all 78 open Dependabot alerts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bump vite directly and pin transitive dependencies (mostly under @ownclouders/web-pkg) via pnpm overrides to their first patched versions. Verified with a clean `pnpm install` + `pnpm vite build` (vite 5 -> 6 major bump builds cleanly, 56 modules, same as baseline). Runtime: - @casl/ability 6.5.0 -> 6.8.1 (#59 critical, prototype pollution, needs >= 6.7.5) - axios 1.13.5/1.17.0 -> 1.18.1 (#100,102,106-113,121-125,132-134,136-139, needs >= 1.16.0) - follow-redirects 1.15.11 -> 1.16.0 (#99, needs >= 1.16.0) - form-data 4.0.5 -> 4.0.6 (#146 CRLF injection, needs >= 4.0.6) - lodash-es 4.17.21 -> 4.18.1 (#52,84,85, needs >= 4.18.0) - postcss 8.5.6 -> 8.5.16 (#105 XSS, needs >= 8.5.10) - qs 6.14.1 -> 6.15.3 (#60,126 DoS, needs >= 6.15.2) - uuid 9.0.0 -> 11.1.1 (#127 bounds check, needs >= 11.1.1; major bump) - yaml 1.10.2 -> 1.10.3 (#79 stack overflow, needs >= 1.10.3) Development: - @babel/core 7.22.1 -> 7.29.7 (#147, needs >= 7.29.6) - @hono/node-server 1.19.9 -> 1.19.14 (#73,88, needs >= 1.19.13) - @modelcontextprotocol/sdk 1.25.3 -> 1.29.0 (#57, needs >= 1.26.0) - esbuild 0.21.5 -> 0.25.12 (#28, needs >= 0.25.0) - fast-uri 3.1.0 -> 3.1.3 (#116,118, needs >= 3.1.2) - flatted 3.3.3 -> 3.4.2 (#78 prototype pollution, needs >= 3.4.2) - hono 4.11.7 -> 4.12.28 (#63,70-72,76,89-93,101,115,117,119,120,128-131,141-145, needs >= 4.12.25) - js-yaml 4.1.1 -> 4.3.0 (#153 DoS, needs >= 4.2.0) - lodash 4.17.21 -> 4.18.1 (#53,86,87, needs >= 4.18.0) - minimatch 3.1.2 -> 3.1.5 (#68 ReDoS, needs >= 3.1.3) - picomatch 2.3.1 -> 2.3.2 (#81, needs >= 2.3.2) - rollup 4.52.5 -> 4.62.2 (#69 path traversal, needs >= 4.59.0) - vite 5.4.21 -> 6.4.3 (#94,96,148,149,151,152, needs >= 6.4.3; major bump) No-fix / accept-risk: none - every open alert has an upstream patch and is covered above. All alerts remain open until this PR merges to master (Dependabot rescans the default branch). Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com> --- js/web/richdocuments.js | 11 +- package.json | 25 +- pnpm-lock.yaml | 3687 ++++++++++++++++++++------------------- 3 files changed, 1930 insertions(+), 1793 deletions(-) diff --git a/js/web/richdocuments.js b/js/web/richdocuments.js index 700f02c80..79f8261db 100644 --- a/js/web/richdocuments.js +++ b/js/web/richdocuments.js @@ -1,2 +1,9 @@ -define(["@ownclouders/web-pkg","vue"],function(q,b){"use strict";function sr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var J={},or={get exports(){return J},set exports(e){J=e}},L={},ur={get exports(){return L},set exports(e){L=e}},ye=function(r,t){return function(){for(var n=new Array(arguments.length),a=0;a"u"}function fr(e){return e!==null&&!$(e)&&e.constructor!==null&&!$(e.constructor)&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}var we=O("ArrayBuffer");function cr(e){var r;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?r=ArrayBuffer.isView(e):r=e&&e.buffer&&we(e.buffer),r}function dr(e){return typeof e=="string"}function hr(e){return typeof e=="number"}function Re(e){return e!==null&&typeof e=="object"}function F(e){if(z(e)!=="object")return!1;var r=Object.getPrototypeOf(e);return r===null||r===Object.prototype}var pr=O("Date"),mr=O("File"),vr=O("Blob"),Er=O("FileList");function K(e){return V.call(e)==="[object Function]"}function yr(e){return Re(e)&&K(e.pipe)}function wr(e){var r="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||V.call(e)===r||K(e.toString)&&e.toString()===r)}var Rr=O("URLSearchParams");function br(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Ar(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function Q(e,r){if(!(e===null||typeof e>"u"))if(typeof e!="object"&&(e=[e]),X(e))for(var t=0,i=e.length;t0;)a=i[n],s[a]||(r[a]=e[a],s[a]=!0);e=Object.getPrototypeOf(e)}while(e&&(!t||t(e,r))&&e!==Object.prototype);return r}function gr(e,r,t){e=String(e),(t===void 0||t>e.length)&&(t=e.length),t-=r.length;var i=e.indexOf(r,t);return i!==-1&&i===t}function Nr(e){if(!e)return null;var r=e.length;if($(r))return null;for(var t=new Array(r);r-- >0;)t[r]=e[r];return t}var _r=function(e){return function(r){return e&&r instanceof e}}(typeof Uint8Array<"u"&&Object.getPrototypeOf(Uint8Array)),m={isArray:X,isArrayBuffer:we,isBuffer:fr,isFormData:wr,isArrayBufferView:cr,isString:dr,isNumber:hr,isObject:Re,isPlainObject:F,isUndefined:$,isDate:pr,isFile:mr,isBlob:vr,isFunction:K,isStream:yr,isURLSearchParams:Rr,isStandardBrowserEnv:Ar,forEach:Q,merge:G,extend:Or,trim:br,stripBOM:Sr,inherits:xr,toFlatObject:Cr,kindOf:z,kindOfTest:O,endsWith:gr,toArray:Nr,isTypedArray:_r,isFileList:Er},x=m;function be(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var Ae=function(r,t,i){if(!t)return r;var n;if(i)n=i(t);else if(x.isURLSearchParams(t))n=t.toString();else{var a=[];x.forEach(t,function(l,d){l===null||typeof l>"u"||(x.isArray(l)?d=d+"[]":l=[l],x.forEach(l,function(h){x.isDate(h)?h=h.toISOString():x.isObject(h)&&(h=JSON.stringify(h)),a.push(be(d)+"="+be(h))}))}),n=a.join("&")}if(n){var s=r.indexOf("#");s!==-1&&(r=r.slice(0,s)),r+=(r.indexOf("?")===-1?"?":"&")+n}return r},Tr=m;function M(){this.handlers=[]}M.prototype.use=function(r,t,i){return this.handlers.push({fulfilled:r,rejected:t,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1},M.prototype.eject=function(r){this.handlers[r]&&(this.handlers[r]=null)},M.prototype.forEach=function(r){Tr.forEach(this.handlers,function(i){i!==null&&r(i)})};var Pr=M,Dr=m,Ur=function(r,t){Dr.forEach(r,function(n,a){a!==t&&a.toUpperCase()===t.toUpperCase()&&(r[t]=n,delete r[a])})},Oe=m;function C(e,r,t,i,n){Error.call(this),this.message=e,this.name="AxiosError",r&&(this.code=r),t&&(this.config=t),i&&(this.request=i),n&&(this.response=n)}Oe.inherits(C,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var Se=C.prototype,xe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(e){xe[e]={value:e}}),Object.defineProperties(C,xe),Object.defineProperty(Se,"isAxiosError",{value:!0}),C.from=function(e,r,t,i,n,a){var s=Object.create(Se);return Oe.toFlatObject(e,s,function(l){return l!==Error.prototype}),C.call(s,e.message,r,t,i,n),s.name=e.name,a&&Object.assign(s,a),s};var g=C,Ce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},w=m;function Br(e,r){r=r||new FormData;var t=[];function i(a){return a===null?"":w.isDate(a)?a.toISOString():w.isArrayBuffer(a)||w.isTypedArray(a)?typeof Blob=="function"?new Blob([a]):Buffer.from(a):a}function n(a,s){if(w.isPlainObject(a)||w.isArray(a)){if(t.indexOf(a)!==-1)throw Error("Circular reference detected in "+s);t.push(a),w.forEach(a,function(l,d){if(!w.isUndefined(l)){var c=s?s+"."+d:d,h;if(l&&!s&&typeof l=="object"){if(w.endsWith(d,"{}"))l=JSON.stringify(l);else if(w.endsWith(d,"[]")&&(h=w.toArray(l))){h.forEach(function(u){!w.isUndefined(u)&&r.append(c,i(u))});return}}n(l,c)}}),t.pop()}else r.append(s,i(a))}return n(e),r}var ge=Br,Y,Ne;function Ir(){if(Ne)return Y;Ne=1;var e=g;return Y=function(t,i,n){var a=n.config.validateStatus;!n.status||!a||a(n.status)?t(n):i(new e("Request failed with status code "+n.status,[e.ERR_BAD_REQUEST,e.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))},Y}var Z,_e;function qr(){if(_e)return Z;_e=1;var e=m;return Z=e.isStandardBrowserEnv()?function(){return{write:function(i,n,a,s,o,l){var d=[];d.push(i+"="+encodeURIComponent(n)),e.isNumber(a)&&d.push("expires="+new Date(a).toGMTString()),e.isString(s)&&d.push("path="+s),e.isString(o)&&d.push("domain="+o),l===!0&&d.push("secure"),document.cookie=d.join("; ")},read:function(i){var n=document.cookie.match(new RegExp("(^|;\\s*)("+i+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(i){this.write(i,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),Z}var Lr=function(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)},$r=function(r,t){return t?r.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):r},Fr=Lr,Mr=$r,Te=function(r,t){return r&&!Fr(t)?Mr(r,t):t},ee,Pe;function jr(){if(Pe)return ee;Pe=1;var e=m,r=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return ee=function(i){var n={},a,s,o;return i&&e.forEach(i.split(` -`),function(d){if(o=d.indexOf(":"),a=e.trim(d.substr(0,o)).toLowerCase(),s=e.trim(d.substr(o+1)),a){if(n[a]&&r.indexOf(a)>=0)return;a==="set-cookie"?n[a]=(n[a]?n[a]:[]).concat([s]):n[a]=n[a]?n[a]+", "+s:s}}),n},ee}var re,De;function kr(){if(De)return re;De=1;var e=m;return re=e.isStandardBrowserEnv()?function(){var t=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a"),n;function a(s){var o=s;return t&&(i.setAttribute("href",o),o=i.href),i.setAttribute("href",o),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:i.pathname.charAt(0)==="/"?i.pathname:"/"+i.pathname}}return n=a(window.location.href),function(o){var l=e.isString(o)?a(o):o;return l.protocol===n.protocol&&l.host===n.host}}():function(){return function(){return!0}}(),re}var te,Ue;function j(){if(Ue)return te;Ue=1;var e=g,r=m;function t(i){e.call(this,i??"canceled",e.ERR_CANCELED),this.name="CanceledError"}return r.inherits(t,e,{__CANCEL__:!0}),te=t,te}var ne,Be;function Hr(){return Be||(Be=1,ne=function(r){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return t&&t[1]||""}),ne}var ie,Ie;function qe(){if(Ie)return ie;Ie=1;var e=m,r=Ir(),t=qr(),i=Ae,n=Te,a=jr(),s=kr(),o=Ce,l=g,d=j(),c=Hr();return ie=function(u){return new Promise(function(bt,T){var U=u.data,B=u.headers,I=u.responseType,P;function nr(){u.cancelToken&&u.cancelToken.unsubscribe(P),u.signal&&u.signal.removeEventListener("abort",P)}e.isFormData(U)&&e.isStandardBrowserEnv()&&delete B["Content-Type"];var f=new XMLHttpRequest;if(u.auth){var At=u.auth.username||"",Ot=u.auth.password?unescape(encodeURIComponent(u.auth.password)):"";B.Authorization="Basic "+btoa(At+":"+Ot)}var me=n(u.baseURL,u.url);f.open(u.method.toUpperCase(),i(me,u.params,u.paramsSerializer),!0),f.timeout=u.timeout;function ir(){if(f){var R="getAllResponseHeaders"in f?a(f.getAllResponseHeaders()):null,D=!I||I==="text"||I==="json"?f.responseText:f.response,S={data:D,status:f.status,statusText:f.statusText,headers:R,config:u,request:f};r(function(Ee){bt(Ee),nr()},function(Ee){T(Ee),nr()},S),f=null}}if("onloadend"in f?f.onloadend=ir:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(ir)},f.onabort=function(){f&&(T(new l("Request aborted",l.ECONNABORTED,u,f)),f=null)},f.onerror=function(){T(new l("Network Error",l.ERR_NETWORK,u,f,f)),f=null},f.ontimeout=function(){var D=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded",S=u.transitional||o;u.timeoutErrorMessage&&(D=u.timeoutErrorMessage),T(new l(D,S.clarifyTimeoutError?l.ETIMEDOUT:l.ECONNABORTED,u,f)),f=null},e.isStandardBrowserEnv()){var ar=(u.withCredentials||s(me))&&u.xsrfCookieName?t.read(u.xsrfCookieName):void 0;ar&&(B[u.xsrfHeaderName]=ar)}"setRequestHeader"in f&&e.forEach(B,function(D,S){typeof U>"u"&&S.toLowerCase()==="content-type"?delete B[S]:f.setRequestHeader(S,D)}),e.isUndefined(u.withCredentials)||(f.withCredentials=!!u.withCredentials),I&&I!=="json"&&(f.responseType=u.responseType),typeof u.onDownloadProgress=="function"&&f.addEventListener("progress",u.onDownloadProgress),typeof u.onUploadProgress=="function"&&f.upload&&f.upload.addEventListener("progress",u.onUploadProgress),(u.cancelToken||u.signal)&&(P=function(R){f&&(T(!R||R&&R.type?new d:R),f.abort(),f=null)},u.cancelToken&&u.cancelToken.subscribe(P),u.signal&&(u.signal.aborted?P():u.signal.addEventListener("abort",P))),U||(U=null);var ve=c(me);if(ve&&["http","https","file"].indexOf(ve)===-1){T(new l("Unsupported protocol "+ve+":",l.ERR_BAD_REQUEST,u));return}f.send(U)})},ie}var ae,Le;function Wr(){return Le||(Le=1,ae=null),ae}var p=m,$e=Ur,Fe=g,Jr=Ce,Vr=ge,zr={"Content-Type":"application/x-www-form-urlencoded"};function Me(e,r){!p.isUndefined(e)&&p.isUndefined(e["Content-Type"])&&(e["Content-Type"]=r)}function Xr(){var e;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(e=qe()),e}function Kr(e,r,t){if(p.isString(e))try{return(r||JSON.parse)(e),p.trim(e)}catch(i){if(i.name!=="SyntaxError")throw i}return(t||JSON.stringify)(e)}var k={transitional:Jr,adapter:Xr(),transformRequest:[function(r,t){if($e(t,"Accept"),$e(t,"Content-Type"),p.isFormData(r)||p.isArrayBuffer(r)||p.isBuffer(r)||p.isStream(r)||p.isFile(r)||p.isBlob(r))return r;if(p.isArrayBufferView(r))return r.buffer;if(p.isURLSearchParams(r))return Me(t,"application/x-www-form-urlencoded;charset=utf-8"),r.toString();var i=p.isObject(r),n=t&&t["Content-Type"],a;if((a=p.isFileList(r))||i&&n==="multipart/form-data"){var s=this.env&&this.env.FormData;return Vr(a?{"files[]":r}:r,s&&new s)}else if(i||n==="application/json")return Me(t,"application/json"),Kr(r);return r}],transformResponse:[function(r){var t=this.transitional||k.transitional,i=t&&t.silentJSONParsing,n=t&&t.forcedJSONParsing,a=!i&&this.responseType==="json";if(a||n&&p.isString(r)&&r.length)try{return JSON.parse(r)}catch(s){if(a)throw s.name==="SyntaxError"?Fe.from(s,Fe.ERR_BAD_RESPONSE,this,null,this.response):s}return r}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Wr()},validateStatus:function(r){return r>=200&&r<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};p.forEach(["delete","get","head"],function(r){k.headers[r]={}}),p.forEach(["post","put","patch"],function(r){k.headers[r]=p.merge(zr)});var se=k,Qr=m,Gr=se,Yr=function(r,t,i){var n=this||Gr;return Qr.forEach(i,function(s){r=s.call(n,r,t)}),r},oe,je;function ke(){return je||(je=1,oe=function(r){return!!(r&&r.__CANCEL__)}),oe}var He=m,ue=Yr,Zr=ke(),et=se,rt=j();function le(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new rt}var tt=function(r){le(r),r.headers=r.headers||{},r.data=ue.call(r,r.data,r.headers,r.transformRequest),r.headers=He.merge(r.headers.common||{},r.headers[r.method]||{},r.headers),He.forEach(["delete","get","head","post","put","patch","common"],function(n){delete r.headers[n]});var t=r.adapter||et.adapter;return t(r).then(function(n){return le(r),n.data=ue.call(r,n.data,n.headers,r.transformResponse),n},function(n){return Zr(n)||(le(r),n&&n.response&&(n.response.data=ue.call(r,n.response.data,n.response.headers,r.transformResponse))),Promise.reject(n)})},E=m,We=function(r,t){t=t||{};var i={};function n(c,h){return E.isPlainObject(c)&&E.isPlainObject(h)?E.merge(c,h):E.isPlainObject(h)?E.merge({},h):E.isArray(h)?h.slice():h}function a(c){if(E.isUndefined(t[c])){if(!E.isUndefined(r[c]))return n(void 0,r[c])}else return n(r[c],t[c])}function s(c){if(!E.isUndefined(t[c]))return n(void 0,t[c])}function o(c){if(E.isUndefined(t[c])){if(!E.isUndefined(r[c]))return n(void 0,r[c])}else return n(void 0,t[c])}function l(c){if(c in t)return n(r[c],t[c]);if(c in r)return n(void 0,r[c])}var d={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l};return E.forEach(Object.keys(r).concat(Object.keys(t)),function(h){var u=d[h]||a,y=u(h);E.isUndefined(y)&&u!==l||(i[h]=y)}),i},fe,Je;function Ve(){return Je||(Je=1,fe={version:"0.27.2"}),fe}var nt=Ve().version,A=g,ce={};["object","boolean","number","function","string","symbol"].forEach(function(e,r){ce[e]=function(i){return typeof i===e||"a"+(r<1?"n ":" ")+e}});var ze={};ce.transitional=function(r,t,i){function n(a,s){return"[Axios v"+nt+"] Transitional option '"+a+"'"+s+(i?". "+i:"")}return function(a,s,o){if(r===!1)throw new A(n(s," has been removed"+(t?" in "+t:"")),A.ERR_DEPRECATED);return t&&!ze[s]&&(ze[s]=!0,console.warn(n(s," has been deprecated since v"+t+" and will be removed in the near future"))),r?r(a,s,o):!0}};function it(e,r,t){if(typeof e!="object")throw new A("options must be an object",A.ERR_BAD_OPTION_VALUE);for(var i=Object.keys(e),n=i.length;n-- >0;){var a=i[n],s=r[a];if(s){var o=e[a],l=o===void 0||s(o,a,e);if(l!==!0)throw new A("option "+a+" must be "+l,A.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new A("Unknown option "+a,A.ERR_BAD_OPTION)}}var at={assertOptions:it,validators:ce},Xe=m,st=Ae,Ke=Pr,Qe=tt,H=We,ot=Te,Ge=at,N=Ge.validators;function _(e){this.defaults=e,this.interceptors={request:new Ke,response:new Ke}}_.prototype.request=function(r,t){typeof r=="string"?(t=t||{},t.url=r):t=r||{},t=H(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var i=t.transitional;i!==void 0&&Ge.assertOptions(i,{silentJSONParsing:N.transitional(N.boolean),forcedJSONParsing:N.transitional(N.boolean),clarifyTimeoutError:N.transitional(N.boolean)},!1);var n=[],a=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(t)===!1||(a=a&&y.synchronous,n.unshift(y.fulfilled,y.rejected))});var s=[];this.interceptors.response.forEach(function(y){s.push(y.fulfilled,y.rejected)});var o;if(!a){var l=[Qe,void 0];for(Array.prototype.unshift.apply(l,n),l=l.concat(s),o=Promise.resolve(t);l.length;)o=o.then(l.shift(),l.shift());return o}for(var d=t;n.length;){var c=n.shift(),h=n.shift();try{d=c(d)}catch(u){h(u);break}}try{o=Qe(d)}catch(u){return Promise.reject(u)}for(;s.length;)o=o.then(s.shift(),s.shift());return o},_.prototype.getUri=function(r){r=H(this.defaults,r);var t=ot(r.baseURL,r.url);return st(t,r.params,r.paramsSerializer)},Xe.forEach(["delete","get","head","options"],function(r){_.prototype[r]=function(t,i){return this.request(H(i||{},{method:r,url:t,data:(i||{}).data}))}}),Xe.forEach(["post","put","patch"],function(r){function t(i){return function(a,s,o){return this.request(H(o||{},{method:r,headers:i?{"Content-Type":"multipart/form-data"}:{},url:a,data:s}))}}_.prototype[r]=t(),_.prototype[r+"Form"]=t(!0)});var ut=_,de,Ye;function lt(){if(Ye)return de;Ye=1;var e=j();function r(t){if(typeof t!="function")throw new TypeError("executor must be a function.");var i;this.promise=new Promise(function(s){i=s});var n=this;this.promise.then(function(a){if(n._listeners){var s,o=n._listeners.length;for(s=0;s{e.dispatch("showMessage",{title:l,desc:s,status:o})};return{...q.useAppDefaults({applicationId:"richdocuments"}),accessToken:r,fileName:i,hideSaveAs:n,messageDisplay:a,serverUrl:t.serverUrl}},async mounted(){try{let e=await this.getDocumentFileInfo();this.fileName=e.title;let r=this.generateDocUrlSrc(e);this.showEditor(e,r),document.title=this.fileName}catch(e){this.messageDisplay(e),this.closeApp()}},methods:{cancelSaveAs(){this.hideSaveAs=!0},confirmSaveAs(e){if(!e)return;let r=document.getElementById("loleafletframe");this.WOPIPostMessage(r,"Action_SaveAs",{Filename:e,Notify:!0}),this.hideSaveAs=!0},WOPIPostMessage(e,r,t){if(!e)return;const i={MessageId:r,SendTime:Date.now(),Values:t};e.contentWindow.postMessage(JSON.stringify(i),"*")},async getDocumentFileInfo(){return mt({method:"GET",url:this.serverUrl+"index.php/apps/richdocuments/ajax/documents/index/"+this.currentFileContext.itemId,headers:{Authorization:"Bearer "+this.accessToken}}).then(e=>e.data)},generateWOPISrc(e){const r=[e.fileId,e.instanceId,e.version,e.sessionId].join("_");return this.serverUrl+`index.php/apps/richdocuments/wopi/files/${r}`},generateDocUrlSrc(e){let r=encodeURIComponent(this.generateWOPISrc(e));return e.urlsrc+"WOPISrc="+r+"&title="+encodeURIComponent(e.title)+"&lang="+e.locale.replace("_","-")+"&closebutton=1"},showEditor(e,r){const t='
',i='