"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9365],{424:function(e,s,a){a.d(s,{Z:function(){return i}});var t=a(828),n=a(85893),l=a(67294);function i(e){var s,a,i,r=e.confirmedDelegetedUser,c=e.linksArray,d=e.user,o=(null===r||void 0===r||r.delegated,null===r||void 0===r||null===(s=r.priviledges)||void 0===s||s.match(/Edit Tables/i),null===r||void 0===r||null===(a=r.priviledges)||void 0===a||a.match(/Delete Tables/i),null===r||void 0===r||null===(i=r.priviledges)||void 0===i||i.match(/Create Tables/i),l.useState(c||null)),u=(0,t.Z)(o,2),x=u[0],h=u[1];return l.useEffect((function(){var e;if(!c){var s=window.location.pathname,a=s.split("/"),t=[];t.push({title:"Home",path:s.match(/admin/)?"/admin":"/"});null===(e=window.location.search)||void 0===e||e.match(/delegated=true/);a.forEach((function(e,s,a){(null===e||void 0===e?void 0:e.match(/./))&&1!=s&&(e.match(/^\d+$/)&&d||t.push({title:e,path:function(){for(var e="",t=0;ts||!n.match(/./)||(e+="/".concat(n))}return e}()}))})),h(t)}}),[]),x&&x[1]?(0,n.jsx)("div",{className:"text-sm mt-2 flex-wrap",children:x.map((function(e,s,a){return s===x.length-1?(0,n.jsx)("a",{href:e.path,className:"text-slate-400 dark:text-slate-500 pointer-events-none",children:e.title},s):(0,n.jsxs)(l.Fragment,{children:[(0,n.jsx)("a",{href:e.path,className:"query-url",children:e.title}),(0,n.jsx)("span",{className:"opacity-20",children:"|"})]},s)}))}):(0,n.jsx)(l.Fragment,{})}},96355:function(e,s,a){a.d(s,{Z:function(){return x}});var t=a(828),n=a(85893),l=a(67294),i=a(86729),r=a(81069),c=a(95264),d=a(88518),o=a(68599),u=a(62888);function x(e){var s=(0,t.Z)(l.useState(!0),2),a=s[0],x=s[1],h=(0,t.Z)(l.useState(0),2),m=h[0],f=h[1],p=(0,t.Z)(l.useState(0),2),j=(p[0],p[1]);return l.useEffect((function(){m||(0,i.Z)("/api/getDiskUsage").then((function(e){(null===e||void 0===e?void 0:e.total)&&(f(e.total),localStorage.setItem("disk_usage",e.total)),x(!1)}))}),[]),a?(0,n.jsx)("div",{className:"button ghost small-text",style:{height:"30px"},children:(0,n.jsx)(c.Z,{width:"15px",position:"relative"})}):(0,n.jsx)(l.Fragment,{children:m?(0,n.jsxs)("div",{className:"button ghost small-text normal-weight p-0",style:{height:"30px",padding:0},onClick:function(e){x(!0),(0,r.Z)().then((function(){j((function(e){return e+1})),x(!1)}))},children:[a&&(0,n.jsx)(c.Z,{width:"15px"}),(0,n.jsx)(o.Z,{size:20,className:"text-slate-400 mr-[3px]"}),(0,n.jsx)("span",{className:"font-bold text-slate-700 dark:text-white",children:m&&m.toFixed(2)}),(0,n.jsx)("span",{className:"text-slate-500",children:"mb"}),(0,n.jsx)(u.Z,{size:17,className:"text-slate-400",strokeWidth:2})]}):(0,n.jsxs)("span",{className:"text-sm info gray font-normal w-auto",children:[(0,n.jsx)(d.Z,{color:"inherit",className:"opacity-50 text-slate-500",fontSize:"small"}),(0,n.jsx)("span",{children:"No Disk Usage Data Available Yet"})]})})}},81069:function(e,s,a){a.d(s,{Z:function(){return i}});var t=a(47568),n=a(97582),l=a(86729);function i(){return r.apply(this,arguments)}function r(){return(r=(0,t.Z)((function(){var e;return(0,n.__generator)(this,(function(s){switch(s.label){case 0:return[4,(0,l.Z)("/api/getDiskUsage")];case 1:return e=s.sent(),localStorage.setItem("disk_usage",e.total),[2]}}))}))).apply(this,arguments)}},54858:function(e,s,a){a.d(s,{Z:function(){return N}});var t=a(85893),n=a(67294),l=a(9008),i=a.n(l),r=(a(15281),a(828)),c=a(64017),d=a(96224),o=a(73486),u=a(33587),x=a(78107),h=a(49525),m=a(57150),f=a(3848),p=a(4844);function j(e){var s=e.user,a=(0,r.Z)(n.useState(!0),2),l=a[0],i=a[1];return(0,t.jsxs)("aside",{className:"aside"+(l?" mobile-collapsed":" mobile-expanded"),children:[(0,t.jsx)(c.Z,{adminAside:!0,collapseAsideMobile:l,setCollapseAsideMobile:i}),(0,t.jsx)("hr",{className:"opacity-0 mt-4"}),(0,t.jsxs)("div",{className:"main-links"+(l?" hidden lg:flex":" "),children:[(0,t.jsxs)("a",{href:"/admin","data-currentlink":"/admin","data-strictlink":"true",children:[(0,t.jsx)(o.Z,{size:20}),(0,t.jsx)("span",{children:"Dashboard"})]}),(0,t.jsxs)("a",{href:"/admin/".concat(null===s||void 0===s?void 0:s.id,"/databases"),"data-currentlink":"/admin/".concat(null===s||void 0===s?void 0:s.id,"/databases"),children:[(0,t.jsx)(u.Z,{size:20}),(0,t.jsx)("span",{children:"Databases"})]}),(0,t.jsxs)("a",{href:"/admin/".concat(null===s||void 0===s?void 0:s.id,"/media"),"data-currentlink":"/admin/".concat(null===s||void 0===s?void 0:s.id,"/media"),children:[(0,t.jsx)(x.Z,{size:20}),(0,t.jsx)("span",{children:"Media"})]}),(0,t.jsxs)("a",{href:"/admin/".concat(null===s||void 0===s?void 0:s.id,"/users"),"data-currentlink":"/admin/".concat(null===s||void 0===s?void 0:s.id,"/users"),children:[(0,t.jsx)(h.Z,{size:20}),(0,t.jsx)("span",{children:"Users"})]}),(0,t.jsxs)("a",{href:"/admin/".concat(null===s||void 0===s?void 0:s.id,"/schema"),"data-currentlink":"/admin/".concat(null===s||void 0===s?void 0:s.id,"/schema"),children:[(0,t.jsx)(m.Z,{size:20}),(0,t.jsx)("span",{children:"Schema"})]}),(0,t.jsxs)("a",{href:"/admin/".concat(null===s||void 0===s?void 0:s.id,"/api-keys"),"data-currentlink":"/admin/".concat(null===s||void 0===s?void 0:s.id,"/api-keys"),children:[(0,t.jsx)(f.Z,{size:20}),(0,t.jsx)("span",{children:"API Keys"})]}),(0,t.jsxs)("a",{href:"/admin/".concat(null===s||void 0===s?void 0:s.id,"/connect"),"data-currentlink":"/admin/".concat(null===s||void 0===s?void 0:s.id,"/connect"),children:[(0,t.jsx)(p.Z,{size:20}),(0,t.jsx)("span",{children:"Connect"})]}),1==s.id&&(0,t.jsx)(n.Fragment,{children:(0,t.jsxs)("a",{href:"/su","data-currentlink":"/su",children:[(0,t.jsx)(d.Z,{className:"text-slate-400"}),(0,t.jsx)("span",{children:"Super Admin User"})]})}),(0,t.jsx)("hr",{className:"opacity-80"}),(0,t.jsxs)("div",{className:"flex-col gap-0 items-start w-full",children:[(0,t.jsx)("a",{href:"/admin/".concat(null===s||void 0===s?void 0:s.id,"/settings"),"data-currentlink":"/admin/".concat(null===s||void 0===s?void 0:s.id,"/settings"),children:(0,t.jsx)("span",{children:"Settings"})}),(0,t.jsx)("a",{href:"/docs","data-currentlink":"/docs",target:"_blank",children:(0,t.jsx)("span",{children:"Documentation"})}),(0,t.jsx)("a",{href:"/logout","data-currentlink":"/logout",children:(0,t.jsx)("span",{children:"Logout"})})]})]})]})}a(87108);var v=a(65484);function g(e){var s=e.user,a=e.extraHeaderContent,l=(0,r.Z)(n.useState(s||null),2),i=l[0],c=l[1];return n.useEffect((function(){(null===s||void 0===s?void 0:s.logged_in_status)&&c(s||null)}),[s]),(0,t.jsx)("section",{className:"overflow-visible w-full px-0 md:px-8 py-0 flex justify-center bg-white dark:bg-slate-800 shadow-lg gap-4 dark:shadow-black/10 z-50 shadow-slate-900/5",style:{zIndex:700,border:"none"},children:(0,t.jsxs)("div",{className:"w-full items-center justify-between gap-4 md:gap-8",children:[(0,t.jsxs)("div",{className:"hidden xl:flex flex-col items-stretch grow fixed xl:static top-0 right-0 px-4 xl:px-0 shadow-xl xl:shadow-none h-screen xl:h-auto overflow-auto xl:overflow-visible w-screen sl:w-auto bg-white xl:bg-transparent pb-10 xl:pb-0",id:"main-nav-content-wrapper",children:[(0,t.jsxs)("div",{className:"items-center mb-2 flex xl:hidden",children:[(0,t.jsx)("a",{href:"/",className:"hidden xl:flex",children:(0,t.jsx)("img",{src:"/images/logo-icon-alt-2.png",alt:"Logo Icon",width:37})}),(0,t.jsx)("button",{className:"outlined gray ml-auto",onClick:function(e){var s=document.getElementById("main-nav-content-wrapper");null===s||void 0===s||s.classList.toggle("hidden")},style:{border:"none"},children:(0,t.jsx)("span",{className:"font-semibold text-4xl",children:"\u2715"})})]}),(0,t.jsxs)("div",{className:"flex items-center w-full gap-6 grow flex-col xl:flex-row justify-start xl:justify-between",children:[(0,t.jsx)("div",{className:"gap-6",children:a}),(0,t.jsx)(v.Z,{activeUser:i})]})]}),(0,t.jsxs)("button",{className:"bg-transparent w-16 p-4 gap-1.5 flex xl:hidden flex-col hover:bg-transparent transition-all ml-auto",onClick:function(e){var s=document.getElementById("main-nav-content-wrapper");null===s||void 0===s||s.classList.toggle("hidden")},style:{minWidth:"50px",backgroundColor:"transparent"},id:"main-header-hamburger-button","aria-label":"Mobile Hambutget Button",children:[(0,t.jsx)("div",{className:"w-full h-1 bg-slate-600 dark:bg-slate-400 rounded-full"}),(0,t.jsx)("div",{className:"w-full h-1 bg-slate-600 dark:bg-slate-400 rounded-full"}),(0,t.jsx)("div",{className:"w-full h-1 bg-slate-600 dark:bg-slate-400 rounded-full"})]})]})})}var b=a(29678),w=a(96355),k=a(86729);function N(e){var s=e.children,a=e.head,l=e.user,r=(e.productionEnvironment,e.extraHeaderContent);e.aceEditor;return r||(r=(0,t.jsx)(w.Z,{})),n.useEffect((function(){var e=document.querySelectorAll("aside .main-links a");(0,b.Z)({links:e}),document.cookie.match(/user_refresh=1/)&&(0,k.Z)("/api/reAuthenticateUser",{method:"post",body:{}},!0).then((function(e){e.status&&e.user&&(document.cookie="user_refresh=0;max-age=0",localStorage.setItem("csrf",e.user.csrf_k),localStorage.setItem("user",JSON.stringify(e.user)),window.location.reload())}))}),[]),(0,t.jsxs)(n.Fragment,{children:[(0,t.jsxs)(i(),{children:[a,(0,t.jsxs)(n.Fragment,{children:[(0,t.jsx)("script",{src:"https://cdnjs.cloudflare.com/ajax/libs/ace/1.22.0/ace.min.js",integrity:"sha512-q6CTB0jS+VuJnSct82rVcWlI06LGzNjaG3CWenHWVUncRvc4UQMFkA3a5Ip880xr+lBx38FcHDclOxPdSg+sBw==",crossOrigin:"anonymous",referrerPolicy:"no-referrer"}),(0,t.jsx)("script",{src:"https://cdnjs.cloudflare.com/ajax/libs/ace/1.22.0/ext-language_tools.min.js",integrity:"sha512-6g6cvocV7eT/J8L44lL8gJKqq9onqQeYGgJO0DmrsYFcCfRl6wYkYA/KHS768r4QVTB4JxsCcMQ9gIezxpTCZw==",crossOrigin:"anonymous",referrerPolicy:"no-referrer"})]})]}),(0,t.jsxs)("div",{className:"admin w-full flex items-start gap-0",children:[(0,t.jsx)(j,{user:l}),(0,t.jsxs)("main",{className:"relative",children:[(0,t.jsx)(g,{user:l,extraHeaderContent:r}),(0,t.jsx)("div",{className:"admin-content",children:s}),(0,t.jsx)("footer",{className:"flex justify-center w-full items-center p-4",children:(0,t.jsxs)("div",{className:"max-w-6xl w-full justify-center flex-wrap",children:[(0,t.jsx)("div",{className:"flex items-center gap-2 scale-75",children:(0,t.jsx)(c.Z,{})}),(0,t.jsx)("span",{className:"opacity-25",children:"|"}),(0,t.jsxs)("span",{className:"text-sm text-slate-400 dark:text-slate-600 text-center",children:[(new Date).getFullYear()," \xa9 Datasquirel. All rights reserved."]}),(0,t.jsx)("span",{className:"opacity-25",children:"|"}),(0,t.jsx)("a",{href:"/docs",children:"Docs"}),(0,t.jsx)("span",{className:"opacity-25",children:"|"}),(0,t.jsx)("a",{href:"/terms",children:"Terms"})]})})]})]})]})}}}]);