const g=n=>"/remote.php/"+n,h=(n,o)=>u()+g(n),b=(n,o,e)=>{const i=Object.assign({ocsVersion:2},{}).ocsVersion===1?1:2;return u()+"/ocs/v"+i+".php"+p(n,o)},p=(n,o,e)=>{const i=Object.assign({escape:!0},{}),s=function(t,r){return r=r||{},t.replace(/{([^{}]*)}/g,function(d,f){const c=r[f];return i.escape?encodeURIComponent(typeof c=="string"||typeof c=="number"?c.toString():d):typeof c=="string"||typeof c=="number"?c.toString():d})};return n.charAt(0)!=="/"&&(n="/"+n),s(n,o||{})},m=(n,o,e)=>{const i=Object.assign({noRewrite:!1},{}),s=a();return window?.OC?.config?.modRewriteWorking===!0&&!i.noRewrite?s+p(n,o):s+"/index.php"+p(n,o)},x=(n,o)=>o.includes(".")?w(n,"img",o):w(n,"img",`${o}.svg`),w=(n,o,e)=>{const i=window?.OC?.coreApps?.includes(n)??!1,s=e.slice(-3)==="php";let t=a();return s&&!i?(t+=`/index.php/apps/${n}`,t+=`/${encodeURI(o)}`,e!=="index.php"&&(t+=`/${e}`)):!s&&!i?(t=l(n),t+=`/${o}/`,t.at(-1)!=="/"&&(t+="/"),t+=e):(t+=`/${n}`,t+=`/${o}`,t+=`/${e}`),t},u=()=>window.location.protocol+"//"+window.location.host+a();function a(){let n=window._oc_webroot;if(typeof n>"u"){n=location.pathname;const o=n.indexOf("/index.php/");if(o!==-1)n=n.slice(0,o);else{const e=n.indexOf("/",1);n=n.slice(0,e>0?e:void 0)}}return n}function l(n){return(window._oc_appswebroots??{})[n]??""}export{b as a,h as b,u as c,a as d,m as g,x as i}; //# sourceMappingURL=index-DxwFe63_.chunk.mjs.map