@astl/astrolabe 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/cdn/astrolabe-editor.js +3 -3
- package/dist/cdn/astrolabe-player.js +1 -1
- package/dist/cdn/astrolabe.js +1 -1
- package/dist/cdn/astrolabe.standalone.js +1084 -1075
- package/dist/cdn/chunks/{audio-B0LSIn5N.js → audio-Biof5aA3.js} +2 -2
- package/dist/cdn/chunks/{audio-B0LSIn5N.js.map → audio-Biof5aA3.js.map} +1 -1
- package/dist/cdn/chunks/{block-styles-CKo9x7Vt.js → block-styles-CCtSFM4j.js} +2 -2
- package/dist/cdn/chunks/{block-styles-CKo9x7Vt.js.map → block-styles-CCtSFM4j.js.map} +1 -1
- package/dist/cdn/chunks/{book-CHzDDaim.js → book-IFipARhv.js} +2 -2
- package/dist/cdn/chunks/{book-CHzDDaim.js.map → book-IFipARhv.js.map} +1 -1
- package/dist/cdn/chunks/{callout-QFLFLPc5.js → callout-CuajbbYY.js} +2 -2
- package/dist/cdn/chunks/{callout-QFLFLPc5.js.map → callout-CuajbbYY.js.map} +1 -1
- package/dist/cdn/chunks/{categorise-BO2tNVJ3.js → categorise-Cm6kXLXw.js} +2 -2
- package/dist/cdn/chunks/{categorise-BO2tNVJ3.js.map → categorise-Cm6kXLXw.js.map} +1 -1
- package/dist/cdn/chunks/{chip-styles-Dme5daTO.js → chip-styles--gboWK2Z.js} +2 -2
- package/dist/cdn/chunks/{chip-styles-Dme5daTO.js.map → chip-styles--gboWK2Z.js.map} +1 -1
- package/dist/cdn/chunks/{choice-CExBvqKj.js → choice-BSpB6LHl.js} +2 -2
- package/dist/cdn/chunks/{choice-CExBvqKj.js.map → choice-BSpB6LHl.js.map} +1 -1
- package/dist/cdn/chunks/{color-control-Cl5cuMSO.js → color-control-1kkdM8ns.js} +2 -2
- package/dist/cdn/chunks/{color-control-Cl5cuMSO.js.map → color-control-1kkdM8ns.js.map} +1 -1
- package/dist/cdn/chunks/{crossword-Cb-a3Tjj.js → crossword-BdOAEPcL.js} +2 -2
- package/dist/cdn/chunks/{crossword-Cb-a3Tjj.js.map → crossword-BdOAEPcL.js.map} +1 -1
- package/dist/cdn/chunks/{definitions-CNX90WtL.js → definitions-BybSa1mq.js} +2 -2
- package/dist/cdn/chunks/{definitions-CNX90WtL.js.map → definitions-BybSa1mq.js.map} +1 -1
- package/dist/cdn/chunks/{directive-helpers-D7lOZKnB.js → directive-helpers-US6zRjJ1.js} +2 -2
- package/dist/cdn/chunks/{directive-helpers-D7lOZKnB.js.map → directive-helpers-US6zRjJ1.js.map} +1 -1
- package/dist/cdn/chunks/{drop-vRXndjHu.js → drop-D4NQ0WK_.js} +2 -2
- package/dist/cdn/chunks/{drop-vRXndjHu.js.map → drop-D4NQ0WK_.js.map} +1 -1
- package/dist/cdn/chunks/{flash-cards-0NrrKdrx.js → flash-cards-D4ebb5m6.js} +2 -2
- package/dist/cdn/chunks/{flash-cards-0NrrKdrx.js.map → flash-cards-D4ebb5m6.js.map} +1 -1
- package/dist/cdn/chunks/{gap-lor-khst.js → gap-D-Sipuyu.js} +2 -2
- package/dist/cdn/chunks/{gap-lor-khst.js.map → gap-D-Sipuyu.js.map} +1 -1
- package/dist/cdn/chunks/{help-C-woafz5.js → help-CmCFuNXk.js} +2 -2
- package/dist/cdn/chunks/{help-C-woafz5.js.map → help-CmCFuNXk.js.map} +1 -1
- package/dist/cdn/chunks/{help-form-DhIyMziw.js → help-form-Di2NtKDp.js} +2 -2
- package/dist/cdn/chunks/{help-form-DhIyMziw.js.map → help-form-Di2NtKDp.js.map} +1 -1
- package/dist/cdn/chunks/{hotspot-oel1Eelo.js → hotspot-B3bvqVzf.js} +2 -2
- package/dist/cdn/chunks/{hotspot-oel1Eelo.js.map → hotspot-B3bvqVzf.js.map} +1 -1
- package/dist/cdn/chunks/{image-drop-Dkprw0Kn.js → image-drop-vLc2B7rF.js} +2 -2
- package/dist/cdn/chunks/{image-drop-Dkprw0Kn.js.map → image-drop-vLc2B7rF.js.map} +1 -1
- package/dist/cdn/chunks/{image-label-Dm5shQSh.js → image-label-DsKxQDTQ.js} +2 -2
- package/dist/cdn/chunks/{image-label-Dm5shQSh.js.map → image-label-DsKxQDTQ.js.map} +1 -1
- package/dist/cdn/chunks/{inline-styles-CTgXWnHb.js → inline-styles-CFNlb6f2.js} +2 -2
- package/dist/cdn/chunks/{inline-styles-CTgXWnHb.js.map → inline-styles-CFNlb6f2.js.map} +1 -1
- package/dist/cdn/chunks/{insert-menu-Cn2E54V9.js → insert-menu-DAQglwtG.js} +2 -2
- package/dist/cdn/chunks/{insert-menu-Cn2E54V9.js.map → insert-menu-DAQglwtG.js.map} +1 -1
- package/dist/cdn/chunks/{issue-list-CQKAW39i.js → issue-list-CzSmohtT.js} +2 -2
- package/dist/cdn/chunks/{issue-list-CQKAW39i.js.map → issue-list-CzSmohtT.js.map} +1 -1
- package/dist/cdn/chunks/{live-jdiyYln2.js → live-qnReIRtj.js} +2 -2
- package/dist/cdn/chunks/{live-jdiyYln2.js.map → live-qnReIRtj.js.map} +1 -1
- package/dist/cdn/chunks/{long-answer-CtzClLAx.js → long-answer-NSWJiK0z.js} +2 -2
- package/dist/cdn/chunks/{long-answer-CtzClLAx.js.map → long-answer-NSWJiK0z.js.map} +1 -1
- package/dist/cdn/chunks/{mark-words-CpH3gTcX.js → mark-words-BKu-_uIl.js} +2 -2
- package/dist/cdn/chunks/{mark-words-CpH3gTcX.js.map → mark-words-BKu-_uIl.js.map} +1 -1
- package/dist/cdn/chunks/{match-DKE_4o-x.js → match-BpnJGW_5.js} +21 -13
- package/dist/cdn/chunks/match-BpnJGW_5.js.map +1 -0
- package/dist/cdn/chunks/{memory-B6hSyHyz.js → memory-BgTHujsU.js} +2 -2
- package/dist/cdn/chunks/{memory-B6hSyHyz.js.map → memory-BgTHujsU.js.map} +1 -1
- package/dist/cdn/chunks/{option-styles-WKzjKmCH.js → option-styles-B2sBX5Oz.js} +2 -2
- package/dist/cdn/chunks/{option-styles-WKzjKmCH.js.map → option-styles-B2sBX5Oz.js.map} +1 -1
- package/dist/cdn/chunks/{order-BhG_6IC-.js → order-B9gqH5wm.js} +2 -2
- package/dist/cdn/chunks/{order-BhG_6IC-.js.map → order-B9gqH5wm.js.map} +1 -1
- package/dist/cdn/chunks/{picture-view-BKnAyScQ.js → picture-view-Deodu_mb.js} +2 -2
- package/dist/cdn/chunks/{picture-view-BKnAyScQ.js.map → picture-view-Deodu_mb.js.map} +1 -1
- package/dist/cdn/chunks/{repeat-CY2W2URZ.js → repeat-BDXokpxQ.js} +2 -2
- package/dist/cdn/chunks/{repeat-CY2W2URZ.js.map → repeat-BDXokpxQ.js.map} +1 -1
- package/dist/cdn/chunks/{runtime-DxAbpr3S.js → runtime-C25QK5B0.js} +3 -3
- package/dist/cdn/chunks/{runtime-DxAbpr3S.js.map → runtime-C25QK5B0.js.map} +1 -1
- package/dist/cdn/chunks/{scan-jWgPnVxA.js → scan-BVhxT2Hw.js} +2 -2
- package/dist/cdn/chunks/{scan-jWgPnVxA.js.map → scan-BVhxT2Hw.js.map} +1 -1
- package/dist/cdn/chunks/{select-DTA3dJzr.js → select-DPpKJwSg.js} +2 -2
- package/dist/cdn/chunks/{select-DTA3dJzr.js.map → select-DPpKJwSg.js.map} +1 -1
- package/dist/cdn/chunks/select-QZ35cyns.js +2 -0
- package/dist/cdn/chunks/select-QZ35cyns.js.map +1 -0
- package/dist/cdn/chunks/{source-view-BlJ2mRns.js → source-view-gqFlZzwR.js} +2 -2
- package/dist/cdn/chunks/{source-view-BlJ2mRns.js.map → source-view-gqFlZzwR.js.map} +1 -1
- package/dist/cdn/chunks/{style-form-D1C2sHzg.js → style-form-DuR0EEum.js} +2 -2
- package/dist/cdn/chunks/{style-form-D1C2sHzg.js.map → style-form-DuR0EEum.js.map} +1 -1
- package/dist/cdn/chunks/{style-popups-BobgX1WK.js → style-popups-Bcl5imdP.js} +2 -2
- package/dist/cdn/chunks/{style-popups-BobgX1WK.js.map → style-popups-Bcl5imdP.js.map} +1 -1
- package/dist/cdn/chunks/{style-rules-ChqPVgZn.js → style-rules-ozpLz2ec.js} +2 -2
- package/dist/cdn/chunks/{style-rules-ChqPVgZn.js.map → style-rules-ozpLz2ec.js.map} +1 -1
- package/dist/cdn/chunks/{styled-Dmx5Yjv7.js → styled-bQqnDxBf.js} +2 -2
- package/dist/cdn/chunks/{styled-Dmx5Yjv7.js.map → styled-bQqnDxBf.js.map} +1 -1
- package/dist/cdn/chunks/{styles-CXkkL_Qi.js → styles-DiY3VA_T.js} +5 -5
- package/dist/cdn/chunks/styles-DiY3VA_T.js.map +1 -0
- package/dist/cdn/chunks/surface-CIz1z2oY.js +1059 -0
- package/dist/cdn/chunks/surface-CIz1z2oY.js.map +1 -0
- package/dist/cdn/chunks/{true-false-DP3MO599.js → true-false-C-S6RmZY.js} +2 -2
- package/dist/cdn/chunks/{true-false-DP3MO599.js.map → true-false-C-S6RmZY.js.map} +1 -1
- package/dist/cdn/chunks/{video-j9MCH6Kw.js → video-Dae8Gguf.js} +2 -2
- package/dist/cdn/chunks/{video-j9MCH6Kw.js.map → video-Dae8Gguf.js.map} +1 -1
- package/dist/cdn/chunks/{word-bank-ARjwUKZf.js → word-bank-CsIle0Ro.js} +2 -2
- package/dist/cdn/chunks/{word-bank-ARjwUKZf.js.map → word-bank-CsIle0Ro.js.map} +1 -1
- package/dist/cdn/chunks/{word-search-AHvM7yCJ.js → word-search-IOCwqo3y.js} +2 -2
- package/dist/cdn/chunks/{word-search-AHvM7yCJ.js.map → word-search-IOCwqo3y.js.map} +1 -1
- package/package.json +9 -9
- package/dist/cdn/chunks/match-DKE_4o-x.js.map +0 -1
- package/dist/cdn/chunks/styles-CXkkL_Qi.js.map +0 -1
- package/dist/cdn/chunks/surface-BhmSAte0.js +0 -1058
- package/dist/cdn/chunks/surface-BhmSAte0.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astl/astrolabe",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Open-source building blocks for interactive exercises (gaps, choice, crosswords and more) with practice and test modes: engine, player, editor, server and a one-file script for plain HTML.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astrolabe",
|
|
@@ -67,14 +67,14 @@
|
|
|
67
67
|
"access": "public"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@astl/components": "0.1.
|
|
71
|
-
"@astl/core": "0.1.
|
|
72
|
-
"@astl/editor": "0.1.
|
|
73
|
-
"@astl/editor-tiptap": "0.1.
|
|
74
|
-
"@astl/engine": "0.1.
|
|
75
|
-
"@astl/player": "0.1.
|
|
76
|
-
"@astl/server": "0.1.
|
|
77
|
-
"@astl/tokens": "0.1.
|
|
70
|
+
"@astl/components": "0.1.4",
|
|
71
|
+
"@astl/core": "0.1.4",
|
|
72
|
+
"@astl/editor": "0.1.4",
|
|
73
|
+
"@astl/editor-tiptap": "0.1.4",
|
|
74
|
+
"@astl/engine": "0.1.4",
|
|
75
|
+
"@astl/player": "0.1.4",
|
|
76
|
+
"@astl/server": "0.1.4",
|
|
77
|
+
"@astl/tokens": "0.1.4"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"vite": "8.3.4"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"match-DKE_4o-x.js","names":["en","pl","LitElement","unsafeCSS","nothing","ifDefined","html","b","r","i$1","w","A","verdictIcon","renderVerdict","AstlElement","o","i","en_default","matchManifest","pl_default","PickAndPlace","blockStyles","optionStyles","namespace","matchUiMessages","NONE","LONG_PRESS","textOf","el","slotOf","index","MatchElement","#facing","item","#dragged","#pointer","x","y","#aim","box","#tile","#draw","#isRow","#join","to","#message","moment","#children","row","rows","columns","column","next","id","value","answers","#pick","#observer","ui","lines","#lines","group","#renderLines","#renderGrid","key","params","names","content","picked","#feedback","label","verdict","j","refs","notes","pick","from","drafting","#palette","#remove","#renderTile","event","partners","first","#press","#keydown","marked","correct","answer","root","prompt","child","items","slot","tag","tile","dragged","name","canvas","centre","dot","aim","g","a","x1","y1","x2","y2","line","matchElement"],"sources":["../../../../components/src/match/ui-messages.ts","../../../../components/src/match/element.ts"],"sourcesContent":["import type { MessageCatalog } from '@astl/core';\nimport en from './messages/ui/en.json' with { type: 'json' };\nimport pl from './messages/ui/pl.json' with { type: 'json' };\n\nconst namespace = 'astl.match';\n\n/**\n * The student strings (`ui.*`): the element's catalogs. A module of their own, because bundlers split by module: one\n * that also built `matchMessages` would put the authoring strings into the element's chunk.\n */\nexport const matchUiMessages: readonly MessageCatalog[] = [\n { namespace, locale: 'en', messages: en },\n { namespace, locale: 'pl', messages: pl },\n];\n","import type { Answers, ComponentManifest, MessageCatalog, Units } from '@astl/core';\nimport { AstlElement, type ElementRegistration, renderVerdict, verdictIcon } from '@astl/player';\nimport { PickAndPlace, type PickMoment } from '@astl/player/interaction';\nimport {\n type CSSResultGroup,\n css,\n html,\n LitElement,\n nothing,\n type PropertyDeclarations,\n svg,\n type TemplateResult,\n unsafeCSS,\n} from 'lit';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { blockStyles } from '../block-styles.js';\nimport { optionStyles } from '../option-styles.js';\nimport { matchManifest } from './manifest.js';\nimport { matchUiMessages } from './ui-messages.js';\n\n/** The answer of a row without a partner, and the first destination of a picked item (Enter there: no line). */\nconst NONE = '';\n\n/** A touch held this long (ms) without moving starts a drag; a touch that moves sooner scrolls the page. */\nconst LONG_PRESS = 250;\n\nconst textOf = (el: Element | undefined): string => (el?.textContent ?? '').replace(/\\s+/g, ' ').trim();\n\n/** Palette slot 1 to 8 of the row at `index`, starting again after the eighth. */\nconst slotOf = (index: number): number => (index % 8) + 1;\n\n/**\n * `<astl-match>`: every row gets one partner from the columns. Slots: one per row (its id), answered with the id of\n * a column. The light-DOM `<astl-prompt>`, `<astl-row>` and `<astl-column>` children are slotted manually and never\n * moved or changed; where a name repeats (option buttons, lists, announcements) it is the child's text.\n * - `grid`: a table whose rows each hold a native radio group named by the row, one radio per column, each named\n * \"row: column\"; the browser gives the keyboard. Narrower than 34rem, each row is a card of option buttons.\n * - `lines`: rows and columns as two sides of toggle buttons with dots. Press an item, then its partner (either side\n * first), or choose the partner with the arrow keys and press Enter; or drag from one to the other (a touch after\n * a long press). Tapping a line, pressing a picked row again, or Delete and Backspace on a row remove its line.\n * Lines are for the eye only: the buttons say what they are joined to, and a disclosure offers one native select\n * per row.\n */\nexport class MatchElement extends AstlElement {\n static override manifest: ComponentManifest = matchManifest;\n static override messages: readonly MessageCatalog[] = matchUiMessages;\n static override shadowRootOptions: ShadowRootInit = {\n ...LitElement.shadowRootOptions,\n slotAssignment: 'manual',\n };\n\n static override properties: PropertyDeclarations = {\n joined: { state: true },\n };\n\n static override styles: CSSResultGroup = [\n // Narrow first: each row a card, its options as buttons. The layout follows the width the block gets, through a\n // container that is that width divided by max(1, columns / 5): from six columns on, the table needs more room\n // before it replaces the cards. The table inside takes the full width back.\n css`\n .fit {\n --astl-match-k: max(1, var(--astl-match-columns) / 5);\n container-type: inline-size;\n inline-size: calc(100% / var(--astl-match-k));\n }\n .table {\n display: flex;\n flex-direction: column;\n gap: var(--astl-space-2);\n inline-size: calc(100% * var(--astl-match-k));\n }\n .head {\n display: none;\n }\n .row,\n .tile {\n position: relative;\n border: var(--astl-outline-width) solid var(--astl-line);\n border-radius: var(--astl-radius-m);\n background: var(--astl-surface);\n }\n .row {\n display: grid;\n gap: var(--astl-space-2);\n padding: var(--astl-space-3);\n }\n .tile {\n border-color: var(--astl-outline);\n }\n .label,\n .column,\n .text {\n min-inline-size: 0;\n overflow-wrap: anywhere;\n }\n .options {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--astl-space-2);\n }\n `,\n // Selected: an option takes the fill and the bar of optionStyles, a picked tile the same here; in hc also bold text\n // (selected-weight), so a pick shows without the radio mark and without colour.\n css`\n .option {\n position: relative;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n gap: var(--astl-space-2);\n min-block-size: var(--astl-target-min);\n padding-block: var(--astl-space-1);\n padding-inline: var(--astl-space-3);\n border: var(--astl-outline-width) solid var(--astl-outline);\n border-radius: var(--astl-radius-m);\n font-size: var(--astl-size-ui);\n cursor: pointer;\n overflow: clip;\n }\n .option:has(input:disabled) {\n cursor: default;\n }\n .option[data-selected],\n .tile[data-picked] {\n font-weight: var(--astl-selected-weight);\n }\n .tile[data-picked] {\n border-color: var(--astl-selected);\n background: var(--astl-selected-soft);\n }\n .tile[data-picked]::before {\n content: '';\n position: absolute;\n inset-block: 0;\n inset-inline-start: 0;\n inline-size: var(--astl-selected-bar);\n background: var(--astl-selected);\n }\n `,\n // The solution line (block-styles.ts) closes its row or tile; the verdict line sits under the task. In the cards,\n // a row's verdict icon stands by the row's label, at the end of its first line (the label keeps room for it), so\n // it never reads as the verdict of the option before it.\n css`\n .options > .astl-solution {\n flex-basis: 100%;\n }\n .options > .astl-verdict {\n position: absolute;\n inset-block-start: var(--astl-space-3);\n inset-inline-end: var(--astl-space-3);\n block-size: 1lh;\n }\n .row:has(.options > .astl-verdict) > .label {\n margin-inline-end: calc(1.1em + var(--astl-space-2));\n }\n .group-verdict {\n margin-block: var(--astl-space-3) 0;\n }\n `,\n // Wide: one table. Rows, their answer cell and its radio group share the table's columns (subgrids): the row\n // label, one column per option under its header (each half the label's share), then the verdict; the solution\n // line runs under the options. Option names move to the headers, and the checked radio alone shows the pick (by\n // its shape, also in hc). The radio sits at the inline start of its cell, like every radio, so the cell keeps\n // more room after it than before. A cell is no option box, so no look's box shadow (a ::part() rule from outside)\n // draws one: only an important rule inside wins over it.\n css`\n @container (min-inline-size: 34rem) {\n .table {\n display: grid;\n grid-template-columns:\n minmax(0, 1fr) repeat(var(--astl-match-columns), minmax(var(--astl-target-min), 0.5fr))\n auto;\n column-gap: var(--astl-space-1);\n }\n .head,\n .row,\n .cell,\n .options {\n display: grid;\n grid-column: 1 / -1;\n grid-template-columns: subgrid;\n align-items: center;\n }\n .head {\n align-items: end;\n padding-inline: calc(var(--astl-space-3) + var(--astl-outline-width));\n font-size: var(--astl-size-ui);\n font-weight: 600;\n }\n .cell {\n grid-column: 2 / -1;\n }\n .options > .astl-verdict {\n position: static;\n grid-column: -2;\n }\n .row:has(.options > .astl-verdict) > .label {\n margin-inline-end: 0;\n }\n .options > .astl-solution {\n grid-column: 1 / -1;\n }\n .option,\n .cell .option[data-selected] {\n padding-inline: var(--astl-space-1) var(--astl-space-3);\n border-color: transparent;\n background: none;\n box-shadow: none !important;\n }\n .cell .option[data-selected]::before {\n content: none;\n }\n .name {\n display: none;\n }\n }\n `,\n // Lines: rows on the inline-start side, columns on the inline-end side, the lines between them. The SVG lies\n // under the tiles, so a press near a dot reaches the tile; only the wide, invisible stroke of a line takes taps.\n css`\n .board {\n position: relative;\n display: grid;\n grid-template-columns: minmax(0, 1fr) minmax(var(--astl-space-7), 0.4fr) minmax(0, 1fr);\n align-items: center;\n }\n .side {\n display: flex;\n flex-direction: column;\n gap: var(--astl-space-3);\n }\n .side + .side {\n grid-column: 3;\n }\n .lines {\n position: absolute;\n inset: 0;\n inline-size: 100%;\n block-size: 100%;\n overflow: visible;\n pointer-events: none;\n }\n .lines line {\n stroke: var(--astl-match-ink);\n stroke-width: 3px;\n stroke-linecap: round;\n }\n .lines .hit {\n stroke: transparent;\n stroke-width: 24px;\n pointer-events: stroke;\n cursor: pointer;\n }\n .lines .draft {\n stroke: var(--astl-selected);\n opacity: 0.6;\n }\n `,\n // A tile: its button, the verdict icon (at the end, on a line of its own when the text needs the room) and a dot\n // on the edge facing the other side: a ring in the row's palette colour, filled once joined (also under forced\n // colours). The solution line wraps under them.\n css`\n .tile {\n --astl-match-ink: var(--astl-outline);\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n }\n .tile[data-target] {\n border-color: var(--astl-accent);\n outline: var(--astl-outline-width) solid var(--astl-accent);\n outline-offset: calc(-2 * var(--astl-outline-width));\n }\n .tile > button {\n flex: 1 1 auto;\n min-inline-size: var(--astl-target-min);\n min-block-size: var(--astl-target-min);\n margin: 0;\n padding-block: var(--astl-space-2);\n padding-inline: var(--astl-space-3);\n border: 0;\n background: none;\n color: inherit;\n font: inherit;\n text-align: start;\n cursor: pointer;\n touch-action: manipulation;\n user-select: none;\n -webkit-user-select: none;\n -webkit-touch-callout: none;\n }\n .tile > .astl-verdict {\n margin-inline-start: auto;\n padding-inline-end: var(--astl-space-3);\n }\n .tile > .astl-solution {\n flex-basis: 100%;\n padding-inline: var(--astl-space-3);\n padding-block-end: var(--astl-space-2);\n }\n .dot {\n position: absolute;\n inset-block-start: calc(50% - 0.5rem);\n inset-inline-end: -0.5rem;\n box-sizing: border-box;\n inline-size: 1rem;\n block-size: 1rem;\n border: 3px solid var(--astl-match-ink);\n border-radius: 50%;\n background: var(--astl-surface);\n forced-color-adjust: none;\n }\n .side + .side .dot {\n inset-inline: -0.5rem auto;\n }\n [data-joined] > .dot {\n background: var(--astl-match-ink);\n }\n `,\n // The disclosure with one native select per row.\n css`\n .fallback {\n margin-block-start: var(--astl-space-4);\n font-size: var(--astl-size-ui);\n }\n summary {\n min-block-size: var(--astl-target-min);\n align-content: center;\n color: var(--astl-accent);\n cursor: pointer;\n }\n .pick {\n display: grid;\n gap: var(--astl-space-1);\n margin-block-start: var(--astl-space-3);\n }\n select {\n min-block-size: var(--astl-target-min);\n max-inline-size: 100%;\n font: inherit;\n }\n `,\n // Palette slots of rows and their lines, through an attribute: a strict Content Security Policy blocks inline\n // style attributes.\n unsafeCSS(\n Array.from(\n { length: 8 },\n (_, i) => `[data-palette='${i + 1}']{--astl-match-ink:var(--astl-palette-${i + 1})}`,\n ).join(''),\n ),\n optionStyles,\n blockStyles,\n ];\n\n /** Row id to column id, in the order they were joined: a column's dot takes the colour of its first row. */\n declare protected joined: ReadonlyMap<string, string>;\n /** Where a drag points (viewport) and the partner under it: the end of the line being drawn. */\n #pointer: readonly [number, number] | null = null;\n #aim: string | null = null;\n /** A press turned into a drag: the click after its release is not a tap. */\n #dragged = false;\n #observer: ResizeObserver | null = null;\n\n /**\n * Joining with the keyboard, taps or a drag: an item (a row or a column) is picked; its destinations are \"no\n * partner\", then the items of the other side, in arrow key order with wrap-around. A touch drags after a long press.\n */\n readonly #pick: PickAndPlace<string> = new PickAndPlace<string>(this, {\n destinations: (item) => [NONE, ...this.#facing(item).map((el) => el.id)],\n // A row is where its line goes; a column is never anywhere (it may have many lines).\n current: (item) => this.joined.get(item) ?? NONE,\n at: (x, y, item) => {\n this.#dragged = true;\n this.#pointer = [x, y];\n this.#aim =\n this.#facing(item).find((el) => {\n const box = this.#tile(el.id)?.getBoundingClientRect();\n return box !== undefined && x >= box.left && x <= box.right && y >= box.top && y <= box.bottom;\n })?.id ?? null;\n this.#draw();\n return this.#aim;\n },\n commit: (item, to) => (this.#isRow(item) ? this.#join(item, to) : this.#join(to, item)),\n say: (moment, item, to) => this.#message(moment, item, to),\n wrap: true,\n hold: LONG_PRESS,\n });\n\n constructor() {\n super();\n this.joined = new Map();\n }\n\n /** `<astl-row>` children in rendered order: view order, or shuffled per attempt with a seed. */\n get rows(): readonly HTMLElement[] {\n return this.shuffled(this.#children('astl-row'));\n }\n\n /** `<astl-column>` children, always in view order (the authored order). */\n get columns(): readonly HTMLElement[] {\n return this.#children('astl-column');\n }\n\n get slotIds(): readonly string[] {\n return this.rows.map((row) => row.id);\n }\n\n getAnswers(): Answers {\n return Object.fromEntries(this.joined);\n }\n\n setAnswers(answers: Answers): void {\n const rows = new Set(this.slotIds);\n const columns = new Set(this.columns.map((column) => column.id));\n const next = new Map(this.joined);\n for (const [id, value] of Object.entries(answers)) {\n if (!rows.has(id) || next.get(id) === value) continue;\n next.delete(id);\n // '' removes the line; an unknown column cannot be shown, so the row is unanswered, as the player sends it.\n if (columns.has(value)) next.set(id, value);\n }\n this.joined = next;\n this.#pick.reset();\n }\n\n units(): Units {\n return { answered: this.joined.size, total: this.rows.length };\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.#observer?.observe(this);\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.#observer?.disconnect();\n }\n\n protected override render(): TemplateResult {\n const ui = this.uiLanguage;\n const lines = this.#lines;\n const group = this.groupVerdict;\n return html`<fieldset part=\"match\">\n <legend part=\"prompt\">\n <slot class=\"prompt-slot\"></slot>\n <span class=\"hint\" lang=${ui.lang}><bdi>${this.t(lines ? 'ui.hint.lines' : 'ui.hint.grid')}</bdi></span>\n </legend>\n ${lines ? this.#renderLines() : this.#renderGrid()}\n ${\n group === null\n ? nothing\n : html`<p class=\"group-verdict\" part=\"verdict\" data-verdict=${group}>\n ${renderVerdict(group, (key, params) => this.t(key, params), ui)}\n </p>`\n }\n </fieldset>`;\n }\n\n #renderGrid(): TemplateResult {\n const columns = this.columns;\n const names = columns.map(textOf);\n const content = this.contentLang || undefined;\n return html`<div class=\"fit\"><div class=\"table\" role=\"table\">\n <div class=\"head\" role=\"row\">\n <span role=\"cell\"></span>\n ${columns.map(\n (column) =>\n html`<span class=\"column\" part=\"column\" role=\"columnheader\"><slot data-item=${column.id}></slot></span>`,\n )}\n </div>\n ${this.rows.map((row, i) => {\n const picked = this.joined.get(row.id);\n const { verdict, refs, notes } = this.#feedback(row.id, i);\n const label = textOf(row);\n return html`<div class=\"row astl-box\" part=\"row\" role=\"row\" data-verdict=${ifDefined(verdict)}>\n <span class=\"label\" role=\"rowheader\" id=\"row-${i}\"><slot data-item=${row.id}></slot></span>\n <div class=\"cell\" role=\"cell\" aria-colspan=${columns.length}>\n <div class=\"options\" role=\"radiogroup\" aria-labelledby=\"row-${i}\">\n ${columns.map(\n (\n column,\n j,\n ) => html`<label class=\"option astl-ring\" part=\"option\" ?data-selected=${picked === column.id}>\n <input\n part=\"control\"\n type=\"radio\"\n name=${row.id}\n value=${column.id}\n .checked=${picked === column.id}\n ?disabled=${this.disabled}\n aria-label=${this.t('ui.option', { row: label, column: names[j] ?? '' })}\n aria-describedby=${refs || nothing}\n @change=${() => this.#join(row.id, column.id)}\n /><span class=\"name\" lang=${ifDefined(content)} aria-hidden=\"true\">${names[j]}</span>\n </label>`,\n )}\n ${notes}\n </div>\n </div>\n </div>`;\n })}\n </div></div>`;\n }\n\n #renderLines(): TemplateResult {\n const ui = this.uiLanguage;\n const rows = this.rows;\n const columns = this.columns;\n const pick = this.#pick;\n const from = pick.dragging ?? pick.picked;\n const drafting = from !== null && (pick.dragging !== null || (pick.target ?? NONE) !== NONE);\n const content = this.contentLang || undefined;\n return html`<span class=\"astl-vh\" id=\"instructions\" lang=${ui.lang} dir=${ui.dir}>${this.t('ui.instructions')}</span>\n <div class=\"board\">\n <svg class=\"lines\" part=\"line\" aria-hidden=\"true\" focusable=\"false\">\n ${[...this.joined].map(\n ([row, column]) =>\n svg`<g data-palette=${this.#palette(row)} data-from=${row} data-to=${column}><line></line>${\n this.disabled ? nothing : svg`<line class=\"hit\" @click=${() => this.#remove(row)}></line>`\n }</g>`,\n )}\n ${drafting ? svg`<g data-from=${from}><line class=\"draft\"></line></g>` : nothing}\n </svg>\n <div class=\"side\">${rows.map((row) => this.#renderTile(row, true))}</div>\n <div class=\"side\">${columns.map((column) => this.#renderTile(column, false))}</div>\n </div>\n <details class=\"fallback\" part=\"fallback\">\n <summary lang=${ui.lang} dir=${ui.dir}>${this.t('ui.fallback')}</summary>\n ${rows.map((row, i) => {\n const picked = this.joined.get(row.id) ?? NONE;\n return html`<label class=\"pick\">\n <span lang=${ifDefined(content)}>${textOf(row)}</span>\n <select\n part=\"control\"\n lang=${ifDefined(content)}\n ?disabled=${this.disabled}\n aria-describedby=${this.#feedback(row.id, i).refs || nothing}\n @change=${(event: Event) => this.#join(row.id, (event.target as HTMLSelectElement).value)}\n >\n <option value=\"\" lang=${ui.lang} .selected=${picked === NONE}>${this.t('ui.choose')}</option>\n ${columns.map(\n (column) =>\n html`<option value=${column.id} .selected=${picked === column.id}>${textOf(column)}</option>`,\n )}\n </select>\n </label>`;\n })}\n </details>`;\n }\n\n #renderTile(item: HTMLElement, row: boolean): TemplateResult {\n const id = item.id;\n const pick = this.#pick;\n const i = this.rows.indexOf(item);\n const partners = row\n ? this.columns.filter((column) => column.id === this.joined.get(id))\n : this.rows.filter((r) => this.joined.get(r.id) === id);\n const first = row ? id : [...this.joined].find(([, column]) => column === id)?.[0];\n const { verdict, refs, notes } = row\n ? this.#feedback(id, i)\n : { verdict: undefined, refs: '', notes: nothing };\n const ui = this.uiLanguage;\n const names = new Intl.ListFormat(ui.lang).format(partners.map(textOf));\n return html`<div\n class=\"tile astl-box astl-ring\"\n part=${row ? 'row' : 'column'}\n data-item=${id}\n data-palette=${ifDefined(first === undefined ? undefined : this.#palette(first))}\n data-verdict=${ifDefined(verdict)}\n ?data-joined=${partners.length > 0}\n ?data-picked=${pick.picked === id || pick.dragging === id}\n ?data-target=${pick.target === id || (pick.dragging !== null && pick.over === id)}\n >\n <button\n type=\"button\"\n data-item=${id}\n aria-pressed=${pick.picked === id ? 'true' : 'false'}\n aria-describedby=${this.disabled ? refs || nothing : `instructions ${refs}`.trim()}\n ?disabled=${this.disabled}\n @click=${(event: MouseEvent) => this.#press(event, id)}\n @keydown=${(event: KeyboardEvent) => this.#keydown(event, id)}\n @pointerdown=${(event: PointerEvent) => {\n this.#dragged = false;\n this.#pointer = null;\n pick.pointerdown(event, id);\n }}\n @touchmove=${pick.touchmove}\n >\n <span class=\"text\"><slot data-item=${id}></slot></span\n ><span class=\"astl-vh\" lang=${ui.lang} dir=${ui.dir}\n >, ${partners.length > 0 ? this.t('ui.joined', { names }) : this.t('ui.notJoined')}</span\n >\n </button>\n <span class=\"dot\" part=\"dot\"></span>\n ${notes}\n </div>`;\n }\n\n /**\n * A row's verdict (answered rows; where rows are marked one by one, an unanswered one shows \"no answer\"), its\n * solution line (unless the answer is the correct one) and their ids.\n */\n #feedback(id: string, i: number) {\n const picked = this.joined.get(id);\n const marked = Object.keys(this.feedback?.slots ?? {}).length > 0;\n const verdict = (picked === undefined ? (marked ? 'empty' : null) : this.slotVerdict(id)) ?? undefined;\n const correct = this.solution?.[id];\n const answer = correct === picked ? undefined : this.columns.find((column) => column.id === correct);\n const ui = this.uiLanguage;\n const content = this.contentLang || undefined;\n const refs = [verdict && `verdict-${i}`, answer && `solution-${i}`].filter(Boolean).join(' ');\n const notes = html`${\n verdict === undefined\n ? nothing\n : renderVerdict(verdict, (key, params) => this.t(key, params), {\n hiddenWord: true,\n id: `verdict-${i}`,\n part: 'verdict',\n ...ui,\n })\n }${\n answer === undefined\n ? nothing\n : // A UI sentence around a content name: it reads in the UI's direction, the name keeps its language.\n html`<p class=\"astl-solution\" part=\"solution\" id=\"solution-${i}\" data-column=${answer.id} lang=${ui.lang} dir=${ui.dir}>\n ${verdictIcon('correct')}<span class=\"astl-solution-label\">${this.t('ui.solution')}</span>\n <bdi lang=${ifDefined(content)}>${textOf(answer)}</bdi>\n </p>`\n }`;\n return { verdict, refs, notes };\n }\n\n protected override updated(): void {\n // Manual slot assignment: the view's light DOM is projected as is, never moved or rewritten.\n const root = this.renderRoot as ShadowRoot;\n const prompt = Array.from(this.children).find((child) => child.localName === 'astl-prompt');\n root.querySelector<HTMLSlotElement>('slot.prompt-slot')?.assign(...(prompt ? [prompt] : []));\n const items = new Map([...this.rows, ...this.columns].map((el) => [el.id, el]));\n for (const slot of root.querySelectorAll<HTMLSlotElement>('slot[data-item]')) {\n const item = items.get(slot.dataset.item ?? '');\n slot.assign(...(item ? [item] : []));\n }\n // Through the CSSOM, which a strict Content Security Policy allows (an inline style attribute it blocks).\n root\n .querySelector<HTMLElement>('.fit')\n ?.style.setProperty('--astl-match-columns', `${this.columns.length}`);\n if (this.#lines && this.#observer === null) {\n // Lines follow the tiles: on resize (the host's size changes with every tile) and once fonts are loaded.\n this.#observer = new ResizeObserver(() => this.#draw());\n this.#observer.observe(this);\n void document.fonts.ready.then(() => this.#draw());\n }\n this.#draw();\n }\n\n // Joining\n\n get #lines(): boolean {\n return this.stringAttribute('variant') === 'lines';\n }\n\n #children(tag: string): HTMLElement[] {\n return Array.from(this.children).filter(\n (child): child is HTMLElement => child.localName === tag && child.id !== '',\n );\n }\n\n #isRow(id: string): boolean {\n return this.rows.some((row) => row.id === id);\n }\n\n /** The items on the other side from `id`. */\n #facing(id: string): readonly HTMLElement[] {\n return this.#isRow(id) ? this.columns : this.rows;\n }\n\n #palette(row: string): number {\n return slotOf(this.rows.findIndex((r) => r.id === row));\n }\n\n #tile(id: string): HTMLElement | undefined {\n return [...(this.renderRoot as ShadowRoot).querySelectorAll<HTMLElement>('.tile')].find(\n (tile) => tile.dataset.item === id,\n );\n }\n\n /** Gives `row` the partner `column` (NONE: none) and reports it. */\n #join(row: string, column: string): void {\n if (this.disabled || (this.joined.get(row) ?? NONE) === column) return;\n const next = new Map(this.joined);\n next.delete(row);\n if (column !== NONE) next.set(row, column);\n this.joined = next;\n this.emitChange({ [row]: column });\n }\n\n /** Removes the line of `row` (a tap on the line, Delete or Backspace, a second press), announced. */\n #remove(row: string): void {\n if (this.disabled || !this.joined.has(row)) return;\n this.#pick.reset();\n this.#join(row, NONE);\n this.announce(this.#message('put', row, NONE));\n }\n\n /**\n * A press on an item (a tap, Space or Enter). A picked row pressed again, with no other partner chosen, loses its\n * line (\"tap the row again\"); else PickAndPlace picks, and a press on the other side puts the picked item there.\n */\n #press(event: MouseEvent, id: string): void {\n const pick = this.#pick;\n const picked = pick.picked;\n const dragged = this.#dragged && event.detail !== 0;\n this.#dragged = false;\n if (!dragged && picked === id && pick.target === null && this.joined.has(id)) this.#remove(id);\n else pick.click(event, id, picked !== null && this.#isRow(picked) !== this.#isRow(id) ? id : undefined);\n }\n\n #keydown(event: KeyboardEvent, id: string): void {\n if ((event.key === 'Delete' || event.key === 'Backspace') && this.joined.has(id)) {\n event.preventDefault();\n this.#remove(id);\n } else this.#pick.keydown(event, id);\n }\n\n /** `ui.announce.pick`, `target` (or `none`), `cancel`, and for a put `join` (or `unjoin`: no partner). */\n #message(moment: PickMoment, item: string, to: string): string {\n const name = (id: string) => textOf([...this.rows, ...this.columns].find((el) => el.id === id));\n const [row, column] = this.#isRow(item) ? [item, to] : [to, item];\n const key =\n moment === 'put'\n ? column === NONE\n ? 'unjoin'\n : 'join'\n : moment === 'target' && to === NONE\n ? 'none'\n : moment;\n return this.t(`ui.announce.${key}`, {\n item: name(moment === 'target' ? to : item),\n row: name(row),\n column: name(column),\n joined: this.joined.size,\n total: this.rows.length,\n });\n }\n\n /** Puts every line between the centres of its dots, and the line being made towards its partner or the pointer. */\n #draw(): void {\n const canvas = (this.renderRoot as ShadowRoot).querySelector('svg.lines');\n if (canvas === null) return;\n // The viewBox is the box on screen: no correction needed for CSS zoom or scaling.\n const box = canvas.getBoundingClientRect();\n canvas.setAttribute('viewBox', `0 0 ${box.width} ${box.height}`);\n const centre = (id: string | null | undefined): readonly [number, number] | null => {\n const dot = id ? this.#tile(id)?.querySelector('.dot')?.getBoundingClientRect() : undefined;\n return dot ? [dot.x + dot.width / 2, dot.y + dot.height / 2] : null;\n };\n const pick = this.#pick;\n const aim = centre(pick.dragging === null ? pick.target : this.#aim) ?? this.#pointer;\n for (const g of canvas.querySelectorAll('g')) {\n const a = centre(g.dataset.from);\n // A line without an end yet stays a point under its own dot.\n const b = (g.dataset.to === undefined ? aim : centre(g.dataset.to)) ?? a;\n const [x1, y1, x2, y2] =\n a && b ? [a[0] - box.x, a[1] - box.y, b[0] - box.x, b[1] - box.y] : [0, 0, 0, 0];\n for (const line of g.querySelectorAll('line')) {\n line.setAttribute('x1', `${x1}`);\n line.setAttribute('y1', `${y1}`);\n line.setAttribute('x2', `${x2}`);\n line.setAttribute('y2', `${y2}`);\n }\n }\n }\n}\n\nexport const matchElement: ElementRegistration = {\n manifest: matchManifest,\n element: MatchElement,\n messages: matchUiMessages,\n};\n"],"mappings":"A,wTAIA,IAAMuB,EAAY,aAMLC,EAA6C,CACxD,CAAE,YAAW,OAAQ,KAAM,SAAUxB,CAAG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Qi.js","names":["LitElement","unsafeCSS","r","i$1","tokens","directionOf","visuallyHidden","tokensCss","i","AuthoringElement","#subscribe","#unsubscribe","changed","adapter","#subscription","offs","selection","off","key","params","lang","inheritTokens","lines","name","selector","kitStyles"],"sources":["../../../../editor/src/elements/base.ts","../../../../editor/src/elements/styles.ts"],"sourcesContent":["import {\n type Direction,\n directionOf,\n type EditorAdapter,\n type EditorSelection,\n type MessageParams,\n} from '@astl/core';\nimport { LitElement, type PropertyDeclarations, type PropertyValues } from 'lit';\nimport type { Authoring } from '../authoring.js';\nimport { EDITOR_NAMESPACE } from '../messages.js';\n\n/**\n * Base of the kit elements: `authoring` and `adapter` properties, a subscription to the adapter's events while\n * connected (re-rendering by default) and UI strings in the authoring locale.\n */\nexport class AuthoringElement extends LitElement {\n static override properties: PropertyDeclarations = {\n authoring: { attribute: false },\n adapter: { attribute: false },\n };\n\n declare authoring: Authoring | null;\n declare adapter: EditorAdapter | null;\n\n #subscription: { readonly adapter: EditorAdapter; readonly off: () => void } | null = null;\n\n constructor() {\n super();\n this.authoring = null;\n this.adapter = null;\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n this.#subscribe();\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n this.#unsubscribe();\n }\n\n protected override willUpdate(changed: PropertyValues<this>): void {\n if (changed.has('adapter')) this.#subscribe();\n }\n\n #subscribe(): void {\n const adapter = this.isConnected ? this.adapter : null;\n if ((this.#subscription?.adapter ?? null) === adapter) return;\n this.#unsubscribe();\n if (adapter === null) return;\n const offs = [\n adapter.onChange(() => this.sourceChanged()),\n adapter.onSelectionChange((selection) => this.selectionChanged(selection)),\n adapter.onCursorChange?.(() => this.cursorChanged()) ?? (() => {}),\n ];\n this.#subscription = {\n adapter,\n off: () => {\n for (const off of offs) off();\n },\n };\n }\n\n #unsubscribe(): void {\n this.#subscription?.off();\n this.#subscription = null;\n }\n\n /** The document changed. */\n protected sourceChanged(): void {\n this.requestUpdate();\n }\n\n /** The cursor entered or left a component. */\n protected selectionChanged(_selection: EditorSelection | null): void {\n this.requestUpdate();\n }\n\n /** The cursor moved, or the document or its history changed. Most elements have nothing to do. */\n protected cursorChanged(): void {}\n\n /** A kit message (`astl.editor`) in the authoring locale. */\n protected t(key: string, params?: MessageParams): string {\n return this.authoring?.t(EDITOR_NAMESPACE, key, params) ?? key;\n }\n\n /** Language and direction of the UI strings. */\n protected get ui(): { readonly lang: string; readonly dir: Direction } {\n const lang = this.authoring?.locale ?? 'en';\n return { lang, dir: directionOf(lang) };\n }\n}\n","import { visuallyHidden } from '@astl/player';\nimport { tokens, tokensCss } from '@astl/tokens';\nimport { type CSSResult, type CSSResultGroup, css, unsafeCSS } from 'lit';\n\n/**\n * Every token as `inherit` on `selector`, for elements that redeclare the tokens on their own `:host` (the player): a\n * rule from the outer tree wins over `:host`, so tokens set on the kit element reach them.\n */\nexport function inheritTokens(selector: string): CSSResult {\n const names = [tokens.scale, tokens.themes.light, tokens.themeScale.light].flatMap(Object.keys);\n const lines = ['color-scheme: inherit;', ...names.map((name) => `--astl-${name}: inherit;`)];\n return unsafeCSS(`${selector} {\\n${lines.join('\\n')}\\n}`);\n}\n\n/** Shared look of the kit elements: a card, native controls with 44px targets, visible focus. Tokens only. */\nexport const kitStyles: CSSResultGroup = [\n // Tokens sit on :host so host pages can override any --astl-* property on the element itself.\n unsafeCSS(tokensCss(':host')),\n visuallyHidden,\n css`\n :host {\n display: block;\n color: var(--astl-ink);\n font-family: var(--astl-font-body);\n font-size: var(--astl-size-ui);\n line-height: 1.4;\n }\n :host([hidden]) {\n display: none;\n }\n .kit {\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n gap: var(--astl-space-3);\n min-inline-size: 0;\n padding: var(--astl-space-4);\n border: var(--astl-outline-width) solid var(--astl-line);\n border-radius: var(--astl-radius-l);\n background: var(--astl-surface);\n color: var(--astl-ink);\n overflow-wrap: anywhere;\n }\n .title {\n margin: 0;\n font-family: var(--astl-font-display);\n font-size: 1.125rem;\n line-height: 1.3;\n }\n .note {\n margin: 0;\n color: var(--astl-ink-muted);\n }\n ul {\n display: flex;\n flex-direction: column;\n gap: var(--astl-space-2);\n margin: 0;\n padding: 0;\n list-style: none;\n }\n button {\n box-sizing: border-box;\n display: inline-flex;\n align-items: center;\n gap: var(--astl-space-2);\n min-block-size: var(--astl-target-min);\n min-inline-size: var(--astl-target-min);\n margin: 0;\n padding-block: var(--astl-space-2);\n padding-inline: var(--astl-space-3);\n border: var(--astl-outline-width) solid var(--astl-outline);\n border-radius: var(--astl-radius-m);\n background: var(--astl-surface);\n color: var(--astl-ink);\n font: inherit;\n text-align: start;\n cursor: pointer;\n }\n button:hover:not(:disabled) {\n background: var(--astl-accent-soft);\n }\n `,\n // Disabled shows without colour too: a dashed border and no fill. In the high contrast theme the line and muted\n // colours are as dark as the enabled ones. Disabled (no editor yet), the primary button must not look pressable.\n css`\n button:is(:disabled, [aria-disabled='true']) {\n border-color: var(--astl-line);\n border-style: dashed;\n background: transparent;\n color: var(--astl-ink-muted);\n cursor: not-allowed;\n }\n button.primary {\n border-color: var(--astl-accent);\n background: var(--astl-accent);\n color: var(--astl-on-accent);\n font-weight: 600;\n }\n button.primary:hover:not(:disabled) {\n background: var(--astl-accent);\n text-decoration: underline;\n }\n button.primary:disabled {\n border-color: var(--astl-line);\n background: transparent;\n color: var(--astl-ink-muted);\n }\n input:not([type='checkbox'], [type='radio']),\n select,\n textarea {\n box-sizing: border-box;\n inline-size: 100%;\n min-inline-size: 0;\n min-block-size: var(--astl-target-min);\n margin: 0;\n padding-block: var(--astl-space-1);\n padding-inline: var(--astl-space-2);\n border: var(--astl-outline-width) solid var(--astl-outline);\n border-radius: var(--astl-radius-s);\n background: var(--astl-surface);\n color: var(--astl-ink);\n font: inherit;\n }\n input[type='checkbox'],\n input[type='radio'] {\n flex: none;\n inline-size: 1.25rem;\n block-size: 1.25rem;\n margin: 0;\n accent-color: var(--astl-accent);\n }\n :focus-visible {\n outline: var(--astl-focus-width) solid var(--astl-focus);\n outline-offset: var(--astl-focus-offset);\n }\n .icon {\n flex: none;\n inline-size: 1.25rem;\n block-size: 1.25rem;\n }\n `,\n // Forced colours: disabled as the system draws disabled controls (the dashed border stays). The Canvas backplate\n // forced colours draw behind text would hide the HighlightText label on the Highlight fill, so the primary button\n // uses only system colours here and keeps its own. Disabled, it stays forced: its muted label would not read on the\n // fill.\n css`\n @media (forced-colors: active) {\n button.primary {\n border-color: ButtonText;\n }\n button:disabled,\n button.primary:disabled {\n border-color: GrayText;\n color: GrayText;\n }\n button.primary:not(:disabled) {\n forced-color-adjust: none;\n }\n }\n `,\n];\n"],"mappings":"A,oHAeA,IAAaS,EAAb,cAAsCT,CAAW,CAC/C,OAAgB,WAAmC,CACjD,UAAW,CAAE,UAAW,EAAM,EAC9B,QAAS,CAAE,UAAW,EAAM,CAC9B,EAKA,GAAsF,KAEtF,aAAc,CACZ,MAAM,EACN,KAAK,UAAY,KACjB,KAAK,QAAU,IACjB,CAEA,mBAAmC,CACjC,MAAM,kBAAkB,EACxB,KAAKU,GAAW,CAClB,CAEA,sBAAsC,CACpC,MAAM,qBAAqB,EAC3B,KAAKC,GAAa,CACpB,CAEA,WAA8B,EAAqC,CAC7DC,EAAQ,IAAI,SAAS,GAAG,KAAKF,GAAW,CAC9C,CAEA,IAAmB,CACjB,IAAMG,EAAU,KAAK,YAAc,KAAK,QAAU,KAGlD,IAFK,KAAKC,IAAe,SAAW,QAAUD,IAC9C,KAAKF,GAAa,EACdE,IAAY,MAAM,OACtB,IAAME,EAAO,CACXF,EAAQ,aAAe,KAAK,cAAc,CAAC,EAC3CA,EAAQ,kBAAmB,GAAc,KAAK,iBAAiBG,CAAS,CAAC,EACzEH,EAAQ,qBAAuB,KAAK,cAAc,CAAC,QAAY,CAAC,EAClE,EACA,KAAKC,GAAgB,CACnB,UACA,QAAW,CACT,IAAK,IAAMG,KAAOF,EAAME,EAAI,CAC9B,CACF,CACF,CAEA,IAAqB,CACnB,KAAKH,IAAe,IAAI,EAC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