@malloy-publisher/app 0.16.1 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. package/dist/api-doc.yaml +202 -32
  2. package/dist/assets/{EnvironmentPage-Y9IWPC9J.js → EnvironmentPage-D2-0ts2G.js} +1 -1
  3. package/dist/assets/{HomePage-BOUo0MEl.js → HomePage-S_Bkczsx.js} +1 -1
  4. package/dist/assets/{MainPage-BkM5UDRU.js → MainPage-DEy4SyjJ.js} +1 -1
  5. package/dist/assets/{ModelPage-PgDTkS5C.js → ModelPage-BVHjDM-u.js} +2 -2
  6. package/dist/assets/{PackagePage-Dn7FrQ5r.js → PackagePage-Cbrg7o1X.js} +1 -1
  7. package/dist/assets/{PackageSplatRoute-BLC29ek-.js → PackageSplatRoute-ChFCJOWE.js} +2 -2
  8. package/dist/assets/{RenderedResult-vyM2wQbC.es-ha8dF24T.js → RenderedResult-BcEDcw0V.es-BD6PNbt6.js} +1 -1
  9. package/dist/assets/{RouteError-BolMqTuz.js → RouteError-CDSSYdLB.js} +1 -1
  10. package/dist/assets/{ThemeEditorPage-CPv1eHkI.js → ThemeEditorPage-DO2JWYOR.js} +1 -1
  11. package/dist/assets/{ToggleButtonGroup-DZtImN0S.js → ToggleButtonGroup-BylAiUaK.js} +1 -1
  12. package/dist/assets/{documentRoutes-DI5cX3ty.js → documentRoutes-CaOt2rpR.js} +1 -1
  13. package/dist/assets/{editPageMounted-C--4kcld.js → editPageMounted-79YCIKgP.js} +2 -2
  14. package/dist/assets/{index-DLToSg1f.js → index-BKjEX4_C.js} +10 -10
  15. package/dist/assets/{index-DyYEltlF.js → index-BOCBPBsi.js} +1 -1
  16. package/dist/assets/{index-D9wSfMZN.js → index-CPSEdm5f.js} +1 -1
  17. package/dist/assets/{index-CbsrzNSp.js → index-keJ8KKBp.js} +1 -1
  18. package/dist/assets/{index.es-D8SVyfmS.js → index.es-DTreXoC5.js} +1 -1
  19. package/dist/assets/usePackageLinkNavigate-BfSAqkJS.js +1 -0
  20. package/dist/assets/{usePackageRoute-A_YQMrax.js → usePackageRoute-G6fA1__J.js} +1 -1
  21. package/dist/index.html +1 -1
  22. package/dist/mcp-app/report.js +4 -4
  23. package/package.json +2 -2
  24. package/dist/assets/usePackageLinkNavigate-DxHGKrmZ.js +0 -1
package/dist/api-doc.yaml CHANGED
@@ -1684,7 +1684,7 @@ paths:
1684
1684
  DEPRECATED. In-place mutation of a package contradicts immutable versions, so this
1685
1685
  operation will be removed. On a package that has published versions it changes only
1686
1686
  what is not content: a `manifestLocation` URI is bound to the package's `latest` version
1687
- (as `PUT .../packages/{packageName}/versions/{version}/manifest` does for any version),
1687
+ (as `PUT .../packages/{packageName}/versions/{versionId}/manifest` does for any version),
1688
1688
  while a null or empty one leaves the binding as it is (clear it with that route), and
1689
1689
  `description` is the package's. `name` and the `location` the version was published from
1690
1690
  may be sent back unchanged. Any other change is refused with 409 (`reason`
@@ -1784,8 +1784,8 @@ paths:
1784
1784
  background, cleans up each version as deleting it alone does: its own auto-runs still
1785
1785
  running are stopped and its own `scope: version` tables reclaimed. To take one
1786
1786
  version out of service while keeping the rest, archive it with
1787
- `PATCH .../packages/{packageName}/versions/{version}`; to remove one version for good,
1788
- delete it with `DELETE .../packages/{packageName}/versions/{version}`.
1787
+ `PATCH .../packages/{packageName}/versions/{versionId}`; to remove one version for good,
1788
+ delete it with `DELETE .../packages/{packageName}/versions/{versionId}`.
1789
1789
  parameters:
1790
1790
  - name: environmentName
1791
1791
  in: path
@@ -1850,7 +1850,7 @@ paths:
1850
1850
  "503":
1851
1851
  $ref: "#/components/responses/ServiceUnavailable"
1852
1852
 
1853
- /environments/{environmentName}/packages/{packageName}/versions/{version}:
1853
+ /environments/{environmentName}/packages/{packageName}/versions/{versionId}:
1854
1854
  get:
1855
1855
  tags:
1856
1856
  - versions
@@ -1897,7 +1897,7 @@ paths:
1897
1897
  table is tried once: one that cannot be dropped is left, and its run record goes all
1898
1898
  the same. Its
1899
1899
  files stay on disk, so it can be unarchived. To remove them, delete the version with
1900
- `DELETE .../versions/{version}`.
1900
+ `DELETE .../versions/{versionId}`.
1901
1901
  - `unarchive` puts it back in service. It loads again on its next read, and serves live
1902
1902
  until it is built again.
1903
1903
 
@@ -2000,7 +2000,7 @@ paths:
2000
2000
  "503":
2001
2001
  $ref: "#/components/responses/ServiceUnavailable"
2002
2002
 
2003
- /environments/{environmentName}/packages/{packageName}/versions/{version}/manifest:
2003
+ /environments/{environmentName}/packages/{packageName}/versions/{versionId}/manifest:
2004
2004
  put:
2005
2005
  tags:
2006
2006
  - versions
@@ -2411,6 +2411,10 @@ paths:
2411
2411
  fails only at the grammar and names no source to run (for example `run` with no colon) is also
2412
2412
  a 400, because a grammar error says nothing about the model, unless the model carries any
2413
2413
  `#(authorize)` or `#(access_filter)`, or the text joins a source off the surface.
2414
+
2415
+ The version queried may be named in the body (`QueryRequest.versionId`), in the URL
2416
+ (`?versionId=`), or both. When both name a version and they differ, the request answers
2417
+ 400 with `reason` VERSION_ID_INVALID; an empty value in either names none.
2414
2418
  parameters:
2415
2419
  - name: environmentName
2416
2420
  in: path
@@ -2431,6 +2435,7 @@ paths:
2431
2435
  schema:
2432
2436
  $ref: "#/components/schemas/PathPattern"
2433
2437
  - $ref: "#/components/parameters/includeHiddenFilesAndSources"
2438
+ - $ref: "#/components/parameters/versionId"
2434
2439
  requestBody:
2435
2440
  required: true
2436
2441
  content:
@@ -3956,6 +3961,12 @@ paths:
3956
3961
  plan (read off `Package.buildPlan`). Returns the materialization already building.
3957
3962
  * Auto-run (standalone, default) — omit `buildInstructions`; the publisher
3958
3963
  self-assigns names and runs all phases in one pass.
3964
+
3965
+ The version to build is named in the body (`versionId`). A `?versionId=` in the URL,
3966
+ as every other materialization operation takes, is read too; when both name a version
3967
+ and they differ, the request answers 400 with `reason` VERSION_ID_INVALID, and an empty
3968
+ value in either names none. It is not declared as a parameter here: an optional query
3969
+ parameter would move the optional body argument of every generated client.
3959
3970
  parameters:
3960
3971
  - $ref: "#/components/parameters/environmentName"
3961
3972
  - $ref: "#/components/parameters/packageName"
@@ -4591,6 +4602,13 @@ components:
4591
4602
  succeed. That reason is what marks the customer's database being down
4592
4603
  rather than this server failing. The body carries a fixed message,
4593
4604
  because the driver's text can name an internal host; it is logged.
4605
+ With `reason: RESULT_TRUNCATED` the database answered, but with fewer
4606
+ rows than it reported and no row limit cut them (a BigQuery answer past
4607
+ one results page of about 10 MB); the query is refused rather than
4608
+ answered short, and a retry fails the same way. With
4609
+ `reason: RESULT_SHAPE_MISMATCH` the database answered, but a row does
4610
+ not fit the schema Malloy declared for the result, so the result could
4611
+ not be built; the message is fixed and the cause is logged.
4594
4612
  content:
4595
4613
  application/json:
4596
4614
  schema:
@@ -4773,7 +4791,7 @@ components:
4773
4791
  description: >-
4774
4792
  The build manifest this version is bound to (see
4775
4793
  `Package.manifestLocation`); null when it serves live. Set with
4776
- `PUT .../versions/{version}/manifest`.
4794
+ `PUT .../versions/{versionId}/manifest`.
4777
4795
  gitCommitSha:
4778
4796
  type: ["string", "null"]
4779
4797
  readOnly: true
@@ -6194,9 +6212,9 @@ components:
6194
6212
  the base, or `<base>.<measure>` for one measure). The
6195
6213
  message says why, and `reason` is the refusal record's
6196
6214
  bounded reason. `preaggregate-not-built` is
6197
- `rollup-not-built`'s former name: each `rollup-not-built`
6198
- warning is repeated under it, with the same message, for
6199
- this release only. `persist-source-refused`, the former name
6215
+ `rollup-not-built`'s former name, retained, no longer
6216
+ produced: 0.15.0 and 0.16 repeated each `rollup-not-built`
6217
+ warning under it. `persist-source-refused`, the former name
6200
6218
  of `persist-not-built` repeated beside it in 0.14.0, is no
6201
6219
  longer produced.
6202
6220
  Retained, no longer produced: the rollup sub-family
@@ -6228,9 +6246,9 @@ components:
6228
6246
  `rollup-join-one-key-repeated`: a rollup's last build found
6229
6247
  a `join_one` key repeated in the data, so queries that read
6230
6248
  that join beside other aggregates are answered live
6231
- (`subject` the rollup's base; `warn`). Repeated under its
6232
- former name `preaggregate-join-one-key-repeated` for this
6233
- release only.
6249
+ (`subject` the rollup's base; `warn`). Its former name,
6250
+ `preaggregate-join-one-key-repeated`, is retained, no longer
6251
+ produced.
6234
6252
  `served-copy-not-served`: the served copy (the author's own
6235
6253
  files, each stored source re-rooted on its table) leaves a
6236
6254
  source as written, so it answers live, or serves it with a
@@ -6355,8 +6373,9 @@ components:
6355
6373
  full rebuild captures the types (one per source, `model` the
6356
6374
  first model binding it, `subject` the source, the message
6357
6375
  naming the columns and which applies; `warn`; see
6358
- docs/materialization.md). Repeated under its former name
6359
- `stored-native-schema-missing` for this release only.
6376
+ docs/materialization.md). Its former name,
6377
+ `stored-native-schema-missing`, is retained, no longer
6378
+ produced.
6360
6379
  `entities-…` (`entities-not-a-dimension`,
6361
6380
  `entities-parameterized-source`,
6362
6381
  `entities-multiple-required-filters`,
@@ -7390,8 +7409,8 @@ components:
7390
7409
  in `tiles=[…]`, or else from a `# break` on the view or query it
7391
7410
  names; `break=false` on the entry turns off the view's. Named for the tag, so every per-tile field on this
7392
7411
  schema is spelled the way an author writes it. A generated client
7393
- escapes the attribute where the word is reserved (the Python client
7394
- exposes `break_`) while the wire key stays `break`.
7412
+ escapes the attribute where the word is reserved (a generated Python
7413
+ client exposes `break_`) while the wire key stays `break`.
7395
7414
  borderless:
7396
7415
  type: boolean
7397
7416
  description: >-
@@ -8625,10 +8644,9 @@ components:
8625
8644
  empty, the query runs against the package's `latest` version. An unknown version
8626
8645
  answers 404 (`reason` VERSION_NOT_FOUND) and an archived one 410
8627
8646
  (`reason` VERSION_ARCHIVED). A `versionId` in the request's query
8628
- string, as a proxy forwarding a page's URL sends, is read the same way;
8629
- when both name a version they must agree, or the request answers 400.
8630
- It is not declared as a query parameter, so generated clients keep
8631
- their argument order.
8647
+ string (the operation's `versionId` parameter) is read the same way;
8648
+ when both name a version they must agree, or the request answers 400
8649
+ with `reason` VERSION_ID_INVALID.
8632
8650
  filterParams:
8633
8651
  type: object
8634
8652
  deprecated: true
@@ -8917,9 +8935,11 @@ components:
8917
8935
  database `#(materialize)` table the served copy read, or a
8918
8936
  database rollup or persisted view.
8919
8937
 
8920
- `live_fallback` — the query DID route to storage and the store then
8921
- failed underneath it, and the source's freshness fallback allowed it
8922
- to degrade to the live warehouse. **The rows are correct and the
8938
+ `live_fallback` — the query DID route to a stored table (a
8939
+ `storage=` table, a database table the served copy reads, or a
8940
+ rollup on either tier) and that read then failed underneath it, and
8941
+ the source's freshness fallback allowed it to degrade to the live
8942
+ warehouse (a rollup's always does). **The rows are correct and the
8923
8943
  request succeeded**, which is why this needs its own value: it is
8924
8944
  indistinguishable from a storage hit at the call site, and treating it
8925
8945
  as one would report a healthy hit rate for a broken store. On
@@ -10368,6 +10388,19 @@ components:
10368
10388
  are fine; retrying elsewhere will not help, and neither will
10369
10389
  rewriting the query.
10370
10390
 
10391
+ RESULT_TRUNCATED, on a 502, means the database returned fewer rows
10392
+ than it reported and no row limit cut them: a BigQuery answer
10393
+ larger than one results page (about 10 MB) whose later pages were
10394
+ not read. The query is refused rather than answered short.
10395
+ Retrying returns the same page; select fewer columns, aggregate,
10396
+ or return fewer rows.
10397
+
10398
+ RESULT_SHAPE_MISMATCH, on a 502, means the database answered but a
10399
+ row does not fit the schema Malloy declared for the result (a value
10400
+ of another type than its column's), so the result could not be
10401
+ built. The query is not the caller's to fix; the server logs the
10402
+ cause.
10403
+
10371
10404
  CONNECTION_AUTH_FAILED, on a 424, means the database rejected the
10372
10405
  connection's credentials (a wrong password, an invalid key, an
10373
10406
  expired token), so the query never ran. Whoever configures the
@@ -10477,8 +10510,8 @@ components:
10477
10510
  * VERSION_ARCHIVED (410): the version is archived.
10478
10511
 
10479
10512
  Known values: TABLE_NOT_FOUND, CONNECTION_FAILED,
10480
- CONNECTION_AUTH_FAILED, CONNECTION_NOT_FOUND,
10481
- STORAGE_ACCESS_DENIED, PATH_ACCESS_DENIED, ACCESS_DENIED,
10513
+ CONNECTION_AUTH_FAILED, CONNECTION_NOT_FOUND, RESULT_TRUNCATED,
10514
+ RESULT_SHAPE_MISMATCH, STORAGE_ACCESS_DENIED, PATH_ACCESS_DENIED, ACCESS_DENIED,
10482
10515
  MATERIALIZATION_REFUSED, TABLE_OWNED_ELSEWHERE,
10483
10516
  TABLE_OWNERSHIP_UNVERIFIED, TABLE_IN_USE, BUILD_INSTRUCTIONS_INVALID,
10484
10517
  MATERIALIZATION_CONFLICT, MANIFEST_VERSION_MISSING, MANIFEST_VERSION_INVALID,
@@ -10823,9 +10856,12 @@ components:
10823
10856
  The published version of the package to build. `latest`, omitted or
10824
10857
  empty, the package's `latest` version is built. An unknown version answers 404
10825
10858
  (`reason` VERSION_NOT_FOUND) and an archived one 410 (`reason`
10826
- VERSION_ARCHIVED). Carried in the body rather than the query string
10827
- because the body is optional: a new optional query parameter ahead
10828
- of it would move the body argument of every generated client.
10859
+ VERSION_ARCHIVED). Carried in the body rather than a declared query
10860
+ parameter because the body is optional: a new optional query
10861
+ parameter ahead of it would move the body argument of every
10862
+ generated client. A `?versionId=` in the URL is read too, and must
10863
+ agree with this one when both name a version (400
10864
+ VERSION_ID_INVALID otherwise).
10829
10865
 
10830
10866
  The run records the version it built in `metadata.versionId`, with
10831
10867
  the package's materialization scope in `metadata.scope`, which
@@ -11331,6 +11367,7 @@ components:
11331
11367
  partial_name_collision,
11332
11368
  given_where_over_unstored_field,
11333
11369
  unreadable_grain,
11370
+ upstream_unread,
11334
11371
  ]
11335
11372
  description: >-
11336
11373
  The bounded refusal reason; `message` says the specifics.
@@ -11370,7 +11407,12 @@ components:
11370
11407
  give no container; refused at plan, before any warehouse work);
11371
11408
  `storage_source_unsupported` (`storage=` on a
11372
11409
  source whose connection the build cannot pass through to a
11373
- destination, e.g. the package's DuckDB sandbox);
11410
+ destination, e.g. the package's DuckDB sandbox; or a source that
11411
+ carries author SQL, an `.sql()` source, a `sql_*` expression or a
11412
+ file or URL read as a table, whose table would be built inside a
11413
+ catalog, which runs only SQL Malloy generated: a `storage=` source
11414
+ on a DuckLake connection, or a source of any tier on a connection
11415
+ configured `managed`);
11374
11416
  `table_name_collision` (under `PERSIST_COLLISION_ENFORCE=false`, a
11375
11417
  declaration whose `name=` puts it on one table with another, so
11376
11418
  neither is built; by default such a package does not load; a run
@@ -11382,7 +11424,13 @@ components:
11382
11424
  source's own extend block is applied at every read and is
11383
11425
  admitted); `incremental_unsupported` (a valid incremental
11384
11426
  declaration this deployment's dialect or destination cannot
11385
- honour).
11427
+ honour); `upstream_unread` (a table its build reads could not be
11428
+ read from its warehouse's catalog when the package loaded, after
11429
+ retrying, and this process has no earlier reading of it, so its
11430
+ content address is not known: it is not built, no run builds it,
11431
+ and a host's instruction for it is refused, until a reload or a
11432
+ plan refresh reads the catalog and plans it at its address; the
11433
+ `*-not-built` warning names the table).
11386
11434
 
11387
11435
 
11388
11436
  A persisted view or named query: `materialization_off` (persisted
@@ -11461,6 +11509,15 @@ components:
11461
11509
  declaration's `*-not-built` warning. For a `#@ persist` gate
11462
11510
  refusal it is the same text a build attempting the source would
11463
11511
  422 with.
11512
+ freshness:
11513
+ $ref: "#/components/schemas/Freshness"
11514
+ description: >-
11515
+ The freshness the refused source declares, resolved as a planned
11516
+ source's is (source, then model file, then package). A package
11517
+ `materialization.schedule` beside it is refused at publish as
11518
+ beside a planned source's: a refused source declares its window
11519
+ all the same. Absent when it declares none, or when the refusal
11520
+ comes from an annotation finding rather than the plan.
11464
11521
 
11465
11522
  BuildGraph:
11466
11523
  type: object
@@ -11737,6 +11794,41 @@ components:
11737
11794
  description: Output schema of the source.
11738
11795
  items:
11739
11796
  $ref: "#/components/schemas/Column"
11797
+ reads:
11798
+ type: array
11799
+ items:
11800
+ $ref: "#/components/schemas/TableRead"
11801
+ description: >-
11802
+ The warehouse tables this entry's build reads, distinct and sorted
11803
+ by connection then table: each `connection.table('...')` in the
11804
+ source's lineage, read off the same fully inlined definition `sql`
11805
+ and `sourceEntityId` are computed from. A table a persisted
11806
+ upstream reads is therefore listed here too, since this source's
11807
+ rows derive from it. A join is listed only when the build reads it
11808
+ (a field, filter or nest of the build reaches it); a join the
11809
+ source declares and the build never uses is not.
11810
+
11811
+
11812
+ Absent when the tables cannot be known: the lineage holds an
11813
+ `.sql()` source (its SQL text names tables Malloy does not parse)
11814
+ or a raw SQL expression such as `sql_number()` (which may hold a
11815
+ subquery). A host that rebuilds only the entries reading a replaced
11816
+ table MUST treat an absent `reads` as possibly reading any table on
11817
+ its connection, and an empty one as reading none. Not part of
11818
+ `sourceEntityId`.
11819
+ upstreamSchemas:
11820
+ type: array
11821
+ items:
11822
+ $ref: "#/components/schemas/UpstreamTableSchema"
11823
+ description: >-
11824
+ Each table in `reads` with its columns' types as its warehouse's
11825
+ catalog named them when this package was loaded (or why it could
11826
+ not be read). Part of `sourceEntityId`: a table whose columns or
11827
+ types change re-addresses every source that reads it, so its table
11828
+ is rebuilt rather than carried or reused. Read at the package's
11829
+ first load in a process and again on every explicit reload or
11830
+ publish. Absent when `reads` is absent: such a source's address is
11831
+ its SQL's alone.
11740
11832
  annotationFields:
11741
11833
  type: object
11742
11834
  additionalProperties:
@@ -11808,6 +11900,68 @@ components:
11808
11900
  `#@ preaggregate` annotations it was synthesized from, which is where
11809
11901
  an author would go to change it.
11810
11902
 
11903
+ UpstreamTableSchema:
11904
+ type: object
11905
+ required: [connectionName, table]
11906
+ description: >-
11907
+ One warehouse table a persist source's build reads, with its columns'
11908
+ types as the warehouse's own catalog names them (`NUMERIC(12,4)`,
11909
+ `FLOAT64`, `DOUBLE`), read when the package was loaded. Exactly one of
11910
+ `columns` and `unread` is present.
11911
+ properties:
11912
+ connectionName:
11913
+ type: string
11914
+ description: The Malloy connection the table is read through, as in `TableRead`.
11915
+ table:
11916
+ type: string
11917
+ description: The table path exactly as the model wrote it, as in `TableRead`.
11918
+ dialect:
11919
+ type: string
11920
+ description: >-
11921
+ The dialect of the connection the types are named in (`snowflake`,
11922
+ `postgres`, `standardsql`, `duckdb`, ...): one type name means
11923
+ different types on different dialects (Snowflake's `FLOAT` is a
11924
+ double, DuckDB's a 4-byte float). Present with `columns`.
11925
+ columns:
11926
+ type: array
11927
+ description: Each column, in catalog order, with its native type.
11928
+ items:
11929
+ type: object
11930
+ required: [name, nativeType]
11931
+ properties:
11932
+ name:
11933
+ type: string
11934
+ nativeType:
11935
+ type: string
11936
+ unread:
11937
+ type: string
11938
+ enum: [no_catalog, not_found, ambiguous, read_failed]
11939
+ description: >-
11940
+ Why the table has no columns here. `no_catalog`: its dialect gives
11941
+ this table no catalog to read (an unqualified BigQuery name, a path
11942
+ the catalog cannot parse). `not_found`: the catalog holds no such
11943
+ table (a BigQuery wildcard table, a table not created yet).
11944
+ `ambiguous`: an unqualified name the catalog holds in more than one
11945
+ schema. These three are stable and fold into the address.
11946
+ `read_failed`: the catalog read failed and no earlier reading of
11947
+ the table was known in this process; the plan refuses each source
11948
+ that reads it (`upstream_unread`), so no address folds it.
11949
+ TableRead:
11950
+ type: object
11951
+ required: [connectionName, table]
11952
+ description: One warehouse table a persist source's build reads.
11953
+ properties:
11954
+ connectionName:
11955
+ type: string
11956
+ description: >-
11957
+ The Malloy connection the table is read through, as the model names
11958
+ it (the `lake` of `lake.table('orders')`).
11959
+ table:
11960
+ type: string
11961
+ description: >-
11962
+ The table path exactly as the model wrote it inside `.table('...')`
11963
+ (e.g. `analytics.orders`), unquoted and unqualified by anything the
11964
+ connection adds; on DuckDB it may be a file path or URL.
11811
11965
  PreaggregatePlan:
11812
11966
  type: object
11813
11967
  description: >-
@@ -12476,6 +12630,18 @@ components:
12476
12630
  producer did not record it.
12477
12631
  items:
12478
12632
  $ref: "#/components/schemas/Column"
12633
+ upstreamSchemas:
12634
+ type: array
12635
+ description: >-
12636
+ The warehouse tables this table's build read, each with its columns'
12637
+ native types as the build's plan read them from the catalog (the
12638
+ plan's `PersistSourcePlan.upstreamSchemas`), on both tiers. The
12639
+ `sourceEntityId` folds them in, so an entry whose upstream was
12640
+ retyped since is never the current address's. A host that stores
12641
+ entries keeps this field as written. Absent on an entry built
12642
+ before 0.17.0, and for a source whose tables cannot be known.
12643
+ items:
12644
+ $ref: "#/components/schemas/UpstreamTableSchema"
12479
12645
  realization:
12480
12646
  allOf:
12481
12647
  - $ref: "#/components/schemas/Realization"
@@ -12782,10 +12948,14 @@ components:
12782
12948
 
12783
12949
  Build metadata must be percent-encoded: send `1.2.0+build.5` as
12784
12950
  `1.2.0%2Bbuild.5`, since a bare `+` in a query string decodes to a space.
12951
+
12952
+ Accepted: `latest`, empty, or a semantic version. The schema carries no
12953
+ pattern on purpose: a validator generated from one would refuse `latest`
12954
+ and the empty value.
12785
12955
  schema:
12786
12956
  type: string
12787
12957
  versionPath:
12788
- name: version
12958
+ name: versionId
12789
12959
  in: path
12790
12960
  required: true
12791
12961
  description: |
@@ -1 +1 @@
1
- import{y as r,C as t,j as e,a7 as i,aa as o}from"./index-DLToSg1f.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{y as r,C as t,j as e,a7 as i,aa as o}from"./index-BKjEX4_C.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 +1 @@
1
- import{y as t,j as o,I as a}from"./index-DLToSg1f.js";function s(){const n=t();return o.jsx(a,{onClickEnvironment:n})}export{s as default};
1
+ import{y as t,j as o,I as a}from"./index-BKjEX4_C.js";function s(){const n=t();return o.jsx(a,{onClickEnvironment:n})}export{s as default};
@@ -1 +1 @@
1
- import{c as j,j as t,s as I,B as Ee,m as Q,e as ce,g as me,a as fe,r as x,u as ge,b as Me,d as W,f as ye,T as K,h as G,i as ze,k as Ce,l as Ie,o as be,n as De,p as Te,q as de,t as Be,v as Re,w as A,x as $,M as He,P as Le,z as $e,S as Ne,A as J,C as Z,D as Ae,E as Oe,F as We,G as pe,H as Ve,y as ee,J as u,K as Fe,L as Y,N as V,O as te,Q as Ue,R as _e,U as ue,V as Xe,W as re,X as ne,Y as oe,Z as Ye,_ as qe,$ as Qe,a0 as Ke}from"./index-DLToSg1f.js";import{u as Ge,l as he}from"./editPageMounted-C--4kcld.js";import{i as Je,w as Ze,a as et}from"./documentRoutes-DI5cX3ty.js";import{u as ve,p as tt}from"./usePackageRoute-A_YQMrax.js";const rt=j(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"})),nt=I(Ee,{name:"MuiBreadcrumbCollapsed"})(Q(({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:ce(e.palette.grey[200],.12)}:{backgroundColor:ce(e.palette.grey[600],.12)}}}))),ot=I(rt)({width:24,height:16});function st(e){const{slots:r={},slotProps:o={},...n}=e,s=e;return t.jsx("li",{children:t.jsx(nt,{focusRipple:!0,...n,ownerState:s,children:t.jsx(ot,{as:r.CollapsedIcon,ownerState:s,...o.collapsedIcon})})})}function at(e){return me("MuiBreadcrumbs",e)}const it=fe("MuiBreadcrumbs",["root","ol","li","separator"]),lt=e=>{const{classes:r}=e;return ye({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},at,r)},ct=I(K,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,r)=>[{[`& .${it.li}`]:r.li},r.root]})({}),dt=I("ol",{name:"MuiBreadcrumbs",slot:"Ol"})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),pt=I("li",{name:"MuiBreadcrumbs",slot:"Separator"})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function ut(e,r,o,n){return e.reduce((s,a,i)=>(i<e.length-1?s=s.concat(a,t.jsx(pt,{"aria-hidden":!0,className:r,ownerState:n,children:o},`separator-${i}`)):s.push(a),s),[])}const ht=x.forwardRef(function(r,o){const n=ge({props:r,name:"MuiBreadcrumbs"}),{children:s,className:a,component:i="nav",slots:d={},slotProps:m={},expandText:p="Show path",itemsAfterCollapse:h=1,itemsBeforeCollapse:b=1,maxItems:g=8,separator:w="/",...D}=n,[k,S]=x.useState(!1),v={...n,component:i,expanded:k,expandText:p,itemsAfterCollapse:h,itemsBeforeCollapse:b,maxItems:g,separator:w},z=lt(v),T=Me({elementType:d.CollapsedIcon,externalSlotProps:m.collapsedIcon,ownerState:v}),P=x.useRef(null),E=c=>{const M=()=>{S(!0);const y=P.current.querySelector("a[href],button,[tabindex]");y&&y.focus()};return b+h>=c.length?c:[...c.slice(0,b),t.jsx(st,{"aria-label":p,slots:{CollapsedIcon:d.CollapsedIcon},slotProps:{collapsedIcon:T},onClick:M},"ellipsis"),...c.slice(c.length-h,c.length)]},B=x.Children.toArray(s).filter(c=>x.isValidElement(c)).map((c,M)=>t.jsx("li",{className:z.li,children:c},`child-${M}`));return t.jsx(ct,{ref:o,component:i,color:"textSecondary",className:W(z.root,a),ownerState:v,...D,children:t.jsx(dt,{className:z.ol,ref:P,ownerState:v,children:ut(k||g&&B.length<=g?B:E(B),z.separator,w,v)})})});function xt(e,r,o){const n=r.getBoundingClientRect(),s=o&&o.getBoundingClientRect(),a=be(r);let i;if(r.fakeTransform)i=r.fakeTransform;else{const p=a.getComputedStyle(r);i=p.getPropertyValue("-webkit-transform")||p.getPropertyValue("transform")}let d=0,m=0;if(i&&i!=="none"&&typeof i=="string"){const p=i.split("(")[1].split(")")[0].split(",");d=parseInt(p[4],10),m=parseInt(p[5],10)}return e==="left"?s?`translateX(${s.right+d-n.left}px)`:`translateX(${a.innerWidth+d-n.left}px)`:e==="right"?s?`translateX(-${n.right-s.left-d}px)`:`translateX(-${n.left+n.width-d}px)`:e==="up"?s?`translateY(${s.bottom+m-n.top}px)`:`translateY(${a.innerHeight+m-n.top}px)`:s?`translateY(-${n.top-s.top+n.height-m}px)`:`translateY(-${n.top+n.height-m}px)`}function mt(e){return typeof e=="function"?e():e}function O(e,r,o){const n=mt(o),s=xt(e,r,n);s&&(r.style.webkitTransform=s,r.style.transform=s)}const ft=x.forwardRef(function(r,o){const n=G(),s={enter:n.transitions.easing.easeOut,exit:n.transitions.easing.sharp},a={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:i,appear:d=!0,children:m,container:p,direction:h="down",easing:b=s,in:g,onEnter:w,onEntered:D,onEntering:k,onExit:S,onExited:v,onExiting:z,style:T,timeout:P=a,TransitionComponent:E=ze,...B}=r,c=x.useRef(null),M=Ce(Ie(m),c,o),y=l=>f=>{l&&(f===void 0?l(c.current):l(c.current,f))},F=y((l,f)=>{O(h,l,p),Te(l),w&&w(l,f)}),ae=y((l,f)=>{const L=de({timeout:P,style:T,easing:b},{mode:"enter"});l.style.webkitTransition=n.transitions.create("-webkit-transform",{...L}),l.style.transition=n.transitions.create("transform",{...L}),l.style.webkitTransform="none",l.style.transform="none",k&&k(l,f)}),R=y(D),H=y(z),C=y(l=>{const f=de({timeout:P,style:T,easing:b},{mode:"exit"});l.style.webkitTransition=n.transitions.create("-webkit-transform",f),l.style.transition=n.transitions.create("transform",f),O(h,l,p),S&&S(l)}),U=y(l=>{l.style.webkitTransition="",l.style.transition="",v&&v(l)}),_=l=>{i&&i(c.current,l)},N=x.useCallback(()=>{c.current&&O(h,c.current,p)},[h,p]);return x.useEffect(()=>{if(g||h==="down"||h==="right")return;const l=De(()=>{c.current&&O(h,c.current,p)}),f=be(c.current);return f.addEventListener("resize",l),()=>{l.clear(),f.removeEventListener("resize",l)}},[h,g,p]),x.useEffect(()=>{g||N()},[g,N]),t.jsx(E,{nodeRef:c,onEnter:F,onEntered:R,onEntering:ae,onExit:C,onExited:U,onExiting:H,addEndListener:_,appear:d,in:g,timeout:P,...B,children:(l,{ownerState:f,...L})=>x.cloneElement(m,{ref:M,style:{visibility:l==="exited"&&!g?"hidden":void 0,...T,...m.props.style},...L})})});function gt(e){return me("MuiDrawer",e)}fe("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const je=(e,r)=>{const{ownerState:o}=e;return[r.root,(o.variant==="permanent"||o.variant==="persistent")&&r.docked,r.modal]},yt=e=>{const{classes:r,anchor:o,variant:n}=e,s={root:["root",`anchor${$(o)}`],docked:[(n==="permanent"||n==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${$(o)}`,n!=="temporary"&&`paperAnchorDocked${$(o)}`]};return ye(s,gt,r)},bt=I(He,{name:"MuiDrawer",slot:"Root",overridesResolver:je})(Q(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),vt=I("div",{shouldForwardProp:$e,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:je})({flex:"0 0 auto"}),jt=I(Le,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,r)=>{const{ownerState:o}=e;return[r.paper,r[`paperAnchor${$(o.anchor)}`],o.variant!=="temporary"&&r[`paperAnchorDocked${$(o.anchor)}`]]}})(Q(({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}`}}]}))),ke={left:"right",right:"left",top:"down",bottom:"up"};function kt(e){return["left","right"].includes(e)}function wt({direction:e},r){return e==="rtl"&&kt(r)?ke[r]:r}const St=x.forwardRef(function(r,o){const n=ge({props:r,name:"MuiDrawer"}),s=G(),a=Be(),i={enter:s.transitions.duration.enteringScreen,exit:s.transitions.duration.leavingScreen},{anchor:d="left",BackdropProps:m,children:p,className:h,elevation:b=16,hideBackdrop:g=!1,ModalProps:{BackdropProps:w,...D}={},onClose:k,open:S=!1,PaperProps:v={},SlideProps:z,TransitionComponent:T,transitionDuration:P=i,variant:E="temporary",slots:B={},slotProps:c={},...M}=n,y=x.useRef(!1);x.useEffect(()=>{y.current=!0},[]);const F=wt({direction:a?"rtl":"ltr"},d),R={...n,anchor:d,elevation:b,open:S,variant:E,...M},H=yt(R),C={slots:{transition:T,...B},slotProps:{paper:v,transition:z,...c,backdrop:Re(c.backdrop||{...m,...w},{transitionDuration:P})}},[U,_]=A("root",{ref:o,elementType:bt,className:W(H.root,H.modal,h),shouldForwardComponentProp:!0,ownerState:R,externalForwardedProps:{...C,...M,...D},additionalProps:{open:S,onClose:k,hideBackdrop:g,slots:{backdrop:C.slots.backdrop},slotProps:{backdrop:C.slotProps.backdrop}}}),[N,l]=A("paper",{elementType:jt,shouldForwardComponentProp:!0,className:W(H.paper,v.className),ownerState:R,externalForwardedProps:C,additionalProps:{elevation:E==="temporary"?b:0,square:!0,...E==="temporary"&&{role:"dialog","aria-modal":"true"}}}),[f,L]=A("docked",{elementType:vt,ref:o,className:W(H.root,H.docked,h),ownerState:R,externalForwardedProps:C,additionalProps:M}),[Se,Pe]=A("transition",{elementType:ft,ownerState:R,externalForwardedProps:C,additionalProps:{in:S,direction:ke[F],timeout:P,appear:y.current}}),ie=t.jsx(N,{...l,children:p});if(E==="permanent")return t.jsx(f,{...L,children:ie});const le=t.jsx(Se,{...Pe,children:ie});return E==="persistent"?t.jsx(f,{...L,children:le}):t.jsx(U,{..._,children:le})}),Pt=j([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")]),Et=j(t.jsx("path",{d:"M10.85 12.65h2.3L12 9zM20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12zM14.3 16l-.7-2h-3.2l-.7 2H7.8L11 7h2l3.2 9z"})),Mt=j(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"})),zt=j(t.jsx("path",{d:"M9.37 5.51c-.18.64-.27 1.31-.27 1.99 0 4.08 3.32 7.4 7.4 7.4.68 0 1.35-.09 1.99-.27C17.45 17.19 14.93 19 12 19c-3.86 0-7-3.14-7-7 0-2.93 1.81-5.45 4.37-6.49M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1"})),Ct=j(t.jsx("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92zM17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29m-3.6 3.19L3 17.25V21h3.75L17.81 9.94z"})),It=j(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"})),Dt=j(t.jsx("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81zM12 3 2 12h3v8h6v-6h2v6h6v-8h3z"})),Tt=j(t.jsx("path",{d:"M12 9c1.65 0 3 1.35 3 3s-1.35 3-3 3-3-1.35-3-3 1.35-3 3-3m0-2c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z"})),Bt=j(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"})),Rt=j([t.jsx("path",{d:"M12 22C6.49 22 2 17.51 2 12S6.49 2 12 2s10 4.04 10 9c0 3.31-2.69 6-6 6h-1.77c-.28 0-.5.22-.5.5 0 .12.05.23.13.33.41.47.64 1.06.64 1.67 0 1.38-1.12 2.5-2.5 2.5m0-18c-4.41 0-8 3.59-8 8s3.59 8 8 8c.28 0 .5-.22.5-.5 0-.16-.08-.28-.14-.35-.41-.46-.63-1.05-.63-1.65 0-1.38 1.12-2.5 2.5-2.5H16c2.21 0 4-1.79 4-4 0-3.86-3.59-7-8-7"},"0"),t.jsx("circle",{cx:"6.5",cy:"11.5",r:"1.5"},"1"),t.jsx("circle",{cx:"9.5",cy:"7.5",r:"1.5"},"2"),t.jsx("circle",{cx:"14.5",cy:"7.5",r:"1.5"},"3"),t.jsx("circle",{cx:"17.5",cy:"11.5",r:"1.5"},"4")]);function q(e){return t.jsxs(Ne,{...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"})]})}const Ht=/\.malloy(nb)?$/;function Lt(){const{pathname:e,search:r}=J(),o=Z(),n=Ae(),s=Oe(),a=Ge(),i=o.environmentName??"",d=o.packageName??"",m=ve({always:!0}),p=m.path??"",h=i!==""&&d!==""&&p!==""&&m.writable&&!Ht.test(p),{reports:b,settled:g}=We(i,d,void 0,h);if(!h||s)return null;const w=p.replace(/\/$/,""),D=Je(r),k=e.replace(/\/$/,"");return D?a?null:t.jsx(pe,{label:"View",onClick:()=>n(`${k}${Ze(r)}`)}):(g?Ve(`${w}.malloy`,b):void 0)?.editable?t.jsx("span",{onPointerEnter:()=>void he(),onFocus:()=>void he(),children:t.jsx(pe,{label:"Edit",icon:t.jsx(Ct,{}),onClick:()=>n(`${k}${et(r)}`)})}):null}function X({label:e,onClick:r,current:o=!1}){return t.jsx(Fe,{clickable:!0,onClick:r,label:e,size:"small","aria-label":`Navigate to ${e}`,"aria-current":o?"page":void 0,sx:n=>({backgroundColor:"transparent",border:"none",color:o?"text.primary":"text.secondary",fontWeight:o?500:400,fontSize:13,height:28,cursor:"pointer",borderRadius:"6px",maxWidth:320,"& .MuiChip-label":{px:.75,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},"&:hover":{backgroundColor:n.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100"}})})}function $t(){const e=Z(),r=ve(),o=e.environmentName&&e.packageName?tt(e.environmentName,e.packageName,r.versionSegment):"",n=r.path?r.path.replace(/\/$/,""):void 0,s=ee();return!e.environmentName&&!e.packageName&&!n?null:t.jsx(u,{sx:{display:"flex",alignItems:"center",minWidth:0},children:t.jsxs(ht,{"aria-label":"breadcrumb",separator:t.jsx(u,{component:"span","aria-hidden":!0,sx:{color:"text.disabled"},children:"/"}),children:[e.environmentName&&t.jsx(X,{label:e.environmentName,current:!e.packageName&&!n,onClick:a=>s(`/${e.environmentName}/`,a)}),e.packageName&&t.jsx(X,{label:e.packageName,current:!n,onClick:a=>s(`${o}/`,a)}),n&&t.jsx(X,{label:n,current:!0,onClick:a=>s(`${o}/${n}`,a)})]})})}const Nt=260,At=64;function we({isCollapsed:e,onToggleCollapse:r,logoHeader:o}){return t.jsxs(u,{sx:{height:"100dvh",width:e?At:Nt,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(Ot,{isCollapsed:e,onToggleCollapse:r,logoHeader:o}),t.jsxs(u,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",py:1},children:[t.jsx(Wt,{isCollapsed:e}),t.jsx(Vt,{isCollapsed:e})]}),t.jsx(Ft,{isCollapsed:e})]})}function Ot({isCollapsed:e,onToggleCollapse:r,logoHeader:o}){const n=ee();return o?t.jsxs(u,{sx:{height:56,display:"flex",alignItems:"center",justifyContent:"space-between",px:e?0:2,flexShrink:0},children:[o,t.jsx(Y,{size:"small",onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",children:t.jsx(q,{fontSize:"small"})})]}):t.jsxs(u,{sx:{minHeight:56,display:"flex",flexDirection:e?"column":"row",alignItems:"center",justifyContent:e?"center":"space-between",gap:e?.5:0,py:e?1:0,px:e?0:2,flexShrink:0},children:[t.jsxs(u,{onClick:s=>n("/",s),sx:{display:"flex",alignItems:"center",gap:1,cursor:"pointer",minWidth:0},children:[t.jsx(u,{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"})]}),t.jsx(V,{title:e?"Expand sidebar":"Collapse sidebar",placement:"right",children:t.jsx(Y,{size:"small",onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",children:t.jsx(q,{fontSize:"small"})})})]})}function Wt({isCollapsed:e}){const o=J().pathname==="/";return t.jsx(te,{sx:{py:0},children:t.jsx(se,{icon:t.jsx(Dt,{fontSize:"small"}),label:"Home",to:"/",selected:o,isCollapsed:e})})}function Vt({isCollapsed:e}){const{apiClients:r}=Ue(),o=Z(),{data:n}=_e({queryKey:["environments"],queryFn:()=>r.environments.listEnvironments()}),s=n?.data??[];return s.length===0?null:t.jsxs(u,{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(te,{sx:{py:0},children:s.map(a=>{const i=a.name??"";return t.jsx(se,{icon:t.jsx(It,{fontSize:"small"}),label:i,to:`/${i}`,selected:o.environmentName===i,isCollapsed:e},i)})})]})}function Ft({isCollapsed:e}){const{pathname:r}=J(),o=[{label:"Malloy Docs",href:ue.docsHome,icon:t.jsx(Pt,{fontSize:"small"}),external:!0},{label:"Publisher Docs",href:ue.publishing,icon:t.jsx(Bt,{fontSize:"small"}),external:!0},{label:"Publisher API",href:"/api-doc.html",icon:t.jsx(Mt,{fontSize:"small"}),external:!1}];return t.jsxs(te,{sx:{py:1},children:[t.jsx(se,{icon:t.jsx(Rt,{fontSize:"small"}),label:"Theme",to:"/settings/theme",selected:r.startsWith("/settings/theme"),isCollapsed:e}),t.jsx(Yt,{isCollapsed:e}),o.map(n=>t.jsx(Ut,{label:n.label,href:n.href,icon:n.icon,external:n.external,isCollapsed:e},n.label))]})}function se({icon:e,label:r,to:o,selected:n,isCollapsed:s}){const a=ee(),i=t.jsxs(re,{selected:n,onClick:d=>a(o,d),sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(ne,{sx:{minWidth:s?0:36,justifyContent:"center",color:n?"text.primary":"text.secondary"},children:e}),!s&&t.jsx(oe,{primary:r,primaryTypographyProps:{variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(V,{title:r,placement:"right",children:t.jsx(u,{children:i})}):i}function Ut({label:e,href:r,icon:o,external:n,isCollapsed:s}){const a=t.jsxs(re,{component:"a",href:r,target:n?"_blank":void 0,rel:n?"noopener noreferrer":void 0,sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(ne,{sx:{minWidth:s?0:36,justifyContent:"center",color:"text.secondary"},children:o}),!s&&t.jsx(oe,{primary:e,primaryTypographyProps:{variant:"body2",sx:{color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(V,{title:e,placement:"right",children:t.jsx(u,{children:a})}):a}const _t={light:"dark",dark:"auto",auto:"light"},Xt={light:"Light mode",dark:"Dark mode",auto:"Auto mode"},xe={light:"Light mode (click for dark)",dark:"Dark mode (click for auto)",auto:"Auto mode (follows OS, click for light)"};function Yt({isCollapsed:e}){const{mode:r,userChoice:o,setMode:n,allowUserToggle:s}=Xe();if(!s)return null;const a=o??r,i=a==="auto"?Et:a==="dark"?zt:Tt,d=t.jsxs(re,{"aria-label":xe[a],onClick:()=>n(_t[a]),sx:{justifyContent:e?"center":"flex-start",px:e?0:2},children:[t.jsx(ne,{sx:{minWidth:e?0:36,justifyContent:"center",color:"text.secondary"},children:t.jsx(i,{fontSize:"small"})}),!e&&t.jsx(oe,{primary:Xt[a],primaryTypographyProps:{variant:"body2",sx:{color:"text.secondary",whiteSpace:"nowrap"}}})]});return t.jsx(V,{title:xe[a],placement:"right",disableHoverListener:!e,children:t.jsx(u,{children:d})})}function qt({open:e,onClose:r,logoHeader:o}){return t.jsx(St,{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(we,{isCollapsed:!1,onToggleCollapse:r,logoHeader:o})})}function Zt({headerProps:e}){const r=G(),o=Ye(r.breakpoints.up("md")),[n,s]=x.useState(!1),[a,i]=x.useState(!1);return x.useEffect(()=>{o&&n&&s(!1)},[o,n]),t.jsxs(u,{sx:{height:"100dvh",display:"flex",flexDirection:"row",bgcolor:"background.default"},children:[o&&t.jsx(we,{isCollapsed:a,onToggleCollapse:()=>i(d=>!d),logoHeader:e?.logoHeader}),t.jsxs(u,{component:"main",sx:{flex:1,display:"flex",flexDirection:"column",minWidth:0},children:[t.jsxs(u,{sx:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"space-between",height:qe.headerHeight,px:{xs:1,md:3},backgroundColor:"background.default"},children:[t.jsx(u,{sx:{display:{xs:"flex",md:"none"},alignItems:"center",mr:1},children:t.jsx(Y,{size:"small",onClick:()=>s(!0),"aria-label":"Open navigation",children:t.jsx(q,{fontSize:"small"})})}),t.jsx(u,{sx:{flex:1,minWidth:0,display:"flex",alignItems:"center"},children:t.jsx($t,{})}),t.jsxs(u,{id:"header-actions-portal",sx:{display:"flex",alignItems:"center",flexShrink:0,gap:1},children:[t.jsx(Lt,{}),e?.endCap]})]}),t.jsx(u,{sx:{flex:1,overflow:"auto",minWidth:320,minHeight:0},children:t.jsx(x.Suspense,{fallback:t.jsx(Ke,{}),children:t.jsx(Qe,{})})})]}),t.jsx(qt,{open:n,onClose:()=>s(!1),logoHeader:e?.logoHeader})]})}export{Zt as default};
1
+ import{c as j,j as t,s as I,B as Ee,m as Q,e as ce,g as me,a as fe,r as x,u as ge,b as Me,d as W,f as ye,T as G,h as K,i as ze,k as Ce,l as Ie,o as be,n as De,p as Te,q as de,t as Be,v as Re,w as A,x as $,M as He,P as Le,z as $e,S as Ne,A as J,C as Z,D as Ae,E as Oe,F as We,G as pe,H as Ve,y as ee,J as u,K as Fe,L as Y,N as V,O as te,Q as Ue,R as _e,U as ue,V as Xe,W as re,X as ne,Y as oe,Z as Ye,_ as qe,$ as Qe,a0 as Ge}from"./index-BKjEX4_C.js";import{u as Ke,l as he}from"./editPageMounted-79YCIKgP.js";import{i as Je,w as Ze,a as et}from"./documentRoutes-CaOt2rpR.js";import{u as ve,p as tt}from"./usePackageRoute-G6fA1__J.js";const rt=j(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"})),nt=I(Ee,{name:"MuiBreadcrumbCollapsed"})(Q(({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:ce(e.palette.grey[200],.12)}:{backgroundColor:ce(e.palette.grey[600],.12)}}}))),ot=I(rt)({width:24,height:16});function st(e){const{slots:r={},slotProps:o={},...n}=e,s=e;return t.jsx("li",{children:t.jsx(nt,{focusRipple:!0,...n,ownerState:s,children:t.jsx(ot,{as:r.CollapsedIcon,ownerState:s,...o.collapsedIcon})})})}function at(e){return me("MuiBreadcrumbs",e)}const it=fe("MuiBreadcrumbs",["root","ol","li","separator"]),lt=e=>{const{classes:r}=e;return ye({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},at,r)},ct=I(G,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(e,r)=>[{[`& .${it.li}`]:r.li},r.root]})({}),dt=I("ol",{name:"MuiBreadcrumbs",slot:"Ol"})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),pt=I("li",{name:"MuiBreadcrumbs",slot:"Separator"})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function ut(e,r,o,n){return e.reduce((s,a,i)=>(i<e.length-1?s=s.concat(a,t.jsx(pt,{"aria-hidden":!0,className:r,ownerState:n,children:o},`separator-${i}`)):s.push(a),s),[])}const ht=x.forwardRef(function(r,o){const n=ge({props:r,name:"MuiBreadcrumbs"}),{children:s,className:a,component:i="nav",slots:d={},slotProps:m={},expandText:p="Show path",itemsAfterCollapse:h=1,itemsBeforeCollapse:b=1,maxItems:g=8,separator:w="/",...D}=n,[k,S]=x.useState(!1),v={...n,component:i,expanded:k,expandText:p,itemsAfterCollapse:h,itemsBeforeCollapse:b,maxItems:g,separator:w},z=lt(v),T=Me({elementType:d.CollapsedIcon,externalSlotProps:m.collapsedIcon,ownerState:v}),P=x.useRef(null),E=c=>{const M=()=>{S(!0);const y=P.current.querySelector("a[href],button,[tabindex]");y&&y.focus()};return b+h>=c.length?c:[...c.slice(0,b),t.jsx(st,{"aria-label":p,slots:{CollapsedIcon:d.CollapsedIcon},slotProps:{collapsedIcon:T},onClick:M},"ellipsis"),...c.slice(c.length-h,c.length)]},B=x.Children.toArray(s).filter(c=>x.isValidElement(c)).map((c,M)=>t.jsx("li",{className:z.li,children:c},`child-${M}`));return t.jsx(ct,{ref:o,component:i,color:"textSecondary",className:W(z.root,a),ownerState:v,...D,children:t.jsx(dt,{className:z.ol,ref:P,ownerState:v,children:ut(k||g&&B.length<=g?B:E(B),z.separator,w,v)})})});function xt(e,r,o){const n=r.getBoundingClientRect(),s=o&&o.getBoundingClientRect(),a=be(r);let i;if(r.fakeTransform)i=r.fakeTransform;else{const p=a.getComputedStyle(r);i=p.getPropertyValue("-webkit-transform")||p.getPropertyValue("transform")}let d=0,m=0;if(i&&i!=="none"&&typeof i=="string"){const p=i.split("(")[1].split(")")[0].split(",");d=parseInt(p[4],10),m=parseInt(p[5],10)}return e==="left"?s?`translateX(${s.right+d-n.left}px)`:`translateX(${a.innerWidth+d-n.left}px)`:e==="right"?s?`translateX(-${n.right-s.left-d}px)`:`translateX(-${n.left+n.width-d}px)`:e==="up"?s?`translateY(${s.bottom+m-n.top}px)`:`translateY(${a.innerHeight+m-n.top}px)`:s?`translateY(-${n.top-s.top+n.height-m}px)`:`translateY(-${n.top+n.height-m}px)`}function mt(e){return typeof e=="function"?e():e}function O(e,r,o){const n=mt(o),s=xt(e,r,n);s&&(r.style.webkitTransform=s,r.style.transform=s)}const ft=x.forwardRef(function(r,o){const n=K(),s={enter:n.transitions.easing.easeOut,exit:n.transitions.easing.sharp},a={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:i,appear:d=!0,children:m,container:p,direction:h="down",easing:b=s,in:g,onEnter:w,onEntered:D,onEntering:k,onExit:S,onExited:v,onExiting:z,style:T,timeout:P=a,TransitionComponent:E=ze,...B}=r,c=x.useRef(null),M=Ce(Ie(m),c,o),y=l=>f=>{l&&(f===void 0?l(c.current):l(c.current,f))},F=y((l,f)=>{O(h,l,p),Te(l),w&&w(l,f)}),ae=y((l,f)=>{const L=de({timeout:P,style:T,easing:b},{mode:"enter"});l.style.webkitTransition=n.transitions.create("-webkit-transform",{...L}),l.style.transition=n.transitions.create("transform",{...L}),l.style.webkitTransform="none",l.style.transform="none",k&&k(l,f)}),R=y(D),H=y(z),C=y(l=>{const f=de({timeout:P,style:T,easing:b},{mode:"exit"});l.style.webkitTransition=n.transitions.create("-webkit-transform",f),l.style.transition=n.transitions.create("transform",f),O(h,l,p),S&&S(l)}),U=y(l=>{l.style.webkitTransition="",l.style.transition="",v&&v(l)}),_=l=>{i&&i(c.current,l)},N=x.useCallback(()=>{c.current&&O(h,c.current,p)},[h,p]);return x.useEffect(()=>{if(g||h==="down"||h==="right")return;const l=De(()=>{c.current&&O(h,c.current,p)}),f=be(c.current);return f.addEventListener("resize",l),()=>{l.clear(),f.removeEventListener("resize",l)}},[h,g,p]),x.useEffect(()=>{g||N()},[g,N]),t.jsx(E,{nodeRef:c,onEnter:F,onEntered:R,onEntering:ae,onExit:C,onExited:U,onExiting:H,addEndListener:_,appear:d,in:g,timeout:P,...B,children:(l,{ownerState:f,...L})=>x.cloneElement(m,{ref:M,style:{visibility:l==="exited"&&!g?"hidden":void 0,...T,...m.props.style},...L})})});function gt(e){return me("MuiDrawer",e)}fe("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const je=(e,r)=>{const{ownerState:o}=e;return[r.root,(o.variant==="permanent"||o.variant==="persistent")&&r.docked,r.modal]},yt=e=>{const{classes:r,anchor:o,variant:n}=e,s={root:["root",`anchor${$(o)}`],docked:[(n==="permanent"||n==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${$(o)}`,n!=="temporary"&&`paperAnchorDocked${$(o)}`]};return ye(s,gt,r)},bt=I(He,{name:"MuiDrawer",slot:"Root",overridesResolver:je})(Q(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),vt=I("div",{shouldForwardProp:$e,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:je})({flex:"0 0 auto"}),jt=I(Le,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,r)=>{const{ownerState:o}=e;return[r.paper,r[`paperAnchor${$(o.anchor)}`],o.variant!=="temporary"&&r[`paperAnchorDocked${$(o.anchor)}`]]}})(Q(({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}`}}]}))),ke={left:"right",right:"left",top:"down",bottom:"up"};function kt(e){return["left","right"].includes(e)}function wt({direction:e},r){return e==="rtl"&&kt(r)?ke[r]:r}const St=x.forwardRef(function(r,o){const n=ge({props:r,name:"MuiDrawer"}),s=K(),a=Be(),i={enter:s.transitions.duration.enteringScreen,exit:s.transitions.duration.leavingScreen},{anchor:d="left",BackdropProps:m,children:p,className:h,elevation:b=16,hideBackdrop:g=!1,ModalProps:{BackdropProps:w,...D}={},onClose:k,open:S=!1,PaperProps:v={},SlideProps:z,TransitionComponent:T,transitionDuration:P=i,variant:E="temporary",slots:B={},slotProps:c={},...M}=n,y=x.useRef(!1);x.useEffect(()=>{y.current=!0},[]);const F=wt({direction:a?"rtl":"ltr"},d),R={...n,anchor:d,elevation:b,open:S,variant:E,...M},H=yt(R),C={slots:{transition:T,...B},slotProps:{paper:v,transition:z,...c,backdrop:Re(c.backdrop||{...m,...w},{transitionDuration:P})}},[U,_]=A("root",{ref:o,elementType:bt,className:W(H.root,H.modal,h),shouldForwardComponentProp:!0,ownerState:R,externalForwardedProps:{...C,...M,...D},additionalProps:{open:S,onClose:k,hideBackdrop:g,slots:{backdrop:C.slots.backdrop},slotProps:{backdrop:C.slotProps.backdrop}}}),[N,l]=A("paper",{elementType:jt,shouldForwardComponentProp:!0,className:W(H.paper,v.className),ownerState:R,externalForwardedProps:C,additionalProps:{elevation:E==="temporary"?b:0,square:!0,...E==="temporary"&&{role:"dialog","aria-modal":"true"}}}),[f,L]=A("docked",{elementType:vt,ref:o,className:W(H.root,H.docked,h),ownerState:R,externalForwardedProps:C,additionalProps:M}),[Se,Pe]=A("transition",{elementType:ft,ownerState:R,externalForwardedProps:C,additionalProps:{in:S,direction:ke[F],timeout:P,appear:y.current}}),ie=t.jsx(N,{...l,children:p});if(E==="permanent")return t.jsx(f,{...L,children:ie});const le=t.jsx(Se,{...Pe,children:ie});return E==="persistent"?t.jsx(f,{...L,children:le}):t.jsx(U,{..._,children:le})}),Pt=j([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")]),Et=j(t.jsx("path",{d:"M10.85 12.65h2.3L12 9zM20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12zM14.3 16l-.7-2h-3.2l-.7 2H7.8L11 7h2l3.2 9z"})),Mt=j(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"})),zt=j(t.jsx("path",{d:"M9.37 5.51c-.18.64-.27 1.31-.27 1.99 0 4.08 3.32 7.4 7.4 7.4.68 0 1.35-.09 1.99-.27C17.45 17.19 14.93 19 12 19c-3.86 0-7-3.14-7-7 0-2.93 1.81-5.45 4.37-6.49M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1"})),Ct=j(t.jsx("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92zM17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29m-3.6 3.19L3 17.25V21h3.75L17.81 9.94z"})),It=j(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"})),Dt=j(t.jsx("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81zM12 3 2 12h3v8h6v-6h2v6h6v-8h3z"})),Tt=j(t.jsx("path",{d:"M12 9c1.65 0 3 1.35 3 3s-1.35 3-3 3-3-1.35-3-3 1.35-3 3-3m0-2c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z"})),Bt=j(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"})),Rt=j([t.jsx("path",{d:"M12 22C6.49 22 2 17.51 2 12S6.49 2 12 2s10 4.04 10 9c0 3.31-2.69 6-6 6h-1.77c-.28 0-.5.22-.5.5 0 .12.05.23.13.33.41.47.64 1.06.64 1.67 0 1.38-1.12 2.5-2.5 2.5m0-18c-4.41 0-8 3.59-8 8s3.59 8 8 8c.28 0 .5-.22.5-.5 0-.16-.08-.28-.14-.35-.41-.46-.63-1.05-.63-1.65 0-1.38 1.12-2.5 2.5-2.5H16c2.21 0 4-1.79 4-4 0-3.86-3.59-7-8-7"},"0"),t.jsx("circle",{cx:"6.5",cy:"11.5",r:"1.5"},"1"),t.jsx("circle",{cx:"9.5",cy:"7.5",r:"1.5"},"2"),t.jsx("circle",{cx:"14.5",cy:"7.5",r:"1.5"},"3"),t.jsx("circle",{cx:"17.5",cy:"11.5",r:"1.5"},"4")]);function q(e){return t.jsxs(Ne,{...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"})]})}const Ht=/\.malloy(nb)?$/;function Lt(){const{pathname:e,search:r}=J(),o=Z(),n=Ae(),s=Oe(),a=Ke(),i=o.environmentName??"",d=o.packageName??"",m=ve({always:!0}),p=m.path??"",h=i!==""&&d!==""&&p!==""&&m.writable&&!Ht.test(p),{reports:b,settled:g}=We(i,d,void 0,h);if(!h||s)return null;const w=p.replace(/\/$/,""),D=Je(r),k=e.replace(/\/$/,"");return D?a?null:t.jsx(pe,{label:"View",onClick:()=>n(`${k}${Ze(r)}`)}):(g?Ve(`${w}.malloy`,b):void 0)?.editable?t.jsx("span",{onPointerEnter:()=>void he(),onFocus:()=>void he(),children:t.jsx(pe,{label:"Edit",icon:t.jsx(Ct,{}),onClick:()=>n(`${k}${et(r)}`)})}):null}function X({label:e,onClick:r,current:o=!1}){return t.jsx(Fe,{clickable:!0,onClick:r,label:e,size:"small","aria-label":`Navigate to ${e}`,"aria-current":o?"page":void 0,sx:n=>({backgroundColor:"transparent",border:"none",color:o?"text.primary":"text.secondary",fontWeight:o?500:400,fontSize:13,height:28,cursor:"pointer",borderRadius:"6px",maxWidth:320,"& .MuiChip-label":{px:.75,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},"&:hover":{backgroundColor:n.palette.mode==="dark"?"rgba(255, 255, 255, 0.08)":"grey.100"}})})}function $t(){const e=Z(),r=ve(),o=e.environmentName&&e.packageName?tt(e.environmentName,e.packageName,r.versionSegment):"",n=r.path?r.path.replace(/\/$/,""):void 0,s=ee();return!e.environmentName&&!e.packageName&&!n?null:t.jsx(u,{sx:{display:"flex",alignItems:"center",minWidth:0},children:t.jsxs(ht,{"aria-label":"breadcrumb",separator:t.jsx(u,{component:"span","aria-hidden":!0,sx:{color:"text.disabled"},children:"/"}),children:[e.environmentName&&t.jsx(X,{label:e.environmentName,current:!e.packageName&&!n,onClick:a=>s(`/${e.environmentName}/`,a)}),e.packageName&&t.jsx(X,{label:e.packageName,current:!n,onClick:a=>s(`${o}/`,a)}),n&&t.jsx(X,{label:n,current:!0,onClick:a=>s(`${o}/${n}`,a)})]})})}const Nt=260,At=64;function we({isCollapsed:e,onToggleCollapse:r,logoHeader:o}){return t.jsxs(u,{sx:{height:"100dvh",width:e?At:Nt,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(Ot,{isCollapsed:e,onToggleCollapse:r,logoHeader:o}),t.jsxs(u,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",py:1},children:[t.jsx(Wt,{isCollapsed:e}),t.jsx(Vt,{isCollapsed:e})]}),t.jsx(Ft,{isCollapsed:e})]})}function Ot({isCollapsed:e,onToggleCollapse:r,logoHeader:o}){const n=ee();return o?t.jsxs(u,{sx:{height:56,display:"flex",alignItems:"center",justifyContent:"space-between",px:e?0:2,flexShrink:0},children:[o,t.jsx(Y,{size:"small",onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",children:t.jsx(q,{fontSize:"small"})})]}):t.jsxs(u,{sx:{minHeight:56,display:"flex",flexDirection:e?"column":"row",alignItems:"center",justifyContent:e?"center":"space-between",gap:e?.5:0,py:e?1:0,px:e?0:2,flexShrink:0},children:[t.jsxs(u,{onClick:s=>n("/",s),sx:{display:"flex",alignItems:"center",gap:1,cursor:"pointer",minWidth:0},children:[t.jsx(u,{component:"img",src:"/logo.svg",alt:"Malloy",sx:{width:24,height:24,flexShrink:0}}),!e&&t.jsx(G,{variant:"subtitle1",sx:{color:"text.primary",fontWeight:500,letterSpacing:"-0.025em",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:"Malloy Publisher"})]}),t.jsx(V,{title:e?"Expand sidebar":"Collapse sidebar",placement:"right",children:t.jsx(Y,{size:"small",onClick:r,"aria-label":e?"Expand sidebar":"Collapse sidebar",children:t.jsx(q,{fontSize:"small"})})})]})}function Wt({isCollapsed:e}){const o=J().pathname==="/";return t.jsx(te,{sx:{py:0},children:t.jsx(se,{icon:t.jsx(Dt,{fontSize:"small"}),label:"Home",to:"/",selected:o,isCollapsed:e})})}function Vt({isCollapsed:e}){const{apiClients:r}=Ue(),o=Z(),{data:n}=_e({queryKey:["environments"],queryFn:()=>r.environments.listEnvironments()}),s=n?.data??[];return s.length===0?null:t.jsxs(u,{sx:{mt:1},children:[!e&&t.jsx(G,{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(te,{sx:{py:0},children:s.map(a=>{const i=a.name??"";return t.jsx(se,{icon:t.jsx(It,{fontSize:"small"}),label:i,to:`/${i}`,selected:o.environmentName===i,isCollapsed:e},i)})})]})}function Ft({isCollapsed:e}){const{pathname:r}=J(),o=[{label:"Malloy Docs",href:ue.docsHome,icon:t.jsx(Pt,{fontSize:"small"}),external:!0},{label:"Publisher Docs",href:ue.publishing,icon:t.jsx(Bt,{fontSize:"small"}),external:!0},{label:"Publisher API",href:"/api-doc.html",icon:t.jsx(Mt,{fontSize:"small"}),external:!1}];return t.jsxs(te,{sx:{py:1},children:[t.jsx(se,{icon:t.jsx(Rt,{fontSize:"small"}),label:"Theme",to:"/settings/theme",selected:r.startsWith("/settings/theme"),isCollapsed:e}),t.jsx(Yt,{isCollapsed:e}),o.map(n=>t.jsx(Ut,{label:n.label,href:n.href,icon:n.icon,external:n.external,isCollapsed:e},n.label))]})}function se({icon:e,label:r,to:o,selected:n,isCollapsed:s}){const a=ee(),i=t.jsxs(re,{selected:n,onClick:d=>a(o,d),sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(ne,{sx:{minWidth:s?0:36,justifyContent:"center",color:n?"text.primary":"text.secondary"},children:e}),!s&&t.jsx(oe,{primary:r,primaryTypographyProps:{variant:"body2",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(V,{title:r,placement:"right",children:t.jsx(u,{children:i})}):i}function Ut({label:e,href:r,icon:o,external:n,isCollapsed:s}){const a=t.jsxs(re,{component:"a",href:r,target:n?"_blank":void 0,rel:n?"noopener noreferrer":void 0,sx:{justifyContent:s?"center":"flex-start",px:s?0:2},children:[t.jsx(ne,{sx:{minWidth:s?0:36,justifyContent:"center",color:"text.secondary"},children:o}),!s&&t.jsx(oe,{primary:e,primaryTypographyProps:{variant:"body2",sx:{color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}})]});return s?t.jsx(V,{title:e,placement:"right",children:t.jsx(u,{children:a})}):a}const _t={light:"dark",dark:"auto",auto:"light"},Xt={light:"Light mode",dark:"Dark mode",auto:"Auto mode"},xe={light:"Light mode (click for dark)",dark:"Dark mode (click for auto)",auto:"Auto mode (follows OS, click for light)"};function Yt({isCollapsed:e}){const{mode:r,userChoice:o,setMode:n,allowUserToggle:s}=Xe();if(!s)return null;const a=o??r,i=a==="auto"?Et:a==="dark"?zt:Tt,d=t.jsxs(re,{"aria-label":xe[a],onClick:()=>n(_t[a]),sx:{justifyContent:e?"center":"flex-start",px:e?0:2},children:[t.jsx(ne,{sx:{minWidth:e?0:36,justifyContent:"center",color:"text.secondary"},children:t.jsx(i,{fontSize:"small"})}),!e&&t.jsx(oe,{primary:Xt[a],primaryTypographyProps:{variant:"body2",sx:{color:"text.secondary",whiteSpace:"nowrap"}}})]});return t.jsx(V,{title:xe[a],placement:"right",disableHoverListener:!e,children:t.jsx(u,{children:d})})}function qt({open:e,onClose:r,logoHeader:o}){return t.jsx(St,{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(we,{isCollapsed:!1,onToggleCollapse:r,logoHeader:o})})}function Zt({headerProps:e}){const r=K(),o=Ye(r.breakpoints.up("md")),[n,s]=x.useState(!1),[a,i]=x.useState(!1);return x.useEffect(()=>{o&&n&&s(!1)},[o,n]),t.jsxs(u,{sx:{height:"100dvh",display:"flex",flexDirection:"row",bgcolor:"background.default"},children:[o&&t.jsx(we,{isCollapsed:a,onToggleCollapse:()=>i(d=>!d),logoHeader:e?.logoHeader}),t.jsxs(u,{component:"main",sx:{flex:1,display:"flex",flexDirection:"column",minWidth:0},children:[t.jsxs(u,{sx:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"space-between",height:qe.headerHeight,px:{xs:1,md:3},backgroundColor:"background.default"},children:[t.jsx(u,{sx:{display:{xs:"flex",md:"none"},alignItems:"center",mr:1},children:t.jsx(Y,{size:"small",onClick:()=>s(!0),"aria-label":"Open navigation",children:t.jsx(q,{fontSize:"small"})})}),t.jsx(u,{sx:{flex:1,minWidth:0,display:"flex",alignItems:"center"},children:t.jsx($t,{})}),t.jsxs(u,{id:"header-actions-portal",sx:{display:"flex",alignItems:"center",flexShrink:0,gap:1},children:[t.jsx(Lt,{}),e?.endCap]})]}),t.jsx(u,{sx:{flex:1,overflow:"auto",minWidth:320,minHeight:0},children:t.jsx(x.Suspense,{fallback:t.jsx(Ge,{}),children:t.jsx(Qe,{})})})]}),t.jsx(qt,{open:n,onClose:()=>s(!1),logoHeader:e?.logoHeader})]})}export{Zt as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.es-D8SVyfmS.js","assets/index-DLToSg1f.js","assets/index-DUqldpo0.css","assets/ToggleButtonGroup-DZtImN0S.js"])))=>i.map(i=>d[i]);
2
- import{y as te,F as B,r as f,d7 as ne,d8 as se,d9 as U,da as W,a5 as q,E as I,j as t,J as m,db as re,a7 as E,dc as z,a4 as oe,az as ae,dd as ie,bn as ce,de as le,D as de,A as k,df as ue,as as fe,a2 as O,a3 as H,dg as he,dh as pe,a6 as G,T as w,di as me,dj as N,H as xe,dk as ge,a1 as ve,a0 as P,dl as L,C as je,Q as ye,dm as be,dn as _,dp as we,dq as Ee}from"./index-DLToSg1f.js";import{i as D,w as Re,a as K,l as ke}from"./documentRoutes-DI5cX3ty.js";import{v as Se,w as A,u as V}from"./usePackageRoute-A_YQMrax.js";import{u as Ce}from"./usePackageLinkNavigate-DxHGKrmZ.js";import{T as X,P as S}from"./PackageSplatRoute-BLC29ek-.js";import{a as De,l as Y}from"./editPageMounted-C--4kcld.js";function Ae(e,n,s){const r=te(),{reports:a,settled:h,isError:c}=B(e,n,Se(s)),o=h&&!c;return f.useCallback((i,l)=>{const u=i.path;if(!ne(u))return"malformed";const d=se(u,a),p=A(U(e,n,d.kind==="path"?d.report.path:u),e,n,s),g=new URLSearchParams(i.givens).toString();return r(p+(g?`?${g}`:""),l),d.kind==="path"?"resolved":o?"unresolved":"unverified"},[r,e,n,s,a,o])}const Te='[data-tile-kind="query"]',$e=".malloy-render, .malloy-table, [role='alert'], .MuiAlert-root",Me=3e3;function J(e,n,s,r){const a=f.useRef(s);a.current=s;const h=f.useRef(!1);f.useEffect(()=>{if(!a.current||h.current)return;let c=0;const o={},i=()=>{clearTimeout(u),o.beat!==void 0&&clearInterval(o.beat),cancelAnimationFrame(c),o.observer?.disconnect()},l=()=>{h.current||(h.current=!0,i(),a.current?.())},u=setTimeout(l,Me);if(!n)return()=>clearTimeout(u);const d=()=>{const p=e.current;if(!p||r&&p.querySelector(r)===null)return;const g=window.innerHeight;[...p.querySelectorAll(Te)].filter(x=>{if(x.getBoundingClientRect().top>=g)return!1;const j=x.querySelector($e);return!j||j.getBoundingClientRect().height<8}).length===0&&c===0&&(c=requestAnimationFrame(()=>{c=requestAnimationFrame(l)}))};return o.observer=new MutationObserver(d),e.current&&o.observer.observe(e.current,{childList:!0,subtree:!0}),o.beat=setInterval(d,50),d(),i},[n,e,r])}function Q({environmentName:e,packageName:n,versionId:s,path:r,editable:a=r.endsWith(".malloy"),onReady:h}){const c=f.useRef(null);J(c,!0,h,`.${ae.report}`);const{params:o,onGivensChange:i}=W(),{versionSegment:l}=V(),u=Ae(e,n,l),d=Ce(e,n,l),p=f.useMemo(()=>q({environmentName:e,packageName:n}),[e,n]),g=I();return f.useEffect(()=>{if(!a||g)return;const y=()=>void oe(()=>import("./index.es-D8SVyfmS.js"),__vite__mapDeps([0,1,2,3])),x=window.requestIdleCallback;if(x){const j=x(y);return()=>window.cancelIdleCallback?.(j)}const v=setTimeout(y,1500);return()=>clearTimeout(v)},[a,g]),t.jsx(m,{ref:c,sx:X,children:r.endsWith(".malloynb")?t.jsx(re,{resourceUri:E({environmentName:e,packageName:n,modelPath:r,versionId:s}),givens:o,onGivensChange:i,onNavigate:d,onDrillNavigate:u,maxResultSize:1024*1024}):t.jsx(z,{resourceUri:E({environmentName:e,packageName:n,versionId:s}),path:r,givens:o,onGivensChange:i,onNavigate:u,onLinkNavigate:d,onEvent:p,maxResultSize:1024*1024})})}function Pe(){const[e,n]=f.useState(!1),s=f.useRef(!1),r=f.useRef(!1),a=f.useCallback(i=>{s.current=i,n(i)},[]),h=f.useCallback(()=>{r.current=!0},[]),c=ie(f.useCallback(({currentLocation:i,nextLocation:l})=>s.current&&!r.current&&(i.pathname!==l.pathname||D(i.search)!==D(l.search)),[]));f.useEffect(()=>{if(!e)return;const i=l=>{l.preventDefault(),l.returnValue=""};return window.addEventListener("beforeunload",i),()=>window.removeEventListener("beforeunload",i)},[e]);const o=t.jsx(ce,{open:c.state==="blocked",canSave:!1,onKeepEditing:()=>c.reset?.(),onDiscard:()=>c.proceed?.()});return{onDirtyChange:a,leaving:h,dialog:o}}const Le=H.lazy(()=>Y().then(e=>({default:e.ReportEditor}))),_e=H.lazy(()=>Y().then(e=>({default:e.BuilderBar})));function Fe(){const[e,n]=f.useState(null);return f.useEffect(()=>{n(document.getElementById("header-actions-portal"))},[]),e}function Z({environmentName:e,packageName:n,path:s,layout:r="grid",onReady:a,quietLoading:h=!1,offstage:c=!1}){const o=Pe();De();const[i]=f.useState(le),l=de(),{pathname:u,search:d}=k(),p=Fe(),[g,y]=f.useState(),x=f.useRef(null),v=I();J(x,g!==void 0||v,a);const j=()=>l(`${u.replace(/\/$/,"")}${Re(d)}`),C=f.useMemo(()=>q({environmentName:e,packageName:n}),[e,n]),R=t.jsx(z,{resourceUri:E({environmentName:e,packageName:n}),path:s,manifestStaleTime:1e4});return t.jsxs(m,{ref:x,sx:X,children:[t.jsx(ue,{children:t.jsx(f.Suspense,{fallback:h?null:R,children:t.jsx(Le,{resourceUri:E({environmentName:e,packageName:n}),path:s,layout:r,keepDraft:i,onDirtyChange:o.onDirtyChange,onExit:j,onOpenModel:b=>l(`/${[e,n,...b.split("/")].map(encodeURIComponent).join("/")}`),onEvent:C,loading:h?null:R,onControlsChange:y},`${e}/${n}/${s}`)})}),o.dialog,p&&!c&&fe.createPortal(t.jsx(f.Suspense,{fallback:t.jsx(O,{variant:"contained",disableElevation:!0,onClick:j,children:"Done"}),children:t.jsx(_e,{controls:g,onDone:j})}),p)]})}function Be({environmentName:e,packageName:n,versionSegment:s,routePath:r,edit:a,reports:h,children:c}){const{search:o}=k(),i=d=>A(U(e,n,d),e,n,s),l=he(r);if(!l)return t.jsx(t.Fragment,{children:c});const u=pe(l.name,h,l.prefer);return"found"in u?t.jsx(G,{replace:!0,to:`${i(u.found.path)}${a?K(o):o}`}):"ambiguous"in u?t.jsxs(m,{sx:S,children:[t.jsxs(w,{variant:"h6",sx:{fontWeight:"fontWeightMedium"},children:["More than one report is named ",l.name]}),t.jsx(w,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"This is an old link, which names a report by its file name alone. Open one by its path:"}),t.jsx(m,{component:"ul",sx:{mt:1},children:u.ambiguous.map(d=>t.jsx("li",{children:t.jsx(me,{to:i(d),style:{fontFamily:N},children:d})},d))})]}):t.jsx(t.Fragment,{children:c})}function Ue({environmentName:e,packageName:n,routePath:s,edit:r,notFound:a,notFoundUntilListed:h=!1,versionId:c,versionSegment:o,readOnly:i=!1}){const{reports:l,settled:u,isFetching:d,isError:p,refetch:g}=B(e,n,c),{search:y}=k(),x=`${s}.malloy`,v=u?xe(x,l):void 0,j=u&&!d&&!p,[C,R]=f.useState();f.useEffect(()=>{j&&R(x)},[j,x]);const b=v!==void 0||j||C===x,T=ge(e,n,x,r&&!i&&b&&!v),$=ee=>t.jsx(Be,{environmentName:e,packageName:n,...o!==void 0?{versionSegment:o}:{},routePath:s,edit:r,reports:l,children:ee});if(!b&&(h&&!r&&!v))return $(a);if(!b&&p&&!d)return t.jsx(m,{sx:S,children:t.jsxs(ve,{severity:"warning",action:t.jsx(O,{color:"inherit",size:"small",onClick:()=>void g(),children:"Retry"}),children:["Could not list this package's reports, so this page cannot tell what is at ",s,"."]})});if(!b)return t.jsx(P,{text:L.opening()});if(v)return t.jsx(We,{environmentName:e,packageName:n,...c!==void 0?{versionId:c}:{},path:v.path,editable:i?!1:v.editable,layout:v.layout,edit:r&&!i});const M=r?void 0:ke(s);return M!==void 0?t.jsx(G,{replace:!0,to:`${A(`/${e}/${n}/${M.split("/").map(encodeURIComponent).join("/")}`,e,n,o)}${K(y)}`}):$(r&&!i?T.settled?t.jsx(Z,{environmentName:e,packageName:n,path:x,layout:T.layout??"grid"}):t.jsx(P,{text:L.opening()}):a)}function We({environmentName:e,packageName:n,versionId:s,path:r,editable:a,layout:h,edit:c}){const[o,i]=f.useState(c?"editor":"reader"),l=c?"editor":"reader",u=l==="reader"||o==="reader",d=l==="editor"||o==="editor",p={position:"absolute",inset:0,visibility:"hidden",pointerEvents:"none",overflow:"hidden"};return t.jsxs(m,{sx:{position:"relative"},"data-switching":u&&d||void 0,children:[u&&t.jsx(m,{sx:o==="reader"?void 0:p,"aria-hidden":o!=="reader"||void 0,children:t.jsx(Q,{environmentName:e,packageName:n,...s!==void 0?{versionId:s}:{},path:r,...a!==void 0?{editable:a}:{},onReady:()=>{c||i("reader")}})},"reader"),d&&t.jsx(m,{sx:o==="editor"?void 0:p,"aria-hidden":o!=="editor"||void 0,children:t.jsx(Z,{environmentName:e,packageName:n,path:r,...h?{layout:h}:{},quietLoading:u,offstage:l!=="editor"||o!=="editor",onReady:()=>{c&&i("editor")}})},"editor")]})}function Ke(){const e=je(),{search:n}=k(),{path:s,versionId:r,versionSegment:a,writable:h}=V({always:!0}),{server:c}=ye(),{params:o,onGivensChange:i,setParam:l}=W();if(!e.environmentName)return t.jsx("div",{children:t.jsx("h2",{children:"Missing environment name"})});if(!e.packageName)return t.jsx("div",{children:t.jsx("h2",{children:"Missing package name"})});if(s!==void 0&&s!==""&&!s.endsWith(".malloy")&&!s.endsWith(".malloynb")){const d=s.replace(/\/$/,""),p=d.startsWith("data-apps/"),g=p?t.jsx(be,{resourceUri:E({environmentName:e.environmentName,packageName:e.packageName,modelPath:d.slice(10),versionId:r})}):t.jsx(F,{environmentName:e.environmentName,packageName:e.packageName,modelPath:s,staticUrl:_({server:c,environmentName:e.environmentName,packageName:e.packageName,path:s,...r!==void 0?{versionId:r}:{}})});return t.jsx(Ue,{environmentName:e.environmentName,packageName:e.packageName,...r!==void 0?{versionId:r}:{},...a!==void 0?{versionSegment:a}:{},readOnly:!h,routePath:d,edit:D(n),notFound:g,notFoundUntilListed:p})}const u=E({environmentName:e.environmentName,packageName:e.packageName,modelPath:s,versionId:r});return s?.endsWith(".malloy")?t.jsx(m,{sx:S,children:t.jsx(we,{resourceUri:u,runOnDemand:!0,sourceName:o.source,onSourceChange:d=>l("source",d),givens:o,onGivensChange:i,maxResultSize:512*1024})}):s?.endsWith(".malloynb")?t.jsx(Q,{environmentName:e.environmentName,packageName:e.packageName,...r!==void 0?{versionId:r}:{},path:s,editable:!1}):t.jsx(F,{environmentName:e.environmentName,packageName:e.packageName,modelPath:s??"",staticUrl:_({server:c,environmentName:e.environmentName,packageName:e.packageName,path:s??"",...r!==void 0?{versionId:r}:{}})})}function F({packageName:e,modelPath:n,staticUrl:s}){const r=/\.[^./]+$/.test(n),a={fontFamily:N};return t.jsxs(m,{sx:S,children:[t.jsx(w,{variant:"h6",sx:{fontWeight:"fontWeightMedium"},children:"Nothing to open at this path"}),t.jsxs(w,{variant:"body2",color:"text.secondary",sx:{mt:1},children:[t.jsx(m,{component:"span",sx:a,children:n})," ","does not name a report, a"," ",t.jsx(m,{component:"span",sx:a,children:".malloy"})," ","or a"," ",t.jsx(m,{component:"span",sx:a,children:".malloynb"})," ","file in package"," ",t.jsx(m,{component:"span",sx:a,children:e}),". This address opens reports by their path without"," ",t.jsx(m,{component:"span",sx:a,children:".malloy"}),", and"," ",t.jsx(m,{component:"span",sx:a,children:".malloy"})," ","and"," ",t.jsx(m,{component:"span",sx:a,children:".malloynb"})," ","files."]}),r&&t.jsxs(w,{variant:"body2",color:"text.secondary",sx:{mt:1},children:["A file from the package's"," ",t.jsx(m,{component:"span",sx:a,children:"public/"})," ","directory is served at ",t.jsx(Ee,{href:s,children:s}),"."]}),t.jsx(w,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"The package lists its reports, models, and data apps."})]})}export{Ke as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.es-DTreXoC5.js","assets/index-BKjEX4_C.js","assets/index-DUqldpo0.css","assets/ToggleButtonGroup-BylAiUaK.js"])))=>i.map(i=>d[i]);
2
+ import{y as te,F as B,r as f,d7 as ne,d8 as se,d9 as U,da as W,a5 as q,E as I,j as t,J as m,db as re,a7 as E,dc as z,a4 as oe,az as ae,dd as ie,bn as ce,de as le,D as de,A as k,df as ue,as as fe,a2 as O,a3 as G,dg as he,dh as pe,a6 as H,T as w,di as me,dj as N,H as xe,dk as ge,a1 as ve,a0 as P,dl as L,C as je,Q as ye,dm as be,dn as _,dp as we,dq as Ee}from"./index-BKjEX4_C.js";import{i as D,w as Re,a as K,l as ke}from"./documentRoutes-CaOt2rpR.js";import{v as Se,w as A,u as V}from"./usePackageRoute-G6fA1__J.js";import{u as Ce}from"./usePackageLinkNavigate-BfSAqkJS.js";import{T as X,P as S}from"./PackageSplatRoute-ChFCJOWE.js";import{a as De,l as Y}from"./editPageMounted-79YCIKgP.js";function Ae(e,n,s){const r=te(),{reports:a,settled:h,isError:c}=B(e,n,Se(s)),o=h&&!c;return f.useCallback((i,l)=>{const u=i.path;if(!ne(u))return"malformed";const d=se(u,a),p=A(U(e,n,d.kind==="path"?d.report.path:u),e,n,s),g=new URLSearchParams(i.givens).toString();return r(p+(g?`?${g}`:""),l),d.kind==="path"?"resolved":o?"unresolved":"unverified"},[r,e,n,s,a,o])}const Te='[data-tile-kind="query"]',$e=".malloy-render, .malloy-table, [role='alert'], .MuiAlert-root",Me=3e3;function J(e,n,s,r){const a=f.useRef(s);a.current=s;const h=f.useRef(!1);f.useEffect(()=>{if(!a.current||h.current)return;let c=0;const o={},i=()=>{clearTimeout(u),o.beat!==void 0&&clearInterval(o.beat),cancelAnimationFrame(c),o.observer?.disconnect()},l=()=>{h.current||(h.current=!0,i(),a.current?.())},u=setTimeout(l,Me);if(!n)return()=>clearTimeout(u);const d=()=>{const p=e.current;if(!p||r&&p.querySelector(r)===null)return;const g=window.innerHeight;[...p.querySelectorAll(Te)].filter(x=>{if(x.getBoundingClientRect().top>=g)return!1;const j=x.querySelector($e);return!j||j.getBoundingClientRect().height<8}).length===0&&c===0&&(c=requestAnimationFrame(()=>{c=requestAnimationFrame(l)}))};return o.observer=new MutationObserver(d),e.current&&o.observer.observe(e.current,{childList:!0,subtree:!0}),o.beat=setInterval(d,50),d(),i},[n,e,r])}function Q({environmentName:e,packageName:n,versionId:s,path:r,editable:a=r.endsWith(".malloy"),onReady:h}){const c=f.useRef(null);J(c,!0,h,`.${ae.report}`);const{params:o,onGivensChange:i}=W(),{versionSegment:l}=V(),u=Ae(e,n,l),d=Ce(e,n,l),p=f.useMemo(()=>q({environmentName:e,packageName:n}),[e,n]),g=I();return f.useEffect(()=>{if(!a||g)return;const y=()=>void oe(()=>import("./index.es-DTreXoC5.js"),__vite__mapDeps([0,1,2,3])),x=window.requestIdleCallback;if(x){const j=x(y);return()=>window.cancelIdleCallback?.(j)}const v=setTimeout(y,1500);return()=>clearTimeout(v)},[a,g]),t.jsx(m,{ref:c,sx:X,children:r.endsWith(".malloynb")?t.jsx(re,{resourceUri:E({environmentName:e,packageName:n,modelPath:r,versionId:s}),givens:o,onGivensChange:i,onNavigate:d,onDrillNavigate:u,maxResultSize:1024*1024}):t.jsx(z,{resourceUri:E({environmentName:e,packageName:n,versionId:s}),path:r,givens:o,onGivensChange:i,onNavigate:u,onLinkNavigate:d,onEvent:p,maxResultSize:1024*1024})})}function Pe(){const[e,n]=f.useState(!1),s=f.useRef(!1),r=f.useRef(!1),a=f.useCallback(i=>{s.current=i,n(i)},[]),h=f.useCallback(()=>{r.current=!0},[]),c=ie(f.useCallback(({currentLocation:i,nextLocation:l})=>s.current&&!r.current&&(i.pathname!==l.pathname||D(i.search)!==D(l.search)),[]));f.useEffect(()=>{if(!e)return;const i=l=>{l.preventDefault(),l.returnValue=""};return window.addEventListener("beforeunload",i),()=>window.removeEventListener("beforeunload",i)},[e]);const o=t.jsx(ce,{open:c.state==="blocked",canSave:!1,onKeepEditing:()=>c.reset?.(),onDiscard:()=>c.proceed?.()});return{onDirtyChange:a,leaving:h,dialog:o}}const Le=G.lazy(()=>Y().then(e=>({default:e.ReportEditor}))),_e=G.lazy(()=>Y().then(e=>({default:e.BuilderBar})));function Fe(){const[e,n]=f.useState(null);return f.useEffect(()=>{n(document.getElementById("header-actions-portal"))},[]),e}function Z({environmentName:e,packageName:n,path:s,layout:r="grid",onReady:a,quietLoading:h=!1,offstage:c=!1}){const o=Pe();De();const[i]=f.useState(le),l=de(),{pathname:u,search:d}=k(),p=Fe(),[g,y]=f.useState(),x=f.useRef(null),v=I();J(x,g!==void 0||v,a);const j=()=>l(`${u.replace(/\/$/,"")}${Re(d)}`),C=f.useMemo(()=>q({environmentName:e,packageName:n}),[e,n]),R=t.jsx(z,{resourceUri:E({environmentName:e,packageName:n}),path:s,manifestStaleTime:1e4});return t.jsxs(m,{ref:x,sx:X,children:[t.jsx(ue,{children:t.jsx(f.Suspense,{fallback:h?null:R,children:t.jsx(Le,{resourceUri:E({environmentName:e,packageName:n}),path:s,layout:r,keepDraft:i,onDirtyChange:o.onDirtyChange,onExit:j,onOpenModel:b=>l(`/${[e,n,...b.split("/")].map(encodeURIComponent).join("/")}`),onEvent:C,loading:h?null:R,onControlsChange:y},`${e}/${n}/${s}`)})}),o.dialog,p&&!c&&fe.createPortal(t.jsx(f.Suspense,{fallback:t.jsx(O,{variant:"contained",disableElevation:!0,onClick:j,children:"Done"}),children:t.jsx(_e,{controls:g,onDone:j})}),p)]})}function Be({environmentName:e,packageName:n,versionSegment:s,routePath:r,edit:a,reports:h,children:c}){const{search:o}=k(),i=d=>A(U(e,n,d),e,n,s),l=he(r);if(!l)return t.jsx(t.Fragment,{children:c});const u=pe(l.name,h,l.prefer);return"found"in u?t.jsx(H,{replace:!0,to:`${i(u.found.path)}${a?K(o):o}`}):"ambiguous"in u?t.jsxs(m,{sx:S,children:[t.jsxs(w,{variant:"h6",sx:{fontWeight:"fontWeightMedium"},children:["More than one report is named ",l.name]}),t.jsx(w,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"This is an old link, which names a report by its file name alone. Open one by its path:"}),t.jsx(m,{component:"ul",sx:{mt:1},children:u.ambiguous.map(d=>t.jsx("li",{children:t.jsx(me,{to:i(d),style:{fontFamily:N},children:d})},d))})]}):t.jsx(t.Fragment,{children:c})}function Ue({environmentName:e,packageName:n,routePath:s,edit:r,notFound:a,notFoundUntilListed:h=!1,versionId:c,versionSegment:o,readOnly:i=!1}){const{reports:l,settled:u,isFetching:d,isError:p,refetch:g}=B(e,n,c),{search:y}=k(),x=`${s}.malloy`,v=u?xe(x,l):void 0,j=u&&!d&&!p,[C,R]=f.useState();f.useEffect(()=>{j&&R(x)},[j,x]);const b=v!==void 0||j||C===x,T=ge(e,n,x,r&&!i&&b&&!v),$=ee=>t.jsx(Be,{environmentName:e,packageName:n,...o!==void 0?{versionSegment:o}:{},routePath:s,edit:r,reports:l,children:ee});if(!b&&(h&&!r&&!v))return $(a);if(!b&&p&&!d)return t.jsx(m,{sx:S,children:t.jsxs(ve,{severity:"warning",action:t.jsx(O,{color:"inherit",size:"small",onClick:()=>void g(),children:"Retry"}),children:["Could not list this package's reports, so this page cannot tell what is at ",s,"."]})});if(!b)return t.jsx(P,{text:L.opening()});if(v)return t.jsx(We,{environmentName:e,packageName:n,...c!==void 0?{versionId:c}:{},path:v.path,editable:i?!1:v.editable,layout:v.layout,edit:r&&!i});const M=r?void 0:ke(s);return M!==void 0?t.jsx(H,{replace:!0,to:`${A(`/${e}/${n}/${M.split("/").map(encodeURIComponent).join("/")}`,e,n,o)}${K(y)}`}):$(r&&!i?T.settled?t.jsx(Z,{environmentName:e,packageName:n,path:x,layout:T.layout??"grid"}):t.jsx(P,{text:L.opening()}):a)}function We({environmentName:e,packageName:n,versionId:s,path:r,editable:a,layout:h,edit:c}){const[o,i]=f.useState(c?"editor":"reader"),l=c?"editor":"reader",u=l==="reader"||o==="reader",d=l==="editor"||o==="editor",p={position:"absolute",inset:0,visibility:"hidden",pointerEvents:"none",overflow:"hidden"};return t.jsxs(m,{sx:{position:"relative"},"data-switching":u&&d||void 0,children:[u&&t.jsx(m,{sx:o==="reader"?void 0:p,"aria-hidden":o!=="reader"||void 0,children:t.jsx(Q,{environmentName:e,packageName:n,...s!==void 0?{versionId:s}:{},path:r,...a!==void 0?{editable:a}:{},onReady:()=>{c||i("reader")}})},"reader"),d&&t.jsx(m,{sx:o==="editor"?void 0:p,"aria-hidden":o!=="editor"||void 0,children:t.jsx(Z,{environmentName:e,packageName:n,path:r,...h?{layout:h}:{},quietLoading:u,offstage:l!=="editor"||o!=="editor",onReady:()=>{c&&i("editor")}})},"editor")]})}function Ke(){const e=je(),{search:n}=k(),{path:s,versionId:r,versionSegment:a,writable:h}=V({always:!0}),{server:c}=ye(),{params:o,onGivensChange:i,setParam:l}=W();if(!e.environmentName)return t.jsx("div",{children:t.jsx("h2",{children:"Missing environment name"})});if(!e.packageName)return t.jsx("div",{children:t.jsx("h2",{children:"Missing package name"})});if(s!==void 0&&s!==""&&!s.endsWith(".malloy")&&!s.endsWith(".malloynb")){const d=s.replace(/\/$/,""),p=d.startsWith("data-apps/"),g=p?t.jsx(be,{resourceUri:E({environmentName:e.environmentName,packageName:e.packageName,modelPath:d.slice(10),versionId:r})}):t.jsx(F,{environmentName:e.environmentName,packageName:e.packageName,modelPath:s,staticUrl:_({server:c,environmentName:e.environmentName,packageName:e.packageName,path:s,...r!==void 0?{versionId:r}:{}})});return t.jsx(Ue,{environmentName:e.environmentName,packageName:e.packageName,...r!==void 0?{versionId:r}:{},...a!==void 0?{versionSegment:a}:{},readOnly:!h,routePath:d,edit:D(n),notFound:g,notFoundUntilListed:p})}const u=E({environmentName:e.environmentName,packageName:e.packageName,modelPath:s,versionId:r});return s?.endsWith(".malloy")?t.jsx(m,{sx:S,children:t.jsx(we,{resourceUri:u,runOnDemand:!0,sourceName:o.source,onSourceChange:d=>l("source",d),givens:o,onGivensChange:i,maxResultSize:512*1024})}):s?.endsWith(".malloynb")?t.jsx(Q,{environmentName:e.environmentName,packageName:e.packageName,...r!==void 0?{versionId:r}:{},path:s,editable:!1}):t.jsx(F,{environmentName:e.environmentName,packageName:e.packageName,modelPath:s??"",staticUrl:_({server:c,environmentName:e.environmentName,packageName:e.packageName,path:s??"",...r!==void 0?{versionId:r}:{}})})}function F({packageName:e,modelPath:n,staticUrl:s}){const r=/\.[^./]+$/.test(n),a={fontFamily:N};return t.jsxs(m,{sx:S,children:[t.jsx(w,{variant:"h6",sx:{fontWeight:"fontWeightMedium"},children:"Nothing to open at this path"}),t.jsxs(w,{variant:"body2",color:"text.secondary",sx:{mt:1},children:[t.jsx(m,{component:"span",sx:a,children:n})," ","does not name a report, a"," ",t.jsx(m,{component:"span",sx:a,children:".malloy"})," ","or a"," ",t.jsx(m,{component:"span",sx:a,children:".malloynb"})," ","file in package"," ",t.jsx(m,{component:"span",sx:a,children:e}),". This address opens reports by their path without"," ",t.jsx(m,{component:"span",sx:a,children:".malloy"}),", and"," ",t.jsx(m,{component:"span",sx:a,children:".malloy"})," ","and"," ",t.jsx(m,{component:"span",sx:a,children:".malloynb"})," ","files."]}),r&&t.jsxs(w,{variant:"body2",color:"text.secondary",sx:{mt:1},children:["A file from the package's"," ",t.jsx(m,{component:"span",sx:a,children:"public/"})," ","directory is served at ",t.jsx(Ee,{href:s,children:s}),"."]}),t.jsx(w,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"The package lists its reports, models, and data apps."})]})}export{Ke as default};
@@ -1 +1 @@
1
- import{A as x,y as N,D as f,r as h,a5 as j,j as n,a6 as P,a7 as E,a8 as L}from"./index-DLToSg1f.js";import{d as M}from"./documentRoutes-DI5cX3ty.js";import{u as R,p as r,L as c}from"./usePackageRoute-A_YQMrax.js";import{u as S}from"./usePackageLinkNavigate-DxHGKrmZ.js";function D(){const{environmentName:e,packageName:a,versionSegment:o,versionId:m,versioned:u}=R({always:!0}),{search:g}=x(),p=N(),v=f(),i=S(e??"",a??"",o),l=h.useMemo(()=>j({environmentName:e??"",packageName:a??""}),[e,a]);if(e){if(!a)return n.jsx("div",{children:n.jsx("h2",{children:"Missing package name"})})}else return n.jsx("div",{children:n.jsx("h2",{children:"Missing environment name"})});if(u&&o===void 0)return n.jsx(P,{to:`${r(e,a,c)}${g}`,replace:!0});const d=E({environmentName:e,packageName:a,versionId:m});return n.jsx(L,{onClickPackageFile:i,onOpenDocument:({path:s,mode:t},k)=>i(M(e,a,s,t),k),onSelectVersion:(s,t)=>p(r(e,a,s),t),onReplaceVersion:s=>v(r(e,a,s??c),{replace:!0}),resourceUri:d,onEvent:l})}export{D as default};
1
+ import{A as x,y as N,D as f,r as h,a5 as j,j as n,a6 as P,a7 as E,a8 as L}from"./index-BKjEX4_C.js";import{d as M}from"./documentRoutes-CaOt2rpR.js";import{u as R,p as r,L as c}from"./usePackageRoute-G6fA1__J.js";import{u as S}from"./usePackageLinkNavigate-BfSAqkJS.js";function D(){const{environmentName:e,packageName:a,versionSegment:o,versionId:m,versioned:u}=R({always:!0}),{search:g}=x(),p=N(),v=f(),i=S(e??"",a??"",o),l=h.useMemo(()=>j({environmentName:e??"",packageName:a??""}),[e,a]);if(e){if(!a)return n.jsx("div",{children:n.jsx("h2",{children:"Missing package name"})})}else return n.jsx("div",{children:n.jsx("h2",{children:"Missing environment name"})});if(u&&o===void 0)return n.jsx(P,{to:`${r(e,a,c)}${g}`,replace:!0});const d=E({environmentName:e,packageName:a,versionId:m});return n.jsx(L,{onClickPackageFile:i,onOpenDocument:({path:s,mode:t},k)=>i(M(e,a,s,t),k),onSelectVersion:(s,t)=>p(r(e,a,s),t),onReplaceVersion:s=>v(r(e,a,s??c),{replace:!0}),resourceUri:d,onEvent:l})}export{D as default};