archsight 0.5.0 → 0.5.1

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 (29) hide show
  1. checksums.yaml +4 -4
  2. data/docs/configuration.md +1 -0
  3. data/docs/index.md.erb +1 -0
  4. data/docs/slide-decks.md +58 -0
  5. data/lib/archsight/assets.rb +37 -1
  6. data/lib/archsight/linter.rb +13 -0
  7. data/lib/archsight/resources/page.rb +8 -0
  8. data/lib/archsight/slides.rb +88 -0
  9. data/lib/archsight/version.rb +1 -1
  10. data/lib/archsight/web/api/openapi/spec.yaml +82 -1
  11. data/lib/archsight/web/api/page_helpers.rb +2 -0
  12. data/lib/archsight/web/api/routes.rb +15 -0
  13. data/lib/archsight/web/public/vue/{DocPage-D3QtnrmO.js → DocPage-CkTW4dsq.js} +1 -1
  14. data/lib/archsight/web/public/vue/{EditorPage-lZyG6dVt.js → EditorPage-DSxjLS7O.js} +1 -1
  15. data/lib/archsight/web/public/vue/{ErrorPage-BhdYGZJk.js → ErrorPage-t0nIF3Mt.js} +1 -1
  16. data/lib/archsight/web/public/vue/{GraphView-CoqAjFdR.js → GraphView-cjbSm9VK.js} +1 -1
  17. data/lib/archsight/web/public/vue/{HomePage-B7SaXVeb.js → HomePage-CNTs4DbN.js} +2 -2
  18. data/lib/archsight/web/public/vue/{InstanceRouter-DJJn9fhP.js → InstanceRouter-DVwn6cFX.js} +1 -1
  19. data/lib/archsight/web/public/vue/{KindList-UqMajqbf.js → KindList-Bc6JpBac.js} +1 -1
  20. data/lib/archsight/web/public/vue/{PageView-CirIXjW6.js → PageView-I-RdgItl.js} +1 -1
  21. data/lib/archsight/web/public/vue/{QueryError-BIJH6gQC.js → QueryError-C2MuoLnX.js} +1 -1
  22. data/lib/archsight/web/public/vue/{ResourceList-761vG1Jw.js → ResourceList-B442GZt_.js} +1 -1
  23. data/lib/archsight/web/public/vue/{SearchResults-BPHa6yhK.js → SearchResults-Dnv-7uqa.js} +1 -1
  24. data/lib/archsight/web/public/vue/{WikiPage-Bi7dzY2h.js → WikiPage-D6pLR-8Q.js} +2 -2
  25. data/lib/archsight/web/public/vue/{index-BF4zUlWZ.js → index-1Vr7UBrY.js} +2 -2
  26. data/lib/archsight/web/public/vue/index-MTJVvg_J.css +1 -0
  27. data/lib/archsight/web/public/vue.html +2 -2
  28. metadata +17 -15
  29. data/lib/archsight/web/public/vue/index-BO59Fbpf.css +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f7ada570ca5a5647d0cb9dc9f23b37d8adc9c0b6eff5420154c8ef3d30d9ea95
4
- data.tar.gz: ba2e28e035b6d091fbfaeef71b0bc8d775f84c88541ecea0de86ba7d256bde42
3
+ metadata.gz: c2723181f6ae7a954a2bb04948ab141390a8234a5c59671c182f3fd5b0a93794
4
+ data.tar.gz: f775f486c1049cc0db5136939a97a8aa003864f874b029bc33724367fa991c05
5
5
  SHA512:
6
- metadata.gz: 739c46f505dfa73125839be21c2f0baaba7b4ba2a98926ca449a2cf87088cbc2c910c6b016c67ac7905540430927f94f2dc1b0bdce29735aec1ab29857390d7c
7
- data.tar.gz: c259164f01f0d14e47dc5bf7f25a572a1a519dcc92ca788f3191274df5b6e0fd4d3d90fcdc5bc253bca6b454db464aa6ab46eaffa1f5a7f515b000a307506324
6
+ metadata.gz: 07354f46a3af0e3d202531ce61c1b61778da83ce2084ad571cbf84d63727c2402e90ff0377ae4c3c76d3d868c32a80cf20639a8eed63e8d9924a818b6204810b
7
+ data.tar.gz: 2f50d7f09171a3f22bb960158efb79cb1a2fce7c4f0e76acdde11ff72506dc65ba27f27913e8c116e208aa613f137ffc7f3569450441d0ae05cf36aad27c3197
@@ -42,6 +42,7 @@ that is set but empty counts as not set.
42
42
  | `pdf.timeout` | `ARCHSIGHT_PDF_TIMEOUT` | Seconds a PDF may take to typeset before it is cancelled. Default `60` |
43
43
  | `pdf.remote_images` | `ARCHSIGHT_PDF_REMOTE_IMAGES` | `false` stops the PDF export from fetching images that a page embeds by URL (default: fetched, public hosts only) |
44
44
  | `pdf.max_analyses` | `ARCHSIGHT_PDF_MAX_ANALYSES` | How many `![[Analysis/...]]` embeds one PDF may run (each can take as long as its own timeout). Default `5`; further ones are shown as a note |
45
+ | `slides.script_hosts` | `ARCHSIGHT_SLIDES_SCRIPT_HOSTS` | `https://` hosts (space or comma separated) from which an HTML [slide deck](/doc/slide-decks) may load scripts, styles and fonts. Default `https://unpkg.com https://cdn.jsdelivr.net https://cdnjs.cloudflare.com` |
45
46
  | `import.cache_root` | `ARCHSIGHT_IMPORT_CACHE_ROOT` | Where the GitHub, GitLab and repository imports clone repositories, and what importers of the resources repository get as `cache_root` / `ARCHSIGHT_CACHE_DIR`. Default `~/.cache/archsight/git`; an import's own `import/config/cacheRoot` wins, see [Importers of the Resources Repository](/doc/import#importers-of-the-resources-repository). Every import makes sure the clones are not indexed by Spotlight (macOS): an empty `.metadata_never_index` in `~/.cache/archsight`, or in the cache root when it is elsewhere |
46
47
 
47
48
  ## Command line
data/docs/index.md.erb CHANGED
@@ -9,6 +9,7 @@ Welcome to the Architecture Documentation System. This documentation covers how
9
9
  - [Query Syntax](/doc/search) - Search and filter resources
10
10
  - [Wiki Pages](/doc/pages) - Author markdown pages and arrange them in the sidebar tree
11
11
  - [PDF Export](/doc/pdf-export) - Download pages and resources as PDF, with a Config for the look
12
+ - [Slide Decks](/doc/slide-decks) - Show a finished PDF or HTML deck on a page, listed in a Slides menu
12
13
  - [Architecture Modeling](/doc/modeling) - How to model your architecture
13
14
  - [REST API Documentation](/docs/api) - JSON API for programmatic access
14
15
  - [Diagrams](/doc/diagram) - Render `.asd` diagram files to SVG
@@ -0,0 +1,58 @@
1
+ # Slide Decks
2
+
3
+ A [page](/doc/pages) can show a finished slide deck above its text. Archsight does not make or render slides: the deck is
4
+ the file your slide tool produced, and the page is its summary. That works for every tool that can write a PDF or one
5
+ self-contained HTML page (Slidev, reveal.js, Marp, PowerPoint, Keynote, Google Slides, ...).
6
+
7
+ ## Layout
8
+
9
+ One folder per deck, and one menu that lists them, so a large collection stays orderly:
10
+
11
+ ```
12
+ resources/slides/
13
+ menu.yaml # a PageMenu "Slides": spec.contains.pages lists the decks in display order
14
+ 2026-06-08-guardrails/
15
+ 2026-06-08-guardrails.md # the page: frontmatter and a summary
16
+ deck.pdf # the deck (or deck.html)
17
+ cover.png # optional poster image
18
+ ```
19
+
20
+ A deck page is an ordinary page: it is searchable, can link and embed, has an owner and tags, and is edited and exported
21
+ like any other. Page names are unique across the resources, so name the page after its folder rather than `index.md`.
22
+ Only `*.yaml` files are loaded, so the menu is `menu.yaml`. A deck missing from the menu appears under "Unsorted" and is
23
+ reported by `archsight lint`.
24
+
25
+ ## Frontmatter
26
+
27
+ ```yaml
28
+ ---
29
+ title: Guardrails for the Target Picture
30
+ owner: Architecture Team
31
+ slides: deck.pdf # or deck.html, a file next to the page
32
+ cover: cover.png # optional; with a cover the page shows a poster and loads the deck on a click
33
+ ---
34
+ The summary of the deck, in markdown.
35
+ ```
36
+
37
+ `slides` and `cover` are resolved like images (relative to the page, never outside the resources directory). The page shows
38
+ the deck in a frame with **Full screen**, **Open** and **Download** links. The page's own PDF button still exports the
39
+ summary text. Without a cover the deck is shown right away.
40
+
41
+ ## HTML decks run in a sandbox
42
+
43
+ An HTML deck is a program written by someone else, so it is served by `GET /api/v1/decks/<path>` (not as an image or asset)
44
+ and only with a `Content-Security-Policy` that starts with `sandbox allow-scripts` and has no `allow-same-origin`: the deck
45
+ cannot read the API, cookies or storage of Archsight, also when its file is opened on its own, and it cannot load data from
46
+ other hosts (`connect-src` allows only `blob:` and `data:`). Scripts, styles and fonts may be loaded from the hosts of
47
+ the setting `slides.script_hosts` (`ARCHSIGHT_SLIDES_SCRIPT_HOSTS`, `https://` hosts separated by spaces or commas), by default
48
+ `unpkg.com`, `cdn.jsdelivr.net` and `cdnjs.cloudflare.com`. Images
49
+ and media must be inside the file (`data:` or `blob:`).
50
+
51
+ PDF decks are served inline with `nosniff` and shown by the browser's own viewer.
52
+
53
+ ## Making the file
54
+
55
+ - **Slidev:** `slidev export` for a PDF, or any tool that bundles the deck into one HTML file. A multi-file `dist/` folder
56
+ is not supported yet.
57
+ - **PowerPoint, Keynote, Google Slides:** export as PDF.
58
+ - Files are limited to 25 MB.
@@ -34,6 +34,13 @@ module Archsight
34
34
  ".drawio" => "application/xml",
35
35
  ".asd" => "image/svg+xml" # served rendered, see the assets route
36
36
  }.freeze
37
+ # Finished slide decks (see `page/slides`): a PDF, or one self-contained HTML page. They are served by their own door
38
+ # (`/api/v1/decks/<path>`), never as an image, because an HTML deck runs script (it is sandboxed when served).
39
+ DECK_TYPES = {
40
+ ".pdf" => "application/pdf",
41
+ ".html" => "text/html; charset=utf-8"
42
+ }.freeze
43
+ DECKS_PREFIX = "/api/v1/decks/"
37
44
  DRAWIO = ".drawio"
38
45
  ASD = ".asd"
39
46
 
@@ -105,8 +112,24 @@ module Archsight
105
112
  # @param path [String] relative to the resources directory, as received (it is normalized here, so callers cannot forget to)
106
113
  # @return [String, nil] absolute path, nil if there is no such servable asset
107
114
  def file_for(path, resources_dir:)
115
+ servable(path, TYPES, resources_dir)
116
+ end
117
+
118
+ # Like #file_for for a slide deck (PDF or HTML)
119
+ def deck_file_for(path, resources_dir:)
120
+ servable(path, DECK_TYPES, resources_dir)
121
+ end
122
+
123
+ # Why a normalized path is not served as a deck: :type or :missing; nil if it is served
124
+ def deck_problem(path, resources_dir:)
125
+ return :type unless DECK_TYPES.key?(File.extname(path).downcase)
126
+
127
+ deck_file_for(path, resources_dir: resources_dir) ? nil : :missing
128
+ end
129
+
130
+ def servable(path, types, resources_dir)
108
131
  normalized = normalize(path)
109
- return nil unless normalized && TYPES.key?(File.extname(normalized).downcase)
132
+ return nil unless normalized && types.key?(File.extname(normalized).downcase)
110
133
 
111
134
  root = File.realpath(resources_dir)
112
135
  real = File.realpath(File.join(root, normalized))
@@ -119,6 +142,19 @@ module Archsight
119
142
  TYPES.fetch(File.extname(path).downcase)
120
143
  end
121
144
 
145
+ def deck_content_type(path)
146
+ DECK_TYPES.fetch(File.extname(path).downcase)
147
+ end
148
+
149
+ def html_deck?(path)
150
+ File.extname(path).casecmp?(".html")
151
+ end
152
+
153
+ # URL under which the API serves a normalized deck path
154
+ def deck_url_for(path)
155
+ DECKS_PREFIX + path.split("/").map { |segment| ERB::Util.url_encode(segment) }.join("/")
156
+ end
157
+
122
158
  def drawio?(path)
123
159
  File.extname(path).casecmp?(DRAWIO)
124
160
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  require_relative "markdown"
4
4
  require_relative "helpers"
5
+ require_relative "slides"
5
6
  require_relative "linter/structure"
6
7
 
7
8
  module Archsight
@@ -105,11 +106,23 @@ module Archsight
105
106
  end
106
107
 
107
108
  # Pages need exactly one menu and their [[links]] must resolve
109
+ # `slides:` and `cover:` of a page must point at files that are served
110
+ def validate_slides(page)
111
+ resources_dir = @database.path if @database.respond_to?(:path)
112
+ return unless resources_dir
113
+
114
+ Archsight::Slides.audit(page, resources_dir: resources_dir).each do |problem|
115
+ @errors << "#{page.path_ref}: Page '#{page.name}': #{problem}"
116
+ end
117
+ end
118
+
108
119
  def validate_page(page)
109
120
  menus = page.references.map { |r| r[:instance] }.select { |i| i.klass == "PageMenu" }.uniq
110
121
  @errors << "#{page.path_ref}: Page '#{page.name}' is not contained in any PageMenu" if menus.empty? && !page.home?
111
122
  @errors << "#{page.path_ref}: Page '#{page.name}' is contained in several PageMenus (#{menus.map(&:name).join(", ")})" if menus.length > 1
112
123
 
124
+ validate_slides(page)
125
+
113
126
  links = Archsight::Helpers::WikiLinks.new(@database)
114
127
  page.annotations["page/content"].to_s.gsub(Archsight::Helpers::Embeds::PATTERN, "").scan(Archsight::Helpers::WikiLinks::PATTERN).map { |match| match.first.strip }.each do |target|
115
128
  next if links.resolve(target).is_a?(String)
@@ -76,6 +76,14 @@ class Archsight::Resources::Page < Archsight::Resources::Base
76
76
  title: "Properties",
77
77
  format: :multiline,
78
78
  sidebar: false
79
+ annotation "page/slides",
80
+ description: "Finished slide deck of the page: a .pdf or a self-contained .html file next to the page",
81
+ title: "Slides",
82
+ sidebar: false
83
+ annotation "page/cover",
84
+ description: "Cover image of the slide deck (a file next to the page)",
85
+ title: "Cover",
86
+ sidebar: false
79
87
  annotation "page/content",
80
88
  description: "Markdown body of the page",
81
89
  title: "Content",
@@ -0,0 +1,88 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "assets"
4
+ require_relative "user_config"
5
+
6
+ module Archsight
7
+ # The finished slide deck a page shows (`slides:` in its frontmatter): a PDF, or one self-contained HTML page made by
8
+ # any slide tool. Archsight does not render slides; it serves the file and embeds it next to the page's summary.
9
+ #
10
+ # An HTML deck is somebody else's script, so it is only ever served inside a sandbox: a Content-Security-Policy with
11
+ # `sandbox allow-scripts` (no `allow-same-origin`) gives it an opaque origin, which cannot reach the API or the
12
+ # storage of Archsight, also when the file is opened on its own. Scripts may come from the hosts of the setting
13
+ # `slides.script_hosts` (`ARCHSIGHT_SLIDES_SCRIPT_HOSTS`, space or comma separated), by default the common CDNs.
14
+ module Slides
15
+ DEFAULT_SCRIPT_HOSTS = %w[https://unpkg.com https://cdn.jsdelivr.net https://cdnjs.cloudflare.com].freeze
16
+ HOST = %r{\Ahttps://[A-Za-z0-9.-]+(:\d+)?\z}
17
+
18
+ module_function
19
+
20
+ # @return [Array<String>] the hosts an HTML deck may load scripts, styles and fonts from (`https://host` only)
21
+ def script_hosts
22
+ setting = UserConfig.setting("slides", "script_hosts")
23
+ return DEFAULT_SCRIPT_HOSTS unless setting
24
+
25
+ setting.to_s.split(/[\s,]+/).grep(HOST)
26
+ end
27
+
28
+ # @return [String] the Content-Security-Policy of an HTML deck
29
+ def csp(hosts = script_hosts)
30
+ list = hosts.join(" ")
31
+ [
32
+ "sandbox allow-scripts allow-popups",
33
+ "default-src 'none'",
34
+ "script-src 'unsafe-inline' 'unsafe-eval' blob: data: #{list}".strip,
35
+ "style-src 'unsafe-inline' blob: data: #{list}".strip,
36
+ "font-src data: blob: #{list}".strip,
37
+ "img-src data: blob:",
38
+ "media-src data: blob:",
39
+ "connect-src blob: data:"
40
+ ].join("; ")
41
+ end
42
+
43
+ # The deck of a page for the API
44
+ # @return [Hash, nil] `{url:, filename:, type:, cover_url:}`, nil if the page has none or the reference is not servable
45
+ def for_page(page, resources_dir: Archsight.resources_dir)
46
+ reference = page.annotations["page/slides"].to_s.strip
47
+ return nil if reference.empty?
48
+
49
+ base = Assets.base_dir_for(page, resources_dir: resources_dir)
50
+ path = base && Assets.resolve_reference(reference, base)
51
+ return nil unless path && Assets.deck_problem(path, resources_dir: resources_dir).nil?
52
+
53
+ { url: Assets.deck_url_for(path), filename: File.basename(path), type: Assets.html_deck?(path) ? "html" : "pdf",
54
+ cover_url: cover_url(page, base, resources_dir) }
55
+ end
56
+
57
+ def cover_url(page, base, resources_dir)
58
+ reference = page.annotations["page/cover"].to_s.strip
59
+ path = !reference.empty? && Assets.resolve_reference(reference, base)
60
+ path && Assets.problem(path, resources_dir: resources_dir).nil? ? Assets.url_for(path) : nil
61
+ end
62
+
63
+ # Problems of the `page/slides` and `page/cover` references of a page, for the linter
64
+ # @return [Array<String>]
65
+ def audit(page, resources_dir:)
66
+ base = Assets.base_dir_for(page, resources_dir: resources_dir)
67
+ return [] unless base
68
+
69
+ [["page/slides", ->(path) { Assets.deck_problem(path, resources_dir: resources_dir) }, Assets::DECK_TYPES],
70
+ ["page/cover", ->(path) { Assets.problem(path, resources_dir: resources_dir) }, Assets::TYPES]].filter_map do |key, check, types|
71
+ reference = page.annotations[key].to_s.strip
72
+ next if reference.empty?
73
+
74
+ problem(key, reference, base, check, types)
75
+ end
76
+ end
77
+
78
+ def problem(key, reference, base, check, types)
79
+ path = Assets.resolve_reference(reference, base)
80
+ return "#{key} #{reference.inspect} is not a path inside the resources directory" unless path
81
+
82
+ case check.call(path)
83
+ when :type then "#{key} #{reference.inspect} must be #{types.keys.join(", ")}"
84
+ when :missing then "#{key} #{reference.inspect} does not exist (#{path})"
85
+ end
86
+ end
87
+ end
88
+ end
@@ -4,5 +4,5 @@
4
4
  # Do not edit manually.
5
5
 
6
6
  module Archsight
7
- VERSION = "0.5.0"
7
+ VERSION = "0.5.1"
8
8
  end
@@ -336,6 +336,65 @@ paths:
336
336
  error: NotFound
337
337
  message: Page 'nope' not found
338
338
 
339
+ /api/v1/decks/{path}:
340
+ get:
341
+ summary: Get a slide deck (PDF or self-contained HTML)
342
+ description: |
343
+ Serves the finished slide deck of a page (`slides:` in its frontmatter): a `.pdf` or one self-contained
344
+ `.html` file made by any slide tool. Archsight does not render slides, it serves the file and embeds it next
345
+ to the page. The URL is part of `slides.url` of `GET /api/v1/pages/{name}`.
346
+
347
+ The same boundary as the assets applies: regular files inside the resources directory, at most 25 MB, a path
348
+ that is outside, missing or of another type gets the same `404`.
349
+
350
+ An HTML deck is script of its author, so it is only ever served with a `Content-Security-Policy` that starts
351
+ with `sandbox allow-scripts` (no `allow-same-origin`): the deck cannot reach the API or the storage of
352
+ Archsight, also when the file is opened on its own. Scripts, styles and fonts may come from the hosts of the
353
+ setting `slides.script_hosts` (default: common CDNs).
354
+ operationId: getDeck
355
+ tags:
356
+ - Assets
357
+ parameters:
358
+ - name: path
359
+ in: path
360
+ required: true
361
+ description: Path relative to the resources directory, with a literal `/` between the segments
362
+ schema:
363
+ type: string
364
+ example: slides/example-deck/deck.pdf
365
+ responses:
366
+ '200':
367
+ description: The deck
368
+ headers:
369
+ Content-Security-Policy:
370
+ description: Only on HTML decks, the sandbox policy
371
+ schema:
372
+ type: string
373
+ X-Content-Type-Options:
374
+ description: Always `nosniff`
375
+ schema:
376
+ type: string
377
+ content:
378
+ application/pdf:
379
+ schema:
380
+ type: string
381
+ format: binary
382
+ text/html:
383
+ schema:
384
+ type: string
385
+ '404':
386
+ description: No such deck
387
+ content:
388
+ application/json:
389
+ schema:
390
+ $ref: '#/components/schemas/Error'
391
+ '413':
392
+ description: The file is larger than 25 MB
393
+ content:
394
+ application/json:
395
+ schema:
396
+ $ref: '#/components/schemas/Error'
397
+
339
398
  /api/v1/status/{colour}/{text}:
340
399
  get:
341
400
  summary: Get the lozenge of a status macro
@@ -2211,9 +2270,26 @@ components:
2211
2270
  type: string
2212
2271
  description: Name of the page the menu opens, present when it opens one; the crumb links to it
2213
2272
 
2273
+ PageSlides:
2274
+ type: object
2275
+ description: The finished slide deck of a page (`slides:` in the frontmatter), shown next to the page's summary
2276
+ required: [url, filename, type, cover_url]
2277
+ properties:
2278
+ url:
2279
+ type: string
2280
+ description: Where the deck is served, `/api/v1/decks/<path>`
2281
+ filename:
2282
+ type: string
2283
+ type:
2284
+ type: string
2285
+ enum: [pdf, html]
2286
+ cover_url:
2287
+ type: [string, 'null']
2288
+ description: The cover image (`cover:` in the frontmatter) as an asset URL
2289
+
2214
2290
  PageResponse:
2215
2291
  type: object
2216
- required: [name, title, status, author, owner, created, updated, properties, links, tags, toc, breadcrumb, html, backlinks]
2292
+ required: [name, title, status, author, owner, created, updated, properties, links, tags, slides, toc, breadcrumb, html, backlinks]
2217
2293
  properties:
2218
2294
  name:
2219
2295
  type: string
@@ -2263,6 +2339,11 @@ components:
2263
2339
  type: array
2264
2340
  items:
2265
2341
  type: string
2342
+ slides:
2343
+ oneOf:
2344
+ - $ref: '#/components/schemas/PageSlides'
2345
+ - type: 'null'
2346
+ description: The slide deck of the page, null if it has none or the file cannot be served
2266
2347
  toc:
2267
2348
  type: array
2268
2349
  description: Headings of the body; empty unless the frontmatter has `toc` `yes`
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "../../page_tree"
4
+ require_relative "../../slides"
4
5
 
5
6
  module Archsight; end
6
7
  module Archsight::Web; end
@@ -43,6 +44,7 @@ module Archsight::Web::API::PageHelpers
43
44
  properties: page.properties.map { |key, value| { key: key, value: value, html: inline_markdown(value, page) } },
44
45
  links: annotations.select { |key, _| key.start_with?("link/") }.transform_keys { |key| key.delete_prefix("link/") },
45
46
  tags: Archsight::Resources::Page.annotation_matching("page/tags")&.value_for(page) || [],
47
+ slides: Archsight::Slides.for_page(page),
46
48
  toc: annotations["page/toc"] == "yes" ? Archsight::PageTree.toc(body) : [],
47
49
  breadcrumb: tree.breadcrumb(page),
48
50
  html: markdown(body, base: Archsight::Assets.base_dir_for(page, resources_dir: Archsight.resources_dir), page: page),
@@ -185,6 +185,21 @@ module Archsight::Web::API::Routes
185
185
  send_file file, type: type, disposition: :inline
186
186
  end
187
187
 
188
+ # GET /api/v1/decks/*path - The finished slide deck of a page (`slides:` in its frontmatter), a PDF or one
189
+ # self-contained HTML page. Same boundary as the assets (only these two types, only inside the resources directory,
190
+ # everything else the same 404). An HTML deck runs script, so it is only ever served with a sandbox policy.
191
+ get "/api/v1/decks/*" do
192
+ file = Archsight::Assets.deck_file_for(params["splat"].first, resources_dir: Archsight.resources_dir)
193
+ json_error("Deck not found", status: 404, error_type: "NotFound") unless file
194
+ json_error("Deck is too large", status: 413, error_type: "PayloadTooLarge") if File.size(file) > Archsight::Assets::MAX_BYTES
195
+
196
+ headers "X-Content-Type-Options" => "nosniff"
197
+ headers "Content-Security-Policy" => Archsight::Slides.csp if Archsight::Assets.html_deck?(file)
198
+ cache_control :public, :must_revalidate, max_age: 0
199
+ etag "#{File.mtime(file).to_i}-#{File.size(file)}"
200
+ send_file file, type: Archsight::Assets.deck_content_type(file), disposition: :inline
201
+ end
202
+
188
203
  # GET /api/v1/status/:colour/*text - The lozenge of a `{status:colour text}` macro, generated on the fly. The
189
204
  # URL fully determines the SVG, so it is cached for good.
190
205
  get "/api/v1/status/:colour/*" do
@@ -1 +1 @@
1
- import{B as e,L as t,R as n,X as r,it as i,p as a,t as o,tt as s}from"./index-BF4zUlWZ.js";import{t as c}from"./WikiPage-Bi7dzY2h.js";var l={key:1},u={__name:`DocPage`,props:{filename:String},setup(u){let d=u,f=i(null);function p(e,t){let n=new DOMParser().parseFromString(e,`text/html`).body,r=n.querySelector(`:scope > article`)||n,i=r.querySelector(`h1`),a=i?.textContent.trim()||t.split(`/`).pop().replace(/[-_]/g,` `);i?.remove();let o=[...r.querySelectorAll(`h2[id], h3[id], h4[id]`)].map(e=>({level:Number(e.tagName[1]),id:e.id,text:e.textContent.trim()})),s=[{title:`Documentation`}];return t.startsWith(`resources/`)&&s.push({title:`Resource types`}),{title:a,html:r.innerHTML,toc:o.length>=2?o:[],breadcrumb:s}}async function m(){let e=await a(d.filename);f.value=e?p(e,d.filename):{title:`Not found`,html:`<p>Documentation not found.</p>`,toc:[],breadcrumb:[{title:`Documentation`}]},o(f.value.title)}return s(()=>d.filename,m,{immediate:!0}),(i,a)=>f.value?(r(),n(c,{key:0,title:f.value.title,html:f.value.html,breadcrumb:f.value.breadcrumb,toc:f.value.toc},null,8,[`title`,`html`,`breadcrumb`,`toc`])):(r(),e(`article`,l,[...a[0]||=[t(`p`,null,`Loading...`,-1)]]))}};export{u as default};
1
+ import{B as e,L as t,R as n,X as r,it as i,p as a,t as o,tt as s}from"./index-1Vr7UBrY.js";import{t as c}from"./WikiPage-D6pLR-8Q.js";var l={key:1},u={__name:`DocPage`,props:{filename:String},setup(u){let d=u,f=i(null);function p(e,t){let n=new DOMParser().parseFromString(e,`text/html`).body,r=n.querySelector(`:scope > article`)||n,i=r.querySelector(`h1`),a=i?.textContent.trim()||t.split(`/`).pop().replace(/[-_]/g,` `);i?.remove();let o=[...r.querySelectorAll(`h2[id], h3[id], h4[id]`)].map(e=>({level:Number(e.tagName[1]),id:e.id,text:e.textContent.trim()})),s=[{title:`Documentation`}];return t.startsWith(`resources/`)&&s.push({title:`Resource types`}),{title:a,html:r.innerHTML,toc:o.length>=2?o:[],breadcrumb:s}}async function m(){let e=await a(d.filename);f.value=e?p(e,d.filename):{title:`Not found`,html:`<p>Documentation not found.</p>`,toc:[],breadcrumb:[{title:`Documentation`}]},o(f.value.title)}return s(()=>d.filename,m,{immediate:!0}),(i,a)=>f.value?(r(),n(c,{key:0,title:f.value.title,html:f.value.html,breadcrumb:f.value.breadcrumb,toc:f.value.toc},null,8,[`title`,`html`,`breadcrumb`,`toc`])):(r(),e(`article`,l,[...a[0]||=[t(`p`,null,`Loading...`,-1)]]))}};export{u as default};
@@ -1,4 +1,4 @@
1
- import{i as e,t}from"./rolldown-runtime-COiEfhsA.js";import{$ as n,A as r,B as i,E as a,G as o,H as s,I as c,J as l,K as u,L as d,N as f,P as p,R as m,T as h,U as g,X as _,Y as v,Z as y,a as b,at as x,ct as S,d as C,f as w,h as ee,it as T,j as te,k as ne,m as re,nt as ie,ot as E,q as ae,rt as oe,tt as se,z as D}from"./index-BF4zUlWZ.js";import{t as ce}from"./useHighlight-BH32C7yt.js";var le=`archsight.diagramPreview.layout`,ue=[`bottom`,`right`,`full`,`hidden`],de=`(min-width: 1400px)`;function fe(){try{let e=localStorage.getItem(le);return ue.includes(e)?e:null}catch{return null}}var pe=T(fe()),me=T(typeof matchMedia==`function`&&matchMedia(de).matches);typeof matchMedia==`function`&&matchMedia(de).addEventListener(`change`,e=>{me.value=e.matches});var he=c(()=>pe.value||(me.value?`right`:`bottom`));function ge(e){if(ue.includes(e)){pe.value=e;try{localStorage.setItem(le,e)}catch{}}}function _e(){return{layout:he,setLayout:ge}}var ve={class:`preview-head`},ye={class:`preview-tools`},be={key:0,class:`preview-state`},xe={class:`preview-layout`,role:`group`,"aria-label":`Preview layout`},Se=[`aria-pressed`,`title`,`aria-label`,`onClick`],Ce={key:0,class:`preview-error`,role:`alert`},we=[`innerHTML`],Te={key:2,class:`preview-empty`},Ee=300,De=b({__name:`DiagramPreview`,props:{source:String},setup(e){let t=e,{layout:n,setLayout:r}=_e(),a=c(()=>n.value===`hidden`),o=[{value:`bottom`,icon:`iconoir-table-rows`,label:`Below the editor`},{value:`right`,icon:`iconoir-view-columns-2`,label:`Right of the editor`},{value:`full`,icon:`iconoir-expand`,label:`Preview only`},{value:`hidden`,icon:`iconoir-eye-closed`,label:`Hide preview`}],l=T(``),u=T(null),f=T(!1),m=null,g=null;function v(){clearTimeout(m),m=null,g?.abort(),g=null}async function b(e){g=new AbortController;let t=g;f.value=!0;try{let n=await h(e,{signal:t.signal});if(t!==g)return;n.html&&(l.value=n.html),u.value=n.error}catch(e){if(e.name===`AbortError`||t!==g)return;u.value=e.message}finally{t===g&&(f.value=!1)}}se([()=>t.source,a],([e,t],[,n])=>{v(),t?f.value=!1:!e||!e.trim()?(l.value=``,u.value=null,f.value=!1):(f.value=!0,m=setTimeout(()=>b(e),n?0:Ee))},{immediate:!0}),ae(v);function C(e){e.target.closest(`a`)&&e.preventDefault()}return(e,t)=>(_(),i(`div`,{class:E([`diagram-preview`,`layout-${x(n)}`])},[d(`div`,ve,[d(`span`,null,[t[0]||=d(`i`,{class:`iconoir-eye`},null,-1),t[1]||=s(` Preview`,-1),a.value?(_(),i(p,{key:0},[s(` hidden`)],64)):D(``,!0)]),d(`span`,ye,[f.value&&!a.value?(_(),i(`span`,be,`Rendering…`)):D(``,!0),d(`span`,xe,[(_(!0),i(p,null,y(o.filter(e=>!a.value||e.value!==`hidden`),e=>(_(),i(`button`,{key:e.value,type:`button`,class:E({active:x(n)===e.value}),"aria-pressed":x(n)===e.value,title:e.label,"aria-label":e.label,onClick:t=>x(r)(e.value)},[d(`i`,{class:E(e.icon)},null,2)],10,Se))),128))])])]),a.value?D(``,!0):(_(),i(p,{key:0},[u.value?(_(),i(`div`,Ce,[t[2]||=d(`i`,{class:`iconoir-warning-triangle`},null,-1),s(` `+S(u.value),1)])):D(``,!0),l.value?(_(),i(`div`,{key:1,class:E([`preview-body`,{stale:!!u.value}]),title:`Links are disabled in the preview`,onClick:C,innerHTML:l.value},null,10,we)):!u.value&&!f.value?(_(),i(`p`,Te,`Nothing to preview yet.`)):D(``,!0)],64))],2))}},[[`__scopeId`,`data-v-11568657`]]),Oe={class:`label-row`},ke=[`for`,`title`],Ae={key:0,class:`required`},je=[`id`,`aria-invalid`],Me=[`value`],Ne=[`id`,`aria-invalid`,`placeholder`],Pe={key:0,class:`future-hint`},Fe={class:`code-source`},Ie=[`id`,`aria-invalid`,`placeholder`],Le={class:`future-hint`},Re=[`id`,`step`,`aria-invalid`],ze=[`id`,`aria-invalid`],Be=[`id`,`aria-invalid`],Ve=[`id`,`aria-invalid`],He={key:7,class:`field-description`},Ue={key:8,class:`field-error`},We=b({__name:`EditorField`,props:{field:Object,modelValue:[String,Number,null],error:[Array,null]},emits:[`update:modelValue`,`openMarkdown`],setup(e,{emit:t}){let n=e,a=t,o=c({get:()=>n.modelValue??``,set:e=>a(`update:modelValue`,e)}),l=c(()=>[`textarea`,`markdown`,`code`].includes(n.field.input_type)),u=c(()=>n.field.key===`page/content`),f=c(()=>n.field.code_language===`asd`),{layout:h}=_e(),g={asd:`Archsight Diagram`},v=c(()=>{let e=n.field.code_language||``;return g[e]||e.charAt(0).toUpperCase()+e.slice(1)}),b=c(()=>n.error&&n.error.length>0);return(t,n)=>(_(),i(`div`,{class:E([`field-group`,{"field-full-width":l.value}])},[d(`div`,Oe,[d(`label`,{for:e.field.key,title:e.field.description},[s(S(e.field.title)+` `,1),e.field.required?(_(),i(`span`,Ae,`*`)):D(``,!0)],8,ke),e.field.input_type===`markdown`?(_(),i(`button`,{key:0,type:`button`,class:`btn-edit-markdown`,title:`Open rich text editor`,onClick:n[0]||=n=>t.$emit(`openMarkdown`,e.field.key)},[...n[8]||=[d(`i`,{class:`iconoir-edit-pencil`},null,-1),s(` Edit `,-1)]])):D(``,!0)]),e.field.input_type===`select`?oe((_(),i(`select`,{key:0,id:e.field.key,"onUpdate:modelValue":n[1]||=e=>o.value=e,"aria-invalid":b.value?`true`:void 0},[n[9]||=d(`option`,{value:``},`Select...`,-1),(_(!0),i(p,null,y(e.field.options,e=>(_(),i(`option`,{key:e,value:e},S(e),9,Me))),128))],8,je)),[[r,o.value]]):e.field.input_type===`textarea`||e.field.input_type===`markdown`?(_(),i(`div`,{key:1,class:E([`markdown-field`,{"page-body":u.value}])},[oe(d(`textarea`,{id:e.field.key,"onUpdate:modelValue":n[2]||=e=>o.value=e,"aria-invalid":b.value?`true`:void 0,placeholder:e.field.input_type===`markdown`?`Enter markdown content...`:`One entry per line...`},null,8,Ne),[[te,o.value]]),e.field.input_type===`markdown`?(_(),i(`small`,Pe,[...n[10]||=[d(`i`,{class:`iconoir-info-circle`},null,-1),s(` Markdown, `,-1),d(`code`,null,`[[links]]`,-1),s(` and `,-1),d(`code`,null,"```asd",-1),s(` diagrams. Use Edit for the rich text editor `,-1)]])):D(``,!0)],2)):e.field.input_type===`code`?(_(),i(`div`,{key:2,class:E([`code-field`,f.value&&[`with-preview`,`layout-${x(h)}`]])},[d(`div`,Fe,[oe(d(`textarea`,{id:e.field.key,"onUpdate:modelValue":n[3]||=e=>o.value=e,"aria-invalid":b.value?`true`:void 0,placeholder:`Enter ${e.field.code_language||``} code...`,spellcheck:`false`},null,8,Ie),[[te,o.value]]),d(`small`,Le,[n[11]||=d(`i`,{class:`iconoir-code`},null,-1),s(` `+S(v.value)+` code `,1)])]),f.value?(_(),m(De,{key:0,class:`field-diagram-preview`,source:String(o.value)},null,8,[`source`])):D(``,!0)],2)):e.field.input_type===`number`?oe((_(),i(`input`,{key:3,id:e.field.key,type:`number`,"onUpdate:modelValue":n[4]||=e=>o.value=e,step:e.field.step,"aria-invalid":b.value?`true`:void 0},null,8,Re)),[[te,o.value]]):e.field.input_type===`url`?oe((_(),i(`input`,{key:4,id:e.field.key,type:`url`,"onUpdate:modelValue":n[5]||=e=>o.value=e,placeholder:`https://...`,"aria-invalid":b.value?`true`:void 0},null,8,ze)),[[te,o.value]]):e.field.input_type===`list`?oe((_(),i(`input`,{key:5,id:e.field.key,type:`text`,"onUpdate:modelValue":n[6]||=e=>o.value=e,placeholder:`Comma-separated values`,"aria-invalid":b.value?`true`:void 0},null,8,Be)),[[te,o.value]]):oe((_(),i(`input`,{key:6,id:e.field.key,type:`text`,"onUpdate:modelValue":n[7]||=e=>o.value=e,"aria-invalid":b.value?`true`:void 0},null,8,Ve)),[[te,o.value]]),e.field.description&&![`textarea`,`markdown`,`code`].includes(e.field.input_type)?(_(),i(`small`,He,S(e.field.description),1)):D(``,!0),b.value?(_(),i(`div`,Ue,S(e.error.join(`, `)),1)):D(``,!0)],2))}},[[`__scopeId`,`data-v-fe1221de`]]),Ge={class:`relations-editor`},Ke={key:0,class:`no-relations`},qe={id:`relations-list`},Je={class:`relation-text`},Ye=[`onClick`],Xe={class:`add-relation-row`},Ze=[`value`],Qe=[`value`],$e=b({__name:`EditorRelations`,props:{relations:Array,relationOptions:Array,instancesByKind:Object},emits:[`update:relations`],setup(e,{emit:t}){let n=e,a=t,o=T(``),l=T(``),u=c(()=>[...n.relations].sort((e,t)=>(e.verb+e.kind+e.name).localeCompare(t.verb+t.kind+t.name))),f=c(()=>o.value?n.relationOptions.find(e=>e.combo===o.value)?.target_kind:null),m=c(()=>f.value&&n.instancesByKind[f.value]||[]);se(o,()=>{l.value=``});function h(){if(!o.value||!l.value)return;let e=n.relationOptions.find(e=>e.combo===o.value);if(!e||n.relations.some(t=>t.verb===e.verb&&t.kind===e.target_kind&&t.name===l.value))return;let t=[...n.relations,{verb:e.verb,kind:e.target_kind,name:l.value}];a(`update:relations`,t),o.value=``,l.value=``}function g(e){let t=n.relations.filter((t,n)=>n!==e);a(`update:relations`,t)}return(t,n)=>(_(),i(`div`,Ge,[!e.relationOptions||e.relationOptions.length===0?(_(),i(`p`,Ke,` This resource type has no defined relations. `)):(_(),i(p,{key:1},[d(`div`,qe,[(_(!0),i(p,null,y(u.value,(e,t)=>(_(),i(`div`,{key:`${e.verb}:${e.kind}:${e.name}`,class:`relation-item`},[d(`span`,Je,[d(`strong`,null,S(e.verb),1),s(` → `+S(e.kind)+`: `,1),d(`em`,null,S(e.name),1)]),d(`button`,{class:`btn-remove`,type:`button`,title:`Remove`,onClick:e=>g(t)},[...n[2]||=[d(`i`,{class:`iconoir-xmark`},null,-1)]],8,Ye)]))),128))]),d(`div`,Xe,[oe(d(`select`,{"onUpdate:modelValue":n[0]||=e=>o.value=e},[n[3]||=d(`option`,{value:``},`Select relation...`,-1),(_(!0),i(p,null,y(e.relationOptions,e=>(_(),i(`option`,{key:e.combo,value:e.combo},S(e.verb)+` → `+S(e.target_kind),9,Ze))),128))],512),[[r,o.value]]),oe(d(`select`,{"onUpdate:modelValue":n[1]||=e=>l.value=e},[n[4]||=d(`option`,{value:``},`Select instance...`,-1),(_(!0),i(p,null,y(m.value,e=>(_(),i(`option`,{key:e,value:e},S(e),9,Qe))),128))],512),[[r,l.value]]),d(`button`,{class:`secondary btn-add`,type:`button`,onClick:h},[...n[5]||=[d(`i`,{class:`iconoir-plus`},null,-1),s(` Add `,-1)]])])],64))]))}},[[`__scopeId`,`data-v-a987a6fe`]]),et={class:`yaml-output-container`},tt={key:0,class:`conflict-error`},nt={class:`yaml-success`},rt={id:`yaml-content`},it={key:0,class:`yaml-file-info`},at={key:1,class:`yaml-instructions`},ot={class:`yaml-actions`},st=[`disabled`],ct=b({__name:`EditorYamlOutput`,props:{yaml:String,format:{type:String,default:`yaml`},kind:String,name:String,contentHash:String,pathRef:String,inlineEditEnabled:Boolean},emits:[`editAgain`],setup(e,{emit:t}){let n=e,r=T(null),o=T(`idle`),f=T(`idle`),m=T(null),h=c(()=>n.format===`markdown`),g=c(()=>h.value?`Markdown`:`YAML`),v=c(()=>h.value?`.md`:`.yaml`);l(()=>{r.value&&ce(r.value)}),se(()=>n.yaml,async()=>{await u(),r.value&&ce(r.value)});async function y(){try{await navigator.clipboard.writeText(n.yaml),o.value=`copied`,setTimeout(()=>{o.value=`idle`},2e3)}catch{let e=document.createElement(`textarea`);e.value=n.yaml,e.style.position=`fixed`,e.style.opacity=`0`,document.body.appendChild(e),e.select(),document.execCommand(`copy`),document.body.removeChild(e),o.value=`copied`,setTimeout(()=>{o.value=`idle`},2e3)}}async function b(){f.value=`saving`,m.value=null;try{let e=await a(n.kind,n.name,n.yaml,n.contentHash);e.success?(f.value=`saved`,setTimeout(()=>{f.value=`idle`},2e3)):e.conflict?(m.value=e.error,f.value=`idle`):(alert(`Save failed: `+e.error),f.value=`idle`)}catch(e){alert(`Save failed: `+e.message),f.value=`idle`}}return(t,n)=>(_(),i(`div`,et,[m.value?(_(),i(`div`,tt,[n[1]||=d(`i`,{class:`iconoir-warning-triangle`},null,-1),d(`span`,null,S(m.value),1)])):D(``,!0),d(`p`,nt,[n[2]||=d(`i`,{class:`iconoir-check-circle`},null,-1),s(` Generated `+S(g.value),1)]),d(`div`,{ref_key:`codeEl`,ref:r},[d(`pre`,rt,[d(`code`,{class:E(`language-${e.format}`)},S(e.yaml),3)])],512),d(`footer`,null,[e.pathRef?(_(),i(`p`,it,[n[3]||=d(`i`,{class:`iconoir-folder`},null,-1),d(`span`,null,`Source: `+S(e.pathRef),1)])):(_(),i(`p`,at,[n[10]||=d(`i`,{class:`iconoir-info-circle`},null,-1),d(`span`,null,[s(` Copy this `+S(g.value)+` and save it to a `,1),d(`code`,null,S(v.value),1),n[6]||=s(` file in your resources directory`,-1),h.value?(_(),i(p,{key:0},[n[4]||=s(` (named `,-1),d(`code`,null,S(e.name)+`.md`,1),n[5]||=s(`)`,-1)],64)):D(``,!0),n[7]||=s(`, `,-1),n[8]||=d(`br`,null,null,-1),n[9]||=s(`then reload the application. `,-1)])])),d(`div`,ot,[e.pathRef&&e.inlineEditEnabled?(_(),i(`button`,{key:0,type:`button`,onClick:b,disabled:f.value===`saving`,class:E({saved:f.value===`saved`})},[d(`i`,{class:E(f.value===`saving`?`iconoir-refresh`:f.value===`saved`?`iconoir-check`:`iconoir-check-circle`)},null,2),s(` `+S(f.value===`saving`?`Saving...`:f.value===`saved`?`Saved!`:`Save to File`),1)],10,st)):D(``,!0),d(`button`,{type:`button`,onClick:y,class:E({copied:o.value===`copied`})},[d(`i`,{class:E(o.value===`copied`?`iconoir-check`:`iconoir-copy`)},null,2),s(` `+S(o.value===`copied`?`Copied!`:`Copy to Clipboard`),1)],2),d(`button`,{class:`secondary`,type:`button`,onClick:n[0]||=e=>t.$emit(`editAgain`)},[...n[11]||=[d(`i`,{class:`iconoir-edit-pencil`},null,-1),s(` Edit Again `,-1)]])])])]))}},[[`__scopeId`,`data-v-b5ea938f`]]);function O(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function lt(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var ut=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,dt=ut&&`documentMode`in document?document.documentMode:null,ft=ut&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),pt=ut&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),mt=!(!ut||!(`InputEvent`in window)||dt)&&`getTargetRanges`in new window.InputEvent(`input`),ht=ut&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),gt=ut&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,_t=ut&&/Android/.test(navigator.userAgent),vt=ut&&/^(?=.*Chrome).*/i.test(navigator.userAgent),yt=ut&&_t&&vt,bt=ut&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&ft&&!vt,xt=0,St=1,Ct=2,wt=1,Tt=2,Et=3,Dt=4,Ot=5,kt=6,At=ht||gt||bt?`\xA0`:`​`,jt=`
1
+ import{i as e,t}from"./rolldown-runtime-COiEfhsA.js";import{$ as n,A as r,B as i,E as a,G as o,H as s,I as c,J as l,K as u,L as d,N as f,P as p,R as m,T as h,U as g,X as _,Y as v,Z as y,a as b,at as x,ct as S,d as C,f as w,h as ee,it as T,j as te,k as ne,m as re,nt as ie,ot as E,q as ae,rt as oe,tt as se,z as D}from"./index-1Vr7UBrY.js";import{t as ce}from"./useHighlight-BH32C7yt.js";var le=`archsight.diagramPreview.layout`,ue=[`bottom`,`right`,`full`,`hidden`],de=`(min-width: 1400px)`;function fe(){try{let e=localStorage.getItem(le);return ue.includes(e)?e:null}catch{return null}}var pe=T(fe()),me=T(typeof matchMedia==`function`&&matchMedia(de).matches);typeof matchMedia==`function`&&matchMedia(de).addEventListener(`change`,e=>{me.value=e.matches});var he=c(()=>pe.value||(me.value?`right`:`bottom`));function ge(e){if(ue.includes(e)){pe.value=e;try{localStorage.setItem(le,e)}catch{}}}function _e(){return{layout:he,setLayout:ge}}var ve={class:`preview-head`},ye={class:`preview-tools`},be={key:0,class:`preview-state`},xe={class:`preview-layout`,role:`group`,"aria-label":`Preview layout`},Se=[`aria-pressed`,`title`,`aria-label`,`onClick`],Ce={key:0,class:`preview-error`,role:`alert`},we=[`innerHTML`],Te={key:2,class:`preview-empty`},Ee=300,De=b({__name:`DiagramPreview`,props:{source:String},setup(e){let t=e,{layout:n,setLayout:r}=_e(),a=c(()=>n.value===`hidden`),o=[{value:`bottom`,icon:`iconoir-table-rows`,label:`Below the editor`},{value:`right`,icon:`iconoir-view-columns-2`,label:`Right of the editor`},{value:`full`,icon:`iconoir-expand`,label:`Preview only`},{value:`hidden`,icon:`iconoir-eye-closed`,label:`Hide preview`}],l=T(``),u=T(null),f=T(!1),m=null,g=null;function v(){clearTimeout(m),m=null,g?.abort(),g=null}async function b(e){g=new AbortController;let t=g;f.value=!0;try{let n=await h(e,{signal:t.signal});if(t!==g)return;n.html&&(l.value=n.html),u.value=n.error}catch(e){if(e.name===`AbortError`||t!==g)return;u.value=e.message}finally{t===g&&(f.value=!1)}}se([()=>t.source,a],([e,t],[,n])=>{v(),t?f.value=!1:!e||!e.trim()?(l.value=``,u.value=null,f.value=!1):(f.value=!0,m=setTimeout(()=>b(e),n?0:Ee))},{immediate:!0}),ae(v);function C(e){e.target.closest(`a`)&&e.preventDefault()}return(e,t)=>(_(),i(`div`,{class:E([`diagram-preview`,`layout-${x(n)}`])},[d(`div`,ve,[d(`span`,null,[t[0]||=d(`i`,{class:`iconoir-eye`},null,-1),t[1]||=s(` Preview`,-1),a.value?(_(),i(p,{key:0},[s(` hidden`)],64)):D(``,!0)]),d(`span`,ye,[f.value&&!a.value?(_(),i(`span`,be,`Rendering…`)):D(``,!0),d(`span`,xe,[(_(!0),i(p,null,y(o.filter(e=>!a.value||e.value!==`hidden`),e=>(_(),i(`button`,{key:e.value,type:`button`,class:E({active:x(n)===e.value}),"aria-pressed":x(n)===e.value,title:e.label,"aria-label":e.label,onClick:t=>x(r)(e.value)},[d(`i`,{class:E(e.icon)},null,2)],10,Se))),128))])])]),a.value?D(``,!0):(_(),i(p,{key:0},[u.value?(_(),i(`div`,Ce,[t[2]||=d(`i`,{class:`iconoir-warning-triangle`},null,-1),s(` `+S(u.value),1)])):D(``,!0),l.value?(_(),i(`div`,{key:1,class:E([`preview-body`,{stale:!!u.value}]),title:`Links are disabled in the preview`,onClick:C,innerHTML:l.value},null,10,we)):!u.value&&!f.value?(_(),i(`p`,Te,`Nothing to preview yet.`)):D(``,!0)],64))],2))}},[[`__scopeId`,`data-v-11568657`]]),Oe={class:`label-row`},ke=[`for`,`title`],Ae={key:0,class:`required`},je=[`id`,`aria-invalid`],Me=[`value`],Ne=[`id`,`aria-invalid`,`placeholder`],Pe={key:0,class:`future-hint`},Fe={class:`code-source`},Ie=[`id`,`aria-invalid`,`placeholder`],Le={class:`future-hint`},Re=[`id`,`step`,`aria-invalid`],ze=[`id`,`aria-invalid`],Be=[`id`,`aria-invalid`],Ve=[`id`,`aria-invalid`],He={key:7,class:`field-description`},Ue={key:8,class:`field-error`},We=b({__name:`EditorField`,props:{field:Object,modelValue:[String,Number,null],error:[Array,null]},emits:[`update:modelValue`,`openMarkdown`],setup(e,{emit:t}){let n=e,a=t,o=c({get:()=>n.modelValue??``,set:e=>a(`update:modelValue`,e)}),l=c(()=>[`textarea`,`markdown`,`code`].includes(n.field.input_type)),u=c(()=>n.field.key===`page/content`),f=c(()=>n.field.code_language===`asd`),{layout:h}=_e(),g={asd:`Archsight Diagram`},v=c(()=>{let e=n.field.code_language||``;return g[e]||e.charAt(0).toUpperCase()+e.slice(1)}),b=c(()=>n.error&&n.error.length>0);return(t,n)=>(_(),i(`div`,{class:E([`field-group`,{"field-full-width":l.value}])},[d(`div`,Oe,[d(`label`,{for:e.field.key,title:e.field.description},[s(S(e.field.title)+` `,1),e.field.required?(_(),i(`span`,Ae,`*`)):D(``,!0)],8,ke),e.field.input_type===`markdown`?(_(),i(`button`,{key:0,type:`button`,class:`btn-edit-markdown`,title:`Open rich text editor`,onClick:n[0]||=n=>t.$emit(`openMarkdown`,e.field.key)},[...n[8]||=[d(`i`,{class:`iconoir-edit-pencil`},null,-1),s(` Edit `,-1)]])):D(``,!0)]),e.field.input_type===`select`?oe((_(),i(`select`,{key:0,id:e.field.key,"onUpdate:modelValue":n[1]||=e=>o.value=e,"aria-invalid":b.value?`true`:void 0},[n[9]||=d(`option`,{value:``},`Select...`,-1),(_(!0),i(p,null,y(e.field.options,e=>(_(),i(`option`,{key:e,value:e},S(e),9,Me))),128))],8,je)),[[r,o.value]]):e.field.input_type===`textarea`||e.field.input_type===`markdown`?(_(),i(`div`,{key:1,class:E([`markdown-field`,{"page-body":u.value}])},[oe(d(`textarea`,{id:e.field.key,"onUpdate:modelValue":n[2]||=e=>o.value=e,"aria-invalid":b.value?`true`:void 0,placeholder:e.field.input_type===`markdown`?`Enter markdown content...`:`One entry per line...`},null,8,Ne),[[te,o.value]]),e.field.input_type===`markdown`?(_(),i(`small`,Pe,[...n[10]||=[d(`i`,{class:`iconoir-info-circle`},null,-1),s(` Markdown, `,-1),d(`code`,null,`[[links]]`,-1),s(` and `,-1),d(`code`,null,"```asd",-1),s(` diagrams. Use Edit for the rich text editor `,-1)]])):D(``,!0)],2)):e.field.input_type===`code`?(_(),i(`div`,{key:2,class:E([`code-field`,f.value&&[`with-preview`,`layout-${x(h)}`]])},[d(`div`,Fe,[oe(d(`textarea`,{id:e.field.key,"onUpdate:modelValue":n[3]||=e=>o.value=e,"aria-invalid":b.value?`true`:void 0,placeholder:`Enter ${e.field.code_language||``} code...`,spellcheck:`false`},null,8,Ie),[[te,o.value]]),d(`small`,Le,[n[11]||=d(`i`,{class:`iconoir-code`},null,-1),s(` `+S(v.value)+` code `,1)])]),f.value?(_(),m(De,{key:0,class:`field-diagram-preview`,source:String(o.value)},null,8,[`source`])):D(``,!0)],2)):e.field.input_type===`number`?oe((_(),i(`input`,{key:3,id:e.field.key,type:`number`,"onUpdate:modelValue":n[4]||=e=>o.value=e,step:e.field.step,"aria-invalid":b.value?`true`:void 0},null,8,Re)),[[te,o.value]]):e.field.input_type===`url`?oe((_(),i(`input`,{key:4,id:e.field.key,type:`url`,"onUpdate:modelValue":n[5]||=e=>o.value=e,placeholder:`https://...`,"aria-invalid":b.value?`true`:void 0},null,8,ze)),[[te,o.value]]):e.field.input_type===`list`?oe((_(),i(`input`,{key:5,id:e.field.key,type:`text`,"onUpdate:modelValue":n[6]||=e=>o.value=e,placeholder:`Comma-separated values`,"aria-invalid":b.value?`true`:void 0},null,8,Be)),[[te,o.value]]):oe((_(),i(`input`,{key:6,id:e.field.key,type:`text`,"onUpdate:modelValue":n[7]||=e=>o.value=e,"aria-invalid":b.value?`true`:void 0},null,8,Ve)),[[te,o.value]]),e.field.description&&![`textarea`,`markdown`,`code`].includes(e.field.input_type)?(_(),i(`small`,He,S(e.field.description),1)):D(``,!0),b.value?(_(),i(`div`,Ue,S(e.error.join(`, `)),1)):D(``,!0)],2))}},[[`__scopeId`,`data-v-fe1221de`]]),Ge={class:`relations-editor`},Ke={key:0,class:`no-relations`},qe={id:`relations-list`},Je={class:`relation-text`},Ye=[`onClick`],Xe={class:`add-relation-row`},Ze=[`value`],Qe=[`value`],$e=b({__name:`EditorRelations`,props:{relations:Array,relationOptions:Array,instancesByKind:Object},emits:[`update:relations`],setup(e,{emit:t}){let n=e,a=t,o=T(``),l=T(``),u=c(()=>[...n.relations].sort((e,t)=>(e.verb+e.kind+e.name).localeCompare(t.verb+t.kind+t.name))),f=c(()=>o.value?n.relationOptions.find(e=>e.combo===o.value)?.target_kind:null),m=c(()=>f.value&&n.instancesByKind[f.value]||[]);se(o,()=>{l.value=``});function h(){if(!o.value||!l.value)return;let e=n.relationOptions.find(e=>e.combo===o.value);if(!e||n.relations.some(t=>t.verb===e.verb&&t.kind===e.target_kind&&t.name===l.value))return;let t=[...n.relations,{verb:e.verb,kind:e.target_kind,name:l.value}];a(`update:relations`,t),o.value=``,l.value=``}function g(e){let t=n.relations.filter((t,n)=>n!==e);a(`update:relations`,t)}return(t,n)=>(_(),i(`div`,Ge,[!e.relationOptions||e.relationOptions.length===0?(_(),i(`p`,Ke,` This resource type has no defined relations. `)):(_(),i(p,{key:1},[d(`div`,qe,[(_(!0),i(p,null,y(u.value,(e,t)=>(_(),i(`div`,{key:`${e.verb}:${e.kind}:${e.name}`,class:`relation-item`},[d(`span`,Je,[d(`strong`,null,S(e.verb),1),s(` → `+S(e.kind)+`: `,1),d(`em`,null,S(e.name),1)]),d(`button`,{class:`btn-remove`,type:`button`,title:`Remove`,onClick:e=>g(t)},[...n[2]||=[d(`i`,{class:`iconoir-xmark`},null,-1)]],8,Ye)]))),128))]),d(`div`,Xe,[oe(d(`select`,{"onUpdate:modelValue":n[0]||=e=>o.value=e},[n[3]||=d(`option`,{value:``},`Select relation...`,-1),(_(!0),i(p,null,y(e.relationOptions,e=>(_(),i(`option`,{key:e.combo,value:e.combo},S(e.verb)+` → `+S(e.target_kind),9,Ze))),128))],512),[[r,o.value]]),oe(d(`select`,{"onUpdate:modelValue":n[1]||=e=>l.value=e},[n[4]||=d(`option`,{value:``},`Select instance...`,-1),(_(!0),i(p,null,y(m.value,e=>(_(),i(`option`,{key:e,value:e},S(e),9,Qe))),128))],512),[[r,l.value]]),d(`button`,{class:`secondary btn-add`,type:`button`,onClick:h},[...n[5]||=[d(`i`,{class:`iconoir-plus`},null,-1),s(` Add `,-1)]])])],64))]))}},[[`__scopeId`,`data-v-a987a6fe`]]),et={class:`yaml-output-container`},tt={key:0,class:`conflict-error`},nt={class:`yaml-success`},rt={id:`yaml-content`},it={key:0,class:`yaml-file-info`},at={key:1,class:`yaml-instructions`},ot={class:`yaml-actions`},st=[`disabled`],ct=b({__name:`EditorYamlOutput`,props:{yaml:String,format:{type:String,default:`yaml`},kind:String,name:String,contentHash:String,pathRef:String,inlineEditEnabled:Boolean},emits:[`editAgain`],setup(e,{emit:t}){let n=e,r=T(null),o=T(`idle`),f=T(`idle`),m=T(null),h=c(()=>n.format===`markdown`),g=c(()=>h.value?`Markdown`:`YAML`),v=c(()=>h.value?`.md`:`.yaml`);l(()=>{r.value&&ce(r.value)}),se(()=>n.yaml,async()=>{await u(),r.value&&ce(r.value)});async function y(){try{await navigator.clipboard.writeText(n.yaml),o.value=`copied`,setTimeout(()=>{o.value=`idle`},2e3)}catch{let e=document.createElement(`textarea`);e.value=n.yaml,e.style.position=`fixed`,e.style.opacity=`0`,document.body.appendChild(e),e.select(),document.execCommand(`copy`),document.body.removeChild(e),o.value=`copied`,setTimeout(()=>{o.value=`idle`},2e3)}}async function b(){f.value=`saving`,m.value=null;try{let e=await a(n.kind,n.name,n.yaml,n.contentHash);e.success?(f.value=`saved`,setTimeout(()=>{f.value=`idle`},2e3)):e.conflict?(m.value=e.error,f.value=`idle`):(alert(`Save failed: `+e.error),f.value=`idle`)}catch(e){alert(`Save failed: `+e.message),f.value=`idle`}}return(t,n)=>(_(),i(`div`,et,[m.value?(_(),i(`div`,tt,[n[1]||=d(`i`,{class:`iconoir-warning-triangle`},null,-1),d(`span`,null,S(m.value),1)])):D(``,!0),d(`p`,nt,[n[2]||=d(`i`,{class:`iconoir-check-circle`},null,-1),s(` Generated `+S(g.value),1)]),d(`div`,{ref_key:`codeEl`,ref:r},[d(`pre`,rt,[d(`code`,{class:E(`language-${e.format}`)},S(e.yaml),3)])],512),d(`footer`,null,[e.pathRef?(_(),i(`p`,it,[n[3]||=d(`i`,{class:`iconoir-folder`},null,-1),d(`span`,null,`Source: `+S(e.pathRef),1)])):(_(),i(`p`,at,[n[10]||=d(`i`,{class:`iconoir-info-circle`},null,-1),d(`span`,null,[s(` Copy this `+S(g.value)+` and save it to a `,1),d(`code`,null,S(v.value),1),n[6]||=s(` file in your resources directory`,-1),h.value?(_(),i(p,{key:0},[n[4]||=s(` (named `,-1),d(`code`,null,S(e.name)+`.md`,1),n[5]||=s(`)`,-1)],64)):D(``,!0),n[7]||=s(`, `,-1),n[8]||=d(`br`,null,null,-1),n[9]||=s(`then reload the application. `,-1)])])),d(`div`,ot,[e.pathRef&&e.inlineEditEnabled?(_(),i(`button`,{key:0,type:`button`,onClick:b,disabled:f.value===`saving`,class:E({saved:f.value===`saved`})},[d(`i`,{class:E(f.value===`saving`?`iconoir-refresh`:f.value===`saved`?`iconoir-check`:`iconoir-check-circle`)},null,2),s(` `+S(f.value===`saving`?`Saving...`:f.value===`saved`?`Saved!`:`Save to File`),1)],10,st)):D(``,!0),d(`button`,{type:`button`,onClick:y,class:E({copied:o.value===`copied`})},[d(`i`,{class:E(o.value===`copied`?`iconoir-check`:`iconoir-copy`)},null,2),s(` `+S(o.value===`copied`?`Copied!`:`Copy to Clipboard`),1)],2),d(`button`,{class:`secondary`,type:`button`,onClick:n[0]||=e=>t.$emit(`editAgain`)},[...n[11]||=[d(`i`,{class:`iconoir-edit-pencil`},null,-1),s(` Edit Again `,-1)]])])])]))}},[[`__scopeId`,`data-v-b5ea938f`]]);function O(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);throw n.search=r.toString(),Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}function lt(e,...t){let n=new URL(`https://lexical.dev/docs/error`),r=new URLSearchParams;r.append(`code`,e);for(let e of t)r.append(`v`,e);n.search=r.toString(),console.warn(`Minified Lexical warning #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}var ut=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,dt=ut&&`documentMode`in document?document.documentMode:null,ft=ut&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),pt=ut&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),mt=!(!ut||!(`InputEvent`in window)||dt)&&`getTargetRanges`in new window.InputEvent(`input`),ht=ut&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),gt=ut&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,_t=ut&&/Android/.test(navigator.userAgent),vt=ut&&/^(?=.*Chrome).*/i.test(navigator.userAgent),yt=ut&&_t&&vt,bt=ut&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&ft&&!vt,xt=0,St=1,Ct=2,wt=1,Tt=2,Et=3,Dt=4,Ot=5,kt=6,At=ht||gt||bt?`\xA0`:`​`,jt=`
2
2
 
3
3
  `,Mt=pt?`\xA0`:At,Nt=`֑-߿יִ-﷽ﹰ-ﻼ`,Pt=`A-Za-zÀ-ÖØ-öø-ʸ̀-֐ࠀ-῿‎Ⰰ-﬜︀-﹯﻽-￿`,Ft=RegExp(`^[^`+Pt+`]*[`+Nt+`]`),It=RegExp(`^[^`+Nt+`]*[`+Pt+`]`),Lt={bold:1,capitalize:1024,code:16,highlight:128,italic:2,lowercase:256,strikethrough:4,subscript:32,superscript:64,underline:8,uppercase:512},Rt={directionless:1,unmergeable:2},zt={center:2,end:6,justify:4,left:1,right:3,start:5},Bt={[Tt]:`center`,[kt]:`end`,[Dt]:`justify`,[wt]:`left`,[Et]:`right`,[Ot]:`start`},Vt={normal:0,segmented:2,token:1},Ht={[xt]:`normal`,[Ct]:`segmented`,[St]:`token`},Ut=`$config`;function Wt(e,t,n,r,i,a){let o=e.getFirstChild();for(;o!==null;){let e=o.__key;o.__parent===t&&(B(o)&&Wt(o,e,n,r,i,a),n.has(e)||a.delete(e),i.push(e)),o=o.getNextSibling()}}var Gt=!1,Kt=0;function qt(e){Kt=e.timeStamp}function Jt(e,t,n){let r=e.nodeName===`BR`,i=t.__lexicalLineBreak;return i&&(e===i||r&&e.previousSibling===i)||r&&Xo(e,n)!==void 0}function Yt(e,t,n){let r=Ls(ks(n)),i=null,a=null;r!==null&&r.anchorNode===e&&(i=r.anchorOffset,a=r.focusOffset);let o=e.nodeValue;o!==null&&cs(t,o,i,a,!1)}function Xt(e,t,n){if(P(e)){let t=e.anchor.getNode();if(t.is(n)&&e.format!==t.getFormat())return!1}return zo(t)&&n.isAttached()}function Zt(e,t,n,r){for(let i=e;i&&!Qs(i);i=Cs(i)){let e=Xo(i,t);if(e!==void 0){let t=W(e,n);if(t)return V(t)||!J(i)?void 0:[i,t]}else if(i===r)return[r,es(n)]}}function Qt(e,t,n){Gt=!0;let r=performance.now()-Kt>100;try{io(e,()=>{let i=F()||function(e){return e.getEditorState().read(()=>{let e=F();return e===null?null:e.clone()})}(e),a=new Map,o=e.getRootElement(),s=e._editorState,c=e._blockCursorElement,l=!1,u=``;for(let n=0;n<t.length;n++){let d=t[n],f=d.type,p=d.target,m=Zt(p,e,s,o);if(!m)continue;let[h,g]=m;if(f===`characterData`)r&&N(g)&&zo(p)&&Xt(i,p,g)&&Yt(p,g,e);else if(f===`childList`){l=!0;let t=d.addedNodes;for(let n=0;n<t.length;n++){let r=t[n],i=Yo(r),a=r.parentNode;if(a!=null&&r!==c&&i===null&&!Jt(r,a,e)){if(pt){let e=(J(r)?r.innerText:null)||r.nodeValue;e&&(u+=e)}a.removeChild(r)}}let n=d.removedNodes,r=n.length;if(r>0){let t=0;for(let i=0;i<r;i++){let r=n[i];(Jt(r,p,e)||c===r)&&(p.appendChild(r),t++)}r!==t&&a.set(h,g)}}}if(a.size>0)for(let[t,n]of a)n.reconcileObservedMutation(t,e);let d=n.takeRecords();if(d.length>0){for(let t=0;t<d.length;t++){let n=d[t],r=n.addedNodes,i=n.target;for(let t=0;t<r.length;t++){let n=r[t],a=n.parentNode;a==null||n.nodeName!==`BR`||Jt(n,i,e)||a.removeChild(n)}}n.takeRecords()}i!==null&&(l&&ts(i),pt&&xs(e)&&i.insertRawText(u))})}finally{Gt=!1}}function $t(e){let t=e._observer;t!==null&&Qt(e,t.takeRecords(),t)}function en(e){(function(e){Kt===0&&ks(e).addEventListener(`textInput`,qt,!0)})(e),e._observer=new MutationObserver((t,n)=>{Qt(e,t,n)})}var tn=class{key;parse;unparse;isEqual;defaultValue;constructor(e,t){this.key=e,this.parse=t.parse.bind(t),this.unparse=(t.unparse||dn).bind(t),this.isEqual=(t.isEqual||Object.is).bind(t),this.defaultValue=this.parse(void 0)}};function nn(e,t){return new tn(e,t)}function rn(e,t,n=`latest`){let r=(n===`latest`?e.getLatest():e).__state;return r?r.getValue(t):t.defaultValue}function an(e,t,n){let r;if(R(),typeof n==`function`){let i=e.getLatest(),a=rn(i,t);if(r=n(a),t.isEqual(a,r))return i}else r=n;let i=e.getWritable();return cn(i).updateFromKnown(t,r),i}function on(e){let t=new Map,n=new Set;for(let r=typeof e==`function`?e:e.replace;r.prototype&&r.prototype.getType!==void 0;r=Object.getPrototypeOf(r)){let{ownNodeConfig:e}=ec(r);if(e&&e.stateConfigs)for(let r of e.stateConfigs){let e;`stateConfig`in r?(e=r.stateConfig,r.flat&&n.add(e.key)):e=r,t.set(e.key,e)}}return{flatKeys:n,sharedConfigMap:t}}var sn=class e{node;knownState;unknownState;sharedNodeState;size;constructor(e,t,n=void 0,r=new Map,i=void 0){this.node=e,this.sharedNodeState=t,this.unknownState=n,this.knownState=r;let{sharedConfigMap:a}=this.sharedNodeState,o=i===void 0?function(e,t,n){let r=n.size;if(t)for(let i in t){let t=e.get(i);t&&n.has(t)||r++}return r}(a,n,r):i;this.size=o}getValue(e){let t=this.knownState.get(e);if(t!==void 0)return t;this.sharedNodeState.sharedConfigMap.set(e.key,e);let n=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){let t=this.unknownState[e.key];t!==void 0&&(n=e.parse(t)),this.updateFromKnown(e,n)}return n}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){let e={...this.unknownState},t={};for(let[t,n]of this.knownState)t.isEqual(n,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(n);for(let n of this.sharedNodeState.flatKeys)n in e&&(t[n]=e[n],delete e[n]);return un(e)&&(t.$=e),t}getWritable(t){if(this.node===t)return this;let{sharedNodeState:n,unknownState:r}=this,i=new Map(this.knownState);return new e(t,n,function(e,t,n){let r;if(n)for(let[i,a]of Object.entries(n)){let n=e.get(i);n?t.has(n)||t.set(n,n.parse(a)):(r||={},r[i]=a)}return r}(n.sharedConfigMap,i,r),i,this.size)}updateFromKnown(e,t){let n=e.key;this.sharedNodeState.sharedConfigMap.set(n,e);let{knownState:r,unknownState:i}=this;r.has(e)||i&&n in i||(i&&(delete i[n],this.unknownState=un(i)),this.size++),r.set(e,t)}updateFromUnknown(e,t){let n=this.sharedNodeState.sharedConfigMap.get(e);n?this.updateFromKnown(n,n.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){let{knownState:t}=this;for(let e of t.keys())t.set(e,e.defaultValue);if(this.size=t.size,this.unknownState=void 0,e)for(let[t,n]of Object.entries(e))this.updateFromUnknown(t,n)}};function cn(e){let t=e.getWritable(),n=t.__state?t.__state.getWritable(t):new sn(t,ln(t));return t.__state=n,n}function ln(e){return e.__state?e.__state.sharedNodeState:Do(Gs(),e.getType()).sharedNodeState}function un(e){if(e)for(let t in e)return e}function dn(e){return e}function fn(e,t,n){for(let[r,i]of t.knownState){if(e.has(r.key))continue;e.add(r.key);let t=n?n.getValue(r):r.defaultValue;if(t!==i&&!r.isEqual(t,i))return!0}return!1}function pn(e,t,n){let{unknownState:r}=t,i=n?n.unknownState:void 0;if(r){for(let[t,n]of Object.entries(r))if(!e.has(t)&&(e.add(t),n!==(i?i[t]:void 0)))return!0}return!1}function mn(e,t){let n=e.__state;return n&&n.node===e?n.getWritable(t):n}function hn(e,t){let n=e.__mode,r=e.__format,i=e.__style,a=t.__mode,o=t.__format,s=t.__style,c=e.__state,l=t.__state;return(n===null||n===a)&&(r===null||r===o)&&(i===null||i===s)&&(e.__state===null||c===l||function(e,t){if(e===t)return!0;if(e&&t&&e.size!==t.size)return!1;let n=new Set;return!(e&&fn(n,e,t)||t&&fn(n,t,e)||e&&pn(n,e,t)||t&&pn(n,t,e))}(c,l))}function gn(e,t){let n=e.mergeWithSibling(t),r=z()._normalizedNodes;return r.add(e.__key),r.add(t.__key),n}function _n(e){let t,n,r=e;if(r.__text!==``||!r.isSimpleText()||r.isUnmergeable()){for(;(t=r.getPreviousSibling())!==null&&N(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==``){if(hn(t,r)){r=gn(t,r);break}break}t.remove()}for(;(n=r.getNextSibling())!==null&&N(n)&&n.isSimpleText()&&!n.isUnmergeable();){if(n.__text!==``){if(hn(r,n)){r=gn(r,n);break}break}n.remove()}}else r.remove()}function vn(e){return yn(e.anchor),yn(e.focus),e}function yn(e){for(;e.type===`element`;){let t=e.getNode(),n=e.offset,r,i;if(n===t.getChildrenSize()?(r=t.getChildAtIndex(n-1),i=!0):(r=t.getChildAtIndex(n),i=!1),N(r)){e.set(r.__key,i?r.getTextContentSize():0,`text`,!0);break}if(!B(r))break;e.set(r.__key,i?r.getChildrenSize():0,`element`,!0)}}var bn,xn,Sn,Cn,wn,Tn,En,Dn,On,kn,k=``,An=null,jn=null,Mn=!1,Nn=!1;function Pn(e,t){let n=En.get(e);if(t!==null){let n=Qn(e);n.parentNode===t&&t.removeChild(n)}if(Dn.has(e)||xn._keyToDOMMap.delete(e),B(n)){let e=Kn(n,En);Fn(e,0,e.length-1,null)}n!==void 0&&vs(kn,Sn,Cn,n,`destroyed`)}function Fn(e,t,n,r){for(let i=t;i<=n;++i){let t=e[i];t!==void 0&&Pn(t,r)}}function In(e,t){e.setProperty(`text-align`,t)}var Ln=`40px`;function Rn(e,t){let n=bn.theme.indent;if(typeof n==`string`){let r=e.classList.contains(n);t>0&&!r?e.classList.add(n):t<1&&r&&e.classList.remove(n)}if(t===0)return void e.style.setProperty(`padding-inline-start`,``);let r=getComputedStyle(xn._rootElement||e).getPropertyValue(`--lexical-indent-base-value`)||Ln;e.style.setProperty(`padding-inline-start`,`calc(${t} * ${r})`)}function zn(e,t){let n=e.style;t===0?In(n,``):t===1?In(n,`left`):t===2?In(n,`center`):t===3?In(n,`right`):t===4?In(n,`justify`):t===5?In(n,`start`):t===6&&In(n,`end`)}function Bn(e,t){let n=function(e){let t=e.__dir;if(t!==null)return t;if(H(e))return null;let n=e.getParentOrThrow();return H(n)&&n.__dir===null?`auto`:null}(t);n===null?e.removeAttribute(`dir`):e.dir=n}function Vn(e,t){let n=Dn.get(e);n===void 0&&O(60);let r=n.createDOM(bn,xn);if(function(e,t,n){let r=n._keyToDOMMap;(function(e,t,n){let r=`__lexicalKey_${t._key}`;e[r]=n})(t,n,e),r.set(e,t)}(e,r,xn),N(n)?r.setAttribute(`data-lexical-text`,`true`):V(n)&&r.setAttribute(`data-lexical-decorator`,`true`),B(n)){let e=n.__indent,t=n.__size;if(Bn(r,n),e!==0&&Rn(r,e),t!==0){let e=t-1;Hn(Kn(n,Dn),n,0,e,n.getDOMSlot(r))}let i=n.__format;i!==0&&zn(r,i),n.isInline()||Wn(null,n,r)}else{let t=n.getTextContent();if(V(n)){let t=n.decorate(xn,bn);t!==null&&Jn(e,t),r.contentEditable=`false`}k+=t}return t!==null&&t.insertChild(r),vs(kn,Sn,Cn,n,`created`),r}function Hn(e,t,n,r,i){let a=k;k=``;let o=n;for(;o<=r;++o){Vn(e[o],i);let t=Dn.get(e[o]);t!==null&&N(t)?An===null&&(An=t.getFormat(),jn=t.getStyle()):B(t)&&o<r&&!t.isInline()&&(k+=jt)}i.element.__lexicalTextContent=k,k=a+k}function Un(e,t){if(e){let n=e.__last;if(n){let e=t.get(n);if(e)return j(e)?`line-break`:V(e)&&e.isInline()?`decorator`:null}return`empty`}return null}function Wn(e,t,n){let r=Un(e,En),i=Un(t,Dn);r!==i&&t.getDOMSlot(n).setManagedLineBreak(i)}function Gn(e,t,n){var r;An=null,jn=null,function(e,t,n){let r=k,i=e.__size,a=t.__size;k=``;let o=n.element;if(i===1&&a===1){let n=e.__first,r=t.__first;if(n===r)qn(n,o);else{let e=Qn(n),t=Vn(r,null);try{o.replaceChild(t,e)}catch(i){if(typeof i==`object`&&i){let a=`${i.toString()} Parent: ${o.tagName}, new child: {tag: ${t.tagName} key: ${r}}, old child: {tag: ${e.tagName}, key: ${n}}.`;throw Error(a)}throw i}Pn(n,null)}let i=Dn.get(r);N(i)&&An===null&&(An=i.getFormat(),jn=i.getStyle())}else{let r=Kn(e,En),s=Kn(t,Dn);if(r.length!==i&&O(227),s.length!==a&&O(228),i===0)a!==0&&Hn(s,0,0,a-1,n);else if(a===0){if(i!==0){let e=n.after==null&&n.before==null&&n.element.__lexicalLineBreak==null;Fn(r,0,i-1,e?null:o),e&&(o.textContent=``)}}else(function(e,t,n,r,i,a){let o=r-1,s=i-1,c,l,u=a.getFirstChild(),d=0,f=0;for(;d<=o&&f<=s;){let e=t[d],r=n[f];if(e===r)u=Yn(qn(r,a.element)),d++,f++;else{if(l===void 0&&(l=Xn(n,f)),c===void 0)c=Xn(t,d);else if(!c.has(e)){d++;continue}if(!l.has(e)){u=Yn(Qn(e)),Pn(e,a.element),d++,c.delete(e);continue}if(c.has(r)){let e=Ss(xn,r);e!==u&&a.withBefore(u).insertChild(e),u=Yn(qn(r,a.element)),d++,f++}else Vn(r,a.withBefore(u)),f++}let i=Dn.get(r);i!==null&&N(i)?An===null&&(An=i.getFormat(),jn=i.getStyle()):B(i)&&f<=s&&!i.isInline()&&(k+=jt)}let p=d>o,m=f>s;if(p&&!m){let e=n[s+1],t=e===void 0?null:xn.getElementByKey(e);Hn(n,0,f,s,a.withBefore(t))}else m&&!p&&Fn(t,d,o,a.element)})(0,r,s,i,a,n)}o.__lexicalTextContent=k,k=r+k}(e,t,t.getDOMSlot(n)),r=t,An==null||An===r.__textFormat||Nn||r.setTextFormat(An),function(e){jn==null||jn===e.__textStyle||Nn||e.setTextStyle(jn)}(t)}function Kn(e,t){let n=[],r=e.__first;for(;r!==null;){let e=t.get(r);e===void 0&&O(101),n.push(r),r=e.__next}return n}function qn(e,t){let n=En.get(e),r=Dn.get(e);n!==void 0&&r!==void 0||O(61);let i=Mn||Tn.has(e)||wn.has(e),a=Ss(xn,e);if(n===r&&!i){let e;if(B(n)){let t=a.__lexicalTextContent;typeof t==`string`?e=t:(e=n.getTextContent(),a.__lexicalTextContent=e)}else e=n.getTextContent();return k+=e,a}if(n!==r&&i&&vs(kn,Sn,Cn,r,`updated`),r.updateDOM(n,a,bn)){let n=Vn(e,null);return t===null&&O(62),t.replaceChild(n,a),Pn(e,null),n}if(B(n)){B(r)||O(334,e);let t=r.__indent;(Mn||t!==n.__indent)&&Rn(a,t);let o=r.__format;if((Mn||o!==n.__format)&&zn(a,o),i)Gn(n,r,a),H(r)||r.isInline()||Wn(n,r,a);else{let e=a.__lexicalTextContent,t;typeof e==`string`?t=e:(t=n.getTextContent(),a.__lexicalTextContent=t),k+=t}if((Mn||r.__dir!==n.__dir)&&(Bn(a,r),H(r)&&!Mn))for(let e of r.getChildren())B(e)&&Bn(Ss(xn,e.getKey()),e)}else{let t=r.getTextContent();if(V(r)){let t=r.decorate(xn,bn);t!==null&&Jn(e,t)}k+=t}if(!Nn&&H(r)&&r.__cachedText!==k){let e=r.getWritable();e.__cachedText=k,r=e}return a}function Jn(e,t){let n=xn._pendingDecorators,r=xn._decorators;if(n===null){if(r[e]===t)return;n=Qo(xn)}n[e]=t}function Yn(e){let t=e.nextSibling;return t!==null&&t===xn._blockCursorElement&&(t=t.nextSibling),t}function Xn(e,t){let n=new Set;for(let r=t;r<e.length;r++)n.add(e[r]);return n}function Zn(e,t,n,r,i,a){k=``,Mn=r===2,xn=n,bn=n._config,Sn=n._nodes,Cn=xn._listeners.mutation,wn=i,Tn=a,En=e._nodeMap,Dn=t._nodeMap,Nn=t._readOnly,On=new Map(n._keyToDOMMap);let o=new Map;return kn=o,qn(`root`,null),xn=void 0,Sn=void 0,wn=void 0,Tn=void 0,En=void 0,Dn=void 0,bn=void 0,On=void 0,kn=void 0,o}function Qn(e){let t=On.get(e);return t===void 0&&O(75,e),t}function A(e){return{type:e}}var $n=A(`SELECTION_CHANGE_COMMAND`),er=A(`SELECTION_INSERT_CLIPBOARD_NODES_COMMAND`),tr=A(`CLICK_COMMAND`),nr=A(`BEFORE_INPUT_COMMAND`),rr=A(`INPUT_COMMAND`),ir=A(`COMPOSITION_START_COMMAND`),ar=A(`COMPOSITION_END_COMMAND`),or=A(`DELETE_CHARACTER_COMMAND`),sr=A(`INSERT_LINE_BREAK_COMMAND`),cr=A(`INSERT_PARAGRAPH_COMMAND`),lr=A(`CONTROLLED_TEXT_INSERTION_COMMAND`),ur=A(`PASTE_COMMAND`),dr=A(`REMOVE_TEXT_COMMAND`),fr=A(`DELETE_WORD_COMMAND`),pr=A(`DELETE_LINE_COMMAND`),mr=A(`FORMAT_TEXT_COMMAND`),hr=A(`UNDO_COMMAND`),gr=A(`REDO_COMMAND`),_r=A(`KEYDOWN_COMMAND`),vr=A(`KEY_ARROW_RIGHT_COMMAND`),yr=A(`MOVE_TO_END`),br=A(`KEY_ARROW_LEFT_COMMAND`),xr=A(`MOVE_TO_START`),Sr=A(`KEY_ARROW_UP_COMMAND`),Cr=A(`KEY_ARROW_DOWN_COMMAND`),wr=A(`KEY_ENTER_COMMAND`),Tr=A(`KEY_SPACE_COMMAND`),Er=A(`KEY_BACKSPACE_COMMAND`),Dr=A(`KEY_ESCAPE_COMMAND`),Or=A(`KEY_DELETE_COMMAND`),kr=A(`KEY_TAB_COMMAND`),Ar=A(`INSERT_TAB_COMMAND`),jr=A(`INDENT_CONTENT_COMMAND`),Mr=A(`OUTDENT_CONTENT_COMMAND`),Nr=A(`DROP_COMMAND`),Pr=A(`FORMAT_ELEMENT_COMMAND`),Fr=A(`DRAGSTART_COMMAND`),Ir=A(`DRAGOVER_COMMAND`),Lr=A(`DRAGEND_COMMAND`),Rr=A(`COPY_COMMAND`),zr=A(`CUT_COMMAND`),Br=A(`SELECT_ALL_COMMAND`),Vr=A(`CLEAR_EDITOR_COMMAND`),Hr=A(`CLEAR_HISTORY_COMMAND`),Ur=A(`CAN_REDO_COMMAND`),Wr=A(`CAN_UNDO_COMMAND`),Gr=A(`FOCUS_COMMAND`),Kr=A(`BLUR_COMMAND`),qr=A(`KEY_MODIFIER_COMMAND`),Jr=Object.freeze({}),Yr=[[`keydown`,function(e,t){Xr=e.timeStamp,Zr=e.key,!t.isComposing()&&q(t,_r,e)}],[`pointerdown`,function(e,t){let n=e.target,r=e.pointerType;Bs(n)&&r!==`touch`&&r!==`pen`&&e.button===0&&io(t,()=>{Ao(n)||(ri=!0)})}],[`compositionstart`,function(e,t){q(t,ir,e)}],[`compositionend`,function(e,t){pt?ai=!0:gt||!ht&&!bt?q(t,ar,e):(oi=!0,si=e.data)}],[`input`,function(e,t){e.stopPropagation(),io(t,()=>{t.dispatchCommand(rr,e)},{event:e}),$r=null}],[`click`,function(e,t){io(t,()=>{let n=F(),r=Ls(ks(t)),i=Da();if(r){if(P(n)){let t=n.anchor,a=t.getNode();if(t.type===`element`&&t.offset===0&&n.isCollapsed()&&!H(a)&&G().getChildrenSize()===1&&a.getTopLevelElementOrThrow().isEmpty()&&i!==null&&n.is(i))r.removeAllRanges(),n.dirty=!0;else if(e.detail===3&&!n.isCollapsed()&&a!==n.focus.getNode()){let e=nc(a,e=>B(e)&&!e.isInline());B(e)&&e.select(0)}}else if(e.pointerType===`touch`||e.pointerType===`pen`){let n=r.anchorNode;(J(n)||zo(n))&&ts(Ea(i,r,t,e))}}q(t,tr,e)})}],[`cut`,Jr],[`copy`,Jr],[`dragstart`,Jr],[`dragover`,Jr],[`dragend`,Jr],[`paste`,Jr],[`focus`,Jr],[`blur`,Jr],[`drop`,Jr]];mt&&Yr.push([`beforeinput`,(e,t)=>function(e,t){let n=e.inputType;n===`deleteCompositionText`||pt&&xs(t)||n!==`insertCompositionText`&&q(t,nr,e)}(e,t)]);var Xr=0,Zr=null,Qr=0,$r=null,ei=new WeakMap,ti=new WeakMap,ni=!1,ri=!1,ii=!1,ai=!1,oi=!1,si=``,ci=null,li=[0,``,0,`root`,0];function ui(e,t,n,r,i){let a=e.anchor,o=e.focus,s=a.getNode(),c=z(),l=Ls(ks(c)),u=l===null?null:l.anchorNode,d=a.key,f=c.getElementByKey(d),p=n.length;return d!==o.key||!N(s)||(!i&&(!mt||Qr<r+50)||s.isDirty()&&p<2||rs(n))&&a.offset!==o.offset&&!s.isComposing()||Ro(s)||s.isDirty()&&p>1||(i||!mt)&&f!==null&&!s.isComposing()&&u!==Vo(f)||l!==null&&t!==null&&(!t.collapsed||t.startContainer!==l.anchorNode||t.startOffset!==l.anchorOffset)||!s.isComposing()&&(s.getFormat()!==e.format||s.getStyle()!==e.style)||function(e,t){if(t.isSegmented())return!0;if(!e.isCollapsed())return!1;let n=e.anchor.offset,r=t.getParentOrThrow(),i=Lo(t);return n===0?!t.canInsertTextBefore()||!r.canInsertTextBefore()&&!t.isComposing()||i||function(e){let t=e.getPreviousSibling();return(N(t)||B(t)&&t.isInline())&&!t.canInsertTextAfter()}(t):n===t.getTextContentSize()&&(!t.canInsertTextAfter()||!r.canInsertTextAfter()&&!t.isComposing()||i)}(e,s)}function di(e,t){return zo(e)&&e.nodeValue!==null&&t!==0&&t!==e.nodeValue.length}function fi(e,t,n){let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=e;ni&&(ni=!1,di(r,i)&&di(a,o)&&!ci)||io(t,()=>{if(!n)return void ts(null);if(!Mo(t,r,a))return;let s=F();if(ci&&P(s)&&s.isCollapsed()){let e=s.anchor,t=ci.anchor;(e.key===t.key&&e.offset===t.offset+1||e.offset===1&&t.getNode().is(e.getNode().getPreviousSibling()))&&(s=ci.clone(),ts(s))}if(ci=null,P(s)){let n=s.anchor,r=n.getNode();if(s.isCollapsed()){e.type===`Range`&&e.anchorNode===e.focusNode&&(s.dirty=!0);let i=ks(t).event,a=i?i.timeStamp:performance.now(),[o,c,l,u,d]=li,f=G(),p=!1===t.isComposing()&&f.getTextContent()===``;if(a<d+200&&n.offset===l&&n.key===u)pi(s,o,c);else if(n.type===`text`)N(r)||O(141),mi(s,r);else if(n.type===`element`&&!p){B(r)||O(259);let e=n.getNode();e.isEmpty()?function(e,t){pi(e,t.getTextFormat(),t.getTextStyle())}(s,e):pi(s,0,``)}}else{let e=n.key,t=s.focus.key,r=s.getNodes(),a=r.length,c=s.isBackward(),l=c?o:i,u=c?i:o,d=c?t:e,f=c?e:t,p=2047,m=!1;for(let e=0;e<a;e++){let t=r[e],n=t.getTextContentSize();if(N(t)&&n!==0&&!(e===0&&t.__key===d&&l===n||e===a-1&&t.__key===f&&u===0)&&(m=!0,p&=t.getFormat(),p===0))break}s.format=m?p:0}}q(t,$n,void 0)})}function pi(e,t,n){e.format===t&&e.style===n||(e.format=t,e.style=n,e.dirty=!0)}function mi(e,t){pi(e,t.getFormat(),t.getStyle())}function hi(e){if(!e.getTargetRanges)return null;let t=e.getTargetRanges();return t.length===0?null:t[0]}function gi(e){let t=e.inputType,n=hi(e),r=z(),i=F();if(t===`deleteContentBackward`){if(i===null){let e=Da();if(!P(e))return!0;ts(e.clone())}if(P(i)){let t=i.anchor.key===i.focus.key;if(a=e.timeStamp,Zr===`MediaLast`&&a<Xr+30&&r.isComposing()&&t){if(qo(null),Xr=0,setTimeout(()=>{io(r,()=>{qo(null)})},30),P(i)){let e=i.anchor.getNode();e.markDirty(),N(e)||O(142),mi(i,e)}}else{qo(null),e.preventDefault();let n=i.anchor.getNode(),a=n.getTextContent(),o=n.canInsertTextAfter(),s=i.anchor.offset===0&&i.focus.offset===a.length,c=yt&&t&&!s&&o;if(c&&i.isCollapsed()&&(c=!V(bs(i.anchor,!0))),!c){q(r,or,!0);let e=F();yt&&P(e)&&e.isCollapsed()&&(ci=e,setTimeout(()=>ci=null))}}return!0}}var a;if(!P(i))return!0;let o=e.data;$r!==null&&ss(!1,r,$r),i.dirty&&$r===null||!i.isCollapsed()||H(i.anchor.getNode())||n===null||i.applyDOMRange(n),$r=null;let s=i.anchor,c=i.focus,l=s.getNode(),u=c.getNode();if(t===`insertText`||t===`insertTranspose`){if(o===`
4
4
  `)e.preventDefault(),q(r,sr,!1);else if(o===jt)e.preventDefault(),q(r,cr,void 0);else if(o==null&&e.dataTransfer){let t=e.dataTransfer.getData(`text/plain`);e.preventDefault(),i.insertRawText(t)}else o!=null&&ui(i,n,o,e.timeStamp,!0)?(e.preventDefault(),q(r,lr,o)):$r=o;return Qr=e.timeStamp,!0}switch(e.preventDefault(),t){case`insertFromYank`:case`insertFromDrop`:case`insertReplacementText`:q(r,lr,e);break;case`insertFromComposition`:qo(null),q(r,lr,e);break;case`insertLineBreak`:qo(null),q(r,sr,!1);break;case`insertParagraph`:qo(null),ii&&!gt?(ii=!1,q(r,sr,!1)):q(r,cr,void 0);break;case`insertFromPaste`:case`insertFromPasteAsQuotation`:q(r,ur,e);break;case`deleteByComposition`:(function(e,t){return e!==t||B(e)||B(t)||!Lo(e)||!Lo(t)})(l,u)&&q(r,dr,e);break;case`deleteByDrag`:case`deleteByCut`:q(r,dr,e);break;case`deleteContent`:q(r,or,!1);break;case`deleteWordBackward`:q(r,fr,!0);break;case`deleteWordForward`:q(r,fr,!1);break;case`deleteHardLineBackward`:case`deleteSoftLineBackward`:q(r,pr,!0);break;case`deleteContentForward`:case`deleteHardLineForward`:case`deleteSoftLineForward`:q(r,pr,!1);break;case`formatStrikeThrough`:q(r,mr,`strikethrough`);break;case`formatBold`:q(r,mr,`bold`);break;case`formatItalic`:q(r,mr,`italic`);break;case`formatUnderline`:q(r,mr,`underline`);break;case`historyUndo`:q(r,hr,void 0);break;case`historyRedo`:q(r,gr,void 0)}return!0}function _i(e){if(J(e.target)&&Ao(e.target))return!0;let t=z(),n=F(),r=e.data,i=hi(e);if(r!=null&&P(n)&&ui(n,i,r,e.timeStamp,!1)){ai&&=(bi(t,r),!1);let i=n.anchor.getNode(),a=Ls(ks(t));if(a===null)return!0;let o=n.isBackward(),s=o?n.anchor.offset:n.focus.offset,c=o?n.focus.offset:n.anchor.offset;mt&&!n.isCollapsed()&&N(i)&&a.anchorNode!==null&&i.getTextContent().slice(0,s)+r+i.getTextContent().slice(s+c)===os(a.anchorNode)||q(t,lr,r);let l=r.length;pt&&l>1&&e.inputType===`insertCompositionText`&&!t.isComposing()&&(n.anchor.offset-=l),yt&&t.isComposing()&&(Xr=0,qo(null))}else ss(!1,t,r===null?void 0:r),ai&&=(bi(t,r||void 0),!1);return function(){R(),$t(z())}(),!0}function vi(e){let t=z(),n=F();if(P(n)&&!t.isComposing()){let r=n.anchor,i=n.anchor.getNode();qo(r.key),Ts(Fi),(e.timeStamp<Xr+30||r.type===`element`||!n.isCollapsed()||i.getFormat()!==n.format||N(i)&&i.getStyle()!==n.style)&&q(t,lr,Mt)}return!0}function yi(e){return bi(z(),e.data),Ts(Ii),!0}function bi(e,t){let n=e._compositionKey;if(qo(null),n!==null&&t!=null){if(t===``){let t=W(n),r=Vo(e.getElementByKey(n));if(r!==null&&r.nodeValue!==null&&N(t)){let n=Ls(ks(e)),i=null,a=null;n!==null&&n.anchorNode===r&&(i=n.anchorOffset,a=n.focusOffset),cs(t,r.nodeValue,i,a,!0)}return}if(t[t.length-1]===`
@@ -1,2 +1,2 @@
1
- import{$ as e,B as t,H as n,I as r,L as i,N as a,O as o,P as s,U as c,X as l,Z as u,a as d,ct as f,k as p,nt as m,ot as h,w as g,z as _}from"./index-BF4zUlWZ.js";var v={key:0},y={class:`error-header`},b={class:`error-message`},x={class:`error-location`},S={class:`error-line-badge`},C={key:0,class:`error-code-block`},w={class:`line-number`},T={key:1},E=d({__name:`ErrorPage`,setup(d){let E=o(),D=p(),O=r(()=>{try{return E.query.data?JSON.parse(E.query.data):null}catch{return null}});async function k(){let e=await g();e.error?D.replace({name:`error`,query:{data:JSON.stringify(e.error)}}):(D.push(`/`),window.location.reload())}return(r,o)=>{let d=e(`router-link`);return O.value?(l(),t(`div`,v,[i(`header`,null,[i(`article`,y,[o[1]||=i(`h3`,null,[i(`i`,{class:`iconoir-warning-triangle`}),n(` Error `)],-1),i(`p`,b,f(O.value.error),1),i(`p`,x,[o[0]||=i(`i`,{class:`iconoir-page`},null,-1),n(` `+f(O.value.path)+` `,1),i(`span`,S,`Line `+f(O.value.line_no),1)])]),i(`a`,{href:`#`,class:`reload-btn`,onClick:a(k,[`prevent`])},[...o[2]||=[i(`i`,{class:`iconoir-refresh`},null,-1),n(` Reload `,-1)]])]),O.value.context?(l(),t(`div`,C,[i(`pre`,null,[i(`code`,null,[(l(!0),t(s,null,u(O.value.context,e=>(l(),t(`span`,{key:e.line_no,class:h(e.selected?`error-line`:`code-line`)},[i(`span`,w,f(String(e.line_no).padStart(4,` `)),1),n(f(e.content)+`
1
+ import{$ as e,B as t,H as n,I as r,L as i,N as a,O as o,P as s,U as c,X as l,Z as u,a as d,ct as f,k as p,nt as m,ot as h,w as g,z as _}from"./index-1Vr7UBrY.js";var v={key:0},y={class:`error-header`},b={class:`error-message`},x={class:`error-location`},S={class:`error-line-badge`},C={key:0,class:`error-code-block`},w={class:`line-number`},T={key:1},E=d({__name:`ErrorPage`,setup(d){let E=o(),D=p(),O=r(()=>{try{return E.query.data?JSON.parse(E.query.data):null}catch{return null}});async function k(){let e=await g();e.error?D.replace({name:`error`,query:{data:JSON.stringify(e.error)}}):(D.push(`/`),window.location.reload())}return(r,o)=>{let d=e(`router-link`);return O.value?(l(),t(`div`,v,[i(`header`,null,[i(`article`,y,[o[1]||=i(`h3`,null,[i(`i`,{class:`iconoir-warning-triangle`}),n(` Error `)],-1),i(`p`,b,f(O.value.error),1),i(`p`,x,[o[0]||=i(`i`,{class:`iconoir-page`},null,-1),n(` `+f(O.value.path)+` `,1),i(`span`,S,`Line `+f(O.value.line_no),1)])]),i(`a`,{href:`#`,class:`reload-btn`,onClick:a(k,[`prevent`])},[...o[2]||=[i(`i`,{class:`iconoir-refresh`},null,-1),n(` Reload `,-1)]])]),O.value.context?(l(),t(`div`,C,[i(`pre`,null,[i(`code`,null,[(l(!0),t(s,null,u(O.value.context,e=>(l(),t(`span`,{key:e.line_no,class:h(e.selected?`error-line`:`code-line`)},[i(`span`,w,f(String(e.line_no).padStart(4,` `)),1),n(f(e.content)+`
2
2
  `,1)],2))),128))])])])):_(``,!0)])):(l(),t(`div`,T,[o[4]||=i(`p`,null,`No error data available.`,-1),c(d,{to:`/`},{default:m(()=>[...o[3]||=[n(`Back to home`,-1)]]),_:1})]))}}},[[`__scopeId`,`data-v-cb96d9d5`]]);export{E as default};
@@ -1 +1 @@
1
- import{B as e,J as t,K as n,L as r,X as i,Y as a,a as o,g as s,it as c}from"./index-BF4zUlWZ.js";import{t as l}from"./useGraphviz-Dnm2pkon.js";import{t as u}from"./usePanZoom-HxgEsqq2.js";var d={key:0},f={key:1,class:`graph-container graph-expand`},p=[`innerHTML`],m=o({__name:`GraphView`,setup(o){let m=c(``),h=c(!0),g=c(null),_=null;t(async()=>{let e=await s();m.value=e?await l(e):``,h.value=!1,await n(),v()}),a(()=>{_?.destroy()});function v(){if(!g.value)return;let e=g.value.querySelector(`svg`);e&&(_=u(e,g.value))}return(t,n)=>(i(),e(`article`,null,[n[1]||=r(`header`,null,[r(`h2`,null,`Architecture Overview`)],-1),h.value?(i(),e(`div`,d,[...n[0]||=[r(`p`,null,`Loading graph...`,-1)]])):(i(),e(`div`,f,[r(`div`,{id:`graphviz`,ref_key:`graphEl`,ref:g,class:`fullcanvas`,innerHTML:m.value},null,8,p)]))]))}},[[`__scopeId`,`data-v-dbc5bc1f`]]);export{m as default};
1
+ import{B as e,J as t,K as n,L as r,X as i,Y as a,a as o,g as s,it as c}from"./index-1Vr7UBrY.js";import{t as l}from"./useGraphviz-Dnm2pkon.js";import{t as u}from"./usePanZoom-HxgEsqq2.js";var d={key:0},f={key:1,class:`graph-container graph-expand`},p=[`innerHTML`],m=o({__name:`GraphView`,setup(o){let m=c(``),h=c(!0),g=c(null),_=null;t(async()=>{let e=await s();m.value=e?await l(e):``,h.value=!1,await n(),v()}),a(()=>{_?.destroy()});function v(){if(!g.value)return;let e=g.value.querySelector(`svg`);e&&(_=u(e,g.value))}return(t,n)=>(i(),e(`article`,null,[n[1]||=r(`header`,null,[r(`h2`,null,`Architecture Overview`)],-1),h.value?(i(),e(`div`,d,[...n[0]||=[r(`p`,null,`Loading graph...`,-1)]])):(i(),e(`div`,f,[r(`div`,{id:`graphviz`,ref_key:`graphEl`,ref:g,class:`fullcanvas`,innerHTML:m.value},null,8,p)]))]))}},[[`__scopeId`,`data-v-dbc5bc1f`]]);export{m as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["vue/GraphView-CoqAjFdR.js","vue/index-BF4zUlWZ.js","vue/mermaid-C3bOamfn.js","vue/rolldown-runtime-COiEfhsA.js","vue/index-BO59Fbpf.css","vue/useGraphviz-Dnm2pkon.js","vue/usePanZoom-HxgEsqq2.js","vue/GraphView-BvWAbUAl.css"])))=>i.map(i=>d[i]);
2
- import{M as e}from"./mermaid-C3bOamfn.js";import{B as t,G as n,I as r,L as i,R as a,W as o,X as s,at as c}from"./index-BF4zUlWZ.js";import{n as l}from"./PageView-CirIXjW6.js";var u={key:2},d={__name:`HomePage`,setup(d){let f=o(()=>e(()=>import(`./GraphView-CoqAjFdR.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))),p=n(`pages`,null),m=n(`pageHome`,null),h=r(()=>p?.value!=null),g=r(()=>m?.value);return(e,n)=>g.value?(s(),a(l,{key:0,name:g.value.name},null,8,[`name`])):h.value?(s(),a(c(f),{key:1})):(s(),t(`article`,u,[...n[0]||=[i(`p`,null,`Loading...`,-1)]]))}};export{d as default};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["vue/GraphView-cjbSm9VK.js","vue/index-1Vr7UBrY.js","vue/mermaid-C3bOamfn.js","vue/rolldown-runtime-COiEfhsA.js","vue/index-MTJVvg_J.css","vue/useGraphviz-Dnm2pkon.js","vue/usePanZoom-HxgEsqq2.js","vue/GraphView-BvWAbUAl.css"])))=>i.map(i=>d[i]);
2
+ import{M as e}from"./mermaid-C3bOamfn.js";import{B as t,G as n,I as r,L as i,R as a,W as o,X as s,at as c}from"./index-1Vr7UBrY.js";import{n as l}from"./PageView-I-RdgItl.js";var u={key:2},d={__name:`HomePage`,setup(d){let f=o(()=>e(()=>import(`./GraphView-cjbSm9VK.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))),p=n(`pages`,null),m=n(`pageHome`,null),h=r(()=>p?.value!=null),g=r(()=>m?.value);return(e,n)=>g.value?(s(),a(l,{key:0,name:g.value.name},null,8,[`name`])):h.value?(s(),a(c(f),{key:1})):(s(),t(`article`,u,[...n[0]||=[i(`p`,null,`Loading...`,-1)]]))}};export{d as default};