@malloy-publisher/app 0.0.160 → 0.0.161
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.
- package/dist/api-doc.yaml +4 -0
- package/dist/assets/{HomePage-CcrEOi14.js → HomePage-CgSTNEQW.js} +1 -1
- package/dist/assets/{MainPage-DvaR7Pn3.js → MainPage-CzAy2LSX.js} +2 -2
- package/dist/assets/{ModelPage-j_Llmqiz.js → ModelPage-uZf0eDBu.js} +1 -1
- package/dist/assets/{PackagePage-CZlsAJnK.js → PackagePage-BHvPFsmZ.js} +1 -1
- package/dist/assets/{ProjectPage-BxObFJlU.js → ProjectPage-ndnv5nGp.js} +1 -1
- package/dist/assets/{RouteError-DmHap2b6.js → RouteError-CZC9OOKh.js} +1 -1
- package/dist/assets/{WorkbookPage-lkFLzesv.js → WorkbookPage-CBJ0x84n.js} +1 -1
- package/dist/assets/{index-CQkmBXYf.js → index-Bl1fe3A7.js} +1 -1
- package/dist/assets/{index-v8DBa7Vi.js → index-BoduKqUa.js} +3 -3
- package/dist/assets/{index-Dgv_6iUv.js → index-D_8e14NE.js} +1 -1
- package/dist/assets/{index.umd-akOH3nye.js → index.umd-DRsjT6d4.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +3 -2
package/dist/api-doc.yaml
CHANGED
|
@@ -1821,6 +1821,10 @@ components:
|
|
|
1821
1821
|
queryName:
|
|
1822
1822
|
type: string
|
|
1823
1823
|
description: Name of a query to execute on a source in the model. Requires the sourceName parameter is set. If the queryName parameter is set, the query parameter must be empty.
|
|
1824
|
+
compactJson:
|
|
1825
|
+
type: boolean
|
|
1826
|
+
default: false
|
|
1827
|
+
description: 'If true, returns a simple JSON array of row objects in the form {"columnName": value}. If false (default), returns the full Malloy result with type metadata for rendering.'
|
|
1824
1828
|
versionId:
|
|
1825
1829
|
type: string
|
|
1826
1830
|
description: Version ID
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as o,j as a,Q as e}from"./index-
|
|
1
|
+
import{t as o,j as a,Q as e}from"./index-BoduKqUa.js";function n(){const t=o();return a.jsx(e,{onClickProject:t})}export{n as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as V,g as F,r as g,R as _,a as X,b as S,c as M,d as A,j as t,s as m,e as w,f as v,h as I,P as Y,m as R,i as J,k as z,B as K,l as
|
|
2
|
-
`)),(L!==void 0?go:po)(l,p,u,d,c)}}O();function xo(o){return S("MuiAppBar",o)}M("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const mo=o=>{const{color:e,position:r,classes:s}=o,n={root:["root",`color${v(e)}`,`position${v(r)}`]};return I(n,xo,s)},D=(o,e)=>o?`${o?.replace(")","")}, ${e})`:e,bo=m(Y,{name:"MuiAppBar",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:r}=o;return[e.root,e[`position${v(r.position)}`],e[`color${v(r.color)}`]]}})(R(({theme:o})=>({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0,variants:[{props:{position:"fixed"},style:{position:"fixed",zIndex:(o.vars||o).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}}},{props:{position:"absolute"},style:{position:"absolute",zIndex:(o.vars||o).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"sticky"},style:{position:"sticky",zIndex:(o.vars||o).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"static"},style:{position:"static"}},{props:{position:"relative"},style:{position:"relative"}},{props:{color:"inherit"},style:{"--AppBar-color":"inherit"}},{props:{color:"default"},style:{"--AppBar-background":o.vars?o.vars.palette.AppBar.defaultBg:o.palette.grey[100],"--AppBar-color":o.vars?o.vars.palette.text.primary:o.palette.getContrastText(o.palette.grey[100]),...o.applyStyles("dark",{"--AppBar-background":o.vars?o.vars.palette.AppBar.defaultBg:o.palette.grey[900],"--AppBar-color":o.vars?o.vars.palette.text.primary:o.palette.getContrastText(o.palette.grey[900])})}},...Object.entries(o.palette).filter(J(["contrastText"])).map(([e])=>({props:{color:e},style:{"--AppBar-background":(o.vars??o).palette[e].main,"--AppBar-color":(o.vars??o).palette[e].contrastText}})),{props:e=>e.enableColorOnDark===!0&&!["inherit","transparent"].includes(e.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)"}},{props:e=>e.enableColorOnDark===!1&&!["inherit","transparent"].includes(e.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...o.applyStyles("dark",{backgroundColor:o.vars?D(o.vars.palette.AppBar.darkBg,"var(--AppBar-background)"):null,color:o.vars?D(o.vars.palette.AppBar.darkColor,"var(--AppBar-color)"):null})}},{props:{color:"transparent"},style:{"--AppBar-background":"transparent","--AppBar-color":"inherit",backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...o.applyStyles("dark",{backgroundImage:"none"})}}]}))),fo=g.forwardRef(function(e,r){const s=A({props:e,name:"MuiAppBar"}),{className:n,color:a="primary",enableColorOnDark:i=!1,position:p="fixed",...u}=s,d={...s,color:a,position:p,enableColorOnDark:i},c=mo(d);return t.jsx(bo,{square:!0,component:"header",ownerState:d,elevation:4,className:w(c.root,n,p==="fixed"&&"mui-fixed"),ref:r,...u})}),ho=z(t.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),yo=m(K,{name:"MuiBreadcrumbCollapsed"})(R(({theme:o})=>({display:"flex",marginLeft:`calc(${o.spacing(1)} * 0.5)`,marginRight:`calc(${o.spacing(1)} * 0.5)`,...o.palette.mode==="light"?{backgroundColor:o.palette.grey[100],color:o.palette.grey[700]}:{backgroundColor:o.palette.grey[700],color:o.palette.grey[100]},borderRadius:2,"&:hover, &:focus":{...o.palette.mode==="light"?{backgroundColor:o.palette.grey[200]}:{backgroundColor:o.palette.grey[600]}},"&:active":{boxShadow:o.shadows[0],...o.palette.mode==="light"?{backgroundColor:
|
|
1
|
+
import{u as V,g as F,r as g,R as _,a as X,b as S,c as M,d as A,j as t,s as m,e as w,f as v,h as I,P as Y,m as R,i as J,k as z,B as K,l as E,n as Z,T as U,o as q,p as oo,t as eo,q as b,C as j,v as ro,w as to,I as so,M as ao,x as $,S as no,y as lo,z as io,O as co}from"./index-BoduKqUa.js";function po(o,e,r,s,n){const[a,i]=g.useState(()=>n&&r?r(o).matches:s?s(o).matches:e);return X(()=>{if(!r)return;const p=r(o),u=()=>{i(p.matches)};return u(),p.addEventListener("change",u),()=>{p.removeEventListener("change",u)}},[o,r]),a}const uo={..._},L=uo.useSyncExternalStore;function go(o,e,r,s,n){const a=g.useCallback(()=>e,[e]),i=g.useMemo(()=>{if(n&&r)return()=>r(o).matches;if(s!==null){const{matches:c}=s(o);return()=>c}return a},[a,o,s,n,r]),[p,u]=g.useMemo(()=>{if(r===null)return[a,()=>()=>{}];const c=r(o);return[()=>c.matches,l=>(c.addEventListener("change",l),()=>{c.removeEventListener("change",l)})]},[a,r,o]);return L(u,p,i)}function O(o={}){const{themeId:e}=o;return function(s,n={}){let a=V();a&&e&&(a=a[e]||a);const i=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:p=!1,matchMedia:u=i?window.matchMedia:null,ssrMatchMedia:d=null,noSsr:c=!1}=F({name:"MuiUseMediaQuery",props:n,theme:a});let l=typeof s=="function"?s(a):s;return l=l.replace(/^@media( ?)/m,""),l.includes("print")&&console.warn(["MUI: You have provided a `print` query to the `useMediaQuery` hook.","Using the print media query to modify print styles can lead to unexpected results.","Consider using the `displayPrint` field in the `sx` prop instead.","More information about `displayPrint` on our docs: https://mui.com/system/display/#display-in-print."].join(`
|
|
2
|
+
`)),(L!==void 0?go:po)(l,p,u,d,c)}}O();function xo(o){return S("MuiAppBar",o)}M("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const mo=o=>{const{color:e,position:r,classes:s}=o,n={root:["root",`color${v(e)}`,`position${v(r)}`]};return I(n,xo,s)},D=(o,e)=>o?`${o?.replace(")","")}, ${e})`:e,bo=m(Y,{name:"MuiAppBar",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:r}=o;return[e.root,e[`position${v(r.position)}`],e[`color${v(r.color)}`]]}})(R(({theme:o})=>({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0,variants:[{props:{position:"fixed"},style:{position:"fixed",zIndex:(o.vars||o).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}}},{props:{position:"absolute"},style:{position:"absolute",zIndex:(o.vars||o).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"sticky"},style:{position:"sticky",zIndex:(o.vars||o).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"static"},style:{position:"static"}},{props:{position:"relative"},style:{position:"relative"}},{props:{color:"inherit"},style:{"--AppBar-color":"inherit"}},{props:{color:"default"},style:{"--AppBar-background":o.vars?o.vars.palette.AppBar.defaultBg:o.palette.grey[100],"--AppBar-color":o.vars?o.vars.palette.text.primary:o.palette.getContrastText(o.palette.grey[100]),...o.applyStyles("dark",{"--AppBar-background":o.vars?o.vars.palette.AppBar.defaultBg:o.palette.grey[900],"--AppBar-color":o.vars?o.vars.palette.text.primary:o.palette.getContrastText(o.palette.grey[900])})}},...Object.entries(o.palette).filter(J(["contrastText"])).map(([e])=>({props:{color:e},style:{"--AppBar-background":(o.vars??o).palette[e].main,"--AppBar-color":(o.vars??o).palette[e].contrastText}})),{props:e=>e.enableColorOnDark===!0&&!["inherit","transparent"].includes(e.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)"}},{props:e=>e.enableColorOnDark===!1&&!["inherit","transparent"].includes(e.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...o.applyStyles("dark",{backgroundColor:o.vars?D(o.vars.palette.AppBar.darkBg,"var(--AppBar-background)"):null,color:o.vars?D(o.vars.palette.AppBar.darkColor,"var(--AppBar-color)"):null})}},{props:{color:"transparent"},style:{"--AppBar-background":"transparent","--AppBar-color":"inherit",backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...o.applyStyles("dark",{backgroundImage:"none"})}}]}))),fo=g.forwardRef(function(e,r){const s=A({props:e,name:"MuiAppBar"}),{className:n,color:a="primary",enableColorOnDark:i=!1,position:p="fixed",...u}=s,d={...s,color:a,position:p,enableColorOnDark:i},c=mo(d);return t.jsx(bo,{square:!0,component:"header",ownerState:d,elevation:4,className:w(c.root,n,p==="fixed"&&"mui-fixed"),ref:r,...u})}),ho=z(t.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})),yo=m(K,{name:"MuiBreadcrumbCollapsed"})(R(({theme:o})=>({display:"flex",marginLeft:`calc(${o.spacing(1)} * 0.5)`,marginRight:`calc(${o.spacing(1)} * 0.5)`,...o.palette.mode==="light"?{backgroundColor:o.palette.grey[100],color:o.palette.grey[700]}:{backgroundColor:o.palette.grey[700],color:o.palette.grey[100]},borderRadius:2,"&:hover, &:focus":{...o.palette.mode==="light"?{backgroundColor:o.palette.grey[200]}:{backgroundColor:o.palette.grey[600]}},"&:active":{boxShadow:o.shadows[0],...o.palette.mode==="light"?{backgroundColor:E(o.palette.grey[200],.12)}:{backgroundColor:E(o.palette.grey[600],.12)}}}))),vo=m(ho)({width:24,height:16});function Bo(o){const{slots:e={},slotProps:r={},...s}=o,n=o;return t.jsx("li",{children:t.jsx(yo,{focusRipple:!0,...s,ownerState:n,children:t.jsx(vo,{as:e.CollapsedIcon,ownerState:n,...r.collapsedIcon})})})}function ko(o){return S("MuiBreadcrumbs",o)}const Co=M("MuiBreadcrumbs",["root","ol","li","separator"]),jo=o=>{const{classes:e}=o;return I({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},ko,e)},So=m(U,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(o,e)=>[{[`& .${Co.li}`]:e.li},e.root]})({}),Mo=m("ol",{name:"MuiBreadcrumbs",slot:"Ol"})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),Ao=m("li",{name:"MuiBreadcrumbs",slot:"Separator"})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function wo(o,e,r,s){return o.reduce((n,a,i)=>(i<o.length-1?n=n.concat(a,t.jsx(Ao,{"aria-hidden":!0,className:e,ownerState:s,children:r},`separator-${i}`)):n.push(a),n),[])}const Io=g.forwardRef(function(e,r){const s=A({props:e,name:"MuiBreadcrumbs"}),{children:n,className:a,component:i="nav",slots:p={},slotProps:u={},expandText:d="Show path",itemsAfterCollapse:c=1,itemsBeforeCollapse:l=1,maxItems:h=8,separator:B="/",...Q}=s,[T,W]=g.useState(!1),f={...s,component:i,expanded:T,expandText:d,itemsAfterCollapse:c,itemsBeforeCollapse:l,maxItems:h,separator:B},y=jo(f),H=Z({elementType:p.CollapsedIcon,externalSlotProps:u.collapsedIcon,ownerState:f}),P=g.useRef(null),G=x=>{const C=()=>{W(!0);const N=P.current.querySelector("a[href],button,[tabindex]");N&&N.focus()};return l+c>=x.length?x:[...x.slice(0,l),t.jsx(Bo,{"aria-label":d,slots:{CollapsedIcon:p.CollapsedIcon},slotProps:{collapsedIcon:H},onClick:C},"ellipsis"),...x.slice(x.length-c,x.length)]},k=g.Children.toArray(n).filter(x=>g.isValidElement(x)).map((x,C)=>t.jsx("li",{className:y.li,children:x},`child-${C}`));return t.jsx(So,{ref:r,component:i,color:"textSecondary",className:w(y.root,a),ownerState:f,...Q,children:t.jsx(Mo,{className:y.ol,ref:P,ownerState:f,children:wo(T||h&&k.length<=h?k:G(k),y.separator,B,f)})})});function Ro(o){return S("MuiToolbar",o)}M("MuiToolbar",["root","gutters","regular","dense"]);const zo=o=>{const{classes:e,disableGutters:r,variant:s}=o;return I({root:["root",!r&&"gutters",s]},Ro,e)},To=m("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:r}=o;return[e.root,!r.disableGutters&&e.gutters,e[r.variant]]}})(R(({theme:o})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:e})=>!e.disableGutters,style:{paddingLeft:o.spacing(2),paddingRight:o.spacing(2),[o.breakpoints.up("sm")]:{paddingLeft:o.spacing(3),paddingRight:o.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:o.mixins.toolbar}]}))),Po=g.forwardRef(function(e,r){const s=A({props:e,name:"MuiToolbar"}),{className:n,component:a="div",disableGutters:i=!1,variant:p="regular",...u}=s,d={...s,component:a,disableGutters:i,variant:p},c=zo(d);return t.jsx(To,{as:a,className:w(c.root,n),ref:r,ownerState:d,...u})}),No=O({themeId:q}),Eo=z(t.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),$o=z(t.jsx("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}));function Do(){const o=oo(),e=o["*"],r=eo();return t.jsx(b,{sx:{display:"flex",alignItems:"center"},children:t.jsxs(Io,{"aria-label":"breadcrumb",separator:t.jsx(Eo,{sx:{fontSize:14,color:"text.secondary"}}),sx:{"& .MuiBreadcrumbs-separator":{margin:"0 6px"}},children:[o.projectName&&t.jsx(j,{onClick:s=>r(`/${o.projectName}/`,s),label:o.projectName,size:"medium",sx:{backgroundColor:"white",color:"primary.main",fontWeight:500,height:"32px",fontSize:"1rem",cursor:"pointer","&:hover":{backgroundColor:"primary.100"}}}),o.packageName&&t.jsx(j,{onClick:s=>r(`/${o.projectName}/${o.packageName}/`,s),label:o.packageName,size:"medium",sx:{backgroundColor:"white",color:"primary.main",fontWeight:500,height:"32px",fontSize:"1rem",cursor:"pointer","&:hover":{backgroundColor:"secondary.100"}}}),e&&t.jsx(j,{onClick:s=>r(`/${o.projectName}/${o.packageName}/${e}`,s),label:e,size:"medium",sx:{backgroundColor:"white",color:"primary.main",fontWeight:500,height:"32px",fontSize:"1rem",cursor:"pointer","&:hover":{backgroundColor:"grey.200"}}})]})})}function Uo({logoHeader:o,endCap:e}){const r=ro(),s=to(),n=No(s.breakpoints.down("sm")),[a,i]=g.useState(null),p=!!a,u=l=>{i(l.currentTarget)},d=()=>i(null),c=[{label:"Malloy Docs",link:"https://docs.malloydata.dev/documentation/",sx:{color:"#14b3cb"}},{label:"Publisher Docs",link:"https://github.com/malloydata/publisher/blob/main/README.md",sx:{color:"#14b3cb"}},{label:"Publisher API",link:"/api-doc.html",sx:{color:"#14b3cb"}}];return t.jsxs(fo,{position:"sticky",elevation:0,sx:{backgroundColor:"background.paper",borderBottom:"1px solid",borderColor:"divider"},children:[t.jsxs(Po,{sx:{justifyContent:"space-between",flexWrap:"nowrap",minHeight:44},children:[o||t.jsxs(b,{sx:{display:"flex",alignItems:"center",gap:1,cursor:"pointer"},onClick:()=>r("/"),children:[t.jsx(b,{component:"img",src:"/logo.svg",alt:"Malloy",sx:{width:28,height:28}}),t.jsx(U,{variant:"h6",sx:{color:"text.primary",fontWeight:700,letterSpacing:"-0.025em",fontSize:{xs:"1.1rem",sm:"1.25rem"}},children:"Malloy Publisher"})]}),n?t.jsxs(t.Fragment,{children:[t.jsx(so,{color:"inherit",onClick:u,children:t.jsx($o,{})}),t.jsxs(ao,{anchorEl:a,open:p,onClose:d,anchorOrigin:{vertical:"bottom",horizontal:"right"},children:[c.map(l=>t.jsx($,{onClick:()=>{d(),window.location.href=l.link},sx:l.sx,children:l.label},l.label)),e&&t.jsx($,{children:e})]})]}):t.jsxs(no,{direction:"row",spacing:2,alignItems:"center",children:[c.map(l=>t.jsx(lo,{href:l.link,sx:l.sx,children:l.label},l.label)),e]})]}),t.jsx(b,{sx:{borderTop:"1px solid white",paddingLeft:"16px",paddingRight:"16px",marginBottom:"1px",overflowX:"auto"},children:t.jsx(Do,{})})]})}function Oo({headerProps:o}){return t.jsxs(b,{sx:{display:"flex",flexDirection:"column",minHeight:"100vh"},children:[t.jsx(Uo,{...o}),t.jsx(io,{maxWidth:"xl",component:"main",sx:{flex:1,display:"flex",flexDirection:"column",py:2,gap:2},children:t.jsx(b,{sx:{flex:1},children:t.jsx(co,{})})})]})}export{Oo as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as n,j as e,A as i,X as t,D as c}from"./index-
|
|
1
|
+
import{p as n,j as e,A as i,X as t,D as c}from"./index-BoduKqUa.js";function o(){const a=n(),r=a["*"];if(!a.projectName)return e.jsx("div",{children:e.jsx("h2",{children:"Missing project name"})});if(!a.packageName)return e.jsx("div",{children:e.jsx("h2",{children:"Missing package name"})});const s=i({projectName:a.projectName,packageName:a.packageName,modelPath:r});return r?.endsWith(".malloy")?e.jsx(t,{resourceUri:s,runOnDemand:!0,maxResultSize:512*1024}):r?.endsWith(".malloynb")?e.jsx(c,{resourceUri:s,maxResultSize:1024*1024}):e.jsx("div",{children:e.jsxs("h2",{children:["Unrecognized file type: ",r]})})}export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as n,t,j as e,A as c,J as o}from"./index-
|
|
1
|
+
import{p as n,t,j as e,A as c,J as o}from"./index-BoduKqUa.js";function l(){const{projectName:s,packageName:a}=n(),r=t();if(s)if(a){const i=c({projectName:s,packageName:a});return e.jsx(o,{onClickPackageFile:r,resourceUri:i})}else return e.jsx("div",{children:e.jsx("h2",{children:"Missing package name"})});else return e.jsx("div",{children:e.jsx("h2",{children:"Missing project name"})})}export{l as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as a,p as n,j as e,A as c,E as o}from"./index-
|
|
1
|
+
import{t as a,p as n,j as e,A as c,E as o}from"./index-BoduKqUa.js";function j(){const t=a(),{projectName:s}=n();if(s){const r=c({projectName:s});return e.jsx(o,{onSelectPackage:t,resourceUri:r})}else return e.jsx("div",{children:e.jsx("h2",{children:"Missing project name"})})}export{j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as o,j as r,z as s,S as n,q as t,T as a}from"./index-
|
|
1
|
+
import{F as o,j as r,z as s,S as n,q as t,T as a}from"./index-BoduKqUa.js";function x(){const e=o();return console.error(e),r.jsx(s,{maxWidth:"lg",component:"main",sx:{display:"flex",flexDirection:"column",my:2,gap:0},children:r.jsxs(n,{sx:{m:"auto",flexDirection:"column"},children:[r.jsx(t,{sx:{height:"300px"}}),r.jsx("img",{src:"/error.png"}),r.jsx(a,{variant:"subtitle1",children:"An unexpected error occurred"})]})})}export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as a,j as e,A as t,Y as c}from"./index-
|
|
1
|
+
import{p as a,j as e,A as t,Y as c}from"./index-BoduKqUa.js";function d(){const{workspace:r,workbookPath:s,projectName:i,packageName:n}=a();if(r)if(s)if(i)if(n){const o=t({projectName:i,packageName:n});return e.jsx(c,{workbookPath:{path:s,workspace:r},resourceUri:o},`${s}`)}else return e.jsx("div",{children:e.jsx("h2",{children:"Missing package name"})});else return e.jsx("div",{children:e.jsx("h2",{children:"Missing project name"})});else return e.jsx("div",{children:e.jsx("h2",{children:"Missing workbook path"})});else return e.jsx("div",{children:e.jsx("h2",{children:"Missing workspace"})})}export{d as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{G as LL,r as T,j as R,H as Ht,R as rR,K as nR,L as ys}from"./index-v8DBa7Vi.js";import{r as n0,a as Oy,b as Fy,c as i0,d as s0,e as Ny,f as Iy,g as ky,h as My,j as By,k as Py,l as $y,m as qy,n as jy,o as o0,p as a0,q as u0,s as l0,t as iR,u as OL,v as Uy,w as ct}from"./index-Dgv_6iUv.js";import{a as b1}from"./index.umd-akOH3nye.js";var Co={},hg={},gr={},pg={},TC;function Ke(){return TC||(TC=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TD=e.ValueType=void 0,e.exprHasKids=t,e.exprHasE=r,e.exprIsLeaf=i,e.isAsymmetricExpr=a,e.mkTemporal=c,e.isRawCast=x,e.isFilterExprType=u,e.isTimeLiteral=d,e.isParameterType=f,e.paramHasValue=m,e.expressionIsScalar=h,e.expressionIsAggregate=p,e.expressionIsUngroupedAggregate=l,e.expressionInvolvesAggregate=C,e.expressionIsCalculation=E,e.expressionIsAnalytic=y,e.isExpressionTypeLEQ=S,e.maxExpressionType=v,e.maxOfExpressionTypes=A,e.hasExpression=w,e.isTemporalType=L,e.isAtomicFieldType=F,e.canOrderBy=P,e.isCastType=k,e.fieldIsIntrinsic=I,e.mkFieldDef=j,e.mkArrayDef=H,e.isRepeatedRecordFunctionParam=q,e.isRepeatedRecord=O,e.isRecordOrRepeatedRecord=W,e.isBasicArray=z,e.isMatrixOperation=ie,e.isJoinable=K,e.isJoined=fe,e.isJoinedSource=Z,e.isDateUnit=te,e.isTimestampUnit=Y,e.isExtractUnit=re,e.refIsStructDef=he,e.segmentHasErrors=xe,e.structHasErrors=X,e.isReduceSegment=de,e.isPartialSegment=ve,e.isProjectSegment=ce,e.isQuerySegment=Te,e.isSamplingRows=Qe,e.isSamplingPercent=Re,e.isSamplingEnable=Le,e.isRawSegment=Ie,e.isIndexSegment=Ge,e.bareFieldUsage=ot,e.isSegmentSQL=Ze,e.sourceBase=ut,e.isSourceDef=It,e.isBaseTable=Dt,e.isLiteral=Bt,e.mergeEvalSpaces=zt,e.isBasicAtomic=rr,e.getIdentifier=Qr,e.isTurtle=Jt,e.isAtomic=mr,e.isValueString=kr,e.isValueNumber=Jr,e.isValueBoolean=ft,e.isValueTimestamp=se,e.isValueDate=ae,e.mergeUniqueKeyRequirement=_e;function t(V){return"kids"in V}function r(V){return"e"in V}function i(V){return!(t(V)||r(V))}function a(V){return V.node==="aggregate"&&["sum","avg","count","distinct"].includes(V.function)}function o(V){return V.node!=="arrayLiteral"&&V.node!=="recordLiteral"}function c(V,Ae){if(!("typeDef"in V)){const Ne=typeof Ae=="string"?{type:Ae}:Ae;if(o(V))return{...V,typeDef:{...Ne}}}return V}function x(V){return"dstSQLType"in V}function u(V){return["string","number","boolean","date","timestamp","timestamptz"].includes(V)}function d(V){return V.node==="dateLiteral"||V.node==="timestampLiteral"||V.node==="timestamptzLiteral"}function f(V){return["string","number","boolean","date","timestamp","timestamptz","filter expression","error"].includes(V)}function m(V){return V.value!==null}function h(V){return V===void 0||V==="scalar"}function p(V){return V==="aggregate"||V==="ungrouped_aggregate"}function l(V){return V==="ungrouped_aggregate"}function C(V){return V==="aggregate"||V==="ungrouped_aggregate"||V==="aggregate_analytic"}function E(V){return V==="aggregate"||V==="scalar_analytic"||V==="aggregate_analytic"||V==="ungrouped_aggregate"}function y(V){return V==="aggregate_analytic"||V==="scalar_analytic"}function _(V){return{scalar:0,aggregate:1,ungrouped_aggregate:2,scalar_analytic:2,aggregate_analytic:3}[V]}function S(V,Ae){return V===Ae||_(V)<_(Ae)}function v(V,Ae){let Ne="scalar";return(V==="aggregate"||Ae==="aggregate")&&(Ne="aggregate"),(V==="ungrouped_aggregate"||Ae==="ungrouped_aggregate")&&(Ne="ungrouped_aggregate"),(V==="scalar_analytic"||Ae==="scalar_analytic")&&(Ne="scalar_analytic"),(V==="aggregate_analytic"||Ae==="aggregate_analytic")&&(Ne="aggregate_analytic"),(V==="scalar_analytic"&&Ae==="aggregate"||V==="aggregate"&&Ae==="scalar_analytic")&&(Ne="aggregate_analytic"),Ne}function A(V){return V.reduce(v,"scalar")}function w(V){return"e"in V&&V.e!==void 0}function L(V){return V==="date"||V==="timestamp"||V==="timestamptz"}function F(V){return["string","number","date","timestamp","timestamptz","boolean","json","sql native","record","array","error"].includes(V)}function P(V){return["string","number","date","boolean","date","timestamp","timestamptz"].includes(V)}function k(V){return["string","number","date","timestamp","timestamptz","boolean","json"].includes(V)}function I(V){return F(V.type)&&!w(V)}function j(V,Ae){if(z(V))return H(V.elementTypeDef,Ae);if(O(V)){const{type:Ue,fields:nt,elementTypeDef:lt}=V;return{type:Ue,fields:nt,elementTypeDef:lt,join:"many",name:Ae}}if(V.type==="record"){const{type:Ue,fields:nt}=V;return{type:Ue,fields:nt,join:"one",name:Ae}}const Ne={name:Ae,type:V.type};switch(V.type){case"sql native":return{...Ne,rawType:V.rawType};case"number":{const Ue=V.numberType;return Ue?{...Ne,numberType:Ue}:Ne}case"date":{const Ue=V.timeframe;return Ue?{name:Ae,type:"date",timeframe:Ue}:Ne}case"timestamp":{const Ue={name:Ae,type:"timestamp"};return V.timeframe&&(Ue.timeframe=V.timeframe),Ue}case"timestamptz":{const Ue={name:Ae,type:"timestamptz"};return V.timeframe&&(Ue.timeframe=V.timeframe),Ue}}return Ne}function H(V,Ae){if(V.type==="record")return{type:"array",join:"many",name:Ae,elementTypeDef:{type:"record_element"},fields:V.fields};const Ne=j(V,"value");return{type:"array",join:"many",name:Ae,elementTypeDef:V,fields:[Ne,{...Ne,name:"each",e:{node:"field",path:["value"]}}]}}function q(V){return V.type==="array"&&V.elementTypeDef.type==="record_element"}function O(V){return V.type==="array"&&V.elementTypeDef.type==="record_element"}function W(V){return V.type==="record"||V.type==="array"&&"elementTypeDef"in V&&V.elementTypeDef.type==="record_element"}function z(V){return V.type==="array"&&V.elementTypeDef.type!=="record_element"}function ie(V){return["left","right","full","inner"].includes(V)}function K(V){return["composite","table","sql_select","query_source","array","record"].includes(V.type)}function fe(V){return"join"in V}function Z(V){return It(V)&&fe(V)}function te(V){return["day","week","month","quarter","year"].includes(V)}function Y(V){return te(V)||["hour","minute","second"].includes(V)}function re(V){return Y(V)||V==="day_of_week"||V==="day_of_year"}var ue;(function(V){V.Date="date",V.Timestamp="timestamp",V.Number="number",V.String="string"})(ue||(e.ValueType=ue={}));function he(V){return typeof V!="string"}function xe(V){return!!((V.type==="reduce"||V.type==="project"||V.type==="partial")&&(V.extendSource&&V.extendSource.some(Ae=>Ae.type==="error")||V.queryFields.some(Ae=>Ae.type==="error")))}function X(V){return V.fields.some(Ae=>Ae.type==="error")}function de(V){return V.type==="reduce"}function ve(V){return V.type==="partial"}function ce(V){return V.type==="project"}function Te(V){return ce(V)||de(V)}function Qe(V){return V.rows!==void 0}function Re(V){return V.percent!==void 0}function Le(V){return V.enable!==void 0}function Ie(V){return V.type==="raw"}function Ge(V){return V.type==="index"}function ot(V){return V.uniqueKeyRequirement===void 0&&V.analyticFunctionUse===void 0}function Ze(V){return"sql"in V}function ut(V){return{...V}}function It(V){return V.type==="table"||V.type==="sql_select"||V.type==="query_source"||V.type==="query_result"||V.type==="finalize"||V.type==="nest_source"||V.type==="composite"}function Dt(V){return Z(V)?!1:!!It(V)}function Bt(V){return V==="literal"}function zt(...V){return V.length<=1&&V.every(Ae=>Ae==="literal")?"literal":V.every(Ae=>Ae==="constant"||Ae==="literal")?"constant":V.every(Ae=>Ae==="output"||Ae==="constant"||Ae==="literal")?"output":"input"}function rr(V){return V.type==="string"||L(V.type)||V.type==="number"||V.type==="boolean"||V.type==="json"||V.type==="sql native"||V.type==="error"}function Qr(V){return V.as!==void 0?V.as:V.name}function Jt(V){return V.type==="turtle"}function mr(V){return F(V.type)}function kr(V,Ae){return Ae.type==="string"}function Jr(V,Ae){return Ae.type==="number"}function ft(V,Ae){return Ae.type==="boolean"}function se(V,Ae){return Ae.type==="timestamp"}function ae(V,Ae){return Ae.type==="date"}e.TD={isAtomic(V){return V!==void 0&&F(V.type)},isBasicAtomic(V){return V!==void 0&&rr({type:V.type})},isString:V=>V?.type==="string",isNumber:V=>V?.type==="number",isBoolean:V=>V?.type==="boolean",isJSON:V=>V?.type==="json",isSQL:V=>V?.type==="sql native",isDate:V=>V?.type==="date",isTimestamp:V=>V?.type==="timestamp",isTimestamptz:V=>V?.type==="timestamptz",isAnyTimestamp(V){return V?.type==="timestamp"||V?.type==="timestamptz"},isTemporal(V){var Ae;const Ne=(Ae=V?.type)!==null&&Ae!==void 0?Ae:"";return L(Ne)},isError:V=>V?.type==="error",eq(V,Ae){if(V===void 0||Ae===void 0)return!1;function Ne(Ue,nt){const lt={};for(const pt of Ue.fields||[])if(pt.name)lt[pt.name]=pt;else return!1;for(const pt of nt.fields||[])if(!e.TD.eq(lt[pt.name],pt))return!1;return!0}return V.type==="array"&&Ae.type==="array"?V.elementTypeDef.type!==Ae.elementTypeDef.type?!1:V.elementTypeDef.type!=="record_element"&&Ae.elementTypeDef.type!=="record_element"?e.TD.eq(V.elementTypeDef,Ae.elementTypeDef):e.TD.isAtomic(V)&&e.TD.isAtomic(Ae)&&Ne(V,Ae):V.type==="record"&&Ae.type==="record"?e.TD.isAtomic(V)&&e.TD.isAtomic(Ae)&&Ne(V,Ae):V.type==="sql native"&&Ae.type==="sql native"?V.rawType!==void 0&&V.rawType===Ae.rawType:V.type===Ae.type}};function _e(V,Ae){return V?Ae?{isCount:V.isCount||Ae.isCount}:V:Ae}})(pg)),pg}var wC;function Js(){if(wC)return gr;wC=1,Object.defineProperty(gr,"__esModule",{value:!0}),gr.arg=t,gr.spread=r,gr.sql=i,gr.constant=a,gr.output=o,gr.literal=c,gr.variadicParam=x,gr.param=u,gr.makeParam=d,gr.maxScalar=f,gr.maxAggregate=m,gr.anyExprType=h,gr.maxUngroupedAggregate=p,gr.maxAnalytic=l,gr.minScalar=C,gr.minAggregate=E,gr.minAnalytic=y,gr.overload=_,gr.expandBlueprintMap=te,gr.expandOverrideMapFromBase=ue,gr.def=xe;const e=Ke();function t(X){return{node:"function_parameter",name:X}}function r(X,de=void 0,ve=void 0){return{node:"spread",e:X,prefix:de,suffix:ve}}function i(X,...de){const ve={node:"genericSQLExpr",kids:{args:[]},src:[]},ce=[...de];let Te="";for(const Qe of X){Te+=Qe;const Re=ce.shift();Re!==void 0&&(typeof Re=="string"?Te+=Re:(ve.src.push(Te),ve.kids.args.push(Re),Te=""))}return Te.length>0&&ve.src.push(Te),ve}function a(X){return{...X,evalSpace:"constant"}}function o(X){return{...X,evalSpace:"output"}}function c(X){return{...X,evalSpace:"literal"}}function x(X,...de){return{name:X,isVariadic:!0,allowedTypes:de}}function u(X,...de){return{name:X,isVariadic:!1,allowedTypes:de}}function d(X,...de){return{param:u(X,...de),arg:t(X)}}function f(X){return{...X,expressionType:"scalar",evalSpace:"input"}}function m(X){return{...X,expressionType:"aggregate",evalSpace:"input"}}function h(X){return{...X,expressionType:void 0,evalSpace:"input"}}function p(X){return{...X,expressionType:"ungrouped_aggregate",evalSpace:"input"}}function l(X){return{...X,expressionType:"aggregate_analytic",evalSpace:"input"}}function C(X){return{...X,expressionType:"scalar",evalSpace:"input"}}function E(X){return{...X,expressionType:"aggregate",evalSpace:"input"}}function y(X){return{...X,expressionType:"scalar_analytic",evalSpace:"input"}}function _(X,de,ve,ce){return{returnType:X,params:de,e:ve,needsWindowOrderBy:ce?.needsWindowOrderBy,between:ce?.between,isSymmetric:ce?.isSymmetric,supportsOrderBy:ce?.supportsOrderBy,defaultOrderByArgIndex:ce?.defaultOrderByArgIndex,supportsLimit:ce?.supportsLimit}}function S(X,de=!0,ve=!0){if(!de&&X==="any")throw new Error("Return type cannot include any");if(typeof X=="string")return{type:X};if("array"in X){const ce=de?S(X.array,!0):S(X.array,!1);return ce.type==="record"?{type:"array",elementTypeDef:{type:"record_element"},fields:ce.fields}:{type:"array",elementTypeDef:ce}}else if("record"in X){const ce=[];for(const[Te,Qe]of Object.entries(X.record)){const Re=de?S(Qe,!0):S(Qe,!1);e.TD.isAtomic(Re)&&ce.push((0,e.mkFieldDef)(Re,Te))}return{type:"record",fields:ce}}else if("generic"in X){if(!ve)throw new Error("Cannot use generic");return{type:"generic",generic:X.generic}}else if("sql_native"in X)return{type:"sql native",rawType:X.sql_native};throw new Error("Cannot figure out type")}function v(X){if(X==="any")throw new Error("Cannot return any type");if(typeof X=="string")return C({type:X});if("array"in X)return h(S(X,!1));if("record"in X)return h(S(X,!1));if("generic"in X)return C(S(X,!1));if("literal"in X)return c(C(S(X.literal,!1)));if("constant"in X)return a(C(S(X.constant,!1)));if("dimension"in X)return C(S(X.dimension,!1));if("measure"in X)return E(S(X.measure,!1));if("sql_native"in X)return h({type:"sql native",rawType:X.sql_native});if("calculation"in X)return y(S(X.calculation,!1));throw new Error("Invalid function blueprint")}function A(X){return typeof X=="string"||"array"in X||"record"in X||"generic"in X||"literal"in X||"constant"in X||"dimension"in X||"measure"in X||"calculation"in X||"sql_native"in X}function w(X){return A(X)?[X]:Array.isArray(X)?X:A(X.variadic)?[X.variadic]:X.variadic}function L(X){if(typeof X=="string")return h({type:X});if("generic"in X)return h(S(X));if("literal"in X)return c(f(S(X.literal)));if("constant"in X)return a(f(S(X.constant)));if("dimension"in X)return f(S(X.dimension));if("measure"in X)return m(S(X.measure));if("array"in X)return h(S(X,!1));if("record"in X)return h(S(X,!1));if("sql_native"in X)return h({type:"sql native",rawType:X.sql_native});if("calculation"in X)return l(S(X.calculation));throw new Error("Invalid function blueprint")}function F(X){return X.map(de=>L(de))}function P(X){return typeof X!="string"&&"variadic"in X}function k(X,de){return{name:X,allowedTypes:F(w(de)),isVariadic:P(de)}}function I(X){return Object.entries(X).map(ve=>k(ve[0],ve[1]))}function j(X){const de=[],ve=[];let ce=X;for(;ce.length>0;){const Qe=ce.indexOf("${");if(Qe===-1){de.push(ce);break}const Re=ce.slice(0,Qe);ce=ce.slice(Qe);const Le=ce.indexOf("}");if(Le===-1){de.push(Re+ce);break}const Ie=ce.slice(2,Le);ce=ce.slice(Le+1);const Ge=Ie.startsWith("..."),ot=Ie.endsWith(":"),Ze=Ge?Ie.slice(3):ot?Ie.slice(0,-1):Ie,ut={node:"function_parameter",name:Ze};de.push(Re),Ge?ve.push({node:"spread",e:ut,prefix:"",suffix:""}):ot&&Ze==="order_by"?ve.push({node:"aggregate_order_by"}):ot&&Ze==="limit"?ve.push({node:"aggregate_limit"}):ve.push(ut)}return{node:"genericSQLExpr",kids:{args:ve},src:de}}function H(X,de){return P(de)?{node:"spread",e:{node:"function_parameter",name:X},prefix:"",suffix:""}:{node:"function_parameter",name:X}}function q(X,de){const ve=Object.entries(de.takes),ce=ve.length>0?ve.length-1:0;return{node:"genericSQLExpr",kids:{args:ve.map(Te=>H(Te[0],Te[1]))},src:[`${X}(`,...Array(ce).fill(","),")"]}}function O(X){return"sql"in X.impl?j(X.impl.sql):"expr"in X.impl?X.impl.expr:q(X.impl.function,X)}function W(X){return{e:O(X),between:X.impl.between,needsWindowOrderBy:X.impl.needsWindowOrderBy,defaultOrderByArgIndex:X.impl.defaultOrderByArgIndex}}function z(X){if(X!==void 0)return Object.entries(X).map(([de,ve])=>({name:de,acceptibleTypes:ve.map(ce=>S(ce,!0,!1))}))}function ie(X){return{returnType:v(X.returns),params:I(X.takes),isSymmetric:X.isSymmetric,supportsOrderBy:X.supportsOrderBy,supportsLimit:X.supportsLimit,genericTypes:z(X.generic),...W(X)}}function K(X){return"takes"in X&&"returns"in X&&"impl"in X}function fe(X){return"function"in X||"sql"in X||"expr"in X}function Z(X){return K(X)?[ie(X)]:Object.values(X).flatMap(de=>ie(de))}function te(X){const de={};for(const ve in X)de[ve]=Z(X[ve]);return de}function Y(X,de){return[ie({...X,impl:de})]}function re(X,de,ve){if(fe(ve)){if(!K(de))throw new Error(`Malformed function override: ${X}. Attempt to override multiple overloads with a single overload (missing: ${Object.keys(de)})`);return Y(de,ve)}else{if(K(de))throw new Error(`Malformed function override: ${X}. Attempt to override a single overload with multiple overloads (extraneous: ${Object.keys(ve)})`);return Object.entries(ve).flatMap(([ce,Te])=>{const Qe=de[ce];if(Qe===void 0)throw new Error(`Malformed function override: ${X}. No overload named ${ce}`);return Y(Qe,Te)})}}function ue(X,de){const ve={};for(const ce in de){if(!(ce in X))throw new Error(`Malformed function override: ${ce}. No such function in Malloy standard`);ve[ce]=re(ce,X[ce],de[ce])}return ve}function*he(X){if(typeof X!="string"){if("generic"in X)yield X;else if("record"in X)for(const de of Object.values(X.record))yield*he(de);else for(const de of["array","literal","measure","dimension","measure","constant","cacluation"])if(de in X){yield*he(X[de]);return}}}function xe(X,de,ve,ce={}){let Te=!1;const Qe={};for(const Le of Object.values(de))for(const Ie of he(Le))Qe[Ie.generic]=["any"],Te=!0;Te&&ce.generic===void 0&&(ce.generic=Qe);const Re={takes:de,returns:ve,impl:{function:X.toUpperCase()},...ce};return{[X]:Re}}return gr}var mg={},DC;function Aa(){return DC||(DC=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Dialect=e.dayIndex=e.MAX_DECIMAL38=e.MIN_DECIMAL38=e.MAX_INT128=e.MIN_INT128=e.MAX_INT64=e.MIN_INT64=e.MAX_INT32=e.MIN_INT32=void 0,e.inDays=i,e.qtz=a;const t=Ke();e.MIN_INT32=-2147483648,e.MAX_INT32=2147483647,e.MIN_INT64=BigInt("-9223372036854775808"),e.MAX_INT64=BigInt("9223372036854775807"),e.MIN_INT128=BigInt("-170141183460469231731687303715884105728"),e.MAX_INT128=BigInt("170141183460469231731687303715884105727"),e.MIN_DECIMAL38=BigInt("-99999999999999999999999999999999999999"),e.MAX_DECIMAL38=BigInt("99999999999999999999999999999999999999");const r=["microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"];e.dayIndex=r.indexOf("day");function i(c){return r.indexOf(c)>=e.dayIndex}function a(c){const x=c.queryTimezone;if(!(x===void 0||x===c.systemTimezone))return x}class o{constructor(){this.cantPartitionWindowFunctionsOnExpressions=!1,this.supportsPipelinesInViews=!0,this.supportsArraysInData=!0,this.hasTimestamptz=!1,this.readsNestedData=!0,this.orderByClause="ordinal",this.nullMatchesFunctionSignature=!0,this.supportsSelectReplace=!0,this.supportsBigIntPrecision=!0,this.supportsComplexFilteredSources=!0,this.supportsTempTables=!0,this.hasModOperator=!0,this.supportsLeftJoinUnnest=!0,this.requiresExplicitUnnestOrdering=!1,this.supportsCountApprox=!1,this.supportsHyperLogLog=!1,this.supportsFullJoin=!0,this.nestedArrays=!0,this.compoundObjectInSchema=!0,this.booleanType="supported",this.likeEscape=!0,this.integerTypeMappings=[{min:BigInt(e.MIN_INT32),max:BigInt(e.MAX_INT32),numberType:"integer"},{min:e.MIN_INT64,max:e.MAX_INT64,numberType:"bigint"}]}literalNumberType(x){if(!/^-?\d+$/.test(x))return{type:"number",numberType:"float"};const d=BigInt(x);for(const f of this.integerTypeMappings)if(d>=f.min&&d<=f.max)return{type:"number",numberType:f.numberType};return{type:"number",numberType:"bigint"}}static makeTimeLiteralNode(x,u,d,f,m){var h;const p=(h=x?.hasTimestamptz)!==null&&h!==void 0?h:!1;return m==="date"?{node:"dateLiteral",literal:u,typeDef:{type:"date",timeframe:f!==void 0&&(0,t.isDateUnit)(f)?f:void 0}}:d&&p?{node:"timestamptzLiteral",literal:u,typeDef:{type:"timestamptz",timeframe:f},timezone:d}:d?{node:"timestampLiteral",literal:u,typeDef:{type:"timestamp",timeframe:f},timezone:d}:{node:"timestampLiteral",literal:u,typeDef:{type:"timestamp",timeframe:f}}}sqlFinalStage(x,u){throw new Error("Dialect has no final Stage but called Anyway")}sqlDateToString(x){return this.castToString(`DATE(${x})`)}sqlLiteralNumber(x){return x}ignoreInProject(x){return!1}needsCivilTimeComputation(x,u,d,f){const m=["day","week","month","quarter","year"],h=u!==void 0&&m.includes(u),p=d!==void 0&&m.includes(d),l=a(f);return{needed:t.TD.isAnyTimestamp(x)&&(h||p)&&l!==void 0,tz:l}}sqlTruncAndOffset(x,u,d,f){if(t.TD.isAnyTimestamp(x.typeDef)){const{needed:h,tz:p}=this.needsCivilTimeComputation(x.typeDef,d,f?.unit,u);if(h&&p){const l=this.sqlConvertToCivilTime(x.sql,p,x.typeDef);let C=l.sql;const E=l.typeDef;return d&&(C=this.sqlTruncate(C,d,E,!0,p)),f&&(C=this.sqlOffsetTime(C,f.op,f.magnitude,f.unit,E,!0,p)),this.sqlConvertFromCivilTime(C,p,x.typeDef)}}let m=x.sql;return d&&(m=this.sqlTruncate(m,d,x.typeDef,!1,a(u))),f&&(m=this.sqlOffsetTime(m,f.op,f.magnitude,f.unit,x.typeDef,!1,a(u))),m}exprToSQL(x,u){switch(u.node){case"now":return this.sqlNowExpr();case"timeDiff":return this.sqlMeasureTimeExpr(u);case"delta":{const d=u.kids.base;return d.node==="trunc"?this.sqlTruncAndOffset(d.e,x,d.units,{op:u.op,magnitude:u.kids.delta.sql,unit:u.units}):this.sqlTruncAndOffset(d,x,void 0,{op:u.op,magnitude:u.kids.delta.sql,unit:u.units})}case"trunc":return this.sqlTruncAndOffset(u.e,x,u.units);case"extract":return this.sqlTimeExtractExpr(x,u);case"cast":return this.sqlCast(x,u);case"regexpMatch":return this.sqlRegexpMatch(u);case"/":return this.divisionIsInteger?`${u.kids.left.sql}*1.0/${u.kids.right.sql}`:void 0;case"%":return this.hasModOperator?void 0:`MOD(${u.kids.left.sql},${u.kids.right.sql})`;case"dateLiteral":return this.sqlDateLiteral(x,u.literal);case"timestampLiteral":return this.sqlTimestampLiteral(x,u.literal,u.timezone);case"timestamptzLiteral":return this.sqlTimestamptzLiteral(x,u.literal,u.timezone);case"stringLiteral":return this.sqlLiteralString(u.literal);case"numberLiteral":return this.sqlLiteralNumber(u.literal);case"regexpLiteral":return this.sqlLiteralRegexp(u.literal);case"recordLiteral":return this.sqlLiteralRecord(u);case"arrayLiteral":return this.sqlLiteralArray(u)}}sqlSumDistinct(x,u,d){return"sqlSumDistinct called but not implemented"}sqlAggDistinct(x,u,d){return"sqlAggDistinct called but not implemented"}sqlSampleTable(x,u){if(u!==void 0)throw new Error(`Sampling is not supported on dialect ${this.name}.`);return x}sqlOrderBy(x,u){return`ORDER BY ${x.join(",")}`}sqlTzStr(x){return`"${x.queryTimezone}"`}sqlMakeUnnestKey(x,u){return this.concat(x,"'x'",u)}sqlStringAggDistinct(x,u,d){const f="__STRING_AGG_KS__",m="__STRING_AGG_KE__";return`REGEXP_REPLACE(
|
|
1
|
+
import{G as LL,r as T,j as R,H as Ht,R as rR,K as nR,L as ys}from"./index-BoduKqUa.js";import{r as n0,a as Oy,b as Fy,c as i0,d as s0,e as Ny,f as Iy,g as ky,h as My,j as By,k as Py,l as $y,m as qy,n as jy,o as o0,p as a0,q as u0,s as l0,t as iR,u as OL,v as Uy,w as ct}from"./index-D_8e14NE.js";import{a as b1}from"./index.umd-DRsjT6d4.js";var Co={},hg={},gr={},pg={},TC;function Ke(){return TC||(TC=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TD=e.ValueType=void 0,e.exprHasKids=t,e.exprHasE=r,e.exprIsLeaf=i,e.isAsymmetricExpr=a,e.mkTemporal=c,e.isRawCast=x,e.isFilterExprType=u,e.isTimeLiteral=d,e.isParameterType=f,e.paramHasValue=m,e.expressionIsScalar=h,e.expressionIsAggregate=p,e.expressionIsUngroupedAggregate=l,e.expressionInvolvesAggregate=C,e.expressionIsCalculation=E,e.expressionIsAnalytic=y,e.isExpressionTypeLEQ=S,e.maxExpressionType=v,e.maxOfExpressionTypes=A,e.hasExpression=w,e.isTemporalType=L,e.isAtomicFieldType=F,e.canOrderBy=P,e.isCastType=k,e.fieldIsIntrinsic=I,e.mkFieldDef=j,e.mkArrayDef=H,e.isRepeatedRecordFunctionParam=q,e.isRepeatedRecord=O,e.isRecordOrRepeatedRecord=W,e.isBasicArray=z,e.isMatrixOperation=ie,e.isJoinable=K,e.isJoined=fe,e.isJoinedSource=Z,e.isDateUnit=te,e.isTimestampUnit=Y,e.isExtractUnit=re,e.refIsStructDef=he,e.segmentHasErrors=xe,e.structHasErrors=X,e.isReduceSegment=de,e.isPartialSegment=ve,e.isProjectSegment=ce,e.isQuerySegment=Te,e.isSamplingRows=Qe,e.isSamplingPercent=Re,e.isSamplingEnable=Le,e.isRawSegment=Ie,e.isIndexSegment=Ge,e.bareFieldUsage=ot,e.isSegmentSQL=Ze,e.sourceBase=ut,e.isSourceDef=It,e.isBaseTable=Dt,e.isLiteral=Bt,e.mergeEvalSpaces=zt,e.isBasicAtomic=rr,e.getIdentifier=Qr,e.isTurtle=Jt,e.isAtomic=mr,e.isValueString=kr,e.isValueNumber=Jr,e.isValueBoolean=ft,e.isValueTimestamp=se,e.isValueDate=ae,e.mergeUniqueKeyRequirement=_e;function t(V){return"kids"in V}function r(V){return"e"in V}function i(V){return!(t(V)||r(V))}function a(V){return V.node==="aggregate"&&["sum","avg","count","distinct"].includes(V.function)}function o(V){return V.node!=="arrayLiteral"&&V.node!=="recordLiteral"}function c(V,Ae){if(!("typeDef"in V)){const Ne=typeof Ae=="string"?{type:Ae}:Ae;if(o(V))return{...V,typeDef:{...Ne}}}return V}function x(V){return"dstSQLType"in V}function u(V){return["string","number","boolean","date","timestamp","timestamptz"].includes(V)}function d(V){return V.node==="dateLiteral"||V.node==="timestampLiteral"||V.node==="timestamptzLiteral"}function f(V){return["string","number","boolean","date","timestamp","timestamptz","filter expression","error"].includes(V)}function m(V){return V.value!==null}function h(V){return V===void 0||V==="scalar"}function p(V){return V==="aggregate"||V==="ungrouped_aggregate"}function l(V){return V==="ungrouped_aggregate"}function C(V){return V==="aggregate"||V==="ungrouped_aggregate"||V==="aggregate_analytic"}function E(V){return V==="aggregate"||V==="scalar_analytic"||V==="aggregate_analytic"||V==="ungrouped_aggregate"}function y(V){return V==="aggregate_analytic"||V==="scalar_analytic"}function _(V){return{scalar:0,aggregate:1,ungrouped_aggregate:2,scalar_analytic:2,aggregate_analytic:3}[V]}function S(V,Ae){return V===Ae||_(V)<_(Ae)}function v(V,Ae){let Ne="scalar";return(V==="aggregate"||Ae==="aggregate")&&(Ne="aggregate"),(V==="ungrouped_aggregate"||Ae==="ungrouped_aggregate")&&(Ne="ungrouped_aggregate"),(V==="scalar_analytic"||Ae==="scalar_analytic")&&(Ne="scalar_analytic"),(V==="aggregate_analytic"||Ae==="aggregate_analytic")&&(Ne="aggregate_analytic"),(V==="scalar_analytic"&&Ae==="aggregate"||V==="aggregate"&&Ae==="scalar_analytic")&&(Ne="aggregate_analytic"),Ne}function A(V){return V.reduce(v,"scalar")}function w(V){return"e"in V&&V.e!==void 0}function L(V){return V==="date"||V==="timestamp"||V==="timestamptz"}function F(V){return["string","number","date","timestamp","timestamptz","boolean","json","sql native","record","array","error"].includes(V)}function P(V){return["string","number","date","boolean","date","timestamp","timestamptz"].includes(V)}function k(V){return["string","number","date","timestamp","timestamptz","boolean","json"].includes(V)}function I(V){return F(V.type)&&!w(V)}function j(V,Ae){if(z(V))return H(V.elementTypeDef,Ae);if(O(V)){const{type:Ue,fields:nt,elementTypeDef:lt}=V;return{type:Ue,fields:nt,elementTypeDef:lt,join:"many",name:Ae}}if(V.type==="record"){const{type:Ue,fields:nt}=V;return{type:Ue,fields:nt,join:"one",name:Ae}}const Ne={name:Ae,type:V.type};switch(V.type){case"sql native":return{...Ne,rawType:V.rawType};case"number":{const Ue=V.numberType;return Ue?{...Ne,numberType:Ue}:Ne}case"date":{const Ue=V.timeframe;return Ue?{name:Ae,type:"date",timeframe:Ue}:Ne}case"timestamp":{const Ue={name:Ae,type:"timestamp"};return V.timeframe&&(Ue.timeframe=V.timeframe),Ue}case"timestamptz":{const Ue={name:Ae,type:"timestamptz"};return V.timeframe&&(Ue.timeframe=V.timeframe),Ue}}return Ne}function H(V,Ae){if(V.type==="record")return{type:"array",join:"many",name:Ae,elementTypeDef:{type:"record_element"},fields:V.fields};const Ne=j(V,"value");return{type:"array",join:"many",name:Ae,elementTypeDef:V,fields:[Ne,{...Ne,name:"each",e:{node:"field",path:["value"]}}]}}function q(V){return V.type==="array"&&V.elementTypeDef.type==="record_element"}function O(V){return V.type==="array"&&V.elementTypeDef.type==="record_element"}function W(V){return V.type==="record"||V.type==="array"&&"elementTypeDef"in V&&V.elementTypeDef.type==="record_element"}function z(V){return V.type==="array"&&V.elementTypeDef.type!=="record_element"}function ie(V){return["left","right","full","inner"].includes(V)}function K(V){return["composite","table","sql_select","query_source","array","record"].includes(V.type)}function fe(V){return"join"in V}function Z(V){return It(V)&&fe(V)}function te(V){return["day","week","month","quarter","year"].includes(V)}function Y(V){return te(V)||["hour","minute","second"].includes(V)}function re(V){return Y(V)||V==="day_of_week"||V==="day_of_year"}var ue;(function(V){V.Date="date",V.Timestamp="timestamp",V.Number="number",V.String="string"})(ue||(e.ValueType=ue={}));function he(V){return typeof V!="string"}function xe(V){return!!((V.type==="reduce"||V.type==="project"||V.type==="partial")&&(V.extendSource&&V.extendSource.some(Ae=>Ae.type==="error")||V.queryFields.some(Ae=>Ae.type==="error")))}function X(V){return V.fields.some(Ae=>Ae.type==="error")}function de(V){return V.type==="reduce"}function ve(V){return V.type==="partial"}function ce(V){return V.type==="project"}function Te(V){return ce(V)||de(V)}function Qe(V){return V.rows!==void 0}function Re(V){return V.percent!==void 0}function Le(V){return V.enable!==void 0}function Ie(V){return V.type==="raw"}function Ge(V){return V.type==="index"}function ot(V){return V.uniqueKeyRequirement===void 0&&V.analyticFunctionUse===void 0}function Ze(V){return"sql"in V}function ut(V){return{...V}}function It(V){return V.type==="table"||V.type==="sql_select"||V.type==="query_source"||V.type==="query_result"||V.type==="finalize"||V.type==="nest_source"||V.type==="composite"}function Dt(V){return Z(V)?!1:!!It(V)}function Bt(V){return V==="literal"}function zt(...V){return V.length<=1&&V.every(Ae=>Ae==="literal")?"literal":V.every(Ae=>Ae==="constant"||Ae==="literal")?"constant":V.every(Ae=>Ae==="output"||Ae==="constant"||Ae==="literal")?"output":"input"}function rr(V){return V.type==="string"||L(V.type)||V.type==="number"||V.type==="boolean"||V.type==="json"||V.type==="sql native"||V.type==="error"}function Qr(V){return V.as!==void 0?V.as:V.name}function Jt(V){return V.type==="turtle"}function mr(V){return F(V.type)}function kr(V,Ae){return Ae.type==="string"}function Jr(V,Ae){return Ae.type==="number"}function ft(V,Ae){return Ae.type==="boolean"}function se(V,Ae){return Ae.type==="timestamp"}function ae(V,Ae){return Ae.type==="date"}e.TD={isAtomic(V){return V!==void 0&&F(V.type)},isBasicAtomic(V){return V!==void 0&&rr({type:V.type})},isString:V=>V?.type==="string",isNumber:V=>V?.type==="number",isBoolean:V=>V?.type==="boolean",isJSON:V=>V?.type==="json",isSQL:V=>V?.type==="sql native",isDate:V=>V?.type==="date",isTimestamp:V=>V?.type==="timestamp",isTimestamptz:V=>V?.type==="timestamptz",isAnyTimestamp(V){return V?.type==="timestamp"||V?.type==="timestamptz"},isTemporal(V){var Ae;const Ne=(Ae=V?.type)!==null&&Ae!==void 0?Ae:"";return L(Ne)},isError:V=>V?.type==="error",eq(V,Ae){if(V===void 0||Ae===void 0)return!1;function Ne(Ue,nt){const lt={};for(const pt of Ue.fields||[])if(pt.name)lt[pt.name]=pt;else return!1;for(const pt of nt.fields||[])if(!e.TD.eq(lt[pt.name],pt))return!1;return!0}return V.type==="array"&&Ae.type==="array"?V.elementTypeDef.type!==Ae.elementTypeDef.type?!1:V.elementTypeDef.type!=="record_element"&&Ae.elementTypeDef.type!=="record_element"?e.TD.eq(V.elementTypeDef,Ae.elementTypeDef):e.TD.isAtomic(V)&&e.TD.isAtomic(Ae)&&Ne(V,Ae):V.type==="record"&&Ae.type==="record"?e.TD.isAtomic(V)&&e.TD.isAtomic(Ae)&&Ne(V,Ae):V.type==="sql native"&&Ae.type==="sql native"?V.rawType!==void 0&&V.rawType===Ae.rawType:V.type===Ae.type}};function _e(V,Ae){return V?Ae?{isCount:V.isCount||Ae.isCount}:V:Ae}})(pg)),pg}var wC;function Js(){if(wC)return gr;wC=1,Object.defineProperty(gr,"__esModule",{value:!0}),gr.arg=t,gr.spread=r,gr.sql=i,gr.constant=a,gr.output=o,gr.literal=c,gr.variadicParam=x,gr.param=u,gr.makeParam=d,gr.maxScalar=f,gr.maxAggregate=m,gr.anyExprType=h,gr.maxUngroupedAggregate=p,gr.maxAnalytic=l,gr.minScalar=C,gr.minAggregate=E,gr.minAnalytic=y,gr.overload=_,gr.expandBlueprintMap=te,gr.expandOverrideMapFromBase=ue,gr.def=xe;const e=Ke();function t(X){return{node:"function_parameter",name:X}}function r(X,de=void 0,ve=void 0){return{node:"spread",e:X,prefix:de,suffix:ve}}function i(X,...de){const ve={node:"genericSQLExpr",kids:{args:[]},src:[]},ce=[...de];let Te="";for(const Qe of X){Te+=Qe;const Re=ce.shift();Re!==void 0&&(typeof Re=="string"?Te+=Re:(ve.src.push(Te),ve.kids.args.push(Re),Te=""))}return Te.length>0&&ve.src.push(Te),ve}function a(X){return{...X,evalSpace:"constant"}}function o(X){return{...X,evalSpace:"output"}}function c(X){return{...X,evalSpace:"literal"}}function x(X,...de){return{name:X,isVariadic:!0,allowedTypes:de}}function u(X,...de){return{name:X,isVariadic:!1,allowedTypes:de}}function d(X,...de){return{param:u(X,...de),arg:t(X)}}function f(X){return{...X,expressionType:"scalar",evalSpace:"input"}}function m(X){return{...X,expressionType:"aggregate",evalSpace:"input"}}function h(X){return{...X,expressionType:void 0,evalSpace:"input"}}function p(X){return{...X,expressionType:"ungrouped_aggregate",evalSpace:"input"}}function l(X){return{...X,expressionType:"aggregate_analytic",evalSpace:"input"}}function C(X){return{...X,expressionType:"scalar",evalSpace:"input"}}function E(X){return{...X,expressionType:"aggregate",evalSpace:"input"}}function y(X){return{...X,expressionType:"scalar_analytic",evalSpace:"input"}}function _(X,de,ve,ce){return{returnType:X,params:de,e:ve,needsWindowOrderBy:ce?.needsWindowOrderBy,between:ce?.between,isSymmetric:ce?.isSymmetric,supportsOrderBy:ce?.supportsOrderBy,defaultOrderByArgIndex:ce?.defaultOrderByArgIndex,supportsLimit:ce?.supportsLimit}}function S(X,de=!0,ve=!0){if(!de&&X==="any")throw new Error("Return type cannot include any");if(typeof X=="string")return{type:X};if("array"in X){const ce=de?S(X.array,!0):S(X.array,!1);return ce.type==="record"?{type:"array",elementTypeDef:{type:"record_element"},fields:ce.fields}:{type:"array",elementTypeDef:ce}}else if("record"in X){const ce=[];for(const[Te,Qe]of Object.entries(X.record)){const Re=de?S(Qe,!0):S(Qe,!1);e.TD.isAtomic(Re)&&ce.push((0,e.mkFieldDef)(Re,Te))}return{type:"record",fields:ce}}else if("generic"in X){if(!ve)throw new Error("Cannot use generic");return{type:"generic",generic:X.generic}}else if("sql_native"in X)return{type:"sql native",rawType:X.sql_native};throw new Error("Cannot figure out type")}function v(X){if(X==="any")throw new Error("Cannot return any type");if(typeof X=="string")return C({type:X});if("array"in X)return h(S(X,!1));if("record"in X)return h(S(X,!1));if("generic"in X)return C(S(X,!1));if("literal"in X)return c(C(S(X.literal,!1)));if("constant"in X)return a(C(S(X.constant,!1)));if("dimension"in X)return C(S(X.dimension,!1));if("measure"in X)return E(S(X.measure,!1));if("sql_native"in X)return h({type:"sql native",rawType:X.sql_native});if("calculation"in X)return y(S(X.calculation,!1));throw new Error("Invalid function blueprint")}function A(X){return typeof X=="string"||"array"in X||"record"in X||"generic"in X||"literal"in X||"constant"in X||"dimension"in X||"measure"in X||"calculation"in X||"sql_native"in X}function w(X){return A(X)?[X]:Array.isArray(X)?X:A(X.variadic)?[X.variadic]:X.variadic}function L(X){if(typeof X=="string")return h({type:X});if("generic"in X)return h(S(X));if("literal"in X)return c(f(S(X.literal)));if("constant"in X)return a(f(S(X.constant)));if("dimension"in X)return f(S(X.dimension));if("measure"in X)return m(S(X.measure));if("array"in X)return h(S(X,!1));if("record"in X)return h(S(X,!1));if("sql_native"in X)return h({type:"sql native",rawType:X.sql_native});if("calculation"in X)return l(S(X.calculation));throw new Error("Invalid function blueprint")}function F(X){return X.map(de=>L(de))}function P(X){return typeof X!="string"&&"variadic"in X}function k(X,de){return{name:X,allowedTypes:F(w(de)),isVariadic:P(de)}}function I(X){return Object.entries(X).map(ve=>k(ve[0],ve[1]))}function j(X){const de=[],ve=[];let ce=X;for(;ce.length>0;){const Qe=ce.indexOf("${");if(Qe===-1){de.push(ce);break}const Re=ce.slice(0,Qe);ce=ce.slice(Qe);const Le=ce.indexOf("}");if(Le===-1){de.push(Re+ce);break}const Ie=ce.slice(2,Le);ce=ce.slice(Le+1);const Ge=Ie.startsWith("..."),ot=Ie.endsWith(":"),Ze=Ge?Ie.slice(3):ot?Ie.slice(0,-1):Ie,ut={node:"function_parameter",name:Ze};de.push(Re),Ge?ve.push({node:"spread",e:ut,prefix:"",suffix:""}):ot&&Ze==="order_by"?ve.push({node:"aggregate_order_by"}):ot&&Ze==="limit"?ve.push({node:"aggregate_limit"}):ve.push(ut)}return{node:"genericSQLExpr",kids:{args:ve},src:de}}function H(X,de){return P(de)?{node:"spread",e:{node:"function_parameter",name:X},prefix:"",suffix:""}:{node:"function_parameter",name:X}}function q(X,de){const ve=Object.entries(de.takes),ce=ve.length>0?ve.length-1:0;return{node:"genericSQLExpr",kids:{args:ve.map(Te=>H(Te[0],Te[1]))},src:[`${X}(`,...Array(ce).fill(","),")"]}}function O(X){return"sql"in X.impl?j(X.impl.sql):"expr"in X.impl?X.impl.expr:q(X.impl.function,X)}function W(X){return{e:O(X),between:X.impl.between,needsWindowOrderBy:X.impl.needsWindowOrderBy,defaultOrderByArgIndex:X.impl.defaultOrderByArgIndex}}function z(X){if(X!==void 0)return Object.entries(X).map(([de,ve])=>({name:de,acceptibleTypes:ve.map(ce=>S(ce,!0,!1))}))}function ie(X){return{returnType:v(X.returns),params:I(X.takes),isSymmetric:X.isSymmetric,supportsOrderBy:X.supportsOrderBy,supportsLimit:X.supportsLimit,genericTypes:z(X.generic),...W(X)}}function K(X){return"takes"in X&&"returns"in X&&"impl"in X}function fe(X){return"function"in X||"sql"in X||"expr"in X}function Z(X){return K(X)?[ie(X)]:Object.values(X).flatMap(de=>ie(de))}function te(X){const de={};for(const ve in X)de[ve]=Z(X[ve]);return de}function Y(X,de){return[ie({...X,impl:de})]}function re(X,de,ve){if(fe(ve)){if(!K(de))throw new Error(`Malformed function override: ${X}. Attempt to override multiple overloads with a single overload (missing: ${Object.keys(de)})`);return Y(de,ve)}else{if(K(de))throw new Error(`Malformed function override: ${X}. Attempt to override a single overload with multiple overloads (extraneous: ${Object.keys(ve)})`);return Object.entries(ve).flatMap(([ce,Te])=>{const Qe=de[ce];if(Qe===void 0)throw new Error(`Malformed function override: ${X}. No overload named ${ce}`);return Y(Qe,Te)})}}function ue(X,de){const ve={};for(const ce in de){if(!(ce in X))throw new Error(`Malformed function override: ${ce}. No such function in Malloy standard`);ve[ce]=re(ce,X[ce],de[ce])}return ve}function*he(X){if(typeof X!="string"){if("generic"in X)yield X;else if("record"in X)for(const de of Object.values(X.record))yield*he(de);else for(const de of["array","literal","measure","dimension","measure","constant","cacluation"])if(de in X){yield*he(X[de]);return}}}function xe(X,de,ve,ce={}){let Te=!1;const Qe={};for(const Le of Object.values(de))for(const Ie of he(Le))Qe[Ie.generic]=["any"],Te=!0;Te&&ce.generic===void 0&&(ce.generic=Qe);const Re={takes:de,returns:ve,impl:{function:X.toUpperCase()},...ce};return{[X]:Re}}return gr}var mg={},DC;function Aa(){return DC||(DC=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Dialect=e.dayIndex=e.MAX_DECIMAL38=e.MIN_DECIMAL38=e.MAX_INT128=e.MIN_INT128=e.MAX_INT64=e.MIN_INT64=e.MAX_INT32=e.MIN_INT32=void 0,e.inDays=i,e.qtz=a;const t=Ke();e.MIN_INT32=-2147483648,e.MAX_INT32=2147483647,e.MIN_INT64=BigInt("-9223372036854775808"),e.MAX_INT64=BigInt("9223372036854775807"),e.MIN_INT128=BigInt("-170141183460469231731687303715884105728"),e.MAX_INT128=BigInt("170141183460469231731687303715884105727"),e.MIN_DECIMAL38=BigInt("-99999999999999999999999999999999999999"),e.MAX_DECIMAL38=BigInt("99999999999999999999999999999999999999");const r=["microsecond","millisecond","second","minute","hour","day","week","month","quarter","year"];e.dayIndex=r.indexOf("day");function i(c){return r.indexOf(c)>=e.dayIndex}function a(c){const x=c.queryTimezone;if(!(x===void 0||x===c.systemTimezone))return x}class o{constructor(){this.cantPartitionWindowFunctionsOnExpressions=!1,this.supportsPipelinesInViews=!0,this.supportsArraysInData=!0,this.hasTimestamptz=!1,this.readsNestedData=!0,this.orderByClause="ordinal",this.nullMatchesFunctionSignature=!0,this.supportsSelectReplace=!0,this.supportsBigIntPrecision=!0,this.supportsComplexFilteredSources=!0,this.supportsTempTables=!0,this.hasModOperator=!0,this.supportsLeftJoinUnnest=!0,this.requiresExplicitUnnestOrdering=!1,this.supportsCountApprox=!1,this.supportsHyperLogLog=!1,this.supportsFullJoin=!0,this.nestedArrays=!0,this.compoundObjectInSchema=!0,this.booleanType="supported",this.likeEscape=!0,this.integerTypeMappings=[{min:BigInt(e.MIN_INT32),max:BigInt(e.MAX_INT32),numberType:"integer"},{min:e.MIN_INT64,max:e.MAX_INT64,numberType:"bigint"}]}literalNumberType(x){if(!/^-?\d+$/.test(x))return{type:"number",numberType:"float"};const d=BigInt(x);for(const f of this.integerTypeMappings)if(d>=f.min&&d<=f.max)return{type:"number",numberType:f.numberType};return{type:"number",numberType:"bigint"}}static makeTimeLiteralNode(x,u,d,f,m){var h;const p=(h=x?.hasTimestamptz)!==null&&h!==void 0?h:!1;return m==="date"?{node:"dateLiteral",literal:u,typeDef:{type:"date",timeframe:f!==void 0&&(0,t.isDateUnit)(f)?f:void 0}}:d&&p?{node:"timestamptzLiteral",literal:u,typeDef:{type:"timestamptz",timeframe:f},timezone:d}:d?{node:"timestampLiteral",literal:u,typeDef:{type:"timestamp",timeframe:f},timezone:d}:{node:"timestampLiteral",literal:u,typeDef:{type:"timestamp",timeframe:f}}}sqlFinalStage(x,u){throw new Error("Dialect has no final Stage but called Anyway")}sqlDateToString(x){return this.castToString(`DATE(${x})`)}sqlLiteralNumber(x){return x}ignoreInProject(x){return!1}needsCivilTimeComputation(x,u,d,f){const m=["day","week","month","quarter","year"],h=u!==void 0&&m.includes(u),p=d!==void 0&&m.includes(d),l=a(f);return{needed:t.TD.isAnyTimestamp(x)&&(h||p)&&l!==void 0,tz:l}}sqlTruncAndOffset(x,u,d,f){if(t.TD.isAnyTimestamp(x.typeDef)){const{needed:h,tz:p}=this.needsCivilTimeComputation(x.typeDef,d,f?.unit,u);if(h&&p){const l=this.sqlConvertToCivilTime(x.sql,p,x.typeDef);let C=l.sql;const E=l.typeDef;return d&&(C=this.sqlTruncate(C,d,E,!0,p)),f&&(C=this.sqlOffsetTime(C,f.op,f.magnitude,f.unit,E,!0,p)),this.sqlConvertFromCivilTime(C,p,x.typeDef)}}let m=x.sql;return d&&(m=this.sqlTruncate(m,d,x.typeDef,!1,a(u))),f&&(m=this.sqlOffsetTime(m,f.op,f.magnitude,f.unit,x.typeDef,!1,a(u))),m}exprToSQL(x,u){switch(u.node){case"now":return this.sqlNowExpr();case"timeDiff":return this.sqlMeasureTimeExpr(u);case"delta":{const d=u.kids.base;return d.node==="trunc"?this.sqlTruncAndOffset(d.e,x,d.units,{op:u.op,magnitude:u.kids.delta.sql,unit:u.units}):this.sqlTruncAndOffset(d,x,void 0,{op:u.op,magnitude:u.kids.delta.sql,unit:u.units})}case"trunc":return this.sqlTruncAndOffset(u.e,x,u.units);case"extract":return this.sqlTimeExtractExpr(x,u);case"cast":return this.sqlCast(x,u);case"regexpMatch":return this.sqlRegexpMatch(u);case"/":return this.divisionIsInteger?`${u.kids.left.sql}*1.0/${u.kids.right.sql}`:void 0;case"%":return this.hasModOperator?void 0:`MOD(${u.kids.left.sql},${u.kids.right.sql})`;case"dateLiteral":return this.sqlDateLiteral(x,u.literal);case"timestampLiteral":return this.sqlTimestampLiteral(x,u.literal,u.timezone);case"timestamptzLiteral":return this.sqlTimestamptzLiteral(x,u.literal,u.timezone);case"stringLiteral":return this.sqlLiteralString(u.literal);case"numberLiteral":return this.sqlLiteralNumber(u.literal);case"regexpLiteral":return this.sqlLiteralRegexp(u.literal);case"recordLiteral":return this.sqlLiteralRecord(u);case"arrayLiteral":return this.sqlLiteralArray(u)}}sqlSumDistinct(x,u,d){return"sqlSumDistinct called but not implemented"}sqlAggDistinct(x,u,d){return"sqlAggDistinct called but not implemented"}sqlSampleTable(x,u){if(u!==void 0)throw new Error(`Sampling is not supported on dialect ${this.name}.`);return x}sqlOrderBy(x,u){return`ORDER BY ${x.join(",")}`}sqlTzStr(x){return`"${x.queryTimezone}"`}sqlMakeUnnestKey(x,u){return this.concat(x,"'x'",u)}sqlStringAggDistinct(x,u,d){const f="__STRING_AGG_KS__",m="__STRING_AGG_KE__";return`REGEXP_REPLACE(
|
|
2
2
|
STRING_AGG(DISTINCT ${`concat('${f}', ${x}, '${m}', ${u})`}${d.length>0?","+d:""}),
|
|
3
3
|
'${f}.*?${m}',
|
|
4
4
|
''
|