import{i as r}from"./vue.runtime.esm-CbNPNm8f.chunk.mjs";import{l as s}from"./index-D3wiQe9-.chunk.mjs";import{g as n}from"./index-DxwFe63_.chunk.mjs";import{l}from"./logger-DrmDPXkr.chunk.mjs";const j=function(t,e){const o=t.attrs.href;if(!o||!window.OCA?.Viewer||o.match(/^[a-zA-Z]*:/)||o.startsWith("#")||s("core","active-app","")==="collectives"||o.includes("/apps/collectives/"))return o;const a=o.match(/^([^?]*)\?fileId=(\d+)/);if(a){const[,,i]=a;return new URL(n(`/f/${i}`),window.origin).href}return o},k=function(t){const e=t.getAttribute("href");if(!e)return e;const o=e.match(/\?dir=([^&]*)&openfile=([^&]*)#relPath=([^&]*)/);if(o){const[,,a]=o;return new URL(n(`/f/${a}`),window.origin).href}return e},A=function(t){const e=window.location.origin+window.location.pathname+window.location.search;return t?.startsWith("#")||t?.startsWith(e+"#")},c=function(t){const e=new URL(t,window.location.href);window.open(e.href,"_blank")},m=Symbol("editor:open-link-handler");function L(){return{openLinkHandler:r(m,{openLink:c})}}const f=Symbol("editor:file"),d=Symbol("attachment:resolver"),u=Symbol("editor:is-mobile"),h=Symbol("editor:upload"),U=Symbol("hook:mention-search"),R=Symbol("hook:mention-insert"),C=Symbol("menubar:link-custom-action"),I={inject:{$isMobile:{from:u,default:!1}}},H={inject:{$file:{from:f,default:()=>({fileId:0,relativePath:null,document:null})}}},O={inject:{$attachmentResolver:{from:d,default:{resolve(t){return l.warn("No attachment resolver provided. Some attachment sources cannot be resolved."),[t]}}}}},P={inject:{$editorUpload:{from:h,default:!0}}},p=Symbol("state:uploading-state"),w=Symbol("editor:action:attachment-prompt"),b=Symbol("editor:action:upload-attachment"),S=Symbol("editor:action:create-attachment"),W={inject:{$uploadingState:{from:p,default:{isUploadingAttachments:!1}}}},x={inject:{$callAttachmentPrompt:{from:w,default:()=>{}}}},E={inject:{$callChooseLocalAttachment:{from:b,default:()=>{}}}},M={inject:{$callCreateAttachment:{from:S,default:()=>t=>{}}}};export{d as A,h as E,f as F,C as H,u as I,m as O,p as S,R as a,U as b,w as c,I as d,E as e,H as f,P as g,x as h,W as i,M as j,j as k,A as l,O as m,S as n,c as o,k as p,b as q,L as u};
//# sourceMappingURL=MediaHandler.provider-BUbYNN83.chunk.mjs.map
