const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./MainQueryBuilder-1.0.63-B0m2zVpP.js","./cmJson-1.0.63-CyZ2MfFg.js","./cm-1.0.63-CSIRHMXC.js","./redux-1.0.63-Df-eBzJn.js","./vendor-1.0.63-CN03Eozo.js","./lib-1.0.63-DJZPtMem.js","./loglevel-1.0.63-BZ7XahX3.js","./lodash-1.0.63-hMxolcpJ.js","./moment-1.0.63-C5S46NFB.js","./rehyperaw-1.0.63-AkovKNCK.js","./markdown-1.0.63-BJvkzZkj.js","./AdminTheme-1.0.63-DhJ0rrw5.js","./Typography-1.0.63-mecuj_Wl.js","./hooks-1.0.63-CWs3kTdT.js","./ActionsExplorer-1.0.63-DQojhfpy.js","./RestApi-1.0.63-BUfzocgq.js","./DatabaseTypeEnum-1.0.63-DeJfpW1u.js","./Spinner-1.0.63-zcgIyS7Z.js","./ThemeProvider-1.0.63-Cq0KMgkh.js","./useEnhancedEffect-1.0.63-DnR0ZFqV.js"])))=>i.map(i=>d[i]);
import{_ as c}from"./cmJson-1.0.63-CyZ2MfFg.js";import{j as o}from"./cm-1.0.63-CSIRHMXC.js";import{c as y,a as p,P as b,r as u}from"./redux-1.0.63-Df-eBzJn.js";import{l as r,a as i}from"./lib-1.0.63-DJZPtMem.js";import{S as q}from"./notistack-1.0.63-B49ULGrj.js";import{u as m}from"./useViewHeight-1.0.63-C7T4FLFa.js";const f={databases:{databases:[],defaultDatabase:"",wpDatabase:""},queries:{},queryId:void 0,tabIndex:"",protectWordPressTables:!0,showSqlHints:!1,sqlSchemas:{},aiDefinitions:{},copyQuery:void 0,openAI:void 0,cron:{cron:{},schedules:{},intervalSorted:[],mailEnabled:!1}},l=y({name:"sql",initialState:f,reducers:{setDatabase:(s,a)=>{const{databases:e}=a.payload;r.debug(e),s.databases={...e}},addQuery:(s,a)=>{const{queryKey:e,query:t}=a.payload;r.debug(e,t),s.queries[e]={...t},s.tabIndex=e},updateQuery:(s,a)=>{const{queryKey:e,query:t,isUpdated:d}=a.payload;r.debug(e,t,d),s.queries[e]&&(s.queries[e]={...t,isUpdated:d??!0})},deleteQuery:(s,a)=>{const{queryKey:e}=a.payload;if(r.debug(e),s.queries[e]){const t=Object.keys(s.queries).indexOf(e);delete s.queries[e];const d=Object.keys(s.queries);d.length>0&&(t===0?s.tabIndex=d[0]:t<d.length-1?s.tabIndex=d[t-1]:s.tabIndex=d[d.length-1])}},closeAll:s=>{s.queries={}},setTabIndex:(s,a)=>{const{tabIndex:e}=a.payload;r.debug(e),s.tabIndex=e},setProtection:(s,a)=>{const{protectWordPressTables:e}=a.payload;r.debug(e),s.protectWordPressTables=e},setHints:(s,a)=>{const{showSqlHints:e}=a.payload;r.debug(e),s.showSqlHints=e},addSqlSchema:(s,a)=>{const{sqlSchemaName:e,sqlSchema:t}=a.payload;r.debug(e,t),s.sqlSchemas[e]=t},addAiDefinitions:(s,a)=>{const{sqlSchemaName:e,aiDefinitions:t}=a.payload;r.debug(e,t),s.aiDefinitions[e]=t},setCopyQuery:(s,a)=>{const{copyQuery:e}=a.payload;r.debug(e),s.copyQuery=e},setOpenAI:(s,a)=>{const{prompt:e,queryKey:t}=a.payload;r.debug(e,t),s.openAI={prompt:e,queryKey:t}},setCron:(s,a)=>{const{cron:e,schedules:t,intervalSorted:d,mailEnabled:n}=a.payload;r.debug(e,t,d,n),s.cron={cron:e,schedules:t,intervalSorted:d,mailEnabled:n}},setQueryId:(s,a)=>{const{queryId:e}=a.payload;r.debug(e),s.queryId=e},queryIsUpdated:(s,a)=>{const{queryKey:e,isUpdated:t}=a.payload;r.debug(e,t),s.queries[e]&&(s.queries[e].isUpdated=t)}},selectors:{selectQueryBuilder:s=>s}}),{setDatabase:A,addQuery:H,updateQuery:O,deleteQuery:T,closeAll:k,setTabIndex:v,setProtection:E,setHints:U,addSqlSchema:w,addAiDefinitions:C,setCopyQuery:K,setOpenAI:B,setCron:M,setQueryId:W,queryIsUpdated:z}=l.actions,S=l.reducer,g=p({reducer:{sql:S}}),x=u.lazy(()=>c(()=>import("./MainQueryBuilder-1.0.63-B0m2zVpP.js").then(s=>s.M),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]),import.meta.url)),I=()=>(m(),o.jsxs(b,{store:g,children:[o.jsx(q,{maxSnack:i.maxSnack,autoHideDuration:i.autoHideDuration}),o.jsx(u.Suspense,{children:o.jsx(x,{})})]})),N=Object.freeze(Object.defineProperty({__proto__:null,default:I},Symbol.toStringTag,{value:"Module"}));export{N as S,W as a,H as b,E as c,U as d,k as e,l as f,g,M as h,v as i,T as j,K as k,w as l,B as m,C as n,A as s,O as u};
