@malloy-publisher/app 0.0.198 → 0.0.200

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 CHANGED
@@ -723,6 +723,13 @@ paths:
723
723
  description: |
724
724
  Executes a SQL statement against the specified database connection and returns the results.
725
725
  The results include data, metadata, and execution information.
726
+
727
+ Rows returned are capped at PUBLISHER_MAX_QUERY_ROWS (default 100,000).
728
+ The cap is forwarded to the connector as a rowLimit on RunSQLOptions;
729
+ queries that return more rows than the cap fail with HTTP 413 rather
730
+ than serializing the response. Set PUBLISHER_MAX_QUERY_ROWS=0 to
731
+ disable the cap. A caller-supplied rowLimit smaller than the cap is
732
+ preserved; larger values are clamped down to cap+1.
726
733
  parameters:
727
734
  - name: environmentName
728
735
  in: path
@@ -767,10 +774,14 @@ paths:
767
774
  $ref: "#/components/responses/Unauthorized"
768
775
  "404":
769
776
  $ref: "#/components/responses/NotFound"
777
+ "413":
778
+ $ref: "#/components/responses/PayloadTooLarge"
770
779
  "500":
771
780
  $ref: "#/components/responses/InternalServerError"
772
781
  "503":
773
782
  $ref: "#/components/responses/ServiceUnavailable"
783
+ "504":
784
+ $ref: "#/components/responses/GatewayTimeout"
774
785
 
775
786
  /environments/{environmentName}/connections/{connectionName}/sqlTemporaryTable:
776
787
  post:
@@ -869,58 +880,11 @@ paths:
869
880
  "503":
870
881
  $ref: "#/components/responses/ServiceUnavailable"
871
882
 
872
- # TODO: Remove this endpoint.
873
- /environments/{environmentName}/connections/{connectionName}/queryData:
874
- get:
875
- tags:
876
- - connections
877
- operationId: get-querydata
878
- deprecated: true
879
- summary: Execute SQL query (deprecated)
880
- description: |
881
- **DEPRECATED**: This endpoint is deprecated and may be removed in future versions.
882
- Use the POST version instead for better security and functionality.
883
-
884
- Executes a SQL statement against the specified database connection and returns the results.
885
- The query results include data, metadata, and execution information.
886
- parameters:
887
- - name: environmentName
888
- in: path
889
- description: Name of the environment
890
- required: true
891
- schema:
892
- $ref: "#/components/schemas/IdentifierPattern"
893
- - name: connectionName
894
- in: path
895
- description: Name of the connection
896
- required: true
897
- schema:
898
- $ref: "#/components/schemas/IdentifierPattern"
899
- - name: sqlStatement
900
- in: query
901
- description: SQL statement
902
- required: false
903
- schema:
904
- type: string
905
- - name: options
906
- in: query
907
- description: Options
908
- required: false
909
- schema:
910
- type: string
911
- responses:
912
- "200":
913
- description: Query execution results
914
- content:
915
- application/json:
916
- schema:
917
- $ref: "#/components/schemas/QueryData"
918
- "401":
919
- $ref: "#/components/responses/Unauthorized"
920
- "404":
921
- $ref: "#/components/responses/NotFound"
922
- "500":
923
- $ref: "#/components/responses/InternalServerError"
883
+ # NOTE: The GET …/connections/{connectionName}/queryData endpoint
884
+ # was removed alongside the operational-guards changes. Use the
885
+ # POST …/sqlQuery endpoint above instead — it accepts the SQL in
886
+ # the request body and obeys the row, byte, and timeout caps from
887
+ # the OOM-mitigation work.
924
888
 
925
889
  # ──────────────────────────────────────────────────────────────────
926
890
  # Per-package connection data routes.
@@ -1216,6 +1180,9 @@ paths:
1216
1180
  description: |
1217
1181
  Executes a SQL statement against the specified database connection,
1218
1182
  resolved in the context of the named package, and returns the results.
1183
+
1184
+ Subject to the same PUBLISHER_MAX_QUERY_ROWS row cap as the
1185
+ environment-level sqlQuery endpoint.
1219
1186
  parameters:
1220
1187
  - name: environmentName
1221
1188
  in: path
@@ -1266,10 +1233,14 @@ paths:
1266
1233
  $ref: "#/components/responses/Unauthorized"
1267
1234
  "404":
1268
1235
  $ref: "#/components/responses/NotFound"
1236
+ "413":
1237
+ $ref: "#/components/responses/PayloadTooLarge"
1269
1238
  "500":
1270
1239
  $ref: "#/components/responses/InternalServerError"
1271
1240
  "503":
1272
1241
  $ref: "#/components/responses/ServiceUnavailable"
1242
+ "504":
1243
+ $ref: "#/components/responses/GatewayTimeout"
1273
1244
 
1274
1245
  /environments/{environmentName}/packages/{packageName}/connections/{connectionName}/sqlTemporaryTable:
1275
1246
  post:
@@ -1379,63 +1350,9 @@ paths:
1379
1350
  "503":
1380
1351
  $ref: "#/components/responses/ServiceUnavailable"
1381
1352
 
1382
- # TODO: Remove this endpoint.
1383
- /environments/{environmentName}/packages/{packageName}/connections/{connectionName}/queryData:
1384
- get:
1385
- tags:
1386
- - connections
1387
- operationId: get-querydata-in-package
1388
- deprecated: true
1389
- summary: Execute SQL query (per-package, deprecated)
1390
- description: |
1391
- **DEPRECATED**: Use the POST version instead.
1392
-
1393
- Executes a SQL statement against the specified database connection,
1394
- resolved in the context of the named package, and returns the results.
1395
- parameters:
1396
- - name: environmentName
1397
- in: path
1398
- description: Name of the environment
1399
- required: true
1400
- schema:
1401
- $ref: "#/components/schemas/IdentifierPattern"
1402
- - name: packageName
1403
- in: path
1404
- description: Name of the package whose connection context to use
1405
- required: true
1406
- schema:
1407
- $ref: "#/components/schemas/IdentifierPattern"
1408
- - name: connectionName
1409
- in: path
1410
- description: Name of the connection
1411
- required: true
1412
- schema:
1413
- $ref: "#/components/schemas/IdentifierPattern"
1414
- - name: sqlStatement
1415
- in: query
1416
- description: SQL statement
1417
- required: false
1418
- schema:
1419
- type: string
1420
- - name: options
1421
- in: query
1422
- description: Options
1423
- required: false
1424
- schema:
1425
- type: string
1426
- responses:
1427
- "200":
1428
- description: Query execution results
1429
- content:
1430
- application/json:
1431
- schema:
1432
- $ref: "#/components/schemas/QueryData"
1433
- "401":
1434
- $ref: "#/components/responses/Unauthorized"
1435
- "404":
1436
- $ref: "#/components/responses/NotFound"
1437
- "500":
1438
- $ref: "#/components/responses/InternalServerError"
1353
+ # NOTE: The GET …/packages/{packageName}/connections/{connectionName}/queryData
1354
+ # endpoint was removed alongside the operational-guards changes.
1355
+ # Use the matching POST …/sqlQuery endpoint instead.
1439
1356
 
1440
1357
  /environments/{environmentName}/packages:
1441
1358
  get:
@@ -1808,12 +1725,16 @@ paths:
1808
1725
  $ref: "#/components/responses/Unauthorized"
1809
1726
  "404":
1810
1727
  $ref: "#/components/responses/NotFound"
1728
+ "413":
1729
+ $ref: "#/components/responses/PayloadTooLarge"
1811
1730
  "500":
1812
1731
  $ref: "#/components/responses/InternalServerError"
1813
1732
  "501":
1814
1733
  $ref: "#/components/responses/NotImplemented"
1815
1734
  "503":
1816
1735
  $ref: "#/components/responses/ServiceUnavailable"
1736
+ "504":
1737
+ $ref: "#/components/responses/GatewayTimeout"
1817
1738
 
1818
1739
  /environments/{environmentName}/packages/{packageName}/models/{path}/compile:
1819
1740
  post:
@@ -2024,6 +1945,12 @@ paths:
2024
1945
  enum:
2025
1946
  - "true"
2026
1947
  - "false"
1948
+ - name: givens
1949
+ in: query
1950
+ description: JSON-encoded given values keyed by given name
1951
+ required: false
1952
+ schema:
1953
+ type: string
2027
1954
  responses:
2028
1955
  "200":
2029
1956
  description: Cell execution result
@@ -2037,12 +1964,16 @@ paths:
2037
1964
  $ref: "#/components/responses/Unauthorized"
2038
1965
  "404":
2039
1966
  $ref: "#/components/responses/NotFound"
1967
+ "413":
1968
+ $ref: "#/components/responses/PayloadTooLarge"
2040
1969
  "500":
2041
1970
  $ref: "#/components/responses/InternalServerError"
2042
1971
  "501":
2043
1972
  $ref: "#/components/responses/NotImplemented"
2044
1973
  "503":
2045
1974
  $ref: "#/components/responses/ServiceUnavailable"
1975
+ "504":
1976
+ $ref: "#/components/responses/GatewayTimeout"
2046
1977
 
2047
1978
  /environments/{environmentName}/packages/{packageName}/databases:
2048
1979
  get:
@@ -2458,8 +2389,48 @@ components:
2458
2389
  schema:
2459
2390
  $ref: "#/components/schemas/Error"
2460
2391
  ServiceUnavailable:
2461
- description: The service is temporarily unavailable, typically due to
2462
- initialization, or draining state (Rolling updates, etc.)
2392
+ description: |
2393
+ The service is temporarily unable to accept the request. Possible
2394
+ causes:
2395
+ * Initialization or draining state (rolling updates, graceful
2396
+ shutdown).
2397
+ * Memory back-pressure — the publisher's RSS crossed the
2398
+ high-water mark derived from PUBLISHER_MAX_MEMORY_BYTES and
2399
+ PUBLISHER_MEMORY_HIGH_WATER_FRACTION, so new queries are
2400
+ rejected until RSS drops below the low-water mark
2401
+ (PUBLISHER_MEMORY_LOW_WATER_FRACTION).
2402
+ * Per-pod query concurrency cap reached — PUBLISHER_MAX_CONCURRENT_QUERIES
2403
+ in-flight queries are already running on this pod.
2404
+ Clients should retry with backoff; under sustained pressure, scale
2405
+ out, raise PUBLISHER_MAX_MEMORY_BYTES / PUBLISHER_MAX_CONCURRENT_QUERIES,
2406
+ or refine the offending queries.
2407
+ content:
2408
+ application/json:
2409
+ schema:
2410
+ $ref: "#/components/schemas/Error"
2411
+ PayloadTooLarge:
2412
+ description: |
2413
+ The request was well-formed but the response exceeds a server-side
2414
+ size cap. Two caps can fire:
2415
+ * PUBLISHER_MAX_QUERY_ROWS (default 100000) — too many rows.
2416
+ * PUBLISHER_MAX_RESPONSE_BYTES (default 50 MB) — JSON-serialized
2417
+ response too large.
2418
+ The error message identifies which cap fired. Refine the query (add
2419
+ a LIMIT, more selective WHERE, project fewer columns) or raise the
2420
+ relevant cap; retrying without changes will not succeed. The
2421
+ per-cap rejection counter is exported as
2422
+ publisher_query_cap_exceeded_total{cap_type, source}.
2423
+ content:
2424
+ application/json:
2425
+ schema:
2426
+ $ref: "#/components/schemas/Error"
2427
+ GatewayTimeout:
2428
+ description: |
2429
+ The query exceeded the per-request wall-clock budget
2430
+ (PUBLISHER_QUERY_TIMEOUT_MS) and was aborted server-side.
2431
+ Refine the query (add a more selective WHERE, lower LIMIT,
2432
+ simplify joins) or raise the timeout. Retrying without
2433
+ changes is unlikely to succeed.
2463
2434
  content:
2464
2435
  application/json:
2465
2436
  schema:
@@ -2670,6 +2641,12 @@ components:
2670
2641
  description: Sources defined in this model
2671
2642
  items:
2672
2643
  $ref: "#/components/schemas/Source"
2644
+ givens:
2645
+ type: array
2646
+ description: Givens (runtime parameters) declared on this model via the
2647
+ `given:` keyword
2648
+ items:
2649
+ $ref: "#/components/schemas/Given"
2673
2650
 
2674
2651
  View:
2675
2652
  type: object
@@ -2730,6 +2707,33 @@ components:
2730
2707
  description: Malloy data type of the dimension (e.g. string, number, boolean,
2731
2708
  date, timestamp)
2732
2709
 
2710
+ Given:
2711
+ type: object
2712
+ description: A given (runtime parameter) declared on a Malloy model via the
2713
+ `given:` keyword. Surfaced on `CompiledModel.givens` and `Source.givens`
2714
+ so callers can introspect what runtime values a model accepts.
2715
+ properties:
2716
+ name:
2717
+ type: string
2718
+ description: Name as declared in the model
2719
+ type:
2720
+ type: string
2721
+ description: Rendered Malloy type for the given (e.g. string, number,
2722
+ boolean, date, timestamp, filter<string>)
2723
+ annotations:
2724
+ type: array
2725
+ description: Annotations attached to the given declaration
2726
+ items:
2727
+ type: string
2728
+
2729
+ Givens:
2730
+ type: object
2731
+ description: Per-query given values that override model defaults. Keys are
2732
+ given names declared in the model's `given:` block. Values must match
2733
+ the declared type (string, number, boolean, date, etc.). See Malloy
2734
+ givens documentation for accepted value shapes.
2735
+ additionalProperties: true
2736
+
2733
2737
  Source:
2734
2738
  type: object
2735
2739
  description: A Malloy source defined in a model
@@ -2752,6 +2756,14 @@ components:
2752
2756
  description: Filters declared on this source via #(filter) annotations
2753
2757
  items:
2754
2758
  $ref: "#/components/schemas/Filter"
2759
+ givens:
2760
+ type: array
2761
+ description: Model-level givens (runtime parameters) available to queries
2762
+ on this source. Identical to `CompiledModel.givens`; repeated here
2763
+ for SDK ergonomics so consumers iterating sources can render inputs
2764
+ without a second lookup.
2765
+ items:
2766
+ $ref: "#/components/schemas/Given"
2755
2767
 
2756
2768
  QueryRequest:
2757
2769
  type: object
@@ -2789,6 +2801,8 @@ components:
2789
2801
  type: boolean
2790
2802
  default: false
2791
2803
  description: When true, skip server-side \#(filter) injection entirely.
2804
+ givens:
2805
+ $ref: "#/components/schemas/Givens"
2792
2806
 
2793
2807
  NotebookCell:
2794
2808
  type: object
@@ -3459,6 +3473,8 @@ components:
3459
3473
  description: If true, returns the generated SQL alongside compilation results
3460
3474
  (only available when compilation succeeds and the source contains a
3461
3475
  runnable query).
3476
+ givens:
3477
+ $ref: "#/components/schemas/Givens"
3462
3478
  required:
3463
3479
  - source
3464
3480
 
@@ -1 +1 @@
1
- import{S as r,F as t,j as e,_ as i,a2 as o}from"./index-U38AyjJL.js";function m(){const s=r(),{environmentName:n}=t();if(n){const a=i({environmentName:n});return e.jsx(o,{onSelectPackage:s,resourceUri:a})}else return e.jsx("div",{children:e.jsx("h2",{children:"Missing environment name"})})}export{m as default};
1
+ import{M as r,G as t,j as e,_ as i,a2 as o}from"./index-DE6d5jEy.js";function m(){const s=r(),{environmentName:n}=t();if(n){const a=i({environmentName:n});return e.jsx(o,{onSelectPackage:s,resourceUri:a})}else return e.jsx("div",{children:e.jsx("h2",{children:"Missing environment name"})})}export{m as default};
@@ -0,0 +1 @@
1
+ import{M as t,j as o,r}from"./index-DE6d5jEy.js";function e(){const n=t();return o.jsx(r,{onClickEnvironment:n})}export{e as default};
@@ -1,2 +1,2 @@
1
- import{u as we,g as ke,r as u,R as Se,a as Pe,c as $,j as t,s as I,B as Ce,m as _,e as re,b as oe,d as se,f as ae,h as Ee,i as O,k as ie,T as K,l as G,n as Ie,o as Me,p as Re,q as le,t as ze,v as ne,w as De,x as Te,y as Be,z as A,A as L,M as $e,P as He,C as Le,D as Ne,E as Ae,F as ce,S as J,G as x,H as We,I as X,J as Oe,K as Z,X as Ve,N as Ue,O as de,Q as pe,U as ue,V as he,W as Qe,Y as Fe,Z as Xe}from"./index-U38AyjJL.js";function Ye(e,r,n,o,s){const[a,i]=u.useState(()=>s&&n?n(e).matches:o?o(e).matches:r);return Pe(()=>{if(!n)return;const c=n(e),h=()=>{i(c.matches)};return h(),c.addEventListener("change",h),()=>{c.removeEventListener("change",h)}},[e,n]),a}const _e={...Se},fe=_e.useSyncExternalStore;function Ke(e,r,n,o,s){const a=u.useCallback(()=>r,[r]),i=u.useMemo(()=>{if(s&&n)return()=>n(e).matches;if(o!==null){const{matches:p}=o(e);return()=>p}return a},[a,e,o,s,n]),[c,h]=u.useMemo(()=>{if(n===null)return[a,()=>()=>{}];const p=n(e);return[()=>p.matches,m=>(p.addEventListener("change",m),()=>{p.removeEventListener("change",m)})]},[a,n,e]);return fe(h,c,i)}function me(e={}){const{themeId:r}=e;return function(o,s={}){let a=we();a&&r&&(a=a[r]||a);const i=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:c=!1,matchMedia:h=i?window.matchMedia:null,ssrMatchMedia:f=null,noSsr:p=!1}=ke({name:"MuiUseMediaQuery",props:s,theme:a});let m=typeof o=="function"?o(a):o;return m=m.replace(/^@media( ?)/m,""),m.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
- `)),(fe!==void 0?Ke:Ye)(m,c,h,f,p)}}me();const Ge=$(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"})),Je=I(Ce,{name:"MuiBreadcrumbCollapsed"})(_(({theme:e})=>({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`,...e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},borderRadius:2,"&:hover, &:focus":{...e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}},"&:active":{boxShadow:e.shadows[0],...e.palette.mode==="light"?{backgroundColor:re(e.palette.grey[200],.12)}:{backgroundColor:re(e.palette.grey[600],.12)}}}))),Ze=I(Ge)({width:24,height:16});function qe(e){const{slots:r={},slotProps:n={},...o}=e,s=e;return t.jsx("li",{children:t.jsx(Je,{focusRipple:!0,...o,ownerState:s,children:t.jsx(Ze,{as:r.CollapsedIcon,ownerState:s,...n.collapsedIcon})})})}function et(e){return se("MuiBreadcrumbs",e)}const tt=oe("MuiBreadcrumbs",["root","ol","li","separator"]),rt=e=>{const{classes:r}=e;return ie({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},et,r)},nt=I(K,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,r)=>[{[`& .${tt.li}`]:r.li},r.root]})({}),ot=I("ol",{name:"MuiBreadcrumbs",slot:"Ol"})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),st=I("li",{name:"MuiBreadcrumbs",slot:"Separator"})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function at(e,r,n,o){return e.reduce((s,a,i)=>(i<e.length-1?s=s.concat(a,t.jsx(st,{"aria-hidden":!0,className:r,ownerState:o,children:n},`separator-${i}`)):s.push(a),s),[])}const it=u.forwardRef(function(r,n){const o=ae({props:r,name:"MuiBreadcrumbs"}),{children:s,className:a,component:i="nav",slots:c={},slotProps:h={},expandText:f="Show path",itemsAfterCollapse:p=1,itemsBeforeCollapse:m=1,maxItems:y=8,separator:S="/",...H}=o,[M,P]=u.useState(!1),v={...o,component:i,expanded:M,expandText:f,itemsAfterCollapse:p,itemsBeforeCollapse:m,maxItems:y,separator:S},C=rt(v),R=Ee({elementType:c.CollapsedIcon,externalSlotProps:h.collapsedIcon,ownerState:v}),j=u.useRef(null),w=d=>{const k=()=>{P(!0);const b=j.current.querySelector("a[href],button,[tabindex]");b&&b.focus()};return m+p>=d.length?d:[...d.slice(0,m),t.jsx(qe,{"aria-label":f,slots:{CollapsedIcon:c.CollapsedIcon},slotProps:{collapsedIcon:R},onClick:k},"ellipsis"),...d.slice(d.length-p,d.length)]},z=u.Children.toArray(s).filter(d=>u.isValidElement(d)).map((d,k)=>t.jsx("li",{className:C.li,children:d},`child-${k}`));return t.jsx(nt,{ref:n,component:i,color:"textSecondary",className:O(C.root,a),ownerState:v,...H,children:t.jsx(ot,{className:C.ol,ref:j,ownerState:v,children:at(M||y&&z.length<=y?z:w(z),C.separator,S,v)})})});function lt(e,r,n){const o=r.getBoundingClientRect(),s=n&&n.getBoundingClientRect(),a=le(r);let i;if(r.fakeTransform)i=r.fakeTransform;else{const f=a.getComputedStyle(r);i=f.getPropertyValue("-webkit-transform")||f.getPropertyValue("transform")}let c=0,h=0;if(i&&i!=="none"&&typeof i=="string"){const f=i.split("(")[1].split(")")[0].split(",");c=parseInt(f[4],10),h=parseInt(f[5],10)}return e==="left"?s?`translateX(${s.right+c-o.left}px)`:`translateX(${a.innerWidth+c-o.left}px)`:e==="right"?s?`translateX(-${o.right-s.left-c}px)`:`translateX(-${o.left+o.width-c}px)`:e==="up"?s?`translateY(${s.bottom+h-o.top}px)`:`translateY(${a.innerHeight+h-o.top}px)`:s?`translateY(-${o.top-s.top+o.height-h}px)`:`translateY(-${o.top+o.height-h}px)`}function ct(e){return typeof e=="function"?e():e}function W(e,r,n){const o=ct(n),s=lt(e,r,o);s&&(r.style.webkitTransform=s,r.style.transform=s)}const dt=u.forwardRef(function(r,n){const o=G(),s={enter:o.transitions.easing.easeOut,exit:o.transitions.easing.sharp},a={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{addEndListener:i,appear:c=!0,children:h,container:f,direction:p="down",easing:m=s,in:y,onEnter:S,onEntered:H,onEntering:M,onExit:P,onExited:v,onExiting:C,style:R,timeout:j=a,TransitionComponent:w=Ie,...z}=r,d=u.useRef(null),k=Me(Re(h),d,n),b=l=>g=>{l&&(g===void 0?l(d.current):l(d.current,g))},V=b((l,g)=>{W(p,l,f),De(l),S&&S(l,g)}),q=b((l,g)=>{const B=ne({timeout:j,style:R,easing:m},{mode:"enter"});l.style.webkitTransition=o.transitions.create("-webkit-transform",{...B}),l.style.transition=o.transitions.create("transform",{...B}),l.style.webkitTransform="none",l.style.transform="none",M&&M(l,g)}),D=b(H),T=b(C),E=b(l=>{const g=ne({timeout:j,style:R,easing:m},{mode:"exit"});l.style.webkitTransition=o.transitions.create("-webkit-transform",g),l.style.transition=o.transitions.create("transform",g),W(p,l,f),P&&P(l)}),U=b(l=>{l.style.webkitTransition="",l.style.transition="",v&&v(l)}),Q=l=>{i&&i(d.current,l)},N=u.useCallback(()=>{d.current&&W(p,d.current,f)},[p,f]);return u.useEffect(()=>{if(y||p==="down"||p==="right")return;const l=ze(()=>{d.current&&W(p,d.current,f)}),g=le(d.current);return g.addEventListener("resize",l),()=>{l.clear(),g.removeEventListener("resize",l)}},[p,y,f]),u.useEffect(()=>{y||N()},[y,N]),t.jsx(w,{nodeRef:d,onEnter:V,onEntered:D,onEntering:q,onExit:E,onExited:U,onExiting:T,addEndListener:Q,appear:c,in:y,timeout:j,...z,children:(l,{ownerState:g,...B})=>u.cloneElement(h,{ref:k,style:{visibility:l==="exited"&&!y?"hidden":void 0,...R,...h.props.style},...B})})});function pt(e){return se("MuiDrawer",e)}oe("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const xe=(e,r)=>{const{ownerState:n}=e;return[r.root,(n.variant==="permanent"||n.variant==="persistent")&&r.docked,r.modal]},ut=e=>{const{classes:r,anchor:n,variant:o}=e,s={root:["root",`anchor${L(n)}`],docked:[(o==="permanent"||o==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${L(n)}`,o!=="temporary"&&`paperAnchorDocked${L(n)}`]};return ie(s,pt,r)},ht=I($e,{name:"MuiDrawer",slot:"Root",overridesResolver:xe})(_(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),ft=I("div",{shouldForwardProp:Le,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:xe})({flex:"0 0 auto"}),mt=I(He,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,r)=>{const{ownerState:n}=e;return[r.paper,r[`paperAnchor${L(n.anchor)}`],n.variant!=="temporary"&&r[`paperAnchorDocked${L(n.anchor)}`]]}})(_(({theme:e})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:r})=>r.anchor==="left"&&r.variant!=="temporary",style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="top"&&r.variant!=="temporary",style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="right"&&r.variant!=="temporary",style:{borderLeft:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="bottom"&&r.variant!=="temporary",style:{borderTop:`1px solid ${(e.vars||e).palette.divider}`}}]}))),ge={left:"right",right:"left",top:"down",bottom:"up"};function xt(e){return["left","right"].includes(e)}function gt({direction:e},r){return e==="rtl"&&xt(r)?ge[r]:r}const yt=u.forwardRef(function(r,n){const o=ae({props:r,name:"MuiDrawer"}),s=G(),a=Te(),i={enter:s.transitions.duration.enteringScreen,exit:s.transitions.duration.leavingScreen},{anchor:c="left",BackdropProps:h,children:f,className:p,elevation:m=16,hideBackdrop:y=!1,ModalProps:{BackdropProps:S,...H}={},onClose:M,open:P=!1,PaperProps:v={},SlideProps:C,TransitionComponent:R,transitionDuration:j=i,variant:w="temporary",slots:z={},slotProps:d={},...k}=o,b=u.useRef(!1);u.useEffect(()=>{b.current=!0},[]);const V=gt({direction:a?"rtl":"ltr"},c),D={...o,anchor:c,elevation:m,open:P,variant:w,...k},T=ut(D),E={slots:{transition:R,...z},slotProps:{paper:v,transition:C,...d,backdrop:Be(d.backdrop||{...h,...S},{transitionDuration:j})}},[U,Q]=A("root",{ref:n,elementType:ht,className:O(T.root,T.modal,p),shouldForwardComponentProp:!0,ownerState:D,externalForwardedProps:{...E,...k,...H},additionalProps:{open:P,onClose:M,hideBackdrop:y,slots:{backdrop:E.slots.backdrop},slotProps:{backdrop:E.slotProps.backdrop}}}),[N,l]=A("paper",{elementType:mt,shouldForwardComponentProp:!0,className:O(T.paper,v.className),ownerState:D,externalForwardedProps:E,additionalProps:{elevation:w==="temporary"?m:0,square:!0,...w==="temporary"&&{role:"dialog","aria-modal":"true"}}}),[g,B]=A("docked",{elementType:ft,ref:n,className:O(T.root,T.docked,p),ownerState:D,externalForwardedProps:E,additionalProps:k}),[ve,je]=A("transition",{elementType:dt,ownerState:D,externalForwardedProps:E,additionalProps:{in:P,direction:ge[V],timeout:j,appear:b.current}}),ee=t.jsx(N,{...l,children:f});if(w==="permanent")return t.jsx(g,{...B,children:ee});const te=t.jsx(ve,{...je,children:ee});return w==="persistent"?t.jsx(g,{...B,children:te}):t.jsx(U,{...Q,children:te})}),bt=me({themeId:Ne}),vt=$([t.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),t.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),jt=$(t.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),wt=$(t.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"})),kt=$(t.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"})),St=$(t.jsx("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81zM12 3 2 12h3v8h6v-6h2v6h6v-8h3z"})),Pt=$(t.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"}));function Y(e){return t.jsxs(Ae,{...e,viewBox:"0 0 24 24",sx:{fill:"none",...e.sx},children:[t.jsx("rect",{x:"3.25",y:"4.75",width:"17.5",height:"14.5",rx:"2.25",stroke:"currentColor",strokeWidth:"1.5"}),t.jsx("line",{x1:"8.5",y1:"5",x2:"8.5",y2:"19",stroke:"currentColor",strokeWidth:"1.5"})]})}function F({label:e,onClick:r}){return t.jsx(We,{clickable:!0,onClick:r,label:e,size:"small","aria-label":`Navigate to ${e}`,sx:{backgroundColor:"background.paper",color:"text.primary",fontWeight:500,fontSize:"0.875rem",height:32,cursor:"pointer",borderRadius:"4px",maxWidth:320,"& .MuiChip-label":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},"&:hover":{backgroundColor:"grey.100"}}})}function Ct(){const e=ce(),r=e["*"],n=J();return!e.environmentName&&!e.packageName&&!r?null:t.jsx(x,{sx:{display:"flex",alignItems:"center",minWidth:0},children:t.jsxs(it,{"aria-label":"breadcrumb",separator:t.jsx(jt,{sx:{fontSize:14,color:"text.secondary"}}),children:[e.environmentName&&t.jsx(F,{label:e.environmentName,onClick:o=>n(`/${e.environmentName}/`,o)}),e.packageName&&t.jsx(F,{label:e.packageName,onClick:o=>n(`/${e.environmentName}/${e.packageName}/`,o)}),r&&t.jsx(F,{label:r,onClick:o=>n(`/${e.environmentName}/${e.packageName}/${r}`,o)})]})})}const Et=260,It=64;function ye({isCollapsed:e,onToggleCollapse:r,logoHeader:n}){return t.jsxs(x,{sx:{height:"100dvh",width:e?It:Et,flexShrink:0,display:"flex",flexDirection:"column",backgroundColor:"background.paper",transition:"width 0.2s cubic-bezier(0.4, 0, 0.2, 1)",overflow:"hidden"},children:[t.jsx(Mt,{isCollapsed:e,onToggleCollapse:r,logoHeader:n}),t.jsxs(x,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",py:1},children:[t.jsx(Rt,{isCollapsed:e}),t.jsx(zt,{isCollapsed:e})]}),t.jsx(Dt,{isCollapsed:e})]})}function Mt({isCollapsed:e,onToggleCollapse:r,logoHeader:n}){const o=J();return n?t.jsxs(x,{sx:{height:56,display:"flex",alignItems:"center",justifyContent:"space-between",px:e?0:2,flexShrink:0},children:[n,t.jsx(X,{size:"small",onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",children:t.jsx(Y,{fontSize:"small"})})]}):t.jsxs(x,{sx:{height:56,display:"flex",alignItems:"center",justifyContent:e?"center":"space-between",px:e?0:2,flexShrink:0},children:[t.jsxs(x,{onClick:s=>o("/",s),sx:{display:"flex",alignItems:"center",gap:1,cursor:"pointer",minWidth:0},children:[t.jsx(x,{component:"img",src:"/logo.svg",alt:"Malloy",sx:{width:24,height:24,flexShrink:0}}),!e&&t.jsx(K,{variant:"subtitle1",sx:{color:"text.primary",fontWeight:500,letterSpacing:"-0.025em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:"Malloy Publisher"})]}),!e&&t.jsx(X,{size:"small",onClick:r,"aria-label":"Collapse sidebar",children:t.jsx(Y,{fontSize:"small"})})]})}function Rt({isCollapsed:e}){const n=Oe().pathname==="/";return t.jsx(Z,{sx:{py:0},children:t.jsx(be,{icon:t.jsx(St,{fontSize:"small"}),label:"Home",to:"/",selected:n,isCollapsed:e})})}function zt({isCollapsed:e}){const{apiClients:r}=Ve(),n=ce(),{data:o}=Ue({queryKey:["environments"],queryFn:()=>r.environments.listEnvironments()}),s=o?.data??[];return s.length===0?null:t.jsxs(x,{sx:{mt:1},children:[!e&&t.jsx(K,{variant:"caption",sx:{display:"block",px:3,py:1,color:"text.secondary",fontWeight:500,textTransform:"uppercase",fontSize:"0.6875rem",letterSpacing:"0.5px"},children:"Environments"}),t.jsx(Z,{sx:{py:0},children:s.map(a=>{const i=a.name??"";return t.jsx(be,{icon:t.jsx(kt,{fontSize:"small"}),label:i,to:`/${i}`,selected:n.environmentName===i,isCollapsed:e},i)})})]})}function Dt({isCollapsed:e}){const r=[{label:"Malloy Docs",href:"https://docs.malloydata.dev/documentation/",icon:t.jsx(vt,{fontSize:"small"}),external:!0},{label:"Publisher Docs",href:"https://github.com/malloydata/publisher/blob/main/README.md",icon:t.jsx(Pt,{fontSize:"small"}),external:!0},{label:"Publisher API",href:"/api-doc.html",icon:t.jsx(wt,{fontSize:"small"}),external:!1}];return t.jsx(Z,{sx:{py:1},children:r.map(n=>t.jsx(Tt,{label:n.label,href:n.href,icon:n.icon,external:n.external,isCollapsed:e},n.label))})}function be({icon:e,label:r,to:n,selected:o,isCollapsed:s}){const a=J(),i=t.jsxs(pe,{selected:o,onClick:c=>a(n,c),sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(ue,{sx:{minWidth:s?0:36,justifyContent:"center",color:o?"text.primary":"text.secondary"},children:e}),!s&&t.jsx(he,{primary:r,primaryTypographyProps:{variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(de,{title:r,placement:"right",children:t.jsx(x,{children:i})}):i}function Tt({label:e,href:r,icon:n,external:o,isCollapsed:s}){const a=t.jsxs(pe,{component:"a",href:r,target:o?"_blank":void 0,rel:o?"noopener noreferrer":void 0,sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(ue,{sx:{minWidth:s?0:36,justifyContent:"center",color:"text.secondary"},children:n}),!s&&t.jsx(he,{primary:e,primaryTypographyProps:{variant:"body2",sx:{color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(de,{title:e,placement:"right",children:t.jsx(x,{children:a})}):a}function Bt({open:e,onClose:r,logoHeader:n}){return t.jsx(yt,{anchor:"left",open:e,onClose:r,ModalProps:{keepMounted:!0},sx:{display:{xs:"block",md:"none"},"& .MuiDrawer-paper":{boxSizing:"border-box",width:260}},children:t.jsx(ye,{isCollapsed:!1,onToggleCollapse:r,logoHeader:n})})}function Ht({headerProps:e}){const r=G(),n=bt(r.breakpoints.up("md")),[o,s]=u.useState(!1),[a,i]=u.useState(!1);return u.useEffect(()=>{n&&o&&s(!1)},[n,o]),t.jsxs(x,{sx:{height:"100dvh",display:"flex",flexDirection:"row",bgcolor:"background.default"},children:[n&&t.jsx(ye,{isCollapsed:a,onToggleCollapse:()=>i(c=>!c),logoHeader:e?.logoHeader}),t.jsxs(x,{component:"main",sx:{flex:1,display:"flex",flexDirection:"column",minWidth:0},children:[t.jsxs(x,{sx:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"space-between",height:Qe.headerHeight,px:{xs:1,md:3},backgroundColor:"background.default"},children:[t.jsx(x,{sx:{display:{xs:"flex",md:"none"},alignItems:"center",mr:1},children:t.jsx(X,{size:"small",onClick:()=>s(!0),"aria-label":"Open navigation",children:t.jsx(Y,{fontSize:"small"})})}),t.jsx(x,{sx:{flex:1,minWidth:0,display:"flex",alignItems:"center"},children:t.jsx(Ct,{})}),t.jsx(x,{id:"header-actions-portal",sx:{display:"flex",alignItems:"center",flexShrink:0,gap:1},children:e?.endCap})]}),t.jsx(x,{sx:{flex:1,overflow:"auto",minWidth:320,minHeight:0},children:t.jsx(u.Suspense,{fallback:t.jsx(Xe,{}),children:t.jsx(Fe,{})})})]}),t.jsx(Bt,{open:o,onClose:()=>s(!1),logoHeader:e?.logoHeader})]})}export{Ht as default};
1
+ import{u as we,g as ke,a as u,R as Se,b as Pe,c as $,j as t,s as I,B as Ce,m as _,e as re,d as oe,f as se,h as ae,i as Ee,k as O,l as ie,T as K,n as G,o as Ie,p as Me,q as Re,t as le,v as ze,w as ne,x as De,y as Te,z as Be,A,C as H,D as $e,P as Le,E as He,F as Ne,S as Ae,G as ce,M as J,H as x,I as We,J as X,K as Oe,L as Z,X as Ve,N as Ue,O as de,Q as pe,U as ue,V as he,W as Qe,Y as Fe,Z as Xe}from"./index-DE6d5jEy.js";function Ye(e,r,n,o,s){const[a,i]=u.useState(()=>s&&n?n(e).matches:o?o(e).matches:r);return Pe(()=>{if(!n)return;const c=n(e),h=()=>{i(c.matches)};return h(),c.addEventListener("change",h),()=>{c.removeEventListener("change",h)}},[e,n]),a}const _e={...Se},fe=_e.useSyncExternalStore;function Ke(e,r,n,o,s){const a=u.useCallback(()=>r,[r]),i=u.useMemo(()=>{if(s&&n)return()=>n(e).matches;if(o!==null){const{matches:p}=o(e);return()=>p}return a},[a,e,o,s,n]),[c,h]=u.useMemo(()=>{if(n===null)return[a,()=>()=>{}];const p=n(e);return[()=>p.matches,m=>(p.addEventListener("change",m),()=>{p.removeEventListener("change",m)})]},[a,n,e]);return fe(h,c,i)}function me(e={}){const{themeId:r}=e;return function(o,s={}){let a=we();a&&r&&(a=a[r]||a);const i=typeof window<"u"&&typeof window.matchMedia<"u",{defaultMatches:c=!1,matchMedia:h=i?window.matchMedia:null,ssrMatchMedia:f=null,noSsr:p=!1}=ke({name:"MuiUseMediaQuery",props:s,theme:a});let m=typeof o=="function"?o(a):o;return m=m.replace(/^@media( ?)/m,""),m.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
+ `)),(fe!==void 0?Ke:Ye)(m,c,h,f,p)}}me();const Ge=$(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"})),Je=I(Ce,{name:"MuiBreadcrumbCollapsed"})(_(({theme:e})=>({display:"flex",marginLeft:`calc(${e.spacing(1)} * 0.5)`,marginRight:`calc(${e.spacing(1)} * 0.5)`,...e.palette.mode==="light"?{backgroundColor:e.palette.grey[100],color:e.palette.grey[700]}:{backgroundColor:e.palette.grey[700],color:e.palette.grey[100]},borderRadius:2,"&:hover, &:focus":{...e.palette.mode==="light"?{backgroundColor:e.palette.grey[200]}:{backgroundColor:e.palette.grey[600]}},"&:active":{boxShadow:e.shadows[0],...e.palette.mode==="light"?{backgroundColor:re(e.palette.grey[200],.12)}:{backgroundColor:re(e.palette.grey[600],.12)}}}))),Ze=I(Ge)({width:24,height:16});function qe(e){const{slots:r={},slotProps:n={},...o}=e,s=e;return t.jsx("li",{children:t.jsx(Je,{focusRipple:!0,...o,ownerState:s,children:t.jsx(Ze,{as:r.CollapsedIcon,ownerState:s,...n.collapsedIcon})})})}function et(e){return se("MuiBreadcrumbs",e)}const tt=oe("MuiBreadcrumbs",["root","ol","li","separator"]),rt=e=>{const{classes:r}=e;return ie({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},et,r)},nt=I(K,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,r)=>[{[`& .${tt.li}`]:r.li},r.root]})({}),ot=I("ol",{name:"MuiBreadcrumbs",slot:"Ol"})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),st=I("li",{name:"MuiBreadcrumbs",slot:"Separator"})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function at(e,r,n,o){return e.reduce((s,a,i)=>(i<e.length-1?s=s.concat(a,t.jsx(st,{"aria-hidden":!0,className:r,ownerState:o,children:n},`separator-${i}`)):s.push(a),s),[])}const it=u.forwardRef(function(r,n){const o=ae({props:r,name:"MuiBreadcrumbs"}),{children:s,className:a,component:i="nav",slots:c={},slotProps:h={},expandText:f="Show path",itemsAfterCollapse:p=1,itemsBeforeCollapse:m=1,maxItems:y=8,separator:S="/",...L}=o,[M,P]=u.useState(!1),v={...o,component:i,expanded:M,expandText:f,itemsAfterCollapse:p,itemsBeforeCollapse:m,maxItems:y,separator:S},C=rt(v),R=Ee({elementType:c.CollapsedIcon,externalSlotProps:h.collapsedIcon,ownerState:v}),j=u.useRef(null),w=d=>{const k=()=>{P(!0);const b=j.current.querySelector("a[href],button,[tabindex]");b&&b.focus()};return m+p>=d.length?d:[...d.slice(0,m),t.jsx(qe,{"aria-label":f,slots:{CollapsedIcon:c.CollapsedIcon},slotProps:{collapsedIcon:R},onClick:k},"ellipsis"),...d.slice(d.length-p,d.length)]},z=u.Children.toArray(s).filter(d=>u.isValidElement(d)).map((d,k)=>t.jsx("li",{className:C.li,children:d},`child-${k}`));return t.jsx(nt,{ref:n,component:i,color:"textSecondary",className:O(C.root,a),ownerState:v,...L,children:t.jsx(ot,{className:C.ol,ref:j,ownerState:v,children:at(M||y&&z.length<=y?z:w(z),C.separator,S,v)})})});function lt(e,r,n){const o=r.getBoundingClientRect(),s=n&&n.getBoundingClientRect(),a=le(r);let i;if(r.fakeTransform)i=r.fakeTransform;else{const f=a.getComputedStyle(r);i=f.getPropertyValue("-webkit-transform")||f.getPropertyValue("transform")}let c=0,h=0;if(i&&i!=="none"&&typeof i=="string"){const f=i.split("(")[1].split(")")[0].split(",");c=parseInt(f[4],10),h=parseInt(f[5],10)}return e==="left"?s?`translateX(${s.right+c-o.left}px)`:`translateX(${a.innerWidth+c-o.left}px)`:e==="right"?s?`translateX(-${o.right-s.left-c}px)`:`translateX(-${o.left+o.width-c}px)`:e==="up"?s?`translateY(${s.bottom+h-o.top}px)`:`translateY(${a.innerHeight+h-o.top}px)`:s?`translateY(-${o.top-s.top+o.height-h}px)`:`translateY(-${o.top+o.height-h}px)`}function ct(e){return typeof e=="function"?e():e}function W(e,r,n){const o=ct(n),s=lt(e,r,o);s&&(r.style.webkitTransform=s,r.style.transform=s)}const dt=u.forwardRef(function(r,n){const o=G(),s={enter:o.transitions.easing.easeOut,exit:o.transitions.easing.sharp},a={enter:o.transitions.duration.enteringScreen,exit:o.transitions.duration.leavingScreen},{addEndListener:i,appear:c=!0,children:h,container:f,direction:p="down",easing:m=s,in:y,onEnter:S,onEntered:L,onEntering:M,onExit:P,onExited:v,onExiting:C,style:R,timeout:j=a,TransitionComponent:w=Ie,...z}=r,d=u.useRef(null),k=Me(Re(h),d,n),b=l=>g=>{l&&(g===void 0?l(d.current):l(d.current,g))},V=b((l,g)=>{W(p,l,f),De(l),S&&S(l,g)}),q=b((l,g)=>{const B=ne({timeout:j,style:R,easing:m},{mode:"enter"});l.style.webkitTransition=o.transitions.create("-webkit-transform",{...B}),l.style.transition=o.transitions.create("transform",{...B}),l.style.webkitTransform="none",l.style.transform="none",M&&M(l,g)}),D=b(L),T=b(C),E=b(l=>{const g=ne({timeout:j,style:R,easing:m},{mode:"exit"});l.style.webkitTransition=o.transitions.create("-webkit-transform",g),l.style.transition=o.transitions.create("transform",g),W(p,l,f),P&&P(l)}),U=b(l=>{l.style.webkitTransition="",l.style.transition="",v&&v(l)}),Q=l=>{i&&i(d.current,l)},N=u.useCallback(()=>{d.current&&W(p,d.current,f)},[p,f]);return u.useEffect(()=>{if(y||p==="down"||p==="right")return;const l=ze(()=>{d.current&&W(p,d.current,f)}),g=le(d.current);return g.addEventListener("resize",l),()=>{l.clear(),g.removeEventListener("resize",l)}},[p,y,f]),u.useEffect(()=>{y||N()},[y,N]),t.jsx(w,{nodeRef:d,onEnter:V,onEntered:D,onEntering:q,onExit:E,onExited:U,onExiting:T,addEndListener:Q,appear:c,in:y,timeout:j,...z,children:(l,{ownerState:g,...B})=>u.cloneElement(h,{ref:k,style:{visibility:l==="exited"&&!y?"hidden":void 0,...R,...h.props.style},...B})})});function pt(e){return se("MuiDrawer",e)}oe("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const xe=(e,r)=>{const{ownerState:n}=e;return[r.root,(n.variant==="permanent"||n.variant==="persistent")&&r.docked,r.modal]},ut=e=>{const{classes:r,anchor:n,variant:o}=e,s={root:["root",`anchor${H(n)}`],docked:[(o==="permanent"||o==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${H(n)}`,o!=="temporary"&&`paperAnchorDocked${H(n)}`]};return ie(s,pt,r)},ht=I($e,{name:"MuiDrawer",slot:"Root",overridesResolver:xe})(_(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),ft=I("div",{shouldForwardProp:He,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:xe})({flex:"0 0 auto"}),mt=I(Le,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,r)=>{const{ownerState:n}=e;return[r.paper,r[`paperAnchor${H(n.anchor)}`],n.variant!=="temporary"&&r[`paperAnchorDocked${H(n.anchor)}`]]}})(_(({theme:e})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:r})=>r.anchor==="left"&&r.variant!=="temporary",style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="top"&&r.variant!=="temporary",style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="right"&&r.variant!=="temporary",style:{borderLeft:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:r})=>r.anchor==="bottom"&&r.variant!=="temporary",style:{borderTop:`1px solid ${(e.vars||e).palette.divider}`}}]}))),ge={left:"right",right:"left",top:"down",bottom:"up"};function xt(e){return["left","right"].includes(e)}function gt({direction:e},r){return e==="rtl"&&xt(r)?ge[r]:r}const yt=u.forwardRef(function(r,n){const o=ae({props:r,name:"MuiDrawer"}),s=G(),a=Te(),i={enter:s.transitions.duration.enteringScreen,exit:s.transitions.duration.leavingScreen},{anchor:c="left",BackdropProps:h,children:f,className:p,elevation:m=16,hideBackdrop:y=!1,ModalProps:{BackdropProps:S,...L}={},onClose:M,open:P=!1,PaperProps:v={},SlideProps:C,TransitionComponent:R,transitionDuration:j=i,variant:w="temporary",slots:z={},slotProps:d={},...k}=o,b=u.useRef(!1);u.useEffect(()=>{b.current=!0},[]);const V=gt({direction:a?"rtl":"ltr"},c),D={...o,anchor:c,elevation:m,open:P,variant:w,...k},T=ut(D),E={slots:{transition:R,...z},slotProps:{paper:v,transition:C,...d,backdrop:Be(d.backdrop||{...h,...S},{transitionDuration:j})}},[U,Q]=A("root",{ref:n,elementType:ht,className:O(T.root,T.modal,p),shouldForwardComponentProp:!0,ownerState:D,externalForwardedProps:{...E,...k,...L},additionalProps:{open:P,onClose:M,hideBackdrop:y,slots:{backdrop:E.slots.backdrop},slotProps:{backdrop:E.slotProps.backdrop}}}),[N,l]=A("paper",{elementType:mt,shouldForwardComponentProp:!0,className:O(T.paper,v.className),ownerState:D,externalForwardedProps:E,additionalProps:{elevation:w==="temporary"?m:0,square:!0,...w==="temporary"&&{role:"dialog","aria-modal":"true"}}}),[g,B]=A("docked",{elementType:ft,ref:n,className:O(T.root,T.docked,p),ownerState:D,externalForwardedProps:E,additionalProps:k}),[ve,je]=A("transition",{elementType:dt,ownerState:D,externalForwardedProps:E,additionalProps:{in:P,direction:ge[V],timeout:j,appear:b.current}}),ee=t.jsx(N,{...l,children:f});if(w==="permanent")return t.jsx(g,{...B,children:ee});const te=t.jsx(ve,{...je,children:ee});return w==="persistent"?t.jsx(g,{...B,children:te}):t.jsx(U,{...Q,children:te})}),bt=me({themeId:Ne}),vt=$([t.jsx("path",{d:"M19 5v14H5V5zm0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"},"0"),t.jsx("path",{d:"M14 17H7v-2h7zm3-4H7v-2h10zm0-4H7V7h10z"},"1")]),jt=$(t.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),wt=$(t.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"})),kt=$(t.jsx("path",{d:"m9.17 6 2 2H20v10H4V6zM10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8z"})),St=$(t.jsx("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81zM12 3 2 12h3v8h6v-6h2v6h6v-8h3z"})),Pt=$(t.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"}));function Y(e){return t.jsxs(Ae,{...e,viewBox:"0 0 24 24",sx:{fill:"none",...e.sx},children:[t.jsx("rect",{x:"3.25",y:"4.75",width:"17.5",height:"14.5",rx:"2.25",stroke:"currentColor",strokeWidth:"1.5"}),t.jsx("line",{x1:"8.5",y1:"5",x2:"8.5",y2:"19",stroke:"currentColor",strokeWidth:"1.5"})]})}function F({label:e,onClick:r}){return t.jsx(We,{clickable:!0,onClick:r,label:e,size:"small","aria-label":`Navigate to ${e}`,sx:{backgroundColor:"background.paper",color:"text.primary",fontWeight:500,fontSize:"0.875rem",height:32,cursor:"pointer",borderRadius:"4px",maxWidth:320,"& .MuiChip-label":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},"&:hover":{backgroundColor:"grey.100"}}})}function Ct(){const e=ce(),r=e["*"],n=J();return!e.environmentName&&!e.packageName&&!r?null:t.jsx(x,{sx:{display:"flex",alignItems:"center",minWidth:0},children:t.jsxs(it,{"aria-label":"breadcrumb",separator:t.jsx(jt,{sx:{fontSize:14,color:"text.secondary"}}),children:[e.environmentName&&t.jsx(F,{label:e.environmentName,onClick:o=>n(`/${e.environmentName}/`,o)}),e.packageName&&t.jsx(F,{label:e.packageName,onClick:o=>n(`/${e.environmentName}/${e.packageName}/`,o)}),r&&t.jsx(F,{label:r,onClick:o=>n(`/${e.environmentName}/${e.packageName}/${r}`,o)})]})})}const Et=260,It=64;function ye({isCollapsed:e,onToggleCollapse:r,logoHeader:n}){return t.jsxs(x,{sx:{height:"100dvh",width:e?It:Et,flexShrink:0,display:"flex",flexDirection:"column",backgroundColor:"background.paper",transition:"width 0.2s cubic-bezier(0.4, 0, 0.2, 1)",overflow:"hidden"},children:[t.jsx(Mt,{isCollapsed:e,onToggleCollapse:r,logoHeader:n}),t.jsxs(x,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",py:1},children:[t.jsx(Rt,{isCollapsed:e}),t.jsx(zt,{isCollapsed:e})]}),t.jsx(Dt,{isCollapsed:e})]})}function Mt({isCollapsed:e,onToggleCollapse:r,logoHeader:n}){const o=J();return n?t.jsxs(x,{sx:{height:56,display:"flex",alignItems:"center",justifyContent:"space-between",px:e?0:2,flexShrink:0},children:[n,t.jsx(X,{size:"small",onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",children:t.jsx(Y,{fontSize:"small"})})]}):t.jsxs(x,{sx:{height:56,display:"flex",alignItems:"center",justifyContent:e?"center":"space-between",px:e?0:2,flexShrink:0},children:[t.jsxs(x,{onClick:s=>o("/",s),sx:{display:"flex",alignItems:"center",gap:1,cursor:"pointer",minWidth:0},children:[t.jsx(x,{component:"img",src:"/logo.svg",alt:"Malloy",sx:{width:24,height:24,flexShrink:0}}),!e&&t.jsx(K,{variant:"subtitle1",sx:{color:"text.primary",fontWeight:500,letterSpacing:"-0.025em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:"Malloy Publisher"})]}),!e&&t.jsx(X,{size:"small",onClick:r,"aria-label":"Collapse sidebar",children:t.jsx(Y,{fontSize:"small"})})]})}function Rt({isCollapsed:e}){const n=Oe().pathname==="/";return t.jsx(Z,{sx:{py:0},children:t.jsx(be,{icon:t.jsx(St,{fontSize:"small"}),label:"Home",to:"/",selected:n,isCollapsed:e})})}function zt({isCollapsed:e}){const{apiClients:r}=Ve(),n=ce(),{data:o}=Ue({queryKey:["environments"],queryFn:()=>r.environments.listEnvironments()}),s=o?.data??[];return s.length===0?null:t.jsxs(x,{sx:{mt:1},children:[!e&&t.jsx(K,{variant:"caption",sx:{display:"block",px:3,py:1,color:"text.secondary",fontWeight:500,textTransform:"uppercase",fontSize:"0.6875rem",letterSpacing:"0.5px"},children:"Environments"}),t.jsx(Z,{sx:{py:0},children:s.map(a=>{const i=a.name??"";return t.jsx(be,{icon:t.jsx(kt,{fontSize:"small"}),label:i,to:`/${i}`,selected:n.environmentName===i,isCollapsed:e},i)})})]})}function Dt({isCollapsed:e}){const r=[{label:"Malloy Docs",href:"https://docs.malloydata.dev/documentation/",icon:t.jsx(vt,{fontSize:"small"}),external:!0},{label:"Publisher Docs",href:"https://github.com/malloydata/publisher/blob/main/README.md",icon:t.jsx(Pt,{fontSize:"small"}),external:!0},{label:"Publisher API",href:"/api-doc.html",icon:t.jsx(wt,{fontSize:"small"}),external:!1}];return t.jsx(Z,{sx:{py:1},children:r.map(n=>t.jsx(Tt,{label:n.label,href:n.href,icon:n.icon,external:n.external,isCollapsed:e},n.label))})}function be({icon:e,label:r,to:n,selected:o,isCollapsed:s}){const a=J(),i=t.jsxs(pe,{selected:o,onClick:c=>a(n,c),sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(ue,{sx:{minWidth:s?0:36,justifyContent:"center",color:o?"text.primary":"text.secondary"},children:e}),!s&&t.jsx(he,{primary:r,primaryTypographyProps:{variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(de,{title:r,placement:"right",children:t.jsx(x,{children:i})}):i}function Tt({label:e,href:r,icon:n,external:o,isCollapsed:s}){const a=t.jsxs(pe,{component:"a",href:r,target:o?"_blank":void 0,rel:o?"noopener noreferrer":void 0,sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(ue,{sx:{minWidth:s?0:36,justifyContent:"center",color:"text.secondary"},children:n}),!s&&t.jsx(he,{primary:e,primaryTypographyProps:{variant:"body2",sx:{color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(de,{title:e,placement:"right",children:t.jsx(x,{children:a})}):a}function Bt({open:e,onClose:r,logoHeader:n}){return t.jsx(yt,{anchor:"left",open:e,onClose:r,ModalProps:{keepMounted:!0},sx:{display:{xs:"block",md:"none"},"& .MuiDrawer-paper":{boxSizing:"border-box",width:260}},children:t.jsx(ye,{isCollapsed:!1,onToggleCollapse:r,logoHeader:n})})}function Lt({headerProps:e}){const r=G(),n=bt(r.breakpoints.up("md")),[o,s]=u.useState(!1),[a,i]=u.useState(!1);return u.useEffect(()=>{n&&o&&s(!1)},[n,o]),t.jsxs(x,{sx:{height:"100dvh",display:"flex",flexDirection:"row",bgcolor:"background.default"},children:[n&&t.jsx(ye,{isCollapsed:a,onToggleCollapse:()=>i(c=>!c),logoHeader:e?.logoHeader}),t.jsxs(x,{component:"main",sx:{flex:1,display:"flex",flexDirection:"column",minWidth:0},children:[t.jsxs(x,{sx:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"space-between",height:Qe.headerHeight,px:{xs:1,md:3},backgroundColor:"background.default"},children:[t.jsx(x,{sx:{display:{xs:"flex",md:"none"},alignItems:"center",mr:1},children:t.jsx(X,{size:"small",onClick:()=>s(!0),"aria-label":"Open navigation",children:t.jsx(Y,{fontSize:"small"})})}),t.jsx(x,{sx:{flex:1,minWidth:0,display:"flex",alignItems:"center"},children:t.jsx(Ct,{})}),t.jsx(x,{id:"header-actions-portal",sx:{display:"flex",alignItems:"center",flexShrink:0,gap:1},children:e?.endCap})]}),t.jsx(x,{sx:{flex:1,overflow:"auto",minWidth:320,minHeight:0},children:t.jsx(u.Suspense,{fallback:t.jsx(Xe,{}),children:t.jsx(Fe,{})})})]}),t.jsx(Bt,{open:o,onClose:()=>s(!1),logoHeader:e?.logoHeader})]})}export{Lt as default};
@@ -1 +1 @@
1
- import{F as t,j as e,_ as m,G as r,$ as x,a0 as o}from"./index-U38AyjJL.js";function l(){const n=t(),a=n["*"];if(!n.environmentName)return e.jsx("div",{children:e.jsx("h2",{children:"Missing environment name"})});if(!n.packageName)return e.jsx("div",{children:e.jsx("h2",{children:"Missing package name"})});const i=m({environmentName:n.environmentName,packageName:n.packageName,modelPath:a}),s={p:3,maxWidth:1200,mx:"auto"};return a?.endsWith(".malloy")?e.jsx(r,{sx:s,children:e.jsx(x,{resourceUri:i,runOnDemand:!0,maxResultSize:512*1024})}):a?.endsWith(".malloynb")?e.jsx(r,{sx:s,children:e.jsx(o,{resourceUri:i,maxResultSize:1024*1024})}):e.jsx(r,{sx:s,children:e.jsxs("h2",{children:["Unrecognized file type: ",a]})})}export{l as default};
1
+ import{G as t,j as e,_ as m,H as r,$ as o,a0 as x}from"./index-DE6d5jEy.js";function l(){const n=t(),a=n["*"];if(!n.environmentName)return e.jsx("div",{children:e.jsx("h2",{children:"Missing environment name"})});if(!n.packageName)return e.jsx("div",{children:e.jsx("h2",{children:"Missing package name"})});const i=m({environmentName:n.environmentName,packageName:n.packageName,modelPath:a}),s={p:3,maxWidth:1200,mx:"auto"};return a?.endsWith(".malloy")?e.jsx(r,{sx:s,children:e.jsx(o,{resourceUri:i,runOnDemand:!0,maxResultSize:512*1024})}):a?.endsWith(".malloynb")?e.jsx(r,{sx:s,children:e.jsx(x,{resourceUri:i,maxResultSize:1024*1024})}):e.jsx(r,{sx:s,children:e.jsxs("h2",{children:["Unrecognized file type: ",a]})})}export{l as default};
@@ -1 +1 @@
1
- import{F as r,S as t,j as e,_ as c,a1 as o}from"./index-U38AyjJL.js";function m(){const{environmentName:a,packageName:n}=r(),s=t();if(a)if(n){const i=c({environmentName:a,packageName:n});return e.jsx(o,{onClickPackageFile:s,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 environment name"})})}export{m as default};
1
+ import{G as r,M as t,j as e,_ as c,a1 as o}from"./index-DE6d5jEy.js";function m(){const{environmentName:a,packageName:n}=r(),s=t();if(a)if(n){const i=c({environmentName:a,packageName:n});return e.jsx(o,{onClickPackageFile:s,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 environment name"})})}export{m as default};
@@ -1 +1 @@
1
- import{a3 as o,j as r,a4 as s,a5 as n,G as t,T as a}from"./index-U38AyjJL.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
+ import{a3 as o,j as r,a4 as s,a5 as n,H as t,T as a}from"./index-DE6d5jEy.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{F as o,j as e,_ as t,a6 as c}from"./index-U38AyjJL.js";function l(){const{workspace:r,workbookPath:s,environmentName:i,packageName:n}=o();if(r)if(s)if(i)if(n){const a=t({environmentName:i,packageName:n});return e.jsx(c,{workbookPath:{path:s,workspace:r},resourceUri:a},`${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 environment 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{l as default};
1
+ import{G as o,j as e,_ as t,a6 as c}from"./index-DE6d5jEy.js";function l(){const{workspace:r,workbookPath:s,environmentName:i,packageName:n}=o();if(r)if(s)if(i)if(n){const a=t({environmentName:i,packageName:n});return e.jsx(c,{workbookPath:{path:s,workspace:r},resourceUri:a},`${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 environment 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{l as default};