@malloy-publisher/sdk 0.0.250 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";var kT=Object.create;var km=Object.defineProperty;var wT=Object.getOwnPropertyDescriptor;var DT=Object.getOwnPropertyNames;var IT=Object.getPrototypeOf,AT=Object.prototype.hasOwnProperty;var OT=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of DT(t))!AT.call(e,o)&&o!==n&&km(e,o,{get:()=>t[o],enumerable:!(r=wT(t,o))||r.enumerable});return e};var ea=(e,t,n)=>(n=e!=null?kT(IT(e)):{},OT(t||!e||!e.__esModule?km(n,"default",{value:e,enumerable:!0}):n,e));const c=require("react/jsx-runtime"),w=require("@mui/material"),V=require("react"),Tr=require("@tanstack/react-query"),Ie=require("./ServerProvider-CcfeBpt3.cjs.js"),Ot=require("@mui/system"),MT=require("@emotion/styled"),PT=require("@emotion/react"),Fu=require("markdown-to-jsx"),On=require("@mui/icons-material"),Ia=require("react-dom"),Is=require("@malloydata/malloy-filter"),wb=require("@react-spring/web"),RT=require("react-router-dom");function Db(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const O=Db(V),NT=Db(Ia),wm=e=>e,FT=()=>{let e=wm;return{configure(t){e=t},generate(t){return e(t)},reset(){e=wm}}},Ib=FT();function bo(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}function Le(e){if(typeof e!="string")throw new Error(bo(7));return e.charAt(0).toUpperCase()+e.slice(1)}function Dm(...e){return e.reduce((t,n)=>n==null?t:function(...o){t.apply(this,o),n.apply(this,o)},()=>{})}function Sr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function LT(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var sd={exports:{}},ad,Im;function _T(){if(Im)return ad;Im=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ad=e,ad}var ld,Am;function BT(){if(Am)return ld;Am=1;var e=_T();function t(){}function n(){}return n.resetWarningCache=t,ld=function(){function r(s,a,l,u,d,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},ld}var Om;function jT(){return Om||(Om=1,sd.exports=BT()()),sd.exports}var $T=jT();const Ee=Sr($T);function Ab(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Ab(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ue(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Ab(e))&&(r&&(r+=" "),r+=t);return r}function Ke(e,t,n=void 0){const r={};for(const o in e){const i=e[o];let s="",a=!0;for(let l=0;l<i.length;l+=1){const u=i[l];u&&(s+=(a===!0?"":" ")+t(u),a=!1,n&&n[u]&&(s+=" "+n[u]))}r[o]=s}return r}var ud={exports:{}},Ht={};/**
1
+ "use strict";var kT=Object.create;var km=Object.defineProperty;var wT=Object.getOwnPropertyDescriptor;var DT=Object.getOwnPropertyNames;var IT=Object.getPrototypeOf,AT=Object.prototype.hasOwnProperty;var OT=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of DT(t))!AT.call(e,o)&&o!==n&&km(e,o,{get:()=>t[o],enumerable:!(r=wT(t,o))||r.enumerable});return e};var ea=(e,t,n)=>(n=e!=null?kT(IT(e)):{},OT(t||!e||!e.__esModule?km(n,"default",{value:e,enumerable:!0}):n,e));const c=require("react/jsx-runtime"),w=require("@mui/material"),V=require("react"),Tr=require("@tanstack/react-query"),Ie=require("./ServerProvider-CTopDUWW.cjs.js"),Ot=require("@mui/system"),MT=require("@emotion/styled"),PT=require("@emotion/react"),Fu=require("markdown-to-jsx"),On=require("@mui/icons-material"),Ia=require("react-dom"),Is=require("@malloydata/malloy-filter"),wb=require("@react-spring/web"),RT=require("react-router-dom");function Db(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const O=Db(V),NT=Db(Ia),wm=e=>e,FT=()=>{let e=wm;return{configure(t){e=t},generate(t){return e(t)},reset(){e=wm}}},Ib=FT();function bo(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}function Le(e){if(typeof e!="string")throw new Error(bo(7));return e.charAt(0).toUpperCase()+e.slice(1)}function Dm(...e){return e.reduce((t,n)=>n==null?t:function(...o){t.apply(this,o),n.apply(this,o)},()=>{})}function Sr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function LT(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var sd={exports:{}},ad,Im;function _T(){if(Im)return ad;Im=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ad=e,ad}var ld,Am;function BT(){if(Am)return ld;Am=1;var e=_T();function t(){}function n(){}return n.resetWarningCache=t,ld=function(){function r(s,a,l,u,d,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},ld}var Om;function jT(){return Om||(Om=1,sd.exports=BT()()),sd.exports}var $T=jT();const Ee=Sr($T);function Ab(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Ab(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ue(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Ab(e))&&(r&&(r+=" "),r+=t);return r}function Ke(e,t,n=void 0){const r={};for(const o in e){const i=e[o];let s="",a=!0;for(let l=0;l<i.length;l+=1){const u=i[l];u&&(s+=(a===!0?"":" ")+t(u),a=!1,n&&n[u]&&(s+=" "+n[u]))}r[o]=s}return r}var ud={exports:{}},Ht={};/**
2
2
  * @license React
3
3
  * react-is.production.js
4
4
  *
@@ -89,7 +89,7 @@ import {${t.sourceName}}" from '${t.modelPath}'"
89
89
  - [ ] `),/^\d+.\s/.test(s)&&(v=`
90
90
  `+(parseInt(s)+1)+". "),ps(r,v)}else if(e.code&&e.code.toLowerCase()==="keyd"&&e.ctrlKey){Cu(e);var k={start:r.selectionStart,end:r.selectionEnd},I=k;k=Wa({text:r.value,selection:k});var T=r.value.slice(k.start,k.end);a.setSelectionRange({start:k.end,end:k.end}),ps(r,`
91
91
  `+T),a.setSelectionRange({start:I.start,end:I.end})}else e.code&&e.code.toLowerCase()==="arrowup"&&e.altKey?wg(e,-1):e.code&&e.code.toLowerCase()==="arrowdown"&&e.altKey&&wg(e,1)}var xN=["prefixCls","onChange"],CN=["markdown","commands","fullscreen","preview","highlightEnable","extraCommands","tabSize","defaultTabEnable","autoFocusEnd","textareaWarp","dispatch"];function EN(e){var{prefixCls:t,onChange:n}=e,r=et(e,xN),o=V.useContext(_s),{markdown:i,commands:s,fullscreen:a,preview:l,highlightEnable:u,extraCommands:d,tabSize:f,defaultTabEnable:h,autoFocusEnd:p,textareaWarp:m,dispatch:b}=o;et(o,CN);var y=V.useRef(null),x=V.useRef(),C=V.useRef({fullscreen:a,preview:l});V.useEffect(()=>{C.current={fullscreen:a,preview:l,highlightEnable:u}},[a,l,u]),V.useEffect(()=>{if(y.current&&b){var k=new Lp(y.current);x.current=k,b({textarea:y.current,commandOrchestrator:k})}},[]),V.useEffect(()=>{if(p&&y.current&&m){y.current.focus();var k=y.current.value.length;y.current.setSelectionRange(k,k),setTimeout(()=>{m&&(m.scrollTop=m.scrollHeight),y.current&&(y.current.scrollTop=y.current.scrollHeight)},0)}},[m]);var v=k=>{yN(k,f,h),d2(k,[...s||[],...d||[]],x.current,b,C.current)};return V.useEffect(()=>(y.current&&y.current.addEventListener("keydown",v),()=>{y.current&&y.current.removeEventListener("keydown",v)}),[]),c.jsx("textarea",K({autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1},r,{ref:y,className:t+"-text-input "+(r.className?r.className:""),value:i,onChange:k=>{b&&b({markdown:k.target.value}),n&&n(k)}}))}var vN=["prefixCls","className","onScroll","renderTextarea"];function TN(e){var t=e||{},{prefixCls:n,className:r,onScroll:o,renderTextarea:i}=t,s=et(t,vN),{markdown:a,scrollTop:l,commands:u,extraCommands:d,dispatch:f}=V.useContext(_s),h=V.useRef(null),p=V.useRef(),m=V.createRef();V.useEffect(()=>{var y={};m.current&&(y.textareaWarp=m.current||void 0,m.current.scrollTop=l||0),f&&f(K({},y))},[]),V.useEffect(()=>{if(h.current&&f){var y=new Lp(h.current);p.current=y,f({textarea:h.current,commandOrchestrator:y})}},[]);var b={WebkitTextFillColor:"initial",overflow:"auto"};return c.jsx("div",{ref:m,className:n+"-area "+(r||""),onScroll:o,children:c.jsx("div",{className:n+"-text",children:i?V.cloneElement(i(K({},s,{value:a,autoComplete:"off",autoCorrect:"off",spellCheck:"false",autoCapitalize:"off",className:n+"-text-input",style:{WebkitTextFillColor:"inherit",overflow:"auto"}}),{dispatch:f,onChange:s.onChange,shortcuts:d2,useContext:{commands:u,extraCommands:d,commandOrchestrator:p.current}}),{ref:h}):c.jsx(V.Fragment,{children:c.jsx(EN,K({prefixCls:n},s,{style:b}))})})})}function SN(e){var{prefixCls:t,groupName:n,commands:r,children:o}=e||{},{barPopup:i={}}=V.useContext(_s);return V.useMemo(()=>c.jsx("div",{className:t+"-toolbar-child "+(n&&i[n]?"active":""),onClick:s=>s.stopPropagation(),children:Array.isArray(r)?c.jsx(g2,K({commands:r},e,{isChild:!0})):o}),[r,i,n,t])}function Dg(e){var{prefixCls:t,overflow:n}=e,{fullscreen:r,preview:o,barPopup:i={},components:s,commandOrchestrator:a,dispatch:l}=V.useContext(_s),u=V.useRef("");function d(f,h){if(l){var p={barPopup:K({},i)};f.keyCommand==="preview"&&(p.preview=f.value),f.keyCommand==="fullscreen"&&(p.fullscreen=!r),e.commands&&f.keyCommand==="group"?e.commands.forEach(m=>{h===m.groupName?p.barPopup[h]=!0:m.keyCommand&&(p.barPopup[m.groupName]=!1)}):(h||f.parent)&&Object.keys(p.barPopup||{}).forEach(m=>{p.barPopup[m]=!1}),Object.keys(p).length&&l(K({},p)),a&&a.executeCommand(f)}}return V.useEffect(()=>{document&&n&&(r?document.body.style.overflow="hidden":(u.current||(u.current=window.getComputedStyle(document.body,null).overflow),document.body.style.overflow=u.current))},[r,u,n]),c.jsx("ul",{children:(e.commands||[]).map((f,h)=>{if(f.keyCommand==="divider")return c.jsx("li",K({},f.liProps,{className:t+"-toolbar-divider"}),h);if(!f.keyCommand)return c.jsx(V.Fragment,{},h);var p=r&&f.keyCommand==="fullscreen"||f.keyCommand==="preview"&&o===f.value,m=f.children&&typeof f.children=="function"?f.children({getState:()=>a.getState(),textApi:a?a.textApi:void 0,close:()=>d({},f.groupName),execute:()=>d({execute:f.execute}),dispatch:l}):void 0,b=i&&o&&o==="preview"&&!/(preview|fullscreen)/.test(f.keyCommand),y=s?.toolbar||f.render,x=y&&typeof y=="function"?y(f,!!b,d,h):null;return c.jsxs("li",K({},f.liProps,{className:p?"active":"",children:[x&&V.isValidElement(x)&&x,!x&&!f.buttonProps&&f.icon,!x&&f.buttonProps&&V.createElement("button",K({type:"button",key:h,disabled:b,"data-name":f.name},f.buttonProps,{onClick:C=>{C.stopPropagation(),d(f,f.groupName)}}),f.icon),f.children&&c.jsx(SN,{overflow:n,groupName:f.groupName,prefixCls:t,children:m,commands:Array.isArray(f.children)?f.children:void 0})]}),h)})})}function g2(e){e===void 0&&(e={});var{prefixCls:t,isChild:n,className:r}=e,{commands:o,extraCommands:i}=V.useContext(_s);return c.jsxs("div",{className:t+"-toolbar "+r,children:[c.jsx(Dg,K({},e,{commands:e.commands||o||[]})),!n&&c.jsx(Dg,K({},e,{commands:i||[]}))]})}function Ig(e){var{hideToolbar:t,toolbarBottom:n,placement:r,overflow:o,prefixCls:i}=e;if(t||r==="bottom"&&!n||r==="top"&&n)return null;var s=n?"bottom":"";return c.jsx(g2,{prefixCls:i,overflow:o,className:s})}var kN=e=>{var{prefixCls:t,onChange:n}=e||{},r=V.useRef(null),o=V.useRef(),i=V.useRef(e.height);V.useEffect(()=>{i.current!==e.height&&(i.current=e.height)},[e.height]);function s(d){if(o.current){var f,h=d.clientY||((f=d.changedTouches[0])==null?void 0:f.clientY),p=o.current.height+h-o.current.dragY;p>=e.minHeight&&p<=e.maxHeight&&n&&n(o.current.height+(h-o.current.dragY))}}function a(){var d,f;o.current=void 0,document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",a),(d=r.current)==null||d.removeEventListener("touchmove",s),(f=r.current)==null||f.removeEventListener("touchend",a)}function l(d){var f,h,p;d.preventDefault();var m=d.clientY||((f=d.changedTouches[0])==null?void 0:f.clientY);o.current={height:i.current,dragY:m},document.addEventListener("mousemove",s),document.addEventListener("mouseup",a),(h=r.current)==null||h.addEventListener("touchmove",s,{passive:!1}),(p=r.current)==null||p.addEventListener("touchend",a,{passive:!1})}V.useEffect(()=>{if(document){var d,f;(d=r.current)==null||d.addEventListener("touchstart",l,{passive:!1}),(f=r.current)==null||f.addEventListener("mousedown",l)}return()=>{if(document){var h;(h=r.current)==null||h.removeEventListener("touchstart",l),document.removeEventListener("mousemove",s)}}},[]);var u=V.useMemo(()=>c.jsx("svg",{viewBox:"0 0 512 512",height:"100%",children:c.jsx("path",{fill:"currentColor",d:"M304 256c0 26.5-21.5 48-48 48s-48-21.5-48-48 21.5-48 48-48 48 21.5 48 48zm120-48c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48zm-336 0c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48z"})}),[]);return c.jsx("div",{className:t+"-bar",ref:r,children:u})},wN=["prefixCls","className","value","commands","commandsFilter","direction","extraCommands","height","enableScroll","visibleDragbar","highlightEnable","preview","fullscreen","overflow","previewOptions","textareaProps","maxHeight","minHeight","autoFocus","autoFocusEnd","tabSize","defaultTabEnable","onChange","onStatistics","onHeightChange","hideToolbar","toolbarBottom","components","renderTextarea"];function DN(e){return e===void 0&&(e={}),Object.keys(e).forEach(t=>{e[t]=!1}),e}var IN=V.forwardRef((e,t)=>{var n=e||{},{prefixCls:r="w-md-editor",className:o,value:i,commands:s=gN(),commandsFilter:a,direction:l,extraCommands:u=bN(),height:d=200,enableScroll:f=!0,visibleDragbar:h=typeof e.visiableDragbar=="boolean"?e.visiableDragbar:!0,highlightEnable:p=!0,preview:m="live",fullscreen:b=!1,overflow:y=!0,previewOptions:x={},textareaProps:C,maxHeight:v=1200,minHeight:k=100,autoFocus:I,autoFocusEnd:T=!1,tabSize:N=2,defaultTabEnable:L=!1,onChange:_,onStatistics:B,onHeightChange:H,hideToolbar:S,toolbarBottom:j=!1,components:M,renderTextarea:P}=n,$=et(n,wN),W=s.map(Se=>a?a(Se,!1):Se).filter(Boolean),G=u.map(Se=>a?a(Se,!0):Se).filter(Boolean),[Y,F]=V.useReducer(_R,{markdown:i,preview:m,components:M,height:d,minHeight:k,highlightEnable:p,tabSize:N,defaultTabEnable:L,scrollTop:0,scrollTopPreview:0,commands:W,extraCommands:G,fullscreen:b,barPopup:{}}),Z=V.useRef(null),se=V.useRef(null),z=V.useRef(f);V.useImperativeHandle(t,()=>K({},Y,{container:Z.current,dispatch:F})),V.useMemo(()=>z.current=f,[f]),V.useEffect(()=>{var Se={};Z.current&&(Se.container=Z.current||void 0),Se.markdown=i||"",Se.barPopup={},F&&F(K({},Y,Se))},[]);var Ce=[o,"wmde-markdown-var",l?r+"-"+l:null,r,Y.preview?r+"-show-"+Y.preview:null,Y.fullscreen?r+"-fullscreen":null].filter(Boolean).join(" ").trim();V.useMemo(()=>i!==Y.markdown&&F({markdown:i||""}),[i,Y.markdown]),V.useMemo(()=>m!==Y.preview&&F({preview:m}),[m]),V.useMemo(()=>N!==Y.tabSize&&F({tabSize:N}),[N]),V.useMemo(()=>p!==Y.highlightEnable&&F({highlightEnable:p}),[p]),V.useMemo(()=>I!==Y.autoFocus&&F({autoFocus:I}),[I]),V.useMemo(()=>T!==Y.autoFocusEnd&&F({autoFocusEnd:T}),[T]),V.useMemo(()=>b!==Y.fullscreen&&F({fullscreen:b}),[b]),V.useMemo(()=>d!==Y.height&&F({height:d}),[d]),V.useMemo(()=>d!==Y.height&&H&&H(Y.height,d,Y),[d,H,Y]),V.useMemo(()=>s!==Y.commands&&F({commands:W}),[e.commands]),V.useMemo(()=>u!==Y.extraCommands&&F({extraCommands:G}),[e.extraCommands]);var ae=V.useRef(),Q=V.useRef("preview"),re=V.useRef(!1);V.useMemo(()=>{ae.current=Y.textareaWarp,Y.textareaWarp&&(Y.textareaWarp.addEventListener("mouseover",()=>{Q.current="text"}),Y.textareaWarp.addEventListener("mouseleave",()=>{Q.current="preview"}))},[Y.textareaWarp]);var ne=(Se,pe)=>{if(z.current){var $e=ae.current,Pe=se.current?se.current:void 0;if(re.current||(Q.current=pe,re.current=!0),$e&&Pe){var Je=($e.scrollHeight-$e.offsetHeight)/(Pe.scrollHeight-Pe.offsetHeight);Se.target===$e&&Q.current==="text"&&(Pe.scrollTop=$e.scrollTop/Je),Se.target===Pe&&Q.current==="preview"&&($e.scrollTop=Pe.scrollTop*Je);var Me=0;Q.current==="text"?Me=$e.scrollTop||0:Q.current==="preview"&&(Me=Pe.scrollTop||0),F({scrollTop:Me})}}},le=r+"-preview "+(x.className||""),ie=Se=>ne(Se,"preview"),J=V.useMemo(()=>c.jsx("div",{ref:se,className:le,children:c.jsx(u2,K({},x,{onScroll:ie,source:Y.markdown||""}))}),[le,x,Y.markdown]),be=M?.preview&&M?.preview(Y.markdown||"",Y,F);be&&V.isValidElement(be)&&(J=c.jsx("div",{className:le,ref:se,onScroll:ie,children:be}));var ue=K({},$.style,{height:Y.height||"100%"}),oe=()=>F({barPopup:K({},DN(Y.barPopup))}),ve=Se=>F({height:Se}),xe=Se=>{if(_&&_(Se.target.value,Se,Y),C&&C.onChange&&C.onChange(Se),Y.textarea&&Y.textarea instanceof HTMLTextAreaElement&&B){var pe=new Lp(Y.textarea),$e=pe.getState()||{};B(K({},$e,{lineCount:Se.target.value.split(`
92
- `).length,length:Se.target.value.length}))}};return c.jsx(_s.Provider,{value:K({},Y,{dispatch:F}),children:c.jsxs("div",K({ref:Z,className:Ce},$,{onClick:oe,style:ue,children:[c.jsx(Ig,{hideToolbar:S,toolbarBottom:j,prefixCls:r,overflow:y,placement:"top"}),c.jsxs("div",{className:r+"-content",children:[/(edit|live)/.test(Y.preview||"")&&c.jsx(TN,K({className:r+"-input",prefixCls:r,autoFocus:I},C,{onChange:xe,renderTextarea:M?.textarea||P,onScroll:Se=>ne(Se,"text")})),/(live|preview)/.test(Y.preview||"")&&J]}),h&&!Y.fullscreen&&c.jsx(kN,{prefixCls:r,height:Y.height,maxHeight:v,minHeight:k,onChange:ve}),c.jsx(Ig,{hideToolbar:S,toolbarBottom:j,prefixCls:r,overflow:y,placement:"bottom"})]}))})}),b2=IN;b2.Markdown=u2;const $d={scopeName:"source.malloy",patterns:[{include:"#malloy-language"}],repository:{"malloy-language":{patterns:[{include:"#sql-string"},{include:"#comments"},{include:"#tags"},{include:"#strings"},{include:"#numbers"},{include:"#keywords"},{include:"#properties"},{include:"#functions"},{include:"#datetimes"},{include:"#identifiers-quoted"},{include:"#types"},{include:"#constants"},{include:"#timeframes"},{include:"#identifiers-unquoted"}]},"malloy-matched":{begin:"{",end:"}",patterns:[{include:"#malloy-matched"},{include:"#malloy-language"}]},"malloy-in-sql":{begin:"%{",name:"source.malloy-in-sql",end:"}%?",patterns:[{include:"#malloy-matched"},{include:"#malloy-language"}]},"sql-string":{patterns:[{begin:'(\\b[A-Za-z_][A-Za-z_0-9]*)(\\s*\\.\\s*)(sql)(\\s*\\(\\s*)(""")',end:'"""',beginCaptures:{1:{name:"variable.other"},3:{name:"keyword.control.sql"},5:{name:"punctuation.sql-block.open"}},endCaptures:{0:{name:"punctuation.sql-block.close"}},name:"source.sql",patterns:[{include:"#malloy-in-sql"},{include:"source.sql"}]}]},functions:{patterns:[{match:"(?i)\\b(count)(\\s*\\()(distinct)",captures:{1:{name:"entity.name.function"},3:{name:"entity.name.function.modifier"}}},{match:"(?i)\\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE|UNGROUPED)(\\s*\\()",captures:{1:{name:"entity.name.function"}}},{match:"(?i)\\b([a-zA-Z_][a-zA-Z_0-9]*)(\\s*\\()",captures:{1:{name:"entity.name.function"}}},{match:"(?i)\\b([a-zA-Z_][a-zA-Z_0-9]*)(!)(timestamp|number|string|boolean|date)?(\\s*\\()",captures:{1:{name:"entity.name.function"},3:{name:"entity.name.type"}}}]},datetimes:{patterns:[{match:"(?i)@[0-9]{4}-[0-9]{2}-[0-9]{2}[ T][0-9]{2}:[0-9]{2}((:[0-9]{2})(([\\.,][0-9]+)(\\[[A-Za-z_/]+\\])?)?)?",name:"constant.numeric.timestamp"},{match:"(?i)@[0-9]{4}(-Q[1-4]|-[0-9]{2}(-[0-9]{2}(-WK)?)?)?",name:"constant.numeric.date"}]},"identifiers-quoted":{patterns:[{match:"`[^`]*`",name:"variable.other.quoted"}]},"identifiers-unquoted":{patterns:[{match:"(?i)\\b[A-Za-z_][A-Za-z_0-9]*\\b",name:"variable.other"}]},timeframes:{patterns:[{match:"(?i)\\b((year|quarter|month|week|day|hour|minute|second)s?)\\b",name:"keyword.other.timeframe"},{match:"(?i)\\b(day_of_year|day_of_month)\\b",name:"keyword.other.timeframe"}]},comments:{patterns:[{begin:"/\\*",end:"\\*/",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"comment.block"},{begin:"//",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-slash"},{begin:"--",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-hyphen"}]},tags:{patterns:[{match:"##\\n",name:"string.quoted",captures:{0:{name:"string.quoted"}}},{begin:'#"',end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-slash"},{match:"#\\n",name:"string.quoted",captures:{0:{name:"string.quoted"}}},{begin:"#\\s",end:"\\n",beginCaptures:{0:{name:"support.type.property-name.json"}},name:"comment.line.double-slash",patterns:[{include:"#tag-values"}]},{begin:"##\\s",end:"\\n",beginCaptures:{0:{name:"support.type.property-name.json"}},name:"comment.line.double-slash",patterns:[{include:"#tag-values"}]},{begin:"#",end:"\\n",beginCaptures:{0:{name:"string.quoted"}},name:"string.quoted"}],repository:{"tag-values":{name:"support.type.property-name.json",match:'(-)?((?:[^\\s=#]+)|(?:"[^#]+"))(?:\\s*(=)\\s*((?:[^\\s=#]+)|(?:"[^#]+")))?',captures:{1:{name:"keyword.control.negate"},2:{name:"support.type.property-name.json"},3:{name:"keyword.operator.comparison.ts"},4:{name:"string.quoted"}}}}},strings:{patterns:[{begin:"'",end:"'",beginCaptures:{0:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},name:"string.quoted.single",patterns:[{include:"#escapes"}]},{begin:'"',end:'"',beginCaptures:{0:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},name:"string.quoted.double",patterns:[{include:"#escapes"}]},{begin:'"""',end:'"""',beginCaptures:{0:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},name:"string.quoted.triple"},{begin:"(?i)[r|/]'",end:"'",name:"string.regexp",patterns:[{include:"#regex-escapes"}]}],repository:{escapes:{name:"constant.character.escape",match:"\\\\(u[A-Fa-f0-9]{4}|.)",captures:{0:{name:"constant.character.escape"}}},"regex-escapes":{name:"constant.character.escape",match:"\\\\.",captures:{0:{name:"constant.character.escape"}}}}},numbers:{match:"(?i)(\\b((0|[1-9][0-9]*)(E[+-]?[0-9]+|\\.[0-9]*)?)|\\.[0-9]+)",name:"constant.numeric"},constants:{patterns:[{match:"(?i)\\bnull\\b",name:"constant.language.null"},{match:"(?i)\\btrue\\b",name:"constant.language.true"},{match:"(?i)\\bfalse\\b",name:"constant.language.false"}]},types:{patterns:[{match:"(?i)\\bstring\\b",name:"entity.name.type.string"},{match:"(?i)\\bnumber\\b",name:"entity.name.type.number"},{match:"(?i)\\bdate\\b",name:"entity.name.type.date"},{match:"(?i)\\btimestamp\\b",name:"entity.name.type.timestamp"},{match:"(?i)\\bboolean\\b",name:"entity.name.type.boolean"}]},properties:{patterns:[{match:"(?i)\\baccept\\b",name:"keyword.control.accept"},{match:"(?i)\\bselect\\b",name:"keyword.control.select"},{match:"(?i)\\bconnection\\b",name:"keyword.control.connection"},{match:"(?i)\\brun\\b",name:"keyword.control.run"},{match:"(?i)\\bextend\\b",name:"keyword.control.extend"},{match:"(?i)\\brefine\\b",name:"keyword.control.refine"},{match:"(?i)\\baggregate\\b",name:"keyword.control.aggregate"},{match:"(?i)\\bsample\\b",name:"keyword.control.sample"},{match:"(?i)\\bcalculate\\b",name:"keyword.control.calculate"},{match:"(?i)\\btimezone\\b",name:"keyword.control.timezone"},{match:"(?i)\\bdimension\\b",name:"keyword.control.dimension"},{match:"(?i)\\bexcept\\b",name:"keyword.control.except"},{match:"(?i)\\bsource\\b",name:"keyword.control.source"},{match:"(?i)\\bgroup_by\\b",name:"keyword.control.group_by"},{match:"(?i)\\bhaving\\b",name:"keyword.control.having"},{match:"(?i)\\bindex\\b",name:"keyword.control.index"},{match:"(?i)\\bjoin_one\\b",name:"keyword.control.join_one"},{match:"(?i)\\bwith\\b",name:"keyword.control.with"},{match:"(?i)\\bjoin_many\\b",name:"keyword.control.join_many"},{match:"(?i)\\bjoin_cross\\b",name:"keyword.control.join_cross"},{match:"(?i)\\blimit\\b",name:"keyword.control.limit"},{match:"(?i)\\bmeasure\\b",name:"keyword.control.measure"},{match:"(?i)\\bnest\\b",name:"keyword.control.nest"},{match:"(?i)\\border_by\\b",name:"keyword.control.order_by"},{match:"(?i)\\bpartition_by\\b",name:"keyword.control.partition_by"},{match:"(?i)\\bprimary_key\\b",name:"keyword.control.primary_key"},{match:"(?i)\\bproject\\b",name:"keyword.control.project"},{match:"(?i)\\bquery\\b",name:"keyword.control.query"},{match:"(?i)\\brename\\b",name:"keyword.control.rename"},{match:"(?i)\\btop\\b",name:"keyword.control.top"},{match:"(?i)\\bview\\b",name:"keyword.control.view"},{match:"(?i)\\bwhere\\b",name:"keyword.control.where"},{match:"(?i)\\bdeclare\\b",name:"keyword.control.declare"}]},keywords:{patterns:[{match:"(?i)\\bis\\b",name:"keyword.control.is"},{match:"(?i)\\bon\\b",name:"keyword.control.on"},{match:"(?i)\\bnot\\b",name:"keyword.other.not"},{match:"(?i)\\bor\\b",name:"keyword.other.or"},{match:"(?i)\\bdesc\\b",name:"keyword.control.desc"},{match:"(?i)\\bby\\b",name:"keyword.control.by"},{match:"(?i)\\band\\b",name:"keyword.other.and"},{match:"(?i)\\basc\\b",name:"keyword.control.asc"},{match:"(?i)\\bfor\\b",name:"keyword.other.for"},{match:"(?i)\\belse\\b",name:"keyword.other.else"},{match:"(?i)\\bto\\b",name:"keyword.other.to"},{match:"(?i)\\bwhen\\b",name:"keyword.other.when"},{match:"(?i)\\bpick\\b",name:"keyword.other.pick"},{match:"(?i)\\bimport\\b",name:"keyword.control.import"}]}}},AN={...$d,patterns:[...$d.patterns,{include:"#docvar"}],repository:{...$d.repository,docvar:{patterns:[{match:"\\<\\<[^(\\>\\>)]*\\>\\>",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"markup.italic.markdown"}]}}},ON={name:"Malloy SQL",scopeName:"source.malloy-sql",patterns:[{include:"#malloysql-sql"}],repository:{"malloysql-sql":{beginCaptures:{0:{name:"entity.other.attribute.malloy-sql"},1:{name:"entity.other.attribute.malloy-sql"},3:{name:"comment.line.double-slash"}},name:"meta.embedded.block.malloysql.sql",patterns:[{include:"#comments"},{begin:"%{",end:"}%",beginCaptures:{0:{name:"punctuation.definition.malloy-sql"}},endCaptures:{0:{name:"punctuation.definition.malloy-sql"}},name:"meta.embedded.block.malloy",patterns:[{include:"source.malloy"}]},{include:"source.sql"}]},comments:{patterns:[{begin:"/\\*",end:"\\*/",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"comment.block"},{begin:"//",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-slash"},{begin:"--",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-hyphen"}]}}},MN="github-light",PN="github-dark";let Hd;function RN(){return Hd||(Hd=(async()=>{const[{createHighlighterCore:e},{createOnigurumaEngine:t},{default:n},{default:r},{default:o},{default:i},{default:s}]=await Promise.all([Promise.resolve().then(()=>require("./core-CVXEUnnm.cjs.js")),Promise.resolve().then(()=>require("./engine-oniguruma-BkproSVE.cjs.js")),Promise.resolve().then(()=>require("./sql-BqWZrLHB.cjs.js")),Promise.resolve().then(()=>require("./json-y-J1j5EW.cjs.js")),Promise.resolve().then(()=>require("./typescript-BqvpT6pB.cjs.js")),Promise.resolve().then(()=>require("./github-light-BFTOhCbz.cjs.js")),Promise.resolve().then(()=>require("./github-dark-BKL9xNgN.cjs.js"))]);return e({engine:t(Promise.resolve().then(()=>require("./wasm-Dw4u1m6u.cjs.js"))),themes:[i,s],langs:[n,r,o,{name:"malloy",scopeName:"source.malloy",embeddedLangs:["sql"],...AN},{name:"malloysql",scopeName:"source.malloy-sql",embeddedLangs:["sql"],...ON}]})})()),Hd}async function Gu(e,t,n="light"){return(await RN()).codeToHtml(e,{lang:t,theme:n==="dark"?PN:MN})}function zt(e){const{server:t}=Ie.useServer(),n={...e,queryKey:[...e.queryKey,t],queryFn:async()=>{try{return await e.queryFn()}catch(r){if(r&&typeof r=="object"&&"response"in r){const o=r;if(o.response?.data){const i=new Error(o.response.data.message||o.message);throw i.status=o.response.status,i.data=o.response.data,i}}throw r}},retry:!1,throwOnError:!1};return Tr.useQuery(n,Ie.globalQueryClient)}function Sn(e){const t={...e,mutationFn:async n=>{try{return await e.mutationFn(n)}catch(r){if(r&&typeof r=="object"&&"response"in r){const o=r;if(o.response?.data){const i=new Error(o.response.data.message||o.message);throw i.status=o.response.status,i.data=o.response.data,i}}throw r}},retry:!1,throwOnError:!1};return Tr.useMutation(t,Ie.globalQueryClient)}const jt=e=>{const t=new URL(e),n={};if(t.protocol!=="publisher:")throw new Error(`Failed to parse resource URI: ${e}`);const r=(t.hostname+t.pathname).split("/");for(let o=0;o<r.length;o+=2){const i=r[o];i==="environments"?n.environmentName=decodeURI(r[o+1])||void 0:i==="packages"?n.packageName=decodeURI(r[o+1])||void 0:i==="connections"?n.connectionName=decodeURI(r[o+1])||void 0:i==="models"&&(n.modelPath=decodeURI(r.slice(o+1).join("/"))||void 0)}if(n.versionId=t.searchParams.get("versionId")||void 0,!n.environmentName)throw new Error(`Failed to parse resource URI: ${e}`);return n},Il=e=>{if(!e.environmentName)throw new Error(`Failed to encode resource URI, missing environment name: ${e}`);let t=`publisher://environments/${e.environmentName}`;return e.packageName&&(t+=`/packages/${e.packageName}`),e.connectionName&&(t+=`/connections/${e.connectionName}`),e.modelPath&&(t+=`/models/${e.modelPath}`),e.packageName&&e.versionId&&(t+=`?versionId=${e.versionId}`),t};function _p({sourceAndPaths:e,selectedSourceIndex:t,existingQuery:n,onQueryChange:r,onSourceChange:o,resourceUri:i}){return V.useEffect(()=>{o&&o(t)},[t,o]),c.jsx(Ie.StyledCardMedia,{children:c.jsxs(Ot.Stack,{spacing:2,component:"section",children:[c.jsx(y2,{sourceAndPath:e[t],existingQuery:n,onChange:s=>{r&&r(s)},resourceUri:i}),c.jsx(Ot.Box,{height:"5px"})]})})}function Eu(){return{query:void 0,malloyQuery:void 0,malloyResult:void 0}}function NN({sourceAndPath:e,onChange:t,existingQuery:n,explorerComponents:r,QueryBuilder:o,resourceUri:i}){const[s,a]=V.useState(n||Eu()),[l,u]=V.useState(void 0);V.useEffect(()=>{n&&a(n)},[n]);const[d,f]=V.useState([]),{MalloyExplorerProvider:h,QueryPanel:p,ResizableCollapsiblePanel:m,ResultPanel:b,SourcePanel:y}=r;V.useEffect(()=>{t&&t(s)},[t,s]);const{environmentName:x,packageName:C,versionId:v}=jt(i),{apiClients:k}=Ie.useServer(),I=Sn({mutationFn:()=>{const _=typeof s?.malloyQuery=="string"?s.malloyQuery:new o.ASTQuery({source:e.sourceInfo,query:s?.malloyQuery}).toMalloy();return u({executionState:"running",query:s?.malloyQuery,queryResolutionStartMillis:Date.now(),onCancel:()=>{I.reset(),u(void 0)},response:{result:{}}}),a({...s,query:_}),k.models.executeQueryModel(x,C,e.modelPath,{query:_,sourceName:void 0,queryName:void 0,versionId:v})},onSuccess:_=>{if(_){const B=JSON.parse(_.data.result);a({...s,malloyResult:B}),u(H=>H?{...H,executionState:"finished",response:{result:B}}:void 0)}},onError:_=>{u(void 0),console.error("Query execution error:",_)}}),[T,N]=V.useState(e.sourceInfo.name);V.useEffect(()=>{T!==e.sourceInfo.name&&(N(e.sourceInfo.name),a(Eu()),u(void 0))},[e,T]);const L=V.useCallback(_=>{a({...s,malloyQuery:_,malloyResult:void 0})},[s]);return T!==e.sourceInfo.name?c.jsx("div",{children:"Loading..."}):c.jsx(Ie.StyledExplorerContent,{sx:{border:"1px solid #e0e0e0",borderRadius:"8px",overflow:"hidden"},children:c.jsx(h,{source:e.sourceInfo,query:s?.malloyQuery,topValues:[],onFocusedNestViewPathChange:f,focusedNestViewPath:d,onQueryChange:L,children:c.jsxs("div",{style:{display:"flex",height:"100%",overflowY:"auto"},children:[c.jsx(m,{isInitiallyExpanded:!0,initialWidth:180,minWidth:180,icon:"database",title:e.sourceInfo.name,children:c.jsx(y,{onRefresh:()=>a(Eu())})}),c.jsx(m,{isInitiallyExpanded:!0,initialWidth:280,minWidth:280,icon:"filterSliders",title:"Query",children:c.jsx(p,{runQuery:()=>{console.log(`running query with: ${s?.malloyQuery}`);try{I.mutate()}catch(_){console.error("Error running query:",_)}}})}),c.jsx(b,{source:e.sourceInfo,draftQuery:s?.malloyQuery,setDraftQuery:_=>a({...s,malloyQuery:_}),submittedQuery:l,options:{showRawQuery:!0}})]})})},e.sourceInfo.name)}function y2(e){const[t,n]=V.useState(null),[r,o]=V.useState(null),[i,s]=V.useState(!0);return V.useEffect(()=>{let a=!0;return Promise.all([import("@malloydata/malloy-explorer"),import("@malloydata/malloy-query-builder")]).then(([l,u])=>{a&&(n(l),o(u),s(!1))}).catch(l=>{console.error("Failed to load Malloy components:",l),a&&s(!1)}),()=>{a=!1}},[]),i||!t||!r?c.jsx(Ie.StyledExplorerPage,{children:c.jsx(Ie.StyledExplorerContent,{children:c.jsx(Ot.Box,{sx:{alignItems:"center",justifyContent:"center",height:"200px",color:"text.secondary"},children:"Loading explorer..."})})}):c.jsx(NN,{...e,explorerComponents:t,QueryBuilder:r,resourceUri:e.resourceUri})}const x2=gt(c.jsx("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}));function xn({text:e,size:t=20,color:n="primary",thickness:r=3.6,centered:o=!0,spacing:i=2,textVariant:s="body2"}){const a=c.jsxs(w.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:i},children:[c.jsx(w.CircularProgress,{size:t,color:n,thickness:r}),e&&c.jsx(w.Typography,{variant:s,color:"text.secondary",children:e})]});return o?c.jsx(w.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"200px",width:"100%"},children:a}):a}const FN=new Set(["warn","error"]);function LN(e){if(!e?.length)return;const t=[];let n=!1;for(const r of e)!r.message||!FN.has(r.severity??"")||(r.severity==="error"&&(n=!0),t.includes(r.message)||t.push(r.message));if(t.length)return{severity:n?"error":"warn",title:t.join(`
92
+ `).length,length:Se.target.value.length}))}};return c.jsx(_s.Provider,{value:K({},Y,{dispatch:F}),children:c.jsxs("div",K({ref:Z,className:Ce},$,{onClick:oe,style:ue,children:[c.jsx(Ig,{hideToolbar:S,toolbarBottom:j,prefixCls:r,overflow:y,placement:"top"}),c.jsxs("div",{className:r+"-content",children:[/(edit|live)/.test(Y.preview||"")&&c.jsx(TN,K({className:r+"-input",prefixCls:r,autoFocus:I},C,{onChange:xe,renderTextarea:M?.textarea||P,onScroll:Se=>ne(Se,"text")})),/(live|preview)/.test(Y.preview||"")&&J]}),h&&!Y.fullscreen&&c.jsx(kN,{prefixCls:r,height:Y.height,maxHeight:v,minHeight:k,onChange:ve}),c.jsx(Ig,{hideToolbar:S,toolbarBottom:j,prefixCls:r,overflow:y,placement:"bottom"})]}))})}),b2=IN;b2.Markdown=u2;const $d={scopeName:"source.malloy",patterns:[{include:"#malloy-language"}],repository:{"malloy-language":{patterns:[{include:"#sql-string"},{include:"#comments"},{include:"#tags"},{include:"#strings"},{include:"#numbers"},{include:"#keywords"},{include:"#properties"},{include:"#functions"},{include:"#datetimes"},{include:"#identifiers-quoted"},{include:"#types"},{include:"#constants"},{include:"#timeframes"},{include:"#identifiers-unquoted"}]},"malloy-matched":{begin:"{",end:"}",patterns:[{include:"#malloy-matched"},{include:"#malloy-language"}]},"malloy-in-sql":{begin:"%{",name:"source.malloy-in-sql",end:"}%?",patterns:[{include:"#malloy-matched"},{include:"#malloy-language"}]},"sql-string":{patterns:[{begin:'(\\b[A-Za-z_][A-Za-z_0-9]*)(\\s*\\.\\s*)(sql)(\\s*\\(\\s*)(""")',end:'"""',beginCaptures:{1:{name:"variable.other"},3:{name:"keyword.control.sql"},5:{name:"punctuation.sql-block.open"}},endCaptures:{0:{name:"punctuation.sql-block.close"}},name:"source.sql",patterns:[{include:"#malloy-in-sql"},{include:"source.sql"}]}]},functions:{patterns:[{match:"(?i)\\b(count)(\\s*\\()(distinct)",captures:{1:{name:"entity.name.function"},3:{name:"entity.name.function.modifier"}}},{match:"(?i)\\b(AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE|UNGROUPED)(\\s*\\()",captures:{1:{name:"entity.name.function"}}},{match:"(?i)\\b([a-zA-Z_][a-zA-Z_0-9]*)(\\s*\\()",captures:{1:{name:"entity.name.function"}}},{match:"(?i)\\b([a-zA-Z_][a-zA-Z_0-9]*)(!)(timestamp|number|string|boolean|date)?(\\s*\\()",captures:{1:{name:"entity.name.function"},3:{name:"entity.name.type"}}}]},datetimes:{patterns:[{match:"(?i)@[0-9]{4}-[0-9]{2}-[0-9]{2}[ T][0-9]{2}:[0-9]{2}((:[0-9]{2})(([\\.,][0-9]+)(\\[[A-Za-z_/]+\\])?)?)?",name:"constant.numeric.timestamp"},{match:"(?i)@[0-9]{4}(-Q[1-4]|-[0-9]{2}(-[0-9]{2}(-WK)?)?)?",name:"constant.numeric.date"}]},"identifiers-quoted":{patterns:[{match:"`[^`]*`",name:"variable.other.quoted"}]},"identifiers-unquoted":{patterns:[{match:"(?i)\\b[A-Za-z_][A-Za-z_0-9]*\\b",name:"variable.other"}]},timeframes:{patterns:[{match:"(?i)\\b((year|quarter|month|week|day|hour|minute|second)s?)\\b",name:"keyword.other.timeframe"},{match:"(?i)\\b(day_of_year|day_of_month)\\b",name:"keyword.other.timeframe"}]},comments:{patterns:[{begin:"/\\*",end:"\\*/",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"comment.block"},{begin:"//",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-slash"},{begin:"--",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-hyphen"}]},tags:{patterns:[{match:"##\\n",name:"string.quoted",captures:{0:{name:"string.quoted"}}},{begin:'#"',end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-slash"},{match:"#\\n",name:"string.quoted",captures:{0:{name:"string.quoted"}}},{begin:"#\\s",end:"\\n",beginCaptures:{0:{name:"support.type.property-name.json"}},name:"comment.line.double-slash",patterns:[{include:"#tag-values"}]},{begin:"##\\s",end:"\\n",beginCaptures:{0:{name:"support.type.property-name.json"}},name:"comment.line.double-slash",patterns:[{include:"#tag-values"}]},{begin:"#",end:"\\n",beginCaptures:{0:{name:"string.quoted"}},name:"string.quoted"}],repository:{"tag-values":{name:"support.type.property-name.json",match:'(-)?((?:[^\\s=#]+)|(?:"[^#]+"))(?:\\s*(=)\\s*((?:[^\\s=#]+)|(?:"[^#]+")))?',captures:{1:{name:"keyword.control.negate"},2:{name:"support.type.property-name.json"},3:{name:"keyword.operator.comparison.ts"},4:{name:"string.quoted"}}}}},strings:{patterns:[{begin:"'",end:"'",beginCaptures:{0:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},name:"string.quoted.single",patterns:[{include:"#escapes"}]},{begin:'"',end:'"',beginCaptures:{0:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},name:"string.quoted.double",patterns:[{include:"#escapes"}]},{begin:'"""',end:'"""',beginCaptures:{0:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},name:"string.quoted.triple"},{begin:"(?i)[r|/]'",end:"'",name:"string.regexp",patterns:[{include:"#regex-escapes"}]}],repository:{escapes:{name:"constant.character.escape",match:"\\\\(u[A-Fa-f0-9]{4}|.)",captures:{0:{name:"constant.character.escape"}}},"regex-escapes":{name:"constant.character.escape",match:"\\\\.",captures:{0:{name:"constant.character.escape"}}}}},numbers:{match:"(?i)(\\b((0|[1-9][0-9]*)(E[+-]?[0-9]+|\\.[0-9]*)?)|\\.[0-9]+)",name:"constant.numeric"},constants:{patterns:[{match:"(?i)\\bnull\\b",name:"constant.language.null"},{match:"(?i)\\btrue\\b",name:"constant.language.true"},{match:"(?i)\\bfalse\\b",name:"constant.language.false"}]},types:{patterns:[{match:"(?i)\\bstring\\b",name:"entity.name.type.string"},{match:"(?i)\\bnumber\\b",name:"entity.name.type.number"},{match:"(?i)\\bdate\\b",name:"entity.name.type.date"},{match:"(?i)\\btimestamp\\b",name:"entity.name.type.timestamp"},{match:"(?i)\\bboolean\\b",name:"entity.name.type.boolean"}]},properties:{patterns:[{match:"(?i)\\baccept\\b",name:"keyword.control.accept"},{match:"(?i)\\bselect\\b",name:"keyword.control.select"},{match:"(?i)\\bconnection\\b",name:"keyword.control.connection"},{match:"(?i)\\brun\\b",name:"keyword.control.run"},{match:"(?i)\\bextend\\b",name:"keyword.control.extend"},{match:"(?i)\\brefine\\b",name:"keyword.control.refine"},{match:"(?i)\\baggregate\\b",name:"keyword.control.aggregate"},{match:"(?i)\\bsample\\b",name:"keyword.control.sample"},{match:"(?i)\\bcalculate\\b",name:"keyword.control.calculate"},{match:"(?i)\\btimezone\\b",name:"keyword.control.timezone"},{match:"(?i)\\bdimension\\b",name:"keyword.control.dimension"},{match:"(?i)\\bexcept\\b",name:"keyword.control.except"},{match:"(?i)\\bsource\\b",name:"keyword.control.source"},{match:"(?i)\\bgroup_by\\b",name:"keyword.control.group_by"},{match:"(?i)\\bhaving\\b",name:"keyword.control.having"},{match:"(?i)\\bindex\\b",name:"keyword.control.index"},{match:"(?i)\\bjoin_one\\b",name:"keyword.control.join_one"},{match:"(?i)\\bwith\\b",name:"keyword.control.with"},{match:"(?i)\\bjoin_many\\b",name:"keyword.control.join_many"},{match:"(?i)\\bjoin_cross\\b",name:"keyword.control.join_cross"},{match:"(?i)\\blimit\\b",name:"keyword.control.limit"},{match:"(?i)\\bmeasure\\b",name:"keyword.control.measure"},{match:"(?i)\\bnest\\b",name:"keyword.control.nest"},{match:"(?i)\\border_by\\b",name:"keyword.control.order_by"},{match:"(?i)\\bpartition_by\\b",name:"keyword.control.partition_by"},{match:"(?i)\\bprimary_key\\b",name:"keyword.control.primary_key"},{match:"(?i)\\bproject\\b",name:"keyword.control.project"},{match:"(?i)\\bquery\\b",name:"keyword.control.query"},{match:"(?i)\\brename\\b",name:"keyword.control.rename"},{match:"(?i)\\btop\\b",name:"keyword.control.top"},{match:"(?i)\\bview\\b",name:"keyword.control.view"},{match:"(?i)\\bwhere\\b",name:"keyword.control.where"},{match:"(?i)\\bdeclare\\b",name:"keyword.control.declare"}]},keywords:{patterns:[{match:"(?i)\\bis\\b",name:"keyword.control.is"},{match:"(?i)\\bon\\b",name:"keyword.control.on"},{match:"(?i)\\bnot\\b",name:"keyword.other.not"},{match:"(?i)\\bor\\b",name:"keyword.other.or"},{match:"(?i)\\bdesc\\b",name:"keyword.control.desc"},{match:"(?i)\\bby\\b",name:"keyword.control.by"},{match:"(?i)\\band\\b",name:"keyword.other.and"},{match:"(?i)\\basc\\b",name:"keyword.control.asc"},{match:"(?i)\\bfor\\b",name:"keyword.other.for"},{match:"(?i)\\belse\\b",name:"keyword.other.else"},{match:"(?i)\\bto\\b",name:"keyword.other.to"},{match:"(?i)\\bwhen\\b",name:"keyword.other.when"},{match:"(?i)\\bpick\\b",name:"keyword.other.pick"},{match:"(?i)\\bimport\\b",name:"keyword.control.import"}]}}},AN={...$d,patterns:[...$d.patterns,{include:"#docvar"}],repository:{...$d.repository,docvar:{patterns:[{match:"\\<\\<[^(\\>\\>)]*\\>\\>",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"markup.italic.markdown"}]}}},ON={name:"Malloy SQL",scopeName:"source.malloy-sql",patterns:[{include:"#malloysql-sql"}],repository:{"malloysql-sql":{beginCaptures:{0:{name:"entity.other.attribute.malloy-sql"},1:{name:"entity.other.attribute.malloy-sql"},3:{name:"comment.line.double-slash"}},name:"meta.embedded.block.malloysql.sql",patterns:[{include:"#comments"},{begin:"%{",end:"}%",beginCaptures:{0:{name:"punctuation.definition.malloy-sql"}},endCaptures:{0:{name:"punctuation.definition.malloy-sql"}},name:"meta.embedded.block.malloy",patterns:[{include:"source.malloy"}]},{include:"source.sql"}]},comments:{patterns:[{begin:"/\\*",end:"\\*/",beginCaptures:{0:{name:"punctuation.definition.comment.begin"}},endCaptures:{0:{name:"punctuation.definition.comment.end"}},name:"comment.block"},{begin:"//",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-slash"},{begin:"--",end:"\\n",beginCaptures:{0:{name:"punctuation.definition.comment"}},name:"comment.line.double-hyphen"}]}}},MN="github-light",PN="github-dark";let Hd;function RN(){return Hd||(Hd=(async()=>{const[{createHighlighterCore:e},{createOnigurumaEngine:t},{default:n},{default:r},{default:o},{default:i},{default:s}]=await Promise.all([Promise.resolve().then(()=>require("./core-hLahnv0W.cjs.js")),Promise.resolve().then(()=>require("./engine-oniguruma-BkproSVE.cjs.js")),Promise.resolve().then(()=>require("./sql-BqWZrLHB.cjs.js")),Promise.resolve().then(()=>require("./json-y-J1j5EW.cjs.js")),Promise.resolve().then(()=>require("./typescript-BqvpT6pB.cjs.js")),Promise.resolve().then(()=>require("./github-light-BFTOhCbz.cjs.js")),Promise.resolve().then(()=>require("./github-dark-BKL9xNgN.cjs.js"))]);return e({engine:t(Promise.resolve().then(()=>require("./wasm-Dw4u1m6u.cjs.js"))),themes:[i,s],langs:[n,r,o,{name:"malloy",scopeName:"source.malloy",embeddedLangs:["sql"],...AN},{name:"malloysql",scopeName:"source.malloy-sql",embeddedLangs:["sql"],...ON}]})})()),Hd}async function Gu(e,t,n="light"){return(await RN()).codeToHtml(e,{lang:t,theme:n==="dark"?PN:MN})}function zt(e){const{server:t}=Ie.useServer(),n={...e,queryKey:[...e.queryKey,t],queryFn:async()=>{try{return await e.queryFn()}catch(r){if(r&&typeof r=="object"&&"response"in r){const o=r;if(o.response?.data){const i=new Error(o.response.data.message||o.message);throw i.status=o.response.status,i.data=o.response.data,i}}throw r}},retry:!1,throwOnError:!1};return Tr.useQuery(n,Ie.globalQueryClient)}function Sn(e){const t={...e,mutationFn:async n=>{try{return await e.mutationFn(n)}catch(r){if(r&&typeof r=="object"&&"response"in r){const o=r;if(o.response?.data){const i=new Error(o.response.data.message||o.message);throw i.status=o.response.status,i.data=o.response.data,i}}throw r}},retry:!1,throwOnError:!1};return Tr.useMutation(t,Ie.globalQueryClient)}const jt=e=>{const t=new URL(e),n={};if(t.protocol!=="publisher:")throw new Error(`Failed to parse resource URI: ${e}`);const r=(t.hostname+t.pathname).split("/");for(let o=0;o<r.length;o+=2){const i=r[o];i==="environments"?n.environmentName=decodeURI(r[o+1])||void 0:i==="packages"?n.packageName=decodeURI(r[o+1])||void 0:i==="connections"?n.connectionName=decodeURI(r[o+1])||void 0:i==="models"&&(n.modelPath=decodeURI(r.slice(o+1).join("/"))||void 0)}if(n.versionId=t.searchParams.get("versionId")||void 0,!n.environmentName)throw new Error(`Failed to parse resource URI: ${e}`);return n},Il=e=>{if(!e.environmentName)throw new Error(`Failed to encode resource URI, missing environment name: ${e}`);let t=`publisher://environments/${e.environmentName}`;return e.packageName&&(t+=`/packages/${e.packageName}`),e.connectionName&&(t+=`/connections/${e.connectionName}`),e.modelPath&&(t+=`/models/${e.modelPath}`),e.packageName&&e.versionId&&(t+=`?versionId=${e.versionId}`),t};function _p({sourceAndPaths:e,selectedSourceIndex:t,existingQuery:n,onQueryChange:r,onSourceChange:o,resourceUri:i}){return V.useEffect(()=>{o&&o(t)},[t,o]),c.jsx(Ie.StyledCardMedia,{children:c.jsxs(Ot.Stack,{spacing:2,component:"section",children:[c.jsx(y2,{sourceAndPath:e[t],existingQuery:n,onChange:s=>{r&&r(s)},resourceUri:i}),c.jsx(Ot.Box,{height:"5px"})]})})}function Eu(){return{query:void 0,malloyQuery:void 0,malloyResult:void 0}}function NN({sourceAndPath:e,onChange:t,existingQuery:n,explorerComponents:r,QueryBuilder:o,resourceUri:i}){const[s,a]=V.useState(n||Eu()),[l,u]=V.useState(void 0);V.useEffect(()=>{n&&a(n)},[n]);const[d,f]=V.useState([]),{MalloyExplorerProvider:h,QueryPanel:p,ResizableCollapsiblePanel:m,ResultPanel:b,SourcePanel:y}=r;V.useEffect(()=>{t&&t(s)},[t,s]);const{environmentName:x,packageName:C,versionId:v}=jt(i),{apiClients:k}=Ie.useServer(),I=Sn({mutationFn:()=>{const _=typeof s?.malloyQuery=="string"?s.malloyQuery:new o.ASTQuery({source:e.sourceInfo,query:s?.malloyQuery}).toMalloy();return u({executionState:"running",query:s?.malloyQuery,queryResolutionStartMillis:Date.now(),onCancel:()=>{I.reset(),u(void 0)},response:{result:{}}}),a({...s,query:_}),k.models.executeQueryModel(x,C,e.modelPath,{query:_,sourceName:void 0,queryName:void 0,versionId:v})},onSuccess:_=>{if(_){const B=JSON.parse(_.data.result);a({...s,malloyResult:B}),u(H=>H?{...H,executionState:"finished",response:{result:B}}:void 0)}},onError:_=>{u(void 0),console.error("Query execution error:",_)}}),[T,N]=V.useState(e.sourceInfo.name);V.useEffect(()=>{T!==e.sourceInfo.name&&(N(e.sourceInfo.name),a(Eu()),u(void 0))},[e,T]);const L=V.useCallback(_=>{a({...s,malloyQuery:_,malloyResult:void 0})},[s]);return T!==e.sourceInfo.name?c.jsx("div",{children:"Loading..."}):c.jsx(Ie.StyledExplorerContent,{sx:{border:"1px solid #e0e0e0",borderRadius:"8px",overflow:"hidden"},children:c.jsx(h,{source:e.sourceInfo,query:s?.malloyQuery,topValues:[],onFocusedNestViewPathChange:f,focusedNestViewPath:d,onQueryChange:L,children:c.jsxs("div",{style:{display:"flex",height:"100%",overflowY:"auto"},children:[c.jsx(m,{isInitiallyExpanded:!0,initialWidth:180,minWidth:180,icon:"database",title:e.sourceInfo.name,children:c.jsx(y,{onRefresh:()=>a(Eu())})}),c.jsx(m,{isInitiallyExpanded:!0,initialWidth:280,minWidth:280,icon:"filterSliders",title:"Query",children:c.jsx(p,{runQuery:()=>{console.log(`running query with: ${s?.malloyQuery}`);try{I.mutate()}catch(_){console.error("Error running query:",_)}}})}),c.jsx(b,{source:e.sourceInfo,draftQuery:s?.malloyQuery,setDraftQuery:_=>a({...s,malloyQuery:_}),submittedQuery:l,options:{showRawQuery:!0}})]})})},e.sourceInfo.name)}function y2(e){const[t,n]=V.useState(null),[r,o]=V.useState(null),[i,s]=V.useState(!0);return V.useEffect(()=>{let a=!0;return Promise.all([import("@malloydata/malloy-explorer"),import("@malloydata/malloy-query-builder")]).then(([l,u])=>{a&&(n(l),o(u),s(!1))}).catch(l=>{console.error("Failed to load Malloy components:",l),a&&s(!1)}),()=>{a=!1}},[]),i||!t||!r?c.jsx(Ie.StyledExplorerPage,{children:c.jsx(Ie.StyledExplorerContent,{children:c.jsx(Ot.Box,{sx:{alignItems:"center",justifyContent:"center",height:"200px",color:"text.secondary"},children:"Loading explorer..."})})}):c.jsx(NN,{...e,explorerComponents:t,QueryBuilder:r,resourceUri:e.resourceUri})}const x2=gt(c.jsx("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}));function xn({text:e,size:t=20,color:n="primary",thickness:r=3.6,centered:o=!0,spacing:i=2,textVariant:s="body2"}){const a=c.jsxs(w.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:i},children:[c.jsx(w.CircularProgress,{size:t,color:n,thickness:r}),e&&c.jsx(w.Typography,{variant:s,color:"text.secondary",children:e})]});return o?c.jsx(w.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"200px",width:"100%"},children:a}):a}const FN=new Set(["warn","error"]);function LN(e){if(!e?.length)return;const t=[];let n=!1;for(const r of e)!r.message||!FN.has(r.severity??"")||(r.severity==="error"&&(n=!0),t.includes(r.message)||t.push(r.message));if(t.length)return{severity:n?"error":"warn",title:t.join(`
93
93
  `)}}const _N=V.lazy(()=>Promise.resolve().then(()=>Hq)),BN=2e3;function Si({result:e,maxHeight:t,maxResultSize:n=0,renderLogs:r,drill:o}){const i=V.useRef(null),[s,a]=V.useState(Math.min(t,BN)),[l,u]=V.useState(!1),d=LN(r);if(!e)return null;if(n>0&&e.length>n&&!l)return c.jsxs(w.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:2,p:4,backgroundColor:"#fafafa",border:"1px solid",borderColor:"#e0e0e0",borderRadius:1},children:[c.jsx(On.Warning,{sx:{fontSize:48,color:"#757575"}}),c.jsx(w.Typography,{variant:"h6",color:"text.secondary",align:"center",children:"Processing large results may cause browser performance issues. Proceed?"}),c.jsx(w.Button,{variant:"contained",color:"primary",onClick:()=>u(!0),children:"Proceed"})]});const h=c.jsx(xn,{text:"Loading...",centered:!0,size:32}),p=Math.min(t,s);return c.jsxs(w.Box,{ref:i,sx:{position:"relative",height:"auto",border:"0px",borderRadius:0,overflow:"hidden"},children:[e&&c.jsx(V.Suspense,{fallback:h,children:c.jsx(_N,{result:e,height:p,onSizeChange:a,drill:o})}),d&&c.jsx(w.Box,{sx:{position:"absolute",top:4,right:4,zIndex:1},children:c.jsx(w.Tooltip,{title:d.title,slotProps:{tooltip:{sx:{whiteSpace:"pre-line"}}},children:c.jsx(w.IconButton,{size:"small","aria-label":"Render tag warnings",sx:{backgroundColor:"rgba(255, 255, 255, 0.9)","&:hover":{backgroundColor:"rgba(255, 255, 255, 1)"}},children:c.jsx(x2,{fontSize:"small",color:d.severity==="error"?"error":"warning"})})})})]})}function jN({cell:e,sourceAndPaths:t,resourceUri:n,onQueryChange:r,onSourceChange:o}){const i={query:e.value,malloyResult:e.result?JSON.parse(e.result):void 0,malloyQuery:e.queryInfo?JSON.parse(e.queryInfo):void 0},s=t.findIndex(a=>a.sourceInfo.name===e.sourceName);return c.jsx(_p,{resourceUri:n,sourceAndPaths:t,selectedSourceIndex:s>=0?s:0,existingQuery:i,onQueryChange:r,onSourceChange:o})}function $N({cell:e,editingMalloy:t,editingMarkdown:n,sourceAndPaths:r,resourceUri:o,onCellChange:i,onClose:s,onEdit:a,onDelete:l,addButtonCallback:u}){const[d,f]=V.useState(e.value),[h,p]=V.useState(!1),[m,b]=V.useState(!1),[y,x]=V.useState(),[C]=V.useState(),[v,k]=V.useState(Eu()),[I,T]=V.useState(!1),[N,L]=V.useState(e.sourceName?r.findIndex(se=>se.sourceInfo.name===e.sourceName):0),{mode:_}=Ie.usePublisherTheme();V.useEffect(()=>{e.isMarkdown||Gu(e.value,"malloy",_).then(se=>{x(se)})},[e,_]),V.useEffect(()=>{document.documentElement.setAttribute("data-color-mode","light")});const[B,H]=V.useState(!1),S=()=>{l(),H(!1)},j=r.length===0,M=V.useCallback(()=>{const se=r[N],z=se?.modelPath||e.modelPath||"",Ce=se?.sourceInfo.name||e.sourceName||"";i({...e,value:e.isMarkdown?d:v.query,result:v.malloyResult?JSON.stringify(v.malloyResult):void 0,queryInfo:v.malloyQuery?JSON.stringify(v.malloyQuery):void 0,sourceName:Ce,modelPath:z})},[e,d,v,i,N,r]),P=c.jsx(w.Tooltip,{title:"Delete Cell",children:c.jsx(w.IconButton,{size:"small",onClick:()=>H(!0),children:c.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:c.jsx("path",{d:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m2 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6h14zM10 11v6M14 11v6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}),$=c.jsxs(w.Dialog,{open:B,onClose:()=>H(!1),children:[c.jsx(w.DialogTitle,{children:"Confirm Delete"}),c.jsx(w.DialogContent,{children:c.jsx(w.Typography,{children:"Are you sure you want to delete this cell?"})}),c.jsxs(w.DialogActions,{children:[c.jsx(w.Button,{onClick:()=>H(!1),children:"Cancel"}),c.jsx(w.Button,{onClick:S,color:"error",children:"Delete"})]})]}),W=()=>{M(),s()},G=e.isMarkdown?c.jsxs(c.Fragment,{children:[n?c.jsx(w.Tooltip,{title:"Save",children:c.jsx(w.IconButton,{size:"small",onClick:W,children:c.jsx(Gl,{})})}):c.jsx(w.Tooltip,{title:"Edit",children:c.jsx(w.IconButton,{size:"small",onClick:a,children:c.jsx(Xm,{})})}),!n&&P]}):c.jsxs(c.Fragment,{children:[!t&&c.jsx(w.Tooltip,{title:h?"Hide Code":"View Code",children:c.jsx(w.IconButton,{size:"small",onClick:()=>{p(!h)},children:c.jsx(Kb,{})})}),!t&&e.result&&c.jsx(w.Tooltip,{title:m?"Hide Embedding":"View Embedding",children:c.jsx(w.IconButton,{size:"small",onClick:()=>{b(!m)},children:c.jsx(sp,{})})}),t&&c.jsx(w.Tooltip,{title:"Save",children:c.jsx(w.IconButton,{size:"small",onClick:W,children:c.jsx(Gl,{})})}),!t&&c.jsx(w.Tooltip,{title:"Edit",children:c.jsx(w.IconButton,{size:"small",onClick:a,children:c.jsx(Xm,{})})}),!t&&P]}),Y=t||n,F=n?c.jsx(w.Tooltip,{title:"Save",children:c.jsx(w.IconButton,{size:"small",onClick:W,children:c.jsx(Gl,{})})}):t?c.jsx(w.Tooltip,{title:"Save",children:c.jsx(w.IconButton,{size:"small",onClick:W,children:c.jsx(Gl,{})})}):null,Z=I&&c.jsx(w.Box,{sx:{position:"absolute",top:"4px",right:"4px",display:"flex",gap:"8px",backgroundColor:"background.paper",border:"1px solid",borderColor:"divider",borderRadius:"8px",padding:"2px 4px",boxShadow:1,zIndex:10},children:!Y&&c.jsxs(c.Fragment,{children:[u(!0),u(!1),G]})||F});return c.jsxs(Ie.StyledCard,{sx:se=>({position:"relative",marginTop:"5px",marginBottom:"5px",borderWidth:"1.5px",backgroundColor:se.palette.background.paper,minHeight:"50px"}),onMouseEnter:()=>T(!0),onMouseLeave:()=>{T(!1)},children:[Z,e.isMarkdown?c.jsx(c.Fragment,{children:n?c.jsx(b2,{value:d,preview:"edit",autoFocus:!0,onChange:se=>{f(se),i({...e,value:se})},onBlur:()=>{M(),I||W()}}):c.jsx(w.Box,{sx:{px:.5,pt:0,mt:0,"& h1, & h2, & h3, & h4, & h5, & h6":{mt:.5,mb:.5},"& p":{mt:.5,mb:.5},"& ul, & ol":{mt:.5,mb:.5},"& li":{mt:0,mb:0},"& pre, & code":{mt:.5,mb:.5},"& blockquote":{mt:.5,mb:.5}},children:e.value?c.jsx(w.Box,{onClick:a,sx:{cursor:"pointer"},children:c.jsx(Fu,{children:e.value})}):c.jsxs(w.Box,{onClick:a,sx:{cursor:"pointer"},children:[c.jsx(w.Typography,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"Markdown is empty"}),c.jsx(w.Typography,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Click to edit."})]})})}):c.jsxs(c.Fragment,{children:[c.jsx(w.Collapse,{in:m,timeout:"auto",unmountOnExit:!0,children:c.jsx(w.Stack,{sx:{p:"10px",borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:c.jsx(w.Typography,{component:"div",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},dangerouslySetInnerHTML:{__html:C}})})}),c.jsx(w.Collapse,{in:h,timeout:"auto",unmountOnExit:!0,children:c.jsx(w.Stack,{sx:{p:"10px",borderRadius:0,flexDirection:"row",justifyContent:"space-between"},children:c.jsx(w.Typography,{component:"div",className:"content",sx:{fontSize:"12px","& .line":{textWrap:"wrap"}},dangerouslySetInnerHTML:{__html:y}})})}),t&&(j?c.jsxs(c.Fragment,{children:[c.jsx(w.Typography,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"No Model Imports"}),c.jsx(w.Typography,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Please add a model import above."})]}):c.jsx(jN,{sourceAndPaths:r,resourceUri:o,onQueryChange:se=>{k(se)},onSourceChange:se=>{L(se)},cell:e})),!t&&e.result&&c.jsx(Ie.StyledCard,{variant:"outlined",sx:{borderRadius:0},children:c.jsx(Si,{result:e.result,maxHeight:800})}),!t&&!e.result&&c.jsxs(w.Box,{onClick:a,sx:{cursor:"pointer"},children:[c.jsx(w.Typography,{sx:{p:2,textAlign:"center",variant:"subtitle2",fontWeight:"medium"},children:"Explore is empty"}),c.jsx(w.Typography,{sx:{mb:2,textAlign:"center",variant:"body2"},children:"Click to edit."})]})]}),B&&$]})}const C2=V.createContext(void 0);function HN({children:e,workbookStorage:t}){const n=V.useMemo(()=>({workbookStorage:t}),[t]);return c.jsx(C2.Provider,{value:n,children:e})}function Bp(){const e=V.useContext(C2);if(!e)throw new Error("useWorkbookStorage must be used within a WorkbookStorageProvider");return e}const _r=gt(c.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),zN=gt(c.jsx("path",{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3zM7 9l1.41 1.41L11 7.83V16h2V7.83l2.59 2.58L17 9l-5-5z"}));function Cn({error:e,context:t}){const n=e.data?.message||"Unknown Error";return c.jsxs(c.Fragment,{children:[t&&c.jsx(w.Typography,{variant:"body2",sx:{p:"10px",m:"auto"},children:t}),c.jsx("pre",{style:{whiteSpace:"pre-wrap",color:"red",padding:"10px",margin:"auto"},children:n})]})}function UN({initialSelectedModels:e,onModelChange:t,resourceUri:n}){const{environmentName:r,packageName:o,versionId:i}=jt(n),{apiClients:s}=Ie.useServer(),{data:a,isLoading:l,isSuccess:u,isError:d,error:f}=zt({queryKey:["models",r,o,i],queryFn:()=>s.models.listModels(r,o,i)}),[h,p]=V.useState(e||[]),[m,b]=V.useState(null);V.useEffect(()=>{p(e||[])},[e]);const y=v=>{const k=h.filter(I=>I!==v);p(k),t(k)},x=v=>{const k=[...h,v];p(k),t(k),b(null)};let C=[];return u&&a?.data&&(C=a.data.filter(v=>!h.includes(v.path)).map(v=>v.path)),d?c.jsx(Cn,{error:f,context:`${r} > ${o} > Model Picker`}):c.jsxs(c.Fragment,{children:[c.jsxs(w.FormControl,{fullWidth:!0,children:[l&&c.jsx(w.Typography,{children:"Loading..."}),c.jsxs(w.Stack,{direction:"row",spacing:1,children:[h.map(v=>c.jsx(w.Chip,{label:v,onDelete:()=>y(v),deleteIcon:c.jsx(_r,{}),sx:{marginBottom:"5px"}},v)),c.jsx(w.Button,{size:"small",startIcon:c.jsx(zN,{}),onClick:v=>b(v.currentTarget),disabled:l||d||C.length===0,children:"Add Model"})]})]}),c.jsxs(w.Menu,{anchorEl:m,open:!!m,onClose:()=>b(null),children:[c.jsx(w.Typography,{variant:"subtitle2",sx:{ml:1},children:"Models"}),c.jsx(w.Divider,{}),C.length===0?c.jsx(w.MenuItem,{disabled:!0,children:"No models available"}):C.map(v=>c.jsx(w.MenuItem,{onClick:()=>x(v),children:c.jsx(w.Typography,{variant:"body2",children:v})},v))]})]})}function E2(){const e=RT.useNavigate();return(t,n)=>{if(!n||!n.metaKey&&!n.ctrlKey&&!n.shiftKey&&n.button!==1){e(t);return}const r=new URL(t,window.location.href).href;(n.metaKey||n.ctrlKey||n.button===1||n.shiftKey)&&window.open(r,"_blank")}}function VN({workbookPath:e,resourceUri:t}){const n=E2(),{server:r,getAccessToken:o}=Ie.useServer(),{apiClients:i}=Ie.useServer(),{workbookStorage:s}=Bp(),{environmentName:a,packageName:l}=jt(t),[u,d]=V.useState(void 0),[f,h]=V.useState(void 0);if(!s)throw new Error("Workbook storage be provided via WorkbookStorageProvider");const[p,m]=V.useState(),[b,y]=V.useState(),[x,C]=V.useState(),[v,k]=V.useState([]),[I,T]=V.useState(null),[N,L]=V.useState(null),_=!!I,B=()=>{T(null),L(null)},H=(Z,se)=>{p&&(m(p.insertCell(se,{isMarkdown:Z,value:""})),Z?C(se):y(se),B(),console.log("handleAddCell",Z,se))},[S,j]=V.useState(!1),M=()=>{j(!0)},P=async()=>{e&&s&&await s.deleteWorkbook(e).then(()=>{h(void 0),d(void 0)}).catch(Z=>{h(`Error deleting workbook: ${Z.message}`),d(void 0)}),j(!1),n(`/${a}/${l}`)},$=()=>{j(!1)},W=V.useCallback(async()=>{if(!p){console.log("No workbook data ref");return}try{m(await p.saveWorkbook()),h(void 0),d("Workbook saved")}catch(Z){h(`Error saving workbook: ${Z.message}`),d(void 0)}},[p]);if(V.useEffect(()=>{if(!p)return;(async()=>{const se=new Map(v.map(({modelPath:ae,sourceInfos:Q})=>[ae,Q])),z=[],Ce=[];for(const ae of p.getModels())se.has(ae)?z.push({modelPath:ae,sourceInfos:se.get(ae)}):(console.log("Fetching model from Publisher",ae),Ce.push(i.models.getModel(a,l,ae,void 0).then(Q=>({modelPath:ae,sourceInfos:Q.data.sourceInfos.map(re=>JSON.parse(re))}))));if(Ce.length>0){const ae=await Promise.all(Ce);k([...z,...ae])}else k(z)})()},[o,p,l,a,r]),V.useEffect(()=>{e&&cs.loadWorkbook(s,e).then(Z=>{m(Z)})},[e,s]),!p)return c.jsx("div",{children:"Loading..."});const G=Z=>{const se=[];for(const z of Z)for(const Ce of z.sourceInfos)se.push({modelPath:z.modelPath,sourceInfo:Ce});return se},Y=(Z,se)=>c.jsx(w.Button,{size:"small",startIcon:c.jsx(ys,{}),onClick:()=>H(Z,se),variant:"contained",sx:{backgroundColor:z=>z.palette.background.paper,color:z=>z.palette.mode==="dark"?z.palette.grey[100]:z.palette.grey[700],boxShadow:"none","&:hover":{backgroundColor:z=>z.palette.mode==="dark"?z.palette.grey[500]:z.palette.grey[300],boxShadow:"none"}},children:Z?"Markdown":"Explore"}),F=c.jsxs(w.Box,{sx:{display:"flex",gap:1,justifyContent:"center",flex:2},children:[Y(!1,p.getCells().length),Y(!0,p.getCells().length)]});return c.jsxs(Ie.StyledCard,{variant:"outlined",children:[c.jsxs(Ie.StyledCardContent,{children:[c.jsx(w.Box,{sx:{mb:2},children:c.jsx(w.Box,{sx:{minHeight:"24px"},children:f?c.jsx(w.Typography,{color:"error",variant:"body2",children:f}):u?c.jsx(w.Typography,{color:"success",variant:"body2",children:u}):c.jsx("span",{children:" "})})}),c.jsxs(Ki,{sx:{flexDirection:"row",justifyContent:"space-between",alignItems:"center"},children:[c.jsxs(Ki,{direction:"row",spacing:1,alignItems:"center",children:[c.jsx(w.Typography,{variant:"overline",sx:{fontSize:"13px",fontWeight:"bold",verticalAlign:"middle"},children:"Workbook"}),c.jsx(w.Typography,{variant:"subtitle2",sx:{fontSize:"13px",fontWeight:"normal",verticalAlign:"middle",ml:1},children:`${e.workspace} > ${e.path}`})]}),c.jsxs(Ki,{sx:{display:"flex",flexDirection:"row",gap:1},children:[c.jsx(w.Box,{sx:{display:"flex",alignItems:"center",mt:1,mb:1},children:c.jsx(WN,{workbookData:p})}),c.jsxs(w.Box,{sx:{display:"flex",alignItems:"center",mt:1,mb:1},children:[c.jsx(w.Button,{color:"error",onClick:M,size:"small",children:"Delete"}),c.jsxs(w.Dialog,{open:S,onClose:$,children:[c.jsx(w.DialogTitle,{children:"Delete Workbook"}),c.jsx(w.DialogContent,{children:c.jsxs(w.DialogContentText,{children:['Are you sure you want to delete the workbook "',e.path,'"? This action cannot be undone.']})}),c.jsxs(w.DialogActions,{children:[c.jsx(w.Button,{onClick:$,color:"primary",size:"small",children:"Cancel"}),c.jsx(w.Button,{onClick:P,color:"error",autoFocus:!0,size:"small",children:"Delete"})]})]})]})]})]}),c.jsx(w.Divider,{}),c.jsxs(Ki,{sx:{display:"flex",flexDirection:"row",width:"100%",mt:2},children:[c.jsx(w.Box,{sx:{flex:1},children:c.jsx(UN,{initialSelectedModels:p.getModels(),onModelChange:Z=>{m(p.setModels(Z)),W()},resourceUri:t})}),c.jsx(w.Box,{sx:{flex:1}})]})]}),c.jsx(Ie.StyledCardMedia,{children:c.jsxs(Ki,{children:[p.getCells().length===0&&c.jsxs(c.Fragment,{children:[c.jsx(w.Typography,{sx:{textAlign:"center",p:2,variant:"subtitle2",fontWeight:"medium"},children:"Workbook is empty"}),c.jsx(w.Typography,{variant:"body2",sx:{textAlign:"center",mb:2,variant:"body2"},children:"Click the + buttons to add a markdown or code cell."})]}),p.getCells().map((Z,se)=>c.jsx(V.Fragment,{children:c.jsx($N,{cell:Z,resourceUri:t,addButtonCallback:z=>Y(z,se),sourceAndPaths:G(v),editingMarkdown:x===se,editingMalloy:b===se,onDelete:()=>{m(p.deleteCell(se)),W()},onCellChange:z=>{m(p.setCell(se,z))},onEdit:()=>{Z.isMarkdown?C(se):y(se)},onClose:()=>{Z.isMarkdown?C(void 0):y(void 0),W()}},`${se}-${Z.isMarkdown}-${e.workspace}-${e.path}`)},`${se}-${p.getCells().length}`)),F,c.jsxs(w.Menu,{anchorEl:I,open:_,onClose:B,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},children:[c.jsx(w.MenuItem,{onClick:()=>H(!0,N??0),children:"Add Markdown"}),c.jsx(w.MenuItem,{onClick:()=>H(!1,N??0),children:"Add Malloy"})]}),c.jsx(Ki,{sx:{flexDirection:"row",justifyContent:"flex-end",p:1}})]})})]})}function WN({workbookData:e}){const[t,n]=V.useState(!1),r=async()=>{if(!e)return;const o=e.toMalloyWorkbook();try{await navigator.clipboard.writeText(o),n(!0),setTimeout(()=>n(!1),1500)}catch{n(!1),alert("Failed to copy to clipboard")}};return c.jsx(w.Button,{color:"primary",onClick:r,size:"small",children:t?"Copied!":"Export"})}function v2({onWorkbookClick:e}){const{workbookStorage:t}=Bp(),[n,r]=V.useState([]),[o,i]=V.useState(void 0);return V.useEffect(()=>{t&&t.listWorkspaces(!1).then(s=>{const a=[];Promise.all(s.map(async l=>{await t.listWorkbooks(l).then(u=>{a.push(...u)}).catch(u=>{i(`Error listing workbooks: ${u.message}`)})})).then(()=>{r(a),i(void 0)})})},[t]),c.jsxs(c.Fragment,{children:[o&&c.jsx(w.Box,{sx:{mb:2},children:c.jsx(w.Typography,{color:"error",variant:"body2",children:o})}),c.jsx(w.Divider,{}),c.jsx(w.Box,{sx:{maxHeight:"300px",overflow:"auto","&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{background:"rgba(0,0,0,0.2)",borderRadius:"4px"}},children:c.jsxs(w.List,{dense:!0,children:[n.length===0&&c.jsx(w.ListItem,{children:c.jsx(w.ListItemText,{primary:"No workbooks found.",sx:{textAlign:"center"}})}),n.map(s=>c.jsx(w.ListItem,{onClick:a=>e(s,a),sx:{cursor:"pointer","&:hover":{backgroundColor:"action.hover"}},children:c.jsx(w.ListItemText,{primary:s.path})},s.path))]})})]})}const Ag="Local";class qN{async listWorkspaces(t){return Promise.resolve([{name:Ag,description:"Stored locally- only accessible to this browser",writeable:!0}])}async listWorkbooks(t){const n=[];for(let r=0;r<localStorage.length;r++){const o=localStorage.key(r);n.push({path:o,workspace:Ag})}return n}async getWorkbook(t){const n=localStorage.getItem(t.path);if(n===null)throw new Error(`Notebook not found at path: ${t}`);return n}async deleteWorkbook(t){if(localStorage.getItem(t.path)===null)throw new Error(`Notebook not found at path: ${t}`);localStorage.removeItem(t.path)}async saveWorkbook(t,n){localStorage.setItem(t.path,n)}async moveWorkbook(t,n){const r=localStorage.getItem(t.path);if(r===null)throw new Error(`Notebook not found at path: ${t.path}`);localStorage.setItem(n.path,r),localStorage.removeItem(t.path)}}function YN({onWorkbookSelect:e}){const{workbookStorage:t}=Bp(),[n,r]=V.useState(""),[o,i]=V.useState(""),[s,a]=V.useState([]),[l,u]=V.useState(null),[d,f]=V.useState(!1),[h,p]=V.useState(!1),m=!!l,b=T=>{u(T.currentTarget)},y=()=>{u(null)},x=()=>{p(!1)},C=()=>{f(!1),r(""),i("")};V.useEffect(()=>{t&&(console.log("fetching workspaces"),t.listWorkspaces(!0).then(T=>{a(T),T.length===1&&i(T[0].name)}).catch(T=>{console.error("Error fetching workspaces:",T),a([])}))},[t]);const v=(T,N)=>{p(!1),e(T,N)},k=T=>{f(!1),e({path:n,workspace:o},T),r(""),i("")},I=s.length===0;return c.jsxs(c.Fragment,{children:[c.jsx(w.Button,{"aria-controls":m?"basic-menu":void 0,"aria-haspopup":"true","aria-expanded":m?"true":void 0,onClick:b,variant:"contained",sx:{height:"40px",px:2,backgroundColor:"#fbbb04","&:hover":{backgroundColor:"#eab308"}},children:"Analyze Package"}),c.jsxs(w.Menu,{id:"basic-menu",anchorEl:l,open:m,onClose:y,MenuListProps:{"aria-labelledby":"basic-button",sx:{py:.5}},children:[c.jsxs(w.MenuItem,{onClick:()=>{f(!0),y()},sx:{py:1,px:2},disabled:I,children:[c.jsx(w.ListItemIcon,{children:c.jsx(On.Add,{fontSize:"small"})}),c.jsxs(w.ListItemText,{children:[c.jsx(w.Typography,{variant:"body2",fontWeight:500,children:"New Workbook"}),I?c.jsx(w.Typography,{variant:"caption",color:"text.secondary",children:"No workspaces available"}):c.jsx(w.Typography,{variant:"caption",color:"text.secondary",children:"Create a new analysis workbook"})]})]}),c.jsxs(w.MenuItem,{onClick:()=>{p(!0),y()},sx:{py:1,px:2},children:[c.jsx(w.ListItemIcon,{children:c.jsx(On.Launch,{fontSize:"small"})}),c.jsxs(w.ListItemText,{children:[c.jsx(w.Typography,{variant:"body2",fontWeight:500,children:"Open Workbook"}),c.jsx(w.Typography,{variant:"caption",color:"text.secondary",children:"Open an existing workbook"})]})]})]}),c.jsxs(w.Dialog,{open:d,onClose:C,maxWidth:"sm",fullWidth:!0,children:[c.jsxs(w.DialogTitle,{sx:{pb:1,pt:2,px:2},children:[c.jsx(w.Typography,{fontWeight:600,sx:{fontSize:"1.5rem",mb:.5},children:"Create New Workbook"}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Start a new analysis workbook to explore your data"})]}),c.jsx(w.DialogContent,{sx:{px:2,pb:2},children:c.jsxs(w.Stack,{spacing:2,sx:{mt:1},children:[s.length>1?c.jsxs(w.FormControl,{fullWidth:!0,size:"small",children:[c.jsx(w.InputLabel,{children:"Workspace"}),c.jsx(w.Select,{value:o,label:"Workspace",onChange:T=>i(T.target.value),children:s.map(T=>c.jsx(w.MenuItem,{value:T.name,children:c.jsxs(w.Box,{children:[c.jsx(w.Typography,{variant:"body2",fontWeight:500,children:T.name}),c.jsx(w.Typography,{variant:"caption",color:"text.secondary",children:T.description})]})},T.name))})]}):s.length===1?c.jsxs(w.Box,{sx:T=>({p:2,border:1,borderColor:"divider",borderRadius:1,backgroundColor:T.palette.mode==="dark"?"rgba(255, 255, 255, 0.04)":"grey.50"}),children:[c.jsxs(w.Typography,{variant:"body2",fontWeight:500,gutterBottom:!0,children:["Workspace: ",s[0].name]}),c.jsx(w.Typography,{variant:"caption",color:"text.secondary",children:s[0].description})]}):null,c.jsx(w.FormControl,{fullWidth:!0,children:c.jsx(w.TextField,{label:"Workbook Name",value:n,onChange:T=>r(T.target.value),placeholder:"Enter workbook name...",fullWidth:!0,autoFocus:!0,size:"small"})}),c.jsxs(w.Stack,{direction:"row",spacing:1,justifyContent:"flex-end",children:[c.jsx(w.Button,{onClick:C,variant:"outlined",size:"small",children:"Cancel"}),c.jsx(w.Button,{onClick:T=>k(T),variant:"contained",disabled:!n.trim()||s.length>1&&!o,size:"small",children:"Create Workbook"})]})]})})]}),c.jsxs(w.Dialog,{open:h,onClose:x,maxWidth:"md",fullWidth:!0,children:[c.jsxs(w.DialogTitle,{sx:{pb:1,pt:2,px:2},children:[c.jsx(w.Typography,{fontWeight:600,sx:{mb:.5,fontSize:"1.5rem"},children:"Open Workbook"}),c.jsx(w.Typography,{variant:"body2",color:"text.secondary",children:"Select an existing workbook to continue your analysis"})]}),c.jsx(w.DialogContent,{sx:{px:2,pb:2},children:c.jsx(v2,{onWorkbookClick:v})})]})]})}function oi(e){return(e??"").startsWith("filter<")}function qa(e){const t=/^filter<(.+)>$/.exec(e??"");return t?t[1]:void 0}function jp(e){const t=e.filter(n=>n.trim()!=="");return t.length===0?"":Is.StringFilterExpression.unparse({operator:"=",values:[...t]})}function KN(e){if(e.trim()==="")return[];const{parsed:t}=Is.StringFilterExpression.parse(e);return T2(t)?t.values:[e]}function GN(e){return e===void 0||e.trim()===""?!0:T2(Is.StringFilterExpression.parse(e).parsed)}function T2(e){return e!==null&&Is.isStringCondition(e)&&e.operator==="="&&e.not!==!0}function QN(e){return Is.NumberFilterExpression.unparse({operator:">=",values:[String(e)]})}function Og(e){const t=e.trim();if(t==="")return;const{parsed:n}=Is.NumberFilterExpression.parse(t);if(n===null||n.operator!==">="||n.not===!0||n.values?.length!==1)return;const r=Number(n.values[0]);return Number.isFinite(r)?r:void 0}function XN(e,t){if(e!=null){if(e instanceof Date)return w2(e,t);if(!Array.isArray(e))return String(e)}}function ZN(e,t){return new Date(Date.UTC(e.year(),e.month(),e.date(),t?.getUTCHours()??0,t?.getUTCMinutes()??0,t?.getUTCSeconds()??0,t?.getUTCMilliseconds()??0))}const JN=/^(\d{4})-(\d{1,2})-(\d{1,2})(?:[T\s]+(\d{1,2}):(\d{2})(?::(\d{2}))?(?:\.(\d{1,9}))?)?\s*(Z|[+-]\d{2}:?\d{2}|[+-]\d{2}|UTC|GMT)?$/i;function S2(e){const t=e.trim();return t===""?e:t.replace(/^(\d{4}-\d{1,2}-\d{1,2}[T\s]+\d{1,2}:\d{2}(?::\d{2})?(?:\.\d{1,9})?)\s+(\d{2}:?\d{2}|\d{2})$/,"$1+$2")}function eF(e,t=!1){const n=S2(e);if(n==="")return;const r=JN.exec(n);if(!r)return;const[,o,i,s,a,l,u,d,f]=r,h={year:Number(o),month:Number(i),day:Number(s),hour:Number(a??0),minute:Number(l??0),second:Number(u??0),milli:Number((d??"").slice(0,3).padEnd(3,"0")||0)},p=Date.UTC(h.year,h.month-1,h.day,h.hour,h.minute,h.second,h.milli),m=new Date(p);if(!(m.getUTCFullYear()===h.year&&m.getUTCMonth()===h.month-1&&m.getUTCDate()===h.day&&m.getUTCHours()===h.hour&&m.getUTCMinutes()===h.minute&&m.getUTCSeconds()===h.second)||f!==void 0&&a===void 0)return;const y=tF(f);if(y===void 0)return;const x=new Date(p-y*6e4);if(!(t&&f!==void 0&&x.getUTCDate()!==h.day))return x}function tF(e){if(e===void 0)return 0;const t=e.toUpperCase();if(t==="Z"||t==="UTC"||t==="GMT")return 0;const n=/^([+-])(\d{2}):?(\d{2})?$/.exec(t);if(!n)return;const r=Number(n[3]??0);if(r>59)return;const o=Number(n[2])*60+r,i=n[1]!=="-";if(!(o>(i?840:720)))return i?o:-o}function nF(e){return!rF.has(e??"")}const rF=new Set(["boolean","number","date","timestamp","timestamptz"]);function k2(e,t){if(t===""&&!nF(e))return null;if(oi(e))return t;switch(e){case"number":{const n=t.trim()===""?NaN:Number(t);return Number.isFinite(n)?n:t}case"boolean":return t==="true"?!0:t==="false"?!1:t;case"date":case"timestamp":case"timestamptz":{const n=S2(t);return eF(n,e==="date")??n}default:return t}}function oF(e,t){const n={};for(const[r,o]of e){const i=XN(o,t.get(r));i!==void 0&&(n[r]=i)}return n}function w2(e,t){const n=e.toISOString();switch(t){case"timestamptz":return n;case"timestamp":return n.slice(0,-1);default:return n.slice(0,10)}}function D2(e,t,n){const r=n?new Set(n):void 0,o={};for(const[i,s]of e)r&&!r.has(i)||s!=null&&(Array.isArray(s)||(o[i]=s instanceof Date?w2(s,t.get(i)):s));return o}function Mg(e,t){const n=new Map;for(const[r,o]of Object.entries(e))t.has(r)&&n.set(r,k2(t.get(r),o));return n}function Pg(e,t){const n=Array.from(e.keys()).filter(o=>!t.has(o));if(n.length===0)return e;const r=new Map(e);for(const o of n)r.delete(o);return r}function Rg(e){return Object.entries(e??{}).sort(([t],[n])=>t<n?-1:1)}function iF(e,t){const n=Object.keys(e);return n.length!==Object.keys(t).length?!1:n.every(r=>e[r]===t[r])}function $p({declaredTypes:e,startingValues:t,params:n,onParamsChange:r,documentKey:o,autorun:i}){const s=V.useMemo(()=>Mg(t??{},e),[e,JSON.stringify(t)]),a=V.useMemo(()=>Mg({...t??{},...n??{}},e),[e,JSON.stringify(t),JSON.stringify(n)]),l=V.useMemo(()=>JSON.stringify([o??null,Rg(t),Rg(n)]),[o,JSON.stringify(t),JSON.stringify(n)]),[u,d]=V.useState(null),f=u?.key===l?u:null;V.useEffect(()=>{u!==null&&u.key!==l&&d(null)},[u,l]);const h=V.useMemo(()=>Pg(f?.draft??a,e),[f,a,e]),p=V.useMemo(()=>Pg(f?.applied??a,e),[f,a,e]),m=V.useCallback(I=>I?.key===l?I:{key:l,draft:a,applied:a},[l,a]),b=V.useMemo(()=>oF(p,e),[p,e]),y=V.useRef(b);V.useEffect(()=>{r&&(iF(y.current,b)||(y.current=b,r(b)))},[b,r]);const x=V.useCallback((I,T)=>{d(N=>{const L=m(N),_=new Map(L.draft);return T===null?_.delete(I):_.set(I,T),{key:L.key,draft:_,applied:i?_:L.applied}})},[i,m]),C=V.useCallback(()=>{d(I=>({key:m(I).key,draft:s,applied:s}))},[m,s]),v=V.useCallback(()=>{d(I=>{const T=m(I);return{key:T.key,draft:T.draft,applied:T.draft}})},[m]),k=V.useMemo(()=>{if(i)return!1;if(h.size!==p.size)return!0;for(const[I,T]of h){const N=p.get(I);if(T instanceof Date&&N instanceof Date){if(T.getTime()!==N.getTime())return!0}else if(Array.isArray(T)&&Array.isArray(N)){if(String(T)!==String(N))return!0}else if(T!==N)return!0}return!1},[i,h,p]);return{draft:h,applied:p,setGiven:x,reset:C,apply:v,pending:k}}const sF=1e3;function I2(e){const t=e.split(".");return t[t.length-1]}function aF(e,t){return`run: ${e} -> {
94
94
  group_by: ${t}
95
95
  order_by: ${I2(t)} asc
@@ -3,7 +3,7 @@ import { Box as Ae, CircularProgress as Wp, Typography as Te, Button as zt, Tool
3
3
  import * as A from "react";
4
4
  import _e, { useEffect as an, useImperativeHandle as ky, useContext as rs, Fragment as wy, useMemo as gt, useRef as Jt, useReducer as NS, useState as Ye, Suspense as Kp, lazy as LS, createContext as FS, useCallback as on, isValidElement as Ku, cloneElement as Gu, Children as _S, useLayoutEffect as BS } from "react";
5
5
  import { useQuery as $S, useMutation as HS, useQueries as zS, useQueryClient as Wo } from "@tanstack/react-query";
6
- import { u as Rt, g as Dy, ay as Gp, az as US, aA as Iy, aB as Xc, aC as yc, aD as Ay, aE as Xp, aF as Er, m as Kn, P as Iu, ab as Oy, aG as Py, aH as My, aI as Ry, d as v0, A as Ny, aJ as Mi, aK as Qf, aL as rl, aM as VS, aN as WS, aO as Gd, aP as qS, aQ as YS } from "./ServerProvider-EqBlMMqx.es.js";
6
+ import { u as Rt, g as Dy, aA as Gp, aB as US, aC as Iy, aD as Xc, aE as yc, aF as Ay, aG as Xp, aH as Er, m as Kn, P as Iu, ad as Oy, aI as Py, aJ as My, aK as Ry, d as v0, A as Ny, aL as Mi, aM as Qf, aN as rl, aO as VS, aP as WS, aQ as Gd, aR as qS, aS as YS } from "./ServerProvider-DUFPY6Rv.es.js";
7
7
  import { unstable_createGetCssVar as jS, createSpacing as KS, useTheme as GS, GlobalStyles as XS, unstable_memoTheme as QS, createStack as ZS, Stack as JS, Box as Ly, keyframes as Zl, css as Fy, shouldForwardProp as _y, alpha as Xn, createBox as ek } from "@mui/system";
8
8
  import tk from "@emotion/styled";
9
9
  import { ThemeContext as nk } from "@emotion/react";
@@ -23679,7 +23679,7 @@ function c8() {
23679
23679
  { default: i },
23680
23680
  { default: a }
23681
23681
  ] = await Promise.all([
23682
- import("./core-Cr-9Wkp3.es.js"),
23682
+ import("./core-lb28vQkR.es.js"),
23683
23683
  import("./engine-oniguruma-C4vnmooL.es.js"),
23684
23684
  import("./sql-DCkt643-.es.js"),
23685
23685
  import("./json-71t8ZF9g.es.js"),
package/dist/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-C-KeIwsG.cjs.js"),r=require("./ServerProvider-CcfeBpt3.cjs.js");exports.AnalyzePackageButton=e.AnalyzePackageButton;exports.BrowserWorkbookStorage=e.BrowserWorkbookStorage;exports.ConnectionExplorer=e.ConnectionExplorer;exports.DOC_LINKS=e.DOC_LINKS;exports.DRILL_CELL_CLASS=e.DRILL_CELL_CLASS;exports.DRILL_SELF=e.DRILL_SELF;exports.Dashboard=e.Dashboard;exports.DashboardTile=e.DashboardTile;exports.DataAppViewer=e.DataAppViewer;exports.DimensionFilter=e.DimensionFilter;exports.EmbeddedQueryResult=e.EmbeddedQueryResult;exports.Environment=e.Environment;exports.EnvironmentMaterializations=e.EnvironmentMaterializations;exports.GivenInput=e.GivenInput;exports.GivensPanel=e.GivensPanel;exports.Home=e.Home;exports.Loading=e.Loading;exports.Materializations=e.Materializations;exports.Model=e.Model;exports.ModelExplorer=e.ModelExplorer;exports.ModelExplorerDialog=e.ModelExplorerDialog;exports.Models=e.Models;exports.Notebook=e.Notebook;exports.Package=e.Package;exports.Packages=e.Packages;exports.QueryResult=e.QueryResult;exports.RenderedResult=e.RenderedResult;exports.ResultContainer=e.ResultContainer;exports.SourceExplorerComponent=e.SourceExplorerComponent;exports.SourcesExplorer=e.SourcesExplorer;exports.Workbook=e.Workbook;exports.WorkbookList=e.WorkbookList;exports.WorkbookManager=e.WorkbookManager;exports.WorkbookStorageProvider=e.WorkbookStorageProvider;exports.buildMalloyExplicitTheme=e.buildMalloyExplicitTheme;exports.buildTableCssVars=e.buildTableCssVars;exports.buildVegaThemeOverride=e.buildVegaThemeOverride;exports.createEmbeddedQueryResult=e.createEmbeddedQueryResult;exports.drillDestinations=e.drillDestinations;exports.drillValueToFilter=e.drillValueToFilter;exports.drillableFieldNames=e.drillableFieldNames;exports.encodeDrillValue=e.encodeDrillValue;exports.encodeResourceUri=e.encodeResourceUri;exports.extractDimensionSpecs=e.extractDimensionSpecs;exports.extractSourceFromQuery=e.extractSourceFromQuery;exports.generateFilterClause=e.generateFilterClause;exports.getDimensionKey=e.getDimensionKey;exports.getJoinedSources=e.getJoinedSources;exports.humanizeSlug=e.humanizeSlug;exports.injectWhereClause=e.injectWhereClause;exports.makeDimensionKey=e.makeDimensionKey;exports.markDrillableCells=e.markDrillableCells;exports.packageFileUrl=e.packageFileUrl;exports.parseAllSourceInfos=e.parseAllSourceInfos;exports.parseDimensionFilterAnnotation=e.parseDimensionFilterAnnotation;exports.parseNotebookFilterAnnotation=e.parseNotebookFilterAnnotation;exports.parseResourceUri=e.parseResourceUri;exports.readChartAnnotations=e.readChartAnnotations;exports.resolveDrill=e.resolveDrill;exports.useDimensionFilters=e.useDimensionFilters;exports.useDimensionFiltersFromSpec=e.useDimensionFiltersFromSpec;exports.useDimensionFiltersQuery=e.useDimensionFiltersQuery;exports.useDimensionalFilterRangeData=e.useDimensionalFilterRangeData;exports.useDrill=e.useDrill;exports.useGivensState=e.useGivensState;exports.useModelData=e.useModelData;exports.useModelGivens=e.useModelGivens;exports.useRawQueryData=e.useRawQueryData;exports.useRouterClickHandler=e.useRouterClickHandler;exports.useSuggestOptions=e.useSuggestOptions;exports.DEFAULT_THEME=r.DEFAULT_THEME;exports.ServerProvider=r.ServerProvider;exports.ThemeProvider=r.ThemeProvider;exports.resolveMode=r.resolveMode;exports.resolveTheme=r.resolveTheme;exports.usePublisherTheme=r.usePublisherTheme;exports.useServer=r.useServer;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DvEanVgc.cjs.js"),r=require("./ServerProvider-CTopDUWW.cjs.js");exports.AnalyzePackageButton=e.AnalyzePackageButton;exports.BrowserWorkbookStorage=e.BrowserWorkbookStorage;exports.ConnectionExplorer=e.ConnectionExplorer;exports.DOC_LINKS=e.DOC_LINKS;exports.DRILL_CELL_CLASS=e.DRILL_CELL_CLASS;exports.DRILL_SELF=e.DRILL_SELF;exports.Dashboard=e.Dashboard;exports.DashboardTile=e.DashboardTile;exports.DataAppViewer=e.DataAppViewer;exports.DimensionFilter=e.DimensionFilter;exports.EmbeddedQueryResult=e.EmbeddedQueryResult;exports.Environment=e.Environment;exports.EnvironmentMaterializations=e.EnvironmentMaterializations;exports.GivenInput=e.GivenInput;exports.GivensPanel=e.GivensPanel;exports.Home=e.Home;exports.Loading=e.Loading;exports.Materializations=e.Materializations;exports.Model=e.Model;exports.ModelExplorer=e.ModelExplorer;exports.ModelExplorerDialog=e.ModelExplorerDialog;exports.Models=e.Models;exports.Notebook=e.Notebook;exports.Package=e.Package;exports.Packages=e.Packages;exports.QueryResult=e.QueryResult;exports.RenderedResult=e.RenderedResult;exports.ResultContainer=e.ResultContainer;exports.SourceExplorerComponent=e.SourceExplorerComponent;exports.SourcesExplorer=e.SourcesExplorer;exports.Workbook=e.Workbook;exports.WorkbookList=e.WorkbookList;exports.WorkbookManager=e.WorkbookManager;exports.WorkbookStorageProvider=e.WorkbookStorageProvider;exports.buildMalloyExplicitTheme=e.buildMalloyExplicitTheme;exports.buildTableCssVars=e.buildTableCssVars;exports.buildVegaThemeOverride=e.buildVegaThemeOverride;exports.createEmbeddedQueryResult=e.createEmbeddedQueryResult;exports.drillDestinations=e.drillDestinations;exports.drillValueToFilter=e.drillValueToFilter;exports.drillableFieldNames=e.drillableFieldNames;exports.encodeDrillValue=e.encodeDrillValue;exports.encodeResourceUri=e.encodeResourceUri;exports.extractDimensionSpecs=e.extractDimensionSpecs;exports.extractSourceFromQuery=e.extractSourceFromQuery;exports.generateFilterClause=e.generateFilterClause;exports.getDimensionKey=e.getDimensionKey;exports.getJoinedSources=e.getJoinedSources;exports.humanizeSlug=e.humanizeSlug;exports.injectWhereClause=e.injectWhereClause;exports.makeDimensionKey=e.makeDimensionKey;exports.markDrillableCells=e.markDrillableCells;exports.packageFileUrl=e.packageFileUrl;exports.parseAllSourceInfos=e.parseAllSourceInfos;exports.parseDimensionFilterAnnotation=e.parseDimensionFilterAnnotation;exports.parseNotebookFilterAnnotation=e.parseNotebookFilterAnnotation;exports.parseResourceUri=e.parseResourceUri;exports.readChartAnnotations=e.readChartAnnotations;exports.resolveDrill=e.resolveDrill;exports.useDimensionFilters=e.useDimensionFilters;exports.useDimensionFiltersFromSpec=e.useDimensionFiltersFromSpec;exports.useDimensionFiltersQuery=e.useDimensionFiltersQuery;exports.useDimensionalFilterRangeData=e.useDimensionalFilterRangeData;exports.useDrill=e.useDrill;exports.useGivensState=e.useGivensState;exports.useModelData=e.useModelData;exports.useModelGivens=e.useModelGivens;exports.useRawQueryData=e.useRawQueryData;exports.useRouterClickHandler=e.useRouterClickHandler;exports.useSuggestOptions=e.useSuggestOptions;exports.DEFAULT_THEME=r.DEFAULT_THEME;exports.ServerProvider=r.ServerProvider;exports.ThemeProvider=r.ThemeProvider;exports.resolveMode=r.resolveMode;exports.resolveTheme=r.resolveTheme;exports.usePublisherTheme=r.usePublisherTheme;exports.useServer=r.useServer;
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
- import { A as s, a7 as r, C as o, ao as i, j as l, l as n, D as t, g as u, i as d, x as m, a0 as D, E as c, R as k, L as p, M as S, N as b, O as g, Q as v, S as E, T as F, U as R, _ as C, Y as L, Z as M, P as h, $ as T, a2 as x, a3 as y, W as A, V as P, a4 as Q, a5 as W, a8 as I, a6 as V, ai as _, aj as G, ak as N, a1 as U, n as f, o as z, k as B, q as H, an as K, y as O, B as j, F as w, ad as J, G as q, r as X, H as Y, ae as Z, m as $, p as aa, I as ea, J as sa, K as ra, am as oa, al as ia, t as la, a9 as na, aa as ta, ab as ua, ac as da, v as ma, ag as Da, X as ca, af as ka, u as pa, e as Sa, ah as ba } from "./index-DVkelll3.es.js";
2
- import { aR as va, S as Ea, aT as Fa, aS as Ra, aQ as Ca, aB as La, u as Ma } from "./ServerProvider-EqBlMMqx.es.js";
1
+ import { A as s, a7 as r, C as o, ao as i, j as l, l as n, D as t, g as u, i as d, x as m, a0 as D, E as c, R as k, L as p, M as S, N as b, O as g, Q as v, S as E, T as F, U as R, _ as C, Y as L, Z as M, P as h, $ as T, a2 as x, a3 as y, W as A, V as P, a4 as Q, a5 as V, a8 as W, a6 as I, ai as U, aj as _, ak as G, a1 as N, n as f, o as z, k as H, q as K, an as O, y as j, B as w, F as B, ad as J, G as q, r as X, H as Y, ae as Z, m as $, p as aa, I as ea, J as sa, K as ra, am as oa, al as ia, t as la, a9 as na, aa as ta, ab as ua, ac as da, v as ma, ag as Da, X as ca, af as ka, u as pa, e as Sa, ah as ba } from "./index-txw04ZbN.es.js";
2
+ import { aT as va, S as Ea, aV as Fa, aU as Ra, aS as Ca, aD as La, u as Ma } from "./ServerProvider-DUFPY6Rv.es.js";
3
3
  export {
4
4
  s as AnalyzePackageButton,
5
5
  r as BrowserWorkbookStorage,
@@ -35,21 +35,21 @@ export {
35
35
  P as SourcesExplorer,
36
36
  Fa as ThemeProvider,
37
37
  Q as Workbook,
38
- W as WorkbookList,
39
- I as WorkbookManager,
40
- V as WorkbookStorageProvider,
41
- _ as buildMalloyExplicitTheme,
42
- G as buildTableCssVars,
43
- N as buildVegaThemeOverride,
44
- U as createEmbeddedQueryResult,
38
+ V as WorkbookList,
39
+ W as WorkbookManager,
40
+ I as WorkbookStorageProvider,
41
+ U as buildMalloyExplicitTheme,
42
+ _ as buildTableCssVars,
43
+ G as buildVegaThemeOverride,
44
+ N as createEmbeddedQueryResult,
45
45
  f as drillDestinations,
46
46
  z as drillValueToFilter,
47
- B as drillableFieldNames,
48
- H as encodeDrillValue,
49
- K as encodeResourceUri,
50
- O as extractDimensionSpecs,
51
- j as extractSourceFromQuery,
52
- w as generateFilterClause,
47
+ H as drillableFieldNames,
48
+ K as encodeDrillValue,
49
+ O as encodeResourceUri,
50
+ j as extractDimensionSpecs,
51
+ w as extractSourceFromQuery,
52
+ B as generateFilterClause,
53
53
  J as getDimensionKey,
54
54
  q as getJoinedSources,
55
55
  X as humanizeSlug,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@malloy-publisher/sdk",
3
3
  "description": "Malloy Publisher SDK",
4
- "version": "0.0.250",
4
+ "version": "0.2.0",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",
7
7
  "module": "dist/index.es.js",
@@ -71,11 +71,11 @@
71
71
  "react-router-dom": ">=7.6.2",
72
72
  "@tanstack/react-query": ">=5.59.16",
73
73
  "@malloydata/malloy-explorer": "0.0.338-dev260215172810",
74
- "@malloydata/malloy-filter": "^0.0.427",
75
- "@malloydata/malloy-interfaces": "^0.0.427",
76
- "@malloydata/malloy-query-builder": "^0.0.427",
77
- "@malloydata/malloy-tag": "^0.0.427",
78
- "@malloydata/render": "^0.0.427",
74
+ "@malloydata/malloy-filter": "^0.0.432",
75
+ "@malloydata/malloy-interfaces": "^0.0.432",
76
+ "@malloydata/malloy-query-builder": "^0.0.432",
77
+ "@malloydata/malloy-tag": "^0.0.432",
78
+ "@malloydata/render": "^0.0.432",
79
79
  "@mui/icons-material": ">=7.1.1",
80
80
  "@mui/x-date-pickers": ">=7.1.1",
81
81
  "@mui/material": ">=7.1.1",
@@ -96,9 +96,9 @@
96
96
  "devDependencies": {
97
97
  "@happy-dom/global-registrator": "^20.11.1",
98
98
  "@malloydata/malloy-explorer": "0.0.338-dev260215172810",
99
- "@malloydata/malloy-filter": "^0.0.427",
100
- "@malloydata/malloy-query-builder": "^0.0.427",
101
- "@malloydata/malloy-tag": "^0.0.427",
99
+ "@malloydata/malloy-filter": "^0.0.432",
100
+ "@malloydata/malloy-query-builder": "^0.0.432",
101
+ "@malloydata/malloy-tag": "^0.0.432",
102
102
  "@openapitools/openapi-generator-cli": "^2.20.2",
103
103
  "@shikijs/langs": "^1.16.3",
104
104
  "@shikijs/themes": "^1.16.3",
@@ -208,8 +208,22 @@ export default function Package({
208
208
  // dashboards call that resolves after the models call rendered the sections
209
209
  // with an empty `dashboardPaths`, so `dashboards/overview.malloy` appeared
210
210
  // under Semantic Models and then vanished: the double listing the filter
211
- // exists to prevent, briefly on screen. It cannot hang the page: the query
212
- // above turns a 404 or a transport failure into an empty list.
211
+ // exists to prevent, briefly on screen.
212
+ //
213
+ // What this covers and what it COSTS, since the two are different questions.
214
+ // It cannot hang the page on a FAILURE: the query above turns a 404 or a
215
+ // transport failure into an empty list. It does add LATENCY, and to every
216
+ // section rather than to the one that needs it: Notebooks, Semantic Models,
217
+ // Data Apps and Databases now wait on the dashboards call where they used to
218
+ // render as soon as notebooks resolved. The only thing that actually needs
219
+ // the gate is the `dashboardPaths` filter on the models list.
220
+ //
221
+ // Accepted rather than narrowed because the cost is bounded and small:
222
+ // `listDashboards` is a synchronous read off the already-loaded package
223
+ // (`service/package.ts`, reached with `getPackage(name, false)`, so no
224
+ // reload), which makes this one more parallel request and not a compile.
225
+ // Narrowing it means gating only the models section, which trades this
226
+ // whole-page wait for a models list that pops in after its neighbours.
213
227
  const isLoading =
214
228
  (!notebooksQuery.isSuccess && !notebooksQuery.isError) ||
215
229
  (!dashboardsQuery.isSuccess && !dashboardsQuery.isError);
@@ -1 +0,0 @@
1
- "use strict";const Q=require("react/jsx-runtime"),H=require("@tanstack/react-query"),h=require("axios"),A=require("react"),y=require("@mui/material"),u="http://localhost/api/v0".replace(/\/+$/,"");class x{constructor(n,e=u,t=h){this.basePath=e,this.axios=t,n&&(this.configuration=n,this.basePath=n.basePath??e)}configuration}class Ue extends Error{constructor(n,e){super(e),this.field=n,this.name="RequiredError"}}const g={},b="https://example.com",m=function(l,n,e){if(e==null)throw new Ue(n,`Required parameter ${n} was null or undefined when calling ${l}.`)};function q(l,n,e=""){n!=null&&(typeof n=="object"?Array.isArray(n)?n.forEach(t=>q(l,t,e)):Object.keys(n).forEach(t=>q(l,n[t],`${e}${e!==""?".":""}${t}`)):l.has(e)?l.append(e,n):l.set(e,n))}const P=function(l,...n){const e=new URLSearchParams(l.search);q(e,n),l.search=e.toString()},C=function(l,n,e){const t=typeof l!="string";return(t&&e&&e.isJsonMime?e.isJsonMime(n.headers["Content-Type"]):t)?JSON.stringify(l!==void 0?l:{}):l||""},v=function(l){return l.pathname+l.search+l.hash},V=function(l,n,e,t){return(a=n,r=e)=>{const o={...l.options,url:(a.defaults.baseURL?"":t?.basePath??r)+l.url};return a.request(o)}},Me={Bigquery:"bigquery",Snowflake:"snowflake",Postgres:"postgres",Gcs:"gcs",S3:"s3",Azure:"azure"},we={ServicePrincipal:"service_principal",SasToken:"sas_token"},fe={Error:"error",Warn:"warn",Debug:"debug"},Fe={Append:"append",File:"file",Package:"package"},Be={Success:"success",Error:"error"},Qe={Postgres:"postgres",Bigquery:"bigquery",Snowflake:"snowflake",Trino:"trino",Databricks:"databricks",Mysql:"mysql",Duckdb:"duckdb",Motherduck:"motherduck",Ducklake:"ducklake",Publisher:"publisher"},ze={Ssh:"ssh"},De={Ok:"ok",Failed:"failed"},$e={Viewport:"viewport"},qe={Embedded:"embedded",Materialized:"materialized"},Le={Equal:"equal",In:"in",Like:"like",GreaterThan:"greater_than",LessThan:"less_than"},je={Live:"live",StaleOk:"stale_ok",Fail:"fail"},He={Select:"select",Multiselect:"multiselect"},_e={Merge:"merge",RangeReplace:"range_replace"},We={Debug:"debug",Info:"info",Warn:"warn",Error:"error"},Ge={Persist:"persist",Preaggregate:"preaggregate"},Ye={Live:"live",StaleOk:"stale_ok",Fail:"fail"},Ke={Delta:"delta",Full:"full",None:"none"},Je={Pending:"PENDING",ManifestRowsReady:"MANIFEST_ROWS_READY",ManifestFileReady:"MANIFEST_FILE_READY",Failed:"FAILED",Cancelled:"CANCELLED"},Xe={Markdown:"markdown",Code:"code"},Ze={Markdown:"markdown",Code:"code"},ea={Version:"version",Package:"package"},aa={Declared:"declared",All:"all"},ta={Unbound:"unbound",Bound:"bound",LiveFallback:"live_fallback"},ra={Error:"error",Warn:"warn"},na={Persist:"persist",Preaggregate:"preaggregate"},oa={Disable:"disable",NoVerify:"no-verify",VerifyCa:"verify-ca",VerifyFull:"verify-full"},sa={Interactive:"interactive",Materialize:"materialize",Index:"index",Ops:"ops"},la={Query:"query",ServerDefault:"server_default"},ca={Storage:"storage",LiveFallback:"live_fallback"},ia={Snapshot:"SNAPSHOT",Copy:"COPY"},da={Publish:"publish",OnDemand:"on_demand",Scheduler:"scheduler"},pa={Initializing:"initializing",Serving:"serving",Draining:"draining",Throttled:"throttled"},ma={Light:"light",Dark:"dark",Auto:"auto"},X=function(l){return{createConnection:async(n,e,t,a={})=>{m("createConnection","environmentName",n),m("createConnection","connectionName",e),m("createConnection","connection",t);const r="/environments/{environmentName}/connections/{connectionName}".replace("{environmentName}",encodeURIComponent(String(n))).replace("{connectionName}",encodeURIComponent(String(e))),o=new URL(r,b);let s;l&&(s=l.baseOptions);const c={method:"POST",...s,...a},i={},d={};i["Content-Type"]="application/json",P(o,d);let p=s&&s.headers?s.headers:{};return c.headers={...i,...p,...a.headers},c.data=C(t,c,l),{url:v(o),options:c}},deleteConnection:async(n,e,t={})=>{m("deleteConnection","environmentName",n),m("deleteConnection","connectionName",e);const a="/environments/{environmentName}/connections/{connectionName}".replace("{environmentName}",encodeURIComponent(String(n))).replace("{connectionName}",encodeURIComponent(String(e))),r=new URL(a,b);let o;l&&(o=l.baseOptions);const s={method:"DELETE",...o,...t},c={};P(r,{});let d=o&&o.headers?o.headers:{};return s.headers={...c,...d,...t.headers},{url:v(r),options:s}},getConnection:async(n,e,t={})=>{m("getConnection","environmentName",n),m("getConnection","connectionName",e);const a="/environments/{environmentName}/connections/{connectionName}".replace("{environmentName}",encodeURIComponent(String(n))).replace("{connectionName}",encodeURIComponent(String(e))),r=new URL(a,b);let o;l&&(o=l.baseOptions);const s={method:"GET",...o,...t},c={};P(r,{});let d=o&&o.headers?o.headers:{};return s.headers={...c,...d,...t.headers},{url:v(r),options:s}},getTable:async(n,e,t,a,r={})=>{m("getTable","environmentName",n),m("getTable","connectionName",e),m("getTable","schemaName",t),m("getTable","tablePath",a);const o="/environments/{environmentName}/connections/{connectionName}/schemas/{schemaName}/tables/{tablePath}".replace("{environmentName}",encodeURIComponent(String(n))).replace("{connectionName}",encodeURIComponent(String(e))).replace("{schemaName}",encodeURIComponent(String(t))).replace("{tablePath}",encodeURIComponent(String(a))),s=new URL(o,b);let c;l&&(c=l.baseOptions);const i={method:"GET",...c,...r},d={};P(s,{});let O=c&&c.headers?c.headers:{};return i.headers={...d,...O,...r.headers},{url:v(s),options:i}},getTableInPackage:async(n,e,t,a,r,o={})=>{m("getTableInPackage","environmentName",n),m("getTableInPackage","packageName",e),m("getTableInPackage","connectionName",t),m("getTableInPackage","schemaName",a),m("getTableInPackage","tablePath",r);const s="/environments/{environmentName}/packages/{packageName}/connections/{connectionName}/schemas/{schemaName}/tables/{tablePath}".replace("{environmentName}",encodeURIComponent(String(n))).replace("{packageName}",encodeURIComponent(String(e))).replace("{connectionName}",encodeURIComponent(String(t))).replace("{schemaName}",encodeURIComponent(String(a))).replace("{tablePath}",encodeURIComponent(String(r))),c=new URL(s,b);let i;l&&(i=l.baseOptions);const d={method:"GET",...i,...o},p={};P(c,{});let k=i&&i.headers?i.headers:{};return d.headers={...p,...k,...o.headers},{url:v(c),options:d}},listConnections:async(n,e={})=>{m("listConnections","environmentName",n);const t="/environments/{environmentName}/connections".replace("{environmentName}",encodeURIComponent(String(n))),a=new URL(t,b);let r;l&&(r=l.baseOptions);const o={method:"GET",...r,...e},s={};P(a,{});let i=r&&r.headers?r.headers:{};return o.headers={...s,...i,...e.headers},{url:v(a),options:o}},listSchemas:async(n,e,t={})=>{m("listSchemas","environmentName",n),m("listSchemas","connectionName",e);const a="/environments/{environmentName}/connections/{connectionName}/schemas".replace("{environmentName}",encodeURIComponent(String(n))).replace("{connectionName}",encodeURIComponent(String(e))),r=new URL(a,b);let o;l&&(o=l.baseOptions);const s={method:"GET",...o,...t},c={};P(r,{});let d=o&&o.headers?o.headers:{};return s.headers={...c,...d,...t.headers},{url:v(r),options:s}},listSchemasInPackage:async(n,e,t,a={})=>{m("listSchemasInPackage","environmentName",n),m("listSchemasInPackage","packageName",e),m("listSchemasInPackage","connectionName",t);const r="/environments/{environmentName}/packages/{packageName}/connections/{connectionName}/schemas".replace("{environmentName}",encodeURIComponent(String(n))).replace("{packageName}",encodeURIComponent(String(e))).replace("{connectionName}",encodeURIComponent(String(t))),o=new URL(r,b);let s;l&&(s=l.baseOptions);const c={method:"GET",...s,...a},i={};P(o,{});let p=s&&s.headers?s.headers:{};return c.headers={...i,...p,...a.headers},{url:v(o),options:c}},listTables:async(n,e,t,a,r={})=>{m("listTables","environmentName",n),m("listTables","connectionName",e),m("listTables","schemaName",t);const o="/environments/{environmentName}/connections/{connectionName}/schemas/{schemaName}/tables".replace("{environmentName}",encodeURIComponent(String(n))).replace("{connectionName}",encodeURIComponent(String(e))).replace("{schemaName}",encodeURIComponent(String(t))),s=new URL(o,b);let c;l&&(c=l.baseOptions);const i={method:"GET",...c,...r},d={},p={};a&&(p.tableNames=a),P(s,p);let O=c&&c.headers?c.headers:{};return i.headers={...d,...O,...r.headers},{url:v(s),options:i}},listTablesInPackage:async(n,e,t,a,r,o={})=>{m("listTablesInPackage","environmentName",n),m("listTablesInPackage","packageName",e),m("listTablesInPackage","connectionName",t),m("listTablesInPackage","schemaName",a);const s="/environments/{environmentName}/packages/{packageName}/connections/{connectionName}/schemas/{schemaName}/tables".replace("{environmentName}",encodeURIComponent(String(n))).replace("{packageName}",encodeURIComponent(String(e))).replace("{connectionName}",encodeURIComponent(String(t))).replace("{schemaName}",encodeURIComponent(String(a))),c=new URL(s,b);let i;l&&(i=l.baseOptions);const d={method:"GET",...i,...o},p={},O={};r&&(O.tableNames=r),P(c,O);let k=i&&i.headers?i.headers:{};return d.headers={...p,...k,...o.headers},{url:v(c),options:d}},postQuerydata:async(n,e,t,a={})=>{m("postQuerydata","environmentName",n),m("postQuerydata","connectionName",e),m("postQuerydata","postQuerydataRequest",t);const r="/environments/{environmentName}/connections/{connectionName}/sqlQuery".replace("{environmentName}",encodeURIComponent(String(n))).replace("{connectionName}",encodeURIComponent(String(e))),o=new URL(r,b);let s;l&&(s=l.baseOptions);const c={method:"POST",...s,...a},i={},d={};i["Content-Type"]="application/json",P(o,d);let p=s&&s.headers?s.headers:{};return c.headers={...i,...p,...a.headers},c.data=C(t,c,l),{url:v(o),options:c}},postQuerydataInPackage:async(n,e,t,a,r={})=>{m("postQuerydataInPackage","environmentName",n),m("postQuerydataInPackage","packageName",e),m("postQuerydataInPackage","connectionName",t),m("postQuerydataInPackage","postQuerydataRequest",a);const o="/environments/{environmentName}/packages/{packageName}/connections/{connectionName}/sqlQuery".replace("{environmentName}",encodeURIComponent(String(n))).replace("{packageName}",encodeURIComponent(String(e))).replace("{connectionName}",encodeURIComponent(String(t))),s=new URL(o,b);let c;l&&(c=l.baseOptions);const i={method:"POST",...c,...r},d={},p={};d["Content-Type"]="application/json",P(s,p);let O=c&&c.headers?c.headers:{};return i.headers={...d,...O,...r.headers},i.data=C(a,i,l),{url:v(s),options:i}},postSqlsource:async(n,e,t,a={})=>{m("postSqlsource","environmentName",n),m("postSqlsource","connectionName",e),m("postSqlsource","postSqlsourceRequest",t);const r="/environments/{environmentName}/connections/{connectionName}/sqlSource".replace("{environmentName}",encodeURIComponent(String(n))).replace("{connectionName}",encodeURIComponent(String(e))),o=new URL(r,b);let s;l&&(s=l.baseOptions);const c={method:"POST",...s,...a},i={},d={};i["Content-Type"]="application/json",P(o,d);let p=s&&s.headers?s.headers:{};return c.headers={...i,...p,...a.headers},c.data=C(t,c,l),{url:v(o),options:c}},postSqlsourceInPackage:async(n,e,t,a,r={})=>{m("postSqlsourceInPackage","environmentName",n),m("postSqlsourceInPackage","packageName",e),m("postSqlsourceInPackage","connectionName",t),m("postSqlsourceInPackage","postSqlsourceRequest",a);const o="/environments/{environmentName}/packages/{packageName}/connections/{connectionName}/sqlSource".replace("{environmentName}",encodeURIComponent(String(n))).replace("{packageName}",encodeURIComponent(String(e))).replace("{connectionName}",encodeURIComponent(String(t))),s=new URL(o,b);let c;l&&(c=l.baseOptions);const i={method:"POST",...c,...r},d={},p={};d["Content-Type"]="application/json",P(s,p);let O=c&&c.headers?c.headers:{};return i.headers={...d,...O,...r.headers},i.data=C(a,i,l),{url:v(s),options:i}},postTemporarytable:async(n,e,t,a={})=>{m("postTemporarytable","environmentName",n),m("postTemporarytable","connectionName",e),m("postTemporarytable","postSqlsourceRequest",t);const r="/environments/{environmentName}/connections/{connectionName}/sqlTemporaryTable".replace("{environmentName}",encodeURIComponent(String(n))).replace("{connectionName}",encodeURIComponent(String(e))),o=new URL(r,b);let s;l&&(s=l.baseOptions);const c={method:"POST",...s,...a},i={},d={};i["Content-Type"]="application/json",P(o,d);let p=s&&s.headers?s.headers:{};return c.headers={...i,...p,...a.headers},c.data=C(t,c,l),{url:v(o),options:c}},postTemporarytableInPackage:async(n,e,t,a,r={})=>{m("postTemporarytableInPackage","environmentName",n),m("postTemporarytableInPackage","packageName",e),m("postTemporarytableInPackage","connectionName",t),m("postTemporarytableInPackage","postSqlsourceRequest",a);const o="/environments/{environmentName}/packages/{packageName}/connections/{connectionName}/sqlTemporaryTable".replace("{environmentName}",encodeURIComponent(String(n))).replace("{packageName}",encodeURIComponent(String(e))).replace("{connectionName}",encodeURIComponent(String(t))),s=new URL(o,b);let c;l&&(c=l.baseOptions);const i={method:"POST",...c,...r},d={},p={};d["Content-Type"]="application/json",P(s,p);let O=c&&c.headers?c.headers:{};return i.headers={...d,...O,...r.headers},i.data=C(a,i,l),{url:v(s),options:i}},updateConnection:async(n,e,t,a={})=>{m("updateConnection","environmentName",n),m("updateConnection","connectionName",e),m("updateConnection","updateConnectionRequest",t);const r="/environments/{environmentName}/connections/{connectionName}".replace("{environmentName}",encodeURIComponent(String(n))).replace("{connectionName}",encodeURIComponent(String(e))),o=new URL(r,b);let s;l&&(s=l.baseOptions);const c={method:"PATCH",...s,...a},i={},d={};i["Content-Type"]="application/json",P(o,d);let p=s&&s.headers?s.headers:{};return c.headers={...i,...p,...a.headers},c.data=C(t,c,l),{url:v(o),options:c}}}},S=function(l){const n=X(l);return{async createConnection(e,t,a,r){const o=await n.createConnection(e,t,a,r),s=l?.serverIndex??0,c=g["ConnectionsApi.createConnection"]?.[s]?.url;return(i,d)=>V(o,h,u,l)(i,c||d)},async deleteConnection(e,t,a){const r=await n.deleteConnection(e,t,a),o=l?.serverIndex??0,s=g["ConnectionsApi.deleteConnection"]?.[o]?.url;return(c,i)=>V(r,h,u,l)(c,s||i)},async getConnection(e,t,a){const r=await n.getConnection(e,t,a),o=l?.serverIndex??0,s=g["ConnectionsApi.getConnection"]?.[o]?.url;return(c,i)=>V(r,h,u,l)(c,s||i)},async getTable(e,t,a,r,o){const s=await n.getTable(e,t,a,r,o),c=l?.serverIndex??0,i=g["ConnectionsApi.getTable"]?.[c]?.url;return(d,p)=>V(s,h,u,l)(d,i||p)},async getTableInPackage(e,t,a,r,o,s){const c=await n.getTableInPackage(e,t,a,r,o,s),i=l?.serverIndex??0,d=g["ConnectionsApi.getTableInPackage"]?.[i]?.url;return(p,O)=>V(c,h,u,l)(p,d||O)},async listConnections(e,t){const a=await n.listConnections(e,t),r=l?.serverIndex??0,o=g["ConnectionsApi.listConnections"]?.[r]?.url;return(s,c)=>V(a,h,u,l)(s,o||c)},async listSchemas(e,t,a){const r=await n.listSchemas(e,t,a),o=l?.serverIndex??0,s=g["ConnectionsApi.listSchemas"]?.[o]?.url;return(c,i)=>V(r,h,u,l)(c,s||i)},async listSchemasInPackage(e,t,a,r){const o=await n.listSchemasInPackage(e,t,a,r),s=l?.serverIndex??0,c=g["ConnectionsApi.listSchemasInPackage"]?.[s]?.url;return(i,d)=>V(o,h,u,l)(i,c||d)},async listTables(e,t,a,r,o){const s=await n.listTables(e,t,a,r,o),c=l?.serverIndex??0,i=g["ConnectionsApi.listTables"]?.[c]?.url;return(d,p)=>V(s,h,u,l)(d,i||p)},async listTablesInPackage(e,t,a,r,o,s){const c=await n.listTablesInPackage(e,t,a,r,o,s),i=l?.serverIndex??0,d=g["ConnectionsApi.listTablesInPackage"]?.[i]?.url;return(p,O)=>V(c,h,u,l)(p,d||O)},async postQuerydata(e,t,a,r){const o=await n.postQuerydata(e,t,a,r),s=l?.serverIndex??0,c=g["ConnectionsApi.postQuerydata"]?.[s]?.url;return(i,d)=>V(o,h,u,l)(i,c||d)},async postQuerydataInPackage(e,t,a,r,o){const s=await n.postQuerydataInPackage(e,t,a,r,o),c=l?.serverIndex??0,i=g["ConnectionsApi.postQuerydataInPackage"]?.[c]?.url;return(d,p)=>V(s,h,u,l)(d,i||p)},async postSqlsource(e,t,a,r){const o=await n.postSqlsource(e,t,a,r),s=l?.serverIndex??0,c=g["ConnectionsApi.postSqlsource"]?.[s]?.url;return(i,d)=>V(o,h,u,l)(i,c||d)},async postSqlsourceInPackage(e,t,a,r,o){const s=await n.postSqlsourceInPackage(e,t,a,r,o),c=l?.serverIndex??0,i=g["ConnectionsApi.postSqlsourceInPackage"]?.[c]?.url;return(d,p)=>V(s,h,u,l)(d,i||p)},async postTemporarytable(e,t,a,r){const o=await n.postTemporarytable(e,t,a,r),s=l?.serverIndex??0,c=g["ConnectionsApi.postTemporarytable"]?.[s]?.url;return(i,d)=>V(o,h,u,l)(i,c||d)},async postTemporarytableInPackage(e,t,a,r,o){const s=await n.postTemporarytableInPackage(e,t,a,r,o),c=l?.serverIndex??0,i=g["ConnectionsApi.postTemporarytableInPackage"]?.[c]?.url;return(d,p)=>V(s,h,u,l)(d,i||p)},async updateConnection(e,t,a,r){const o=await n.updateConnection(e,t,a,r),s=l?.serverIndex??0,c=g["ConnectionsApi.updateConnection"]?.[s]?.url;return(i,d)=>V(o,h,u,l)(i,c||d)}}},ha=function(l,n,e){const t=S(l);return{createConnection(a,r,o,s){return t.createConnection(a,r,o,s).then(c=>c(e,n))},deleteConnection(a,r,o){return t.deleteConnection(a,r,o).then(s=>s(e,n))},getConnection(a,r,o){return t.getConnection(a,r,o).then(s=>s(e,n))},getTable(a,r,o,s,c){return t.getTable(a,r,o,s,c).then(i=>i(e,n))},getTableInPackage(a,r,o,s,c,i){return t.getTableInPackage(a,r,o,s,c,i).then(d=>d(e,n))},listConnections(a,r){return t.listConnections(a,r).then(o=>o(e,n))},listSchemas(a,r,o){return t.listSchemas(a,r,o).then(s=>s(e,n))},listSchemasInPackage(a,r,o,s){return t.listSchemasInPackage(a,r,o,s).then(c=>c(e,n))},listTables(a,r,o,s,c){return t.listTables(a,r,o,s,c).then(i=>i(e,n))},listTablesInPackage(a,r,o,s,c,i){return t.listTablesInPackage(a,r,o,s,c,i).then(d=>d(e,n))},postQuerydata(a,r,o,s){return t.postQuerydata(a,r,o,s).then(c=>c(e,n))},postQuerydataInPackage(a,r,o,s,c){return t.postQuerydataInPackage(a,r,o,s,c).then(i=>i(e,n))},postSqlsource(a,r,o,s){return t.postSqlsource(a,r,o,s).then(c=>c(e,n))},postSqlsourceInPackage(a,r,o,s,c){return t.postSqlsourceInPackage(a,r,o,s,c).then(i=>i(e,n))},postTemporarytable(a,r,o,s){return t.postTemporarytable(a,r,o,s).then(c=>c(e,n))},postTemporarytableInPackage(a,r,o,s,c){return t.postTemporarytableInPackage(a,r,o,s,c).then(i=>i(e,n))},updateConnection(a,r,o,s){return t.updateConnection(a,r,o,s).then(c=>c(e,n))}}};class Z extends x{createConnection(n,e,t,a){return S(this.configuration).createConnection(n,e,t,a).then(r=>r(this.axios,this.basePath))}deleteConnection(n,e,t){return S(this.configuration).deleteConnection(n,e,t).then(a=>a(this.axios,this.basePath))}getConnection(n,e,t){return S(this.configuration).getConnection(n,e,t).then(a=>a(this.axios,this.basePath))}getTable(n,e,t,a,r){return S(this.configuration).getTable(n,e,t,a,r).then(o=>o(this.axios,this.basePath))}getTableInPackage(n,e,t,a,r,o){return S(this.configuration).getTableInPackage(n,e,t,a,r,o).then(s=>s(this.axios,this.basePath))}listConnections(n,e){return S(this.configuration).listConnections(n,e).then(t=>t(this.axios,this.basePath))}listSchemas(n,e,t){return S(this.configuration).listSchemas(n,e,t).then(a=>a(this.axios,this.basePath))}listSchemasInPackage(n,e,t,a){return S(this.configuration).listSchemasInPackage(n,e,t,a).then(r=>r(this.axios,this.basePath))}listTables(n,e,t,a,r){return S(this.configuration).listTables(n,e,t,a,r).then(o=>o(this.axios,this.basePath))}listTablesInPackage(n,e,t,a,r,o){return S(this.configuration).listTablesInPackage(n,e,t,a,r,o).then(s=>s(this.axios,this.basePath))}postQuerydata(n,e,t,a){return S(this.configuration).postQuerydata(n,e,t,a).then(r=>r(this.axios,this.basePath))}postQuerydataInPackage(n,e,t,a,r){return S(this.configuration).postQuerydataInPackage(n,e,t,a,r).then(o=>o(this.axios,this.basePath))}postSqlsource(n,e,t,a){return S(this.configuration).postSqlsource(n,e,t,a).then(r=>r(this.axios,this.basePath))}postSqlsourceInPackage(n,e,t,a,r){return S(this.configuration).postSqlsourceInPackage(n,e,t,a,r).then(o=>o(this.axios,this.basePath))}postTemporarytable(n,e,t,a){return S(this.configuration).postTemporarytable(n,e,t,a).then(r=>r(this.axios,this.basePath))}postTemporarytableInPackage(n,e,t,a,r){return S(this.configuration).postTemporarytableInPackage(n,e,t,a,r).then(o=>o(this.axios,this.basePath))}updateConnection(n,e,t,a){return S(this.configuration).updateConnection(n,e,t,a).then(r=>r(this.axios,this.basePath))}}const ee=function(l){return{testConnectionConfiguration:async(n,e={})=>{m("testConnectionConfiguration","connection",n);const t="/connections/test",a=new URL(t,b);let r;l&&(r=l.baseOptions);const o={method:"POST",...r,...e},s={},c={};s["Content-Type"]="application/json",P(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...s,...i,...e.headers},o.data=C(n,o,l),{url:v(a),options:o}}}},_=function(l){const n=ee(l);return{async testConnectionConfiguration(e,t){const a=await n.testConnectionConfiguration(e,t),r=l?.serverIndex??0,o=g["ConnectionsTestApi.testConnectionConfiguration"]?.[r]?.url;return(s,c)=>V(a,h,u,l)(s,o||c)}}},ua=function(l,n,e){const t=_(l);return{testConnectionConfiguration(a,r){return t.testConnectionConfiguration(a,r).then(o=>o(e,n))}}};class ga extends x{testConnectionConfiguration(n,e){return _(this.configuration).testConnectionConfiguration(n,e).then(t=>t(this.axios,this.basePath))}}const ae=function(l){return{getDashboard:async(n,e,t,a,r={})=>{m("getDashboard","environmentName",n),m("getDashboard","packageName",e),m("getDashboard","dashboardName",t);const o="/environments/{environmentName}/packages/{packageName}/dashboards/{dashboardName}".replace("{environmentName}",encodeURIComponent(String(n))).replace("{packageName}",encodeURIComponent(String(e))).replace("{dashboardName}",encodeURIComponent(String(t))),s=new URL(o,b);let c;l&&(c=l.baseOptions);const i={method:"GET",...c,...r},d={},p={};a!==void 0&&(p.versionId=a),P(s,p);let O=c&&c.headers?c.headers:{};return i.headers={...d,...O,...r.headers},{url:v(s),options:i}},listDashboards:async(n,e,t,a={})=>{m("listDashboards","environmentName",n),m("listDashboards","packageName",e);const r="/environments/{environmentName}/packages/{packageName}/dashboards".replace("{environmentName}",encodeURIComponent(String(n))).replace("{packageName}",encodeURIComponent(String(e))),o=new URL(r,b);let s;l&&(s=l.baseOptions);const c={method:"GET",...s,...a},i={},d={};t!==void 0&&(d.versionId=t),P(o,d);let p=s&&s.headers?s.headers:{};return c.headers={...i,...p,...a.headers},{url:v(o),options:c}}}},z=function(l){const n=ae(l);return{async getDashboard(e,t,a,r,o){const s=await n.getDashboard(e,t,a,r,o),c=l?.serverIndex??0,i=g["DashboardsApi.getDashboard"]?.[c]?.url;return(d,p)=>V(s,h,u,l)(d,i||p)},async listDashboards(e,t,a,r){const o=await n.listDashboards(e,t,a,r),s=l?.serverIndex??0,c=g["DashboardsApi.listDashboards"]?.[s]?.url;return(i,d)=>V(o,h,u,l)(i,c||d)}}},ba=function(l,n,e){const t=z(l);return{getDashboard(a,r,o,s,c){return t.getDashboard(a,r,o,s,c).then(i=>i(e,n))},listDashboards(a,r,o,s){return t.listDashboards(a,r,o,s).then(c=>c(e,n))}}};class te extends x{getDashboard(n,e,t,a,r){return z(this.configuration).getDashboard(n,e,t,a,r).then(o=>o(this.axios,this.basePath))}listDashboards(n,e,t,a){return z(this.configuration).listDashboards(n,e,t,a).then(r=>r(this.axios,this.basePath))}}const re=function(l){return{listDataApps:async(n,e,t={})=>{m("listDataApps","environmentName",n),m("listDataApps","packageName",e);const a="/environments/{environmentName}/packages/{packageName}/data-apps".replace("{environmentName}",encodeURIComponent(String(n))).replace("{packageName}",encodeURIComponent(String(e))),r=new URL(a,b);let o;l&&(o=l.baseOptions);const s={method:"GET",...o,...t},c={};P(r,{});let d=o&&o.headers?o.headers:{};return s.headers={...c,...d,...t.headers},{url:v(r),options:s}}}},W=function(l){const n=re(l);return{async listDataApps(e,t,a){const r=await n.listDataApps(e,t,a),o=l?.serverIndex??0,s=g["DataAppsApi.listDataApps"]?.[o]?.url;return(c,i)=>V(r,h,u,l)(c,s||i)}}},Pa=function(l,n,e){const t=W(l);return{listDataApps(a,r,o){return t.listDataApps(a,r,o).then(s=>s(e,n))}}};class ne extends x{listDataApps(n,e,t){return W(this.configuration).listDataApps(n,e,t).then(a=>a(this.axios,this.basePath))}}const oe=function(l){return{listDatabases:async(n,e,t,a={})=>{m("listDatabases","environmentName",n),m("listDatabases","packageName",e);const r="/environments/{environmentName}/packages/{packageName}/databases".replace("{environmentName}",encodeURIComponent(String(n))).replace("{packageName}",encodeURIComponent(String(e))),o=new URL(r,b);let s;l&&(s=l.baseOptions);const c={method:"GET",...s,...a},i={},d={};t!==void 0&&(d.versionId=t),P(o,d);let p=s&&s.headers?s.headers:{};return c.headers={...i,...p,...a.headers},{url:v(o),options:c}}}},G=function(l){const n=oe(l);return{async listDatabases(e,t,a,r){const o=await n.listDatabases(e,t,a,r),s=l?.serverIndex??0,c=g["DatabasesApi.listDatabases"]?.[s]?.url;return(i,d)=>V(o,h,u,l)(i,c||d)}}},va=function(l,n,e){const t=G(l);return{listDatabases(a,r,o,s){return t.listDatabases(a,r,o,s).then(c=>c(e,n))}}};class se extends x{listDatabases(n,e,t,a){return G(this.configuration).listDatabases(n,e,t,a).then(r=>r(this.axios,this.basePath))}}const le=function(l){return{createEnvironment:async(n,e={})=>{m("createEnvironment","environment",n);const t="/environments",a=new URL(t,b);let r;l&&(r=l.baseOptions);const o={method:"POST",...r,...e},s={},c={};s["Content-Type"]="application/json",P(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...s,...i,...e.headers},o.data=C(n,o,l),{url:v(a),options:o}},deleteEnvironment:async(n,e={})=>{m("deleteEnvironment","environmentName",n);const t="/environments/{environmentName}".replace("{environmentName}",encodeURIComponent(String(n))),a=new URL(t,b);let r;l&&(r=l.baseOptions);const o={method:"DELETE",...r,...e},s={};P(a,{});let i=r&&r.headers?r.headers:{};return o.headers={...s,...i,...e.headers},{url:v(a),options:o}},getEnvironment:async(n,e,t={})=>{m("getEnvironment","environmentName",n);const a="/environments/{environmentName}".replace("{environmentName}",encodeURIComponent(String(n))),r=new URL(a,b);let o;l&&(o=l.baseOptions);const s={method:"GET",...o,...t},c={},i={};e!==void 0&&(i.reload=e),P(r,i);let d=o&&o.headers?o.headers:{};return s.headers={...c,...d,...t.headers},{url:v(r),options:s}},listEnvironments:async(n={})=>{const e="/environments",t=new URL(e,b);let a;l&&(a=l.baseOptions);const r={method:"GET",...a,...n},o={};P(t,{});let c=a&&a.headers?a.headers:{};return r.headers={...o,...c,...n.headers},{url:v(t),options:r}},updateEnvironment:async(n,e,t={})=>{m("updateEnvironment","environmentName",n),m("updateEnvironment","environment",e);const a="/environments/{environmentName}".replace("{environmentName}",encodeURIComponent(String(n))),r=new URL(a,b);let o;l&&(o=l.baseOptions);const s={method:"PATCH",...o,...t},c={},i={};c["Content-Type"]="application/json",P(r,i);let d=o&&o.headers?o.headers:{};return s.headers={...c,...d,...t.headers},s.data=C(e,s,l),{url:v(r),options:s}}}},E=function(l){const n=le(l);return{async createEnvironment(e,t){const a=await n.createEnvironment(e,t),r=l?.serverIndex??0,o=g["EnvironmentsApi.createEnvironment"]?.[r]?.url;return(s,c)=>V(a,h,u,l)(s,o||c)},async deleteEnvironment(e,t){const a=await n.deleteEnvironment(e,t),r=l?.serverIndex??0,o=g["EnvironmentsApi.deleteEnvironment"]?.[r]?.url;return(s,c)=>V(a,h,u,l)(s,o||c)},async getEnvironment(e,t,a){const r=await n.getEnvironment(e,t,a),o=l?.serverIndex??0,s=g["EnvironmentsApi.getEnvironment"]?.[o]?.url;return(c,i)=>V(r,h,u,l)(c,s||i)},async listEnvironments(e){const t=await n.listEnvironments(e),a=l?.serverIndex??0,r=g["EnvironmentsApi.listEnvironments"]?.[a]?.url;return(o,s)=>V(t,h,u,l)(o,r||s)},async updateEnvironment(e,t,a){const r=await n.updateEnvironment(e,t,a),o=l?.serverIndex??0,s=g["EnvironmentsApi.updateEnvironment"]?.[o]?.url;return(c,i)=>V(r,h,u,l)(c,s||i)}}},Va=function(l,n,e){const t=E(l);return{createEnvironment(a,r){return t.createEnvironment(a,r).then(o=>o(e,n))},deleteEnvironment(a,r){return t.deleteEnvironment(a,r).then(o=>o(e,n))},getEnvironment(a,r,o){return t.getEnvironment(a,r,o).then(s=>s(e,n))},listEnvironments(a){return t.listEnvironments(a).then(r=>r(e,n))},updateEnvironment(a,r,o){return t.updateEnvironment(a,r,o).then(s=>s(e,n))}}};class ce extends x{createEnvironment(n,e){return E(this.configuration).createEnvironment(n,e).then(t=>t(this.axios,this.basePath))}deleteEnvironment(n,e){return E(this.configuration).deleteEnvironment(n,e).then(t=>t(this.axios,this.basePath))}getEnvironment(n,e,t){return E(this.configuration).getEnvironment(n,e,t).then(a=>a(this.axios,this.basePath))}listEnvironments(n){return E(this.configuration).listEnvironments(n).then(e=>e(this.axios,this.basePath))}updateEnvironment(n,e,t){return E(this.configuration).updateEnvironment(n,e,t).then(a=>a(this.axios,this.basePath))}}const ie=function(l){return{createMaterialization:async(n,e,t,a={})=>{m("createMaterialization","environmentName",n),m("createMaterialization","packageName",e);const r="/environments/{environmentName}/packages/{packageName}/materializations".replace("{environmentName}",encodeURIComponent(String(n))).replace("{packageName}",encodeURIComponent(String(e))),o=new URL(r,b);let s;l&&(s=l.baseOptions);const c={method:"POST",...s,...a},i={},d={};i["Content-Type"]="application/json",P(o,d);let p=s&&s.headers?s.headers:{};return c.headers={...i,...p,...a.headers},c.data=C(t,c,l),{url:v(o),options:c}},deleteMaterialization:async(n,e,t,a,r={})=>{m("deleteMaterialization","environmentName",n),m("deleteMaterialization","packageName",e),m("deleteMaterialization","materializationId",t);const o="/environments/{environmentName}/packages/{packageName}/materializations/{materializationId}".replace("{environmentName}",encodeURIComponent(String(n))).replace("{packageName}",encodeURIComponent(String(e))).replace("{materializationId}",encodeURIComponent(String(t))),s=new URL(o,b);let c;l&&(c=l.baseOptions);const i={method:"DELETE",...c,...r},d={},p={};a!==void 0&&(p.dropTables=a),P(s,p);let O=c&&c.headers?c.headers:{};return i.headers={...d,...O,...r.headers},{url:v(s),options:i}},getMaterialization:async(n,e,t,a={})=>{m("getMaterialization","environmentName",n),m("getMaterialization","packageName",e),m("getMaterialization","materializationId",t);const r="/environments/{environmentName}/packages/{packageName}/materializations/{materializationId}".replace("{environmentName}",encodeURIComponent(String(n))).replace("{packageName}",encodeURIComponent(String(e))).replace("{materializationId}",encodeURIComponent(String(t))),o=new URL(r,b);let s;l&&(s=l.baseOptions);const c={method:"GET",...s,...a},i={};P(o,{});let p=s&&s.headers?s.headers:{};return c.headers={...i,...p,...a.headers},{url:v(o),options:c}},listEnvironmentMaterializations:async(n,e,t,a={})=>{m("listEnvironmentMaterializations","environmentName",n);const r="/environments/{environmentName}/packages/materializations".replace("{environmentName}",encodeURIComponent(String(n))),o=new URL(r,b);let s;l&&(s=l.baseOptions);const c={method:"GET",...s,...a},i={},d={};e!==void 0&&(d.limit=e),t!==void 0&&(d.offset=t),P(o,d);let p=s&&s.headers?s.headers:{};return c.headers={...i,...p,...a.headers},{url:v(o),options:c}},listMaterializations:async(n,e,t,a,r={})=>{m("listMaterializations","environmentName",n),m("listMaterializations","packageName",e);const o="/environments/{environmentName}/packages/{packageName}/materializations".replace("{environmentName}",encodeURIComponent(String(n))).replace("{packageName}",encodeURIComponent(String(e))),s=new URL(o,b);let c;l&&(c=l.baseOptions);const i={method:"GET",...c,...r},d={},p={};t!==void 0&&(p.limit=t),a!==void 0&&(p.offset=a),P(s,p);let O=c&&c.headers?c.headers:{};return i.headers={...d,...O,...r.headers},{url:v(s),options:i}},materializationAction:async(n,e,t,a,r={})=>{m("materializationAction","environmentName",n),m("materializationAction","packageName",e),m("materializationAction","materializationId",t),m("materializationAction","action",a);const o="/environments/{environmentName}/packages/{packageName}/materializations/{materializationId}".replace("{environmentName}",encodeURIComponent(String(n))).replace("{packageName}",encodeURIComponent(String(e))).replace("{materializationId}",encodeURIComponent(String(t))),s=new URL(o,b);let c;l&&(c=l.baseOptions);const i={method:"POST",...c,...r},d={},p={};a!==void 0&&(p.action=a),P(s,p);let O=c&&c.headers?c.headers:{};return i.headers={...d,...O,...r.headers},{url:v(s),options:i}}}},R=function(l){const n=ie(l);return{async createMaterialization(e,t,a,r){const o=await n.createMaterialization(e,t,a,r),s=l?.serverIndex??0,c=g["MaterializationsApi.createMaterialization"]?.[s]?.url;return(i,d)=>V(o,h,u,l)(i,c||d)},async deleteMaterialization(e,t,a,r,o){const s=await n.deleteMaterialization(e,t,a,r,o),c=l?.serverIndex??0,i=g["MaterializationsApi.deleteMaterialization"]?.[c]?.url;return(d,p)=>V(s,h,u,l)(d,i||p)},async getMaterialization(e,t,a,r){const o=await n.getMaterialization(e,t,a,r),s=l?.serverIndex??0,c=g["MaterializationsApi.getMaterialization"]?.[s]?.url;return(i,d)=>V(o,h,u,l)(i,c||d)},async listEnvironmentMaterializations(e,t,a,r){const o=await n.listEnvironmentMaterializations(e,t,a,r),s=l?.serverIndex??0,c=g["MaterializationsApi.listEnvironmentMaterializations"]?.[s]?.url;return(i,d)=>V(o,h,u,l)(i,c||d)},async listMaterializations(e,t,a,r,o){const s=await n.listMaterializations(e,t,a,r,o),c=l?.serverIndex??0,i=g["MaterializationsApi.listMaterializations"]?.[c]?.url;return(d,p)=>V(s,h,u,l)(d,i||p)},async materializationAction(e,t,a,r,o){const s=await n.materializationAction(e,t,a,r,o),c=l?.serverIndex??0,i=g["MaterializationsApi.materializationAction"]?.[c]?.url;return(d,p)=>V(s,h,u,l)(d,i||p)}}},Oa=function(l,n,e){const t=R(l);return{createMaterialization(a,r,o,s){return t.createMaterialization(a,r,o,s).then(c=>c(e,n))},deleteMaterialization(a,r,o,s,c){return t.deleteMaterialization(a,r,o,s,c).then(i=>i(e,n))},getMaterialization(a,r,o,s){return t.getMaterialization(a,r,o,s).then(c=>c(e,n))},listEnvironmentMaterializations(a,r,o,s){return t.listEnvironmentMaterializations(a,r,o,s).then(c=>c(e,n))},listMaterializations(a,r,o,s,c){return t.listMaterializations(a,r,o,s,c).then(i=>i(e,n))},materializationAction(a,r,o,s,c){return t.materializationAction(a,r,o,s,c).then(i=>i(e,n))}}};class de extends x{createMaterialization(n,e,t,a){return R(this.configuration).createMaterialization(n,e,t,a).then(r=>r(this.axios,this.basePath))}deleteMaterialization(n,e,t,a,r){return R(this.configuration).deleteMaterialization(n,e,t,a,r).then(o=>o(this.axios,this.basePath))}getMaterialization(n,e,t,a){return R(this.configuration).getMaterialization(n,e,t,a).then(r=>r(this.axios,this.basePath))}listEnvironmentMaterializations(n,e,t,a){return R(this.configuration).listEnvironmentMaterializations(n,e,t,a).then(r=>r(this.axios,this.basePath))}listMaterializations(n,e,t,a,r){return R(this.configuration).listMaterializations(n,e,t,a,r).then(o=>o(this.axios,this.basePath))}materializationAction(n,e,t,a,r){return R(this.configuration).materializationAction(n,e,t,a,r).then(o=>o(this.axios,this.basePath))}}const ya={Stop:"stop"},pe=function(l){return{compileModelSource:async(n,e,t,a,r={})=>{m("compileModelSource","environmentName",n),m("compileModelSource","packageName",e),m("compileModelSource","path",t),m("compileModelSource","compileRequest",a);const o="/environments/{environmentName}/packages/{packageName}/models/{path}/compile".replace("{environmentName}",encodeURIComponent(String(n))).replace("{packageName}",encodeURIComponent(String(e))).replace("{path}",encodeURIComponent(String(t))),s=new URL(o,b);let c;l&&(c=l.baseOptions);const i={method:"POST",...c,...r},d={},p={};d["Content-Type"]="application/json",P(s,p);let O=c&&c.headers?c.headers:{};return i.headers={...d,...O,...r.headers},i.data=C(a,i,l),{url:v(s),options:i}},executeQueryModel:async(n,e,t,a,r={})=>{m("executeQueryModel","environmentName",n),m("executeQueryModel","packageName",e),m("executeQueryModel","path",t),m("executeQueryModel","queryRequest",a);const o="/environments/{environmentName}/packages/{packageName}/models/{path}/query".replace("{environmentName}",encodeURIComponent(String(n))).replace("{packageName}",encodeURIComponent(String(e))).replace("{path}",encodeURIComponent(String(t))),s=new URL(o,b);let c;l&&(c=l.baseOptions);const i={method:"POST",...c,...r},d={},p={};d["Content-Type"]="application/json",P(s,p);let O=c&&c.headers?c.headers:{};return i.headers={...d,...O,...r.headers},i.data=C(a,i,l),{url:v(s),options:i}},getModel:async(n,e,t,a,r={})=>{m("getModel","environmentName",n),m("getModel","packageName",e),m("getModel","path",t);const o="/environments/{environmentName}/packages/{packageName}/models/{path}".replace("{environmentName}",encodeURIComponent(String(n))).replace("{packageName}",encodeURIComponent(String(e))).replace("{path}",encodeURIComponent(String(t))),s=new URL(o,b);let c;l&&(c=l.baseOptions);const i={method:"GET",...c,...r},d={},p={};a!==void 0&&(p.versionId=a),P(s,p);let O=c&&c.headers?c.headers:{};return i.headers={...d,...O,...r.headers},{url:v(s),options:i}},listModels:async(n,e,t,a={})=>{m("listModels","environmentName",n),m("listModels","packageName",e);const r="/environments/{environmentName}/packages/{packageName}/models".replace("{environmentName}",encodeURIComponent(String(n))).replace("{packageName}",encodeURIComponent(String(e))),o=new URL(r,b);let s;l&&(s=l.baseOptions);const c={method:"GET",...s,...a},i={},d={};t!==void 0&&(d.versionId=t),P(o,d);let p=s&&s.headers?s.headers:{};return c.headers={...i,...p,...a.headers},{url:v(o),options:c}}}},U=function(l){const n=pe(l);return{async compileModelSource(e,t,a,r,o){const s=await n.compileModelSource(e,t,a,r,o),c=l?.serverIndex??0,i=g["ModelsApi.compileModelSource"]?.[c]?.url;return(d,p)=>V(s,h,u,l)(d,i||p)},async executeQueryModel(e,t,a,r,o){const s=await n.executeQueryModel(e,t,a,r,o),c=l?.serverIndex??0,i=g["ModelsApi.executeQueryModel"]?.[c]?.url;return(d,p)=>V(s,h,u,l)(d,i||p)},async getModel(e,t,a,r,o){const s=await n.getModel(e,t,a,r,o),c=l?.serverIndex??0,i=g["ModelsApi.getModel"]?.[c]?.url;return(d,p)=>V(s,h,u,l)(d,i||p)},async listModels(e,t,a,r){const o=await n.listModels(e,t,a,r),s=l?.serverIndex??0,c=g["ModelsApi.listModels"]?.[s]?.url;return(i,d)=>V(o,h,u,l)(i,c||d)}}},Sa=function(l,n,e){const t=U(l);return{compileModelSource(a,r,o,s,c){return t.compileModelSource(a,r,o,s,c).then(i=>i(e,n))},executeQueryModel(a,r,o,s,c){return t.executeQueryModel(a,r,o,s,c).then(i=>i(e,n))},getModel(a,r,o,s,c){return t.getModel(a,r,o,s,c).then(i=>i(e,n))},listModels(a,r,o,s){return t.listModels(a,r,o,s).then(c=>c(e,n))}}};class me extends x{compileModelSource(n,e,t,a,r){return U(this.configuration).compileModelSource(n,e,t,a,r).then(o=>o(this.axios,this.basePath))}executeQueryModel(n,e,t,a,r){return U(this.configuration).executeQueryModel(n,e,t,a,r).then(o=>o(this.axios,this.basePath))}getModel(n,e,t,a,r){return U(this.configuration).getModel(n,e,t,a,r).then(o=>o(this.axios,this.basePath))}listModels(n,e,t,a){return U(this.configuration).listModels(n,e,t,a).then(r=>r(this.axios,this.basePath))}}const he=function(l){return{executeNotebookCell:async(n,e,t,a,r,o,s,c,i={})=>{m("executeNotebookCell","environmentName",n),m("executeNotebookCell","packageName",e),m("executeNotebookCell","path",t),m("executeNotebookCell","cellIndex",a);const d="/environments/{environmentName}/packages/{packageName}/notebooks/{path}/cells/{cellIndex}".replace("{environmentName}",encodeURIComponent(String(n))).replace("{packageName}",encodeURIComponent(String(e))).replace("{path}",encodeURIComponent(String(t))).replace("{cellIndex}",encodeURIComponent(String(a))),p=new URL(d,b);let O;l&&(O=l.baseOptions);const k={method:"GET",...O,...i},F={},I={};r!==void 0&&(I.versionId=r),o!==void 0&&(I.filter_params=o),s!==void 0&&(I.bypass_filters=s),c!==void 0&&(I.givens=c),P(p,I);let D=O&&O.headers?O.headers:{};return k.headers={...F,...D,...i.headers},{url:v(p),options:k}},getNotebook:async(n,e,t,a,r={})=>{m("getNotebook","environmentName",n),m("getNotebook","packageName",e),m("getNotebook","path",t);const o="/environments/{environmentName}/packages/{packageName}/notebooks/{path}".replace("{environmentName}",encodeURIComponent(String(n))).replace("{packageName}",encodeURIComponent(String(e))).replace("{path}",encodeURIComponent(String(t))),s=new URL(o,b);let c;l&&(c=l.baseOptions);const i={method:"GET",...c,...r},d={},p={};a!==void 0&&(p.versionId=a),P(s,p);let O=c&&c.headers?c.headers:{};return i.headers={...d,...O,...r.headers},{url:v(s),options:i}},listNotebooks:async(n,e,t,a={})=>{m("listNotebooks","environmentName",n),m("listNotebooks","packageName",e);const r="/environments/{environmentName}/packages/{packageName}/notebooks".replace("{environmentName}",encodeURIComponent(String(n))).replace("{packageName}",encodeURIComponent(String(e))),o=new URL(r,b);let s;l&&(s=l.baseOptions);const c={method:"GET",...s,...a},i={},d={};t!==void 0&&(d.versionId=t),P(o,d);let p=s&&s.headers?s.headers:{};return c.headers={...i,...p,...a.headers},{url:v(o),options:c}}}},B=function(l){const n=he(l);return{async executeNotebookCell(e,t,a,r,o,s,c,i,d){const p=await n.executeNotebookCell(e,t,a,r,o,s,c,i,d),O=l?.serverIndex??0,k=g["NotebooksApi.executeNotebookCell"]?.[O]?.url;return(F,I)=>V(p,h,u,l)(F,k||I)},async getNotebook(e,t,a,r,o){const s=await n.getNotebook(e,t,a,r,o),c=l?.serverIndex??0,i=g["NotebooksApi.getNotebook"]?.[c]?.url;return(d,p)=>V(s,h,u,l)(d,i||p)},async listNotebooks(e,t,a,r){const o=await n.listNotebooks(e,t,a,r),s=l?.serverIndex??0,c=g["NotebooksApi.listNotebooks"]?.[s]?.url;return(i,d)=>V(o,h,u,l)(i,c||d)}}},Ca=function(l,n,e){const t=B(l);return{executeNotebookCell(a,r,o,s,c,i,d,p,O){return t.executeNotebookCell(a,r,o,s,c,i,d,p,O).then(k=>k(e,n))},getNotebook(a,r,o,s,c){return t.getNotebook(a,r,o,s,c).then(i=>i(e,n))},listNotebooks(a,r,o,s){return t.listNotebooks(a,r,o,s).then(c=>c(e,n))}}};class ue extends x{executeNotebookCell(n,e,t,a,r,o,s,c,i){return B(this.configuration).executeNotebookCell(n,e,t,a,r,o,s,c,i).then(d=>d(this.axios,this.basePath))}getNotebook(n,e,t,a,r){return B(this.configuration).getNotebook(n,e,t,a,r).then(o=>o(this.axios,this.basePath))}listNotebooks(n,e,t,a){return B(this.configuration).listNotebooks(n,e,t,a).then(r=>r(this.axios,this.basePath))}}const ka={True:"true",False:"false"},ge=function(l){return{createPackage:async(n,e,t={})=>{m("createPackage","environmentName",n),m("createPackage","_package",e);const a="/environments/{environmentName}/packages".replace("{environmentName}",encodeURIComponent(String(n))),r=new URL(a,b);let o;l&&(o=l.baseOptions);const s={method:"POST",...o,...t},c={},i={};c["Content-Type"]="application/json",P(r,i);let d=o&&o.headers?o.headers:{};return s.headers={...c,...d,...t.headers},s.data=C(e,s,l),{url:v(r),options:s}},deletePackage:async(n,e,t={})=>{m("deletePackage","environmentName",n),m("deletePackage","packageName",e);const a="/environments/{environmentName}/packages/{packageName}".replace("{environmentName}",encodeURIComponent(String(n))).replace("{packageName}",encodeURIComponent(String(e))),r=new URL(a,b);let o;l&&(o=l.baseOptions);const s={method:"DELETE",...o,...t},c={};P(r,{});let d=o&&o.headers?o.headers:{};return s.headers={...c,...d,...t.headers},{url:v(r),options:s}},getPackage:async(n,e,t,a,r={})=>{m("getPackage","environmentName",n),m("getPackage","packageName",e);const o="/environments/{environmentName}/packages/{packageName}".replace("{environmentName}",encodeURIComponent(String(n))).replace("{packageName}",encodeURIComponent(String(e))),s=new URL(o,b);let c;l&&(c=l.baseOptions);const i={method:"GET",...c,...r},d={},p={};t!==void 0&&(p.versionId=t),a!==void 0&&(p.reload=a),P(s,p);let O=c&&c.headers?c.headers:{};return i.headers={...d,...O,...r.headers},{url:v(s),options:i}},listPackages:async(n,e={})=>{m("listPackages","environmentName",n);const t="/environments/{environmentName}/packages".replace("{environmentName}",encodeURIComponent(String(n))),a=new URL(t,b);let r;l&&(r=l.baseOptions);const o={method:"GET",...r,...e},s={};P(a,{});let i=r&&r.headers?r.headers:{};return o.headers={...s,...i,...e.headers},{url:v(a),options:o}},updatePackage:async(n,e,t,a={})=>{m("updatePackage","environmentName",n),m("updatePackage","packageName",e),m("updatePackage","_package",t);const r="/environments/{environmentName}/packages/{packageName}".replace("{environmentName}",encodeURIComponent(String(n))).replace("{packageName}",encodeURIComponent(String(e))),o=new URL(r,b);let s;l&&(s=l.baseOptions);const c={method:"PATCH",...s,...a},i={},d={};i["Content-Type"]="application/json",P(o,d);let p=s&&s.headers?s.headers:{};return c.headers={...i,...p,...a.headers},c.data=C(t,c,l),{url:v(o),options:c}}}},N=function(l){const n=ge(l);return{async createPackage(e,t,a){const r=await n.createPackage(e,t,a),o=l?.serverIndex??0,s=g["PackagesApi.createPackage"]?.[o]?.url;return(c,i)=>V(r,h,u,l)(c,s||i)},async deletePackage(e,t,a){const r=await n.deletePackage(e,t,a),o=l?.serverIndex??0,s=g["PackagesApi.deletePackage"]?.[o]?.url;return(c,i)=>V(r,h,u,l)(c,s||i)},async getPackage(e,t,a,r,o){const s=await n.getPackage(e,t,a,r,o),c=l?.serverIndex??0,i=g["PackagesApi.getPackage"]?.[c]?.url;return(d,p)=>V(s,h,u,l)(d,i||p)},async listPackages(e,t){const a=await n.listPackages(e,t),r=l?.serverIndex??0,o=g["PackagesApi.listPackages"]?.[r]?.url;return(s,c)=>V(a,h,u,l)(s,o||c)},async updatePackage(e,t,a,r){const o=await n.updatePackage(e,t,a,r),s=l?.serverIndex??0,c=g["PackagesApi.updatePackage"]?.[s]?.url;return(i,d)=>V(o,h,u,l)(i,c||d)}}},Aa=function(l,n,e){const t=N(l);return{createPackage(a,r,o){return t.createPackage(a,r,o).then(s=>s(e,n))},deletePackage(a,r,o){return t.deletePackage(a,r,o).then(s=>s(e,n))},getPackage(a,r,o,s,c){return t.getPackage(a,r,o,s,c).then(i=>i(e,n))},listPackages(a,r){return t.listPackages(a,r).then(o=>o(e,n))},updatePackage(a,r,o,s){return t.updatePackage(a,r,o,s).then(c=>c(e,n))}}};class be extends x{createPackage(n,e,t){return N(this.configuration).createPackage(n,e,t).then(a=>a(this.axios,this.basePath))}deletePackage(n,e,t){return N(this.configuration).deletePackage(n,e,t).then(a=>a(this.axios,this.basePath))}getPackage(n,e,t,a,r){return N(this.configuration).getPackage(n,e,t,a,r).then(o=>o(this.axios,this.basePath))}listPackages(n,e){return N(this.configuration).listPackages(n,e).then(t=>t(this.axios,this.basePath))}updatePackage(n,e,t,a){return N(this.configuration).updatePackage(n,e,t,a).then(r=>r(this.axios,this.basePath))}}const Pe=function(l){return{deleteTheme:async(n={})=>{const e="/theme",t=new URL(e,b);let a;l&&(a=l.baseOptions);const r={method:"DELETE",...a,...n},o={};P(t,{});let c=a&&a.headers?a.headers:{};return r.headers={...o,...c,...n.headers},{url:v(t),options:r}},getStatus:async(n={})=>{const e="/status",t=new URL(e,b);let a;l&&(a=l.baseOptions);const r={method:"GET",...a,...n},o={};P(t,{});let c=a&&a.headers?a.headers:{};return r.headers={...o,...c,...n.headers},{url:v(t),options:r}},getTheme:async(n={})=>{const e="/theme",t=new URL(e,b);let a;l&&(a=l.baseOptions);const r={method:"GET",...a,...n},o={};P(t,{});let c=a&&a.headers?a.headers:{};return r.headers={...o,...c,...n.headers},{url:v(t),options:r}},updateTheme:async(n,e={})=>{m("updateTheme","theme",n);const t="/theme",a=new URL(t,b);let r;l&&(r=l.baseOptions);const o={method:"PUT",...r,...e},s={},c={};s["Content-Type"]="application/json",P(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...s,...i,...e.headers},o.data=C(n,o,l),{url:v(a),options:o}}}},M=function(l){const n=Pe(l);return{async deleteTheme(e){const t=await n.deleteTheme(e),a=l?.serverIndex??0,r=g["PublisherApi.deleteTheme"]?.[a]?.url;return(o,s)=>V(t,h,u,l)(o,r||s)},async getStatus(e){const t=await n.getStatus(e),a=l?.serverIndex??0,r=g["PublisherApi.getStatus"]?.[a]?.url;return(o,s)=>V(t,h,u,l)(o,r||s)},async getTheme(e){const t=await n.getTheme(e),a=l?.serverIndex??0,r=g["PublisherApi.getTheme"]?.[a]?.url;return(o,s)=>V(t,h,u,l)(o,r||s)},async updateTheme(e,t){const a=await n.updateTheme(e,t),r=l?.serverIndex??0,o=g["PublisherApi.updateTheme"]?.[r]?.url;return(s,c)=>V(a,h,u,l)(s,o||c)}}},xa=function(l,n,e){const t=M(l);return{deleteTheme(a){return t.deleteTheme(a).then(r=>r(e,n))},getStatus(a){return t.getStatus(a).then(r=>r(e,n))},getTheme(a){return t.getTheme(a).then(r=>r(e,n))},updateTheme(a,r){return t.updateTheme(a,r).then(o=>o(e,n))}}};class ve extends x{deleteTheme(n){return M(this.configuration).deleteTheme(n).then(e=>e(this.axios,this.basePath))}getStatus(n){return M(this.configuration).getStatus(n).then(e=>e(this.axios,this.basePath))}getTheme(n){return M(this.configuration).getTheme(n).then(e=>e(this.axios,this.basePath))}updateTheme(n,e){return M(this.configuration).updateTheme(n,e).then(t=>t(this.axios,this.basePath))}}const Ve=function(l){return{getWatchStatus:async(n={})=>{const e="/watch-mode/status",t=new URL(e,b);let a;l&&(a=l.baseOptions);const r={method:"GET",...a,...n},o={};P(t,{});let c=a&&a.headers?a.headers:{};return r.headers={...o,...c,...n.headers},{url:v(t),options:r}},startWatching:async(n,e={})=>{m("startWatching","startWatchRequest",n);const t="/watch-mode/start",a=new URL(t,b);let r;l&&(r=l.baseOptions);const o={method:"POST",...r,...e},s={},c={};s["Content-Type"]="application/json",P(a,c);let i=r&&r.headers?r.headers:{};return o.headers={...s,...i,...e.headers},o.data=C(n,o,l),{url:v(a),options:o}},stopWatching:async(n={})=>{const e="/watch-mode/stop",t=new URL(e,b);let a;l&&(a=l.baseOptions);const r={method:"POST",...a,...n},o={};P(t,{});let c=a&&a.headers?a.headers:{};return r.headers={...o,...c,...n.headers},{url:v(t),options:r}},streamPackageEvents:async(n,e,t={})=>{m("streamPackageEvents","environmentName",n),m("streamPackageEvents","packageName",e);const a="/environments/{environmentName}/packages/{packageName}/events".replace("{environmentName}",encodeURIComponent(String(n))).replace("{packageName}",encodeURIComponent(String(e))),r=new URL(a,b);let o;l&&(o=l.baseOptions);const s={method:"GET",...o,...t},c={};P(r,{});let d=o&&o.headers?o.headers:{};return s.headers={...c,...d,...t.headers},{url:v(r),options:s}}}},w=function(l){const n=Ve(l);return{async getWatchStatus(e){const t=await n.getWatchStatus(e),a=l?.serverIndex??0,r=g["WatchModeApi.getWatchStatus"]?.[a]?.url;return(o,s)=>V(t,h,u,l)(o,r||s)},async startWatching(e,t){const a=await n.startWatching(e,t),r=l?.serverIndex??0,o=g["WatchModeApi.startWatching"]?.[r]?.url;return(s,c)=>V(a,h,u,l)(s,o||c)},async stopWatching(e){const t=await n.stopWatching(e),a=l?.serverIndex??0,r=g["WatchModeApi.stopWatching"]?.[a]?.url;return(o,s)=>V(t,h,u,l)(o,r||s)},async streamPackageEvents(e,t,a){const r=await n.streamPackageEvents(e,t,a),o=l?.serverIndex??0,s=g["WatchModeApi.streamPackageEvents"]?.[o]?.url;return(c,i)=>V(r,h,u,l)(c,s||i)}}},Ia=function(l,n,e){const t=w(l);return{getWatchStatus(a){return t.getWatchStatus(a).then(r=>r(e,n))},startWatching(a,r){return t.startWatching(a,r).then(o=>o(e,n))},stopWatching(a){return t.stopWatching(a).then(r=>r(e,n))},streamPackageEvents(a,r,o){return t.streamPackageEvents(a,r,o).then(s=>s(e,n))}}};class Oe extends x{getWatchStatus(n){return w(this.configuration).getWatchStatus(n).then(e=>e(this.axios,this.basePath))}startWatching(n,e){return w(this.configuration).startWatching(n,e).then(t=>t(this.axios,this.basePath))}stopWatching(n){return w(this.configuration).stopWatching(n).then(e=>e(this.axios,this.basePath))}streamPackageEvents(n,e,t){return w(this.configuration).streamPackageEvents(n,e,t).then(a=>a(this.axios,this.basePath))}}class ye{apiKey;username;password;accessToken;basePath;serverIndex;baseOptions;formDataCtor;constructor(n={}){this.apiKey=n.apiKey,this.username=n.username,this.password=n.password,this.accessToken=n.accessToken,this.basePath=n.basePath,this.serverIndex=n.serverIndex,this.baseOptions={...n.baseOptions,headers:{...n.baseOptions?.headers}},this.formDataCtor=n.formDataCtor}isJsonMime(n){const e=new RegExp("^(application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(;.*)?$","i");return n!==null&&(e.test(n)||n.toLowerCase()==="application/json-patch+json")}}const f={teal:"#14b3cb",orange:"#e47404",darkBlue:"#1474a4"},Ra={violet:"#7c4dcc",magenta:"#c2478f",moss:"#5c8f3f"},Ea='"JetBrains Mono", "ui-monospace", "SFMono-Regular", "Menlo", monospace',Na=y.styled(y.Card)({display:"flex",flexDirection:"column",height:"100%",boxShadow:"none",border:"none",backgroundColor:"transparent"}),Ta=y.styled(y.CardContent)({display:"flex",flexDirection:"column",padding:"0",flexGrow:1}),Ua=y.styled(y.CardMedia)({padding:"0"}),Ma=y.styled("div")(({theme:l})=>({backgroundColor:l.palette.background.default,padding:"0 8px 0px 8px",borderRadius:"12px",boxShadow:"none",border:"none",maxWidth:"1200px",margin:"0 auto"}));y.styled("div")(({theme:l})=>({marginBottom:"40px",paddingBottom:"24px",borderBottom:`1px solid ${l.palette.divider}`}));const wa=y.styled("div")({marginBottom:"48px",padding:"0",backgroundColor:"transparent",border:"none",boxShadow:"none"}),fa=y.styled("div")({marginBottom:"0",padding:"0",backgroundColor:"transparent",border:"none",boxShadow:"none"}),Fa=y.styled("div")({backgroundColor:"transparent",paddingTop:"12px",paddingBottom:"2px",borderRadius:"8px",border:"none",boxShadow:"none",marginBottom:"0"});y.styled("div")(({theme:l})=>({backgroundColor:l.palette.mode==="dark"?"#1e293b":"#f8f9fa",padding:"16px",borderRadius:"8px",border:`1px solid ${l.palette.divider}`,fontFamily:"'Monaco', 'Menlo', 'Ubuntu Mono', monospace",fontSize:"13px",lineHeight:"1.5",overflowX:"auto",color:l.palette.text.primary}));y.styled("div")(({theme:l})=>({backgroundColor:l.palette.mode==="dark"?"#1e293b":"#f8f9fa",padding:"12px 16px",borderRadius:"8px",border:`1px solid ${l.palette.divider}`,marginBottom:"16px",display:"flex",justifyContent:"space-between",alignItems:"center"}));const Ba=y.styled("div")({height:"100%"});y.styled("div")({height:"30px",backgroundColor:"rgba(225, 240, 255, 1)",display:"flex",padding:"4px",alignItems:"center"});const Qa=y.styled("div")({height:"75vh",width:"100%",overflowY:"auto"});y.styled("div")({position:"relative",height:"100%",flex:"0 0 auto"});const za=y.styled(y.Card)(({theme:l})=>({backgroundColor:l.palette.background.paper,padding:"24px",borderRadius:"8px",border:`1px solid ${l.palette.divider}`,boxShadow:"0 1px 3px rgba(0, 0, 0, 0.04)",height:"100%",transition:"box-shadow 0.2s ease-in-out","&:hover":{boxShadow:"0 2px 6px rgba(0, 0, 0, 0.08)"}})),Da=y.styled(y.CardContent)({padding:"0","&:last-child":{paddingBottom:"0"}}),$a=y.styled("div")(({theme:l})=>({fontSize:"0.875rem",fontWeight:500,color:l.palette.text.secondary,marginBottom:"16px",paddingBottom:"8px",borderBottom:`1px solid ${l.palette.divider}`}));y.styled("div")({padding:"32px",maxWidth:"1400px",margin:"0 auto",minHeight:"100vh"});const qa=[f.teal,f.orange,f.darkBlue,"#66cedc","#ec72b8","#f9c85b","#aacd85","#b87ced"],La="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",L={defaultMode:"light",allowUserToggle:!0,palette:{series:qa,background:{light:"#ffffff",dark:"#1e293b"},tableHeader:{light:"#5d626b",dark:"#cbd5e1"},tableHeaderBackground:{light:"#f5fafc",dark:"#1e293b"},tableBody:{light:"#727883",dark:"#e2e8f0"},tile:{light:"#f5fafc",dark:"#0f172a"},tileTitle:{light:"#5d626b",dark:"#94a3b8"},mapColor:{light:f.teal,dark:f.teal}},font:{family:La,size:12}},Se=["background","tableHeader","tableHeaderBackground","tableBody","tile","tileTitle","mapColor"];function Y(l,n){const e=L.palette??{},t=L.font??{family:"sans-serif",size:12};let a=[...e.series??[]],r=t.family??"sans-serif",o=t.size??12;const s={background:{...e.background??{}},tableHeader:{...e.tableHeader??{}},tableHeaderBackground:{...e.tableHeaderBackground??{}},tableBody:{...e.tableBody??{}},tile:{...e.tile??{}},tileTitle:{...e.tileTitle??{}},mapColor:{...e.mapColor??{}}};for(const p of l)if(p){Array.isArray(p.palette?.series)&&(a=[...p.palette.series]);for(const O of Se){const k=p.palette?.[O];k&&(s[O]={...s[O],...k})}typeof p.font?.family=="string"&&(r=p.font.family),typeof p.font?.size=="number"&&(o=p.font.size)}const c=n==="dark",i=p=>s[p][n]??e[p]?.[n],d=i("background");return{mode:n,series:a,font:{family:r,size:o},background:d,tableHeader:i("tableHeader"),tableHeaderBackground:i("tableHeaderBackground"),tableBody:i("tableBody"),tile:i("tile"),tileTitle:i("tileTitle"),mapColor:i("mapColor"),tableBackground:d,border:c?"1px solid #334155":"1px solid #e5e7eb",pinnedBorder:c?"1px solid #475569":"1px solid #daedf3",valueColor:c?"#f1f5f9":"#1f2937",foreground:c?"#e2e8f0":"#1f2937",axisFaint:c?"#475569":"#d1d5db",dashboardRoot:c?"#1e293b":"#ffffff",drillLink:c?"#60a5fa":"#2563eb"}}function Ce(l,n,e){const t=n??l??"light";return t==="auto"?e?"dark":"light":t}const ke=A.createContext(void 0);function Ae({layers:l,mode:n,userChoice:e,setMode:t,allowUserToggle:a=!0,children:r}){const o=A.useMemo(()=>Y(l,n),[l,n]),s=A.useMemo(()=>({theme:o,layers:l,mode:n,userChoice:e,setMode:t,allowUserToggle:a}),[o,l,n,e,t,a]);return Q.jsx(ke.Provider,{value:s,children:r})}function ja(){const l=A.useContext(ke);return l||{theme:Y([],"light"),layers:[],mode:"light",userChoice:void 0,setMode:()=>{},allowUserToggle:!1}}const xe=new H.QueryClient({defaultOptions:{queries:{retry:!1,throwOnError:!1},mutations:{retry:!1,throwOnError:!1}}}),Ha={staleTime:300*1e3,refetchOnWindowFocus:!1,refetchOnReconnect:!1},j="publisher:themeMode";function _a(){if(!(typeof window>"u"))try{const l=window.localStorage.getItem(j);if(l==="light"||l==="dark"||l==="auto")return l}catch{}}function Wa(l){if(!(typeof window>"u"))try{l===void 0?window.localStorage.removeItem(j):window.localStorage.setItem(j,l)}catch{}}function Ga(){return typeof window>"u"||!window.matchMedia?!1:window.matchMedia("(prefers-color-scheme: dark)").matches}h.defaults.baseURL||(h.defaults.baseURL="IfYouAreSeeingThis_baseURL_IsNotSet");const Ie=A.createContext(void 0),Ya=(l,n)=>{const e=`${window.location.protocol}//${window.location.host}/api/v0`,t=h.create({baseURL:l||e,withCredentials:!0,timeout:6e5});t.interceptors.request.use(async r=>{const o=await n?.();return r.headers.Authorization=o||"",r});const a=new ye({basePath:e});return{models:new me(a,e,t),publisher:new ve(a,e,t),environments:new ce(a,e,t),packages:new be(a,e,t),dashboards:new te(a,e,t),dataApps:new ne(a,e,t),notebooks:new ue(a,e,t),connections:new Z(a,e,t),databases:new se(a,e,t),materializations:new de(a,e,t),watchMode:new Oe(a,e,t)}},Ka=l=>Q.jsx(H.QueryClientProvider,{client:xe,children:Q.jsx(Ja,{...l})}),Ja=({children:l,getAccessToken:n,baseURL:e,mutable:t,theme:a})=>{const r=A.useMemo(()=>Ya(e,n),[e,n]),o=e||`${window.location.protocol}//${window.location.host}/api/v0`,s=H.useQuery({queryKey:["status"],queryFn:async()=>(await r.publisher.getStatus()).data});s.error&&console.error("Failed to fetch publisher status:",s.error);const c=s.data?.frozenConfig,i=s.data?.theme,d=s.isLoading;let p;s.isLoading||s.error?p=t:c?p=!1:p=t??!0;const O=A.useMemo(()=>[i,a],[i,a]),[k,F]=A.useState(_a),[I,D]=A.useState(Ga);A.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const T=window.matchMedia("(prefers-color-scheme: dark)"),J=Te=>D(Te.matches);return T.addEventListener("change",J),()=>T.removeEventListener("change",J)},[]);const Re=A.useCallback(T=>{F(T),Wa(T)},[]),K=i?.allowUserToggle??!0,$=K?k:void 0,Ee=A.useMemo(()=>Ce(i?.defaultMode,$,I),[i?.defaultMode,$,I]),Ne={server:o,getAccessToken:n,apiClients:r,mutable:p,isLoadingStatus:d,instanceTheme:i};return Q.jsx(Ie.Provider,{value:Ne,children:Q.jsx(Ae,{layers:O,mode:Ee,userChoice:$,setMode:Re,allowUserToggle:K,children:l})})},Xa=()=>{const l=A.useContext(Ie);if(l===void 0)throw new Error("useServer must be used within a ServerProvider");return l};exports.AttachedDatabaseTypeEnum=Me;exports.AzureConnectionAuthTypeEnum=we;exports.CHART_RESULT_QUERY_OPTIONS=Ha;exports.CleanMetricCard=Fa;exports.CleanNotebookCell=fa;exports.CleanNotebookContainer=Ma;exports.CleanNotebookSection=wa;exports.CompileProblemSeverityEnum=fe;exports.CompileRequestScopeEnum=Fe;exports.CompileResultStatusEnum=Be;exports.Configuration=ye;exports.ConnectionProxyTypeEnum=ze;exports.ConnectionStatusStatusEnum=De;exports.ConnectionTypeEnum=Qe;exports.ConnectionsApi=Z;exports.ConnectionsApiAxiosParamCreator=X;exports.ConnectionsApiFactory=ha;exports.ConnectionsApiFp=S;exports.ConnectionsTestApi=ga;exports.ConnectionsTestApiAxiosParamCreator=ee;exports.ConnectionsTestApiFactory=ua;exports.ConnectionsTestApiFp=_;exports.DEFAULT_THEME=L;exports.DashboardsApi=te;exports.DashboardsApiAxiosParamCreator=ae;exports.DashboardsApiFactory=ba;exports.DashboardsApiFp=z;exports.DataAppFitEnum=$e;exports.DataAppsApi=ne;exports.DataAppsApiAxiosParamCreator=re;exports.DataAppsApiFactory=Pa;exports.DataAppsApiFp=W;exports.DatabaseTypeEnum=qe;exports.DatabasesApi=se;exports.DatabasesApiAxiosParamCreator=oe;exports.DatabasesApiFactory=va;exports.DatabasesApiFp=G;exports.EnvironmentsApi=ce;exports.EnvironmentsApiAxiosParamCreator=le;exports.EnvironmentsApiFactory=Va;exports.EnvironmentsApiFp=E;exports.ExecuteNotebookCellBypassFiltersEnum=ka;exports.FilterTypeEnum=Le;exports.FreshnessFallbackEnum=je;exports.GivenControlEnum=He;exports.LedgerEntryStrategyEnum=_e;exports.LogMessageSeverityEnum=We;exports.MALLOY_ACCENT=Ra;exports.MALLOY_BRAND=f;exports.MONO_FONT_FAMILY=Ea;exports.ManifestEntryFreshnessFallbackEnum=Ye;exports.ManifestEntryOriginEnum=Ge;exports.ManifestEntryRefreshEnum=Ke;exports.MaterializationActionActionEnum=ya;exports.MaterializationStatus=Je;exports.MaterializationsApi=de;exports.MaterializationsApiAxiosParamCreator=ie;exports.MaterializationsApiFactory=Oa;exports.MaterializationsApiFp=R;exports.ModelsApi=me;exports.ModelsApiAxiosParamCreator=pe;exports.ModelsApiFactory=Sa;exports.ModelsApiFp=U;exports.NotebookCellResultTypeEnum=Ze;exports.NotebookCellTypeEnum=Xe;exports.NotebooksApi=ue;exports.NotebooksApiAxiosParamCreator=he;exports.NotebooksApiFactory=Ca;exports.NotebooksApiFp=B;exports.PER_MODE_COLOR_KEYS=Se;exports.PackageCard=za;exports.PackageCardContent=Da;exports.PackageManifestBindingStatusEnum=ta;exports.PackageQueryableSourcesEnum=aa;exports.PackageScopeEnum=ea;exports.PackageSectionTitle=$a;exports.PackageWarningsInnerSeverityEnum=ra;exports.PackagesApi=be;exports.PackagesApiAxiosParamCreator=ge;exports.PackagesApiFactory=Aa;exports.PackagesApiFp=N;exports.PersistSourcePlanOriginEnum=na;exports.PostgresConnectionSslmodeEnum=oa;exports.PublisherApi=ve;exports.PublisherApiAxiosParamCreator=Pe;exports.PublisherApiFactory=xa;exports.PublisherApiFp=M;exports.QueryClass=sa;exports.QueryResultQueryRowLimitSourceEnum=la;exports.QueryResultServedFromEnum=ca;exports.Realization=ia;exports.RunContextTriggerEnum=da;exports.ServerProvider=Ka;exports.ServerStatusOperationalStateEnum=pa;exports.StyledCard=Na;exports.StyledCardContent=Ta;exports.StyledCardMedia=Ua;exports.StyledExplorerContent=Qa;exports.StyledExplorerPage=Ba;exports.ThemeDefaultModeEnum=ma;exports.ThemeProvider=Ae;exports.WatchModeApi=Oe;exports.WatchModeApiAxiosParamCreator=Ve;exports.WatchModeApiFactory=Ia;exports.WatchModeApiFp=w;exports.globalQueryClient=xe;exports.resolveMode=Ce;exports.resolveTheme=Y;exports.usePublisherTheme=ja;exports.useServer=Xa;