diff --git a/forge/e2e/helpers/constants.ts b/forge/e2e/helpers/constants.ts new file mode 100644 index 00000000..d1e62386 --- /dev/null +++ b/forge/e2e/helpers/constants.ts @@ -0,0 +1,13 @@ +/** + * Constants for Forge/Sterling e2e tests. + * Centralizes magic values so representation changes only need one update. + */ + +// Boolean display values (Racket uses #t/#f format) +export const BOOL_TRUE = '#t'; +export const BOOL_FALSE = '#f'; + +// Common timeout values (ms) +export const TIMEOUT_GRAPH_LAYOUT = 2000; +export const TIMEOUT_EVAL_RESULT = 1500; +export const TIMEOUT_ELEMENT_VISIBLE = 5000; diff --git a/forge/e2e/tests/sterling-evaluator.spec.ts b/forge/e2e/tests/sterling-evaluator.spec.ts index 7683e169..63a67ff2 100644 --- a/forge/e2e/tests/sterling-evaluator.spec.ts +++ b/forge/e2e/tests/sterling-evaluator.spec.ts @@ -1,5 +1,136 @@ -import { test, expect } from '@playwright/test'; +import { test, expect, Page, Locator } from '@playwright/test'; import { startForge, ForgeInstance, selectAndRunCommand } from '../helpers/forge-runner'; +import { BOOL_TRUE, BOOL_FALSE, TIMEOUT_GRAPH_LAYOUT, TIMEOUT_EVAL_RESULT, TIMEOUT_ELEMENT_VISIBLE } from '../helpers/constants'; + +/** + * Helper class to interact with Sterling's evaluator panel. + * + * IMPORTANT: We cannot reliably scope assertions to the evaluator panel because + * Sterling's DOM structure may vary. Instead, we use these strategies: + * + * 1. For expressions: Count the expression text (e.g., "`Node0") which is unique + * to the evaluator since backticks don't appear in graph labels. + * + * 2. For boolean results: Count #t/#f which only appear in evaluator results. + * + * 3. For atom/set results: We can only verify the expression was processed + * (appears in history) and no error occurred. We cannot distinguish result + * atoms from graph atoms. + */ +class EvaluatorHelper { + private page: Page; + private input: Locator; + + constructor(page: Page) { + this.page = page; + this.input = page.getByPlaceholder('Enter an expression'); + } + + async waitForVisible(): Promise { + await expect(this.input).toBeVisible({ timeout: TIMEOUT_ELEMENT_VISIBLE }); + } + + /** + * Count occurrences of exact text on the page. + */ + async countOnPage(text: string): Promise { + return await this.page.getByText(text, { exact: true }).count(); + } + + /** + * Evaluate an expression and wait for result. + */ + async evaluate(expr: string): Promise { + await this.input.fill(expr); + await this.input.press('Enter'); + await this.page.waitForTimeout(TIMEOUT_EVAL_RESULT); + } + + /** + * Check that no error indicators are visible. + * Uses specific patterns that indicate actual errors, avoiding false matches + * on benign text like "0 errors" or help text. + */ + async expectNoError(): Promise { + // Check for error-styled elements (red text, error classes) rather than just text + // These patterns are more specific to actual error states + const errorIndicators = [ + // Exact error message patterns (case-sensitive to avoid "0 errors") + 'Error:', + 'Error evaluating', + 'evaluation failed', + 'Parse error', + 'Syntax error', + ]; + + for (const errorText of errorIndicators) { + const errorVisible = await this.page.getByText(errorText).first().isVisible().catch(() => false); + expect(errorVisible, `Unexpected error: found '${errorText}'`).toBe(false); + } + } + + /** + * Verify that evaluating an expression adds it to the history. + * The expression text (especially with backticks) is unique to the evaluator. + * + * @param expr - The expression to evaluate + * @param description - Test description for error messages + * @param expectedResult - Optional: expected result text to verify (must be evaluator-unique) + */ + async evaluateAndVerifyInHistory(expr: string, description: string, expectedResult?: string): Promise { + const countBefore = await this.countOnPage(expr); + const resultCountBefore = expectedResult ? await this.countOnPage(expectedResult) : 0; + + await this.evaluate(expr); + + const countAfter = await this.countOnPage(expr); + expect(countAfter, `${description}: expression '${expr}' should appear in history`).toBeGreaterThan(countBefore); + + if (expectedResult) { + const resultCountAfter = await this.countOnPage(expectedResult); + if (resultCountAfter <= resultCountBefore) { + // Capture what's actually on the page for debugging + const pageText = await this.page.locator('body').innerText(); + // Find lines containing the expression to show nearby context + const lines = pageText.split('\n'); + const relevantLines = lines.filter(line => line.includes(expr) || line.includes('Node')); + const context = relevantLines.slice(0, 10).join('\n'); + + const errorMsg = + `${description}: expected result '${expectedResult}' not found.\n` + + `Expression '${expr}' was evaluated.\n` + + `Expected '${expectedResult}' count to increase from ${resultCountBefore}, but got ${resultCountAfter}.\n` + + `Relevant page content:\n${context}\n` + + `(Check screenshot for full evaluator output)`; + + expect(resultCountAfter, errorMsg).toBeGreaterThan(resultCountBefore); + } + } + + await this.expectNoError(); + } + + /** + * Verify that evaluating a boolean formula produces the expected result. + * #t and #f are unique to evaluator output (don't appear in graph). + */ + async evaluateAndExpectBool(expr: string, expectedBool: string, description: string): Promise { + const exprCountBefore = await this.countOnPage(expr); + const boolCountBefore = await this.countOnPage(expectedBool); + + await this.evaluate(expr); + + // Verify expression was added to history + const exprCountAfter = await this.countOnPage(expr); + expect(exprCountAfter, `${description}: expression should appear in history`).toBeGreaterThan(exprCountBefore); + + // Verify correct boolean result appeared (#t/#f are evaluator-specific) + const boolCountAfter = await this.countOnPage(expectedBool); + expect(boolCountAfter, `${description}: expected '${expectedBool}' result`).toBeGreaterThan(boolCountBefore); + + await this.expectNoError(); + } +} test.describe('Sterling Evaluator', () => { let forge: ForgeInstance; @@ -10,88 +141,81 @@ test.describe('Sterling Evaluator', () => { } }); - test('can open the evaluator panel', async ({ page }) => { - forge = await startForge('e2e/fixtures/simple-graph.frg'); - await page.goto(forge.sterlingUrl); - - // Must run a command first to have an instance to evaluate + /** + * Helper to set up a test: open Sterling, run a command, open evaluator. + * @param page - Playwright page + * @param forgeInstance - The Forge instance (must be started before calling) + */ + async function setupEvaluator(page: Page, forgeInstance: ForgeInstance): Promise { + await page.goto(forgeInstance.sterlingUrl); await selectAndRunCommand(page, 'simpleRun'); + await page.waitForTimeout(TIMEOUT_GRAPH_LAYOUT); - // Wait for graph layout to finish - await page.waitForTimeout(2000); - - // The Evaluator is a sidebar tab on the right - click it - // It's displayed as vertical text "Evaluator" in a tab button const evaluatorTab = page.getByText('Evaluator', { exact: true }).first(); - await expect(evaluatorTab).toBeVisible({ timeout: 5000 }); + await expect(evaluatorTab).toBeVisible({ timeout: TIMEOUT_ELEMENT_VISIBLE }); await evaluatorTab.click(); - // After clicking, the EVALUATOR panel should open - await expect(page.getByPlaceholder('Enter an expression')).toBeVisible({ timeout: 5000 }); - }); + const helper = new EvaluatorHelper(page); + await helper.waitForVisible(); + return helper; + } - test('can evaluate a simple expression', async ({ page }) => { + test('can open the evaluator panel', async ({ page }) => { forge = await startForge('e2e/fixtures/simple-graph.frg'); - await page.goto(forge.sterlingUrl); - - // Run a command first - await selectAndRunCommand(page, 'simpleRun'); - - // Wait for graph layout to finish - await page.waitForTimeout(2000); - - // Open evaluator panel - const evaluatorTab = page.getByText('Evaluator', { exact: true }).first(); - await evaluatorTab.click(); - await expect(page.getByPlaceholder('Enter an expression')).toBeVisible({ timeout: 5000 }); + await setupEvaluator(page, forge); + // setupEvaluator already verifies the evaluator input is visible + }); - // Find input field in evaluator - placeholder is "Enter an expression..." - const evaluatorInput = page.getByPlaceholder('Enter an expression'); - await expect(evaluatorInput).toBeVisible({ timeout: 5000 }); + test('sig expression evaluates without error', async ({ page }) => { + forge = await startForge('e2e/fixtures/simple-graph.frg'); + const evaluator = await setupEvaluator(page, forge); - // Type a simple expression - "Node" should return all Node atoms - await evaluatorInput.fill('Node'); - await evaluatorInput.press('Enter'); + // Evaluate "Node" - we can only verify no error occurs + // (result atoms are indistinguishable from graph atoms) + await evaluator.evaluate('Node'); + await evaluator.expectNoError(); + }); - // Wait for result - await page.waitForTimeout(2000); + test('relation expression evaluates without error', async ({ page }) => { + forge = await startForge('e2e/fixtures/simple-graph.frg'); + const evaluator = await setupEvaluator(page, forge); - // The result should contain Node references - look for Node0, Node1, or Node2 - await expect(page.getByText(/Node[012]/).first()).toBeVisible({ timeout: 5000 }); + // Evaluate "edges" - we can only verify no error occurs + // (result tuples are indistinguishable from graph edges) + await evaluator.evaluate('edges'); + await evaluator.expectNoError(); }); - test('evaluator shows result for edges relation', async ({ page }) => { + // --- Atom-specific evaluator tests --- + // These tests ensure backtick atoms work correctly in the Sterling evaluator. + // Combined into one test to avoid expensive Forge/Sterling startup for each case. + + test('can evaluate atom expressions and formulas', async ({ page }) => { forge = await startForge('e2e/fixtures/simple-graph.frg'); - await page.goto(forge.sterlingUrl); + const evaluator = await setupEvaluator(page, forge); - // Run a command first - await selectAndRunCommand(page, 'simpleRun'); + // Test 1: Single atom expression - backtick expression appears in history + await evaluator.evaluateAndVerifyInHistory('`Node0', 'Single atom', '`Node0'); - // Wait for graph layout to finish - await page.waitForTimeout(2000); + // Test 2: Atom join expression - `Node0.edges (result depends on instance) + await evaluator.evaluateAndVerifyInHistory('`Node0.edges', 'Atom join'); - // Open evaluator panel - const evaluatorTab = page.getByText('Evaluator', { exact: true }).first(); - await evaluatorTab.click(); - await expect(page.getByPlaceholder('Enter an expression')).toBeVisible({ timeout: 5000 }); + // Test 3: Atom membership formula - `Node0 in Node should be true + await evaluator.evaluateAndExpectBool('`Node0 in Node', BOOL_TRUE, 'Atom membership (true)'); - // Count how many result entries exist before evaluation - const resultsBefore = await page.locator('text=/Node\\d.*→.*Node\\d/').count(); + // Test 4: Atom equality formula - `Node0 = `Node0 should be true + await evaluator.evaluateAndExpectBool('`Node0 = `Node0', BOOL_TRUE, 'Atom self-equality (true)'); - // Find input field and evaluate the edges relation - const evaluatorInput = page.getByPlaceholder('Enter an expression'); - await evaluatorInput.fill('edges'); - await evaluatorInput.press('Enter'); + // Test 5: Atom inequality formula - `Node0 != `Node1 should be true + await evaluator.evaluateAndExpectBool('`Node0 != `Node1', BOOL_TRUE, 'Atom inequality (true)'); - // Wait for result - await page.waitForTimeout(2000); + // Test 6: Atom equality with different atoms - should be FALSE + await evaluator.evaluateAndExpectBool('`Node0 = `Node1', BOOL_FALSE, 'Different atoms equality (false)'); - // The evaluator should show tuple results like "Node0 → Node1" for edges - // Since simpleRun requires "some edges", there should be at least one tuple - const resultsAfter = await page.locator('text=/Node\\d/').count(); + // Test 7: Atom in set union - backtick expression appears in history + await evaluator.evaluateAndVerifyInHistory('`Node0 + `Node1', 'Set union', '((Node0) (Node1))'); - // There should be more Node references after evaluation (the result tuples) - // Or at minimum, the evaluator panel should show the edges expression was processed - expect(resultsAfter).toBeGreaterThan(0); + // Test 8: Atom in product - backtick expression appears in history + await evaluator.evaluateAndVerifyInHistory('`Node0 -> `Node1', 'Product', '((Node0 Node1))'); }); }); diff --git a/forge/lang/ast.rkt b/forge/lang/ast.rkt index c8dc2ecd..95891c73 100644 --- a/forge/lang/ast.rkt +++ b/forge/lang/ast.rkt @@ -1348,10 +1348,13 @@ "unknown:?:?")) (define (raise-forge-error #:msg [msg "error"] #:context [context #f] #:raise? [raise? #t]) - (if raise? + (if raise? (raise-user-error (format "[~a] ~a" (pretty-loc context) msg)) (fprintf (current-error-port) "[~a] ~a" (pretty-loc context) msg))) +(define (raise-forge-warning #:msg [msg "warning"] #:context [context #f]) + (fprintf (current-error-port) "Warning: [~a] ~a~n" (pretty-loc context) msg)) + ; Helper for other locations we might need to generate a nodeinfo struct from a variety ; of datatype possibilities. (define (build-nodeinfo context) diff --git a/forge/lang/expander.rkt b/forge/lang/expander.rkt index c23e60be..566fb4ff 100644 --- a/forge/lang/expander.rkt +++ b/forge/lang/expander.rkt @@ -20,7 +20,7 @@ (only-in pkg/lib pkg-directory) (only-in racket/path file-name-from-path find-relative-path normalize-path) (only-in racket/string string-replace string-join) - (only-in forge/lang/ast raise-forge-error)) + (only-in forge/lang/ast raise-forge-error raise-forge-warning)) syntax/srcloc racket/string (only-in syntax/modresolve resolve-module-path) @@ -1246,10 +1246,11 @@ (define-for-syntax (ensure-target-ref target-pred ex) (define tp (syntax-e target-pred)) (let ([ex-as-datum (syntax->datum ex)]) - (unless + (unless (memq tp (flatten ex-as-datum)) - (eprintf "Warning: ~a ~a:~a Test does not reference ~a.\n" - (syntax-source ex) (syntax-line ex) (syntax-column ex) tp)))) + (raise-forge-warning + #:msg (format "Test does not reference ~a." tp) + #:context ex)))) (define-syntax (NT-TestSuiteDecl stx) diff --git a/forge/server/forgeserver.rkt b/forge/server/forgeserver.rkt index 6bc8343e..01c1e1c8 100644 --- a/forge/server/forgeserver.rkt +++ b/forge/server/forgeserver.rkt @@ -442,11 +442,11 @@ #:context context)])) (define xml (get-xml inst)) - ; is-running? is about the _solver process itself_. + ; is-solver-process-alive? is about the _solver process itself_. ; is-run-closed? is about whether this specific run has been terminated ; Sat? is about whether the solution we have is Sat. (define response (make-sterling-data xml datum-id name temporal? - (and (is-running? the-run) (not (is-run-closed? the-run)) inst) + (and (is-solver-process-alive? the-run) (not (is-run-closed? the-run)) inst) old-datum-id)) (send-to-sterling response #:connection connection)] [else diff --git a/forge/sigs-structs.rkt b/forge/sigs-structs.rkt index 551ca30c..079547d4 100644 --- a/forge/sigs-structs.rkt +++ b/forge/sigs-structs.rkt @@ -674,19 +674,19 @@ Returns whether the given run resulted in sat or unsat, respectively. ; get-stdin :: Run -> input-port? (: get-stdin (-> Run Output-Port)) (define (get-stdin run) - (assert-is-running run) + (assert-solver-process-alive run) (Server-ports-stdin (Run-server-ports run))) ; get-stdout :: Run -> output-port? (: get-stdout (-> Run Input-Port)) (define (get-stdout run) - (assert-is-running run) + (assert-solver-process-alive run) (Server-ports-stdout (Run-server-ports run))) ; get-stderr :: Run -> output-port? (: get-stderr (-> Run Input-Port)) (define (get-stderr run) - (assert-is-running run) + (assert-solver-process-alive run) (Server-ports-stderr (Run-server-ports run))) ;;;;;;;;;;;;;;;;;;;;;;; @@ -710,39 +710,41 @@ Returns whether the given run resulted in sat or unsat, respectively. (member name-or-run (unbox closed-run-names))]))) ; close-run :: Run -> void +; Idempotent: safe to call multiple times on the same run. (: close-run (-> Run Void)) (define (close-run run) - (assert-is-running run) - (when (>= (get-verbosity) VERBOSITY_HIGH) - (printf "Clearing run ~a. Keeping engine process active...~n" (Run-name run))) - ; Cut off this Run's ability to query the solver, since it's about to be closed - ; This state is referenced in the instance-generator thunk - (add-closed-run-name! (Run-name run)) - - ; Since we're using a single process now, send it instructions to clear this run - ; Different backends will be cleared in different ways. - (define backend (get-option (Run-run-spec run) 'backend)) - (match backend - ['pardinus - (parameterize ([pardinus-port (get-stdin run)]) - (pardinus-clear (Run-name run)) - (flush-output (get-stdin run)))] - ['smtlibtor - (cvc5-smtlib-display (get-stdin run) "(reset)")] - [else - (raise-forge-error #:msg (format "Unsupported backend when closing solver run: ~a" backend) - #:context #f)])) - -; is-running :: Run -> Boolean -; This reports whether the _solver server_ is running; -; *NOT* whether an individual run is still open. -(: is-running? (-> Run Boolean)) -(define (is-running? run) + (unless (is-run-closed? run) + (assert-solver-process-alive run) + (when (>= (get-verbosity) VERBOSITY_HIGH) + (printf "Clearing run ~a. Keeping engine process active...~n" (Run-name run))) + ; Cut off this Run's ability to query the solver, since it's about to be closed + ; This state is referenced in the instance-generator thunk + (add-closed-run-name! (Run-name run)) + + ; Since we're using a single process now, send it instructions to clear this run + ; Different backends will be cleared in different ways. + (define backend (get-option (Run-run-spec run) 'backend)) + (match backend + ['pardinus + (parameterize ([pardinus-port (get-stdin run)]) + (pardinus-clear (Run-name run)) + (flush-output (get-stdin run)))] + ['smtlibtor + (cvc5-smtlib-display (get-stdin run) "(reset)")] + [else + (raise-forge-error #:msg (format "Unsupported backend when closing solver run: ~a" backend) + #:context #f)]))) + +; is-solver-process-alive? :: Run -> Boolean +; This reports whether the _solver server process_ is running; +; *NOT* whether an individual run is still open (use is-run-closed? for that). +(: is-solver-process-alive? (-> Run Boolean)) +(define (is-solver-process-alive? run) ((Server-ports-is-running? (Run-server-ports run)))) -(: assert-is-running (-> Run Void)) -(define (assert-is-running run) - (unless (is-running? run) +(: assert-solver-process-alive (-> Run Void)) +(define (assert-solver-process-alive run) + (unless (is-solver-process-alive? run) (raise-user-error "Solver process is not running."))) (require (for-syntax syntax/srcloc)) ; for these macros diff --git a/forge/sigs.rkt b/forge/sigs.rkt index 20c124ac..37a91934 100644 --- a/forge/sigs.rkt +++ b/forge/sigs.rkt @@ -373,6 +373,23 @@ ; this parameter, make sure it is done in a normal function, not a macro. (define helpers-enclosing (make-parameter '())) +; Check that parameter names don't shadow existing definitions. +; Called at runtime (file load time) when pred/fun is being defined. +(define (check-param-shadowing! param-names helper-kind helper-name context-info) + (for ([param-name param-names]) + (define shadowed-kind + (cond + [(hash-has-key? (State-sigs curr-state) param-name) "sig"] + [(hash-has-key? (State-relations curr-state) param-name) "field"] + [(hash-has-key? (State-pred-map curr-state) param-name) "predicate"] + [(hash-has-key? (State-fun-map curr-state) param-name) "function"] + [else #f])) + (when shadowed-kind + (raise-forge-warning + #:msg (format "Parameter '~a' in ~a '~a' shadows an existing ~a with the same name." + param-name helper-kind helper-name shadowed-kind) + #:context context-info)))) + ; Declare a new predicate ; Two cases: one with args, and one with no args (define-syntax (pred stx) @@ -420,6 +437,9 @@ (with-syntax ([functionname (format-id #'name "~a/func" #'name)]) (quasisyntax/loc stx (begin + ; Check for parameter name shadowing + (check-param-shadowing! '(decls.name ...) "predicate" 'name decl-info) + ; - Use a macro in order to capture the location of the _use_. (define-syntax (name stx2) (syntax-parse stx2 @@ -478,6 +498,9 @@ [inner-unsyntax #'unsyntax]) (quasisyntax/loc stx (begin + ; Check for parameter name shadowing + (check-param-shadowing! '(decls.name ...) "function" 'name decl-info) + ; - create a macro that captures the syntax location of the _use_ (define-syntax (name stx2) (syntax-parse stx2 @@ -663,18 +686,20 @@ (cond ; TODO: isn't this known at expansion time? We'll have the value of . [(equal? 'expected 'forge_error) - ; Expecting an error. If we receive one, do nothing. + ; Expecting an error. If we receive one, do nothing. ; Otherwise, continue to report the error and then close the run. ; (N.B., this assumes the run isn't actually created or sent to the solver.) (define run-reference #f) - - ; `is forge_error` should be satisfied by an error produced via raise-forge-error. These - ; are exn:fail:user values. Other Racket errors, such as arity errors, use a different - ; error value type, and so would not be considered valid for `is forge_error` testing. + (define handler-failed #f) + + ; `is forge_error` should be satisfied by an error produced via raise-forge-error. These + ; are exn:fail:user values. Other Racket errors, such as arity errors, use a different + ; error value type, and so would not be considered valid for `is forge_error` testing. (with-handlers ([exn:fail:user? - (lambda (e) + (lambda (e) (unless (or (not expected-details) (regexp-match (regexp expected-details) (exn-message e))) + (set! handler-failed #t) (report-test-failure #:name 'name #:msg (format "Failed test ~a. Forge error was produced with unexpected message. Expected match: ~a. Actual message: ~a." @@ -686,6 +711,7 @@ ; Cannot throw the new "failed test" Forge error here, or it will be caught and ignored (set! run-reference name) (close-run name)) + ; Instead, wait and throw it here (note this will only happen if _NO_ user-error was ; produced by the run, and thus a run-reference is present. (when run-reference @@ -695,9 +721,12 @@ #:context loc #:run run-reference #:sterling #f)) - (when (member 'name (hash-keys (State-runmap curr-state))) - (printf "Warning: successful `is forge_error` test run left in state environment: ~a.~n" 'name)) - (report-passing-test #:name 'name)] + + ; Only report passing if error was caught/matched as expected + (unless (or run-reference handler-failed) + (when (member 'name (hash-keys (State-runmap curr-state))) + (printf "Warning: successful `is forge_error` test run left in state environment: ~a.~n" 'name)) + (report-passing-test #:name 'name))] ; It may not be immediately obvious why we would ever test for unknown, ; but it seems reasonable to support it in the engine, regardless. diff --git a/forge/sterling/README.md b/forge/sterling/README.md index 02f4dec7..995796de 100644 --- a/forge/sterling/README.md +++ b/forge/sterling/README.md @@ -1,3 +1,8 @@ -This folder contains a build of the current version of Sterling for Forge. To update, build Sterling and recursively copy the contents of the `dist` folder in that repo to the `build` sub-folder here. Remember to build with `yarn run build:forge`; the Forge version is slightly different from the Alloy version. +This folder contains a build of the current version of Sterling for Forge. To update, you can either: + +- Run `./update-sterling.sh vX.Y.Z` to download `sterling-forge.zip` from the corresponding GitHub release and replace `build/`. +- Or build Sterling locally and recursively copy the contents of the `dist` folder in that repo to the `build` sub-folder here. + +Remember to build with `yarn run build:forge`; the Forge version is slightly different from the Alloy version. Also, note well that the build has sub-folders. Don't neglect to `cp -r` and to delete the subfolders before copying. diff --git a/forge/sterling/build/assets/manifest.webapp b/forge/sterling/build/assets/manifest.webapp index a22e5b90..41e880f0 100644 --- a/forge/sterling/build/assets/manifest.webapp +++ b/forge/sterling/build/assets/manifest.webapp @@ -1,5 +1,5 @@ { - "version": "2.1.1", + "version": "2.3.0", "name": "sterling-layout", "description": "Spytial Sterling is a fork of the Sterling visualizer that encodes spatial layout.", "icons": { diff --git a/forge/sterling/build/assets/yandex-browser-manifest.json b/forge/sterling/build/assets/yandex-browser-manifest.json index 97331c60..8a95a081 100644 --- a/forge/sterling/build/assets/yandex-browser-manifest.json +++ b/forge/sterling/build/assets/yandex-browser-manifest.json @@ -1,5 +1,5 @@ { - "version": "2.1.1", + "version": "2.3.0", "api_version": 1, "layout": { "logo": "yandex-browser-50x50.png", diff --git a/forge/sterling/build/main.bundle.js b/forge/sterling/build/main.bundle.js index eb666f63..e3766dae 100644 --- a/forge/sterling/build/main.bundle.js +++ b/forge/sterling/build/main.bundle.js @@ -1 +1 @@ -(()=>{"use strict";var e,t,n,r={50004:(e,t,n)=>{var r=n(85893),o=(n(54848),n(49203),n(31906),n(67294)),s=n(73935),i=n(39704),a=n(57247),l=n(105),c=n(68527),d=n(78654),p=n(35173);const h=()=>{const e=(0,l.mq)("DragBar");return(0,r.jsx)(c.xu,{__css:e})},u=()=>{const e=(0,l.mq)("DragHandle");return(0,r.jsx)(c.xu,Object.assign({className:"drag-handle",__css:e},{children:(0,r.jsx)(h,{})}))},m=e=>{const{children:t,rightPaneCollapsed:n,rightPaneInitialWidth:s,rightPaneMinWidth:i,rightPaneMaxWidth:a}=e,h=(0,o.useRef)(null),m=(0,l.mq)("Dashboard"),[g,x]=(0,o.useState)(0),[b,y]=(0,o.useState)(!1),[w,v]=(0,o.useState)(s),j=(0,o.useMemo)((()=>n?0:w),[n,w]),A=(0,o.useMemo)((()=>n?-w:0),[n,w]),S=(0,o.useMemo)((()=>f(void 0,0,j,b)),[0,j,!1,b]),M=(0,o.useMemo)((()=>f(w,void 0,A,b)),[w,A,b]),C=(0,o.useMemo)((()=>f(void 0,void 0,A+w,b)),[A,w,b]),I=(0,o.useCallback)(((e,t)=>{const n=t.target.getBoundingClientRect(),r=t.clientX-n.left;"right"===e&&(x(r),y(!0))}),[y]),O=(0,o.useCallback)((0,d.Z)((e=>{var t;if(b){const n=h.current;if(n){null===(t=window.getSelection())||void 0===t||t.empty();const r=n.getBoundingClientRect().width-e.clientX+g-5;v((0,p.Z)(r,i,a))}}}),16),[g,b,i,a]),k=(0,o.useCallback)((()=>{y(!1)}),[y]);(0,o.useEffect)((()=>(document.addEventListener("mousemove",O),document.addEventListener("mouseup",k),()=>{document.removeEventListener("mousemove",O),document.removeEventListener("mouseup",k)})),[O,k]);const N=o.Children.toArray(t).filter((e=>e));return 2===N.length?(0,r.jsxs)(c.xu,Object.assign({ref:h,__css:m},{children:[(0,r.jsx)("div",Object.assign({style:S},{children:N[0]})),(0,r.jsx)("div",Object.assign({style:M},{children:N[1]})),(0,r.jsx)("div",Object.assign({style:C,onMouseDown:e=>I("right",e)},{children:(0,r.jsx)(u,{})}))]})):null},g={baseStyle:{position:"fixed",top:"56px",right:"64px",bottom:"36px",left:"0"}};function f(e,t,n,r){const o={position:"absolute",top:"0",bottom:"0",transition:r?void 0:"all 200ms cubic-bezier(0.85, 0, 0.15, 1)"};return void 0!==e&&(o.width=`${e}px`),void 0!==t&&(o.left=`${t}px`),void 0!==n&&(o.right=`${n}px`),o}const x=(0,l.Gp)(((e,t)=>{const n=(0,l.mq)("Pane");return(0,r.jsx)(c.xu,Object.assign({__css:n,ref:t},e))})),b=e=>{const t=(0,l.mq)("LogList",e);return(0,r.jsx)(c.rj,Object.assign({__css:t},e))};const y=e=>{const{variant:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{const t=(0,l.mq)("Logo");return(0,r.jsx)(c.M5,Object.assign({__css:t},e,{children:"Spytial Sterling"}))},v=e=>{const t=(0,l.mq)("NavBar");return(0,r.jsx)(c.kC,Object.assign({__css:t},e))},j={baseStyle:{h:"56px",position:"fixed",top:0,left:0,right:0,display:"flex",alignItems:"center",gap:3,px:4,bg:"rgba(11, 17, 32, 0.92)",backgroundImage:"linear-gradient(120deg, #0f172a 0%, #111827 45%, #0b1224 100%)",color:"gray.100",borderBottom:"1px solid",borderColor:"whiteAlpha.200",boxShadow:"0 12px 40px rgba(15, 23, 42, 0.45)",backdropFilter:"saturate(180%) blur(12px)",zIndex:"banner"}};var A=n(68921);const S=e=>{const t=(0,l.mq)("NavButton");return(0,r.jsx)(A.zx,Object.assign({__css:t},e))},M=e=>{const t=(0,l.mq)("PaneBody");return(0,r.jsx)(c.xu,Object.assign({__css:t},e))},C={baseStyle:{position:"absolute",top:"56px",right:0,bottom:0,left:0,bg:"#f8fafc"}},I=e=>{const t=(0,l.mq)("PaneHeader");return(0,r.jsx)(c.xu,Object.assign({__css:t},e))},O={baseStyle:{position:"absolute",top:0,left:0,right:0,height:"56px",display:"flex",alignItems:"center",gap:"0.75rem",px:3,bg:"rgba(255, 255, 255, 0.92)",backgroundImage:"linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.9) 100%)",borderBottom:"1px solid",borderColor:"gray.200",boxShadow:"0 8px 30px rgba(15, 23, 42, 0.08)",backdropFilter:"saturate(180%) blur(6px)",zIndex:"banner"}},k=e=>{const t=(0,l.mq)("PaneTitle");return(0,r.jsx)(c.M5,Object.assign({__css:t},e))},N=e=>{const t=(0,l.mq)("SideBar");return(0,r.jsx)(c.kC,Object.assign({__css:Object.assign(Object.assign({},t),{overflowY:"auto"})},e))},z={baseStyle:{w:"64px",position:"fixed",top:"56px",right:0,bottom:"36px",display:"flex",flexDir:"column",alignItems:"stretch",fontSize:"xs",gap:"6px",px:2,py:3,borderLeft:"1px solid",borderColor:"whiteAlpha.200",bg:"rgba(11, 17, 32, 0.88)",backdropFilter:"saturate(180%) blur(12px)",boxShadow:"-12px 0 30px rgba(15, 23, 42, 0.35)",color:"gray.100",zIndex:"banner"}};const D=e=>{const{text:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{const t=(0,l.mq)("StatusBar");return(0,r.jsx)(c.kC,Object.assign({__css:t},e))},_={baseStyle:{h:"36px",position:"fixed",right:0,bottom:0,left:0,display:"flex",alignItems:"center",px:4,gap:3,fontSize:"sm",borderTop:"1px solid",borderColor:"whiteAlpha.200",bg:"rgba(12, 17, 30, 0.9)",color:"gray.100",backdropFilter:"saturate(180%) blur(10px)",boxShadow:"0 -8px 30px rgba(15, 23, 42, 0.3)"}},L=(0,a.B1C)({fonts:{body:"InterVariable",mono:"Fira Code VF, Fira Code, monospace"},styles:{global:{"html, body, #root":{w:"full",h:"full",overflow:"hidden",userSelect:"none",cursor:"default"}}},components:{Dashboard:g,DragBar:{baseStyle:{w:"1px",h:"full",transition:"all ease 0.25s",backgroundColor:"gray.300",".drag-handle:hover &":{backgroundColor:"gray.500"}}},DragHandle:{baseStyle:{w:"10px",h:"full",mx:"-5px",px:"5px",cursor:"col-resize",boxSizing:"border-box",backgroundColor:"transparent"}},Logo:{baseStyle:{px:3,py:2,fontWeight:"extrabold",fontSize:"md",letterSpacing:"0.22em",textTransform:"uppercase",color:"white",bg:"whiteAlpha.100",borderRadius:"lg",boxShadow:"inset 0 0 0 1px rgba(255, 255, 255, 0.12)",lineHeight:"1"}},LogList:{baseStyle:{display:"grid",backgroundColor:"gray.50",gridTemplateColumns:"fit-content(300px) 1fr",gridColumnGap:"0.35rem",gridAutoRows:"min-content",userSelect:"text"}},LogText:{baseStyle:{fontFamily:"mono",fontSize:"xs"},variants:{message:{color:"gray.900"},warning:{color:"yellow.400",fontWeight:"semibold"},error:{color:"red.500",fontWeight:"semibold"},timestamp:{display:"flex",alignItems:"center",color:"gray.500"}},defaultProps:{variant:"message"}},NavBar:j,NavButton:{baseStyle:{display:"flex",alignItems:"center",gap:"0.35rem",borderRadius:"full",px:4,py:2,lineHeight:1.1,fontSize:"sm",fontWeight:"semibold",color:"gray.100",bg:"whiteAlpha.50",border:"1px solid",borderColor:"whiteAlpha.200",boxShadow:"0 10px 30px rgba(15, 23, 42, 0.15)",transitionProperty:"common",transitionDuration:"normal",_hover:{bg:"whiteAlpha.200",color:"white",borderColor:"whiteAlpha.300",_disabled:{bg:"initial"}},_active:{bg:"white",color:"#0f172a",borderColor:"white",boxShadow:"0 12px 34px rgba(15, 23, 42, 0.35)"},_focusVisible:{boxShadow:"0 0 0 2px rgba(99, 102, 241, 0.6)",outline:"none"},_disabled:{opacity:.4,cursor:"not-allowed"}}},Pane:{baseStyle:{position:"absolute",top:0,right:0,bottom:0,left:0}},PaneBody:C,PaneHeader:O,PaneTitle:{baseStyle:{fontSize:"sm",fontWeight:"semibold",letterSpacing:"0.08em",textTransform:"uppercase",color:"#0f172a"}},SideBar:z,SideBarButton:{baseStyle:{display:"flex",cursor:"pointer",alignItems:"center",justifyContent:"center",py:4,fontSize:"xs",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",writingMode:"vertical-lr",textOrientation:"sideways",borderRadius:"lg",border:"1px solid",borderColor:"whiteAlpha.200",color:"gray.100",bg:"whiteAlpha.50",boxShadow:"0 10px 30px rgba(15, 23, 42, 0.12)",iconSpacing:"0.35rem",span:{marginRight:".12rem"},_hover:{bg:"whiteAlpha.200",color:"white",borderColor:"whiteAlpha.300",transform:"translateY(-1px)",_disabled:{bg:"initial"}},_active:{bg:"linear-gradient(180deg, #e0e7ff 0%, #c7d2fe 100%)",color:"#0f172a",borderColor:"white",boxShadow:"0 14px 36px rgba(15, 23, 42, 0.35)",transform:"translateY(-2px)"},_focusVisible:{boxShadow:"0 0 0 2px rgba(94, 234, 212, 0.65)",outline:"none"}}},StatusBar:_,View:{baseStyle:{w:"full",h:"full"}}}});var T=n(59876),P=n(11384);const B=e=>{const{text:t,variant:n,time:o}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(y,Object.assign({variant:"timestamp",justifySelf:"end"},{children:[o?(0,P.Z)(o,"HH:mm:ss"):"--:--:--",(0,r.jsx)(T.XC,{})]})),(0,r.jsx)(y,Object.assign({variant:n},{children:t}))]})};var R=n(64657);function V(e,t){return e.nodes[t]}function $(e,t){return t?t.map((t=>V(e,t))):(0,R.Z)(e.nodes)}function F(e,t){return e.edges[t]}function G(e,t){return t?t.map((t=>F(e,t))):(0,R.Z)(e.edges)}function Z(e,t){return`arrow-${e}-[${t}]`}const W=(0,o.memo)((e=>{const{size:t,color:n}=e,o=Z(t,n),s=t/2;return(0,r.jsx)("marker",Object.assign({id:o,viewBox:`0 0 ${t} ${t}`,refX:0,refY:s,markerWidth:t,markerHeight:t,markerUnits:"userSpaceOnUse",orient:"auto",fill:n},{children:(0,r.jsx)("path",{d:`M 0 0 L ${t} ${s} L 0 ${t} z`})}))})),U=e=>{const{arrowHeads:t}=e;return(0,r.jsx)("defs",{children:t.map(((e,t)=>(0,r.jsx)(W,Object.assign({},e),t)))})},q=e=>(0,r.jsx)("text",Object.assign({x:e.x,y:e.y,style:e.style},e.props,{children:e.text})),Y=e=>{const{label:t,position:n}=e;return t.length!==n.length?null:(0,r.jsx)(r.Fragment,{children:t.map(((e,t)=>{const{x:o,y:s}=n[t];return(0,r.jsx)(q,Object.assign({x:o,y:s},e),t)}))})};var X=n(3759),H=n(18990),J=n(27470),Q=n(75908),K=n(74681),ee=n(85925),te=n(69786),ne=n(67185),re=n(14643);const oe=e=>{const{path:t,curve:n,style:s,onRender:i}=e,a=(0,o.useRef)(null),l=(0,o.useRef)(null),c=(0,o.useMemo)((()=>function(e){const t=(0,X.Z)().x((e=>e.x)).y((e=>e.y));switch(null==e?void 0:e.type){case"bspline":t.curve(H.ZP);break;case"bundle":t.curve(J.Z.beta(.85));break;case"cardinal":t.curve(Q.ZP.tension(0));break;case"catmullrom":t.curve(K.Z.alpha(.5));break;case"line":default:t.curve(ee.Z);break;case"monotonex":t.curve(te.Z);break;case"monotoney":t.curve(te.s);break;case"natural":t.curve(ne.Z);break;case"step":t.curve(re.ZP);break;case"stepafter":t.curve(re.cD);break;case"stepbefore":t.curve(re.RN)}return t}(n)),[n]),d=(0,o.useMemo)((()=>c(t)||""),[c,t]),p=`url(#${Z(10,s.stroke)})`;return(0,o.useLayoutEffect)((()=>{const e=a.current,n=l.current;if(e&&n){const r=e.getTotalLength(),o=e.getPointAtLength(r-10);n.setAttribute("d",c([...t.slice(0,-1),o])||"")}i&&a.current&&i(a.current)}),[i,t]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("path",{ref:l,style:s,markerEnd:p}),(0,r.jsx)("path",{ref:a,d,stroke:"transparent",strokeWidth:11,fill:"none"})]})},se=e=>{const{id:t,path:n,curve:s,style:i,labels:a}=e,[l,c]=(0,o.useState)([]),d=(0,o.useCallback)((e=>{a&&c(a.map((t=>function(e,t){const n=t.getTotalLength();if(void 0===e.position)return t.getPointAtLength(n/2);if("number"==typeof e.position){const r=(0,p.Z)(e.position,0,1);return t.getPointAtLength(r*n)}const r=(0,p.Z)(e.position.distance,0,n);return"source"===e.position.from?t.getPointAtLength(r):t.getPointAtLength(n-r)}(t,e))))}),[c,a]);return(0,r.jsxs)("g",Object.assign({id:`${t}`},{children:[(0,r.jsx)(oe,{path:n,curve:s,style:i,onRender:d}),a&&(0,r.jsx)(Y,{label:a,position:l})]}))},ie=(0,o.memo)((e=>{const{edges:t}=e;return(0,r.jsx)("g",Object.assign({className:"edges"},{children:t.map((e=>(0,r.jsx)(se,Object.assign({},e),e.id)))}))}));function ae(e,t){return{x:e.x+t.x,y:e.y+t.y}}function le(e){return Math.atan2(-e.y,-e.x)+Math.PI}function ce(e,t){return{x:e.x-t.x,y:e.y-t.y}}function de(e,t,n){return{x:e.x+n*Math.cos(t),y:e.y+n*Math.sin(t)}}var pe=n(5419);const he=(0,o.createContext)({nodeOffset:()=>({x:0,y:0}),onClickNode:()=>{},onMouseDown:()=>{},onMouseDownNode:()=>{},onMouseMove:()=>{},onMouseUp:()=>{},onMouseUpNode:()=>{},onWheel:()=>{},spreadMatrix:(0,pe.yR)(),zoomMatrix:(0,pe.yR)()});var ue=n(60953);const me={x:0,y:0};function ge(e,t,n){const r=t.getScreenCTM();if(r){const o=r.inverse(),s=(0,pe.SO)(n),i=t.createSVGPoint();i.x=e.clientX,i.y=e.clientY;const a=(0,pe.hC)(s,i.matrixTransform(o));return i.x=e.clientX+e.movementX,i.y=e.clientY+e.movementY,ce((0,pe.hC)(s,i.matrixTransform(o)),a)}return{x:0,y:0}}const fe=()=>!1;function xe(e){return(0,o.useCallback)(((t,n)=>{let r,o=n.callbacks;switch(n.type){case"clicknode":return r=(0,ue.Z)(null==o?void 0:o.onClickNode,fe),r(n.nodeId,n.event)?t:function(e,t){return e}(t);case"mousedown":return r=(0,ue.Z)(null==o?void 0:o.onMouseDown,fe),r(n.event)?t:function(e,t){return Object.assign(Object.assign({},e),{isPanning:!0})}(t);case"mousedownnode":return r=(0,ue.Z)(null==o?void 0:o.onMouseDownNode,fe),r(n.nodeId,n.event)?t:function(e,t){const{event:n,nodeId:r}=t;return n.preventDefault(),n.stopPropagation(),e.selection.push(r),e.isDragging=!0,e}(t,n);case"mousemove":return r=(0,ue.Z)(null==o?void 0:o.onMouseMove,fe),r(n.event)?t:function(e,t,n){if(n){if(e.isDragging)return function(e,t,n){const r=e.selection,o=Object.assign({},e.offsets),s=ge(t.event,n,e.zoomMatrix);return r.forEach((e=>{const t=o[e]||me;o[e]=ae(t,s)})),Object.assign(Object.assign({},e),{offsets:o})}(e,t,n);if(e.isPanning)return function(e,t,n){const r=ge(t.event,n,e.zoomMatrix),o=(0,pe.vs)([e.zoomMatrix,(0,pe.Iu)(r.x,r.y)]);return Object.assign(Object.assign({},e),{zoomMatrix:o})}(e,t,n)}return e}(t,n,e);case"mouseup":return r=(0,ue.Z)(null==o?void 0:o.onMouseUp,fe),r(n.event)?t:function(e,t){return Object.assign(Object.assign({},e),{isDragging:!1,isPanning:!1,offsets:{},selection:[]})}(t);case"mouseupnode":return r=(0,ue.Z)(null==o?void 0:o.onMouseUpNode,fe),r(n.nodeId,n.event)?t:(r=(0,ue.Z)(null==o?void 0:o.onSelectionMoved,fe),r(t.offsets)?t:function(e,t){const{event:n}=t;return n.preventDefault(),n.stopPropagation(),e.isDragging=!1,e.isPanning=!1,e.offsets={},e.selection=[],e}(t,n));case"wheel":if(r=(0,ue.Z)(null==o?void 0:o.onWheel,fe),r(n.event))return t;const s=t.spreadMatrix,i=t.zoomMatrix,a=function(e,t,n){const r=t.event,o=function(e){const t=e.shiftKey?e.deltaX:e.deltaY;return 0===t?0:t<0?1.055:.9478672985781991}(r);return n&&0!==o&&!r.ctrlKey?r.shiftKey?function(e,t,n,r){const o=r.getScreenCTM();if(o){const s=r.createSVGPoint();s.x=t.clientX,s.y=t.clientY;const i=s.matrixTransform(o.inverse()),{x:a,y:l}=(0,pe.hC)((0,pe.vs)((0,pe.SO)(e.spreadMatrix),(0,pe.SO)(e.zoomMatrix)),i),c=(0,pe.vs)(e.spreadMatrix,(0,pe.bA)(n,n,a,l));return Object.assign(Object.assign({},e),{spreadMatrix:c})}return e}(e,r,o,n):function(e,t,n,r){const o=r.getScreenCTM();if(o){const s=r.createSVGPoint();s.x=t.clientX,s.y=t.clientY;const i=s.matrixTransform(o.inverse()),{x:a,y:l}=(0,pe.hC)((0,pe.SO)(e.zoomMatrix),i),c=(0,pe.vs)(e.zoomMatrix,(0,pe.bA)(n,n,a,l));return Object.assign(Object.assign({},e),{zoomMatrix:c})}return e}(e,r,o,n):e}(t,n,e);return r=(0,ue.Z)(null==o?void 0:o.onSpreadChanged,fe),s!==a.spreadMatrix&&r(a.spreadMatrix)?t:(r=(0,ue.Z)(null==o?void 0:o.onZoomChanged,fe),i!==a.zoomMatrix&&r(a.zoomMatrix)?t:a)}return t}),[e])}const be=e=>{const{svg:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{i(function(e,t){return Object.assign(Object.assign({},e),{callbacks:t})}(e,n))}),[i,n]);return{nodeOffset:(0,o.useCallback)((e=>s.offsets[e]||{x:0,y:0}),[s.offsets]),onClickNode:(0,o.useCallback)(((e,t)=>a(function(e,t){return{type:"clicknode",nodeId:e,event:t}}(e,t))),[a]),onMouseDown:(0,o.useCallback)((e=>a(function(e){return{type:"mousedown",event:e}}(e))),[a]),onMouseDownNode:(0,o.useCallback)(((e,t)=>a(function(e,t){return{type:"mousedownnode",nodeId:e,event:t}}(e,t))),[a]),onMouseMove:(0,o.useCallback)((e=>a(function(e){return{type:"mousemove",event:e}}(e))),[a]),onMouseUp:(0,o.useCallback)((e=>a(function(e){return{type:"mouseup",event:e}}(e))),[a]),onMouseUpNode:(0,o.useCallback)(((e,t)=>a(function(e,t){return{type:"mouseupnode",event:t,nodeId:e}}(e,t))),[a]),onWheel:(0,o.useCallback)((e=>a(function(e){return{type:"wheel",event:e}}(e))),[a]),spreadMatrix:s.spreadMatrix,zoomMatrix:s.zoomMatrix}};const ye=()=>(0,o.useContext)(he),we=e=>{const{children:t,beforeUnmount:n}=e,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o()=>{n&&n(i)}),[n]),(0,r.jsx)(he.Provider,Object.assign({value:i},{children:t}))};const ve=e=>{const{label:t}=e;return(0,r.jsx)(r.Fragment,{children:t.map(((e,t)=>{const{offset:n}=e,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{const{shape:t,style:n}=e;return(0,r.jsx)("circle",{r:t.radius,style:n})})),Ae=(0,o.memo)((e=>{const{shape:t,style:n}=e;return(0,r.jsx)("rect",{x:-t.width/2,y:-t.height/2,width:t.width,height:t.height,style:n})})),Se=(0,o.memo)((e=>{const{shape:t,style:n}=e;switch(t.shape){case"circle":return(0,r.jsx)(je,{shape:t,style:n});case"rectangle":return(0,r.jsx)(Ae,{shape:t,style:n})}return null})),Me=(0,o.memo)((e=>{const{id:t,position:n,shape:s,style:i,labels:a,superscripts:l}=e,{onClickNode:c,onMouseDownNode:d,onMouseUpNode:p,spreadMatrix:h,nodeOffset:u}=ye(),m=u(t),g=(0,o.useMemo)((()=>{const e=ae((0,pe.hC)(h,n),m);return`translate(${e.x} ${e.y})`}),[n,m,h]);return(0,r.jsxs)("g",Object.assign({id:t,transform:g,onClick:e=>c(t,e),onMouseDown:e=>d(t,e),onMouseUp:e=>p(t,e)},{children:[(0,r.jsx)(Se,{shape:s,style:i}),a&&(0,r.jsx)(ve,{label:a}),l&&(0,r.jsx)(ve,{label:l})]}))})),Ce=(0,o.memo)((e=>{const{nodes:t}=e;return(0,r.jsx)("g",Object.assign({className:"nodes"},{children:t.map((e=>(0,r.jsx)(Me,Object.assign({},e),e.id)))}))}));function Ie(e,t){return{a:e,b:t}}function Oe(e,t){const n=e.a,r=e.b,o=t.a,s=t.b,i=((s.x-o.x)*(n.y-o.y)-(s.y-o.y)*(n.x-o.x))/((s.y-o.y)*(r.x-n.x)-(s.x-o.x)*(r.y-n.y));return{x:n.x+i*(r.x-n.x),y:n.y+i*(r.y-n.y)}}function ke(e,t,n,r){switch(t.shape){case"circle":return function(e,t,n,r){return de(e,le(n),t+r/2)}(e,t.radius,n,r);case"rectangle":return function(e,t,n,r,o){const s=t+o,i=n+o,a=s/2,l=i/2,c=de(e,le(r),Math.max(s,i)),d=Ie(e,c),p=((h=d).a.y-h.b.y)/(h.a.x-h.b.x);var h;const u=p*a,m=l/p,g={x:e.x+a,y:e.y+l},f={x:e.x-a,y:e.y+l},x={x:e.x+a,y:e.y-l},b={x:e.x-a,y:e.y-l};if(-l<=u&&u<=l){if(e.xc.x)return Oe(Ie(f,b),d)}if(-a<=m&&m<=a){if(e.yc.y)return Oe(Ie(b,x),d)}return e}(e,t.width,t.height,n,r)}return e}function Ne(e){return void 0!==e}const ze=(0,o.memo)((e=>{const{id:t,graph:n,edgeCurves:s,edgeStyles:i,edgeLabels:a,nodeShapes:l,nodeStyles:c,nodeLabels:d,nodeSuperscripts:p}=e,h=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o$(n).map((e=>{const t={x:e.x,y:e.y},n=l[e.id],r=c[e.id],o=d?d[e.id]:void 0,s=p?p[e.id]:void 0;return{id:e.id,position:t,shape:n,style:r,labels:o,superscripts:s}}))),[n,l,c,d]),f=(0,o.useMemo)((()=>G(n).map((e=>{const t=V(n,e.source),r=V(n,e.target);if(!t||!r)return;const o=l[t.id],c=l[r.id],d=function(e,t,n,r,o,s,i,a){const l=e.waypoints||[],c=(0,pe.hC)(a,ae(t,r)),d=(0,pe.hC)(a,ae(o,i)),p=l.map((e=>(0,pe.hC)(a,e))),h=ke(c,n,ce((0,ue.Z)(p[0],d),c),0),u=ke(d,s,ce((0,ue.Z)(p[p.length-1],c),d),0);return[h,...p,u]}(e,t,o,u(t.id),r,c,u(r.id),m),p=s[e.id],h=i[e.id],g=a?a[e.id]:void 0;return{id:e.id,path:d,curve:p,style:h,labels:g}})).filter(Ne)),[n,m,s,i,a,u]),x=function(e){const t=new Set,n=[];return e.forEach((e=>{const r=e.stroke,o=Z(10,r);t.has(o)||(t.add(o),n.push({size:10,color:r}))})),n}(Object.values(i));return g.length<1&&g.push({id:"0",position:{x:0,y:0},shape:{shape:"rectangle",width:550,height:50},style:{fill:"transparent",stroke:"black"},labels:[{text:"There are no atoms to display (or the current theme has hidden them)",style:{fontSize:12,textAnchor:"middle",fontFamily:"monospace",userSelect:"none"}}]}),(0,r.jsxs)("g",Object.assign({id:t},h,{children:[(0,r.jsx)(U,{arrowHeads:x}),(0,r.jsx)(Ce,{nodes:g}),(0,r.jsx)(ie,{edges:f})]}))}));(0,o.forwardRef)(((e,t)=>{const{children:n}=e,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o(0,r.jsx)(A.zx,Object.assign({colorScheme:"green",size:"xs",ref:t},e))));var Ee=n(98765);const _e=(0,Ee.PH)("sterling/buttonClicked"),Le=(0,Ee.PH)("sterling/dataRequested"),Te=(0,Ee.PH)("sterling/evalRequested"),Pe=(0,Ee.PH)("sterling/metaRequested"),Be=(0,Ee.PH)("sterling/dataReceived"),Re=(0,Ee.PH)("sterling/evalReceived"),Ve=(0,Ee.PH)("sterling/metaReceived"),$e=(0,Ee.PH)("sterling/connect"),Fe=(0,Ee.PH)("sterling/disconnect"),Ge=(0,Ee.PH)("sterling/connected"),Ze=(0,Ee.PH)("sterling/connectionError"),We=(0,Ee.PH)("sterling/disconnected"),Ue=(0,Ee.PH)("sterling/error");function qe(e){return void 0!==e}function Ye(e,t){const n={};for(const r of e)n[t(r)]=r;return n}function Xe(e){return e.types[e.types.length-1]}function He(e){return e.atoms}function Je(e){return void 0!==e.meta&&!0===e.meta.builtin}function Qe(e,t,n){return"string"==typeof t&&(t=ct(e,t)),"string"!=typeof n&&(n=n.id),t.types.includes(n)}function Ke(e,t){const n=t.getAttribute("label");if(!n)throw new Error("No label attribute in atom element");return{_:"atom",id:n,type:e}}function et(e,t){return Array.from(t).map((t=>Ke(e,t)))}function tt(e,t){if("string"==typeof t&&(t=st(e,t)),!e.types[t.type])throw new Error(`The atom's type is not part of the instance: ${t.type}`);return e.types[t.type]}function nt(e,t){return Array.from(t).map((t=>function(e,t){return{_:"tuple",types:e,atoms:Array.from(t.querySelectorAll("atom")).map(((t,n)=>Ke(e[n],t).id))}}(e,t)))}function rt(e){return e.tuples}function ot(e,t){return Array.from(t).map((t=>function(e,t){const n=t.getAttribute("label");if(!n)throw new Error("No label found for field element");const r=function(e,t){const n=t.querySelectorAll("type");return Array.from(n).map((t=>{const n=t.getAttribute("ID");if(!n)throw new Error("Type element must have an ID attribute");const r=e[n];if(!r)throw new Error(`Type element with ID ${n} not found`);return r}))}(e,t);if(0===r.length)throw new Error("No types found for field element");return{_:"relation",id:`${r[0]}<:${n}`,name:n,types:r,tuples:nt(r,t.querySelectorAll("tuple"))}}(e,t)))}function st(e,t){const n=it(e).find((e=>e.id===t));if(!n)throw new Error(`Could not find atom with id ${t}`);return n}function it(e){return dt(e).map(He).reduce(((e,t)=>e.concat(t)),[])}function at(e){return Object.values(e.relations)}function lt(e){return Object.values(e.skolems)}function ct(e,t){const n=e.types[t];if(!n)throw new Error(`Could not find type with id ${t}`);return n}function dt(e){return Object.values(e.types)}function pt(e){const t=e.getAttribute("bitwidth");if(!t)throw new Error("No bitwidth found in instance");const n=function(e){const t={},n=e.querySelectorAll("sig");for(const e of n){const n=e.getAttribute("ID"),r=e.getAttribute("label");if(!n)throw new Error("No ID found for sig element");if(!r)throw new Error("No label found for sig element");t[n]=r}return t}(e),r=function(e,t){const n={},r=t.querySelectorAll("sig");for(const e of r)if(!ft(e)){const t=e.getAttribute("ID"),r=e.getAttribute("parentID"),o=e.getAttribute("label");if(!t)throw new Error("No ID found for sig element");if(!o)throw new Error("No label found for sig element");r&&(n[t]=r)}const o=(t,r)=>n[t]?o(n[t],[...r,e[t]]):r,s={};for(const t in e)s[e[t]]=o(t,[]);return s}(n,e),o=function(e,t){return Array.from(t).filter((e=>!ft(e))).map((t=>function(e,t){const n=t.getAttribute("label");if(!n)throw new Error("No label attribute in sig element");const r=e[n];if(!r)throw console.log(e),new Error(`No type hierarchy for ${n}`);const o=function(e){const t={};return"yes"===e.getAttribute("abstract")&&(t.abstract=!0),"yes"===e.getAttribute("builtin")&&(t.builtin=!0),"yes"===e.getAttribute("enum")&&(t.enum=!0),"yes"===e.getAttribute("meta")&&(t.meta=!0),"yes"===e.getAttribute("one")&&(t.one=!0),"yes"===e.getAttribute("private")&&(t.private=!0),0===Object.keys(t).length?void 0:t}(t),s={_:"type",id:n,types:r,atoms:et(n,t.querySelectorAll("atom")),meta:void 0};return qe(o)&&(s.meta=o),s}(e,t)))}(r,e.querySelectorAll("sig")),s=ot(n,e.querySelectorAll("field")),i=ot(n,e.querySelectorAll("skolem"));return function(e,t){const n=t.find((e=>"Int"===e.id));if(!n)throw new Error("Could not find Int type");n.atoms=function(e){const t=[],n=Math.pow(2,e);for(let e=-n/2;ee.id)),relations:Ye(s,(e=>e.id)),skolems:Ye(i,(e=>e.id))}}function ht(e){var t;const n=(new DOMParser).parseFromString(e,"application/xml"),r=Array.from(n.querySelectorAll("instance"));if(!r.length)throw new Error(`No Alloy instance in XML: ${e}`);const o=n.querySelectorAll("visualizer");let s,i,a;for(const e of o){const t=mt(e,"script"),n=mt(e,"theme"),r=mt(e,"cnd");i=null!=t?t:i,s=null!=r?r:s,a=null!=n?n:a}return{instances:r.map(pt),bitwidth:ut(r[0],"bitwidth"),command:mt(r[0],"command"),loopBack:null!==(t=ut(r[0],"backloop"))&&void 0!==t?t:ut(r[0],"loop"),maxSeq:ut(r[0],"maxseq"),maxTrace:ut(r[0],"maxtrace"),minTrace:ut(r[0],"mintrace"),traceLength:ut(r[0],"tracelength"),visualizerConfig:{script:gt(i),theme:gt(a),cnd:gt(s)}}}function ut(e,t){const n=e.getAttribute(t);return n?+n:void 0}function mt(e,t){const n=e.getAttribute(t);return n?`${n}`:void 0}function gt(e){return null==e?void 0:e.replaceAll(""",'"').replaceAll('\\"','"').replaceAll(">",">").replaceAll("<","<")}function ft(e){return e.querySelectorAll("type").length>0}function xt(e){return"alloy"===e.format}function bt(e){return Object.assign(Object.assign({},e),{parsed:ht(e.data)})}function yt(e,t){const n=function(e){return JSON.parse(e)}(e);!function(e){return"data"===e.type&&void 0!==e.payload}(n)?function(e){return"eval"===e.type&&void 0!==e.payload}(n)?t.dispatch(Re(n.payload)):function(e){return"meta"===e.type&&void 0!==e.payload}(n)&&t.dispatch(Ve(n.payload)):t.dispatch(Be(function(e,t){const{enter:n,update:r,exit:o}=e,s=function(e,t){const n=[];return e&&e.forEach((e=>{!function(e){const t=e.format;return"alloy"===t||"raw"===t}(e)?t.dispatch(Ue(`Unsupported data format in datum ${e.id}: ${e.format}`)):(e.id=`${e.id}`,n.push(e))})),n}(n,t);return{enter:s.map((e=>{switch(e.format){case"alloy":return bt(e);case"raw":return function(e){return Object.assign(Object.assign({},e),{parsed:e.data})}(e);default:throw new Error("Unsupported format fell through unexpectedly.")}})),update:r,exit:o}}(n.payload,t)))}function wt(e){e.dispatch(Ue("Not connected to a provider."))}function vt(e,t){e.send(JSON.stringify(t))}const jt=()=>(0,i.I0)(),At=i.v9;var St=n(18172);function Mt(e,t){return t in e.edges}function Ct(e,t){return t in e.nodes}var It=n(29428);function Ot(e,t){return t=t||[],function(e,t){return(0,St.Uy)(e,(e=>{t.forEach((t=>function(e,t){const{id:n,source:r,target:o}=t;if(n&&(s=e,i=[r,o],(0,It.Z)(i,(e=>Ct(s,e))))&&!Mt(e,n))e.edges[n]=t,function(e,t,n,r){e.predecessors.hasOwnProperty(n)||(e.predecessors[n]={}),e.predecessors[n].hasOwnProperty(t)||(e.predecessors[n][t]=[]),e.predecessors[n][t].push(r)}(e,r,o,n),function(e,t,n,r){e.successors.hasOwnProperty(t)||(e.successors[t]={}),e.successors[t].hasOwnProperty(n)||(e.successors[t][n]=[]),e.successors[t][n].push(r)}(e,r,o,n),function(e,t,n){e.inedges[t].push(n)}(e,o,n),function(e,t,n){e.outedges[t].push(n)}(e,r,n);else{if(!n)throw new Error("Cannot add an edge without an edge ID");if(!Ct(e,r))throw new Error(`Cannot add edge ${n}, the source node ${r} is not in the graph`);if(!Ct(e,o))throw new Error(`Cannot add edge ${n}, the target node ${o} is not in the graph`);if(Mt(e,n))throw new Error(`Cannot add edge, an edge with ID ${n} already exists in the graph`)}var s,i}(e,(0,St.cA)(t))))}))}(function(e,t){return(0,St.Uy)(e,(e=>{t.forEach((t=>function(e,t){const{id:n}=t;if(n&&!Ct(e,n))e.nodes[n]=t,e.predecessors[n]={},e.successors[n]={},e.inedges[n]=[],e.outedges[n]=[];else{if(!n)throw new Error("Cannot add a node without a node ID");if(Ct(e,n))throw new Error(`Cannot add node, a node with ID ${n} already exists in the graph`)}}(e,(0,St.cA)(t))))}))}({nodes:{},edges:{},predecessors:{},successors:{},inedges:{},outedges:{}},e=e||[]),t)}function kt(e,t){const n=e.edges;return!!n&&n.some((e=>{var n;return!0===e.asAttribute&&(null===(n=e.targets)||void 0===n?void 0:n.some((e=>"*"===e||e.relation===t)))}))}function Nt(e,t,n){if(n<2)return[0,0];if(!e)return[0,n-1];const r=e.edges;if(!r)return[0,n-1];const o=r.find((e=>{var n;return(e.sourceIndex||e.targetIndex)&&(null===(n=e.targets)||void 0===n?void 0:n.some((e=>"*"===e||e.relation===t)))}));return o?[o.sourceIndex?o.sourceIndex:0,o.targetIndex?o.targetIndex:n-1]:[0,n-1]}var zt=n(11022),Dt=n(935);function Et(e){return e.id}function _t(e,t){return`${e.id}:${t.atoms.join("->")}`}function Lt(e,t){var n,r;const o=(null===(n=null==t?void 0:t.hidden)||void 0===n?void 0:n.disconnected)||!1,s=o||(null===(r=null==t?void 0:t.hidden)||void 0===r?void 0:r.builtinDisconnected)||!1,{nodeIds:i,edgeIds:a}=function(e,t,n,r){const o=new Set,s=new Set;return at(e).forEach((t=>{rt(t).forEach((n=>{const i=n.atoms.map((t=>st(e,t))),[a,l]=function(e,t,n){if(n){const[r,o]=Nt(n,e.id,t.length);return[r?t[r]:(0,zt.Z)(t),o?t[o]:(0,Dt.Z)(t)]}return[(0,zt.Z)(t),(0,Dt.Z)(t)]}(t,i,r);a&&l&&(o.add(Et(a)),o.add(Et(l)),s.add(_t(t,n)))}))})),it(e).forEach((r=>{const s=Et(r);o.has(s)||t||function(e,t){return"string"==typeof t&&(t=st(e,t)),tt(e,t).types.map((t=>ct(e,t))).some(Je)}(e,r)&&n||o.add(s)})),{nodeIds:o,edgeIds:s}}(e,o,s,t),l=[];it(e).forEach((e=>{const t=Et(e);i.has(t)&&l.push({id:t,atom:e})}));const c=[];return at(e).forEach((n=>{t&&kt(t,n.id)||rt(n).forEach((r=>{const o=_t(n,r),s=r.atoms,[i,l]=Nt(t,n.id,s.length),d=i?s[i]:(0,zt.Z)(s),p=l?s[l]:(0,Dt.Z)(s);d&&p&&a.has(o)&&c.push({id:o,source:Et(st(e,d)),target:Et(st(e,p)),relation:n,tuple:r})}))})),Ot(l,c)}var Tt=n(79432),Pt=n(27961);function Bt(e,t,n,r){const o={},s={},i={},a={},l={},c={},d={},p=function(e,t){const n={"*":(r=[t],(0,Pt.Z)(r.map((e=>e.nodes?e.nodes.filter((e=>e.targets&&e.targets.some((e=>"*"===e)))):[]))))};var r;return dt(e).forEach((e=>{n[e.id]=function(e,t){return(0,Pt.Z)(t.map((t=>t.nodes?t.nodes.filter((t=>t.targets&&t.targets.some((t=>"*"!==t&&t.type===e)))):[])))}(e.id,[t])})),n}(t,r),h=function(e,t){const n={"*":(r=[t],(0,Pt.Z)(r.map((e=>e.edges?e.edges.filter((e=>e.targets&&e.targets.some((e=>"*"===e)))):[]))))};var r;return at(e).forEach((e=>{n[e.id]=function(e,t){return(0,Pt.Z)(t.map((t=>t.edges?t.edges.filter((t=>t.targets&&t.targets.some((t=>"*"!==t&&t.relation===e)))):[])))}(e.id,[t])})),n}(t,r),u={};at(t).forEach((e=>{kt(r,e.id)&&rt(e).forEach((t=>{const n=t.atoms;if(n.length>1){const t=n[0];u[t]||(u[t]=[]),u[t].push(`${e.name}: ${n.slice(1).join(", ")}`)}}))})),lt(t).forEach((e=>{rt(e).forEach((t=>{const n=t.atoms[0];u[n]||(u[n]=[]),u[n].push(`${e.name}`)}))})),$(n).forEach((e=>{i[e.id]=[{text:e.atom.id,props:{},style:{}}];const n=ct(t,e.atom.type);a[e.id]=[{text:n.types[0],props:{dy:"-1em"},style:{textAnchor:"middle",fontSize:"14px",fontStyle:"italic"}}],u[e.id]&&i[e.id].push(...u[e.id].map((e=>({text:e,props:{},style:{}})))),s[e.id]={}}));const m=e=>{if(e.tuple.atoms.length>2){const[t,n]=Nt(r,e.relation.id,e.tuple.atoms.length),o=e.tuple.atoms.slice();return o.splice(t,1),o.splice(n-1,1),e.relation.name+`[${o.join(", ")}]`}return e.relation.name};return G(n).forEach((e=>{d[e.id]=[{text:m(e),props:{},style:{}}],c[e.id]={}})),$(n).forEach((e=>{const{id:n,atom:r}=e;["*","univ",...tt(t,r).types.slice().reverse()].forEach((e=>{var t;null===(t=p[e])||void 0===t||t.forEach((e=>{var t;e.shape&&(o[n]=e.shape),(0,Tt.Z)(s[n],null===(t=e.styles)||void 0===t?void 0:t.node),i[n].forEach((t=>{var n,r;(0,Tt.Z)(t.props,null===(n=e.props)||void 0===n?void 0:n.label),(0,Tt.Z)(t.style,null===(r=e.styles)||void 0===r?void 0:r.label)})),Rt(i[n])}))}))})),G(n).forEach((e=>{const{id:t,relation:n,tuple:r}=e;["*",n.id].forEach((e=>{var n;null===(n=h[e])||void 0===n||n.forEach((e=>{var n;e.curve&&(l[t]=e.curve),(0,Tt.Z)(c[t],null===(n=e.styles)||void 0===n?void 0:n.edge),d[t].forEach((t=>{var n,r;(0,Tt.Z)(t.props,null===(n=e.props)||void 0===n?void 0:n.label),(0,Tt.Z)(t.style,null===(r=e.styles)||void 0===r?void 0:r.label)})),Rt(d[t])}))}))})),{id:e,graph:n,nodeShapes:o,nodeStyles:s,nodeLabels:i,nodeSuperscripts:a,edgeCurves:l,edgeLabels:d,edgeStyles:c}}function Rt(e){const t=e.length-1;e.forEach(((e,n)=>{e.props||(e.props={}),e.props.dy=n-t/2+.33+"em"}))}var Vt=n(70681),$t=n.n(Vt),Ft=n(5840),Gt=n(13209),Zt=n(44186),Wt=n(49360);function Ut(e,t){return Ot($(e).map((e=>{const n=t.nodePositions[e.id];return Object.assign(Object.assign({},e),{x:(null==n?void 0:n.x)||0,y:(null==n?void 0:n.y)||0})})),G(e).map((e=>Object.assign(Object.assign({},e),{waypoints:t.edgeWaypoints[e.id]||[]}))))}const qt=e=>void 0!==e.loopBack;var Yt=n(1185);function Xt(e,t){const n={};return t.forEach((t=>{const r=Xe(tt(e,t));if(n[r])throw new Error(`Cannot project ${t} and ${n[r]}. Both are of type ${r}`);n[r]=t})),{types:Ht(e,n),relations:Jt(e,n),skolems:e.skolems}}function Ht(e,t){const n={},r=Object.keys(t);for(const t in e.types){const o=e.types[t],s=r.some((t=>Qe(e,o,t)));n[t]={_:"type",id:o.id,types:o.types,atoms:s?[]:o.atoms,meta:o.meta}}return n}function Jt(e,t){const n={},r=Object.keys(t),o=Object.values(t);for(const t in e.relations){const s=e.relations[t],i=s.types.some((t=>r.some((n=>Qe(e,t,n))))),a=i?Qt(e,s.types,r):[];n[t]={_:"relation",id:s.id,name:s.name,types:i?en(s.types,a):s.types,tuples:i?Kt(s.tuples,a,o):s.tuples},i||(n[t]=s)}return n}function Qt(e,t,n){const r=[];return t.forEach(((t,o)=>{n.some((n=>Qe(e,t,n)))&&r.push(o)})),r}function Kt(e,t,n){return e.filter((e=>e.atoms.some((e=>n.includes(e))))).map((e=>({_:"tuple",types:en(e.types,t),atoms:en(e.atoms,t)}))).filter((e=>e.atoms.length>1))}function en(e,t){const n=[];for(let r=0;rt.map((t=>sn(e,t))).filter((e=>!(0,Wt.Z)(e))))),selectDatumById:sn},ln=function(e,t){return(e.orderByDatumId[t.id]||[]).map((t=>e.expressionsById[t]))},cn=function(e){return e.nextExpressionId};function dn(e){return e.length?e.slice().sort(((e,t)=>e.time===t.time?e.type.localeCompare(t.type):!0===e.time?-1:1)).map((e=>!0===e.time?`[${e.type}]`:`(${e.type})`)).join("|"):"|"}function pn(e,t){const n=hn(e,t);return n&&n.projections||[]}function hn(e,t){var n;return e.themeByGeneratorName[null!==(n=t.generatorName)&&void 0!==n?n:""]}const un={selectGraphLayout:function(e,t){const n=pn(e,t),r=e.layoutsByDatumId[t.id],o=dn(n);return r.layoutById[o]},selectHiddenRelations:function(e,t){return e.hiddenByDatumId[t.id]},selectProjections:pn,selectSpreadMatrix:function(e,t){var n;return null===(n=e.matricesByDatumId[t.id])||void 0===n?void 0:n.spreadMatrix},selectTheme:hn,selectTimeIndex:function(e,t){return e.timeByDatumId[t.id]||0},selectZoomMatrix:function(e,t){var n;return null===(n=e.matricesByDatumId[t.id])||void 0===n?void 0:n.zoomMatrix},selectCnDSpec:function(e,t){var n,r;const o=null!==(n=t.generatorName)&&void 0!==n?n:"";return null!==(r=e.cndSpecByGeneratorName[o])&&void 0!==r?r:""}},mn=function(e){return e.items},gn=function(e){return e.connected},fn=function(e){return e.providerName},xn=function(e){return e.providerGenerators},bn=function(e){return e.synthesisEnabled};function yn(e,t){let n=null!=t?t:e;if(n instanceof Function)return n;{let e=n;return()=>e}}function wn(e){return{top_left:{x:Math.min(...e.map((e=>e.top_left.x))),y:Math.min(...e.map((e=>e.top_left.y)))},bottom_right:{x:Math.max(...e.map((e=>e.bottom_right.x))),y:Math.max(...e.map((e=>e.bottom_right.y)))}}}function vn(e){return null==e||0==e.length?{x:0,y:0}:e.reduce(((t,n)=>({x:t.x+n.x/e.length,y:t.y+n.y/e.length})),{x:0,y:0})}function jn(e,t){return e.map((e=>()=>({x:e().x-t().x,y:e().y-t().y})))}function An(e){let t=1/0,n=1/0,r=-1/0,o=-1/0;return e.forEach((e=>{t=Math.min(t,e.x),r=Math.max(r,e.x),n=Math.min(n,e.y),o=Math.max(o,e.y)})),{top_left:{x:t,y:n},bottom_right:{x:r,y:o}}}function Sn(e,t){const n=[];for(let o=1;o<=t;o++){const s=e(2*Math.PI/t*o);if(!("x"in(r=s))||!("y"in r))throw"returned bounding box response not of type coords. Issue in edge.ts or utility.ts";n.push(s)}var r;return n}function Mn(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Cn(e){let t=Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2));return{x:e.x/t,y:e.y/t}}function In(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}function On(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function kn(e,t){const n=function(e,t){return e.x*t.x+e.y*t.y}(e,t)/(On(e)*On(t));return On(e)*On(t)==0?1/0:Math.acos(n)}function Nn(e,t,n,r){const o=e*n+t*r,s=Math.sqrt((e*e+t*t)*(n*n+r*r));let i=Math.acos(o/s);return e*r-t*n<0&&(i=-i),i}var zn=n(69364);const Dn="rgb(0, 0, 0)";class En{constructor(e){this.center=yn({x:0,y:0},e),this.origin_offset=yn({x:0,y:0},e),this.bounding_box_lam=e=>this.center(),this.hasBoundingBox=!1,this.children=[],this.dependents=[],this.masks=[]}boundingBox(){return 0==this.children.length?{top_left:this.center(),bottom_right:this.center()}:wn(this.children.map((e=>e.boundingBox())))}getChildren(){return this.children}setCenter(e){this.center=yn(this.center(),e)}hasLam(){return this.hasBoundingBox}getLam(){return this.hasBoundingBox?this.bounding_box_lam:(e=this.boundingBox(),t=>{const n=t%(2*Math.PI),r=e.top_left,o=e.bottom_right,s=Math.abs(r.y-o.y),i=Math.abs(r.x-o.x),a=Math.atan(s/i);if(2*Math.PI-a<=n||n<=a){const e=o.x;let t;return t=n>Math.PI?o.y-s/2+Math.tan(2*Math.PI-n)*i/2:o.y-s+Math.tan(n)*i/2,{x:e,y:t}}if(aMath.PI/2?r.x+s/(2*Math.tan(n-Math.PI/4)):r.x+i/2+s/(2*Math.tan(n)),{x:e,y:r.y}}if(Math.PI-a{r.append("rect").attr("x",e.top_left.x).attr("y",e.top_left.y).attr("width",Math.abs(e.top_left.x-e.bottom_right.x)).attr("height",Math.abs(e.top_left.y-e.bottom_right.y))})),n}render(e,t){let n;n=t?this.masks.concat(t):this.masks,this.children.forEach((t=>{t.render(e,n)}))}sterlingExpectCenter(e,t,n){if(this.center().x!==t)throw new Error(`${e}: center().x was not expected value (${t}); was ${this.center().x}`);if(this.center().y!==n)throw new Error(`${e}: center().y was not expected value (${n}); was ${this.center().y}`)}}class _n extends En{constructor(e){super(e.coords),this.text=yn("",e.text),this.fontSize=yn(15,e.fontSize),this.color=yn("rgb(0, 0, 0)",e.color),this.events=yn([],e.events),this.fontWeight=yn(400,e.fontWeight)}boundingBox(){return{top_left:{x:this.center().x-this.fontSize()/2,y:this.center().y-this.fontSize()/2},bottom_right:{x:this.center().x+this.fontSize()/2,y:this.center().y+this.fontSize()/2}}}setText(e){this.text=yn(this.text(),e)}setFontSize(e){this.fontSize=yn(this.fontSize(),e)}setTextColor(e){this.color=yn(this.color(),e)}setFontWeight(e){this.fontWeight=yn(this.fontWeight(),e)}render(e,t){let n,r="";n=t?this.masks.concat(t):this.masks,r=this.addMaskRender(n,e);const o=zn.Ys(e).append("text").attr("x",this.center().x).attr("y",this.center().y).attr("text-anchor","middle").attr("alignment-baseline","central").attr("font-size",this.fontSize).attr("font-weight",this.fontWeight).attr("mask",n.length>0?`url(#${r})`:"").attr("fill",this.color).text(this.text);this.events()&&this.events().forEach((e=>o.on(e.event,e.callback))),super.render(e)}}class Ln extends En{constructor(e){super(e.center),this.color=yn("rgb(0, 0, 0)",e.color),this.borderWidth=yn(2,e.borderWidth),this.borderColor=yn("rgb(255, 255, 255)",e.borderColor),this.label=new _n({text:e.label,coords:()=>this.center(),color:e.labelColor,fontSize:e.labelSize}),this.children.push(this.label),this.opacity=yn(1,e.opacity)}setColor(e){this.color=yn(this.color(),e)}setBorderWidth(e){this.borderWidth=yn(this.borderWidth(),e)}setBorderColor(e){this.borderColor=yn(this.borderColor(),e)}setLabelText(e){this.label.setText(e)}setLabelColor(e){this.label.setTextColor(e)}setLabelSize(e){this.label.setFontSize(e)}}class Tn extends Ln{constructor(e){var t;super(e),this.height=yn(0,e.height),this.width=yn(0,e.width),this.labelLocation=null!==(t=e.labelLocation)&&void 0!==t?t:"center";const n={x:0,y:0};if(e.center&&e.coords)throw"you cannot include both coords and a center as the two define the same thing";this.center=(()=>{if(e.center)return yn(n,e.center);{const t=yn(n,e.coords);return()=>{const e=t();return{x:e.x+this.width()/2,y:e.y+this.height()/2}}}})(),this.setLabelLocation()}boundingBox(){return{top_left:{x:this.center().x-this.width()/2,y:this.center().y-this.height()/2},bottom_right:{x:this.center().x+this.width()/2,y:this.center().y+this.height()/2}}}setLabelLocation(){switch(this.labelLocation){case"topLeft":this.label.setCenter((()=>({x:this.center().x-this.width()/2+2.5*this.label.text().length,y:this.center().y-this.height()/2-1*this.label.fontSize()})));break;case"topRight":this.label.setCenter((()=>({x:this.center().x+this.width()/2-2.5*this.label.text().length,y:this.center().y-this.height()/2-1*this.label.fontSize()})));break;case"bottomRight":this.label.setCenter((()=>({x:this.center().x+this.width()/2-2.5*this.label.text().length,y:this.center().y+this.height()/2+1*this.label.fontSize()})));break;case"bottomLeft":this.label.setCenter((()=>({x:this.center().x-this.width()/2+2.5*this.label.text().length,y:this.center().y+this.height()/2+1*this.label.fontSize()})))}}setWidth(e){this.width=yn(this.width(),e)}setHeight(e){this.height=yn(this.height(),e)}render(e,t){let n,r="";n=t?this.masks.concat(t):this.masks,r=this.addMaskRender(n,e),zn.Ys(e).append("rect").attr("x",this.center().x-this.width()/2).attr("y",this.center().y-this.height()/2).attr("width",this.width()).attr("height",this.height()).attr("stroke-width",this.borderWidth()).attr("stroke",this.borderColor()).attr("fill",this.color()).attr("mask",n.length>0?`url(#${r})`:"").attr("opacity",this.opacity()),super.render(e,n)}}class Pn extends Ln{constructor(e){super(e),this.radius=yn(0,e.radius),this.bounding_box_lam=e=>{const t=this.radius(),n=this.center();return{x:t*Math.cos(e)+n.x,y:t*Math.sin(e)+n.y}},this.hasBoundingBox=!0}boundingBox(){return{top_left:{x:this.center().x-this.radius(),y:this.center().y-this.radius()},bottom_right:{x:this.center().x+this.radius(),y:this.center().y+this.radius()}}}setRadius(e){this.radius=yn(0,e)}render(e,t){let n,r="";n=t?this.masks.concat(t):this.masks,r=this.addMaskRender(n,e),zn.Ys(e).append("circle").attr("cx",this.center().x).attr("cy",this.center().y).attr("r",this.radius).attr("stroke-width",this.borderWidth).attr("stroke",this.borderColor).attr("fill",this.color).attr("mask",n.length>0?`url(#${r})`:"").attr("opacity",this.opacity()),super.render(e,n)}}var Bn=n(28721);class Rn extends En{constructor(e){var t;let n;n=null!=e.points?e.points.map((e=>yn({x:0,y:0},e))):[],super((()=>vn(n.map((e=>e()))))),this.pointsRelative=jn(n,this.center),this.color=yn(Dn,e.color),this.width=yn(2,e.width),this.opacity=yn(1,e.opacity),this.arrow=null!==(t=e.arrow)&&void 0!==t&&t,this.style=yn("full",e.style),this.curve=yn({curveType:"none"},e.curve)}boundingBox(){return An(this.pointsRelative.map((e=>({x:e().x+this.center().x,y:e().y+this.center().y}))))}setColor(e){this.color=yn(this.color(),e)}setWidth(e){this.width=yn(this.width(),e)}setOpacity(e){this.opacity=yn(this.opacity(),e)}render(e,t){let n,r="";if(n=t?this.masks.concat(t):this.masks,r=this.addMaskRender(n,e),2==this.pointsRelative.length)for(;this.pointsRelative[0]().x==this.pointsRelative[1]().x||this.pointsRelative[0]().y==this.pointsRelative[1]().y;){if(this.pointsRelative[0]().x==this.pointsRelative[1]().x){const e=this.pointsRelative[0];this.pointsRelative[0]=()=>({x:e().x+1e-4,y:e().y})}if(this.pointsRelative[0]().y==this.pointsRelative[1]().y){const e=this.pointsRelative[0];this.pointsRelative[0]=()=>({x:e().x,y:e().y+1e-4})}}let o=this.pointsRelative.map((e=>({x:e().x+this.center().x,y:e().y+this.center().y})));const s=this.buildPathString(o);let i="0";if("dashed"==this.style()?i=5*this.width():"dotted"==this.style()&&(i=this.width()),this.arrow){const t=(0,Bn.Z)();zn.Ys(e).append("svg:defs").append("svg:marker").attr("id",t).attr("refX",11).attr("refY",6).attr("markerWidth",10*this.width()).attr("markerHeight",10*this.width()).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 0 0 12 6 0 12 3 6").style("fill",this.color),zn.Ys(e).append("path").attr("d",s).attr("stroke-width",this.width).attr("stroke",this.color).attr("opacity",this.opacity()).attr("marker-end",`url(#${t})`).attr("mask",n.length>0?`url(#${r})`:"").style("stroke-dasharray",i).attr("fill","transparent"),super.render(e,n)}else zn.Ys(e).append("path").attr("d",s).attr("stroke-width",this.width).attr("stroke",this.color).attr("opacity",this.opacity()).attr("fill","transparent").attr("mask",n.length>0?`url(#${r})`:"").style("stroke-dasharray",i),super.render(e,n)}buildPathString(e){const t=this.curve();switch(t.curveType){case"none":const n=zn.ETc();return n.moveTo(e[0].x,e[0].y),e.forEach((e=>{n.lineTo(e.x,e.y)})),n.toString();case"arc":return`M ${e[0].x} ${e[0].y} \n A ${t.xradius} ${t.yradius} 0 0 \n ${void 0!==t.sweep?t.sweep:1} ${e[1].x} ${e[1].y}`;case"cubic":throw console.log("Error: cubic curves currently unsupported by Line"),new Error("cubic curves currently unsupported by Line");case"quadratic":throw console.log("Error: quadratic curves currently unsupported by Line"),new Error("quadratic curves currently unsupported by Line");default:throw console.log(`Error: unrecognized curveType in prop ${JSON.stringify(t)} (check you have not misspelled the field name)`),new Error(`unknown curveType field in Line prop ${JSON.stringify(t)} (check you have not misspelled the field name)`)}}}class Vn extends En{constructor(e){var t,n;super(e.coords);let r=yn({x:0,y:0},e.coords);this.center=()=>({x:r().x+this.width/2,y:r().y+this.height/2}),this.coords=()=>{const e=this.center();return{x:e.x-this.width/2,y:e.y-this.height/2}},this.height=e.height,this.width=e.width,this.root=e.root;let o=this.root.visualObject.center;this.root.visualObject.setCenter((()=>{const e=this.coords(),t=o();return{x:e.x+this.width/2+t.x,y:e.y+t.y}})),this.lines=[],this.subTrees=[],this.setUpSubtrees(),this.setLineColor(null!==(t=e.edgeColor)&&void 0!==t?t:"black"),this.setLineWidth(null!==(n=e.edgeWidth)&&void 0!==n?n:2)}setUpSubtrees(){let e=this.height/($n(this.root)-1),t=this.root.children.map((e=>Fn(e))).reduce(((e,t)=>e+t),0);this.subTrees=[];let n=0;this.subTrees=this.root.children.map((r=>{let o=Fn(r),s=n;return n+=o,new Vn({root:r,height:e*($n(r)-1),width:this.width*Fn(r)/t,coords:()=>{const n=this.coords();return{x:n.x+s/t*this.width,y:n.y+e}}})})),this.subTrees.forEach((e=>{this.lines.push(new Rn({points:[()=>{const e=this.root.visualObject.center();return{x:e.x,y:e.y}},()=>{const t=e.root.visualObject.center();return{x:t.x,y:t.y}}],color:Dn,width:2}))})),this.lines.forEach((e=>{this.children.push(e)})),this.subTrees.forEach((e=>{this.children.push(e)})),this.children.push(this.root.visualObject)}setLineColor(e){this.lines.forEach((t=>t.setColor(e))),this.subTrees.forEach((t=>t.setLineColor(e)))}setLineWidth(e){this.lines.forEach((t=>t.setWidth(e))),this.subTrees.forEach((t=>t.setLineWidth(e)))}}function $n(e){let t=0,n=[e];for(;0!=n.length;){t+=1;let e=[];n.forEach((t=>{t.children.forEach((t=>{e.push(t)}))})),n=e}return t}function Fn(e){let t=1,n=[e];for(;0!=n.length;){let e=[];n.forEach((t=>{t.children.forEach((t=>{e.push(t)}))})),n=e,t=Math.max(t,e.length)}return t}class Gn{static error(e,t,n){return n&&console.trace(),Error(`[${e}] ${t}`)}static missingAttribute(e,t){return Error(`[${e}] Missing attribute: ${t}`)}static missingElement(e,t){return Error(`[${e}] Missing element: <${t}>`)}}class Zn{constructor(e){this._tuples=e||[]}empty(){return 0===this._tuples.length}equals(e){return this.toString()===e.toString()}in(e){const t=new Set(e.tuples().map((e=>e.toString())));return this.tuples().every((e=>t.has(e.toString())))}join(e){if(Array.isArray(e))throw Gn.error("AlloySet",`[${e}] is an array, not an AlloySet, so unable to apply join.`);if(!(e instanceof Zn))throw Gn.error("AlloySet",`${e} is something other than an AlloySet, so unable to apply join.`);if(!this.tuples().length||!e.tuples().length)return new Zn;const t=function(e,t){const n=new Map;return t.forEach((e=>{const t=e.atoms()[0];n.has(t.id())||n.set(t.id(),[]),n.get(t.id()).push(e)})),n}(0,e.tuples()),n=[],r=this._tuples[0].atoms().length-1;return this.tuples().forEach((e=>{const o=e.atoms()[r],s=t.get(o.id());s&&s.forEach((t=>{const r=e.atoms().slice(0,-1).concat(...t.atoms().slice(1));n.push(new Wn(r))}))})),new Zn(function(e){const t=new Set;return e.filter((e=>{const n=e.atoms().map((e=>e.id())).join();return!t.has(n)&&(t.add(n),!0)}))}(n))}toString(){return this._tuples.map((e=>e.toString())).join("\n")}tuples(){return this._tuples.slice()}}class Wn extends Zn{constructor(e){super(),this._tuples=[this],this._atoms=e}atoms(){return this._atoms.slice()}toString(){return this._atoms.map((e=>e.id())).join(", ")}static tuplesFromXML(e,t){return Array.from(e).map((e=>{if(1===t.length)return Wn.buildTuple(t[0],e);const n=t.reduce(((t,n)=>{if(t)return t;try{return Wn.buildTuple(n,e)}catch(e){return}}),void 0);if(n)return n;throw Gn.error("AlloyField",`No match for tuple element ${e} in declared types ${t}`)}))}static buildTuple(e,t){const n=Array.from(t.querySelectorAll("atom")).map(((t,n)=>{const r=e[n],o=t.getAttribute("label");if(!o)throw Gn.missingAttribute("AlloyField","label");const s=r.atom(o);if(!s)throw Gn.error("AlloyField",`No atom: ${o} in type: ${r}`);return s}));return new Wn(n)}}class Un extends Zn{constructor(e,t){super();const n=t?t.applyProxy(this,function(e){return e.replace("/","$").replace("-","$")}(e)):this;return this._id=e,this._tuples=[new Wn([n])],n}clone(e){return new Un(this.id(),e)}id(){return this._id}static fromElement(e,t){const n=e.getAttribute("label");if(!n)throw Gn.missingAttribute("AlloyAtom","label");return new Un(n,t)}}const qn=[{name:"VisualObject",value:En},{name:"Shape",value:Ln},{name:"Grid",value:class extends En{constructor(e){super(e.grid_location),this.config=e;let t=yn({x:0,y:0},this.config.grid_location);this.center=()=>{const e=t();return{x:e.x+this.config.grid_dimensions.x_size*this.config.cell_size.x_size/2,y:e.y+this.config.grid_dimensions.y_size*this.config.cell_size.y_size/2}},this.coords=()=>{const e=this.center();return{x:e.x-this.config.grid_dimensions.x_size*this.config.cell_size.x_size/2,y:e.y-this.config.grid_dimensions.y_size*this.config.cell_size.y_size/2}},this.cells=new Array(this.config.grid_dimensions.y_size).fill([]);for(var n=0;nthis.config.cell_size.y_size)throw`Proposed object to add is taller than grid cells. Add "true" as the last parameter to\n grid.add() to hide this error.\n Grid cells are ${this.config.cell_size.y_size}\n units tall, while the object you want to add is ${n} units tall`;if(t>this.config.cell_size.x_size)throw`Proposed object to add is wider than grid cells. Add "true" as the last parameter to\n grid.add() to hide this error.\n Grid cells are ${this.config.cell_size.x_size}\n units tall, while the object you want to add is ${t} units tall`}add(e,t,n){if(!(t instanceof En))throw new Error("Grid can only add VisualObjects as children.");this.check_coords(e),n||this.check_bounding_box(t.boundingBox()),this.children.push(t),t.center=this.center_helper(e,t.origin_offset),this.cells[e.y][e.x]=t}center_helper(e,t){return()=>{let n=t();const r=this.coords();return{x:r.x+this.config.cell_size.x_size*(e.x+.5)+n.x,y:r.y+this.config.cell_size.y_size*(e.y+.5)+n.y}}}fill_grid_lines(){for(let e=0;e<=this.config.grid_dimensions.y_size;e++){const t=new Rn({points:[()=>{const t=this.coords();return{x:t.x,y:t.y+e*this.config.cell_size.y_size}},()=>{const t=this.coords();return{x:t.x+this.config.grid_dimensions.x_size*this.config.cell_size.x_size,y:t.y+e*this.config.cell_size.y_size}}]});this.gridlines.push(t),this.children.push(t)}for(let e=0;e<=this.config.grid_dimensions.x_size;e++){const t=new Rn({points:[()=>{const t=this.coords();return{x:t.x+e*this.config.cell_size.x_size,y:t.y}},()=>{const t=this.coords();return{x:t.x+e*this.config.cell_size.x_size,y:t.y+this.config.grid_dimensions.y_size*this.config.cell_size.y_size}}]});this.gridlines.push(t),this.children.push(t)}}hide_grid_lines(){this.gridlines.forEach((e=>{e.setOpacity(0)}))}fill(e,t){this.check_coords(e);const n=new Tn({height:this.config.cell_size.x_size,width:this.config.cell_size.y_size});n.setColor(t),this.add(e,n)}check_coords(e){if(!Number.isInteger(e.x)||!Number.isInteger(e.y))throw`non-integer indices given for grid coords. Inputted coords: ${e.x},${e.y}`;if(e.x<0||e.y<0)throw"negative indices given for grid coords";if(e.x>this.config.grid_dimensions.x_size-1||e.y>this.config.grid_dimensions.y_size-1)throw`coordinates out of bounds. Grid is of x_size ${this.config.grid_dimensions.x_size} and y_size ${this.config.grid_dimensions.y_size}\n\n Note: passing in 2 refers to index 2 which is the third element of the grid`}childAt(e,t){if(void 0!==this.cells[e]&&void 0!==this.cells[e][t])return this.cells[e][t]}}},{name:"Rectangle",value:Tn},{name:"Circle",value:Pn},{name:"Stage",value:class{constructor(){this.Children=[],this.masks=[]}add(e){if(!(e instanceof En))throw new Error("Stage can only add VisualObjects as children.");this.Children.push(e)}addAll(e){e.forEach((e=>{this.Children.push(e)}))}remove(e){this.Children=this.Children.filter((t=>t!==e))}addMask(e){this.masks.push(e)}childrenToTreeRecurse(e){const t=e.constructor.name,n={visualObject:new _n({text:t}),children:[]};return 0==e.getChildren().length||e.children.forEach((e=>{n.children.push(this.childrenToTreeRecurse(e))})),n}render(e,t){if(zn.Ys(e).selectAll("*").remove(),this.Children.forEach((t=>t.render(e,this.masks))),t){const e=t.getElementById("svg-container");e.getElementsByTagName("svg")[0].style.height="200%",e.getElementsByTagName("svg")[0].style.width="200%"}}}},{name:"TextBox",value:_n},{name:"Line",value:Rn},{name:"Polygon",value:class extends Ln{constructor(e){let t=e.points.map((e=>yn({x:0,y:0},e)));e.center=()=>vn(t.map((e=>e()))),super(e),this.pointsRelative=jn(t,this.center)}boundingBox(){return An(this.pointsRelative.map((e=>({x:e().x+this.center().x,y:e().y+this.center().y}))))}render(e,t){let n,r="";n=t?this.masks.concat(t):this.masks;let o=this.pointsRelative.map((e=>({x:e().x+this.center().x,y:e().y+this.center().y}))),s=zn.ETc();s.moveTo(o[0].x,o[0].y),o.forEach((e=>{s.lineTo(e.x,e.y)})),s.closePath(),r=this.addMaskRender(n,e),zn.Ys(e).append("path").attr("d",s.toString()).attr("stroke-width",this.borderWidth).attr("stroke",this.borderColor).attr("fill",this.color).attr("mask",n.length>0?`url(#${r})`:"").attr("opacity",this.opacity()),super.render(e,n)}}},{name:"Tree",value:Vn},{name:"Edge",value:class extends En{constructor(e){var t,n,r,o;super(),this.obj1=e.obj1,this.obj2=e.obj2,this.textProps=null!==(t=e.textProps)&&void 0!==t?t:{},this.lineProps=null!==(n=e.lineProps)&&void 0!==n?n:{points:[]},this.textLocation=null!==(r=e.textLocation)&&void 0!==r?r:"none",this.obj1CoordsStore={x:0,y:0},this.obj2CoordsStore={x:0,y:0},this.fast_imprecise=null!==(o=e.fast_imprecise)&&void 0!==o&&o,this.obj1Coords=()=>({x:0,y:0}),this.obj2Coords=()=>({x:0,y:0}),this.compute_points(30),this.makeLine(),this.makeText()}compute_points(e){const t=In(this.obj1.center(),this.obj2.center());this.obj2Coords=()=>this.opt_points(t,this.obj2,e,"obj1"),this.obj1Coords=()=>this.opt_points(t,this.obj1,e,"obj2")}opt_points(e,t,n,r){if(this.fast_imprecise){let e;if("obj1"==r)e=this.obj1CoordsStore;else{if("obj2"!=r)throw"bad arg for coordsstore";e=this.obj1CoordsStore}if(e.xt.boundingBox().top_left.x&&e.y>t.boundingBox().bottom_right.y&&e.y{Mn(t,e)function(e,t){if(e.x==t.x)return 90;{let n=(e.y-t.y)/(e.x-t.x);return Math.atan(n)}}(this.obj1Coords(),this.obj2Coords()),n=()=>Math.sqrt(Math.pow(e.fontSize(),2)+Math.pow(.14*e.text().length*e.fontSize(),2)),r=()=>{const e=this.arcMidpoint();return void 0!==e?e:In(this.obj1Coords(),this.obj2Coords())};switch(this.textLocation){case"above":e.setCenter((()=>({x:r().x+Math.cos(t()-Math.PI/2)*n(),y:r().y+Math.sin(t()-Math.PI/2)*n()})));break;case"below":e.setCenter((()=>({x:r().x+Math.cos(t()+Math.PI/2)*n(),y:r().y+Math.sin(t()+Math.PI/2)*n()})));break;case"left":e.setCenter((()=>t()<=0?{x:r().x+Math.cos(t()-Math.PI/2)*n(),y:r().y+Math.sin(t()-Math.PI/2)*n()}:{x:r().x+Math.cos(t()+Math.PI/2)*n(),y:r().y+Math.sin(t()+Math.PI/2)*n()}));break;case"right":e.setCenter((()=>t()<=0?{x:r().x+Math.cos(t()+Math.PI/2)*n(),y:r().y+Math.sin(t()+Math.PI/2)*n()}:{x:r().x+Math.cos(t()-Math.PI/2)*n(),y:r().y+Math.sin(t()-Math.PI/2)*n()}));break;case"clockwise":e.setCenter((()=>{let e=Cn({x:this.obj2Coords().x-this.obj1Coords().x,y:this.obj2Coords().y-this.obj1Coords().y});return{x:r().x-e.y*n(),y:r().y+e.x*n()}}));break;case"counterclockwise":e.setCenter((()=>{let e=Cn({x:this.obj2Coords().x-this.obj1Coords().x,y:this.obj2Coords().y-this.obj1Coords().y});return{x:r().x+e.y*n(),y:r().y-e.x*n()}}));break;default:console.log(`default text position: midpoint of line or arc: at ${JSON.stringify(r())}`),e.setCenter((()=>({x:r().x,y:r().y})))}this.children.push(e)}arcMidpoint(){if(!this.lineProps)return;const e=this.lineProps.curve instanceof Function?this.lineProps.curve():this.lineProps.curve;if(e){if("arc"===e.curveType){const t=function({x1:e,y1:t,rx:n,ry:r,phi:o,fA:s,fS:i,x2:a,y2:l}){let c,d,p,h,u;const m=2*Math.PI;if(0==n||0==r)throw Error("rx and ry can not be 0");n<0&&(n=-n),r<0&&(r=-r);const g=Math.sin(o),f=Math.cos(o),x=(e-a)/2,b=(t-l)/2,y=(e+a)/2,w=(t+l)/2,v=f*x+g*b,j=f*b-g*x,A=v*v/(n*n)+j*j/(r*r);A>1&&(n*=Math.sqrt(A),r*=Math.sqrt(A));var S=n*r,M=n*j,C=r*v,I=M*M+C*C;if(!I)throw Error("start point can not be same as end point");var O=Math.sqrt(Math.abs((S*S-I)/I));s==i&&(O=-O);var k=O*M/r,N=-O*C/n;c=f*k-g*N+y,d=g*k+f*N+w;var z=(v-k)/n,D=(v+k)/n,E=(j-N)/r,_=(j+N)/r;for(p=Nn(1,0,z,E),h=Nn(z,E,-D,-_);h>m;)h-=m;for(;h<0;)h+=m;for(0==i&&(h-=m),u=p+h;u>m;)u-=m;for(;u<0;)u+=m;return{cx:c,cy:d,startAngle:p,deltaAngle:h,endAngle:u,clockwise:1==i,rx:n,ry:r}}({x1:this.obj1Coords().x,y1:this.obj1Coords().y,rx:e.xradius,ry:e.yradius,phi:0,fA:!1,fS:1===e.sweep,x2:this.obj2Coords().x,y2:this.obj2Coords().y}),n=0===e.sweep;return{x:t.cx,y:n?t.cy+t.ry:t.cy-t.ry}}throw console.log(`unsupported curve type: ${e.curveType}`),new Error(`unsupported curve type: ${e.curveType}`)}}}},{name:"Hull",value:class extends En{constructor(e){var t,n;super(),this.fuzz=null!==(t=e.fuzz)&&void 0!==t?t:0,this.smooth=null!==(n=e.smooth)&&void 0!==n&&n,this.pts=function(e){let t=[],n=new Set;t.push(function(e){return e.sort(((e,t)=>e.x>t.x?1:t.x>e.x?-1:0))[0]}(e));let r=0;for(;0==r||t[r].x!=t[0].x||t[r].y!=t[0].y;){let o;0==r?o={x:0,y:1}:(o={x:t[r].x-t[r-1].x,y:t[r].y-t[r-1].y},n.add({x:t[r].x,y:t[r].y}));let s={x:0,y:0},i=2*Math.PI;e.forEach((e=>{if(!n.has({x:e.x,y:e.y})){let n={x:e.x-t[r].x,y:e.y-t[r].y},a=kn(o,n);(a{t.push({x:e.center().x,y:e.center().y})})):this.smooth?e.forEach((e=>{Sn(new Pn({radius:this.fuzz,center:e.center()}).getLam(),100).forEach((e=>t.push(e)))})):e.forEach((e=>{const n=new Tn({height:this.fuzz,width:this.fuzz});n.setCenter(e.center()),Sn(n.getLam(),100).forEach((e=>t.push(e)))})),t}render(e,t){let n;n=t?this.masks.concat(t):this.masks,new Rn({points:this.pts}).render(e,n)}}},{name:"ConjoinedObject",value:class extends En{constructor(e){super({x:0,y:0}),this.children=[],e&&e.forEach((e=>{this.add(e)}))}addOrdered(e,t){if(!(e instanceof En))throw new Error("ConjoinedObject can only add VisualObjects as children.");if(t>this.children.length)throw`Index larger than current number of objects stored plus 1. Add an index between 0 and ${this.children.length}`;this.children.splice(t,0,e)}add(e){this.addOrdered(e,0)}setCenter(e){this.children.forEach((t=>{t.setCenter(e)}))}}},{name:"boxUnion",value:wn},{name:"Ellipse",value:class extends Ln{constructor(e){super(e),this.height=yn(0,e.height),this.width=yn(0,e.width);let t=yn({x:0,y:0},e.coords);this.center=()=>{const e=t();return{x:e.x+this.width()/2,y:e.y+this.height()/2}}}boundingBox(){return{top_left:{x:this.center().x-this.width()/2,y:this.center().y-this.height()/2},bottom_right:{x:this.center().x+this.width()/2,y:this.center().y+this.height()/2}}}setWidth(e){this.width=yn(this.width(),e)}setHeight(e){this.height=yn(this.height(),e)}render(e,t){let n,r="";n=t?this.masks.concat(t):this.masks,r=this.addMaskRender(n,e),zn.Ys(e).append("ellipse").attr("cx",this.center().x-this.width()/2).attr("cy",this.center().y-this.height()/2).attr("rx",this.width()).attr("ry",this.height()).attr("stroke-width",this.borderWidth()).attr("stroke",this.borderColor()).attr("fill",this.color()).attr("mask",n.length>0?`url(#${r})`:"").attr("opacity",this.opacity()),super.render(e,n)}}},{name:"ImageBox",value:class extends En{constructor(e){super(e.coords),this.url=yn("",e.url),this.width=yn(100,e.width),this.height=yn(100,e.height)}boundingBox(){return{top_left:{x:this.center().x-this.width()/2,y:this.center().y-this.height()/2},bottom_right:{x:this.center().x+this.width()/2,y:this.center().y+this.height()/2}}}render(e,t){let n,r="";n=t?this.masks.concat(t):this.masks,r=this.addMaskRender(n,e),zn.Ys(e).append("svg:image").attr("x",this.center().x-this.width()/2).attr("y",this.center().y-this.height()/2).attr("width",this.width()).attr("height",this.height()).attr("mask",n.length>0?`url(#${r})`:"").attr("xlink:href",`${this.url()}`),super.render(e)}}},{name:"AlloySet",value:Zn},{name:"AlloyAtom",value:Un}];var Yn=n(25001);class Xn extends Zn{constructor(e,t,n){return super(),this._id=e,this._atoms=t,this._subsignatures=[],this._tuples=t.map((e=>new Wn([e]))),n?n.applyProxy(this,function(e){return e.replace(/^this\//,"").replace("/","$").replace("-","$")}(e)):this}atom(e){return this.atoms(!0).find((t=>t.id()===e))||null}atoms(e=!1){return e?this.atoms().concat(this.subSignatures().map((e=>e.atoms(!0))).reduce(((e,t)=>e.concat(t)),[])):this._atoms.slice()}tuples(){return this.atoms(!0).map((e=>new Wn([e])))}clone(e){const t=new Xn(this.id(),this.atoms().map((t=>t.clone(e))),e);return t._subsignatures=this.subSignatures().map((t=>t.clone(e))),t}id(){return this._id}subSignatures(e=!1){return e?this.subSignatures().concat(this.subSignatures().map((e=>e.subSignatures(!0))).reduce(((e,t)=>e.concat(t)),[])):this._subsignatures.slice()}static fromElement(e,t){const n=e.getAttribute("label");if(!n)throw Gn.missingAttribute("AlloySignature","label");const r=Array.from(e.querySelectorAll("atom")).map((e=>Un.fromElement(e,t)));return new Xn(n,r,t)}static intSignature(e,t){if(e<0)throw Gn.error("AlloySignature","Invalid bitwidth");const n=[];for(let r=Math.pow(2,e),o=-r/2;o{const n=e.getAttribute("ID"),o=e.getAttribute("label");if(!n)throw Gn.missingAttribute("AlloySignature","ID");const a=Xn.getParent(e);if(!a&&"univ"!==o)throw Gn.error("AlloySignature",`unable to resolve parent sig for non-univ sig ${o}`);const l="Int"===o||"seq/Int"===o?r:Xn.fromElement(e,t);return i.set(n,l),a&&"seq/Int"!==o&&(s.has(a)||s.set(a,[]),s.get(a).push(n)),l})),i.forEach(((e,t)=>{const n=s.get(t)||[];e._subsignatures=n.map((e=>i.get(e))).filter(Yn.$K)})),i}static getParent(e){const t=e.getAttribute("parentID"),n=e.getAttribute("label");if(!t&&"univ"!==n){const t=e.getElementsByTagName("type");if(1!==t.length)throw Gn.error("AlloySignature",`subset sig ${n} had no type or multiple types; this is unsupported`);if(t[0].getAttribute("ID"))return t[0].getAttribute("ID");throw Gn.missingAttribute("AlloySignature","type.ID")}return t}static typesFromXML(e,t){const n=e.querySelectorAll("types");if(!n)throw Gn.missingElement("AlloyField","types");return Array.from(n).map((e=>Xn.typesFromXMLSingle(e,t)))}static typesFromXMLSingle(e,t){return Array.from(e.querySelectorAll("type")).map((e=>{const n=e.getAttribute("ID");if(!n)throw Gn.missingAttribute("AlloyField","ID");const r=t.get(n);if(!r)throw Gn.error("Alloy Field",`No signature with ID: ${n}`);return r}))}}var Hn=n(44908),Jn=n.n(Hn);class Qn extends Zn{constructor(e,t){super(t),this._types=e}project(e){const t=Jn()(this.types().map((t=>t.map((t=>e.get(t))))).flat());t.some(Yn.$K)&&(this._tuples=this.tuples().filter((e=>e.atoms().every(((e,n)=>void 0===t[n]||t[n]===e)))).map((e=>new Wn(e.atoms().filter(((e,n)=>void 0===t[n]))))))}types(){return this._types.slice()}join(e){if(e instanceof Qn){const t=this.types().map((e=>e.at(-1))),n=e.types().map((e=>e.at(0)));if(!t.some((e=>n.includes(e))))throw Gn.error("Join",`Joining ${this} and ${e} will always be empty.`)}return super.join(e)}}class Kn extends Qn{constructor(e,t,n,r,o){return super(t,n),this._id=e,r?r.applyProxy(this,o?function(e){return e.replace(/-/g,"$").replace("/","$")}(o):e):this}clone(e,t){this.types().forEach((e=>{if(!this.types().every(Yn.$K))throw Gn.error("AlloyField","Missing type, cannot clone field")}));const n=this.tuples().map((e=>new Wn(e.atoms().map(((e,t)=>e.clone())))));if(t){const e=Reflect.get(this,"__var__");if(!e)throw Gn.error("AlloyField","Cannot use proxy to clone non-proxied field");return new Kn(this.id(),this.types(),n,t,e.toString())}return new Kn(this.id(),this.types(),n)}id(){return this._id}static fieldsFromXML(e,t,n){const r=Array.from(e.querySelectorAll("field")),o=new Map;return r.forEach((e=>{const t=e.getAttribute("label");if(!t)throw Gn.missingAttribute("AlloyField","label");o.set(t,(o.get(t)||0)+1)})),r.map((e=>{const r=e.getAttribute("label"),s=e.getAttribute("parentID"),i=Xn.typesFromXML(e,t);if(!r)throw Gn.missingAttribute("AlloyField","label");if(!s)throw Gn.missingAttribute("AlloyField","parentID");const a=o.get(r)||0,l=t.get(s);if(!l)throw Gn.error("AlloyField","Field parent type does not exist");const c=a>1?(d=r,p=l,`${Reflect.get(p,"__var__")}$${d}`):r;var d,p;const h=Wn.tuplesFromXML(e.querySelectorAll("tuple"),i);return new Kn(r,i,h,n,c)}))}}class er{constructor(){this._sets=new Map}applyProxy(e,t){const n=this._sets,r=t||`${n.size}`,o=this._finalize.bind(this);if(n.has(r))throw Gn.error("AlloyProxy",`Cannot apply proxy, ID already exists: ${r}. (This may be caused by a clash between sig and atom names.)`);const s=new Proxy(e,{get(e,r){if("symbol"==typeof r||r in e)return Reflect.get(e,r);if("number"!=typeof r&&isNaN(+r)){let s;const i=r.match(/\[(.*)]/);if(i){const r=n.get(i[1]);if(!r)throw Gn.error("Box Join",`Tried to join ${t} with ${i[1]} but no set ${i[1]} defined.`,!0);s=r.join(e)}else{const o=n.get(r);if(!o)throw Gn.error("Dot Join",`Tried to join ${t} with ${r} but no set ${r} defined.`,!0);s=e.join(o)}return o(s)}{const t=n.get(`${r}`);if(!t)throw Gn.error("Join",`Integer atom does not exist: ${r}`);return o(t.join(e))}}});return Reflect.set(s,Symbol.toPrimitive,(()=>`[${r}]`)),Reflect.set(s,"__var__",r),this._sets.set(r,s),s}_finalize(e){if(1===e.tuples().length&&1===e.tuples()[0].atoms().length){const t=e.tuples()[0].atoms()[0];return this._sets.get(t.id())||this.applyProxy(t,t.id())}return this.applyProxy(e)}}class tr extends Qn{constructor(e,t,n,r){return super(t,n),this._id=e,r?r.applyProxy(this,function(e){return e.replace(/^\$this\//,"$").replace("/","$").replace(/'/g,"$")}(e)):this}clone(e,t){const n=this.tuples().map((e=>new Wn(e.atoms().map(((e,t)=>e.clone())))));return new tr(this.id(),this.types(),n,t)}id(){return this._id}static skolemsFromXML(e,t,n){return Array.from(e.querySelectorAll("skolem")).map((e=>{const r=e.getAttribute("label"),o=Xn.typesFromXML(e,t),s=Wn.tuplesFromXML(e.querySelectorAll("tuple"),o);if(!r)throw Gn.missingAttribute("AlloySkolem","label");return new tr(r,o,s,n)}))}}class nr{constructor(e,t){this._proxy=new er,this._atoms=[],this._fields=[],this._signatures=[],this._skolems=[],this._projections=new Map,this._bitwidth=0,this._command="",this._filename="",this._sources=new Map,e&&this._buildFromXML(e,t)}atom(e){return this._atoms.find((t=>t.id()===e))||null}atoms(){return this._atoms.slice()}bitwidth(){return this._bitwidth}clone(){const e=new er,t=this.univ();if(!t)throw Gn.error("AlloyInstance","Cannot clone an instance without univ signature");const n=t.clone(e),r=[n,...n.subSignatures(!0)],o=n.atoms(!0),s=this.fields().map((t=>t.clone(r,e))),i=this.skolems().map((t=>t.clone(r,e))),a=new nr;return a._proxy=e,a._fields=s,a._signatures=r,a._atoms=o,a._skolems=i,a._bitwidth=this.bitwidth(),a._command=this.command(),a._filename=this.filename(),a}command(){return this._command}field(e){return this._fields.find((t=>t.id()===e))||null}fields(){return this._fields}filename(){return this._filename}project(e){const t=this.clone(),n=e.map((e=>t.atom(e.id())));if(!n.every(Yn.$K))throw Gn.error("AlloyInstance","Error cloning instance");const r=t.univ();if(!r)throw Gn.error("AlloyInstance","No univ signature");const o=r.subSignatures(),s=new Map;return n.forEach((e=>{o.forEach((t=>{if(t.atoms(!0).includes(e)){if(s.has(t))throw Gn.error("AlloyInstance","Cannot project over multiple atoms from the same signature");s.set(t,e)}}))})),this._projections=s,t.fields().forEach((e=>e.project(s))),t.skolems().forEach((e=>e.project(s))),t}projections(){return new Map(this._projections)}signature(e){return this.signatures().find((t=>t.id()===e))||null}signatures(){return this._signatures.slice()}skolem(e){return this.skolems().find((t=>t.id()===e))||null}skolems(){return this._skolems.slice()}sources(){return new Map(this._sources)}univ(){return this._signatures.find((e=>"univ"===e.id()))||null}_buildFromXML(e,t){const n=(new DOMParser).parseFromString(e,"application/xml"),r=n.querySelectorAll("instance"),o=void 0!==t?r[t]:r[0];if(!o)throw Gn.missingElement("AlloyInstance","instance");const s=o.getAttribute("bitwidth"),i=o.getAttribute("command"),a=o.getAttribute("filename"),l=o.getAttribute("maxseq");if(!s)throw Gn.missingAttribute("AlloyInstance","bitwidth");if(!i)throw Gn.missingAttribute("AlloyInstance","command");if(!a)throw Gn.missingAttribute("AlloyInstance","filename");if(!l)throw Gn.missingAttribute("AlloyInstance","maxseq");if(+s<1)throw Gn.error("AlloyInstance",`Invalid bitwidth ${s}`);this._bitwidth=+s,this._command=i,this._filename=a,this._atoms=[],this._fields=[],this._signatures=[],this._skolems=[];const c=Xn.signaturesFromXML(o,this._proxy);this._signatures=Array.from(c.values()),this._fields=Kn.fieldsFromXML(o,c,this._proxy),this._skolems=tr.skolemsFromXML(o,c,this._proxy),this._atoms=this._signatures.map((e=>e.atoms())).reduce(((e,t)=>e.concat(t)),[]),this._sources=new Map,Array.from(n.querySelectorAll("source")).forEach((e=>{const t=e.getAttribute("filename"),n=e.getAttribute("content");if(!t)throw Gn.missingAttribute("AlloyInstance","filename");if(!n)throw Gn.missingAttribute("AlloyInstance","content");this._sources.set(t,n)}))}}const rr="https://alloy-js.github.io/alloy-ts/classes/alloyinstance.alloyinstance-1.html",or=function(e){return e.stage},sr=function(e){return e.stageDimensions},ir=function(e){return e.text},ar=function(e,t,n){if(xt(e)){const r=e.data,o=e.parsed.instances.map(((e,t)=>new nr(r,t))),s=o[n],i=s.atoms(),a=[];t.forEach((e=>{const t=e.atom;if(t){const e=i.find((e=>e.id()===t));e&&a.push(e)}}));const l=s.project(a),c=l.signatures().map((e=>({name:Reflect.get(e,"__var__"),variable:e,type:"AlloySignature",typeUrl:"https://alloy-js.github.io/alloy-ts/classes/alloysignature.alloysignature-1.html"}))),d=l.atoms().filter((e=>isNaN(+e.id()))).map((e=>({name:Reflect.get(e,"__var__"),variable:e,type:"AlloyAtom",typeUrl:"https://alloy-js.github.io/alloy-ts/classes/alloyatom.alloyatom-1.html"}))),p=l.fields().map((e=>({name:Reflect.get(e,"__var__"),variable:e,type:"AlloyField",typeUrl:"https://alloy-js.github.io/alloy-ts/classes/alloyfield.alloyfield-1.html"}))),h=l.skolems().map((e=>({name:Reflect.get(e,"__var__"),variable:e,type:"AlloySkolem",typeUrl:"https://alloy-js.github.io/alloy-ts/classes/alloyskolem.alloyskolem-1.html"}))),u=qn.map((e=>({name:e.name,variable:e.value,type:"D3Helper",typeUrl:"https://csci1710.github.io/forge-documentation/sterling/d3fx.html"}))),m=[{name:"instance",variable:s,type:"AlloyInstance",typeUrl:rr},...c,...d,...p,...h,...u];return qt(e.parsed)&&m.unshift({name:"currentInstance",type:"number",variable:n},{name:"loopBack",type:"number",variable:e.parsed.loopBack},{name:"instances",variable:o,type:"AlloyInstance[]",typeUrl:rr}),m}return function(e){return"raw"===e.format}(e)?[{name:"data",variable:e.data,type:"string"}]:[]};function lr(e){return e.mainView}function cr(e){return e.graphViewDrawer}function dr(e){return e.tableViewDrawer}function pr(e){return e.scriptViewDrawer}const hr={selectAvailableViews:function(e){return e.availableViews},selectMainView:lr,selectGraphDrawer:cr,selectTableDrawer:dr,selectScriptDrawer:pr,selectDrawerIsCollapsed:(0,tn.P1)([lr,cr,dr,pr],((e,t,n,r)=>{switch(e){case"GraphView":return null===t;case"TableView":return null===n;case"ScriptView":return null===r;default:return!0}})),selectDrawerView:(0,tn.P1)([lr,cr,dr,pr],((e,t,n,r)=>{switch(e){case"GraphView":return t;case"TableView":return n;case"ScriptView":return r;default:return null}})),selectSelectedGenerator:function(e){return e.selectedGenerator}};function ur(e){return an.selectActiveDatum(e.data)}function mr(e){return hr.selectSelectedGenerator(e.ui)}function gr(e){return hr.selectAvailableViews(e.ui)}function fr(e){return an.selectData(e.data)}function xr(e,t){return xt(t)&&qt(t.parsed)}function br(e){return hr.selectDrawerIsCollapsed(e.ui)}function yr(e){return hr.selectDrawerView(e.ui)}function wr(e){return hr.selectGraphDrawer(e.ui)}function vr(e){const t=ur(e);return void 0!==t&&!0===t.evaluator}function jr(e,t){return ln(e.evaluator,t)}function Ar(e){return gn(e.provider)}function Sr(e){return mn(e.log)}function Mr(e){return hr.selectMainView(e.ui)}function Cr(e){return cn(e.evaluator)}function Ir(e,t){const n={};if(t&&xt(t)){const e=t.parsed.instances[0];(function(e){return(0,Yt.Z)(dt(e).map(Xe)).filter((e=>!(0,Wt.Z)(e)))})(e).forEach((t=>{const r=ct(e,t);n[t]=function(e,t){return it(e).filter((n=>function(e,t,n){return"string"==typeof t&&(t=st(e,t)),"string"!=typeof n&&(n=n.id),tt(e,t).types.includes(n)}(e,n,t)))}(e,r).map((e=>e.id))}))}return n}function Or(e,t){return un.selectProjections(e.graphs,t)}function kr(e){return fn(e.provider)}function Nr(e){return xn(e.provider)}function zr(e){return hr.selectScriptDrawer(e.ui)}function Dr(e){return or(e.script)}function Er(e){return sr(e.script)}function _r(e){return ir(e.script)}function Lr(e){return hr.selectTableDrawer(e.ui)}function Tr(e,t){return un.selectTimeIndex(e.graphs,t)}(0,tn.P1)([(e,t)=>t,(e,t)=>t?function(e,t){return un.selectGraphLayout(e.graphs,t)}(e,t):void 0,(e,t)=>t?function(e,t){return un.selectTheme(e.graphs,t)}(e,t):void 0,(e,t)=>t?Tr(e,t):void 0,(e,t)=>t?function(e,t){return un.selectHiddenRelations(e.graphs,t)}(e,t):void 0],((e,t,n,r,o)=>{if(e&&t&&n&&void 0!==r&&xt(e)&&o){const s=e.parsed.instances[r],i=n.projections||[],a=i.filter((e=>!0===e.time)),l=Xt(s,i.map((e=>e.atom)).filter(qe)),c=Lt(l,n);if(a.length)return a.map((e=>{let r=c;o[e.type]&&o[e.type].forEach((e=>{const t=G(r).filter((t=>t.relation.name===e)).map((e=>e.id));r=function(e,t){return(0,St.Uy)(e,(e=>{t.forEach((t=>{const n=F(e,t);n&&function(e,t){const{id:n,source:r,target:o}=t;delete e.edges[n],function(e,t,n,r){const o=e.predecessors[n][t];if(o){const s=o.indexOf(r);-1!==s&&o.splice(s,1),0===o.length&&delete e.predecessors[n][t]}}(e,r,o,n),function(e,t,n,r){const o=e.successors[t][n];if(o){const s=o.indexOf(r);-1!==s&&o.splice(s,1),0===o.length&&delete e.successors[t][n]}}(e,r,o,n),function(e,t,n){const r=e.inedges[t].indexOf(n);-1!==r&&e.inedges[t].splice(r,1)}(e,o,n),function(e,t,n){const r=e.outedges[t].indexOf(n);-1!==r&&e.outedges[t].splice(r,1)}(e,r,n)}(e,n)}))}))}(c,t)}));const s=Ut(r,t);return Bt("",l,s,n)}));const d=Ut(c,t);return[Bt("",l,d,n)]}return console.log(`datum: ${void 0!==e}`),console.log(`layout: ${void 0!==t}`),console.log(`theme: ${void 0!==n}`),console.log(`time: ${r}`),[]}));const Pr=(0,tn.P1)([(e,t)=>t,(e,t)=>Or(e,t),(e,t)=>Tr(e,t)],((e,t,n)=>ar(e,t,n))),Br=(0,tn.P1)([(e,t)=>t,(e,t)=>Tr(e,t)],((e,t)=>{if(xt(e)){const n=e.parsed.instances[t],r=function(e){const t=lt(e),n=at(e);return t.concat(n)}(n).map((e=>({title:e.name,type:"relation",headers:e.types,data:rt(e).map((e=>e.atoms))})));return[...r,...dt(n).map((e=>({title:e.id,type:"type",data:He(e).map((e=>[e.id]))})))]}return[]}));function Rr(e,t){return un.selectCnDSpec(e.graphs,t)}function Vr(e){return bn(e.provider)}function $r(e){return e.synthesis.isActive}function Fr(e){return e.synthesis.selectorType}function Gr(e){return e.synthesis.currentStep}function Zr(e){return e.synthesis.numInstances}function Wr(e){return e.synthesis.examples}function Ur(e){return e.synthesis.loadedInstances}function qr(e){return e.synthesis.result}function Yr(e){return e.synthesis.error}function Xr(e){return e.synthesis.isLoading}function Hr(e){return!e.synthesis.isLoading&&e.synthesis.examples.length===e.synthesis.numInstances&&e.synthesis.examples.every((e=>e.selectedAtomIds.length>0||e.selectedPairs.length>0))}function Jr(e){return e.synthesis.currentDataInstance}var Qr=n(10894),Kr=n(66653);const eo=e=>{const{expression:t}=e;return(0,r.jsxs)("div",Object.assign({className:"relative p-2 font-mono text-xs"},{children:[(0,r.jsxs)("div",Object.assign({className:"relative flex ml-6"},{children:[(0,r.jsx)("span",Object.assign({className:"absolute inset-y-0 -left-5"},{children:(0,r.jsx)(Qr.JO,{as:Kr.tOB})})),(0,r.jsx)("div",Object.assign({className:"font-semibold select-text"},{children:t.expression}))]})),(0,r.jsx)("div",Object.assign({className:"ml-6 text-gray-600 select-text"},{children:t.result}))]}))},to=e=>{const{datum:t}=e,n=At((e=>jr(e,t)));return(0,r.jsx)("div",Object.assign({className:"absolute inset-x-0 top-[35px] bottom-0 flex flex-col overflow-y-auto"},{children:n.map((e=>(0,r.jsx)(eo,{expression:e},e.id)))}))},no=e=>{const{datum:t}=e,[n,s]=(0,o.useState)(""),[i,a]=(0,o.useState)(null),l=At(vr),c=At(Cr),d=At((e=>jr(e,t))),p=jt(),h=(0,o.useCallback)((e=>{a(null),s(e.target.value)}),[]),u=(0,o.useCallback)((e=>{var t;if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||(t=e.code,ro.includes(t))))switch(e.code){case"ArrowUp":null===i?d.length>0&&a(0):i{e.preventDefault(),n.length>0&&(p(Te({id:`${c}`,datumId:t.id,expression:n})),s(""),a(null))}),[t,c,n]),g=l?"gray.500":"gray.300",f=l?"Enter an expression...":"Evaluator disabled";return(0,r.jsx)("div",Object.assign({className:"absolute inset-x-0 top-0 h-[35px]"},{children:(0,r.jsxs)("form",Object.assign({className:"relative block font-mono",onSubmit:m},{children:[(0,r.jsx)("span",Object.assign({className:"sr-only"},{children:"Search"})),(0,r.jsx)("span",Object.assign({className:"absolute inset-y-0 left-0 flex items-center pl-2"},{children:(0,r.jsx)(Qr.JO,{color:g,as:Kr.tOB})})),(0,r.jsx)("input",{className:"h-[35px] text-xs placeholder:italic placeholder:text-gray-400 placeholder:text-xs block bg-white w-full border-b border-gray-100 focus:border-gray-200 py-2 pl-9 pr-3 focus:outline-none",placeholder:f,type:"text",disabled:!l,value:null===i?n:d[i].expression,onChange:h,onKeyDown:u})]}))}))},ro=["Unidentified","Escape","Enter","ControlLeft","ControlRight","ShiftLeft","ShiftRight","AltLeft","AltRight","CapsLock","OSLeft","OSRight","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12","ScrollLock","ArrowLeft","ArrowRight"],oo=()=>{const e=At(ur);return e?(0,r.jsxs)("div",Object.assign({className:"absolute inset-0"},{children:[(0,r.jsx)(no,{datum:e}),(0,r.jsx)(to,{datum:e})]})):null},so=()=>(0,r.jsxs)("div",Object.assign({className:"flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(Qr.JO,{as:Kr.RJr}),(0,r.jsx)(k,{children:"Evaluator"})]})),io=()=>{const e=At(Sr);return(0,r.jsx)(b,Object.assign({h:"full",px:2,py:1,overflowY:"auto"},{children:e.map(((e,t)=>(0,r.jsx)(B,{text:e.text,time:new Date(e.time),variant:e.type},t)))}))},ao=()=>(0,r.jsxs)("div",Object.assign({className:"flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(Qr.JO,{className:"mt-0.5",as:Kr.t75}),(0,r.jsx)(k,{children:"Log"})]}));var lo=n(89583),co=n(57324),po=n(51649),ho=n(48707),uo=n(41947),mo=n(18124);const go={nodeWidth:100,nodeHeight:60,nodeSep:100,rankSep:100},fo={hidden:{builtinDisconnected:!0},nodes:[{shape:{shape:"rectangle",width:100,height:60},styles:{node:{stroke:"#333",strokeWidth:1,fill:"#ffffff"},label:{fontFamily:"monospace",fontSize:"14px",textAnchor:"middle",userSelect:"none",fill:"#333"}},props:{label:{dy:"0.33em"}},targets:["*"]}],edges:[{asAttribute:!1,sourceIndex:0,curve:{type:"bspline"},styles:{edge:{stroke:"#333",strokeWidth:1,fill:"none"},label:{fontFamily:"monospace",fontSize:"12px",textAnchor:"middle",userSelect:"none"}},targets:["*"]}]};function xo(e,t){var n;return null===(n=e.edges)||void 0===n?void 0:n.find((e=>{const n=e.targets,r=n?n[0]:void 0;return void 0!==n&&1===n.length&&void 0!==r&&"*"!==r&&r.relation===t}))}function bo(e,t){var n;return null===(n=e.nodes)||void 0===n?void 0:n.find((e=>{const n=e.targets,r=n?n[0]:void 0;return void 0!==n&&1===n.length&&void 0!==r&&"*"!==r&&r.type===t}))}function yo(e,t){var n;if(xt(t)){const r=e.themeByGeneratorName[null!==(n=t.generatorName)&&void 0!==n?n:""],o=r&&r.projections||[];if(o){const e=t.parsed.instances[0];o.forEach((t=>{if(!t.atom){const n=t.type,r=He(ct(e,n));r.length&&(t.atom=r[0].id)}}))}const s=dn(o),i=t.parsed.instances,a=o.map((e=>e.atom)).filter(qe),l=i.map((e=>Xt(e,a))).map((e=>Lt(e,r)));e.layoutsByDatumId[t.id].layoutById[s]=function(e,t){const n=new Set,r={};e.forEach((e=>{$(e).forEach((e=>{n.add(e.id)})),G(e).forEach((e=>{r[e.id]=e}))}));const o=new($t().graphlib.Graph)({multigraph:!0});o.setGraph({nodesep:t.nodeSep,ranksep:t.rankSep,rankdir:"TB"}),n.forEach((e=>{o.setNode(e,{label:e,width:t.nodeWidth,height:t.nodeHeight})})),(0,Ft.Z)(r,((e,t)=>{o.setEdge(e.source,e.target,{id:t})})),$t().layout(o);const s=function(e,t){const n=e.nodes().map((t=>e.node(t).x)),r=e.nodes().map((t=>e.node(t).y)),o=(0,Gt.Z)(n),s=(0,Gt.Z)(r),i=(0,Zt.Z)(n),a=(0,Zt.Z)(r);return{x:(0,Wt.Z)(o)||(0,Wt.Z)(i)?0:(i-o)/2+t.nodeWidth/2,y:(0,Wt.Z)(s)||(0,Wt.Z)(a)?0:(a-s)/2+t.nodeHeight/2}}(o,t),i={},a={};return o.nodes().forEach((e=>{const{x:t,y:n}=o.node(e);i[e]={x:t-s.x,y:n-s.y}})),o.edges().forEach((e=>{const{id:t,points:n}=o.edge(e);a[t]=n.slice(1,-1).map((e=>({x:e.x-s.x,y:e.y-s.y})))})),{nodePositions:i,edgeWaypoints:a}}(l,go)}}const wo={asAttributeSet:function(e,t){var n;const{datum:r,relation:o,asAttribute:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=xo(i,o);if(e)s?(0,ho.Z)(e,["asAttribute"],!0):(0,uo.Z)(e,["asAttribute"]);else if(s){const e={targets:[{relation:o}],asAttribute:!0};i.edges||(i.edges=[]),i.edges.push((0,St.cA)(e))}}},cndSpecSet:function(e,t){var n;const{datum:r,spec:o}=t.payload,s=null!==(n=r.generatorName)&&void 0!==n?n:"";e.cndSpecByGeneratorName[s]=o},curveRemoved:function(e,t){var n;const{datum:r,relation:o}=t.payload,s=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(s){const e=xo(s,o);e&&(0,uo.Z)(e,["curve"])}},curveSet:function(e,t){var n;const{datum:r,relation:o,curve:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=xo(i,o);if(e)(0,ho.Z)(e,["curve"],s);else{const e={targets:[{relation:o}],curve:s};i.edges||(i.edges=[]),i.edges.push((0,St.cA)(e))}}},edgeLabelStyleRemoved:function(e,t){var n;const{datum:r,relation:o,style:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=xo(i,o);e&&(0,uo.Z)(e,["styles","label",s])}},edgeLabelStyleSet:function(e,t){var n;const{datum:r,relation:o,style:s,value:i}=t.payload,a=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(a){const e=xo(a,o);if(e)(0,ho.Z)(e,["styles","label",s],i);else{const e={targets:[{relation:o}],styles:{label:{[s]:i}}};a.edges||(a.edges=[]),a.edges.push((0,St.cA)(e))}}},edgeStyleRemoved:function(e,t){var n;const{datum:r,relation:o,style:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=xo(i,o);e&&(0,uo.Z)(e,["styles","edge",s])}},edgeStyleSet:function(e,t){var n;const{datum:r,relation:o,style:s,value:i}=t.payload,a=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(a){const e=xo(a,o);if(e)(0,ho.Z)(e,["styles","edge",s],i);else{const e={targets:[{relation:o}],styles:{edge:{[s]:i}}};a.edges||(a.edges=[]),a.edges.push((0,St.cA)(e))}}},edgeIndexSet:function(e,t){var n;const{datum:r,relation:o,which:s,value:i}=t.payload,a=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(a){const t=xo(a,o);if(t)(0,ho.Z)(t,[s],i);else{const e={targets:[{relation:o}]};e[s]=i,a.edges||(a.edges=[]),a.edges.push((0,St.cA)(e))}yo(e,r)}},edgeIndexRemoved:function(e,t){var n;const{datum:r,relation:o,which:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=xo(i,o);e&&(0,uo.Z)(e,[s])}},graphSpread:function(e,t){const{datum:n,matrix:r}=t.payload,o=e.matricesByDatumId[n.id];o&&(o.spreadMatrix=r)},graphZoomed:function(e,t){const{datum:n,matrix:r}=t.payload,o=e.matricesByDatumId[n.id];o&&(o.zoomMatrix=r)},hiddenRelationAdded:function(e,t){const{datum:n,type:r,relation:o}=t.payload;e.hiddenByDatumId[n.id][r]||(e.hiddenByDatumId[n.id][r]=[]),e.hiddenByDatumId[n.id][r].push(o)},nodeLabelPropRemoved:function(e,t){var n;const{datum:r,type:o,prop:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=bo(i,o);e&&(0,uo.Z)(e,["props","label",s])}},nodeLabelPropSet:function(e,t){var n;const{datum:r,type:o,prop:s,value:i}=t.payload,a=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(a){const e=bo(a,o);if(e)(0,ho.Z)(e,["props","label",s],i);else{const e={targets:[{type:o}],props:{label:{[s]:i}}};a.nodes||(a.nodes=[]),a.nodes.push((0,St.cA)(e))}}},nodeLabelStyleRemoved:function(e,t){var n;const{datum:r,type:o,style:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=bo(i,o);e&&(0,uo.Z)(e,["styles","label",s])}},nodeLabelStyleSet:function(e,t){var n;const{datum:r,type:o,style:s,value:i}=t.payload,a=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(a){const e=bo(a,o);if(e)(0,ho.Z)(e,["styles","label",s],i);else{const e={targets:[{type:o}],styles:{label:{[s]:i}}};a.nodes||(a.nodes=[]),a.nodes.push((0,St.cA)(e))}}},nodesOffset:function(e,t){var n;const{datum:r,offsets:o}=t.payload,s=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""],i=dn(s&&s.projections||[]),a=e.layoutsByDatumId[r.id].layoutById[i];(0,Ft.Z)(o,((e,t)=>{const n=a.nodePositions[t];a.nodePositions[t]=ae(n,e)}))},projectionAdded:function(e,t){var n;const{datum:r,type:o,atom:s,time:i,timeOrdering:a}=t.payload,l={type:o,atom:s,time:i,timeOrdering:a},c=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];c.projections?c.projections.push((0,St.cA)(l)):c.projections=[(0,St.cA)(l)],yo(e,r)},projectionOrderingSet:function(e,t){var n;const{datum:r,type:o,relation:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""],a=(i&&i.projections||[]).find((e=>e.type===o));a&&(s?a.timeOrdering=s:delete a.timeOrdering)},projectionRemoved:function(e,t){var n;const{datum:r,type:o}=t.payload,s=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];s.projections&&(0,mo.Z)(s.projections,(e=>e.type===o)),yo(e,r)},projectionSet:function(e,t){var n;const{datum:r,type:o,atom:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""],a=(i&&i.projections||[]).find((e=>e.type===o));a&&(a.atom=s),yo(e,r)},saveThemeRequested:function(e,t){var n;const{datum:r}=t.payload,o=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(o){const e=(0,St.Vk)(o),t=(0,St.Uy)(e,(e=>{var t;null===(t=e.projections)||void 0===t||t.forEach((e=>{(0,uo.Z)(e,"atom")}))})),n=JSON.stringify(t,null,2),r=document.createElement("a"),s=new Blob([n],{type:"application/json"});r.href=URL.createObjectURL(s),r.download="theme.json",r.click()}},shapeRemoved:function(e,t){var n;const{datum:r,type:o}=t.payload,s=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(s){const e=bo(s,o);e&&(0,uo.Z)(e,["shape"])}},shapeSet:function(e,t){var n;const{datum:r,type:o,shape:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=bo(i,o);if(e)(0,ho.Z)(e,["shape"],s);else{const e={targets:[{type:o}],shape:s};i.nodes||(i.nodes=[]),i.nodes.push((0,St.cA)(e))}}},shapeStyleRemoved:function(e,t){var n;const{datum:r,type:o,style:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=bo(i,o);e&&(0,uo.Z)(e,["styles","node",s])}},shapeStyleSet:function(e,t){var n;const{datum:r,type:o,style:s,value:i}=t.payload,a=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(a){const e=bo(a,o);if(e)(0,ho.Z)(e,["styles","node",s],i);else{const e={targets:[{type:o}],styles:{node:{[s]:i}}};a.nodes||(a.nodes=[]),a.nodes.push((0,St.cA)(e))}}},themeFileLoaded:function(e,t){var n;const{datum:r,data:o}=t.payload;e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""]=JSON.parse(o),yo(e,r)},timeIndexSet:function(e,t){const{datum:n,index:r}=t.payload;e.timeByDatumId[n.id]=r}},vo=function(e,t){const{enter:n}=t.payload;n&&n.filter(xt).forEach((t=>{var n,r,o;const s=t.id;e.matricesByDatumId[t.id]={datumId:s,spreadMatrix:(0,pe.yR)(),zoomMatrix:(0,pe.yR)()};const i=null!==(n=t.generatorName)&&void 0!==n?n:"";i in e.themeByGeneratorName||(e.themeByGeneratorName[i]=(0,St.cA)(fo)),e.layoutsByDatumId[s]={datumId:s,layoutById:{}},yo(e,t),e.timeByDatumId[s]=0,i in e.cndSpecByGeneratorName||(e.cndSpecByGeneratorName[i]=null!==(o=null===(r=t.parsed.visualizerConfig)||void 0===r?void 0:r.cnd)&&void 0!==o?o:"directives:\n - flag: hideDisconnectedBuiltIns"),e.hiddenByDatumId[s]={}}))},jo=(0,Ee.oM)({name:"graphs",initialState:{layoutsByDatumId:{},matricesByDatumId:{},themeByGeneratorName:{},timeByDatumId:{},hiddenByDatumId:{},cndSpecByGeneratorName:{}},reducers:wo,extraReducers:e=>e.addCase(Be,vo)}),{asAttributeSet:Ao,cndSpecSet:So,edgeLabelStyleRemoved:Mo,edgeLabelStyleSet:Co,edgeStyleRemoved:Io,edgeStyleSet:Oo,edgeIndexSet:ko,edgeIndexRemoved:No,curveRemoved:zo,curveSet:Do,graphSpread:Eo,graphZoomed:_o,hiddenRelationAdded:Lo,nodeLabelStyleRemoved:To,nodeLabelStyleSet:Po,nodeLabelPropRemoved:Bo,nodeLabelPropSet:Ro,nodesOffset:Vo,projectionAdded:$o,projectionOrderingSet:Fo,projectionRemoved:Go,projectionSet:Zo,shapeRemoved:Wo,saveThemeRequested:Uo,shapeSet:qo,shapeStyleRemoved:Yo,shapeStyleSet:Xo,themeFileLoaded:Ho,timeIndexSet:Jo}=jo.actions,Qo=jo.reducer,Ko=e=>{const{datum:t}=e,n=jt(),s=At((e=>function(e,t){const n=Ir(0,t),r=Or(e,t).map((e=>e.type)),o=(0,nn.Z)((0,rn.Z)(n),r);return(0,on.Z)(n,o)}(e,t))),i=(0,rn.Z)(s),a=(0,o.useCallback)((e=>{const r=s[e][0];n($o({datum:t,type:e,atom:r,time:!0}))}),[t,s]);return 0===i.length?null:(0,r.jsx)(c.M5,Object.assign({my:2},{children:(0,r.jsxs)(co.v2,{children:[(0,r.jsx)(co.j2,Object.assign({as:A.zx,colorScheme:"green",size:"xs",leftIcon:(0,r.jsx)(po.f8n,{})},{children:"Add Time Projection"})),(0,r.jsx)(co.qy,{children:i.map((e=>(0,r.jsx)(co.sN,Object.assign({onClick:()=>a(e)},{children:e}),e)))})]})}))};var es=n(11391),ts=n(5434);const ns=e=>{const{type:t,atom:n,atoms:o,onChange:s,onNext:i,onPrevious:a,onRemove:l,onToggle:c}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",Object.assign({className:"text-sm px-2 flex items-center align-middle"},{children:t})),(0,r.jsx)("div",Object.assign({className:"flex items-center"},{children:(0,r.jsx)(es.Ph,Object.assign({className:"flex items-center",size:"xs",value:n,onChange:s},{children:o.map((e=>(0,r.jsx)("option",Object.assign({value:e},{children:e}),e)))}))})),(0,r.jsxs)("div",Object.assign({className:"px-2 flex items-center justify-end"},{children:[(0,r.jsxs)(A.hE,Object.assign({size:"xs",isAttached:!0},{children:[(0,r.jsx)(A.hU,{"aria-label":"Previous",icon:(0,r.jsx)(ts.G1X,{}),onClick:a}),(0,r.jsx)(A.hU,{"aria-label":"Remove",icon:(0,r.jsx)(ts.FU5,{}),onClick:l}),(0,r.jsx)(A.hU,{"aria-label":"Next",icon:(0,r.jsx)(ts.FNi,{}),onClick:i})]})),(0,r.jsx)(ts.G1X,{className:"-rotate-90 ml-2 cursor-pointer hover:text-black",onClick:c})]}))]})},rs=e=>{const{type:t,atom:n,atoms:o,relation:s,relations:i,onChange:a,onNext:l,onPrevious:c,onRelation:d,onRemove:p,onToggle:h,onHiddenRelation:u}=e;return(0,r.jsxs)("div",Object.assign({className:"m-2 p-2 col-span-3 flex flex-col border shadow"},{children:[(0,r.jsxs)("div",Object.assign({className:"flex justify-between pb-3"},{children:[(0,r.jsx)("div",Object.assign({className:"text-sm font-bold"},{children:t})),(0,r.jsx)(ts.G1X,{className:"rotate-90 cursor-pointer hover:text-black",onClick:h})]})),(0,r.jsxs)("div",Object.assign({className:"px-2 grid grid-cols-[minmax(max-content,auto)_minmax(max-content,auto)]"},{children:[(0,r.jsx)(es.Ph,Object.assign({size:"xs",value:n,onChange:a},{children:o.map((e=>(0,r.jsx)("option",Object.assign({value:e},{children:e}),e)))})),(0,r.jsx)("div",Object.assign({className:"mt-0.5 flex items-center justify-end"},{children:(0,r.jsxs)(A.hE,Object.assign({className:"px-2",size:"xs",isAttached:!0},{children:[(0,r.jsx)(A.zx,Object.assign({"aria-label":"Previous",leftIcon:(0,r.jsx)(ts.G1X,{}),onClick:c},{children:"Previous"})),(0,r.jsx)(A.zx,Object.assign({"aria-label":"Next",rightIcon:(0,r.jsx)(ts.FNi,{}),onClick:l},{children:"Next"}))]}))}))]})),(0,r.jsx)("div",Object.assign({className:"px-2 pt-2"},{children:s?(0,r.jsxs)("div",Object.assign({className:"px-2 text-sm flex justify-between items-center"},{children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("span",Object.assign({className:"font-semibold"},{children:s}))," defines total order"]}),(0,r.jsx)(ts.FU5,{onClick:()=>d(void 0)})]})):(0,r.jsxs)(co.v2,Object.assign({matchWidth:!0},{children:[(0,r.jsx)(co.j2,Object.assign({as:A.zx,width:"full",size:"xs",py:4},{children:"Select Ordering Relation"})),(0,r.jsx)(co.qy,{children:i.map((e=>(0,r.jsx)(co.sN,Object.assign({onClick:()=>d(e)},{children:e}),e)))})]}))})),(0,r.jsx)("div",Object.assign({className:"p-2"},{children:(0,r.jsxs)(co.v2,Object.assign({matchWidth:!0},{children:[(0,r.jsx)(co.j2,Object.assign({as:A.zx,width:"full",size:"xs",py:4},{children:"Hide a Relation"})),(0,r.jsx)(co.qy,{children:i.map((e=>(0,r.jsx)(co.sN,Object.assign({onClick:()=>u(e)},{children:e}),e)))})]}))})),(0,r.jsx)("div",Object.assign({className:"p-2"},{children:(0,r.jsx)(A.zx,Object.assign({"aria-label":"Remove",width:"full",size:"xs",py:4,colorScheme:"red",leftIcon:(0,r.jsx)(ts.FU5,{}),onClick:p},{children:"Remove Projection"}))}))]}))},os=e=>{const{datum:t,projection:n,atoms:s,relations:i}=e,{type:a,atom:l,timeOrdering:c}=n,[d,p]=(0,o.useState)(!1),h=jt(),u=(0,o.useCallback)((e=>{const n=e.target.value;h(Zo({datum:t,type:a,atom:n}))}),[t,a]),m=(0,o.useCallback)((()=>{if(l){const e=s.indexOf(l);e>0&&h(Zo({datum:t,type:a,atom:s[e-1]}))}}),[t,a,s,l]),g=(0,o.useCallback)((()=>{h(Go({datum:t,type:a}))}),[t,a]),f=(0,o.useCallback)((()=>{if(l){const e=s.indexOf(l);-1!==e&&e{h(Fo({datum:t,type:a,relation:e}))}),[t,a]),b=(0,o.useCallback)((e=>{h(Lo({datum:t,type:a,relation:e}))}),[t,a]),y=(0,o.useCallback)((()=>{p((e=>!e))}),[p]);return d?(0,r.jsx)(rs,{type:a,atom:l,atoms:s,relation:c,relations:i,onChange:u,onNext:f,onPrevious:m,onRemove:g,onRelation:x,onToggle:y,onHiddenRelation:b}):(0,r.jsx)(ns,{type:a,atom:l,atoms:s,relation:c,relations:i,onChange:u,onNext:f,onPrevious:m,onRemove:g,onRelation:x,onToggle:y,onHiddenRelation:b})},ss=({datum:e})=>{const t=At((t=>Ir(0,e))),n=At((t=>Or(t,e))).filter((e=>!0===e.time)),o=At((t=>function(e,t){return xt(t)?at(t.parsed.instances[0]).map((e=>e.name)):[]}(0,e)));return 0===n.length?null:(0,r.jsx)("div",Object.assign({className:"p-2 grid grid-cols-[minmax(min-content,max-content)_minmax(max-content,auto)_minmax(min-content,max-content)] gap-y-2"},{children:n.map((n=>{const s=n.type,i=t[s];return(0,r.jsx)(os,{datum:e,projection:n,atoms:i,relations:o},s)}))}))},is=({datum:e})=>At((t=>xr(0,e)))?null:(0,r.jsxs)("div",Object.assign({className:"flex flex-col justify-middle"},{children:[(0,r.jsx)(ss,{datum:e}),(0,r.jsx)(Ko,{datum:e})]}));var as=n(47516);const ls=e=>{const{collapsed:t,current:n,length:o,onChange:s,label:i,loopBack:a,onToggleCollapse:l}=e;return(0,r.jsx)("div",Object.assign({className:"flex"},{children:(0,r.jsxs)(A.hE,Object.assign({width:"full",isAttached:!0,size:"sm"},{children:[(0,r.jsx)(A.hU,{"aria-label":"First State",icon:(0,r.jsx)(as.pB9,{}),borderRadius:0,disabled:0===n,onClick:()=>s(0)}),(0,r.jsx)(A.hU,{"aria-label":"Previous State",borderRadius:0,icon:(0,r.jsx)(as.u_m,{}),disabled:0===n,onClick:()=>s(n-1)}),(0,r.jsx)(c.M5,Object.assign({width:"full",px:2,fontSize:"xs",bg:"gray.100"},{children:i(n)})),void 0!==a&&n===o-1?(0,r.jsx)(A.hU,{"aria-label":"Loop Back",borderRadius:0,icon:(0,r.jsx)(as.V3h,{}),onClick:()=>s(a)}):(0,r.jsx)(A.hU,{"aria-label":"First State",borderRadius:0,icon:(0,r.jsx)(as.OEZ,{}),disabled:n===o-1,onClick:()=>s(n+1)}),(0,r.jsx)(A.hU,{"aria-label":"Previous State",icon:(0,r.jsx)(as.xeH,{}),disabled:n===o-1,onClick:()=>s(o-1)}),(0,r.jsx)(A.hU,{"aria-label":"Toggle Minimap",size:"sm",borderRadius:0,borderLeftWidth:1,borderLeftColor:"gray.300",icon:t?(0,r.jsx)(as.OrA,{}):(0,r.jsx)(as.jRD,{}),onClick:()=>l()})]}))}))};function cs(e){const t={};return G(e).forEach((e=>{t[e.id]={type:"line"}})),t}function ds(e){const t={};return G(e).forEach((e=>{t[`${e.id}`]={stroke:"#4A5568",strokeWidth:1,fill:"none"}})),t}function ps(e,t){const n={};return $(e).forEach((e=>{const r=e.id===`${t}`;n[`${e.id}`]=[{text:e.id,style:{fill:r?"white":"#4A5568",fontFamily:"monospace",fontSize:"10px",fontWeight:r?"bold":"normal",textAnchor:"middle",userSelect:"none",cursor:"pointer"},props:{dy:"0.4em"}}]})),n}function hs(e){const t={};return $(e).forEach((e=>{t[`${e.id}`]={shape:"circle",radius:15}})),t}function us(e,t){const n={};return $(e).forEach((e=>{const r=e.id===`${t}`;n[e.id]={stroke:r?"#3B82F6":"#4A5568",strokeWidth:1,fill:r?"#3B82F6":"white",cursor:"pointer"}})),n}const ms=e=>{const t=function(e){return 50*(e.length-1)+45}(e),n=function(e){return void 0!==e.loopBack?75:45}(e),s=function(e){const{length:t,loopBack:n}=e,r=[],o=[],s=-50*(t-1)/2,i=void 0!==n?7.5:0;for(let e=0;e${e+1}`,source:`${e}`,target:`${e+1}`}):void 0!==n&&o.push({id:`${e}->${n}`,source:`${e}`,target:`${n}`,waypoints:[{x:s+50*e,y:i-30},{x:s+50*n,y:i-30}]});return Ot(r,o)}(e),i=`${-t/2} ${-n/2} ${t} ${n}`,a=(0,o.useRef)(null);return(0,r.jsx)("div",Object.assign({className:"grid place-items-center overflow-y-auto"},{children:(0,r.jsx)(we,Object.assign({svg:a.current,onMouseDown:()=>console.log("down"),onClickNode:t=>{e.onChange&&e.onChange(+t)}},{children:(0,r.jsx)("svg",Object.assign({ref:a,style:{minWidth:t},width:t,height:n,viewBox:i},{children:(0,r.jsx)(ze,{id:"minimap",graph:s,nodeShapes:hs(s),nodeStyles:us(s,e.current),nodeLabels:ps(s,e.current),edgeCurves:cs(s),edgeStyles:ds(s)})}))}))}))},gs=e=>{const{collapsed:t}=e;return(0,r.jsxs)("div",Object.assign({className:"border rounded mx-2"},{children:[(0,r.jsx)(ls,Object.assign({},e)),!t&&(0,r.jsx)(ms,Object.assign({},e))]}))},fs=({datum:e})=>{const t=jt(),[n,s]=(0,o.useState)(!1),i=At((t=>Tr(t,e))),a=At((t=>function(e,t){return xt(t)&&qt(t.parsed)?t.parsed.instances.length:1}(0,e))),l=At((t=>function(e,t){if(t&&xt(t)&&qt(t.parsed))return t.parsed.loopBack}(0,e))),c=(0,o.useCallback)((n=>{t(Jo({datum:e,index:n}))}),[e]);return(0,r.jsx)("div",Object.assign({className:"mx-1 my-2"},{children:(0,r.jsx)(gs,{collapsed:n,current:i,length:a,loopBack:l,label:e=>`State ${e+1}/${a}`,onChange:c,onToggleCollapse:()=>s((e=>!e))})}))},xs=({datum:e})=>At((t=>xr(0,e)))?(0,r.jsx)("div",Object.assign({className:"flex flex-col justify-middle"},{children:(0,r.jsx)(fs,{datum:e})})):null,bs=()=>{const e=At(ur);return e?(0,r.jsxs)("div",Object.assign({className:"absolute inset-0 flex flex-col overflow-y-auto"},{children:[(0,r.jsx)(is,{datum:e}),(0,r.jsx)(xs,{datum:e})]})):null},ys=()=>(0,r.jsxs)("div",Object.assign({className:"flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(Qr.JO,{as:lo.rHK}),(0,r.jsx)(k,{children:"Time"})]}));var ws=n(47398);const vs={activeDatumSet:function(e,t){e.active=t.payload},dumpClicked:function(e){console.log((0,St.Vk)(e))}};var js=n(3231),As=n(54354),Ss=n(20924);const Ms=function(e,t){const{enter:n,update:r,exit:o}=t.payload;if(n){(0,js.Z)(n,(t=>{const n=t.id;e.datumById[n]||(e.datumById[n]=t,e.datumIds.push(n))}));const t=(0,Dt.Z)(n);t&&(e.active=t.id)}r&&(0,Ft.Z)(r,(t=>{const n=t.id;e.datumById[n]&&(0,As.Z)(e.datumById[n],t)})),o&&(0,Ft.Z)(o,(t=>{if(e.datumById[t]){delete e.datumById[t];const n=(0,Ss.Z)(e.datumIds,t);n>-1&&e.datumIds.splice(n,1),e.active===t&&(e.active=e.datumIds.length?e.datumIds[0]:null)}}))},Cs=(0,Ee.oM)({name:"data",initialState:{active:null,datumById:{},datumIds:[]},reducers:vs,extraReducers:e=>e.addCase(Be,Ms)}),{activeDatumSet:Is,dumpClicked:Os}=Cs.actions,ks=Cs.reducer;var Ns=n(2585),zs=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{const{className:t,onClick:n}=e,o=zs(e,["className","onClick"]);return(0,r.jsx)("div",Object.assign({className:`contents ${n?"group":""} ${t||""}`,onClick:n},o))},Es=e=>{const{className:t}=e,n=zs(e,["className"]);return(0,r.jsx)("div",Object.assign({className:`\n flex items-center prose prose-sm truncate px-1 py-0.5 first:pl-2 last:pr-2 group-hover:bg-blue-600 group-active:bg-blue-700 group-hover:text-white select-none cursor-default group-hover:cursor-pointer ${t||""}`},n))},_s=e=>{var t;const{datum:n,active:o,onClickItem:s}=e,i=At((e=>function(e,t){return xr(0,t)}(0,n))),a=At((e=>function(e,t){return(Or(e,t)||[]).some((e=>!0===e.time))}(e,n))),l=o?"text-white bg-blue-600":"";return(0,r.jsxs)(Ds,Object.assign({onClick:e=>s(e,n)},{children:[(0,r.jsxs)(Es,Object.assign({className:l},{children:["Instance ",n.id," (from: '",null!==(t=n.generatorName)&&void 0!==t?t:"UNNAMED","')"]})),(0,r.jsx)(Es,Object.assign({className:l},{children:n.evaluator&&(0,r.jsx)(Qr.JO,{as:Kr.RJr})})),(0,r.jsxs)(Es,Object.assign({className:l},{children:[i&&(0,r.jsx)(Qr.JO,{as:lo.rHK}),a&&(0,r.jsx)(Qr.JO,{as:Ns.sYI})]}))]}))},Ls=e=>{const{data:t,active:n}=e,s=jt(),i=(0,o.useCallback)(((e,t)=>{s(Is(t.id))}),[]);return(0,r.jsx)("div",Object.assign({className:"w-full grid grid-cols-[minmax(max-content,auto)_repeat(2,min-content)]"},{children:t.map((e=>{const{id:t}=e;return(0,r.jsx)(_s,{datum:e,active:e===n,onClickItem:i},t)}))}))},Ts=function(e,t){const n=t.payload;n.views&&(e.availableViews=n.views.map((e=>{switch(e){case"graph":return"GraphView";case"table":return"TableView";case"script":return"ScriptView"}})),e.mainView=e.availableViews[0],n.generators&&n.generators.length>0&&(e.selectedGenerator=n.generators[0]))},Ps={availableViews:["GraphView","TableView","ScriptView"],mainView:"ScriptView",graphViewDrawer:"explorer",tableViewDrawer:null,scriptViewDrawer:"variables",selectedGenerator:void 0};const Bs=(0,Ee.oM)({name:"ui",initialState:Ps,reducers:{mainViewChanged:function(e,t){e.mainView=t.payload},commonDrawerViewChanged:function(e,t){const n=t.payload;switch(e.mainView){case"GraphView":e.graphViewDrawer=n===e.graphViewDrawer?null:n;break;case"TableView":e.tableViewDrawer=n===e.tableViewDrawer?null:n;break;case"ScriptView":e.scriptViewDrawer=n===e.scriptViewDrawer?null:n}},graphDrawerViewChanged:function(e,t){const n=t.payload;e.graphViewDrawer=n===e.graphViewDrawer?null:n},tableDrawerViewChanged:function(e,t){const n=t.payload;e.tableViewDrawer=n===e.tableViewDrawer?null:n},scriptDrawerViewChanged:function(e,t){const n=t.payload;e.scriptViewDrawer=n===e.scriptViewDrawer?null:n},selectedGeneratorChanged:function(e,t){const n=t.payload;e.selectedGenerator=n.generatorName}},extraReducers:e=>{e.addCase(Ve,Ts)}}),{mainViewChanged:Rs,commonDrawerViewChanged:Vs,graphDrawerViewChanged:$s,tableDrawerViewChanged:Fs,scriptDrawerViewChanged:Gs,selectedGeneratorChanged:Zs}=Bs.actions,Ws=Bs.reducer,Us=()=>{const e=At(ur),t=At(fr),n=At(Nr),s=jt(),i=At(mr);if(!e&&(!n||n.length<1))return null;const a=!t.some((e=>e.generatorName==i)),l=(0,o.useCallback)((()=>{void 0!==i&&a&&(console.log(`Running new generator: ${i}`),s(_e({id:void 0,onClick:"next",context:{generatorName:i}})))}),[i,t]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(c.xu,Object.assign({p:1,shadow:"md",borderWidth:"1px"},{children:[(0,r.jsx)(c.X6,Object.assign({fontSize:"sm",align:"center",fontWeight:"medium"},{children:"Select an Available Command"})),(0,r.jsxs)(c.kC,{children:[(0,r.jsx)(es.Ph,Object.assign({isDisabled:!n||n.length<1,value:i,onChange:e=>{const n=e.target.value,r=t.filter((e=>e.generatorName==n)).reverse()[0];console.log(`Selecting generator: ${n}. Latest id: ${null==r?void 0:r.id}`),s(Zs({generatorName:n})),s(Is(r?r.id:""))}},{children:null==n?void 0:n.map(((e,t)=>(0,r.jsx)("option",{children:e},t)))})),(0,r.jsx)(A.zx,Object.assign({size:"sm",margin:"1",onClick:l,isDisabled:!n||n.length<1||i&&(null==e?void 0:e.generatorName)===i||!a},{children:(0,r.jsx)(ws.u,Object.assign({hasArrow:!0,label:"Re-run Forge to refresh this command.",isDisabled:a},{children:"Run"}))}))]})]})),(0,r.jsx)(c.xu,Object.assign({p:1,shadow:"md",borderWidth:"1px"},{children:(0,r.jsxs)(c.X6,Object.assign({fontSize:"xs",align:"center",fontWeight:"normal"},{children:["Instance History for ",(0,r.jsx)("i",{children:i})]}))})),(0,r.jsx)("hr",{}),(0,r.jsx)("div",Object.assign({"aria-label":"explorer pane instance selector",className:"absolute flex flex-col overflow-y-auto"},{children:(0,r.jsx)(Ls,{data:t.filter((e=>e.generatorName==i)),active:e})}))]})},qs=()=>(0,r.jsxs)("div",Object.assign({className:"flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(Qr.JO,{as:lo.rHK}),(0,r.jsx)(k,{children:"Explorer"})]}));var Ys=n(79352);const Xs=()=>{const e=jt(),t=At(ur),n=(0,o.useRef)(null),s=(0,o.useRef)(null),i=(0,o.useRef)(null),[a,l]=(0,o.useState)(!1),[c,d]=(0,o.useState)(!1),[p,h]=(0,o.useState)(!1),[u,m]=(0,o.useState)({}),g=At((e=>t?Rr(e,t):void 0));(0,o.useEffect)((()=>{m({}),window.currentProjections&&(window.currentProjections={}),console.log("Projections reset for new datum")}),[t]),(0,o.useEffect)((()=>{if(!document.getElementById("spytial-bootstrap-stylesheet")){const e=document.createElement("link");e.id="spytial-bootstrap-stylesheet",e.rel="stylesheet",e.href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css",e.integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM",e.crossOrigin="anonymous",document.head.appendChild(e)}}),[]),(0,o.useEffect)((()=>{if(s.current&&window.mountErrorMessageModal&&!c)try{window.mountErrorMessageModal("layout-error-mount"),d(!0),console.log("SpyTial Error Modal mounted in Layout Drawer")}catch(e){console.error("Failed to mount SpyTial Error Modal:",e)}}),[c]);const f=(0,o.useCallback)(((n,r)=>{var o;if(console.log(`Projection changed: ${n} -> ${r}`),m((e=>Object.assign(Object.assign({},e),{[n]:r}))),window.currentProjections||(window.currentProjections={}),window.currentProjections[n]=r,t){const n=(null===(o=window.getCurrentCNDSpecFromReact)||void 0===o?void 0:o.call(window))||"";e(So({datum:t,spec:n}))}}),[t,e]);return(0,o.useEffect)((()=>{if(i.current&&window.mountProjectionControls&&t)try{window.mountProjectionControls("layout-projection-mount",f),h(!0),console.log("Projection Controls mounted in Layout Drawer")}catch(e){console.error("Failed to mount Projection Controls:",e)}return()=>{h(!1)}}),[t,f]),(0,o.useEffect)((()=>{var e;if(n.current&&!a&&t){const t="directives:\n - flag: hideDisconnectedBuiltIns",n={initialYamlValue:g&&""!==g?g:t,initialDirectives:g&&""!==g?void 0:[{flag:"hideDisconnectedBuiltIns"}]};try{(null===(e=window.CndCore)||void 0===e?void 0:e.mountCndLayoutInterface)?(window.CndCore.mountCndLayoutInterface("cnd-editor-mount",n),l(!0),console.log("CnD Layout Interface mounted via CndCore"+(g?" with preloaded spec":" with default directives"))):window.mountCndLayoutInterface&&(window.mountCndLayoutInterface("cnd-editor-mount",n),l(!0),console.log("CnD Layout Interface mounted"+(g?" with preloaded spec":" with default directives")))}catch(e){console.error("Failed to mount CnD Layout Interface:",e)}}}),[a,t,g]),t?(0,r.jsxs)("div",Object.assign({className:"absolute inset-0 flex flex-col overflow-y-auto bg-slate-50/90 text-slate-900"},{children:[(0,r.jsx)("div",{id:"layout-error-mount",ref:s,className:"flex-shrink-0","aria-live":"polite"}),(0,r.jsxs)("div",Object.assign({className:"flex-1 space-y-3 p-3"},{children:[(0,r.jsx)("div",{id:"layout-projection-mount",ref:i,className:"rounded-lg border border-slate-200 bg-white/90 p-2 shadow-sm"}),(0,r.jsxs)("div",Object.assign({className:"flex gap-2"},{children:[(0,r.jsx)("button",Object.assign({type:"button",onClick:n=>{var r;if(n.preventDefault(),!t)return;window.clearAllErrors&&window.clearAllErrors();const o=(null===(r=window.getCurrentCNDSpecFromReact)||void 0===r?void 0:r.call(window))||"";e(So({datum:t,spec:o}))},className:"flex-1 rounded-lg bg-indigo-600 px-4 py-2.5 text-sm font-medium text-white shadow-sm transition hover:bg-indigo-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-2"},{children:"Apply Layout"})),(0,r.jsxs)("label",Object.assign({className:"group relative flex-1 cursor-pointer"},{children:[(0,r.jsxs)("div",Object.assign({className:"flex items-center justify-center gap-2 rounded-lg border-2 border-dashed border-slate-300 bg-white px-4 py-2.5 text-sm font-medium text-slate-600 transition hover:border-indigo-400 hover:text-indigo-600 focus-within:border-indigo-500 focus-within:ring-2 focus-within:ring-indigo-200"},{children:[(0,r.jsx)("svg",Object.assign({className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},{children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})})),"Upload .cnd"]})),(0,r.jsx)("input",{type:"file",accept:".cnd",onChange:n=>{var r;if(!t)return;const o=null===(r=n.target.files)||void 0===r?void 0:r[0];if(o){const n=new FileReader;n.onload=n=>{var r;const o=null===(r=n.target)||void 0===r?void 0:r.result;e(So({datum:t,spec:o}))},n.readAsText(o)}},className:"absolute inset-0 h-full w-full cursor-pointer opacity-0","aria-label":"Upload .cnd layout file"})]}))]})),(0,r.jsx)("div",Object.assign({className:"rounded-lg border border-slate-200 bg-white shadow-sm p-3"},{children:(0,r.jsx)("div",{id:"cnd-editor-mount",ref:n,className:"min-h-[360px] overflow-hidden rounded-lg border border-slate-200 bg-slate-50"})}))]}))]})):null},Hs=()=>(0,r.jsxs)("div",Object.assign({className:"w-full flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(Qr.JO,{as:Ys.vWf}),(0,r.jsx)(k,{children:"Layout"})]})),Js=(0,Ee.oM)({name:"synthesis",initialState:{isActive:!1,selectorType:"unary",numInstances:3,currentStep:0,examples:[],draftSelection:{atomIds:[],pairs:[]},loadedInstances:[],currentDataInstance:null,result:null,error:null,isLoading:!1},reducers:{enterSynthesisMode:function(e,t){e.isActive=!0,e.selectorType=t.payload.selectorType,e.numInstances=t.payload.numInstances,e.currentStep=0,e.examples=[],e.loadedInstances=[],e.result=null,e.error=null,e.isLoading=!0},exitSynthesisMode:function(e){e.isActive=!1,e.currentStep=0,e.examples=[],e.loadedInstances=[],e.result=null,e.error=null,e.isLoading=!1},synthesisInstancesLoaded:function(e,t){e.loadedInstances=t.payload.instances,e.isLoading=!1,0===e.currentStep&&(e.currentStep=1)},synthesisLoadError:function(e,t){e.error=t.payload.error,e.isLoading=!1},addSynthesisExample:function(e,t){e.examples.push(t.payload),e.currentStep<=e.numInstances&&e.currentStep++},updateSynthesisExample:function(e,t){const{instanceIndex:n,selectedAtomIds:r,selectedPairs:o}=t.payload,s=e.examples.findIndex((e=>e.instanceIndex===n));s>=0&&(void 0!==r&&(e.examples[s].selectedAtomIds=r),void 0!==o&&(e.examples[s].selectedPairs=o))},synthesisStepBack:function(e){e.currentStep>1&&(e.currentStep--,e.examples.length>=e.currentStep&&e.examples.pop())},setSynthesisResult:function(e,t){e.result=t.payload,e.error=null,e.isLoading=!1},setSynthesisError:function(e,t){e.error=t.payload.error,e.result=null,e.isLoading=!1},startSynthesis:function(e){e.isLoading=!0,e.error=null},updateDraftSelection:function(e,t){void 0!==t.payload.atomIds&&(e.draftSelection.atomIds=t.payload.atomIds),void 0!==t.payload.pairs&&(e.draftSelection.pairs=t.payload.pairs)},commitDraftSelection:function(e,t){const{instanceIndex:n,dataInstance:r,atomIds:o=[],pairs:s=[]}=t.payload,i=e.examples.findIndex((e=>e.instanceIndex===n));i>=0?(e.examples[i].selectedAtomIds=o,e.examples[i].selectedPairs=s,e.examples[i].dataInstance=r):e.examples.push({instanceIndex:n,selectedAtomIds:[...o],selectedPairs:[...s],dataInstance:r}),e.draftSelection={atomIds:[],pairs:[]},e.currentStep<=e.numInstances&&e.currentStep++},setCurrentDataInstance:function(e,t){e.currentDataInstance=t.payload.dataInstance}}}),{enterSynthesisMode:Qs,exitSynthesisMode:Ks,synthesisInstancesLoaded:ei,synthesisLoadError:ti,addSynthesisExample:ni,updateSynthesisExample:ri,synthesisStepBack:oi,setSynthesisResult:si,setSynthesisError:ii,startSynthesis:ai,updateDraftSelection:li,commitDraftSelection:ci,setCurrentDataInstance:di}=Js.actions,pi=Js.reducer;var hi=n(38152),ui=n(79762),mi=n(9680),gi=n(72773);const fi=()=>{const e=jt(),t=At(ur),[n,s]=(0,o.useState)(3),[i,a]=(0,o.useState)("unary"),[l,d]=(0,o.useState)(!1);return(0,r.jsx)("div",Object.assign({className:"p-8 max-w-2xl mx-auto"},{children:(0,r.jsxs)(c.gC,Object.assign({spacing:6,align:"stretch"},{children:[(0,r.jsx)("div",{children:(0,r.jsx)(c.xv,Object.assign({fontSize:"2xl",fontWeight:"bold",mb:2},{children:"Selector Synthesis"}))}),(0,r.jsxs)(ui.NI,{children:[(0,r.jsx)(ui.lX,{children:"Selector Type"}),(0,r.jsx)(mi.Ee,Object.assign({value:i,onChange:e=>a(e)},{children:(0,r.jsxs)(c.Kq,Object.assign({direction:"column",spacing:3},{children:[(0,r.jsx)(mi.Y8,Object.assign({value:"unary"},{children:(0,r.jsx)(c.xv,Object.assign({fontWeight:"semibold"},{children:"Unary Selector (Atoms)"}))})),(0,r.jsx)(mi.Y8,Object.assign({value:"binary"},{children:(0,r.jsx)(c.xv,Object.assign({fontWeight:"semibold"},{children:"Binary Selector (Pairs/Relations)"}))}))]}))}))]}),(0,r.jsxs)(ui.NI,{children:[(0,r.jsx)(ui.lX,{children:"Number of Instances"}),(0,r.jsxs)(gi.Y2,Object.assign({value:n,onChange:(e,t)=>s(t),min:1,max:10,step:1},{children:[(0,r.jsx)(gi.zu,{}),(0,r.jsxs)(gi.Fi,{children:[(0,r.jsx)(gi.WQ,{}),(0,r.jsx)(gi.Y_,{})]})]}))]}),(0,r.jsx)(A.zx,Object.assign({colorScheme:"blue",size:"lg",onClick:()=>{return r=void 0,o=void 0,a=function*(){if(t&&window.CndCore){d(!0),e(Qs({numInstances:n,selectorType:i}));try{const n=t.data,r=window.CndCore.AlloyInstance.parseAlloyXML(n);if(!r.instances||0===r.instances.length)throw new Error("No instances found in Alloy XML");const o=new window.CndCore.AlloyDataInstance(r.instances[0]);console.log("[SynthesisSetup] Starting with first instance"),e(ei({instances:[o]}))}catch(t){e(ti({error:t.message})),d(!1)}}},new((s=void 0)||(s=Promise))((function(e,t){function n(e){try{l(a.next(e))}catch(e){t(e)}}function i(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof s?r:new s((function(e){e(r)}))).then(n,i)}l((a=a.apply(r,o||[])).next())}));var r,o,s,a},isLoading:l,loadingText:"Loading instances...",w:"full"},{children:"Start Synthesis"}))]}))}))};var xi=n(4612);const bi=()=>{const e=jt(),t=At(Gr),n=At(Wr),s=At(Ur),i=At(Zr),a=At(ur),l=At(Jr),[d,p]=(0,o.useState)(""),[h,u]=(0,o.useState)([]),m=t-1,g=s[m],f=n.find((e=>e.instanceIndex===m));return(0,o.useEffect)((()=>{if(f)u(f.selectedAtomIds),p(f.selectedAtomIds.join(", "));else{u([]),p("");const e=document.querySelector("webcola-cnd-graph");e&&e.clearNodeHighlights&&e.clearNodeHighlights()}}),[m,f]),(0,o.useEffect)((()=>{const e=d.split(",").map((e=>e.trim())).filter((e=>e.length>0));u(e)}),[d]),g?(0,r.jsxs)("div",Object.assign({className:"flex flex-col h-full"},{children:[(0,r.jsxs)("div",Object.assign({className:"p-4 bg-blue-50 border-b border-blue-200"},{children:[(0,r.jsxs)(c.xv,Object.assign({fontSize:"sm",fontWeight:"semibold",mb:1,color:"blue.900"},{children:["Instance ",m+1," of ",i]})),(0,r.jsx)(c.xv,Object.assign({fontSize:"xs",color:"blue.700"},{children:"Enter atom IDs (comma-separated) that should match your selector. Atoms will be highlighted in the graph in real-time."}))]})),(0,r.jsx)("div",Object.assign({className:"p-4 space-y-4"},{children:(0,r.jsxs)("div",{children:[(0,r.jsx)("label",Object.assign({className:"block text-sm font-medium text-gray-700 mb-2"},{children:"Atom IDs (comma-separated)"})),(0,r.jsx)(xi.II,{value:d,onChange:e=>p(e.target.value),onBlur:()=>{const e=document.querySelector("webcola-cnd-graph");if(e){if(e.clearNodeHighlights&&e.clearNodeHighlights(),h.length>0&&e.highlightNodes){const t=e.highlightNodes(h);console.log("[SynthesisExample] Highlighted nodes:",h,"success:",t)}}else console.warn("[SynthesisExample] Graph element not found")},size:"lg",fontFamily:"monospace"})]})})),(0,r.jsx)("div",{className:"flex-1"}),(0,r.jsx)("div",Object.assign({className:"p-4 border-t bg-gray-50"},{children:(0,r.jsx)(A.zx,Object.assign({w:"full",colorScheme:"blue",size:"lg",onClick:()=>{l?(console.log("[SynthesisExample] Committing selection:",{instanceIndex:m,atomIds:h}),e(ci({instanceIndex:m,dataInstance:l,atomIds:h})),t{const e=jt(),t=At(Gr),n=At(Wr),s=At(Ur),i=At(Zr),a=At(ur),l=At(Jr),[d,p]=(0,o.useState)(""),[h,u]=(0,o.useState)([]),[m,g]=(0,o.useState)(null),f=t-1,x=s[f],b=n.find((e=>e.instanceIndex===f));return(0,o.useEffect)((()=>{if(b){u(b.selectedPairs);const e=b.selectedPairs.map((([e,t])=>`${e}:${t}`)).join(", ");p(e)}else{u([]),p("");const e=document.querySelector("webcola-cnd-graph");e&&e.clearNodeHighlights&&e.clearNodeHighlights()}}),[f,b]),(0,o.useEffect)((()=>{if(g(null),""===d.trim())return void u([]);const e=d.split(",").map((e=>e.trim())).filter((e=>e)),t=[];for(const n of e){const e=n.split(":");if(2!==e.length)return void g(`Invalid pair format: "${n}". Use format: First:Second`);const[r,o]=e.map((e=>e.trim()));if(!r||!o)return void g(`Empty node ID in pair: "${n}"`);t.push([r,o])}u(t)}),[d]),x?(0,r.jsxs)("div",Object.assign({className:"flex flex-col h-full"},{children:[(0,r.jsxs)("div",Object.assign({className:"p-4 bg-purple-50 border-b border-purple-200"},{children:[(0,r.jsxs)(c.xv,Object.assign({fontSize:"sm",fontWeight:"semibold",mb:1,color:"purple.900"},{children:["Instance ",f+1," of ",i," - Binary Selector"]})),(0,r.jsxs)(c.xv,Object.assign({fontSize:"xs",color:"purple.700"},{children:["Enter pairs of atom IDs (format: First:Second) separated by commas.",(0,r.jsx)("br",{}),"Pairs will be highlighted with arrows in the graph."]}))]})),(0,r.jsx)("div",Object.assign({className:"p-4 space-y-4"},{children:(0,r.jsxs)("div",{children:[(0,r.jsx)("label",Object.assign({className:"block text-sm font-medium text-gray-700 mb-2"},{children:"Node Pairs (format: First:Second, comma-separated)"})),(0,r.jsx)(xi.II,{value:d,onChange:e=>p(e.target.value),onBlur:()=>{const e=document.querySelector("webcola-cnd-graph");if(e){if(e.clearNodeHighlights&&e.clearNodeHighlights(),h.length>0&&!m&&e.highlightNodePairs){const t=e.highlightNodePairs(h,{showBadges:!0});console.log("[BinaryExample] Highlighted pairs:",h,"success:",t)}}else console.warn("[BinaryExample] Graph element not found")},size:"lg",fontFamily:"monospace",isInvalid:null!==m}),m&&(0,r.jsx)(c.xv,Object.assign({fontSize:"xs",color:"red.600",mt:1},{children:m}))]})})),(0,r.jsx)("div",{className:"flex-1"}),(0,r.jsx)("div",Object.assign({className:"p-4 border-t bg-gray-50"},{children:(0,r.jsx)(A.zx,Object.assign({w:"full",colorScheme:"purple",size:"lg",onClick:()=>{l?(console.log("[BinaryExample] Committing selection:",{instanceIndex:f,pairs:h}),e(ci({instanceIndex:f,dataInstance:l,pairs:h})),t{const e=jt(),t=At(ur),n=At(qr),o=At(Fr),s=At(Wr),i=At((e=>t?Rr(e,t):""));if(!n||!t)return(0,r.jsx)("div",Object.assign({className:"p-8 text-center"},{children:(0,r.jsx)(c.xv,Object.assign({color:"gray.500"},{children:"No synthesis result available"}))}));const a="unary"===o,l=a?n.matchesByInstance:n.pairMatchesByInstance;return(0,r.jsx)("div",Object.assign({className:"p-6 max-w-4xl mx-auto"},{children:(0,r.jsxs)(c.gC,Object.assign({spacing:6,align:"stretch"},{children:[(0,r.jsxs)(c.xu,Object.assign({borderWidth:2,borderColor:"green.500",rounded:"lg",p:4,bg:"green.50"},{children:[(0,r.jsxs)(c.xv,Object.assign({fontSize:"sm",fontWeight:"semibold",color:"green.700",mb:2},{children:["Synthesized ",a?"Unary":"Binary"," Selector"]})),(0,r.jsx)(c.EK,Object.assign({p:3,rounded:"md",fontSize:"lg",fontWeight:"bold",display:"block",bg:"white"},{children:n.expression}))]})),(0,r.jsxs)(c.xu,{children:[(0,r.jsx)(c.xv,Object.assign({fontSize:"lg",fontWeight:"semibold",mb:3},{children:"Matches Across Instances"})),(0,r.jsx)(wi.UQ,Object.assign({allowMultiple:!0},{children:l.map(((e,t)=>{const n=s[t];let o=!1;if(a){const t=e;o=n&&n.selectedAtomIds.every((e=>t.matchedAtomIds.includes(e)))&&n.selectedAtomIds.length===t.matchedAtomIds.length}else{const t=e,r=(null==n?void 0:n.selectedPairs)||[];o=r.every((([e,n])=>t.matchedPairs.some((([t,r])=>t===e&&r===n||t===n&&r===e))))&&r.length===t.matchedPairs.length}const i=a?e.matchedAtomIds.length:e.matchedPairs.length;return(0,r.jsxs)(wi.Qd,{children:[(0,r.jsx)("h2",{children:(0,r.jsxs)(wi.KF,{children:[(0,r.jsx)(c.xu,Object.assign({flex:"1",textAlign:"left"},{children:(0,r.jsxs)(c.Ug,{children:[(0,r.jsxs)(c.xv,Object.assign({fontWeight:"semibold"},{children:["Instance ",e.instanceIndex+1]})),(0,r.jsxs)(c.Ct,Object.assign({colorScheme:o?"green":"yellow"},{children:[i," matches"]})),o?(0,r.jsxs)(c.Ct,Object.assign({colorScheme:"green"},{children:[(0,r.jsx)(ts.HhX,{})," Exact"]})):(0,r.jsx)(c.Ct,Object.assign({colorScheme:"yellow"},{children:"Partial"}))]})})),(0,r.jsx)(wi.XE,{})]})}),(0,r.jsx)(wi.Hk,Object.assign({pb:4},{children:a?(0,r.jsxs)(c.gC,Object.assign({align:"stretch",spacing:2},{children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(c.xv,Object.assign({fontSize:"sm",fontWeight:"semibold",mb:1},{children:"You selected:"})),(0,r.jsx)("div",Object.assign({className:"flex flex-wrap gap-1"},{children:null==n?void 0:n.selectedAtomIds.map((e=>(0,r.jsx)(c.Ct,Object.assign({colorScheme:"blue"},{children:e}),e)))}))]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(c.xv,Object.assign({fontSize:"sm",fontWeight:"semibold",mb:1},{children:"Selector matches:"})),(0,r.jsx)("div",Object.assign({className:"flex flex-wrap gap-1"},{children:e.matchedAtomIds.map((e=>(0,r.jsxs)(c.Ct,Object.assign({colorScheme:(null==n?void 0:n.selectedAtomIds.includes(e))?"green":"orange"},{children:[e,!(null==n?void 0:n.selectedAtomIds.includes(e))&&" (extra)"]}),e)))}))]})]})):(0,r.jsxs)(c.gC,Object.assign({align:"stretch",spacing:2},{children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(c.xv,Object.assign({fontSize:"sm",fontWeight:"semibold",mb:1},{children:"You selected:"})),(0,r.jsx)(c.gC,Object.assign({align:"stretch",spacing:1},{children:null==n?void 0:n.selectedPairs.map((([e,t],n)=>(0,r.jsxs)(c.Ug,{children:[(0,r.jsx)(c.Ct,Object.assign({colorScheme:"blue"},{children:e})),(0,r.jsx)(ts.hdK,{}),(0,r.jsx)(c.Ct,Object.assign({colorScheme:"blue"},{children:t}))]},n)))}))]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(c.xv,Object.assign({fontSize:"sm",fontWeight:"semibold",mb:1},{children:"Selector matches:"})),(0,r.jsx)(c.gC,Object.assign({align:"stretch",spacing:1},{children:e.matchedPairs.map((([e,t],o)=>{const s=null==n?void 0:n.selectedPairs.some((([n,r])=>n===e&&r===t||n===t&&r===e));return(0,r.jsxs)(c.Ug,{children:[(0,r.jsx)(c.Ct,Object.assign({colorScheme:s?"green":"orange"},{children:e})),(0,r.jsx)(ts.hdK,{}),(0,r.jsx)(c.Ct,Object.assign({colorScheme:s?"green":"orange"},{children:t})),!s&&(0,r.jsx)(c.xv,Object.assign({fontSize:"xs"},{children:"(extra)"}))]},o)}))}))]})]}))}))]},e.instanceIndex)}))}))]}),(0,r.jsxs)(c.Ug,Object.assign({spacing:3,pt:4},{children:[(0,r.jsx)(A.zx,Object.assign({flex:1,colorScheme:"green",leftIcon:(0,r.jsx)(ts.HhX,{}),onClick:()=>{const r=i?`${i}\n\n# Synthesized ${o} selector\n# ${n.expression}\n`:`# Synthesized ${o} selector\n# ${n.expression}\n`;e(So({datum:t,spec:r})),e(Ks())},size:"lg"},{children:"Accept & Insert into Spec"})),(0,r.jsx)(A.zx,Object.assign({flex:1,variant:"outline",leftIcon:(0,r.jsx)(ts.FU5,{}),onClick:()=>{e(Ks())},size:"lg"},{children:"Reject & Try Again"}))]})),(0,r.jsx)(c.xu,Object.assign({bg:"blue.50",p:4,rounded:"md",borderWidth:1,borderColor:"blue.200"},{children:(0,r.jsxs)(c.xv,Object.assign({fontSize:"sm",color:"gray.700"},{children:[(0,r.jsx)("strong",{children:"Next steps:"})," The selector will be added as a comment in your CnD spec. You can use it in constraints (e.g., ",(0,r.jsxs)(c.EK,{children:["right(",n.expression,")"]}),") or directives (e.g., ",(0,r.jsxs)(c.EK,{children:["color red(",n.expression,")"]}),")."]}))}))]}))}))};const ji=()=>{const e=jt(),t=At(ur),n=At($r),s=At(Fr),i=At(Gr),a=At(Zr),l=At(Wr),d=(At(Ur),At(qr)),p=At(Yr),h=At(Xr),u=At(Hr),m=i>a&&null===d&&!h&&!p&&l.length===a,g=l.every((e=>e.selectedAtomIds.length>0||e.selectedPairs.length>0));if(console.log("[SynthesisPanel] State:",{currentStep:i,numInstances:a,result:d,isLoading:h,error:p,examplesLength:l.length,shouldSynthesize:m,canSynthesize:u,examplesHaveSelections:g,examples:l.map((e=>({instanceIndex:e.instanceIndex,selectedAtomIds:e.selectedAtomIds,selectedPairs:e.selectedPairs,hasDataInstance:!!e.dataInstance})))}),(0,o.useEffect)((()=>{var n,r,o,i;m&&u&&(console.log("[SynthesisPanel] Auto-triggering synthesis"),n=void 0,r=void 0,i=function*(){if(t&&window.CndCore){e(ai());try{const t=e=>new window.CndCore.AlloyDataInstance(e),n=(e,t)=>{const n=e.getAtoms();console.log("[Synthesis] Looking for atom:",t,"in",n.length,"atoms"),console.log("[Synthesis] Available atom IDs:",n.map((e=>e.id)));const r=n.find((e=>e.id===t));if(!r)throw new Error(`Atom not found: ${t}`);return r};if("unary"===s){console.log("[Synthesis] Starting unary synthesis with",l.length,"examples"),console.log("[Synthesis] Examples:",l.map((e=>({instanceIndex:e.instanceIndex,selectedAtomIds:e.selectedAtomIds,hasDataInstance:!!e.dataInstance}))));const r=l.map(((e,r)=>{const o=e.dataInstance;if(console.log(`[Synthesis] Example ${r}: rawInstanceData =`,o),!o)throw new Error(`Example ${e.instanceIndex+1}: Missing data instance`);const s=t(o);console.log(`[Synthesis] Example ${r}: recreated AlloyDataInstance with ${s.getAtoms().length} atoms`);const i=e.selectedAtomIds.map((e=>n(s,e)));return console.log(`[Synthesis] Example ${r}: converted ${e.selectedAtomIds.length} IDs to atoms`),{atoms:i,dataInstance:s}}));console.log("[Synthesis] Calling synthesizeAtomSelectorWithExplanation with:",r);const o=window.CndCore.synthesizeAtomSelectorWithExplanation(r,3);if(console.log("[Synthesis] Result:",o),!o)throw new Error("Synthesis failed - no selector found");const s=l.map(((e,n)=>{const r=t(e.dataInstance),s=new window.CndCore.SGraphQueryEvaluator;s.initialize({sourceData:r});const i=s.evaluate(o.expression);return{instanceIndex:n,matchedAtomIds:i.selectedAtoms?i.selectedAtoms().map((e=>e.id)):[]}}));e(si({expression:o.expression,explanation:o.explanation||null,matchesByInstance:s,pairMatchesByInstance:[]}))}else{const r=l.map((e=>{const r=e.dataInstance;if(!r)throw new Error(`Example ${e.instanceIndex+1}: Missing data instance`);const o=t(r);return{pairs:e.selectedPairs.map((([e,t])=>[n(o,e),n(o,t)])),dataInstance:o}})),o=window.CndCore.synthesizeBinarySelectorWithExplanation(r,3);if(!o)throw new Error("Synthesis failed - no binary selector found");const s=l.map(((e,n)=>{const r=t(e.dataInstance),s=new window.CndCore.SGraphQueryEvaluator;s.initialize({sourceData:r});const i=s.evaluate(o.expression);return{instanceIndex:n,matchedPairs:(i.selectedTuplesAll?i.selectedTuplesAll():[]).map((e=>[e[0].id,e[1].id]))}}));e(si({expression:o.expression,explanation:null,matchesByInstance:[],pairMatchesByInstance:s}))}}catch(t){e(ii({error:t.message||"Synthesis failed"}))}}},new((o=void 0)||(o=Promise))((function(e,t){function s(e){try{l(i.next(e))}catch(e){t(e)}}function a(e){try{l(i.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(s,a)}l((i=i.apply(n,r||[])).next())})))}),[m,u]),!n)return null;const f=0===i?0:(i-1)/a*100,x=0===i,b=i>=1&&i<=a,y=i>a||null!==d;return(0,r.jsxs)("div",Object.assign({className:"absolute inset-0 flex flex-col bg-white"},{children:[(0,r.jsxs)("div",Object.assign({className:"p-4 border-b bg-blue-50 flex items-center justify-between"},{children:[(0,r.jsxs)("div",Object.assign({className:"flex items-center gap-2"},{children:[(0,r.jsx)(Qr.JO,{as:ts.tSv,boxSize:6,color:"blue.600"}),(0,r.jsxs)("div",{children:[(0,r.jsx)(k,{children:"Selector Synthesis"}),(0,r.jsxs)(c.xv,Object.assign({fontSize:"xs",color:"gray.600"},{children:[x&&"Configure synthesis parameters",b&&`Collecting examples (${l.length}/${a})`,y&&"Review synthesized selector"]}))]})]})),(0,r.jsx)(A.zx,Object.assign({size:"sm",leftIcon:(0,r.jsx)(ts.FU5,{}),onClick:()=>{e(Ks())},variant:"ghost"},{children:"Exit"}))]})),!x&&!y&&(0,r.jsx)(hi.Ex,{value:f,size:"xs",colorScheme:"blue"}),(0,r.jsxs)("div",Object.assign({className:"flex-1 overflow-y-auto"},{children:[x&&(0,r.jsx)(fi,{}),b&&("unary"===s?(0,r.jsx)(bi,{}):(0,r.jsx)(yi,{})),y&&(0,r.jsx)(vi,{})]})),!x&&!y&&(0,r.jsxs)("div",Object.assign({className:"p-4 border-t bg-gray-50 flex items-center justify-between"},{children:[(0,r.jsx)(A.zx,Object.assign({size:"sm",leftIcon:(0,r.jsx)(ts.KYK,{}),onClick:()=>e(oi()),isDisabled:i<=1,variant:"outline"},{children:"Previous"})),(0,r.jsxs)(c.xv,Object.assign({fontSize:"sm",color:"gray.600"},{children:["Instance ",i," of ",a]}))]})),p&&(0,r.jsxs)("div",Object.assign({className:"p-4 bg-red-50 border-t border-red-200 text-red-700 text-sm"},{children:[(0,r.jsx)("strong",{children:"Error:"})," ",p]}))]}))},Ai=()=>{const e=jt(),t=At(ur);return At($r)?(0,r.jsx)(ji,{}):t?(0,r.jsx)("div",Object.assign({className:"absolute inset-0 flex flex-col overflow-y-auto bg-slate-50/90 text-slate-900"},{children:(0,r.jsx)("div",Object.assign({className:"flex-1 space-y-4 p-4"},{children:(0,r.jsxs)("div",Object.assign({className:"space-y-4 rounded-xl border border-slate-200 bg-white/80 p-6 backdrop-blur shadow-sm"},{children:[(0,r.jsxs)("div",Object.assign({className:"flex items-center gap-3"},{children:[(0,r.jsx)(Qr.JO,{as:ts.tSv,boxSize:8,className:"text-fuchsia-600"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",Object.assign({className:"text-lg font-semibold text-slate-800"},{children:"Selector Synthesis"})),(0,r.jsx)("p",Object.assign({className:"text-sm text-slate-500"},{children:"Synthesize selectors from examples"}))]})]})),(0,r.jsx)("p",Object.assign({className:"text-sm text-slate-600 leading-relaxed"},{children:"Use this tool to automatically generate CnD selectors by providing positive and negative examples. Select atoms across multiple instances to define which elements should be matched by the selector."})),(0,r.jsxs)("div",Object.assign({className:"space-y-3 pt-2"},{children:[(0,r.jsxs)("div",Object.assign({className:"rounded-lg border border-slate-200 bg-slate-50 p-4"},{children:[(0,r.jsx)("h3",Object.assign({className:"font-medium text-slate-700 mb-2"},{children:"Selector Types"})),(0,r.jsxs)("ul",Object.assign({className:"text-sm text-slate-600 space-y-2"},{children:[(0,r.jsxs)("li",Object.assign({className:"flex items-start gap-2"},{children:[(0,r.jsx)("span",Object.assign({className:"inline-block w-5 h-5 rounded-full bg-fuchsia-100 text-fuchsia-600 text-xs flex items-center justify-center font-semibold mt-0.5"},{children:"1"})),(0,r.jsxs)("span",{children:[(0,r.jsx)("strong",{children:"Unary:"}),' Select individual atoms (e.g., "all Nodes with value > 5")']})]})),(0,r.jsxs)("li",Object.assign({className:"flex items-start gap-2"},{children:[(0,r.jsx)("span",Object.assign({className:"inline-block w-5 h-5 rounded-full bg-purple-100 text-purple-600 text-xs flex items-center justify-center font-semibold mt-0.5"},{children:"2"})),(0,r.jsxs)("span",{children:[(0,r.jsx)("strong",{children:"Binary:"}),' Select pairs of atoms/edges (e.g., "all edges where source.value < target.value")']})]}))]}))]})),(0,r.jsxs)("div",Object.assign({className:"grid gap-2 sm:grid-cols-2"},{children:[(0,r.jsxs)("button",Object.assign({type:"button",onClick:()=>e(Qs({numInstances:3,selectorType:"unary"})),className:"inline-flex items-center justify-center gap-2 rounded-lg bg-gradient-to-r from-fuchsia-600 to-purple-600 px-4 py-3 text-sm font-semibold text-white shadow-md transition hover:from-fuchsia-500 hover:to-purple-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fuchsia-500 focus-visible:ring-offset-2 focus-visible:ring-offset-white"},{children:[(0,r.jsx)(Qr.JO,{as:ts.tSv}),"Synthesize Unary Selector"]})),(0,r.jsxs)("button",Object.assign({type:"button",onClick:()=>e(Qs({numInstances:3,selectorType:"binary"})),className:"inline-flex items-center justify-center gap-2 rounded-lg bg-gradient-to-r from-purple-600 to-indigo-600 px-4 py-3 text-sm font-semibold text-white shadow-md transition hover:from-purple-500 hover:to-indigo-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-purple-500 focus-visible:ring-offset-2 focus-visible:ring-offset-white"},{children:[(0,r.jsx)(Qr.JO,{as:ts.tSv}),"Synthesize Binary Selector"]}))]}))]}))]}))}))})):(0,r.jsxs)("div",Object.assign({className:"absolute inset-0 flex flex-col items-center justify-center bg-slate-50/90 p-8 text-center"},{children:[(0,r.jsx)(Qr.JO,{as:ts.tSv,boxSize:12,className:"mb-4 text-slate-300"}),(0,r.jsx)("p",Object.assign({className:"text-slate-500"},{children:"Load an instance to start synthesizing selectors."}))]}))},Si=()=>(0,r.jsxs)("div",Object.assign({className:"w-full flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(Qr.JO,{as:ts.tSv}),(0,r.jsx)(k,{children:"Synthesis"})]})),Mi=()=>{const e=At(wr);return(0,r.jsxs)(r.Fragment,{children:["explorer"===e&&(0,r.jsx)(Us,{}),"state"===e&&(0,r.jsx)(bs,{}),"evaluator"===e&&(0,r.jsx)(oo,{}),"log"===e&&(0,r.jsx)(io,{}),"layout"===e&&(0,r.jsx)(Xs,{}),"synthesis"===e&&(0,r.jsx)(Ai,{})]})},Ci=()=>{const e=At(wr);return(0,r.jsxs)(r.Fragment,{children:["explorer"===e&&(0,r.jsx)(qs,{}),"state"===e&&(0,r.jsx)(ys,{}),"evaluator"===e&&(0,r.jsx)(so,{}),"log"===e&&(0,r.jsx)(ao,{}),"layout"===e&&(0,r.jsx)(Hs,{}),"synthesis"===e&&(0,r.jsx)(Si,{})]})};var Ii=n(14578);const Oi=e=>(0,r.jsx)("div",Object.assign({className:"contents group"},{children:e.children})),ki=e=>(0,r.jsx)("div",Object.assign({className:"px-4 py-0.5 prose text-xs group-hover:bg-slate-100"},{children:e.children})),Ni=e=>(0,r.jsx)("div",Object.assign({className:"px-4 py-0.5 text-xs font-mono group-hover:bg-slate-100"},{children:e.children})),zi=e=>{const{variable:t}=e;return(0,r.jsxs)(Oi,{children:[(0,r.jsx)(Ni,{children:t.name}),(0,r.jsx)(ki,{children:void 0!==t.typeUrl?(0,r.jsx)("a",Object.assign({target:"_blank",rel:"noopener noreferrer",href:t.typeUrl},{children:t.type})):t.type})]})},Di=e=>{const{datum:t}=e,n=At((e=>Pr(e,t)));return(0,r.jsxs)("div",Object.assign({className:"flex flex-col justify-middle"},{children:[(0,r.jsx)("div",Object.assign({className:"prose prose-md font-bold mx-2 my-2 border-b"},{children:"Datum Variables"})),(0,r.jsxs)("div",Object.assign({className:"grid grid-cols-2"},{children:[(0,r.jsx)("div",Object.assign({className:"px-4 prose prose-sm font-semibold"},{children:"Variable"})),(0,r.jsx)("div",Object.assign({className:"px-4 prose prose-sm font-semibold"},{children:"Type"})),n.map(((e,t)=>(0,r.jsx)(zi,{variable:e},t)))]}))]}))},Ei=()=>{const e=At(Dr),t=At(Er);return(0,r.jsxs)("div",Object.assign({className:"flex flex-col justify-middle"},{children:[(0,r.jsx)("div",Object.assign({className:"prose prose-md font-bold mx-2 my-2 border-b"},{children:"Stage Variables"})),(0,r.jsxs)("div",Object.assign({className:"grid grid-cols-2"},{children:[(0,r.jsx)("div",Object.assign({className:"px-4 prose prose-sm font-semibold"},{children:"Variable"})),(0,r.jsx)("div",Object.assign({className:"px-4 prose prose-sm font-semibold"},{children:"Value"})),(0,r.jsxs)(Oi,{children:[(0,r.jsx)(Ni,{children:e}),(0,r.jsxs)(ki,{children:["svg"===e&&(0,r.jsx)("a",Object.assign({target:"_blank",rel:"noopener noreferrer",href:"https://developer.mozilla.org/en-US/docs/Web/SVG"},{children:""})),"div"===e&&(0,r.jsx)("a",Object.assign({target:"_blank",rel:"noopener noreferrer",href:"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div"},{children:"
"})),"canvas"===e&&(0,r.jsx)("a",Object.assign({target:"_blank",rel:"noopener noreferrer",href:"https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API"},{children:""}))]})]}),(0,r.jsxs)(Oi,{children:[(0,r.jsx)(Ni,{children:"width"}),(0,r.jsx)(Ni,{children:t.width})]}),(0,r.jsxs)(Oi,{children:[(0,r.jsx)(Ni,{children:"height"}),(0,r.jsx)(Ni,{children:t.height})]})]}))]}))},_i=e=>{const{datum:t}=e;return(0,r.jsxs)("div",Object.assign({className:"absolute inset-0 flex flex-col overflow-y-auto"},{children:[(0,r.jsx)(Ei,{}),(0,r.jsx)(Di,{datum:t})]}))},Li=()=>(0,r.jsxs)("div",Object.assign({className:"w-full flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(Qr.JO,{as:Ii.VuO}),(0,r.jsx)(k,{children:"Variables"})]})),Ti=()=>{const e=At(ur),t=At(zr);return(0,r.jsxs)(r.Fragment,{children:["explorer"===t&&(0,r.jsx)(Us,{}),"evaluator"===t&&(0,r.jsx)(oo,{}),"log"===t&&(0,r.jsx)(io,{}),"variables"===t&&e&&(0,r.jsx)(_i,{datum:e})]})},Pi=()=>{const e=At(zr);return(0,r.jsxs)(r.Fragment,{children:["explorer"===e&&(0,r.jsx)(qs,{}),"evaluator"===e&&(0,r.jsx)(so,{}),"log"===e&&(0,r.jsx)(ao,{}),"variables"===e&&(0,r.jsx)(Li,{})]})},Bi=()=>{const e=At(ur);return e?(0,r.jsx)("div",Object.assign({className:"absolute inset-0 flex flex-col overflow-y-auto"},{children:(0,r.jsx)(xs,{datum:e})})):null},Ri=()=>(0,r.jsxs)("div",Object.assign({className:"flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(Qr.JO,{as:lo.rHK}),(0,r.jsx)(k,{children:"Time"})]})),Vi=()=>{console.log("table drawer explorer!");const e=At(Lr);return(0,r.jsxs)(r.Fragment,{children:["explorer"===e&&(0,r.jsx)(Us,{}),"state"===e&&(0,r.jsx)(Bi,{}),"evaluator"===e&&(0,r.jsx)(oo,{}),"log"===e&&(0,r.jsx)(io,{})]})},$i=()=>{const e=At(Lr);return(0,r.jsxs)(r.Fragment,{children:["explorer"===e&&(0,r.jsx)(qs,{}),"state"===e&&(0,r.jsx)(Ri,{}),"evaluator"===e&&(0,r.jsx)(so,{}),"log"===e&&(0,r.jsx)(ao,{})]})},Fi=()=>{const e=At(Mr);return(0,r.jsxs)(x,{children:[(0,r.jsxs)(I,Object.assign({className:"border-b"},{children:["GraphView"===e&&(0,r.jsx)(Ci,{}),"TableView"===e&&(0,r.jsx)($i,{}),"ScriptView"===e&&(0,r.jsx)(Pi,{})]})),(0,r.jsxs)(M,{children:["GraphView"===e&&(0,r.jsx)(Mi,{}),"TableView"===e&&(0,r.jsx)(Vi,{}),"ScriptView"===e&&(0,r.jsx)(Ti,{})]})]})};var Gi=n(53854);const Zi=()=>{const e=jt(),t=At(gr),n=At(Mr);return(0,r.jsxs)(r.Fragment,{children:[t.includes("GraphView")&&(0,r.jsx)(S,Object.assign({isActive:"GraphView"===n,mr:1,leftIcon:(0,r.jsx)(as.DvO,{}),onClick:()=>e(Rs("GraphView"))},{children:"Graph"})),t.includes("TableView")&&(0,r.jsx)(S,Object.assign({isActive:"TableView"===n,mr:1,leftIcon:(0,r.jsx)(lo.WHV,{}),onClick:()=>e(Rs("TableView"))},{children:"Table"})),t.includes("ScriptView")&&(0,r.jsx)(S,Object.assign({isActive:"ScriptView"===n,mr:1,leftIcon:(0,r.jsx)(Gi.aJo,{}),onClick:()=>e(Rs("ScriptView"))},{children:"Script"}))]})},Wi=()=>(0,r.jsxs)(v,Object.assign({className:"shadow"},{children:[(0,r.jsx)(w,{}),(0,r.jsx)(c.iz,{orientation:"vertical",mx:2}),(0,r.jsx)(c.LZ,{}),(0,r.jsx)(Zi,{})]}));var Ui=n(60155);const qi=()=>{const e=jt(),t=At(Mr),n=At(wr),o=At(Vr);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(D,{text:"Time",rightIcon:(0,r.jsx)(lo.rHK,{}),isActive:"GraphView"===t&&"state"===n,onClick:()=>e($s("state"))}),(0,r.jsx)(D,{text:"Layout",rightIcon:(0,r.jsx)(ts.df2,{}),isActive:"GraphView"===t&&"layout"===n,onClick:()=>e($s("layout"))}),o&&(0,r.jsx)(D,{text:"Synthesis",rightIcon:(0,r.jsx)(ts.tSv,{}),isActive:"GraphView"===t&&"synthesis"===n,onClick:()=>e($s("synthesis"))}),(0,r.jsx)(D,{text:"Settings",rightIcon:(0,r.jsx)(Ui.Fuo,{}),isActive:"GraphView"===t&&"settings"===n,onClick:()=>e($s("settings"))})]})},Yi=()=>{const e=jt(),t=At(Mr),n=At(zr);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(D,{text:"Variables",rightIcon:(0,r.jsx)(Ii.VuO,{}),isActive:"ScriptView"===t&&"variables"===n,onClick:()=>e(Gs("variables"))}),(0,r.jsx)(D,{text:"Settings",rightIcon:(0,r.jsx)(Ui.Fuo,{}),isActive:"ScriptView"===t&&"settings"===n,onClick:()=>e(Gs("settings"))})]})},Xi=()=>{const e=jt(),t=At(Mr),n=At(Lr);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(D,{text:"Time",rightIcon:(0,r.jsx)(lo.rHK,{}),isActive:"TableView"===t&&"state"===n,onClick:()=>e(Fs("state"))}),(0,r.jsx)(D,{text:"Settings",rightIcon:(0,r.jsx)(Ui.Fuo,{}),isActive:"TableView"===t&&"settings"===n,onClick:()=>e(Fs("settings"))})]})},Hi=()=>{const e=jt(),t=At(Mr),n=At(yr);return(0,r.jsxs)(N,{children:["GraphView"===t&&(0,r.jsx)(qi,{}),"TableView"===t&&(0,r.jsx)(Xi,{}),"ScriptView"===t&&(0,r.jsx)(Yi,{}),(0,r.jsx)(c.LZ,{}),(0,r.jsx)(D,{text:"Explorer",rightIcon:(0,r.jsx)(lo.rHK,{}),isActive:"explorer"===n,onClick:()=>e(Vs("explorer"))}),(0,r.jsx)(D,{text:"Evaluator",rightIcon:(0,r.jsx)(Kr.RJr,{}),isActive:"evaluator"===n,onClick:()=>e(Vs("evaluator"))}),(0,r.jsx)(D,{text:"Log",rightIcon:(0,r.jsx)(Kr.t75,{}),isActive:"log"===n,onClick:()=>e(Vs("log"))})]})};var Ji=function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}l((r=r.apply(e,t||[])).next())}))};const Qi=e=>{const{datum:t,cndSpec:n,timeIndex:s,priorState:i,onLayoutStateChange:a,synthesisMode:l=!1,onDataInstanceCreated:c}=e,d=(0,o.useRef)(null),p=(0,o.useRef)(null),[h,u]=(0,o.useState)(null),[m,g]=(0,o.useState)(!0),[f,x]=(0,o.useState)(void 0!==window.CndCore),b=(0,o.useRef)(null),y=(0,o.useRef)(!1),w=(0,o.useRef)(a);w.current=a,(0,o.useEffect)((()=>{if(f)return;const e=()=>{var e;return!!(null===(e=window.CndCore)||void 0===e?void 0:e.parseLayoutSpec)&&(console.log("CndCore is now available"),x(!0),!0)};if(e())return;let t=0;const n=setInterval((()=>{t++,(e()||t>=100)&&(clearInterval(n),t>=100&&!f&&(console.error("CndCore did not load within timeout"),u("CnD Core library failed to load. Please refresh the page."),g(!1)))}),100);return()=>clearInterval(n)}),[f]);const v=(0,o.useCallback)((()=>Ji(void 0,void 0,void 0,(function*(){p.current&&b.current&&(yield p.current.renderLayout(b.current))}))),[]),j=(0,o.useCallback)((()=>Ji(void 0,void 0,void 0,(function*(){var e;if(p.current){if(g(!0),u(null),void 0===window.CndCore)return u("CnD Core library is not available. Please check your internet connection."),void g(!1);try{const r=t.data;if(!r)throw new Error("No Alloy XML data available in datum");const o=window.CndCore.AlloyInstance.parseAlloyXML(r);if(!o.instances||0===o.instances.length)throw new Error("No instances found in Alloy XML");const a=void 0!==s?Math.min(s,o.instances.length-1):0,d=new window.CndCore.AlloyDataInstance(o.instances[a]);l&&c&&c(o.instances[a]);const h=new window.CndCore.SGraphQueryEvaluator;h.initialize({sourceData:d});let m=null;try{m=window.CndCore.parseLayoutSpec(n||""),window.clearAllErrors&&window.clearAllErrors()}catch(e){console.error("Layout spec parse error:",e),window.showParseError&&window.showParseError(e.message,"Layout Specification"),m=window.CndCore.parseLayoutSpec("")}const f=!0,x=0,y=new window.CndCore.LayoutInstance(m,h,x,f),w=window.currentProjections||{};console.log("Using projections:",w);const v=y.generateLayout(d,w);if(window.updateProjectionData&&v.projectionData?(console.log("Updating projection data:",v.projectionData),window.updateProjectionData(v.projectionData)):v.projectionData&&v.projectionData.length>0&&console.warn("Projection data available but updateProjectionData function not found. Projection controls may not display correctly."),v.error&&(console.error("Layout generation error:",v.error),v.error.errorMessages?window.showPositionalError?window.showPositionalError(v.error.errorMessages):u(`Positional constraint conflict: ${v.error.message}`):v.error.overlappingNodes?window.showGroupOverlapError?window.showGroupOverlapError(v.error.message):u(`Group overlap error: ${v.error.message}`):window.showGeneralError?window.showGeneralError(`Layout generation error: ${v.error.message}`):u(`Layout generation error: ${v.error.message}`),p.current&&p.current.setAttribute("unsat","")),b.current=v.layout,p.current&&v.layout){const t=(null===(e=v.layout.nodes)||void 0===e?void 0:e.map((e=>e.id||e.name||e.label)))||[],n=i&&i.positions&&i.positions.length>0,r=n?{priorState:i}:void 0;n&&i&&i.positions.map((e=>e.id)).filter((e=>t.includes(e))),yield p.current.renderLayout(v.layout,r)}g(!1)}catch(e){console.error("Error rendering SpyTial graph:",e),u(`Error rendering graph: ${e.message}`),g(!1)}}}))),[t.data,t.id,n,s,v,i]);return(0,o.useEffect)((()=>{if(!d.current||y.current)return;const e=document.createElement("webcola-cnd-graph");e.id="spytial-graph-container",e.setAttribute("layoutFormat","default"),e.setAttribute("aria-label","Interactive graph visualization"),e.style.cssText="\n width: 100%;\n height: 100%;\n min-height: 400px;\n display: block;\n ";const t=e=>{var t;if((null===(t=p.current)||void 0===t?void 0:t.getLayoutState)&&w.current){const e=p.current.getLayoutState();e&&e.positions&&e.positions.length>0&&w.current(e)}},n=e=>{var t;if((null===(t=p.current)||void 0===t?void 0:t.getLayoutState)&&w.current){const e=p.current.getLayoutState();e&&e.positions&&e.positions.length>0&&w.current(e)}},r=e=>{var t;if((null===(t=p.current)||void 0===t?void 0:t.getLayoutState)&&w.current){const e=p.current.getLayoutState();e&&e.positions&&e.positions.length>0&&w.current(e)}};return e.addEventListener("layout-complete",t),e.addEventListener("node-drag-end",n),e.addEventListener("viewbox-change",r),d.current.appendChild(e),p.current=e,y.current=!0,()=>{p.current&&(p.current.removeEventListener("layout-complete",t),p.current.removeEventListener("node-drag-end",n),p.current.removeEventListener("viewbox-change",r),p.current.clear&&p.current.clear(),d.current&&p.current.parentNode===d.current&&d.current.removeChild(p.current)),p.current=null,b.current=null,y.current=!1}}),[]),(0,o.useEffect)((()=>{p.current&&f&&j()}),[t.data,n,s,j,f]),(0,r.jsxs)("div",Object.assign({className:"absolute inset-0 flex flex-col",style:{background:"white",overflow:"hidden"}},{children:[(0,r.jsx)("div",{ref:d,style:{flex:1,position:"relative",minHeight:"400px",cursor:l?"pointer":"default"}}),m&&(0,r.jsx)("div",Object.assign({className:"absolute inset-0 flex items-center justify-center bg-white bg-opacity-75",style:{zIndex:10,pointerEvents:"none"}},{children:(0,r.jsx)("div",Object.assign({className:"text-gray-600"},{children:"Loading graph..."}))})),h&&(0,r.jsxs)("div",Object.assign({className:"absolute bottom-0 left-0 right-0 p-4 bg-red-100 border-t border-red-300 text-red-700",style:{zIndex:20}},{children:[(0,r.jsx)("strong",{children:"Error:"})," ",h]}))]}))},Ki=e=>{const t=jt(),{datumId:n,button:s,generatorId:i}=e,{text:a,onClick:l,mouseover:c}=s,d=(0,o.useCallback)((()=>{t(_e({id:n,onClick:l,context:{generatorName:i,id:n}}))}),[n,s]);return(0,r.jsx)(ws.u,Object.assign({hasArrow:!0,label:c,isDisabled:void 0===c},{children:(0,r.jsx)(De,Object.assign({onClick:d},{children:a}))}))},ea=e=>{const{datum:t}=e,{id:n,parsed:o,buttons:s,generatorName:i}=t,a=o.command;return(0,r.jsxs)("div",Object.assign({className:"w-full flex item-center space-x-2 px-2"},{children:[(0,r.jsxs)(k,Object.assign({className:"text-gray-400"},{children:["ID: ",n]})),(0,r.jsx)(k,{children:a}),(0,r.jsx)("div",{className:"grow"}),s&&s.map(((e,t)=>(0,r.jsx)(Ki,{datumId:n,generatorId:i,button:e},t)))]}))},ta=()=>{const e=jt(),t=At(ur),n=At((e=>t?Rr(e,t):"")),s=At((e=>t?Tr(e,t):0)),i=At($r),a=At(Gr),l=(0,o.useRef)(void 0),c=(0,o.useCallback)((e=>{l.current=e}),[]),d=(0,o.useCallback)((t=>{i&&e(di({dataInstance:t}))}),[e,i]);return(0,r.jsx)(x,Object.assign({className:"grid grid-flow-col divide-x divide-dashed"},{children:t?(0,r.jsx)("div",Object.assign({className:"relative"},{children:(0,r.jsxs)(x,{children:[(0,r.jsx)(I,Object.assign({className:"border-b"},{children:(0,r.jsx)(ea,{datum:t})})),(0,r.jsx)(M,{children:(0,r.jsx)(Qi,{datum:t,cndSpec:n,timeIndex:s,priorState:l.current,onLayoutStateChange:c,synthesisMode:i&&a>0,onDataInstanceCreated:d})})]})})):null}))};var na=n(4953);const ra=(0,Ee.oM)({name:"script",initialState:{stage:"svg",stageDimensions:{width:0,height:0},text:"",scriptTextByDatumId:{}},reducers:{scriptStageDimensionsSet(e,t){e.stageDimensions=t.payload},scriptStageSet(e,t){e.stage=t.payload},scriptTextSet(e,t){e.text=t.payload},scriptTextByDatumSet(e,t){const{id:n,text:r}=t.payload;e.scriptTextByDatumId[n]=r}},extraReducers:e=>e.addCase(Is,((e,t)=>{e.text=e.scriptTextByDatumId[t.payload]})).addCase(Be,((e,t)=>{const{enter:n,update:r,exit:o}=t.payload;if(n){(0,js.Z)(n,(t=>{"visualizerConfig"in t.parsed&&"script"in t.parsed.visualizerConfig&&(e.scriptTextByDatumId[t.id]=t.parsed.visualizerConfig.script)}));const t=(0,Dt.Z)(n);t&&(e.text=e.scriptTextByDatumId[t.id])}o&&(0,Ft.Z)(o,(t=>{e.scriptTextByDatumId[t]=""}))}))}),{scriptStageSet:oa,scriptStageDimensionsSet:sa,scriptTextSet:ia,scriptTextByDatumSet:aa}=ra.actions,la=ra.reducer;var ca=n(76815);function da(e){return(0,ca.pF)(e)}var pa=n(81493);const ha="\nclass AlloyError {\n static error(source: string, message: string): Error;\n\n static missingAttribute(source: string, attribute: string): Error;\n\n static missingElement(source: string, element: string): Error;\n}\n\nclass AlloySignature extends AlloySet {\n private readonly _id;\n private readonly _atoms;\n private _subsignatures;\n\n /**\n * Create a new Alloy signature.\n *\n * @param id The signature's unique ID\n * @param atoms The atoms defined by the signature\n * @param proxy If provided, a proxied signature will be created.\n */\n constructor(id: string, atoms: AlloyAtom[], proxy?: AlloyProxy);\n\n /**\n * Get an atom by ID\n * @param id The atom ID\n * @returns An atom or null if there is no atom with the specified ID\n */\n atom(id: string): AlloyAtom | null;\n\n /**\n * Get an array of all atoms in this signature.\n * @param recursive If false, return only atoms defined by this signature,\n * if true, include atoms defined by all subsignatures as well.\n */\n atoms(recursive?: boolean): AlloyAtom[];\n\n /**\n * Create a clone of this signature.\n * @param proxy If provided, a proxied clone will be returned.\n */\n clone(proxy?: AlloyProxy): AlloySignature;\n\n /**\n * Get the signature ID.\n */\n id(): string;\n\n /**\n * Get an array of all signatures that extend this signature.\n * @param recursive If false, return only signatures that are immediate\n * children of this signature. If true, return all signatures that are\n * descendants of this signature.\n */\n subSignatures(recursive?: boolean): AlloySignature[];\n\n /**\n * Create a signature from an XML element and populate the signature with\n * atoms. Any signatures that extend the one defined in the element are not\n * created.\n *\n * @param element The XML `````` element\n * @param proxy If provided, a proxied signature with proxied atoms will be\n * returned.\n */\n static fromElement(element: Element, proxy?: AlloyProxy): AlloySignature;\n\n /**\n * Create the Int signature.\n *\n * @param bitwidth The integer bitwidth, which must be greater than or equal to zero.\n * @param proxy If provided, a proxied Int signature with proxied atoms will\n * be returned.\n */\n static intSignature(bitwidth: number, proxy?: AlloyProxy): AlloySignature;\n\n /**\n * TODO: Check and document this.\n * @param intsig\n * @param proxy\n */\n static seqIntSignature(\n intsig: AlloySignature,\n proxy?: AlloyProxy\n ): AlloySignature;\n\n /**\n * Build all signatures from an XML `````` element. All signatures are\n * populated with atoms.\n *\n * @param instance The XML `````` element\n * @param proxy If provided, all signatures and atoms will be proxied.\n * @returns A map of string IDs, as defined by the \"ID\" attribute for each\n * signature, to [[AlloySignature]] objects.\n */\n static signaturesFromXML(\n instance: Element,\n proxy?: AlloyProxy\n ): Map;\n\n /**\n * Get an array of signature types associated with an XML element. Typically\n * this is used when parsing a field or skolem, as each `````` and ``````\n * element will have a `````` child. This method parses the types defined\n * in this element and returns the corresponding signatures.\n *\n * @param element The XML element that has a child\n * @param sigIDs A map of signature IDs to signatures\n */\n static typesFromXML(\n element: Element,\n sigIDs: Map\n ): AlloySignature[];\n}\n\nclass AlloySet {\n protected _tuples: AlloyTuple[];\n\n /**\n * Create a new Alloy set.\n *\n * @param tuples The tuples contained in the set\n */\n constructor(tuples?: AlloyTuple[]);\n\n /**\n * Returns true if the set is empty, false if it is not.\n */\n empty(): boolean;\n\n /**\n * Returns true if this set is equivalent to the provided set, false otherwise.\n * @param that The set to compare to\n */\n equals(that: AlloySet): boolean;\n\n /**\n * Returns true if this set is a subset of the provided set, false otherwise.\n * @param that The set to compare to\n */\n in(that: AlloySet): boolean;\n\n /**\n * Perform a join operation with another set. This operation is equivalent\n * to the dot join operator in Alloy, in which this set is on the left side\n * of the dot and that set is on the right side.\n *\n * @param that The other set\n */\n join(that: AlloySet): AlloySet;\n\n /**\n * Create a printable string representation of this set.\n */\n toString(): string;\n\n /**\n * Get an array of all tuples in this set.\n */\n tuples(): AlloyTuple[];\n}\n\nclass AlloyTuple extends AlloySet {\n private _atoms;\n\n /**\n * Create a new Alloy tuple.\n *\n * @param atoms The atoms, in order, that comprise the tuple.\n */\n constructor(atoms: AlloyAtom[]);\n\n /**\n * Get an ordered list of the atoms in this tuple.\n */\n atoms(): AlloyAtom[];\n\n /**\n * Create a printable string representation of this tuple.\n */\n toString(): string;\n\n /**\n * Create an array of tuples from a node list of `````` XML elements.\n *\n * @param elements A node list of `````` elements, typically created\n * using the ```querySelectorAll()``` method on a `````` or\n * `````` element.\n * @param types An ordered array of signatures that define the type of each\n * atom in each tuple, typically created using [[AlloySignature.typesFromXML]].\n */\n static tuplesFromXML(\n elements: NodeListOf,\n types: AlloySignature[]\n ): AlloyTuple[];\n}\n\nclass AlloyProxy {\n private readonly _sets;\n\n constructor();\n\n applyProxy(set: T, id?: string): T;\n\n private _finalize;\n}\n\n/**\n * In Alloy, an atom is a primitive entity that is indivisible, immutable, and\n * uninterpreted.\n */\nclass AlloyAtom extends AlloySet {\n private readonly _id;\n\n constructor(id: string, proxy?: AlloyProxy);\n\n clone(proxy?: AlloyProxy): AlloyAtom;\n\n id(): string;\n\n static fromElement(element: Element, proxy?: AlloyProxy): AlloyAtom;\n}\n\nclass AlloyTypedSet extends AlloySet {\n private readonly _types;\n\n constructor(types: AlloySignature[], tuples: AlloyTuple[]);\n\n project(atoms: Map): void;\n\n types(): AlloySignature[];\n}\n\nexport class AlloyField extends AlloyTypedSet {\n private readonly _id;\n\n /**\n * Create a new Alloy field.\n * @param id The field's unique ID\n * @param types An array of signatures defining the types of each column of the field\n * @param tuples The tuples defined by the field\n * @param proxy If provided, a proxied signature will be created.\n * @param varName If provided, the variable name to assign to this field when proxied.\n */\n constructor(\n id: string,\n types: AlloySignature[],\n tuples: AlloyTuple[],\n proxy?: AlloyProxy,\n varName?: string\n );\n\n /**\n * Create a clone of this field\n *\n * @param signatures An array of signatures. When creating the clone of this\n * field, the types associated with each column are not cloned. Instead,\n * provide an array of signatures and this method will find the corresponding\n * types by signature ID in the array and use them to define types of the\n * cloned field.\n * @param proxy If provided, a proxied clone will be returned.\n */\n clone(signatures: AlloySignature[], proxy?: AlloyProxy): AlloyField;\n\n /**\n * Get the field ID.\n */\n id(): string;\n\n /**\n * Build all fields from an XML `````` element. All fields are\n * fully populated with tuples.\n *\n * @param instance The XML `````` element\n * @param sigIDs A map of signature string IDs to signature objects\n * @param proxy If provided, all fields will be proxied.\n */\n static fieldsFromXML(\n instance: Element,\n sigIDs: Map,\n proxy?: AlloyProxy\n ): AlloyField[];\n}\n\nclass AlloySkolem extends AlloyTypedSet {\n private readonly _id;\n\n constructor(\n id: string,\n types: AlloySignature[],\n tuples: AlloyTuple[],\n proxy?: AlloyProxy\n );\n\n clone(signatures: AlloySignature[], proxy?: AlloyProxy): AlloySkolem;\n\n id(): string;\n\n static skolemsFromXML(\n instance: Element,\n sigIDs: Map,\n proxy?: AlloyProxy\n ): AlloySkolem[];\n}\n\n/**\n * In Alloy, when you run a predicate or check an assertion, the analyzer\n * searches for an _instance_ of an _analysis constraint_: an assignment of\n * values to the variables of the constraint for which the constraint evaluates\n * to true [[Jackson 2012](http://softwareabstractions.org/)].\n */\nclass AlloyInstance {\n private _proxy;\n private _atoms;\n private _fields;\n private _signatures;\n private _skolems;\n private _projections;\n private _bitwidth;\n private _command;\n private _filename;\n private _sources;\n\n /**\n * Create a new Alloy instance. If no text is provided, an empty instance\n * is created.\n * @param text A string containing the XML output from an Alloy instance\n * @param index\n */\n constructor(text?: string, index?: number);\n\n /**\n * Get an atom by ID.\n * @param id The atom ID\n * @returns An atom or null if there is no atom with the specified ID\n */\n atom(id: string): AlloyAtom | null;\n\n /**\n * Get an array of all atoms in the instance.\n */\n atoms(): AlloyAtom[];\n\n /**\n * Get the bitwidth of the instance.\n */\n bitwidth(): number;\n\n /**\n * Generate a deep clone of the instance.\n * @throws Error if the instance does not have a univ signature.\n */\n clone(): AlloyInstance;\n\n /**\n * Get the command used to generate the instance.\n */\n command(): string;\n\n /**\n * Get a field by ID.\n * @param id The field ID\n * @returns A field or null if there is no field with the specified ID\n */\n field(id: string): AlloyField | null;\n\n /**\n * Get an array of all fields in the instance.\n */\n fields(): AlloyField[];\n\n /**\n * Get the full path of the model used to generate the instance.\n */\n filename(): string;\n\n /**\n * Project the instance over the specified atoms. There may be a maximum of\n * one atom per signature that is a direct descendant of the univ signature.\n * @param atoms The list of atoms over which to project the instance.\n * @returns A clone of the instance with the projection applied.\n * @throws Error if there is more than one atom provided for any signature\n * that is a direct descendant of the univ signature.\n */\n project(atoms: AlloyAtom[]): AlloyInstance;\n\n /**\n * Get the currently projected atoms.\n * @returns A Map object with key-value pairs mapping signatures to projected atoms\n */\n projections(): Map;\n\n /**\n * Get a signature by ID\n * @param id The signature ID\n * @returns A signature or null if there is no signature with the specified ID\n */\n signature(id: string): AlloySignature | null;\n\n /**\n * Get an array of all signatures in the instance.\n */\n signatures(): AlloySignature[];\n\n /**\n * Get a skolem by ID\n * @param id The skolem ID\n * @returns A skolem or null if there is no skolem with the specified ID\n */\n skolem(id: string): AlloySkolem | null;\n\n /**\n * Get an array of all skolems in the instance.\n */\n skolems(): AlloySkolem[];\n\n /**\n * Get all source files that define the model from which this instance was created.\n * @returns A Map object with key-value pairs mapping full path names to file contents\n */\n sources(): Map;\n\n /**\n * Get the univ signature.\n * @returns The univ signature if it exists, null if it does not\n */\n univ(): AlloySignature | null;\n\n private _buildFromXML;\n}",ua=e=>{const{initialText:t,variables:n,editorRef:s,stageRef:i,beforeUnmount:a,onExecute:l}=e,[c,d]=(0,o.useState)(),p=(0,o.useCallback)((e=>{s(e),d(e)}),[]);return(0,o.useEffect)((()=>{if(c){c.addCommand(pa.Fd.KeyMod.WinCtrl|pa.Fd.KeyCode.Enter,(()=>{l()}));const e="ts:filename/alloy.d.js",t=pa.Fd.Uri.parse(e);null!==pa.Fd.editor.getModel(t)||(pa.Fd.languages.typescript.javascriptDefaults.setExtraLibs([{content:ha,filePath:"alloy.js"}]),pa.Fd.editor.createModel(ha,"typescript",t))}}),[c,l,i]),(0,o.useEffect)((()=>{const e=function(e){return e.map((e=>`declare const ${e.name}: ${e.type};`)).join("\n")}(n);pa.Fd.languages.typescript.javascriptDefaults.setExtraLibs([{content:"\n/**\n * To anyone adding to this library in the future: please take the following steps when adding\n * new VisualObjects.\n *\n * 1. If the object is to be accessible within sterling, add it to library within ScriptViewImports.\n * 2. Add the name of the file, minus .d.ts, to the list within d3lib-def-compiler/src/D3LibDefCompiler.java.\n * 3. Run the typescript compiler (\"tsc\" in terminal) from within the d3-packages folder.\n * 4. Run the main method within D3LibDefCompiler.\n *\n * If these steps are not followed, the file's definitions will either not be accessible within\n * sterling, or will not show up in monaco.\n */\ndeclare type BoundingBoxGenerator = (r: number) => Coords;\ndeclare class VisualObject {\n center: () => Coords;\n children: VisualObject[];\n dependents: VisualObject[];\n bounding_box_lam: BoundingBoxGenerator;\n hasBoundingBox: boolean;\n /**\n * Top level class, which all other visual objects will extend.\n * @param coords position of the object on screen.\n */\n constructor(coords?: Coords | (() => Coords));\n boundingBox(): BoundingBox;\n getChildren(): VisualObject[];\n /**\n * Shifts object to have new given center\n * @param center new center of the object\n */\n setCenter(center: Coords | (() => Coords)): void;\n hasLam(): Boolean;\n getLam(): BoundingBoxGenerator;\n /**\n * Renders the object to the screen.\n * @param svg HTML Svg object to which the object should be rendered.\n */\n render(svg: any): void;\n}\n//# sourceMappingURL=VisualObject.d.ts.map\ninterface ShapeProps {\n center?: Coords | (() => Coords);\n color?: string | (() => string);\n borderWidth?: number | (() => number);\n borderColor?: string | (() => string);\n label?: string | (() => string);\n labelColor?: string | (() => string);\n labelSize?: number | (() => number);\n opacity?: number | (() => number);\n}\n/**\n * Generic class for a large suite of \"shape\"-like objects.\n * Generally includes anything with an inside and an outside.\n * All shapes come with builtin label.\n */\ndeclare class Shape extends VisualObject {\n color: () => string;\n borderWidth: () => number;\n borderColor: () => string;\n opacity: () => number;\n label: TextBox;\n /**\n * Constructs a generic shape object. This is a top-level class,\n * which should not be used except as super class for other specific\n * shapes.\n * @param coords coordinates of the shape\n * @param color color of shape's interior\n * @param borderWidth width of Shape's border\n * @param borderColor color of border\n * @param label text to display atop the shape\n * @param labelColor color of text\n * @param labelSize size of text\n * @param style\n */\n constructor(props: ShapeProps);\n setColor(color: string | (() => string)): void;\n setBorderWidth(borderWidth: number | (() => number)): void;\n setBorderColor(borderColor: string | (() => string)): void;\n setLabelText(text: string | (() => string)): void;\n setLabelColor(labelColor: string | (() => string)): void;\n setLabelSize(labelSize: number | (() => number)): void;\n}\n//# sourceMappingURL=Shape.d.ts.map\ndeclare class Pane {\n Children: VisualObject[];\n constructor();\n add(addNode: VisualObject): void;\n render(svg: any): void;\n}\n//# sourceMappingURL=Pane.d.ts.map\ninterface gridProps {\n grid_location: Coords | (() => Coords);\n cell_size: {\n x_size: number;\n y_size: number;\n };\n grid_dimensions: {\n x_size: number;\n y_size: number;\n };\n}\ndeclare class Grid extends VisualObject {\n /**\n *\n * As one of the most common expressions of a graph is a matrix, we offer functionality\n * for building a grid of cells, where you can add visual objects to each square in the grid,\n * and they are automatically formatted into the grid (where the center of the object is aligned\n * to the center of the grid)\n *\n * Note: grid size is fixed! You can't change the size of a grid once it's created\n *\n */\n private coords;\n config: gridProps;\n cells: Array>;\n gridlines: Array;\n constructor(props: gridProps);\n private check_bounding_box;\n add(coords: Coords, add_object: VisualObject, ignore_warning?: boolean): void;\n private center_helper;\n private fill_grid_lines;\n hide_grid_lines(): void;\n fill(coords: Coords, color: string): void;\n private check_coords;\n}\n{};\n//# sourceMappingURL=Grid.d.ts.map\ninterface RectangleProps extends ShapeProps {\n height: number | (() => number);\n width: number | (() => number);\n coords?: Coords | (() => Coords);\n}\ndeclare class Rectangle extends Shape {\n height: () => number;\n width: () => number;\n /**\n * Creates a logical rectangle object\n * @param height height (y direction)\n * @param width width (x direction)\n * @param coords coordinates of the top-left point\n * @param color color for interior\n * @param borderWidth width of border\n * @param borderColor color of border\n * @param label text for label\n * @param labelColor color for label text\n * @param labelSize size of label text\n */\n constructor(props: RectangleProps);\n boundingBox(): BoundingBox;\n setWidth(width: number | (() => number)): void;\n setHeight(height: number | (() => number)): void;\n render(svg: any): void;\n}\n//# sourceMappingURL=Rectangle.d.ts.map\ninterface CircleProps extends ShapeProps {\n radius: number | (() => number);\n}\ndeclare class Circle extends Shape {\n radius: () => number;\n bounding_box_lam: BoundingBoxGenerator;\n /**\n * Creates a circle object at the given location\n * @param radius radius of circle\n * @param coords coordinates of circle's center\n * @param color color of interior\n * @param borderWidth width border\n * @param borderColor color for border\n * @param label text for label\n * @param labelColor color of label\n * @param labelSize size of label\n */\n constructor(props: CircleProps);\n boundingBox(): BoundingBox;\n setRadius(radius: number | (() => number)): void;\n render(svg: any): void;\n}\n//# sourceMappingURL=Circle.d.ts.map\ndeclare class Stage {\n Children: VisualObject[];\n constructor();\n add(addObject: VisualObject): void;\n children_to_tree_recurse(root: VisualObject): VisTree;\n render(svg: any, document?: any): void;\n}\n//# sourceMappingURL=Stage.d.ts.map\ninterface TextBoxProps {\n text?: string | (() => string);\n coords?: Coords | (() => Coords);\n color?: string | (() => string);\n fontSize?: number | (() => number);\n}\ndeclare class TextBox extends VisualObject {\n text: () => string;\n fontSize: () => number;\n color: () => string;\n /**\n * Displays given text.\n * @param text text to display\n * @param coords location for center of text\n * @param color text color\n * @param fontSize size of the text\n */\n constructor(props: TextBoxProps);\n boundingBox(): BoundingBox;\n setText(text: string | (() => string)): void;\n setFontSize(fontSize: number | (() => number)): void;\n setTextColor(color: string | (() => string)): void;\n render(svg: any): void;\n}\n//# sourceMappingURL=TextBox.d.ts.map\ninterface LineProps {\n points?: Coords[] | (() => Coords)[];\n arrow?: boolean;\n color?: string | (() => string);\n width?: number | (() => number);\n opacity?: number | (() => number);\n style?: string | (() => string);\n}\ndeclare class Line extends VisualObject {\n pointsRelative: (() => Coords)[];\n color: () => string;\n width: () => number;\n opacity: () => number;\n arrow: boolean;\n style: () => string;\n /**\n * Creates a line on the given poitns.\n * @param points list of points for the line to pass through\n * @param color color of line\n * @param width width of line\n * @param opacity of the line\n */\n constructor(props: LineProps);\n boundingBox(): BoundingBox;\n setColor(color: string | (() => string)): void;\n setWidth(width: number | (() => number)): void;\n setOpacity(opacity: number | (() => number)): void;\n render(svg: any): void;\n}\n//# sourceMappingURL=Line.d.ts.map\n/**\n * This class is not currently being used!!\n */\ndeclare class ConjoinedObject extends VisualObject {\n /**\n * Note: this code is untested!\n */\n children: VisualObject[];\n constructor(Children?: VisualObject[]);\n addOrdered(obj: VisualObject, index: number): void;\n add(obj: VisualObject): void;\n setCenter(coords: Coords): void;\n render(svg: any): void;\n}\n//# sourceMappingURL=ConjoinedObject.d.ts.map\ninterface PolygonProps extends ShapeProps {\n points: Coords[] | (() => Coords)[];\n}\n/**\n * Class Representing Polygonal objects. Takes the form of any\n * series of points, and will form a polygon with said points as the boundary.\n */\ndeclare class Polygon extends Shape {\n pointsRelative: (() => Coords)[];\n /**\n * Constructs a polygon object\n * @param points list of points forming outside\n * @param color color of interior\n * @param borderWidth width of the border\n * @param borderColor color of the border\n * @param label text to label with\n * @param labelColor color of label text\n * @param labelSize size of the label\n */\n constructor(props: PolygonProps);\n boundingBox(): BoundingBox;\n render(svg: any): void;\n}\n//# sourceMappingURL=Polygon.d.ts.map\ninterface Node {\n name: string;\n neighbors: string[];\n}\ndeclare class Graph extends VisualObject {\n nodes: Node[];\n node_radius: number;\n fixed_nodes: number;\n graph_dimensions: number;\n node_to_location: any;\n constructor(coords?: Coords, graph_dimensions?: number, fixed_nodes?: number, node_radius?: number);\n setCenter(center: Coords): void;\n center(): {\n x: any;\n y: any;\n };\n add(Nodes: Node[]): void;\n private set_fixed_nodes;\n private set_malleable_nodes;\n check_add_set(Nodes: Node[]): void;\n render(svg: any): void;\n render_lines(svg: any, connections: string[][]): void;\n render_nodes(svg: any): void;\n}\n//# sourceMappingURL=Graph.d.ts.map\n/**\n * This is going to be a generic utility file. Primarily for factoring\n * out algorithms with a higher level of computational complexity.\n */\ndeclare function toFunc(defaultValue: T, t?: T | (() => T)): (() => T);\ninterface Coords {\n x: number;\n y: number;\n}\n/**\n * Generic props for representing a box around an object.\n */\ninterface BoundingBox {\n top_left: Coords;\n bottom_right: Coords;\n}\ndeclare function boxUnion(boxes: BoundingBox[]): {\n top_left: {\n x: number;\n y: number;\n };\n bottom_right: {\n x: number;\n y: number;\n };\n};\ninterface ExperimentalBoundingBox {\n lambda: (radians: number) => Coords;\n}\n/**\n * Simple method averaging the coordinate points in a series.\n * @param points\n * @returns\n */\ndeclare function averagePath(points: Coords[]): Coords;\n/**\n * Shifts a function list of points according to a shift variable\n * @param pointList\n * @param shift\n * @returns\n */\ndeclare function shiftList(pointList: (() => Coords)[], shift: () => Coords): (() => Coords)[];\n/**\n * Utility function returning bounding box for a list of points\n * @param pointList list of points as coords\n * @returns bounding box\n */\ndeclare function boundsOfList(pointList: Coords[]): BoundingBox;\n//# sourceMappingURL=Utility.d.ts.map\n/**\n * Interface for node in a tree with a visualObject\n */\ninterface VisTree {\n visualObject: VisualObject;\n children: VisTree[];\n}\ninterface TreeProps {\n root: VisTree;\n height: number;\n width: number;\n coords?: Coords | (() => Coords);\n edgeColor?: string;\n edgeWidth?: number;\n}\ndeclare class Tree extends VisualObject {\n root: VisTree;\n height: number;\n width: number;\n private lines;\n private subTrees;\n private coords;\n /**\n * Builds a tree object, pulling all children nodes into proper locations and\n * adding lines where necessary.\n * @param root root of the tree of visual objects\n * @param height height of box to bound the tree\n * @param width width of box to bound the tree\n * @param coords top left point of the tree\n */\n constructor(props: TreeProps);\n private setUpSubtrees;\n setLineColor(color: string): void;\n setLineWidth(width: number): void;\n}\n//# sourceMappingURL=Tree.d.ts.map\n",filePath:"helpers.ts"},{content:ha+"\n"+e,filePath:"alloy.js"},{content:e,filePath:"variables.ts"}])}),[c,n]),(0,r.jsx)(pa.ZP,{"data-testid":"script-view-monaco-editor",language:"javascript",options:{automaticLayout:!0,scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:12},value:t},editorDidMount:p,editorWillUnmount:e=>{const t=e.getValue();a(t)}})},ma=e=>{const t=jt(),{datumId:n,button:s,generatorId:i}=e,{text:a,onClick:l,mouseover:c}=s,d=(0,o.useCallback)((()=>{t(_e({id:n,onClick:l,context:{generatorName:i,id:n}}))}),[n,s]);return(0,r.jsx)(ws.u,Object.assign({hasArrow:!0,label:c,isDisabled:void 0===c},{children:(0,r.jsx)(De,Object.assign({onClick:d},{children:a}))}))},ga=e=>{const{onExecute:t}=e,n=At(Dr),s=jt(),i=(0,o.useCallback)((e=>{s(oa(e))}),[]);return(0,r.jsxs)("div",Object.assign({className:"flex"},{children:[(0,r.jsx)(ws.u,Object.assign({hasArrow:!0,label:""},{children:(0,r.jsx)(A.zx,Object.assign({colorScheme:"blue",size:"xs",onClick:t},{children:"Run"}))})),(0,r.jsxs)(A.hE,Object.assign({className:"pl-2",isAttached:!0,colorScheme:"blue",size:"xs"},{children:[(0,r.jsx)(A.zx,Object.assign({isActive:"div"===n,onClick:()=>i("div")},{children:"
"})),(0,r.jsx)(A.zx,Object.assign({isActive:"canvas"===n,onClick:()=>i("canvas")},{children:""})),(0,r.jsx)(A.zx,Object.assign({isActive:"svg"===n,onClick:()=>i("svg")},{children:""}))]}))]}))},fa=e=>{const{datum:t,onExecute:n}=e,{id:o,parsed:s,buttons:i}=t,a=s.command;return(0,r.jsxs)("div",Object.assign({className:"w-full flex items-center space-x-2 px-2"},{children:[(0,r.jsxs)(k,Object.assign({className:"text-gray-400"},{children:["ID: ",o]})),(0,r.jsx)(k,{children:a}),(0,r.jsx)("div",{className:"grow"}),(0,r.jsx)(ga,{onExecute:n}),i&&i.map(((e,n)=>(0,r.jsx)(ma,{datumId:o,generatorId:t.generatorName,button:e},n)))]}))},xa=e=>{const{datum:t}=e,n=jt(),s=(0,na.pm)(),i=At(Dr),a=At(Er),l=At(_r),c=At((e=>Pr(e,t))),[d,p]=(0,o.useState)(),[h,u]=(0,o.useState)(null),m=(0,o.useRef)(null);((e,t)=>{const[n,r]=(0,o.useState)();(0,o.useLayoutEffect)((()=>{const n=e.current;if(n){r(n.getBoundingClientRect());const e=new ResizeObserver((e=>{e.forEach((e=>{e.target===n&&(t?t(e.contentRect):r(e.contentRect))}))}));return e.observe(n),()=>{e.unobserve(n)}}}),[e.current])})(m,(e=>{n(sa({width:e.width,height:e.height}))}));const g=(0,o.useCallback)((e=>{p(e)}),[]),f=(0,o.useCallback)((e=>{e&&u(e)}),[]),b=(0,o.useCallback)((e=>{e&&u(e)}),[]),y=(0,o.useCallback)((e=>{e&&u(e)}),[]),w=(0,o.useCallback)((e=>{n(ia(e)),n(aa({id:t.id,text:e}))}),[t]),v=(0,o.useCallback)((()=>{const e=null==d?void 0:d.getValue();if(e&&h&&a){n(ia(e)),n(aa({id:t.id,text:e}));const[r,o]=function(e){const t=e.split("\n"),n=[];let r=0;for(let e=0;e{try{new Function(i,"width","height",...qn.map((e=>e.name)),...c.map((e=>e.name)),...r.map((e=>function(e){return e.replaceAll("-","_")}(e))),o)(h,a.width,a.height,...qn.map((e=>e.value)),...c.map((e=>e.variable)),...e)}catch(e){s({variant:"top-accent",position:"bottom-right",title:e instanceof Error?e.name:"Error",description:ba(e),status:"error",duration:1e4,isClosable:!0})}}))}}),[d,i,h,a,c]);return(0,r.jsxs)(x,{children:[(0,r.jsx)(I,Object.assign({className:"border-b"},{children:(0,r.jsx)(fa,{datum:t,onExecute:v})})),(0,r.jsx)(M,{children:(0,r.jsxs)("div",Object.assign({className:"grid grid-cols-2 divide-x h-full"},{children:[(0,r.jsxs)(x,Object.assign({ref:m,className:"relative"},{children:["div"===i&&(0,r.jsx)("div",{ref:y,className:"w-full h-full"}),"canvas"===i&&(0,r.jsx)("canvas",{ref:b,className:"w-full h-full"}),"svg"===i&&(0,r.jsx)("div",Object.assign({"aria-label":"SVG Visualization",id:"svg-container",style:{height:"100%",width:"100%",overflow:"scroll"}},{children:(0,r.jsx)("svg",{ref:f,style:{width:"100%",height:"100%",backgroundColor:"snow"}})}))]})),(0,r.jsx)(x,Object.assign({className:"relative","aria-label":"Visualization Script","data-testid":"script-editor-pane"},{children:(0,r.jsx)(ua,{initialText:l,variables:c,editorRef:g,stageRef:h,beforeUnmount:w,onExecute:v})}))]}))})]})};function ba(e){if(!(e instanceof Error))return`${e}`;if(console.log(`Error stack: ${e.stack}`),null!=e.stack){const t=e.stack.match(new RegExp(".*(Function|):[0-9]+:[0-9]+.*","g"));if(t){const n=t[0].split(new RegExp(".*Function:|:"))[1].split(":");console.log(`rowCol: ${JSON.stringify(n)}`);const r=+n[0]-2;return n[1],`${e.message} Around line ${r} (computed via parsing error stack)`}}return`${e.message} (error location was not provided by the browser)`}const ya=()=>{const e=At(ur);return e?(0,r.jsx)(xa,{datum:e,"data-testid":"script-view-datum"}):null},wa=e=>{const{data:t}=e,n={gridTemplateColumns:`repeat(${t.data.length>0?t.data[0].length:0}, minmax(0, 1fr))`,borderCollapse:"collapse",textAlign:"left"};return(0,r.jsxs)("table",Object.assign({className:"prose shadow m-2 boarder prose text-xs font-mono",summary:t.title,role:"table",style:n},{children:[(0,r.jsx)("caption",Object.assign({className:"prose prose-sm font-semibold px-2 py-1 border shadow",style:{textAlign:"left"}},{children:t.title})),(0,r.jsx)("thead",Object.assign({className:"bg-slate-100"},{children:(0,r.jsx)("tr",{children:t.headers&&t.headers.map(((e,t)=>(0,r.jsx)("th",Object.assign({className:"font-semibold px-2 py-0.5",scope:"col","aria-labelledby":e},{children:e}),`header-${t}`)))})})),(0,r.jsx)("tbody",{children:t.data.map(((e,t)=>(0,r.jsx)("tr",{children:e.map(((e,n)=>(0,r.jsx)("td",Object.assign({className:"px-2 py-0.5 bg-white boarder",headers:`header-${n}`},{children:e}),`${t}${n}`)))},`row-${t}`)))})]}))},va=e=>{const{datum:t}=e,n=At((e=>Br(e,t)));return(0,r.jsx)(r.Fragment,{children:n.map(((e,t)=>(0,r.jsx)(wa,{data:e},t)))})},ja=e=>{const{datum:t}=e,{id:n,parsed:o,buttons:s}=t,i=o.command;return(0,r.jsxs)("div",Object.assign({className:"w-full flex items-center space-x-2 px-2"},{children:[(0,r.jsxs)(k,Object.assign({className:"text-gray-400"},{children:["ID: ",n]})),(0,r.jsx)(k,{children:i}),(0,r.jsx)("div",{className:"grow"}),s&&s.map(((e,o)=>(0,r.jsx)(ma,{datumId:n,generatorId:t.generatorName,button:e},o)))]}))},Aa=()=>{const e=At(ur);return e?(0,r.jsxs)(x,{children:[(0,r.jsx)(I,{children:(0,r.jsx)(ja,{datum:e})}),(0,r.jsx)(M,{children:(0,r.jsx)("div",Object.assign({className:"w-full h-full flex content-start items-start flex-wrap overflow-y-auto"},{children:(0,r.jsx)(va,{datum:e})}))})]}):null},Sa=()=>{const e=At(Mr);return(0,r.jsxs)(x,{children:["GraphView"===e&&(0,r.jsx)(ta,{}),"TableView"===e&&(0,r.jsx)(Aa,{}),"ScriptView"===e&&(0,r.jsx)(ya,{})]})};var Ma=n(97375);const Ca=e=>{const{isConnected:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{const t=At(Ar),n=At(kr),o=t?`Connected to ${n}`:"Not connected to a provider",s=t?"Connected":"Disconnected";return(0,r.jsx)(ws.u,Object.assign({hasArrow:!0,label:o},{children:(0,r.jsxs)(c.M5,Object.assign({},e,{children:[(0,r.jsx)(Ca,{isConnected:t}),(0,r.jsx)(c.xv,Object.assign({mx:1,userSelect:"none"},{children:s}))]}))}))};var Oa=n(45073),ka=n(33441);const Na=function(e,t){const{name:n,generators:r,features:o}=t.payload;e.providerName=n||"unknown provider",e.providerGenerators=null==r?void 0:r.slice(),e.features=(null==o?void 0:o.slice())||[]},za=function(e){e.connected=!0},Da=function(e){e.connected=!1},Ea=(0,Ee.oM)({name:"provider",initialState:{connected:!1,providerName:"unknown provider",providerGenerators:void 0,features:[],synthesisEnabled:!1},reducers:{synthesisFeatureEnabled(e,t){e.synthesisEnabled=t.payload}},extraReducers:e=>e.addCase(Ve,Na).addCase(Ge,za).addCase(We,Da)}),{synthesisFeatureEnabled:_a}=Ea.actions,La=Ea.reducer,Ta=e=>t=>n=>{const r=t(n);if(Be.match(n))try{const t=e.getState(),r=t.synthesis;if(r.isActive&&r.currentStep>0&&r.currentStep<=r.numInstances){const o=n.payload;if(o.enter&&o.enter.length>0&&window.CndCore){const n=o.enter[o.enter.length-1],s=t.data.datumById[t.data.active||""];if(console.log("[SynthesisMiddleware] New datum received:",{newDatumId:n.id,activeDatumId:null==s?void 0:s.id,generatorMatch:n.generatorName===(null==s?void 0:s.generatorName),currentStep:r.currentStep,numInstances:r.numInstances}),n.generatorName===(null==s?void 0:s.generatorName)){console.log("[SynthesisMiddleware] New instance from same generator, loading for synthesis");const t=window.CndCore.AlloyInstance.parseAlloyXML(n.data);if(t.instances&&t.instances.length>0){const n=new window.CndCore.AlloyDataInstance(t.instances[0]),o=[...r.loadedInstances,n];console.log("[SynthesisMiddleware] Loaded instance, total now:",o.length),e.dispatch(ei({instances:o}))}}}}}catch(e){console.error("[SynthesisMiddleware] Failed to load new instance:",e)}return r},Pa=function(e,t){const{id:n,result:r}=t.payload;e.expressionsById[n].result=r},Ba=function(e,t){const{id:n,datumId:r,expression:o}=t.payload,s=e.orderByDatumId[r]||[];e.nextExpressionId+=1,e.expressionsById[n]={id:n,datumId:r,expression:o,result:""},e.orderByDatumId[r]=[n,...s]},Ra=(0,Ee.oM)({name:"evaluator",initialState:{nextExpressionId:0,expressionsById:{},orderByDatumId:{}},reducers:{},extraReducers:e=>e.addCase(Re,Pa).addCase(Te,Ba)}),{}=Ra.actions,Va=Ra.reducer;function $a(e){return{type:"message",time:(new Date).toJSON(),text:e}}function Fa(e){return{type:"error",time:(new Date).toJSON(),text:e}}const Ga=function(e,t){e.items.push($a(`Datum selected - Datum ID: ${t.payload}`))},Za=function(e,t){const{id:n,onClick:r}=t.payload;e.items.push($a(`Click button - Datum ID: ${n} - Button: ${r}`))},Wa=function(e,t){const{enter:n,update:r,exit:o}=t.payload,s=(null==n?void 0:n.length)||0,i=(null==r?void 0:r.length)||0,a=(null==o?void 0:o.length)||0;e.items.push($a(`Receive data: ${s} enter, ${i} update, ${a} exit.`))},Ua=function(e){e.items.push($a("Request data."))},qa=function(e,t){const{name:n}=t.payload;e.items.push($a(`Receive metadata from ${n}.`))},Ya=function(e){e.items.push($a("Connection established."))},Xa=function(e,t){e.items.push(Fa(t.payload))},Ha=function(e){e.items.push($a("Connection lost."))},Ja=function(e,t){e.items.push(Fa(t.payload))},Qa=(0,Ee.oM)({name:"log",initialState:{items:[],filters:["message","warning","error"],sort:"ascending"},reducers:{filtersChanged:function(e,t){e.filters=t.payload},logCleared:function(e){e.items=[]},sortOrderChanged:function(e,t){e.sort=t.payload}},extraReducers:e=>e.addCase(Is,Ga).addCase(_e,Za).addCase(Be,Wa).addCase(Le,Ua).addCase(Ve,qa).addCase(Ge,Ya).addCase(Ze,Xa).addCase(We,Ha).addCase(Ue,Ja)}),{logCleared:Ka,sortOrderChanged:el,filtersChanged:tl}=Qa.actions,nl=Qa.reducer,rl=(0,Ee.xC)({reducer:{data:ks,evaluator:Va,graphs:Qo,log:nl,provider:La,script:la,synthesis:pi,ui:Ws},middleware:e=>e({serializableCheck:{ignoredPaths:["synthesis.loadedInstances"],ignoredActionPaths:["payload.instances"]}}).prepend(function(){let e=null,t=0;const n=()=>{window.clearInterval(t),t=0},r=()=>{e&&e.close()},o=()=>{e&&e.send("ping")},s=(i,a)=>{const l=i.dispatch;let c=!1;e&&r(),a=a||`ws://localhost:${window.location.search.slice(1)}`,e=new WebSocket(a),e.onopen=()=>{c=!0,window.setTimeout((()=>o()),3e3),l(Ge()),n()},e.onclose=()=>{c&&(c=!1,l(We())),e&&e.readyState===WebSocket.CLOSED&&(n(),t=window.setInterval((()=>s(i,a)),1e3))},e.onmessage=e=>{"pong"===e.data?window.setTimeout((()=>o()),3e3):yt(e.data,i)}};return t=>n=>o=>($e.match(o)?s(t,o.payload):Fe.match(o)?r():_e.match(o)?function(e,t,n){if(!e)return wt(t);vt(e,function(e,t){return{type:"click",version:1,payload:t}}(0,n))}(e,t,o.payload):Le.match(o)?function(e,t){if(!e)return wt(t);vt(e,{type:"data",version:1})}(e,t):Te.match(o)?function(e,t,n){if(!e)return wt(t);vt(e,function(e,t){return{type:"eval",version:1,payload:t}}(0,n))}(e,t,o.payload):Pe.match(o)&&function(e,t){if(!e)return wt(t);vt(e,{type:"meta",version:1})}(e,t),n(o))}(),(e=>t=>n=>{if(!Ge.match(n))return t(n);t(n),e.dispatch(Pe()),e.dispatch(Le())}),Ta)});function ol({isOpen:e,onClose:t}){const n=(0,o.useRef)(null);let[s,i]=(0,o.useState)("");const a=(0,na.pm)(),l=(0,o.useRef)(null);return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(Oa.u_,Object.assign({isOpen:e,onClose:t},{children:[(0,r.jsx)(Oa.ZA,{}),(0,r.jsxs)(Oa.hz,Object.assign({maxW:"70rem"},{children:[(0,r.jsx)(Oa.xB,{children:(0,r.jsx)(c.M5,{children:"Input Alloy-style XML datum (paste directly or load from file)"})}),(0,r.jsx)(Oa.ol,{}),(0,r.jsxs)(Oa.fe,Object.assign({pb:6},{children:[(0,r.jsx)(A.zx,Object.assign({onClick:()=>{var e;return null===(e=l.current)||void 0===e?void 0:e.click()}},{children:"Click to add XML from file"})),' ...or simply paste in an XML datum below. Then click the "Add Datum" button.',(0,r.jsx)(c.LZ,{h:"1rem"}),(0,r.jsx)(c.iz,{orientation:"horizontal",mx:5}),(0,r.jsx)(c.LZ,{h:"1rem"}),(0,r.jsxs)(ui.NI,{children:[(0,r.jsx)(ui.lX,{children:"XML datum string to add"}),(0,r.jsx)(ka.g,{minH:"20rem",ref:n,placeholder:'\n\n \n \n \n\n\n',value:s,onChange:e=>i(e.target.value)})]})]})),(0,r.jsxs)(Oa.mz,{children:[(0,r.jsx)(A.zx,Object.assign({onClick:()=>{var e;const r=null===(e=n.current)||void 0===e?void 0:e.value;if(void 0===r)return void t();const o=rl.getState().data.datumIds;console.log(o);const s=o.reduce(((e,t)=>isNaN(parseInt(t))?e:Math.max(e,parseInt(t)+1)),0);try{rl.dispatch(Be({enter:[bt({id:s.toString(),format:"alloy",data:r,buttons:[],evaluator:!1})],update:[],exit:[]}))}catch(e){a({variant:"top-accent",position:"bottom-right",title:e instanceof Error?e.name:"Error adding instance",description:e instanceof Error?e.message:"No further information is available.",status:"error",duration:1e4,isClosable:!0})}t()}},{children:"Add Datum"})),(0,r.jsx)(xi.II,{type:"file",ref:l,style:{display:"none"},onChange:e=>{var t;const n=new FileReader;n.onload=e=>{return t=this,n=void 0,o=function*(){var t;(null===(t=e.target)||void 0===t?void 0:t.result)&&(e.target.result instanceof ArrayBuffer?i(e.target.result.toString()):i(e.target.result))},new((r=void 0)||(r=Promise))((function(e,s){function i(e){try{l(o.next(e))}catch(e){s(e)}}function a(e){try{l(o.throw(e))}catch(e){s(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(i,a)}l((o=o.apply(t,n||[])).next())}));var t,n,r,o},(null===(t=e.target)||void 0===t?void 0:t.files)&&e.target.files.length>0&&n.readAsText(e.target.files[0])}})]})]}))]}))})}function sl({isOpen:e,onClose:t}){const n=At(Mr);return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(Oa.u_,Object.assign({isOpen:e,onClose:t},{children:[(0,r.jsx)(Oa.ZA,{}),(0,r.jsxs)(Oa.hz,Object.assign({maxW:"70rem"},{children:[(0,r.jsx)(Oa.xB,{children:(0,r.jsx)(c.M5,{children:"Using Spytial Sterling"})}),(0,r.jsx)(Oa.ol,{}),(0,r.jsxs)(Oa.fe,Object.assign({pb:6},{children:[(0,r.jsxs)(c.xu,Object.assign({as:"ul",listStyleType:"circle"},{children:[(0,r.jsxs)("li",{children:["Use the ",(0,r.jsx)("strong",{children:"evaluator"})," tab to query the value of expressions and constraints."]}),(0,r.jsxs)("li",{children:["The ",(0,r.jsx)("strong",{children:"explorer"})," tab lets you pick a run to visualize. Click on any prior instance to reload it in the visualizer."]})]})),(0,r.jsx)(c.iz,{orientation:"horizontal",colorScheme:"blackAlpha"}),"ScriptView"===n&&(0,r.jsx)(al,{}),"GraphView"===n&&(0,r.jsx)(il,{}),"TableView"===n&&(0,r.jsx)(ll,{})]}))]}))]}))})}function il(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.M5,{children:(0,r.jsx)("strong",{children:"Graph View"})}),(0,r.jsxs)(c.xu,Object.assign({as:"ul",listStyleType:"circle"},{children:[(0,r.jsxs)("li",{children:[(0,r.jsx)("strong",{children:"Zoom"})," with the mouse wheel or with ",(0,r.jsx)("em",{children:"two fingers"})," on the trackpad."]}),(0,r.jsxs)("li",{children:["Use the ",(0,r.jsx)("strong",{children:"theme"})," tab on the sidebar to adjust styling options such as node coloring by sig, source and destination for edges, etc. You can also save the theme-definition file or load one you've already created."]}),(0,r.jsxs)("li",{children:["The ",(0,r.jsx)("strong",{children:"time"})," tab will let you adjust the layout according to time index, if that is appropriate for your model. In a Temporal model, you'll see a minimap and have the option to move back and forth in time. In a model that isn't explicitly temporal, you can still declare a sig as the time index and use it to navigate."]}),(0,r.jsxs)("li",{children:["The ",(0,r.jsx)("strong",{children:"layout"})," tab opens the CnD interface, which is an alternative graph-based visualization that gives more control over your instance diagram."]})]}))]})}function al(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.M5,{children:(0,r.jsx)("strong",{children:"Script View"})}),(0,r.jsx)(c.xu,{as:"ul",listStyleType:"circle"})]})}function ll(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.M5,{children:(0,r.jsx)("strong",{children:"Table View"})}),(0,r.jsx)(c.xu,{as:"ul",listStyleType:"circle"})]})}const cl=()=>{const e=jt(),t=(0,Ma.qY)(),n=(0,Ma.qY)();return(0,r.jsxs)(E,Object.assign({"data-testid":"app-status-bar"},{children:[(0,r.jsxs)("div",Object.assign({className:"cursor-pointer transition-colors hover:text-white",onClick:n.onOpen},{children:[(0,r.jsx)(c.LZ,{width:"50px"}),(0,r.jsx)(c.M5,{children:(0,r.jsx)("strong",{children:"Help"})})]})),(0,r.jsx)(sl,{isOpen:n.isOpen,onClose:n.onClose}),(0,r.jsx)(c.iz,{orientation:"vertical",mx:2}),(0,r.jsx)(c.LZ,{}),(0,r.jsx)(c.iz,{orientation:"vertical",mx:2}),(0,r.jsx)("div",Object.assign({className:"cursor-pointer transition-colors hover:text-white",onClick:t.onOpen},{children:"Manual Datum"})),(0,r.jsx)(ol,{isOpen:t.isOpen,onClose:t.onClose}),(0,r.jsx)(c.iz,{orientation:"vertical",mx:2}),(0,r.jsx)("div",Object.assign({className:"cursor-pointer transition-colors hover:text-white",onClick:()=>{e(Os())}},{children:"Console Dump"})),(0,r.jsx)(c.iz,{orientation:"vertical",mx:2}),(0,r.jsx)(Ia,{})]}))},dl={layout:{drawerWidth:350,drawerMinWidth:100,drawerMaxWidth:600,explorerWidth:250,explorerMinWidth:60,explorerMaxWidth:250}};var pl=n(93379),hl=n.n(pl),ul=n(7795),ml=n.n(ul),gl=n(90569),fl=n.n(gl),xl=n(3565),bl=n.n(xl),yl=n(19216),wl=n.n(yl),vl=n(44589),jl=n.n(vl),Al=n(50992),Sl={};Sl.styleTagTransform=jl(),Sl.setAttributes=bl(),Sl.insert=fl().bind(null,"head"),Sl.domAPI=ml(),Sl.insertStyleElement=wl(),hl()(Al.Z,Sl),Al.Z&&Al.Z.locals&&Al.Z.locals,s.render((0,r.jsx)(o.StrictMode,{children:(0,r.jsx)(a.xjn,Object.assign({theme:L},{children:(0,r.jsx)(i.zt,Object.assign({store:rl},{children:(0,r.jsx)((e=>{const{url:t}=e,{layout:n}=dl,s=jt(),i=At(br);return(0,o.useEffect)((()=>(s($e(t)),()=>{s(Fe())})),[t,s]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(m,Object.assign({rightPaneCollapsed:i,rightPaneInitialWidth:n.drawerWidth,rightPaneMinWidth:n.drawerMinWidth,rightPaneMaxWidth:n.drawerMaxWidth},{children:[(0,r.jsx)(Sa,{}),(0,r.jsx)(Fi,{})]})),(0,r.jsx)(Hi,{}),(0,r.jsx)(Wi,{}),(0,r.jsx)(cl,{})]})}),{url:void 0})}))}))}),document.getElementById("root"))},50992:(e,t,n)=>{n.d(t,{Z:()=>b});var r=n(8081),o=n.n(r),s=n(23645),i=n.n(s),a=n(61667),l=n.n(a),c=new URL(n(70909),n.b),d=new URL(n(133),n.b),p=new URL(n(23601),n.b),h=new URL(n(1686),n.b),u=i()(o()),m=l()(c),g=l()(d),f=l()(p),x=l()(h);u.push([e.id,"/*\n! tailwindcss v3.0.13 | MIT License | https://tailwindcss.com\n*//*\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\n*/\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: #e5e7eb; /* 2 */\n}\n\n::before,\n::after {\n --tw-content: '';\n}\n\n/*\n1. Use a consistent sensible line-height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n3. Use a more readable tab size.\n4. Use the user's configured `sans` font-family by default.\n*/\n\nhtml {\n line-height: 1.5; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n -moz-tab-size: 4; /* 3 */\n -o-tab-size: 4;\n tab-size: 4; /* 3 */\n font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"; /* 4 */\n}\n\n/*\n1. Remove the margin in all browsers.\n2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.\n*/\n\nbody {\n margin: 0; /* 1 */\n line-height: inherit; /* 2 */\n}\n\n/*\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n3. Ensure horizontal rules are visible by default.\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n border-top-width: 1px; /* 3 */\n}\n\n/*\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\n/*\nRemove the default font size and weight for headings.\n*/\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/*\nReset links to optimize for opt-in styling instead of opt-out.\n*/\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/*\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/*\n1. Use the user's configured `mono` font family by default.\n2. Correct the odd `em` font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/*\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/*\nPrevent `sub` and `sup` elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n3. Remove gaps between table borders by default.\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n border-collapse: collapse; /* 3 */\n}\n\n/*\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n3. Remove default padding in all browsers.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-size: 100%; /* 1 */\n line-height: inherit; /* 1 */\n color: inherit; /* 1 */\n margin: 0; /* 2 */\n padding: 0; /* 3 */\n}\n\n/*\nRemove the inheritance of text transform in Edge and Firefox.\n*/\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Remove default button styles.\n*/\n\nbutton,\n[type='button'],\n[type='reset'],\n[type='submit'] {\n -webkit-appearance: button; /* 1 */\n background-color: transparent; /* 2 */\n background-image: none; /* 2 */\n}\n\n/*\nUse the modern Firefox focus style for all focusable elements.\n*/\n\n:-moz-focusring {\n outline: auto;\n}\n\n/*\nRemove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\n/*\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/*\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/*\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type='search'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/*\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to `inherit` in Safari.\n*/\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/*\nRemoves the default spacing and border for appropriate elements.\n*/\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nol,\nul,\nmenu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/*\nPrevent resizing textareas horizontally by default.\n*/\n\ntextarea {\n resize: vertical;\n}\n\n/*\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n2. Set the default placeholder color to the user's configured gray 400 color.\n*/\n\ninput::-moz-placeholder, textarea::-moz-placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\ninput:-ms-input-placeholder, textarea:-ms-input-placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\ninput::placeholder,\ntextarea::placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\n/*\nSet the default cursor for buttons.\n*/\n\nbutton,\n[role=\"button\"] {\n cursor: pointer;\n}\n\n/*\nMake sure disabled buttons don't get the pointer cursor.\n*/\n:disabled {\n cursor: default;\n}\n\n/*\n1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)\n2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block; /* 1 */\n vertical-align: middle; /* 2 */\n}\n\n/*\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/*\nEnsure the default browser behavior of the `hidden` attribute.\n*/\n\n[hidden] {\n display: none;\n}\n\n[type='text'],[type='email'],[type='url'],[type='password'],[type='number'],[type='date'],[type='datetime-local'],[type='month'],[type='search'],[type='tel'],[type='time'],[type='week'],[multiple],textarea,select {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n background-color: #fff;\n border-color: #6b7280;\n border-width: 1px;\n border-radius: 0px;\n padding-top: 0.5rem;\n padding-right: 0.75rem;\n padding-bottom: 0.5rem;\n padding-left: 0.75rem;\n font-size: 1rem;\n line-height: 1.5rem;\n --tw-shadow: 0 0 #0000;\n}\n\n[type='text']:focus, [type='email']:focus, [type='url']:focus, [type='password']:focus, [type='number']:focus, [type='date']:focus, [type='datetime-local']:focus, [type='month']:focus, [type='search']:focus, [type='tel']:focus, [type='time']:focus, [type='week']:focus, [multiple]:focus, textarea:focus, select:focus {\n outline: 2px solid transparent;\n outline-offset: 2px;\n --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: #2563eb;\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n border-color: #2563eb;\n}\n\ninput::-moz-placeholder, textarea::-moz-placeholder {\n color: #6b7280;\n opacity: 1;\n}\n\ninput:-ms-input-placeholder, textarea:-ms-input-placeholder {\n color: #6b7280;\n opacity: 1;\n}\n\ninput::placeholder,textarea::placeholder {\n color: #6b7280;\n opacity: 1;\n}\n\n::-webkit-datetime-edit-fields-wrapper {\n padding: 0;\n}\n\n::-webkit-date-and-time-value {\n min-height: 1.5em;\n}\n\nselect {\n background-image: url("+m+");\n background-position: right 0.5rem center;\n background-repeat: no-repeat;\n background-size: 1.5em 1.5em;\n padding-right: 2.5rem;\n -webkit-print-color-adjust: exact;\n color-adjust: exact;\n}\n\n[multiple] {\n background-image: initial;\n background-position: initial;\n background-repeat: unset;\n background-size: initial;\n padding-right: 0.75rem;\n -webkit-print-color-adjust: unset;\n color-adjust: unset;\n}\n\n[type='checkbox'],[type='radio'] {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n padding: 0;\n -webkit-print-color-adjust: exact;\n color-adjust: exact;\n display: inline-block;\n vertical-align: middle;\n background-origin: border-box;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n flex-shrink: 0;\n height: 1rem;\n width: 1rem;\n color: #2563eb;\n background-color: #fff;\n border-color: #6b7280;\n border-width: 1px;\n --tw-shadow: 0 0 #0000;\n}\n\n[type='checkbox'] {\n border-radius: 0px;\n}\n\n[type='radio'] {\n border-radius: 100%;\n}\n\n[type='checkbox']:focus,[type='radio']:focus {\n outline: 2px solid transparent;\n outline-offset: 2px;\n --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);\n --tw-ring-offset-width: 2px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: #2563eb;\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n}\n\n[type='checkbox']:checked,[type='radio']:checked {\n border-color: transparent;\n background-color: currentColor;\n background-size: 100% 100%;\n background-position: center;\n background-repeat: no-repeat;\n}\n\n[type='checkbox']:checked {\n background-image: url("+g+");\n}\n\n[type='radio']:checked {\n background-image: url("+f+");\n}\n\n[type='checkbox']:checked:hover,[type='checkbox']:checked:focus,[type='radio']:checked:hover,[type='radio']:checked:focus {\n border-color: transparent;\n background-color: currentColor;\n}\n\n[type='checkbox']:indeterminate {\n background-image: url("+x+');\n border-color: transparent;\n background-color: currentColor;\n background-size: 100% 100%;\n background-position: center;\n background-repeat: no-repeat;\n}\n\n[type=\'checkbox\']:indeterminate:hover,[type=\'checkbox\']:indeterminate:focus {\n border-color: transparent;\n background-color: currentColor;\n}\n\n[type=\'file\'] {\n background: unset;\n border-color: inherit;\n border-width: 0;\n border-radius: 0;\n padding: 0;\n font-size: unset;\n line-height: inherit;\n}\n\n[type=\'file\']:focus {\n outline: 1px auto -webkit-focus-ring-color;\n}\n\n*, ::before, ::after {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n}\n.container {\n width: 100%;\n}\n@media (min-width: 640px) {\n\n .container {\n max-width: 640px;\n }\n}\n@media (min-width: 768px) {\n\n .container {\n max-width: 768px;\n }\n}\n@media (min-width: 1024px) {\n\n .container {\n max-width: 1024px;\n }\n}\n@media (min-width: 1280px) {\n\n .container {\n max-width: 1280px;\n }\n}\n@media (min-width: 1536px) {\n\n .container {\n max-width: 1536px;\n }\n}\n.prose {\n color: var(--tw-prose-body);\n max-width: 65ch;\n}\n.prose :where([class~="lead"]):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-lead);\n font-size: 1.25em;\n line-height: 1.6;\n margin-top: 1.2em;\n margin-bottom: 1.2em;\n}\n.prose :where(a):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-links);\n text-decoration: underline;\n font-weight: 500;\n}\n.prose :where(strong):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-bold);\n font-weight: 600;\n}\n.prose :where(ol):not(:where([class~="not-prose"] *)) {\n list-style-type: decimal;\n padding-left: 1.625em;\n}\n.prose :where(ol[type="A"]):not(:where([class~="not-prose"] *)) {\n list-style-type: upper-alpha;\n}\n.prose :where(ol[type="a"]):not(:where([class~="not-prose"] *)) {\n list-style-type: lower-alpha;\n}\n.prose :where(ol[type="A" s]):not(:where([class~="not-prose"] *)) {\n list-style-type: upper-alpha;\n}\n.prose :where(ol[type="a" s]):not(:where([class~="not-prose"] *)) {\n list-style-type: lower-alpha;\n}\n.prose :where(ol[type="I"]):not(:where([class~="not-prose"] *)) {\n list-style-type: upper-roman;\n}\n.prose :where(ol[type="i"]):not(:where([class~="not-prose"] *)) {\n list-style-type: lower-roman;\n}\n.prose :where(ol[type="I" s]):not(:where([class~="not-prose"] *)) {\n list-style-type: upper-roman;\n}\n.prose :where(ol[type="i" s]):not(:where([class~="not-prose"] *)) {\n list-style-type: lower-roman;\n}\n.prose :where(ol[type="1"]):not(:where([class~="not-prose"] *)) {\n list-style-type: decimal;\n}\n.prose :where(ul):not(:where([class~="not-prose"] *)) {\n list-style-type: disc;\n padding-left: 1.625em;\n}\n.prose :where(ol > li):not(:where([class~="not-prose"] *))::marker {\n font-weight: 400;\n color: var(--tw-prose-counters);\n}\n.prose :where(ul > li):not(:where([class~="not-prose"] *))::marker {\n color: var(--tw-prose-bullets);\n}\n.prose :where(hr):not(:where([class~="not-prose"] *)) {\n border-color: var(--tw-prose-hr);\n border-top-width: 1px;\n margin-top: 3em;\n margin-bottom: 3em;\n}\n.prose :where(blockquote):not(:where([class~="not-prose"] *)) {\n font-weight: 500;\n font-style: italic;\n color: var(--tw-prose-quotes);\n border-left-width: 0.25rem;\n border-left-color: var(--tw-prose-quote-borders);\n quotes: "\\201C""\\201D""\\2018""\\2019";\n margin-top: 1.6em;\n margin-bottom: 1.6em;\n padding-left: 1em;\n}\n.prose :where(blockquote p:first-of-type):not(:where([class~="not-prose"] *))::before {\n content: open-quote;\n}\n.prose :where(blockquote p:last-of-type):not(:where([class~="not-prose"] *))::after {\n content: close-quote;\n}\n.prose :where(h1):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-headings);\n font-weight: 800;\n font-size: 2.25em;\n margin-top: 0;\n margin-bottom: 0.8888889em;\n line-height: 1.1111111;\n}\n.prose :where(h1 strong):not(:where([class~="not-prose"] *)) {\n font-weight: 900;\n}\n.prose :where(h2):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-headings);\n font-weight: 700;\n font-size: 1.5em;\n margin-top: 2em;\n margin-bottom: 1em;\n line-height: 1.3333333;\n}\n.prose :where(h2 strong):not(:where([class~="not-prose"] *)) {\n font-weight: 800;\n}\n.prose :where(h3):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-headings);\n font-weight: 600;\n font-size: 1.25em;\n margin-top: 1.6em;\n margin-bottom: 0.6em;\n line-height: 1.6;\n}\n.prose :where(h3 strong):not(:where([class~="not-prose"] *)) {\n font-weight: 700;\n}\n.prose :where(h4):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-headings);\n font-weight: 600;\n margin-top: 1.5em;\n margin-bottom: 0.5em;\n line-height: 1.5;\n}\n.prose :where(h4 strong):not(:where([class~="not-prose"] *)) {\n font-weight: 700;\n}\n.prose :where(figure > *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n margin-bottom: 0;\n}\n.prose :where(figcaption):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-captions);\n font-size: 0.875em;\n line-height: 1.4285714;\n margin-top: 0.8571429em;\n}\n.prose :where(code):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-code);\n font-weight: 600;\n font-size: 0.875em;\n}\n.prose :where(code):not(:where([class~="not-prose"] *))::before {\n content: "`";\n}\n.prose :where(code):not(:where([class~="not-prose"] *))::after {\n content: "`";\n}\n.prose :where(a code):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-links);\n}\n.prose :where(pre):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-pre-code);\n background-color: var(--tw-prose-pre-bg);\n overflow-x: auto;\n font-weight: 400;\n font-size: 0.875em;\n line-height: 1.7142857;\n margin-top: 1.7142857em;\n margin-bottom: 1.7142857em;\n border-radius: 0.375rem;\n padding-top: 0.8571429em;\n padding-right: 1.1428571em;\n padding-bottom: 0.8571429em;\n padding-left: 1.1428571em;\n}\n.prose :where(pre code):not(:where([class~="not-prose"] *)) {\n background-color: transparent;\n border-width: 0;\n border-radius: 0;\n padding: 0;\n font-weight: inherit;\n color: inherit;\n font-size: inherit;\n font-family: inherit;\n line-height: inherit;\n}\n.prose :where(pre code):not(:where([class~="not-prose"] *))::before {\n content: none;\n}\n.prose :where(pre code):not(:where([class~="not-prose"] *))::after {\n content: none;\n}\n.prose :where(table):not(:where([class~="not-prose"] *)) {\n width: 100%;\n table-layout: auto;\n text-align: left;\n margin-top: 2em;\n margin-bottom: 2em;\n font-size: 0.875em;\n line-height: 1.7142857;\n}\n.prose :where(thead):not(:where([class~="not-prose"] *)) {\n border-bottom-width: 1px;\n border-bottom-color: var(--tw-prose-th-borders);\n}\n.prose :where(thead th):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-headings);\n font-weight: 600;\n vertical-align: bottom;\n padding-right: 0.5714286em;\n padding-bottom: 0.5714286em;\n padding-left: 0.5714286em;\n}\n.prose :where(tbody tr):not(:where([class~="not-prose"] *)) {\n border-bottom-width: 1px;\n border-bottom-color: var(--tw-prose-td-borders);\n}\n.prose :where(tbody tr:last-child):not(:where([class~="not-prose"] *)) {\n border-bottom-width: 0;\n}\n.prose :where(tbody td):not(:where([class~="not-prose"] *)) {\n vertical-align: baseline;\n padding-top: 0.5714286em;\n padding-right: 0.5714286em;\n padding-bottom: 0.5714286em;\n padding-left: 0.5714286em;\n}\n.prose {\n --tw-prose-body: #374151;\n --tw-prose-headings: #111827;\n --tw-prose-lead: #4b5563;\n --tw-prose-links: #111827;\n --tw-prose-bold: #111827;\n --tw-prose-counters: #6b7280;\n --tw-prose-bullets: #d1d5db;\n --tw-prose-hr: #e5e7eb;\n --tw-prose-quotes: #111827;\n --tw-prose-quote-borders: #e5e7eb;\n --tw-prose-captions: #6b7280;\n --tw-prose-code: #111827;\n --tw-prose-pre-code: #e5e7eb;\n --tw-prose-pre-bg: #1f2937;\n --tw-prose-th-borders: #d1d5db;\n --tw-prose-td-borders: #e5e7eb;\n --tw-prose-invert-body: #d1d5db;\n --tw-prose-invert-headings: #fff;\n --tw-prose-invert-lead: #9ca3af;\n --tw-prose-invert-links: #fff;\n --tw-prose-invert-bold: #fff;\n --tw-prose-invert-counters: #9ca3af;\n --tw-prose-invert-bullets: #4b5563;\n --tw-prose-invert-hr: #374151;\n --tw-prose-invert-quotes: #f3f4f6;\n --tw-prose-invert-quote-borders: #374151;\n --tw-prose-invert-captions: #9ca3af;\n --tw-prose-invert-code: #fff;\n --tw-prose-invert-pre-code: #d1d5db;\n --tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);\n --tw-prose-invert-th-borders: #4b5563;\n --tw-prose-invert-td-borders: #374151;\n font-size: 1rem;\n line-height: 1.75;\n}\n.prose :where(p):not(:where([class~="not-prose"] *)) {\n margin-top: 1.25em;\n margin-bottom: 1.25em;\n}\n.prose :where(img):not(:where([class~="not-prose"] *)) {\n margin-top: 2em;\n margin-bottom: 2em;\n}\n.prose :where(video):not(:where([class~="not-prose"] *)) {\n margin-top: 2em;\n margin-bottom: 2em;\n}\n.prose :where(figure):not(:where([class~="not-prose"] *)) {\n margin-top: 2em;\n margin-bottom: 2em;\n}\n.prose :where(h2 code):not(:where([class~="not-prose"] *)) {\n font-size: 0.875em;\n}\n.prose :where(h3 code):not(:where([class~="not-prose"] *)) {\n font-size: 0.9em;\n}\n.prose :where(li):not(:where([class~="not-prose"] *)) {\n margin-top: 0.5em;\n margin-bottom: 0.5em;\n}\n.prose :where(ol > li):not(:where([class~="not-prose"] *)) {\n padding-left: 0.375em;\n}\n.prose :where(ul > li):not(:where([class~="not-prose"] *)) {\n padding-left: 0.375em;\n}\n.prose > :where(ul > li p):not(:where([class~="not-prose"] *)) {\n margin-top: 0.75em;\n margin-bottom: 0.75em;\n}\n.prose > :where(ul > li > *:first-child):not(:where([class~="not-prose"] *)) {\n margin-top: 1.25em;\n}\n.prose > :where(ul > li > *:last-child):not(:where([class~="not-prose"] *)) {\n margin-bottom: 1.25em;\n}\n.prose > :where(ol > li > *:first-child):not(:where([class~="not-prose"] *)) {\n margin-top: 1.25em;\n}\n.prose > :where(ol > li > *:last-child):not(:where([class~="not-prose"] *)) {\n margin-bottom: 1.25em;\n}\n.prose :where(ul ul, ul ol, ol ul, ol ol):not(:where([class~="not-prose"] *)) {\n margin-top: 0.75em;\n margin-bottom: 0.75em;\n}\n.prose :where(hr + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose :where(h2 + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose :where(h3 + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose :where(h4 + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose :where(thead th:first-child):not(:where([class~="not-prose"] *)) {\n padding-left: 0;\n}\n.prose :where(thead th:last-child):not(:where([class~="not-prose"] *)) {\n padding-right: 0;\n}\n.prose :where(tbody td:first-child):not(:where([class~="not-prose"] *)) {\n padding-left: 0;\n}\n.prose :where(tbody td:last-child):not(:where([class~="not-prose"] *)) {\n padding-right: 0;\n}\n.prose > :where(:first-child):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose > :where(:last-child):not(:where([class~="not-prose"] *)) {\n margin-bottom: 0;\n}\n.prose-sm {\n font-size: 0.875rem;\n line-height: 1.7142857;\n}\n.prose-sm :where(p):not(:where([class~="not-prose"] *)) {\n margin-top: 1.1428571em;\n margin-bottom: 1.1428571em;\n}\n.prose-sm :where([class~="lead"]):not(:where([class~="not-prose"] *)) {\n font-size: 1.2857143em;\n line-height: 1.5555556;\n margin-top: 0.8888889em;\n margin-bottom: 0.8888889em;\n}\n.prose-sm :where(blockquote):not(:where([class~="not-prose"] *)) {\n margin-top: 1.3333333em;\n margin-bottom: 1.3333333em;\n padding-left: 1.1111111em;\n}\n.prose-sm :where(h1):not(:where([class~="not-prose"] *)) {\n font-size: 2.1428571em;\n margin-top: 0;\n margin-bottom: 0.8em;\n line-height: 1.2;\n}\n.prose-sm :where(h2):not(:where([class~="not-prose"] *)) {\n font-size: 1.4285714em;\n margin-top: 1.6em;\n margin-bottom: 0.8em;\n line-height: 1.4;\n}\n.prose-sm :where(h3):not(:where([class~="not-prose"] *)) {\n font-size: 1.2857143em;\n margin-top: 1.5555556em;\n margin-bottom: 0.4444444em;\n line-height: 1.5555556;\n}\n.prose-sm :where(h4):not(:where([class~="not-prose"] *)) {\n margin-top: 1.4285714em;\n margin-bottom: 0.5714286em;\n line-height: 1.4285714;\n}\n.prose-sm :where(img):not(:where([class~="not-prose"] *)) {\n margin-top: 1.7142857em;\n margin-bottom: 1.7142857em;\n}\n.prose-sm :where(video):not(:where([class~="not-prose"] *)) {\n margin-top: 1.7142857em;\n margin-bottom: 1.7142857em;\n}\n.prose-sm :where(figure):not(:where([class~="not-prose"] *)) {\n margin-top: 1.7142857em;\n margin-bottom: 1.7142857em;\n}\n.prose-sm :where(figure > *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n margin-bottom: 0;\n}\n.prose-sm :where(figcaption):not(:where([class~="not-prose"] *)) {\n font-size: 0.8571429em;\n line-height: 1.3333333;\n margin-top: 0.6666667em;\n}\n.prose-sm :where(code):not(:where([class~="not-prose"] *)) {\n font-size: 0.8571429em;\n}\n.prose-sm :where(h2 code):not(:where([class~="not-prose"] *)) {\n font-size: 0.9em;\n}\n.prose-sm :where(h3 code):not(:where([class~="not-prose"] *)) {\n font-size: 0.8888889em;\n}\n.prose-sm :where(pre):not(:where([class~="not-prose"] *)) {\n font-size: 0.8571429em;\n line-height: 1.6666667;\n margin-top: 1.6666667em;\n margin-bottom: 1.6666667em;\n border-radius: 0.25rem;\n padding-top: 0.6666667em;\n padding-right: 1em;\n padding-bottom: 0.6666667em;\n padding-left: 1em;\n}\n.prose-sm :where(ol):not(:where([class~="not-prose"] *)) {\n padding-left: 1.5714286em;\n}\n.prose-sm :where(ul):not(:where([class~="not-prose"] *)) {\n padding-left: 1.5714286em;\n}\n.prose-sm :where(li):not(:where([class~="not-prose"] *)) {\n margin-top: 0.2857143em;\n margin-bottom: 0.2857143em;\n}\n.prose-sm :where(ol > li):not(:where([class~="not-prose"] *)) {\n padding-left: 0.4285714em;\n}\n.prose-sm :where(ul > li):not(:where([class~="not-prose"] *)) {\n padding-left: 0.4285714em;\n}\n.prose-sm > :where(ul > li p):not(:where([class~="not-prose"] *)) {\n margin-top: 0.5714286em;\n margin-bottom: 0.5714286em;\n}\n.prose-sm > :where(ul > li > *:first-child):not(:where([class~="not-prose"] *)) {\n margin-top: 1.1428571em;\n}\n.prose-sm > :where(ul > li > *:last-child):not(:where([class~="not-prose"] *)) {\n margin-bottom: 1.1428571em;\n}\n.prose-sm > :where(ol > li > *:first-child):not(:where([class~="not-prose"] *)) {\n margin-top: 1.1428571em;\n}\n.prose-sm > :where(ol > li > *:last-child):not(:where([class~="not-prose"] *)) {\n margin-bottom: 1.1428571em;\n}\n.prose-sm :where(ul ul, ul ol, ol ul, ol ol):not(:where([class~="not-prose"] *)) {\n margin-top: 0.5714286em;\n margin-bottom: 0.5714286em;\n}\n.prose-sm :where(hr):not(:where([class~="not-prose"] *)) {\n margin-top: 2.8571429em;\n margin-bottom: 2.8571429em;\n}\n.prose-sm :where(hr + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose-sm :where(h2 + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose-sm :where(h3 + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose-sm :where(h4 + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose-sm :where(table):not(:where([class~="not-prose"] *)) {\n font-size: 0.8571429em;\n line-height: 1.5;\n}\n.prose-sm :where(thead th):not(:where([class~="not-prose"] *)) {\n padding-right: 1em;\n padding-bottom: 0.6666667em;\n padding-left: 1em;\n}\n.prose-sm :where(thead th:first-child):not(:where([class~="not-prose"] *)) {\n padding-left: 0;\n}\n.prose-sm :where(thead th:last-child):not(:where([class~="not-prose"] *)) {\n padding-right: 0;\n}\n.prose-sm :where(tbody td):not(:where([class~="not-prose"] *)) {\n padding-top: 0.6666667em;\n padding-right: 1em;\n padding-bottom: 0.6666667em;\n padding-left: 1em;\n}\n.prose-sm :where(tbody td:first-child):not(:where([class~="not-prose"] *)) {\n padding-left: 0;\n}\n.prose-sm :where(tbody td:last-child):not(:where([class~="not-prose"] *)) {\n padding-right: 0;\n}\n.prose-sm > :where(:first-child):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose-sm > :where(:last-child):not(:where([class~="not-prose"] *)) {\n margin-bottom: 0;\n}\n.sr-only {\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n padding: 0 !important;\n margin: -1px !important;\n overflow: hidden !important;\n clip: rect(0, 0, 0, 0) !important;\n white-space: nowrap !important;\n border-width: 0 !important;\n}\n.visible {\n visibility: visible !important;\n}\n.fixed {\n position: fixed !important;\n}\n.absolute {\n position: absolute !important;\n}\n.relative {\n position: relative !important;\n}\n.inset-0 {\n top: 0px !important;\n right: 0px !important;\n bottom: 0px !important;\n left: 0px !important;\n}\n.inset-y-0 {\n top: 0px !important;\n bottom: 0px !important;\n}\n.inset-x-0 {\n left: 0px !important;\n right: 0px !important;\n}\n.top-0 {\n top: 0px !important;\n}\n.right-0 {\n right: 0px !important;\n}\n.left-0 {\n left: 0px !important;\n}\n.bottom-0 {\n bottom: 0px !important;\n}\n.-left-5 {\n left: -1.25rem !important;\n}\n.top-\\[35px\\] {\n top: 35px !important;\n}\n.col-span-3 {\n grid-column: span 3 / span 3 !important;\n}\n.m-2 {\n margin: 0.5rem !important;\n}\n.mx-2 {\n margin-left: 0.5rem !important;\n margin-right: 0.5rem !important;\n}\n.mx-auto {\n margin-left: auto !important;\n margin-right: auto !important;\n}\n.my-2 {\n margin-top: 0.5rem !important;\n margin-bottom: 0.5rem !important;\n}\n.mx-1 {\n margin-left: 0.25rem !important;\n margin-right: 0.25rem !important;\n}\n.mt-0\\.5 {\n margin-top: 0.125rem !important;\n}\n.mt-0 {\n margin-top: 0px !important;\n}\n.ml-6 {\n margin-left: 1.5rem !important;\n}\n.mb-2 {\n margin-bottom: 0.5rem !important;\n}\n.mb-4 {\n margin-bottom: 1rem !important;\n}\n.ml-2 {\n margin-left: 0.5rem !important;\n}\n.mt-3 {\n margin-top: 0.75rem !important;\n}\n.-mt-0\\.5 {\n margin-top: -0.125rem !important;\n}\n.-mt-0 {\n margin-top: -0px !important;\n}\n.block {\n display: block !important;\n}\n.inline-block {\n display: inline-block !important;\n}\n.flex {\n display: flex !important;\n}\n.inline-flex {\n display: inline-flex !important;\n}\n.table {\n display: table !important;\n}\n.grid {\n display: grid !important;\n}\n.contents {\n display: contents !important;\n}\n.hidden {\n display: none !important;\n}\n.h-\\[30px\\] {\n height: 30px !important;\n}\n.h-full {\n height: 100% !important;\n}\n.h-\\[35px\\] {\n height: 35px !important;\n}\n.h-5 {\n height: 1.25rem !important;\n}\n.h-4 {\n height: 1rem !important;\n}\n.min-h-\\[360px\\] {\n min-height: 360px !important;\n}\n.w-full {\n width: 100% !important;\n}\n.w-5 {\n width: 1.25rem !important;\n}\n.w-4 {\n width: 1rem !important;\n}\n.max-w-4xl {\n max-width: 56rem !important;\n}\n.max-w-2xl {\n max-width: 42rem !important;\n}\n.flex-1 {\n flex: 1 1 0% !important;\n}\n.flex-shrink-0 {\n flex-shrink: 0 !important;\n}\n.grow {\n flex-grow: 1 !important;\n}\n.-rotate-90 {\n --tw-rotate: -90deg !important;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) !important;\n}\n.rotate-90 {\n --tw-rotate: 90deg !important;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) !important;\n}\n.transform {\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) !important;\n}\n.cursor-pointer {\n cursor: pointer !important;\n}\n.cursor-default {\n cursor: default !important;\n}\n.select-none {\n -webkit-user-select: none !important;\n -moz-user-select: none !important;\n -ms-user-select: none !important;\n user-select: none !important;\n}\n.select-text {\n -webkit-user-select: text !important;\n -moz-user-select: text !important;\n -ms-user-select: text !important;\n user-select: text !important;\n}\n.grid-flow-col {\n grid-auto-flow: column !important;\n}\n.grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr)) !important;\n}\n.grid-cols-\\[minmax\\(max-content\\2c auto\\)_repeat\\(2\\2c min-content\\)\\] {\n grid-template-columns: minmax(max-content,auto) repeat(2,min-content) !important;\n}\n.grid-cols-\\[minmax\\(min-content\\2c max-content\\)_minmax\\(max-content\\2c auto\\)_minmax\\(min-content\\2c max-content\\)\\] {\n grid-template-columns: minmax(min-content,max-content) minmax(max-content,auto) minmax(min-content,max-content) !important;\n}\n.grid-cols-\\[minmax\\(max-content\\2c auto\\)_minmax\\(max-content\\2c auto\\)\\] {\n grid-template-columns: minmax(max-content,auto) minmax(max-content,auto) !important;\n}\n.flex-col {\n flex-direction: column !important;\n}\n.flex-wrap {\n flex-wrap: wrap !important;\n}\n.place-content-center {\n place-content: center !important;\n}\n.place-items-center {\n place-items: center !important;\n}\n.content-start {\n align-content: flex-start !important;\n}\n.items-start {\n align-items: flex-start !important;\n}\n.items-center {\n align-items: center !important;\n}\n.justify-end {\n justify-content: flex-end !important;\n}\n.justify-center {\n justify-content: center !important;\n}\n.justify-between {\n justify-content: space-between !important;\n}\n.gap-3 {\n gap: 0.75rem !important;\n}\n.gap-2 {\n gap: 0.5rem !important;\n}\n.gap-1 {\n gap: 0.25rem !important;\n}\n.gap-y-2 {\n row-gap: 0.5rem !important;\n}\n.space-x-2 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-x-reverse: 0 !important;\n margin-right: calc(0.5rem * var(--tw-space-x-reverse)) !important;\n margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse))) !important;\n}\n.space-y-4 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0 !important;\n margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse))) !important;\n margin-bottom: calc(1rem * var(--tw-space-y-reverse)) !important;\n}\n.space-y-3 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0 !important;\n margin-top: calc(0.75rem * calc(1 - var(--tw-space-y-reverse))) !important;\n margin-bottom: calc(0.75rem * var(--tw-space-y-reverse)) !important;\n}\n.space-y-2 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0 !important;\n margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse))) !important;\n margin-bottom: calc(0.5rem * var(--tw-space-y-reverse)) !important;\n}\n.divide-x > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-x-reverse: 0 !important;\n border-right-width: calc(1px * var(--tw-divide-x-reverse)) !important;\n border-left-width: calc(1px * calc(1 - var(--tw-divide-x-reverse))) !important;\n}\n.divide-dashed > :not([hidden]) ~ :not([hidden]) {\n border-style: dashed !important;\n}\n.overflow-hidden {\n overflow: hidden !important;\n}\n.overflow-y-auto {\n overflow-y: auto !important;\n}\n.truncate {\n overflow: hidden !important;\n text-overflow: ellipsis !important;\n white-space: nowrap !important;\n}\n.whitespace-nowrap {\n white-space: nowrap !important;\n}\n.rounded {\n border-radius: 0.25rem !important;\n}\n.rounded-xl {\n border-radius: 0.75rem !important;\n}\n.rounded-lg {\n border-radius: 0.5rem !important;\n}\n.rounded-full {\n border-radius: 9999px !important;\n}\n.border {\n border-width: 1px !important;\n}\n.border-2 {\n border-width: 2px !important;\n}\n.border-b {\n border-bottom-width: 1px !important;\n}\n.border-t {\n border-top-width: 1px !important;\n}\n.border-dashed {\n border-style: dashed !important;\n}\n.border-red-300 {\n --tw-border-opacity: 1 !important;\n border-color: rgb(252 165 165 / var(--tw-border-opacity)) !important;\n}\n.border-gray-100 {\n --tw-border-opacity: 1 !important;\n border-color: rgb(243 244 246 / var(--tw-border-opacity)) !important;\n}\n.border-purple-200 {\n --tw-border-opacity: 1 !important;\n border-color: rgb(233 213 255 / var(--tw-border-opacity)) !important;\n}\n.border-slate-200 {\n --tw-border-opacity: 1 !important;\n border-color: rgb(226 232 240 / var(--tw-border-opacity)) !important;\n}\n.border-blue-200 {\n --tw-border-opacity: 1 !important;\n border-color: rgb(191 219 254 / var(--tw-border-opacity)) !important;\n}\n.border-red-200 {\n --tw-border-opacity: 1 !important;\n border-color: rgb(254 202 202 / var(--tw-border-opacity)) !important;\n}\n.border-slate-300 {\n --tw-border-opacity: 1 !important;\n border-color: rgb(203 213 225 / var(--tw-border-opacity)) !important;\n}\n.bg-slate-100 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(241 245 249 / var(--tw-bg-opacity)) !important;\n}\n.bg-white {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity)) !important;\n}\n.bg-red-100 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(254 226 226 / var(--tw-bg-opacity)) !important;\n}\n.bg-purple-50 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(250 245 255 / var(--tw-bg-opacity)) !important;\n}\n.bg-gray-50 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(249 250 251 / var(--tw-bg-opacity)) !important;\n}\n.bg-slate-50\\/90 {\n background-color: rgb(248 250 252 / 0.9) !important;\n}\n.bg-white\\/80 {\n background-color: rgb(255 255 255 / 0.8) !important;\n}\n.bg-slate-50 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(248 250 252 / var(--tw-bg-opacity)) !important;\n}\n.bg-fuchsia-100 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(250 232 255 / var(--tw-bg-opacity)) !important;\n}\n.bg-purple-100 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(243 232 255 / var(--tw-bg-opacity)) !important;\n}\n.bg-blue-50 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(239 246 255 / var(--tw-bg-opacity)) !important;\n}\n.bg-red-50 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(254 242 242 / var(--tw-bg-opacity)) !important;\n}\n.bg-white\\/90 {\n background-color: rgb(255 255 255 / 0.9) !important;\n}\n.bg-indigo-600 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(79 70 229 / var(--tw-bg-opacity)) !important;\n}\n.bg-blue-600 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(37 99 235 / var(--tw-bg-opacity)) !important;\n}\n.bg-opacity-75 {\n --tw-bg-opacity: 0.75 !important;\n}\n.bg-gradient-to-r {\n background-image: linear-gradient(to right, var(--tw-gradient-stops)) !important;\n}\n.from-fuchsia-600 {\n --tw-gradient-from: #c026d3 !important;\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(192 38 211 / 0)) !important;\n}\n.from-purple-600 {\n --tw-gradient-from: #9333ea !important;\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(147 51 234 / 0)) !important;\n}\n.to-purple-600 {\n --tw-gradient-to: #9333ea !important;\n}\n.to-indigo-600 {\n --tw-gradient-to: #4f46e5 !important;\n}\n.p-4 {\n padding: 1rem !important;\n}\n.p-2 {\n padding: 0.5rem !important;\n}\n.p-8 {\n padding: 2rem !important;\n}\n.p-6 {\n padding: 1.5rem !important;\n}\n.p-3 {\n padding: 0.75rem !important;\n}\n.p-1 {\n padding: 0.25rem !important;\n}\n.px-2 {\n padding-left: 0.5rem !important;\n padding-right: 0.5rem !important;\n}\n.py-1 {\n padding-top: 0.25rem !important;\n padding-bottom: 0.25rem !important;\n}\n.py-0\\.5 {\n padding-top: 0.125rem !important;\n padding-bottom: 0.125rem !important;\n}\n.py-0 {\n padding-top: 0px !important;\n padding-bottom: 0px !important;\n}\n.py-2 {\n padding-top: 0.5rem !important;\n padding-bottom: 0.5rem !important;\n}\n.px-4 {\n padding-left: 1rem !important;\n padding-right: 1rem !important;\n}\n.py-3 {\n padding-top: 0.75rem !important;\n padding-bottom: 0.75rem !important;\n}\n.py-2\\.5 {\n padding-top: 0.625rem !important;\n padding-bottom: 0.625rem !important;\n}\n.px-1 {\n padding-left: 0.25rem !important;\n padding-right: 0.25rem !important;\n}\n.px-3 {\n padding-left: 0.75rem !important;\n padding-right: 0.75rem !important;\n}\n.pl-2 {\n padding-left: 0.5rem !important;\n}\n.pl-9 {\n padding-left: 2.25rem !important;\n}\n.pr-3 {\n padding-right: 0.75rem !important;\n}\n.pt-2 {\n padding-top: 0.5rem !important;\n}\n.pb-3 {\n padding-bottom: 0.75rem !important;\n}\n.text-center {\n text-align: center !important;\n}\n.align-middle {\n vertical-align: middle !important;\n}\n.font-mono {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;\n}\n.text-xs {\n font-size: 0.75rem !important;\n line-height: 1rem !important;\n}\n.text-sm {\n font-size: 0.875rem !important;\n line-height: 1.25rem !important;\n}\n.text-lg {\n font-size: 1.125rem !important;\n line-height: 1.75rem !important;\n}\n.font-semibold {\n font-weight: 600 !important;\n}\n.font-medium {\n font-weight: 500 !important;\n}\n.font-bold {\n font-weight: 700 !important;\n}\n.uppercase {\n text-transform: uppercase !important;\n}\n.leading-relaxed {\n line-height: 1.625 !important;\n}\n.text-gray-400 {\n --tw-text-opacity: 1 !important;\n color: rgb(156 163 175 / var(--tw-text-opacity)) !important;\n}\n.text-gray-600 {\n --tw-text-opacity: 1 !important;\n color: rgb(75 85 99 / var(--tw-text-opacity)) !important;\n}\n.text-red-700 {\n --tw-text-opacity: 1 !important;\n color: rgb(185 28 28 / var(--tw-text-opacity)) !important;\n}\n.text-gray-700 {\n --tw-text-opacity: 1 !important;\n color: rgb(55 65 81 / var(--tw-text-opacity)) !important;\n}\n.text-slate-300 {\n --tw-text-opacity: 1 !important;\n color: rgb(203 213 225 / var(--tw-text-opacity)) !important;\n}\n.text-slate-500 {\n --tw-text-opacity: 1 !important;\n color: rgb(100 116 139 / var(--tw-text-opacity)) !important;\n}\n.text-slate-900 {\n --tw-text-opacity: 1 !important;\n color: rgb(15 23 42 / var(--tw-text-opacity)) !important;\n}\n.text-fuchsia-600 {\n --tw-text-opacity: 1 !important;\n color: rgb(192 38 211 / var(--tw-text-opacity)) !important;\n}\n.text-slate-800 {\n --tw-text-opacity: 1 !important;\n color: rgb(30 41 59 / var(--tw-text-opacity)) !important;\n}\n.text-slate-600 {\n --tw-text-opacity: 1 !important;\n color: rgb(71 85 105 / var(--tw-text-opacity)) !important;\n}\n.text-slate-700 {\n --tw-text-opacity: 1 !important;\n color: rgb(51 65 85 / var(--tw-text-opacity)) !important;\n}\n.text-purple-600 {\n --tw-text-opacity: 1 !important;\n color: rgb(147 51 234 / var(--tw-text-opacity)) !important;\n}\n.text-white {\n --tw-text-opacity: 1 !important;\n color: rgb(255 255 255 / var(--tw-text-opacity)) !important;\n}\n.opacity-0 {\n opacity: 0 !important;\n}\n.shadow {\n --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1) !important;\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color) !important;\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;\n}\n.shadow-sm {\n --tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05) !important;\n --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color) !important;\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;\n}\n.shadow-md {\n --tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1) !important;\n --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color) !important;\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;\n}\n.outline {\n outline-style: solid !important;\n}\n.blur {\n --tw-blur: blur(8px) !important;\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow) !important;\n}\n.filter {\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow) !important;\n}\n.backdrop-blur {\n --tw-backdrop-blur: blur(8px) !important;\n backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia) !important;\n}\n.transition-colors {\n transition-property: color, background-color, border-color, fill, stroke, -webkit-text-decoration-color !important;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke !important;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, -webkit-text-decoration-color !important;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;\n transition-duration: 150ms !important;\n}\n.transition {\n transition-property: color, background-color, border-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-text-decoration-color !important;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter !important;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-text-decoration-color !important;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;\n transition-duration: 150ms !important;\n}\n.placeholder\\:text-xs::-moz-placeholder {\n font-size: 0.75rem !important;\n line-height: 1rem !important;\n}\n.placeholder\\:text-xs:-ms-input-placeholder {\n font-size: 0.75rem !important;\n line-height: 1rem !important;\n}\n.placeholder\\:text-xs::placeholder {\n font-size: 0.75rem !important;\n line-height: 1rem !important;\n}\n.placeholder\\:italic::-moz-placeholder {\n font-style: italic !important;\n}\n.placeholder\\:italic:-ms-input-placeholder {\n font-style: italic !important;\n}\n.placeholder\\:italic::placeholder {\n font-style: italic !important;\n}\n.placeholder\\:text-gray-400::-moz-placeholder {\n --tw-text-opacity: 1 !important;\n color: rgb(156 163 175 / var(--tw-text-opacity)) !important;\n}\n.placeholder\\:text-gray-400:-ms-input-placeholder {\n --tw-text-opacity: 1 !important;\n color: rgb(156 163 175 / var(--tw-text-opacity)) !important;\n}\n.placeholder\\:text-gray-400::placeholder {\n --tw-text-opacity: 1 !important;\n color: rgb(156 163 175 / var(--tw-text-opacity)) !important;\n}\n.first\\:pl-2:first-child {\n padding-left: 0.5rem !important;\n}\n.last\\:pr-2:last-child {\n padding-right: 0.5rem !important;\n}\n.focus-within\\:border-indigo-500:focus-within {\n --tw-border-opacity: 1 !important;\n border-color: rgb(99 102 241 / var(--tw-border-opacity)) !important;\n}\n.focus-within\\:ring-2:focus-within {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000) !important;\n}\n.focus-within\\:ring-indigo-200:focus-within {\n --tw-ring-opacity: 1 !important;\n --tw-ring-color: rgb(199 210 254 / var(--tw-ring-opacity)) !important;\n}\n.hover\\:border-indigo-400:hover {\n --tw-border-opacity: 1 !important;\n border-color: rgb(129 140 248 / var(--tw-border-opacity)) !important;\n}\n.hover\\:bg-indigo-500:hover {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(99 102 241 / var(--tw-bg-opacity)) !important;\n}\n.hover\\:from-fuchsia-500:hover {\n --tw-gradient-from: #d946ef !important;\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(217 70 239 / 0)) !important;\n}\n.hover\\:from-purple-500:hover {\n --tw-gradient-from: #a855f7 !important;\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(168 85 247 / 0)) !important;\n}\n.hover\\:to-purple-500:hover {\n --tw-gradient-to: #a855f7 !important;\n}\n.hover\\:to-indigo-500:hover {\n --tw-gradient-to: #6366f1 !important;\n}\n.hover\\:text-white:hover {\n --tw-text-opacity: 1 !important;\n color: rgb(255 255 255 / var(--tw-text-opacity)) !important;\n}\n.hover\\:text-indigo-600:hover {\n --tw-text-opacity: 1 !important;\n color: rgb(79 70 229 / var(--tw-text-opacity)) !important;\n}\n.hover\\:text-slate-400:hover {\n --tw-text-opacity: 1 !important;\n color: rgb(148 163 184 / var(--tw-text-opacity)) !important;\n}\n.hover\\:text-black:hover {\n --tw-text-opacity: 1 !important;\n color: rgb(0 0 0 / var(--tw-text-opacity)) !important;\n}\n.focus\\:border-gray-200:focus {\n --tw-border-opacity: 1 !important;\n border-color: rgb(229 231 235 / var(--tw-border-opacity)) !important;\n}\n.focus\\:outline-none:focus {\n outline: 2px solid transparent !important;\n outline-offset: 2px !important;\n}\n.focus-visible\\:outline-none:focus-visible {\n outline: 2px solid transparent !important;\n outline-offset: 2px !important;\n}\n.focus-visible\\:ring-2:focus-visible {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000) !important;\n}\n.focus-visible\\:ring-fuchsia-500:focus-visible {\n --tw-ring-opacity: 1 !important;\n --tw-ring-color: rgb(217 70 239 / var(--tw-ring-opacity)) !important;\n}\n.focus-visible\\:ring-purple-500:focus-visible {\n --tw-ring-opacity: 1 !important;\n --tw-ring-color: rgb(168 85 247 / var(--tw-ring-opacity)) !important;\n}\n.focus-visible\\:ring-indigo-500:focus-visible {\n --tw-ring-opacity: 1 !important;\n --tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity)) !important;\n}\n.focus-visible\\:ring-offset-2:focus-visible {\n --tw-ring-offset-width: 2px !important;\n}\n.focus-visible\\:ring-offset-white:focus-visible {\n --tw-ring-offset-color: #fff !important;\n}\n.active\\:text-slate-800:active {\n --tw-text-opacity: 1 !important;\n color: rgb(30 41 59 / var(--tw-text-opacity)) !important;\n}\n.group:hover .group-hover\\:cursor-pointer {\n cursor: pointer !important;\n}\n.group:hover .group-hover\\:bg-slate-100 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(241 245 249 / var(--tw-bg-opacity)) !important;\n}\n.group:hover .group-hover\\:bg-blue-600 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(37 99 235 / var(--tw-bg-opacity)) !important;\n}\n.group:hover .group-hover\\:text-white {\n --tw-text-opacity: 1 !important;\n color: rgb(255 255 255 / var(--tw-text-opacity)) !important;\n}\n.group:active .group-active\\:bg-blue-700 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(29 78 216 / var(--tw-bg-opacity)) !important;\n}\n@media (min-width: 640px) {\n\n .sm\\:grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr)) !important;\n }\n}',""]);const b=u},94748:e=>{e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAHUlEQVQYV2PYvXu3JAi7uLiAMaYAjAGTQBPYLQkAa/0Zef3qRswAAAAASUVORK5CYII="},4768:e=>{e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAL0lEQVQoz2NgCD3x//9/BhBYBWdhgFVAiVW4JBFKGIa4AqD0//9D3pt4I4tAdAMAHTQ/j5Zom30AAAAASUVORK5CYII="},35555:e=>{e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAAz0lEQVRIx2NgYGBY/R8I/vx5eelX3n82IJ9FxGf6tksvf/8FiTMQAcAGQMDvSwu09abffY8QYSAScNk45G198eX//yev73/4///701eh//kZSARckrNBRvz//+8+6ZohwCzjGNjdgQxkAg7B9WADeBjIBqtJCbhRA0YNoIkBSNmaPEMoNmA0FkYNoFKhapJ6FGyAH3nauaSmPfwI0v/3OukVi0CIZ+F25KrtYcx/CTIy0e+rC7R1Z4KMICVTQQ14feVXIbR695u14+Ir4gwAAD49E54wc1kWAAAAAElFTkSuQmCC"},23601:e=>{e.exports="data:image/svg+xml,%3csvg viewBox=%270 0 16 16%27 fill=%27white%27 xmlns=%27http://www.w3.org/2000/svg%27%3e%3ccircle cx=%278%27 cy=%278%27 r=%273%27/%3e%3c/svg%3e"},133:e=>{e.exports="data:image/svg+xml,%3csvg viewBox=%270 0 16 16%27 fill=%27white%27 xmlns=%27http://www.w3.org/2000/svg%27%3e%3cpath d=%27M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z%27/%3e%3c/svg%3e"},1686:e=>{e.exports="data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27none%27 viewBox=%270 0 16 16%27%3e%3cpath stroke=%27white%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%272%27 d=%27M4 8h8%27/%3e%3c/svg%3e"},70909:e=>{e.exports="data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27none%27 viewBox=%270 0 20 20%27%3e%3cpath stroke=%27%236b7280%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%271.5%27 d=%27M6 8l4 4 4-4%27/%3e%3c/svg%3e"},6161:e=>{e.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCA1MyAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDguMDM2NCA0LjAxMDQySDQuMDA3NzlMNC4wMDc3OSAzMi4wMjg2SDQ4LjAzNjRWNC4wMTA0MlpNNC4wMDc3OSAwLjAwNzgxMjVDMS43OTcyMSAwLjAwNzgxMjUgMC4wMDUxODc5OSAxLjc5OTg0IDAuMDA1MTg3OTkgNC4wMTA0MlYzMi4wMjg2QzAuMDA1MTg3OTkgMzQuMjM5MiAxLjc5NzIxIDM2LjAzMTIgNC4wMDc3OSAzNi4wMzEySDQ4LjAzNjRDNTAuMjQ3IDM2LjAzMTIgNTIuMDM5IDM0LjIzOTIgNTIuMDM5IDMyLjAyODZWNC4wMTA0MkM1Mi4wMzkgMS43OTk4NCA1MC4yNDcgMC4wMDc4MTI1IDQ4LjAzNjQgMC4wMDc4MTI1SDQuMDA3NzlaTTguMDEwNDIgOC4wMTMwMkgxMi4wMTNWMTIuMDE1Nkg4LjAxMDQyVjguMDEzMDJaTTIwLjAxODIgOC4wMTMwMkgxNi4wMTU2VjEyLjAxNTZIMjAuMDE4MlY4LjAxMzAyWk0yNC4wMjA4IDguMDEzMDJIMjguMDIzNFYxMi4wMTU2SDI0LjAyMDhWOC4wMTMwMlpNMzYuMDI4NiA4LjAxMzAySDMyLjAyNlYxMi4wMTU2SDM2LjAyODZWOC4wMTMwMlpNNDAuMDMxMiA4LjAxMzAySDQ0LjAzMzlWMTIuMDE1Nkg0MC4wMzEyVjguMDEzMDJaTTE2LjAxNTYgMTYuMDE4Mkg4LjAxMDQyVjIwLjAyMDhIMTYuMDE1NlYxNi4wMTgyWk0yMC4wMTgyIDE2LjAxODJIMjQuMDIwOFYyMC4wMjA4SDIwLjAxODJWMTYuMDE4MlpNMzIuMDI2IDE2LjAxODJIMjguMDIzNFYyMC4wMjA4SDMyLjAyNlYxNi4wMTgyWk00NC4wMzM5IDE2LjAxODJWMjAuMDIwOEgzNi4wMjg2VjE2LjAxODJINDQuMDMzOVpNMTIuMDEzIDI0LjAyMzRIOC4wMTA0MlYyOC4wMjZIMTIuMDEzVjI0LjAyMzRaTTE2LjAxNTYgMjQuMDIzNEgzNi4wMjg2VjI4LjAyNkgxNi4wMTU2VjI0LjAyMzRaTTQ0LjAzMzkgMjQuMDIzNEg0MC4wMzEyVjI4LjAyNkg0NC4wMzM5VjI0LjAyMzRaIiBmaWxsPSIjNDI0MjQyIi8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDAiPgo8cmVjdCB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg=="},51096:e=>{e.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCA1MyAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDguMDM2NCA0LjAxMDQySDQuMDA3NzlMNC4wMDc3OSAzMi4wMjg2SDQ4LjAzNjRWNC4wMTA0MlpNNC4wMDc3OSAwLjAwNzgxMjVDMS43OTcyMSAwLjAwNzgxMjUgMC4wMDUxODc5OSAxLjc5OTg0IDAuMDA1MTg3OTkgNC4wMTA0MlYzMi4wMjg2QzAuMDA1MTg3OTkgMzQuMjM5MiAxLjc5NzIxIDM2LjAzMTIgNC4wMDc3OSAzNi4wMzEySDQ4LjAzNjRDNTAuMjQ3IDM2LjAzMTIgNTIuMDM5IDM0LjIzOTIgNTIuMDM5IDMyLjAyODZWNC4wMTA0MkM1Mi4wMzkgMS43OTk4NCA1MC4yNDcgMC4wMDc4MTI1IDQ4LjAzNjQgMC4wMDc4MTI1SDQuMDA3NzlaTTguMDEwNDIgOC4wMTMwMkgxMi4wMTNWMTIuMDE1Nkg4LjAxMDQyVjguMDEzMDJaTTIwLjAxODIgOC4wMTMwMkgxNi4wMTU2VjEyLjAxNTZIMjAuMDE4MlY4LjAxMzAyWk0yNC4wMjA4IDguMDEzMDJIMjguMDIzNFYxMi4wMTU2SDI0LjAyMDhWOC4wMTMwMlpNMzYuMDI4NiA4LjAxMzAySDMyLjAyNlYxMi4wMTU2SDM2LjAyODZWOC4wMTMwMlpNNDAuMDMxMiA4LjAxMzAySDQ0LjAzMzlWMTIuMDE1Nkg0MC4wMzEyVjguMDEzMDJaTTE2LjAxNTYgMTYuMDE4Mkg4LjAxMDQyVjIwLjAyMDhIMTYuMDE1NlYxNi4wMTgyWk0yMC4wMTgyIDE2LjAxODJIMjQuMDIwOFYyMC4wMjA4SDIwLjAxODJWMTYuMDE4MlpNMzIuMDI2IDE2LjAxODJIMjguMDIzNFYyMC4wMjA4SDMyLjAyNlYxNi4wMTgyWk00NC4wMzM5IDE2LjAxODJWMjAuMDIwOEgzNi4wMjg2VjE2LjAxODJINDQuMDMzOVpNMTIuMDEzIDI0LjAyMzRIOC4wMTA0MlYyOC4wMjZIMTIuMDEzVjI0LjAyMzRaTTE2LjAxNTYgMjQuMDIzNEgzNi4wMjg2VjI4LjAyNkgxNi4wMTU2VjI0LjAyMzRaTTQ0LjAzMzkgMjQuMDIzNEg0MC4wMzEyVjI4LjAyNkg0NC4wMzM5VjI0LjAyMzRaIiBmaWxsPSIjQzVDNUM1Ii8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDAiPgo8cmVjdCB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg=="}},o={};function s(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={id:e,loaded:!1,exports:{}};return r[e](n,n.exports,s),n.loaded=!0,n.exports}s.m=r,s.amdO={},e=[],s.O=(t,n,r,o)=>{if(!n){var i=1/0;for(d=0;d=o)&&Object.keys(s.O).every((e=>s.O[e](n[l])))?n.splice(l--,1):(a=!1,o0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[n,r,o]},s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,n)=>(s.f[n](e,t),t)),[])),s.u=e=>e+".bundle.js",s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},n="sterling-layout:",s.l=(e,r,o,i)=>{if(t[e])t[e].push(r);else{var a,l;if(void 0!==o)for(var c=document.getElementsByTagName("script"),d=0;d{a.onerror=a.onload=null,clearTimeout(u);var o=t[e];if(delete t[e],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach((e=>e(r))),n)return n(r)},u=setTimeout(h.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=h.bind(null,a.onerror),a.onload=h.bind(null,a.onload),l&&document.head.appendChild(a)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),s.p="./",(()=>{s.b=document.baseURI||self.location.href;var e={179:0};s.f.j=(t,n)=>{var r=s.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise(((n,o)=>r=e[t]=[n,o]));n.push(r[2]=o);var i=s.p+s.u(t),a=new Error;s.l(i,(n=>{if(s.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",a.name="ChunkLoadError",a.type=o,a.request=i,r[1](a)}}),"chunk-"+t,t)}},s.O.j=t=>0===e[t];var t=(t,n)=>{var r,o,[i,a,l]=n,c=0;if(i.some((t=>0!==e[t]))){for(r in a)s.o(a,r)&&(s.m[r]=a[r]);if(l)var d=l(s)}for(t&&t(n);cs(50004)));i=s.O(i)})(); \ No newline at end of file +(()=>{"use strict";var e,t,n,r={67403:(e,t,n)=>{var r=n(85893),o=(n(54848),n(49203),n(31906),n(67294)),s=n(73935),i=n(39704),a=n(57247),l=n(105),c=n(68527),d=n(78654),p=n(35173);const u=()=>{const e=(0,l.mq)("DragBar");return(0,r.jsx)(c.xu,{__css:e})},h=()=>{const e=(0,l.mq)("DragHandle");return(0,r.jsx)(c.xu,Object.assign({className:"drag-handle",__css:e},{children:(0,r.jsx)(u,{})}))},m=e=>{const{children:t,rightPaneCollapsed:n,rightPaneInitialWidth:s,rightPaneMinWidth:i,rightPaneMaxWidth:a}=e,u=(0,o.useRef)(null),m=(0,l.mq)("Dashboard"),[g,f]=(0,o.useState)(0),[b,y]=(0,o.useState)(!1),[w,v]=(0,o.useState)(s),j=(0,o.useMemo)((()=>n?0:w),[n,w]),S=(0,o.useMemo)((()=>n?-w:0),[n,w]),A=(0,o.useMemo)((()=>x(void 0,0,j,b)),[0,j,!1,b]),C=(0,o.useMemo)((()=>x(w,void 0,S,b)),[w,S,b]),M=(0,o.useMemo)((()=>x(void 0,void 0,S+w,b)),[S,w,b]),I=(0,o.useCallback)(((e,t)=>{const n=t.target.getBoundingClientRect(),r=t.clientX-n.left;"right"===e&&(f(r),y(!0))}),[y]),O=(0,o.useCallback)((0,d.Z)((e=>{var t;if(b){const n=u.current;if(n){null===(t=window.getSelection())||void 0===t||t.empty();const r=n.getBoundingClientRect().width-e.clientX+g-5;v((0,p.Z)(r,i,a))}}}),16),[g,b,i,a]),k=(0,o.useCallback)((()=>{y(!1)}),[y]);(0,o.useEffect)((()=>(document.addEventListener("mousemove",O),document.addEventListener("mouseup",k),()=>{document.removeEventListener("mousemove",O),document.removeEventListener("mouseup",k)})),[O,k]);const N=o.Children.toArray(t).filter((e=>e));return 2===N.length?(0,r.jsxs)(c.xu,Object.assign({ref:u,__css:m},{children:[(0,r.jsx)("div",Object.assign({style:A},{children:N[0]})),(0,r.jsx)("div",Object.assign({style:C},{children:N[1]})),(0,r.jsx)("div",Object.assign({style:M,onMouseDown:e=>I("right",e)},{children:(0,r.jsx)(h,{})}))]})):null},g={baseStyle:{position:"fixed",top:"56px",right:"64px",bottom:"36px",left:"0"}};function x(e,t,n,r){const o={position:"absolute",top:"0",bottom:"0",transition:r?void 0:"all 200ms cubic-bezier(0.85, 0, 0.15, 1)"};return void 0!==e&&(o.width=`${e}px`),void 0!==t&&(o.left=`${t}px`),void 0!==n&&(o.right=`${n}px`),o}const f=(0,l.Gp)(((e,t)=>{const n=(0,l.mq)("Pane");return(0,r.jsx)(c.xu,Object.assign({__css:n,ref:t},e))})),b=e=>{const t=(0,l.mq)("LogList",e);return(0,r.jsx)(c.rj,Object.assign({__css:t},e))};const y=e=>{const{variant:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{const t=(0,l.mq)("Logo");return(0,r.jsx)(c.M5,Object.assign({__css:t},e,{children:"Spytial Sterling"}))},v=e=>{const t=(0,l.mq)("NavBar");return(0,r.jsx)(c.kC,Object.assign({__css:t},e))},j={baseStyle:{h:"56px",position:"fixed",top:0,left:0,right:0,display:"flex",alignItems:"center",gap:3,px:4,bg:"rgba(11, 17, 32, 0.92)",backgroundImage:"linear-gradient(120deg, #0f172a 0%, #111827 45%, #0b1224 100%)",color:"gray.100",borderBottom:"1px solid",borderColor:"whiteAlpha.200",boxShadow:"0 12px 40px rgba(15, 23, 42, 0.45)",backdropFilter:"saturate(180%) blur(12px)",zIndex:"banner"}};var S=n(68921);const A=e=>{const t=(0,l.mq)("NavButton");return(0,r.jsx)(S.zx,Object.assign({__css:t},e))},C=e=>{const t=(0,l.mq)("PaneBody");return(0,r.jsx)(c.xu,Object.assign({__css:t},e))},M={baseStyle:{position:"absolute",top:"56px",right:0,bottom:0,left:0,bg:"#f8fafc"}},I=e=>{const t=(0,l.mq)("PaneHeader");return(0,r.jsx)(c.xu,Object.assign({__css:t},e))},O={baseStyle:{position:"absolute",top:0,left:0,right:0,height:"56px",display:"flex",alignItems:"center",gap:"0.75rem",px:3,bg:"rgba(255, 255, 255, 0.92)",backgroundImage:"linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.9) 100%)",borderBottom:"1px solid",borderColor:"gray.200",boxShadow:"0 8px 30px rgba(15, 23, 42, 0.08)",backdropFilter:"saturate(180%) blur(6px)",zIndex:"banner"}},k=e=>{const t=(0,l.mq)("PaneTitle");return(0,r.jsx)(c.M5,Object.assign({__css:t},e))},N=e=>{const t=(0,l.mq)("SideBar");return(0,r.jsx)(c.kC,Object.assign({__css:Object.assign(Object.assign({},t),{overflowY:"auto"})},e))},D={baseStyle:{w:"64px",position:"fixed",top:"56px",right:0,bottom:"36px",display:"flex",flexDir:"column",alignItems:"stretch",fontSize:"xs",gap:"6px",px:2,py:3,borderLeft:"1px solid",borderColor:"whiteAlpha.200",bg:"rgba(11, 17, 32, 0.88)",backdropFilter:"saturate(180%) blur(12px)",boxShadow:"-12px 0 30px rgba(15, 23, 42, 0.35)",color:"gray.100",zIndex:"banner"}};const z=e=>{const{text:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{const t=(0,l.mq)("StatusBar");return(0,r.jsx)(c.kC,Object.assign({__css:t},e))},_={baseStyle:{h:"36px",position:"fixed",right:0,bottom:0,left:0,display:"flex",alignItems:"center",px:4,gap:3,fontSize:"sm",borderTop:"1px solid",borderColor:"whiteAlpha.200",bg:"rgba(12, 17, 30, 0.9)",color:"gray.100",backdropFilter:"saturate(180%) blur(10px)",boxShadow:"0 -8px 30px rgba(15, 23, 42, 0.3)"}},L=(0,a.B1C)({fonts:{body:"InterVariable",mono:"Fira Code VF, Fira Code, monospace"},styles:{global:{"html, body, #root":{w:"full",h:"full",overflow:"hidden",userSelect:"none",cursor:"default"}}},components:{Dashboard:g,DragBar:{baseStyle:{w:"1px",h:"full",transition:"all ease 0.25s",backgroundColor:"gray.300",".drag-handle:hover &":{backgroundColor:"gray.500"}}},DragHandle:{baseStyle:{w:"10px",h:"full",mx:"-5px",px:"5px",cursor:"col-resize",boxSizing:"border-box",backgroundColor:"transparent"}},Logo:{baseStyle:{px:3,py:2,fontWeight:"extrabold",fontSize:"md",letterSpacing:"0.22em",textTransform:"uppercase",color:"white",bg:"whiteAlpha.100",borderRadius:"lg",boxShadow:"inset 0 0 0 1px rgba(255, 255, 255, 0.12)",lineHeight:"1"}},LogList:{baseStyle:{display:"grid",backgroundColor:"gray.50",gridTemplateColumns:"fit-content(300px) 1fr",gridColumnGap:"0.35rem",gridAutoRows:"min-content",userSelect:"text"}},LogText:{baseStyle:{fontFamily:"mono",fontSize:"xs"},variants:{message:{color:"gray.900"},warning:{color:"yellow.400",fontWeight:"semibold"},error:{color:"red.500",fontWeight:"semibold"},timestamp:{display:"flex",alignItems:"center",color:"gray.500"}},defaultProps:{variant:"message"}},NavBar:j,NavButton:{baseStyle:{display:"flex",alignItems:"center",gap:"0.35rem",borderRadius:"full",px:4,py:2,lineHeight:1.1,fontSize:"sm",fontWeight:"semibold",color:"gray.100",bg:"whiteAlpha.50",border:"1px solid",borderColor:"whiteAlpha.200",boxShadow:"0 10px 30px rgba(15, 23, 42, 0.15)",transitionProperty:"common",transitionDuration:"normal",_hover:{bg:"whiteAlpha.200",color:"white",borderColor:"whiteAlpha.300",_disabled:{bg:"initial"}},_active:{bg:"white",color:"#0f172a",borderColor:"white",boxShadow:"0 12px 34px rgba(15, 23, 42, 0.35)"},_focusVisible:{boxShadow:"0 0 0 2px rgba(99, 102, 241, 0.6)",outline:"none"},_disabled:{opacity:.4,cursor:"not-allowed"}}},Pane:{baseStyle:{position:"absolute",top:0,right:0,bottom:0,left:0}},PaneBody:M,PaneHeader:O,PaneTitle:{baseStyle:{fontSize:"sm",fontWeight:"semibold",letterSpacing:"0.08em",textTransform:"uppercase",color:"#0f172a"}},SideBar:D,SideBarButton:{baseStyle:{display:"flex",cursor:"pointer",alignItems:"center",justifyContent:"center",py:4,fontSize:"xs",fontWeight:"semibold",transitionProperty:"common",transitionDuration:"normal",writingMode:"vertical-lr",textOrientation:"sideways",borderRadius:"lg",border:"1px solid",borderColor:"whiteAlpha.200",color:"gray.100",bg:"whiteAlpha.50",boxShadow:"0 10px 30px rgba(15, 23, 42, 0.12)",iconSpacing:"0.35rem",span:{marginRight:".12rem"},_hover:{bg:"whiteAlpha.200",color:"white",borderColor:"whiteAlpha.300",transform:"translateY(-1px)",_disabled:{bg:"initial"}},_active:{bg:"linear-gradient(180deg, #e0e7ff 0%, #c7d2fe 100%)",color:"#0f172a",borderColor:"white",boxShadow:"0 14px 36px rgba(15, 23, 42, 0.35)",transform:"translateY(-2px)"},_focusVisible:{boxShadow:"0 0 0 2px rgba(94, 234, 212, 0.65)",outline:"none"}}},StatusBar:_,View:{baseStyle:{w:"full",h:"full"}}}});var T=n(59876),P=n(11384);const B=e=>{const{text:t,variant:n,time:o}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(y,Object.assign({variant:"timestamp",justifySelf:"end"},{children:[o?(0,P.Z)(o,"HH:mm:ss"):"--:--:--",(0,r.jsx)(T.XC,{})]})),(0,r.jsx)(y,Object.assign({variant:n},{children:t}))]})};var R=n(64657);function $(e,t){return e.nodes[t]}function V(e,t){return t?t.map((t=>$(e,t))):(0,R.Z)(e.nodes)}function F(e,t){return e.edges[t]}function G(e,t){return t?t.map((t=>F(e,t))):(0,R.Z)(e.edges)}function Z(e,t){return`arrow-${e}-[${t}]`}const W=(0,o.memo)((e=>{const{size:t,color:n}=e,o=Z(t,n),s=t/2;return(0,r.jsx)("marker",Object.assign({id:o,viewBox:`0 0 ${t} ${t}`,refX:0,refY:s,markerWidth:t,markerHeight:t,markerUnits:"userSpaceOnUse",orient:"auto",fill:n},{children:(0,r.jsx)("path",{d:`M 0 0 L ${t} ${s} L 0 ${t} z`})}))})),U=e=>{const{arrowHeads:t}=e;return(0,r.jsx)("defs",{children:t.map(((e,t)=>(0,r.jsx)(W,Object.assign({},e),t)))})},q=e=>(0,r.jsx)("text",Object.assign({x:e.x,y:e.y,style:e.style},e.props,{children:e.text})),Y=e=>{const{label:t,position:n}=e;return t.length!==n.length?null:(0,r.jsx)(r.Fragment,{children:t.map(((e,t)=>{const{x:o,y:s}=n[t];return(0,r.jsx)(q,Object.assign({x:o,y:s},e),t)}))})};var X=n(3759),H=n(18990),J=n(27470),Q=n(75908),K=n(74681),ee=n(85925),te=n(69786),ne=n(67185),re=n(14643);const oe=e=>{const{path:t,curve:n,style:s,onRender:i}=e,a=(0,o.useRef)(null),l=(0,o.useRef)(null),c=(0,o.useMemo)((()=>function(e){const t=(0,X.Z)().x((e=>e.x)).y((e=>e.y));switch(null==e?void 0:e.type){case"bspline":t.curve(H.ZP);break;case"bundle":t.curve(J.Z.beta(.85));break;case"cardinal":t.curve(Q.ZP.tension(0));break;case"catmullrom":t.curve(K.Z.alpha(.5));break;case"line":default:t.curve(ee.Z);break;case"monotonex":t.curve(te.Z);break;case"monotoney":t.curve(te.s);break;case"natural":t.curve(ne.Z);break;case"step":t.curve(re.ZP);break;case"stepafter":t.curve(re.cD);break;case"stepbefore":t.curve(re.RN)}return t}(n)),[n]),d=(0,o.useMemo)((()=>c(t)||""),[c,t]),p=`url(#${Z(10,s.stroke)})`;return(0,o.useLayoutEffect)((()=>{const e=a.current,n=l.current;if(e&&n){const r=e.getTotalLength(),o=e.getPointAtLength(r-10);n.setAttribute("d",c([...t.slice(0,-1),o])||"")}i&&a.current&&i(a.current)}),[i,t]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("path",{ref:l,style:s,markerEnd:p}),(0,r.jsx)("path",{ref:a,d,stroke:"transparent",strokeWidth:11,fill:"none"})]})},se=e=>{const{id:t,path:n,curve:s,style:i,labels:a}=e,[l,c]=(0,o.useState)([]),d=(0,o.useCallback)((e=>{a&&c(a.map((t=>function(e,t){const n=t.getTotalLength();if(void 0===e.position)return t.getPointAtLength(n/2);if("number"==typeof e.position){const r=(0,p.Z)(e.position,0,1);return t.getPointAtLength(r*n)}const r=(0,p.Z)(e.position.distance,0,n);return"source"===e.position.from?t.getPointAtLength(r):t.getPointAtLength(n-r)}(t,e))))}),[c,a]);return(0,r.jsxs)("g",Object.assign({id:`${t}`},{children:[(0,r.jsx)(oe,{path:n,curve:s,style:i,onRender:d}),a&&(0,r.jsx)(Y,{label:a,position:l})]}))},ie=(0,o.memo)((e=>{const{edges:t}=e;return(0,r.jsx)("g",Object.assign({className:"edges"},{children:t.map((e=>(0,r.jsx)(se,Object.assign({},e),e.id)))}))}));function ae(e,t){return{x:e.x+t.x,y:e.y+t.y}}function le(e){return Math.atan2(-e.y,-e.x)+Math.PI}function ce(e,t){return{x:e.x-t.x,y:e.y-t.y}}function de(e,t,n){return{x:e.x+n*Math.cos(t),y:e.y+n*Math.sin(t)}}var pe=n(5419);const ue=(0,o.createContext)({nodeOffset:()=>({x:0,y:0}),onClickNode:()=>{},onMouseDown:()=>{},onMouseDownNode:()=>{},onMouseMove:()=>{},onMouseUp:()=>{},onMouseUpNode:()=>{},onWheel:()=>{},spreadMatrix:(0,pe.yR)(),zoomMatrix:(0,pe.yR)()});var he=n(60953);const me={x:0,y:0};function ge(e,t,n){const r=t.getScreenCTM();if(r){const o=r.inverse(),s=(0,pe.SO)(n),i=t.createSVGPoint();i.x=e.clientX,i.y=e.clientY;const a=(0,pe.hC)(s,i.matrixTransform(o));return i.x=e.clientX+e.movementX,i.y=e.clientY+e.movementY,ce((0,pe.hC)(s,i.matrixTransform(o)),a)}return{x:0,y:0}}const xe=()=>!1;function fe(e){return(0,o.useCallback)(((t,n)=>{let r,o=n.callbacks;switch(n.type){case"clicknode":return r=(0,he.Z)(null==o?void 0:o.onClickNode,xe),r(n.nodeId,n.event)?t:function(e,t){return e}(t);case"mousedown":return r=(0,he.Z)(null==o?void 0:o.onMouseDown,xe),r(n.event)?t:function(e,t){return Object.assign(Object.assign({},e),{isPanning:!0})}(t);case"mousedownnode":return r=(0,he.Z)(null==o?void 0:o.onMouseDownNode,xe),r(n.nodeId,n.event)?t:function(e,t){const{event:n,nodeId:r}=t;return n.preventDefault(),n.stopPropagation(),e.selection.push(r),e.isDragging=!0,e}(t,n);case"mousemove":return r=(0,he.Z)(null==o?void 0:o.onMouseMove,xe),r(n.event)?t:function(e,t,n){if(n){if(e.isDragging)return function(e,t,n){const r=e.selection,o=Object.assign({},e.offsets),s=ge(t.event,n,e.zoomMatrix);return r.forEach((e=>{const t=o[e]||me;o[e]=ae(t,s)})),Object.assign(Object.assign({},e),{offsets:o})}(e,t,n);if(e.isPanning)return function(e,t,n){const r=ge(t.event,n,e.zoomMatrix),o=(0,pe.vs)([e.zoomMatrix,(0,pe.Iu)(r.x,r.y)]);return Object.assign(Object.assign({},e),{zoomMatrix:o})}(e,t,n)}return e}(t,n,e);case"mouseup":return r=(0,he.Z)(null==o?void 0:o.onMouseUp,xe),r(n.event)?t:function(e,t){return Object.assign(Object.assign({},e),{isDragging:!1,isPanning:!1,offsets:{},selection:[]})}(t);case"mouseupnode":return r=(0,he.Z)(null==o?void 0:o.onMouseUpNode,xe),r(n.nodeId,n.event)?t:(r=(0,he.Z)(null==o?void 0:o.onSelectionMoved,xe),r(t.offsets)?t:function(e,t){const{event:n}=t;return n.preventDefault(),n.stopPropagation(),e.isDragging=!1,e.isPanning=!1,e.offsets={},e.selection=[],e}(t,n));case"wheel":if(r=(0,he.Z)(null==o?void 0:o.onWheel,xe),r(n.event))return t;const s=t.spreadMatrix,i=t.zoomMatrix,a=function(e,t,n){const r=t.event,o=function(e){const t=e.shiftKey?e.deltaX:e.deltaY;return 0===t?0:t<0?1.055:.9478672985781991}(r);return n&&0!==o&&!r.ctrlKey?r.shiftKey?function(e,t,n,r){const o=r.getScreenCTM();if(o){const s=r.createSVGPoint();s.x=t.clientX,s.y=t.clientY;const i=s.matrixTransform(o.inverse()),{x:a,y:l}=(0,pe.hC)((0,pe.vs)((0,pe.SO)(e.spreadMatrix),(0,pe.SO)(e.zoomMatrix)),i),c=(0,pe.vs)(e.spreadMatrix,(0,pe.bA)(n,n,a,l));return Object.assign(Object.assign({},e),{spreadMatrix:c})}return e}(e,r,o,n):function(e,t,n,r){const o=r.getScreenCTM();if(o){const s=r.createSVGPoint();s.x=t.clientX,s.y=t.clientY;const i=s.matrixTransform(o.inverse()),{x:a,y:l}=(0,pe.hC)((0,pe.SO)(e.zoomMatrix),i),c=(0,pe.vs)(e.zoomMatrix,(0,pe.bA)(n,n,a,l));return Object.assign(Object.assign({},e),{zoomMatrix:c})}return e}(e,r,o,n):e}(t,n,e);return r=(0,he.Z)(null==o?void 0:o.onSpreadChanged,xe),s!==a.spreadMatrix&&r(a.spreadMatrix)?t:(r=(0,he.Z)(null==o?void 0:o.onZoomChanged,xe),i!==a.zoomMatrix&&r(a.zoomMatrix)?t:a)}return t}),[e])}const be=e=>{const{svg:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{i(function(e,t){return Object.assign(Object.assign({},e),{callbacks:t})}(e,n))}),[i,n]);return{nodeOffset:(0,o.useCallback)((e=>s.offsets[e]||{x:0,y:0}),[s.offsets]),onClickNode:(0,o.useCallback)(((e,t)=>a(function(e,t){return{type:"clicknode",nodeId:e,event:t}}(e,t))),[a]),onMouseDown:(0,o.useCallback)((e=>a(function(e){return{type:"mousedown",event:e}}(e))),[a]),onMouseDownNode:(0,o.useCallback)(((e,t)=>a(function(e,t){return{type:"mousedownnode",nodeId:e,event:t}}(e,t))),[a]),onMouseMove:(0,o.useCallback)((e=>a(function(e){return{type:"mousemove",event:e}}(e))),[a]),onMouseUp:(0,o.useCallback)((e=>a(function(e){return{type:"mouseup",event:e}}(e))),[a]),onMouseUpNode:(0,o.useCallback)(((e,t)=>a(function(e,t){return{type:"mouseupnode",event:t,nodeId:e}}(e,t))),[a]),onWheel:(0,o.useCallback)((e=>a(function(e){return{type:"wheel",event:e}}(e))),[a]),spreadMatrix:s.spreadMatrix,zoomMatrix:s.zoomMatrix}};const ye=()=>(0,o.useContext)(ue),we=e=>{const{children:t,beforeUnmount:n}=e,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o()=>{n&&n(i)}),[n]),(0,r.jsx)(ue.Provider,Object.assign({value:i},{children:t}))};const ve=e=>{const{label:t}=e;return(0,r.jsx)(r.Fragment,{children:t.map(((e,t)=>{const{offset:n}=e,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{const{shape:t,style:n}=e;return(0,r.jsx)("circle",{r:t.radius,style:n})})),Se=(0,o.memo)((e=>{const{shape:t,style:n}=e;return(0,r.jsx)("rect",{x:-t.width/2,y:-t.height/2,width:t.width,height:t.height,style:n})})),Ae=(0,o.memo)((e=>{const{shape:t,style:n}=e;switch(t.shape){case"circle":return(0,r.jsx)(je,{shape:t,style:n});case"rectangle":return(0,r.jsx)(Se,{shape:t,style:n})}return null})),Ce=(0,o.memo)((e=>{const{id:t,position:n,shape:s,style:i,labels:a,superscripts:l}=e,{onClickNode:c,onMouseDownNode:d,onMouseUpNode:p,spreadMatrix:u,nodeOffset:h}=ye(),m=h(t),g=(0,o.useMemo)((()=>{const e=ae((0,pe.hC)(u,n),m);return`translate(${e.x} ${e.y})`}),[n,m,u]);return(0,r.jsxs)("g",Object.assign({id:t,transform:g,onClick:e=>c(t,e),onMouseDown:e=>d(t,e),onMouseUp:e=>p(t,e)},{children:[(0,r.jsx)(Ae,{shape:s,style:i}),a&&(0,r.jsx)(ve,{label:a}),l&&(0,r.jsx)(ve,{label:l})]}))})),Me=(0,o.memo)((e=>{const{nodes:t}=e;return(0,r.jsx)("g",Object.assign({className:"nodes"},{children:t.map((e=>(0,r.jsx)(Ce,Object.assign({},e),e.id)))}))}));function Ie(e,t){return{a:e,b:t}}function Oe(e,t){const n=e.a,r=e.b,o=t.a,s=t.b,i=((s.x-o.x)*(n.y-o.y)-(s.y-o.y)*(n.x-o.x))/((s.y-o.y)*(r.x-n.x)-(s.x-o.x)*(r.y-n.y));return{x:n.x+i*(r.x-n.x),y:n.y+i*(r.y-n.y)}}function ke(e,t,n,r){switch(t.shape){case"circle":return function(e,t,n,r){return de(e,le(n),t+r/2)}(e,t.radius,n,r);case"rectangle":return function(e,t,n,r,o){const s=t+o,i=n+o,a=s/2,l=i/2,c=de(e,le(r),Math.max(s,i)),d=Ie(e,c),p=((u=d).a.y-u.b.y)/(u.a.x-u.b.x);var u;const h=p*a,m=l/p,g={x:e.x+a,y:e.y+l},x={x:e.x-a,y:e.y+l},f={x:e.x+a,y:e.y-l},b={x:e.x-a,y:e.y-l};if(-l<=h&&h<=l){if(e.xc.x)return Oe(Ie(x,b),d)}if(-a<=m&&m<=a){if(e.yc.y)return Oe(Ie(b,f),d)}return e}(e,t.width,t.height,n,r)}return e}function Ne(e){return void 0!==e}const De=(0,o.memo)((e=>{const{id:t,graph:n,edgeCurves:s,edgeStyles:i,edgeLabels:a,nodeShapes:l,nodeStyles:c,nodeLabels:d,nodeSuperscripts:p}=e,u=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);oV(n).map((e=>{const t={x:e.x,y:e.y},n=l[e.id],r=c[e.id],o=d?d[e.id]:void 0,s=p?p[e.id]:void 0;return{id:e.id,position:t,shape:n,style:r,labels:o,superscripts:s}}))),[n,l,c,d]),x=(0,o.useMemo)((()=>G(n).map((e=>{const t=$(n,e.source),r=$(n,e.target);if(!t||!r)return;const o=l[t.id],c=l[r.id],d=function(e,t,n,r,o,s,i,a){const l=e.waypoints||[],c=(0,pe.hC)(a,ae(t,r)),d=(0,pe.hC)(a,ae(o,i)),p=l.map((e=>(0,pe.hC)(a,e))),u=ke(c,n,ce((0,he.Z)(p[0],d),c),0),h=ke(d,s,ce((0,he.Z)(p[p.length-1],c),d),0);return[u,...p,h]}(e,t,o,h(t.id),r,c,h(r.id),m),p=s[e.id],u=i[e.id],g=a?a[e.id]:void 0;return{id:e.id,path:d,curve:p,style:u,labels:g}})).filter(Ne)),[n,m,s,i,a,h]),f=function(e){const t=new Set,n=[];return e.forEach((e=>{const r=e.stroke,o=Z(10,r);t.has(o)||(t.add(o),n.push({size:10,color:r}))})),n}(Object.values(i));return g.length<1&&g.push({id:"0",position:{x:0,y:0},shape:{shape:"rectangle",width:550,height:50},style:{fill:"transparent",stroke:"black"},labels:[{text:"There are no atoms to display (or the current theme has hidden them)",style:{fontSize:12,textAnchor:"middle",fontFamily:"monospace",userSelect:"none"}}]}),(0,r.jsxs)("g",Object.assign({id:t},u,{children:[(0,r.jsx)(U,{arrowHeads:f}),(0,r.jsx)(Me,{nodes:g}),(0,r.jsx)(ie,{edges:x})]}))}));(0,o.forwardRef)(((e,t)=>{const{children:n}=e,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o(0,r.jsx)(S.zx,Object.assign({colorScheme:"green",size:"xs",ref:t},e))));var Ee=n(98765);const _e=(0,Ee.PH)("sterling/buttonClicked"),Le=(0,Ee.PH)("sterling/dataRequested"),Te=(0,Ee.PH)("sterling/evalRequested"),Pe=(0,Ee.PH)("sterling/metaRequested"),Be=(0,Ee.PH)("sterling/dataReceived"),Re=(0,Ee.PH)("sterling/evalReceived"),$e=(0,Ee.PH)("sterling/metaReceived"),Ve=(0,Ee.PH)("sterling/connect"),Fe=(0,Ee.PH)("sterling/disconnect"),Ge=(0,Ee.PH)("sterling/connected"),Ze=(0,Ee.PH)("sterling/connectionError"),We=(0,Ee.PH)("sterling/disconnected"),Ue=(0,Ee.PH)("sterling/error");function qe(e){return void 0!==e}function Ye(e,t){const n={};for(const r of e)n[t(r)]=r;return n}function Xe(e){return e.types[e.types.length-1]}function He(e){return e.atoms}function Je(e){return void 0!==e.meta&&!0===e.meta.builtin}function Qe(e,t,n){return"string"==typeof t&&(t=ct(e,t)),"string"!=typeof n&&(n=n.id),t.types.includes(n)}function Ke(e,t){const n=t.getAttribute("label");if(!n)throw new Error("No label attribute in atom element");return{_:"atom",id:n,type:e}}function et(e,t){return Array.from(t).map((t=>Ke(e,t)))}function tt(e,t){if("string"==typeof t&&(t=st(e,t)),!e.types[t.type])throw new Error(`The atom's type is not part of the instance: ${t.type}`);return e.types[t.type]}function nt(e,t){return Array.from(t).map((t=>function(e,t){return{_:"tuple",types:e,atoms:Array.from(t.querySelectorAll("atom")).map(((t,n)=>Ke(e[n],t).id))}}(e,t)))}function rt(e){return e.tuples}function ot(e,t){return Array.from(t).map((t=>function(e,t){const n=t.getAttribute("label");if(!n)throw new Error("No label found for field element");const r=function(e,t){const n=t.querySelectorAll("type");return Array.from(n).map((t=>{const n=t.getAttribute("ID");if(!n)throw new Error("Type element must have an ID attribute");const r=e[n];if(!r)throw new Error(`Type element with ID ${n} not found`);return r}))}(e,t);if(0===r.length)throw new Error("No types found for field element");return{_:"relation",id:`${r[0]}<:${n}`,name:n,types:r,tuples:nt(r,t.querySelectorAll("tuple"))}}(e,t)))}function st(e,t){const n=it(e).find((e=>e.id===t));if(!n)throw new Error(`Could not find atom with id ${t}`);return n}function it(e){return dt(e).map(He).reduce(((e,t)=>e.concat(t)),[])}function at(e){return Object.values(e.relations)}function lt(e){return Object.values(e.skolems)}function ct(e,t){const n=e.types[t];if(!n)throw new Error(`Could not find type with id ${t}`);return n}function dt(e){return Object.values(e.types)}function pt(e){const t=e.getAttribute("bitwidth");if(!t)throw new Error("No bitwidth found in instance");const n=function(e){const t={},n=e.querySelectorAll("sig");for(const e of n){const n=e.getAttribute("ID"),r=e.getAttribute("label");if(!n)throw new Error("No ID found for sig element");if(!r)throw new Error("No label found for sig element");t[n]=r}return t}(e),r=function(e,t){const n={},r=t.querySelectorAll("sig");for(const e of r)if(!xt(e)){const t=e.getAttribute("ID"),r=e.getAttribute("parentID"),o=e.getAttribute("label");if(!t)throw new Error("No ID found for sig element");if(!o)throw new Error("No label found for sig element");r&&(n[t]=r)}const o=(t,r)=>n[t]?o(n[t],[...r,e[t]]):r,s={};for(const t in e)s[e[t]]=o(t,[]);return s}(n,e),o=function(e,t){return Array.from(t).filter((e=>!xt(e))).map((t=>function(e,t){const n=t.getAttribute("label");if(!n)throw new Error("No label attribute in sig element");const r=e[n];if(!r)throw console.log(e),new Error(`No type hierarchy for ${n}`);const o=function(e){const t={};return"yes"===e.getAttribute("abstract")&&(t.abstract=!0),"yes"===e.getAttribute("builtin")&&(t.builtin=!0),"yes"===e.getAttribute("enum")&&(t.enum=!0),"yes"===e.getAttribute("meta")&&(t.meta=!0),"yes"===e.getAttribute("one")&&(t.one=!0),"yes"===e.getAttribute("private")&&(t.private=!0),0===Object.keys(t).length?void 0:t}(t),s={_:"type",id:n,types:r,atoms:et(n,t.querySelectorAll("atom")),meta:void 0};return qe(o)&&(s.meta=o),s}(e,t)))}(r,e.querySelectorAll("sig")),s=ot(n,e.querySelectorAll("field")),i=ot(n,e.querySelectorAll("skolem"));return function(e,t){const n=t.find((e=>"Int"===e.id));if(!n)throw new Error("Could not find Int type");n.atoms=function(e){const t=[],n=Math.pow(2,e);for(let e=-n/2;ee.id)),relations:Ye(s,(e=>e.id)),skolems:Ye(i,(e=>e.id))}}function ut(e){var t;const n=(new DOMParser).parseFromString(e,"application/xml"),r=Array.from(n.querySelectorAll("instance"));if(!r.length)throw new Error(`No Alloy instance in XML: ${e}`);const o=n.querySelectorAll("visualizer");let s,i,a;for(const e of o){const t=mt(e,"script"),n=mt(e,"theme"),r=mt(e,"cnd");i=null!=t?t:i,s=null!=r?r:s,a=null!=n?n:a}return{instances:r.map(pt),bitwidth:ht(r[0],"bitwidth"),command:mt(r[0],"command"),loopBack:null!==(t=ht(r[0],"backloop"))&&void 0!==t?t:ht(r[0],"loop"),maxSeq:ht(r[0],"maxseq"),maxTrace:ht(r[0],"maxtrace"),minTrace:ht(r[0],"mintrace"),traceLength:ht(r[0],"tracelength"),visualizerConfig:{script:gt(i),theme:gt(a),cnd:gt(s)}}}function ht(e,t){const n=e.getAttribute(t);return n?+n:void 0}function mt(e,t){const n=e.getAttribute(t);return n?`${n}`:void 0}function gt(e){return null==e?void 0:e.replaceAll(""",'"').replaceAll('\\"','"').replaceAll(">",">").replaceAll("<","<")}function xt(e){return e.querySelectorAll("type").length>0}function ft(e){return"alloy"===e.format}function bt(e){return Object.assign(Object.assign({},e),{parsed:ut(e.data)})}function yt(e,t){const n=function(e){return JSON.parse(e)}(e);!function(e){return"data"===e.type&&void 0!==e.payload}(n)?function(e){return"eval"===e.type&&void 0!==e.payload}(n)?t.dispatch(Re(n.payload)):function(e){return"meta"===e.type&&void 0!==e.payload}(n)&&t.dispatch($e(n.payload)):t.dispatch(Be(function(e,t){const{enter:n,update:r,exit:o}=e,s=function(e,t){const n=[];return e&&e.forEach((e=>{!function(e){const t=e.format;return"alloy"===t||"raw"===t}(e)?t.dispatch(Ue(`Unsupported data format in datum ${e.id}: ${e.format}`)):(e.id=`${e.id}`,n.push(e))})),n}(n,t);return{enter:s.map((e=>{switch(e.format){case"alloy":return bt(e);case"raw":return function(e){return Object.assign(Object.assign({},e),{parsed:e.data})}(e);default:throw new Error("Unsupported format fell through unexpectedly.")}})),update:r,exit:o}}(n.payload,t)))}function wt(e){e.dispatch(Ue("Not connected to a provider."))}function vt(e,t){e.send(JSON.stringify(t))}const jt=()=>(0,i.I0)(),St=i.v9;var At=n(18172);function Ct(e,t){return t in e.edges}function Mt(e,t){return t in e.nodes}var It=n(29428);function Ot(e,t){return t=t||[],function(e,t){return(0,At.Uy)(e,(e=>{t.forEach((t=>function(e,t){const{id:n,source:r,target:o}=t;if(n&&(s=e,i=[r,o],(0,It.Z)(i,(e=>Mt(s,e))))&&!Ct(e,n))e.edges[n]=t,function(e,t,n,r){e.predecessors.hasOwnProperty(n)||(e.predecessors[n]={}),e.predecessors[n].hasOwnProperty(t)||(e.predecessors[n][t]=[]),e.predecessors[n][t].push(r)}(e,r,o,n),function(e,t,n,r){e.successors.hasOwnProperty(t)||(e.successors[t]={}),e.successors[t].hasOwnProperty(n)||(e.successors[t][n]=[]),e.successors[t][n].push(r)}(e,r,o,n),function(e,t,n){e.inedges[t].push(n)}(e,o,n),function(e,t,n){e.outedges[t].push(n)}(e,r,n);else{if(!n)throw new Error("Cannot add an edge without an edge ID");if(!Mt(e,r))throw new Error(`Cannot add edge ${n}, the source node ${r} is not in the graph`);if(!Mt(e,o))throw new Error(`Cannot add edge ${n}, the target node ${o} is not in the graph`);if(Ct(e,n))throw new Error(`Cannot add edge, an edge with ID ${n} already exists in the graph`)}var s,i}(e,(0,At.cA)(t))))}))}(function(e,t){return(0,At.Uy)(e,(e=>{t.forEach((t=>function(e,t){const{id:n}=t;if(n&&!Mt(e,n))e.nodes[n]=t,e.predecessors[n]={},e.successors[n]={},e.inedges[n]=[],e.outedges[n]=[];else{if(!n)throw new Error("Cannot add a node without a node ID");if(Mt(e,n))throw new Error(`Cannot add node, a node with ID ${n} already exists in the graph`)}}(e,(0,At.cA)(t))))}))}({nodes:{},edges:{},predecessors:{},successors:{},inedges:{},outedges:{}},e=e||[]),t)}function kt(e,t){const n=e.edges;return!!n&&n.some((e=>{var n;return!0===e.asAttribute&&(null===(n=e.targets)||void 0===n?void 0:n.some((e=>"*"===e||e.relation===t)))}))}function Nt(e,t,n){if(n<2)return[0,0];if(!e)return[0,n-1];const r=e.edges;if(!r)return[0,n-1];const o=r.find((e=>{var n;return(e.sourceIndex||e.targetIndex)&&(null===(n=e.targets)||void 0===n?void 0:n.some((e=>"*"===e||e.relation===t)))}));return o?[o.sourceIndex?o.sourceIndex:0,o.targetIndex?o.targetIndex:n-1]:[0,n-1]}var Dt=n(11022),zt=n(935);function Et(e){return e.id}function _t(e,t){return`${e.id}:${t.atoms.join("->")}`}function Lt(e,t){var n,r;const o=(null===(n=null==t?void 0:t.hidden)||void 0===n?void 0:n.disconnected)||!1,s=o||(null===(r=null==t?void 0:t.hidden)||void 0===r?void 0:r.builtinDisconnected)||!1,{nodeIds:i,edgeIds:a}=function(e,t,n,r){const o=new Set,s=new Set;return at(e).forEach((t=>{rt(t).forEach((n=>{const i=n.atoms.map((t=>st(e,t))),[a,l]=function(e,t,n){if(n){const[r,o]=Nt(n,e.id,t.length);return[r?t[r]:(0,Dt.Z)(t),o?t[o]:(0,zt.Z)(t)]}return[(0,Dt.Z)(t),(0,zt.Z)(t)]}(t,i,r);a&&l&&(o.add(Et(a)),o.add(Et(l)),s.add(_t(t,n)))}))})),it(e).forEach((r=>{const s=Et(r);o.has(s)||t||function(e,t){return"string"==typeof t&&(t=st(e,t)),tt(e,t).types.map((t=>ct(e,t))).some(Je)}(e,r)&&n||o.add(s)})),{nodeIds:o,edgeIds:s}}(e,o,s,t),l=[];it(e).forEach((e=>{const t=Et(e);i.has(t)&&l.push({id:t,atom:e})}));const c=[];return at(e).forEach((n=>{t&&kt(t,n.id)||rt(n).forEach((r=>{const o=_t(n,r),s=r.atoms,[i,l]=Nt(t,n.id,s.length),d=i?s[i]:(0,Dt.Z)(s),p=l?s[l]:(0,zt.Z)(s);d&&p&&a.has(o)&&c.push({id:o,source:Et(st(e,d)),target:Et(st(e,p)),relation:n,tuple:r})}))})),Ot(l,c)}var Tt=n(79432),Pt=n(27961);function Bt(e,t,n,r){const o={},s={},i={},a={},l={},c={},d={},p=function(e,t){const n={"*":(r=[t],(0,Pt.Z)(r.map((e=>e.nodes?e.nodes.filter((e=>e.targets&&e.targets.some((e=>"*"===e)))):[]))))};var r;return dt(e).forEach((e=>{n[e.id]=function(e,t){return(0,Pt.Z)(t.map((t=>t.nodes?t.nodes.filter((t=>t.targets&&t.targets.some((t=>"*"!==t&&t.type===e)))):[])))}(e.id,[t])})),n}(t,r),u=function(e,t){const n={"*":(r=[t],(0,Pt.Z)(r.map((e=>e.edges?e.edges.filter((e=>e.targets&&e.targets.some((e=>"*"===e)))):[]))))};var r;return at(e).forEach((e=>{n[e.id]=function(e,t){return(0,Pt.Z)(t.map((t=>t.edges?t.edges.filter((t=>t.targets&&t.targets.some((t=>"*"!==t&&t.relation===e)))):[])))}(e.id,[t])})),n}(t,r),h={};at(t).forEach((e=>{kt(r,e.id)&&rt(e).forEach((t=>{const n=t.atoms;if(n.length>1){const t=n[0];h[t]||(h[t]=[]),h[t].push(`${e.name}: ${n.slice(1).join(", ")}`)}}))})),lt(t).forEach((e=>{rt(e).forEach((t=>{const n=t.atoms[0];h[n]||(h[n]=[]),h[n].push(`${e.name}`)}))})),V(n).forEach((e=>{i[e.id]=[{text:e.atom.id,props:{},style:{}}];const n=ct(t,e.atom.type);a[e.id]=[{text:n.types[0],props:{dy:"-1em"},style:{textAnchor:"middle",fontSize:"14px",fontStyle:"italic"}}],h[e.id]&&i[e.id].push(...h[e.id].map((e=>({text:e,props:{},style:{}})))),s[e.id]={}}));const m=e=>{if(e.tuple.atoms.length>2){const[t,n]=Nt(r,e.relation.id,e.tuple.atoms.length),o=e.tuple.atoms.slice();return o.splice(t,1),o.splice(n-1,1),e.relation.name+`[${o.join(", ")}]`}return e.relation.name};return G(n).forEach((e=>{d[e.id]=[{text:m(e),props:{},style:{}}],c[e.id]={}})),V(n).forEach((e=>{const{id:n,atom:r}=e;["*","univ",...tt(t,r).types.slice().reverse()].forEach((e=>{var t;null===(t=p[e])||void 0===t||t.forEach((e=>{var t;e.shape&&(o[n]=e.shape),(0,Tt.Z)(s[n],null===(t=e.styles)||void 0===t?void 0:t.node),i[n].forEach((t=>{var n,r;(0,Tt.Z)(t.props,null===(n=e.props)||void 0===n?void 0:n.label),(0,Tt.Z)(t.style,null===(r=e.styles)||void 0===r?void 0:r.label)})),Rt(i[n])}))}))})),G(n).forEach((e=>{const{id:t,relation:n,tuple:r}=e;["*",n.id].forEach((e=>{var n;null===(n=u[e])||void 0===n||n.forEach((e=>{var n;e.curve&&(l[t]=e.curve),(0,Tt.Z)(c[t],null===(n=e.styles)||void 0===n?void 0:n.edge),d[t].forEach((t=>{var n,r;(0,Tt.Z)(t.props,null===(n=e.props)||void 0===n?void 0:n.label),(0,Tt.Z)(t.style,null===(r=e.styles)||void 0===r?void 0:r.label)})),Rt(d[t])}))}))})),{id:e,graph:n,nodeShapes:o,nodeStyles:s,nodeLabels:i,nodeSuperscripts:a,edgeCurves:l,edgeLabels:d,edgeStyles:c}}function Rt(e){const t=e.length-1;e.forEach(((e,n)=>{e.props||(e.props={}),e.props.dy=n-t/2+.33+"em"}))}var $t=n(70681),Vt=n.n($t),Ft=n(5840),Gt=n(13209),Zt=n(44186),Wt=n(49360);function Ut(e,t){return Ot(V(e).map((e=>{const n=t.nodePositions[e.id];return Object.assign(Object.assign({},e),{x:(null==n?void 0:n.x)||0,y:(null==n?void 0:n.y)||0})})),G(e).map((e=>Object.assign(Object.assign({},e),{waypoints:t.edgeWaypoints[e.id]||[]}))))}const qt=e=>void 0!==e.loopBack;var Yt=n(1185);function Xt(e,t){const n={};return t.forEach((t=>{const r=Xe(tt(e,t));if(n[r])throw new Error(`Cannot project ${t} and ${n[r]}. Both are of type ${r}`);n[r]=t})),{types:Ht(e,n),relations:Jt(e,n),skolems:e.skolems}}function Ht(e,t){const n={},r=Object.keys(t);for(const t in e.types){const o=e.types[t],s=r.some((t=>Qe(e,o,t)));n[t]={_:"type",id:o.id,types:o.types,atoms:s?[]:o.atoms,meta:o.meta}}return n}function Jt(e,t){const n={},r=Object.keys(t),o=Object.values(t);for(const t in e.relations){const s=e.relations[t],i=s.types.some((t=>r.some((n=>Qe(e,t,n))))),a=i?Qt(e,s.types,r):[];n[t]={_:"relation",id:s.id,name:s.name,types:i?en(s.types,a):s.types,tuples:i?Kt(s.tuples,a,o):s.tuples},i||(n[t]=s)}return n}function Qt(e,t,n){const r=[];return t.forEach(((t,o)=>{n.some((n=>Qe(e,t,n)))&&r.push(o)})),r}function Kt(e,t,n){return e.filter((e=>e.atoms.some((e=>n.includes(e))))).map((e=>({_:"tuple",types:en(e.types,t),atoms:en(e.atoms,t)}))).filter((e=>e.atoms.length>1))}function en(e,t){const n=[];for(let r=0;rt.map((t=>sn(e,t))).filter((e=>!(0,Wt.Z)(e))))),selectDatumById:sn},ln=function(e,t){return(e.orderByDatumId[t.id]||[]).map((t=>e.expressionsById[t]))},cn=function(e){return e.nextExpressionId};function dn(e){return e.length?e.slice().sort(((e,t)=>e.time===t.time?e.type.localeCompare(t.type):!0===e.time?-1:1)).map((e=>!0===e.time?`[${e.type}]`:`(${e.type})`)).join("|"):"|"}function pn(e,t){const n=un(e,t);return n&&n.projections||[]}function un(e,t){var n;return e.themeByGeneratorName[null!==(n=t.generatorName)&&void 0!==n?n:""]}const hn={selectGraphLayout:function(e,t){const n=pn(e,t),r=e.layoutsByDatumId[t.id],o=dn(n);return r.layoutById[o]},selectHiddenRelations:function(e,t){return e.hiddenByDatumId[t.id]},selectProjections:pn,selectSelectedProjections:function(e,t){var n,r;const o=null!==(n=t.generatorName)&&void 0!==n?n:"";return null!==(r=e.selectedProjectionsByGeneratorName[o])&&void 0!==r?r:{}},selectSelectedTimeIndices:function(e,t){var n;return null!==(n=e.selectedTimeIndicesByDatumId[t.id])&&void 0!==n?n:[]},selectSpreadMatrix:function(e,t){var n;return null===(n=e.matricesByDatumId[t.id])||void 0===n?void 0:n.spreadMatrix},selectTheme:un,selectTimeIndex:function(e,t){return e.timeByDatumId[t.id]||0},selectZoomMatrix:function(e,t){var n;return null===(n=e.matricesByDatumId[t.id])||void 0===n?void 0:n.zoomMatrix},selectCnDSpec:function(e,t){var n,r;const o=null!==(n=t.generatorName)&&void 0!==n?n:"";return null!==(r=e.cndSpecByGeneratorName[o])&&void 0!==r?r:""}},mn=function(e){return e.items},gn=function(e){return e.connected},xn=function(e){return e.providerName},fn=function(e){return e.providerGenerators},bn=function(e){return e.synthesisEnabled};function yn(e,t){let n=null!=t?t:e;if(n instanceof Function)return n;{let e=n;return()=>e}}function wn(e){return{top_left:{x:Math.min(...e.map((e=>e.top_left.x))),y:Math.min(...e.map((e=>e.top_left.y)))},bottom_right:{x:Math.max(...e.map((e=>e.bottom_right.x))),y:Math.max(...e.map((e=>e.bottom_right.y)))}}}function vn(e){return null==e||0==e.length?{x:0,y:0}:e.reduce(((t,n)=>({x:t.x+n.x/e.length,y:t.y+n.y/e.length})),{x:0,y:0})}function jn(e,t){return e.map((e=>()=>({x:e().x-t().x,y:e().y-t().y})))}function Sn(e){let t=1/0,n=1/0,r=-1/0,o=-1/0;return e.forEach((e=>{t=Math.min(t,e.x),r=Math.max(r,e.x),n=Math.min(n,e.y),o=Math.max(o,e.y)})),{top_left:{x:t,y:n},bottom_right:{x:r,y:o}}}function An(e,t){const n=[];for(let o=1;o<=t;o++){const s=e(2*Math.PI/t*o);if(!("x"in(r=s))||!("y"in r))throw"returned bounding box response not of type coords. Issue in edge.ts or utility.ts";n.push(s)}var r;return n}function Cn(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Mn(e){let t=Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2));return{x:e.x/t,y:e.y/t}}function In(e,t){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}function On(e){return Math.sqrt(Math.pow(e.x,2)+Math.pow(e.y,2))}function kn(e,t){const n=function(e,t){return e.x*t.x+e.y*t.y}(e,t)/(On(e)*On(t));return On(e)*On(t)==0?1/0:Math.acos(n)}function Nn(e,t,n,r){const o=e*n+t*r,s=Math.sqrt((e*e+t*t)*(n*n+r*r));let i=Math.acos(o/s);return e*r-t*n<0&&(i=-i),i}var Dn=n(69364);const zn="rgb(0, 0, 0)";class En{constructor(e){this.center=yn({x:0,y:0},e),this.origin_offset=yn({x:0,y:0},e),this.bounding_box_lam=e=>this.center(),this.hasBoundingBox=!1,this.children=[],this.dependents=[],this.masks=[]}boundingBox(){return 0==this.children.length?{top_left:this.center(),bottom_right:this.center()}:wn(this.children.map((e=>e.boundingBox())))}getChildren(){return this.children}setCenter(e){this.center=yn(this.center(),e)}hasLam(){return this.hasBoundingBox}getLam(){return this.hasBoundingBox?this.bounding_box_lam:(e=this.boundingBox(),t=>{const n=t%(2*Math.PI),r=e.top_left,o=e.bottom_right,s=Math.abs(r.y-o.y),i=Math.abs(r.x-o.x),a=Math.atan(s/i);if(2*Math.PI-a<=n||n<=a){const e=o.x;let t;return t=n>Math.PI?o.y-s/2+Math.tan(2*Math.PI-n)*i/2:o.y-s+Math.tan(n)*i/2,{x:e,y:t}}if(aMath.PI/2?r.x+s/(2*Math.tan(n-Math.PI/4)):r.x+i/2+s/(2*Math.tan(n)),{x:e,y:r.y}}if(Math.PI-a{r.append("rect").attr("x",e.top_left.x).attr("y",e.top_left.y).attr("width",Math.abs(e.top_left.x-e.bottom_right.x)).attr("height",Math.abs(e.top_left.y-e.bottom_right.y))})),n}render(e,t){let n;n=t?this.masks.concat(t):this.masks,this.children.forEach((t=>{t.render(e,n)}))}sterlingExpectCenter(e,t,n){if(this.center().x!==t)throw new Error(`${e}: center().x was not expected value (${t}); was ${this.center().x}`);if(this.center().y!==n)throw new Error(`${e}: center().y was not expected value (${n}); was ${this.center().y}`)}}class _n extends En{constructor(e){super(e.coords),this.text=yn("",e.text),this.fontSize=yn(15,e.fontSize),this.color=yn("rgb(0, 0, 0)",e.color),this.events=yn([],e.events),this.fontWeight=yn(400,e.fontWeight)}boundingBox(){return{top_left:{x:this.center().x-this.fontSize()/2,y:this.center().y-this.fontSize()/2},bottom_right:{x:this.center().x+this.fontSize()/2,y:this.center().y+this.fontSize()/2}}}setText(e){this.text=yn(this.text(),e)}setFontSize(e){this.fontSize=yn(this.fontSize(),e)}setTextColor(e){this.color=yn(this.color(),e)}setFontWeight(e){this.fontWeight=yn(this.fontWeight(),e)}render(e,t){let n,r="";n=t?this.masks.concat(t):this.masks,r=this.addMaskRender(n,e);const o=Dn.Ys(e).append("text").attr("x",this.center().x).attr("y",this.center().y).attr("text-anchor","middle").attr("alignment-baseline","central").attr("font-size",this.fontSize).attr("font-weight",this.fontWeight).attr("mask",n.length>0?`url(#${r})`:"").attr("fill",this.color).text(this.text);this.events()&&this.events().forEach((e=>o.on(e.event,e.callback))),super.render(e)}}class Ln extends En{constructor(e){super(e.center),this.color=yn("rgb(0, 0, 0)",e.color),this.borderWidth=yn(2,e.borderWidth),this.borderColor=yn("rgb(255, 255, 255)",e.borderColor),this.label=new _n({text:e.label,coords:()=>this.center(),color:e.labelColor,fontSize:e.labelSize}),this.children.push(this.label),this.opacity=yn(1,e.opacity)}setColor(e){this.color=yn(this.color(),e)}setBorderWidth(e){this.borderWidth=yn(this.borderWidth(),e)}setBorderColor(e){this.borderColor=yn(this.borderColor(),e)}setLabelText(e){this.label.setText(e)}setLabelColor(e){this.label.setTextColor(e)}setLabelSize(e){this.label.setFontSize(e)}}class Tn extends Ln{constructor(e){var t;super(e),this.height=yn(0,e.height),this.width=yn(0,e.width),this.labelLocation=null!==(t=e.labelLocation)&&void 0!==t?t:"center";const n={x:0,y:0};if(e.center&&e.coords)throw"you cannot include both coords and a center as the two define the same thing";this.center=(()=>{if(e.center)return yn(n,e.center);{const t=yn(n,e.coords);return()=>{const e=t();return{x:e.x+this.width()/2,y:e.y+this.height()/2}}}})(),this.setLabelLocation()}boundingBox(){return{top_left:{x:this.center().x-this.width()/2,y:this.center().y-this.height()/2},bottom_right:{x:this.center().x+this.width()/2,y:this.center().y+this.height()/2}}}setLabelLocation(){switch(this.labelLocation){case"topLeft":this.label.setCenter((()=>({x:this.center().x-this.width()/2+2.5*this.label.text().length,y:this.center().y-this.height()/2-1*this.label.fontSize()})));break;case"topRight":this.label.setCenter((()=>({x:this.center().x+this.width()/2-2.5*this.label.text().length,y:this.center().y-this.height()/2-1*this.label.fontSize()})));break;case"bottomRight":this.label.setCenter((()=>({x:this.center().x+this.width()/2-2.5*this.label.text().length,y:this.center().y+this.height()/2+1*this.label.fontSize()})));break;case"bottomLeft":this.label.setCenter((()=>({x:this.center().x-this.width()/2+2.5*this.label.text().length,y:this.center().y+this.height()/2+1*this.label.fontSize()})))}}setWidth(e){this.width=yn(this.width(),e)}setHeight(e){this.height=yn(this.height(),e)}render(e,t){let n,r="";n=t?this.masks.concat(t):this.masks,r=this.addMaskRender(n,e),Dn.Ys(e).append("rect").attr("x",this.center().x-this.width()/2).attr("y",this.center().y-this.height()/2).attr("width",this.width()).attr("height",this.height()).attr("stroke-width",this.borderWidth()).attr("stroke",this.borderColor()).attr("fill",this.color()).attr("mask",n.length>0?`url(#${r})`:"").attr("opacity",this.opacity()),super.render(e,n)}}class Pn extends Ln{constructor(e){super(e),this.radius=yn(0,e.radius),this.bounding_box_lam=e=>{const t=this.radius(),n=this.center();return{x:t*Math.cos(e)+n.x,y:t*Math.sin(e)+n.y}},this.hasBoundingBox=!0}boundingBox(){return{top_left:{x:this.center().x-this.radius(),y:this.center().y-this.radius()},bottom_right:{x:this.center().x+this.radius(),y:this.center().y+this.radius()}}}setRadius(e){this.radius=yn(0,e)}render(e,t){let n,r="";n=t?this.masks.concat(t):this.masks,r=this.addMaskRender(n,e),Dn.Ys(e).append("circle").attr("cx",this.center().x).attr("cy",this.center().y).attr("r",this.radius).attr("stroke-width",this.borderWidth).attr("stroke",this.borderColor).attr("fill",this.color).attr("mask",n.length>0?`url(#${r})`:"").attr("opacity",this.opacity()),super.render(e,n)}}var Bn=n(28721);class Rn extends En{constructor(e){var t;let n;n=null!=e.points?e.points.map((e=>yn({x:0,y:0},e))):[],super((()=>vn(n.map((e=>e()))))),this.pointsRelative=jn(n,this.center),this.color=yn(zn,e.color),this.width=yn(2,e.width),this.opacity=yn(1,e.opacity),this.arrow=null!==(t=e.arrow)&&void 0!==t&&t,this.style=yn("full",e.style),this.curve=yn({curveType:"none"},e.curve)}boundingBox(){return Sn(this.pointsRelative.map((e=>({x:e().x+this.center().x,y:e().y+this.center().y}))))}setColor(e){this.color=yn(this.color(),e)}setWidth(e){this.width=yn(this.width(),e)}setOpacity(e){this.opacity=yn(this.opacity(),e)}render(e,t){let n,r="";if(n=t?this.masks.concat(t):this.masks,r=this.addMaskRender(n,e),2==this.pointsRelative.length)for(;this.pointsRelative[0]().x==this.pointsRelative[1]().x||this.pointsRelative[0]().y==this.pointsRelative[1]().y;){if(this.pointsRelative[0]().x==this.pointsRelative[1]().x){const e=this.pointsRelative[0];this.pointsRelative[0]=()=>({x:e().x+1e-4,y:e().y})}if(this.pointsRelative[0]().y==this.pointsRelative[1]().y){const e=this.pointsRelative[0];this.pointsRelative[0]=()=>({x:e().x,y:e().y+1e-4})}}let o=this.pointsRelative.map((e=>({x:e().x+this.center().x,y:e().y+this.center().y})));const s=this.buildPathString(o);let i="0";if("dashed"==this.style()?i=5*this.width():"dotted"==this.style()&&(i=this.width()),this.arrow){const t=(0,Bn.Z)();Dn.Ys(e).append("svg:defs").append("svg:marker").attr("id",t).attr("refX",11).attr("refY",6).attr("markerWidth",10*this.width()).attr("markerHeight",10*this.width()).attr("markerUnits","userSpaceOnUse").attr("orient","auto").append("path").attr("d","M 0 0 12 6 0 12 3 6").style("fill",this.color),Dn.Ys(e).append("path").attr("d",s).attr("stroke-width",this.width).attr("stroke",this.color).attr("opacity",this.opacity()).attr("marker-end",`url(#${t})`).attr("mask",n.length>0?`url(#${r})`:"").style("stroke-dasharray",i).attr("fill","transparent"),super.render(e,n)}else Dn.Ys(e).append("path").attr("d",s).attr("stroke-width",this.width).attr("stroke",this.color).attr("opacity",this.opacity()).attr("fill","transparent").attr("mask",n.length>0?`url(#${r})`:"").style("stroke-dasharray",i),super.render(e,n)}buildPathString(e){const t=this.curve();switch(t.curveType){case"none":const n=Dn.ETc();return n.moveTo(e[0].x,e[0].y),e.forEach((e=>{n.lineTo(e.x,e.y)})),n.toString();case"arc":return`M ${e[0].x} ${e[0].y} \n A ${t.xradius} ${t.yradius} 0 0 \n ${void 0!==t.sweep?t.sweep:1} ${e[1].x} ${e[1].y}`;case"cubic":throw console.log("Error: cubic curves currently unsupported by Line"),new Error("cubic curves currently unsupported by Line");case"quadratic":throw console.log("Error: quadratic curves currently unsupported by Line"),new Error("quadratic curves currently unsupported by Line");default:throw console.log(`Error: unrecognized curveType in prop ${JSON.stringify(t)} (check you have not misspelled the field name)`),new Error(`unknown curveType field in Line prop ${JSON.stringify(t)} (check you have not misspelled the field name)`)}}}class $n extends En{constructor(e){var t,n;super(e.coords);let r=yn({x:0,y:0},e.coords);this.center=()=>({x:r().x+this.width/2,y:r().y+this.height/2}),this.coords=()=>{const e=this.center();return{x:e.x-this.width/2,y:e.y-this.height/2}},this.height=e.height,this.width=e.width,this.root=e.root;let o=this.root.visualObject.center;this.root.visualObject.setCenter((()=>{const e=this.coords(),t=o();return{x:e.x+this.width/2+t.x,y:e.y+t.y}})),this.lines=[],this.subTrees=[],this.setUpSubtrees(),this.setLineColor(null!==(t=e.edgeColor)&&void 0!==t?t:"black"),this.setLineWidth(null!==(n=e.edgeWidth)&&void 0!==n?n:2)}setUpSubtrees(){let e=this.height/(Vn(this.root)-1),t=this.root.children.map((e=>Fn(e))).reduce(((e,t)=>e+t),0);this.subTrees=[];let n=0;this.subTrees=this.root.children.map((r=>{let o=Fn(r),s=n;return n+=o,new $n({root:r,height:e*(Vn(r)-1),width:this.width*Fn(r)/t,coords:()=>{const n=this.coords();return{x:n.x+s/t*this.width,y:n.y+e}}})})),this.subTrees.forEach((e=>{this.lines.push(new Rn({points:[()=>{const e=this.root.visualObject.center();return{x:e.x,y:e.y}},()=>{const t=e.root.visualObject.center();return{x:t.x,y:t.y}}],color:zn,width:2}))})),this.lines.forEach((e=>{this.children.push(e)})),this.subTrees.forEach((e=>{this.children.push(e)})),this.children.push(this.root.visualObject)}setLineColor(e){this.lines.forEach((t=>t.setColor(e))),this.subTrees.forEach((t=>t.setLineColor(e)))}setLineWidth(e){this.lines.forEach((t=>t.setWidth(e))),this.subTrees.forEach((t=>t.setLineWidth(e)))}}function Vn(e){let t=0,n=[e];for(;0!=n.length;){t+=1;let e=[];n.forEach((t=>{t.children.forEach((t=>{e.push(t)}))})),n=e}return t}function Fn(e){let t=1,n=[e];for(;0!=n.length;){let e=[];n.forEach((t=>{t.children.forEach((t=>{e.push(t)}))})),n=e,t=Math.max(t,e.length)}return t}class Gn{static error(e,t,n){return n&&console.trace(),Error(`[${e}] ${t}`)}static missingAttribute(e,t){return Error(`[${e}] Missing attribute: ${t}`)}static missingElement(e,t){return Error(`[${e}] Missing element: <${t}>`)}}class Zn{constructor(e){this._tuples=e||[]}empty(){return 0===this._tuples.length}equals(e){return this.toString()===e.toString()}in(e){const t=new Set(e.tuples().map((e=>e.toString())));return this.tuples().every((e=>t.has(e.toString())))}join(e){if(Array.isArray(e))throw Gn.error("AlloySet",`[${e}] is an array, not an AlloySet, so unable to apply join.`);if(!(e instanceof Zn))throw Gn.error("AlloySet",`${e} is something other than an AlloySet, so unable to apply join.`);if(!this.tuples().length||!e.tuples().length)return new Zn;const t=function(e,t){const n=new Map;return t.forEach((e=>{const t=e.atoms()[0];n.has(t.id())||n.set(t.id(),[]),n.get(t.id()).push(e)})),n}(0,e.tuples()),n=[],r=this._tuples[0].atoms().length-1;return this.tuples().forEach((e=>{const o=e.atoms()[r],s=t.get(o.id());s&&s.forEach((t=>{const r=e.atoms().slice(0,-1).concat(...t.atoms().slice(1));n.push(new Wn(r))}))})),new Zn(function(e){const t=new Set;return e.filter((e=>{const n=e.atoms().map((e=>e.id())).join();return!t.has(n)&&(t.add(n),!0)}))}(n))}toString(){return this._tuples.map((e=>e.toString())).join("\n")}tuples(){return this._tuples.slice()}}class Wn extends Zn{constructor(e){super(),this._tuples=[this],this._atoms=e}atoms(){return this._atoms.slice()}toString(){return this._atoms.map((e=>e.id())).join(", ")}static tuplesFromXML(e,t){return Array.from(e).map((e=>{if(1===t.length)return Wn.buildTuple(t[0],e);const n=t.reduce(((t,n)=>{if(t)return t;try{return Wn.buildTuple(n,e)}catch(e){return}}),void 0);if(n)return n;throw Gn.error("AlloyField",`No match for tuple element ${e} in declared types ${t}`)}))}static buildTuple(e,t){const n=Array.from(t.querySelectorAll("atom")).map(((t,n)=>{const r=e[n],o=t.getAttribute("label");if(!o)throw Gn.missingAttribute("AlloyField","label");const s=r.atom(o);if(!s)throw Gn.error("AlloyField",`No atom: ${o} in type: ${r}`);return s}));return new Wn(n)}}class Un extends Zn{constructor(e,t){super();const n=t?t.applyProxy(this,function(e){return e.replace("/","$").replace("-","$")}(e)):this;return this._id=e,this._tuples=[new Wn([n])],n}clone(e){return new Un(this.id(),e)}id(){return this._id}static fromElement(e,t){const n=e.getAttribute("label");if(!n)throw Gn.missingAttribute("AlloyAtom","label");return new Un(n,t)}}const qn=[{name:"VisualObject",value:En},{name:"Shape",value:Ln},{name:"Grid",value:class extends En{constructor(e){super(e.grid_location),this.config=e;let t=yn({x:0,y:0},this.config.grid_location);this.center=()=>{const e=t();return{x:e.x+this.config.grid_dimensions.x_size*this.config.cell_size.x_size/2,y:e.y+this.config.grid_dimensions.y_size*this.config.cell_size.y_size/2}},this.coords=()=>{const e=this.center();return{x:e.x-this.config.grid_dimensions.x_size*this.config.cell_size.x_size/2,y:e.y-this.config.grid_dimensions.y_size*this.config.cell_size.y_size/2}},this.cells=new Array(this.config.grid_dimensions.y_size).fill([]);for(var n=0;nthis.config.cell_size.y_size)throw`Proposed object to add is taller than grid cells. Add "true" as the last parameter to\n grid.add() to hide this error.\n Grid cells are ${this.config.cell_size.y_size}\n units tall, while the object you want to add is ${n} units tall`;if(t>this.config.cell_size.x_size)throw`Proposed object to add is wider than grid cells. Add "true" as the last parameter to\n grid.add() to hide this error.\n Grid cells are ${this.config.cell_size.x_size}\n units tall, while the object you want to add is ${t} units tall`}add(e,t,n){if(!(t instanceof En))throw new Error("Grid can only add VisualObjects as children.");this.check_coords(e),n||this.check_bounding_box(t.boundingBox()),this.children.push(t),t.center=this.center_helper(e,t.origin_offset),this.cells[e.y][e.x]=t}center_helper(e,t){return()=>{let n=t();const r=this.coords();return{x:r.x+this.config.cell_size.x_size*(e.x+.5)+n.x,y:r.y+this.config.cell_size.y_size*(e.y+.5)+n.y}}}fill_grid_lines(){for(let e=0;e<=this.config.grid_dimensions.y_size;e++){const t=new Rn({points:[()=>{const t=this.coords();return{x:t.x,y:t.y+e*this.config.cell_size.y_size}},()=>{const t=this.coords();return{x:t.x+this.config.grid_dimensions.x_size*this.config.cell_size.x_size,y:t.y+e*this.config.cell_size.y_size}}]});this.gridlines.push(t),this.children.push(t)}for(let e=0;e<=this.config.grid_dimensions.x_size;e++){const t=new Rn({points:[()=>{const t=this.coords();return{x:t.x+e*this.config.cell_size.x_size,y:t.y}},()=>{const t=this.coords();return{x:t.x+e*this.config.cell_size.x_size,y:t.y+this.config.grid_dimensions.y_size*this.config.cell_size.y_size}}]});this.gridlines.push(t),this.children.push(t)}}hide_grid_lines(){this.gridlines.forEach((e=>{e.setOpacity(0)}))}fill(e,t){this.check_coords(e);const n=new Tn({height:this.config.cell_size.x_size,width:this.config.cell_size.y_size});n.setColor(t),this.add(e,n)}check_coords(e){if(!Number.isInteger(e.x)||!Number.isInteger(e.y))throw`non-integer indices given for grid coords. Inputted coords: ${e.x},${e.y}`;if(e.x<0||e.y<0)throw"negative indices given for grid coords";if(e.x>this.config.grid_dimensions.x_size-1||e.y>this.config.grid_dimensions.y_size-1)throw`coordinates out of bounds. Grid is of x_size ${this.config.grid_dimensions.x_size} and y_size ${this.config.grid_dimensions.y_size}\n\n Note: passing in 2 refers to index 2 which is the third element of the grid`}childAt(e,t){if(void 0!==this.cells[e]&&void 0!==this.cells[e][t])return this.cells[e][t]}}},{name:"Rectangle",value:Tn},{name:"Circle",value:Pn},{name:"Stage",value:class{constructor(){this.Children=[],this.masks=[]}add(e){if(!(e instanceof En))throw new Error("Stage can only add VisualObjects as children.");this.Children.push(e)}addAll(e){e.forEach((e=>{this.Children.push(e)}))}remove(e){this.Children=this.Children.filter((t=>t!==e))}addMask(e){this.masks.push(e)}childrenToTreeRecurse(e){const t=e.constructor.name,n={visualObject:new _n({text:t}),children:[]};return 0==e.getChildren().length||e.children.forEach((e=>{n.children.push(this.childrenToTreeRecurse(e))})),n}render(e,t){if(Dn.Ys(e).selectAll("*").remove(),this.Children.forEach((t=>t.render(e,this.masks))),t){const e=t.getElementById("svg-container");e.getElementsByTagName("svg")[0].style.height="200%",e.getElementsByTagName("svg")[0].style.width="200%"}}}},{name:"TextBox",value:_n},{name:"Line",value:Rn},{name:"Polygon",value:class extends Ln{constructor(e){let t=e.points.map((e=>yn({x:0,y:0},e)));e.center=()=>vn(t.map((e=>e()))),super(e),this.pointsRelative=jn(t,this.center)}boundingBox(){return Sn(this.pointsRelative.map((e=>({x:e().x+this.center().x,y:e().y+this.center().y}))))}render(e,t){let n,r="";n=t?this.masks.concat(t):this.masks;let o=this.pointsRelative.map((e=>({x:e().x+this.center().x,y:e().y+this.center().y}))),s=Dn.ETc();s.moveTo(o[0].x,o[0].y),o.forEach((e=>{s.lineTo(e.x,e.y)})),s.closePath(),r=this.addMaskRender(n,e),Dn.Ys(e).append("path").attr("d",s.toString()).attr("stroke-width",this.borderWidth).attr("stroke",this.borderColor).attr("fill",this.color).attr("mask",n.length>0?`url(#${r})`:"").attr("opacity",this.opacity()),super.render(e,n)}}},{name:"Tree",value:$n},{name:"Edge",value:class extends En{constructor(e){var t,n,r,o;super(),this.obj1=e.obj1,this.obj2=e.obj2,this.textProps=null!==(t=e.textProps)&&void 0!==t?t:{},this.lineProps=null!==(n=e.lineProps)&&void 0!==n?n:{points:[]},this.textLocation=null!==(r=e.textLocation)&&void 0!==r?r:"none",this.obj1CoordsStore={x:0,y:0},this.obj2CoordsStore={x:0,y:0},this.fast_imprecise=null!==(o=e.fast_imprecise)&&void 0!==o&&o,this.obj1Coords=()=>({x:0,y:0}),this.obj2Coords=()=>({x:0,y:0}),this.compute_points(30),this.makeLine(),this.makeText()}compute_points(e){const t=In(this.obj1.center(),this.obj2.center());this.obj2Coords=()=>this.opt_points(t,this.obj2,e,"obj1"),this.obj1Coords=()=>this.opt_points(t,this.obj1,e,"obj2")}opt_points(e,t,n,r){if(this.fast_imprecise){let e;if("obj1"==r)e=this.obj1CoordsStore;else{if("obj2"!=r)throw"bad arg for coordsstore";e=this.obj1CoordsStore}if(e.xt.boundingBox().top_left.x&&e.y>t.boundingBox().bottom_right.y&&e.y{Cn(t,e)function(e,t){if(e.x==t.x)return 90;{let n=(e.y-t.y)/(e.x-t.x);return Math.atan(n)}}(this.obj1Coords(),this.obj2Coords()),n=()=>Math.sqrt(Math.pow(e.fontSize(),2)+Math.pow(.14*e.text().length*e.fontSize(),2)),r=()=>{const e=this.arcMidpoint();return void 0!==e?e:In(this.obj1Coords(),this.obj2Coords())};switch(this.textLocation){case"above":e.setCenter((()=>({x:r().x+Math.cos(t()-Math.PI/2)*n(),y:r().y+Math.sin(t()-Math.PI/2)*n()})));break;case"below":e.setCenter((()=>({x:r().x+Math.cos(t()+Math.PI/2)*n(),y:r().y+Math.sin(t()+Math.PI/2)*n()})));break;case"left":e.setCenter((()=>t()<=0?{x:r().x+Math.cos(t()-Math.PI/2)*n(),y:r().y+Math.sin(t()-Math.PI/2)*n()}:{x:r().x+Math.cos(t()+Math.PI/2)*n(),y:r().y+Math.sin(t()+Math.PI/2)*n()}));break;case"right":e.setCenter((()=>t()<=0?{x:r().x+Math.cos(t()+Math.PI/2)*n(),y:r().y+Math.sin(t()+Math.PI/2)*n()}:{x:r().x+Math.cos(t()-Math.PI/2)*n(),y:r().y+Math.sin(t()-Math.PI/2)*n()}));break;case"clockwise":e.setCenter((()=>{let e=Mn({x:this.obj2Coords().x-this.obj1Coords().x,y:this.obj2Coords().y-this.obj1Coords().y});return{x:r().x-e.y*n(),y:r().y+e.x*n()}}));break;case"counterclockwise":e.setCenter((()=>{let e=Mn({x:this.obj2Coords().x-this.obj1Coords().x,y:this.obj2Coords().y-this.obj1Coords().y});return{x:r().x+e.y*n(),y:r().y-e.x*n()}}));break;default:console.log(`default text position: midpoint of line or arc: at ${JSON.stringify(r())}`),e.setCenter((()=>({x:r().x,y:r().y})))}this.children.push(e)}arcMidpoint(){if(!this.lineProps)return;const e=this.lineProps.curve instanceof Function?this.lineProps.curve():this.lineProps.curve;if(e){if("arc"===e.curveType){const t=function({x1:e,y1:t,rx:n,ry:r,phi:o,fA:s,fS:i,x2:a,y2:l}){let c,d,p,u,h;const m=2*Math.PI;if(0==n||0==r)throw Error("rx and ry can not be 0");n<0&&(n=-n),r<0&&(r=-r);const g=Math.sin(o),x=Math.cos(o),f=(e-a)/2,b=(t-l)/2,y=(e+a)/2,w=(t+l)/2,v=x*f+g*b,j=x*b-g*f,S=v*v/(n*n)+j*j/(r*r);S>1&&(n*=Math.sqrt(S),r*=Math.sqrt(S));var A=n*r,C=n*j,M=r*v,I=C*C+M*M;if(!I)throw Error("start point can not be same as end point");var O=Math.sqrt(Math.abs((A*A-I)/I));s==i&&(O=-O);var k=O*C/r,N=-O*M/n;c=x*k-g*N+y,d=g*k+x*N+w;var D=(v-k)/n,z=(v+k)/n,E=(j-N)/r,_=(j+N)/r;for(p=Nn(1,0,D,E),u=Nn(D,E,-z,-_);u>m;)u-=m;for(;u<0;)u+=m;for(0==i&&(u-=m),h=p+u;h>m;)h-=m;for(;h<0;)h+=m;return{cx:c,cy:d,startAngle:p,deltaAngle:u,endAngle:h,clockwise:1==i,rx:n,ry:r}}({x1:this.obj1Coords().x,y1:this.obj1Coords().y,rx:e.xradius,ry:e.yradius,phi:0,fA:!1,fS:1===e.sweep,x2:this.obj2Coords().x,y2:this.obj2Coords().y}),n=0===e.sweep;return{x:t.cx,y:n?t.cy+t.ry:t.cy-t.ry}}throw console.log(`unsupported curve type: ${e.curveType}`),new Error(`unsupported curve type: ${e.curveType}`)}}}},{name:"Hull",value:class extends En{constructor(e){var t,n;super(),this.fuzz=null!==(t=e.fuzz)&&void 0!==t?t:0,this.smooth=null!==(n=e.smooth)&&void 0!==n&&n,this.pts=function(e){let t=[],n=new Set;t.push(function(e){return e.sort(((e,t)=>e.x>t.x?1:t.x>e.x?-1:0))[0]}(e));let r=0;for(;0==r||t[r].x!=t[0].x||t[r].y!=t[0].y;){let o;0==r?o={x:0,y:1}:(o={x:t[r].x-t[r-1].x,y:t[r].y-t[r-1].y},n.add({x:t[r].x,y:t[r].y}));let s={x:0,y:0},i=2*Math.PI;e.forEach((e=>{if(!n.has({x:e.x,y:e.y})){let n={x:e.x-t[r].x,y:e.y-t[r].y},a=kn(o,n);(a{t.push({x:e.center().x,y:e.center().y})})):this.smooth?e.forEach((e=>{An(new Pn({radius:this.fuzz,center:e.center()}).getLam(),100).forEach((e=>t.push(e)))})):e.forEach((e=>{const n=new Tn({height:this.fuzz,width:this.fuzz});n.setCenter(e.center()),An(n.getLam(),100).forEach((e=>t.push(e)))})),t}render(e,t){let n;n=t?this.masks.concat(t):this.masks,new Rn({points:this.pts}).render(e,n)}}},{name:"ConjoinedObject",value:class extends En{constructor(e){super({x:0,y:0}),this.children=[],e&&e.forEach((e=>{this.add(e)}))}addOrdered(e,t){if(!(e instanceof En))throw new Error("ConjoinedObject can only add VisualObjects as children.");if(t>this.children.length)throw`Index larger than current number of objects stored plus 1. Add an index between 0 and ${this.children.length}`;this.children.splice(t,0,e)}add(e){this.addOrdered(e,0)}setCenter(e){this.children.forEach((t=>{t.setCenter(e)}))}}},{name:"boxUnion",value:wn},{name:"Ellipse",value:class extends Ln{constructor(e){super(e),this.height=yn(0,e.height),this.width=yn(0,e.width);let t=yn({x:0,y:0},e.coords);this.center=()=>{const e=t();return{x:e.x+this.width()/2,y:e.y+this.height()/2}}}boundingBox(){return{top_left:{x:this.center().x-this.width()/2,y:this.center().y-this.height()/2},bottom_right:{x:this.center().x+this.width()/2,y:this.center().y+this.height()/2}}}setWidth(e){this.width=yn(this.width(),e)}setHeight(e){this.height=yn(this.height(),e)}render(e,t){let n,r="";n=t?this.masks.concat(t):this.masks,r=this.addMaskRender(n,e),Dn.Ys(e).append("ellipse").attr("cx",this.center().x-this.width()/2).attr("cy",this.center().y-this.height()/2).attr("rx",this.width()).attr("ry",this.height()).attr("stroke-width",this.borderWidth()).attr("stroke",this.borderColor()).attr("fill",this.color()).attr("mask",n.length>0?`url(#${r})`:"").attr("opacity",this.opacity()),super.render(e,n)}}},{name:"ImageBox",value:class extends En{constructor(e){super(e.coords),this.url=yn("",e.url),this.width=yn(100,e.width),this.height=yn(100,e.height)}boundingBox(){return{top_left:{x:this.center().x-this.width()/2,y:this.center().y-this.height()/2},bottom_right:{x:this.center().x+this.width()/2,y:this.center().y+this.height()/2}}}render(e,t){let n,r="";n=t?this.masks.concat(t):this.masks,r=this.addMaskRender(n,e),Dn.Ys(e).append("svg:image").attr("x",this.center().x-this.width()/2).attr("y",this.center().y-this.height()/2).attr("width",this.width()).attr("height",this.height()).attr("mask",n.length>0?`url(#${r})`:"").attr("xlink:href",`${this.url()}`),super.render(e)}}},{name:"AlloySet",value:Zn},{name:"AlloyAtom",value:Un}];var Yn=n(25001);class Xn extends Zn{constructor(e,t,n){return super(),this._id=e,this._atoms=t,this._subsignatures=[],this._tuples=t.map((e=>new Wn([e]))),n?n.applyProxy(this,function(e){return e.replace(/^this\//,"").replace("/","$").replace("-","$")}(e)):this}atom(e){return this.atoms(!0).find((t=>t.id()===e))||null}atoms(e=!1){return e?this.atoms().concat(this.subSignatures().map((e=>e.atoms(!0))).reduce(((e,t)=>e.concat(t)),[])):this._atoms.slice()}tuples(){return this.atoms(!0).map((e=>new Wn([e])))}clone(e){const t=new Xn(this.id(),this.atoms().map((t=>t.clone(e))),e);return t._subsignatures=this.subSignatures().map((t=>t.clone(e))),t}id(){return this._id}subSignatures(e=!1){return e?this.subSignatures().concat(this.subSignatures().map((e=>e.subSignatures(!0))).reduce(((e,t)=>e.concat(t)),[])):this._subsignatures.slice()}static fromElement(e,t){const n=e.getAttribute("label");if(!n)throw Gn.missingAttribute("AlloySignature","label");const r=Array.from(e.querySelectorAll("atom")).map((e=>Un.fromElement(e,t)));return new Xn(n,r,t)}static intSignature(e,t){if(e<0)throw Gn.error("AlloySignature","Invalid bitwidth");const n=[];for(let r=Math.pow(2,e),o=-r/2;o{const n=e.getAttribute("ID"),o=e.getAttribute("label");if(!n)throw Gn.missingAttribute("AlloySignature","ID");const a=Xn.getParent(e);if(!a&&"univ"!==o)throw Gn.error("AlloySignature",`unable to resolve parent sig for non-univ sig ${o}`);const l="Int"===o||"seq/Int"===o?r:Xn.fromElement(e,t);return i.set(n,l),a&&"seq/Int"!==o&&(s.has(a)||s.set(a,[]),s.get(a).push(n)),l})),i.forEach(((e,t)=>{const n=s.get(t)||[];e._subsignatures=n.map((e=>i.get(e))).filter(Yn.$K)})),i}static getParent(e){const t=e.getAttribute("parentID"),n=e.getAttribute("label");if(!t&&"univ"!==n){const t=e.getElementsByTagName("type");if(1!==t.length)throw Gn.error("AlloySignature",`subset sig ${n} had no type or multiple types; this is unsupported`);if(t[0].getAttribute("ID"))return t[0].getAttribute("ID");throw Gn.missingAttribute("AlloySignature","type.ID")}return t}static typesFromXML(e,t){const n=e.querySelectorAll("types");if(!n)throw Gn.missingElement("AlloyField","types");return Array.from(n).map((e=>Xn.typesFromXMLSingle(e,t)))}static typesFromXMLSingle(e,t){return Array.from(e.querySelectorAll("type")).map((e=>{const n=e.getAttribute("ID");if(!n)throw Gn.missingAttribute("AlloyField","ID");const r=t.get(n);if(!r)throw Gn.error("Alloy Field",`No signature with ID: ${n}`);return r}))}}var Hn=n(44908),Jn=n.n(Hn);class Qn extends Zn{constructor(e,t){super(t),this._types=e}project(e){const t=Jn()(this.types().map((t=>t.map((t=>e.get(t))))).flat());t.some(Yn.$K)&&(this._tuples=this.tuples().filter((e=>e.atoms().every(((e,n)=>void 0===t[n]||t[n]===e)))).map((e=>new Wn(e.atoms().filter(((e,n)=>void 0===t[n]))))))}types(){return this._types.slice()}join(e){if(e instanceof Qn){const t=this.types().map((e=>e.at(-1))),n=e.types().map((e=>e.at(0)));if(!t.some((e=>n.includes(e))))throw Gn.error("Join",`Joining ${this} and ${e} will always be empty.`)}return super.join(e)}}class Kn extends Qn{constructor(e,t,n,r,o){return super(t,n),this._id=e,r?r.applyProxy(this,o?function(e){return e.replace(/-/g,"$").replace("/","$")}(o):e):this}clone(e,t){this.types().forEach((e=>{if(!this.types().every(Yn.$K))throw Gn.error("AlloyField","Missing type, cannot clone field")}));const n=this.tuples().map((e=>new Wn(e.atoms().map(((e,t)=>e.clone())))));if(t){const e=Reflect.get(this,"__var__");if(!e)throw Gn.error("AlloyField","Cannot use proxy to clone non-proxied field");return new Kn(this.id(),this.types(),n,t,e.toString())}return new Kn(this.id(),this.types(),n)}id(){return this._id}static fieldsFromXML(e,t,n){const r=Array.from(e.querySelectorAll("field")),o=new Map;return r.forEach((e=>{const t=e.getAttribute("label");if(!t)throw Gn.missingAttribute("AlloyField","label");o.set(t,(o.get(t)||0)+1)})),r.map((e=>{const r=e.getAttribute("label"),s=e.getAttribute("parentID"),i=Xn.typesFromXML(e,t);if(!r)throw Gn.missingAttribute("AlloyField","label");if(!s)throw Gn.missingAttribute("AlloyField","parentID");const a=o.get(r)||0,l=t.get(s);if(!l)throw Gn.error("AlloyField","Field parent type does not exist");const c=a>1?(d=r,p=l,`${Reflect.get(p,"__var__")}$${d}`):r;var d,p;const u=Wn.tuplesFromXML(e.querySelectorAll("tuple"),i);return new Kn(r,i,u,n,c)}))}}class er{constructor(){this._sets=new Map}applyProxy(e,t){const n=this._sets,r=t||`${n.size}`,o=this._finalize.bind(this);if(n.has(r))throw Gn.error("AlloyProxy",`Cannot apply proxy, ID already exists: ${r}. (This may be caused by a clash between sig and atom names.)`);const s=new Proxy(e,{get(e,r){if("symbol"==typeof r||r in e)return Reflect.get(e,r);if("number"!=typeof r&&isNaN(+r)){let s;const i=r.match(/\[(.*)]/);if(i){const r=n.get(i[1]);if(!r)throw Gn.error("Box Join",`Tried to join ${t} with ${i[1]} but no set ${i[1]} defined.`,!0);s=r.join(e)}else{const o=n.get(r);if(!o)throw Gn.error("Dot Join",`Tried to join ${t} with ${r} but no set ${r} defined.`,!0);s=e.join(o)}return o(s)}{const t=n.get(`${r}`);if(!t)throw Gn.error("Join",`Integer atom does not exist: ${r}`);return o(t.join(e))}}});return Reflect.set(s,Symbol.toPrimitive,(()=>`[${r}]`)),Reflect.set(s,"__var__",r),this._sets.set(r,s),s}_finalize(e){if(1===e.tuples().length&&1===e.tuples()[0].atoms().length){const t=e.tuples()[0].atoms()[0];return this._sets.get(t.id())||this.applyProxy(t,t.id())}return this.applyProxy(e)}}class tr extends Qn{constructor(e,t,n,r){return super(t,n),this._id=e,r?r.applyProxy(this,function(e){return e.replace(/^\$this\//,"$").replace("/","$").replace(/'/g,"$")}(e)):this}clone(e,t){const n=this.tuples().map((e=>new Wn(e.atoms().map(((e,t)=>e.clone())))));return new tr(this.id(),this.types(),n,t)}id(){return this._id}static skolemsFromXML(e,t,n){return Array.from(e.querySelectorAll("skolem")).map((e=>{const r=e.getAttribute("label"),o=Xn.typesFromXML(e,t),s=Wn.tuplesFromXML(e.querySelectorAll("tuple"),o);if(!r)throw Gn.missingAttribute("AlloySkolem","label");return new tr(r,o,s,n)}))}}class nr{constructor(e,t){this._proxy=new er,this._atoms=[],this._fields=[],this._signatures=[],this._skolems=[],this._projections=new Map,this._bitwidth=0,this._command="",this._filename="",this._sources=new Map,e&&this._buildFromXML(e,t)}atom(e){return this._atoms.find((t=>t.id()===e))||null}atoms(){return this._atoms.slice()}bitwidth(){return this._bitwidth}clone(){const e=new er,t=this.univ();if(!t)throw Gn.error("AlloyInstance","Cannot clone an instance without univ signature");const n=t.clone(e),r=[n,...n.subSignatures(!0)],o=n.atoms(!0),s=this.fields().map((t=>t.clone(r,e))),i=this.skolems().map((t=>t.clone(r,e))),a=new nr;return a._proxy=e,a._fields=s,a._signatures=r,a._atoms=o,a._skolems=i,a._bitwidth=this.bitwidth(),a._command=this.command(),a._filename=this.filename(),a}command(){return this._command}field(e){return this._fields.find((t=>t.id()===e))||null}fields(){return this._fields}filename(){return this._filename}project(e){const t=this.clone(),n=e.map((e=>t.atom(e.id())));if(!n.every(Yn.$K))throw Gn.error("AlloyInstance","Error cloning instance");const r=t.univ();if(!r)throw Gn.error("AlloyInstance","No univ signature");const o=r.subSignatures(),s=new Map;return n.forEach((e=>{o.forEach((t=>{if(t.atoms(!0).includes(e)){if(s.has(t))throw Gn.error("AlloyInstance","Cannot project over multiple atoms from the same signature");s.set(t,e)}}))})),this._projections=s,t.fields().forEach((e=>e.project(s))),t.skolems().forEach((e=>e.project(s))),t}projections(){return new Map(this._projections)}signature(e){return this.signatures().find((t=>t.id()===e))||null}signatures(){return this._signatures.slice()}skolem(e){return this.skolems().find((t=>t.id()===e))||null}skolems(){return this._skolems.slice()}sources(){return new Map(this._sources)}univ(){return this._signatures.find((e=>"univ"===e.id()))||null}_buildFromXML(e,t){const n=(new DOMParser).parseFromString(e,"application/xml"),r=n.querySelectorAll("instance"),o=void 0!==t?r[t]:r[0];if(!o)throw Gn.missingElement("AlloyInstance","instance");const s=o.getAttribute("bitwidth"),i=o.getAttribute("command"),a=o.getAttribute("filename"),l=o.getAttribute("maxseq");if(!s)throw Gn.missingAttribute("AlloyInstance","bitwidth");if(!i)throw Gn.missingAttribute("AlloyInstance","command");if(!a)throw Gn.missingAttribute("AlloyInstance","filename");if(!l)throw Gn.missingAttribute("AlloyInstance","maxseq");if(+s<1)throw Gn.error("AlloyInstance",`Invalid bitwidth ${s}`);this._bitwidth=+s,this._command=i,this._filename=a,this._atoms=[],this._fields=[],this._signatures=[],this._skolems=[];const c=Xn.signaturesFromXML(o,this._proxy);this._signatures=Array.from(c.values()),this._fields=Kn.fieldsFromXML(o,c,this._proxy),this._skolems=tr.skolemsFromXML(o,c,this._proxy),this._atoms=this._signatures.map((e=>e.atoms())).reduce(((e,t)=>e.concat(t)),[]),this._sources=new Map,Array.from(n.querySelectorAll("source")).forEach((e=>{const t=e.getAttribute("filename"),n=e.getAttribute("content");if(!t)throw Gn.missingAttribute("AlloyInstance","filename");if(!n)throw Gn.missingAttribute("AlloyInstance","content");this._sources.set(t,n)}))}}const rr="https://alloy-js.github.io/alloy-ts/classes/alloyinstance.alloyinstance-1.html",or=function(e){return e.stage},sr=function(e){return e.stageDimensions},ir=function(e){return e.text},ar=function(e,t,n){if(ft(e)){const r=e.data,o=e.parsed.instances.map(((e,t)=>new nr(r,t))),s=o[n],i=s.atoms(),a=[];t.forEach((e=>{const t=e.atom;if(t){const e=i.find((e=>e.id()===t));e&&a.push(e)}}));const l=s.project(a),c=l.signatures().map((e=>({name:Reflect.get(e,"__var__"),variable:e,type:"AlloySignature",typeUrl:"https://alloy-js.github.io/alloy-ts/classes/alloysignature.alloysignature-1.html"}))),d=l.atoms().filter((e=>isNaN(+e.id()))).map((e=>({name:Reflect.get(e,"__var__"),variable:e,type:"AlloyAtom",typeUrl:"https://alloy-js.github.io/alloy-ts/classes/alloyatom.alloyatom-1.html"}))),p=l.fields().map((e=>({name:Reflect.get(e,"__var__"),variable:e,type:"AlloyField",typeUrl:"https://alloy-js.github.io/alloy-ts/classes/alloyfield.alloyfield-1.html"}))),u=l.skolems().map((e=>({name:Reflect.get(e,"__var__"),variable:e,type:"AlloySkolem",typeUrl:"https://alloy-js.github.io/alloy-ts/classes/alloyskolem.alloyskolem-1.html"}))),h=qn.map((e=>({name:e.name,variable:e.value,type:"D3Helper",typeUrl:"https://csci1710.github.io/forge-documentation/sterling/d3fx.html"}))),m=[{name:"instance",variable:s,type:"AlloyInstance",typeUrl:rr},...c,...d,...p,...u,...h];return qt(e.parsed)&&m.unshift({name:"currentInstance",type:"number",variable:n},{name:"loopBack",type:"number",variable:e.parsed.loopBack},{name:"instances",variable:o,type:"AlloyInstance[]",typeUrl:rr}),m}return function(e){return"raw"===e.format}(e)?[{name:"data",variable:e.data,type:"string"}]:[]};function lr(e){return e.mainView}function cr(e){return e.graphViewDrawer}function dr(e){return e.tableViewDrawer}function pr(e){return e.scriptViewDrawer}const ur={selectAvailableViews:function(e){return e.availableViews},selectMainView:lr,selectGraphDrawer:cr,selectTableDrawer:dr,selectScriptDrawer:pr,selectDrawerIsCollapsed:(0,tn.P1)([lr,cr,dr,pr],((e,t,n,r)=>{switch(e){case"GraphView":return null===t;case"TableView":return null===n;case"ScriptView":return null===r;default:return!0}})),selectDrawerView:(0,tn.P1)([lr,cr,dr,pr],((e,t,n,r)=>{switch(e){case"GraphView":return t;case"TableView":return n;case"ScriptView":return r;default:return null}})),selectSelectedGenerator:function(e){return e.selectedGenerator}};function hr(e){return an.selectActiveDatum(e.data)}function mr(e){return ur.selectSelectedGenerator(e.ui)}function gr(e){return ur.selectAvailableViews(e.ui)}function xr(e){return an.selectData(e.data)}function fr(e,t){return ft(t)&&qt(t.parsed)}function br(e){return ur.selectDrawerIsCollapsed(e.ui)}function yr(e){return ur.selectDrawerView(e.ui)}function wr(e){return ur.selectGraphDrawer(e.ui)}function vr(e){const t=hr(e);return void 0!==t&&!0===t.evaluator}function jr(e,t){return ln(e.evaluator,t)}function Sr(e){return gn(e.provider)}function Ar(e){return mn(e.log)}function Cr(e){return ur.selectMainView(e.ui)}function Mr(e){return cn(e.evaluator)}function Ir(e,t){const n={};if(t&&ft(t)){const e=t.parsed.instances[0];(function(e){return(0,Yt.Z)(dt(e).map(Xe)).filter((e=>!(0,Wt.Z)(e)))})(e).forEach((t=>{const r=ct(e,t);n[t]=function(e,t){return it(e).filter((n=>function(e,t,n){return"string"==typeof t&&(t=st(e,t)),"string"!=typeof n&&(n=n.id),tt(e,t).types.includes(n)}(e,n,t)))}(e,r).map((e=>e.id))}))}return n}function Or(e,t){return hn.selectProjections(e.graphs,t)}function kr(e){return xn(e.provider)}function Nr(e){return fn(e.provider)}function Dr(e){return ur.selectScriptDrawer(e.ui)}function zr(e){return or(e.script)}function Er(e){return sr(e.script)}function _r(e){return ir(e.script)}function Lr(e){return ur.selectTableDrawer(e.ui)}function Tr(e,t){return hn.selectTimeIndex(e.graphs,t)}function Pr(e,t){return ft(t)&&qt(t.parsed)?t.parsed.instances.length:1}(0,tn.P1)([(e,t)=>t,(e,t)=>t?function(e,t){return hn.selectGraphLayout(e.graphs,t)}(e,t):void 0,(e,t)=>t?function(e,t){return hn.selectTheme(e.graphs,t)}(e,t):void 0,(e,t)=>t?Tr(e,t):void 0,(e,t)=>t?function(e,t){return hn.selectHiddenRelations(e.graphs,t)}(e,t):void 0],((e,t,n,r,o)=>{if(e&&t&&n&&void 0!==r&&ft(e)&&o){const s=e.parsed.instances[r],i=n.projections||[],a=i.filter((e=>!0===e.time)),l=Xt(s,i.map((e=>e.atom)).filter(qe)),c=Lt(l,n);if(a.length)return a.map((e=>{let r=c;o[e.type]&&o[e.type].forEach((e=>{const t=G(r).filter((t=>t.relation.name===e)).map((e=>e.id));r=function(e,t){return(0,At.Uy)(e,(e=>{t.forEach((t=>{const n=F(e,t);n&&function(e,t){const{id:n,source:r,target:o}=t;delete e.edges[n],function(e,t,n,r){const o=e.predecessors[n][t];if(o){const s=o.indexOf(r);-1!==s&&o.splice(s,1),0===o.length&&delete e.predecessors[n][t]}}(e,r,o,n),function(e,t,n,r){const o=e.successors[t][n];if(o){const s=o.indexOf(r);-1!==s&&o.splice(s,1),0===o.length&&delete e.successors[t][n]}}(e,r,o,n),function(e,t,n){const r=e.inedges[t].indexOf(n);-1!==r&&e.inedges[t].splice(r,1)}(e,o,n),function(e,t,n){const r=e.outedges[t].indexOf(n);-1!==r&&e.outedges[t].splice(r,1)}(e,r,n)}(e,n)}))}))}(c,t)}));const s=Ut(r,t);return Bt("",l,s,n)}));const d=Ut(c,t);return[Bt("",l,d,n)]}return console.log(`datum: ${void 0!==e}`),console.log(`layout: ${void 0!==t}`),console.log(`theme: ${void 0!==n}`),console.log(`time: ${r}`),[]}));const Br=(0,tn.P1)([(e,t)=>t,(e,t)=>Or(e,t),(e,t)=>Tr(e,t)],((e,t,n)=>ar(e,t,n))),Rr=(0,tn.P1)([(e,t)=>t,(e,t)=>Tr(e,t)],((e,t)=>{if(ft(e)){const n=e.parsed.instances[t],r=function(e){const t=lt(e),n=at(e);return t.concat(n)}(n).map((e=>({title:e.name,type:"relation",headers:e.types,data:rt(e).map((e=>e.atoms))})));return[...r,...dt(n).map((e=>({title:e.id,type:"type",data:He(e).map((e=>[e.id]))})))]}return[]}));function $r(e,t){return hn.selectCnDSpec(e.graphs,t)}function Vr(e,t){return hn.selectSelectedProjections(e.graphs,t)}function Fr(e,t){return hn.selectSelectedTimeIndices(e.graphs,t)}function Gr(e){return bn(e.provider)}function Zr(e){return e.synthesis.isActive}function Wr(e){return e.synthesis.selectorType}function Ur(e){return e.synthesis.currentStep}function qr(e){return e.synthesis.numInstances}function Yr(e){return e.synthesis.examples}function Xr(e){return e.synthesis.loadedInstances}function Hr(e){return e.synthesis.result}function Jr(e){return e.synthesis.error}function Qr(e){return e.synthesis.isLoading}function Kr(e){return!e.synthesis.isLoading&&e.synthesis.examples.length===e.synthesis.numInstances&&e.synthesis.examples.every((e=>e.selectedAtomIds.length>0||e.selectedPairs.length>0))}function eo(e){return e.synthesis.currentDataInstance}var to=n(10894),no=n(66653);const ro=e=>{const{expression:t}=e;return(0,r.jsxs)("div",Object.assign({className:"relative p-2 font-mono text-xs"},{children:[(0,r.jsxs)("div",Object.assign({className:"relative flex ml-6"},{children:[(0,r.jsx)("span",Object.assign({className:"absolute inset-y-0 -left-5"},{children:(0,r.jsx)(to.JO,{as:no.tOB})})),(0,r.jsx)("div",Object.assign({className:"font-semibold select-text"},{children:t.expression}))]})),(0,r.jsx)("div",Object.assign({className:"ml-6 text-gray-600 select-text"},{children:t.result}))]}))},oo=e=>{const{datum:t}=e,n=St((e=>jr(e,t)));return(0,r.jsx)("div",Object.assign({className:"absolute inset-x-0 top-[35px] bottom-0 flex flex-col overflow-y-auto"},{children:n.map((e=>(0,r.jsx)(ro,{expression:e},e.id)))}))},so=e=>{const{datum:t}=e,[n,s]=(0,o.useState)(""),[i,a]=(0,o.useState)(null),l=St(vr),c=St(Mr),d=St((e=>jr(e,t))),p=jt(),u=(0,o.useCallback)((e=>{a(null),s(e.target.value)}),[]),h=(0,o.useCallback)((e=>{var t;if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||(t=e.code,io.includes(t))))switch(e.code){case"ArrowUp":null===i?d.length>0&&a(0):i{e.preventDefault(),n.length>0&&(p(Te({id:`${c}`,datumId:t.id,expression:n})),s(""),a(null))}),[t,c,n]),g=l?"gray.500":"gray.300",x=l?"Enter an expression...":"Evaluator disabled";return(0,r.jsx)("div",Object.assign({className:"absolute inset-x-0 top-0 h-[35px]"},{children:(0,r.jsxs)("form",Object.assign({className:"relative block font-mono",onSubmit:m},{children:[(0,r.jsx)("span",Object.assign({className:"sr-only"},{children:"Search"})),(0,r.jsx)("span",Object.assign({className:"absolute inset-y-0 left-0 flex items-center pl-2"},{children:(0,r.jsx)(to.JO,{color:g,as:no.tOB})})),(0,r.jsx)("input",{className:"h-[35px] text-xs placeholder:italic placeholder:text-gray-400 placeholder:text-xs block bg-white w-full border-b border-gray-100 focus:border-gray-200 py-2 pl-9 pr-3 focus:outline-none",placeholder:x,type:"text",disabled:!l,value:null===i?n:d[i].expression,onChange:u,onKeyDown:h})]}))}))},io=["Unidentified","Escape","Enter","ControlLeft","ControlRight","ShiftLeft","ShiftRight","AltLeft","AltRight","CapsLock","OSLeft","OSRight","F1","F2","F3","F4","F5","F6","F7","F8","F9","F10","F11","F12","ScrollLock","ArrowLeft","ArrowRight"],ao=()=>{const e=St(hr);return e?(0,r.jsxs)("div",Object.assign({className:"absolute inset-0"},{children:[(0,r.jsx)(so,{datum:e}),(0,r.jsx)(oo,{datum:e})]})):null},lo=()=>(0,r.jsxs)("div",Object.assign({className:"flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(to.JO,{as:no.RJr}),(0,r.jsx)(k,{children:"Evaluator"})]})),co=()=>{const e=St(Ar);return(0,r.jsx)(b,Object.assign({h:"full",px:2,py:1,overflowY:"auto"},{children:e.map(((e,t)=>(0,r.jsx)(B,{text:e.text,time:new Date(e.time),variant:e.type},t)))}))},po=()=>(0,r.jsxs)("div",Object.assign({className:"flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(to.JO,{className:"mt-0.5",as:no.t75}),(0,r.jsx)(k,{children:"Log"})]}));var uo=n(89583),ho=n(57324),mo=n(51649),go=n(48707),xo=n(41947),fo=n(18124);const bo={nodeWidth:100,nodeHeight:60,nodeSep:100,rankSep:100},yo={hidden:{builtinDisconnected:!0},nodes:[{shape:{shape:"rectangle",width:100,height:60},styles:{node:{stroke:"#333",strokeWidth:1,fill:"#ffffff"},label:{fontFamily:"monospace",fontSize:"14px",textAnchor:"middle",userSelect:"none",fill:"#333"}},props:{label:{dy:"0.33em"}},targets:["*"]}],edges:[{asAttribute:!1,sourceIndex:0,curve:{type:"bspline"},styles:{edge:{stroke:"#333",strokeWidth:1,fill:"none"},label:{fontFamily:"monospace",fontSize:"12px",textAnchor:"middle",userSelect:"none"}},targets:["*"]}]};function wo(e,t){var n;return null===(n=e.edges)||void 0===n?void 0:n.find((e=>{const n=e.targets,r=n?n[0]:void 0;return void 0!==n&&1===n.length&&void 0!==r&&"*"!==r&&r.relation===t}))}function vo(e,t){var n;return null===(n=e.nodes)||void 0===n?void 0:n.find((e=>{const n=e.targets,r=n?n[0]:void 0;return void 0!==n&&1===n.length&&void 0!==r&&"*"!==r&&r.type===t}))}function jo(e,t){var n;if(ft(t)){const r=e.themeByGeneratorName[null!==(n=t.generatorName)&&void 0!==n?n:""],o=r&&r.projections||[];if(o){const e=t.parsed.instances[0];o.forEach((t=>{if(!t.atom){const n=t.type,r=He(ct(e,n));r.length&&(t.atom=r[0].id)}}))}const s=dn(o),i=t.parsed.instances,a=o.map((e=>e.atom)).filter(qe),l=i.map((e=>Xt(e,a))).map((e=>Lt(e,r)));e.layoutsByDatumId[t.id].layoutById[s]=function(e,t){const n=new Set,r={};e.forEach((e=>{V(e).forEach((e=>{n.add(e.id)})),G(e).forEach((e=>{r[e.id]=e}))}));const o=new(Vt().graphlib.Graph)({multigraph:!0});o.setGraph({nodesep:t.nodeSep,ranksep:t.rankSep,rankdir:"TB"}),n.forEach((e=>{o.setNode(e,{label:e,width:t.nodeWidth,height:t.nodeHeight})})),(0,Ft.Z)(r,((e,t)=>{o.setEdge(e.source,e.target,{id:t})})),Vt().layout(o);const s=function(e,t){const n=e.nodes().map((t=>e.node(t).x)),r=e.nodes().map((t=>e.node(t).y)),o=(0,Gt.Z)(n),s=(0,Gt.Z)(r),i=(0,Zt.Z)(n),a=(0,Zt.Z)(r);return{x:(0,Wt.Z)(o)||(0,Wt.Z)(i)?0:(i-o)/2+t.nodeWidth/2,y:(0,Wt.Z)(s)||(0,Wt.Z)(a)?0:(a-s)/2+t.nodeHeight/2}}(o,t),i={},a={};return o.nodes().forEach((e=>{const{x:t,y:n}=o.node(e);i[e]={x:t-s.x,y:n-s.y}})),o.edges().forEach((e=>{const{id:t,points:n}=o.edge(e);a[t]=n.slice(1,-1).map((e=>({x:e.x-s.x,y:e.y-s.y})))})),{nodePositions:i,edgeWaypoints:a}}(l,bo)}}const So={asAttributeSet:function(e,t){var n;const{datum:r,relation:o,asAttribute:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=wo(i,o);if(e)s?(0,go.Z)(e,["asAttribute"],!0):(0,xo.Z)(e,["asAttribute"]);else if(s){const e={targets:[{relation:o}],asAttribute:!0};i.edges||(i.edges=[]),i.edges.push((0,At.cA)(e))}}},cndSpecSet:function(e,t){var n;const{datum:r,spec:o}=t.payload,s=null!==(n=r.generatorName)&&void 0!==n?n:"";e.cndSpecByGeneratorName[s]=o},curveRemoved:function(e,t){var n;const{datum:r,relation:o}=t.payload,s=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(s){const e=wo(s,o);e&&(0,xo.Z)(e,["curve"])}},curveSet:function(e,t){var n;const{datum:r,relation:o,curve:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=wo(i,o);if(e)(0,go.Z)(e,["curve"],s);else{const e={targets:[{relation:o}],curve:s};i.edges||(i.edges=[]),i.edges.push((0,At.cA)(e))}}},edgeLabelStyleRemoved:function(e,t){var n;const{datum:r,relation:o,style:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=wo(i,o);e&&(0,xo.Z)(e,["styles","label",s])}},edgeLabelStyleSet:function(e,t){var n;const{datum:r,relation:o,style:s,value:i}=t.payload,a=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(a){const e=wo(a,o);if(e)(0,go.Z)(e,["styles","label",s],i);else{const e={targets:[{relation:o}],styles:{label:{[s]:i}}};a.edges||(a.edges=[]),a.edges.push((0,At.cA)(e))}}},edgeStyleRemoved:function(e,t){var n;const{datum:r,relation:o,style:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=wo(i,o);e&&(0,xo.Z)(e,["styles","edge",s])}},edgeStyleSet:function(e,t){var n;const{datum:r,relation:o,style:s,value:i}=t.payload,a=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(a){const e=wo(a,o);if(e)(0,go.Z)(e,["styles","edge",s],i);else{const e={targets:[{relation:o}],styles:{edge:{[s]:i}}};a.edges||(a.edges=[]),a.edges.push((0,At.cA)(e))}}},edgeIndexSet:function(e,t){var n;const{datum:r,relation:o,which:s,value:i}=t.payload,a=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(a){const t=wo(a,o);if(t)(0,go.Z)(t,[s],i);else{const e={targets:[{relation:o}]};e[s]=i,a.edges||(a.edges=[]),a.edges.push((0,At.cA)(e))}jo(e,r)}},edgeIndexRemoved:function(e,t){var n;const{datum:r,relation:o,which:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=wo(i,o);e&&(0,xo.Z)(e,[s])}},graphSpread:function(e,t){const{datum:n,matrix:r}=t.payload,o=e.matricesByDatumId[n.id];o&&(o.spreadMatrix=r)},graphZoomed:function(e,t){const{datum:n,matrix:r}=t.payload,o=e.matricesByDatumId[n.id];o&&(o.zoomMatrix=r)},hiddenRelationAdded:function(e,t){const{datum:n,type:r,relation:o}=t.payload;e.hiddenByDatumId[n.id][r]||(e.hiddenByDatumId[n.id][r]=[]),e.hiddenByDatumId[n.id][r].push(o)},nodeLabelPropRemoved:function(e,t){var n;const{datum:r,type:o,prop:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=vo(i,o);e&&(0,xo.Z)(e,["props","label",s])}},nodeLabelPropSet:function(e,t){var n;const{datum:r,type:o,prop:s,value:i}=t.payload,a=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(a){const e=vo(a,o);if(e)(0,go.Z)(e,["props","label",s],i);else{const e={targets:[{type:o}],props:{label:{[s]:i}}};a.nodes||(a.nodes=[]),a.nodes.push((0,At.cA)(e))}}},nodeLabelStyleRemoved:function(e,t){var n;const{datum:r,type:o,style:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=vo(i,o);e&&(0,xo.Z)(e,["styles","label",s])}},nodeLabelStyleSet:function(e,t){var n;const{datum:r,type:o,style:s,value:i}=t.payload,a=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(a){const e=vo(a,o);if(e)(0,go.Z)(e,["styles","label",s],i);else{const e={targets:[{type:o}],styles:{label:{[s]:i}}};a.nodes||(a.nodes=[]),a.nodes.push((0,At.cA)(e))}}},nodesOffset:function(e,t){var n;const{datum:r,offsets:o}=t.payload,s=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""],i=dn(s&&s.projections||[]),a=e.layoutsByDatumId[r.id].layoutById[i];(0,Ft.Z)(o,((e,t)=>{const n=a.nodePositions[t];a.nodePositions[t]=ae(n,e)}))},projectionAdded:function(e,t){var n;const{datum:r,type:o,atom:s,time:i,timeOrdering:a}=t.payload,l={type:o,atom:s,time:i,timeOrdering:a},c=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];c.projections?c.projections.push((0,At.cA)(l)):c.projections=[(0,At.cA)(l)],jo(e,r)},projectionAtomToggled:function(e,t){var n;const{datum:r,projectionType:o,atomId:s}=t.payload,i=null!==(n=r.generatorName)&&void 0!==n?n:"";e.selectedProjectionsByGeneratorName[i]||(e.selectedProjectionsByGeneratorName[i]={}),e.selectedProjectionsByGeneratorName[i][o]||(e.selectedProjectionsByGeneratorName[i][o]=[]);const a=e.selectedProjectionsByGeneratorName[i][o],l=a.indexOf(s);-1===l?a.push(s):a.splice(l,1)},projectionOrderingSet:function(e,t){var n;const{datum:r,type:o,relation:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""],a=(i&&i.projections||[]).find((e=>e.type===o));a&&(s?a.timeOrdering=s:delete a.timeOrdering)},projectionRemoved:function(e,t){var n;const{datum:r,type:o}=t.payload,s=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];s.projections&&(0,fo.Z)(s.projections,(e=>e.type===o)),jo(e,r)},projectionSet:function(e,t){var n;const{datum:r,type:o,atom:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""],a=(i&&i.projections||[]).find((e=>e.type===o));a&&(a.atom=s),jo(e,r)},saveThemeRequested:function(e,t){var n;const{datum:r}=t.payload,o=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(o){const e=(0,At.Vk)(o),t=(0,At.Uy)(e,(e=>{var t;null===(t=e.projections)||void 0===t||t.forEach((e=>{(0,xo.Z)(e,"atom")}))})),n=JSON.stringify(t,null,2),r=document.createElement("a"),s=new Blob([n],{type:"application/json"});r.href=URL.createObjectURL(s),r.download="theme.json",r.click()}},selectedProjectionsSet:function(e,t){var n;const{datum:r,projectionType:o,selectedAtoms:s}=t.payload,i=null!==(n=r.generatorName)&&void 0!==n?n:"";e.selectedProjectionsByGeneratorName[i]||(e.selectedProjectionsByGeneratorName[i]={}),e.selectedProjectionsByGeneratorName[i][o]=s},selectedTimeIndicesSet:function(e,t){const{datum:n,selectedIndices:r}=t.payload;e.selectedTimeIndicesByDatumId[n.id]=r},shapeRemoved:function(e,t){var n;const{datum:r,type:o}=t.payload,s=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(s){const e=vo(s,o);e&&(0,xo.Z)(e,["shape"])}},shapeSet:function(e,t){var n;const{datum:r,type:o,shape:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=vo(i,o);if(e)(0,go.Z)(e,["shape"],s);else{const e={targets:[{type:o}],shape:s};i.nodes||(i.nodes=[]),i.nodes.push((0,At.cA)(e))}}},shapeStyleRemoved:function(e,t){var n;const{datum:r,type:o,style:s}=t.payload,i=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(i){const e=vo(i,o);e&&(0,xo.Z)(e,["styles","node",s])}},shapeStyleSet:function(e,t){var n;const{datum:r,type:o,style:s,value:i}=t.payload,a=e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""];if(a){const e=vo(a,o);if(e)(0,go.Z)(e,["styles","node",s],i);else{const e={targets:[{type:o}],styles:{node:{[s]:i}}};a.nodes||(a.nodes=[]),a.nodes.push((0,At.cA)(e))}}},themeFileLoaded:function(e,t){var n;const{datum:r,data:o}=t.payload;e.themeByGeneratorName[null!==(n=r.generatorName)&&void 0!==n?n:""]=JSON.parse(o),jo(e,r)},timeIndexSet:function(e,t){const{datum:n,index:r}=t.payload;e.timeByDatumId[n.id]=r},timeIndexToggled:function(e,t){const{datum:n,index:r}=t.payload;e.selectedTimeIndicesByDatumId[n.id]||(e.selectedTimeIndicesByDatumId[n.id]=[]);const o=e.selectedTimeIndicesByDatumId[n.id],s=o.indexOf(r);-1===s?(o.push(r),o.sort(((e,t)=>e-t))):o.length>1&&o.splice(s,1)}},Ao=function(e,t){const{enter:n}=t.payload;n&&n.filter(ft).forEach((t=>{var n,r,o;if((e=>{if(!e.instances||0===e.instances.length)return!1;const t=e.instances[0];return Object.values(t.types).some((e=>"No more instances! Some equivalent instances may have been removed through symmetry breaking."===e.id))})(t.parsed))return void console.log('[graphsExtraReducers] Skipping "no more instances" marker');const s=t.id;e.matricesByDatumId[t.id]={datumId:s,spreadMatrix:(0,pe.yR)(),zoomMatrix:(0,pe.yR)()};const i=null!==(n=t.generatorName)&&void 0!==n?n:"";i in e.themeByGeneratorName||(e.themeByGeneratorName[i]=(0,At.cA)(yo)),e.layoutsByDatumId[s]={datumId:s,layoutById:{}},jo(e,t),e.timeByDatumId[s]=0,i in e.cndSpecByGeneratorName||(e.cndSpecByGeneratorName[i]=null!==(o=null===(r=t.parsed.visualizerConfig)||void 0===r?void 0:r.cnd)&&void 0!==o?o:"directives:\n - flag: hideDisconnectedBuiltIns"),e.hiddenByDatumId[s]={}}))},Co=(0,Ee.oM)({name:"graphs",initialState:{layoutsByDatumId:{},matricesByDatumId:{},themeByGeneratorName:{},timeByDatumId:{},hiddenByDatumId:{},cndSpecByGeneratorName:{},selectedProjectionsByGeneratorName:{},selectedTimeIndicesByDatumId:{}},reducers:So,extraReducers:e=>e.addCase(Be,Ao)}),{asAttributeSet:Mo,cndSpecSet:Io,edgeLabelStyleRemoved:Oo,edgeLabelStyleSet:ko,edgeStyleRemoved:No,edgeStyleSet:Do,edgeIndexSet:zo,edgeIndexRemoved:Eo,curveRemoved:_o,curveSet:Lo,graphSpread:To,graphZoomed:Po,hiddenRelationAdded:Bo,nodeLabelStyleRemoved:Ro,nodeLabelStyleSet:$o,nodeLabelPropRemoved:Vo,nodeLabelPropSet:Fo,nodesOffset:Go,projectionAdded:Zo,projectionAtomToggled:Wo,projectionOrderingSet:Uo,projectionRemoved:qo,projectionSet:Yo,selectedProjectionsSet:Xo,selectedTimeIndicesSet:Ho,shapeRemoved:Jo,saveThemeRequested:Qo,shapeSet:Ko,shapeStyleRemoved:es,shapeStyleSet:ts,themeFileLoaded:ns,timeIndexSet:rs,timeIndexToggled:os}=Co.actions,ss=Co.reducer,is=e=>{const{datum:t}=e,n=jt(),s=St((e=>function(e,t){const n=Ir(0,t),r=Or(e,t).map((e=>e.type)),o=(0,nn.Z)((0,rn.Z)(n),r);return(0,on.Z)(n,o)}(e,t))),i=(0,rn.Z)(s),a=(0,o.useCallback)((e=>{const r=s[e][0];n(Zo({datum:t,type:e,atom:r,time:!0}))}),[t,s]);return 0===i.length?null:(0,r.jsx)(c.M5,Object.assign({my:2},{children:(0,r.jsxs)(ho.v2,{children:[(0,r.jsx)(ho.j2,Object.assign({as:S.zx,colorScheme:"green",size:"xs",leftIcon:(0,r.jsx)(mo.f8n,{})},{children:"Add Time Projection"})),(0,r.jsx)(ho.qy,{children:i.map((e=>(0,r.jsx)(ho.sN,Object.assign({onClick:()=>a(e)},{children:e}),e)))})]})}))};var as=n(11391),ls=n(5434);const cs=e=>{const{type:t,atom:n,atoms:o,onChange:s,onNext:i,onPrevious:a,onRemove:l,onToggle:c}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",Object.assign({className:"text-sm px-2 flex items-center align-middle"},{children:t})),(0,r.jsx)("div",Object.assign({className:"flex items-center"},{children:(0,r.jsx)(as.Ph,Object.assign({className:"flex items-center",size:"xs",value:n,onChange:s},{children:o.map((e=>(0,r.jsx)("option",Object.assign({value:e},{children:e}),e)))}))})),(0,r.jsxs)("div",Object.assign({className:"px-2 flex items-center justify-end"},{children:[(0,r.jsxs)(S.hE,Object.assign({size:"xs",isAttached:!0},{children:[(0,r.jsx)(S.hU,{"aria-label":"Previous",icon:(0,r.jsx)(ls.G1X,{}),onClick:a}),(0,r.jsx)(S.hU,{"aria-label":"Remove",icon:(0,r.jsx)(ls.FU5,{}),onClick:l}),(0,r.jsx)(S.hU,{"aria-label":"Next",icon:(0,r.jsx)(ls.FNi,{}),onClick:i})]})),(0,r.jsx)(ls.G1X,{className:"-rotate-90 ml-2 cursor-pointer hover:text-black",onClick:c})]}))]})},ds=e=>{const{type:t,atom:n,atoms:o,relation:s,relations:i,onChange:a,onNext:l,onPrevious:c,onRelation:d,onRemove:p,onToggle:u,onHiddenRelation:h}=e;return(0,r.jsxs)("div",Object.assign({className:"m-2 p-2 col-span-3 flex flex-col border shadow"},{children:[(0,r.jsxs)("div",Object.assign({className:"flex justify-between pb-3"},{children:[(0,r.jsx)("div",Object.assign({className:"text-sm font-bold"},{children:t})),(0,r.jsx)(ls.G1X,{className:"rotate-90 cursor-pointer hover:text-black",onClick:u})]})),(0,r.jsxs)("div",Object.assign({className:"px-2 grid grid-cols-[minmax(max-content,auto)_minmax(max-content,auto)]"},{children:[(0,r.jsx)(as.Ph,Object.assign({size:"xs",value:n,onChange:a},{children:o.map((e=>(0,r.jsx)("option",Object.assign({value:e},{children:e}),e)))})),(0,r.jsx)("div",Object.assign({className:"mt-0.5 flex items-center justify-end"},{children:(0,r.jsxs)(S.hE,Object.assign({className:"px-2",size:"xs",isAttached:!0},{children:[(0,r.jsx)(S.zx,Object.assign({"aria-label":"Previous",leftIcon:(0,r.jsx)(ls.G1X,{}),onClick:c},{children:"Previous"})),(0,r.jsx)(S.zx,Object.assign({"aria-label":"Next",rightIcon:(0,r.jsx)(ls.FNi,{}),onClick:l},{children:"Next"}))]}))}))]})),(0,r.jsx)("div",Object.assign({className:"px-2 pt-2"},{children:s?(0,r.jsxs)("div",Object.assign({className:"px-2 text-sm flex justify-between items-center"},{children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("span",Object.assign({className:"font-semibold"},{children:s}))," defines total order"]}),(0,r.jsx)(ls.FU5,{onClick:()=>d(void 0)})]})):(0,r.jsxs)(ho.v2,Object.assign({matchWidth:!0},{children:[(0,r.jsx)(ho.j2,Object.assign({as:S.zx,width:"full",size:"xs",py:4},{children:"Select Ordering Relation"})),(0,r.jsx)(ho.qy,{children:i.map((e=>(0,r.jsx)(ho.sN,Object.assign({onClick:()=>d(e)},{children:e}),e)))})]}))})),(0,r.jsx)("div",Object.assign({className:"p-2"},{children:(0,r.jsxs)(ho.v2,Object.assign({matchWidth:!0},{children:[(0,r.jsx)(ho.j2,Object.assign({as:S.zx,width:"full",size:"xs",py:4},{children:"Hide a Relation"})),(0,r.jsx)(ho.qy,{children:i.map((e=>(0,r.jsx)(ho.sN,Object.assign({onClick:()=>h(e)},{children:e}),e)))})]}))})),(0,r.jsx)("div",Object.assign({className:"p-2"},{children:(0,r.jsx)(S.zx,Object.assign({"aria-label":"Remove",width:"full",size:"xs",py:4,colorScheme:"red",leftIcon:(0,r.jsx)(ls.FU5,{}),onClick:p},{children:"Remove Projection"}))}))]}))},ps=e=>{const{datum:t,projection:n,atoms:s,relations:i}=e,{type:a,atom:l,timeOrdering:c}=n,[d,p]=(0,o.useState)(!1),u=jt(),h=(0,o.useCallback)((e=>{const n=e.target.value;u(Yo({datum:t,type:a,atom:n}))}),[t,a]),m=(0,o.useCallback)((()=>{if(l){const e=s.indexOf(l);e>0&&u(Yo({datum:t,type:a,atom:s[e-1]}))}}),[t,a,s,l]),g=(0,o.useCallback)((()=>{u(qo({datum:t,type:a}))}),[t,a]),x=(0,o.useCallback)((()=>{if(l){const e=s.indexOf(l);-1!==e&&e{u(Uo({datum:t,type:a,relation:e}))}),[t,a]),b=(0,o.useCallback)((e=>{u(Bo({datum:t,type:a,relation:e}))}),[t,a]),y=(0,o.useCallback)((()=>{p((e=>!e))}),[p]);return d?(0,r.jsx)(ds,{type:a,atom:l,atoms:s,relation:c,relations:i,onChange:h,onNext:x,onPrevious:m,onRemove:g,onRelation:f,onToggle:y,onHiddenRelation:b}):(0,r.jsx)(cs,{type:a,atom:l,atoms:s,relation:c,relations:i,onChange:h,onNext:x,onPrevious:m,onRemove:g,onRelation:f,onToggle:y,onHiddenRelation:b})},us=({datum:e})=>{const t=St((t=>Ir(0,e))),n=St((t=>Or(t,e))).filter((e=>!0===e.time)),o=St((t=>function(e,t){return ft(t)?at(t.parsed.instances[0]).map((e=>e.name)):[]}(0,e)));return 0===n.length?null:(0,r.jsx)("div",Object.assign({className:"p-2 grid grid-cols-[minmax(min-content,max-content)_minmax(max-content,auto)_minmax(min-content,max-content)] gap-y-2"},{children:n.map((n=>{const s=n.type,i=t[s];return(0,r.jsx)(ps,{datum:e,projection:n,atoms:i,relations:o},s)}))}))},hs=({datum:e})=>St((t=>fr(0,e)))?null:(0,r.jsxs)("div",Object.assign({className:"flex flex-col justify-middle"},{children:[(0,r.jsx)(us,{datum:e}),(0,r.jsx)(is,{datum:e})]}));var ms=n(47516);const gs=e=>{const{collapsed:t,current:n,length:o,onChange:s,label:i,loopBack:a,onToggleCollapse:l}=e;return(0,r.jsx)("div",Object.assign({className:"flex"},{children:(0,r.jsxs)(S.hE,Object.assign({width:"full",isAttached:!0,size:"sm"},{children:[(0,r.jsx)(S.hU,{"aria-label":"First State",icon:(0,r.jsx)(ms.pB9,{}),borderRadius:0,disabled:0===n,onClick:()=>s(0)}),(0,r.jsx)(S.hU,{"aria-label":"Previous State",borderRadius:0,icon:(0,r.jsx)(ms.u_m,{}),disabled:0===n,onClick:()=>s(n-1)}),(0,r.jsx)(c.M5,Object.assign({width:"full",px:2,fontSize:"xs",bg:"gray.100"},{children:i(n)})),void 0!==a&&n===o-1?(0,r.jsx)(S.hU,{"aria-label":"Loop Back",borderRadius:0,icon:(0,r.jsx)(ms.V3h,{}),onClick:()=>s(a)}):(0,r.jsx)(S.hU,{"aria-label":"First State",borderRadius:0,icon:(0,r.jsx)(ms.OEZ,{}),disabled:n===o-1,onClick:()=>s(n+1)}),(0,r.jsx)(S.hU,{"aria-label":"Previous State",icon:(0,r.jsx)(ms.xeH,{}),disabled:n===o-1,onClick:()=>s(o-1)}),(0,r.jsx)(S.hU,{"aria-label":"Toggle Minimap",size:"sm",borderRadius:0,borderLeftWidth:1,borderLeftColor:"gray.300",icon:t?(0,r.jsx)(ms.OrA,{}):(0,r.jsx)(ms.jRD,{}),onClick:()=>l()})]}))}))};function xs(e){const t={};return G(e).forEach((e=>{t[e.id]={type:"line"}})),t}function fs(e){const t={};return G(e).forEach((e=>{t[`${e.id}`]={stroke:"#4A5568",strokeWidth:1,fill:"none"}})),t}function bs(e,t){const n={};return V(e).forEach((e=>{const r=e.id===`${t}`;n[`${e.id}`]=[{text:e.id,style:{fill:r?"white":"#4A5568",fontFamily:"monospace",fontSize:"10px",fontWeight:r?"bold":"normal",textAnchor:"middle",userSelect:"none",cursor:"pointer"},props:{dy:"0.4em"}}]})),n}function ys(e){const t={};return V(e).forEach((e=>{t[`${e.id}`]={shape:"circle",radius:15}})),t}function ws(e,t){const n={};return V(e).forEach((e=>{const r=e.id===`${t}`;n[e.id]={stroke:r?"#3B82F6":"#4A5568",strokeWidth:1,fill:r?"#3B82F6":"white",cursor:"pointer"}})),n}const vs=e=>{const t=function(e){return 50*(e.length-1)+45}(e),n=function(e){return void 0!==e.loopBack?75:45}(e),s=function(e){const{length:t,loopBack:n}=e,r=[],o=[],s=-50*(t-1)/2,i=void 0!==n?7.5:0;for(let e=0;e${e+1}`,source:`${e}`,target:`${e+1}`}):void 0!==n&&o.push({id:`${e}->${n}`,source:`${e}`,target:`${n}`,waypoints:[{x:s+50*e,y:i-30},{x:s+50*n,y:i-30}]});return Ot(r,o)}(e),i=`${-t/2} ${-n/2} ${t} ${n}`,a=(0,o.useRef)(null);return(0,r.jsx)("div",Object.assign({className:"grid place-items-center overflow-y-auto"},{children:(0,r.jsx)(we,Object.assign({svg:a.current,onMouseDown:()=>console.log("down"),onClickNode:t=>{e.onChange&&e.onChange(+t)}},{children:(0,r.jsx)("svg",Object.assign({ref:a,style:{minWidth:t},width:t,height:n,viewBox:i},{children:(0,r.jsx)(De,{id:"minimap",graph:s,nodeShapes:ys(s),nodeStyles:ws(s,e.current),nodeLabels:bs(s,e.current),edgeCurves:xs(s),edgeStyles:fs(s)})}))}))}))},js=e=>{const{collapsed:t}=e;return(0,r.jsxs)("div",Object.assign({className:"border rounded mx-2"},{children:[(0,r.jsx)(gs,Object.assign({},e)),!t&&(0,r.jsx)(vs,Object.assign({},e))]}))},Ss=({datum:e})=>{const t=jt(),[n,s]=(0,o.useState)(!1),[i,a]=(0,o.useState)(!1),l=St((t=>Tr(t,e))),c=St((t=>Pr(0,e))),d=St((t=>function(e,t){if(t&&ft(t)&&qt(t.parsed))return t.parsed.loopBack}(0,e))),p=St((t=>Fr(t,e))),u=(0,o.useCallback)((n=>{t(i?os({datum:e,index:n}):rs({datum:e,index:n}))}),[e,t,i]),h=(0,o.useCallback)((()=>{const n=!i;a(n),t(Ho(n?{datum:e,selectedIndices:[l]}:{datum:e,selectedIndices:[]}))}),[i,t,e,l]),m=(0,o.useCallback)((()=>{const n=Array.from({length:c},((e,t)=>t));t(Ho({datum:e,selectedIndices:n}))}),[t,e,c]),g=(0,o.useCallback)((()=>{t(Ho({datum:e,selectedIndices:c>1?[0,c-1]:[0]}))}),[t,e,c]);return(0,r.jsxs)("div",Object.assign({className:"mx-1 my-2"},{children:[c>1&&(0,r.jsxs)("div",Object.assign({className:"mb-2 flex items-center justify-between"},{children:[(0,r.jsx)("button",Object.assign({type:"button",onClick:h,className:`\n px-2 py-1 text-xs rounded-md transition-all font-medium\n ${i?"bg-blue-600 text-white shadow-sm":"bg-gray-100 text-gray-700 hover:bg-gray-200 border border-gray-200"}\n `},{children:i?"✓ Compare Mode":"Compare States"})),i&&(0,r.jsxs)("div",Object.assign({className:"flex gap-1"},{children:[(0,r.jsx)("button",Object.assign({type:"button",onClick:g,className:"px-2 py-1 text-xs rounded-md bg-gray-100 text-gray-700 hover:bg-gray-200 border border-gray-200"},{children:"First & Last"})),(0,r.jsx)("button",Object.assign({type:"button",onClick:m,className:"px-2 py-1 text-xs rounded-md bg-gray-100 text-gray-700 hover:bg-gray-200 border border-gray-200"},{children:"All"}))]}))]})),i&&(0,r.jsxs)("div",Object.assign({className:"mb-2"},{children:[(0,r.jsx)("p",Object.assign({className:"text-xs text-gray-500 mb-1.5"},{children:"Click states to compare side-by-side:"})),(0,r.jsx)("div",Object.assign({className:"flex flex-wrap gap-1"},{children:Array.from({length:c},((n,o)=>{const s=p.includes(o);return(0,r.jsx)("button",Object.assign({type:"button",onClick:()=>t(os({datum:e,index:o})),className:`\n w-8 h-8 text-xs rounded-md transition-all font-medium\n ${s?"bg-blue-600 text-white shadow-sm":"bg-gray-100 text-gray-700 hover:bg-gray-200 border border-gray-200"}\n `},{children:o+1}),o)}))})),p.length>1&&(0,r.jsxs)("p",Object.assign({className:"text-xs text-blue-600 mt-1.5 font-medium"},{children:["✓ ",p.length," states selected — showing side-by-side comparison"]}))]})),(0,r.jsx)(js,{collapsed:n,current:l,length:c,loopBack:d,label:e=>`State ${e+1}/${c}`,onChange:u,onToggleCollapse:()=>s((e=>!e))})]}))},As=({datum:e})=>St((t=>fr(0,e)))?(0,r.jsx)("div",Object.assign({className:"flex flex-col justify-middle"},{children:(0,r.jsx)(Ss,{datum:e})})):null,Cs=()=>{const e=St(hr);return e?(0,r.jsxs)("div",Object.assign({className:"absolute inset-0 flex flex-col overflow-y-auto"},{children:[(0,r.jsx)(hs,{datum:e}),(0,r.jsx)(As,{datum:e})]})):null},Ms=()=>(0,r.jsxs)("div",Object.assign({className:"flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(to.JO,{as:uo.rHK}),(0,r.jsx)(k,{children:"Time"})]}));var Is=n(47398);const Os={activeDatumSet:function(e,t){e.active=t.payload},dumpClicked:function(e){console.log((0,At.Vk)(e))}};var ks=n(3231),Ns=n(54354),Ds=n(20924);const zs=function(e,t){const{enter:n,update:r,exit:o}=t.payload;if(n){(0,ks.Z)(n,(t=>{const n=t.id;e.datumById[n]||(e.datumById[n]=t,e.datumIds.push(n))}));const t=(0,zt.Z)(n);t&&(e.active=t.id)}r&&(0,Ft.Z)(r,(t=>{const n=t.id;e.datumById[n]&&(0,Ns.Z)(e.datumById[n],t)})),o&&(0,Ft.Z)(o,(t=>{if(e.datumById[t]){delete e.datumById[t];const n=(0,Ds.Z)(e.datumIds,t);n>-1&&e.datumIds.splice(n,1),e.active===t&&(e.active=e.datumIds.length?e.datumIds[0]:null)}}))},Es=(0,Ee.oM)({name:"data",initialState:{active:null,datumById:{},datumIds:[]},reducers:Os,extraReducers:e=>e.addCase(Be,zs)}),{activeDatumSet:_s,dumpClicked:Ls}=Es.actions,Ts=Es.reducer;var Ps=n(2585),Bs=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{const{className:t,onClick:n}=e,o=Bs(e,["className","onClick"]);return(0,r.jsx)("div",Object.assign({className:`contents ${n?"group":""} ${t||""}`,onClick:n},o))},$s=e=>{const{className:t}=e,n=Bs(e,["className"]);return(0,r.jsx)("div",Object.assign({className:`\n flex items-center prose prose-sm truncate px-1 py-0.5 first:pl-2 last:pr-2 group-hover:bg-blue-600 group-active:bg-blue-700 group-hover:text-white select-none cursor-default group-hover:cursor-pointer ${t||""}`},n))},Vs=e=>{var t;const{datum:n,active:o,onClickItem:s}=e,i=St((e=>function(e,t){return fr(0,t)}(0,n))),a=St((e=>function(e,t){return(Or(e,t)||[]).some((e=>!0===e.time))}(e,n))),l=o?"text-white bg-blue-600":"";return(0,r.jsxs)(Rs,Object.assign({onClick:e=>s(e,n)},{children:[(0,r.jsxs)($s,Object.assign({className:l},{children:["Instance ",n.id," (from: '",null!==(t=n.generatorName)&&void 0!==t?t:"UNNAMED","')"]})),(0,r.jsx)($s,Object.assign({className:l},{children:n.evaluator&&(0,r.jsx)(to.JO,{as:no.RJr})})),(0,r.jsxs)($s,Object.assign({className:l},{children:[i&&(0,r.jsx)(to.JO,{as:uo.rHK}),a&&(0,r.jsx)(to.JO,{as:Ps.sYI})]}))]}))},Fs=e=>{const{data:t,active:n}=e,s=jt(),i=(0,o.useCallback)(((e,t)=>{s(_s(t.id))}),[]);return(0,r.jsx)("div",Object.assign({className:"w-full grid grid-cols-[minmax(max-content,auto)_repeat(2,min-content)]"},{children:t.map((e=>{const{id:t}=e;return(0,r.jsx)(Vs,{datum:e,active:e===n,onClickItem:i},t)}))}))},Gs=function(e,t){const n=t.payload;n.views&&(e.availableViews=n.views.map((e=>{switch(e){case"graph":return"GraphView";case"table":return"TableView";case"script":return"ScriptView"}})),e.mainView=e.availableViews[0],n.generators&&n.generators.length>0&&(e.selectedGenerator=n.generators[0]))},Zs={availableViews:["GraphView","TableView","ScriptView"],mainView:"ScriptView",graphViewDrawer:"explorer",tableViewDrawer:null,scriptViewDrawer:"variables",selectedGenerator:void 0};const Ws=(0,Ee.oM)({name:"ui",initialState:Zs,reducers:{mainViewChanged:function(e,t){e.mainView=t.payload},commonDrawerViewChanged:function(e,t){const n=t.payload;switch(e.mainView){case"GraphView":e.graphViewDrawer=n===e.graphViewDrawer?null:n;break;case"TableView":e.tableViewDrawer=n===e.tableViewDrawer?null:n;break;case"ScriptView":e.scriptViewDrawer=n===e.scriptViewDrawer?null:n}},graphDrawerViewChanged:function(e,t){const n=t.payload;e.graphViewDrawer=n===e.graphViewDrawer?null:n},tableDrawerViewChanged:function(e,t){const n=t.payload;e.tableViewDrawer=n===e.tableViewDrawer?null:n},scriptDrawerViewChanged:function(e,t){const n=t.payload;e.scriptViewDrawer=n===e.scriptViewDrawer?null:n},selectedGeneratorChanged:function(e,t){const n=t.payload;e.selectedGenerator=n.generatorName}},extraReducers:e=>{e.addCase($e,Gs)}}),{mainViewChanged:Us,commonDrawerViewChanged:qs,graphDrawerViewChanged:Ys,tableDrawerViewChanged:Xs,scriptDrawerViewChanged:Hs,selectedGeneratorChanged:Js}=Ws.actions,Qs=Ws.reducer,Ks=()=>{const e=St(hr),t=St(xr),n=St(Nr),s=jt(),i=St(mr);if(!e&&(!n||n.length<1))return null;const a=!t.some((e=>e.generatorName==i)),l=(0,o.useCallback)((()=>{void 0!==i&&a&&(console.log(`Running new generator: ${i}`),s(_e({id:void 0,onClick:"next",context:{generatorName:i}})))}),[i,t]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(c.xu,Object.assign({p:1,shadow:"md",borderWidth:"1px"},{children:[(0,r.jsx)(c.X6,Object.assign({fontSize:"sm",align:"center",fontWeight:"medium"},{children:"Select an Available Command"})),(0,r.jsxs)(c.kC,{children:[(0,r.jsx)(as.Ph,Object.assign({isDisabled:!n||n.length<1,value:i,onChange:e=>{const n=e.target.value,r=t.filter((e=>e.generatorName==n)).reverse()[0];console.log(`Selecting generator: ${n}. Latest id: ${null==r?void 0:r.id}`),s(Js({generatorName:n})),s(_s(r?r.id:""))}},{children:null==n?void 0:n.map(((e,t)=>(0,r.jsx)("option",{children:e},t)))})),(0,r.jsx)(S.zx,Object.assign({size:"sm",margin:"1",onClick:l,isDisabled:!n||n.length<1||i&&(null==e?void 0:e.generatorName)===i||!a},{children:(0,r.jsx)(Is.u,Object.assign({hasArrow:!0,label:"Re-run Forge to refresh this command.",isDisabled:a},{children:"Run"}))}))]})]})),(0,r.jsx)(c.xu,Object.assign({p:1,shadow:"md",borderWidth:"1px"},{children:(0,r.jsxs)(c.X6,Object.assign({fontSize:"xs",align:"center",fontWeight:"normal"},{children:["Instance History for ",(0,r.jsx)("i",{children:i})]}))})),(0,r.jsx)("hr",{}),(0,r.jsx)("div",Object.assign({"aria-label":"explorer pane instance selector",className:"absolute flex flex-col overflow-y-auto"},{children:(0,r.jsx)(Fs,{data:t.filter((e=>e.generatorName==i)),active:e})}))]})},ei=()=>(0,r.jsxs)("div",Object.assign({className:"flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(to.JO,{as:uo.rHK}),(0,r.jsx)(k,{children:"Explorer"})]}));var ti=n(79352);const ni=()=>{const e=jt(),t=St(hr),n=(0,o.useRef)(null),s=(0,o.useRef)(null),[i,a]=(0,o.useState)(!1),[l,c]=(0,o.useState)(!1),[d,p]=(0,o.useState)([]),u=St((e=>t?$r(e,t):void 0)),h=u||"",m=St((e=>t?Vr(e,t):{}));if("undefined"!=typeof window){const e=window.updateProjectionData;if(!e||!e.__isMultiSelectHandler){const e=e=>{console.log("GraphLayoutDrawer received RAW projection data:",JSON.stringify(e,null,2));const t=e.map((e=>{const t=e.type||e.typeName||e.name||e.typeId||"",n=t,r=(e.atoms||[]).map((e=>"string"==typeof e?{id:e,label:e}:{id:e.id||e.atomId||e.name||e.label||"",label:e.label||e.name||e.id||e.atomId||""}));return console.log(`Normalized type: ${t}, atoms:`,r),{typeId:n,typeName:t,atoms:r}}));window.__lastProjectionData=t,window.dispatchEvent(new CustomEvent("projectionDataUpdated",{detail:t}))};e.__isMultiSelectHandler=!0,window.updateProjectionData=e}}(0,o.useEffect)((()=>{const n=n=>{const r=n.detail;p(r),t&&r.length>0&&r.forEach((n=>{0===(m[n.typeId]||[]).length&&n.atoms.length>0&&(e(Xo({datum:t,projectionType:n.typeId,selectedAtoms:[n.atoms[0].id]})),window.currentProjections||(window.currentProjections={}),window.currentProjections[n.typeId]=n.atoms[0].id)}))};window.addEventListener("projectionDataUpdated",n);const r=window.__lastProjectionData;return r&&r.length>0&&n({detail:r}),()=>{window.removeEventListener("projectionDataUpdated",n)}}),[t,m,e]),(0,o.useEffect)((()=>{p([]),window.currentProjections&&(window.currentProjections={})}),[t]),(0,o.useEffect)((()=>{if(!document.getElementById("spytial-bootstrap-stylesheet")){const e=document.createElement("link");e.id="spytial-bootstrap-stylesheet",e.rel="stylesheet",e.href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css",e.integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM",e.crossOrigin="anonymous",document.head.appendChild(e)}}),[]),(0,o.useEffect)((()=>{if(s.current&&window.mountErrorMessageModal&&!l)try{window.mountErrorMessageModal("layout-error-mount"),c(!0)}catch(e){console.error("Failed to mount SpyTial Error Modal:",e)}}),[l]);const g=(0,o.useCallback)(((n,r)=>{var o;if(!t)return;e(Wo({datum:t,projectionType:n,atomId:r}));const s=m[n]||[],i=s.includes(r)?s.filter((e=>e!==r)):[...s,r];window.currentProjections||(window.currentProjections={}),window.currentProjections[n]=i[0]||"";const a=(null===(o=window.getCurrentCNDSpecFromReact)||void 0===o?void 0:o.call(window))||h;e(Io({datum:t,spec:a}))}),[t,e,m,h]),x=(0,o.useCallback)(((n,r)=>{var o;if(!t)return;const s=(m[n]||[]).length===r.length?[r[0].id]:r.map((e=>e.id));e(Xo({datum:t,projectionType:n,selectedAtoms:s})),window.currentProjections||(window.currentProjections={}),window.currentProjections[n]=s[0]||"";const i=(null===(o=window.getCurrentCNDSpecFromReact)||void 0===o?void 0:o.call(window))||h;e(Io({datum:t,spec:i}))}),[t,e,m,h]);return(0,o.useEffect)((()=>{var e;if(n.current&&!i&&t){const t="directives:\n - flag: hideDisconnectedBuiltIns",n={initialYamlValue:u&&""!==u?u:t,initialDirectives:u&&""!==u?void 0:[{flag:"hideDisconnectedBuiltIns"}]};try{(null===(e=window.CndCore)||void 0===e?void 0:e.mountCndLayoutInterface)?(window.CndCore.mountCndLayoutInterface("cnd-editor-mount",n),a(!0)):window.mountCndLayoutInterface&&(window.mountCndLayoutInterface("cnd-editor-mount",n),a(!0))}catch(e){console.error("Failed to mount CnD Layout Interface:",e)}}}),[i,t,u]),t?(0,r.jsxs)("div",Object.assign({className:"absolute inset-0 flex flex-col overflow-y-auto bg-slate-50/90 text-slate-900"},{children:[(0,r.jsx)("div",{id:"layout-error-mount",ref:s,className:"flex-shrink-0","aria-live":"polite"}),(0,r.jsxs)("div",Object.assign({className:"flex-1 space-y-3 p-3"},{children:[d.length>0&&(0,r.jsxs)("div",Object.assign({className:"rounded-lg border border-slate-200 bg-white p-3 shadow-sm"},{children:[(0,r.jsxs)("div",Object.assign({className:"flex items-center justify-between mb-2"},{children:[(0,r.jsx)("span",Object.assign({className:"text-sm font-semibold text-gray-800"},{children:"Projections"})),(0,r.jsx)("span",Object.assign({className:"text-xs text-indigo-600 bg-indigo-50 px-2 py-0.5 rounded"},{children:"Multi-select"}))]})),(0,r.jsx)("p",Object.assign({className:"text-xs text-gray-500 mb-3"},{children:"Click atoms to toggle. Multiple selections show separate graphs."})),d.map((e=>{const t=m[e.typeId]||[],n=t.length===e.atoms.length;return(0,r.jsxs)("div",Object.assign({className:"mb-3 last:mb-0"},{children:[(0,r.jsxs)("div",Object.assign({className:"flex items-center justify-between mb-1.5"},{children:[(0,r.jsx)("label",Object.assign({className:"text-xs font-medium text-gray-700"},{children:e.typeName})),(0,r.jsx)("button",Object.assign({type:"button",onClick:()=>x(e.typeId,e.atoms),className:"text-xs text-indigo-600 hover:text-indigo-800"},{children:n?"Select one":"Select all"}))]})),(0,r.jsx)("div",Object.assign({className:"flex flex-wrap gap-1.5"},{children:e.atoms.map((n=>{const o=t.includes(n.id);return(0,r.jsx)("button",Object.assign({type:"button",onClick:()=>g(e.typeId,n.id),className:`\n px-2.5 py-1 text-xs rounded-md transition-all font-medium\n ${o?"bg-indigo-600 text-white shadow-sm":"bg-gray-100 text-gray-700 hover:bg-gray-200 border border-gray-200"}\n `},{children:n.label}),n.id)}))})),t.length>1&&(0,r.jsxs)("p",Object.assign({className:"text-xs text-indigo-600 mt-1.5 font-medium"},{children:["✓ ",t.length," selected — showing ",t.length," graphs"]}))]}),e.typeId)}))]})),(0,r.jsxs)("div",Object.assign({className:"flex gap-2"},{children:[(0,r.jsx)("button",Object.assign({type:"button",onClick:n=>{var r;if(n.preventDefault(),!t)return;window.clearAllErrors&&window.clearAllErrors();const o=(null===(r=window.getCurrentCNDSpecFromReact)||void 0===r?void 0:r.call(window))||"";e(Io({datum:t,spec:o}))},className:"flex-1 rounded-lg bg-indigo-600 px-4 py-2.5 text-sm font-medium text-white shadow-sm transition hover:bg-indigo-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-indigo-500 focus-visible:ring-offset-2"},{children:"Apply Layout"})),(0,r.jsxs)("label",Object.assign({className:"group relative flex-1 cursor-pointer"},{children:[(0,r.jsxs)("div",Object.assign({className:"flex items-center justify-center gap-2 rounded-lg border-2 border-dashed border-slate-300 bg-white px-4 py-2.5 text-sm font-medium text-slate-600 transition hover:border-indigo-400 hover:text-indigo-600"},{children:[(0,r.jsx)("svg",Object.assign({className:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},{children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})})),"Upload .cnd"]})),(0,r.jsx)("input",{type:"file",accept:".cnd",onChange:n=>{var r;if(!t)return;const o=null===(r=n.target.files)||void 0===r?void 0:r[0];if(o){const n=new FileReader;n.onload=n=>{var r;const o=null===(r=n.target)||void 0===r?void 0:r.result;e(Io({datum:t,spec:o}))},n.readAsText(o)}},className:"absolute inset-0 h-full w-full cursor-pointer opacity-0"})]}))]})),(0,r.jsx)("div",Object.assign({className:"rounded-lg border border-slate-200 bg-white shadow-sm p-3"},{children:(0,r.jsx)("div",{id:"cnd-editor-mount",ref:n,className:"min-h-[360px] overflow-hidden rounded-lg border border-slate-200 bg-slate-50"})}))]}))]})):null},ri=()=>(0,r.jsxs)("div",Object.assign({className:"w-full flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(to.JO,{as:ti.vWf}),(0,r.jsx)(k,{children:"Layout"})]})),oi=(0,Ee.oM)({name:"synthesis",initialState:{isActive:!1,selectorType:"unary",numInstances:3,currentStep:0,examples:[],draftSelection:{atomIds:[],pairs:[]},loadedInstances:[],currentDataInstance:null,result:null,error:null,isLoading:!1},reducers:{enterSynthesisMode:function(e,t){e.isActive=!0,e.selectorType=t.payload.selectorType,e.numInstances=t.payload.numInstances,e.currentStep=0,e.examples=[],e.loadedInstances=[],e.result=null,e.error=null,e.isLoading=!0},exitSynthesisMode:function(e){e.isActive=!1,e.currentStep=0,e.examples=[],e.loadedInstances=[],e.result=null,e.error=null,e.isLoading=!1},synthesisInstancesLoaded:function(e,t){e.loadedInstances=t.payload.instances,e.isLoading=!1,0===e.currentStep&&(e.currentStep=1)},synthesisLoadError:function(e,t){e.error=t.payload.error,e.isLoading=!1},synthesisOutOfInstances:function(e){e.isLoading=!1,e.error="No more instances available. Forge has exhausted all satisfying instances. Consider using fewer examples for synthesis."},addSynthesisExample:function(e,t){e.examples.push(t.payload),e.currentStep<=e.numInstances&&e.currentStep++},updateSynthesisExample:function(e,t){const{instanceIndex:n,selectedAtomIds:r,selectedPairs:o}=t.payload,s=e.examples.findIndex((e=>e.instanceIndex===n));s>=0&&(void 0!==r&&(e.examples[s].selectedAtomIds=r),void 0!==o&&(e.examples[s].selectedPairs=o))},synthesisStepBack:function(e){e.currentStep>1&&(e.currentStep--,e.examples.length>=e.currentStep&&e.examples.pop())},setSynthesisResult:function(e,t){e.result=t.payload,e.error=null,e.isLoading=!1},setSynthesisError:function(e,t){e.error=t.payload.error,e.result=null,e.isLoading=!1},startSynthesis:function(e){e.isLoading=!0,e.error=null},updateDraftSelection:function(e,t){void 0!==t.payload.atomIds&&(e.draftSelection.atomIds=t.payload.atomIds),void 0!==t.payload.pairs&&(e.draftSelection.pairs=t.payload.pairs)},commitDraftSelection:function(e,t){const{instanceIndex:n,dataInstance:r,atomIds:o=[],pairs:s=[]}=t.payload,i=e.examples.findIndex((e=>e.instanceIndex===n));i>=0?(e.examples[i].selectedAtomIds=o,e.examples[i].selectedPairs=s,e.examples[i].dataInstance=r):e.examples.push({instanceIndex:n,selectedAtomIds:[...o],selectedPairs:[...s],dataInstance:r}),e.draftSelection={atomIds:[],pairs:[]},e.currentStep<=e.numInstances&&e.currentStep++},setCurrentDataInstance:function(e,t){e.currentDataInstance=t.payload.dataInstance}}}),{enterSynthesisMode:si,exitSynthesisMode:ii,synthesisInstancesLoaded:ai,synthesisLoadError:li,synthesisOutOfInstances:ci,addSynthesisExample:di,updateSynthesisExample:pi,synthesisStepBack:ui,setSynthesisResult:hi,setSynthesisError:mi,startSynthesis:gi,updateDraftSelection:xi,commitDraftSelection:fi,setCurrentDataInstance:bi}=oi.actions,yi=oi.reducer;var wi=n(38152),vi=n(79762),ji=n(9680),Si=n(72773);const Ai=()=>{const e=jt(),t=St(hr),[n,s]=(0,o.useState)(3),[i,a]=(0,o.useState)("unary"),[l,d]=(0,o.useState)(!1);return(0,r.jsx)("div",Object.assign({className:"p-8 max-w-2xl mx-auto"},{children:(0,r.jsxs)(c.gC,Object.assign({spacing:6,align:"stretch"},{children:[(0,r.jsx)("div",{children:(0,r.jsx)(c.xv,Object.assign({fontSize:"2xl",fontWeight:"bold",mb:2},{children:"Selector Synthesis"}))}),(0,r.jsxs)(vi.NI,{children:[(0,r.jsx)(vi.lX,{children:"Selector Type"}),(0,r.jsx)(ji.Ee,Object.assign({value:i,onChange:e=>a(e)},{children:(0,r.jsxs)(c.Kq,Object.assign({direction:"column",spacing:3},{children:[(0,r.jsx)(ji.Y8,Object.assign({value:"unary"},{children:(0,r.jsx)(c.xv,Object.assign({fontWeight:"semibold"},{children:"Unary Selector (Atoms)"}))})),(0,r.jsx)(ji.Y8,Object.assign({value:"binary"},{children:(0,r.jsx)(c.xv,Object.assign({fontWeight:"semibold"},{children:"Binary Selector (Pairs/Relations)"}))}))]}))}))]}),(0,r.jsxs)(vi.NI,{children:[(0,r.jsx)(vi.lX,{children:"Number of Instances"}),(0,r.jsxs)(Si.Y2,Object.assign({value:n,onChange:(e,t)=>s(t),min:1,max:10,step:1},{children:[(0,r.jsx)(Si.zu,{}),(0,r.jsxs)(Si.Fi,{children:[(0,r.jsx)(Si.WQ,{}),(0,r.jsx)(Si.Y_,{})]})]}))]}),(0,r.jsx)(S.zx,Object.assign({colorScheme:"blue",size:"lg",onClick:()=>{return r=void 0,o=void 0,a=function*(){if(t&&window.CndCore){d(!0),e(si({numInstances:n,selectorType:i}));try{const n=t.data,r=window.CndCore.AlloyInstance.parseAlloyXML(n);if(!r.instances||0===r.instances.length)throw new Error("No instances found in Alloy XML");const o=new window.CndCore.AlloyDataInstance(r.instances[0]);if(function(e){var t;try{return((null===(t=e.getTypes)||void 0===t?void 0:t.call(e))||[]).some((e=>{var t;return"No more instances! Some equivalent instances may have been removed through symmetry breaking."===(e.id||(null===(t=e.getId)||void 0===t?void 0:t.call(e))||"")}))}catch(e){return!1}}(o))throw new Error("No instances available. The current result indicates all instances have been exhausted.");console.log("[SynthesisSetup] Starting with first instance"),e(ai({instances:[o]}))}catch(t){e(li({error:t.message})),d(!1)}}},new((s=void 0)||(s=Promise))((function(e,t){function n(e){try{l(a.next(e))}catch(e){t(e)}}function i(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):(r=t.value,r instanceof s?r:new s((function(e){e(r)}))).then(n,i)}l((a=a.apply(r,o||[])).next())}));var r,o,s,a},isLoading:l,loadingText:"Loading instances...",w:"full"},{children:"Start Synthesis"}))]}))}))};var Ci=n(4612);const Mi=()=>{const e=jt(),t=St(Ur),n=St(Yr),s=St(Xr),i=St(qr),a=St(hr),l=St(eo),[d,p]=(0,o.useState)(""),[u,h]=(0,o.useState)([]),m=t-1,g=s[m],x=n.find((e=>e.instanceIndex===m));return(0,o.useEffect)((()=>{if(x)h(x.selectedAtomIds),p(x.selectedAtomIds.join(", "));else{h([]),p("");const e=document.querySelector("webcola-cnd-graph");e&&e.clearNodeHighlights&&e.clearNodeHighlights()}}),[m,x]),(0,o.useEffect)((()=>{const e=d.split(",").map((e=>e.trim())).filter((e=>e.length>0));h(e)}),[d]),g?(0,r.jsxs)("div",Object.assign({className:"flex flex-col h-full"},{children:[(0,r.jsxs)("div",Object.assign({className:"p-4 bg-blue-50 border-b border-blue-200"},{children:[(0,r.jsxs)(c.xv,Object.assign({fontSize:"sm",fontWeight:"semibold",mb:1,color:"blue.900"},{children:["Instance ",m+1," of ",i]})),(0,r.jsx)(c.xv,Object.assign({fontSize:"xs",color:"blue.700"},{children:"Enter atom IDs (comma-separated) that should match your selector. Atoms will be highlighted in the graph in real-time."}))]})),(0,r.jsx)("div",Object.assign({className:"p-4 space-y-4"},{children:(0,r.jsxs)("div",{children:[(0,r.jsx)("label",Object.assign({className:"block text-sm font-medium text-gray-700 mb-2"},{children:"Atom IDs (comma-separated)"})),(0,r.jsx)(Ci.II,{value:d,onChange:e=>p(e.target.value),onBlur:()=>{const e=document.querySelector("webcola-cnd-graph");if(e){if(e.clearNodeHighlights&&e.clearNodeHighlights(),u.length>0&&e.highlightNodes){const t=e.highlightNodes(u);console.log("[SynthesisExample] Highlighted nodes:",u,"success:",t)}}else console.warn("[SynthesisExample] Graph element not found")},size:"lg",fontFamily:"monospace"})]})})),(0,r.jsx)("div",{className:"flex-1"}),(0,r.jsx)("div",Object.assign({className:"p-4 border-t bg-gray-50"},{children:(0,r.jsx)(S.zx,Object.assign({w:"full",colorScheme:"blue",size:"lg",onClick:()=>{l?(console.log("[SynthesisExample] Committing selection:",{instanceIndex:m,atomIds:u}),e(fi({instanceIndex:m,dataInstance:l,atomIds:u})),t{const e=jt(),t=St(Ur),n=St(Yr),s=St(Xr),i=St(qr),a=St(hr),l=St(eo),[d,p]=(0,o.useState)(""),[u,h]=(0,o.useState)([]),[m,g]=(0,o.useState)(null),x=t-1,f=s[x],b=n.find((e=>e.instanceIndex===x));return(0,o.useEffect)((()=>{if(b){h(b.selectedPairs);const e=b.selectedPairs.map((([e,t])=>`${e}:${t}`)).join(", ");p(e)}else{h([]),p("");const e=document.querySelector("webcola-cnd-graph");e&&e.clearNodeHighlights&&e.clearNodeHighlights()}}),[x,b]),(0,o.useEffect)((()=>{if(g(null),""===d.trim())return void h([]);const e=d.split(",").map((e=>e.trim())).filter((e=>e)),t=[];for(const n of e){const e=n.split(":");if(2!==e.length)return void g(`Invalid pair format: "${n}". Use format: First:Second`);const[r,o]=e.map((e=>e.trim()));if(!r||!o)return void g(`Empty node ID in pair: "${n}"`);t.push([r,o])}h(t)}),[d]),f?(0,r.jsxs)("div",Object.assign({className:"flex flex-col h-full"},{children:[(0,r.jsxs)("div",Object.assign({className:"p-4 bg-purple-50 border-b border-purple-200"},{children:[(0,r.jsxs)(c.xv,Object.assign({fontSize:"sm",fontWeight:"semibold",mb:1,color:"purple.900"},{children:["Instance ",x+1," of ",i," - Binary Selector"]})),(0,r.jsxs)(c.xv,Object.assign({fontSize:"xs",color:"purple.700"},{children:["Enter pairs of atom IDs (format: First:Second) separated by commas.",(0,r.jsx)("br",{}),"Pairs will be highlighted with arrows in the graph."]}))]})),(0,r.jsx)("div",Object.assign({className:"p-4 space-y-4"},{children:(0,r.jsxs)("div",{children:[(0,r.jsx)("label",Object.assign({className:"block text-sm font-medium text-gray-700 mb-2"},{children:"Node Pairs (format: First:Second, comma-separated)"})),(0,r.jsx)(Ci.II,{value:d,onChange:e=>p(e.target.value),onBlur:()=>{const e=document.querySelector("webcola-cnd-graph");if(e){if(e.clearNodeHighlights&&e.clearNodeHighlights(),u.length>0&&!m&&e.highlightNodePairs){const t=e.highlightNodePairs(u,{showBadges:!0});console.log("[BinaryExample] Highlighted pairs:",u,"success:",t)}}else console.warn("[BinaryExample] Graph element not found")},size:"lg",fontFamily:"monospace",isInvalid:null!==m}),m&&(0,r.jsx)(c.xv,Object.assign({fontSize:"xs",color:"red.600",mt:1},{children:m}))]})})),(0,r.jsx)("div",{className:"flex-1"}),(0,r.jsx)("div",Object.assign({className:"p-4 border-t bg-gray-50"},{children:(0,r.jsx)(S.zx,Object.assign({w:"full",colorScheme:"purple",size:"lg",onClick:()=>{l?(console.log("[BinaryExample] Committing selection:",{instanceIndex:x,pairs:u}),e(fi({instanceIndex:x,dataInstance:l,pairs:u})),t{const e=jt(),t=St(hr),n=St(Hr),o=St(Wr),s=St(Yr),i=St((e=>t?$r(e,t):""));if(!n||!t)return(0,r.jsx)("div",Object.assign({className:"p-8 text-center"},{children:(0,r.jsx)(c.xv,Object.assign({color:"gray.500"},{children:"No synthesis result available"}))}));const a="unary"===o,l=a?n.matchesByInstance:n.pairMatchesByInstance;return(0,r.jsx)("div",Object.assign({className:"p-6 max-w-4xl mx-auto"},{children:(0,r.jsxs)(c.gC,Object.assign({spacing:6,align:"stretch"},{children:[(0,r.jsxs)(c.xu,Object.assign({borderWidth:2,borderColor:"green.500",rounded:"lg",p:4,bg:"green.50"},{children:[(0,r.jsxs)(c.xv,Object.assign({fontSize:"sm",fontWeight:"semibold",color:"green.700",mb:2},{children:["Synthesized ",a?"Unary":"Binary"," Selector"]})),(0,r.jsx)(c.EK,Object.assign({p:3,rounded:"md",fontSize:"lg",fontWeight:"bold",display:"block",bg:"white"},{children:n.expression}))]})),(0,r.jsxs)(c.xu,{children:[(0,r.jsx)(c.xv,Object.assign({fontSize:"lg",fontWeight:"semibold",mb:3},{children:"Matches Across Instances"})),(0,r.jsx)(Oi.UQ,Object.assign({allowMultiple:!0},{children:l.map(((e,t)=>{const n=s[t];let o=!1;if(a){const t=e;o=n&&n.selectedAtomIds.every((e=>t.matchedAtomIds.includes(e)))&&n.selectedAtomIds.length===t.matchedAtomIds.length}else{const t=e,r=(null==n?void 0:n.selectedPairs)||[];o=r.every((([e,n])=>t.matchedPairs.some((([t,r])=>t===e&&r===n||t===n&&r===e))))&&r.length===t.matchedPairs.length}const i=a?e.matchedAtomIds.length:e.matchedPairs.length;return(0,r.jsxs)(Oi.Qd,{children:[(0,r.jsx)("h2",{children:(0,r.jsxs)(Oi.KF,{children:[(0,r.jsx)(c.xu,Object.assign({flex:"1",textAlign:"left"},{children:(0,r.jsxs)(c.Ug,{children:[(0,r.jsxs)(c.xv,Object.assign({fontWeight:"semibold"},{children:["Instance ",e.instanceIndex+1]})),(0,r.jsxs)(c.Ct,Object.assign({colorScheme:o?"green":"yellow"},{children:[i," matches"]})),o?(0,r.jsxs)(c.Ct,Object.assign({colorScheme:"green"},{children:[(0,r.jsx)(ls.HhX,{})," Exact"]})):(0,r.jsx)(c.Ct,Object.assign({colorScheme:"yellow"},{children:"Partial"}))]})})),(0,r.jsx)(Oi.XE,{})]})}),(0,r.jsx)(Oi.Hk,Object.assign({pb:4},{children:a?(0,r.jsxs)(c.gC,Object.assign({align:"stretch",spacing:2},{children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(c.xv,Object.assign({fontSize:"sm",fontWeight:"semibold",mb:1},{children:"You selected:"})),(0,r.jsx)("div",Object.assign({className:"flex flex-wrap gap-1"},{children:null==n?void 0:n.selectedAtomIds.map((e=>(0,r.jsx)(c.Ct,Object.assign({colorScheme:"blue"},{children:e}),e)))}))]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(c.xv,Object.assign({fontSize:"sm",fontWeight:"semibold",mb:1},{children:"Selector matches:"})),(0,r.jsx)("div",Object.assign({className:"flex flex-wrap gap-1"},{children:e.matchedAtomIds.map((e=>(0,r.jsxs)(c.Ct,Object.assign({colorScheme:(null==n?void 0:n.selectedAtomIds.includes(e))?"green":"orange"},{children:[e,!(null==n?void 0:n.selectedAtomIds.includes(e))&&" (extra)"]}),e)))}))]})]})):(0,r.jsxs)(c.gC,Object.assign({align:"stretch",spacing:2},{children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(c.xv,Object.assign({fontSize:"sm",fontWeight:"semibold",mb:1},{children:"You selected:"})),(0,r.jsx)(c.gC,Object.assign({align:"stretch",spacing:1},{children:null==n?void 0:n.selectedPairs.map((([e,t],n)=>(0,r.jsxs)(c.Ug,{children:[(0,r.jsx)(c.Ct,Object.assign({colorScheme:"blue"},{children:e})),(0,r.jsx)(ls.hdK,{}),(0,r.jsx)(c.Ct,Object.assign({colorScheme:"blue"},{children:t}))]},n)))}))]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(c.xv,Object.assign({fontSize:"sm",fontWeight:"semibold",mb:1},{children:"Selector matches:"})),(0,r.jsx)(c.gC,Object.assign({align:"stretch",spacing:1},{children:e.matchedPairs.map((([e,t],o)=>{const s=null==n?void 0:n.selectedPairs.some((([n,r])=>n===e&&r===t||n===t&&r===e));return(0,r.jsxs)(c.Ug,{children:[(0,r.jsx)(c.Ct,Object.assign({colorScheme:s?"green":"orange"},{children:e})),(0,r.jsx)(ls.hdK,{}),(0,r.jsx)(c.Ct,Object.assign({colorScheme:s?"green":"orange"},{children:t})),!s&&(0,r.jsx)(c.xv,Object.assign({fontSize:"xs"},{children:"(extra)"}))]},o)}))}))]})]}))}))]},e.instanceIndex)}))}))]}),(0,r.jsxs)(c.Ug,Object.assign({spacing:3,pt:4},{children:[(0,r.jsx)(S.zx,Object.assign({flex:1,colorScheme:"green",leftIcon:(0,r.jsx)(ls.HhX,{}),onClick:()=>{const r=i?`${i}\n\n# Synthesized ${o} selector\n# ${n.expression}\n`:`# Synthesized ${o} selector\n# ${n.expression}\n`;e(Io({datum:t,spec:r})),e(ii())},size:"lg"},{children:"Accept & Insert into Spec"})),(0,r.jsx)(S.zx,Object.assign({flex:1,variant:"outline",leftIcon:(0,r.jsx)(ls.FU5,{}),onClick:()=>{e(ii())},size:"lg"},{children:"Reject & Try Again"}))]})),(0,r.jsx)(c.xu,Object.assign({bg:"blue.50",p:4,rounded:"md",borderWidth:1,borderColor:"blue.200"},{children:(0,r.jsxs)(c.xv,Object.assign({fontSize:"sm",color:"gray.700"},{children:[(0,r.jsx)("strong",{children:"Next steps:"})," The selector will be added as a comment in your CnD spec. You can use it in constraints (e.g., ",(0,r.jsxs)(c.EK,{children:["right(",n.expression,")"]}),") or directives (e.g., ",(0,r.jsxs)(c.EK,{children:["color red(",n.expression,")"]}),")."]}))}))]}))}))};const Ni=()=>{const e=jt(),t=St(hr),n=St(Zr),s=St(Wr),i=St(Ur),a=St(qr),l=St(Yr),d=(St(Xr),St(Hr)),p=St(Jr),u=St(Qr),h=St(Kr),m=i>a&&null===d&&!u&&!p&&l.length===a,g=l.every((e=>e.selectedAtomIds.length>0||e.selectedPairs.length>0));if(console.log("[SynthesisPanel] State:",{currentStep:i,numInstances:a,result:d,isLoading:u,error:p,examplesLength:l.length,shouldSynthesize:m,canSynthesize:h,examplesHaveSelections:g,examples:l.map((e=>({instanceIndex:e.instanceIndex,selectedAtomIds:e.selectedAtomIds,selectedPairs:e.selectedPairs,hasDataInstance:!!e.dataInstance})))}),(0,o.useEffect)((()=>{var n,r,o,i;m&&h&&(console.log("[SynthesisPanel] Auto-triggering synthesis"),n=void 0,r=void 0,i=function*(){if(t&&window.CndCore){e(gi());try{const t=e=>new window.CndCore.AlloyDataInstance(e),n=(e,t)=>{const n=e.getAtoms();console.log("[Synthesis] Looking for atom:",t,"in",n.length,"atoms"),console.log("[Synthesis] Available atom IDs:",n.map((e=>e.id)));const r=n.find((e=>e.id===t));if(!r)throw new Error(`Atom not found: ${t}`);return r};if("unary"===s){console.log("[Synthesis] Starting unary synthesis with",l.length,"examples"),console.log("[Synthesis] Examples:",l.map((e=>({instanceIndex:e.instanceIndex,selectedAtomIds:e.selectedAtomIds,hasDataInstance:!!e.dataInstance}))));const r=l.map(((e,r)=>{const o=e.dataInstance;if(console.log(`[Synthesis] Example ${r}: rawInstanceData =`,o),!o)throw new Error(`Example ${e.instanceIndex+1}: Missing data instance`);const s=t(o);console.log(`[Synthesis] Example ${r}: recreated AlloyDataInstance with ${s.getAtoms().length} atoms`);const i=e.selectedAtomIds.map((e=>n(s,e)));return console.log(`[Synthesis] Example ${r}: converted ${e.selectedAtomIds.length} IDs to atoms`),{atoms:i,dataInstance:s}}));console.log("[Synthesis] Calling synthesizeAtomSelectorWithExplanation with:",r);const o=window.CndCore.synthesizeAtomSelectorWithExplanation(r,3);if(console.log("[Synthesis] Result:",o),!o)throw new Error("Synthesis failed - no selector found");const s=l.map(((e,n)=>{const r=t(e.dataInstance),s=new window.CndCore.SGraphQueryEvaluator;s.initialize({sourceData:r});const i=s.evaluate(o.expression);return{instanceIndex:n,matchedAtomIds:i.selectedAtoms?i.selectedAtoms().map((e=>e.id)):[]}}));e(hi({expression:o.expression,explanation:o.explanation||null,matchesByInstance:s,pairMatchesByInstance:[]}))}else{const r=l.map((e=>{const r=e.dataInstance;if(!r)throw new Error(`Example ${e.instanceIndex+1}: Missing data instance`);const o=t(r);return{pairs:e.selectedPairs.map((([e,t])=>[n(o,e),n(o,t)])),dataInstance:o}})),o=window.CndCore.synthesizeBinarySelectorWithExplanation(r,3);if(!o)throw new Error("Synthesis failed - no binary selector found");const s=l.map(((e,n)=>{const r=t(e.dataInstance),s=new window.CndCore.SGraphQueryEvaluator;s.initialize({sourceData:r});const i=s.evaluate(o.expression);return{instanceIndex:n,matchedPairs:(i.selectedTuplesAll?i.selectedTuplesAll():[]).map((e=>[e[0].id,e[1].id]))}}));e(hi({expression:o.expression,explanation:null,matchesByInstance:[],pairMatchesByInstance:s}))}}catch(t){e(mi({error:t.message||"Synthesis failed"}))}}},new((o=void 0)||(o=Promise))((function(e,t){function s(e){try{l(i.next(e))}catch(e){t(e)}}function a(e){try{l(i.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof o?n:new o((function(e){e(n)}))).then(s,a)}l((i=i.apply(n,r||[])).next())})))}),[m,h]),!n)return null;const x=0===i?0:(i-1)/a*100,f=0===i,b=i>=1&&i<=a,y=i>a||null!==d;return(0,r.jsxs)("div",Object.assign({className:"absolute inset-0 flex flex-col bg-white"},{children:[(0,r.jsxs)("div",Object.assign({className:"p-4 border-b bg-blue-50 flex items-center justify-between"},{children:[(0,r.jsxs)("div",Object.assign({className:"flex items-center gap-2"},{children:[(0,r.jsx)(to.JO,{as:ls.tSv,boxSize:6,color:"blue.600"}),(0,r.jsxs)("div",{children:[(0,r.jsx)(k,{children:"Selector Synthesis"}),(0,r.jsxs)(c.xv,Object.assign({fontSize:"xs",color:"gray.600"},{children:[f&&"Configure synthesis parameters",b&&`Collecting examples (${l.length}/${a})`,y&&"Review synthesized selector"]}))]})]})),(0,r.jsx)(S.zx,Object.assign({size:"sm",leftIcon:(0,r.jsx)(ls.FU5,{}),onClick:()=>{e(ii())},variant:"ghost"},{children:"Exit"}))]})),!f&&!y&&(0,r.jsx)(wi.Ex,{value:x,size:"xs",colorScheme:"blue"}),(0,r.jsxs)("div",Object.assign({className:"flex-1 overflow-y-auto"},{children:[f&&(0,r.jsx)(Ai,{}),b&&("unary"===s?(0,r.jsx)(Mi,{}):(0,r.jsx)(Ii,{})),y&&(0,r.jsx)(ki,{})]})),!f&&!y&&(0,r.jsxs)("div",Object.assign({className:"p-4 border-t bg-gray-50 flex items-center justify-between"},{children:[(0,r.jsx)(S.zx,Object.assign({size:"sm",leftIcon:(0,r.jsx)(ls.KYK,{}),onClick:()=>e(ui()),isDisabled:i<=1,variant:"outline"},{children:"Previous"})),(0,r.jsxs)(c.xv,Object.assign({fontSize:"sm",color:"gray.600"},{children:["Instance ",i," of ",a]}))]})),p&&(0,r.jsxs)("div",Object.assign({className:"p-4 bg-red-50 border-t border-red-200 text-red-700 text-sm"},{children:[(0,r.jsx)("strong",{children:"Error:"})," ",p]}))]}))},Di=()=>{const e=jt(),t=St(hr);return St(Zr)?(0,r.jsx)(Ni,{}):t?(0,r.jsx)("div",Object.assign({className:"absolute inset-0 flex flex-col overflow-y-auto bg-slate-50/90 text-slate-900"},{children:(0,r.jsx)("div",Object.assign({className:"flex-1 space-y-4 p-4"},{children:(0,r.jsxs)("div",Object.assign({className:"space-y-4 rounded-xl border border-slate-200 bg-white/80 p-6 backdrop-blur shadow-sm"},{children:[(0,r.jsxs)("div",Object.assign({className:"flex items-center gap-3"},{children:[(0,r.jsx)(to.JO,{as:ls.tSv,boxSize:8,className:"text-fuchsia-600"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",Object.assign({className:"text-lg font-semibold text-slate-800"},{children:"Selector Synthesis"})),(0,r.jsx)("p",Object.assign({className:"text-sm text-slate-500"},{children:"Synthesize selectors from examples"}))]})]})),(0,r.jsx)("p",Object.assign({className:"text-sm text-slate-600 leading-relaxed"},{children:"Use this tool to automatically generate CnD selectors by providing positive and negative examples. Select atoms across multiple instances to define which elements should be matched by the selector."})),(0,r.jsxs)("div",Object.assign({className:"space-y-3 pt-2"},{children:[(0,r.jsxs)("div",Object.assign({className:"rounded-lg border border-slate-200 bg-slate-50 p-4"},{children:[(0,r.jsx)("h3",Object.assign({className:"font-medium text-slate-700 mb-2"},{children:"Selector Types"})),(0,r.jsxs)("ul",Object.assign({className:"text-sm text-slate-600 space-y-2"},{children:[(0,r.jsxs)("li",Object.assign({className:"flex items-start gap-2"},{children:[(0,r.jsx)("span",Object.assign({className:"inline-block w-5 h-5 rounded-full bg-fuchsia-100 text-fuchsia-600 text-xs flex items-center justify-center font-semibold mt-0.5"},{children:"1"})),(0,r.jsxs)("span",{children:[(0,r.jsx)("strong",{children:"Unary:"}),' Select individual atoms (e.g., "all Nodes with value > 5")']})]})),(0,r.jsxs)("li",Object.assign({className:"flex items-start gap-2"},{children:[(0,r.jsx)("span",Object.assign({className:"inline-block w-5 h-5 rounded-full bg-purple-100 text-purple-600 text-xs flex items-center justify-center font-semibold mt-0.5"},{children:"2"})),(0,r.jsxs)("span",{children:[(0,r.jsx)("strong",{children:"Binary:"}),' Select pairs of atoms/edges (e.g., "all edges where source.value < target.value")']})]}))]}))]})),(0,r.jsxs)("div",Object.assign({className:"grid gap-2 sm:grid-cols-2"},{children:[(0,r.jsxs)("button",Object.assign({type:"button",onClick:()=>e(si({numInstances:3,selectorType:"unary"})),className:"inline-flex items-center justify-center gap-2 rounded-lg bg-gradient-to-r from-fuchsia-600 to-purple-600 px-4 py-3 text-sm font-semibold text-white shadow-md transition hover:from-fuchsia-500 hover:to-purple-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fuchsia-500 focus-visible:ring-offset-2 focus-visible:ring-offset-white"},{children:[(0,r.jsx)(to.JO,{as:ls.tSv}),"Synthesize Unary Selector"]})),(0,r.jsxs)("button",Object.assign({type:"button",onClick:()=>e(si({numInstances:3,selectorType:"binary"})),className:"inline-flex items-center justify-center gap-2 rounded-lg bg-gradient-to-r from-purple-600 to-indigo-600 px-4 py-3 text-sm font-semibold text-white shadow-md transition hover:from-purple-500 hover:to-indigo-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-purple-500 focus-visible:ring-offset-2 focus-visible:ring-offset-white"},{children:[(0,r.jsx)(to.JO,{as:ls.tSv}),"Synthesize Binary Selector"]}))]}))]}))]}))}))})):(0,r.jsxs)("div",Object.assign({className:"absolute inset-0 flex flex-col items-center justify-center bg-slate-50/90 p-8 text-center"},{children:[(0,r.jsx)(to.JO,{as:ls.tSv,boxSize:12,className:"mb-4 text-slate-300"}),(0,r.jsx)("p",Object.assign({className:"text-slate-500"},{children:"Load an instance to start synthesizing selectors."}))]}))},zi=()=>(0,r.jsxs)("div",Object.assign({className:"w-full flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(to.JO,{as:ls.tSv}),(0,r.jsx)(k,{children:"Synthesis"})]})),Ei=()=>{const e=St(wr);return(0,r.jsxs)(r.Fragment,{children:["explorer"===e&&(0,r.jsx)(Ks,{}),"state"===e&&(0,r.jsx)(Cs,{}),"evaluator"===e&&(0,r.jsx)(ao,{}),"log"===e&&(0,r.jsx)(co,{}),"layout"===e&&(0,r.jsx)(ni,{}),"synthesis"===e&&(0,r.jsx)(Di,{})]})},_i=()=>{const e=St(wr);return(0,r.jsxs)(r.Fragment,{children:["explorer"===e&&(0,r.jsx)(ei,{}),"state"===e&&(0,r.jsx)(Ms,{}),"evaluator"===e&&(0,r.jsx)(lo,{}),"log"===e&&(0,r.jsx)(po,{}),"layout"===e&&(0,r.jsx)(ri,{}),"synthesis"===e&&(0,r.jsx)(zi,{})]})};var Li=n(14578);const Ti=e=>(0,r.jsx)("div",Object.assign({className:"contents group"},{children:e.children})),Pi=e=>(0,r.jsx)("div",Object.assign({className:"px-4 py-0.5 prose text-xs group-hover:bg-slate-100"},{children:e.children})),Bi=e=>(0,r.jsx)("div",Object.assign({className:"px-4 py-0.5 text-xs font-mono group-hover:bg-slate-100"},{children:e.children})),Ri=e=>{const{variable:t}=e;return(0,r.jsxs)(Ti,{children:[(0,r.jsx)(Bi,{children:t.name}),(0,r.jsx)(Pi,{children:void 0!==t.typeUrl?(0,r.jsx)("a",Object.assign({target:"_blank",rel:"noopener noreferrer",href:t.typeUrl},{children:t.type})):t.type})]})},$i=e=>{const{datum:t}=e,n=St((e=>Br(e,t)));return(0,r.jsxs)("div",Object.assign({className:"flex flex-col justify-middle"},{children:[(0,r.jsx)("div",Object.assign({className:"prose prose-md font-bold mx-2 my-2 border-b"},{children:"Datum Variables"})),(0,r.jsxs)("div",Object.assign({className:"grid grid-cols-2"},{children:[(0,r.jsx)("div",Object.assign({className:"px-4 prose prose-sm font-semibold"},{children:"Variable"})),(0,r.jsx)("div",Object.assign({className:"px-4 prose prose-sm font-semibold"},{children:"Type"})),n.map(((e,t)=>(0,r.jsx)(Ri,{variable:e},t)))]}))]}))},Vi=()=>{const e=St(zr),t=St(Er);return(0,r.jsxs)("div",Object.assign({className:"flex flex-col justify-middle"},{children:[(0,r.jsx)("div",Object.assign({className:"prose prose-md font-bold mx-2 my-2 border-b"},{children:"Stage Variables"})),(0,r.jsxs)("div",Object.assign({className:"grid grid-cols-2"},{children:[(0,r.jsx)("div",Object.assign({className:"px-4 prose prose-sm font-semibold"},{children:"Variable"})),(0,r.jsx)("div",Object.assign({className:"px-4 prose prose-sm font-semibold"},{children:"Value"})),(0,r.jsxs)(Ti,{children:[(0,r.jsx)(Bi,{children:e}),(0,r.jsxs)(Pi,{children:["svg"===e&&(0,r.jsx)("a",Object.assign({target:"_blank",rel:"noopener noreferrer",href:"https://developer.mozilla.org/en-US/docs/Web/SVG"},{children:""})),"div"===e&&(0,r.jsx)("a",Object.assign({target:"_blank",rel:"noopener noreferrer",href:"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/div"},{children:"
"})),"canvas"===e&&(0,r.jsx)("a",Object.assign({target:"_blank",rel:"noopener noreferrer",href:"https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API"},{children:""}))]})]}),(0,r.jsxs)(Ti,{children:[(0,r.jsx)(Bi,{children:"width"}),(0,r.jsx)(Bi,{children:t.width})]}),(0,r.jsxs)(Ti,{children:[(0,r.jsx)(Bi,{children:"height"}),(0,r.jsx)(Bi,{children:t.height})]})]}))]}))},Fi=e=>{const{datum:t}=e;return(0,r.jsxs)("div",Object.assign({className:"absolute inset-0 flex flex-col overflow-y-auto"},{children:[(0,r.jsx)(Vi,{}),(0,r.jsx)($i,{datum:t})]}))},Gi=()=>(0,r.jsxs)("div",Object.assign({className:"w-full flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(to.JO,{as:Li.VuO}),(0,r.jsx)(k,{children:"Variables"})]})),Zi=()=>{const e=St(hr),t=St(Dr);return(0,r.jsxs)(r.Fragment,{children:["explorer"===t&&(0,r.jsx)(Ks,{}),"evaluator"===t&&(0,r.jsx)(ao,{}),"log"===t&&(0,r.jsx)(co,{}),"variables"===t&&e&&(0,r.jsx)(Fi,{datum:e})]})},Wi=()=>{const e=St(Dr);return(0,r.jsxs)(r.Fragment,{children:["explorer"===e&&(0,r.jsx)(ei,{}),"evaluator"===e&&(0,r.jsx)(lo,{}),"log"===e&&(0,r.jsx)(po,{}),"variables"===e&&(0,r.jsx)(Gi,{})]})},Ui=()=>{const e=St(hr);return e?(0,r.jsx)("div",Object.assign({className:"absolute inset-0 flex flex-col overflow-y-auto"},{children:(0,r.jsx)(As,{datum:e})})):null},qi=()=>(0,r.jsxs)("div",Object.assign({className:"flex items-center px-2 space-x-2"},{children:[(0,r.jsx)(to.JO,{as:uo.rHK}),(0,r.jsx)(k,{children:"Time"})]})),Yi=()=>{console.log("table drawer explorer!");const e=St(Lr);return(0,r.jsxs)(r.Fragment,{children:["explorer"===e&&(0,r.jsx)(Ks,{}),"state"===e&&(0,r.jsx)(Ui,{}),"evaluator"===e&&(0,r.jsx)(ao,{}),"log"===e&&(0,r.jsx)(co,{})]})},Xi=()=>{const e=St(Lr);return(0,r.jsxs)(r.Fragment,{children:["explorer"===e&&(0,r.jsx)(ei,{}),"state"===e&&(0,r.jsx)(qi,{}),"evaluator"===e&&(0,r.jsx)(lo,{}),"log"===e&&(0,r.jsx)(po,{})]})},Hi=()=>{const e=St(Cr);return(0,r.jsxs)(f,{children:[(0,r.jsxs)(I,Object.assign({className:"border-b"},{children:["GraphView"===e&&(0,r.jsx)(_i,{}),"TableView"===e&&(0,r.jsx)(Xi,{}),"ScriptView"===e&&(0,r.jsx)(Wi,{})]})),(0,r.jsxs)(C,{children:["GraphView"===e&&(0,r.jsx)(Ei,{}),"TableView"===e&&(0,r.jsx)(Yi,{}),"ScriptView"===e&&(0,r.jsx)(Zi,{})]})]})};var Ji=n(53854);const Qi=()=>{const e=jt(),t=St(gr),n=St(Cr);return(0,r.jsxs)(r.Fragment,{children:[t.includes("GraphView")&&(0,r.jsx)(A,Object.assign({isActive:"GraphView"===n,mr:1,leftIcon:(0,r.jsx)(ms.DvO,{}),onClick:()=>e(Us("GraphView"))},{children:"Graph"})),t.includes("TableView")&&(0,r.jsx)(A,Object.assign({isActive:"TableView"===n,mr:1,leftIcon:(0,r.jsx)(uo.WHV,{}),onClick:()=>e(Us("TableView"))},{children:"Table"})),t.includes("ScriptView")&&(0,r.jsx)(A,Object.assign({isActive:"ScriptView"===n,mr:1,leftIcon:(0,r.jsx)(Ji.aJo,{}),onClick:()=>e(Us("ScriptView"))},{children:"Script"}))]})},Ki=()=>(0,r.jsxs)(v,Object.assign({className:"shadow"},{children:[(0,r.jsx)(w,{}),(0,r.jsx)(c.iz,{orientation:"vertical",mx:2}),(0,r.jsx)(c.LZ,{}),(0,r.jsx)(Qi,{})]}));var ea=n(60155);const ta=()=>{const e=jt(),t=St(Cr),n=St(wr),o=St(Gr);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(z,{text:"Time",rightIcon:(0,r.jsx)(uo.rHK,{}),isActive:"GraphView"===t&&"state"===n,onClick:()=>e(Ys("state"))}),(0,r.jsx)(z,{text:"Layout",rightIcon:(0,r.jsx)(ls.df2,{}),isActive:"GraphView"===t&&"layout"===n,onClick:()=>e(Ys("layout"))}),o&&(0,r.jsx)(z,{text:"Synthesis",rightIcon:(0,r.jsx)(ls.tSv,{}),isActive:"GraphView"===t&&"synthesis"===n,onClick:()=>e(Ys("synthesis"))}),(0,r.jsx)(z,{text:"Settings",rightIcon:(0,r.jsx)(ea.Fuo,{}),isActive:"GraphView"===t&&"settings"===n,onClick:()=>e(Ys("settings"))})]})},na=()=>{const e=jt(),t=St(Cr),n=St(Dr);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(z,{text:"Variables",rightIcon:(0,r.jsx)(Li.VuO,{}),isActive:"ScriptView"===t&&"variables"===n,onClick:()=>e(Hs("variables"))}),(0,r.jsx)(z,{text:"Settings",rightIcon:(0,r.jsx)(ea.Fuo,{}),isActive:"ScriptView"===t&&"settings"===n,onClick:()=>e(Hs("settings"))})]})},ra=()=>{const e=jt(),t=St(Cr),n=St(Lr);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(z,{text:"Time",rightIcon:(0,r.jsx)(uo.rHK,{}),isActive:"TableView"===t&&"state"===n,onClick:()=>e(Xs("state"))}),(0,r.jsx)(z,{text:"Settings",rightIcon:(0,r.jsx)(ea.Fuo,{}),isActive:"TableView"===t&&"settings"===n,onClick:()=>e(Xs("settings"))})]})},oa=()=>{const e=jt(),t=St(Cr),n=St(yr);return(0,r.jsxs)(N,{children:["GraphView"===t&&(0,r.jsx)(ta,{}),"TableView"===t&&(0,r.jsx)(ra,{}),"ScriptView"===t&&(0,r.jsx)(na,{}),(0,r.jsx)(c.LZ,{}),(0,r.jsx)(z,{text:"Explorer",rightIcon:(0,r.jsx)(uo.rHK,{}),isActive:"explorer"===n,onClick:()=>e(qs("explorer"))}),(0,r.jsx)(z,{text:"Evaluator",rightIcon:(0,r.jsx)(no.RJr,{}),isActive:"evaluator"===n,onClick:()=>e(qs("evaluator"))}),(0,r.jsx)(z,{text:"Log",rightIcon:(0,r.jsx)(no.t75,{}),isActive:"log"===n,onClick:()=>e(qs("log"))})]})};var sa=function(e,t,n,r){return new(n||(n=Promise))((function(o,s){function i(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,a)}l((r=r.apply(e,t||[])).next())}))};const ia=e=>{const{datum:t,cndSpec:n,timeIndex:s,priorState:i,onLayoutStateChange:a,synthesisMode:l=!1,onDataInstanceCreated:c}=e,d=(0,o.useRef)(null),p=(0,o.useRef)(null),[u,h]=(0,o.useState)(null),[m,g]=(0,o.useState)(!0),[x,f]=(0,o.useState)(void 0!==window.CndCore),b=(0,o.useRef)(null),y=(0,o.useRef)(!1),w=(0,o.useRef)(a);w.current=a,(0,o.useEffect)((()=>{if(x)return;const e=()=>{var e;return!!(null===(e=window.CndCore)||void 0===e?void 0:e.parseLayoutSpec)&&(console.log("CndCore is now available"),f(!0),!0)};if(e())return;let t=0;const n=setInterval((()=>{t++,(e()||t>=100)&&(clearInterval(n),t>=100&&!x&&(console.error("CndCore did not load within timeout"),h("CnD Core library failed to load. Please refresh the page."),g(!1)))}),100);return()=>clearInterval(n)}),[x]);const v=(0,o.useCallback)((()=>sa(void 0,void 0,void 0,(function*(){p.current&&b.current&&(yield p.current.renderLayout(b.current))}))),[]),j=(0,o.useCallback)((()=>sa(void 0,void 0,void 0,(function*(){var e,r;if(p.current){if(g(!0),h(null),void 0===window.CndCore)return h("CnD Core library is not available. Please check your internet connection."),void g(!1);try{const o=t.data;if(!o)throw new Error("No Alloy XML data available in datum");const a=window.CndCore.AlloyInstance.parseAlloyXML(o);if(!a.instances||0===a.instances.length)throw new Error("No instances found in Alloy XML");const d=void 0!==s?Math.min(s,a.instances.length-1):0,u=new window.CndCore.AlloyDataInstance(a.instances[d]);if(function(e){var t;try{return((null===(t=e.getTypes)||void 0===t?void 0:t.call(e))||[]).some((e=>{var t;return"No more instances! Some equivalent instances may have been removed through symmetry breaking."===(e.id||(null===(t=e.getId)||void 0===t?void 0:t.call(e))||"")}))}catch(e){return!1}}(u))return console.log("No more instances available from Forge"),h("No more instances available. All satisfying instances have been exhausted."),g(!1),void((null===(e=p.current)||void 0===e?void 0:e.clear)&&p.current.clear());l&&c&&c(a.instances[d]);const m=new window.CndCore.SGraphQueryEvaluator;m.initialize({sourceData:u});let x=null;try{x=window.CndCore.parseLayoutSpec(n||""),window.clearAllErrors&&window.clearAllErrors()}catch(e){console.error("Layout spec parse error:",e),window.showParseError&&window.showParseError(e.message,"Layout Specification"),x=window.CndCore.parseLayoutSpec("")}const f=!0,y=0,w=new window.CndCore.LayoutInstance(x,m,y,f),v=window.currentProjections||{};console.log("Using projections:",v);const j=w.generateLayout(u,v);if(window.updateProjectionData&&j.projectionData?(console.log("Updating projection data:",j.projectionData),window.updateProjectionData(j.projectionData)):j.projectionData&&j.projectionData.length>0&&console.warn("Projection data available but updateProjectionData function not found. Projection controls may not display correctly."),j.error&&(console.error("Layout generation error:",j.error),j.error.errorMessages?window.showPositionalError?window.showPositionalError(j.error.errorMessages):h(`Positional constraint conflict: ${j.error.message}`):j.error.overlappingNodes?window.showGroupOverlapError?window.showGroupOverlapError(j.error.message):h(`Group overlap error: ${j.error.message}`):window.showGeneralError?window.showGeneralError(`Layout generation error: ${j.error.message}`):h(`Layout generation error: ${j.error.message}`),p.current&&p.current.setAttribute("unsat","")),b.current=j.layout,p.current&&j.layout){const e=(null===(r=j.layout.nodes)||void 0===r?void 0:r.map((e=>e.id||e.name||e.label)))||[],t=i&&i.positions&&i.positions.length>0,n=t?{priorState:i}:void 0;t&&i&&i.positions.map((e=>e.id)).filter((t=>e.includes(t))),yield p.current.renderLayout(j.layout,n)}g(!1)}catch(e){console.error("Error rendering SpyTial graph:",e),h(`Error rendering graph: ${e.message}`),g(!1)}}}))),[t.data,t.id,n,s,v,i]);return(0,o.useEffect)((()=>{if(!d.current||y.current)return;const e=document.createElement("webcola-cnd-graph");e.id="spytial-graph-container",e.setAttribute("layoutFormat","default"),e.setAttribute("aria-label","Interactive graph visualization"),e.style.cssText="\n width: 100%;\n height: 100%;\n min-height: 400px;\n display: block;\n ";const t=e=>{var t;if((null===(t=p.current)||void 0===t?void 0:t.getLayoutState)&&w.current){const e=p.current.getLayoutState();e&&e.positions&&e.positions.length>0&&w.current(e)}},n=e=>{var t;if((null===(t=p.current)||void 0===t?void 0:t.getLayoutState)&&w.current){const e=p.current.getLayoutState();e&&e.positions&&e.positions.length>0&&w.current(e)}},r=e=>{var t;if((null===(t=p.current)||void 0===t?void 0:t.getLayoutState)&&w.current){const e=p.current.getLayoutState();e&&e.positions&&e.positions.length>0&&w.current(e)}};return e.addEventListener("layout-complete",t),e.addEventListener("node-drag-end",n),e.addEventListener("viewbox-change",r),d.current.appendChild(e),p.current=e,y.current=!0,()=>{p.current&&(p.current.removeEventListener("layout-complete",t),p.current.removeEventListener("node-drag-end",n),p.current.removeEventListener("viewbox-change",r),p.current.clear&&p.current.clear(),d.current&&p.current.parentNode===d.current&&d.current.removeChild(p.current)),p.current=null,b.current=null,y.current=!1}}),[]),(0,o.useEffect)((()=>{p.current&&x&&j()}),[t.data,n,s,j,x]),(0,r.jsxs)("div",Object.assign({className:"absolute inset-0 flex flex-col",style:{background:"white",overflow:"hidden"}},{children:[(0,r.jsx)("div",{ref:d,style:{flex:1,position:"relative",minHeight:"400px",cursor:l?"pointer":"default"}}),m&&(0,r.jsx)("div",Object.assign({className:"absolute inset-0 flex items-center justify-center bg-white bg-opacity-75",style:{zIndex:10,pointerEvents:"none"}},{children:(0,r.jsx)("div",Object.assign({className:"text-gray-600"},{children:"Loading graph..."}))})),u&&(0,r.jsxs)("div",Object.assign({className:"absolute bottom-0 left-0 right-0 p-4 bg-red-100 border-t border-red-300 text-red-700",style:{zIndex:20}},{children:[(0,r.jsx)("strong",{children:"Error:"})," ",u]}))]}))};function aa(e){var t;try{return((null===(t=e.getTypes)||void 0===t?void 0:t.call(e))||[]).some((e=>{var t;return"No more instances! Some equivalent instances may have been removed through symmetry breaking."===(e.id||(null===(t=e.getId)||void 0===t?void 0:t.call(e))||"")}))}catch(e){return!1}}const la=e=>{const{datum:t,cndSpec:n,timeIndex:s,projectionType:i,atomId:a,atomLabel:l,index:c}=e,d=(0,o.useRef)(null),p=(0,o.useRef)(null),[u,h]=(0,o.useState)(null),[m,g]=(0,o.useState)(!0),x=(0,o.useRef)(!1),f=(0,o.useRef)(null);console.log(`[SingleProjectionPane] projectionType=${i}, atomId=${a}, atomLabel=${l}`);const b=(0,o.useCallback)((()=>{return e=void 0,r=void 0,c=function*(){if(p.current){if(g(!0),h(null),void 0===window.CndCore)return h("CnD Core library is not available."),void g(!1);try{const e=t.data;if(!e)throw new Error("No Alloy XML data available in datum");const r=window.CndCore.AlloyInstance.parseAlloyXML(e);if(!r.instances||0===r.instances.length)throw new Error("No instances found in Alloy XML");const o=void 0!==s?Math.min(s,r.instances.length-1):0,c=new window.CndCore.AlloyDataInstance(r.instances[o]);if(aa(c))return h("No more instances available."),void g(!1);const d=new window.CndCore.SGraphQueryEvaluator;d.initialize({sourceData:c});let u=null;try{u=window.CndCore.parseLayoutSpec(n||"")}catch(e){console.error(`[Projection ${l}] Layout spec parse error:`,e),u=window.CndCore.parseLayoutSpec("")}const m=!0,x=new window.CndCore.LayoutInstance(u,d,0,m),b=i?{[i]:a}:{};console.log(`[SingleProjectionPane ${l}] Generating with projection:`,i,"->",a,"Full projections:",b);const y=x.generateLayout(c,b);y.error&&(console.error(`[Projection ${l}] Layout generation error:`,y.error),h(`Layout error: ${y.error.message}`)),f.current=y.layout,p.current&&y.layout&&(yield p.current.renderLayout(y.layout)),g(!1)}catch(e){console.error(`[Projection ${l}] Error rendering graph:`,e),h(`Error: ${e.message}`),g(!1)}}},new((o=void 0)||(o=Promise))((function(t,n){function s(e){try{a(c.next(e))}catch(e){n(e)}}function i(e){try{a(c.throw(e))}catch(e){n(e)}}function a(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(e){e(n)}))).then(s,i)}a((c=c.apply(e,r||[])).next())}));var e,r,o,c}),[t.data,t.id,n,s,i,a,l]);return(0,o.useEffect)((()=>{if(!d.current||x.current)return;const e=document.createElement("webcola-cnd-graph");return e.id=`spytial-graph-projection-${c}`,e.setAttribute("layoutFormat","default"),e.setAttribute("aria-label",`Graph visualization for ${l}`),e.style.cssText="\n width: 100%;\n height: 100%;\n min-height: 200px;\n display: block;\n ",d.current.appendChild(e),p.current=e,x.current=!0,()=>{p.current&&(p.current.clear&&p.current.clear(),d.current&&p.current.parentNode===d.current&&d.current.removeChild(p.current)),p.current=null,f.current=null,x.current=!1}}),[c,l]),(0,o.useEffect)((()=>{p.current&&void 0!==window.CndCore&&b()}),[t.data,n,s,b]),(0,r.jsxs)("div",Object.assign({className:"relative flex flex-col border border-gray-300 rounded-lg overflow-hidden bg-white shadow-sm"},{children:[(0,r.jsx)("div",Object.assign({className:"px-3 py-2 bg-gray-100 border-b border-gray-200"},{children:(0,r.jsx)("span",Object.assign({className:"font-medium text-sm text-gray-700"},{children:l}))})),(0,r.jsx)("div",{ref:d,className:"flex-1",style:{minHeight:"250px",background:"white"}}),m&&(0,r.jsx)("div",Object.assign({className:"absolute inset-0 flex items-center justify-center bg-white bg-opacity-75",style:{zIndex:10,pointerEvents:"none"}},{children:(0,r.jsx)("div",Object.assign({className:"text-gray-600 text-sm"},{children:"Loading..."}))})),u&&(0,r.jsx)("div",Object.assign({className:"px-3 py-2 bg-red-50 border-t border-red-200 text-red-600 text-xs"},{children:u}))]}))},ca=e=>{const{datum:t,cndSpec:n,timeIndex:s,projectionType:i,selectedAtoms:a}=e;console.log("[MultiProjectionGraph] Props:",{projectionType:i,selectedAtoms:a,datumId:null==t?void 0:t.id});const[l,c]=(0,o.useState)([]),[d,p]=(0,o.useState)("undefined"!=typeof window&&void 0!==window.CndCore),[u,h]=(0,o.useState)(null);(0,o.useEffect)((()=>{if(d)return;const e=()=>!("undefined"==typeof window||!window.CndCore||"function"!=typeof window.CndCore.parseLayoutSpec||(p(!0),0));if(e())return;let t=0;const n=setInterval((()=>{t++,(e()||t>=100)&&(clearInterval(n),t>=100&&!d&&h("CnD Core library failed to load."))}),100);return()=>clearInterval(n)}),[d]),(0,o.useEffect)((()=>{if(d&&t.data)try{const e=t.data,n=window.CndCore.AlloyInstance.parseAlloyXML(e);if(!n.instances||0===n.instances.length)return void h("No instances found in Alloy XML");const r=void 0!==s?Math.min(s,n.instances.length-1):0,o=new window.CndCore.AlloyDataInstance(n.instances[r]);if(aa(o))return void h("No more instances available.");const i=new window.CndCore.SGraphQueryEvaluator;i.initialize({sourceData:o});const a=window.CndCore.parseLayoutSpec(""),l=new window.CndCore.LayoutInstance(a,i,0,!0).generateLayout(o,{});l.projectionData&&c(l.projectionData)}catch(e){console.error("Error extracting projection data:",e),h(`Error: ${e.message}`)}}),[t.data,s,d]);const m=(0,o.useMemo)((()=>{const e=l.find((e=>e.typeId===i||e.typeName===i));console.log("[MultiProjectionGraph] Looking for typeData:",{projectionType:i,found:e,allTypes:l.map((e=>({typeId:e.typeId,typeName:e.typeName})))});const t=(null==e?void 0:e.atoms)||[],n=new Map(t.map((e=>[e.id,e])));return a.map((e=>{const t=n.get(e);return{id:e,label:(null==t?void 0:t.label)||e}}))}),[l,i,a]),g=(0,o.useMemo)((()=>{const e=m.length;return e<=2?e:e<=4?2:e<=6?3:4}),[m.length]);if(u)return(0,r.jsx)("div",Object.assign({className:"flex items-center justify-center h-full p-4"},{children:(0,r.jsxs)("div",Object.assign({className:"text-red-600 bg-red-50 p-4 rounded-lg"},{children:[(0,r.jsx)("strong",{children:"Error:"})," ",u]}))}));if(!d)return(0,r.jsx)("div",Object.assign({className:"flex items-center justify-center h-full"},{children:(0,r.jsx)("div",Object.assign({className:"text-gray-600"},{children:"Loading CnD Core..."}))}));if(0===m.length)return(0,r.jsx)("div",Object.assign({className:"flex items-center justify-center h-full p-4"},{children:(0,r.jsxs)("div",Object.assign({className:"text-gray-600 bg-gray-50 p-4 rounded-lg"},{children:['No atoms selected for projection type "',i,'".']}))}));const x=(0,o.useMemo)((()=>{const e=l.find((e=>e.typeId===i||e.typeName===i));return(null==e?void 0:e.typeName)||i||"Unknown"}),[l,i]);return(0,r.jsxs)("div",Object.assign({className:"absolute inset-0 overflow-auto bg-gray-100 p-4"},{children:[(0,r.jsxs)("div",Object.assign({className:"mb-4 px-2"},{children:[(0,r.jsxs)("h2",Object.assign({className:"text-lg font-semibold text-gray-800"},{children:["Projections over ",x]})),(0,r.jsxs)("p",Object.assign({className:"text-sm text-gray-600"},{children:["Showing ",m.length," selected projection",1!==m.length?"s":""]}))]})),(0,r.jsx)("div",Object.assign({className:"grid gap-4",style:{gridTemplateColumns:`repeat(${g}, minmax(300px, 1fr))`}},{children:m.map(((e,o)=>(0,r.jsx)(la,{datum:t,cndSpec:n,timeIndex:s,projectionType:i,atomId:e.id,atomLabel:e.label,index:o},e.id)))}))]}))};const da=e=>{const{datum:t,cndSpec:n,timeIndex:s,traceLength:i,index:a}=e,l=(0,o.useRef)(null),c=(0,o.useRef)(null),[d,p]=(0,o.useState)(null),[u,h]=(0,o.useState)(!0),m=(0,o.useRef)(!1),g=(0,o.useRef)(null),x=(0,o.useCallback)((()=>{return e=void 0,r=void 0,i=function*(){if(c.current){if(h(!0),p(null),void 0===window.CndCore)return p("CnD Core library is not available."),void h(!1);try{const e=t.data;if(!e)throw new Error("No Alloy XML data available in datum");const r=window.CndCore.AlloyInstance.parseAlloyXML(e);if(!r.instances||0===r.instances.length)throw new Error("No instances found in Alloy XML");const o=Math.min(s,r.instances.length-1),i=new window.CndCore.AlloyDataInstance(r.instances[o]);if(function(e){var t;try{return((null===(t=e.getTypes)||void 0===t?void 0:t.call(e))||[]).some((e=>{var t;return"No more instances! Some equivalent instances may have been removed through symmetry breaking."===(e.id||(null===(t=e.getId)||void 0===t?void 0:t.call(e))||"")}))}catch(e){return!1}}(i))return p("No more instances available."),void h(!1);const a=new window.CndCore.SGraphQueryEvaluator;a.initialize({sourceData:i});let l=null;try{l=window.CndCore.parseLayoutSpec(n||"")}catch(e){console.error(`[Time ${s}] Layout spec parse error:`,e),l=window.CndCore.parseLayoutSpec("")}const d=!0,u=new window.CndCore.LayoutInstance(l,a,o,d),m=window.currentProjections||{},x=u.generateLayout(i,m);x.error&&(console.error(`[Time ${s}] Layout generation error:`,x.error),p(`Layout error: ${x.error.message}`)),g.current=x.layout,c.current&&x.layout&&(yield c.current.renderLayout(x.layout)),h(!1)}catch(e){console.error(`[Time ${s}] Error rendering graph:`,e),p(`Error: ${e.message}`),h(!1)}}},new((o=void 0)||(o=Promise))((function(t,n){function s(e){try{l(i.next(e))}catch(e){n(e)}}function a(e){try{l(i.throw(e))}catch(e){n(e)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof o?n:new o((function(e){e(n)}))).then(s,a)}l((i=i.apply(e,r||[])).next())}));var e,r,o,i}),[t.data,t.id,n,s]);return(0,o.useEffect)((()=>{if(!l.current||m.current)return;const e=document.createElement("webcola-cnd-graph");return e.id=`spytial-graph-temporal-${a}`,e.setAttribute("layoutFormat","default"),e.setAttribute("aria-label",`Graph visualization for time step ${s+1}`),e.style.cssText="\n width: 100%;\n height: 100%;\n min-height: 200px;\n display: block;\n ",l.current.appendChild(e),c.current=e,m.current=!0,()=>{c.current&&(c.current.clear&&c.current.clear(),l.current&&c.current.parentNode===l.current&&l.current.removeChild(c.current)),c.current=null,g.current=null,m.current=!1}}),[a,s]),(0,o.useEffect)((()=>{c.current&&void 0!==window.CndCore&&x()}),[t.data,n,s,x]),(0,r.jsxs)("div",Object.assign({className:"relative flex flex-col border border-gray-300 rounded-lg overflow-hidden bg-white shadow-sm"},{children:[(0,r.jsx)("div",Object.assign({className:"px-3 py-2 bg-blue-50 border-b border-blue-200"},{children:(0,r.jsxs)("span",Object.assign({className:"font-medium text-sm text-blue-800"},{children:["State ",s+1," of ",i]}))})),(0,r.jsx)("div",{ref:l,className:"flex-1",style:{minHeight:"250px",background:"white"}}),u&&(0,r.jsx)("div",Object.assign({className:"absolute inset-0 flex items-center justify-center bg-white bg-opacity-75",style:{zIndex:10,pointerEvents:"none"}},{children:(0,r.jsx)("div",Object.assign({className:"text-gray-600 text-sm"},{children:"Loading..."}))})),d&&(0,r.jsx)("div",Object.assign({className:"px-3 py-2 bg-red-50 border-t border-red-200 text-red-600 text-xs"},{children:d}))]}))},pa=e=>{const{datum:t,cndSpec:n,selectedTimeIndices:s,traceLength:i}=e,[a,l]=(0,o.useState)("undefined"!=typeof window&&void 0!==window.CndCore),[c,d]=(0,o.useState)(null);(0,o.useEffect)((()=>{if(a)return;const e=()=>!("undefined"==typeof window||!window.CndCore||"function"!=typeof window.CndCore.parseLayoutSpec||(l(!0),0));if(e())return;let t=0;const n=setInterval((()=>{t++,(e()||t>=100)&&(clearInterval(n),t>=100&&!a&&d("CnD Core library failed to load."))}),100);return()=>clearInterval(n)}),[a]);const p=(0,o.useMemo)((()=>{const e=s.length;return e<=2?e:e<=4?2:e<=6?3:4}),[s.length]);return c?(0,r.jsx)("div",Object.assign({className:"flex items-center justify-center h-full p-4"},{children:(0,r.jsxs)("div",Object.assign({className:"text-red-600 bg-red-50 p-4 rounded-lg"},{children:[(0,r.jsx)("strong",{children:"Error:"})," ",c]}))})):a?0===s.length?(0,r.jsx)("div",Object.assign({className:"flex items-center justify-center h-full p-4"},{children:(0,r.jsx)("div",Object.assign({className:"text-gray-600 bg-gray-50 p-4 rounded-lg"},{children:"No time steps selected."}))})):(0,r.jsxs)("div",Object.assign({className:"absolute inset-0 overflow-auto bg-gray-100 p-4"},{children:[(0,r.jsxs)("div",Object.assign({className:"mb-4 px-2"},{children:[(0,r.jsx)("h2",Object.assign({className:"text-lg font-semibold text-gray-800"},{children:"Temporal Comparison"})),(0,r.jsxs)("p",Object.assign({className:"text-sm text-gray-600"},{children:["Showing ",s.length," time step",1!==s.length?"s":""," of ",i]}))]})),(0,r.jsx)("div",Object.assign({className:"grid gap-4",style:{gridTemplateColumns:`repeat(${p}, minmax(300px, 1fr))`}},{children:s.map(((e,o)=>(0,r.jsx)(da,{datum:t,cndSpec:n,timeIndex:e,traceLength:i,index:o},`time-${e}`)))}))]})):(0,r.jsx)("div",Object.assign({className:"flex items-center justify-center h-full"},{children:(0,r.jsx)("div",Object.assign({className:"text-gray-600"},{children:"Loading CnD Core..."}))}))},ua=e=>{const t=jt(),{datumId:n,button:s,generatorId:i}=e,{text:a,onClick:l,mouseover:c}=s,d=(0,o.useCallback)((()=>{t(_e({id:n,onClick:l,context:{generatorName:i,id:n}}))}),[n,s]);return(0,r.jsx)(Is.u,Object.assign({hasArrow:!0,label:c,isDisabled:void 0===c},{children:(0,r.jsx)(ze,Object.assign({onClick:d},{children:a}))}))},ha=e=>{const{datum:t}=e,{id:n,parsed:o,buttons:s,generatorName:i}=t,a=o.command;return(0,r.jsxs)("div",Object.assign({className:"w-full flex item-center space-x-2 px-2"},{children:[(0,r.jsxs)(k,Object.assign({className:"text-gray-400"},{children:["ID: ",n]})),(0,r.jsx)(k,{children:a}),(0,r.jsx)("div",{className:"grow"}),s&&s.map(((e,t)=>(0,r.jsx)(ua,{datumId:n,generatorId:i,button:e},t)))]}))},ma=()=>{const e=jt(),t=St(hr),n=St((e=>t?$r(e,t):"")),s=St((e=>t?Tr(e,t):0)),i=St((e=>t?Pr(0,t):1)),a=St((e=>t?Vr(e,t):{})),l=St((e=>t?Fr(e,t):[])),c=(0,o.useMemo)((()=>{console.log("[GraphView] selectedProjections:",a);for(const[e,t]of Object.entries(a))if(console.log(`[GraphView] Checking typeId="${e}", atoms:`,t),t.length>1)return console.log(`[GraphView] Found multi-projection: typeId="${e}" with ${t.length} atoms`),{typeId:e,atoms:t};return null}),[a]),d=l.length>1,p=St(Zr),u=St(Ur),h=(0,o.useRef)(void 0),m=(0,o.useCallback)((e=>{h.current=e}),[]),g=(0,o.useCallback)((t=>{p&&e(bi({dataInstance:t}))}),[e,p]),x=null!==c&&!p&&!d,b=d&&!p;return(0,r.jsx)(f,Object.assign({className:"grid grid-flow-col divide-x divide-dashed"},{children:t?(0,r.jsx)("div",Object.assign({className:"relative"},{children:(0,r.jsxs)(f,{children:[(0,r.jsx)(I,Object.assign({className:"border-b"},{children:(0,r.jsx)(ha,{datum:t})})),(0,r.jsx)(C,{children:t?b?(0,r.jsx)(pa,{datum:t,cndSpec:n,selectedTimeIndices:l,traceLength:i}):x&&c?(0,r.jsx)(ca,{datum:t,cndSpec:n,timeIndex:s,projectionType:c.typeId,selectedAtoms:c.atoms}):(0,r.jsx)(ia,{datum:t,cndSpec:n,timeIndex:s,priorState:h.current,onLayoutStateChange:m,synthesisMode:p&&u>0,onDataInstanceCreated:g}):null})]})})):null}))};var ga=n(4953);const xa=(0,Ee.oM)({name:"script",initialState:{stage:"svg",stageDimensions:{width:0,height:0},text:"",scriptTextByDatumId:{}},reducers:{scriptStageDimensionsSet(e,t){e.stageDimensions=t.payload},scriptStageSet(e,t){e.stage=t.payload},scriptTextSet(e,t){e.text=t.payload},scriptTextByDatumSet(e,t){const{id:n,text:r}=t.payload;e.scriptTextByDatumId[n]=r}},extraReducers:e=>e.addCase(_s,((e,t)=>{e.text=e.scriptTextByDatumId[t.payload]})).addCase(Be,((e,t)=>{const{enter:n,update:r,exit:o}=t.payload;if(n){(0,ks.Z)(n,(t=>{"visualizerConfig"in t.parsed&&"script"in t.parsed.visualizerConfig&&(e.scriptTextByDatumId[t.id]=t.parsed.visualizerConfig.script)}));const t=(0,zt.Z)(n);t&&(e.text=e.scriptTextByDatumId[t.id])}o&&(0,Ft.Z)(o,(t=>{e.scriptTextByDatumId[t]=""}))}))}),{scriptStageSet:fa,scriptStageDimensionsSet:ba,scriptTextSet:ya,scriptTextByDatumSet:wa}=xa.actions,va=xa.reducer;var ja=n(76815);function Sa(e){return(0,ja.pF)(e)}var Aa=n(81493);const Ca="\nclass AlloyError {\n static error(source: string, message: string): Error;\n\n static missingAttribute(source: string, attribute: string): Error;\n\n static missingElement(source: string, element: string): Error;\n}\n\nclass AlloySignature extends AlloySet {\n private readonly _id;\n private readonly _atoms;\n private _subsignatures;\n\n /**\n * Create a new Alloy signature.\n *\n * @param id The signature's unique ID\n * @param atoms The atoms defined by the signature\n * @param proxy If provided, a proxied signature will be created.\n */\n constructor(id: string, atoms: AlloyAtom[], proxy?: AlloyProxy);\n\n /**\n * Get an atom by ID\n * @param id The atom ID\n * @returns An atom or null if there is no atom with the specified ID\n */\n atom(id: string): AlloyAtom | null;\n\n /**\n * Get an array of all atoms in this signature.\n * @param recursive If false, return only atoms defined by this signature,\n * if true, include atoms defined by all subsignatures as well.\n */\n atoms(recursive?: boolean): AlloyAtom[];\n\n /**\n * Create a clone of this signature.\n * @param proxy If provided, a proxied clone will be returned.\n */\n clone(proxy?: AlloyProxy): AlloySignature;\n\n /**\n * Get the signature ID.\n */\n id(): string;\n\n /**\n * Get an array of all signatures that extend this signature.\n * @param recursive If false, return only signatures that are immediate\n * children of this signature. If true, return all signatures that are\n * descendants of this signature.\n */\n subSignatures(recursive?: boolean): AlloySignature[];\n\n /**\n * Create a signature from an XML element and populate the signature with\n * atoms. Any signatures that extend the one defined in the element are not\n * created.\n *\n * @param element The XML `````` element\n * @param proxy If provided, a proxied signature with proxied atoms will be\n * returned.\n */\n static fromElement(element: Element, proxy?: AlloyProxy): AlloySignature;\n\n /**\n * Create the Int signature.\n *\n * @param bitwidth The integer bitwidth, which must be greater than or equal to zero.\n * @param proxy If provided, a proxied Int signature with proxied atoms will\n * be returned.\n */\n static intSignature(bitwidth: number, proxy?: AlloyProxy): AlloySignature;\n\n /**\n * TODO: Check and document this.\n * @param intsig\n * @param proxy\n */\n static seqIntSignature(\n intsig: AlloySignature,\n proxy?: AlloyProxy\n ): AlloySignature;\n\n /**\n * Build all signatures from an XML `````` element. All signatures are\n * populated with atoms.\n *\n * @param instance The XML `````` element\n * @param proxy If provided, all signatures and atoms will be proxied.\n * @returns A map of string IDs, as defined by the \"ID\" attribute for each\n * signature, to [[AlloySignature]] objects.\n */\n static signaturesFromXML(\n instance: Element,\n proxy?: AlloyProxy\n ): Map;\n\n /**\n * Get an array of signature types associated with an XML element. Typically\n * this is used when parsing a field or skolem, as each `````` and ``````\n * element will have a `````` child. This method parses the types defined\n * in this element and returns the corresponding signatures.\n *\n * @param element The XML element that has a child\n * @param sigIDs A map of signature IDs to signatures\n */\n static typesFromXML(\n element: Element,\n sigIDs: Map\n ): AlloySignature[];\n}\n\nclass AlloySet {\n protected _tuples: AlloyTuple[];\n\n /**\n * Create a new Alloy set.\n *\n * @param tuples The tuples contained in the set\n */\n constructor(tuples?: AlloyTuple[]);\n\n /**\n * Returns true if the set is empty, false if it is not.\n */\n empty(): boolean;\n\n /**\n * Returns true if this set is equivalent to the provided set, false otherwise.\n * @param that The set to compare to\n */\n equals(that: AlloySet): boolean;\n\n /**\n * Returns true if this set is a subset of the provided set, false otherwise.\n * @param that The set to compare to\n */\n in(that: AlloySet): boolean;\n\n /**\n * Perform a join operation with another set. This operation is equivalent\n * to the dot join operator in Alloy, in which this set is on the left side\n * of the dot and that set is on the right side.\n *\n * @param that The other set\n */\n join(that: AlloySet): AlloySet;\n\n /**\n * Create a printable string representation of this set.\n */\n toString(): string;\n\n /**\n * Get an array of all tuples in this set.\n */\n tuples(): AlloyTuple[];\n}\n\nclass AlloyTuple extends AlloySet {\n private _atoms;\n\n /**\n * Create a new Alloy tuple.\n *\n * @param atoms The atoms, in order, that comprise the tuple.\n */\n constructor(atoms: AlloyAtom[]);\n\n /**\n * Get an ordered list of the atoms in this tuple.\n */\n atoms(): AlloyAtom[];\n\n /**\n * Create a printable string representation of this tuple.\n */\n toString(): string;\n\n /**\n * Create an array of tuples from a node list of `````` XML elements.\n *\n * @param elements A node list of `````` elements, typically created\n * using the ```querySelectorAll()``` method on a `````` or\n * `````` element.\n * @param types An ordered array of signatures that define the type of each\n * atom in each tuple, typically created using [[AlloySignature.typesFromXML]].\n */\n static tuplesFromXML(\n elements: NodeListOf,\n types: AlloySignature[]\n ): AlloyTuple[];\n}\n\nclass AlloyProxy {\n private readonly _sets;\n\n constructor();\n\n applyProxy(set: T, id?: string): T;\n\n private _finalize;\n}\n\n/**\n * In Alloy, an atom is a primitive entity that is indivisible, immutable, and\n * uninterpreted.\n */\nclass AlloyAtom extends AlloySet {\n private readonly _id;\n\n constructor(id: string, proxy?: AlloyProxy);\n\n clone(proxy?: AlloyProxy): AlloyAtom;\n\n id(): string;\n\n static fromElement(element: Element, proxy?: AlloyProxy): AlloyAtom;\n}\n\nclass AlloyTypedSet extends AlloySet {\n private readonly _types;\n\n constructor(types: AlloySignature[], tuples: AlloyTuple[]);\n\n project(atoms: Map): void;\n\n types(): AlloySignature[];\n}\n\nexport class AlloyField extends AlloyTypedSet {\n private readonly _id;\n\n /**\n * Create a new Alloy field.\n * @param id The field's unique ID\n * @param types An array of signatures defining the types of each column of the field\n * @param tuples The tuples defined by the field\n * @param proxy If provided, a proxied signature will be created.\n * @param varName If provided, the variable name to assign to this field when proxied.\n */\n constructor(\n id: string,\n types: AlloySignature[],\n tuples: AlloyTuple[],\n proxy?: AlloyProxy,\n varName?: string\n );\n\n /**\n * Create a clone of this field\n *\n * @param signatures An array of signatures. When creating the clone of this\n * field, the types associated with each column are not cloned. Instead,\n * provide an array of signatures and this method will find the corresponding\n * types by signature ID in the array and use them to define types of the\n * cloned field.\n * @param proxy If provided, a proxied clone will be returned.\n */\n clone(signatures: AlloySignature[], proxy?: AlloyProxy): AlloyField;\n\n /**\n * Get the field ID.\n */\n id(): string;\n\n /**\n * Build all fields from an XML `````` element. All fields are\n * fully populated with tuples.\n *\n * @param instance The XML `````` element\n * @param sigIDs A map of signature string IDs to signature objects\n * @param proxy If provided, all fields will be proxied.\n */\n static fieldsFromXML(\n instance: Element,\n sigIDs: Map,\n proxy?: AlloyProxy\n ): AlloyField[];\n}\n\nclass AlloySkolem extends AlloyTypedSet {\n private readonly _id;\n\n constructor(\n id: string,\n types: AlloySignature[],\n tuples: AlloyTuple[],\n proxy?: AlloyProxy\n );\n\n clone(signatures: AlloySignature[], proxy?: AlloyProxy): AlloySkolem;\n\n id(): string;\n\n static skolemsFromXML(\n instance: Element,\n sigIDs: Map,\n proxy?: AlloyProxy\n ): AlloySkolem[];\n}\n\n/**\n * In Alloy, when you run a predicate or check an assertion, the analyzer\n * searches for an _instance_ of an _analysis constraint_: an assignment of\n * values to the variables of the constraint for which the constraint evaluates\n * to true [[Jackson 2012](http://softwareabstractions.org/)].\n */\nclass AlloyInstance {\n private _proxy;\n private _atoms;\n private _fields;\n private _signatures;\n private _skolems;\n private _projections;\n private _bitwidth;\n private _command;\n private _filename;\n private _sources;\n\n /**\n * Create a new Alloy instance. If no text is provided, an empty instance\n * is created.\n * @param text A string containing the XML output from an Alloy instance\n * @param index\n */\n constructor(text?: string, index?: number);\n\n /**\n * Get an atom by ID.\n * @param id The atom ID\n * @returns An atom or null if there is no atom with the specified ID\n */\n atom(id: string): AlloyAtom | null;\n\n /**\n * Get an array of all atoms in the instance.\n */\n atoms(): AlloyAtom[];\n\n /**\n * Get the bitwidth of the instance.\n */\n bitwidth(): number;\n\n /**\n * Generate a deep clone of the instance.\n * @throws Error if the instance does not have a univ signature.\n */\n clone(): AlloyInstance;\n\n /**\n * Get the command used to generate the instance.\n */\n command(): string;\n\n /**\n * Get a field by ID.\n * @param id The field ID\n * @returns A field or null if there is no field with the specified ID\n */\n field(id: string): AlloyField | null;\n\n /**\n * Get an array of all fields in the instance.\n */\n fields(): AlloyField[];\n\n /**\n * Get the full path of the model used to generate the instance.\n */\n filename(): string;\n\n /**\n * Project the instance over the specified atoms. There may be a maximum of\n * one atom per signature that is a direct descendant of the univ signature.\n * @param atoms The list of atoms over which to project the instance.\n * @returns A clone of the instance with the projection applied.\n * @throws Error if there is more than one atom provided for any signature\n * that is a direct descendant of the univ signature.\n */\n project(atoms: AlloyAtom[]): AlloyInstance;\n\n /**\n * Get the currently projected atoms.\n * @returns A Map object with key-value pairs mapping signatures to projected atoms\n */\n projections(): Map;\n\n /**\n * Get a signature by ID\n * @param id The signature ID\n * @returns A signature or null if there is no signature with the specified ID\n */\n signature(id: string): AlloySignature | null;\n\n /**\n * Get an array of all signatures in the instance.\n */\n signatures(): AlloySignature[];\n\n /**\n * Get a skolem by ID\n * @param id The skolem ID\n * @returns A skolem or null if there is no skolem with the specified ID\n */\n skolem(id: string): AlloySkolem | null;\n\n /**\n * Get an array of all skolems in the instance.\n */\n skolems(): AlloySkolem[];\n\n /**\n * Get all source files that define the model from which this instance was created.\n * @returns A Map object with key-value pairs mapping full path names to file contents\n */\n sources(): Map;\n\n /**\n * Get the univ signature.\n * @returns The univ signature if it exists, null if it does not\n */\n univ(): AlloySignature | null;\n\n private _buildFromXML;\n}",Ma=e=>{const{initialText:t,variables:n,editorRef:s,stageRef:i,beforeUnmount:a,onExecute:l}=e,[c,d]=(0,o.useState)(),p=(0,o.useCallback)((e=>{s(e),d(e)}),[]);return(0,o.useEffect)((()=>{if(c){c.addCommand(Aa.Fd.KeyMod.WinCtrl|Aa.Fd.KeyCode.Enter,(()=>{l()}));const e="ts:filename/alloy.d.js",t=Aa.Fd.Uri.parse(e);null!==Aa.Fd.editor.getModel(t)||(Aa.Fd.languages.typescript.javascriptDefaults.setExtraLibs([{content:Ca,filePath:"alloy.js"}]),Aa.Fd.editor.createModel(Ca,"typescript",t))}}),[c,l,i]),(0,o.useEffect)((()=>{const e=function(e){return e.map((e=>`declare const ${e.name}: ${e.type};`)).join("\n")}(n);Aa.Fd.languages.typescript.javascriptDefaults.setExtraLibs([{content:"\n/**\n * To anyone adding to this library in the future: please take the following steps when adding\n * new VisualObjects.\n *\n * 1. If the object is to be accessible within sterling, add it to library within ScriptViewImports.\n * 2. Add the name of the file, minus .d.ts, to the list within d3lib-def-compiler/src/D3LibDefCompiler.java.\n * 3. Run the typescript compiler (\"tsc\" in terminal) from within the d3-packages folder.\n * 4. Run the main method within D3LibDefCompiler.\n *\n * If these steps are not followed, the file's definitions will either not be accessible within\n * sterling, or will not show up in monaco.\n */\ndeclare type BoundingBoxGenerator = (r: number) => Coords;\ndeclare class VisualObject {\n center: () => Coords;\n children: VisualObject[];\n dependents: VisualObject[];\n bounding_box_lam: BoundingBoxGenerator;\n hasBoundingBox: boolean;\n /**\n * Top level class, which all other visual objects will extend.\n * @param coords position of the object on screen.\n */\n constructor(coords?: Coords | (() => Coords));\n boundingBox(): BoundingBox;\n getChildren(): VisualObject[];\n /**\n * Shifts object to have new given center\n * @param center new center of the object\n */\n setCenter(center: Coords | (() => Coords)): void;\n hasLam(): Boolean;\n getLam(): BoundingBoxGenerator;\n /**\n * Renders the object to the screen.\n * @param svg HTML Svg object to which the object should be rendered.\n */\n render(svg: any): void;\n}\n//# sourceMappingURL=VisualObject.d.ts.map\ninterface ShapeProps {\n center?: Coords | (() => Coords);\n color?: string | (() => string);\n borderWidth?: number | (() => number);\n borderColor?: string | (() => string);\n label?: string | (() => string);\n labelColor?: string | (() => string);\n labelSize?: number | (() => number);\n opacity?: number | (() => number);\n}\n/**\n * Generic class for a large suite of \"shape\"-like objects.\n * Generally includes anything with an inside and an outside.\n * All shapes come with builtin label.\n */\ndeclare class Shape extends VisualObject {\n color: () => string;\n borderWidth: () => number;\n borderColor: () => string;\n opacity: () => number;\n label: TextBox;\n /**\n * Constructs a generic shape object. This is a top-level class,\n * which should not be used except as super class for other specific\n * shapes.\n * @param coords coordinates of the shape\n * @param color color of shape's interior\n * @param borderWidth width of Shape's border\n * @param borderColor color of border\n * @param label text to display atop the shape\n * @param labelColor color of text\n * @param labelSize size of text\n * @param style\n */\n constructor(props: ShapeProps);\n setColor(color: string | (() => string)): void;\n setBorderWidth(borderWidth: number | (() => number)): void;\n setBorderColor(borderColor: string | (() => string)): void;\n setLabelText(text: string | (() => string)): void;\n setLabelColor(labelColor: string | (() => string)): void;\n setLabelSize(labelSize: number | (() => number)): void;\n}\n//# sourceMappingURL=Shape.d.ts.map\ndeclare class Pane {\n Children: VisualObject[];\n constructor();\n add(addNode: VisualObject): void;\n render(svg: any): void;\n}\n//# sourceMappingURL=Pane.d.ts.map\ninterface gridProps {\n grid_location: Coords | (() => Coords);\n cell_size: {\n x_size: number;\n y_size: number;\n };\n grid_dimensions: {\n x_size: number;\n y_size: number;\n };\n}\ndeclare class Grid extends VisualObject {\n /**\n *\n * As one of the most common expressions of a graph is a matrix, we offer functionality\n * for building a grid of cells, where you can add visual objects to each square in the grid,\n * and they are automatically formatted into the grid (where the center of the object is aligned\n * to the center of the grid)\n *\n * Note: grid size is fixed! You can't change the size of a grid once it's created\n *\n */\n private coords;\n config: gridProps;\n cells: Array>;\n gridlines: Array;\n constructor(props: gridProps);\n private check_bounding_box;\n add(coords: Coords, add_object: VisualObject, ignore_warning?: boolean): void;\n private center_helper;\n private fill_grid_lines;\n hide_grid_lines(): void;\n fill(coords: Coords, color: string): void;\n private check_coords;\n}\n{};\n//# sourceMappingURL=Grid.d.ts.map\ninterface RectangleProps extends ShapeProps {\n height: number | (() => number);\n width: number | (() => number);\n coords?: Coords | (() => Coords);\n}\ndeclare class Rectangle extends Shape {\n height: () => number;\n width: () => number;\n /**\n * Creates a logical rectangle object\n * @param height height (y direction)\n * @param width width (x direction)\n * @param coords coordinates of the top-left point\n * @param color color for interior\n * @param borderWidth width of border\n * @param borderColor color of border\n * @param label text for label\n * @param labelColor color for label text\n * @param labelSize size of label text\n */\n constructor(props: RectangleProps);\n boundingBox(): BoundingBox;\n setWidth(width: number | (() => number)): void;\n setHeight(height: number | (() => number)): void;\n render(svg: any): void;\n}\n//# sourceMappingURL=Rectangle.d.ts.map\ninterface CircleProps extends ShapeProps {\n radius: number | (() => number);\n}\ndeclare class Circle extends Shape {\n radius: () => number;\n bounding_box_lam: BoundingBoxGenerator;\n /**\n * Creates a circle object at the given location\n * @param radius radius of circle\n * @param coords coordinates of circle's center\n * @param color color of interior\n * @param borderWidth width border\n * @param borderColor color for border\n * @param label text for label\n * @param labelColor color of label\n * @param labelSize size of label\n */\n constructor(props: CircleProps);\n boundingBox(): BoundingBox;\n setRadius(radius: number | (() => number)): void;\n render(svg: any): void;\n}\n//# sourceMappingURL=Circle.d.ts.map\ndeclare class Stage {\n Children: VisualObject[];\n constructor();\n add(addObject: VisualObject): void;\n children_to_tree_recurse(root: VisualObject): VisTree;\n render(svg: any, document?: any): void;\n}\n//# sourceMappingURL=Stage.d.ts.map\ninterface TextBoxProps {\n text?: string | (() => string);\n coords?: Coords | (() => Coords);\n color?: string | (() => string);\n fontSize?: number | (() => number);\n}\ndeclare class TextBox extends VisualObject {\n text: () => string;\n fontSize: () => number;\n color: () => string;\n /**\n * Displays given text.\n * @param text text to display\n * @param coords location for center of text\n * @param color text color\n * @param fontSize size of the text\n */\n constructor(props: TextBoxProps);\n boundingBox(): BoundingBox;\n setText(text: string | (() => string)): void;\n setFontSize(fontSize: number | (() => number)): void;\n setTextColor(color: string | (() => string)): void;\n render(svg: any): void;\n}\n//# sourceMappingURL=TextBox.d.ts.map\ninterface LineProps {\n points?: Coords[] | (() => Coords)[];\n arrow?: boolean;\n color?: string | (() => string);\n width?: number | (() => number);\n opacity?: number | (() => number);\n style?: string | (() => string);\n}\ndeclare class Line extends VisualObject {\n pointsRelative: (() => Coords)[];\n color: () => string;\n width: () => number;\n opacity: () => number;\n arrow: boolean;\n style: () => string;\n /**\n * Creates a line on the given poitns.\n * @param points list of points for the line to pass through\n * @param color color of line\n * @param width width of line\n * @param opacity of the line\n */\n constructor(props: LineProps);\n boundingBox(): BoundingBox;\n setColor(color: string | (() => string)): void;\n setWidth(width: number | (() => number)): void;\n setOpacity(opacity: number | (() => number)): void;\n render(svg: any): void;\n}\n//# sourceMappingURL=Line.d.ts.map\n/**\n * This class is not currently being used!!\n */\ndeclare class ConjoinedObject extends VisualObject {\n /**\n * Note: this code is untested!\n */\n children: VisualObject[];\n constructor(Children?: VisualObject[]);\n addOrdered(obj: VisualObject, index: number): void;\n add(obj: VisualObject): void;\n setCenter(coords: Coords): void;\n render(svg: any): void;\n}\n//# sourceMappingURL=ConjoinedObject.d.ts.map\ninterface PolygonProps extends ShapeProps {\n points: Coords[] | (() => Coords)[];\n}\n/**\n * Class Representing Polygonal objects. Takes the form of any\n * series of points, and will form a polygon with said points as the boundary.\n */\ndeclare class Polygon extends Shape {\n pointsRelative: (() => Coords)[];\n /**\n * Constructs a polygon object\n * @param points list of points forming outside\n * @param color color of interior\n * @param borderWidth width of the border\n * @param borderColor color of the border\n * @param label text to label with\n * @param labelColor color of label text\n * @param labelSize size of the label\n */\n constructor(props: PolygonProps);\n boundingBox(): BoundingBox;\n render(svg: any): void;\n}\n//# sourceMappingURL=Polygon.d.ts.map\ninterface Node {\n name: string;\n neighbors: string[];\n}\ndeclare class Graph extends VisualObject {\n nodes: Node[];\n node_radius: number;\n fixed_nodes: number;\n graph_dimensions: number;\n node_to_location: any;\n constructor(coords?: Coords, graph_dimensions?: number, fixed_nodes?: number, node_radius?: number);\n setCenter(center: Coords): void;\n center(): {\n x: any;\n y: any;\n };\n add(Nodes: Node[]): void;\n private set_fixed_nodes;\n private set_malleable_nodes;\n check_add_set(Nodes: Node[]): void;\n render(svg: any): void;\n render_lines(svg: any, connections: string[][]): void;\n render_nodes(svg: any): void;\n}\n//# sourceMappingURL=Graph.d.ts.map\n/**\n * This is going to be a generic utility file. Primarily for factoring\n * out algorithms with a higher level of computational complexity.\n */\ndeclare function toFunc(defaultValue: T, t?: T | (() => T)): (() => T);\ninterface Coords {\n x: number;\n y: number;\n}\n/**\n * Generic props for representing a box around an object.\n */\ninterface BoundingBox {\n top_left: Coords;\n bottom_right: Coords;\n}\ndeclare function boxUnion(boxes: BoundingBox[]): {\n top_left: {\n x: number;\n y: number;\n };\n bottom_right: {\n x: number;\n y: number;\n };\n};\ninterface ExperimentalBoundingBox {\n lambda: (radians: number) => Coords;\n}\n/**\n * Simple method averaging the coordinate points in a series.\n * @param points\n * @returns\n */\ndeclare function averagePath(points: Coords[]): Coords;\n/**\n * Shifts a function list of points according to a shift variable\n * @param pointList\n * @param shift\n * @returns\n */\ndeclare function shiftList(pointList: (() => Coords)[], shift: () => Coords): (() => Coords)[];\n/**\n * Utility function returning bounding box for a list of points\n * @param pointList list of points as coords\n * @returns bounding box\n */\ndeclare function boundsOfList(pointList: Coords[]): BoundingBox;\n//# sourceMappingURL=Utility.d.ts.map\n/**\n * Interface for node in a tree with a visualObject\n */\ninterface VisTree {\n visualObject: VisualObject;\n children: VisTree[];\n}\ninterface TreeProps {\n root: VisTree;\n height: number;\n width: number;\n coords?: Coords | (() => Coords);\n edgeColor?: string;\n edgeWidth?: number;\n}\ndeclare class Tree extends VisualObject {\n root: VisTree;\n height: number;\n width: number;\n private lines;\n private subTrees;\n private coords;\n /**\n * Builds a tree object, pulling all children nodes into proper locations and\n * adding lines where necessary.\n * @param root root of the tree of visual objects\n * @param height height of box to bound the tree\n * @param width width of box to bound the tree\n * @param coords top left point of the tree\n */\n constructor(props: TreeProps);\n private setUpSubtrees;\n setLineColor(color: string): void;\n setLineWidth(width: number): void;\n}\n//# sourceMappingURL=Tree.d.ts.map\n",filePath:"helpers.ts"},{content:Ca+"\n"+e,filePath:"alloy.js"},{content:e,filePath:"variables.ts"}])}),[c,n]),(0,r.jsx)(Aa.ZP,{"data-testid":"script-view-monaco-editor",language:"javascript",options:{automaticLayout:!0,scrollBeyondLastLine:!1,scrollbar:{verticalScrollbarSize:12},value:t},editorDidMount:p,editorWillUnmount:e=>{const t=e.getValue();a(t)}})},Ia=e=>{const t=jt(),{datumId:n,button:s,generatorId:i}=e,{text:a,onClick:l,mouseover:c}=s,d=(0,o.useCallback)((()=>{t(_e({id:n,onClick:l,context:{generatorName:i,id:n}}))}),[n,s]);return(0,r.jsx)(Is.u,Object.assign({hasArrow:!0,label:c,isDisabled:void 0===c},{children:(0,r.jsx)(ze,Object.assign({onClick:d},{children:a}))}))},Oa=e=>{const{onExecute:t}=e,n=St(zr),s=jt(),i=(0,o.useCallback)((e=>{s(fa(e))}),[]);return(0,r.jsxs)("div",Object.assign({className:"flex"},{children:[(0,r.jsx)(Is.u,Object.assign({hasArrow:!0,label:""},{children:(0,r.jsx)(S.zx,Object.assign({colorScheme:"blue",size:"xs",onClick:t},{children:"Run"}))})),(0,r.jsxs)(S.hE,Object.assign({className:"pl-2",isAttached:!0,colorScheme:"blue",size:"xs"},{children:[(0,r.jsx)(S.zx,Object.assign({isActive:"div"===n,onClick:()=>i("div")},{children:"
"})),(0,r.jsx)(S.zx,Object.assign({isActive:"canvas"===n,onClick:()=>i("canvas")},{children:""})),(0,r.jsx)(S.zx,Object.assign({isActive:"svg"===n,onClick:()=>i("svg")},{children:""}))]}))]}))},ka=e=>{const{datum:t,onExecute:n}=e,{id:o,parsed:s,buttons:i}=t,a=s.command;return(0,r.jsxs)("div",Object.assign({className:"w-full flex items-center space-x-2 px-2"},{children:[(0,r.jsxs)(k,Object.assign({className:"text-gray-400"},{children:["ID: ",o]})),(0,r.jsx)(k,{children:a}),(0,r.jsx)("div",{className:"grow"}),(0,r.jsx)(Oa,{onExecute:n}),i&&i.map(((e,n)=>(0,r.jsx)(Ia,{datumId:o,generatorId:t.generatorName,button:e},n)))]}))},Na=e=>{const{datum:t}=e,n=jt(),s=(0,ga.pm)(),i=St(zr),a=St(Er),l=St(_r),c=St((e=>Br(e,t))),[d,p]=(0,o.useState)(),[u,h]=(0,o.useState)(null),m=(0,o.useRef)(null);((e,t)=>{const[n,r]=(0,o.useState)();(0,o.useLayoutEffect)((()=>{const n=e.current;if(n){r(n.getBoundingClientRect());const e=new ResizeObserver((e=>{e.forEach((e=>{e.target===n&&(t?t(e.contentRect):r(e.contentRect))}))}));return e.observe(n),()=>{e.unobserve(n)}}}),[e.current])})(m,(e=>{n(ba({width:e.width,height:e.height}))}));const g=(0,o.useCallback)((e=>{p(e)}),[]),x=(0,o.useCallback)((e=>{e&&h(e)}),[]),b=(0,o.useCallback)((e=>{e&&h(e)}),[]),y=(0,o.useCallback)((e=>{e&&h(e)}),[]),w=(0,o.useCallback)((e=>{n(ya(e)),n(wa({id:t.id,text:e}))}),[t]),v=(0,o.useCallback)((()=>{const e=null==d?void 0:d.getValue();if(e&&u&&a){n(ya(e)),n(wa({id:t.id,text:e}));const[r,o]=function(e){const t=e.split("\n"),n=[];let r=0;for(let e=0;e{try{new Function(i,"width","height",...qn.map((e=>e.name)),...c.map((e=>e.name)),...r.map((e=>function(e){return e.replaceAll("-","_")}(e))),o)(u,a.width,a.height,...qn.map((e=>e.value)),...c.map((e=>e.variable)),...e)}catch(e){s({variant:"top-accent",position:"bottom-right",title:e instanceof Error?e.name:"Error",description:Da(e),status:"error",duration:1e4,isClosable:!0})}}))}}),[d,i,u,a,c]);return(0,r.jsxs)(f,{children:[(0,r.jsx)(I,Object.assign({className:"border-b"},{children:(0,r.jsx)(ka,{datum:t,onExecute:v})})),(0,r.jsx)(C,{children:(0,r.jsxs)("div",Object.assign({className:"grid grid-cols-2 divide-x h-full"},{children:[(0,r.jsxs)(f,Object.assign({ref:m,className:"relative"},{children:["div"===i&&(0,r.jsx)("div",{ref:y,className:"w-full h-full"}),"canvas"===i&&(0,r.jsx)("canvas",{ref:b,className:"w-full h-full"}),"svg"===i&&(0,r.jsx)("div",Object.assign({"aria-label":"SVG Visualization",id:"svg-container",style:{height:"100%",width:"100%",overflow:"scroll"}},{children:(0,r.jsx)("svg",{ref:x,style:{width:"100%",height:"100%",backgroundColor:"snow"}})}))]})),(0,r.jsx)(f,Object.assign({className:"relative","aria-label":"Visualization Script","data-testid":"script-editor-pane"},{children:(0,r.jsx)(Ma,{initialText:l,variables:c,editorRef:g,stageRef:u,beforeUnmount:w,onExecute:v})}))]}))})]})};function Da(e){if(!(e instanceof Error))return`${e}`;if(console.log(`Error stack: ${e.stack}`),null!=e.stack){const t=e.stack.match(new RegExp(".*(Function|):[0-9]+:[0-9]+.*","g"));if(t){const n=t[0].split(new RegExp(".*Function:|:"))[1].split(":");console.log(`rowCol: ${JSON.stringify(n)}`);const r=+n[0]-2;return n[1],`${e.message} Around line ${r} (computed via parsing error stack)`}}return`${e.message} (error location was not provided by the browser)`}const za=()=>{const e=St(hr);return e?(0,r.jsx)(Na,{datum:e,"data-testid":"script-view-datum"}):null},Ea=e=>{const{data:t}=e,n={gridTemplateColumns:`repeat(${t.data.length>0?t.data[0].length:0}, minmax(0, 1fr))`,borderCollapse:"collapse",textAlign:"left"};return(0,r.jsxs)("table",Object.assign({className:"prose shadow m-2 boarder prose text-xs font-mono",summary:t.title,role:"table",style:n},{children:[(0,r.jsx)("caption",Object.assign({className:"prose prose-sm font-semibold px-2 py-1 border shadow",style:{textAlign:"left"}},{children:t.title})),(0,r.jsx)("thead",Object.assign({className:"bg-slate-100"},{children:(0,r.jsx)("tr",{children:t.headers&&t.headers.map(((e,t)=>(0,r.jsx)("th",Object.assign({className:"font-semibold px-2 py-0.5",scope:"col","aria-labelledby":e},{children:e}),`header-${t}`)))})})),(0,r.jsx)("tbody",{children:t.data.map(((e,t)=>(0,r.jsx)("tr",{children:e.map(((e,n)=>(0,r.jsx)("td",Object.assign({className:"px-2 py-0.5 bg-white boarder",headers:`header-${n}`},{children:e}),`${t}${n}`)))},`row-${t}`)))})]}))},_a=e=>{const{datum:t}=e,n=St((e=>Rr(e,t)));return(0,r.jsx)(r.Fragment,{children:n.map(((e,t)=>(0,r.jsx)(Ea,{data:e},t)))})},La=e=>{const{datum:t}=e,{id:n,parsed:o,buttons:s}=t,i=o.command;return(0,r.jsxs)("div",Object.assign({className:"w-full flex items-center space-x-2 px-2"},{children:[(0,r.jsxs)(k,Object.assign({className:"text-gray-400"},{children:["ID: ",n]})),(0,r.jsx)(k,{children:i}),(0,r.jsx)("div",{className:"grow"}),s&&s.map(((e,o)=>(0,r.jsx)(Ia,{datumId:n,generatorId:t.generatorName,button:e},o)))]}))},Ta=()=>{const e=St(hr);return e?(0,r.jsxs)(f,{children:[(0,r.jsx)(I,{children:(0,r.jsx)(La,{datum:e})}),(0,r.jsx)(C,{children:(0,r.jsx)("div",Object.assign({className:"w-full h-full flex content-start items-start flex-wrap overflow-y-auto"},{children:(0,r.jsx)(_a,{datum:e})}))})]}):null},Pa=()=>{const e=St(Cr);return(0,r.jsxs)(f,{children:["GraphView"===e&&(0,r.jsx)(ma,{}),"TableView"===e&&(0,r.jsx)(Ta,{}),"ScriptView"===e&&(0,r.jsx)(za,{})]})};var Ba=n(97375);const Ra=e=>{const{isConnected:t}=e,n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{const t=St(Sr),n=St(kr),o=t?`Connected to ${n}`:"Not connected to a provider",s=t?"Connected":"Disconnected";return(0,r.jsx)(Is.u,Object.assign({hasArrow:!0,label:o},{children:(0,r.jsxs)(c.M5,Object.assign({},e,{children:[(0,r.jsx)(Ra,{isConnected:t}),(0,r.jsx)(c.xv,Object.assign({mx:1,userSelect:"none"},{children:s}))]}))}))};var Va=n(45073),Fa=n(33441);const Ga=function(e,t){const{name:n,generators:r,features:o}=t.payload;e.providerName=n||"unknown provider",e.providerGenerators=null==r?void 0:r.slice(),e.features=(null==o?void 0:o.slice())||[]},Za=function(e){e.connected=!0},Wa=function(e){e.connected=!1},Ua=(0,Ee.oM)({name:"provider",initialState:{connected:!1,providerName:"unknown provider",providerGenerators:void 0,features:[],synthesisEnabled:!1},reducers:{synthesisFeatureEnabled(e,t){e.synthesisEnabled=t.payload}},extraReducers:e=>e.addCase($e,Ga).addCase(Ge,Za).addCase(We,Wa)}),{synthesisFeatureEnabled:qa}=Ua.actions,Ya=Ua.reducer,Xa=e=>t=>n=>{const r=t(n);if(Be.match(n))try{const t=e.getState(),o=t.synthesis;if(o.isActive&&o.currentStep>0&&o.currentStep<=o.numInstances){const s=n.payload;if(s.enter&&s.enter.length>0&&window.CndCore){const n=s.enter[s.enter.length-1],i=t.data.datumById[t.data.active||""];if(console.log("[SynthesisMiddleware] New datum received:",{newDatumId:n.id,activeDatumId:null==i?void 0:i.id,generatorMatch:n.generatorName===(null==i?void 0:i.generatorName),currentStep:o.currentStep,numInstances:o.numInstances}),n.generatorName===(null==i?void 0:i.generatorName)){console.log("[SynthesisMiddleware] New instance from same generator, loading for synthesis");const t=window.CndCore.AlloyInstance.parseAlloyXML(n.data);if(t.instances&&t.instances.length>0){const n=new window.CndCore.AlloyDataInstance(t.instances[0]);if(function(e){var t;try{return((null===(t=e.getTypes)||void 0===t?void 0:t.call(e))||[]).some((e=>{var t;return"No more instances! Some equivalent instances may have been removed through symmetry breaking."===(e.id||(null===(t=e.getId)||void 0===t?void 0:t.call(e))||"")}))}catch(e){return!1}}(n))return console.log("[SynthesisMiddleware] No more instances available from Forge"),e.dispatch(ci()),r;const s=[...o.loadedInstances,n];console.log("[SynthesisMiddleware] Loaded instance, total now:",s.length),e.dispatch(ai({instances:s}))}}}}}catch(e){console.error("[SynthesisMiddleware] Failed to load new instance:",e)}return r},Ha=function(e,t){const{id:n,result:r}=t.payload;e.expressionsById[n].result=r},Ja=function(e,t){const{id:n,datumId:r,expression:o}=t.payload,s=e.orderByDatumId[r]||[];e.nextExpressionId+=1,e.expressionsById[n]={id:n,datumId:r,expression:o,result:""},e.orderByDatumId[r]=[n,...s]},Qa=(0,Ee.oM)({name:"evaluator",initialState:{nextExpressionId:0,expressionsById:{},orderByDatumId:{}},reducers:{},extraReducers:e=>e.addCase(Re,Ha).addCase(Te,Ja)}),{}=Qa.actions,Ka=Qa.reducer;function el(e){return{type:"message",time:(new Date).toJSON(),text:e}}function tl(e){return{type:"error",time:(new Date).toJSON(),text:e}}const nl=function(e,t){e.items.push(el(`Datum selected - Datum ID: ${t.payload}`))},rl=function(e,t){const{id:n,onClick:r}=t.payload;e.items.push(el(`Click button - Datum ID: ${n} - Button: ${r}`))},ol=function(e,t){const{enter:n,update:r,exit:o}=t.payload,s=(null==n?void 0:n.length)||0,i=(null==r?void 0:r.length)||0,a=(null==o?void 0:o.length)||0;e.items.push(el(`Receive data: ${s} enter, ${i} update, ${a} exit.`))},sl=function(e){e.items.push(el("Request data."))},il=function(e,t){const{name:n}=t.payload;e.items.push(el(`Receive metadata from ${n}.`))},al=function(e){e.items.push(el("Connection established."))},ll=function(e,t){e.items.push(tl(t.payload))},cl=function(e){e.items.push(el("Connection lost."))},dl=function(e,t){e.items.push(tl(t.payload))},pl=(0,Ee.oM)({name:"log",initialState:{items:[],filters:["message","warning","error"],sort:"ascending"},reducers:{filtersChanged:function(e,t){e.filters=t.payload},logCleared:function(e){e.items=[]},sortOrderChanged:function(e,t){e.sort=t.payload}},extraReducers:e=>e.addCase(_s,nl).addCase(_e,rl).addCase(Be,ol).addCase(Le,sl).addCase($e,il).addCase(Ge,al).addCase(Ze,ll).addCase(We,cl).addCase(Ue,dl)}),{logCleared:ul,sortOrderChanged:hl,filtersChanged:ml}=pl.actions,gl=pl.reducer,xl=(0,Ee.xC)({reducer:{data:Ts,evaluator:Ka,graphs:ss,log:gl,provider:Ya,script:va,synthesis:yi,ui:Qs},middleware:e=>e({serializableCheck:{ignoredPaths:["synthesis.loadedInstances"],ignoredActionPaths:["payload.instances"]}}).prepend(function(){let e=null,t=0;const n=()=>{window.clearInterval(t),t=0},r=()=>{e&&e.close()},o=()=>{e&&e.send("ping")},s=(i,a)=>{const l=i.dispatch;let c=!1;e&&r(),a=a||`ws://localhost:${window.location.search.slice(1)}`,e=new WebSocket(a),e.onopen=()=>{c=!0,window.setTimeout((()=>o()),3e3),l(Ge()),n()},e.onclose=()=>{c&&(c=!1,l(We())),e&&e.readyState===WebSocket.CLOSED&&(n(),t=window.setInterval((()=>s(i,a)),1e3))},e.onmessage=e=>{"pong"===e.data?window.setTimeout((()=>o()),3e3):yt(e.data,i)}};return t=>n=>o=>(Ve.match(o)?s(t,o.payload):Fe.match(o)?r():_e.match(o)?function(e,t,n){if(!e)return wt(t);vt(e,function(e,t){return{type:"click",version:1,payload:t}}(0,n))}(e,t,o.payload):Le.match(o)?function(e,t){if(!e)return wt(t);vt(e,{type:"data",version:1})}(e,t):Te.match(o)?function(e,t,n){if(!e)return wt(t);vt(e,function(e,t){return{type:"eval",version:1,payload:t}}(0,n))}(e,t,o.payload):Pe.match(o)&&function(e,t){if(!e)return wt(t);vt(e,{type:"meta",version:1})}(e,t),n(o))}(),(e=>t=>n=>{if(!Ge.match(n))return t(n);t(n),e.dispatch(Pe()),e.dispatch(Le())}),Xa)});function fl({isOpen:e,onClose:t}){const n=(0,o.useRef)(null);let[s,i]=(0,o.useState)("");const a=(0,ga.pm)(),l=(0,o.useRef)(null);return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(Va.u_,Object.assign({isOpen:e,onClose:t},{children:[(0,r.jsx)(Va.ZA,{}),(0,r.jsxs)(Va.hz,Object.assign({maxW:"70rem"},{children:[(0,r.jsx)(Va.xB,{children:(0,r.jsx)(c.M5,{children:"Input Alloy-style XML datum (paste directly or load from file)"})}),(0,r.jsx)(Va.ol,{}),(0,r.jsxs)(Va.fe,Object.assign({pb:6},{children:[(0,r.jsx)(S.zx,Object.assign({onClick:()=>{var e;return null===(e=l.current)||void 0===e?void 0:e.click()}},{children:"Click to add XML from file"})),' ...or simply paste in an XML datum below. Then click the "Add Datum" button.',(0,r.jsx)(c.LZ,{h:"1rem"}),(0,r.jsx)(c.iz,{orientation:"horizontal",mx:5}),(0,r.jsx)(c.LZ,{h:"1rem"}),(0,r.jsxs)(vi.NI,{children:[(0,r.jsx)(vi.lX,{children:"XML datum string to add"}),(0,r.jsx)(Fa.g,{minH:"20rem",ref:n,placeholder:'\n\n \n \n \n\n\n',value:s,onChange:e=>i(e.target.value)})]})]})),(0,r.jsxs)(Va.mz,{children:[(0,r.jsx)(S.zx,Object.assign({onClick:()=>{var e;const r=null===(e=n.current)||void 0===e?void 0:e.value;if(void 0===r)return void t();const o=xl.getState().data.datumIds;console.log(o);const s=o.reduce(((e,t)=>isNaN(parseInt(t))?e:Math.max(e,parseInt(t)+1)),0);try{xl.dispatch(Be({enter:[bt({id:s.toString(),format:"alloy",data:r,buttons:[],evaluator:!1})],update:[],exit:[]}))}catch(e){a({variant:"top-accent",position:"bottom-right",title:e instanceof Error?e.name:"Error adding instance",description:e instanceof Error?e.message:"No further information is available.",status:"error",duration:1e4,isClosable:!0})}t()}},{children:"Add Datum"})),(0,r.jsx)(Ci.II,{type:"file",ref:l,style:{display:"none"},onChange:e=>{var t;const n=new FileReader;n.onload=e=>{return t=this,n=void 0,o=function*(){var t;(null===(t=e.target)||void 0===t?void 0:t.result)&&(e.target.result instanceof ArrayBuffer?i(e.target.result.toString()):i(e.target.result))},new((r=void 0)||(r=Promise))((function(e,s){function i(e){try{l(o.next(e))}catch(e){s(e)}}function a(e){try{l(o.throw(e))}catch(e){s(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(i,a)}l((o=o.apply(t,n||[])).next())}));var t,n,r,o},(null===(t=e.target)||void 0===t?void 0:t.files)&&e.target.files.length>0&&n.readAsText(e.target.files[0])}})]})]}))]}))})}function bl({isOpen:e,onClose:t}){const n=St(Cr);return(0,r.jsx)(r.Fragment,{children:(0,r.jsxs)(Va.u_,Object.assign({isOpen:e,onClose:t},{children:[(0,r.jsx)(Va.ZA,{}),(0,r.jsxs)(Va.hz,Object.assign({maxW:"70rem"},{children:[(0,r.jsx)(Va.xB,{children:(0,r.jsx)(c.M5,{children:"Using Spytial Sterling"})}),(0,r.jsx)(Va.ol,{}),(0,r.jsxs)(Va.fe,Object.assign({pb:6},{children:[(0,r.jsxs)(c.xu,Object.assign({as:"ul",listStyleType:"circle"},{children:[(0,r.jsxs)("li",{children:["Use the ",(0,r.jsx)("strong",{children:"evaluator"})," tab to query the value of expressions and constraints."]}),(0,r.jsxs)("li",{children:["The ",(0,r.jsx)("strong",{children:"explorer"})," tab lets you pick a run to visualize. Click on any prior instance to reload it in the visualizer."]})]})),(0,r.jsx)(c.iz,{orientation:"horizontal",colorScheme:"blackAlpha"}),"ScriptView"===n&&(0,r.jsx)(wl,{}),"GraphView"===n&&(0,r.jsx)(yl,{}),"TableView"===n&&(0,r.jsx)(vl,{})]}))]}))]}))})}function yl(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.M5,{children:(0,r.jsx)("strong",{children:"Graph View"})}),(0,r.jsxs)(c.xu,Object.assign({as:"ul",listStyleType:"circle"},{children:[(0,r.jsxs)("li",{children:[(0,r.jsx)("strong",{children:"Zoom"})," with the mouse wheel or with ",(0,r.jsx)("em",{children:"two fingers"})," on the trackpad."]}),(0,r.jsxs)("li",{children:["Use the ",(0,r.jsx)("strong",{children:"theme"})," tab on the sidebar to adjust styling options such as node coloring by sig, source and destination for edges, etc. You can also save the theme-definition file or load one you've already created."]}),(0,r.jsxs)("li",{children:["The ",(0,r.jsx)("strong",{children:"time"})," tab will let you adjust the layout according to time index, if that is appropriate for your model. In a Temporal model, you'll see a minimap and have the option to move back and forth in time. In a model that isn't explicitly temporal, you can still declare a sig as the time index and use it to navigate."]}),(0,r.jsxs)("li",{children:["The ",(0,r.jsx)("strong",{children:"layout"})," tab opens the CnD interface, which is an alternative graph-based visualization that gives more control over your instance diagram."]})]}))]})}function wl(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.M5,{children:(0,r.jsx)("strong",{children:"Script View"})}),(0,r.jsx)(c.xu,{as:"ul",listStyleType:"circle"})]})}function vl(){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(c.M5,{children:(0,r.jsx)("strong",{children:"Table View"})}),(0,r.jsx)(c.xu,{as:"ul",listStyleType:"circle"})]})}const jl=()=>{const e=jt(),t=(0,Ba.qY)(),n=(0,Ba.qY)();return(0,r.jsxs)(E,Object.assign({"data-testid":"app-status-bar"},{children:[(0,r.jsxs)("div",Object.assign({className:"cursor-pointer transition-colors hover:text-white",onClick:n.onOpen},{children:[(0,r.jsx)(c.LZ,{width:"50px"}),(0,r.jsx)(c.M5,{children:(0,r.jsx)("strong",{children:"Help"})})]})),(0,r.jsx)(bl,{isOpen:n.isOpen,onClose:n.onClose}),(0,r.jsx)(c.iz,{orientation:"vertical",mx:2}),(0,r.jsx)(c.LZ,{}),(0,r.jsx)(c.iz,{orientation:"vertical",mx:2}),(0,r.jsx)("div",Object.assign({className:"cursor-pointer transition-colors hover:text-white",onClick:t.onOpen},{children:"Manual Datum"})),(0,r.jsx)(fl,{isOpen:t.isOpen,onClose:t.onClose}),(0,r.jsx)(c.iz,{orientation:"vertical",mx:2}),(0,r.jsx)("div",Object.assign({className:"cursor-pointer transition-colors hover:text-white",onClick:()=>{e(Ls())}},{children:"Console Dump"})),(0,r.jsx)(c.iz,{orientation:"vertical",mx:2}),(0,r.jsx)($a,{})]}))},Sl={layout:{drawerWidth:350,drawerMinWidth:100,drawerMaxWidth:600,explorerWidth:250,explorerMinWidth:60,explorerMaxWidth:250}};var Al=n(93379),Cl=n.n(Al),Ml=n(7795),Il=n.n(Ml),Ol=n(90569),kl=n.n(Ol),Nl=n(3565),Dl=n.n(Nl),zl=n(19216),El=n.n(zl),_l=n(44589),Ll=n.n(_l),Tl=n(50992),Pl={};Pl.styleTagTransform=Ll(),Pl.setAttributes=Dl(),Pl.insert=kl().bind(null,"head"),Pl.domAPI=Il(),Pl.insertStyleElement=El(),Cl()(Tl.Z,Pl),Tl.Z&&Tl.Z.locals&&Tl.Z.locals,s.render((0,r.jsx)(o.StrictMode,{children:(0,r.jsx)(a.xjn,Object.assign({theme:L},{children:(0,r.jsx)(i.zt,Object.assign({store:xl},{children:(0,r.jsx)((e=>{const{url:t}=e,{layout:n}=Sl,s=jt(),i=St(br);return(0,o.useEffect)((()=>(s(Ve(t)),()=>{s(Fe())})),[t,s]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(m,Object.assign({rightPaneCollapsed:i,rightPaneInitialWidth:n.drawerWidth,rightPaneMinWidth:n.drawerMinWidth,rightPaneMaxWidth:n.drawerMaxWidth},{children:[(0,r.jsx)(Pa,{}),(0,r.jsx)(Hi,{})]})),(0,r.jsx)(oa,{}),(0,r.jsx)(Ki,{}),(0,r.jsx)(jl,{})]})}),{url:void 0})}))}))}),document.getElementById("root"))},50992:(e,t,n)=>{n.d(t,{Z:()=>b});var r=n(8081),o=n.n(r),s=n(23645),i=n.n(s),a=n(61667),l=n.n(a),c=new URL(n(70909),n.b),d=new URL(n(133),n.b),p=new URL(n(23601),n.b),u=new URL(n(1686),n.b),h=i()(o()),m=l()(c),g=l()(d),x=l()(p),f=l()(u);h.push([e.id,"/*\n! tailwindcss v3.0.13 | MIT License | https://tailwindcss.com\n*//*\n1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)\n2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)\n*/\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: #e5e7eb; /* 2 */\n}\n\n::before,\n::after {\n --tw-content: '';\n}\n\n/*\n1. Use a consistent sensible line-height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n3. Use a more readable tab size.\n4. Use the user's configured `sans` font-family by default.\n*/\n\nhtml {\n line-height: 1.5; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n -moz-tab-size: 4; /* 3 */\n -o-tab-size: 4;\n tab-size: 4; /* 3 */\n font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"; /* 4 */\n}\n\n/*\n1. Remove the margin in all browsers.\n2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.\n*/\n\nbody {\n margin: 0; /* 1 */\n line-height: inherit; /* 2 */\n}\n\n/*\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n3. Ensure horizontal rules are visible by default.\n*/\n\nhr {\n height: 0; /* 1 */\n color: inherit; /* 2 */\n border-top-width: 1px; /* 3 */\n}\n\n/*\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n}\n\n/*\nRemove the default font size and weight for headings.\n*/\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/*\nReset links to optimize for opt-in styling instead of opt-out.\n*/\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/*\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/*\n1. Use the user's configured `mono` font family by default.\n2. Correct the odd `em` font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/*\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n font-size: 80%;\n}\n\n/*\nPrevent `sub` and `sup` elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/*\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n3. Remove gaps between table borders by default.\n*/\n\ntable {\n text-indent: 0; /* 1 */\n border-color: inherit; /* 2 */\n border-collapse: collapse; /* 3 */\n}\n\n/*\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n3. Remove default padding in all browsers.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font-family: inherit; /* 1 */\n font-size: 100%; /* 1 */\n line-height: inherit; /* 1 */\n color: inherit; /* 1 */\n margin: 0; /* 2 */\n padding: 0; /* 3 */\n}\n\n/*\nRemove the inheritance of text transform in Edge and Firefox.\n*/\n\nbutton,\nselect {\n text-transform: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Remove default button styles.\n*/\n\nbutton,\n[type='button'],\n[type='reset'],\n[type='submit'] {\n -webkit-appearance: button; /* 1 */\n background-color: transparent; /* 2 */\n background-image: none; /* 2 */\n}\n\n/*\nUse the modern Firefox focus style for all focusable elements.\n*/\n\n:-moz-focusring {\n outline: auto;\n}\n\n/*\nRemove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)\n*/\n\n:-moz-ui-invalid {\n box-shadow: none;\n}\n\n/*\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n vertical-align: baseline;\n}\n\n/*\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/*\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type='search'] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/*\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/*\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to `inherit` in Safari.\n*/\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n display: list-item;\n}\n\n/*\nRemoves the default spacing and border for appropriate elements.\n*/\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nlegend {\n padding: 0;\n}\n\nol,\nul,\nmenu {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/*\nPrevent resizing textareas horizontally by default.\n*/\n\ntextarea {\n resize: vertical;\n}\n\n/*\n1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)\n2. Set the default placeholder color to the user's configured gray 400 color.\n*/\n\ninput::-moz-placeholder, textarea::-moz-placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\ninput:-ms-input-placeholder, textarea:-ms-input-placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\ninput::placeholder,\ntextarea::placeholder {\n opacity: 1; /* 1 */\n color: #9ca3af; /* 2 */\n}\n\n/*\nSet the default cursor for buttons.\n*/\n\nbutton,\n[role=\"button\"] {\n cursor: pointer;\n}\n\n/*\nMake sure disabled buttons don't get the pointer cursor.\n*/\n:disabled {\n cursor: default;\n}\n\n/*\n1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)\n2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)\n This can trigger a poorly considered lint error in some tools but is included by design.\n*/\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block; /* 1 */\n vertical-align: middle; /* 2 */\n}\n\n/*\nConstrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)\n*/\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/*\nEnsure the default browser behavior of the `hidden` attribute.\n*/\n\n[hidden] {\n display: none;\n}\n\n[type='text'],[type='email'],[type='url'],[type='password'],[type='number'],[type='date'],[type='datetime-local'],[type='month'],[type='search'],[type='tel'],[type='time'],[type='week'],[multiple],textarea,select {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n background-color: #fff;\n border-color: #6b7280;\n border-width: 1px;\n border-radius: 0px;\n padding-top: 0.5rem;\n padding-right: 0.75rem;\n padding-bottom: 0.5rem;\n padding-left: 0.75rem;\n font-size: 1rem;\n line-height: 1.5rem;\n --tw-shadow: 0 0 #0000;\n}\n\n[type='text']:focus, [type='email']:focus, [type='url']:focus, [type='password']:focus, [type='number']:focus, [type='date']:focus, [type='datetime-local']:focus, [type='month']:focus, [type='search']:focus, [type='tel']:focus, [type='time']:focus, [type='week']:focus, [multiple]:focus, textarea:focus, select:focus {\n outline: 2px solid transparent;\n outline-offset: 2px;\n --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: #2563eb;\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n border-color: #2563eb;\n}\n\ninput::-moz-placeholder, textarea::-moz-placeholder {\n color: #6b7280;\n opacity: 1;\n}\n\ninput:-ms-input-placeholder, textarea:-ms-input-placeholder {\n color: #6b7280;\n opacity: 1;\n}\n\ninput::placeholder,textarea::placeholder {\n color: #6b7280;\n opacity: 1;\n}\n\n::-webkit-datetime-edit-fields-wrapper {\n padding: 0;\n}\n\n::-webkit-date-and-time-value {\n min-height: 1.5em;\n}\n\nselect {\n background-image: url("+m+");\n background-position: right 0.5rem center;\n background-repeat: no-repeat;\n background-size: 1.5em 1.5em;\n padding-right: 2.5rem;\n -webkit-print-color-adjust: exact;\n color-adjust: exact;\n}\n\n[multiple] {\n background-image: initial;\n background-position: initial;\n background-repeat: unset;\n background-size: initial;\n padding-right: 0.75rem;\n -webkit-print-color-adjust: unset;\n color-adjust: unset;\n}\n\n[type='checkbox'],[type='radio'] {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n padding: 0;\n -webkit-print-color-adjust: exact;\n color-adjust: exact;\n display: inline-block;\n vertical-align: middle;\n background-origin: border-box;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n flex-shrink: 0;\n height: 1rem;\n width: 1rem;\n color: #2563eb;\n background-color: #fff;\n border-color: #6b7280;\n border-width: 1px;\n --tw-shadow: 0 0 #0000;\n}\n\n[type='checkbox'] {\n border-radius: 0px;\n}\n\n[type='radio'] {\n border-radius: 100%;\n}\n\n[type='checkbox']:focus,[type='radio']:focus {\n outline: 2px solid transparent;\n outline-offset: 2px;\n --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/);\n --tw-ring-offset-width: 2px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: #2563eb;\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n}\n\n[type='checkbox']:checked,[type='radio']:checked {\n border-color: transparent;\n background-color: currentColor;\n background-size: 100% 100%;\n background-position: center;\n background-repeat: no-repeat;\n}\n\n[type='checkbox']:checked {\n background-image: url("+g+");\n}\n\n[type='radio']:checked {\n background-image: url("+x+");\n}\n\n[type='checkbox']:checked:hover,[type='checkbox']:checked:focus,[type='radio']:checked:hover,[type='radio']:checked:focus {\n border-color: transparent;\n background-color: currentColor;\n}\n\n[type='checkbox']:indeterminate {\n background-image: url("+f+');\n border-color: transparent;\n background-color: currentColor;\n background-size: 100% 100%;\n background-position: center;\n background-repeat: no-repeat;\n}\n\n[type=\'checkbox\']:indeterminate:hover,[type=\'checkbox\']:indeterminate:focus {\n border-color: transparent;\n background-color: currentColor;\n}\n\n[type=\'file\'] {\n background: unset;\n border-color: inherit;\n border-width: 0;\n border-radius: 0;\n padding: 0;\n font-size: unset;\n line-height: inherit;\n}\n\n[type=\'file\']:focus {\n outline: 1px auto -webkit-focus-ring-color;\n}\n\n*, ::before, ::after {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n --tw-pan-x: ;\n --tw-pan-y: ;\n --tw-pinch-zoom: ;\n --tw-scroll-snap-strictness: proximity;\n --tw-ordinal: ;\n --tw-slashed-zero: ;\n --tw-numeric-figure: ;\n --tw-numeric-spacing: ;\n --tw-numeric-fraction: ;\n --tw-ring-inset: ;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: rgb(59 130 246 / 0.5);\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n --tw-blur: ;\n --tw-brightness: ;\n --tw-contrast: ;\n --tw-grayscale: ;\n --tw-hue-rotate: ;\n --tw-invert: ;\n --tw-saturate: ;\n --tw-sepia: ;\n --tw-drop-shadow: ;\n --tw-backdrop-blur: ;\n --tw-backdrop-brightness: ;\n --tw-backdrop-contrast: ;\n --tw-backdrop-grayscale: ;\n --tw-backdrop-hue-rotate: ;\n --tw-backdrop-invert: ;\n --tw-backdrop-opacity: ;\n --tw-backdrop-saturate: ;\n --tw-backdrop-sepia: ;\n}\n.container {\n width: 100%;\n}\n@media (min-width: 640px) {\n\n .container {\n max-width: 640px;\n }\n}\n@media (min-width: 768px) {\n\n .container {\n max-width: 768px;\n }\n}\n@media (min-width: 1024px) {\n\n .container {\n max-width: 1024px;\n }\n}\n@media (min-width: 1280px) {\n\n .container {\n max-width: 1280px;\n }\n}\n@media (min-width: 1536px) {\n\n .container {\n max-width: 1536px;\n }\n}\n.prose {\n color: var(--tw-prose-body);\n max-width: 65ch;\n}\n.prose :where([class~="lead"]):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-lead);\n font-size: 1.25em;\n line-height: 1.6;\n margin-top: 1.2em;\n margin-bottom: 1.2em;\n}\n.prose :where(a):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-links);\n text-decoration: underline;\n font-weight: 500;\n}\n.prose :where(strong):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-bold);\n font-weight: 600;\n}\n.prose :where(ol):not(:where([class~="not-prose"] *)) {\n list-style-type: decimal;\n padding-left: 1.625em;\n}\n.prose :where(ol[type="A"]):not(:where([class~="not-prose"] *)) {\n list-style-type: upper-alpha;\n}\n.prose :where(ol[type="a"]):not(:where([class~="not-prose"] *)) {\n list-style-type: lower-alpha;\n}\n.prose :where(ol[type="A" s]):not(:where([class~="not-prose"] *)) {\n list-style-type: upper-alpha;\n}\n.prose :where(ol[type="a" s]):not(:where([class~="not-prose"] *)) {\n list-style-type: lower-alpha;\n}\n.prose :where(ol[type="I"]):not(:where([class~="not-prose"] *)) {\n list-style-type: upper-roman;\n}\n.prose :where(ol[type="i"]):not(:where([class~="not-prose"] *)) {\n list-style-type: lower-roman;\n}\n.prose :where(ol[type="I" s]):not(:where([class~="not-prose"] *)) {\n list-style-type: upper-roman;\n}\n.prose :where(ol[type="i" s]):not(:where([class~="not-prose"] *)) {\n list-style-type: lower-roman;\n}\n.prose :where(ol[type="1"]):not(:where([class~="not-prose"] *)) {\n list-style-type: decimal;\n}\n.prose :where(ul):not(:where([class~="not-prose"] *)) {\n list-style-type: disc;\n padding-left: 1.625em;\n}\n.prose :where(ol > li):not(:where([class~="not-prose"] *))::marker {\n font-weight: 400;\n color: var(--tw-prose-counters);\n}\n.prose :where(ul > li):not(:where([class~="not-prose"] *))::marker {\n color: var(--tw-prose-bullets);\n}\n.prose :where(hr):not(:where([class~="not-prose"] *)) {\n border-color: var(--tw-prose-hr);\n border-top-width: 1px;\n margin-top: 3em;\n margin-bottom: 3em;\n}\n.prose :where(blockquote):not(:where([class~="not-prose"] *)) {\n font-weight: 500;\n font-style: italic;\n color: var(--tw-prose-quotes);\n border-left-width: 0.25rem;\n border-left-color: var(--tw-prose-quote-borders);\n quotes: "\\201C""\\201D""\\2018""\\2019";\n margin-top: 1.6em;\n margin-bottom: 1.6em;\n padding-left: 1em;\n}\n.prose :where(blockquote p:first-of-type):not(:where([class~="not-prose"] *))::before {\n content: open-quote;\n}\n.prose :where(blockquote p:last-of-type):not(:where([class~="not-prose"] *))::after {\n content: close-quote;\n}\n.prose :where(h1):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-headings);\n font-weight: 800;\n font-size: 2.25em;\n margin-top: 0;\n margin-bottom: 0.8888889em;\n line-height: 1.1111111;\n}\n.prose :where(h1 strong):not(:where([class~="not-prose"] *)) {\n font-weight: 900;\n}\n.prose :where(h2):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-headings);\n font-weight: 700;\n font-size: 1.5em;\n margin-top: 2em;\n margin-bottom: 1em;\n line-height: 1.3333333;\n}\n.prose :where(h2 strong):not(:where([class~="not-prose"] *)) {\n font-weight: 800;\n}\n.prose :where(h3):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-headings);\n font-weight: 600;\n font-size: 1.25em;\n margin-top: 1.6em;\n margin-bottom: 0.6em;\n line-height: 1.6;\n}\n.prose :where(h3 strong):not(:where([class~="not-prose"] *)) {\n font-weight: 700;\n}\n.prose :where(h4):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-headings);\n font-weight: 600;\n margin-top: 1.5em;\n margin-bottom: 0.5em;\n line-height: 1.5;\n}\n.prose :where(h4 strong):not(:where([class~="not-prose"] *)) {\n font-weight: 700;\n}\n.prose :where(figure > *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n margin-bottom: 0;\n}\n.prose :where(figcaption):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-captions);\n font-size: 0.875em;\n line-height: 1.4285714;\n margin-top: 0.8571429em;\n}\n.prose :where(code):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-code);\n font-weight: 600;\n font-size: 0.875em;\n}\n.prose :where(code):not(:where([class~="not-prose"] *))::before {\n content: "`";\n}\n.prose :where(code):not(:where([class~="not-prose"] *))::after {\n content: "`";\n}\n.prose :where(a code):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-links);\n}\n.prose :where(pre):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-pre-code);\n background-color: var(--tw-prose-pre-bg);\n overflow-x: auto;\n font-weight: 400;\n font-size: 0.875em;\n line-height: 1.7142857;\n margin-top: 1.7142857em;\n margin-bottom: 1.7142857em;\n border-radius: 0.375rem;\n padding-top: 0.8571429em;\n padding-right: 1.1428571em;\n padding-bottom: 0.8571429em;\n padding-left: 1.1428571em;\n}\n.prose :where(pre code):not(:where([class~="not-prose"] *)) {\n background-color: transparent;\n border-width: 0;\n border-radius: 0;\n padding: 0;\n font-weight: inherit;\n color: inherit;\n font-size: inherit;\n font-family: inherit;\n line-height: inherit;\n}\n.prose :where(pre code):not(:where([class~="not-prose"] *))::before {\n content: none;\n}\n.prose :where(pre code):not(:where([class~="not-prose"] *))::after {\n content: none;\n}\n.prose :where(table):not(:where([class~="not-prose"] *)) {\n width: 100%;\n table-layout: auto;\n text-align: left;\n margin-top: 2em;\n margin-bottom: 2em;\n font-size: 0.875em;\n line-height: 1.7142857;\n}\n.prose :where(thead):not(:where([class~="not-prose"] *)) {\n border-bottom-width: 1px;\n border-bottom-color: var(--tw-prose-th-borders);\n}\n.prose :where(thead th):not(:where([class~="not-prose"] *)) {\n color: var(--tw-prose-headings);\n font-weight: 600;\n vertical-align: bottom;\n padding-right: 0.5714286em;\n padding-bottom: 0.5714286em;\n padding-left: 0.5714286em;\n}\n.prose :where(tbody tr):not(:where([class~="not-prose"] *)) {\n border-bottom-width: 1px;\n border-bottom-color: var(--tw-prose-td-borders);\n}\n.prose :where(tbody tr:last-child):not(:where([class~="not-prose"] *)) {\n border-bottom-width: 0;\n}\n.prose :where(tbody td):not(:where([class~="not-prose"] *)) {\n vertical-align: baseline;\n padding-top: 0.5714286em;\n padding-right: 0.5714286em;\n padding-bottom: 0.5714286em;\n padding-left: 0.5714286em;\n}\n.prose {\n --tw-prose-body: #374151;\n --tw-prose-headings: #111827;\n --tw-prose-lead: #4b5563;\n --tw-prose-links: #111827;\n --tw-prose-bold: #111827;\n --tw-prose-counters: #6b7280;\n --tw-prose-bullets: #d1d5db;\n --tw-prose-hr: #e5e7eb;\n --tw-prose-quotes: #111827;\n --tw-prose-quote-borders: #e5e7eb;\n --tw-prose-captions: #6b7280;\n --tw-prose-code: #111827;\n --tw-prose-pre-code: #e5e7eb;\n --tw-prose-pre-bg: #1f2937;\n --tw-prose-th-borders: #d1d5db;\n --tw-prose-td-borders: #e5e7eb;\n --tw-prose-invert-body: #d1d5db;\n --tw-prose-invert-headings: #fff;\n --tw-prose-invert-lead: #9ca3af;\n --tw-prose-invert-links: #fff;\n --tw-prose-invert-bold: #fff;\n --tw-prose-invert-counters: #9ca3af;\n --tw-prose-invert-bullets: #4b5563;\n --tw-prose-invert-hr: #374151;\n --tw-prose-invert-quotes: #f3f4f6;\n --tw-prose-invert-quote-borders: #374151;\n --tw-prose-invert-captions: #9ca3af;\n --tw-prose-invert-code: #fff;\n --tw-prose-invert-pre-code: #d1d5db;\n --tw-prose-invert-pre-bg: rgb(0 0 0 / 50%);\n --tw-prose-invert-th-borders: #4b5563;\n --tw-prose-invert-td-borders: #374151;\n font-size: 1rem;\n line-height: 1.75;\n}\n.prose :where(p):not(:where([class~="not-prose"] *)) {\n margin-top: 1.25em;\n margin-bottom: 1.25em;\n}\n.prose :where(img):not(:where([class~="not-prose"] *)) {\n margin-top: 2em;\n margin-bottom: 2em;\n}\n.prose :where(video):not(:where([class~="not-prose"] *)) {\n margin-top: 2em;\n margin-bottom: 2em;\n}\n.prose :where(figure):not(:where([class~="not-prose"] *)) {\n margin-top: 2em;\n margin-bottom: 2em;\n}\n.prose :where(h2 code):not(:where([class~="not-prose"] *)) {\n font-size: 0.875em;\n}\n.prose :where(h3 code):not(:where([class~="not-prose"] *)) {\n font-size: 0.9em;\n}\n.prose :where(li):not(:where([class~="not-prose"] *)) {\n margin-top: 0.5em;\n margin-bottom: 0.5em;\n}\n.prose :where(ol > li):not(:where([class~="not-prose"] *)) {\n padding-left: 0.375em;\n}\n.prose :where(ul > li):not(:where([class~="not-prose"] *)) {\n padding-left: 0.375em;\n}\n.prose > :where(ul > li p):not(:where([class~="not-prose"] *)) {\n margin-top: 0.75em;\n margin-bottom: 0.75em;\n}\n.prose > :where(ul > li > *:first-child):not(:where([class~="not-prose"] *)) {\n margin-top: 1.25em;\n}\n.prose > :where(ul > li > *:last-child):not(:where([class~="not-prose"] *)) {\n margin-bottom: 1.25em;\n}\n.prose > :where(ol > li > *:first-child):not(:where([class~="not-prose"] *)) {\n margin-top: 1.25em;\n}\n.prose > :where(ol > li > *:last-child):not(:where([class~="not-prose"] *)) {\n margin-bottom: 1.25em;\n}\n.prose :where(ul ul, ul ol, ol ul, ol ol):not(:where([class~="not-prose"] *)) {\n margin-top: 0.75em;\n margin-bottom: 0.75em;\n}\n.prose :where(hr + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose :where(h2 + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose :where(h3 + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose :where(h4 + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose :where(thead th:first-child):not(:where([class~="not-prose"] *)) {\n padding-left: 0;\n}\n.prose :where(thead th:last-child):not(:where([class~="not-prose"] *)) {\n padding-right: 0;\n}\n.prose :where(tbody td:first-child):not(:where([class~="not-prose"] *)) {\n padding-left: 0;\n}\n.prose :where(tbody td:last-child):not(:where([class~="not-prose"] *)) {\n padding-right: 0;\n}\n.prose > :where(:first-child):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose > :where(:last-child):not(:where([class~="not-prose"] *)) {\n margin-bottom: 0;\n}\n.prose-sm {\n font-size: 0.875rem;\n line-height: 1.7142857;\n}\n.prose-sm :where(p):not(:where([class~="not-prose"] *)) {\n margin-top: 1.1428571em;\n margin-bottom: 1.1428571em;\n}\n.prose-sm :where([class~="lead"]):not(:where([class~="not-prose"] *)) {\n font-size: 1.2857143em;\n line-height: 1.5555556;\n margin-top: 0.8888889em;\n margin-bottom: 0.8888889em;\n}\n.prose-sm :where(blockquote):not(:where([class~="not-prose"] *)) {\n margin-top: 1.3333333em;\n margin-bottom: 1.3333333em;\n padding-left: 1.1111111em;\n}\n.prose-sm :where(h1):not(:where([class~="not-prose"] *)) {\n font-size: 2.1428571em;\n margin-top: 0;\n margin-bottom: 0.8em;\n line-height: 1.2;\n}\n.prose-sm :where(h2):not(:where([class~="not-prose"] *)) {\n font-size: 1.4285714em;\n margin-top: 1.6em;\n margin-bottom: 0.8em;\n line-height: 1.4;\n}\n.prose-sm :where(h3):not(:where([class~="not-prose"] *)) {\n font-size: 1.2857143em;\n margin-top: 1.5555556em;\n margin-bottom: 0.4444444em;\n line-height: 1.5555556;\n}\n.prose-sm :where(h4):not(:where([class~="not-prose"] *)) {\n margin-top: 1.4285714em;\n margin-bottom: 0.5714286em;\n line-height: 1.4285714;\n}\n.prose-sm :where(img):not(:where([class~="not-prose"] *)) {\n margin-top: 1.7142857em;\n margin-bottom: 1.7142857em;\n}\n.prose-sm :where(video):not(:where([class~="not-prose"] *)) {\n margin-top: 1.7142857em;\n margin-bottom: 1.7142857em;\n}\n.prose-sm :where(figure):not(:where([class~="not-prose"] *)) {\n margin-top: 1.7142857em;\n margin-bottom: 1.7142857em;\n}\n.prose-sm :where(figure > *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n margin-bottom: 0;\n}\n.prose-sm :where(figcaption):not(:where([class~="not-prose"] *)) {\n font-size: 0.8571429em;\n line-height: 1.3333333;\n margin-top: 0.6666667em;\n}\n.prose-sm :where(code):not(:where([class~="not-prose"] *)) {\n font-size: 0.8571429em;\n}\n.prose-sm :where(h2 code):not(:where([class~="not-prose"] *)) {\n font-size: 0.9em;\n}\n.prose-sm :where(h3 code):not(:where([class~="not-prose"] *)) {\n font-size: 0.8888889em;\n}\n.prose-sm :where(pre):not(:where([class~="not-prose"] *)) {\n font-size: 0.8571429em;\n line-height: 1.6666667;\n margin-top: 1.6666667em;\n margin-bottom: 1.6666667em;\n border-radius: 0.25rem;\n padding-top: 0.6666667em;\n padding-right: 1em;\n padding-bottom: 0.6666667em;\n padding-left: 1em;\n}\n.prose-sm :where(ol):not(:where([class~="not-prose"] *)) {\n padding-left: 1.5714286em;\n}\n.prose-sm :where(ul):not(:where([class~="not-prose"] *)) {\n padding-left: 1.5714286em;\n}\n.prose-sm :where(li):not(:where([class~="not-prose"] *)) {\n margin-top: 0.2857143em;\n margin-bottom: 0.2857143em;\n}\n.prose-sm :where(ol > li):not(:where([class~="not-prose"] *)) {\n padding-left: 0.4285714em;\n}\n.prose-sm :where(ul > li):not(:where([class~="not-prose"] *)) {\n padding-left: 0.4285714em;\n}\n.prose-sm > :where(ul > li p):not(:where([class~="not-prose"] *)) {\n margin-top: 0.5714286em;\n margin-bottom: 0.5714286em;\n}\n.prose-sm > :where(ul > li > *:first-child):not(:where([class~="not-prose"] *)) {\n margin-top: 1.1428571em;\n}\n.prose-sm > :where(ul > li > *:last-child):not(:where([class~="not-prose"] *)) {\n margin-bottom: 1.1428571em;\n}\n.prose-sm > :where(ol > li > *:first-child):not(:where([class~="not-prose"] *)) {\n margin-top: 1.1428571em;\n}\n.prose-sm > :where(ol > li > *:last-child):not(:where([class~="not-prose"] *)) {\n margin-bottom: 1.1428571em;\n}\n.prose-sm :where(ul ul, ul ol, ol ul, ol ol):not(:where([class~="not-prose"] *)) {\n margin-top: 0.5714286em;\n margin-bottom: 0.5714286em;\n}\n.prose-sm :where(hr):not(:where([class~="not-prose"] *)) {\n margin-top: 2.8571429em;\n margin-bottom: 2.8571429em;\n}\n.prose-sm :where(hr + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose-sm :where(h2 + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose-sm :where(h3 + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose-sm :where(h4 + *):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose-sm :where(table):not(:where([class~="not-prose"] *)) {\n font-size: 0.8571429em;\n line-height: 1.5;\n}\n.prose-sm :where(thead th):not(:where([class~="not-prose"] *)) {\n padding-right: 1em;\n padding-bottom: 0.6666667em;\n padding-left: 1em;\n}\n.prose-sm :where(thead th:first-child):not(:where([class~="not-prose"] *)) {\n padding-left: 0;\n}\n.prose-sm :where(thead th:last-child):not(:where([class~="not-prose"] *)) {\n padding-right: 0;\n}\n.prose-sm :where(tbody td):not(:where([class~="not-prose"] *)) {\n padding-top: 0.6666667em;\n padding-right: 1em;\n padding-bottom: 0.6666667em;\n padding-left: 1em;\n}\n.prose-sm :where(tbody td:first-child):not(:where([class~="not-prose"] *)) {\n padding-left: 0;\n}\n.prose-sm :where(tbody td:last-child):not(:where([class~="not-prose"] *)) {\n padding-right: 0;\n}\n.prose-sm > :where(:first-child):not(:where([class~="not-prose"] *)) {\n margin-top: 0;\n}\n.prose-sm > :where(:last-child):not(:where([class~="not-prose"] *)) {\n margin-bottom: 0;\n}\n.sr-only {\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n padding: 0 !important;\n margin: -1px !important;\n overflow: hidden !important;\n clip: rect(0, 0, 0, 0) !important;\n white-space: nowrap !important;\n border-width: 0 !important;\n}\n.visible {\n visibility: visible !important;\n}\n.fixed {\n position: fixed !important;\n}\n.absolute {\n position: absolute !important;\n}\n.relative {\n position: relative !important;\n}\n.inset-0 {\n top: 0px !important;\n right: 0px !important;\n bottom: 0px !important;\n left: 0px !important;\n}\n.inset-y-0 {\n top: 0px !important;\n bottom: 0px !important;\n}\n.inset-x-0 {\n left: 0px !important;\n right: 0px !important;\n}\n.top-0 {\n top: 0px !important;\n}\n.right-0 {\n right: 0px !important;\n}\n.left-0 {\n left: 0px !important;\n}\n.bottom-0 {\n bottom: 0px !important;\n}\n.-left-5 {\n left: -1.25rem !important;\n}\n.top-\\[35px\\] {\n top: 35px !important;\n}\n.col-span-3 {\n grid-column: span 3 / span 3 !important;\n}\n.m-2 {\n margin: 0.5rem !important;\n}\n.mx-2 {\n margin-left: 0.5rem !important;\n margin-right: 0.5rem !important;\n}\n.mx-auto {\n margin-left: auto !important;\n margin-right: auto !important;\n}\n.my-2 {\n margin-top: 0.5rem !important;\n margin-bottom: 0.5rem !important;\n}\n.mx-1 {\n margin-left: 0.25rem !important;\n margin-right: 0.25rem !important;\n}\n.mb-4 {\n margin-bottom: 1rem !important;\n}\n.mt-0\\.5 {\n margin-top: 0.125rem !important;\n}\n.mt-0 {\n margin-top: 0px !important;\n}\n.ml-6 {\n margin-left: 1.5rem !important;\n}\n.mb-2 {\n margin-bottom: 0.5rem !important;\n}\n.mb-3 {\n margin-bottom: 0.75rem !important;\n}\n.mb-1\\.5 {\n margin-bottom: 0.375rem !important;\n}\n.mb-1 {\n margin-bottom: 0.25rem !important;\n}\n.mt-1\\.5 {\n margin-top: 0.375rem !important;\n}\n.mt-1 {\n margin-top: 0.25rem !important;\n}\n.ml-2 {\n margin-left: 0.5rem !important;\n}\n.mt-3 {\n margin-top: 0.75rem !important;\n}\n.-mt-0\\.5 {\n margin-top: -0.125rem !important;\n}\n.-mt-0 {\n margin-top: -0px !important;\n}\n.block {\n display: block !important;\n}\n.inline-block {\n display: inline-block !important;\n}\n.flex {\n display: flex !important;\n}\n.inline-flex {\n display: inline-flex !important;\n}\n.table {\n display: table !important;\n}\n.grid {\n display: grid !important;\n}\n.contents {\n display: contents !important;\n}\n.hidden {\n display: none !important;\n}\n.h-\\[30px\\] {\n height: 30px !important;\n}\n.h-full {\n height: 100% !important;\n}\n.h-\\[35px\\] {\n height: 35px !important;\n}\n.h-5 {\n height: 1.25rem !important;\n}\n.h-4 {\n height: 1rem !important;\n}\n.h-8 {\n height: 2rem !important;\n}\n.min-h-\\[360px\\] {\n min-height: 360px !important;\n}\n.w-full {\n width: 100% !important;\n}\n.w-5 {\n width: 1.25rem !important;\n}\n.w-4 {\n width: 1rem !important;\n}\n.w-8 {\n width: 2rem !important;\n}\n.max-w-4xl {\n max-width: 56rem !important;\n}\n.max-w-2xl {\n max-width: 42rem !important;\n}\n.flex-1 {\n flex: 1 1 0% !important;\n}\n.flex-shrink-0 {\n flex-shrink: 0 !important;\n}\n.grow {\n flex-grow: 1 !important;\n}\n.-rotate-90 {\n --tw-rotate: -90deg !important;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) !important;\n}\n.rotate-90 {\n --tw-rotate: 90deg !important;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) !important;\n}\n.transform {\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) !important;\n}\n.cursor-pointer {\n cursor: pointer !important;\n}\n.cursor-default {\n cursor: default !important;\n}\n.select-none {\n -webkit-user-select: none !important;\n -moz-user-select: none !important;\n -ms-user-select: none !important;\n user-select: none !important;\n}\n.select-text {\n -webkit-user-select: text !important;\n -moz-user-select: text !important;\n -ms-user-select: text !important;\n user-select: text !important;\n}\n.grid-flow-col {\n grid-auto-flow: column !important;\n}\n.grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr)) !important;\n}\n.grid-cols-\\[minmax\\(max-content\\2c auto\\)_repeat\\(2\\2c min-content\\)\\] {\n grid-template-columns: minmax(max-content,auto) repeat(2,min-content) !important;\n}\n.grid-cols-\\[minmax\\(min-content\\2c max-content\\)_minmax\\(max-content\\2c auto\\)_minmax\\(min-content\\2c max-content\\)\\] {\n grid-template-columns: minmax(min-content,max-content) minmax(max-content,auto) minmax(min-content,max-content) !important;\n}\n.grid-cols-\\[minmax\\(max-content\\2c auto\\)_minmax\\(max-content\\2c auto\\)\\] {\n grid-template-columns: minmax(max-content,auto) minmax(max-content,auto) !important;\n}\n.flex-col {\n flex-direction: column !important;\n}\n.flex-wrap {\n flex-wrap: wrap !important;\n}\n.place-content-center {\n place-content: center !important;\n}\n.place-items-center {\n place-items: center !important;\n}\n.content-start {\n align-content: flex-start !important;\n}\n.items-start {\n align-items: flex-start !important;\n}\n.items-center {\n align-items: center !important;\n}\n.justify-end {\n justify-content: flex-end !important;\n}\n.justify-center {\n justify-content: center !important;\n}\n.justify-between {\n justify-content: space-between !important;\n}\n.gap-4 {\n gap: 1rem !important;\n}\n.gap-3 {\n gap: 0.75rem !important;\n}\n.gap-2 {\n gap: 0.5rem !important;\n}\n.gap-1 {\n gap: 0.25rem !important;\n}\n.gap-1\\.5 {\n gap: 0.375rem !important;\n}\n.gap-y-2 {\n row-gap: 0.5rem !important;\n}\n.space-x-2 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-x-reverse: 0 !important;\n margin-right: calc(0.5rem * var(--tw-space-x-reverse)) !important;\n margin-left: calc(0.5rem * calc(1 - var(--tw-space-x-reverse))) !important;\n}\n.space-y-4 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0 !important;\n margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse))) !important;\n margin-bottom: calc(1rem * var(--tw-space-y-reverse)) !important;\n}\n.space-y-3 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0 !important;\n margin-top: calc(0.75rem * calc(1 - var(--tw-space-y-reverse))) !important;\n margin-bottom: calc(0.75rem * var(--tw-space-y-reverse)) !important;\n}\n.space-y-2 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0 !important;\n margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse))) !important;\n margin-bottom: calc(0.5rem * var(--tw-space-y-reverse)) !important;\n}\n.divide-x > :not([hidden]) ~ :not([hidden]) {\n --tw-divide-x-reverse: 0 !important;\n border-right-width: calc(1px * var(--tw-divide-x-reverse)) !important;\n border-left-width: calc(1px * calc(1 - var(--tw-divide-x-reverse))) !important;\n}\n.divide-dashed > :not([hidden]) ~ :not([hidden]) {\n border-style: dashed !important;\n}\n.overflow-auto {\n overflow: auto !important;\n}\n.overflow-hidden {\n overflow: hidden !important;\n}\n.overflow-y-auto {\n overflow-y: auto !important;\n}\n.truncate {\n overflow: hidden !important;\n text-overflow: ellipsis !important;\n white-space: nowrap !important;\n}\n.whitespace-nowrap {\n white-space: nowrap !important;\n}\n.rounded-lg {\n border-radius: 0.5rem !important;\n}\n.rounded {\n border-radius: 0.25rem !important;\n}\n.rounded-xl {\n border-radius: 0.75rem !important;\n}\n.rounded-full {\n border-radius: 9999px !important;\n}\n.rounded-md {\n border-radius: 0.375rem !important;\n}\n.border {\n border-width: 1px !important;\n}\n.border-2 {\n border-width: 2px !important;\n}\n.border-b {\n border-bottom-width: 1px !important;\n}\n.border-t {\n border-top-width: 1px !important;\n}\n.border-dashed {\n border-style: dashed !important;\n}\n.border-gray-300 {\n --tw-border-opacity: 1 !important;\n border-color: rgb(209 213 219 / var(--tw-border-opacity)) !important;\n}\n.border-gray-200 {\n --tw-border-opacity: 1 !important;\n border-color: rgb(229 231 235 / var(--tw-border-opacity)) !important;\n}\n.border-red-200 {\n --tw-border-opacity: 1 !important;\n border-color: rgb(254 202 202 / var(--tw-border-opacity)) !important;\n}\n.border-blue-200 {\n --tw-border-opacity: 1 !important;\n border-color: rgb(191 219 254 / var(--tw-border-opacity)) !important;\n}\n.border-red-300 {\n --tw-border-opacity: 1 !important;\n border-color: rgb(252 165 165 / var(--tw-border-opacity)) !important;\n}\n.border-gray-100 {\n --tw-border-opacity: 1 !important;\n border-color: rgb(243 244 246 / var(--tw-border-opacity)) !important;\n}\n.border-purple-200 {\n --tw-border-opacity: 1 !important;\n border-color: rgb(233 213 255 / var(--tw-border-opacity)) !important;\n}\n.border-slate-200 {\n --tw-border-opacity: 1 !important;\n border-color: rgb(226 232 240 / var(--tw-border-opacity)) !important;\n}\n.border-slate-300 {\n --tw-border-opacity: 1 !important;\n border-color: rgb(203 213 225 / var(--tw-border-opacity)) !important;\n}\n.bg-slate-100 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(241 245 249 / var(--tw-bg-opacity)) !important;\n}\n.bg-white {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity)) !important;\n}\n.bg-gray-100 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity)) !important;\n}\n.bg-red-50 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(254 242 242 / var(--tw-bg-opacity)) !important;\n}\n.bg-gray-50 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(249 250 251 / var(--tw-bg-opacity)) !important;\n}\n.bg-blue-50 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(239 246 255 / var(--tw-bg-opacity)) !important;\n}\n.bg-red-100 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(254 226 226 / var(--tw-bg-opacity)) !important;\n}\n.bg-purple-50 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(250 245 255 / var(--tw-bg-opacity)) !important;\n}\n.bg-slate-50\\/90 {\n background-color: rgb(248 250 252 / 0.9) !important;\n}\n.bg-white\\/80 {\n background-color: rgb(255 255 255 / 0.8) !important;\n}\n.bg-slate-50 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(248 250 252 / var(--tw-bg-opacity)) !important;\n}\n.bg-fuchsia-100 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(250 232 255 / var(--tw-bg-opacity)) !important;\n}\n.bg-purple-100 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(243 232 255 / var(--tw-bg-opacity)) !important;\n}\n.bg-indigo-50 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(238 242 255 / var(--tw-bg-opacity)) !important;\n}\n.bg-indigo-600 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(79 70 229 / var(--tw-bg-opacity)) !important;\n}\n.bg-blue-600 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(37 99 235 / var(--tw-bg-opacity)) !important;\n}\n.bg-opacity-75 {\n --tw-bg-opacity: 0.75 !important;\n}\n.bg-gradient-to-r {\n background-image: linear-gradient(to right, var(--tw-gradient-stops)) !important;\n}\n.from-fuchsia-600 {\n --tw-gradient-from: #c026d3 !important;\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(192 38 211 / 0)) !important;\n}\n.from-purple-600 {\n --tw-gradient-from: #9333ea !important;\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(147 51 234 / 0)) !important;\n}\n.to-purple-600 {\n --tw-gradient-to: #9333ea !important;\n}\n.to-indigo-600 {\n --tw-gradient-to: #4f46e5 !important;\n}\n.p-4 {\n padding: 1rem !important;\n}\n.p-2 {\n padding: 0.5rem !important;\n}\n.p-8 {\n padding: 2rem !important;\n}\n.p-6 {\n padding: 1.5rem !important;\n}\n.p-3 {\n padding: 0.75rem !important;\n}\n.p-1 {\n padding: 0.25rem !important;\n}\n.px-2 {\n padding-left: 0.5rem !important;\n padding-right: 0.5rem !important;\n}\n.px-3 {\n padding-left: 0.75rem !important;\n padding-right: 0.75rem !important;\n}\n.py-2 {\n padding-top: 0.5rem !important;\n padding-bottom: 0.5rem !important;\n}\n.py-1 {\n padding-top: 0.25rem !important;\n padding-bottom: 0.25rem !important;\n}\n.py-0\\.5 {\n padding-top: 0.125rem !important;\n padding-bottom: 0.125rem !important;\n}\n.py-0 {\n padding-top: 0px !important;\n padding-bottom: 0px !important;\n}\n.px-4 {\n padding-left: 1rem !important;\n padding-right: 1rem !important;\n}\n.py-3 {\n padding-top: 0.75rem !important;\n padding-bottom: 0.75rem !important;\n}\n.px-2\\.5 {\n padding-left: 0.625rem !important;\n padding-right: 0.625rem !important;\n}\n.py-2\\.5 {\n padding-top: 0.625rem !important;\n padding-bottom: 0.625rem !important;\n}\n.px-1 {\n padding-left: 0.25rem !important;\n padding-right: 0.25rem !important;\n}\n.pl-2 {\n padding-left: 0.5rem !important;\n}\n.pl-9 {\n padding-left: 2.25rem !important;\n}\n.pr-3 {\n padding-right: 0.75rem !important;\n}\n.pt-2 {\n padding-top: 0.5rem !important;\n}\n.pb-3 {\n padding-bottom: 0.75rem !important;\n}\n.text-center {\n text-align: center !important;\n}\n.align-middle {\n vertical-align: middle !important;\n}\n.font-mono {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;\n}\n.text-sm {\n font-size: 0.875rem !important;\n line-height: 1.25rem !important;\n}\n.text-xs {\n font-size: 0.75rem !important;\n line-height: 1rem !important;\n}\n.text-lg {\n font-size: 1.125rem !important;\n line-height: 1.75rem !important;\n}\n.font-medium {\n font-weight: 500 !important;\n}\n.font-semibold {\n font-weight: 600 !important;\n}\n.font-bold {\n font-weight: 700 !important;\n}\n.uppercase {\n text-transform: uppercase !important;\n}\n.leading-relaxed {\n line-height: 1.625 !important;\n}\n.text-gray-400 {\n --tw-text-opacity: 1 !important;\n color: rgb(156 163 175 / var(--tw-text-opacity)) !important;\n}\n.text-gray-700 {\n --tw-text-opacity: 1 !important;\n color: rgb(55 65 81 / var(--tw-text-opacity)) !important;\n}\n.text-gray-600 {\n --tw-text-opacity: 1 !important;\n color: rgb(75 85 99 / var(--tw-text-opacity)) !important;\n}\n.text-red-600 {\n --tw-text-opacity: 1 !important;\n color: rgb(220 38 38 / var(--tw-text-opacity)) !important;\n}\n.text-gray-800 {\n --tw-text-opacity: 1 !important;\n color: rgb(31 41 55 / var(--tw-text-opacity)) !important;\n}\n.text-blue-800 {\n --tw-text-opacity: 1 !important;\n color: rgb(30 64 175 / var(--tw-text-opacity)) !important;\n}\n.text-red-700 {\n --tw-text-opacity: 1 !important;\n color: rgb(185 28 28 / var(--tw-text-opacity)) !important;\n}\n.text-slate-300 {\n --tw-text-opacity: 1 !important;\n color: rgb(203 213 225 / var(--tw-text-opacity)) !important;\n}\n.text-slate-500 {\n --tw-text-opacity: 1 !important;\n color: rgb(100 116 139 / var(--tw-text-opacity)) !important;\n}\n.text-slate-900 {\n --tw-text-opacity: 1 !important;\n color: rgb(15 23 42 / var(--tw-text-opacity)) !important;\n}\n.text-fuchsia-600 {\n --tw-text-opacity: 1 !important;\n color: rgb(192 38 211 / var(--tw-text-opacity)) !important;\n}\n.text-slate-800 {\n --tw-text-opacity: 1 !important;\n color: rgb(30 41 59 / var(--tw-text-opacity)) !important;\n}\n.text-slate-600 {\n --tw-text-opacity: 1 !important;\n color: rgb(71 85 105 / var(--tw-text-opacity)) !important;\n}\n.text-slate-700 {\n --tw-text-opacity: 1 !important;\n color: rgb(51 65 85 / var(--tw-text-opacity)) !important;\n}\n.text-purple-600 {\n --tw-text-opacity: 1 !important;\n color: rgb(147 51 234 / var(--tw-text-opacity)) !important;\n}\n.text-white {\n --tw-text-opacity: 1 !important;\n color: rgb(255 255 255 / var(--tw-text-opacity)) !important;\n}\n.text-indigo-600 {\n --tw-text-opacity: 1 !important;\n color: rgb(79 70 229 / var(--tw-text-opacity)) !important;\n}\n.text-gray-500 {\n --tw-text-opacity: 1 !important;\n color: rgb(107 114 128 / var(--tw-text-opacity)) !important;\n}\n.text-blue-600 {\n --tw-text-opacity: 1 !important;\n color: rgb(37 99 235 / var(--tw-text-opacity)) !important;\n}\n.opacity-0 {\n opacity: 0 !important;\n}\n.shadow {\n --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1) !important;\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color) !important;\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;\n}\n.shadow-sm {\n --tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05) !important;\n --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color) !important;\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;\n}\n.shadow-md {\n --tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1) !important;\n --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color) !important;\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow) !important;\n}\n.outline {\n outline-style: solid !important;\n}\n.blur {\n --tw-blur: blur(8px) !important;\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow) !important;\n}\n.filter {\n filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow) !important;\n}\n.backdrop-blur {\n --tw-backdrop-blur: blur(8px) !important;\n backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia) !important;\n}\n.transition-colors {\n transition-property: color, background-color, border-color, fill, stroke, -webkit-text-decoration-color !important;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke !important;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, -webkit-text-decoration-color !important;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;\n transition-duration: 150ms !important;\n}\n.transition {\n transition-property: color, background-color, border-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-text-decoration-color !important;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter !important;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-text-decoration-color !important;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;\n transition-duration: 150ms !important;\n}\n.transition-all {\n transition-property: all !important;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;\n transition-duration: 150ms !important;\n}\n.placeholder\\:text-xs::-moz-placeholder {\n font-size: 0.75rem !important;\n line-height: 1rem !important;\n}\n.placeholder\\:text-xs:-ms-input-placeholder {\n font-size: 0.75rem !important;\n line-height: 1rem !important;\n}\n.placeholder\\:text-xs::placeholder {\n font-size: 0.75rem !important;\n line-height: 1rem !important;\n}\n.placeholder\\:italic::-moz-placeholder {\n font-style: italic !important;\n}\n.placeholder\\:italic:-ms-input-placeholder {\n font-style: italic !important;\n}\n.placeholder\\:italic::placeholder {\n font-style: italic !important;\n}\n.placeholder\\:text-gray-400::-moz-placeholder {\n --tw-text-opacity: 1 !important;\n color: rgb(156 163 175 / var(--tw-text-opacity)) !important;\n}\n.placeholder\\:text-gray-400:-ms-input-placeholder {\n --tw-text-opacity: 1 !important;\n color: rgb(156 163 175 / var(--tw-text-opacity)) !important;\n}\n.placeholder\\:text-gray-400::placeholder {\n --tw-text-opacity: 1 !important;\n color: rgb(156 163 175 / var(--tw-text-opacity)) !important;\n}\n.first\\:pl-2:first-child {\n padding-left: 0.5rem !important;\n}\n.last\\:mb-0:last-child {\n margin-bottom: 0px !important;\n}\n.last\\:pr-2:last-child {\n padding-right: 0.5rem !important;\n}\n.hover\\:border-indigo-400:hover {\n --tw-border-opacity: 1 !important;\n border-color: rgb(129 140 248 / var(--tw-border-opacity)) !important;\n}\n.hover\\:bg-gray-200:hover {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(229 231 235 / var(--tw-bg-opacity)) !important;\n}\n.hover\\:bg-indigo-500:hover {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(99 102 241 / var(--tw-bg-opacity)) !important;\n}\n.hover\\:from-fuchsia-500:hover {\n --tw-gradient-from: #d946ef !important;\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(217 70 239 / 0)) !important;\n}\n.hover\\:from-purple-500:hover {\n --tw-gradient-from: #a855f7 !important;\n --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(168 85 247 / 0)) !important;\n}\n.hover\\:to-purple-500:hover {\n --tw-gradient-to: #a855f7 !important;\n}\n.hover\\:to-indigo-500:hover {\n --tw-gradient-to: #6366f1 !important;\n}\n.hover\\:text-white:hover {\n --tw-text-opacity: 1 !important;\n color: rgb(255 255 255 / var(--tw-text-opacity)) !important;\n}\n.hover\\:text-indigo-800:hover {\n --tw-text-opacity: 1 !important;\n color: rgb(55 48 163 / var(--tw-text-opacity)) !important;\n}\n.hover\\:text-indigo-600:hover {\n --tw-text-opacity: 1 !important;\n color: rgb(79 70 229 / var(--tw-text-opacity)) !important;\n}\n.hover\\:text-slate-400:hover {\n --tw-text-opacity: 1 !important;\n color: rgb(148 163 184 / var(--tw-text-opacity)) !important;\n}\n.hover\\:text-black:hover {\n --tw-text-opacity: 1 !important;\n color: rgb(0 0 0 / var(--tw-text-opacity)) !important;\n}\n.focus\\:border-gray-200:focus {\n --tw-border-opacity: 1 !important;\n border-color: rgb(229 231 235 / var(--tw-border-opacity)) !important;\n}\n.focus\\:outline-none:focus {\n outline: 2px solid transparent !important;\n outline-offset: 2px !important;\n}\n.focus-visible\\:outline-none:focus-visible {\n outline: 2px solid transparent !important;\n outline-offset: 2px !important;\n}\n.focus-visible\\:ring-2:focus-visible {\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000) !important;\n}\n.focus-visible\\:ring-fuchsia-500:focus-visible {\n --tw-ring-opacity: 1 !important;\n --tw-ring-color: rgb(217 70 239 / var(--tw-ring-opacity)) !important;\n}\n.focus-visible\\:ring-purple-500:focus-visible {\n --tw-ring-opacity: 1 !important;\n --tw-ring-color: rgb(168 85 247 / var(--tw-ring-opacity)) !important;\n}\n.focus-visible\\:ring-indigo-500:focus-visible {\n --tw-ring-opacity: 1 !important;\n --tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity)) !important;\n}\n.focus-visible\\:ring-offset-2:focus-visible {\n --tw-ring-offset-width: 2px !important;\n}\n.focus-visible\\:ring-offset-white:focus-visible {\n --tw-ring-offset-color: #fff !important;\n}\n.active\\:text-slate-800:active {\n --tw-text-opacity: 1 !important;\n color: rgb(30 41 59 / var(--tw-text-opacity)) !important;\n}\n.group:hover .group-hover\\:cursor-pointer {\n cursor: pointer !important;\n}\n.group:hover .group-hover\\:bg-slate-100 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(241 245 249 / var(--tw-bg-opacity)) !important;\n}\n.group:hover .group-hover\\:bg-blue-600 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(37 99 235 / var(--tw-bg-opacity)) !important;\n}\n.group:hover .group-hover\\:text-white {\n --tw-text-opacity: 1 !important;\n color: rgb(255 255 255 / var(--tw-text-opacity)) !important;\n}\n.group:active .group-active\\:bg-blue-700 {\n --tw-bg-opacity: 1 !important;\n background-color: rgb(29 78 216 / var(--tw-bg-opacity)) !important;\n}\n@media (min-width: 640px) {\n\n .sm\\:grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr)) !important;\n }\n}',""]);const b=h},94748:e=>{e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAECAYAAACp8Z5+AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMTZEaa/1AAAAHUlEQVQYV2PYvXu3JAi7uLiAMaYAjAGTQBPYLQkAa/0Zef3qRswAAAAASUVORK5CYII="},4768:e=>{e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAL0lEQVQoz2NgCD3x//9/BhBYBWdhgFVAiVW4JBFKGIa4AqD0//9D3pt4I4tAdAMAHTQ/j5Zom30AAAAASUVORK5CYII="},35555:e=>{e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAAz0lEQVRIx2NgYGBY/R8I/vx5eelX3n82IJ9FxGf6tksvf/8FiTMQAcAGQMDvSwu09abffY8QYSAScNk45G198eX//yev73/4///701eh//kZSARckrNBRvz//+8+6ZohwCzjGNjdgQxkAg7B9WADeBjIBqtJCbhRA0YNoIkBSNmaPEMoNmA0FkYNoFKhapJ6FGyAH3nauaSmPfwI0v/3OukVi0CIZ+F25KrtYcx/CTIy0e+rC7R1Z4KMICVTQQ14feVXIbR695u14+Ir4gwAAD49E54wc1kWAAAAAElFTkSuQmCC"},23601:e=>{e.exports="data:image/svg+xml,%3csvg viewBox=%270 0 16 16%27 fill=%27white%27 xmlns=%27http://www.w3.org/2000/svg%27%3e%3ccircle cx=%278%27 cy=%278%27 r=%273%27/%3e%3c/svg%3e"},133:e=>{e.exports="data:image/svg+xml,%3csvg viewBox=%270 0 16 16%27 fill=%27white%27 xmlns=%27http://www.w3.org/2000/svg%27%3e%3cpath d=%27M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z%27/%3e%3c/svg%3e"},1686:e=>{e.exports="data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27none%27 viewBox=%270 0 16 16%27%3e%3cpath stroke=%27white%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%272%27 d=%27M4 8h8%27/%3e%3c/svg%3e"},70909:e=>{e.exports="data:image/svg+xml,%3csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27none%27 viewBox=%270 0 20 20%27%3e%3cpath stroke=%27%236b7280%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%271.5%27 d=%27M6 8l4 4 4-4%27/%3e%3c/svg%3e"},6161:e=>{e.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCA1MyAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDguMDM2NCA0LjAxMDQySDQuMDA3NzlMNC4wMDc3OSAzMi4wMjg2SDQ4LjAzNjRWNC4wMTA0MlpNNC4wMDc3OSAwLjAwNzgxMjVDMS43OTcyMSAwLjAwNzgxMjUgMC4wMDUxODc5OSAxLjc5OTg0IDAuMDA1MTg3OTkgNC4wMTA0MlYzMi4wMjg2QzAuMDA1MTg3OTkgMzQuMjM5MiAxLjc5NzIxIDM2LjAzMTIgNC4wMDc3OSAzNi4wMzEySDQ4LjAzNjRDNTAuMjQ3IDM2LjAzMTIgNTIuMDM5IDM0LjIzOTIgNTIuMDM5IDMyLjAyODZWNC4wMTA0MkM1Mi4wMzkgMS43OTk4NCA1MC4yNDcgMC4wMDc4MTI1IDQ4LjAzNjQgMC4wMDc4MTI1SDQuMDA3NzlaTTguMDEwNDIgOC4wMTMwMkgxMi4wMTNWMTIuMDE1Nkg4LjAxMDQyVjguMDEzMDJaTTIwLjAxODIgOC4wMTMwMkgxNi4wMTU2VjEyLjAxNTZIMjAuMDE4MlY4LjAxMzAyWk0yNC4wMjA4IDguMDEzMDJIMjguMDIzNFYxMi4wMTU2SDI0LjAyMDhWOC4wMTMwMlpNMzYuMDI4NiA4LjAxMzAySDMyLjAyNlYxMi4wMTU2SDM2LjAyODZWOC4wMTMwMlpNNDAuMDMxMiA4LjAxMzAySDQ0LjAzMzlWMTIuMDE1Nkg0MC4wMzEyVjguMDEzMDJaTTE2LjAxNTYgMTYuMDE4Mkg4LjAxMDQyVjIwLjAyMDhIMTYuMDE1NlYxNi4wMTgyWk0yMC4wMTgyIDE2LjAxODJIMjQuMDIwOFYyMC4wMjA4SDIwLjAxODJWMTYuMDE4MlpNMzIuMDI2IDE2LjAxODJIMjguMDIzNFYyMC4wMjA4SDMyLjAyNlYxNi4wMTgyWk00NC4wMzM5IDE2LjAxODJWMjAuMDIwOEgzNi4wMjg2VjE2LjAxODJINDQuMDMzOVpNMTIuMDEzIDI0LjAyMzRIOC4wMTA0MlYyOC4wMjZIMTIuMDEzVjI0LjAyMzRaTTE2LjAxNTYgMjQuMDIzNEgzNi4wMjg2VjI4LjAyNkgxNi4wMTU2VjI0LjAyMzRaTTQ0LjAzMzkgMjQuMDIzNEg0MC4wMzEyVjI4LjAyNkg0NC4wMzM5VjI0LjAyMzRaIiBmaWxsPSIjNDI0MjQyIi8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDAiPgo8cmVjdCB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg=="},51096:e=>{e.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIHZpZXdCb3g9IjAgMCA1MyAzNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgY2xpcC1wYXRoPSJ1cmwoI2NsaXAwKSI+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDguMDM2NCA0LjAxMDQySDQuMDA3NzlMNC4wMDc3OSAzMi4wMjg2SDQ4LjAzNjRWNC4wMTA0MlpNNC4wMDc3OSAwLjAwNzgxMjVDMS43OTcyMSAwLjAwNzgxMjUgMC4wMDUxODc5OSAxLjc5OTg0IDAuMDA1MTg3OTkgNC4wMTA0MlYzMi4wMjg2QzAuMDA1MTg3OTkgMzQuMjM5MiAxLjc5NzIxIDM2LjAzMTIgNC4wMDc3OSAzNi4wMzEySDQ4LjAzNjRDNTAuMjQ3IDM2LjAzMTIgNTIuMDM5IDM0LjIzOTIgNTIuMDM5IDMyLjAyODZWNC4wMTA0MkM1Mi4wMzkgMS43OTk4NCA1MC4yNDcgMC4wMDc4MTI1IDQ4LjAzNjQgMC4wMDc4MTI1SDQuMDA3NzlaTTguMDEwNDIgOC4wMTMwMkgxMi4wMTNWMTIuMDE1Nkg4LjAxMDQyVjguMDEzMDJaTTIwLjAxODIgOC4wMTMwMkgxNi4wMTU2VjEyLjAxNTZIMjAuMDE4MlY4LjAxMzAyWk0yNC4wMjA4IDguMDEzMDJIMjguMDIzNFYxMi4wMTU2SDI0LjAyMDhWOC4wMTMwMlpNMzYuMDI4NiA4LjAxMzAySDMyLjAyNlYxMi4wMTU2SDM2LjAyODZWOC4wMTMwMlpNNDAuMDMxMiA4LjAxMzAySDQ0LjAzMzlWMTIuMDE1Nkg0MC4wMzEyVjguMDEzMDJaTTE2LjAxNTYgMTYuMDE4Mkg4LjAxMDQyVjIwLjAyMDhIMTYuMDE1NlYxNi4wMTgyWk0yMC4wMTgyIDE2LjAxODJIMjQuMDIwOFYyMC4wMjA4SDIwLjAxODJWMTYuMDE4MlpNMzIuMDI2IDE2LjAxODJIMjguMDIzNFYyMC4wMjA4SDMyLjAyNlYxNi4wMTgyWk00NC4wMzM5IDE2LjAxODJWMjAuMDIwOEgzNi4wMjg2VjE2LjAxODJINDQuMDMzOVpNMTIuMDEzIDI0LjAyMzRIOC4wMTA0MlYyOC4wMjZIMTIuMDEzVjI0LjAyMzRaTTE2LjAxNTYgMjQuMDIzNEgzNi4wMjg2VjI4LjAyNkgxNi4wMTU2VjI0LjAyMzRaTTQ0LjAzMzkgMjQuMDIzNEg0MC4wMzEyVjI4LjAyNkg0NC4wMzM5VjI0LjAyMzRaIiBmaWxsPSIjQzVDNUM1Ii8+CjwvZz4KPGRlZnM+CjxjbGlwUGF0aCBpZD0iY2xpcDAiPgo8cmVjdCB3aWR0aD0iNTMiIGhlaWdodD0iMzYiIGZpbGw9IndoaXRlIi8+CjwvY2xpcFBhdGg+CjwvZGVmcz4KPC9zdmc+Cg=="}},o={};function s(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={id:e,loaded:!1,exports:{}};return r[e](n,n.exports,s),n.loaded=!0,n.exports}s.m=r,s.amdO={},e=[],s.O=(t,n,r,o)=>{if(!n){var i=1/0;for(d=0;d=o)&&Object.keys(s.O).every((e=>s.O[e](n[l])))?n.splice(l--,1):(a=!1,o0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[n,r,o]},s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,n)=>(s.f[n](e,t),t)),[])),s.u=e=>e+".bundle.js",s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},n="sterling-layout:",s.l=(e,r,o,i)=>{if(t[e])t[e].push(r);else{var a,l;if(void 0!==o)for(var c=document.getElementsByTagName("script"),d=0;d{a.onerror=a.onload=null,clearTimeout(h);var o=t[e];if(delete t[e],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach((e=>e(r))),n)return n(r)},h=setTimeout(u.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=u.bind(null,a.onerror),a.onload=u.bind(null,a.onload),l&&document.head.appendChild(a)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),s.p="./",(()=>{s.b=document.baseURI||self.location.href;var e={179:0};s.f.j=(t,n)=>{var r=s.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise(((n,o)=>r=e[t]=[n,o]));n.push(r[2]=o);var i=s.p+s.u(t),a=new Error;s.l(i,(n=>{if(s.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),i=n&&n.target&&n.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+i+")",a.name="ChunkLoadError",a.type=o,a.request=i,r[1](a)}}),"chunk-"+t,t)}},s.O.j=t=>0===e[t];var t=(t,n)=>{var r,o,[i,a,l]=n,c=0;if(i.some((t=>0!==e[t]))){for(r in a)s.o(a,r)&&(s.m[r]=a[r]);if(l)var d=l(s)}for(t&&t(n);cs(67403)));i=s.O(i)})(); \ No newline at end of file diff --git a/forge/sterling/build/vendor/react-component-integration.css b/forge/sterling/build/vendor/react-component-integration.css index d9612b93..891cda6b 100644 --- a/forge/sterling/build/vendor/react-component-integration.css +++ b/forge/sterling/build/vendor/react-component-integration.css @@ -1,1531 +1,2 @@ -/* src/components/CndLayoutInterface.css */ -.cnd-layout-interface { - font-family: var(--bs-font-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif); -} -.cnd-layout-interface--disabled { - opacity: 0.6; - pointer-events: none; -} -.cnd-layout-interface__toggle { - position: relative; - display: inline-block; - width: 48px; - height: 24px; - cursor: pointer; - flex-shrink: 0; -} -.cnd-layout-interface__toggle-input { - opacity: 0; - width: 0; - height: 0; - position: absolute; -} -.cnd-layout-interface__toggle-slider { - position: absolute; - cursor: pointer; - top: 0; - left: 0; - right: 0; - bottom: 0; - background-color: var(--bs-gray-400, #6c757d); - border-radius: 24px; - transition: background-color 0.3s ease; - z-index: 1; -} -.cnd-layout-interface__toggle-slider::before { - position: absolute; - content: ""; - height: 20px; - width: 20px; - left: 2px; - top: 2px; - background-color: white; - border-radius: 50%; - transition: transform 0.3s ease; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); - will-change: transform; - z-index: 2; -} -.cnd-layout-interface__toggle-input:checked + .cnd-layout-interface__toggle-slider { - background-color: #0d6efd; - background-color: var(--bs-primary, #0d6efd); -} -.cnd-layout-interface__toggle-input:checked + .cnd-layout-interface__toggle-slider::before { - transform: translateX(24px); -} -.cnd-layout-interface__toggle-input:disabled + .cnd-layout-interface__toggle-slider { - opacity: 0.5; - cursor: not-allowed; -} -.cnd-layout-interface__toggle-input:focus + .cnd-layout-interface__toggle-slider { - box-shadow: 0 0 0 2px var(--bs-primary, #0d6efd), 0 0 0 4px rgba(13, 110, 253, 0.25); -} -.cnd-layout-interface__textarea { - font-family: - "Monaco", - "Menlo", - "Ubuntu Mono", - "Consolas", - "Courier New", - monospace; - font-size: 0.875rem; - line-height: 1.6; - background-color: var(--bs-gray-50, #f8f9fa); - transition: - border-color 0.15s ease-in-out, - box-shadow 0.15s ease-in-out, - background-color 0.15s ease-in-out; -} -.cnd-layout-interface__textarea:focus { - background-color: white; - border-color: var(--bs-primary, #0d6efd); - box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25); -} -.cnd-layout-interface__textarea:disabled { - background-color: var(--bs-gray-100, #e9ecef); - opacity: 1; -} -.cnd-layout-interface__content { - min-height: 400px; -} -.cnd-layout-interface .btn-outline-secondary:hover { - transform: translateY(-1px); - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); - transition: all 0.2s ease; -} -.cnd-layout-interface__undo-btn, -.cnd-layout-interface__redo-btn { - display: inline-flex; - align-items: center; - justify-content: center; - width: 32px; - height: 32px; - padding: 0; - font-size: 1.125rem; - font-weight: 500; - color: var(--bs-gray-600, #6c757d); - background-color: transparent; - border: 1px solid var(--bs-gray-300, #dee2e6); - border-radius: 6px; - cursor: pointer; - transition: all 0.15s ease-in-out; -} -.cnd-layout-interface__undo-btn:hover:not(:disabled), -.cnd-layout-interface__redo-btn:hover:not(:disabled) { - color: var(--bs-primary, #0d6efd); - background-color: var(--bs-gray-100, #f8f9fa); - border-color: var(--bs-primary, #0d6efd); -} -.cnd-layout-interface__undo-btn:disabled, -.cnd-layout-interface__redo-btn:disabled { - color: var(--bs-gray-400, #ced4da); - background-color: transparent; - border-color: var(--bs-gray-200, #e9ecef); - cursor: not-allowed; - opacity: 0.6; -} -.cnd-layout-interface__undo-btn:focus:not(:disabled), -.cnd-layout-interface__redo-btn:focus:not(:disabled) { - outline: none; - box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25); -} -@media (max-width: 576px) { - .cnd-layout-interface__toggle { - width: 44px; - height: 22px; - } - .cnd-layout-interface__toggle-slider::before { - height: 18px; - width: 18px; - } - .cnd-layout-interface__toggle-input:checked + .cnd-layout-interface__toggle-slider::before { - transform: translateX(22px); - } - .cnd-layout-interface__textarea { - font-size: 0.8125rem; - } -} -@media print { - .cnd-layout-interface__toggle, - .cnd-layout-interface__toggle-label { - display: none !important; - } -} -@media (prefers-reduced-motion: reduce) { - .cnd-layout-interface__toggle-slider, - .cnd-layout-interface__toggle-slider::before, - .cnd-layout-interface__textarea, - .cnd-layout-interface .btn-outline-secondary { - transition: none !important; - } -} -@media (prefers-contrast: high) { - .cnd-layout-interface__toggle-slider { - border: 2px solid; - } -} - -/* src/components/NoCodeView/NoCodeView.css */ -.cardContainer { - display: flex; - flex-direction: column; - gap: 8px; -} -.noCodeCard { - background: #ffffff; - border-radius: 6px; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04); - padding: 12px 14px; - position: relative; - border: 1px solid #e9ecef; -} -.noCodeCard:hover { - box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.06); -} -.noCodeCard > .input-group:first-of-type { - margin-bottom: 0; -} -.noCodeCard > .input-group:first-of-type .input-group-text { - background-color: #f8f9fa; - font-weight: 500; - border-right: none; -} -.noCodeCard > .input-group:first-of-type select { - border-left: 1px solid #dee2e6; -} -.input-group-text.stretch-height { - height: 100%; -} -.closeButton { - position: absolute; - top: 6px; - right: 8px; - background-color: transparent; - color: #adb5bd; - font-size: 1.25rem; - padding: 0; - line-height: 1; - border: none; - width: 24px; - height: 24px; - display: flex; - align-items: center; - justify-content: center; - border-radius: 4px; - transition: all 0.15s ease-in-out; -} -.closeButton:hover { - color: #dc3545; - background-color: #fee2e2; - cursor: pointer; -} -.code-input { - font-family: monospace; -} -.selector-input { - font-family: - ui-monospace, - SFMono-Regular, - "SF Mono", - Menlo, - Consolas, - "Liberation Mono", - monospace; - font-size: 0.9rem; - background-color: #f6f8fa; - border: 1px solid #d0d7de; - padding: 0.375rem 0.5rem; - width: 100%; - height: 2.25rem; - min-height: 2.25rem; - resize: vertical; - overflow-x: auto; - overflow-y: hidden; - white-space: pre; - line-height: 1.5; - field-sizing: content; -} -.selector-input:not([rows="1"]), -.selector-input[style*=height] { - overflow-y: auto; - height: auto; -} -.selector-input:focus { - outline: 2px solid #0969da; - outline-offset: -1px; - background-color: #ffffff; -} -.selector-input::-webkit-resizer { - background-color: #d0d7de; - border-radius: 2px; -} -.infolabel { - cursor: help; - text-decoration: underline; - color: #007bff; -} -.infolabel:hover { - color: #0056b3; - text-decoration: none; -} -.highlight { - border: 1px solid #007bff; - animation: fadeConstraintBorder 1s ease-out forwards; -} -@keyframes fadeConstraintBorder { - 0% { - border-color: #007bff; - } - 100% { - border-color: transparent; - } -} -.code-view-card { - background: #ffffff; - border: 1px solid #e5e9f0; - border-radius: 8px; - padding: 12px; -} -.code-view-textarea { - width: 100%; - min-height: 400px; - resize: vertical; - font-family: - "Monaco", - "Menlo", - "Ubuntu Mono", - "Consolas", - "Courier New", - monospace; - font-size: 0.875rem; - line-height: 1.6; - padding: 12px; - border: 1px solid #d0d7de; - border-radius: 6px; - background-color: #f8fafc; - color: #1f2937; -} -.code-view-textarea:focus { - outline: none; - border-color: #0d6efd; - box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15); - background-color: #ffffff; -} -.code-view-textarea:disabled { - background-color: #f3f4f6; - color: #9ca3af; - cursor: not-allowed; -} -.code-view-textarea::placeholder { - color: #9ca3af; -} -.direction-selector { - margin-top: 0.5rem; -} -.direction-selector__label { - display: block; - font-size: 0.875rem; - font-weight: 500; - color: #495057; - margin-bottom: 0.375rem; -} -.direction-selector__grid { - display: grid; - grid-template-columns: repeat(2, 1fr); - gap: 0.25rem; -} -.direction-selector__option { - display: flex; - align-items: center; - padding: 0.25rem 0.5rem; - border-radius: 4px; - cursor: pointer; - user-select: none; - font-size: 0.8125rem; - background-color: #f8f9fa; - border: 1px solid #dee2e6; - transition: all 0.15s ease-in-out; -} -.direction-selector__option:hover { - background-color: #e9ecef; - border-color: #adb5bd; -} -.direction-selector__option--selected { - background-color: #e7f1ff; - border-color: #0d6efd; - color: #0d6efd; -} -.direction-selector__option--selected:hover { - background-color: #d0e4ff; -} -.direction-selector__checkbox { - margin-right: 0.375rem; - accent-color: #0d6efd; -} -.direction-selector__text { - flex: 1; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} -.noCodeCard .input-group { - margin-bottom: 0.5rem; -} -.noCodeCard .input-group:last-child { - margin-bottom: 0; -} -.noCodeCard .input-group-text { - font-size: 0.8125rem; - padding: 0.25rem 0.5rem; - min-width: 80px; -} -.noCodeCard .form-control, -.noCodeCard select { - font-size: 0.875rem; - padding: 0.25rem 0.5rem; -} -.noCodeCard .params { - margin-top: 0.5rem; - padding-top: 0.5rem; - border-top: 1px solid #e9ecef; -} -.inline-checkbox { - display: inline-flex; - align-items: center; - gap: 0.375rem; - font-size: 0.8125rem; - color: #495057; - padding: 0.25rem 0.5rem; - background-color: #f8f9fa; - border-radius: 4px; - cursor: pointer; - user-select: none; - margin-top: 0.5rem; -} -.inline-checkbox:hover { - background-color: #e9ecef; -} -.inline-checkbox input[type=checkbox] { - margin: 0; - accent-color: #0d6efd; -} -.cardHeader { - display: flex; - align-items: center; - gap: 0.5rem; - margin-bottom: 0.5rem; -} -.collapseButton { - background: transparent; - border: none; - padding: 0; - width: 20px; - height: 20px; - display: flex; - align-items: center; - justify-content: center; - color: #6c757d; - cursor: pointer; - font-size: 0.625rem; - border-radius: 3px; - transition: all 0.15s ease-in-out; -} -.collapseButton:hover { - background-color: #e9ecef; - color: #495057; -} -.dragHandle { - color: #adb5bd; - cursor: grab; - font-size: 0.875rem; - letter-spacing: -2px; - user-select: none; - padding: 0 0.25rem; -} -.dragHandle:hover { - color: #6c757d; -} -.noCodeCard--collapsed { - padding: 8px 14px; -} -.noCodeCard--collapsed .params { - display: none; -} -.noCodeCard--collapsed .input-group { - margin-bottom: 0; -} -.noCodeCard.dragging { - opacity: 0.5; - border: 2px dashed #0d6efd; -} -.noCodeCard[draggable=true] { - cursor: grab; -} -.noCodeCard[draggable=true]:active { - cursor: grabbing; -} -.commentSection { - margin-top: 0.5rem; - padding-top: 0.5rem; - border-top: 1px dashed #dee2e6; -} -.commentInput { - width: 100%; - border: 1px solid #dee2e6; - border-radius: 4px; - padding: 0.25rem 0.5rem; - font-size: 0.75rem; - color: #6c757d; - background-color: #f8f9fa; - font-style: italic; -} -.commentInput:focus { - outline: none; - border-color: #86b7fe; - background-color: #fff; -} -.commentInput::placeholder { - color: #adb5bd; -} -.addCommentButton { - background: transparent; - border: none; - color: #adb5bd; - font-size: 0.75rem; - padding: 0; - cursor: pointer; - font-style: italic; -} -.addCommentButton:hover { - color: #6c757d; -} -.collapsedComment { - font-size: 0.75rem; - color: #6c757d; - font-style: italic; - margin-top: 0.25rem; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; -} -.sectionHeader { - display: flex; - align-items: center; - justify-content: space-between; - margin-bottom: 0.5rem; -} -.sectionHeader h5 { - margin: 0; -} -.collapseAllButtons { - display: flex; - gap: 0.5rem; -} -.collapseAllButton { - background: transparent; - border: 1px solid #dee2e6; - border-radius: 4px; - padding: 0.125rem 0.5rem; - font-size: 0.6875rem; - color: #6c757d; - cursor: pointer; - transition: all 0.15s ease-in-out; -} -.collapseAllButton:hover { - background-color: #f8f9fa; - border-color: #adb5bd; - color: #495057; -} - -/* src/components/InstanceBuilder/InstanceBuilder.css */ -.instance-builder { - border: 1px solid #e0e0e0; - border-radius: 8px; - padding: 20px; - background: #ffffff; - font-family: - -apple-system, - BlinkMacSystemFont, - "Segoe UI", - Roboto, - sans-serif; - max-width: 800px; -} -.instance-builder__header { - display: flex; - justify-content: space-between; - align-items: center; - margin-bottom: 20px; - padding-bottom: 10px; - border-bottom: 1px solid #e0e0e0; -} -.instance-builder__header h2 { - margin: 0; - color: #333; - font-size: 1.5rem; -} -.instance-builder__stats { - display: flex; - gap: 15px; - font-size: 0.9rem; - color: #666; -} -.instance-builder__stats span { - background: #f5f5f5; - padding: 4px 8px; - border-radius: 4px; -} -.instance-builder__error { - background: #fee; - border: 1px solid #fcc; - color: #c33; - padding: 10px 15px; - border-radius: 4px; - margin-bottom: 20px; - display: flex; - justify-content: space-between; - align-items: center; -} -.instance-builder__error button { - background: none; - border: none; - color: #c33; - font-size: 1.2rem; - cursor: pointer; - padding: 0; - width: 20px; - height: 20px; -} -.instance-builder__content { - display: flex; - flex-direction: column; - gap: 30px; -} -.relation-atoms { - background: #f9f9f9; - border: 1px solid #e0e0e0; - border-radius: 4px; - padding: 12px; - margin: 8px 0; -} -.atom-selector { - display: flex; - align-items: center; - gap: 8px; - margin-bottom: 8px; -} -.atom-selector label { - min-width: 80px; - font-weight: 500; -} -.atom-selector select { - flex: 1; - min-width: 200px; -} -.arity-controls { - display: flex; - gap: 8px; - padding-top: 8px; - border-top: 1px solid #e0e0e0; -} -.arity-controls button { - background: #6c757d; - color: white; - border: none; - padding: 6px 12px; - border-radius: 4px; - cursor: pointer; - font-size: 0.8rem; -} -.arity-controls button:hover:not(:disabled) { - background: #5a6268; -} -.instance-builder__section { - border: 1px solid #f0f0f0; - border-radius: 6px; - padding: 20px; - background: #fafafa; -} -.instance-builder__section h3 { - margin: 0 0 15px 0; - color: #444; - font-size: 1.2rem; - border-bottom: 1px solid #e0e0e0; - padding-bottom: 8px; -} -.instance-builder__form { - margin-bottom: 20px; -} -.form-row { - display: flex; - gap: 10px; - align-items: center; - flex-wrap: wrap; -} -.form-row input, -.form-row select { - padding: 8px 12px; - border: 1px solid #ddd; - border-radius: 4px; - font-size: 0.9rem; - min-width: 120px; - flex: 1; -} -.form-row input:focus, -.form-row select:focus { - outline: none; - border-color: #007acc; - box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2); -} -.form-row button { - background: #007acc; - color: white; - border: none; - padding: 8px 16px; - border-radius: 4px; - cursor: pointer; - font-size: 0.9rem; - white-space: nowrap; -} -.form-row button:hover:not(:disabled) { - background: #005a9e; -} -.form-row button:disabled { - background: #ccc; - cursor: not-allowed; -} -.instance-builder__list { - max-height: 300px; - overflow-y: auto; - border: 1px solid #e0e0e0; - border-radius: 4px; - background: white; -} -.empty-state { - padding: 20px; - text-align: center; - color: #888; - font-style: italic; - margin: 0; -} -.list-item { - display: flex; - justify-content: space-between; - align-items: center; - padding: 12px 15px; - border-bottom: 1px solid #f0f0f0; -} -.list-item:last-child { - border-bottom: none; -} -.list-item:hover { - background: #f9f9f9; -} -.item-info { - display: flex; - align-items: center; - gap: 10px; - flex: 1; -} -.item-info strong { - color: #333; - font-weight: 600; -} -.item-label { - color: #666; - font-style: italic; -} -.item-type { - background: #e7f3ff; - color: #0066cc; - padding: 2px 6px; - border-radius: 3px; - font-size: 0.8rem; - font-weight: 500; -} -.remove-button { - background: #dc3545; - color: white; - border: none; - padding: 6px 12px; - border-radius: 4px; - cursor: pointer; - font-size: 0.8rem; -} -.remove-button:hover:not(:disabled) { - background: #c82333; -} -.remove-button:disabled { - background: #ccc; - cursor: not-allowed; -} -.relation-group { - margin-bottom: 15px; -} -.relation-group h4 { - margin: 0 0 10px 0; - color: #555; - font-size: 1rem; - padding: 8px 15px; - background: #f0f8ff; - border-left: 3px solid #007acc; -} -.relation-group .list-item { - margin-left: 15px; - border-left: 2px solid #e0e0e0; -} -.instance-builder__actions { - display: flex; - gap: 15px; - align-items: flex-start; - padding-top: 20px; - border-top: 1px solid #e0e0e0; -} -.clear-button { - background: #6c757d; - color: white; - border: none; - padding: 10px 20px; - border-radius: 4px; - cursor: pointer; - font-size: 0.9rem; -} -.clear-button:hover:not(:disabled) { - background: #5a6268; -} -.clear-button:disabled { - background: #ccc; - cursor: not-allowed; -} -.import-section { - flex: 1; -} -.import-section summary { - cursor: pointer; - font-weight: 500; - color: #007acc; - padding: 10px 0; -} -.import-section summary:hover { - color: #005a9e; -} -.import-section textarea { - width: 100%; - padding: 10px; - border: 1px solid #ddd; - border-radius: 4px; - font-family: "Courier New", monospace; - font-size: 0.9rem; - resize: vertical; - margin-top: 10px; -} -.import-section textarea:focus { - outline: none; - border-color: #007acc; - box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.2); -} -@media (max-width: 768px) { - .instance-builder { - padding: 15px; - } - .instance-builder__header { - flex-direction: column; - align-items: flex-start; - gap: 10px; - } - .form-row { - flex-direction: column; - align-items: stretch; - } - .form-row input, - .form-row select, - .form-row button { - min-width: auto; - width: 100%; - } - .instance-builder__actions { - flex-direction: column; - } - .list-item { - flex-direction: column; - align-items: flex-start; - gap: 10px; - } - .item-info { - flex-direction: column; - align-items: flex-start; - gap: 5px; - } -} - -/* src/components/ErrorMessageModal/ErrorMessageModal.css */ -.error-card { - min-width: 320px; - max-width: 100%; -} -#error-message-modal { - border-radius: 0.5rem; - border: 2px var(--bs-danger) solid; -} -.constraint-item.highlight-source { - background-color: rgba(255, 193, 7, 0.35); - border-radius: 4px; -} -.constraint-item.highlight-diagram { - background-color: rgba(255, 193, 7, 0.7); - border-radius: 4px; -} -.constraint-relationship-table { - width: 100%; - margin-bottom: 1rem; -} -.constraint-relationship-table .constraint-item { - padding: 0.5rem; - border-bottom: 1px solid #eee; -} -.constraint-relationship-table .constraint-item:last-child { - border-bottom: none; -} -code > code, -code > pre { - border: 1px solid var(--bs-code-color); - padding: 0.2em 0.4em; - border-radius: 4px; -} - -/* src/components/ReplInterface/ReplInterface.css */ -.repl-interface { - display: flex; - flex-direction: column; - gap: 15px; - background: #1e1e1e; - color: #d4d4d4; - border-radius: 8px; - padding: 15px; - font-family: - "Courier New", - "Monaco", - "Menlo", - monospace; - max-width: 1400px; - min-height: 200px; -} -.repl-interface__main { - display: flex; - flex-direction: column; - gap: 20px; -} -.repl-interface__header { - display: flex; - align-items: center; - justify-content: space-between; - gap: 15px; - margin-bottom: 10px; - padding-bottom: 8px; - border-bottom: 1px solid #333; -} -.repl-interface__stats { - display: flex; - gap: 10px; - font-size: 0.85rem; - color: #9cdcfe; -} -.repl-interface__stats span { - background: rgba(156, 220, 254, 0.1); - padding: 3px 6px; - border-radius: 3px; - border: 1px solid rgba(156, 220, 254, 0.3); -} -.repl-interface__terminals { - display: flex; - flex-direction: column; - gap: 15px; - flex: 1; -} -.repl-terminal { - background: #252526; - border: 1px solid #3c3c3c; - border-radius: 6px; - display: flex; - flex-direction: column; - min-height: 120px; -} -.repl-terminal__header { - background: #2d2d30; - padding: 8px 12px; - border-bottom: 1px solid #3c3c3c; - font-size: 0.9rem; - font-weight: 600; - color: #cccccc; - display: flex; - justify-content: flex-end; - align-items: center; -} -.repl-terminal__help { - color: #6a737d; - font-size: 0.8rem; - cursor: pointer; -} -.repl-terminal__help:hover { - color: #9cdcfe; -} -.repl-terminal__output { - flex: 1; - padding: 10px; - overflow-y: auto; - font-size: 0.85rem; - line-height: 1.4; - min-height: 60px; - max-height: 120px; -} -.repl-terminal__input { - border-top: 2px solid #4ec9b0; - padding: 15px; - background: #1e1e1e; -} -.repl-terminal__input textarea { - width: 100%; - background: transparent; - border: 2px solid #3c3c3c; - border-radius: 4px; - padding: 10px; - color: #d4d4d4; - font-family: inherit; - font-size: 0.9rem; - line-height: 1.4; - resize: none; - outline: none; - min-height: 60px; - max-height: 100px; - transition: border-color 0.2s ease; -} -.repl-terminal__input textarea:focus { - border-color: #4ec9b0; -} -.repl-terminal__input textarea::placeholder { - color: #6a737d; -} -.repl-terminal__controls { - display: flex; - justify-content: flex-end; - align-items: center; - padding-top: 12px; - border-top: 1px solid #4ec9b0; -} -.repl-terminal__execute { - background: #4ec9b0; - color: #1e1e1e; - border: none; - padding: 8px 16px; - border-radius: 4px; - cursor: pointer; - font-size: 0.85rem; - font-family: inherit; - font-weight: 600; -} -.repl-terminal__execute:hover:not(:disabled) { - background: #6bd4ba; -} -.repl-terminal__execute:disabled { - background: #3c3c3c; - color: #6a737d; - cursor: not-allowed; -} -.repl-terminal__clear { - display: none; -} -.repl-output-line { - margin: 2px 0; - padding: 2px 0; -} -.repl-output-line.command { - color: #9cdcfe; -} -.repl-output-line.command::before { - content: "> "; - color: #4ec9b0; - font-weight: bold; -} -.repl-output-line.success { - color: #4ec9b0; -} -.repl-output-line.error { - color: #f48771; -} -.repl-output-line.error::before { - content: "\2717 "; -} -.repl-output-line.info { - color: #dcdcaa; -} -.repl-output-line.info::before { - content: "\2139 "; -} -.repl-output-line.help { - color: #6a737d; - font-style: italic; -} -.repl-interface__actions { - display: flex; - gap: 10px; - align-items: center; - padding-top: 15px; - border-top: 1px solid #3c3c3c; -} -.repl-interface__action-button { - background: #2d2d30; - color: #cccccc; - border: 1px solid #3c3c3c; - padding: 8px 16px; - border-radius: 4px; - cursor: pointer; - font-size: 0.85rem; - font-family: inherit; -} -.repl-interface__action-button:hover:not(:disabled) { - background: #37373d; - border-color: #505050; -} -.repl-interface__action-button:disabled { - background: #1e1e1e; - color: #6a737d; - cursor: not-allowed; -} -.repl-interface__action-button.primary { - background: #0e639c; - border-color: #0e639c; - color: white; -} -.repl-interface__action-button.primary:hover:not(:disabled) { - background: #1177bb; - border-color: #1177bb; -} -.repl-interface__action-button.danger { - background: #a74747; - border-color: #a74747; - color: white; -} -.repl-interface__action-button.danger:hover:not(:disabled) { - background: #c85450; - border-color: #c85450; -} -@media (max-width: 1024px) { - .repl-interface__drawers { - flex-direction: column; - } - .repl-interface__drawer { - max-width: none; - } - .repl-terminal { - min-height: 100px; - } -} -@media (max-width: 768px) { - .repl-interface { - padding: 10px; - } - .repl-interface__header { - flex-direction: column; - align-items: flex-start; - gap: 10px; - } - .repl-terminal__input textarea { - min-height: 40px; - } - .repl-interface__drawers { - gap: 8px; - } -} -.repl-terminal__output::-webkit-scrollbar { - width: 8px; -} -.repl-terminal__output::-webkit-scrollbar-track { - background: #252526; -} -.repl-terminal__output::-webkit-scrollbar-thumb { - background: #424242; - border-radius: 4px; -} -.repl-terminal__output::-webkit-scrollbar-thumb:hover { - background: #4f4f4f; -} -.repl-interface__drawers { - display: flex; - gap: 10px; - margin-top: 10px; -} -.repl-interface__drawer { - background: #252526; - border: 1px solid #3c3c3c; - border-radius: 6px; - flex: 1; - max-width: 300px; -} -.repl-interface__drawer-header { - padding: 8px 12px; - background: #2d2d30; - border-bottom: 1px solid #3c3c3c; - font-size: 0.9rem; - font-weight: 600; - color: #cccccc; - display: flex; - justify-content: space-between; - align-items: center; - cursor: pointer; -} -.repl-interface__drawer-toggle { - font-size: 0.8rem; - color: #9cdcfe; -} -.repl-interface__drawer-content { - max-height: 200px; - overflow-y: auto; - padding: 8px; -} -.repl-interface__drawer-content.collapsed { - display: none; -} -.repl-interface__drawer-item { - font-size: 0.8rem; - padding: 6px 8px; - background: rgba(156, 220, 254, 0.05); - border: 1px solid rgba(156, 220, 254, 0.2); - border-radius: 3px; - line-height: 1.3; - margin-bottom: 4px; - display: flex; - justify-content: space-between; - align-items: center; -} -.repl-interface__drawer-item-content { - flex: 1; -} -.repl-interface__drawer-item-header { - color: #9cdcfe; - font-weight: 600; -} -.repl-interface__drawer-item-detail { - color: #dcdcaa; - font-size: 0.75rem; - margin-top: 2px; -} -.repl-interface__drawer-delete { - background: #a74747; - border: none; - color: white; - font-size: 0.7rem; - padding: 2px 6px; - border-radius: 3px; - cursor: pointer; - margin-left: 8px; - opacity: 0.7; - transition: opacity 0.2s ease; -} -.repl-interface__drawer-delete:hover { - opacity: 1; - background: #c85450; -} -.repl-interface__drawer-empty { - color: #6a737d; - font-style: italic; - font-size: 0.8rem; - text-align: center; - padding: 10px; -} - -/* src/components/EvaluatorRepl/EvaluatorRepl.css */ -.code-input { - font-family: monospace; -} -#repl-output { - font-family: monospace; - white-space: pre-wrap; - max-height: 80vh; - overflow-y: auto; -} -#evaluator-input { - margin: 10px 0; -} - -/* src/components/RelationHighlighter/RelationHighlighter.css */ -.relation-highlighter { - border: 1px solid #ddd; - border-radius: 6px; - background: #ffffff; - font-family: - system-ui, - -apple-system, - sans-serif; - max-width: 320px; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); - overflow: hidden; -} -.relation-highlighter-header { - display: flex; - justify-content: space-between; - align-items: center; - padding: 14px 18px; - background: - linear-gradient( - 135deg, - #f8f9fa 0%, - #e9ecef 100%); - border-bottom: 1px solid #dee2e6; - cursor: pointer; - user-select: none; - transition: background-color 0.2s ease; - position: relative; -} -.relation-highlighter-header:hover { - background: - linear-gradient( - 135deg, - #e9ecef 0%, - #dee2e6 100%); -} -.relation-highlighter-header:active { - background: - linear-gradient( - 135deg, - #dee2e6 0%, - #ced4da 100%); -} -.relation-highlighter-title { - margin: 0; - font-size: 15px; - font-weight: 600; - color: #495057; - letter-spacing: 0.025em; -} -.collapse-toggle { - background: none; - border: none; - font-size: 16px; - color: #6c757d; - cursor: pointer; - padding: 6px; - border-radius: 4px; - transition: all 0.25s ease; - line-height: 1; - min-width: 28px; - min-height: 28px; - display: flex; - align-items: center; - justify-content: center; -} -.collapse-toggle:hover { - background: rgba(108, 117, 125, 0.1); - color: #495057; -} -.collapse-toggle.collapsed { - transform: rotate(-90deg); - color: #868e96; -} -.relation-highlighter-content { - max-height: 350px; - overflow: hidden; - transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1); - background: #ffffff; -} -.relation-highlighter-content.collapsed { - max-height: 0; - border-top: none; -} -.no-relations { - padding: 20px 18px; - text-align: center; - color: #6c757d; - font-style: italic; - margin: 0; - font-size: 14px; -} -.relation-list { - list-style: none; - margin: 0; - padding: 0; - max-height: 320px; - overflow-y: auto; - overflow-x: auto; -} -.relation-item { - padding: 12px 18px; - cursor: pointer; - border-bottom: 1px solid #f1f3f4; - color: #495057; - font-size: 14px; - font-weight: 500; - transition: all 0.2s ease; - user-select: none; - position: relative; - background: #ffffff; - overflow: hidden; - white-space: nowrap; - min-width: 100px; -} -.relation-item:last-child { - border-bottom: none; -} -.relation-item:hover { - background: - linear-gradient( - 90deg, - #e3f2fd 0%, - #f3e5f5 100%); - color: #1565c0; - font-weight: 600; - padding-left: 28px; - padding-right: 18px; -} -.relation-item:active { - background: - linear-gradient( - 90deg, - #bbdefb 0%, - #e1bee7 100%); -} -.relation-list::-webkit-scrollbar { - width: 8px; -} -.relation-list::-webkit-scrollbar-track { - background: #f8f9fa; - border-radius: 4px; -} -.relation-list::-webkit-scrollbar-thumb { - background: - linear-gradient( - 180deg, - #ced4da 0%, - #adb5bd 100%); - border-radius: 4px; - border: 1px solid #dee2e6; -} -.relation-list::-webkit-scrollbar-thumb:hover { - background: - linear-gradient( - 180deg, - #adb5bd 0%, - #868e96 100%); -} -@keyframes accordionExpand { - from { - opacity: 0; - transform: translateY(-10px); - } - to { - opacity: 1; - transform: translateY(0); - } -} -.relation-highlighter-content:not(.collapsed) .relation-list { - animation: accordionExpand 0.3s ease-out; -} -@media (max-width: 480px) { - .relation-highlighter { - max-width: 100%; - border-radius: 4px; - } - .relation-highlighter-title { - font-size: 14px; - } - .relation-item { - padding: 14px 18px; - font-size: 15px; - padding-right: 32px; - } - .relation-item:hover { - padding-left: 32px; - padding-right: 18px; - } -} -.relation-highlighter-header:focus { - outline: 2px solid #0d6efd; - outline-offset: -2px; -} -.collapse-toggle:focus { - outline: 2px solid #0d6efd; - outline-offset: 2px; - border-radius: 4px; -} -.relation-item:focus { - outline: 2px solid #0d6efd; - outline-offset: -2px; - background: #e3f2fd; -} - -/* src/components/ProjectionControls/ProjectionControls.css */ -.projection-controls { - background: #f8f9fa; - border: 1px solid #dee2e6; - border-radius: 0.25rem; - padding: 1rem; - margin-bottom: 1rem; -} -.projection-controls__header { - margin-bottom: 1rem; -} -.projection-controls__title { - font-size: 1.1rem; - font-weight: 600; - margin: 0 0 0.25rem 0; - color: #212529; -} -.projection-controls__description { - font-size: 0.875rem; - color: #6c757d; - margin: 0; - font-style: italic; -} -.projection-controls__list { - display: flex; - flex-direction: column; - gap: 0.75rem; -} -.projection-controls__item { - display: flex; - align-items: center; - gap: 0.75rem; -} -.projection-controls__label { - font-weight: 500; - color: #495057; - min-width: 120px; - margin: 0; - font-size: 0.875rem; -} -.projection-controls__select { - flex: 1; - padding: 0.375rem 0.75rem; - font-size: 0.875rem; - line-height: 1.5; - color: #495057; - background-color: #fff; - background-clip: padding-box; - border: 1px solid #ced4da; - border-radius: 0.25rem; - transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; -} -.projection-controls__select:focus { - color: #495057; - background-color: #fff; - border-color: #80bdff; - outline: 0; - box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25); -} -.projection-controls__select:disabled { - background-color: #e9ecef; - opacity: 1; - cursor: not-allowed; -} -@media (max-width: 576px) { - .projection-controls__item { - flex-direction: column; - align-items: flex-start; - } - .projection-controls__label { - min-width: auto; - } - .projection-controls__select { - width: 100%; - } -} +.cnd-layout-interface{font-family:var(--bs-font-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif)}.cnd-layout-interface--disabled{opacity:.6;pointer-events:none}.cnd-layout-interface__toggle{position:relative;display:inline-block;width:48px;height:24px;cursor:pointer;flex-shrink:0}.cnd-layout-interface__toggle-input{opacity:0;width:0;height:0;position:absolute}.cnd-layout-interface__toggle-slider{position:absolute;cursor:pointer;inset:0;background-color:var(--bs-gray-400, #6c757d);border-radius:24px;transition:background-color .3s ease;z-index:1}.cnd-layout-interface__toggle-slider:before{position:absolute;content:"";height:20px;width:20px;left:2px;top:2px;background-color:#fff;border-radius:50%;transition:transform .3s ease;box-shadow:0 2px 4px #0003;will-change:transform;z-index:2}.cnd-layout-interface__toggle-input:checked+.cnd-layout-interface__toggle-slider{background-color:#0d6efd;background-color:var(--bs-primary, #0d6efd)}.cnd-layout-interface__toggle-input:checked+.cnd-layout-interface__toggle-slider:before{transform:translate(24px)}.cnd-layout-interface__toggle-input:disabled+.cnd-layout-interface__toggle-slider{opacity:.5;cursor:not-allowed}.cnd-layout-interface__toggle-input:focus+.cnd-layout-interface__toggle-slider{box-shadow:0 0 0 2px var(--bs-primary, #0d6efd),0 0 0 4px #0d6efd40}.cnd-layout-interface__textarea{font-family:Monaco,Menlo,Ubuntu Mono,Consolas,Courier New,monospace;font-size:.875rem;line-height:1.6;background-color:var(--bs-gray-50, #f8f9fa);transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out,background-color .15s ease-in-out}.cnd-layout-interface__textarea:focus{background-color:#fff;border-color:var(--bs-primary, #0d6efd);box-shadow:0 0 0 .25rem #0d6efd40}.cnd-layout-interface__textarea:disabled{background-color:var(--bs-gray-100, #e9ecef);opacity:1}.cnd-layout-interface__content{min-height:400px}.cnd-layout-interface .btn-outline-secondary:hover{transform:translateY(-1px);box-shadow:0 2px 4px #0000001a;transition:all .2s ease}.cnd-layout-interface__undo-btn,.cnd-layout-interface__redo-btn{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;font-size:1.125rem;font-weight:500;color:var(--bs-gray-600, #6c757d);background-color:transparent;border:1px solid var(--bs-gray-300, #dee2e6);border-radius:6px;cursor:pointer;transition:all .15s ease-in-out}.cnd-layout-interface__undo-btn:hover:not(:disabled),.cnd-layout-interface__redo-btn:hover:not(:disabled){color:var(--bs-primary, #0d6efd);background-color:var(--bs-gray-100, #f8f9fa);border-color:var(--bs-primary, #0d6efd)}.cnd-layout-interface__undo-btn:disabled,.cnd-layout-interface__redo-btn:disabled{color:var(--bs-gray-400, #ced4da);background-color:transparent;border-color:var(--bs-gray-200, #e9ecef);cursor:not-allowed;opacity:.6}.cnd-layout-interface__undo-btn:focus:not(:disabled),.cnd-layout-interface__redo-btn:focus:not(:disabled){outline:none;box-shadow:0 0 0 2px #0d6efd40}@media(max-width:576px){.cnd-layout-interface__toggle{width:44px;height:22px}.cnd-layout-interface__toggle-slider:before{height:18px;width:18px}.cnd-layout-interface__toggle-input:checked+.cnd-layout-interface__toggle-slider:before{transform:translate(22px)}.cnd-layout-interface__textarea{font-size:.8125rem}}@media print{.cnd-layout-interface__toggle,.cnd-layout-interface__toggle-label{display:none!important}}@media(prefers-reduced-motion:reduce){.cnd-layout-interface__toggle-slider,.cnd-layout-interface__toggle-slider:before,.cnd-layout-interface__textarea,.cnd-layout-interface .btn-outline-secondary{transition:none!important}}@media(prefers-contrast:high){.cnd-layout-interface__toggle-slider{border:2px solid}}.cardContainer{display:flex;flex-direction:column;gap:8px}.noCodeCard{background:#fff;border-radius:6px;box-shadow:0 1px 3px #00000014,0 1px 2px #0000000a;padding:12px 14px;position:relative;border:1px solid #e9ecef}.noCodeCard:hover{box-shadow:0 2px 6px #0000001a,0 1px 3px #0000000f}.noCodeCard>.input-group:first-of-type{margin-bottom:0}.noCodeCard>.input-group:first-of-type .input-group-text{background-color:#f8f9fa;font-weight:500;border-right:none}.noCodeCard>.input-group:first-of-type select{border-left:1px solid #dee2e6}.input-group-text.stretch-height{height:100%}.closeButton{position:absolute;top:6px;right:8px;background-color:transparent;color:#adb5bd;font-size:1.25rem;padding:0;line-height:1;border:none;width:24px;height:24px;display:flex;align-items:center;justify-content:center;border-radius:4px;transition:all .15s ease-in-out}.closeButton:hover{color:#dc3545;background-color:#fee2e2;cursor:pointer}.selector-input{font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace;font-size:.9rem;background-color:#f6f8fa;border:1px solid #d0d7de;padding:.375rem .5rem;width:100%;height:2.25rem;min-height:2.25rem;resize:vertical;overflow-x:auto;overflow-y:hidden;white-space:pre;line-height:1.5;field-sizing:content}.selector-input:not([rows="1"]),.selector-input[style*=height]{overflow-y:auto;height:auto}.selector-input:focus{outline:2px solid #0969da;outline-offset:-1px;background-color:#fff}.selector-input::-webkit-resizer{background-color:#d0d7de;border-radius:2px}.infolabel{cursor:help;text-decoration:underline;color:#007bff}.infolabel:hover{color:#0056b3;text-decoration:none}.highlight{border:1px solid #007bff;animation:fadeConstraintBorder 1s ease-out forwards}@keyframes fadeConstraintBorder{0%{border-color:#007bff}to{border-color:transparent}}.code-view-card{background:#fff;border:1px solid #e5e9f0;border-radius:8px;padding:12px}.code-view-textarea{width:100%;min-height:400px;resize:vertical;font-family:Monaco,Menlo,Ubuntu Mono,Consolas,Courier New,monospace;font-size:.875rem;line-height:1.6;padding:12px;border:1px solid #d0d7de;border-radius:6px;background-color:#f8fafc;color:#1f2937}.code-view-textarea:focus{outline:none;border-color:#0d6efd;box-shadow:0 0 0 3px #0d6efd26;background-color:#fff}.code-view-textarea:disabled{background-color:#f3f4f6;color:#9ca3af;cursor:not-allowed}.code-view-textarea::placeholder{color:#9ca3af}.direction-selector{margin-top:.5rem}.direction-selector__label{display:block;font-size:.875rem;font-weight:500;color:#495057;margin-bottom:.375rem}.direction-selector__grid{display:grid;grid-template-columns:repeat(2,1fr);gap:.25rem}.direction-selector__option{display:flex;align-items:center;padding:.25rem .5rem;border-radius:4px;cursor:pointer;user-select:none;font-size:.8125rem;background-color:#f8f9fa;border:1px solid #dee2e6;transition:all .15s ease-in-out}.direction-selector__option:hover{background-color:#e9ecef;border-color:#adb5bd}.direction-selector__option--selected{background-color:#e7f1ff;border-color:#0d6efd;color:#0d6efd}.direction-selector__option--selected:hover{background-color:#d0e4ff}.direction-selector__checkbox{margin-right:.375rem;accent-color:#0d6efd}.direction-selector__text{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.noCodeCard .input-group{margin-bottom:.5rem}.noCodeCard .input-group:last-child{margin-bottom:0}.noCodeCard .input-group-text{font-size:.8125rem;padding:.25rem .5rem;min-width:80px}.noCodeCard .form-control,.noCodeCard select{font-size:.875rem;padding:.25rem .5rem}.noCodeCard .params{margin-top:.5rem;padding-top:.5rem;border-top:1px solid #e9ecef}.inline-checkbox{display:inline-flex;align-items:center;gap:.375rem;font-size:.8125rem;color:#495057;padding:.25rem .5rem;background-color:#f8f9fa;border-radius:4px;cursor:pointer;user-select:none;margin-top:.5rem}.inline-checkbox:hover{background-color:#e9ecef}.inline-checkbox input[type=checkbox]{margin:0;accent-color:#0d6efd}.cardHeader{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}.collapseButton{background:transparent;border:none;padding:0;width:20px;height:20px;display:flex;align-items:center;justify-content:center;color:#6c757d;cursor:pointer;font-size:.625rem;border-radius:3px;transition:all .15s ease-in-out}.collapseButton:hover{background-color:#e9ecef;color:#495057}.dragHandle{color:#adb5bd;cursor:grab;font-size:.875rem;letter-spacing:-2px;user-select:none;padding:0 .25rem}.dragHandle:hover{color:#6c757d}.noCodeCard--collapsed{padding:8px 14px}.noCodeCard--collapsed .params{display:none}.noCodeCard--collapsed .input-group{margin-bottom:0}.noCodeCard.dragging{opacity:.5;border:2px dashed #0d6efd}.noCodeCard[draggable=true]{cursor:grab}.noCodeCard[draggable=true]:active{cursor:grabbing}.commentSection{margin-top:.5rem;padding-top:.5rem;border-top:1px dashed #dee2e6}.commentInput{width:100%;border:1px solid #dee2e6;border-radius:4px;padding:.25rem .5rem;font-size:.75rem;color:#6c757d;background-color:#f8f9fa;font-style:italic}.commentInput:focus{outline:none;border-color:#86b7fe;background-color:#fff}.commentInput::placeholder{color:#adb5bd}.addCommentButton{background:transparent;border:none;color:#adb5bd;font-size:.75rem;padding:0;cursor:pointer;font-style:italic}.addCommentButton:hover{color:#6c757d}.collapsedComment{font-size:.75rem;color:#6c757d;font-style:italic;margin-top:.25rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sectionHeader{display:flex;align-items:center;justify-content:space-between;margin-bottom:.5rem}.sectionHeader h5{margin:0}.collapseAllButtons{display:flex;gap:.5rem}.collapseAllButton{background:transparent;border:1px solid #dee2e6;border-radius:4px;padding:.125rem .5rem;font-size:.6875rem;color:#6c757d;cursor:pointer;transition:all .15s ease-in-out}.collapseAllButton:hover{background-color:#f8f9fa;border-color:#adb5bd;color:#495057}.instance-builder{border:1px solid #e0e0e0;border-radius:8px;padding:20px;background:#fff;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;max-width:800px}.instance-builder__header{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px;padding-bottom:10px;border-bottom:1px solid #e0e0e0}.instance-builder__header h2{margin:0;color:#333;font-size:1.5rem}.instance-builder__stats{display:flex;gap:15px;font-size:.9rem;color:#666}.instance-builder__stats span{background:#f5f5f5;padding:4px 8px;border-radius:4px}.instance-builder__error{background:#fee;border:1px solid #fcc;color:#c33;padding:10px 15px;border-radius:4px;margin-bottom:20px;display:flex;justify-content:space-between;align-items:center}.instance-builder__error button{background:none;border:none;color:#c33;font-size:1.2rem;cursor:pointer;padding:0;width:20px;height:20px}.instance-builder__content{display:flex;flex-direction:column;gap:30px}.relation-atoms{background:#f9f9f9;border:1px solid #e0e0e0;border-radius:4px;padding:12px;margin:8px 0}.atom-selector{display:flex;align-items:center;gap:8px;margin-bottom:8px}.atom-selector label{min-width:80px;font-weight:500}.atom-selector select{flex:1;min-width:200px}.arity-controls{display:flex;gap:8px;padding-top:8px;border-top:1px solid #e0e0e0}.arity-controls button{background:#6c757d;color:#fff;border:none;padding:6px 12px;border-radius:4px;cursor:pointer;font-size:.8rem}.arity-controls button:hover:not(:disabled){background:#5a6268}.instance-builder__section{border:1px solid #f0f0f0;border-radius:6px;padding:20px;background:#fafafa}.instance-builder__section h3{margin:0 0 15px;color:#444;font-size:1.2rem;border-bottom:1px solid #e0e0e0;padding-bottom:8px}.instance-builder__form{margin-bottom:20px}.form-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.form-row input,.form-row select{padding:8px 12px;border:1px solid #ddd;border-radius:4px;font-size:.9rem;min-width:120px;flex:1}.form-row input:focus,.form-row select:focus{outline:none;border-color:#007acc;box-shadow:0 0 0 2px #007acc33}.form-row button{background:#007acc;color:#fff;border:none;padding:8px 16px;border-radius:4px;cursor:pointer;font-size:.9rem;white-space:nowrap}.form-row button:hover:not(:disabled){background:#005a9e}.form-row button:disabled{background:#ccc;cursor:not-allowed}.instance-builder__list{max-height:300px;overflow-y:auto;border:1px solid #e0e0e0;border-radius:4px;background:#fff}.empty-state{padding:20px;text-align:center;color:#888;font-style:italic;margin:0}.list-item{display:flex;justify-content:space-between;align-items:center;padding:12px 15px;border-bottom:1px solid #f0f0f0}.list-item:last-child{border-bottom:none}.list-item:hover{background:#f9f9f9}.item-info{display:flex;align-items:center;gap:10px;flex:1}.item-info strong{color:#333;font-weight:600}.item-label{color:#666;font-style:italic}.item-type{background:#e7f3ff;color:#06c;padding:2px 6px;border-radius:3px;font-size:.8rem;font-weight:500}.remove-button{background:#dc3545;color:#fff;border:none;padding:6px 12px;border-radius:4px;cursor:pointer;font-size:.8rem}.remove-button:hover:not(:disabled){background:#c82333}.remove-button:disabled{background:#ccc;cursor:not-allowed}.relation-group{margin-bottom:15px}.relation-group h4{margin:0 0 10px;color:#555;font-size:1rem;padding:8px 15px;background:#f0f8ff;border-left:3px solid #007acc}.relation-group .list-item{margin-left:15px;border-left:2px solid #e0e0e0}.instance-builder__actions{display:flex;gap:15px;align-items:flex-start;padding-top:20px;border-top:1px solid #e0e0e0}.clear-button{background:#6c757d;color:#fff;border:none;padding:10px 20px;border-radius:4px;cursor:pointer;font-size:.9rem}.clear-button:hover:not(:disabled){background:#5a6268}.clear-button:disabled{background:#ccc;cursor:not-allowed}.import-section{flex:1}.import-section summary{cursor:pointer;font-weight:500;color:#007acc;padding:10px 0}.import-section summary:hover{color:#005a9e}.import-section textarea{width:100%;padding:10px;border:1px solid #ddd;border-radius:4px;font-family:Courier New,monospace;font-size:.9rem;resize:vertical;margin-top:10px}.import-section textarea:focus{outline:none;border-color:#007acc;box-shadow:0 0 0 2px #007acc33}@media(max-width:768px){.instance-builder{padding:15px}.instance-builder__header{flex-direction:column;align-items:flex-start;gap:10px}.form-row{flex-direction:column;align-items:stretch}.form-row input,.form-row select,.form-row button{min-width:auto;width:100%}.instance-builder__actions{flex-direction:column}.list-item{flex-direction:column;align-items:flex-start;gap:10px}.item-info{flex-direction:column;align-items:flex-start;gap:5px}}.error-card{min-width:320px;max-width:100%}#error-message-modal{border-radius:.5rem;border:2px var(--bs-danger) solid}.constraint-item.highlight-source{background-color:#ffc10759;border-radius:4px}.constraint-item.highlight-diagram{background-color:#ffc107b3;border-radius:4px}.constraint-relationship-table{width:100%;margin-bottom:1rem}.constraint-relationship-table .constraint-item{padding:.5rem;border-bottom:1px solid #eee}.constraint-relationship-table .constraint-item:last-child{border-bottom:none}code>code,code>pre{border:1px solid var(--bs-code-color);padding:.2em .4em;border-radius:4px}.repl-interface{display:flex;flex-direction:column;gap:15px;background:#1e1e1e;color:#d4d4d4;border-radius:8px;padding:15px;font-family:Courier New,Monaco,Menlo,monospace;max-width:1400px;min-height:200px}.repl-interface__main{display:flex;flex-direction:column;gap:20px}.repl-interface__header{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:10px;padding-bottom:8px;border-bottom:1px solid #333}.repl-interface__stats{display:flex;gap:10px;font-size:.85rem;color:#9cdcfe}.repl-interface__stats span{background:#9cdcfe1a;padding:3px 6px;border-radius:3px;border:1px solid rgba(156,220,254,.3)}.repl-interface__terminals{display:flex;flex-direction:column;gap:15px;flex:1}.repl-terminal{background:#252526;border:1px solid #3c3c3c;border-radius:6px;display:flex;flex-direction:column;min-height:120px}.repl-terminal__header{background:#2d2d30;padding:8px 12px;border-bottom:1px solid #3c3c3c;font-size:.9rem;font-weight:600;color:#ccc;display:flex;justify-content:flex-end;align-items:center}.repl-terminal__help{color:#6a737d;font-size:.8rem;cursor:pointer}.repl-terminal__help:hover{color:#9cdcfe}.repl-terminal__output{flex:1;padding:10px;overflow-y:auto;font-size:.85rem;line-height:1.4;min-height:60px;max-height:120px}.repl-terminal__input{border-top:2px solid #4ec9b0;padding:15px;background:#1e1e1e}.repl-terminal__input textarea{width:100%;background:transparent;border:2px solid #3c3c3c;border-radius:4px;padding:10px;color:#d4d4d4;font-family:inherit;font-size:.9rem;line-height:1.4;resize:none;outline:none;min-height:60px;max-height:100px;transition:border-color .2s ease}.repl-terminal__input textarea:focus{border-color:#4ec9b0}.repl-terminal__input textarea::placeholder{color:#6a737d}.repl-terminal__controls{display:flex;justify-content:flex-end;align-items:center;padding-top:12px;border-top:1px solid #4ec9b0}.repl-terminal__execute{background:#4ec9b0;color:#1e1e1e;border:none;padding:8px 16px;border-radius:4px;cursor:pointer;font-size:.85rem;font-family:inherit;font-weight:600}.repl-terminal__execute:hover:not(:disabled){background:#6bd4ba}.repl-terminal__execute:disabled{background:#3c3c3c;color:#6a737d;cursor:not-allowed}.repl-terminal__clear{display:none}.repl-output-line{margin:2px 0;padding:2px 0}.repl-output-line.command{color:#9cdcfe}.repl-output-line.command:before{content:"> ";color:#4ec9b0;font-weight:700}.repl-output-line.success{color:#4ec9b0}.repl-output-line.error{color:#f48771}.repl-output-line.error:before{content:"\2717 "}.repl-output-line.info{color:#dcdcaa}.repl-output-line.info:before{content:"\2139 "}.repl-output-line.help{color:#6a737d;font-style:italic}.repl-interface__actions{display:flex;gap:10px;align-items:center;padding-top:15px;border-top:1px solid #3c3c3c}.repl-interface__action-button{background:#2d2d30;color:#ccc;border:1px solid #3c3c3c;padding:8px 16px;border-radius:4px;cursor:pointer;font-size:.85rem;font-family:inherit}.repl-interface__action-button:hover:not(:disabled){background:#37373d;border-color:#505050}.repl-interface__action-button:disabled{background:#1e1e1e;color:#6a737d;cursor:not-allowed}.repl-interface__action-button.primary{background:#0e639c;border-color:#0e639c;color:#fff}.repl-interface__action-button.primary:hover:not(:disabled){background:#17b;border-color:#17b}.repl-interface__action-button.danger{background:#a74747;border-color:#a74747;color:#fff}.repl-interface__action-button.danger:hover:not(:disabled){background:#c85450;border-color:#c85450}@media(max-width:1024px){.repl-interface__drawers{flex-direction:column}.repl-interface__drawer{max-width:none}.repl-terminal{min-height:100px}}@media(max-width:768px){.repl-interface{padding:10px}.repl-interface__header{flex-direction:column;align-items:flex-start;gap:10px}.repl-terminal__input textarea{min-height:40px}.repl-interface__drawers{gap:8px}}.repl-terminal__output::-webkit-scrollbar{width:8px}.repl-terminal__output::-webkit-scrollbar-track{background:#252526}.repl-terminal__output::-webkit-scrollbar-thumb{background:#424242;border-radius:4px}.repl-terminal__output::-webkit-scrollbar-thumb:hover{background:#4f4f4f}.repl-interface__drawers{display:flex;gap:10px;margin-top:10px}.repl-interface__drawer{background:#252526;border:1px solid #3c3c3c;border-radius:6px;flex:1;max-width:300px}.repl-interface__drawer-header{padding:8px 12px;background:#2d2d30;border-bottom:1px solid #3c3c3c;font-size:.9rem;font-weight:600;color:#ccc;display:flex;justify-content:space-between;align-items:center;cursor:pointer}.repl-interface__drawer-toggle{font-size:.8rem;color:#9cdcfe}.repl-interface__drawer-content{max-height:200px;overflow-y:auto;padding:8px}.repl-interface__drawer-content.collapsed{display:none}.repl-interface__drawer-item{font-size:.8rem;padding:6px 8px;background:#9cdcfe0d;border:1px solid rgba(156,220,254,.2);border-radius:3px;line-height:1.3;margin-bottom:4px;display:flex;justify-content:space-between;align-items:center}.repl-interface__drawer-item-content{flex:1}.repl-interface__drawer-item-header{color:#9cdcfe;font-weight:600}.repl-interface__drawer-item-detail{color:#dcdcaa;font-size:.75rem;margin-top:2px}.repl-interface__drawer-delete{background:#a74747;border:none;color:#fff;font-size:.7rem;padding:2px 6px;border-radius:3px;cursor:pointer;margin-left:8px;opacity:.7;transition:opacity .2s ease}.repl-interface__drawer-delete:hover{opacity:1;background:#c85450}.repl-interface__drawer-empty{color:#6a737d;font-style:italic;font-size:.8rem;text-align:center;padding:10px}.code-input{font-family:monospace}#repl-output{font-family:monospace;white-space:pre-wrap;max-height:80vh;overflow-y:auto}#evaluator-input{margin:10px 0}.relation-highlighter{border:1px solid #ddd;border-radius:6px;background:#fff;font-family:system-ui,-apple-system,sans-serif;max-width:320px;box-shadow:0 2px 4px #0000001a;overflow:hidden}.relation-highlighter-header{display:flex;justify-content:space-between;align-items:center;padding:14px 18px;background:linear-gradient(135deg,#f8f9fa,#e9ecef);border-bottom:1px solid #dee2e6;cursor:pointer;user-select:none;transition:background-color .2s ease;position:relative}.relation-highlighter-header:hover{background:linear-gradient(135deg,#e9ecef,#dee2e6)}.relation-highlighter-header:active{background:linear-gradient(135deg,#dee2e6,#ced4da)}.relation-highlighter-title{margin:0;font-size:15px;font-weight:600;color:#495057;letter-spacing:.025em}.collapse-toggle{background:none;border:none;font-size:16px;color:#6c757d;cursor:pointer;padding:6px;border-radius:4px;transition:all .25s ease;line-height:1;min-width:28px;min-height:28px;display:flex;align-items:center;justify-content:center}.collapse-toggle:hover{background:#6c757d1a;color:#495057}.collapse-toggle.collapsed{transform:rotate(-90deg);color:#868e96}.relation-highlighter-content{max-height:350px;overflow:hidden;transition:max-height .35s cubic-bezier(.4,0,.2,1);background:#fff}.relation-highlighter-content.collapsed{max-height:0;border-top:none}.no-relations{padding:20px 18px;text-align:center;color:#6c757d;font-style:italic;margin:0;font-size:14px}.relation-list{list-style:none;margin:0;padding:0;max-height:320px;overflow-y:auto;overflow-x:auto}.relation-item{padding:12px 18px;cursor:pointer;border-bottom:1px solid #f1f3f4;color:#495057;font-size:14px;font-weight:500;transition:all .2s ease;user-select:none;position:relative;background:#fff;overflow:hidden;white-space:nowrap;min-width:100px}.relation-item:last-child{border-bottom:none}.relation-item:hover{background:linear-gradient(90deg,#e3f2fd,#f3e5f5);color:#1565c0;font-weight:600;padding-left:28px;padding-right:18px}.relation-item:active{background:linear-gradient(90deg,#bbdefb,#e1bee7)}.relation-list::-webkit-scrollbar{width:8px}.relation-list::-webkit-scrollbar-track{background:#f8f9fa;border-radius:4px}.relation-list::-webkit-scrollbar-thumb{background:linear-gradient(180deg,#ced4da,#adb5bd);border-radius:4px;border:1px solid #dee2e6}.relation-list::-webkit-scrollbar-thumb:hover{background:linear-gradient(180deg,#adb5bd,#868e96)}@keyframes accordionExpand{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.relation-highlighter-content:not(.collapsed) .relation-list{animation:accordionExpand .3s ease-out}@media(max-width:480px){.relation-highlighter{max-width:100%;border-radius:4px}.relation-highlighter-title{font-size:14px}.relation-item{padding:14px 32px 14px 18px;font-size:15px}.relation-item:hover{padding-left:32px;padding-right:18px}}.relation-highlighter-header:focus{outline:2px solid #0d6efd;outline-offset:-2px}.collapse-toggle:focus{outline:2px solid #0d6efd;outline-offset:2px;border-radius:4px}.relation-item:focus{outline:2px solid #0d6efd;outline-offset:-2px;background:#e3f2fd}.projection-controls{background:#f8f9fa;border:1px solid #dee2e6;border-radius:.25rem;padding:1rem;margin-bottom:1rem}.projection-controls__header{margin-bottom:1rem}.projection-controls__title{font-size:1.1rem;font-weight:600;margin:0 0 .25rem;color:#212529}.projection-controls__description{font-size:.875rem;color:#6c757d;margin:0;font-style:italic}.projection-controls__list{display:flex;flex-direction:column;gap:.75rem}.projection-controls__item{display:flex;align-items:center;gap:.75rem}.projection-controls__label{font-weight:500;color:#495057;min-width:120px;margin:0;font-size:.875rem}.projection-controls__select{flex:1;padding:.375rem .75rem;font-size:.875rem;line-height:1.5;color:#495057;background-color:#fff;background-clip:padding-box;border:1px solid #ced4da;border-radius:.25rem;transition:border-color .15s ease-in-out,box-shadow .15s ease-in-out}.projection-controls__select:focus{color:#495057;background-color:#fff;border-color:#80bdff;outline:0;box-shadow:0 0 0 .2rem #007bff40}.projection-controls__select:disabled{background-color:#e9ecef;opacity:1;cursor:not-allowed}@media(max-width:576px){.projection-controls__item{flex-direction:column;align-items:flex-start}.projection-controls__label{min-width:auto}.projection-controls__select{width:100%}} /*# sourceMappingURL=react-component-integration.css.map */ \ No newline at end of file diff --git a/forge/sterling/build/vendor/react-component-integration.global.js b/forge/sterling/build/vendor/react-component-integration.global.js index ee3a8c87..3b0dfa9a 100644 --- a/forge/sterling/build/vendor/react-component-integration.global.js +++ b/forge/sterling/build/vendor/react-component-integration.global.js @@ -1,2 +1,2 @@ /*! For license information please see react-component-integration.global.js.LICENSE.txt */ -"use strict";var IntegratedDemo=(()=>{var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,o=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty,s=(e=>"undefined"!=typeof require?require:"undefined"!=typeof Proxy?new Proxy(e,{get:(e,t)=>("undefined"!=typeof require?require:e)[t]}):e)((function(e){if("undefined"!=typeof require)return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')})),a=(e,t)=>function(){return t||(0,e[r(e)[0]])((t={exports:{}}).exports,t),t.exports},l=(e,o,s,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let l of r(o))i.call(e,l)||l===s||t(e,l,{get:()=>o[l],enumerable:!(a=n(o,l))||a.enumerable});return e},u=(n,r,i)=>(i=null!=n?e(o(n)):{},l(!r&&n&&n.__esModule?i:t(i,"default",{value:n,enumerable:!0}),n)),c=a({"node_modules/react/cjs/react.development.js"(e,t){!function(){function n(e,t){Object.defineProperty(o.prototype,e,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})}function r(e,t){var n=(e=(e=e.constructor)&&(e.displayName||e.name)||"ReactClass")+"."+t;$[n]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,e),$[n]=!0)}function o(e,t,n){this.props=e,this.context=t,this.refs=V,this.updater=n||G}function i(){}function s(e,t,n){this.props=e,this.context=t,this.refs=V,this.updater=n||G}function a(e){return""+e}function l(e){try{a(e);var t=!1}catch(e){t=!0}if(t){var n=(t=console).error,r="function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",r),a(e)}}function u(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===Z?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case j:return"Fragment";case I:return"Profiler";case L:return"StrictMode";case K:return"Suspense";case F:return"SuspenseList";case z:return"Activity"}if("object"==typeof e)switch("number"==typeof e.tag&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case k:return"Portal";case D:return(e.displayName||"Context")+".Provider";case P:return(e._context.displayName||"Context")+".Consumer";case M:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case U:return null!==(t=e.displayName||null)?t:u(e.type)||"Memo";case H:t=e._payload,e=e._init;try{return u(e(t))}catch(e){}}return null}function c(e){if(e===j)return"<>";if("object"==typeof e&&null!==e&&e.$$typeof===H)return"<...>";try{var t=u(e);return t?"<"+t+">":"<...>"}catch(e){return"<...>"}}function d(){var e=ee.A;return null===e?null:e.getOwner()}function h(){return Error("react-stack-top-frame")}function p(e){if(te.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}function f(e,t){function n(){Q||(Q=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}function m(){var e=u(this.type);return re[e]||(re[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),void 0!==(e=this.props.ref)?e:null}function g(e,t,n,r,o,i,s,a){return n=i.ref,e={$$typeof:A,type:e,key:t,props:i,_owner:o},null!==(void 0!==n?n:null)?Object.defineProperty(e,"ref",{enumerable:!1,get:m}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:s}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function y(e){return"object"==typeof e&&null!==e&&e.$$typeof===A}function _(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(l(e.key),n=""+e.key,r={"=":"=0",":":"=2"},"$"+n.replace(/[=:]/g,(function(e){return r[e]}))):t.toString(36);var n,r}function v(){}function b(e,t,n,r,o){var i=typeof e;"undefined"!==i&&"boolean"!==i||(e=null);var s,a,u,c=!1;if(null===e)c=!0;else switch(i){case"bigint":case"string":case"number":c=!0;break;case"object":switch(e.$$typeof){case A:case k:c=!0;break;case H:return b((c=e._init)(e._payload),t,n,r,o)}}if(c){o=o(c=e);var d=""===r?"."+_(c,0):r;return J(o)?(n="",null!=d&&(n=d.replace(ae,"$&/")+"/"),b(o,t,n,"",(function(e){return e}))):null!=o&&(y(o)&&(null!=o.key&&(c&&c.key===o.key||l(o.key)),s=o,a=n+(null==o.key||c&&c.key===o.key?"":(""+o.key).replace(ae,"$&/")+"/")+d,a=g(s.type,a,void 0,0,s._owner,s.props,s._debugStack,s._debugTask),s._store&&(a._store.validated=s._store.validated),n=a,""!==r&&null!=c&&y(c)&&null==c.key&&c._store&&!c._store.validated&&(n._store.validated=2),o=n),t.push(o)),1}if(c=0,d=""===r?".":r+":",J(e))for(var h=0;h import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",t),"default"in t||console.error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",t),t.default;throw e._result}function E(){var e=ee.H;return null===e&&console.error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."),e}function O(){}function S(e){if(null===ce)try{var n=("require"+Math.random()).slice(0,7);ce=(t&&t[n]).call(t,"timers").setImmediate}catch(e){ce=function(e){!1===ue&&(ue=!0,"undefined"==typeof MessageChannel&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(void 0)}}return ce(e)}function w(e){return 1 ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))})),{then:function(e,t){o=!0,s.then((function(o){if(C(0,n),0===n){try{R(r),S((function(){return N(o,e,t)}))}catch(e){ee.thrownErrors.push(e)}if(0 ...)"))})),ee.actQueue=null),0ee.recentlyCreatedOwnerStacks++;return g(e,o,void 0,0,d(),r,u?Error("react-stack-top-frame"):oe,u?ne(c(e)):ie)},e.createRef=function(){var e={current:null};return Object.seal(e),e},e.forwardRef=function(e){null!=e&&e.$$typeof===U?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?console.error("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&null!=e.defaultProps&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var t,n={$$typeof:M,render:e};return Object.defineProperty(n,"displayName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(n){t=n,e.name||e.displayName||(Object.defineProperty(e,"name",{value:n}),e.displayName=n)}}),n},e.isValidElement=y,e.lazy=function(e){return{$$typeof:H,_payload:{_status:-1,_result:e},_init:T}},e.memo=function(e,t){var n;return null==e&&console.error("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),t={$$typeof:U,type:e,compare:void 0===t?null:t},Object.defineProperty(t,"displayName",{enumerable:!1,configurable:!0,get:function(){return n},set:function(t){n=t,e.name||e.displayName||(Object.defineProperty(e,"name",{value:t}),e.displayName=t)}}),t},e.startTransition=function(e){var t=ee.T,n={};ee.T=n,n._updatedFibers=new Set;try{var r=e(),o=ee.S;null!==o&&o(n,r),"object"==typeof r&&null!==r&&"function"==typeof r.then&&r.then(O,le)}catch(e){le(e)}finally{null===t&&n._updatedFibers&&(e=n._updatedFibers.size,n._updatedFibers.clear(),10t&&l());){var c=g.callback;if("function"==typeof c){g.callback=null,y=g.priorityLevel;var d=c(g.expirationTime<=t);if(t=e.unstable_now(),"function"==typeof d){g.callback=d,s(t),n=!0;break t}g===r(p)&&o(p),s(t)}else o(p);g=r(p)}if(null!==g)n=!0;else{var h=r(f);null!==h&&u(a,h.startTime-t),n=!1}}break e}finally{g=null,y=i,_=!1}n=void 0}}finally{n?R():S=!1}}}function n(e,t){var n=e.length;e.push(t);e:for(;0>>1,o=e[r];if(!(0>>1;ri(l,n))ui(c,l)?(e[r]=c,e[u]=n,r=u):(e[r]=l,e[a]=n,r=a);else{if(!(ui(c,n)))break e;e[r]=c,e[u]=n,r=u}}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}function s(e){for(var t=r(f);null!==t;){if(null===t.callback)o(f);else{if(!(t.startTime<=e))break;o(f),t.sortIndex=t.expirationTime,n(p,t)}t=r(f)}}function a(e){if(b=!1,s(e),!v)if(null!==r(p))v=!0,S||(S=!0,R());else{var t=r(f);null!==t&&u(a,t.startTime-e)}}function l(){return!(!x&&e.unstable_now()-Ne||125s?(t.sortIndex=i,n(f,t),null===r(p)&&t===r(f)&&(b?(E(w),w=-1):b=!0,u(a,i-s))):(t.sortIndex=l,n(p,t),v||_||(v=!0,S||(S=!0,R()))),t},e.unstable_shouldYield=l,e.unstable_wrapCallback=function(e){var t=y;return function(){var n=y;y=t;try{return e.apply(this,arguments)}finally{y=n}}},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()}}),p=a({"node_modules/scheduler/index.js"(e,t){t.exports=h()}}),f=a({"node_modules/react-dom/cjs/react-dom.development.js"(e){!function(){function t(){}function n(e){return""+e}function r(e,t,r){var o=3` tag.%s',n),"string"==typeof e&&"object"==typeof t&&null!==t&&"string"==typeof t.as){var r=o(n=t.as,t.crossOrigin);u.d.L(e,n,{crossOrigin:r,integrity:"string"==typeof t.integrity?t.integrity:void 0,nonce:"string"==typeof t.nonce?t.nonce:void 0,type:"string"==typeof t.type?t.type:void 0,fetchPriority:"string"==typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"string"==typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"==typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"==typeof t.imageSizes?t.imageSizes:void 0,media:"string"==typeof t.media?t.media:void 0})}},e.preloadModule=function(e,t){var n="";"string"==typeof e&&e||(n+=" The `href` argument encountered was "+i(e)+"."),void 0!==t&&"object"!=typeof t?n+=" The `options` argument encountered was "+i(t)+".":t&&"as"in t&&"string"!=typeof t.as&&(n+=" The `as` option encountered was "+i(t.as)+"."),n&&console.error('ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `` tag.%s',n),"string"==typeof e&&(t?(n=o(t.as,t.crossOrigin),u.d.m(e,{as:"string"==typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:n,integrity:"string"==typeof t.integrity?t.integrity:void 0})):u.d.m(e))},e.requestFormReset=function(e){u.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return a().useFormState(e,t,n)},e.useFormStatus=function(){return a().useHostTransitionStatus()},e.version="19.1.0","undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()}}),m=a({"node_modules/react-dom/index.js"(e,t){t.exports=f()}}),g=a({"node_modules/react-dom/cjs/react-dom-client.development.js"(e){!function(){function t(e,t){for(e=e.memoizedState;null!==e&&0=t.length)return o;var i=t[r],s=$c(e)?e.slice():_c({},e);return s[i]=n(e[i],t,r+1,o),s}function r(e,t,n){if(t.length===n.length){for(var r=0;rQc?console.error("Unexpected pop."):(t!==Yc[Qc]&&console.error("Unexpected Fiber popped."),e.current=Wc[Qc],Wc[Qc]=null,Yc[Qc]=null,Qc--)}function N(e,t,n){Qc++,Wc[Qc]=e.current,Yc[Qc]=n,e.current=t}function R(e){return null===e&&console.error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."),e}function A(e,t){N(Zc,t,e),N(Jc,e,e),N(Xc,null,e);var n=t.nodeType;switch(n){case 9:case 11:n=9===n?"#document":"#fragment",t=(t=t.documentElement)&&(t=t.namespaceURI)?Ql(t):Iv;break;default:if(n=t.tagName,t=t.namespaceURI)t=Xl(t=Ql(t),n);else switch(n){case"svg":t=Pv;break;case"math":t=Dv;break;default:t=Iv}}n={context:t,ancestorInfo:n=ft(null,n=n.toLowerCase())},C(Xc,e),N(Xc,n,e)}function k(e){C(Xc,e),C(Jc,e),C(Zc,e)}function j(){return R(Xc.current)}function L(e){null!==e.memoizedState&&N(ed,e,e);var t=R(Xc.current),n=e.type,r=Xl(t.context,n);t!==(r={context:r,ancestorInfo:n=ft(t.ancestorInfo,n)})&&(N(Jc,e,e),N(Xc,r,e))}function I(e){Jc.current===e&&(C(Xc,e),C(Jc,e)),ed.current===e&&(C(ed,e),gb._currentValue=mb)}function P(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}function D(e){try{return M(e),!1}catch(e){return!0}}function M(e){return""+e}function K(e,t){if(D(e))return console.error("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before using it here.",t,P(e)),M(e)}function F(e,t){if(D(e))return console.error("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before using it here.",t,P(e)),M(e)}function U(e){if(D(e))return console.error("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before using it here.",P(e)),M(e)}function H(e){if("function"==typeof pd&&fd(e),gd&&"function"==typeof gd.setStrictMode)try{gd.setStrictMode(md,e)}catch(e){_d||(_d=!0,console.error("React instrumentation encountered an error: %s",e))}}function z(){null!==yd&&"function"==typeof yd.markCommitStopped&&yd.markCommitStopped()}function B(e){null!==yd&&"function"==typeof yd.markComponentRenderStarted&&yd.markComponentRenderStarted(e)}function $(){null!==yd&&"function"==typeof yd.markComponentRenderStopped&&yd.markComponentRenderStopped()}function G(e){null!==yd&&"function"==typeof yd.markRenderStarted&&yd.markRenderStarted(e)}function q(){null!==yd&&"function"==typeof yd.markRenderStopped&&yd.markRenderStopped()}function V(e,t){null!==yd&&"function"==typeof yd.markStateUpdateScheduled&&yd.markStateUpdateScheduled(e,t)}function W(e){return 1&e?"SyncHydrationLane":2&e?"Sync":4&e?"InputContinuousHydration":8&e?"InputContinuous":16&e?"DefaultHydration":32&e?"Default":128&e?"TransitionHydration":4194048&e?"Transition":62914560&e?"Retry":67108864&e?"SelectiveHydration":134217728&e?"IdleHydration":268435456&e?"Idle":536870912&e?"Offscreen":1073741824&e?"Deferred":void 0}function Y(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194048&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return console.error("Should have found matching lanes. This is a bug in React."),e}}function Q(e,t,n){var r=e.pendingLanes;if(0===r)return 0;var o=0,i=e.suspendedLanes,s=e.pingedLanes;e=e.warmLanes;var a=134217727&r;return 0!==a?0!=(r=a&~i)?o=Y(r):0!=(s&=a)?o=Y(s):n||0!=(n=a&~e)&&(o=Y(n)):0!=(a=r&~i)?o=Y(a):0!==s?o=Y(s):n||0!=(n=r&~e)&&(o=Y(n)),0===o?0:0!==t&&t!==o&&0==(t&i)&&((i=o&-o)>=(n=t&-t)||32===i&&0!=(4194048&n))?t:o}function X(e,t){return 0==(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function J(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return console.error("Should have found matching lanes. This is a bug in React."),-1}}function Z(){var e=Ed;return 0==(4194048&(Ed<<=1))&&(Ed=256),e}function ee(){var e=Od;return 0==(62914560&(Od<<=1))&&(Od=4194304),e}function te(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ne(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function re(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-bd(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|4194090&n}function oe(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-bd(n),o=1<)":-1--s||u[i]!==c[s]){var d="\n"+u[i].replace(" at new "," at ");return e.displayName&&d.includes("")&&(d=d.replace("",e.displayName)),"function"==typeof e&&Yd.set(e,d),d}}while(1<=i&&0<=s);break}}}finally{Wd=!1,Gc.H=n,function(){if(0==--Gd){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:_c({},e,{value:Pc}),info:_c({},e,{value:Dc}),warn:_c({},e,{value:Mc}),error:_c({},e,{value:Kc}),group:_c({},e,{value:Fc}),groupCollapsed:_c({},e,{value:Uc}),groupEnd:_c({},e,{value:Hc})})}0>Gd&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=r}return u=(u=e?e.displayName||e.name:"")?Se(u):"","function"==typeof e&&Yd.set(e,u),u}function Ce(e){var t=Error.prepareStackTrace;return Error.prepareStackTrace=void 0,e=e.stack,Error.prepareStackTrace=t,e.startsWith("Error: react-stack-top-frame\n")&&(e=e.slice(29)),-1!==(t=e.indexOf("\n"))&&(e=e.slice(t+1)),-1!==(t=e.indexOf("react-stack-bottom-frame"))&&(t=e.lastIndexOf("\n",t)),-1===t?"":e=e.slice(0,t)}function Ne(e){switch(e.tag){case 26:case 27:case 5:return Se(e.type);case 16:return Se("Lazy");case 13:return Se("Suspense");case 19:return Se("SuspenseList");case 0:case 15:return we(e.type,!1);case 11:return we(e.type.render,!1);case 1:return we(e.type,!0);case 31:return Se("Activity");default:return""}}function Re(e){try{var t="";do{t+=Ne(e);var n=e._debugInfo;if(n)for(var r=n.length-1;0<=r;r--){var o=n[r];if("string"==typeof o.name){var i=t,s=o.env;t=i+Se(o.name+(s?" ["+s+"]":""))}}e=e.return}while(e);return t}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}function Ae(e){return(e=e?e.displayName||e.name:"")?Se(e):""}function ke(){if(null===Qd)return null;var e=Qd._debugOwner;return null!=e?O(e):null}function je(){if(null===Qd)return"";var e=Qd;try{var t="";switch(6===e.tag&&(e=e.return),e.tag){case 26:case 27:case 5:t+=Se(e.type);break;case 13:t+=Se("Suspense");break;case 19:t+=Se("SuspenseList");break;case 31:t+=Se("Activity");break;case 30:case 0:case 15:case 1:e._debugOwner||""!==t||(t+=Ae(e.type));break;case 11:e._debugOwner||""!==t||(t+=Ae(e.type.render))}for(;e;)if("number"==typeof e.tag){var n=e;e=n._debugOwner;var r=n._debugStack;e&&r&&("string"!=typeof r&&(n._debugStack=r=Ce(r)),""!==r&&(t+="\n"+r))}else{if(null==e.debugStack)break;var o=e.debugStack;(e=e.owner)&&o&&(t+="\n"+Ce(o))}var i=t}catch(e){i="\nError generating stack: "+e.message+"\n"+e.stack}return i}function Le(e,t,n,r,o,i,s){var a=Qd;Ie(e);try{return null!==e&&e._debugTask?e._debugTask.run(t.bind(null,n,r,o,i,s)):t(n,r,o,i,s)}finally{Ie(a)}throw Error("runWithFiberInDEV should never be called in production. This is a bug in React.")}function Ie(e){Gc.getCurrentStack=null===e?null:je,Xd=!1,Qd=e}function Pe(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return U(e),e;default:return""}}function De(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function Me(e){e._valueTracker||(e._valueTracker=function(e){var t=De(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);U(e[t]);var r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(e){U(e),r=""+e,i.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){U(e),r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function Ke(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=De(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function Fe(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Ue(e){return e.replace(Jd,(function(e){return"\\"+e.charCodeAt(0).toString(16)+" "}))}function He(e,t){void 0===t.checked||void 0===t.defaultChecked||eh||(console.error("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components",ke()||"A component",t.type),eh=!0),void 0===t.value||void 0===t.defaultValue||Zd||(console.error("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components",ke()||"A component",t.type),Zd=!0)}function ze(e,t,n,r,o,i,s,a){e.name="",null!=s&&"function"!=typeof s&&"symbol"!=typeof s&&"boolean"!=typeof s?(K(s,"type"),e.type=s):e.removeAttribute("type"),null!=t?"number"===s?(0===t&&""===e.value||e.value!=t)&&(e.value=""+Pe(t)):e.value!==""+Pe(t)&&(e.value=""+Pe(t)):"submit"!==s&&"reset"!==s||e.removeAttribute("value"),null!=t?$e(e,s,Pe(t)):null!=n?$e(e,s,Pe(n)):null!=r&&e.removeAttribute("value"),null==o&&null!=i&&(e.defaultChecked=!!i),null!=o&&(e.checked=o&&"function"!=typeof o&&"symbol"!=typeof o),null!=a&&"function"!=typeof a&&"symbol"!=typeof a&&"boolean"!=typeof a?(K(a,"name"),e.name=""+Pe(a)):e.removeAttribute("name")}function Be(e,t,n,r,o,i,s,a){if(null!=i&&"function"!=typeof i&&"symbol"!=typeof i&&"boolean"!=typeof i&&(K(i,"type"),e.type=i),null!=t||null!=n){if(("submit"===i||"reset"===i)&&null==t)return;n=null!=n?""+Pe(n):"",t=null!=t?""+Pe(t):n,a||t===e.value||(e.value=t),e.defaultValue=t}r="function"!=typeof(r=null!=r?r:o)&&"symbol"!=typeof r&&!!r,e.checked=a?e.checked:!!r,e.defaultChecked=!!r,null!=s&&"function"!=typeof s&&"symbol"!=typeof s&&"boolean"!=typeof s&&(K(s,"name"),e.name=s)}function $e(e,t,n){"number"===t&&Fe(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function Ge(e,t){null==t.value&&("object"==typeof t.children&&null!==t.children?gc.Children.forEach(t.children,(function(e){null==e||"string"==typeof e||"number"==typeof e||"bigint"==typeof e||nh||(nh=!0,console.error("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to or of the Document.",e,e),!1;switch(e){case"meta":case"title":return!0;case"style":if("string"!=typeof t.precedence||"string"!=typeof t.href||""===t.href){r&&console.error('Cannot render a \n
\n
\n \n \n \n
\n
\n \n \n
\n
\n
\n ⚠️\n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n `}initializeD3(){kg||(kg=window.d3),this.svg=kg.select(this.shadowRoot.querySelector("#svg")),this.container=this.svg.select(".zoomable"),kg.zoom?(this.zoomBehavior=kg.zoom().scaleExtent([.01,20]).on("start",(()=>{kg.event.sourceEvent&&(this.userHasManuallyZoomed=!0)})).on("zoom",(()=>{this.container.attr("transform",kg.event.transform),this.updateZoomControlStates(),this.updateSmallNodeClasses()})),this.svg.call(this.zoomBehavior),this.initializeZoomControls()):console.warn("D3 zoom behavior not available. Ensure D3 v4+ is loaded.")}initializeZoomControls(){const t=this.shadowRoot.querySelector("#zoom-in"),e=this.shadowRoot.querySelector("#zoom-out"),r=this.shadowRoot.querySelector("#zoom-fit");t&&t.addEventListener("click",(()=>{this.userHasManuallyZoomed=!0,this.zoomIn()})),e&&e.addEventListener("click",(()=>{this.userHasManuallyZoomed=!0,this.zoomOut()})),r&&r.addEventListener("click",(()=>{this.resetViewToFitContent()}));const n=this.shadowRoot.querySelector("#routing-mode");if(n){const t=this.layoutFormat||"default";n.value=t,n.addEventListener("change",(()=>{this.handleRoutingModeChange(n.value)}))}this.updateZoomControlStates()}handleRoutingModeChange(t){this.setAttribute("layoutFormat",t),this.currentLayout&&this.colaLayout&&("grid"===t?this.gridify(10,25,10):this.routeEdges(),this.dispatchEvent(new CustomEvent("routing-mode-changed",{detail:{mode:t}})))}updateRoutingModeDropdown(){const t=this.shadowRoot?.querySelector("#routing-mode");if(t){const e=this.layoutFormat||"default";t.value=e}}initializeInputModeHandlers(){this.inputModeEnabled&&this.attachInputModeListeners()}attachInputModeListeners(){this.inputModeListenersAttached||(document.addEventListener("keydown",this.handleInputModeKeydown),document.addEventListener("keyup",this.handleInputModeKeyup),window.addEventListener("blur",this.handleInputModeBlur),this.inputModeListenersAttached=!0)}detachInputModeListeners(){this.inputModeListenersAttached&&(document.removeEventListener("keydown",this.handleInputModeKeydown),document.removeEventListener("keyup",this.handleInputModeKeyup),window.removeEventListener("blur",this.handleInputModeBlur),this.inputModeListenersAttached=!1)}activateInputMode(){this.isInputModeActive=!0,this.svg&&this.svg.classed("input-mode",!0),this.disableNodeDragging(),this.disableZoom(),this.updateEdgeEndpointMarkers(),this.dispatchEvent(new CustomEvent("input-mode-activated",{detail:{active:!0}}))}deactivateInputMode(){this.isInputModeActive=!1,this.svg&&this.svg.classed("input-mode",!1),this.cleanupEdgeCreation(),this.enableNodeDragging(),this.enableZoom(),this.updateEdgeEndpointMarkers(),this.dispatchEvent(new CustomEvent("input-mode-deactivated",{detail:{active:!1}}))}disableNodeDragging(){this.svgNodes&&this.colaLayout&&this.svgNodes.on(".drag",null)}enableNodeDragging(){if(this.svgNodes&&this.colaLayout&&this.colaLayout.drag){const t=this.colaLayout.drag();this.setupNodeDragHandlers(t),this.svgNodes.call(t)}}disableZoom(){this.svg&&this.zoomBehavior&&(this.storedTransform=kg.zoomTransform(this.svg.node()),this.svg.on(".zoom",null))}enableZoom(){this.svg&&this.zoomBehavior&&(this.svg.call(this.zoomBehavior),this.storedTransform&&this.svg.call(this.zoomBehavior.transform,this.storedTransform))}zoomIn(){this.svg&&this.zoomBehavior&&this.svg.transition().duration(200).call(this.zoomBehavior.scaleBy,1.5)}zoomOut(){this.svg&&this.zoomBehavior&&this.svg.transition().duration(200).call(this.zoomBehavior.scaleBy,1/1.5)}updateZoomControlStates(){if(!this.svg||!this.zoomBehavior)return;const t=kg.zoomTransform(this.svg.node()).k,[e,r]=this.zoomBehavior.scaleExtent(),n=this.shadowRoot.querySelector("#zoom-in"),i=this.shadowRoot.querySelector("#zoom-out");n&&(n.disabled=t>=r),i&&(i.disabled=t<=e)}cleanupEdgeCreation(){this.edgeCreationState.temporaryEdge&&this.edgeCreationState.temporaryEdge.remove(),this.edgeCreationState={isCreating:!1,sourceNode:null,temporaryEdge:null}}setupNodeDragHandlers(t){t.on("start.cnd",(t=>{this.userHasManuallyZoomed=!0;const e={x:t.x,y:t.y};this.dragStartPositions.set(t.id,e),this.dispatchEvent(new CustomEvent("node-drag-start",{detail:{id:t.id,position:e}}))})).on("end.cnd",(t=>{const e=this.dragStartPositions.get(t.id);this.dragStartPositions.delete(t.id);const r={id:t.id,previous:e,current:{x:t.x,y:t.y}};this.dispatchEvent(new CustomEvent("node-drag-end",{detail:r}))}))}startEdgeCreation(t){this.isInputModeActive&&(this.cleanupEdgeCreation(),this.edgeCreationState.isCreating=!0,this.edgeCreationState.sourceNode=t,this.edgeCreationState.temporaryEdge=this.container.append("line").attr("class","temporary-edge").attr("x1",t.x).attr("y1",t.y).attr("x2",t.x).attr("y2",t.y).attr("stroke","#007bff").attr("stroke-width",2).attr("stroke-dasharray","5,5").attr("opacity",.7),this.svg.on("mousemove.edgecreation",(()=>{if(this.edgeCreationState.isCreating&&this.edgeCreationState.temporaryEdge){const[t,e]=kg.mouse(this.container.node());this.edgeCreationState.temporaryEdge.attr("x2",t).attr("y2",e)}})))}async finishEdgeCreation(t){if(!this.isInputModeActive||!this.edgeCreationState.isCreating||!this.edgeCreationState.sourceNode)return;const e=this.edgeCreationState.sourceNode;e.id!==t.id||await this.showConfirmDialog(`Are you sure you want to create a self-loop edge on "${e.label||e.id}"?`)?(this.svg.on("mousemove.edgecreation",null),await this.showEdgeLabelInput(e,t)):this.cleanupEdgeCreation()}async showEdgeLabelInput(t,e){const r=await this.showPromptDialog(`Enter label for edge from "${t.label||t.id}" to "${e.label||e.id}":`,"");null!==r&&await this.createNewEdge(t,e,r||""),this.cleanupEdgeCreation()}async createNewEdge(t,e,r){if(!this.currentLayout)return;const n=this.currentLayout.nodes.findIndex((e=>e.id===t.id)),i=this.currentLayout.nodes.findIndex((t=>t.id===e.id));if(-1===n||-1===i)return void console.error("Could not find node indices for edge creation");const o={id:`edge_${t.id}_${e.id}_${Date.now()}`,source:n,target:i,label:r,relName:r,color:"#333",isUserCreated:!0};this.currentLayout.links.push(o),await this.updateExternalStateForNewEdge(t,e,r),this.dispatchEvent(new CustomEvent("edge-created",{detail:{edge:o,sourceNode:t,targetNode:e}})),this.rerenderGraph()}async updateExternalStateForNewEdge(t,e,r){if(r.trim())try{const n={atoms:[t.id,e.id],types:[t.type||"untyped",e.type||"untyped"]};console.log(`Dispatching edge creation request: ${r}(${t.id}, ${e.id})`);const i=new CustomEvent("edge-creation-requested",{detail:{relationId:r,sourceNodeId:t.id,targetNodeId:e.id,tuple:n},bubbles:!0});this.dispatchEvent(i)}catch(t){console.error("Failed to update external state for new edge:",t)}}rerenderGraph(){this.currentLayout&&this.colaLayout&&(this.colaLayout.links(this.currentLayout.links),this.container.selectAll(".link-group").remove(),this.renderLinks(this.currentLayout.links,this.colaLayout),this.colaLayout.start())}async editEdgeLabel(t){if(!this.isInputModeActive)return;const e=t.label||t.relName||"",r=await this.showEdgeEditDialog("Edit edge label:",e);if("DELETE"!==r){if(null!==r&&r!==e){const n=r,i=this.getNodeFromEdge(t,"source"),o=this.getNodeFromEdge(t,"target");await this.updateExternalStateForEdgeModification(i,o,e,n),t.label=n,t.relName=n,this.dispatchEvent(new CustomEvent("edge-modified",{detail:{edge:t,oldLabel:e,newLabel:n}})),this.rerenderGraph()}}else await this.deleteEdge(t)}getNodeFromEdge(t,e){if(!this.currentLayout)return null;const r="number"==typeof t[e]?t[e]:t[e].index;return this.currentLayout.nodes[r]||null}async updateExternalStateForEdgeModification(t,e,r,n){if(t&&e)try{const i={atoms:[t.id,e.id],types:[t.type||"untyped",e.type||"untyped"]};console.log(`Dispatching edge modification request: ${r} -> ${n}`);const o=new CustomEvent("edge-modification-requested",{detail:{oldRelationId:r,newRelationId:n,sourceNodeId:t.id,targetNodeId:e.id,tuple:i},bubbles:!0});this.dispatchEvent(o)}catch(t){console.error("Failed to update external state for edge modification:",t)}}async renderLayout(r,n){if(!kn(r))throw new Error("Invalid instance layout provided. Expected an InstanceLayout instance.");const i=n?.priorState,o=i&&i.positions.length>0;if(o||(this.isInitialRender=!0,this.userHasManuallyZoomed=!1),this.svg&&this.zoomBehavior&&kg)try{if(o){const t=kg.zoomIdentity.translate(i.transform.x,i.transform.y).scale(i.transform.k);this.svg.call(this.zoomBehavior.transform,t),console.log(`WebCola: Restored prior state - ${i.positions.length} positions, zoom ${i.transform.k.toFixed(2)}x`)}else{const t=kg.zoomIdentity;this.svg.call(this.zoomBehavior.transform,t)}}catch(t){console.warn("Failed to set zoom transform:",t)}try{if(!kg)throw new Error("D3 library not available. Please ensure D3 v4 is loaded from CDN.");if(!Ig){if(!window.cola)throw new Error("WebCola library not available. Please ensure vendor/cola.js is loaded.");Ig=window.cola}if(this.container&&this.svg||this.initializeD3(),!this.container)throw new Error("Failed to initialize D3 container. SVG elements may not be available.");this.showLoading(),this.updateLoadingProgress("Translating layout...");const s=this.shadowRoot.querySelector("#svg-container").getBoundingClientRect(),a=s.width||800,l=s.height||600,u=new t.WebColaTranslator,c=await u.translate(r,a,l,n);this.updateLoadingProgress(`Computing layout for ${c.nodes.length} nodes...`);const h=c.nodes.length;let d=e.INITIAL_UNCONSTRAINED_ITERATIONS,p=e.INITIAL_USER_CONSTRAINT_ITERATIONS,f=e.INITIAL_ALL_CONSTRAINTS_ITERATIONS;o&&(d=0,p=Math.min(10,p),f=Math.min(20,f),console.log(`WebCola: Using minimal iterations to preserve ${i.positions.length} prior positions`)),h>100?(d=Math.max(o?0:5,Math.floor(.5*d)),p=Math.max(25,Math.floor(.5*p)),f=Math.max(100,Math.floor(.5*f))):h>50&&(d=Math.max(o?0:8,Math.floor(.8*d)),p=Math.max(40,Math.floor(.8*p)),f=Math.max(150,Math.floor(.75*f)));const{scaledConstraints:g,linkLength:m,groupCompactness:y}=this.getScaledDetails(c.constraints,5,c.nodes,c.groups,c.links);this.updateLoadingProgress("Applying constraints and initializing...");const _=o?.1:.001,v=Ig.d3adaptor(kg).linkDistance(m).convergenceThreshold(_).avoidOverlaps(!0).handleDisconnected(!0).nodes(c.nodes).links(c.links).constraints(g).groups(c.groups).groupCompactness(y).size([c.FIG_WIDTH,c.FIG_HEIGHT]);this.currentLayout=c,this.colaLayout=v,this.container.selectAll("*").remove(),this.renderGroups(c.groups,v),this.renderLinks(c.links,v),this.renderNodes(c.nodes,v);let x=0;const b=d+p+f;v.on("tick",(()=>{if(x++,x%20==0){const t=Math.min(95,Math.round(x/b*100));this.updateLoadingProgress(`Computing layout... ${t}%`)}"default"!==this.layoutFormat&&this.layoutFormat&&null!==this.layoutFormat?"grid"===this.layoutFormat?this.gridUpdatePositions():console.warn(`Unknown layout format: ${this.layoutFormat}. Skipping position updates.`):this.updatePositions()})).on("end",(()=>{this.updateLoadingProgress("Finalizing..."),"default"!==this.layoutFormat&&this.layoutFormat?"grid"===this.layoutFormat?this.gridify(10,25,10):console.warn(`Unknown layout format: ${this.layoutFormat}. Skipping edge routing.`):this.routeEdges(),this.isUnsatCore&&this.showErrorIcon(),this.dispatchRelationsAvailableEvent(),this.dispatchEvent(new CustomEvent("layout-complete",{detail:{nodePositions:this.getNodePositions()}})),this.updateRoutingModeDropdown(),this.hideLoading()}));try{v.start(d,p,f,e.GRID_SNAP_ITERATIONS)}catch(t){console.warn("WebCola layout start encountered an error, trying alternative approach:",t);try{v.start()}catch(t){throw console.error("Both WebCola start methods failed:",t),new Error(`WebCola layout failed to start: ${t.message}`)}}}catch(t){console.error("Error rendering layout:",t),this.showError(`Layout rendering failed: ${t.message}`)}}clear(){if(this.colaLayout)try{this.colaLayout.stop?.()}catch(t){}this.container&&this.container.selectAll("*").remove(),this.currentLayout=null,this.colaLayout=null,this.svgNodes=null,this.svgLinks=null,this.svgGroups=null,this.edgeRoutingCache.edgesBetweenNodes.clear(),this.edgeRoutingCache.alignmentEdges.clear(),this.dragStartPositions.clear()}getNodePositions(){return this.currentLayout?.nodes?this.currentLayout.nodes.map((t=>({id:t.id,x:t.x,y:t.y}))):[]}getCurrentTransform(){if(this.svg&&this.svg.node())try{const t=kg.zoomTransform(this.svg.node());return{k:t.k,x:t.x,y:t.y}}catch(t){return{k:1,x:0,y:0}}return{k:1,x:0,y:0}}getLayoutState(){return{positions:this.getNodePositions(),transform:this.getCurrentTransform()}}addToolbarControl(t){const e=this.shadowRoot?.querySelector("#graph-toolbar");e&&e.appendChild(t)}getToolbar(){return this.shadowRoot?.querySelector("#graph-toolbar")||null}renderGroups(t,e){this.currentLayout.nodes&&0!==this.currentLayout.nodes.length?this.svgGroups=this.setupGroups(t,this.currentLayout.nodes,e):console.warn("Cannot render groups: nodes not available")}setupLinks(t,e){const r=this.container.selectAll(".link-group").data(t).enter().append("g").attr("class","link-group");return this.setupLinkPaths(r),this.setupLinkLabels(r),this.setupEdgeEndpointMarkers(r),r}setupLinkPaths(t){t.append("path").attr("class",(t=>this.isAlignmentEdge(t)?"alignmentLink":this.isInferredEdge(t)?"inferredLink":"link")).attr("data-link-id",(t=>t.id||"")).attr("stroke",(t=>t.color)).attr("fill","none").style("stroke-width",(t=>null!=t.weight?`${t.weight}px`:null)).attr("stroke-dasharray",(t=>this.getEdgeDasharray(t.style))).attr("marker-end",(t=>this.isAlignmentEdge(t)?"none":"url(#end-arrow)")).attr("marker-start",(t=>this.isAlignmentEdge(t)||!t.bidirectional?"none":"url(#start-arrow)")).on("click.inputmode",(t=>{this.isInputModeActive&&!this.isAlignmentEdge(t)&&(kg.event.stopPropagation(),this.editEdgeLabel(t).catch((t=>{console.error("Error editing edge label:",t)})))})).style("cursor",(()=>this.isInputModeActive?"pointer":"default"))}getEdgeDasharray(t){if(!t)return null;switch(t.toLowerCase()){case"dotted":return"1,4";case"dashed":return"6,4";default:return null}}setupLinkLabels(t){t.filter((t=>!this.isAlignmentEdge(t)&&(this.isInferredEdge(t)||!1!==t.showLabel))).append("text").attr("class","linklabel").attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family","system-ui").attr("pointer-events","none").text((t=>t.label||t.relName||""))}setupEdgeEndpointMarkers(t){t.filter((t=>!this.isAlignmentEdge(t))).append("circle").attr("class","edge-endpoint-marker target-marker").attr("r",8).attr("fill","#007bff").attr("stroke","white").attr("stroke-width",2).attr("opacity",0).attr("cursor","move").style("pointer-events","none").call(kg.drag().on("start",(t=>this.startEdgeEndpointDrag(t,"target"))).on("drag",(t=>this.dragEdgeEndpoint(t,"target"))).on("end",(t=>this.endEdgeEndpointDrag(t,"target")))),t.filter((t=>!this.isAlignmentEdge(t))).append("circle").attr("class","edge-endpoint-marker source-marker").attr("r",8).attr("fill","#28a745").attr("stroke","white").attr("stroke-width",2).attr("opacity",0).attr("cursor","move").style("pointer-events","none").call(kg.drag().on("start",(t=>this.startEdgeEndpointDrag(t,"source"))).on("drag",(t=>this.dragEdgeEndpoint(t,"source"))).on("end",(t=>this.endEdgeEndpointDrag(t,"source"))))}startEdgeEndpointDrag(t,e){kg.event.sourceEvent.stopPropagation(),this.edgeDragState.isDragging=!0,this.edgeDragState.edge=t,this.edgeDragState.endpoint=e,console.log(`🔵 Started dragging ${e} endpoint of edge:`,t.id)}dragEdgeEndpoint(t,e){if(!this.edgeDragState.isDragging)return;const[r,n]=kg.mouse(this.container.node()),i="target"===e?".target-marker":".source-marker";this.container.selectAll(".link-group").filter((e=>e.id===t.id)).select(i).attr("cx",r).attr("cy",n)}async endEdgeEndpointDrag(t,e){if(!this.edgeDragState.isDragging)return;const[r,n]=kg.mouse(this.container.node()),i=this.findNodeAtPosition(r,n);i?(console.log(`🔗 Reconnecting ${e} to node:`,i.id),await this.reconnectEdge(t,e,i)):(console.log("🗑️ No node found - deleting edge:",t.id),await this.deleteEdge(t)),this.edgeDragState={isDragging:!1,edge:null,endpoint:null,dragMarker:null},this.rerenderGraph()}findNodeAtPosition(t,e){if(!this.currentLayout?.nodes)return null;for(const r of this.currentLayout.nodes){const n=(r.width||0)/2,i=(r.height||0)/2;if(t>=r.x-n&&t<=r.x+n&&e>=r.y-i&&e<=r.y+i)return r}return null}async reconnectEdge(t,e,r){const n=this.getNodeFromEdge(t,"source"),i=this.getNodeFromEdge(t,"target");if(!n||!i)return void console.error("Could not find source or target node");let o,s;if("source"===e?(o=r,s=i):(o=n,s=r),o.id===n.id&&s.id===i.id)return void console.log("⏭️ Edge already connected to this node, no change needed");const a=t.label||t.relName||"";if(!a.trim())return void console.warn("Edge has no relation name, cannot reconnect");const l={atoms:[n.id,i.id],types:[n.type||"untyped",i.type||"untyped"]},u={atoms:[o.id,s.id],types:[o.type||"untyped",s.type||"untyped"]};console.log(`🔄 Reconnecting edge from ${n.id}->${i.id} to ${o.id}->${s.id}`);const c=new CustomEvent("edge-reconnection-requested",{detail:{relationId:a,oldTuple:l,newTuple:u,oldSourceNodeId:n.id,oldTargetNodeId:i.id,newSourceNodeId:o.id,newTargetNodeId:s.id},bubbles:!0});this.dispatchEvent(c);const h=this.currentLayout.nodes.findIndex((t=>t.id===o.id)),d=this.currentLayout.nodes.findIndex((t=>t.id===s.id));-1!==h&&-1!==d&&(t.source=h,t.target=d)}async deleteEdge(t){const e=this.getNodeFromEdge(t,"source"),r=this.getNodeFromEdge(t,"target");if(!e||!r)return void console.error("Could not find source or target node for edge deletion");const n=t.label||t.relName||"";if(!n.trim())return console.warn("Edge has no relation name, cannot delete from data instance"),void this.removeEdgeFromLayout(t);const i={atoms:[e.id,r.id],types:[e.type||"untyped",r.type||"untyped"]};console.log(`🗑️ Deleting edge: ${n}(${e.id}, ${r.id})`);const o=new CustomEvent("edge-modification-requested",{detail:{oldRelationId:n,newRelationId:"",sourceNodeId:e.id,targetNodeId:r.id,tuple:i},bubbles:!0});this.dispatchEvent(o),this.removeEdgeFromLayout(t)}removeEdgeFromLayout(t){if(!this.currentLayout?.links)return;const e=this.currentLayout.links.findIndex((e=>e.id===t.id));-1!==e&&(this.currentLayout.links.splice(e,1),console.log(`✅ Edge removed from layout: ${t.id}`))}setupGroups(t,e,r){const n=this.setupGroupRectangles(t,e,r);return this.svgGroupLabels=this.setupGroupLabels(t,r),n}setupGroupRectangles(t,r,n){return this.container.selectAll(".group").data(t).enter().append("rect").attr("class",(t=>this.isDisconnectedGroup(t)?"disconnectedNode":this.isErrorGroup(t)?"error-group":"group")).attr("rx",e.GROUP_BORDER_RADIUS).attr("ry",e.GROUP_BORDER_RADIUS).style("fill",(t=>this.isDisconnectedGroup(t)?"transparent":r[t.keyNode]?.color||"#cccccc")).attr("fill-opacity",e.GROUP_FILL_OPACITY).attr("stroke",(t=>this.isDisconnectedGroup(t)?"none":r[t.keyNode]?.color||"#999999")).attr("stroke-width",1).call(n.drag)}setupGroupLabels(t,r){return this.container.selectAll(".groupLabel").data(t).enter().append("text").attr("class","groupLabel").attr("text-anchor","middle").attr("dominant-baseline","hanging").attr("font-family","system-ui").attr("font-size","12px").attr("font-weight","bold").attr("fill","#333").attr("pointer-events","none").text((t=>t.showLabel?(t.padding&&(t.padding=Math.max(t.padding,e.GROUP_LABEL_PADDING)),t.name||""):"")).call(r.drag)}renderLinks(t,e){this.svgLinkGroups=this.setupLinks(t,e)}setupNodes(t,e){const r=e.drag();this.setupNodeDragHandlers(r);const n=this.container.selectAll(".node").data(t).enter().append("g").attr("class",(t=>{const e=this.isErrorNode(t)?"error-node":"node";return this.isErrorNode(t)&&this.isSmallNode(t)?e+" small-error-node":e})).call(r).on("mousedown.inputmode",(t=>{this.isInputModeActive&&(kg.event.stopPropagation(),this.startEdgeCreation(t))})).on("mouseup.inputmode",(t=>{this.isInputModeActive&&this.edgeCreationState.isCreating&&(kg.event.stopPropagation(),this.finishEdgeCreation(t).catch((t=>{console.error("Error finishing edge creation:",t)})))})).on("mouseover",(function(t){kg.select(this).append("title").attr("class","node-tooltip").text(`ID: ${t.id}`)})).on("mouseout",(function(){kg.select(this).select("title.node-tooltip").remove()}));return this.setupNodeRectangles(n),this.setupNodeIcons(n),this.setupMostSpecificTypeLabels(n),this.setupNodeLabels(n),n}setupNodeRectangles(t){t.append("rect").attr("width",(t=>t.width)).attr("height",(t=>t.height)).attr("x",(t=>-t.width/2)).attr("y",(t=>-t.height/2)).attr("stroke",(t=>t.color||"black")).attr("rx",e.NODE_BORDER_RADIUS).attr("ry",e.NODE_BORDER_RADIUS).attr("stroke-width",e.NODE_STROKE_WIDTH).attr("fill",(t=>{const e=this.isHiddenNode(t),r=!!t.icon;return e||r?"transparent":"white"}))}setupNodeIcons(t){t.filter((t=>t.icon)).append("image").attr("xlink:href",(t=>t.icon)).attr("width",(t=>t.showLabels?t.width*e.SMALL_IMG_SCALE_FACTOR:t.width)).attr("height",(t=>t.showLabels?t.height*e.SMALL_IMG_SCALE_FACTOR:t.height)).attr("x",(t=>{const r=t.width;return t.showLabels?t.x+r-r*e.SMALL_IMG_SCALE_FACTOR:t.x-r/2})).attr("y",(t=>{const e=t.height;return t.y-e/2})).append("title").text((t=>t.label||t.name||t.id||"Node")).on("error",(function(t,e){kg.select(this).attr("xlink:href","img/default.png"),console.error(`Failed to load icon for node ${e.id}: ${e.icon}`)}))}setupMostSpecificTypeLabels(t){t.append("text").attr("class","mostSpecificTypeLabel").style("fill",(t=>t.color||"black")).text((t=>t.mostSpecificType||""))}getTextMeasurementContext(){return this.textMeasurementCanvas||(this.textMeasurementCanvas=document.createElement("canvas")),this.textMeasurementCanvas.getContext("2d")}measureTextWidth(t,e,r="system-ui"){const n=this.getTextMeasurementContext();return n.font=`${e}px ${r}`,n.measureText(t).width}calculateOptimalFontSize(t,r,n,i="system-ui"){let o=e.DEFAULT_FONT_SIZE;for(;o>e.MIN_FONT_SIZE;){const s=this.measureTextWidth(t,o,i),a=o*e.LINE_HEIGHT_RATIO;if(s<=r&&a<=n)break;o-=.5}for(;or||l>n)break;o=s}return Math.max(e.MIN_FONT_SIZE,Math.min(o,e.MAX_FONT_SIZE))}wrapText(t,e,r,n="system-ui"){const i=t.split(/\s+/),o=[];let s="";for(const t of i){const i=s?`${s} ${t}`:t;this.measureTextWidth(i,r,n)<=e?s=i:s?(o.push(s),s=t):o.push(t)}return s&&o.push(s),o}setupNodeLabelsWithDynamicSizing(t){t.append("text").attr("class","label").attr("text-anchor","middle").attr("dominant-baseline","middle").attr("font-family","system-ui").attr("fill","black").each(((t,r,n)=>{if(this.isHiddenNode(t))return;if(!t.showLabels)return;const i=kg.select(n[r]),o=t.width||100,s=t.height||60,a=o-2*e.TEXT_PADDING,l=s-2*e.TEXT_PADDING,u=t.label||t.name||t.id||"Node",c=t.attributes||{},h=Object.entries(c),d=t.labels||{},p=Object.entries(d),f=p.length>0,g=h.length>0,m=f||g,y=m?.5*l:l,_=this.calculateOptimalFontSize(u,a,y,"system-ui");i.attr("font-size",`${_}px`);const v=_*e.LINE_HEIGHT_RATIO,x=p.length+h.length,b=m?-x*v*.5:0;t._labelVerticalOffset=b,t._labelLineHeight=v,i.append("tspan").attr("x",0).attr("dy",`${b}px`).attr("class","main-label-tspan").style("font-weight","bold").style("font-size",`${_}px`).text(u);let T="";for(const[t,e]of p){const t=Array.isArray(e)?e.join(", "):String(e);t.length>T.length&&(T=t)}for(const[t,e]of h){const r=`${t}: ${e}`;r.length>T.length&&(T=r)}const E=.65*_,O=l-v,S=x>0?this.calculateOptimalFontSize(T||"SampleText",a,O/x,"system-ui"):.8*_,N=Math.max(S,E);if(f){const t="black";for(const[r,n]of p){const r=Array.isArray(n)?n.join(", "):String(n);i.append("tspan").attr("x",0).attr("dy",N*e.LINE_HEIGHT_RATIO+"px").style("font-size",`${N}px`).style("fill",t).style("font-style","italic").text(r)}}if(g)for(let t=0;t!!t.leaves&&t.leaves.some((t=>t.id===e.id))))}getNodeIndex(t){return this.currentLayout?.nodes?this.currentLayout.nodes.findIndex((e=>e.id===t.id)):-1}updatePositions(){this.svgGroups.attr("x",(t=>t.bounds.x)).attr("y",(t=>t.bounds.y)).attr("width",(t=>t.bounds.width())).attr("height",(t=>t.bounds.height())).lower(),this.svgNodes.select("rect").each((t=>{t.bounds&&(t.innerBounds=t.bounds.inflate(-1))})).attr("x",(t=>t.bounds.x)).attr("y",(t=>t.bounds.y)).attr("width",(t=>t.bounds.width())).attr("height",(t=>t.bounds.height())),this.svgNodes.select("image").attr("x",(t=>t.showLabels?t.x+t.width/2-t.width*e.SMALL_IMG_SCALE_FACTOR:t.bounds.x)).attr("y",(t=>t.showLabels?t.y-t.height/2:t.bounds.y)),this.svgNodes.select(".mostSpecificTypeLabel").attr("x",(t=>t.x-(t.width||0)/2+5)).attr("y",(t=>t.y-(t.height||0)/2+10)).raise(),this.svgNodes.select(".label").attr("x",(t=>t.x)).attr("y",(t=>t.y)).each(((t,e,r)=>{const n=t._labelVerticalOffset||0,i=t._labelLineHeight||12;kg.select(r[e]).selectAll("tspan").attr("x",t.x).attr("dy",((t,e)=>0===e?`${n}px`:`${i}px`))})).raise(),this.svgLinkGroups.select("path").attr("d",(t=>{let e=t.source,r=t.target;if(t.id?.startsWith("_g_")){const{groupOnIndex:n,addToGroupIndex:i}=this.getGroupOnAndAddToGroupIndices(t.id),o=n>=i;if(nt.keyNode===this.getNodeIndex(e)));t&&(r=t)}else if(o){const t=this.getContainingGroups(this.currentLayout?.groups||[],e).find((t=>t.keyNode===this.getNodeIndex(r)));t&&(e=t)}}const n=this.getStableEdgePath(e,r);return this.lineFunction(n)})).attr("marker-end",(t=>this.isAlignmentEdge(t)?"none":"url(#end-arrow)")).attr("marker-start",(t=>this.isAlignmentEdge(t)||!t.bidirectional?"none":"url(#start-arrow)")).raise(),this.svgLinkGroups.select(".linklabel").attr("x",(t=>{const e=this.shadowRoot?.querySelector(`path[data-link-id="${t.id}"]`);return e?this.calculateNewPosition(e,"x"):(t.source.x+t.target.x)/2})).attr("y",(t=>{const e=this.shadowRoot?.querySelector(`path[data-link-id="${t.id}"]`);return e?this.calculateNewPosition(e,"y"):(t.source.y+t.target.y)/2})).style("font-size",(()=>{const t=this.getCurrentZoomScale(),e=t<1?12/Math.sqrt(t):12;return`${Math.min(e,16)}px`})).raise(),this.updateEdgeEndpointMarkers(),this.svgGroupLabels.attr("x",(t=>t.bounds?t.bounds.x+t.bounds.width()/2:0)).attr("y",(t=>t.bounds?t.bounds.y+5:0)).attr("text-anchor","middle").lower(),this.svgLinkGroups.selectAll("marker").raise(),this.svgLinkGroups.selectAll(".linklabel").raise(),this.svgGroups.selectAll(".error-group").raise(),this.svgNodes.selectAll(".error-node").raise()}updateEdgeEndpointMarkers(){this.svgLinkGroups&&(this.svgLinkGroups.select(".target-marker").attr("cx",(t=>{const e=this.shadowRoot?.querySelector(`path[data-link-id="${t.id}"]`);if(e){const t=e.getTotalLength();return e.getPointAtLength(t).x}return t.target.x||0})).attr("cy",(t=>{const e=this.shadowRoot?.querySelector(`path[data-link-id="${t.id}"]`);if(e){const t=e.getTotalLength();return e.getPointAtLength(t).y}return t.target.y||0})).attr("opacity",this.isInputModeActive?.8:0).style("pointer-events",this.isInputModeActive?"all":"none").raise(),this.svgLinkGroups.select(".source-marker").attr("cx",(t=>{const e=this.shadowRoot?.querySelector(`path[data-link-id="${t.id}"]`);return e?e.getPointAtLength(0).x:t.source.x||0})).attr("cy",(t=>{const e=this.shadowRoot?.querySelector(`path[data-link-id="${t.id}"]`);return e?e.getPointAtLength(0).y:t.source.y||0})).attr("opacity",this.isInputModeActive?.8:0).style("pointer-events",this.isInputModeActive?"all":"none").raise())}gridUpdatePositions(){this.ensureNodeBounds(!0);const t=this.container.selectAll(".node"),r=this.container.selectAll(".mostSpecificTypeLabel"),n=this.container.selectAll(".label"),i=this.container.selectAll(".group"),o=this.container.selectAll(".groupLabel");t.select("rect").each((function(t){t.innerBounds=t.bounds.inflate(-1)})).attr("x",(function(t){return t.bounds.x})).attr("y",(function(t){return t.bounds.y})).attr("width",(function(t){return t.bounds.width()})).attr("height",(function(t){return t.bounds.height()})),t.select("image").attr("x",(function(t){return t.showLabels?t.x+t.width/2-t.width*e.SMALL_IMG_SCALE_FACTOR:t.bounds.x})).attr("y",(function(t){return t.showLabels?t.y-t.height/2:t.bounds.y})),r.attr("x",(function(t){return t.bounds.x+5})).attr("y",(function(t){return t.bounds.y+10})).raise(),n.attr("x",(t=>t.x)).attr("y",(t=>t.y)).each((function(t){var e=0;kg.select(this).selectAll("tspan").attr("x",t.x).attr("dy",(function(){return 1===(e+=1)?"0em":"1em"}))})).raise(),i.attr("x",(function(t){return t.bounds.x})).attr("y",(function(t){return t.bounds.y})).attr("width",(function(t){return t.bounds.width()})).attr("height",(function(t){return t.bounds.height()})).lower(),o.attr("x",(function(t){return t.bounds.x+t.bounds.width()/2})).attr("y",(function(t){return t.bounds.y+12})).attr("text-anchor","middle").raise();const s=this.container.selectAll(".link-group");s.select("path").attr("d",(t=>{const e=t.source?.x??t.source?.bounds?.cx()??0,r=t.source?.y??t.source?.bounds?.cy()??0,n=t.target?.x??t.target?.bounds?.cx()??0,i=t.target?.y??t.target?.bounds?.cy()??0,o=n-e,s=i-r;if(Math.abs(o)>Math.abs(s)){const t=e+o/2;return this.gridLineFunction([{x:e,y:r},{x:t,y:r},{x:t,y:i},{x:n,y:i}])}{const t=r+s/2;return this.gridLineFunction([{x:e,y:r},{x:e,y:t},{x:n,y:t},{x:n,y:i}])}})),s.select("text.linklabel").attr("x",(t=>{const e=this.shadowRoot?.querySelector(`path[data-link-id="${t.id}"]`);if(e){const t=e.getTotalLength();return e.getPointAtLength(t/2).x}return((t.source?.x??t.source?.bounds?.cx()??0)+(t.target?.x??t.target?.bounds?.cx()??0))/2})).attr("y",(t=>{const e=this.shadowRoot?.querySelector(`path[data-link-id="${t.id}"]`);if(e){const t=e.getTotalLength();return e.getPointAtLength(t/2).y}return((t.source?.y??t.source?.bounds?.cy()??0)+(t.target?.y??t.target?.bounds?.cy()??0))/2})).raise()}routeEdges(){try{this.ensureNodeBounds(),"function"==typeof this.colaLayout?.prepareEdgeRouting&&this.colaLayout.prepareEdgeRouting(e.VIEWBOX_PADDING/e.EDGE_ROUTE_MARGIN_DIVISOR),this.buildEdgeRoutingCaches(),this.routeLinkPaths(),this.updateLinkLabelsAfterRouting(),this.fitViewportToContent()}catch(t){console.error("Error in edge routing:",t),this.showError(`Edge routing failed: ${t.message}`)}}ensureNodeBounds(t=!1){if(this.currentLayout?.nodes&&Ig?.Rectangle)for(const e of this.currentLayout.nodes){if(!t&&e.bounds&&"function"==typeof e.bounds.rayIntersection){const t=e.bounds.cx(),r=e.bounds.cy(),n=1;if(Math.abs(t-(e.x||0)){t.id?.startsWith("_alignment_")&&this.edgeRoutingCache.alignmentEdges.add(t.id)})),this.currentLayout.links.forEach((t=>{if(this.isAlignmentEdge(t))return;const e=t.source.id,r=t.target.id,n=this.getNodePairKey(e,r);this.edgeRoutingCache.edgesBetweenNodes.has(n)||this.edgeRoutingCache.edgesBetweenNodes.set(n,[]),this.edgeRoutingCache.edgesBetweenNodes.get(n).push(t)})))}getNodePairKey(t,e){return t{const e=t.bounds||t.innerBounds||this.createFallbackBounds(t);t.routerNode={name:t.name,bounds:e}})),e.forEach((e=>{e.bounds||console.warn("Grid routing group missing bounds; routing may be degraded.",e),e.routerNode={bounds:e.bounds?.inflate(-n)??e.bounds,children:(void 0!==e.groups?e.groups.map((e=>t.length+e.id)):[]).concat(void 0!==e.leaves?e.leaves.map((t=>t.index)):[])}}));let i=t.concat(e).map(((t,e)=>t.routerNode?(t.routerNode.id=e,t.routerNode):null)).filter(Boolean);return new Ig.GridRouter(i,{getChildren:t=>t.children,getBounds:t=>t.bounds},r-n)}gridify(t,e,r){try{const n=this.currentLayout?.nodes??[],i=this.currentLayout?.groups??[],o=this.currentLayout?.links??[];if(0===n.length)return void console.warn("No nodes available for GridRouter; skipping gridify.");if(0===o.length)return void console.warn("No edges to route in GridRouter");console.log("[gridify] Node positions BEFORE ensureNodeBounds:"),n.slice(0,3).forEach((t=>{console.log(` ${t.id}: x=${t.x?.toFixed(2)}, y=${t.y?.toFixed(2)}, bounds.cx=${t.bounds?.cx?.()?.toFixed(2)}, bounds.x=${t.bounds?.x?.toFixed(2)}`)})),this.ensureNodeBounds(!0),console.log("[gridify] Node positions AFTER ensureNodeBounds:"),n.slice(0,3).forEach((t=>{console.log(` ${t.id}: x=${t.x?.toFixed(2)}, y=${t.y?.toFixed(2)}, bounds.cx=${t.bounds?.cx?.()?.toFixed(2)}, bounds.x=${t.bounds?.x?.toFixed(2)}`)}));const s=this.route(n,i,e,r);let a=[];const l=o.filter((t=>t?.source?.routerNode&&t?.target?.routerNode));console.log("[gridify] Total edges:",o.length,"Routable:",l.length),l.length!==o.length&&o.filter((t=>!t?.source?.routerNode||!t?.target?.routerNode)).forEach((t=>{console.warn("[gridify] Unroutable edge:",t.id,"source routerNode:",!!t?.source?.routerNode,"target routerNode:",!!t?.target?.routerNode,"source:",t?.source?.id,"x:",t?.source?.x,"y:",t?.source?.y,"target:",t?.target?.id,"x:",t?.target?.x,"y:",t?.target?.y)})),a=s.routeEdges(l,t,(function(t){return t.source.routerNode.id}),(function(t){return t.target.routerNode.id}));const u=new Map;l.forEach(((t,e)=>{const r=a[e];t?.id&&r&&u.set(t.id,this.adjustGridRouteForEdge(t,r))})),console.log("[gridify] Routes generated:",u.size,"out of",l.length),this.container.selectAll(".link-group").data(o,(t=>t.id??t)).select("path").attr("d",(t=>{const e=u.get(t.id);if(!e){const e=t.source?.x??t.source?.bounds?.cx()??0,r=t.source?.y??t.source?.bounds?.cy()??0,n=t.target?.x??t.target?.bounds?.cx()??0,i=t.target?.y??t.target?.bounds?.cy()??0;console.log("[gridify] Fallback path for edge:",t.id,"from",t.source?.id,"(",e,",",r,")","to",t.target?.id,"(",n,",",i,")");const o=n-e,s=i-r;if(Math.abs(o)>Math.abs(s)){const t=e+o/2;return this.gridLineFunction([{x:e,y:r},{x:t,y:r},{x:t,y:i},{x:n,y:i}])}{const t=r+s/2;return this.gridLineFunction([{x:e,y:r},{x:e,y:t},{x:n,y:t},{x:n,y:i}])}}const r=Ig.GridRouter.getRoutePath(e,5,3,7);return this.adjustGridRouteForArrowPositioning(t,r.routepath,e)||r.routepath})),this.gridUpdateLinkLabels(o,u),this.fitViewportToContent(),this.dispatchEvent(new Event("relationsAvailable"))}catch(t){console.log("Error routing edges in GridRouter"),console.error(t);let e=document.getElementById("runtime_messages"),r=document.createElement("div");return r.className="alert alert-danger alert-dismissible fade show",r.setAttribute("role","alert"),r.innerHTML="Runtime (WebCola) error when gridifying edges. You may have to click and drag these nodes slightly to un-stick layout.",e.querySelectorAll(".alert").forEach((t=>{t.innerHTML===r.innerHTML&&t.remove()})),void e.appendChild(r)}}gridUpdateLinkLabels(t,e){this.container.selectAll(".link-group").filter((t=>!this.isAlignmentEdge(t))).select("text.linklabel").attr("x",(t=>{const r=this.shadowRoot?.querySelector(`path[data-link-id="${t.id}"]`);if(r)try{const t=r.getTotalLength();return r.getPointAtLength(t/2).x}catch(t){}return this.getGridRouteMidpoint(t,e)?.x??t.source?.x??t.source?.bounds?.cx()??0})).attr("y",(t=>{const r=this.shadowRoot?.querySelector(`path[data-link-id="${t.id}"]`);if(r)try{const t=r.getTotalLength();return r.getPointAtLength(t/2).y}catch(t){}return this.getGridRouteMidpoint(t,e)?.y??t.source?.y??t.source?.bounds?.cy()??0})).attr("text-anchor","middle").attr("dominant-baseline","middle")}getGridRouteMidpoint(t,e){const r=e.get(t.id);if(!r){const e=t.source?.x??t.source?.bounds?.cx()??0,r=t.source?.y??t.source?.bounds?.cy()??0;return{x:(e+(t.target?.x??t.target?.bounds?.cx()??0))/2,y:(r+(t.target?.y??t.target?.bounds?.cy()??0))/2}}const n=[];if(r.forEach((t=>{0===n.length&&t.length>0&&n.push(t[0]),t.length>1&&n.push(t[1])})),n.length<2)return null;let i=0;const o=[];for(let t=0;t=s){const r=s-a,i=e>0?r/e:0;return{x:n[t].x+i*(n[t+1].x-n[t].x),y:n[t].y+i*(n[t+1].y-n[t].y)}}a+=e}const l=Math.floor(n.length/2);return n[l]}adjustGridRouteForEdge(t,e){if(!t?.id?.startsWith("_g_"))return e;const r=this.gridRouteToPoints(e);if(r.length<2)return e;const n=this.routeGroupEdge(t,r);return this.pointsToGridRoute(n)}adjustGridRouteForArrowPositioning(t,e,r){if(!e||!t.source||!t.target)return null;try{const e=this.gridRouteToPoints(r);if(e.length<2)return null;const n=t.source,i=t.target,o=n.bounds||{x:n.x-(n.width||0)/2,y:n.y-(n.height||0)/2,width:()=>n.width||0,height:()=>n.height||0},s=i.bounds||{x:i.x-(i.width||0)/2,y:i.y-(i.height||0)/2,width:()=>i.width||0,height:()=>i.height||0},a=(e[0],e.length>1?e[1]:e[0]),l=this.getRectangleIntersection(o.x+o.width()/2,o.y+o.height()/2,a.x,a.y,o);l&&(e[0]=l);const u=e[e.length-1],c=e.length>1?e[e.length-2]:u,h=this.getRectangleIntersection(s.x+s.width()/2,s.y+s.height()/2,c.x,c.y,s);return h&&(e[e.length-1]=h),this.gridLineFunction(e)}catch(t){return console.warn("Error adjusting grid route for arrow positioning:",t),null}}gridRouteToPoints(t){const e=[];return t.forEach(((t,r)=>{0===r&&e.push({x:t[0].x,y:t[0].y}),e.push({x:t[1].x,y:t[1].y})})),e}pointsToGridRoute(t){const e=[];for(let r=0;rd)return null;const p=h>0?h:d;return{x:t+p*u,y:e+p*c}}routeLinkPaths(){this.container.selectAll(".link-group path").attr("d",(t=>{try{return this.routeSingleEdge(t)}catch(e){return console.error(`Error routing edge ${t.id} from ${t.source.id} to ${t.target.id}:`,e),this.showRuntimeAlert(t.source.id,t.target.id),this.lineFunction([{x:t.source.x||0,y:t.source.y||0},{x:t.target.x||0,y:t.target.y||0}])}}))}routeSingleEdge(t){if(this.isAlignmentEdge(t))return this.lineFunction([{x:t.source.x||0,y:t.source.y||0},{x:t.target.x||0,y:t.target.y||0}]);const e=[{x:t.source.x||0,y:t.source.y||0},{x:t.target.x||0,y:t.target.y||0}];let r;if("function"==typeof this.colaLayout?.routeEdge)try{if(r=this.colaLayout.routeEdge(t),!r||!Array.isArray(r)||r.length<2||!r[0]||!r[1]||void 0===r[0].x||void 0===r[0].y)throw new Error(`WebCola failed to route edge ${t.id} from ${t.source.id} to ${t.target.id}`)}catch(r){return console.log("Error routing edge",t.id,`from ${t.source.id} to ${t.target.id}`),console.error(r),this.lineFunction(e)}else r=e;return r=t.source.id===t.target.id?this.createSelfLoopRoute(t):t.id?.startsWith("_g_")?this.routeGroupEdge(t,r):this.handleMultipleEdgeRouting(t,r),this.lineFunction(r)}createSelfLoopRoute(t){const r=t.source,n=r.bounds;if(!n)return[{x:r.x,y:r.y},{x:r.x+20,y:r.y-20},{x:r.x,y:r.y}];const i=n.X-n.x,o=n.Y-n.y,s={x:n.x+i/2,y:n.y},a={x:n.X,y:n.y+o/2},l=1+(t.selfLoopIndex||0)*e.SELF_LOOP_CURVATURE_SCALE;return[s,{x:n.X+i/2*l,y:n.y-o/2*l},a]}routeGroupEdge(t,e){const{groupOnIndex:r,addToGroupIndex:n}=this.getGroupOnAndAddToGroupIndices(t.id),i=r>=n;if(rt.keyNode===r));if(i){const t=this.closestPointOnRect(i.bounds,e[0]);e[e.length-1]=t}else console.log("Target group not found",n,this.getNodeIndex(t.target),t.id)}else if(i){const r=this.getNodeIndex(t.source),n=this.getNodeIndex(t.target),i=this.getContainingGroups(this.currentLayout?.groups||[],t.source),o=i.find((t=>t.keyNode===n));if(o){const t=o.bounds?.inflate(-1),r=this.closestPointOnRect(t||o.bounds,e[e.length-1]);e[0]=r}else console.log("Source group not found",i,r,n,t.id)}else console.log("This is a group edge, but neither source nor target is a group.",t);return e.length>2&&e.splice(1,e.length-2),e}handleMultipleEdgeRouting(t,e){const r=this.getAllEdgesBetweenNodes(t.source.id,t.target.id);if(r.length<=1)return e;if(2===e.length){const t={x:(e[0].x+e[1].x)/2,y:(e[0].y+e[1].y)/2};e.splice(1,0,t)}const n=e[1].x-e[0].x,i=e[1].y-e[0].y,o=Math.atan2(i,n),s=Math.sqrt(n*n+i*i),a=r.findIndex((e=>e.id===t.id));if(-1!==a){e=this.applyEdgeOffsetWithIndex(t,e,r,o,a);const n=this.calculateCurvatureWithIndex(r,t.id,a);e=this.applyCurvatureToRoute(e,n,o,s)}return e}getAllEdgesBetweenNodes(t,e){if(!this.currentLayout?.links)return[];const r=this.getNodePairKey(t,e);return this.edgeRoutingCache.edgesBetweenNodes.has(r)?this.edgeRoutingCache.edgesBetweenNodes.get(r):this.currentLayout.links.filter((r=>!this.isAlignmentEdge(r)&&(r.source.id===t&&r.target.id===e||r.source.id===e&&r.target.id===t)))}calculateCurvature(t,r,n,i){if(i.startsWith("_alignment_"))return 0;const o=t.length,s=t.findIndex((t=>t.id===i));return o<=1?0:(s%2==0?1:-1)*(Math.floor(s/2)+1)*e.CURVATURE_BASE_MULTIPLIER*o}calculateCurvatureWithIndex(t,r,n){const i=t.length;return i<=1?0:(n%2==0?1:-1)*(Math.floor(n/2)+1)*e.CURVATURE_BASE_MULTIPLIER*i}applyEdgeOffset(t,e,r,n){const i=r.findIndex((e=>e.id===t.id));return this.applyEdgeOffsetWithIndex(t,e,r,n,i)}applyEdgeOffsetWithIndex(t,r,n,i,o){const s=(o%2==0?1:-1)*(Math.floor(o/2)+1)*e.MIN_EDGE_DISTANCE,a=this.getDominantDirection(i);return"right"===a||"left"===a?(r[0].y+=s,r[r.length-1].y+=s):"up"!==a&&"down"!==a||(r[0].x+=s,r[r.length-1].x+=s),t.source.innerBounds&&(r[0]=this.adjustPointToRectanglePerimeter(r[0],t.source.innerBounds)),t.target.innerBounds&&(r[r.length-1]=this.adjustPointToRectanglePerimeter(r[r.length-1],t.target.innerBounds)),r}applyCurvatureToRoute(t,e,r,n){return 0===e||t.forEach(((i,o)=>{if(o>0&&o=-Math.PI/4&&t<=Math.PI/4?"right":t>Math.PI/4&&t<3*Math.PI/4?"up":t>=3*Math.PI/4||t<=-3*Math.PI/4?"left":t>-3*Math.PI/4&&t<-Math.PI/4?"down":null}closestPointOnRect(t,e){if(!t)return e;const{x:r,y:n,X:i,Y:o}=t;return{x:Math.max(r,Math.min(e.x,i)),y:Math.max(n,Math.min(e.y,o))}}getStableEdgeAnchor(t,e){if(!t)return e;let r,n,i,o;if("function"==typeof t.cx)r=t.cx(),n=t.cy(),i=t.width()/2,o=t.height()/2;else{if(void 0===t.x||void 0===t.X)return e;r=(t.x+t.X)/2,n=(t.y+t.Y)/2,i=(t.X-t.x)/2,o=(t.Y-t.y)/2}const s=e.x-r,a=e.y-n;return Math.abs(s)/i>Math.abs(a)/o?s>0?{x:r+i,y:n}:{x:r-i,y:n}:a>0?{x:r,y:n+o}:{x:r,y:n-o}}getStableEdgePath(t,e){let r,n;return r=e.bounds&&"function"==typeof e.bounds.cx?{x:e.bounds.cx(),y:e.bounds.cy()}:e.bounds?{x:(e.bounds.x+e.bounds.X)/2,y:(e.bounds.y+e.bounds.Y)/2}:{x:e.x||0,y:e.y||0},n=t.bounds&&"function"==typeof t.bounds.cx?{x:t.bounds.cx(),y:t.bounds.cy()}:t.bounds?{x:(t.bounds.x+t.bounds.X)/2,y:(t.bounds.y+t.bounds.Y)/2}:{x:t.x||0,y:t.y||0},[t.bounds||t.innerBounds?this.getStableEdgeAnchor(t.bounds||t.innerBounds,r):n,e.bounds||e.innerBounds?this.getStableEdgeAnchor(e.bounds||e.innerBounds,n):r]}adjustPointToRectanglePerimeter(t,e){return e?this.closestPointOnRect(e,t):t}updateLinkLabelsAfterRouting(){this.container.selectAll(".link-group .linklabel").attr("x",(t=>{const e=this.shadowRoot?.querySelector(`path[data-link-id="${t.id}"]`);if(!e)return 0;const r=e.getTotalLength();return e.getPointAtLength(r/2).x})).attr("y",(t=>{const e=this.shadowRoot?.querySelector(`path[data-link-id="${t.id}"]`);if(!e)return 0;const r=e.getTotalLength();return e.getPointAtLength(r/2).y})).attr("text-anchor","middle").each(((t,e,r)=>{this.handleLabelOverlap(r[e])})).raise()}handleLabelOverlap(t){const e=[];this.container.selectAll(".linklabel").each((function(){this!==t&&function(t,e){function r(t){return t&&"object"==typeof t&&"getBBox"in t}const n=r(t)?t.getBBox():{x:0,y:0,width:0,height:0},i=r(e)?e.getBBox():{x:0,y:0,width:0,height:0};return!(i.x>n.x+n.width||i.x+i.widthn.y+n.height||i.y+i.height0&&this.minimizeOverlap(t,e)}minimizeOverlap(t,e){}fitViewportToContent(t=!1){const r=this.svg?.node();if(!r||!this.zoomBehavior)return;if(this.userHasManuallyZoomed&&!this.isInitialRender&&!t)return;const n=this.calculateContentBounds();if(!n)return;const i=r.clientWidth||r.parentElement?.clientWidth||800,o=r.clientHeight||r.parentElement?.clientHeight||600,s=4*e.VIEWBOX_PADDING,a=(i-2*s)/n.width,l=(o-2*s)/n.height,u=Math.min(a,l,1),[c,h]=this.zoomBehavior.scaleExtent(),d=Math.max(c,Math.min(h,u)),p=i/2-(n.x+n.width/2)*d,f=o/2-(n.y+n.height/2)*d,g=kg.zoomIdentity.translate(p,f).scale(d);this.isInitialRender?(this.svg.call(this.zoomBehavior.transform,g),this.isInitialRender=!1):this.svg.transition().duration(300).ease(kg.easeCubicOut).call(this.zoomBehavior.transform,g),this.updateZoomControlStates()}resetViewToFitContent(){this.userHasManuallyZoomed=!1,this.fitViewportToContent(!0)}calculateContentBounds(){try{if(!this.currentLayout||!this.container)return null;let t=1/0,e=1/0,r=-1/0,n=-1/0;const i=this.currentLayout.nodes;i&&i.length>0&&(i.forEach(((i,o)=>{if("number"==typeof i.x&&"number"==typeof i.y){const o=i.width||0,s=i.height||0,a=i.x,l=i.x+o,u=i.y,c=i.y+s;t=Math.min(t,a),r=Math.max(r,l),e=Math.min(e,u),n=Math.max(n,c)}})),i.reduce(((t,e)=>"number"==typeof e.x&&"number"==typeof e.y&&e.y+(e.height||0)>(t?t.y+(t.height||0):-1/0)?e:t),null));const o=this.container.selectAll(".link-group");o.empty()||o.each((function(){try{const i=this.getBBox();i.width>0&&i.height>0&&(t=Math.min(t,i.x),r=Math.max(r,i.x+i.width),e=Math.min(e,i.y),n=Math.max(n,i.y+i.height))}catch(t){}}));const s=this.container.selectAll(".node, .error-node");s.empty()||s.each((function(){try{const i=this.getBBox();i.width>0&&i.height>0&&(t=Math.min(t,i.x),r=Math.max(r,i.x+i.width),e=Math.min(e,i.y),n=Math.max(n,i.y+i.height))}catch(t){}}));const a=this.container.selectAll("text");if(!a.empty()){let i=0;a.each((function(){try{const o=this.getBBox();if(o.width>0&&o.height>0){i++;const s=5,a=o.y-s,l=o.y+o.height+s;t=Math.min(t,o.x-s),r=Math.max(r,o.x+o.width+s),e=Math.min(e,a),n=Math.max(n,l)}}catch(t){}}))}const l=this.container.selectAll(".group");return l.empty()||l.each((function(){try{const i=this.getBBox();i.width>0&&i.height>0&&(t=Math.min(t,i.x),r=Math.max(r,i.x+i.width),e=Math.min(e,i.y),n=Math.max(n,i.y+i.height))}catch(t){}})),t===1/0||e===1/0||r===-1/0||n===-1/0?(console.warn("Could not calculate content bounds - no valid elements found"),null):{x:t,y:e,width:r-t,height:n-e}}catch(t){return console.error("Error calculating content bounds:",t),null}}dispatchRelationsAvailableEvent(){const t=this.getAllRelations(),e=new CustomEvent("relations-available",{detail:{relations:t,count:t.length,timestamp:Date.now(),graphId:this.id||"unknown"},bubbles:!0,cancelable:!0});this.dispatchEvent(e)}getAllRelations(){if(!this.currentLayout?.links)return[];const t=new Set(this.currentLayout.links.filter((t=>!this.isAlignmentEdge(t))).map((t=>t.relName)).filter(Boolean));return Array.from(t)}highlightRelation(t){return!!this.currentLayout?.links&&(this.svgLinkGroups.filter((e=>e.relName===t&&!this.isAlignmentEdge(e))).selectAll("path").classed("highlighted",!0),!0)}clearHighlightRelation(t){return!!this.currentLayout?.links&&(this.svgLinkGroups.filter((e=>e.relName===t&&!this.isAlignmentEdge(e))).selectAll("path").classed("highlighted",!1),!0)}highlightNodes(t){if(!this.currentLayout?.nodes||!this.svgNodes)return!1;if(!t||0===t.length)return!1;const e=new Set(t);let r=!1;return this.svgNodes.each(((t,n,i)=>{e.has(t.id)&&(kg.select(i[n]).classed("highlighted",!0),r=!0)})),r}highlightNodePairs(t,e={}){if(!this.currentLayout?.nodes||!this.svgNodes)return!1;if(!t||0===t.length)return!1;const{showBadges:r=!1}=e,n=new Set,i=new Set;t.forEach(((t,e)=>{if(!Array.isArray(t))return void console.warn(`highlightNodePairs: Pair at index ${e} is not an array, skipping`);if(2!==t.length)return void console.warn(`highlightNodePairs: Pair at index ${e} has ${t.length} elements (expected 2), skipping`);const[r,o]=t;r&&n.add(r),o&&i.add(o)}));let o=!1;return this.svgNodes.each(((t,e,s)=>{const a=kg.select(s[e]);n.has(t.id)&&(a.classed("highlighted-first",!0),o=!0,r&&this.addHighlightBadge(a,t,"1","#007aff")),i.has(t.id)&&(a.classed("highlighted-second",!0),o=!0,r&&(n.has(t.id)?this.addHighlightBadge(a,t,"1,2","#9B59B6"):this.addHighlightBadge(a,t,"2","#ff3b30")))})),o}clearNodeHighlights(){return!!this.svgNodes&&(this.svgNodes.classed("highlighted",!1).classed("highlighted-first",!1).classed("highlighted-second",!1).selectAll(".highlight-badge, .highlight-badge-bg").remove(),!0)}addHighlightBadge(t,e,r,n){t.selectAll(".highlight-badge, .highlight-badge-bg").remove();const i=(e.width||0)/2-8-4,o=-(e.height||0)/2+8+4;t.append("circle").attr("class","highlight-badge-bg").attr("cx",i).attr("cy",o).attr("r",8).attr("fill",n),t.append("text").attr("class","highlight-badge").attr("x",i).attr("y",o).attr("dy","0.35em").text(r)}showRuntimeAlert(t,e){console.warn(`Runtime (WebCola) error when laying out an edge from ${t} to ${e}. You may have to click and drag these nodes slightly to un-stick layout.`)}getCSS(){return'\n :host {\n display: block;\n width: 100%;\n height: 100%;\n font-family: system-ui, -apple-system, sans-serif;\n }\n \n #svg-container {\n position: relative; /* Make this the positioning context for zoom controls */\n width: 100%;\n height: 100%;\n border: 1px solid #ccc;\n overflow: hidden;\n }\n \n /* Make SVG fill the container completely */\n svg {\n width: 100%; /* Fill container width */\n height: 100%; /* Fill container height */\n display: block; /* Remove inline spacing */\n cursor: grab;\n }\n \n svg:active {\n cursor: grabbing;\n }\n \n .node rect {\n cursor: move;\n }\n\n .error-node rect, .error-group {\n stroke-width: 2px;\n stroke-dasharray: 5 5;\n animation: dash 1s linear infinite;\n }\n\n /* Enhanced visibility for small error nodes */\n .small-error-node rect {\n stroke-width: 4px !important; /* Thicker stroke for visibility */\n stroke-dasharray: 8 4 !important; /* Larger dash pattern */\n animation: dash 1s linear infinite, pulse-bg 2s ease-in-out infinite !important;\n fill: rgba(225, 112, 46, 0.46) !important; /* Light reddish background */\n }\n\n @keyframes dash {\n to {\n stroke-dashoffset: -10;\n }\n }\n\n /* Pulsing background animation for small error nodes */\n @keyframes pulse-bg {\n 0%, 100% { \n fill-opacity: 0.15; \n }\n 50% { \n fill-opacity: 0.55; \n }\n }\n \n .link {\n stroke-width: 1px;\n fill: none;\n marker-end: url(#end-arrow);\n }\n \n .inferredLink {\n stroke-width: 1.5px;\n fill: none;\n marker-end: url(#end-arrow);\n }\n\n\n .alignmentLink {\n stroke: transparent !important; /* make the stroke invisible */\n stroke-width: 0 !important; /* ensure no visible thickness */\n stroke-opacity: 0 !important; /* defensive */\n fill: none !important;\n pointer-events: none !important; /* don\'t block mouse events */\n }\n\n\n .link.highlighted {\n stroke: black; /* Change this to your desired highlight color */\n stroke-width: 3px; /* Change this to your desired highlight width */\n }\n\n .inferredLink.highlighted {\n stroke:#666666; /* Change this to your desired highlight color */\n stroke-width: 3px; /* Change this to your desired highlight width */\n }\n\n /* Node highlighting styles */\n .node.highlighted rect {\n stroke: #ff9500;\n stroke-width: 3px;\n filter: drop-shadow(0 0 6px rgba(255, 149, 0, 0.6));\n }\n\n .node.highlighted-first rect {\n stroke: #007aff;\n stroke-width: 3px;\n filter: drop-shadow(0 0 6px rgba(0, 122, 255, 0.6));\n }\n\n .node.highlighted-second rect {\n stroke: #ff3b30;\n stroke-width: 3px;\n filter: drop-shadow(0 0 6px rgba(255, 59, 48, 0.6));\n }\n\n /* Add a badge indicator for first/second in binary selectors */\n .highlight-badge {\n font-size: 10px;\n font-weight: bold;\n fill: white;\n text-anchor: middle;\n pointer-events: none;\n }\n\n .highlight-badge-bg {\n pointer-events: none;\n }\n \n .group {\n fill: rgba(200, 200, 200, 0.3);\n stroke: #666;\n stroke-width: 1px;\n }\n \n .label {\n text-anchor: middle;\n dominant-baseline: middle;\n font-size: 10px;\n pointer-events: none;\n }\n\n .linklabel {\n text-anchor: middle;\n dominant-baseline: middle;\n font-size: 12px;\n font-weight: 500;\n fill: #1a1a1a;\n pointer-events: none;\n font-family: system-ui, -apple-system, sans-serif;\n stroke: white;\n stroke-width: 3px;\n stroke-linejoin: round;\n paint-order: stroke fill;\n }\n \n .mostSpecificTypeLabel {\n font-size: 8px;\n font-weight: bold;\n pointer-events: none;\n }\n \n #loading, #error {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n padding: 20px;\n background: white;\n border: 1px solid #ccc;\n border-radius: 4px;\n box-shadow: 0 2px 8px rgba(0,0,0,0.1);\n }\n\n /* Input mode styles */\n svg.input-mode {\n cursor: crosshair !important;\n }\n\n svg.input-mode .node rect {\n cursor: crosshair !important;\n }\n\n svg.input-mode:active {\n cursor: crosshair !important;\n }\n\n .temporary-edge {\n pointer-events: none;\n z-index: 1000;\n }\n\n svg.input-mode .link {\n cursor: pointer;\n }\n\n svg.input-mode .link:hover {\n opacity: 0.8;\n }\n\n /* Error icon positioning - bottom area to avoid header overlap */\n #error-icon {\n margin: 5px;\n padding: 8px 12px;\n font-size: 16px;\n position: absolute;\n bottom: 10px; /* Position at bottom instead of top */\n left: 10px;\n z-index: 1000;\n cursor: help;\n background-color: rgba(220, 53, 69, 0.95);\n color: white;\n border-radius: 6px;\n border: none;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);\n font-weight: 500;\n display: flex;\n align-items: center;\n gap: 6px;\n visibility: hidden; /* Use visibility instead of display */\n }\n \n #error-icon.visible {\n visibility: visible;\n }\n\n #error-icon::before {\n content: "⚠️";\n font-size: 18px;\n }\n\n /* Graph toolbar styling */\n #graph-toolbar {\n display: flex;\n justify-content: flex-start;\n align-items: center;\n padding: 8px 12px;\n background: rgba(255, 255, 255, 0.95);\n border: 1px solid rgba(0, 0, 0, 0.1);\n border-radius: 6px;\n margin-bottom: 8px;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n backdrop-filter: blur(4px);\n }\n\n /* Zoom controls styling */\n #zoom-controls {\n display: flex;\n flex-direction: row;\n gap: 8px;\n align-items: center;\n }\n\n #zoom-controls button {\n width: 24px;\n height: 24px;\n border: 1px solid #d1d5db;\n background: #f9fafb;\n color: #374151;\n border-radius: 4px;\n cursor: pointer;\n font-size: 14px;\n font-weight: 500;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.15s ease;\n user-select: none;\n line-height: 1;\n }\n\n #zoom-controls button:hover {\n background: #f3f4f6;\n border-color: #9ca3af;\n color: #111827;\n }\n\n #zoom-controls button:active {\n background: #e5e7eb;\n border-color: #6b7280;\n transform: translateY(0.5px);\n }\n\n #zoom-controls button:disabled {\n background: #f9fafb;\n border-color: #e5e7eb;\n color: #9ca3af;\n cursor: not-allowed;\n }\n\n #zoom-controls button:disabled:hover {\n background: #f9fafb;\n border-color: #e5e7eb;\n color: #9ca3af;\n transform: none;\n }\n\n /* Routing control styling */\n #routing-control {\n display: flex;\n align-items: center;\n gap: 6px;\n margin-left: 16px;\n padding-left: 16px;\n border-left: 1px solid #e5e7eb;\n }\n\n #routing-control label {\n font-size: 12px;\n font-weight: 500;\n color: #6b7280;\n user-select: none;\n }\n\n #routing-mode {\n padding: 4px 8px;\n border: 1px solid #d1d5db;\n background: #f9fafb;\n color: #374151;\n border-radius: 4px;\n font-size: 12px;\n cursor: pointer;\n transition: all 0.15s ease;\n outline: none;\n }\n\n #routing-mode:hover {\n background: #f3f4f6;\n border-color: #9ca3af;\n }\n\n #routing-mode:focus {\n border-color: #3b82f6;\n box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);\n }\n\n /* Modal Overlay and Dialog */\n .modal-overlay {\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n font-family: system-ui, -apple-system, sans-serif;\n }\n\n .modal-dialog {\n background: white;\n border-radius: 8px;\n box-shadow: 0 4px 20px rgba(0,0,0,0.3);\n padding: 24px;\n max-width: 500px;\n width: 90%;\n max-height: 90vh;\n overflow-y: auto;\n }\n\n .modal-header {\n margin-bottom: 16px;\n }\n\n .modal-title {\n margin: 0;\n font-size: 18px;\n font-weight: 600;\n color: #333;\n }\n\n .modal-body {\n margin-bottom: 20px;\n }\n\n .modal-message {\n margin: 0 0 16px 0;\n font-size: 14px;\n color: #555;\n line-height: 1.5;\n }\n\n .modal-input {\n width: 100%;\n padding: 8px 12px;\n border: 2px solid #ddd;\n border-radius: 4px;\n font-size: 14px;\n box-sizing: border-box;\n }\n\n .modal-input:focus {\n outline: none;\n border-color: #007acc;\n }\n\n .modal-footer {\n display: flex;\n gap: 8px;\n justify-content: flex-end;\n }\n\n .modal-button {\n padding: 8px 16px;\n border: none;\n border-radius: 4px;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: background-color 0.2s;\n }\n\n .modal-button.primary {\n background: #007acc;\n color: white;\n }\n\n .modal-button.primary:hover {\n background: #005fa3;\n }\n\n .modal-button.secondary {\n background: #f8f9fa;\n color: #666;\n border: 1px solid #ddd;\n }\n\n .modal-button.secondary:hover {\n background: #e9ecef;\n }\n '}calculateNewPosition(t,e){const r=t.getTotalLength(),n=r/2;let i=n+0;i>=r&&(i=n);const o=t.getPointAtLength(i);return"x"===e?o.x:o.y}showLoading(){const t=this.shadowRoot.querySelector("#loading"),e=this.shadowRoot.querySelector("#error");t.style.display="flex",t.style.justifyContent="center",t.style.alignItems="center",t.style.position="absolute",t.style.top="50%",t.style.left="50%",t.style.transform="translate(-50%, -50%)",t.style.zIndex="1000",e.style.display="none"}updateLoadingProgress(t){const e=this.shadowRoot.querySelector("#loading-progress");e&&(e.textContent=t)}hideLoading(){this.shadowRoot.querySelector("#loading").style.display="none"}showError(t){const e=this.shadowRoot.querySelector("#loading"),r=this.shadowRoot.querySelector("#error");e.style.display="none",r.style.display="block",r.textContent=t}showErrorIcon(){this.shadowRoot.querySelector("#error-icon").classList.add("visible")}hideErrorIcon(){this.shadowRoot.querySelector("#error-icon").classList.remove("visible")}showConfirmDialog(t){return new Promise((e=>{const r=document.createElement("div");r.className="modal-overlay",r.innerHTML=`\n \n `,r.addEventListener("click",(t=>{const n=t.target;n.classList.contains("modal-overlay")||"cancel"===n.dataset.action?(this.shadowRoot.removeChild(r),e(!1)):"confirm"===n.dataset.action&&(this.shadowRoot.removeChild(r),e(!0))}));const n=t=>{"Escape"===t.key&&(this.shadowRoot.removeChild(r),document.removeEventListener("keydown",n),e(!1))};document.addEventListener("keydown",n),this.shadowRoot.appendChild(r),r.querySelector('[data-action="confirm"]')?.focus()}))}showPromptDialog(t,e=""){return new Promise((r=>{const n=document.createElement("div");n.className="modal-overlay",n.innerHTML=`\n \n `;const i=n.querySelector(".modal-input");n.addEventListener("click",(t=>{const e=t.target;if(e.classList.contains("modal-overlay"))this.shadowRoot.removeChild(n),r(null);else if("cancel"===e.dataset.action)this.shadowRoot.removeChild(n),r(null);else if("ok"===e.dataset.action){const t=i.value;this.shadowRoot.removeChild(n),r(t)}}));const o=t=>{if("Enter"===t.key){const t=i.value;this.shadowRoot.removeChild(n),document.removeEventListener("keydown",o),r(t)}else"Escape"===t.key&&(this.shadowRoot.removeChild(n),document.removeEventListener("keydown",o),r(null))};document.addEventListener("keydown",o),this.shadowRoot.appendChild(n),i.focus(),i.select()}))}showEdgeEditDialog(t,e=""){return new Promise((r=>{const n=document.createElement("div");n.className="modal-overlay",n.innerHTML=`\n \n `;const i=n.querySelector(".modal-input");n.addEventListener("click",(t=>{const e=t.target;if(e.classList.contains("modal-overlay"))this.shadowRoot.removeChild(n),r(null);else if("cancel"===e.dataset.action)this.shadowRoot.removeChild(n),r(null);else if("delete"===e.dataset.action)this.shadowRoot.removeChild(n),r("DELETE");else if("ok"===e.dataset.action){const t=i.value;this.shadowRoot.removeChild(n),r(t)}}));const o=t=>{if("Enter"===t.key){const t=i.value;this.shadowRoot.removeChild(n),document.removeEventListener("keydown",o),r(t)}else"Escape"===t.key&&(this.shadowRoot.removeChild(n),document.removeEventListener("keydown",o),r(null))};document.addEventListener("keydown",o),this.shadowRoot.appendChild(n),i.focus(),i.select()}))}disconnectedCallback(){this.dispose()}dispose(){this.detachInputModeListeners(),this.deactivateInputMode(),this.svg&&(this.svg.on(".zoom",null),this.svg.selectAll("*").remove()),this.container&&this.container.selectAll("*").remove(),this.svgNodes&&(this.svgNodes.on(".drag",null),this.svgNodes.on(".cnd",null)),this.colaLayout&&("function"==typeof this.colaLayout.stop&&this.colaLayout.stop(),this.colaLayout.on("tick",null),this.colaLayout.on("end",null)),this.currentLayout=null,this.colaLayout=null,this.svgNodes=null,this.svgLinkGroups=null,this.svgGroups=null,this.svgGroupLabels=null,this.zoomBehavior=null,this.storedTransform=null,this.dragStartPositions.clear(),this.cleanupEdgeCreation(),this.textMeasurementCanvas&&(this.textMeasurementCanvas=null)}getMemoryStats(){return{nodeCount:this.currentLayout?.nodes?.length||0,edgeCount:this.currentLayout?.links?.length||0,groupCount:this.currentLayout?.groups?.length||0,constraintCount:this.currentLayout?.constraints?.length||0,hasActiveLayout:!!this.colaLayout}}},Pg.DEFAULT_SVG_WIDTH=800,Pg.DEFAULT_SVG_HEIGHT=600,Pg.SMALL_IMG_SCALE_FACTOR=.3,Pg.NODE_BORDER_RADIUS=3,Pg.NODE_STROKE_WIDTH=1.5,Pg.DEFAULT_FONT_SIZE=10,Pg.MIN_FONT_SIZE=6,Pg.MAX_FONT_SIZE=16,Pg.TEXT_PADDING=8,Pg.LINE_HEIGHT_RATIO=1.2,Pg.DISCONNECTED_NODE_PREFIX="_d_",Pg.GROUP_BORDER_RADIUS=8,Pg.GROUP_FILL_OPACITY=.25,Pg.GROUP_LABEL_PADDING=20,Pg.DEFAULT_GROUP_COMPACTNESS=1e-5,Pg.EDGE_ROUTE_MARGIN_DIVISOR=3,Pg.CURVATURE_BASE_MULTIPLIER=.15,Pg.MIN_EDGE_DISTANCE=10,Pg.SELF_LOOP_CURVATURE_SCALE=.2,Pg.VIEWBOX_PADDING=10,Pg.INITIAL_UNCONSTRAINED_ITERATIONS=10,Pg.INITIAL_USER_CONSTRAINT_ITERATIONS=50,Pg.INITIAL_ALL_CONSTRAINTS_ITERATIONS=200,Pg.GRID_SNAP_ITERATIONS=1,Dg=Pg,"undefined"!=typeof customElements&&"undefined"!=typeof HTMLElement&&customElements.define("webcola-cnd-graph",Dg)}});t.JSONDataInstance=void 0,t.DataInstanceNormalizer=void 0;var Fg=c({"src/data-instance/json-data-instance.ts"(){Kg=p(dn()),t.JSONDataInstance=class e{constructor(e,r={}){this.atoms=[],this.relations=[],this.types=[],this.errors=[],this.eventListeners=new Map;try{const n="string"==typeof e?JSON.parse(e):e;if(!n||"object"!=typeof n)throw new Error("Invalid data: expected object with atoms and relations");if(!Array.isArray(n.atoms))throw new Error("Invalid data: atoms must be an array");if(!Array.isArray(n.relations))throw new Error("Invalid data: relations must be an array");const i=t.DataInstanceNormalizer.normalize(n,r);this.atoms=i.atoms,this.relations=i.relations,this.types=i.types,this.errors=i.errors}catch(t){throw new Error(`Failed to create JSONDataInstance: ${t instanceof Error?t.message:String(t)}`)}}addEventListener(t,e){this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(e)}removeEventListener(t,e){const r=this.eventListeners.get(t);r&&r.delete(e)}emitEvent(t){const e=this.eventListeners.get(t.type);e&&e.forEach((e=>{try{e(t)}catch(t){console.error("Error in data instance event listener:",t)}}))}isAtomBuiltin(t){return!1}getAtomType(t){const e=this.atoms.find((e=>e.id===t));if(!e)throw new Error(`Atom with ID '${t}' not found`);const r=this.types.find((t=>t.id===e.type));if(!r)throw new Error(`Type '${e.type}' not found for atom '${t}'`);return r}getTypes(){return this.types}getAtoms(){return this.atoms}getRelations(){return this.relations}applyProjections(t){if(0===t.length)return this.clone();const r=new Set(t),n=this.atoms.filter((t=>r.has(t.id))),i=this.relations.map((t=>({...t,tuples:t.tuples.filter((t=>t.atoms.every((t=>r.has(t)))))}))).filter((t=>t.tuples.length>0));return new e({atoms:n,relations:i,types:this.types})}generateGraph(t=!1,e=!1){const r=new Kg.Graph({directed:!0,multigraph:!0});if(this.atoms.forEach((t=>{r.setNode(t.id,{id:t.id,label:t.label,type:t.type,isBuiltin:this.isAtomBuiltin(t)})})),this.relations.forEach((t=>{t.tuples.forEach(((e,n)=>{if(e.atoms.length>=2){const i=e.atoms[0],o=e.atoms[e.atoms.length-1],s=e.atoms.slice(1,-1);let a=t.name;if(s.length>0){const e=s.map((t=>{const e=this.atoms.find((e=>e.id===t));return e?e.label:t}));a=`${t.name}[${e.join(", ")}]`}const l=`${t.id}_${n}`;r.setEdge(i,o,a,l)}else if(1===e.atoms.length){const i=e.atoms[0],o=`${t.id}_${n}`;r.setEdge(i,i,t.name,o)}}))})),t||e){const n=[];r.nodes().forEach((i=>{const o=r.inEdges(i)||[],s=r.outEdges(i)||[];if(0===o.length&&0===s.length){const o=r.node(i)?.isBuiltin||!1;(t||o&&e)&&n.push(i)}})),n.forEach((t=>{r.removeNode(t)}))}return r}addAtom(t){if(this.atoms.some((e=>e.id===t.id)))throw new Error(`Atom with ID '${t.id}' already exists`);this.atoms.push(t);let e=this.types.find((e=>e.id===t.type));e||(e={id:t.type,types:[t.type],atoms:[],isBuiltin:!1},this.types.push(e)),e.atoms.push(t),this.emitEvent({type:"atomAdded",data:{atom:t}})}addRelationTuple(t,e){for(const t of e.atoms)if(!this.atoms.some((e=>e.id===t)))throw new Error(`Cannot add tuple: referenced atom '${t}' does not exist`);let r=this.relations.find((e=>e.id===t||e.name===t));if(r){const t=new Set(r.types);for(const n of e.types)t.has(n)||r.types.push(n)}else r={id:t,name:t,types:[...e.types],tuples:[]},this.relations.push(r);r.tuples.push(e),this.emitEvent({type:"relationTupleAdded",data:{relationId:t,tuple:e}})}removeAtom(t){const e=this.atoms.findIndex((e=>e.id===t));if(-1===e)throw new Error(`Cannot remove atom: atom with ID '${t}' not found`);const r=this.atoms[e];this.atoms.splice(e,1);const n=this.types.find((t=>t.id===r.type));n&&(n.atoms=n.atoms.filter((e=>e.id!==t)));for(const e of this.relations)e.tuples=e.tuples.filter((e=>!e.atoms.includes(t)));this.emitEvent({type:"atomRemoved",data:{atomId:t}})}removeRelationTuple(t,e){const r=this.relations.find((e=>e.id===t||e.name===t));if(!r)throw new Error(`Cannot remove tuple: relation '${t}' not found`);const n=r.tuples.length;if(r.tuples=r.tuples.filter((t=>{return n=e,!((r=t).atoms.length===n.atoms.length&&r.atoms.every(((t,e)=>t===n.atoms[e])));var r,n})),r.tuples.length===n)throw new Error(`Tuple not found in relation '${t}'`);this.emitEvent({type:"relationTupleRemoved",data:{relationId:t,tuple:e}})}reify(){return{atoms:[...this.atoms],relations:this.relations.map((t=>({...t,tuples:[...t.tuples]}))),types:this.types.map((t=>({...t,atoms:[...t.atoms]})))}}addFromDataInstance(t,e){if(!t)return!1;const r=new Map;return t.getAtoms().forEach((t=>{const n=this.isAtomBuiltin(t);if(e&&n){const e=this.atoms.find((e=>e.type===t.type&&e.label===t.label));if(e)return void r.set(t.id,e.id)}const i=`atom_${this.atoms.length+1}`;r.set(t.id,i);const o={...t,id:i};this.addAtom(o)})),t.getRelations().forEach((t=>{const e=t.tuples.map((t=>({atoms:t.atoms.map((t=>r.get(t)||t)),types:t.types}))),n=this.relations.find((e=>e.id===t.id||e.name===t.name));if(n){const t=new Set(n.tuples.map((t=>JSON.stringify(t))));e.forEach((e=>{const r=JSON.stringify(e);t.has(r)||(n.tuples.push(e),t.add(r))}))}else this.relations.push({...t,tuples:e})})),t.getTypes().forEach((t=>{const e=this.types.find((e=>e.id===t.id));if(e){const n=new Set(e.atoms.map((t=>t.id)));t.atoms.forEach((t=>{const i=r.get(t.id)||t.id;n.has(i)||(e.atoms.push({...t,id:i}),n.add(i))}))}else this.types.push({...t,atoms:t.atoms.map((t=>({...t,id:r.get(t.id)||t.id})))})})),!0}getErrors(){return[...this.errors]}isValid(){return 0===this.errors.length}getStatistics(){return{atomCount:this.atoms.length,relationCount:this.relations.length,typeCount:this.types.length,tupleCount:this.relations.reduce(((t,e)=>t+e.tuples.length),0),errorCount:this.errors.length,hasBuiltinTypes:this.types.some((t=>t.isBuiltin))}}clone(){return new e(this.reify())}},t.DataInstanceNormalizer=class t{static mergeRelations(t){const e=new Map;for(const r of t){const t=e.get(r.name);if(t){const e=new Set(t.tuples.map((t=>JSON.stringify(t))));for(const n of r.tuples){const r=JSON.stringify(n);e.has(r)||(t.tuples.push(n),e.add(r))}const n=new Set(t.types);for(const e of r.types)n.has(e)||(t.types.push(e),n.add(e))}else e.set(r.name,{id:r.id||r.name,name:r.name,types:[...r.types],tuples:[...r.tuples]})}return Array.from(e.values())}static inferTypes(e){const r=new Map;for(const n of e)r.has(n.type)||r.set(n.type,{id:n.type,types:[n.type],atoms:[],isBuiltin:t.isBuiltinType(n.type)}),r.get(n.type).atoms.push(n);return Array.from(r.values())}static isBuiltinType(t){return new Set(["String","Int","Bool","seq/Int","univ","none","Entity","Object","Node","Edge","Atom"]).has(t)}static deduplicateAtoms(t){const e=new Map,r=new Set;for(const n of t)e.has(n.id)?r.add(n.id):e.set(n.id,n);return r.size>0&&console.warn(`Found duplicate atoms with IDs: ${Array.from(r).join(", ")}`),Array.from(e.values())}static validateReferences(t,e){const r=new Set(t.map((t=>t.id))),n=[];for(const t of e)for(let e=0;e0){const t=n.length;n=this.deduplicateAtoms(n),n.length0){const t=i.length;i=this.mergeRelations(i),i.length0&&(o=this.inferTypes(n),s.push(`Inferred ${o.length} types from atoms`)),r.validateReferences){const t=this.validateReferences(n,i);s.push(...t.errors)}return{atoms:n,relations:i,types:o,errors:s}}}}}),Hg={};d(Hg,{StructuredInputGraph:()=>t.StructuredInputGraph}),t.StructuredInputGraph=void 0;var Bg=c({"src/translators/webcola/structured-input-graph.ts"(){Ug(),Fg(),Nn(),uf(),Oa(),t.StructuredInputGraph=class extends Dg{constructor(e){super(!0),this.evaluator=null,this.layoutInstance=null,this.cndSpecString="",this.controlsContainer=null,this.customTypes=new Set,this.relationAtomPositions=["",""],this.currentConstraintError=null,this.dataInstanceEventHandlers={atomAdded:null,atomRemoved:null,relationTupleAdded:null,relationTupleRemoved:null};const r=e||new t.JSONDataInstance({atoms:[],relations:[]});console.log("StructuredInputGraph initialized with data instance:",r),this.setDataInstance(r),this.initializeStructuredInput(),this.addEventListener("edge-creation-requested",this.handleEdgeCreationRequest.bind(this)),this.addEventListener("edge-modification-requested",this.handleEdgeModificationRequest.bind(this)),this.addEventListener("edge-reconnection-requested",this.handleEdgeReconnectionRequest.bind(this))}static get observedAttributes(){return["cnd-spec","data-instance","show-export"]}attributeChangedCallback(t,e,r){if(e!==r)switch(t){case"cnd-spec":this.parseCnDSpec(r);break;case"data-instance":this.updateDataInstance(r);break;case"show-export":this.updateExportVisibility("true"===r)}}initializeStructuredInput(){requestAnimationFrame((()=>{this.createControlsInterface()}))}createControlsInterface(){if(!this.shadowRoot)return;this.controlsContainer=document.createElement("div"),this.controlsContainer.className="structured-input-controls",this.controlsContainer.innerHTML=this.getControlsHTML();const t=document.createElement("style");t.textContent=this.getControlsCSS(),this.shadowRoot.appendChild(t),this.shadowRoot.appendChild(this.controlsContainer),this.bindControlEvents()}getControlsHTML(){return'\n
\n
\n

Data Editor

\n \n
\n
\n
\n
\n

Atoms

\n \n
\n
\n
\n
\n \n \n or\n \n
\n
\n \n \n ID will be auto-generated\n
\n \n
\n
\n
\n \n
\n
\n

Relations

\n \n
\n
\n
\n
\n \n \n
\n
\n \n
\n
\n \n \n
\n
\n \n
\n
\n
\n \n
\n
\n

Delete

\n \n
\n
\n
\n
\n \n \n \n
\n
\n \n \n \n
\n
\n
\n \n
\n
\n \n
\n
\n

Export

\n \n
\n
\n \n \n
\n
\n \n
\n
\n

Spec Info

\n \n
\n
\n
\n
No spec loaded
\n
\n
\n
\n
\n
\n
\n '}getControlsCSS(){return"\n .structured-input-controls {\n position: absolute;\n top: 12px;\n right: 12px;\n width: 320px;\n background: #ffffff;\n border: 1px solid #d0d7de;\n border-radius: 6px;\n box-shadow: 0 4px 12px rgba(0,0,0,0.1);\n z-index: 1000;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;\n overflow: hidden;\n }\n\n .panel-header {\n background: #0078d4;\n color: white;\n padding: 10px 12px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-bottom: 1px solid rgba(255,255,255,0.1);\n }\n\n .panel-header h3 {\n margin: 0;\n font-size: 14px;\n font-weight: 600;\n }\n\n .toggle-panel, .section-toggle {\n background: rgba(255,255,255,0.2);\n border: none;\n color: white;\n cursor: pointer;\n font-size: 12px;\n padding: 4px 8px;\n border-radius: 3px;\n transition: background 0.2s ease;\n }\n\n .toggle-panel:hover, .section-toggle:hover {\n background: rgba(255,255,255,0.3);\n }\n\n .panel-content {\n padding: 12px;\n max-height: 600px;\n overflow-y: auto;\n overflow-x: hidden;\n }\n\n .panel-content::-webkit-scrollbar {\n width: 8px;\n }\n\n .panel-content::-webkit-scrollbar-track {\n background: #f5f5f5;\n }\n\n .panel-content::-webkit-scrollbar-thumb {\n background: #c1c1c1;\n border-radius: 4px;\n }\n\n .panel-content::-webkit-scrollbar-thumb:hover {\n background: #a8a8a8;\n }\n\n .panel-content.collapsed {\n display: none;\n }\n\n .section-card {\n background: #fafbfc;\n border: 1px solid #d0d7de;\n border-radius: 4px;\n padding: 0;\n margin-bottom: 10px;\n }\n\n .section-card:last-child {\n margin-bottom: 0;\n }\n\n .section-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 8px 10px;\n background: #f6f8fa;\n border-bottom: 1px solid #d0d7de;\n cursor: pointer;\n user-select: none;\n }\n\n .section-header:hover {\n background: #eef2f5;\n }\n\n .section-toggle {\n background: transparent;\n color: #57606a;\n font-size: 10px;\n padding: 2px 6px;\n }\n\n .section-toggle:hover {\n background: rgba(0,0,0,0.05);\n }\n\n .section-content {\n padding: 12px;\n }\n\n .section-content.collapsed {\n display: none;\n }\n\n h4 {\n margin: 0;\n font-size: 13px;\n font-weight: 600;\n color: #24292e;\n }\n\n .atom-form, .relation-form {\n display: flex;\n flex-direction: column;\n gap: 10px;\n }\n\n .form-group {\n display: flex;\n flex-direction: column;\n gap: 4px;\n }\n\n .form-label {\n font-size: 11px;\n font-weight: 600;\n color: #57606a;\n text-transform: uppercase;\n letter-spacing: 0.3px;\n }\n\n .label-divider {\n text-align: center;\n color: #8b949e;\n font-size: 10px;\n font-weight: 500;\n margin: 2px 0;\n }\n\n .form-control {\n padding: 6px 8px;\n border: 1px solid #d0d7de;\n border-radius: 4px;\n font-size: 12px;\n background: white;\n transition: border-color 0.15s ease;\n }\n\n .form-control:focus {\n outline: none;\n border-color: #0078d4;\n box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.1);\n }\n\n .custom-type-input {\n resize: vertical;\n min-height: 60px;\n font-family: 'SF Mono', Monaco, 'Consolas', 'Courier New', monospace;\n font-size: 11px;\n line-height: 1.4;\n }\n\n .form-hint {\n font-size: 10px;\n color: #8b949e;\n font-style: italic;\n }\n\n .btn-primary, .btn-secondary, .btn-danger, .btn-danger-outline {\n padding: 7px 12px;\n border: none;\n border-radius: 4px;\n cursor: pointer;\n font-size: 12px;\n font-weight: 500;\n transition: background-color 0.15s ease;\n width: 100%;\n }\n\n .btn-primary {\n background: #0078d4;\n color: white;\n }\n\n .btn-primary:hover:not(:disabled) {\n background: #106ebe;\n }\n\n .btn-secondary {\n background: #6c757d;\n color: white;\n }\n\n .btn-secondary:hover {\n background: #5a6268;\n }\n\n .btn-danger {\n background: #dc3545;\n color: white;\n }\n\n .btn-danger:hover:not(:disabled) {\n background: #c82333;\n }\n\n .btn-danger-outline {\n background: white;\n color: #dc3545;\n border: 1px solid #dc3545;\n }\n\n .btn-danger-outline:hover {\n background: #dc3545;\n color: white;\n }\n\n .btn-primary:disabled, .btn-danger:disabled {\n background: #e9ecef;\n color: #adb5bd;\n cursor: not-allowed;\n }\n\n .btn-sm {\n padding: 5px 10px;\n font-size: 11px;\n border-radius: 3px;\n border: 1px solid #d0d7de;\n background: white;\n cursor: pointer;\n font-weight: 400;\n transition: background-color 0.15s ease;\n }\n\n .btn-sm:hover:not(:disabled) {\n background: #f6f8fa;\n border-color: #0078d4;\n }\n\n .atom-selector {\n margin-top: 8px;\n }\n\n .atom-checkboxes {\n max-height: 120px;\n overflow-y: auto;\n border: 1px solid #d0d7de;\n border-radius: 6px;\n padding: 8px;\n background: white;\n }\n\n .atom-checkbox-item {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 0;\n font-size: 12px;\n }\n\n .atom-checkbox-item input[type=\"checkbox\"] {\n margin: 0;\n width: 16px;\n height: 16px;\n }\n\n .relation-atoms {\n display: flex;\n flex-direction: column;\n gap: 8px;\n }\n\n .atom-positions {\n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: 8px;\n background: white;\n border: 1px solid #d0d7de;\n border-radius: 4px;\n }\n\n .atom-position {\n display: flex;\n flex-direction: column;\n gap: 4px;\n }\n\n .atom-position label {\n font-size: 10px;\n font-weight: 600;\n color: #57606a;\n }\n\n .atom-position select {\n padding: 5px 8px;\n border: 1px solid #d0d7de;\n border-radius: 3px;\n font-size: 11px;\n background: white;\n }\n\n .arity-controls {\n display: flex;\n gap: 6px;\n }\n\n .arity-display {\n font-weight: 700;\n color: #0078d4;\n }\n\n .deletion-controls {\n display: flex;\n flex-direction: column;\n gap: 10px;\n }\n\n .bulk-delete {\n border-top: 1px solid #d0d7de;\n padding-top: 10px;\n margin-top: 4px;\n }\n\n .export-output {\n width: 100%;\n height: 100px;\n margin-top: 8px;\n padding: 8px;\n border: 1px solid #d0d7de;\n border-radius: 4px;\n font-family: 'SF Mono', Monaco, 'Consolas', 'Courier New', monospace;\n font-size: 10px;\n line-height: 1.4;\n resize: vertical;\n background: #f6f8fa;\n color: #24292e;\n }\n\n .export-output:focus {\n outline: none;\n border-color: #0078d4;\n box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.1);\n }\n\n .spec-status {\n font-size: 11px;\n padding: 6px 8px;\n border-radius: 3px;\n background: #f6f8fa;\n border: 1px solid #d0d7de;\n font-weight: 500;\n }\n\n .spec-status.loaded {\n background: #d4edda;\n border-color: #c3e6cb;\n color: #155724;\n }\n\n .spec-status.error {\n background: #f8d7da;\n border-color: #f5c6cb;\n color: #721c24;\n }\n\n .type-list {\n margin-top: 8px;\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n }\n\n .type-item {\n background: #e7f3ff;\n color: #0969da;\n padding: 3px 8px;\n border-radius: 3px;\n font-size: 10px;\n font-weight: 500;\n border: 1px solid #b6d7f0;\n }\n "}bindControlEvents(){if(!this.controlsContainer)return;const t=this.controlsContainer.querySelector(".toggle-panel"),e=this.controlsContainer.querySelector(".panel-content");t?.addEventListener("click",(()=>{const r=e.classList.contains("collapsed");e.classList.toggle("collapsed"),t.textContent=r?"▲":"▼"})),this.controlsContainer.querySelectorAll(".section-header").forEach((t=>{const e=t.querySelector(".section-toggle"),r=t.closest(".section-card")?.querySelector(".section-content");e&&r&&(t.addEventListener("click",(t=>{if(t.target===e)return;const n=r.classList.contains("collapsed");r.classList.toggle("collapsed"),e.textContent=n?"▲":"▼"})),e.addEventListener("click",(t=>{t.stopPropagation();const n=r.classList.contains("collapsed");r.classList.toggle("collapsed"),e.textContent=n?"▲":"▼"})))}));const r=this.controlsContainer.querySelector(".atom-type-select"),n=this.controlsContainer.querySelector(".custom-type-input"),i=this.controlsContainer.querySelector(".atom-label-input"),o=this.controlsContainer.querySelector(".add-atom-btn"),s=()=>{const t=r.value,e=n.value.trim()||t;o.disabled=!e||!i.value.trim()};r?.addEventListener("change",(()=>{r.value&&"Other..."!==r.value&&(n.value=""),s()})),n?.addEventListener("input",(()=>{n.value.trim()&&(r.value=""),s()})),i?.addEventListener("input",s),o?.addEventListener("click",(async()=>{const t=n.value.trim();let e=t||r.value;if(t){this.customTypes.add(t);const e=Array.from(r.options).find((t=>"Other..."===t.value));if(e&&r.removeChild(e),!Array.from(r.options).find((e=>e.value===t))){const e=document.createElement("option");e.value=t,e.textContent=t,r.appendChild(e)}e&&r.appendChild(e),r.value="",n.value=""}else if(!e)return;await this.addAtomFromForm(e,i.value.trim()),i.value="",s(),this.updateDeletionSelects(),this.updateAtomPositions()}));const a=this.controlsContainer.querySelector(".relation-type-input"),l=this.controlsContainer.querySelector(".add-relation-btn"),u=this.controlsContainer.querySelector(".add-position-btn"),c=this.controlsContainer.querySelector(".remove-position-btn"),h=()=>{const t=this.relationAtomPositions.filter((t=>""!==t.trim())).length>=2,e=a.value.trim();l.disabled=!t||!e};a?.addEventListener("input",h),this.updateAtomPositions(),u?.addEventListener("click",(()=>{this.relationAtomPositions.push(""),this.updateAtomPositions(),h()})),c?.addEventListener("click",(()=>{this.relationAtomPositions.length>2&&(this.relationAtomPositions.pop(),this.updateAtomPositions(),h())})),l?.addEventListener("click",(async()=>{await this.addRelationFromForm(),a.value="",this.relationAtomPositions=["",""],this.updateAtomPositions(),h(),this.updateDeletionSelects()}));const d=this.controlsContainer.querySelector(".atom-delete-select"),p=this.controlsContainer.querySelector(".relation-delete-select"),f=this.controlsContainer.querySelector(".delete-atom-btn"),g=this.controlsContainer.querySelector(".delete-relation-btn"),m=this.controlsContainer.querySelector(".clear-all-btn"),y=()=>{f.disabled=!d.value,g.disabled=!p.value};d?.addEventListener("change",y),p?.addEventListener("change",y),f?.addEventListener("click",(async()=>{await this.deleteAtom(d.value),this.updateDeletionSelects(),this.updateAtomPositions(),y()})),g?.addEventListener("click",(async()=>{await this.deleteRelation(p.value),this.updateDeletionSelects(),y()})),m?.addEventListener("click",(async()=>{await this.clearAllItems(),this.updateDeletionSelects(),this.updateAtomPositions(),y()})),this.controlsContainer.querySelector(".export-json-btn")?.addEventListener("click",(()=>{this.exportDataAsJSON()})),this.updateDeletionSelects()}async handleEdgeCreationRequest(t){console.log("🔗 Handling edge creation request:",t.detail);const{relationId:e,sourceNodeId:r,targetNodeId:n,tuple:i}=t.detail;try{this.dataInstance.addRelationTuple(e,i),console.log(`✅ Added relation to data instance: ${e}(${r}, ${n})`),await this.enforceConstraintsAndRegenerate()}catch(t){console.error("❌ Failed to handle edge creation request:",t)}}async handleEdgeModificationRequest(t){console.log("🔗 Handling edge modification request:",t.detail);const{oldRelationId:e,newRelationId:r,sourceNodeId:n,targetNodeId:i,tuple:o}=t.detail;try{if(r&&""!==r.trim()){if(e.trim()===r.trim())return void console.log("⏭️ Same relation name, no data changes needed");if(e&&e.trim())try{this.dataInstance.removeRelationTuple(e,o),console.log(`🗑️ Removed from ${e}`)}catch(t){const r=t instanceof Error?t.message:String(t);console.log(`⚠️ Could not remove from ${e}: ${r}`)}this.dataInstance.addRelationTuple(r,o),console.log(`➕ Added to ${r}`)}else console.log("🗑️ Deleting edge (empty new relation name)"),e&&e.trim()&&(this.dataInstance.removeRelationTuple(e,o),console.log(`✅ Removed relation tuple from ${e}`));await this.enforceConstraintsAndRegenerate()}catch(t){console.error("❌ Failed to handle edge modification request:",t)}}async handleEdgeReconnectionRequest(t){console.log("🔄 Handling edge reconnection request:",t.detail);const{relationId:e,oldTuple:r,newTuple:n,oldSourceNodeId:i,oldTargetNodeId:o,newSourceNodeId:s,newTargetNodeId:a}=t.detail;try{if(e&&e.trim())try{this.dataInstance.removeRelationTuple(e,r),console.log(`🗑️ Removed old tuple from ${e}: ${i} -> ${o}`)}catch(t){const r=t instanceof Error?t.message:String(t);console.log(`⚠️ Could not remove old tuple from ${e}: ${r}`)}this.dataInstance.addRelationTuple(e,n),console.log(`➕ Added new tuple to ${e}: ${s} -> ${a}`),await this.enforceConstraintsAndRegenerate()}catch(t){console.error("❌ Failed to handle edge reconnection request:",t)}}async parseCnDSpec(t){try{console.log("🔄 Parsing CnD spec and initializing pipeline..."),this.cndSpecString=t,await this.initializeCnDPipeline(t),this.updateTypeSelector(),this.updateSpecInfo(),await this.enforceConstraintsAndRegenerate(),this.dispatchEvent(new CustomEvent("spec-loaded",{detail:{spec:this.cndSpecString}})),console.log("✅ CnD spec parsed and pipeline initialized")}catch(t){console.error("❌ Failed to parse CnD spec:",t),this.updateSpecInfo("error",t instanceof Error?t.message:"Parse error")}}async initializeCnDPipeline(e){if(!e.trim())return console.log("📝 Empty spec - clearing pipeline"),this.evaluator=null,void(this.layoutInstance=null);try{console.log("🔧 Initializing CnD pipeline with spec...");const r=Ea(e);console.log("📋 Layout spec parsed successfully"),this.evaluator=new t.SGraphQueryEvaluator,this.evaluator.initialize({sourceData:this.dataInstance}),console.log("🔍 SGraphQueryEvaluator initialized with data instance"),this.layoutInstance=new t.LayoutInstance(r,this.evaluator,0,!0),console.log("📐 LayoutInstance created"),console.log("✅ CnD pipeline initialized successfully (evaluator + layout instance)")}catch(t){throw console.error("❌ Failed to initialize CnD pipeline:",t),this.evaluator=null,this.layoutInstance=null,t}}async enforceConstraintsAndRegenerate(){console.log("🔄 enforceConstraintsAndRegenerate() called");try{if(!this.layoutInstance)return void console.log("⚠️ Cannot enforce constraints - no layout instance available");console.log("📊 Current data instance state:",{atoms:this.dataInstance.getAtoms().length,relations:this.dataInstance.getRelations().length}),this.evaluator&&(console.log("🔄 Re-initializing evaluator with updated data instance..."),this.evaluator.initialize({sourceData:this.dataInstance}),console.log("✅ Evaluator re-initialized")),console.log("🔧 Generating layout with constraint enforcement...");const t={},e=this.layoutInstance.generateLayout(this.dataInstance,t);e.error?(console.warn("⚠️ Constraint validation error detected:",e.error),this.currentConstraintError=e.error,this.dispatchEvent(new CustomEvent("constraint-error",{detail:{error:e.error,layout:e.layout},bubbles:!0})),console.log("📤 Dispatched constraint-error event with UNSAT core information")):(console.log("✅ Layout generated successfully - all constraints satisfied"),null!==this.currentConstraintError&&(console.log("🧹 Clearing previous constraint error - constraints now satisfied"),this.currentConstraintError=null,this.dispatchEvent(new CustomEvent("constraints-satisfied",{detail:{layout:e.layout},bubbles:!0})),console.log("📤 Dispatched constraints-satisfied event"))),console.log("🎨 Rendering layout..."),await this.renderLayout(e.layout),console.log("✅ Constraints enforced and layout regenerated successfully")}catch(t){console.error("❌ Failed to enforce constraints and regenerate layout:",t),this.dispatchEvent(new CustomEvent("layout-generation-error",{detail:{error:t},bubbles:!0}))}}refreshTypesFromDataInstance(){this.updateTypeSelector()}getAvailableAtomTypes(){const t=new Set;return this.dataInstance&&this.dataInstance.getAtoms().forEach((e=>{e.type&&t.add(e.type)})),0===t.size&&(t.add("Entity"),t.add("Person"),t.add("Object")),Array.from(t)}updateDataInstance(t){try{console.log("Data instance updated:",t)}catch(t){console.error("Failed to update data instance:",t)}}updateExportVisibility(t){const e=this.controlsContainer?.querySelector(".export-section");e&&(e.style.display=t?"block":"none")}updateTypeSelector(){const t=this.controlsContainer?.querySelector(".atom-type-select");if(!t)return;for(;t.children.length>1;)t.removeChild(t.lastChild);this.getAvailableAtomTypes().forEach((e=>{const r=document.createElement("option");r.value=e,r.textContent=e,t.appendChild(r)})),this.customTypes.forEach((e=>{if(!Array.from(t.options).find((t=>t.value===e))){const r=document.createElement("option");r.value=e,r.textContent=e,t.appendChild(r)}}));const e=document.createElement("option");e.value="Other...",e.textContent="Other...",t.appendChild(e)}updateSpecInfo(t="loaded",e){const r=this.controlsContainer?.querySelector(".spec-status"),n=this.controlsContainer?.querySelector(".type-list");if(!r||!n)return;if(r.className=`spec-status ${t}`,"error"===t)return r.textContent=e||"Error loading spec",void(n.innerHTML="");const i=this.getAvailableAtomTypes();r.textContent=`Loaded: ${i.length} atom types available`,n.innerHTML=i.map((t=>`${t}`)).join("")}generateAtomId(t){if(!this.dataInstance)return`${t}-1`;const e=this.dataInstance.getAtoms(),r=new Set(e.map((t=>t.id)));let n=1,i=`${t}-${n}`;for(;r.has(i);)n++,i=`${t}-${n}`;return i}async addAtomFromForm(t,e){if(t&&e)try{console.log(`🔵 Adding atom: ${e} (${t})`);const r={id:this.generateAtomId(t),type:t,label:e};this.dataInstance.addAtom(r),console.log(`✅ Atom added to data instance: ${r.label} (${r.id}:${r.type})`),this.refreshTypesFromDataInstance(),await this.enforceConstraintsAndRegenerate(),this.dispatchEvent(new CustomEvent("atom-added",{detail:{atom:r}})),console.log(`🎉 Atom addition completed: ${r.label} (${r.id}:${r.type})`)}catch(t){console.error("❌ Failed to add atom:",t)}}updateAtomPositions(){if(!this.controlsContainer)return;const t=this.controlsContainer.querySelector(".atom-positions"),e=this.controlsContainer.querySelector(".arity-display"),r=this.controlsContainer.querySelector(".remove-position-btn");if(!t)return;e&&(e.textContent=this.relationAtomPositions.length.toString()),r&&(r.disabled=this.relationAtomPositions.length<=2),t.innerHTML="";const n=this.dataInstance.getAtoms();0!==n.length?this.relationAtomPositions.forEach(((e,r)=>{const i=document.createElement("div");i.className="atom-position";const o=document.createElement("label");o.textContent=`Position ${r+1}:`;const s=document.createElement("select");s.dataset.position=r.toString();const a=document.createElement("option");a.value="",a.textContent="Select Atom",s.appendChild(a),n.forEach((t=>{const r=document.createElement("option");r.value=t.id,r.textContent=`${t.label} (${t.type})`,t.id===e&&(r.selected=!0),s.appendChild(r)})),s.addEventListener("change",(()=>{this.relationAtomPositions[r]=s.value,this.updateRelationButtonState()})),i.appendChild(o),i.appendChild(s),t.appendChild(i)})):t.innerHTML='
No atoms available
'}updateRelationButtonState(){if(!this.controlsContainer)return;const t=this.controlsContainer.querySelector(".relation-type-input"),e=this.controlsContainer.querySelector(".add-relation-btn"),r=this.relationAtomPositions.filter((t=>""!==t.trim())).length>=2,n=t?.value.trim();e&&(e.disabled=!r||!n)}async addRelationFromForm(){if(this.controlsContainer)try{const t=this.controlsContainer.querySelector(".relation-type-input").value.trim();if(!t)return;const e=this.relationAtomPositions.filter((t=>""!==t.trim()));if(e.length<2)return void console.warn("Need at least 2 atoms for a relation");console.log(`🔗 Adding relation: ${t}(${e.join(", ")})`);const r=this.dataInstance.getAtoms(),n=e.map((t=>r.find((e=>e.id===t))?.type||"untyped")),i={atoms:e,types:n};this.dataInstance.addRelationTuple(t,i),console.log(`✅ Relation added to data instance: ${t}(${e.join(", ")})`),await this.enforceConstraintsAndRegenerate(),this.dispatchEvent(new CustomEvent("relation-added",{detail:{relationType:t,tuple:i}})),console.log(`🎉 Relation addition completed: ${t}(${e.join(", ")})`)}catch(t){console.error("❌ Failed to add relation:",t)}}exportDataAsJSON(){try{console.log("📤 Exporting data instance using reify()...");const t=this.dataInstance.reify(),e="string"==typeof t?t:JSON.stringify(t,null,2),r=this.controlsContainer?.querySelector(".export-output");r&&(r.value=e),this.dispatchEvent(new CustomEvent("data-exported",{detail:{data:e,format:"string"==typeof t?"text":"json",reified:t}})),console.log("✅ Data exported using reify()")}catch(t){console.error("❌ Failed to export data:",t)}}handleDataChangeUIUpdate(t=!1){this.refreshTypesFromDataInstance(),this.updateDeletionSelects(),t&&this.updateAtomPositions()}async handleDataDeletionWithValidation(t=!1){this.handleDataChangeUIUpdate(t),await this.enforceConstraintsAndRegenerate()}setDataInstance(t){console.log("🔄 Setting new data instance"),this.dataInstance&&(this.dataInstanceEventHandlers.atomAdded&&this.dataInstance.removeEventListener("atomAdded",this.dataInstanceEventHandlers.atomAdded),this.dataInstanceEventHandlers.atomRemoved&&this.dataInstance.removeEventListener("atomRemoved",this.dataInstanceEventHandlers.atomRemoved),this.dataInstanceEventHandlers.relationTupleAdded&&this.dataInstance.removeEventListener("relationTupleAdded",this.dataInstanceEventHandlers.relationTupleAdded),this.dataInstanceEventHandlers.relationTupleRemoved&&this.dataInstance.removeEventListener("relationTupleRemoved",this.dataInstanceEventHandlers.relationTupleRemoved)),this.dataInstance=t,this.refreshTypesFromDataInstance(),this.dataInstanceEventHandlers.atomAdded=async()=>{console.log("📍 Atom added to instance - updating UI and re-validating constraints"),this.handleDataChangeUIUpdate(!0),await this.enforceConstraintsAndRegenerate()},this.dataInstanceEventHandlers.relationTupleAdded=async()=>{console.log("🔗 Relation added to instance - updating UI and re-validating constraints"),this.handleDataChangeUIUpdate(!1),await this.enforceConstraintsAndRegenerate()},this.dataInstanceEventHandlers.atomRemoved=async()=>{console.log("🗑️ Atom removed from instance - updating UI and re-validating constraints"),await this.handleDataDeletionWithValidation(!0)},this.dataInstanceEventHandlers.relationTupleRemoved=async()=>{console.log("🗑️ Relation tuple removed from instance - updating UI and re-validating constraints"),await this.handleDataDeletionWithValidation(!1)},t.addEventListener("atomAdded",this.dataInstanceEventHandlers.atomAdded),t.addEventListener("relationTupleAdded",this.dataInstanceEventHandlers.relationTupleAdded),t.addEventListener("atomRemoved",this.dataInstanceEventHandlers.atomRemoved),t.addEventListener("relationTupleRemoved",this.dataInstanceEventHandlers.relationTupleRemoved),this.updateDeletionSelects(),this.updateAtomPositions(),console.log("✅ Data instance set successfully")}updateDeletionSelects(){if(!this.controlsContainer)return;const t=this.controlsContainer.querySelector(".atom-delete-select"),e=this.controlsContainer.querySelector(".relation-delete-select");if(t){for(;t.children.length>1;)t.removeChild(t.lastChild);this.dataInstance.getAtoms().forEach((e=>{const r=document.createElement("option");r.value=e.id,r.textContent=`${e.label} (${e.type})`,t.appendChild(r)}))}if(e){for(;e.children.length>1;)e.removeChild(e.lastChild);const t=this.dataInstance.getRelations();let r=0;t.forEach((t=>{t.tuples.forEach((n=>{const i=document.createElement("option");i.value=r.toString();const o=n.atoms.map((t=>{const e=this.dataInstance.getAtoms().find((e=>e.id===t));return e?e.label:t})),s=t.id||t.name||"relation";i.textContent=`${s}: ${o.join(" → ")}`,e.appendChild(i),r++}))}))}}async deleteAtom(t){if(t)try{console.log(`🗑️ Deleting atom: ${t}`);const e=this.dataInstance.getAtoms().find((e=>e.id===t));if(!e)return void console.warn(`⚠️ Atom ${t} not found`);this.dataInstance.removeAtom(t),console.log(`✅ Atom removed from data instance: ${e.label} (${e.id})`),console.log(`🎉 Atom deletion completed: ${e.label} (${e.id})`),this.dispatchEvent(new CustomEvent("atom-deleted",{detail:{atom:e}}))}catch(t){console.error("❌ Failed to delete atom:",t)}}async deleteRelation(t){if(t)try{const e=parseInt(t,10);console.log(`🗑️ Deleting relation tuple at index: ${e}`);const r=this.dataInstance.getRelations();let n=0,i=null,o=null;for(const t of r){for(const r of t.tuples){if(n===e){i=t,o=r;break}n++}if(i)break}if(!i||!o)return void console.warn(`⚠️ Relation tuple at index ${e} not found`);const s=i.id||i.name;console.log(`🗑️ Found tuple in relation "${s}": ${o.atoms.join(" → ")}`),this.dataInstance.removeRelationTuple(s,o),console.log(`✅ Relation tuple removed from data instance: ${s}: ${o.atoms.join(" → ")}`),console.log(`🎉 Relation tuple deletion completed: ${s}: ${o.atoms.join(" → ")}`),this.dispatchEvent(new CustomEvent("relation-tuple-deleted",{detail:{relationId:s,tuple:o}}))}catch(t){console.error("❌ Failed to delete relation tuple:",t)}}async clearAllItems(){try{console.log("🧹 Clearing all atoms and relations...");const e=new t.JSONDataInstance({atoms:[],relations:[],types:[]});this.setDataInstance(e),console.log("✅ All items cleared from data instance"),await this.enforceConstraintsAndRegenerate(),console.log("🎉 Clear all completed"),this.dispatchEvent(new CustomEvent("all-items-cleared",{detail:{}}))}catch(t){console.error("❌ Failed to clear all items:",t)}}getDataInstance(){return this.dataInstance}getCurrentConstraintError(){return this.currentConstraintError}hasConstraintErrors(){return null!==this.currentConstraintError}async setCnDSpec(t){this.setAttribute("cnd-spec",t),await this.parseCnDSpec(t)}getAvailableTypes(){return this.getAvailableAtomTypes()}}}}),zg=h({"node_modules/lodash/lodash.js"(t,e){(function(){var r,n="Expected a function",i="__lodash_hash_undefined__",o="__lodash_placeholder__",s=32,a=128,l=1/0,u=9007199254740991,c=NaN,h=4294967295,d=[["ary",a],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",s],["partialRight",64],["rearg",256]],p="[object Arguments]",f="[object Array]",g="[object Boolean]",m="[object Date]",y="[object Error]",_="[object Function]",v="[object GeneratorFunction]",x="[object Map]",b="[object Number]",T="[object Object]",E="[object Promise]",O="[object RegExp]",S="[object Set]",N="[object String]",w="[object Symbol]",A="[object WeakMap]",C="[object ArrayBuffer]",R="[object DataView]",L="[object Float32Array]",k="[object Float64Array]",I="[object Int8Array]",P="[object Int16Array]",D="[object Int32Array]",j="[object Uint8Array]",M="[object Uint8ClampedArray]",K="[object Uint16Array]",U="[object Uint32Array]",F=/\b__p \+= '';/g,H=/\b(__p \+=) '' \+/g,B=/(__e\(.*?\)|\b__t\)) \+\n'';/g,z=/&(?:amp|lt|gt|quot|#39);/g,q=/[&<>"']/g,G=RegExp(z.source),$=RegExp(q.source),V=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,W=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Q=/^\w*$/,J=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Z=/[\\^$.*+?()[\]{}|]/g,tt=RegExp(Z.source),et=/^\s+/,rt=/\s/,nt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,it=/\{\n\/\* \[wrapped with (.+)\] \*/,ot=/,? & /,st=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,at=/[()=,{}\[\]\/\s]/,lt=/\\(\\)?/g,ut=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ct=/\w*$/,ht=/^[-+]0x[0-9a-f]+$/i,dt=/^0b[01]+$/i,pt=/^\[object .+?Constructor\]$/,ft=/^0o[0-7]+$/i,gt=/^(?:0|[1-9]\d*)$/,mt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,yt=/($^)/,_t=/['\n\r\u2028\u2029\\]/g,vt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",xt="a-z\\xdf-\\xf6\\xf8-\\xff",bt="A-Z\\xc0-\\xd6\\xd8-\\xde",Tt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Et="["+Tt+"]",Ot="["+vt+"]",St="\\d+",Nt="["+xt+"]",wt="[^\\ud800-\\udfff"+Tt+St+"\\u2700-\\u27bf"+xt+bt+"]",At="\\ud83c[\\udffb-\\udfff]",Ct="[^\\ud800-\\udfff]",Rt="(?:\\ud83c[\\udde6-\\uddff]){2}",Lt="[\\ud800-\\udbff][\\udc00-\\udfff]",kt="["+bt+"]",It="(?:"+Nt+"|"+wt+")",Pt="(?:"+kt+"|"+wt+")",Dt="(?:['’](?:d|ll|m|re|s|t|ve))?",jt="(?:['’](?:D|LL|M|RE|S|T|VE))?",Mt="(?:"+Ot+"|"+At+")?",Kt="[\\ufe0e\\ufe0f]?",Ut=Kt+Mt+"(?:\\u200d(?:"+[Ct,Rt,Lt].join("|")+")"+Kt+Mt+")*",Ft="(?:"+["[\\u2700-\\u27bf]",Rt,Lt].join("|")+")"+Ut,Ht="(?:"+[Ct+Ot+"?",Ot,Rt,Lt,"[\\ud800-\\udfff]"].join("|")+")",Bt=RegExp("['’]","g"),zt=RegExp(Ot,"g"),qt=RegExp(At+"(?="+At+")|"+Ht+Ut,"g"),Gt=RegExp([kt+"?"+Nt+"+"+Dt+"(?="+[Et,kt,"$"].join("|")+")",Pt+"+"+jt+"(?="+[Et,kt+It,"$"].join("|")+")",kt+"?"+It+"+"+Dt,kt+"+"+jt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",St,Ft].join("|"),"g"),$t=RegExp("[\\u200d\\ud800-\\udfff"+vt+"\\ufe0e\\ufe0f]"),Vt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Yt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Wt=-1,Xt={};Xt[L]=Xt[k]=Xt[I]=Xt[P]=Xt[D]=Xt[j]=Xt[M]=Xt[K]=Xt[U]=!0,Xt[p]=Xt[f]=Xt[C]=Xt[g]=Xt[R]=Xt[m]=Xt[y]=Xt[_]=Xt[x]=Xt[b]=Xt[T]=Xt[O]=Xt[S]=Xt[N]=Xt[A]=!1;var Qt={};Qt[p]=Qt[f]=Qt[C]=Qt[R]=Qt[g]=Qt[m]=Qt[L]=Qt[k]=Qt[I]=Qt[P]=Qt[D]=Qt[x]=Qt[b]=Qt[T]=Qt[O]=Qt[S]=Qt[N]=Qt[w]=Qt[j]=Qt[M]=Qt[K]=Qt[U]=!0,Qt[y]=Qt[_]=Qt[A]=!1;var Jt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Zt=parseFloat,te=parseInt,ee="object"==typeof globalThis&&globalThis&&globalThis.Object===Object&&globalThis,re="object"==typeof self&&self&&self.Object===Object&&self,ne=ee||re||Function("return this")(),ie="object"==typeof t&&t&&!t.nodeType&&t,oe=ie&&"object"==typeof e&&e&&!e.nodeType&&e,se=oe&&oe.exports===ie,ae=se&&ee.process,le=function(){try{return oe&&oe.require&&oe.require("util").types||ae&&ae.binding&&ae.binding("util")}catch(t){}}(),ue=le&&le.isArrayBuffer,ce=le&&le.isDate,he=le&&le.isMap,de=le&&le.isRegExp,pe=le&&le.isSet,fe=le&&le.isTypedArray;function ge(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function me(t,e,r,n){for(var i=-1,o=null==t?0:t.length;++i-1}function Te(t,e,r){for(var n=-1,i=null==t?0:t.length;++n-1;);return r}function Ge(t,e){for(var r=t.length;r--&&Le(e,t[r],0)>-1;);return r}function $e(t,e){for(var r=t.length,n=0;r--;)t[r]===e&&++n;return n}var Ve=je({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),Ye=je({"&":"&","<":"<",">":">",'"':""","'":"'"});function We(t){return"\\"+Jt[t]}function Xe(t){return $t.test(t)}function Qe(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function Je(t,e){return function(r){return t(e(r))}}function Ze(t,e){for(var r=-1,n=t.length,i=0,s=[];++r",""":'"',"'":"'"}),or=function t(e){var rt,vt=(e=null==e?ne:or.defaults(ne.Object(),e,or.pick(ne,Yt))).Array,xt=e.Date,bt=e.Error,Tt=e.Function,Et=e.Math,Ot=e.Object,St=e.RegExp,Nt=e.String,wt=e.TypeError,At=vt.prototype,Ct=Tt.prototype,Rt=Ot.prototype,Lt=e["__core-js_shared__"],kt=Ct.toString,It=Rt.hasOwnProperty,Pt=0,Dt=(rt=/[^.]+$/.exec(Lt&&Lt.keys&&Lt.keys.IE_PROTO||""))?"Symbol(src)_1."+rt:"",jt=Rt.toString,Mt=kt.call(Ot),Kt=ne._,Ut=St("^"+kt.call(It).replace(Z,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ft=se?e.Buffer:r,Ht=e.Symbol,qt=e.Uint8Array,$t=Ft?Ft.allocUnsafe:r,Jt=Je(Ot.getPrototypeOf,Ot),ee=Ot.create,re=Rt.propertyIsEnumerable,ie=At.splice,oe=Ht?Ht.isConcatSpreadable:r,ae=Ht?Ht.iterator:r,le=Ht?Ht.toStringTag:r,Ae=function(){try{var t=lo(Ot,"defineProperty");return t({},"",{}),t}catch(t){}}(),je=e.clearTimeout!==ne.clearTimeout&&e.clearTimeout,sr=xt&&xt.now!==ne.Date.now&&xt.now,ar=e.setTimeout!==ne.setTimeout&&e.setTimeout,lr=Et.ceil,ur=Et.floor,cr=Ot.getOwnPropertySymbols,hr=Ft?Ft.isBuffer:r,dr=e.isFinite,pr=At.join,fr=Je(Ot.keys,Ot),gr=Et.max,mr=Et.min,yr=xt.now,_r=e.parseInt,vr=Et.random,xr=At.reverse,br=lo(e,"DataView"),Tr=lo(e,"Map"),Er=lo(e,"Promise"),Or=lo(e,"Set"),Sr=lo(e,"WeakMap"),Nr=lo(Ot,"create"),wr=Sr&&new Sr,Ar={},Cr=Uo(br),Rr=Uo(Tr),Lr=Uo(Er),kr=Uo(Or),Ir=Uo(Sr),Pr=Ht?Ht.prototype:r,Dr=Pr?Pr.valueOf:r,jr=Pr?Pr.toString:r;function Mr(t){if(ra(t)&&!Gs(t)&&!(t instanceof Hr)){if(t instanceof Fr)return t;if(It.call(t,"__wrapped__"))return Fo(t)}return new Fr(t)}var Kr=function(){function t(){}return function(e){if(!ea(e))return{};if(ee)return ee(e);t.prototype=e;var n=new t;return t.prototype=r,n}}();function Ur(){}function Fr(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=r}function Hr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=h,this.__views__=[]}function Br(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function sn(t,e,n,i,o,s){var a,l=1&e,u=2&e,c=4&e;if(n&&(a=o?n(t,i,o,s):n(t)),a!==r)return a;if(!ea(t))return t;var h=Gs(t);if(h){if(a=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&It.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!l)return Ni(t,a)}else{var d=ho(t),f=d==_||d==v;if(Ws(t))return xi(t,l);if(d==T||d==p||f&&!o){if(a=u||f?{}:fo(t),!l)return u?function(t,e){return wi(t,co(t),e)}(t,function(t,e){return t&&wi(e,Ia(e),t)}(a,t)):function(t,e){return wi(t,uo(t),e)}(t,en(a,t))}else{if(!Qt[d])return o?t:{};a=function(t,e,r){var n,i=t.constructor;switch(e){case C:return bi(t);case g:case m:return new i(+t);case R:return function(t,e){var r=e?bi(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case L:case k:case I:case P:case D:case j:case M:case K:case U:return Ti(t,r);case x:return new i;case b:case N:return new i(t);case O:return function(t){var e=new t.constructor(t.source,ct.exec(t));return e.lastIndex=t.lastIndex,e}(t);case S:return new i;case w:return n=t,Dr?Ot(Dr.call(n)):{}}}(t,d,l)}}s||(s=new $r);var y=s.get(t);if(y)return y;s.set(t,a),aa(t)?t.forEach((function(r){a.add(sn(r,e,n,r,t,s))})):na(t)&&t.forEach((function(r,i){a.set(i,sn(r,e,n,i,t,s))}));var E=h?r:(c?u?eo:to:u?Ia:ka)(t);return ye(E||t,(function(r,i){E&&(r=t[i=r]),Jr(a,i,sn(r,e,n,i,t,s))})),a}function an(t,e,n){var i=n.length;if(null==t)return!i;for(t=Ot(t);i--;){var o=n[i],s=e[o],a=t[o];if(a===r&&!(o in t)||!s(a))return!1}return!0}function ln(t,e,i){if("function"!=typeof t)throw new wt(n);return Co((function(){t.apply(r,i)}),e)}function un(t,e,r,n){var i=-1,o=be,s=!0,a=t.length,l=[],u=e.length;if(!a)return l;r&&(e=Ee(e,He(r))),n?(o=Te,s=!1):e.length>=200&&(o=ze,s=!1,e=new Gr(e));t:for(;++i-1},zr.prototype.set=function(t,e){var r=this.__data__,n=Zr(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this},qr.prototype.clear=function(){this.size=0,this.__data__={hash:new Br,map:new(Tr||zr),string:new Br}},qr.prototype.delete=function(t){var e=so(this,t).delete(t);return this.size-=e?1:0,e},qr.prototype.get=function(t){return so(this,t).get(t)},qr.prototype.has=function(t){return so(this,t).has(t)},qr.prototype.set=function(t,e){var r=so(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this},Gr.prototype.add=Gr.prototype.push=function(t){return this.__data__.set(t,i),this},Gr.prototype.has=function(t){return this.__data__.has(t)},$r.prototype.clear=function(){this.__data__=new zr,this.size=0},$r.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},$r.prototype.get=function(t){return this.__data__.get(t)},$r.prototype.has=function(t){return this.__data__.has(t)},$r.prototype.set=function(t,e){var r=this.__data__;if(r instanceof zr){var n=r.__data__;if(!Tr||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new qr(n)}return r.set(t,e),this.size=r.size,this};var cn=Ri(_n),hn=Ri(vn,!0);function dn(t,e){var r=!0;return cn(t,(function(t,n,i){return r=!!e(t,n,i)})),r}function pn(t,e,n){for(var i=-1,o=t.length;++i0&&r(a)?e>1?gn(a,e-1,r,n,i):Oe(i,a):n||(i[i.length]=a)}return i}var mn=Li(),yn=Li(!0);function _n(t,e){return t&&mn(t,e,ka)}function vn(t,e){return t&&yn(t,e,ka)}function xn(t,e){return xe(e,(function(e){return Js(t[e])}))}function bn(t,e){for(var n=0,i=(e=mi(e,t)).length;null!=t&&ne}function Sn(t,e){return null!=t&&It.call(t,e)}function Nn(t,e){return null!=t&&e in Ot(t)}function wn(t,e,n){for(var i=n?Te:be,o=t[0].length,s=t.length,a=s,l=vt(s),u=1/0,c=[];a--;){var h=t[a];a&&e&&(h=Ee(h,He(e))),u=mr(h.length,u),l[a]=!n&&(e||o>=120&&h.length>=120)?new Gr(a&&h):r}h=t[0];var d=-1,p=l[0];t:for(;++d=a?l:l*("desc"==r[n]?-1:1)}return t.index-e.index}(t,e,r)}));n--;)t[n]=t[n].value;return t}(jn(t,(function(t,r,i){return{criteria:Ee(e,(function(e){return e(t)})),index:++n,value:t}})))}function Bn(t,e,r){for(var n=-1,i=e.length,o={};++n-1;)a!==t&&ie.call(a,l,1),ie.call(t,l,1);return t}function qn(t,e){for(var r=t?e.length:0,n=r-1;r--;){var i=e[r];if(r==n||i!==o){var o=i;mo(i)?ie.call(t,i,1):li(t,i)}}return t}function Gn(t,e){return t+ur(vr()*(e-t+1))}function $n(t,e){var r="";if(!t||e<1||e>u)return r;do{e%2&&(r+=t),(e=ur(e/2))&&(t+=t)}while(e);return r}function Vn(t,e){return Ro(Oo(t,e,il),t+"")}function Yn(t){return Yr(Ha(t))}function Wn(t,e){var r=Ha(t);return Io(r,on(e,0,r.length))}function Xn(t,e,n,i){if(!ea(t))return t;for(var o=-1,s=(e=mi(e,t)).length,a=s-1,l=t;null!=l&&++oi?0:i+e),(r=r>i?i:r)<0&&(r+=i),i=e>r?0:r-e>>>0,e>>>=0;for(var o=vt(i);++n>>1,s=t[o];null!==s&&!ua(s)&&(r?s<=e:s=200){var u=e?null:$i(t);if(u)return tr(u);s=!1,i=ze,l=new Gr}else l=e?[]:a;t:for(;++n=i?t:ti(t,e,n)}var vi=je||function(t){return ne.clearTimeout(t)};function xi(t,e){if(e)return t.slice();var r=t.length,n=$t?$t(r):new t.constructor(r);return t.copy(n),n}function bi(t){var e=new t.constructor(t.byteLength);return new qt(e).set(new qt(t)),e}function Ti(t,e){var r=e?bi(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function Ei(t,e){if(t!==e){var n=t!==r,i=null===t,o=t==t,s=ua(t),a=e!==r,l=null===e,u=e==e,c=ua(e);if(!l&&!c&&!s&&t>e||s&&a&&u&&!l&&!c||i&&a&&u||!n&&u||!o)return 1;if(!i&&!s&&!c&&t1?n[o-1]:r,a=o>2?n[2]:r;for(s=t.length>3&&"function"==typeof s?(o--,s):r,a&&yo(n[0],n[1],a)&&(s=o<3?r:s,o=1),e=Ot(e);++i-1?o[s?e[a]:a]:r}}function ji(t){return Zi((function(e){var i=e.length,o=i,s=Fr.prototype.thru;for(t&&e.reverse();o--;){var a=e[o];if("function"!=typeof a)throw new wt(n);if(s&&!l&&"wrapper"==no(a))var l=new Fr([],!0)}for(o=l?o:i;++o1&&_.reverse(),d&&cl))return!1;var c=s.get(t),h=s.get(e);if(c&&h)return c==e&&h==t;var d=-1,p=!0,f=2&n?new Gr:r;for(s.set(t,e),s.set(e,t);++d-1&&t%1==0&&t1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(nt,"{\n/* [wrapped with "+e+"] */\n")}(n,function(t,e){return ye(d,(function(r){var n="_."+r[0];e&r[1]&&!be(t,n)&&t.push(n)})),t.sort()}(function(t){var e=t.match(it);return e?e[1].split(ot):[]}(n),r)))}function ko(t){var e=0,n=0;return function(){var i=yr(),o=16-(i-n);if(n=i,o>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(r,arguments)}}function Io(t,e){var n=-1,i=t.length,o=i-1;for(e=e===r?i:e;++n1?t[e-1]:r;return n="function"==typeof n?(t.pop(),n):r,ss(t,n)}));function ps(t){var e=Mr(t);return e.__chain__=!0,e}function fs(t,e){return e(t)}var gs=Zi((function(t){var e=t.length,n=e?t[0]:0,i=this.__wrapped__,o=function(e){return nn(e,t)};return!(e>1||this.__actions__.length)&&i instanceof Hr&&mo(n)?((i=i.slice(n,+n+(e?1:0))).__actions__.push({func:fs,args:[o],thisArg:r}),new Fr(i,this.__chain__).thru((function(t){return e&&!t.length&&t.push(r),t}))):this.thru(o)})),ms=Ai((function(t,e,r){It.call(t,r)?++t[r]:rn(t,r,1)})),ys=Di(qo),_s=Di(Go);function vs(t,e){return(Gs(t)?ye:cn)(t,oo(e,3))}function xs(t,e){return(Gs(t)?_e:hn)(t,oo(e,3))}var bs=Ai((function(t,e,r){It.call(t,r)?t[r].push(e):rn(t,r,[e])})),Ts=Vn((function(t,e,r){var n=-1,i="function"==typeof e,o=Vs(t)?vt(t.length):[];return cn(t,(function(t){o[++n]=i?ge(e,t,r):An(t,e,r)})),o})),Es=Ai((function(t,e,r){rn(t,r,e)}));function Os(t,e){return(Gs(t)?Ee:jn)(t,oo(e,3))}var Ss=Ai((function(t,e,r){t[r?0:1].push(e)}),(function(){return[[],[]]})),Ns=Vn((function(t,e){if(null==t)return[];var r=e.length;return r>1&&yo(t,e[0],e[1])?e=[]:r>2&&yo(e[0],e[1],e[2])&&(e=[e[0]]),Hn(t,gn(e,1),[])})),ws=sr||function(){return ne.Date.now()};function As(t,e,n){return e=n?r:e,e=t&&null==e?t.length:e,Yi(t,a,r,r,r,r,e)}function Cs(t,e){var i;if("function"!=typeof e)throw new wt(n);return t=ga(t),function(){return--t>0&&(i=e.apply(this,arguments)),t<=1&&(e=r),i}}var Rs=Vn((function(t,e,r){var n=1;if(r.length){var i=Ze(r,io(Rs));n|=s}return Yi(t,n,e,r,i)})),Ls=Vn((function(t,e,r){var n=3;if(r.length){var i=Ze(r,io(Ls));n|=s}return Yi(e,n,t,r,i)}));function ks(t,e,i){var o,s,a,l,u,c,h=0,d=!1,p=!1,f=!0;if("function"!=typeof t)throw new wt(n);function g(e){var n=o,i=s;return o=s=r,h=e,l=t.apply(i,n)}function m(t){return h=t,u=Co(_,e),d?g(t):l}function y(t){var n=t-c;return c===r||n>=e||n<0||p&&t-h>=a}function _(){var t=ws();if(y(t))return v(t);u=Co(_,function(t){var r=e-(t-c);return p?mr(r,a-(t-h)):r}(t))}function v(t){return u=r,f&&o?g(t):(o=s=r,l)}function x(){var t=ws(),n=y(t);if(o=arguments,s=this,c=t,n){if(u===r)return m(c);if(p)return vi(u),u=Co(_,e),g(c)}return u===r&&(u=Co(_,e)),l}return e=ya(e)||0,ea(i)&&(d=!!i.leading,a=(p="maxWait"in i)?gr(ya(i.maxWait)||0,e):a,f="trailing"in i?!!i.trailing:f),x.cancel=function(){u!==r&&vi(u),h=0,o=c=s=u=r},x.flush=function(){return u===r?l:v(ws())},x}var Is=Vn((function(t,e){return ln(t,1,e)})),Ps=Vn((function(t,e,r){return ln(t,ya(e)||0,r)}));function Ds(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new wt(n);var r=function(){var n=arguments,i=e?e.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var s=t.apply(this,n);return r.cache=o.set(i,s)||o,s};return r.cache=new(Ds.Cache||qr),r}function js(t){if("function"!=typeof t)throw new wt(n);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Ds.Cache=qr;var Ms=yi((function(t,e){var r=(e=1==e.length&&Gs(e[0])?Ee(e[0],He(oo())):Ee(gn(e,1),He(oo()))).length;return Vn((function(n){for(var i=-1,o=mr(n.length,r);++i=e})),qs=Cn(function(){return arguments}())?Cn:function(t){return ra(t)&&It.call(t,"callee")&&!re.call(t,"callee")},Gs=vt.isArray,$s=ue?He(ue):function(t){return ra(t)&&En(t)==C};function Vs(t){return null!=t&&ta(t.length)&&!Js(t)}function Ys(t){return ra(t)&&Vs(t)}var Ws=hr||yl,Xs=ce?He(ce):function(t){return ra(t)&&En(t)==m};function Qs(t){if(!ra(t))return!1;var e=En(t);return e==y||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!oa(t)}function Js(t){if(!ea(t))return!1;var e=En(t);return e==_||e==v||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Zs(t){return"number"==typeof t&&t==ga(t)}function ta(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=u}function ea(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function ra(t){return null!=t&&"object"==typeof t}var na=he?He(he):function(t){return ra(t)&&ho(t)==x};function ia(t){return"number"==typeof t||ra(t)&&En(t)==b}function oa(t){if(!ra(t)||En(t)!=T)return!1;var e=Jt(t);if(null===e)return!0;var r=It.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&kt.call(r)==Mt}var sa=de?He(de):function(t){return ra(t)&&En(t)==O},aa=pe?He(pe):function(t){return ra(t)&&ho(t)==S};function la(t){return"string"==typeof t||!Gs(t)&&ra(t)&&En(t)==N}function ua(t){return"symbol"==typeof t||ra(t)&&En(t)==w}var ca=fe?He(fe):function(t){return ra(t)&&ta(t.length)&&!!Xt[En(t)]},ha=zi(Dn),da=zi((function(t,e){return t<=e}));function pa(t){if(!t)return[];if(Vs(t))return la(t)?rr(t):Ni(t);if(ae&&t[ae])return function(t){for(var e,r=[];!(e=t.next()).done;)r.push(e.value);return r}(t[ae]());var e=ho(t);return(e==x?Qe:e==S?tr:Ha)(t)}function fa(t){return t?(t=ya(t))===l||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function ga(t){var e=fa(t),r=e%1;return e==e?r?e-r:e:0}function ma(t){return t?on(ga(t),0,h):0}function ya(t){if("number"==typeof t)return t;if(ua(t))return c;if(ea(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=ea(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Fe(t);var r=dt.test(t);return r||ft.test(t)?te(t.slice(2),r?2:8):ht.test(t)?c:+t}function _a(t){return wi(t,Ia(t))}function va(t){return null==t?"":si(t)}var xa=Ci((function(t,e){if(bo(e)||Vs(e))wi(e,ka(e),t);else for(var r in e)It.call(e,r)&&Jr(t,r,e[r])})),ba=Ci((function(t,e){wi(e,Ia(e),t)})),Ta=Ci((function(t,e,r,n){wi(e,Ia(e),t,n)})),Ea=Ci((function(t,e,r,n){wi(e,ka(e),t,n)})),Oa=Zi(nn),Sa=Vn((function(t,e){t=Ot(t);var n=-1,i=e.length,o=i>2?e[2]:r;for(o&&yo(e[0],e[1],o)&&(i=1);++n1),e})),wi(t,eo(t),r),n&&(r=sn(r,7,Qi));for(var i=e.length;i--;)li(r,e[i]);return r})),Ma=Zi((function(t,e){return null==t?{}:function(t,e){return Bn(t,e,(function(e,r){return Aa(t,r)}))}(t,e)}));function Ka(t,e){if(null==t)return{};var r=Ee(eo(t),(function(t){return[t]}));return e=oo(e),Bn(t,r,(function(t,r){return e(t,r[0])}))}var Ua=Vi(ka),Fa=Vi(Ia);function Ha(t){return null==t?[]:Be(t,ka(t))}var Ba=Ii((function(t,e,r){return e=e.toLowerCase(),t+(r?za(e):e)}));function za(t){return Qa(va(t).toLowerCase())}function qa(t){return(t=va(t))&&t.replace(mt,Ve).replace(zt,"")}var Ga=Ii((function(t,e,r){return t+(r?"-":"")+e.toLowerCase()})),$a=Ii((function(t,e,r){return t+(r?" ":"")+e.toLowerCase()})),Va=ki("toLowerCase"),Ya=Ii((function(t,e,r){return t+(r?"_":"")+e.toLowerCase()})),Wa=Ii((function(t,e,r){return t+(r?" ":"")+Qa(e)})),Xa=Ii((function(t,e,r){return t+(r?" ":"")+e.toUpperCase()})),Qa=ki("toUpperCase");function Ja(t,e,n){return t=va(t),(e=n?r:e)===r?function(t){return Vt.test(t)}(t)?function(t){return t.match(Gt)||[]}(t):function(t){return t.match(st)||[]}(t):t.match(e)||[]}var Za=Vn((function(t,e){try{return ge(t,r,e)}catch(t){return Qs(t)?t:new bt(t)}})),tl=Zi((function(t,e){return ye(e,(function(e){e=Ko(e),rn(t,e,Rs(t[e],t))})),t}));function el(t){return function(){return t}}var rl=ji(),nl=ji(!0);function il(t){return t}function ol(t){return In("function"==typeof t?t:sn(t,1))}var sl=Vn((function(t,e){return function(r){return An(r,t,e)}})),al=Vn((function(t,e){return function(r){return An(t,r,e)}}));function ll(t,e,r){var n=ka(e),i=xn(e,n);null!=r||ea(e)&&(i.length||!n.length)||(r=e,e=t,t=this,i=xn(e,ka(e)));var o=!(ea(r)&&"chain"in r&&!r.chain),s=Js(t);return ye(i,(function(r){var n=e[r];t[r]=n,s&&(t.prototype[r]=function(){var e=this.__chain__;if(o||e){var r=t(this.__wrapped__),i=r.__actions__=Ni(this.__actions__);return i.push({func:n,args:arguments,thisArg:t}),r.__chain__=e,r}return n.apply(t,Oe([this.value()],arguments))})})),t}function ul(){}var cl=Fi(Ee),hl=Fi(ve),dl=Fi(we);function pl(t){return _o(t)?De(Ko(t)):function(t){return function(e){return bn(e,t)}}(t)}var fl=Bi(),gl=Bi(!0);function ml(){return[]}function yl(){return!1}var _l,vl=Ui((function(t,e){return t+e}),0),xl=Gi("ceil"),bl=Ui((function(t,e){return t/e}),1),Tl=Gi("floor"),El=Ui((function(t,e){return t*e}),1),Ol=Gi("round"),Sl=Ui((function(t,e){return t-e}),0);return Mr.after=function(t,e){if("function"!=typeof e)throw new wt(n);return t=ga(t),function(){if(--t<1)return e.apply(this,arguments)}},Mr.ary=As,Mr.assign=xa,Mr.assignIn=ba,Mr.assignInWith=Ta,Mr.assignWith=Ea,Mr.at=Oa,Mr.before=Cs,Mr.bind=Rs,Mr.bindAll=tl,Mr.bindKey=Ls,Mr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Gs(t)?t:[t]},Mr.chain=ps,Mr.chunk=function(t,e,n){e=(n?yo(t,e,n):e===r)?1:gr(ga(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var o=0,s=0,a=vt(lr(i/e));oo?0:o+n),(i=i===r||i>o?o:ga(i))<0&&(i+=o),i=n>i?0:ma(i);n>>0)?(t=va(t))&&("string"==typeof e||null!=e&&!sa(e))&&!(e=si(e))&&Xe(t)?_i(rr(t),0,n):t.split(e,n):[]},Mr.spread=function(t,e){if("function"!=typeof t)throw new wt(n);return e=null==e?0:gr(ga(e),0),Vn((function(r){var n=r[e],i=_i(r,0,e);return n&&Oe(i,n),ge(t,this,i)}))},Mr.tail=function(t){var e=null==t?0:t.length;return e?ti(t,1,e):[]},Mr.take=function(t,e,n){return t&&t.length?ti(t,0,(e=n||e===r?1:ga(e))<0?0:e):[]},Mr.takeRight=function(t,e,n){var i=null==t?0:t.length;return i?ti(t,(e=i-(e=n||e===r?1:ga(e)))<0?0:e,i):[]},Mr.takeRightWhile=function(t,e){return t&&t.length?ci(t,oo(e,3),!1,!0):[]},Mr.takeWhile=function(t,e){return t&&t.length?ci(t,oo(e,3)):[]},Mr.tap=function(t,e){return e(t),t},Mr.throttle=function(t,e,r){var i=!0,o=!0;if("function"!=typeof t)throw new wt(n);return ea(r)&&(i="leading"in r?!!r.leading:i,o="trailing"in r?!!r.trailing:o),ks(t,e,{leading:i,maxWait:e,trailing:o})},Mr.thru=fs,Mr.toArray=pa,Mr.toPairs=Ua,Mr.toPairsIn=Fa,Mr.toPath=function(t){return Gs(t)?Ee(t,Ko):ua(t)?[t]:Ni(Mo(va(t)))},Mr.toPlainObject=_a,Mr.transform=function(t,e,r){var n=Gs(t),i=n||Ws(t)||ca(t);if(e=oo(e,4),null==r){var o=t&&t.constructor;r=i?n?new o:[]:ea(t)&&Js(o)?Kr(Jt(t)):{}}return(i?ye:_n)(t,(function(t,n,i){return e(r,t,n,i)})),r},Mr.unary=function(t){return As(t,1)},Mr.union=rs,Mr.unionBy=ns,Mr.unionWith=is,Mr.uniq=function(t){return t&&t.length?ai(t):[]},Mr.uniqBy=function(t,e){return t&&t.length?ai(t,oo(e,2)):[]},Mr.uniqWith=function(t,e){return e="function"==typeof e?e:r,t&&t.length?ai(t,r,e):[]},Mr.unset=function(t,e){return null==t||li(t,e)},Mr.unzip=os,Mr.unzipWith=ss,Mr.update=function(t,e,r){return null==t?t:ui(t,e,gi(r))},Mr.updateWith=function(t,e,n,i){return i="function"==typeof i?i:r,null==t?t:ui(t,e,gi(n),i)},Mr.values=Ha,Mr.valuesIn=function(t){return null==t?[]:Be(t,Ia(t))},Mr.without=as,Mr.words=Ja,Mr.wrap=function(t,e){return Ks(gi(e),t)},Mr.xor=ls,Mr.xorBy=us,Mr.xorWith=cs,Mr.zip=hs,Mr.zipObject=function(t,e){return pi(t||[],e||[],Jr)},Mr.zipObjectDeep=function(t,e){return pi(t||[],e||[],Xn)},Mr.zipWith=ds,Mr.entries=Ua,Mr.entriesIn=Fa,Mr.extend=ba,Mr.extendWith=Ta,ll(Mr,Mr),Mr.add=vl,Mr.attempt=Za,Mr.camelCase=Ba,Mr.capitalize=za,Mr.ceil=xl,Mr.clamp=function(t,e,n){return n===r&&(n=e,e=r),n!==r&&(n=(n=ya(n))==n?n:0),e!==r&&(e=(e=ya(e))==e?e:0),on(ya(t),e,n)},Mr.clone=function(t){return sn(t,4)},Mr.cloneDeep=function(t){return sn(t,5)},Mr.cloneDeepWith=function(t,e){return sn(t,5,e="function"==typeof e?e:r)},Mr.cloneWith=function(t,e){return sn(t,4,e="function"==typeof e?e:r)},Mr.conformsTo=function(t,e){return null==e||an(t,e,ka(e))},Mr.deburr=qa,Mr.defaultTo=function(t,e){return null==t||t!=t?e:t},Mr.divide=bl,Mr.endsWith=function(t,e,n){t=va(t),e=si(e);var i=t.length,o=n=n===r?i:on(ga(n),0,i);return(n-=e.length)>=0&&t.slice(n,o)==e},Mr.eq=Hs,Mr.escape=function(t){return(t=va(t))&&$.test(t)?t.replace(q,Ye):t},Mr.escapeRegExp=function(t){return(t=va(t))&&tt.test(t)?t.replace(Z,"\\$&"):t},Mr.every=function(t,e,n){var i=Gs(t)?ve:dn;return n&&yo(t,e,n)&&(e=r),i(t,oo(e,3))},Mr.find=ys,Mr.findIndex=qo,Mr.findKey=function(t,e){return Ce(t,oo(e,3),_n)},Mr.findLast=_s,Mr.findLastIndex=Go,Mr.findLastKey=function(t,e){return Ce(t,oo(e,3),vn)},Mr.floor=Tl,Mr.forEach=vs,Mr.forEachRight=xs,Mr.forIn=function(t,e){return null==t?t:mn(t,oo(e,3),Ia)},Mr.forInRight=function(t,e){return null==t?t:yn(t,oo(e,3),Ia)},Mr.forOwn=function(t,e){return t&&_n(t,oo(e,3))},Mr.forOwnRight=function(t,e){return t&&vn(t,oo(e,3))},Mr.get=wa,Mr.gt=Bs,Mr.gte=zs,Mr.has=function(t,e){return null!=t&&po(t,e,Sn)},Mr.hasIn=Aa,Mr.head=Vo,Mr.identity=il,Mr.includes=function(t,e,r,n){t=Vs(t)?t:Ha(t),r=r&&!n?ga(r):0;var i=t.length;return r<0&&(r=gr(i+r,0)),la(t)?r<=i&&t.indexOf(e,r)>-1:!!i&&Le(t,e,r)>-1},Mr.indexOf=function(t,e,r){var n=null==t?0:t.length;if(!n)return-1;var i=null==r?0:ga(r);return i<0&&(i=gr(n+i,0)),Le(t,e,i)},Mr.inRange=function(t,e,n){return e=fa(e),n===r?(n=e,e=0):n=fa(n),function(t,e,r){return t>=mr(e,r)&&t=-9007199254740991&&t<=u},Mr.isSet=aa,Mr.isString=la,Mr.isSymbol=ua,Mr.isTypedArray=ca,Mr.isUndefined=function(t){return t===r},Mr.isWeakMap=function(t){return ra(t)&&ho(t)==A},Mr.isWeakSet=function(t){return ra(t)&&"[object WeakSet]"==En(t)},Mr.join=function(t,e){return null==t?"":pr.call(t,e)},Mr.kebabCase=Ga,Mr.last=Qo,Mr.lastIndexOf=function(t,e,n){var i=null==t?0:t.length;if(!i)return-1;var o=i;return n!==r&&(o=(o=ga(n))<0?gr(i+o,0):mr(o,i-1)),e==e?function(t,e,r){for(var n=r+1;n--;)if(t[n]===e)return n;return n}(t,e,o):Re(t,Ie,o,!0)},Mr.lowerCase=$a,Mr.lowerFirst=Va,Mr.lt=ha,Mr.lte=da,Mr.max=function(t){return t&&t.length?pn(t,il,On):r},Mr.maxBy=function(t,e){return t&&t.length?pn(t,oo(e,2),On):r},Mr.mean=function(t){return Pe(t,il)},Mr.meanBy=function(t,e){return Pe(t,oo(e,2))},Mr.min=function(t){return t&&t.length?pn(t,il,Dn):r},Mr.minBy=function(t,e){return t&&t.length?pn(t,oo(e,2),Dn):r},Mr.stubArray=ml,Mr.stubFalse=yl,Mr.stubObject=function(){return{}},Mr.stubString=function(){return""},Mr.stubTrue=function(){return!0},Mr.multiply=El,Mr.nth=function(t,e){return t&&t.length?Fn(t,ga(e)):r},Mr.noConflict=function(){return ne._===this&&(ne._=Kt),this},Mr.noop=ul,Mr.now=ws,Mr.pad=function(t,e,r){t=va(t);var n=(e=ga(e))?er(t):0;if(!e||n>=e)return t;var i=(e-n)/2;return Hi(ur(i),r)+t+Hi(lr(i),r)},Mr.padEnd=function(t,e,r){t=va(t);var n=(e=ga(e))?er(t):0;return e&&ne){var i=t;t=e,e=i}if(n||t%1||e%1){var o=vr();return mr(t+o*(e-t+Zt("1e-"+((o+"").length-1))),e)}return Gn(t,e)},Mr.reduce=function(t,e,r){var n=Gs(t)?Se:Me,i=arguments.length<3;return n(t,oo(e,4),r,i,cn)},Mr.reduceRight=function(t,e,r){var n=Gs(t)?Ne:Me,i=arguments.length<3;return n(t,oo(e,4),r,i,hn)},Mr.repeat=function(t,e,n){return e=(n?yo(t,e,n):e===r)?1:ga(e),$n(va(t),e)},Mr.replace=function(){var t=arguments,e=va(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Mr.result=function(t,e,n){var i=-1,o=(e=mi(e,t)).length;for(o||(o=1,t=r);++iu)return[];var r=h,n=mr(t,h);e=oo(e),t-=h;for(var i=Ue(n,e);++r=s)return t;var l=n-er(i);if(l<1)return i;var u=a?_i(a,0,l).join(""):t.slice(0,l);if(o===r)return u+i;if(a&&(l+=u.length-l),sa(o)){if(t.slice(l).search(o)){var c,h=u;for(o.global||(o=St(o.source,va(ct.exec(o))+"g")),o.lastIndex=0;c=o.exec(h);)var d=c.index;u=u.slice(0,d===r?l:d)}}else if(t.indexOf(si(o),l)!=l){var p=u.lastIndexOf(o);p>-1&&(u=u.slice(0,p))}return u+i},Mr.unescape=function(t){return(t=va(t))&&G.test(t)?t.replace(z,ir):t},Mr.uniqueId=function(t){var e=++Pt;return va(t)+e},Mr.upperCase=Xa,Mr.upperFirst=Qa,Mr.each=vs,Mr.eachRight=xs,Mr.first=Vo,ll(Mr,(_l={},_n(Mr,(function(t,e){It.call(Mr.prototype,e)||(_l[e]=t)})),_l),{chain:!1}),Mr.VERSION="4.17.21",ye(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Mr[t].placeholder=Mr})),ye(["drop","take"],(function(t,e){Hr.prototype[t]=function(n){n=n===r?1:gr(ga(n),0);var i=this.__filtered__&&!e?new Hr(this):this.clone();return i.__filtered__?i.__takeCount__=mr(n,i.__takeCount__):i.__views__.push({size:mr(n,h),type:t+(i.__dir__<0?"Right":"")}),i},Hr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),ye(["filter","map","takeWhile"],(function(t,e){var r=e+1,n=1==r||3==r;Hr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:oo(t,3),type:r}),e.__filtered__=e.__filtered__||n,e}})),ye(["head","last"],(function(t,e){var r="take"+(e?"Right":"");Hr.prototype[t]=function(){return this[r](1).value()[0]}})),ye(["initial","tail"],(function(t,e){var r="drop"+(e?"":"Right");Hr.prototype[t]=function(){return this.__filtered__?new Hr(this):this[r](1)}})),Hr.prototype.compact=function(){return this.filter(il)},Hr.prototype.find=function(t){return this.filter(t).head()},Hr.prototype.findLast=function(t){return this.reverse().find(t)},Hr.prototype.invokeMap=Vn((function(t,e){return"function"==typeof t?new Hr(this):this.map((function(r){return An(r,t,e)}))})),Hr.prototype.reject=function(t){return this.filter(js(oo(t)))},Hr.prototype.slice=function(t,e){t=ga(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Hr(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==r&&(n=(e=ga(e))<0?n.dropRight(-e):n.take(e-t)),n)},Hr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Hr.prototype.toArray=function(){return this.take(h)},_n(Hr.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),i=/^(?:head|last)$/.test(e),o=Mr[i?"take"+("last"==e?"Right":""):e],s=i||/^find/.test(e);o&&(Mr.prototype[e]=function(){var e=this.__wrapped__,a=i?[1]:arguments,l=e instanceof Hr,u=a[0],c=l||Gs(e),h=function(t){var e=o.apply(Mr,Oe([t],a));return i&&d?e[0]:e};c&&n&&"function"==typeof u&&1!=u.length&&(l=c=!1);var d=this.__chain__,p=!!this.__actions__.length,f=s&&!d,g=l&&!p;if(!s&&c){e=g?e:new Hr(this);var m=t.apply(e,a);return m.__actions__.push({func:fs,args:[h],thisArg:r}),new Fr(m,d)}return f&&g?t.apply(this,a):(m=this.thru(h),f?i?m.value()[0]:m.value():m)})})),ye(["pop","push","shift","sort","splice","unshift"],(function(t){var e=At[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",n=/^(?:pop|shift)$/.test(t);Mr.prototype[t]=function(){var t=arguments;if(n&&!this.__chain__){var i=this.value();return e.apply(Gs(i)?i:[],t)}return this[r]((function(r){return e.apply(Gs(r)?r:[],t)}))}})),_n(Hr.prototype,(function(t,e){var r=Mr[e];if(r){var n=r.name+"";It.call(Ar,n)||(Ar[n]=[]),Ar[n].push({name:e,func:r})}})),Ar[Mi(r,2).name]=[{name:"wrapper",func:r}],Hr.prototype.clone=function(){var t=new Hr(this.__wrapped__);return t.__actions__=Ni(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ni(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ni(this.__views__),t},Hr.prototype.reverse=function(){if(this.__filtered__){var t=new Hr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Hr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,r=Gs(t),n=e<0,i=r?t.length:0,o=function(t,e,r){for(var n=-1,i=r.length;++n=this.__values__.length;return{done:t,value:t?r:this.__values__[this.__index__++]}},Mr.prototype.plant=function(t){for(var e,n=this;n instanceof Ur;){var i=Fo(n);i.__index__=0,i.__values__=r,e?o.__wrapped__=i:e=i;var o=i;n=n.__wrapped__}return o.__wrapped__=t,e},Mr.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Hr){var e=t;return this.__actions__.length&&(e=new Hr(this)),(e=e.reverse()).__actions__.push({func:fs,args:[es],thisArg:r}),new Fr(e,this.__chain__)}return this.thru(es)},Mr.prototype.toJSON=Mr.prototype.valueOf=Mr.prototype.value=function(){return hi(this.__wrapped__,this.__actions__)},Mr.prototype.first=Mr.prototype.head,ae&&(Mr.prototype[ae]=function(){return this}),Mr}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(ne._=or,define((function(){return or}))):oe?((oe.exports=or)._=or,ie._=or):ne._=or}).call(t)}}),qg=h({"node_modules/graphlib-dot/lib/lodash.js"(t,e){var r;if(u)try{r=zg()}catch(t){}r||(r=window._),e.exports=r}}),Gg=h({"node_modules/graphlib-dot/lib/dot-grammar.js"(t,e){e.exports=function(){function t(t,e,r,n,i,o){this.message=t,this.expected=e,this.found=r,this.offset=n,this.line=i,this.column=o,this.name="SyntaxError"}return function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(t,Error),{SyntaxError:t,parse:function(e){var r,n=arguments.length>1?arguments[1]:{},i={},o={start:_e,graphStmt:ve},s=_e,a=i,l=null,u="{",c={type:"literal",value:"{",description:'"{"'},h="}",d={type:"literal",value:"}",description:'"}"'},p=function(t,e,r,n){return{type:e,id:r,strict:null!==t,stmts:n}},f=";",g={type:"literal",value:";",description:'";"'},m=function(t,e){for(var r=[t],n=0;n",description:'"->"'},U=function(t,e){var r=[t];if(e)for(var n=0;nt&&(ce=0,he={line:1,column:1,seenCR:!1}),function(t,r,n){var i,o;for(i=r;ide&&(de=ue,pe=[]),pe.push(t))}function ye(r,n,i){var o=ge(i),s=ie.description?1:0}));e1?n.slice(0,-1).join(", ")+" or "+n[t.length-1]:n[0])+" but "+(e?'"'+function(t){function e(t){return t.charCodeAt(0).toString(16).toUpperCase()}return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x07\x0B\x0E\x0F]/g,(function(t){return"\\x0"+e(t)})).replace(/[\x10-\x1F\x80-\xFF]/g,(function(t){return"\\x"+e(t)})).replace(/[\u0180-\u0FFF]/g,(function(t){return"\\u0"+e(t)})).replace(/[\u1080-\uFFFF]/g,(function(t){return"\\u"+e(t)}))}(e)+'"':"end of input")+" found."}(n,s),n,s,i,o.line,o.column)}function _e(){var t,e;if(t=[],(e=ve())!==i)for(;e!==i;)t.push(e),e=ve();else t=a;return t}function ve(){var t,r,n,o,s,f,g,m,y,_,v,x,b,T;for(t=ue,r=[],n=$e();n!==i;)r.push(n),n=$e();if(r!==i)if(n=ue,(o=Be())!==i&&(s=$e())!==i?n=o=[o,s]:(ue=n,n=a),n===i&&(n=l),n!==i)if((o=ze())!==i){for(s=[],f=$e();f!==i;)s.push(f),f=$e();if(s!==i)if((f=je())===i&&(f=l),f!==i){for(g=[],m=$e();m!==i;)g.push(m),m=$e();if(g!==i)if(123===e.charCodeAt(ue)?(m=u,ue++):(m=i,0===fe&&me(c)),m!==i){for(y=[],_=$e();_!==i;)y.push(_),_=$e();if(y!==i)if((_=xe())===i&&(_=l),_!==i){for(v=[],x=$e();x!==i;)v.push(x),x=$e();if(v!==i)if(125===e.charCodeAt(ue)?(x=h,ue++):(x=i,0===fe&&me(d)),x!==i){for(b=[],T=$e();T!==i;)b.push(T),T=$e();b!==i?t=r=p(n,o,f,_):(ue=t,t=a)}else ue=t,t=a;else ue=t,t=a}else ue=t,t=a;else ue=t,t=a}else ue=t,t=a;else ue=t,t=a}else ue=t,t=a;else ue=t,t=a}else ue=t,t=a;else ue=t,t=a;else ue=t,t=a;return t}function xe(){var t,r,n,o,s,u,c,h,d,p;if(t=ue,(r=be())!==i){for(n=[],o=$e();o!==i;)n.push(o),o=$e();if(n!==i)if(59===e.charCodeAt(ue)?(o=f,ue++):(o=i,0===fe&&me(g)),o===i&&(o=l),o!==i){for(s=[],u=ue,c=[],h=$e();h!==i;)c.push(h),h=$e();if(c!==i)if((h=be())!==i){for(d=[],p=$e();p!==i;)d.push(p),p=$e();d!==i?(59===e.charCodeAt(ue)?(p=f,ue++):(p=i,0===fe&&me(g)),p===i&&(p=l),p!==i?u=c=[c,h,d,p]:(ue=u,u=a)):(ue=u,u=a)}else ue=u,u=a;else ue=u,u=a;for(;u!==i;){for(s.push(u),u=ue,c=[],h=$e();h!==i;)c.push(h),h=$e();if(c!==i)if((h=be())!==i){for(d=[],p=$e();p!==i;)d.push(p),p=$e();d!==i?(59===e.charCodeAt(ue)?(p=f,ue++):(p=i,0===fe&&me(g)),p===i&&(p=l),p!==i?u=c=[c,h,d,p]:(ue=u,u=a)):(ue=u,u=a)}else ue=u,u=a;else ue=u,u=a}s!==i?t=r=m(r,s):(ue=t,t=a)}else ue=t,t=a;else ue=t,t=a}else ue=t,t=a;return t}function be(){var t;return(t=Te())===i&&(t=Se())===i&&(t=Ne())===i&&(t=Ee())===i&&(t=Oe()),t}function Te(){var t,e,r,n;if(t=ue,(e=Ue())===i&&(e=Me())===i&&(e=Ke()),e!==i){for(r=[],n=$e();n!==i;)r.push(n),n=$e();r!==i&&(n=we())!==i?t=e=y(e,n):(ue=t,t=a)}else ue=t,t=a;return t}function Ee(){var t,r,n,o,s,l;if(t=ue,(r=je())!==i){for(n=[],o=$e();o!==i;)n.push(o),o=$e();if(n!==i)if(61===e.charCodeAt(ue)?(o=_,ue++):(o=i,0===fe&&me(v)),o!==i){for(s=[],l=$e();l!==i;)s.push(l),l=$e();s!==i&&(l=je())!==i?t=r=x(r,l):(ue=t,t=a)}else ue=t,t=a;else ue=t,t=a}else ue=t,t=a;return t}function Oe(){var t,e,r,n;if(t=ue,(e=Ie())!==i){for(r=[],n=$e();n!==i;)r.push(n),n=$e();r!==i?((n=we())===i&&(n=l),n!==i?t=e=b(e,n):(ue=t,t=a)):(ue=t,t=a)}else ue=t,t=a;return t}function Se(){var t,e,r,n,o,s;if(t=ue,(e=ke())!==i){for(r=[],n=$e();n!==i;)r.push(n),n=$e();if(r!==i)if((n=Re())!==i){for(o=[],s=$e();s!==i;)o.push(s),s=$e();o!==i?((s=we())===i&&(s=l),s!==i?t=e=T(e,n,s):(ue=t,t=a)):(ue=t,t=a)}else ue=t,t=a;else ue=t,t=a}else ue=t,t=a;return t}function Ne(){var t,r,n,o,s,p,f,g;if(t=ue,r=ue,(n=He())!==i){for(o=[],s=$e();s!==i;)o.push(s),s=$e();if(o!==i){if(s=ue,(p=je())!==i){for(f=[],g=$e();g!==i;)f.push(g),g=$e();f!==i?s=p=[p,f]:(ue=s,s=a)}else ue=s,s=a;s===i&&(s=l),s!==i?r=n=[n,o,s]:(ue=r,r=a)}else ue=r,r=a}else ue=r,r=a;if(r===i&&(r=l),r!==i)if(123===e.charCodeAt(ue)?(n=u,ue++):(n=i,0===fe&&me(c)),n!==i){for(o=[],s=$e();s!==i;)o.push(s),s=$e();if(o!==i)if((s=xe())===i&&(s=l),s!==i){for(p=[],f=$e();f!==i;)p.push(f),f=$e();p!==i?(125===e.charCodeAt(ue)?(f=h,ue++):(f=i,0===fe&&me(d)),f!==i?t=r=E(r,s):(ue=t,t=a)):(ue=t,t=a)}else ue=t,t=a;else ue=t,t=a}else ue=t,t=a;else ue=t,t=a;return t}function we(){var t,e,r,n,o,s;if(t=ue,(e=Ae())!==i){for(r=[],n=ue,o=[],s=$e();s!==i;)o.push(s),s=$e();for(o!==i&&(s=Ae())!==i?n=o=[o,s]:(ue=n,n=a);n!==i;){for(r.push(n),n=ue,o=[],s=$e();s!==i;)o.push(s),s=$e();o!==i&&(s=Ae())!==i?n=o=[o,s]:(ue=n,n=a)}r!==i?t=e=O(e,r):(ue=t,t=a)}else ue=t,t=a;return t}function Ae(){var t,r,n,o,s,u;if(t=ue,91===e.charCodeAt(ue)?(r=S,ue++):(r=i,0===fe&&me(N)),r!==i){for(n=[],o=$e();o!==i;)n.push(o),o=$e();if(n!==i)if((o=Ce())===i&&(o=l),o!==i){for(s=[],u=$e();u!==i;)s.push(u),u=$e();s!==i?(93===e.charCodeAt(ue)?(u=w,ue++):(u=i,0===fe&&me(A)),u!==i?t=r=C(o):(ue=t,t=a)):(ue=t,t=a)}else ue=t,t=a;else ue=t,t=a}else ue=t,t=a;return t}function Ce(){var t,r,n,o,s,u,c,h;if(t=ue,(r=Le())!==i){for(n=[],o=ue,s=[],u=$e();u!==i;)s.push(u),u=$e();if(s!==i)if(44===e.charCodeAt(ue)?(u=R,ue++):(u=i,0===fe&&me(L)),u===i&&(u=l),u!==i){for(c=[],h=$e();h!==i;)c.push(h),h=$e();c!==i&&(h=Le())!==i?o=s=[s,u,c,h]:(ue=o,o=a)}else ue=o,o=a;else ue=o,o=a;for(;o!==i;){for(n.push(o),o=ue,s=[],u=$e();u!==i;)s.push(u),u=$e();if(s!==i)if(44===e.charCodeAt(ue)?(u=R,ue++):(u=i,0===fe&&me(L)),u===i&&(u=l),u!==i){for(c=[],h=$e();h!==i;)c.push(h),h=$e();c!==i&&(h=Le())!==i?o=s=[s,u,c,h]:(ue=o,o=a)}else ue=o,o=a;else ue=o,o=a}n!==i?t=r=k(r,n):(ue=t,t=a)}else ue=t,t=a;return t}function Re(){var t,r,n,o,s,u;if(t=ue,r=ue,e.substr(ue,2)===I?(n=I,ue+=2):(n=i,0===fe&&me(P)),n!==i&&(o=(o=D())?a:j)!==i?r=n=[n,o]:(ue=r,r=a),r===i&&(r=ue,e.substr(ue,2)===M?(n=M,ue+=2):(n=i,0===fe&&me(K)),n!==i&&(o=(o=D())?j:a)!==i?r=n=[n,o]:(ue=r,r=a)),r!==i){for(n=[],o=$e();o!==i;)n.push(o),o=$e();if(n!==i)if((o=ke())!==i){for(s=[],u=$e();u!==i;)s.push(u),u=$e();s!==i?((u=Re())===i&&(u=l),u!==i?t=r=U(o,u):(ue=t,t=a)):(ue=t,t=a)}else ue=t,t=a;else ue=t,t=a}else ue=t,t=a;return t}function Le(){var t,r,n,o,s,u,c;if(t=ue,(r=je())!==i){for(n=ue,o=[],s=$e();s!==i;)o.push(s),s=$e();if(o!==i)if(61===e.charCodeAt(ue)?(s=_,ue++):(s=i,0===fe&&me(v)),s!==i){for(u=[],c=$e();c!==i;)u.push(c),c=$e();u!==i&&(c=je())!==i?n=o=[o,s,u,c]:(ue=n,n=a)}else ue=n,n=a;else ue=n,n=a;n===i&&(n=l),n!==i?t=r=F(r,n):(ue=t,t=a)}else ue=t,t=a;return t}function ke(){var t,e;return(t=Ne())===i&&(t=ue,(e=Ie())!==i&&(e=H(e)),t=e),t}function Ie(){var t,e,r,n;if(t=ue,(e=je())!==i){for(r=[],n=$e();n!==i;)r.push(n),n=$e();r!==i?((n=Pe())===i&&(n=l),n!==i?t=e=B(e):(ue=t,t=a)):(ue=t,t=a)}else ue=t,t=a;return t}function Pe(){var t,r,n,o,s,u,c,h,d;if(t=ue,58===e.charCodeAt(ue)?(r=z,ue++):(r=i,0===fe&&me(q)),r!==i){for(n=[],o=$e();o!==i;)n.push(o),o=$e();if(n!==i)if((o=je())!==i){for(s=[],u=$e();u!==i;)s.push(u),u=$e();if(s!==i){if(u=ue,58===e.charCodeAt(ue)?(c=z,ue++):(c=i,0===fe&&me(q)),c!==i){for(h=[],d=$e();d!==i;)h.push(d),d=$e();h!==i&&(d=De())!==i?u=c=[c,h,d]:(ue=u,u=a)}else ue=u,u=a;u===i&&(u=l),u!==i?t=r=[r,n,o,s,u]:(ue=t,t=a)}else ue=t,t=a}else ue=t,t=a;else ue=t,t=a}else ue=t,t=a;return t}function De(){var t;return e.substr(ue,2)===G?(t=G,ue+=2):(t=i,0===fe&&me($)),t===i&&(e.substr(ue,2)===V?(t=V,ue+=2):(t=i,0===fe&&me(Y)),t===i&&(e.substr(ue,2)===W?(t=W,ue+=2):(t=i,0===fe&&me(X)),t===i&&(e.substr(ue,2)===Q?(t=Q,ue+=2):(t=i,0===fe&&me(J)),t===i&&(110===e.charCodeAt(ue)?(t=Z,ue++):(t=i,0===fe&&me(tt)),t===i&&(101===e.charCodeAt(ue)?(t=et,ue++):(t=i,0===fe&&me(rt)),t===i&&(115===e.charCodeAt(ue)?(t=nt,ue++):(t=i,0===fe&&me(it)),t===i&&(119===e.charCodeAt(ue)?(t=ot,ue++):(t=i,0===fe&&me(st)),t===i&&(99===e.charCodeAt(ue)?(t=at,ue++):(t=i,0===fe&&me(lt)),t===i&&(95===e.charCodeAt(ue)?(t=ut,ue++):(t=i,0===fe&&me(ct))))))))))),t}function je(){var t,r,n,o,s,u,c;if(fe++,t=ue,dt.test(e.charAt(ue))?(r=e.charAt(ue),ue++):(r=i,0===fe&&me(pt)),r!==i){for(n=[],ft.test(e.charAt(ue))?(o=e.charAt(ue),ue++):(o=i,0===fe&&me(gt));o!==i;)n.push(o),ft.test(e.charAt(ue))?(o=e.charAt(ue),ue++):(o=i,0===fe&&me(gt));n!==i?t=r=mt(r,n):(ue=t,t=a)}else ue=t,t=a;if(t===i){if(t=ue,45===e.charCodeAt(ue)?(r=yt,ue++):(r=i,0===fe&&me(_t)),r===i&&(r=l),r!==i)if(46===e.charCodeAt(ue)?(n=vt,ue++):(n=i,0===fe&&me(xt)),n!==i){if(o=[],bt.test(e.charAt(ue))?(s=e.charAt(ue),ue++):(s=i,0===fe&&me(Tt)),s!==i)for(;s!==i;)o.push(s),bt.test(e.charAt(ue))?(s=e.charAt(ue),ue++):(s=i,0===fe&&me(Tt));else o=a;o!==i?t=r=Et(r,n,o):(ue=t,t=a)}else ue=t,t=a;else ue=t,t=a;if(t===i){if(t=ue,45===e.charCodeAt(ue)?(r=yt,ue++):(r=i,0===fe&&me(_t)),r===i&&(r=l),r!==i){if(n=[],bt.test(e.charAt(ue))?(o=e.charAt(ue),ue++):(o=i,0===fe&&me(Tt)),o!==i)for(;o!==i;)n.push(o),bt.test(e.charAt(ue))?(o=e.charAt(ue),ue++):(o=i,0===fe&&me(Tt));else n=a;if(n!==i){if(o=ue,46===e.charCodeAt(ue)?(s=vt,ue++):(s=i,0===fe&&me(xt)),s!==i){for(u=[],bt.test(e.charAt(ue))?(c=e.charAt(ue),ue++):(c=i,0===fe&&me(Tt));c!==i;)u.push(c),bt.test(e.charAt(ue))?(c=e.charAt(ue),ue++):(c=i,0===fe&&me(Tt));u!==i?o=s=[s,u]:(ue=o,o=a)}else ue=o,o=a;o===i&&(o=l),o!==i?t=r=Ot(r,n,o):(ue=t,t=a)}else ue=t,t=a}else ue=t,t=a;if(t===i)if(t=ue,34===e.charCodeAt(ue)?(r=St,ue++):(r=i,0===fe&&me(Nt)),r!==i){for(n=[],o=ue,e.substr(ue,2)===wt?(s=wt,ue+=2):(s=i,0===fe&&me(At)),s!==i&&(s=Ct()),(o=s)===i&&(o=ue,92===e.charCodeAt(ue)?(s=Rt,ue++):(s=i,0===fe&&me(Lt)),s!==i?(kt.test(e.charAt(ue))?(u=e.charAt(ue),ue++):(u=i,0===fe&&me(It)),u!==i?o=s=Pt(u):(ue=o,o=a)):(ue=o,o=a),o===i&&(kt.test(e.charAt(ue))?(o=e.charAt(ue),ue++):(o=i,0===fe&&me(It))));o!==i;)n.push(o),o=ue,e.substr(ue,2)===wt?(s=wt,ue+=2):(s=i,0===fe&&me(At)),s!==i&&(s=Ct()),(o=s)===i&&(o=ue,92===e.charCodeAt(ue)?(s=Rt,ue++):(s=i,0===fe&&me(Lt)),s!==i?(kt.test(e.charAt(ue))?(u=e.charAt(ue),ue++):(u=i,0===fe&&me(It)),u!==i?o=s=Pt(u):(ue=o,o=a)):(ue=o,o=a),o===i&&(kt.test(e.charAt(ue))?(o=e.charAt(ue),ue++):(o=i,0===fe&&me(It))));n!==i?(34===e.charCodeAt(ue)?(o=St,ue++):(o=i,0===fe&&me(Nt)),o!==i?t=r=Dt(n):(ue=t,t=a)):(ue=t,t=a)}else ue=t,t=a}}return fe--,t===i&&(r=i,0===fe&&me(ht)),t}function Me(){var t;return e.substr(ue,4).toLowerCase()===jt?(t=e.substr(ue,4),ue+=4):(t=i,0===fe&&me(Mt)),t!==i&&(t=Kt(t)),t}function Ke(){var t;return e.substr(ue,4).toLowerCase()===Ut?(t=e.substr(ue,4),ue+=4):(t=i,0===fe&&me(Ft)),t!==i&&(t=Kt(t)),t}function Ue(){var t;return e.substr(ue,5).toLowerCase()===Ht?(t=e.substr(ue,5),ue+=5):(t=i,0===fe&&me(Bt)),t!==i&&(t=Kt(t)),t}function Fe(){var t;return e.substr(ue,7).toLowerCase()===zt?(t=e.substr(ue,7),ue+=7):(t=i,0===fe&&me(qt)),t!==i&&(t=Kt(t)),t}function He(){var t;return e.substr(ue,8).toLowerCase()===Gt?(t=e.substr(ue,8),ue+=8):(t=i,0===fe&&me($t)),t!==i&&(t=Kt(t)),t}function Be(){var t;return e.substr(ue,6).toLowerCase()===Vt?(t=e.substr(ue,6),ue+=6):(t=i,0===fe&&me(Yt)),t!==i&&(t=Kt(t)),t}function ze(){var t,e;return(t=Ue())===i&&(t=ue,(e=Fe())!==i&&(e=Wt(e)),t=e),t}function qe(){var t,r;if(fe++,t=[],Qt.test(e.charAt(ue))?(r=e.charAt(ue),ue++):(r=i,0===fe&&me(Jt)),r!==i)for(;r!==i;)t.push(r),Qt.test(e.charAt(ue))?(r=e.charAt(ue),ue++):(r=i,0===fe&&me(Jt));else t=a;return fe--,t===i&&(r=i,0===fe&&me(Xt)),t}function Ge(){var t,r,n,o,s,l;if(fe++,t=ue,e.substr(ue,2)===te?(r=te,ue+=2):(r=i,0===fe&&me(ee)),r!==i){for(n=[],re.test(e.charAt(ue))?(o=e.charAt(ue),ue++):(o=i,0===fe&&me(ne));o!==i;)n.push(o),re.test(e.charAt(ue))?(o=e.charAt(ue),ue++):(o=i,0===fe&&me(ne));n!==i?t=r=[r,n]:(ue=t,t=a)}else ue=t,t=a;if(t===i)if(t=ue,e.substr(ue,2)===ie?(r=ie,ue+=2):(r=i,0===fe&&me(oe)),r!==i){for(n=[],o=ue,s=ue,fe++,e.substr(ue,2)===se?(l=se,ue+=2):(l=i,0===fe&&me(ae)),fe--,l===i?s=j:(ue=s,s=a),s!==i?(e.length>ue?(l=e.charAt(ue),ue++):(l=i,0===fe&&me(le)),l!==i?o=s=[s,l]:(ue=o,o=a)):(ue=o,o=a);o!==i;)n.push(o),o=ue,s=ue,fe++,e.substr(ue,2)===se?(l=se,ue+=2):(l=i,0===fe&&me(ae)),fe--,l===i?s=j:(ue=s,s=a),s!==i?(e.length>ue?(l=e.charAt(ue),ue++):(l=i,0===fe&&me(le)),l!==i?o=s=[s,l]:(ue=o,o=a)):(ue=o,o=a);n!==i?(e.substr(ue,2)===se?(o=se,ue+=2):(o=i,0===fe&&me(ae)),o!==i?t=r=[r,n,o]:(ue=t,t=a)):(ue=t,t=a)}else ue=t,t=a;return fe--,t===i&&(r=i,0===fe&&me(Zt)),t}function $e(){var t;return(t=qe())===i&&(t=Ge()),t}var Ve,Ye=qg();if((r=s())!==i&&ue===e.length)return r;throw r!==i&&ue":"--",n=new a;t.isMultigraph()||n.write("strict "),n.writeLine((t.isDirected()?"digraph":"graph")+" {"),n.indent();var l=t.graph();return r.isObject(l)&&r.each(l,(function(t,e){n.writeLine(s(e)+"="+s(t)+";")})),i(t,void 0,n),t.edges().forEach((function(r){!function(t,e,r,n){var i=e.v,a=e.w,l=t.edge(e);n.write(s(i)+" "+r+" "+s(a)),o(l,n),n.writeLine()}(t,r,e,n)})),n.unindent(),n.writeLine("}"),n.toString()};var n=/^[a-zA-Z\200-\377_][a-zA-Z\200-\377_0-9]*$/;function i(t,e,n){var a=t.isCompound()?t.children(e):t.nodes();r.each(a,(function(e){t.isCompound()&&t.children(e).length?(n.writeLine("subgraph "+s(e)+" {"),n.indent(),r.isObject(t.node(e))&&r.map(t.node(e),(function(t,e){n.writeLine(s(e)+"="+s(t)+";")})),i(t,e,n),n.unindent(),n.writeLine("}")):function(t,e,r){r.write(s(e)),o(t.node(e),r),r.writeLine()}(t,e,n)}))}function o(t,e){if(r.isObject(t)){var n=r.map(t,(function(t,e){return s(e)+"="+s(t)}));n.length&&e.write(" ["+n.join(",")+"]")}}function s(t){return"number"==typeof t||t.toString().match(n)?t:'"'+t.toString().replace(/"/g,'\\"')+'"'}function a(){this._indent="",this._content="",this._shouldIndent=!0}a.prototype.INDENT=" ",a.prototype.indent=function(){this._indent+=this.INDENT},a.prototype.unindent=function(){this._indent=this._indent.slice(this.INDENT.length)},a.prototype.writeLine=function(t){this.write((t||"")+"\n"),this._shouldIndent=!0},a.prototype.write=function(t){this._shouldIndent&&(this._shouldIndent=!1,this._content+=this._indent),this._content+=t},a.prototype.toString=function(){return this._content}}}),Qg=h({"node_modules/graphlib-dot/lib/version.js"(t,e){e.exports="0.6.4"}}),Jg=h({"node_modules/graphlib-dot/index.js"(t,e){var r=Yg(),n=Wg(),i=Xg(),o=Qg();e.exports={graphlib:$g(),read:r,readMany:n,write:i,version:o,type:"dot",buffer:!1}}}),Zg=h({"node_modules/react/cjs/react.production.js"(t){var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),a=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),d=Symbol.iterator,p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f=Object.assign,g={};function m(t,e,r){this.props=t,this.context=e,this.refs=g,this.updater=r||p}function y(){}function _(t,e,r){this.props=t,this.context=e,this.refs=g,this.updater=r||p}m.prototype.isReactComponent={},m.prototype.setState=function(t,e){if("object"!=typeof t&&"function"!=typeof t&&null!=t)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")},m.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")},y.prototype=m.prototype;var v=_.prototype=new y;v.constructor=_,f(v,m.prototype),v.isPureReactComponent=!0;var x=Array.isArray,b={H:null,A:null,T:null,S:null,V:null},T=Object.prototype.hasOwnProperty;function E(t,r,n,i,o,s){return n=s.ref,{$$typeof:e,type:t,key:r,ref:void 0!==n?n:null,props:s}}function O(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var S=/\/+/g;function N(t,e){return"object"==typeof t&&null!==t&&null!=t.key?(r=""+t.key,n={"=":"=0",":":"=2"},"$"+r.replace(/[=:]/g,(function(t){return n[t]}))):e.toString(36);var r,n}function w(){}function A(t,n,i,o,s){var a=typeof t;"undefined"!==a&&"boolean"!==a||(t=null);var l,u,c=!1;if(null===t)c=!0;else switch(a){case"bigint":case"string":case"number":c=!0;break;case"object":switch(t.$$typeof){case e:case r:c=!0;break;case h:return A((c=t._init)(t._payload),n,i,o,s)}}if(c)return s=s(t),c=""===o?"."+N(t,0):o,x(s)?(i="",null!=c&&(i=c.replace(S,"$&/")+"/"),A(s,n,i,"",(function(t){return t}))):null!=s&&(O(s)&&(l=s,u=i+(null==s.key||t&&t.key===s.key?"":(""+s.key).replace(S,"$&/")+"/")+c,s=E(l.type,u,void 0,0,0,l.props)),n.push(s)),1;c=0;var p,f=""===o?".":o+":";if(x(t))for(var g=0;g>>1,o=t[n];if(!(0>>1;ni(l,r))ui(c,l)?(t[n]=c,t[u]=r,n=u):(t[n]=l,t[a]=r,n=a);else{if(!(ui(c,r)))break t;t[n]=c,t[u]=r,n=u}}}return e}function i(t,e){var r=t.sortIndex-e.sortIndex;return 0!==r?r:t.id-e.id}var o,s,a;t.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now?(o=performance,t.unstable_now=function(){return o.now()}):(s=Date,a=s.now(),t.unstable_now=function(){return s.now()-a});var l=[],u=[],c=1,h=null,d=3,p=!1,f=!1,g=!1,m=!1,y="function"==typeof setTimeout?setTimeout:null,_="function"==typeof clearTimeout?clearTimeout:null,v="undefined"!=typeof setImmediate?setImmediate:null;function x(t){for(var i=r(u);null!==i;){if(null===i.callback)n(u);else{if(!(i.startTime<=t))break;n(u),i.sortIndex=i.expirationTime,e(l,i)}i=r(u)}}function b(t){if(g=!1,x(t),!f)if(null!==r(l))f=!0,S||(S=!0,T());else{var e=r(u);null!==e&&L(b,e.startTime-t)}}var T,E,O,S=!1,N=-1,w=5,A=-1;function C(){return!(!m&&t.unstable_now()-Ae&&C());){var s=h.callback;if("function"==typeof s){h.callback=null,d=h.priorityLevel;var a=s(h.expirationTime<=e);if(e=t.unstable_now(),"function"==typeof a){h.callback=a,x(e),i=!0;break e}h===r(l)&&n(l),x(e)}else n(l);h=r(l)}if(null!==h)i=!0;else{var c=r(u);null!==c&&L(b,c.startTime-e),i=!1}}break t}finally{h=null,d=o,p=!1}i=void 0}}finally{i?T():S=!1}}}function L(e,r){N=y((function(){e(t.unstable_now())}),r)}"function"==typeof v?T=function(){v(R)}:"undefined"!=typeof MessageChannel?(E=new MessageChannel,O=E.port2,E.port1.onmessage=R,T=function(){O.postMessage(null)}):T=function(){y(R,0)},t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(t){t.callback=null},t.unstable_forceFrameRate=function(t){0>t||125s?(n.sortIndex=o,e(u,n),null===r(l)&&n===r(u)&&(g?(_(N),N=-1):g=!0,L(b,o-s))):(n.sortIndex=a,e(l,n),f||p||(f=!0,S||(S=!0,T()))),n},t.unstable_shouldYield=C,t.unstable_wrapCallback=function(t){var e=d;return function(){var r=d;d=e;try{return t.apply(this,arguments)}finally{d=r}}}}}),im=h({"node_modules/scheduler/index.js"(t,e){e.exports=nm()}}),om=h({"node_modules/react-dom/cjs/react-dom.production.js"(t){var e=tm();function r(t){var e="https://react.dev/errors/"+t;if(1j||(t.current=D[j],D[j]=null,j--)}function U(t,e){j++,D[j]=t.current,t.current=e}var F=M(null),H=M(null),B=M(null),z=M(null);function q(t,e){switch(U(B,e),U(H,t),U(F,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?rh(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)t=nh(e=rh(e),t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}K(F),U(F,t)}function G(){K(F),K(H),K(B)}function $(t){null!==t.memoizedState&&U(z,t);var e=F.current,r=nh(e,t.type);e!==r&&(U(H,t),U(F,r))}function V(t){H.current===t&&(K(F),K(H)),z.current===t&&(K(z),$h._currentValue=P)}var Y=Object.prototype.hasOwnProperty,W=e.unstable_scheduleCallback,X=e.unstable_cancelCallback,Q=e.unstable_shouldYield,J=e.unstable_requestPaint,Z=e.unstable_now,tt=e.unstable_getCurrentPriorityLevel,et=e.unstable_ImmediatePriority,rt=e.unstable_UserBlockingPriority,nt=e.unstable_NormalPriority,it=e.unstable_LowPriority,ot=e.unstable_IdlePriority,st=e.log,at=e.unstable_setDisableYieldValue,lt=null,ut=null;function ct(t){if("function"==typeof st&&at(t),ut&&"function"==typeof ut.setStrictMode)try{ut.setStrictMode(lt,t)}catch(t){}}var ht=Math.clz32?Math.clz32:function(t){return 0==(t>>>=0)?32:31-(dt(t)/pt|0)|0},dt=Math.log,pt=Math.LN2,ft=256,gt=4194304;function mt(t){var e=42&t;if(0!==e)return e;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194048&t;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&t;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function yt(t,e,r){var n=t.pendingLanes;if(0===n)return 0;var i=0,o=t.suspendedLanes,s=t.pingedLanes;t=t.warmLanes;var a=134217727&n;return 0!==a?0!=(n=a&~o)?i=mt(n):0!=(s&=a)?i=mt(s):r||0!=(r=a&~t)&&(i=mt(r)):0!=(a=n&~o)?i=mt(a):0!==s?i=mt(s):r||0!=(r=n&~t)&&(i=mt(r)),0===i?0:0!==e&&e!==i&&0==(e&o)&&((o=i&-i)>=(r=e&-e)||32===o&&0!=(4194048&r))?e:i}function _t(t,e){return 0==(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)}function vt(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;default:return-1}}function xt(){var t=ft;return 0==(4194048&(ft<<=1))&&(ft=256),t}function bt(){var t=gt;return 0==(62914560&(gt<<=1))&&(gt=4194304),t}function Tt(t){for(var e=[],r=0;31>r;r++)e.push(t);return e}function Et(t,e){t.pendingLanes|=e,268435456!==e&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Ot(t,e,r){t.pendingLanes|=e,t.suspendedLanes&=~e;var n=31-ht(e);t.entangledLanes|=e,t.entanglements[n]=1073741824|t.entanglements[n]|4194090&r}function St(t,e){var r=t.entangledLanes|=e;for(t=t.entanglements;r;){var n=31-ht(r),i=1<)":-1--i||l[n]!==u[i]){var c="\n"+l[n].replace(" at new "," at ");return t.displayName&&c.includes("")&&(c=c.replace("",t.displayName)),c}}while(1<=n&&0<=i);break}}}finally{ne=!1,Error.prepareStackTrace=r}return(r=t?t.displayName||t.name:"")?re(r):""}function oe(t){switch(t.tag){case 26:case 27:case 5:return re(t.type);case 16:return re("Lazy");case 13:return re("Suspense");case 19:return re("SuspenseList");case 0:case 15:return ie(t.type,!1);case 11:return ie(t.type.render,!1);case 1:return ie(t.type,!0);case 31:return re("Activity");default:return""}}function se(t){try{var e="";do{e+=oe(t),t=t.return}while(t);return e}catch(t){return"\nError generating stack: "+t.message+"\n"+t.stack}}function ae(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":case"object":return t;default:return""}}function le(t){var e=t.type;return(t=t.nodeName)&&"input"===t.toLowerCase()&&("checkbox"===e||"radio"===e)}function ue(t){t._valueTracker||(t._valueTracker=function(t){var e=le(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&void 0!==r&&"function"==typeof r.get&&"function"==typeof r.set){var i=r.get,o=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(t){n=""+t,o.call(this,t)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(t){n=""+t},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}(t))}function ce(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=le(t)?t.checked?"true":"false":t.value),(t=n)!==r&&(e.setValue(t),!0)}function he(t){if(void 0===(t=t||("undefined"!=typeof document?document:void 0)))return null;try{return t.activeElement||t.body}catch(e){return t.body}}var de=/[\n"\\]/g;function pe(t){return t.replace(de,(function(t){return"\\"+t.charCodeAt(0).toString(16)+" "}))}function fe(t,e,r,n,i,o,s,a){t.name="",null!=s&&"function"!=typeof s&&"symbol"!=typeof s&&"boolean"!=typeof s?t.type=s:t.removeAttribute("type"),null!=e?"number"===s?(0===e&&""===t.value||t.value!=e)&&(t.value=""+ae(e)):t.value!==""+ae(e)&&(t.value=""+ae(e)):"submit"!==s&&"reset"!==s||t.removeAttribute("value"),null!=e?me(t,s,ae(e)):null!=r?me(t,s,ae(r)):null!=n&&t.removeAttribute("value"),null==i&&null!=o&&(t.defaultChecked=!!o),null!=i&&(t.checked=i&&"function"!=typeof i&&"symbol"!=typeof i),null!=a&&"function"!=typeof a&&"symbol"!=typeof a&&"boolean"!=typeof a?t.name=""+ae(a):t.removeAttribute("name")}function ge(t,e,r,n,i,o,s,a){if(null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o&&(t.type=o),null!=e||null!=r){if(("submit"===o||"reset"===o)&&null==e)return;r=null!=r?""+ae(r):"",e=null!=e?""+ae(e):r,a||e===t.value||(t.value=e),t.defaultValue=e}n="function"!=typeof(n=null!=n?n:i)&&"symbol"!=typeof n&&!!n,t.checked=a?t.checked:!!n,t.defaultChecked=!!n,null!=s&&"function"!=typeof s&&"symbol"!=typeof s&&"boolean"!=typeof s&&(t.name=s)}function me(t,e,r){"number"===e&&he(t.ownerDocument)===t||t.defaultValue===""+r||(t.defaultValue=""+r)}function ye(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i=xr),Er=String.fromCharCode(32),Or=!1;function Sr(t,e){switch(t){case"keyup":return-1!==_r.indexOf(e.keyCode);case"keydown":return 229!==e.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Nr(t){return"object"==typeof(t=t.detail)&&"data"in t?t.data:null}var wr=!1,Ar={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Cr(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return"input"===e?!!Ar[t.type]:"textarea"===e}function Rr(t,e,r,n){Re?Le?Le.push(n):Le=[n]:Re=n,0<(e=Bc(e,"onChange")).length&&(r=new Qe("onChange","change",null,r,n),t.push({event:r,listeners:e}))}var Lr=null,kr=null;function Ir(t){Pc(t,0)}function Pr(t){if(ce(Ht(t)))return t}function Dr(t,e){if("change"===t)return e}var jr,Mr,Kr,Ur=!1;function Fr(){Lr&&(Lr.detachEvent("onpropertychange",Hr),kr=Lr=null)}function Hr(t){if("value"===t.propertyName&&Pr(kr)){var e=[];Rr(e,kr,t,Ce(t)),Pe(Ir,e)}}function Br(t,e,r){"focusin"===t?(Fr(),kr=r,(Lr=e).attachEvent("onpropertychange",Hr)):"focusout"===t&&Fr()}function zr(t){if("selectionchange"===t||"keyup"===t||"keydown"===t)return Pr(kr)}function qr(t,e){if("click"===t)return Pr(e)}function Gr(t,e){if("input"===t||"change"===t)return Pr(e)}Me&&(Me?((Mr="oninput"in document)||((Kr=document.createElement("div")).setAttribute("oninput","return;"),Mr="function"==typeof Kr.oninput),jr=Mr):jr=!1,Ur=jr&&(!document.documentMode||9=e)return{node:n,offset:e-t};t=r}t:{for(;n;){if(n.nextSibling){n=n.nextSibling;break t}n=n.parentNode}n=void 0}n=Yr(n)}}function Xr(t,e){return!(!t||!e)&&(t===e||(!t||3!==t.nodeType)&&(e&&3===e.nodeType?Xr(t,e.parentNode):"contains"in t?t.contains(e):!!t.compareDocumentPosition&&!!(16&t.compareDocumentPosition(e))))}function Qr(t){for(var e=he((t=null!=t&&null!=t.ownerDocument&&null!=t.ownerDocument.defaultView?t.ownerDocument.defaultView:window).document);e instanceof t.HTMLIFrameElement;){try{var r="string"==typeof e.contentWindow.location.href}catch(t){r=!1}if(!r)break;e=he((t=e.contentWindow).document)}return e}function Jr(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&("input"===e&&("text"===t.type||"search"===t.type||"tel"===t.type||"url"===t.type||"password"===t.type)||"textarea"===e||"true"===t.contentEditable)}var Zr=Me&&"documentMode"in document&&11>=document.documentMode,tn=null,en=null,rn=null,nn=!1;function on(t,e,r){var n=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;nn||null==tn||tn!==he(n)||(n="selectionStart"in(n=tn)&&Jr(n)?{start:n.selectionStart,end:n.selectionEnd}:{anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},rn&&Vr(rn,n)||(rn=n,0<(n=Bc(en,"onSelect")).length&&(e=new Qe("onSelect","select",null,e,r),t.push({event:e,listeners:n}),e.target=tn)))}function sn(t,e){var r={};return r[t.toLowerCase()]=e.toLowerCase(),r["Webkit"+t]="webkit"+e,r["Moz"+t]="moz"+e,r}var an={animationend:sn("Animation","AnimationEnd"),animationiteration:sn("Animation","AnimationIteration"),animationstart:sn("Animation","AnimationStart"),transitionrun:sn("Transition","TransitionRun"),transitionstart:sn("Transition","TransitionStart"),transitioncancel:sn("Transition","TransitionCancel"),transitionend:sn("Transition","TransitionEnd")},ln={},un={};function cn(t){if(ln[t])return ln[t];if(!an[t])return t;var e,r=an[t];for(e in r)if(r.hasOwnProperty(e)&&e in un)return ln[t]=r[e];return t}Me&&(un=document.createElement("div").style,"AnimationEvent"in window||(delete an.animationend.animation,delete an.animationiteration.animation,delete an.animationstart.animation),"TransitionEvent"in window||delete an.transitionend.transition);var hn=cn("animationend"),dn=cn("animationiteration"),pn=cn("animationstart"),fn=cn("transitionrun"),gn=cn("transitionstart"),mn=cn("transitioncancel"),yn=cn("transitionend"),_n=new Map,vn="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function xn(t,e){_n.set(t,e),$t(e,[t])}vn.push("scrollEnd");var bn=new WeakMap;function Tn(t,e){if("object"==typeof t&&null!==t){var r=bn.get(t);return void 0!==r?r:(e={value:t,source:e,stack:se(e)},bn.set(t,e),e)}return{value:t,source:e,stack:se(e)}}var En=[],On=0,Sn=0;function Nn(){for(var t=On,e=Sn=On=0;e>=s,i-=s,Wn=1<<32-ht(e)+i|r<o?o:8;var s,a,l,u=k.T,c={};k.T=c,Us(t,!1,e,r);try{var h=i(),d=k.S;if(null!==d&&d(c,h),null!==h&&"object"==typeof h&&"function"==typeof h.then){var p=(s=n,a=[],l={status:"pending",value:null,reason:null,then:function(t){a.push(t)}},h.then((function(){l.status="fulfilled",l.value=s;for(var t=0;td?(p=h,h=null):p=h.sibling;var f=m(i,h,a[d],l);if(null===f){null===h&&(h=p);break}t&&h&&null===f.alternate&&e(i,h),o=s(f,o,d),null===c?u=f:c.sibling=f,c=f,h=p}if(d===a.length)return r(i,h),ni&&Qn(i,d),u;if(null===h){for(;dp?(f=d,d=null):f=d.sibling;var v=m(o,d,_.value,u);if(null===v){null===d&&(d=f);break}t&&d&&null===v.alternate&&e(o,d),a=s(v,a,p),null===h?c=v:h.sibling=v,h=v,d=f}if(_.done)return r(o,d),ni&&Qn(o,p),c;if(null===d){for(;!_.done;p++,_=l.next())null!==(_=g(o,_.value,u))&&(a=s(_,a,p),null===h?c=_:h.sibling=_,h=_);return ni&&Qn(o,p),c}for(d=n(d);!_.done;p++,_=l.next())null!==(_=y(d,o,p,_.value,u))&&(t&&null!==_.alternate&&d.delete(null===_.key?p:_.key),a=s(_,a,p),null===h?c=_:h.sibling=_,h=_);return t&&d.forEach((function(t){return e(o,t)})),ni&&Qn(o,p),c}(l,u,c=x.call(c),h)}if("function"==typeof c.then)return _(l,u,Ws(c),h);if(c.$$typeof===v)return _(l,u,Si(l,c),h);Qs(l,c)}return"string"==typeof c&&""!==c||"number"==typeof c||"bigint"==typeof c?(c=""+c,null!==u&&6===u.tag?(r(l,u.sibling),(h=o(u,c)).return=l,l=h):(r(l,u),(h=Fn(c,l.mode,h)).return=l,l=h),a(l)):r(l,u)}return function(t,e,r,n){try{Ys=0;var i=_(t,e,r,n);return Vs=null,i}catch(e){if(e===zi||e===Gi)throw e;var o=Pn(29,e,null,t.mode);return o.lanes=n,o.return=t,o}}}var ta=Zs(!0),ea=Zs(!1),ra=M(null),na=null;function ia(t){var e=t.alternate;U(la,1&la.current),U(ra,t),null===na&&(null===e||null!==ho.current||null!==e.memoizedState)&&(na=t)}function oa(t){if(22===t.tag){if(U(la,la.current),U(ra,t),null===na){var e=t.alternate;null!==e&&null!==e.memoizedState&&(na=t)}}else sa()}function sa(){U(la,la.current),U(ra,ra.current)}function aa(t){K(ra),na===t&&(na=null),K(la)}var la=M(0);function ua(t){for(var e=t;null!==e;){if(13===e.tag){var r=e.memoizedState;if(null!==r&&(null===(r=r.dehydrated)||"$?"===r.data||fh(r)))return e}else if(19===e.tag&&void 0!==e.memoizedProps.revealOrder){if(0!=(128&e.flags))return e}else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break;for(;null===e.sibling;){if(null===e.return||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}function ca(t,e,r,n){r=null==(r=r(n,e=t.memoizedState))?e:c({},e,r),t.memoizedState=r,0===t.lanes&&(t.updateQueue.baseState=r)}var ha={enqueueSetState:function(t,e,r){t=t._reactInternals;var n=ku(),i=ro(n);i.payload=e,null!=r&&(i.callback=r),null!==(e=no(t,i,n))&&(Pu(e,0,n),io(e,t,n))},enqueueReplaceState:function(t,e,r){t=t._reactInternals;var n=ku(),i=ro(n);i.tag=1,i.payload=e,null!=r&&(i.callback=r),null!==(e=no(t,i,n))&&(Pu(e,0,n),io(e,t,n))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var r=ku(),n=ro(r);n.tag=2,null!=e&&(n.callback=e),null!==(e=no(t,n,r))&&(Pu(e,0,r),io(e,t,r))}};function da(t,e,r,n,i,o,s){return"function"==typeof(t=t.stateNode).shouldComponentUpdate?t.shouldComponentUpdate(n,o,s):!(e.prototype&&e.prototype.isPureReactComponent&&Vr(r,n)&&Vr(i,o))}function pa(t,e,r,n){t=e.state,"function"==typeof e.componentWillReceiveProps&&e.componentWillReceiveProps(r,n),"function"==typeof e.UNSAFE_componentWillReceiveProps&&e.UNSAFE_componentWillReceiveProps(r,n),e.state!==t&&ha.enqueueReplaceState(e,e.state,null)}function fa(t,e){var r=e;if("ref"in e)for(var n in r={},e)"ref"!==n&&(r[n]=e[n]);if(t=t.defaultProps)for(var i in r===e&&(r=c({},r)),t)void 0===r[i]&&(r[i]=t[i]);return r}var ga="function"==typeof reportError?reportError:function(t){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof t&&null!==t&&"string"==typeof t.message?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",t);console.error(t)};function ma(t){ga(t)}function ya(t){console.error(t)}function _a(t){ga(t)}function va(t,e){try{(0,t.onUncaughtError)(e.value,{componentStack:e.stack})}catch(t){setTimeout((function(){throw t}))}}function xa(t,e,r){try{(0,t.onCaughtError)(r.value,{componentStack:r.stack,errorBoundary:1===e.tag?e.stateNode:null})}catch(t){setTimeout((function(){throw t}))}}function ba(t,e,r){return(r=ro(r)).tag=3,r.payload={element:null},r.callback=function(){va(t,e)},r}function Ta(t){return(t=ro(t)).tag=3,t}function Ea(t,e,r,n){var i=r.type.getDerivedStateFromError;if("function"==typeof i){var o=n.value;t.payload=function(){return i(o)},t.callback=function(){xa(e,r,n)}}var s=r.stateNode;null!==s&&"function"==typeof s.componentDidCatch&&(t.callback=function(){xa(e,r,n),"function"!=typeof i&&(null===Tu?Tu=new Set([this]):Tu.add(this));var t=n.stack;this.componentDidCatch(n.value,{componentStack:null!==t?t:""})})}var Oa=Error(i(461)),Sa=!1;function Na(t,e,r,n){e.child=null===t?ea(e,null,r,n):ta(e,t.child,r,n)}function wa(t,e,r,n,i){r=r.render;var o=e.ref;if("ref"in n){var s={};for(var a in n)"ref"!==a&&(s[a]=n[a])}else s=n;return Ei(e),n=Ro(t,e,r,s,o,i),a=Po(),null===t||Sa?(ni&&a&&Zn(e),e.flags|=1,Na(t,e,n,i),e.child):(Do(t,e,i),Va(t,e,i))}function Aa(t,e,r,n,i){if(null===t){var o=r.type;return"function"!=typeof o||Dn(o)||void 0!==o.defaultProps||null!==r.compare?((t=Kn(r.type,null,n,e,e.mode,i)).ref=e.ref,t.return=e,e.child=t):(e.tag=15,e.type=o,Ca(t,e,o,n,i))}if(o=t.child,!Ya(t,i)){var s=o.memoizedProps;if((r=null!==(r=r.compare)?r:Vr)(s,n)&&t.ref===e.ref)return Va(t,e,i)}return e.flags|=1,(t=jn(o,n)).ref=e.ref,t.return=e,e.child=t}function Ca(t,e,r,n,i){if(null!==t){var o=t.memoizedProps;if(Vr(o,n)&&t.ref===e.ref){if(Sa=!1,e.pendingProps=n=o,!Ya(t,i))return e.lanes=t.lanes,Va(t,e,i);0!=(131072&t.flags)&&(Sa=!0)}}return Ia(t,e,r,n,i)}function Ra(t,e,r){var n=e.pendingProps,i=n.children,o=null!==t?t.memoizedState:null;if("hidden"===n.mode){if(0!=(128&e.flags)){if(n=null!==o?o.baseLanes|r:r,null!==t){for(i=e.child=t.child,o=0;null!==i;)o=o|i.lanes|i.childLanes,i=i.sibling;e.childLanes=o&~n}else e.childLanes=0,e.child=null;return La(t,e,n,r)}if(0==(536870912&r))return e.lanes=e.childLanes=536870912,La(t,e,null!==o?o.baseLanes|r:r,r);e.memoizedState={baseLanes:0,cachePool:null},null!==t&&Hi(0,null!==o?o.cachePool:null),null!==o?fo(e,o):go(),oa(e)}else null!==o?(Hi(0,o.cachePool),fo(e,o),sa(),e.memoizedState=null):(null!==t&&Hi(0,null),go(),sa());return Na(t,e,i,r),e.child}function La(t,e,r,n){var i=Fi();return i=null===i?null:{parent:Ri._currentValue,pool:i},e.memoizedState={baseLanes:r,cachePool:i},null!==t&&Hi(0,null),go(),oa(e),null!==t&&bi(t,e,n,!0),null}function ka(t,e){var r=e.ref;if(null===r)null!==t&&null!==t.ref&&(e.flags|=4194816);else{if("function"!=typeof r&&"object"!=typeof r)throw Error(i(284));null!==t&&t.ref===r||(e.flags|=4194816)}}function Ia(t,e,r,n,i){return Ei(e),r=Ro(t,e,r,n,void 0,i),n=Po(),null===t||Sa?(ni&&n&&Zn(e),e.flags|=1,Na(t,e,r,i),e.child):(Do(t,e,i),Va(t,e,i))}function Pa(t,e,r,n,i,o){return Ei(e),e.updateQueue=null,r=ko(e,n,r,i),Lo(t),n=Po(),null===t||Sa?(ni&&n&&Zn(e),e.flags|=1,Na(t,e,r,o),e.child):(Do(t,e,o),Va(t,e,o))}function Da(t,e,r,n,i){if(Ei(e),null===e.stateNode){var o=kn,s=r.contextType;"object"==typeof s&&null!==s&&(o=Oi(s)),o=new r(n,o),e.memoizedState=null!==o.state&&void 0!==o.state?o.state:null,o.updater=ha,e.stateNode=o,o._reactInternals=e,(o=e.stateNode).props=n,o.state=e.memoizedState,o.refs={},to(e),s=r.contextType,o.context="object"==typeof s&&null!==s?Oi(s):kn,o.state=e.memoizedState,"function"==typeof(s=r.getDerivedStateFromProps)&&(ca(e,r,s,n),o.state=e.memoizedState),"function"==typeof r.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(s=o.state,"function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),s!==o.state&&ha.enqueueReplaceState(o,o.state,null),lo(e,n,o,i),ao(),o.state=e.memoizedState),"function"==typeof o.componentDidMount&&(e.flags|=4194308),n=!0}else if(null===t){o=e.stateNode;var a=e.memoizedProps,l=fa(r,a);o.props=l;var u=o.context,c=r.contextType;s=kn,"object"==typeof c&&null!==c&&(s=Oi(c));var h=r.getDerivedStateFromProps;c="function"==typeof h||"function"==typeof o.getSnapshotBeforeUpdate,a=e.pendingProps!==a,c||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(a||u!==s)&&pa(e,o,n,s),Zi=!1;var d=e.memoizedState;o.state=d,lo(e,n,o,i),ao(),u=e.memoizedState,a||d!==u||Zi?("function"==typeof h&&(ca(e,r,h,n),u=e.memoizedState),(l=Zi||da(e,r,l,n,d,u,s))?(c||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||("function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount()),"function"==typeof o.componentDidMount&&(e.flags|=4194308)):("function"==typeof o.componentDidMount&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=u),o.props=n,o.state=u,o.context=s,n=l):("function"==typeof o.componentDidMount&&(e.flags|=4194308),n=!1)}else{o=e.stateNode,eo(t,e),c=fa(r,s=e.memoizedProps),o.props=c,h=e.pendingProps,d=o.context,u=r.contextType,l=kn,"object"==typeof u&&null!==u&&(l=Oi(u)),(u="function"==typeof(a=r.getDerivedStateFromProps)||"function"==typeof o.getSnapshotBeforeUpdate)||"function"!=typeof o.UNSAFE_componentWillReceiveProps&&"function"!=typeof o.componentWillReceiveProps||(s!==h||d!==l)&&pa(e,o,n,l),Zi=!1,d=e.memoizedState,o.state=d,lo(e,n,o,i),ao();var p=e.memoizedState;s!==h||d!==p||Zi||null!==t&&null!==t.dependencies&&Ti(t.dependencies)?("function"==typeof a&&(ca(e,r,a,n),p=e.memoizedState),(c=Zi||da(e,r,c,n,d,p,l)||null!==t&&null!==t.dependencies&&Ti(t.dependencies))?(u||"function"!=typeof o.UNSAFE_componentWillUpdate&&"function"!=typeof o.componentWillUpdate||("function"==typeof o.componentWillUpdate&&o.componentWillUpdate(n,p,l),"function"==typeof o.UNSAFE_componentWillUpdate&&o.UNSAFE_componentWillUpdate(n,p,l)),"function"==typeof o.componentDidUpdate&&(e.flags|=4),"function"==typeof o.getSnapshotBeforeUpdate&&(e.flags|=1024)):("function"!=typeof o.componentDidUpdate||s===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||s===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=p),o.props=n,o.state=p,o.context=l,n=c):("function"!=typeof o.componentDidUpdate||s===t.memoizedProps&&d===t.memoizedState||(e.flags|=4),"function"!=typeof o.getSnapshotBeforeUpdate||s===t.memoizedProps&&d===t.memoizedState||(e.flags|=1024),n=!1)}return o=n,ka(t,e),n=0!=(128&e.flags),o||n?(o=e.stateNode,r=n&&"function"!=typeof r.getDerivedStateFromError?null:o.render(),e.flags|=1,null!==t&&n?(e.child=ta(e,t.child,null,i),e.child=ta(e,null,r,i)):Na(t,e,r,i),e.memoizedState=o.state,t=e.child):t=Va(t,e,i),t}function ja(t,e,r,n){return hi(),e.flags|=256,Na(t,e,r,n),e.child}var Ma={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ka(t){return{baseLanes:t,cachePool:Bi()}}function Ua(t,e,r){return t=null!==t?t.childLanes&~r:0,e&&(t|=fu),t}function Fa(t,e,r){var n,o=e.pendingProps,s=!1,a=0!=(128&e.flags);if((n=a)||(n=(null===t||null!==t.memoizedState)&&0!=(2&la.current)),n&&(s=!0,e.flags&=-129),n=0!=(32&e.flags),e.flags&=-33,null===t){if(ni){if(s?ia(e):sa(),ni){var l,u=ri;if(l=u){t:{for(l=u,u=oi;8!==l.nodeType;){if(!u){u=null;break t}if(null===(l=gh(l.nextSibling))){u=null;break t}}u=l}null!==u?(e.memoizedState={dehydrated:u,treeContext:null!==Yn?{id:Wn,overflow:Xn}:null,retryLane:536870912,hydrationErrors:null},(l=Pn(18,null,null,0)).stateNode=u,l.return=e,e.child=l,ei=e,ri=null,l=!0):l=!1}l||ai(e)}if(null!==(u=e.memoizedState)&&null!==(u=u.dehydrated))return fh(u)?e.lanes=32:e.lanes=536870912,null;aa(e)}return u=o.children,o=o.fallback,s?(sa(),u=Ba({mode:"hidden",children:u},s=e.mode),o=Un(o,s,r,null),u.return=e,o.return=e,u.sibling=o,e.child=u,(s=e.child).memoizedState=Ka(r),s.childLanes=Ua(t,n,r),e.memoizedState=Ma,o):(ia(e),Ha(e,u))}if(null!==(l=t.memoizedState)&&null!==(u=l.dehydrated)){if(a)256&e.flags?(ia(e),e.flags&=-257,e=za(t,e,r)):null!==e.memoizedState?(sa(),e.child=t.child,e.flags|=128,e=null):(sa(),s=o.fallback,u=e.mode,o=Ba({mode:"visible",children:o.children},u),(s=Un(s,u,r,null)).flags|=2,o.return=e,s.return=e,o.sibling=s,e.child=o,ta(e,t.child,null,r),(o=e.child).memoizedState=Ka(r),o.childLanes=Ua(t,n,r),e.memoizedState=Ma,e=s);else if(ia(e),fh(u)){if(n=u.nextSibling&&u.nextSibling.dataset)var c=n.dgst;n=c,(o=Error(i(419))).stack="",o.digest=n,pi({value:o,source:null,stack:null}),e=za(t,e,r)}else if(Sa||bi(t,e,r,!1),n=0!=(r&t.childLanes),Sa||n){if(null!==(n=eu)&&0!==(o=0!=((o=0!=(42&(o=r&-r))?1:Nt(o))&(n.suspendedLanes|r))?0:o)&&o!==l.retryLane)throw l.retryLane=o,Cn(t,o),Pu(n,0,o),Oa;"$?"===u.data||Gu(),e=za(t,e,r)}else"$?"===u.data?(e.flags|=192,e.child=t.child,e=null):(t=l.treeContext,ri=gh(u.nextSibling),ei=e,ni=!0,ii=null,oi=!1,null!==t&&($n[Vn++]=Wn,$n[Vn++]=Xn,$n[Vn++]=Yn,Wn=t.id,Xn=t.overflow,Yn=e),(e=Ha(e,o.children)).flags|=4096);return e}return s?(sa(),s=o.fallback,u=e.mode,c=(l=t.child).sibling,(o=jn(l,{mode:"hidden",children:o.children})).subtreeFlags=65011712&l.subtreeFlags,null!==c?s=jn(c,s):(s=Un(s,u,r,null)).flags|=2,s.return=e,o.return=e,o.sibling=s,e.child=o,o=s,s=e.child,null===(u=t.child.memoizedState)?u=Ka(r):(null!==(l=u.cachePool)?(c=Ri._currentValue,l=l.parent!==c?{parent:c,pool:c}:l):l=Bi(),u={baseLanes:u.baseLanes|r,cachePool:l}),s.memoizedState=u,s.childLanes=Ua(t,n,r),e.memoizedState=Ma,o):(ia(e),t=(r=t.child).sibling,(r=jn(r,{mode:"visible",children:o.children})).return=e,r.sibling=null,null!==t&&(null===(n=e.deletions)?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r)}function Ha(t,e){return(e=Ba({mode:"visible",children:e},t.mode)).return=t,t.child=e}function Ba(t,e){return(t=Pn(22,t,null,e)).lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function za(t,e,r){return ta(e,t.child,null,r),(t=Ha(e,e.pendingProps.children)).flags|=2,e.memoizedState=null,t}function qa(t,e,r){t.lanes|=e;var n=t.alternate;null!==n&&(n.lanes|=e),vi(t.return,e,r)}function Ga(t,e,r,n,i){var o=t.memoizedState;null===o?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(o.isBackwards=e,o.rendering=null,o.renderingStartTime=0,o.last=n,o.tail=r,o.tailMode=i)}function $a(t,e,r){var n=e.pendingProps,i=n.revealOrder,o=n.tail;if(Na(t,e,n.children,r),0!=(2&(n=la.current)))n=1&n|2,e.flags|=128;else{if(null!==t&&0!=(128&t.flags))t:for(t=e.child;null!==t;){if(13===t.tag)null!==t.memoizedState&&qa(t,r,e);else if(19===t.tag)qa(t,r,e);else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break t;for(;null===t.sibling;){if(null===t.return||t.return===e)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}n&=1}switch(U(la,n),i){case"forwards":for(r=e.child,i=null;null!==r;)null!==(t=r.alternate)&&null===ua(t)&&(i=r),r=r.sibling;null===(r=i)?(i=e.child,e.child=null):(i=r.sibling,r.sibling=null),Ga(e,!1,i,r,o);break;case"backwards":for(r=null,i=e.child,e.child=null;null!==i;){if(null!==(t=i.alternate)&&null===ua(t)){e.child=i;break}t=i.sibling,i.sibling=r,r=i,i=t}Ga(e,!0,r,null,o);break;case"together":Ga(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Va(t,e,r){if(null!==t&&(e.dependencies=t.dependencies),hu|=e.lanes,0==(r&e.childLanes)){if(null===t)return null;if(bi(t,e,r,!1),0==(r&e.childLanes))return null}if(null!==t&&e.child!==t.child)throw Error(i(153));if(null!==e.child){for(r=jn(t=e.child,t.pendingProps),e.child=r,r.return=e;null!==t.sibling;)t=t.sibling,(r=r.sibling=jn(t,t.pendingProps)).return=e;r.sibling=null}return e.child}function Ya(t,e){return 0!=(t.lanes&e)||!(null===(t=t.dependencies)||!Ti(t))}function Wa(t,e,r){if(null!==t)if(t.memoizedProps!==e.pendingProps)Sa=!0;else{if(!Ya(t,r)&&0==(128&e.flags))return Sa=!1,function(t,e,r){switch(e.tag){case 3:q(e,e.stateNode.containerInfo),yi(0,Ri,t.memoizedState.cache),hi();break;case 27:case 5:$(e);break;case 4:q(e,e.stateNode.containerInfo);break;case 10:yi(0,e.type,e.memoizedProps.value);break;case 13:var n=e.memoizedState;if(null!==n)return null!==n.dehydrated?(ia(e),e.flags|=128,null):0!=(r&e.child.childLanes)?Fa(t,e,r):(ia(e),null!==(t=Va(t,e,r))?t.sibling:null);ia(e);break;case 19:var i=0!=(128&t.flags);if((n=0!=(r&e.childLanes))||(bi(t,e,r,!1),n=0!=(r&e.childLanes)),i){if(n)return $a(t,e,r);e.flags|=128}if(null!==(i=e.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),U(la,la.current),n)break;return null;case 22:case 23:return e.lanes=0,Ra(t,e,r);case 24:yi(0,Ri,t.memoizedState.cache)}return Va(t,e,r)}(t,e,r);Sa=0!=(131072&t.flags)}else Sa=!1,ni&&0!=(1048576&e.flags)&&Jn(e,Gn,e.index);switch(e.lanes=0,e.tag){case 16:t:{t=e.pendingProps;var n=e.elementType,o=n._init;if(n=o(n._payload),e.type=n,"function"!=typeof n){if(null!=n){if((o=n.$$typeof)===x){e.tag=11,e=wa(null,e,n,t,r);break t}if(o===E){e.tag=14,e=Aa(null,e,n,t,r);break t}}throw e=R(n)||n,Error(i(306,e,""))}Dn(n)?(t=fa(n,t),e.tag=1,e=Da(null,e,n,t,r)):(e.tag=0,e=Ia(null,e,n,t,r))}return e;case 0:return Ia(t,e,e.type,e.pendingProps,r);case 1:return Da(t,e,n=e.type,o=fa(n,e.pendingProps),r);case 3:t:{if(q(e,e.stateNode.containerInfo),null===t)throw Error(i(387));n=e.pendingProps;var s=e.memoizedState;o=s.element,eo(t,e),lo(e,n,null,r);var a=e.memoizedState;if(n=a.cache,yi(0,Ri,n),n!==s.cache&&xi(e,[Ri],r,!0),ao(),n=a.element,s.isDehydrated){if(s={element:n,isDehydrated:!1,cache:a.cache},e.updateQueue.baseState=s,e.memoizedState=s,256&e.flags){e=ja(t,e,n,r);break t}if(n!==o){pi(o=Tn(Error(i(424)),e)),e=ja(t,e,n,r);break t}for(t=9===(t=e.stateNode.containerInfo).nodeType?t.body:"HTML"===t.nodeName?t.ownerDocument.body:t,ri=gh(t.firstChild),ei=e,ni=!0,ii=null,oi=!0,r=ea(e,null,n,r),e.child=r;r;)r.flags=-3&r.flags|4096,r=r.sibling}else{if(hi(),n===o){e=Va(t,e,r);break t}Na(t,e,n,r)}e=e.child}return e;case 26:return ka(t,e),null===t?(r=Nh(e.type,null,e.pendingProps,null))?e.memoizedState=r:ni||(r=e.type,t=e.pendingProps,(n=eh(B.current).createElement(r))[Rt]=e,n[Lt]=t,Jc(n,r,t),zt(n),e.stateNode=n):e.memoizedState=Nh(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return $(e),null===t&&ni&&(n=e.stateNode=_h(e.type,e.pendingProps,B.current),ei=e,oi=!0,o=ri,hh(e.type)?(mh=o,ri=gh(n.firstChild)):ri=o),Na(t,e,e.pendingProps.children,r),ka(t,e),null===t&&(e.flags|=4194304),e.child;case 5:return null===t&&ni&&((o=n=ri)&&(null!==(n=function(t,e,r,n){for(;1===t.nodeType;){var i=r;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!n&&("INPUT"!==t.nodeName||"hidden"!==t.type))break}else if(n){if(!t[Mt])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if("stylesheet"===(o=t.getAttribute("rel"))&&t.hasAttribute("data-precedence"))break;if(o!==i.rel||t.getAttribute("href")!==(null==i.href||""===i.href?null:i.href)||t.getAttribute("crossorigin")!==(null==i.crossOrigin?null:i.crossOrigin)||t.getAttribute("title")!==(null==i.title?null:i.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(((o=t.getAttribute("src"))!==(null==i.src?null:i.src)||t.getAttribute("type")!==(null==i.type?null:i.type)||t.getAttribute("crossorigin")!==(null==i.crossOrigin?null:i.crossOrigin))&&o&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else{if("input"!==e||"hidden"!==t.type)return t;var o=null==i.name?null:""+i.name;if("hidden"===i.type&&t.getAttribute("name")===o)return t}if(null===(t=gh(t.nextSibling)))break}return null}(n,e.type,e.pendingProps,oi))?(e.stateNode=n,ei=e,ri=gh(n.firstChild),oi=!1,o=!0):o=!1),o||ai(e)),$(e),o=e.type,s=e.pendingProps,a=null!==t?t.memoizedProps:null,n=s.children,ih(o,s)?n=null:null!==a&&ih(o,a)&&(e.flags|=32),null!==e.memoizedState&&(o=Ro(t,e,Io,null,null,r),$h._currentValue=o),ka(t,e),Na(t,e,n,r),e.child;case 6:return null===t&&ni&&((t=r=ri)&&(null!==(r=function(t,e,r){if(""===e)return null;for(;3!==t.nodeType;){if((1!==t.nodeType||"INPUT"!==t.nodeName||"hidden"!==t.type)&&!r)return null;if(null===(t=gh(t.nextSibling)))return null}return t}(r,e.pendingProps,oi))?(e.stateNode=r,ei=e,ri=null,t=!0):t=!1),t||ai(e)),null;case 13:return Fa(t,e,r);case 4:return q(e,e.stateNode.containerInfo),n=e.pendingProps,null===t?e.child=ta(e,null,n,r):Na(t,e,n,r),e.child;case 11:return wa(t,e,e.type,e.pendingProps,r);case 7:return Na(t,e,e.pendingProps,r),e.child;case 8:case 12:return Na(t,e,e.pendingProps.children,r),e.child;case 10:return n=e.pendingProps,yi(0,e.type,n.value),Na(t,e,n.children,r),e.child;case 9:return o=e.type._context,n=e.pendingProps.children,Ei(e),n=n(o=Oi(o)),e.flags|=1,Na(t,e,n,r),e.child;case 14:return Aa(t,e,e.type,e.pendingProps,r);case 15:return Ca(t,e,e.type,e.pendingProps,r);case 19:return $a(t,e,r);case 31:return n=e.pendingProps,r=e.mode,n={mode:n.mode,children:n.children},null===t?((r=Ba(n,r)).ref=e.ref,e.child=r,r.return=e,e=r):((r=jn(t.child,n)).ref=e.ref,e.child=r,r.return=e,e=r),e;case 22:return Ra(t,e,r);case 24:return Ei(e),n=Oi(Ri),null===t?(null===(o=Fi())&&(o=eu,s=Li(),o.pooledCache=s,s.refCount++,null!==s&&(o.pooledCacheLanes|=r),o=s),e.memoizedState={parent:n,cache:o},to(e),yi(0,Ri,o)):(0!=(t.lanes&r)&&(eo(t,e),lo(e,null,null,r),ao()),o=t.memoizedState,s=e.memoizedState,o.parent!==n?(o={parent:n,cache:n},e.memoizedState=o,0===e.lanes&&(e.memoizedState=e.updateQueue.baseState=o),yi(0,Ri,n)):(n=s.cache,yi(0,Ri,n),n!==o.cache&&xi(e,[Ri],r,!0))),Na(t,e,e.pendingProps.children,r),e.child;case 29:throw e.pendingProps}throw Error(i(156,e.tag))}function Xa(t){t.flags|=4}function Qa(t,e){if("stylesheet"!==e.type||0!=(4&e.state.loading))t.flags&=-16777217;else if(t.flags|=16777216,!Uh(e)){if(null!==(e=ra.current)&&((4194048&nu)===nu?null!==na:(62914560&nu)!==nu&&0==(536870912&nu)||e!==na))throw Xi=$i,qi;t.flags|=8192}}function Ja(t,e){null!==e&&(t.flags|=4),16384&t.flags&&(e=22!==t.tag?bt():536870912,t.lanes|=e,gu|=e)}function Za(t,e){if(!ni)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;null!==e;)null!==e.alternate&&(r=e),e=e.sibling;null===r?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var n=null;null!==r;)null!==r.alternate&&(n=r),r=r.sibling;null===n?e||null===t.tail?t.tail=null:t.tail.sibling=null:n.sibling=null}}function tl(t){var e=null!==t.alternate&&t.alternate.child===t.child,r=0,n=0;if(e)for(var i=t.child;null!==i;)r|=i.lanes|i.childLanes,n|=65011712&i.subtreeFlags,n|=65011712&i.flags,i.return=t,i=i.sibling;else for(i=t.child;null!==i;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=n,t.childLanes=r,e}function el(t,e,r){var n=e.pendingProps;switch(ti(e),e.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 1:return tl(e),null;case 3:return r=e.stateNode,n=null,null!==t&&(n=t.memoizedState.cache),e.memoizedState.cache!==n&&(e.flags|=2048),_i(Ri),G(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==t&&null!==t.child||(ci(e)?Xa(e):null===t||t.memoizedState.isDehydrated&&0==(256&e.flags)||(e.flags|=1024,di())),tl(e),null;case 26:return r=e.memoizedState,null===t?(Xa(e),null!==r?(tl(e),Qa(e,r)):(tl(e),e.flags&=-16777217)):r?r!==t.memoizedState?(Xa(e),tl(e),Qa(e,r)):(tl(e),e.flags&=-16777217):(t.memoizedProps!==n&&Xa(e),tl(e),e.flags&=-16777217),null;case 27:V(e),r=B.current;var o=e.type;if(null!==t&&null!=e.stateNode)t.memoizedProps!==n&&Xa(e);else{if(!n){if(null===e.stateNode)throw Error(i(166));return tl(e),null}t=F.current,ci(e)?li(e):(t=_h(o,n,r),e.stateNode=t,Xa(e))}return tl(e),null;case 5:if(V(e),r=e.type,null!==t&&null!=e.stateNode)t.memoizedProps!==n&&Xa(e);else{if(!n){if(null===e.stateNode)throw Error(i(166));return tl(e),null}if(t=F.current,ci(e))li(e);else{switch(o=eh(B.current),t){case 1:t=o.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:t=o.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":t=o.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":t=o.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":(t=o.createElement("div")).innerHTML="