const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=[window.OC.filePath('assistant', '', 'js/index-Ds-TrDn_.chunk.mjs'),window.OC.filePath('assistant', '', 'js/index-D953jVe0.chunk.mjs'),window.OC.filePath('assistant', '', 'js/index-DhgIrZpo.chunk.mjs'),window.OC.filePath('assistant', '', 'js/index-Dk4MzVw6.chunk.mjs'),window.OC.filePath('assistant', '', 'js/runtime-dom.esm-bundler-Dyqpejx9.chunk.mjs'),window.OC.filePath('assistant', '', 'js/index-CYie652Q.chunk.mjs'),window.OC.filePath('assistant', '', 'js/index-0D_mItKm.chunk.mjs'),window.OC.filePath('assistant', '', 'js/index-B7npabGH.chunk.mjs')])))=>i.map(i=>d[i]); import{_ as c}from"./index-D953jVe0.chunk.mjs";import{F as h,P as d,b as p,r as v}from"./index-BYewGXp2.chunk.mjs";import{l as w}from"./index-CYie652Q.chunk.mjs";import{C as E}from"./creation-CfmEXXjo.chunk.mjs";import{V as q,a as I}from"./constants-HI3vTFfS.chunk.mjs";import"./index-B7npabGH.chunk.mjs";const A='',Q='',T='',_=["trashbin","files.public"];function b(n){const s=new h({id:"assistant-group",displayName:i=>t("assistant","AI Assistant"),enabled(i,e){return!_.includes(e.id)&&i.length===1&&!i.some(({permissions:r})=>(r&d.READ)===0)&&i.every(({type:r})=>r===p.File)&&i.every(({mime:r})=>n.includes(r))},iconSvgInline:()=>E,order:0,async exec(){return null}});v(s)}function O(){const n=new h({id:"assistant-summarize",parent:"assistant-group",displayName:s=>t("approval","Summarize using AI"),enabled(s,i){return!_.includes(i.id)&&s.length===1&&!s.some(({permissions:e})=>(e&d.READ)===0)&&s.every(({type:e})=>e===p.File)&&s.every(({mime:e})=>q.includes(e))},iconSvgInline:()=>A,order:0,async exec(s){const{default:i}=await c(async()=>{const{default:a}=await import("./index-Ds-TrDn_.chunk.mjs");return{default:a}},__vite__mapDeps([0,1]),import.meta.url),{generateOcsUrl:e}=await c(async()=>{const{generateOcsUrl:a}=await import("./index-D953jVe0.chunk.mjs").then(o=>o.z);return{generateOcsUrl:a}},[],import.meta.url),{showError:r,showSuccess:l}=await c(async()=>{const{showError:a,showSuccess:o}=await import("./index-DhgIrZpo.chunk.mjs").then(m=>m.r);return{showError:a,showSuccess:o}},__vite__mapDeps([2,1,3,4,0,5,6,7]),import.meta.url),u=e("/apps/assistant/api/v1/file-action/{fileId}/core:text2text:summary",{fileId:s.fileid});try{await i.post(u),l(t("assistant","Summarization AI task submitted successfully.")+` `+t("assistant","You will be notified when it is ready.")+` `+t("assistant",'It can also be checked in the Assistant in the "Work with text -> Summarize" menu.'))}catch(a){console.error(a),r(t("assistant","Failed to launch the AI file action"))}return null}});v(n)}function S(){const n=new h({id:"assistant-tts",parent:"assistant-group",displayName:s=>t("assistant","Text-To-Speech using AI"),enabled(s,i){return!_.includes(i.id)&&s.length===1&&!s.some(({permissions:e})=>(e&d.READ)===0)&&s.every(({type:e})=>e===p.File)&&s.every(({mime:e})=>q.includes(e))},iconSvgInline:()=>Q,order:0,async exec(s){const{default:i}=await c(async()=>{const{default:a}=await import("./index-Ds-TrDn_.chunk.mjs");return{default:a}},__vite__mapDeps([0,1]),import.meta.url),{generateOcsUrl:e}=await c(async()=>{const{generateOcsUrl:a}=await import("./index-D953jVe0.chunk.mjs").then(o=>o.z);return{generateOcsUrl:a}},[],import.meta.url),{showError:r,showSuccess:l}=await c(async()=>{const{showError:a,showSuccess:o}=await import("./index-DhgIrZpo.chunk.mjs").then(m=>m.r);return{showError:a,showSuccess:o}},__vite__mapDeps([2,1,3,4,0,5,6,7]),import.meta.url),u=e("/apps/assistant/api/v1/file-action/{fileId}/core:text2speech",{fileId:s.fileid});try{await i.post(u),l(t("assistant","Text-to-Speech AI task submitted successfully.")+` `+t("assistant","You will be notified when it is ready.")+` `+t("assistant",'It can also be checked in the Assistant in the "Work with audio -> Generate speech" menu.'))}catch(a){console.error(a),r(t("assistant","Failed to launch the AI file action"))}return null}});v(n)}function x(){const n=new h({id:"assistant-stt",parent:"assistant-group",displayName:s=>t("assistant","Transcribe audio using AI"),enabled(s,i){return!_.includes(i.id)&&s.length===1&&!s.some(({permissions:e})=>(e&d.READ)===0)&&s.every(({type:e})=>e===p.File)&&s.every(({mime:e})=>I.includes(e))},iconSvgInline:()=>T,order:0,async exec(s){const{default:i}=await c(async()=>{const{default:a}=await import("./index-Ds-TrDn_.chunk.mjs");return{default:a}},__vite__mapDeps([0,1]),import.meta.url),{generateOcsUrl:e}=await c(async()=>{const{generateOcsUrl:a}=await import("./index-D953jVe0.chunk.mjs").then(o=>o.z);return{generateOcsUrl:a}},[],import.meta.url),{showError:r,showSuccess:l}=await c(async()=>{const{showError:a,showSuccess:o}=await import("./index-DhgIrZpo.chunk.mjs").then(m=>m.r);return{showError:a,showSuccess:o}},__vite__mapDeps([2,1,3,4,0,5,6,7]),import.meta.url),u=e("/apps/assistant/api/v1/file-action/{fileId}/core:audio2text",{fileId:s.fileid});try{await i.post(u),l(t("assistant","Transcription AI task submitted successfully.")+` `+t("assistant","You will be notified when it is ready.")+` `+t("assistant",'It can also be checked in the Assistant in the "Work with audio -> Transcribe audio" menu.'))}catch(a){console.error(a),r(t("assistant","Failed to launch the AI file action"))}return null}});v(n)}const Z=w("assistant","assistant-enabled",!1),f=w("assistant","summarize-available",!1),g=w("assistant","stt-available",!1),y=w("assistant","tts-available",!1);if(Z){if(f||g||y){const n=[];(f||y)&&n.push(...q),g&&n.push(...I),b(n)}g&&x(),f&&O(),y&&S()} //# sourceMappingURL=assistant-fileActions.mjs.map