import{aa as l,ab as c}from"./_applist-tangy-colts-beg-36.js";import{_ as o}from"./main-tangy-colts-beg.js";import{h as a,s as E}from"./machine.-tangy-colts-beg-869.js";import{h as d,c as r}from"./commons.-tangy-colts-beg-359.js";import{a as i,h}from"./machineh-tangy-colts-beg-169.js";import"./lodash-tangy-colts-beg-516.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(t,e){return this.cache.has(t)?this.cache.get(t):(this.cache.set(t,e),e)}};const f=l(({helpers:t})=>({states:{components:[r(t),{allowClear:!0,componentName:t.componentName.select,fieldType:"config",helperText:o("Select the file to delete."),id:"file-id",label:o("File"),onChange:"SELECT_FILE",onRefetch:"REFETCH_FILES",options:[],render:"IF_CONNECTION_SELECTED",required:!0,showSearch:!0,value:void 0},{componentName:t.componentName.switch,fieldType:"config",helperText:o("Whether to delete the file immediately. If false, the file will be moved to the trash."),id:"delete-permanently",label:o("Delete Permanently"),onChange:"SET_DELETE_PERMANENTLY",render:"IF_CONNECTION_SELECTED",value:!1}]},actions:{SET_CONNECTION:async({$:e,e:n})=>{a("connectionId")({$:e,e:n}),await i(e),h(e,t)},CONNECTION_ADD_CHANGE:d,IF_CONNECTION_SELECTED:({$:e})=>{var n;return c((n=e.getComponent("connection-id"))==null?void 0:n.value)},REFETCH_FILES:({$:e})=>i(e),SELECT_FILE:a("fileId"),SET_DELETE_PERMANENTLY:a("deletePermanently"),ON_MACHINE_LOAD:({$:e})=>{E(e,[{db:"connectionId",id:"connection-id"},{db:"fileId",id:"file-id"},{db:"deletePermanently",id:"delete-permanently"}]),i(e)}}}));export{f as default};
