@roxyapi/ui 0.27.0 → 0.27.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components-catalog.json +127 -127
- package/dist/cdn/components/endpoint-form.js +1 -1
- package/dist/cdn/components/endpoint-form.js.map +1 -1
- package/dist/cdn/components/ephemeris-table.js +1 -1
- package/dist/cdn/components/ephemeris-table.js.map +2 -2
- package/dist/cdn/roxy-ui.js +1 -1
- package/dist/cdn/roxy-ui.js.map +2 -2
- package/dist/components/endpoint-form.js +1 -1
- package/dist/components/endpoint-form.js.map +1 -1
- package/dist/components/ephemeris-table.d.ts.map +1 -1
- package/dist/components/ephemeris-table.js +1 -1
- package/dist/components/ephemeris-table.js.map +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +2 -2
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/ephemeris-table.ts +19 -0
- package/src/version.ts +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/components/ephemeris-table.ts", "../../src/utils/string.ts", "../../src/tokens/index.ts", "../../src/utils/base-element.ts", "../../src/i18n/lang.ts", "../../src/i18n/registry.ts", "../../src/i18n/locale-controller.ts", "../../src/utils/base-styles.ts", "../../src/utils/key-guard.ts", "../../src/utils/fetch-controller.ts", "../../src/utils/interp-accordion.ts", "../../src/utils/disclosure.ts", "../../src/utils/markup-data.ts", "../../src/utils/degree.ts", "../../src/utils/format.ts", "../../src/utils/localized.ts"],
|
|
4
|
-
"sourcesContent": ["import { css, html, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { planetGlyph, signGlyph } from '../tokens/index.js';\nimport type {\n\tGetMonthlyEphemerisResponse,\n\tGetMonthlyTropicalEphemerisResponse,\n} from '../types/index.js';\nimport { RoxyDataElement } from '../utils/base-element.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport { splitDegreeInSign } from '../utils/degree.js';\nimport {\n\tformatMonthDay,\n\tformatMonthYear,\n\tformatWeekdayDay,\n} from '../utils/format.js';\nimport { display } from '../utils/localized.js';\n\n/**\n * The sample instant every position in both responses is calculated for, printed as a literal rather than a translated phrase.\n *\n * @remarks\n * An ephemeris is unusable without its time basis, which is why every published one declares it in the header: the Astrodienst and Sirius tables print `Time Zone: EDT (04:00 East)`, Astro-Seek prints `00:00 [UT/GMT]` and repeats that literal unchanged in all seven of its localized builds. A clock literal is the same in every language, so this needs no catalogue entry and cannot drift from one.\n *\n * Verified against a published midnight-EDT ephemeris for the same month on 2026-08-10: at 04:00 UTC on 2026-08-01 the Sun reads 8\u00B056'55\" Leo (128.949\u00B0) and this API returns 129.2669\u00B0 for that date, a difference of 0.318\u00B0 against the Sun's 0.955\u00B0/day, which is exactly the eight hours from 04:00 to 12:00 UTC. Both endpoint descriptions state noon UTC and the arithmetic agrees with them.\n */\nconst SAMPLE_INSTANT = '12:00 UTC';\n\n/**\n * The two monthly-ephemeris responses this table renders. Structurally\n * identical: the Western one carries fourteen tropical bodies, the Vedic one\n * the nine sidereal Navagraha, and neither says which frame it is in, so the\n * component never claims one (see the class docblock).\n */\ntype EphemerisResponse =\n\t| GetMonthlyTropicalEphemerisResponse\n\t| GetMonthlyEphemerisResponse;\n\n/** One body on one day, straight off the response. */\ntype Position = EphemerisResponse['days'][number]['positions'][number];\n\n/** A contiguous stretch of sampled days on which a body is retrograde, clipped to the month. */\ninterface RetrogradeRun {\n\tstart: string;\n\tend: string;\n}\n\n/** A body crossing into a new sign, dated by the first day the sample shows it there. */\ninterface Ingress {\n\tdate: string;\n\t/** Canonical English sign: the glyph lookup keys on this. */\n\tsign: string;\n\t/** The sign name a reader sees. */\n\tsignLabel: string;\n}\n\n/** One body read along the whole month: where it began, where it ended, and everything that changed in between. */\ninterface BodyTrack {\n\t/** Canonical English body name. Every glyph lookup and every column key uses this. */\n\tname: string;\n\t/** The body name a reader sees. */\n\tlabel: string;\n\tfirst: Position;\n\tlast: Position;\n\tingresses: Ingress[];\n\tretrogrades: RetrogradeRun[];\n\t/** Dates on which this body changed sign, so the daily grid can mark the same cells the chips name. */\n\tingressDates: Set<string>;\n\t/** Dates on which this body was seen to change direction, which a printed ephemeris marks in the column rather than only listing below it. */\n\tstationDates: Set<string>;\n}\n\n/** One day of the grid: the date plus one cell per body, aligned to {@link ViewModel.bodies}. */\ninterface DayRow {\n\tdate: string;\n\tcells: Array<Position | undefined>;\n}\n\ninterface ViewModel {\n\tyear: number;\n\tmonth: number;\n\tbodies: BodyTrack[];\n\trows: DayRow[];\n}\n\n/**\n * Monthly ephemeris: every body read across a whole month, as the reference\n * table a practitioner works from plus the two things a month view exists to\n * answer.\n *\n * @remarks\n * Renders `POST /astrology/planets/monthly` (fourteen tropical Western bodies)\n * and `POST /vedic-astrology/planetary-positions/monthly` (the nine sidereal\n * Navagraha). One response shape, so one component; nothing selects between\n * them, because the payload is the only honest discriminator and the layout is\n * the same either way.\n *\n * **The grid follows the published ephemeris, which is one of the most\n * convention-bound artifacts in astrology and where a deviation reads as\n * amateurish on sight.** Checked on 2026-08-10 against the Sirius-generated\n * ephemeris for this same month published by Cafe Astrology, and against the\n * Astro-Seek monthly ephemeris: days run DOWN the rows with the weekday beside\n * the day number, bodies run ACROSS the columns headed by their glyphs, a cell\n * is `9\u264C16` with the sign glyph BETWEEN the degree and the minutes rather than a\n * decimal longitude, retrograde is marked in the cell, and the sign changes and\n * direction changes are listed separately beside the grid, which is what those\n * publications call Ingresses and Stations. One deliberate deviation, and it is\n * additive: a printed ephemeris prints the sign glyph only on the row where it\n * changes, because a reader has the whole page in view. A scrolling table has no\n * such anchor, so every cell carries its glyph and the ingress cell is tinted\n * instead, which makes the same day easier to find rather than harder.\n *\n * **Two blocks, both always in the page, and the order is the reading order.**\n * A month of daily positions is 31 rows by up to 14 bodies, and dumping that\n * alone answers \"where was Mars on the 12th\" while burying the questions a\n * practitioner actually opens an ephemeris for: when did a body change sign,\n * and when did it turn retrograde. So the derived answer leads. Each body gets\n * one row carrying its position on the first and last sampled day, a chip per\n * sign it entered with the date, and a chip per retrograde stretch. This is also\n * how the published tables separate the Moon, which changes sign every two or\n * three days and would otherwise swamp a single date-ordered ingress list: one\n * row per body puts its thirteen crossings on their own line. Below it, the full\n * daily grid, so every chip can be checked against the day it came from. Neither\n * block is behind a tab or a disclosure, and the grid scrolls inside its own box\n * so a phone never scrolls the page sideways.\n *\n * **Ingresses and retrograde windows are DERIVED from consecutive days, and the\n * grain of the answer is the grain of the sample.** The API returns one\n * position per day at noon UTC, so an ingress is dated to the first day the\n * body is shown in the new sign and a retrograde run to the first and last days\n * it is shown retrograde. The true crossing and the true station fall somewhere\n * in the preceding 24 hours; a month page cannot say where, and pretending to a\n * time the response does not carry would be the worse error. A run that reaches\n * either edge of the month is clipped there rather than extrapolated, so\n * `Retrograde Aug 1 - Aug 31` means what it says: retrograde on every day this\n * month.\n *\n * **No coordinate-system badge, deliberately.** The Western endpoint is always\n * tropical, but the Vedic one takes `coordinateSystem` as a REQUEST parameter\n * (`sidereal` by default, `tropical` on request) and echoes nothing about it in\n * the response, and neither response carries a `frame`. A card cannot label a\n * zodiac it was not told, and a wrong frame label on an ephemeris is worse than\n * none, so the roster of bodies is left to say what it says.\n *\n * `hide-readings` is a no-op here: neither endpoint returns a word of\n * interpretation, so there is nothing to take away.\n */\n@customElement('roxy-ephemeris-table')\nexport class RoxyEphemerisTable extends RoxyDataElement<EphemerisResponse> {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tcss`.wrap{background:var(--roxy-surface,#fff);width:100%;color:var(--roxy-fg,#0a0a0a);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-lg,1.5rem);box-shadow:var(--roxy-shadow-sm);gap:var(--roxy-space-md,1rem);grid-template-columns:minmax(0,1fr);display:grid}header{justify-content:space-between;align-items:baseline;gap:var(--roxy-space-sm,.5rem) var(--roxy-space-md,1rem);flex-wrap:wrap;display:flex}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-primary,#0f172a);margin:0}.month{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-sm,.875rem);gap:var(--roxy-space-xs,.25rem) var(--roxy-space-sm,.5rem);flex-wrap:wrap;margin:0;display:flex}.basis{font-variant-numeric:tabular-nums}.wrap>*{min-width:0}h3{margin:0 0 var(--roxy-space-xs,.25rem);font-size:var(--roxy-text-xs,.75rem);font-weight:var(--roxy-weight-bold,600);text-transform:uppercase;letter-spacing:.06em;color:var(--roxy-muted,#71717a)}.tracks{background:var(--roxy-border,#e4e4e7);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);grid-template-columns:minmax(0,1fr);gap:1px;display:grid;overflow:hidden}.track{align-items:center;gap:var(--roxy-space-xs,.25rem) var(--roxy-space-sm,.5rem);padding:6px var(--roxy-space-sm,.5rem);background:var(--roxy-surface,#fff);font-size:var(--roxy-text-sm,.875rem);flex-wrap:wrap;display:flex}.body-name{align-items:baseline;gap:.35rem;min-width:8.5rem;font-weight:500;display:inline-flex}.body-name .glyph{color:var(--roxy-accent-ink,#b45309);font-size:1.1em}.span{color:var(--roxy-secondary,#475569);font-variant-numeric:tabular-nums;white-space:nowrap;align-items:baseline;gap:.3rem;display:inline-flex}.arrow{color:var(--roxy-muted,#71717a)}.chip-date{color:var(--roxy-secondary,#475569)}.chips{gap:var(--roxy-space-xs,.25rem);flex-wrap:wrap;margin-left:auto;display:flex}.chip{border-radius:var(--roxy-radius-full,9999px);font-size:var(--roxy-text-xs,.75rem);white-space:nowrap;align-items:baseline;gap:.25rem;padding:1px 8px;display:inline-flex}.chip--ingress{background:color-mix(in srgb, var(--roxy-accent,#f59e0b) 14%, transparent);color:var(--roxy-fg,#0a0a0a)}.chip--retro{background:color-mix(in srgb, var(--roxy-danger,#dc2626) 10%, transparent);color:var(--roxy-danger-fg,#991b1b);font-weight:var(--roxy-weight-bold,600)}.scroll:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b);outline-offset:2px}.scroll{border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);-webkit-overflow-scrolling:touch;min-width:0;overflow-x:auto}table{border-collapse:collapse;font-size:var(--roxy-text-xs,.75rem)}th,td{text-align:left;border-bottom:1px solid var(--roxy-border,#e4e4e7);white-space:nowrap;padding:4px 8px}thead th{color:var(--roxy-muted,#71717a);font-weight:var(--roxy-weight-bold,600);background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 20%, transparent)}thead th .glyph{color:var(--roxy-fg,#0a0a0a);font-size:1.15em}th.day{z-index:1;background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a);font-variant-numeric:tabular-nums;border-right:1px solid var(--roxy-border,#e4e4e7);font-weight:500;position:sticky;left:0}thead th.day{z-index:2;background:var(--roxy-surface,#fff)}td{font-variant-numeric:tabular-nums}.sg{color:var(--roxy-secondary,#475569);font-variant-numeric:normal;margin:0 .15em}.retro-mark{font-weight:var(--roxy-weight-bold,600);margin-left:.25em}td.retro{background:color-mix(in srgb, var(--roxy-danger,#dc2626) 10%, transparent);color:var(--roxy-danger-fg,#991b1b)}td.retro .sg{color:inherit}td.ingress{box-shadow:inset 3px 0 var(--roxy-accent-ink,#b45309);font-weight:var(--roxy-weight-bold,600)}td.station{border-top:2px solid var(--roxy-danger-fg,#991b1b);font-weight:var(--roxy-weight-bold,600)}`,\n\t];\n\n\t/** Override the card heading. Empty keeps the default, which is translated like every other chrome string. */\n\t@property({ type: String })\n\theading = 'Ephemeris';\n\n\tprotected renderEmpty() {\n\t\treturn html`<div class=\"roxy-empty\" role=\"status\">${this.t('No ephemeris data')}</div>`;\n\t}\n\n\tprotected renderData(data: EphemerisResponse) {\n\t\tif (!data.days?.length) return this.renderEmpty();\n\t\tconst vm = this.toViewModel(data);\n\t\tconst locale = this.effectiveLang();\n\t\treturn html`<div class=\"wrap\" part=\"card\"><header part=\"header\"><h2 class=\"title\">${this.t(this.heading)}</h2><p class=\"month\"><span>${formatMonthYear(locale, vm.year, vm.month)}</span><span class=\"basis\">${SAMPLE_INSTANT}</span></p></header><section part=\"section changes\"><h3>${this.t('Sign changes and retrograde periods')}</h3><div class=\"tracks\" role=\"list\">${vm.bodies.map((b) => this.renderTrack(b))}</div></section><section part=\"section daily\"><h3>${this.t('Daily positions')}</h3><div class=\"scroll\" part=\"table\" aria-label=\"${this.t('Daily positions')}\" tabindex=\"0\">${this.renderGrid(vm)}</div></section></div>`;\n\t}\n\n\t/** One body across the month: where it started, where it ended, and every change in between. */\n\tprivate renderTrack(b: BodyTrack) {\n\t\tconst glyph = planetGlyph(b.name);\n\t\treturn html`<div class=\"track\" role=\"listitem\"><span class=\"body-name\">${glyph ? html`<span class=\"glyph\" aria-hidden=\"true\">${glyph}</span>` : nothing}${b.label} </span><span class=\"span\">${this.renderPosition(b.first)}<span class=\"arrow\" aria-hidden=\"true\">\u2192</span>${this.renderPosition(b.last)} </span>${\n\t\t\t\tb.ingresses.length || b.retrogrades.length\n\t\t\t\t\t? html`<span class=\"chips\">${b.ingresses.map((i) => this.renderIngressChip(i))} ${b.retrogrades.map((r) => this.renderRetrogradeChip(r))}</span>`\n\t\t\t\t\t: nothing\n\t\t\t}</div>`;\n\t}\n\n\t/**\n\t * A longitude the way a published ephemeris prints one: `9\u264C16`, degree then\n\t * sign then minutes. The sign name rides on the `title` for a reader who does\n\t * not read glyphs, and it is the localized half.\n\t */\n\tprivate renderPosition(p: Position) {\n\t\tconst { degree, minute } = splitDegreeInSign(p.degreeInSign);\n\t\tconst g = signGlyph(p.sign);\n\t\tconst label = display(p, 'sign');\n\t\treturn html`<span class=\"pos\" title=\"${label}\">${degree}${\n\t\t\t\tg\n\t\t\t\t\t? html`<span class=\"sg\" aria-hidden=\"true\">${g}</span>`\n\t\t\t\t\t: html`<span class=\"sg\">${label}</span>`\n\t\t\t}${String(minute).padStart(2, '0')}</span>`;\n\t}\n\n\tprivate renderIngressChip(i: Ingress) {\n\t\tconst g = signGlyph(i.sign);\n\t\tconst date = formatMonthDay(this.effectiveLang(), i.date);\n\t\treturn html`<span class=\"chip chip--ingress\" aria-label=\"${this.t('Enters {{sign}} on {{date}}', { sign: i.signLabel, date })}\"><span aria-hidden=\"true\">\u2192</span>${g ? html`<span aria-hidden=\"true\">${g}</span>` : nothing}${i.signLabel} <span class=\"chip-date\">${date}</span></span>`;\n\t}\n\n\tprivate renderRetrogradeChip(r: RetrogradeRun) {\n\t\tconst locale = this.effectiveLang();\n\t\tconst start = formatMonthDay(locale, r.start);\n\t\tconst end = formatMonthDay(locale, r.end);\n\t\tconst range = start === end ? start : `${start} - ${end}`;\n\t\treturn html`<span class=\"chip chip--retro\"><span aria-hidden=\"true\">\u211E</span>${this.t('Retrograde {{range}}', { range })}</span>`;\n\t}\n\n\t/** The reference ephemeris: one row per day, one column per body, in the order the response lists them. */\n\tprivate renderGrid(vm: ViewModel) {\n\t\tconst locale = this.effectiveLang();\n\t\treturn html`<table><caption class=\"roxy-sr-only\">${this.t('Every body with its position on each day of the month, as a zodiac sign and a degree.')}</caption><thead><tr><th scope=\"col\" class=\"day\">${this.t('Date')}</th>${vm.bodies.map((b) => {\n\t\t\t\t\t\tconst glyph = planetGlyph(b.name);\n\t\t\t\t\t\treturn html`<th scope=\"col\" title=\"${b.label}\">${\n\t\t\t\t\t\t\t\tglyph\n\t\t\t\t\t\t\t\t\t? html`<span class=\"glyph\" aria-hidden=\"true\">${glyph}</span><span class=\"roxy-sr-only\">${b.label}</span>`\n\t\t\t\t\t\t\t\t\t: b.label\n\t\t\t\t\t\t\t}</th>`;\n\t\t\t\t\t})}</tr></thead><tbody>${vm.rows.map(\n\t\t\t\t\t(row) => html`<tr><th scope=\"row\" class=\"day\">${formatWeekdayDay(locale, row.date)}</th>${row.cells.map((cell, i) => this.renderCell(cell, vm.bodies[i], row.date))}</tr>`,\n\t\t\t\t)}</tbody></table>`;\n\t}\n\n\tprivate renderCell(\n\t\tcell: Position | undefined,\n\t\tbody: BodyTrack | undefined,\n\t\tdate: string,\n\t) {\n\t\tif (!cell) return html`<td>\u2014</td>`;\n\t\tconst classes = [\n\t\t\tcell.isRetrograde ? 'retro' : '',\n\t\t\tbody?.ingressDates.has(date) ? 'ingress' : '',\n\t\t\tbody?.stationDates.has(date) ? 'station' : '',\n\t\t]\n\t\t\t.filter(Boolean)\n\t\t\t.join(' ');\n\t\treturn html`<td class=\"${classes}\">${this.renderPosition(cell)}${\n\t\t\t\tcell.isRetrograde\n\t\t\t\t\t? html`<span class=\"retro-mark\" aria-label=\"${this.t('retrograde')}\">\u211E</span>`\n\t\t\t\t\t: nothing\n\t\t\t}</td>`;\n\t}\n\n\t/**\n\t * Walk the month once, keying every body on its canonical English name.\n\t *\n\t * @remarks\n\t * The column order is the order the response lists bodies on its first day,\n\t * which is the order each domain reads them in (Sun through Pluto then the\n\t * nodes, Chiron and Black Moon Lilith for the Western set; the Navagraha in\n\t * vara order for the Vedic one). A body that only appears on a later day is\n\t * appended rather than dropped, and a body missing from a given day leaves\n\t * that one cell empty instead of shifting the row.\n\t */\n\tprivate toViewModel(data: EphemerisResponse): ViewModel {\n\t\tconst order: string[] = [];\n\t\tconst series = new Map<string, Array<{ date: string; p: Position }>>();\n\t\tfor (const day of data.days) {\n\t\t\tfor (const p of day.positions) {\n\t\t\t\tlet samples = series.get(p.planet);\n\t\t\t\tif (!samples) {\n\t\t\t\t\tsamples = [];\n\t\t\t\t\tseries.set(p.planet, samples);\n\t\t\t\t\torder.push(p.planet);\n\t\t\t\t}\n\t\t\t\tsamples.push({ date: day.date, p });\n\t\t\t}\n\t\t}\n\n\t\tconst bodies: BodyTrack[] = [];\n\t\tfor (const name of order) {\n\t\t\tconst samples = series.get(name);\n\t\t\tconst first = samples?.[0];\n\t\t\tconst last = samples?.[samples.length - 1];\n\t\t\tif (!samples || !first || !last) continue;\n\t\t\tconst ingresses: Ingress[] = [];\n\t\t\tconst retrogrades: RetrogradeRun[] = [];\n\t\t\tconst ingressDates = new Set<string>();\n\t\t\tconst stationDates = new Set<string>();\n\t\t\tfor (let i = 0; i < samples.length; i++) {\n\t\t\t\tconst cur = samples[i];\n\t\t\t\tconst prev = samples[i - 1];\n\t\t\t\tif (!cur) continue;\n\t\t\t\tif (prev && cur.p.sign !== prev.p.sign) {\n\t\t\t\t\tingresses.push({\n\t\t\t\t\t\tdate: cur.date,\n\t\t\t\t\t\tsign: cur.p.sign,\n\t\t\t\t\t\tsignLabel: display(cur.p, 'sign'),\n\t\t\t\t\t});\n\t\t\t\t\tingressDates.add(cur.date);\n\t\t\t\t}\n\t\t\t\t// A direction change is only observable against a previous day, so a\n\t\t\t\t// body that is already retrograde on the first of the month stationed\n\t\t\t\t// before this page begins and is not marked as stationing on it.\n\t\t\t\tif (prev && cur.p.isRetrograde !== prev.p.isRetrograde)\n\t\t\t\t\tstationDates.add(cur.date);\n\t\t\t\tif (!cur.p.isRetrograde) continue;\n\t\t\t\t// Extend the run in progress only when yesterday was retrograde too, so\n\t\t\t\t// a body that stations twice in one month gets two chips rather than one\n\t\t\t\t// spanning the direct stretch between them.\n\t\t\t\tconst open = retrogrades[retrogrades.length - 1];\n\t\t\t\tif (open && prev?.p.isRetrograde) open.end = cur.date;\n\t\t\t\telse retrogrades.push({ start: cur.date, end: cur.date });\n\t\t\t}\n\t\t\tbodies.push({\n\t\t\t\tname,\n\t\t\t\tlabel: display(last.p, 'planet'),\n\t\t\t\tfirst: first.p,\n\t\t\t\tlast: last.p,\n\t\t\t\tingresses,\n\t\t\t\tretrogrades,\n\t\t\t\tingressDates,\n\t\t\t\tstationDates,\n\t\t\t});\n\t\t}\n\n\t\tconst rows: DayRow[] = data.days.map((day) => {\n\t\t\tconst byName = new Map(day.positions.map((p) => [p.planet, p]));\n\t\t\treturn { date: day.date, cells: bodies.map((b) => byName.get(b.name)) };\n\t\t});\n\t\treturn { year: data.year, month: data.month, bodies, rows };\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-ephemeris-table': RoxyEphemerisTable;\n\t}\n}\n", "/**\n * Shared string helpers used across components. Single source of truth so the\n * same formatting rules apply to every key/label/title that surfaces in the\n * shadow tree.\n *\n * - `lookupKey`: the ONE normalizer every lookup table in this library is keyed\n * and read by (`tokens/index.ts` glyphs and abbreviations, `i18n/` chrome\n * strings).\n * - `capitalize`: title-cases the first character, lowercases the rest. A\n * DISPLAY helper only; it is not a lookup key (see `lookupKey`).\n * - `humanize`: turns an API key (`birth_date`, `birthDate`, `mahadasha-end`)\n * into a label suitable for display (\"Birth date\", \"Mahadasha end\").\n */\n\n/**\n * Fold a name to the canonical key its lookup table is stored under: lower case, every run of spaces, underscores and hyphens collapsed to one space, trimmed.\n *\n * @remarks\n * This exists because a GUESSED key spelling is a defect class this repo has now shipped twice. The glyph tables were keyed off whatever {@link capitalize} happened to produce (`North node`), while the API returns `North Node`, so every call site that reached the table without first calling `capitalize` missed and fell through to a fabricated abbreviation. Aspects hit the same wall from the other side: `/aspects` returns `SEMI SEXTILE` where synastry returns `SEMI_SEXTILE`.\n *\n * One normalizer, applied when a table is DEFINED and again when it is READ, removes the whole class: no call site has to remember a convention, and no table has to guess a spelling. Use it for every new table keyed by an API-supplied name.\n *\n * @example\n * ```ts\n * lookupKey('North Node'); // 'north node'\n * lookupKey('SEMI_SEXTILE'); // 'semi sextile'\n * lookupKey('semi-sextile'); // 'semi sextile'\n * ```\n */\nexport function lookupKey(s: string): string {\n\treturn s\n\t\t.toLowerCase()\n\t\t.replace(/[\\s_-]+/g, ' ')\n\t\t.trim();\n}\n\nexport function capitalize(s: string): string {\n\tif (!s) return '';\n\treturn s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();\n}\n\nexport function humanize(s: string): string {\n\treturn (\n\t\ts\n\t\t\t.replace(/[_-]+/g, ' ')\n\t\t\t.replace(/([a-z])([A-Z])/g, '$1 $2')\n\t\t\t// Split a trailing/embedded digit off a word so \"person1\" reads \"Person 1\"\n\t\t\t// and every group legend and field label spaces its ordinal.\n\t\t\t.replace(/([a-z])([0-9])/g, '$1 $2')\n\t\t\t.replace(/^\\w/, (c) => c.toUpperCase())\n\t);\n}\n", "/**\n * Symbol constants used across components. Single source of truth so chart\n * wheels, card headers, hexagram displays, and panchang tables stay visually\n * consistent.\n *\n * @remarks\n * **Every table here is keyed by {@link lookupKey} and read ONLY through the accessor beside it.** The raw records are deliberately not exported: a component that indexes a record directly has to guess the key convention, and a guessed spelling is what shipped `No North Node R`, `So South Node R` and `Bl Black Moon Lilith` into a live customer's natal chart. The API returns `North Node` with a space; the table was keyed `North node`, the spelling {@link capitalize} happens to produce, so every call site that forgot to call `capitalize` first missed the table.\n *\n * **A miss returns `undefined`, never a manufactured abbreviation.** The old `?? name.slice(0, 2)` fallback is what made the defect survive review: a failed lookup renders as a plausible two-letter code that reads exactly like an intentional abbreviation, so nothing about the output says \"this is broken\". A caller that can omit the glyph should omit it (`?? ''`); a caller that must show something falls back to the FULL name, which is visibly wrong at the size these slots are drawn.\n *\n * `tests/tokens.test.ts` resolves every body, sign and aspect name the committed spec can emit against these tables, so a vocabulary the API gains cannot ship unglyphed.\n */\n\nimport { lookupKey } from '../utils/string.js';\n\n/** Look one name up in a normalized table. The single read path for every map in this file. */\nconst resolve = (\n\ttable: Record<string, string>,\n\tname: string | undefined | null,\n): string | undefined => (name ? table[lookupKey(name)] : undefined);\n\nconst PLANET_GLYPH: Record<string, string> = {\n\tsun: '\u2609',\n\tmoon: '\u263D',\n\tmercury: '\u263F',\n\tvenus: '\u2640',\n\tearth: '\u2641',\n\tmars: '\u2642',\n\tjupiter: '\u2643',\n\tsaturn: '\u2644',\n\turanus: '\u2645',\n\tneptune: '\u2646',\n\tpluto: '\u2647',\n\trahu: '\u260A',\n\tketu: '\u260B',\n\tascendant: 'Asc',\n\tlagna: 'La',\n\t'north node': '\u260A',\n\t'south node': '\u260B',\n\tchiron: '\u26B7',\n\tlilith: '\u26B8',\n\t'black moon lilith': '\u26B8',\n};\n\n/** Astrological glyph for a planet or point, or `undefined` when the library has none for it. */\nexport const planetGlyph = (\n\tname: string | undefined | null,\n): string | undefined => resolve(PLANET_GLYPH, name);\n\nconst PLANET_ABBR: Record<string, string> = {\n\tsun: 'Su',\n\tmoon: 'Mo',\n\tmercury: 'Me',\n\tvenus: 'Ve',\n\tmars: 'Ma',\n\tjupiter: 'Ju',\n\tsaturn: 'Sa',\n\turanus: 'Ur',\n\tneptune: 'Ne',\n\tpluto: 'Pl',\n\trahu: 'Ra',\n\tketu: 'Ke',\n\tascendant: 'Asc',\n\tlagna: 'La',\n};\n\n/** Two-letter graha code for the tight cells of a North/South Indian kundli, or `undefined`. */\nexport const planetAbbr = (\n\tname: string | undefined | null,\n): string | undefined => resolve(PLANET_ABBR, name);\n\nconst SIGN_GLYPH: Record<string, string> = {\n\taries: '\u2648',\n\ttaurus: '\u2649',\n\tgemini: '\u264A',\n\tcancer: '\u264B',\n\tleo: '\u264C',\n\tvirgo: '\u264D',\n\tlibra: '\u264E',\n\tscorpio: '\u264F',\n\tsagittarius: '\u2650',\n\tcapricorn: '\u2651',\n\taquarius: '\u2652',\n\tpisces: '\u2653',\n};\n\n/** Zodiac glyph for a sign name in any case, or `undefined`. */\nexport const signGlyph = (\n\tname: string | undefined | null,\n): string | undefined => resolve(SIGN_GLYPH, name);\n\nconst SIGN_ABBR: Record<string, string> = {\n\taries: 'Ar',\n\ttaurus: 'Ta',\n\tgemini: 'Ge',\n\tcancer: 'Cn',\n\tleo: 'Le',\n\tvirgo: 'Vi',\n\tlibra: 'Li',\n\tscorpio: 'Sc',\n\tsagittarius: 'Sg',\n\tcapricorn: 'Cp',\n\taquarius: 'Aq',\n\tpisces: 'Pi',\n};\n\n/** Two-letter rashi code for kundli cells and grid headers, or `undefined`. */\nexport const signAbbr = (name: string | undefined | null): string | undefined =>\n\tresolve(SIGN_ABBR, name);\n\n/** The twelve signs in zodiacal order. Display values, not lookup keys: read them through {@link signGlyph} / {@link signAbbr}. */\nexport const SIGNS_ORDER = [\n\t'Aries',\n\t'Taurus',\n\t'Gemini',\n\t'Cancer',\n\t'Leo',\n\t'Virgo',\n\t'Libra',\n\t'Scorpio',\n\t'Sagittarius',\n\t'Capricorn',\n\t'Aquarius',\n\t'Pisces',\n] as const;\n\n/**\n * Glyph per aspect. Used by the natal, transit and synastry aspect tables.\n *\n * @remarks\n * These are the nine aspects Unicode itself defines as a set, in its Miscellaneous Symbols block note: `260C, 26BA, 2220, 26B9, 25A1, 25B3, 26BC, 26BB, 260D` for 0, 30, 45, 60, 90, 120, 135, 150 and 180 degrees. That is exactly the vocabulary the API returns, so every aspect resolves to a real glyph and none falls through to a truncated slug.\n *\n * Do not substitute the visually similar maths operators. Unicode lists `\u22BB` XOR and `\u22BC` NAND as cross-references FROM the real quincunx and semisextile glyphs, so they look like safe stand-ins and are easy to pair the wrong way round, which renders a 150 degree quincunx with the 30 degree semisextile symbol. An astrologer reads the glyph, not the tooltip.\n */\nconst ASPECT_SYMBOL: Record<string, string> = {\n\tconjunction: '\u260C',\n\tsemisextile: '\u26BA',\n\t'semi sextile': '\u26BA',\n\tsemisquare: '\u2220',\n\t'semi square': '\u2220',\n\tsextile: '\u26B9',\n\tsquare: '\u25A1',\n\ttrine: '\u25B3',\n\tsesquiquadrate: '\u26BC',\n\tquincunx: '\u26BB',\n\topposition: '\u260D',\n};\n\n/** Aspect glyph for any of the separator forms the endpoints use (`SEMI_SEXTILE`, `SEMI SEXTILE`, `semi-sextile`), or `undefined`. */\nexport const aspectSymbol = (\n\tname: string | undefined | null,\n): string | undefined => resolve(ASPECT_SYMBOL, name);\n\n/** Trigrams used by I Ching hexagrams. Eight trigrams compose 64 hexagrams. */\nconst TRIGRAM_GLYPH: Record<string, string> = {\n\theaven: '\u2630',\n\tlake: '\u2631',\n\tfire: '\u2632',\n\tthunder: '\u2633',\n\twind: '\u2634',\n\twater: '\u2635',\n\tmountain: '\u2636',\n\tearth: '\u2637',\n};\n\n/** Trigram glyph for a trigram name in any case, or `undefined`. */\nexport const trigramGlyph = (\n\tname: string | undefined | null,\n): string | undefined => resolve(TRIGRAM_GLYPH, name);\n\n/** Moon phase emoji set. Used by the moon phase card. */\nconst MOON_PHASE_EMOJI: Record<string, string> = {\n\t'new moon': '\uD83C\uDF11',\n\t'waxing crescent': '\uD83C\uDF12',\n\t'first quarter': '\uD83C\uDF13',\n\t'waxing gibbous': '\uD83C\uDF14',\n\t'full moon': '\uD83C\uDF15',\n\t'waning gibbous': '\uD83C\uDF16',\n\t'last quarter': '\uD83C\uDF17',\n\t'waning crescent': '\uD83C\uDF18',\n};\n\n/**\n * Emoji for a lunar phase, or `undefined`.\n *\n * @remarks\n * The live API suffixes most phase names (`Waxing Gibbous Moon`) and calls the third quarter `Third Quarter Moon`, while only new and full moon carry the suffix in the table. Both reconciliations live here rather than in the card, so any component reading a phase name resolves the same eight phases from the same four spellings.\n */\nexport const moonPhaseEmoji = (\n\tname: string | undefined | null,\n): string | undefined => {\n\tif (!name) return undefined;\n\tconst key = lookupKey(name);\n\tconst bare = key.replace(/ moon$/, '');\n\tconst alias = bare === 'third quarter' ? 'last quarter' : bare;\n\treturn MOON_PHASE_EMOJI[key] ?? MOON_PHASE_EMOJI[alias];\n};\n", "import {\n\ttype CSSResultGroup,\n\thtml,\n\tLitElement,\n\tnothing,\n\ttype PropertyValues,\n} from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { resolveLang } from '../i18n/lang.js';\nimport { LocaleController } from '../i18n/locale-controller.js';\nimport { translate } from '../i18n/registry.js';\nimport { baseStyles } from './base-styles.js';\nimport { buildRequest, FetchController } from './fetch-controller.js';\nimport {\n\ttype InterpSection,\n\trenderInterpAccordion,\n} from './interp-accordion.js';\nimport { MarkupDataController } from './markup-data.js';\n\n/**\n * Shared base for every data-driven Roxy component. Consolidates the things every component used to repeat by hand and adds the self-contained, drop-in behavior: controlled-mode hydration, an opt-in self-fetch (form, request, loading, error, empty), the typed `data` slot, and the render switch. A subclass implements one method, {@link RoxyDataElement.renderData}.\n *\n * @remarks\n * Two render modes, one component, which is the whole drop-in contract:\n *\n * - Controlled: a server (WordPress, JSX SSR, static HTML) fetches the response and injects it as a direct-child `<script type=\"application/json\" class=\"roxy-data\">`. {@link MarkupDataController} hydrates `data` from it on connect. No key reaches the browser. This is the path the WordPress plugin drives, and it is unchanged by the base class.\n * - Uncontrolled: no data is injected, but a `data-endpoint` and a `pk_` `publishable-key` are set. The component renders its own `<roxy-endpoint-form>` (an internal detail, never placed by the consumer), and on submit fetches through {@link FetchController}, which refuses any non-publishable key. The result populates `data` and the component renders it.\n *\n * The JavaScript `data` property always wins over markup, so a host that assigns `el.data = \u2026` after upgrade is authoritative.\n *\n * Self-fetch needs `<roxy-endpoint-form>` (and `<roxy-location-search>`) registered. The CDN bundle and the full `@roxyapi/ui` entry register everything; per-component ESM consumers that want self-fetch import the form component too.\n *\n * Two things every subclass inherits for the host page to shape the render from outside the shadow root, with no JavaScript: the `hide-readings` attribute ({@link RoxyDataElement.hideReadings}), and the `part` names on the base's own branches (`form`, `loading`, `error`, `edit-bar`, `attribution`). A component adds `part` to its own structural blocks; the vocabulary is in `docs/authoring.md`.\n *\n * @example\n * ```ts\n * @customElement('roxy-dream-card')\n * export class RoxyDreamCard extends RoxyDataElement<GetDreamSymbolResponse> {\n * static styles = [baseStyles, css`.card { \u2026 }`];\n * protected renderData(d: GetDreamSymbolResponse) {\n * return html`<article class=\"card\">\u2026</article>`;\n * }\n * protected renderEmpty() {\n * return html`<div class=\"roxy-empty\" role=\"status\">No dream symbol</div>`;\n * }\n * }\n * ```\n */\nexport abstract class RoxyDataElement<T = unknown> extends LitElement {\n\tstatic styles: CSSResultGroup = [baseStyles];\n\n\t/** Typed RoxyAPI response. Assigned in JavaScript, hydrated from the roxy-data island, or set by a self-fetch. */\n\t@property({ attribute: false })\n\tdata: T | null = null;\n\n\t/** Endpoint path for self-fetch, e.g. \"astrology/natal-chart\" or \"dreams/symbols/{id}\". Empty disables self-fetch (controlled mode only). */\n\t@property({ type: String, attribute: 'data-endpoint' })\n\tendpoint = '';\n\n\t/** HTTP method for self-fetch. */\n\t@property({ type: String })\n\tmethod: 'GET' | 'POST' = 'POST';\n\n\t/** Browser-safe publishable key (pk_) for self-fetch. A secret key is refused client-side. */\n\t@property({ type: String, attribute: 'publishable-key' })\n\tpublishableKey?: string;\n\n\t/** Override the API origin for self-hosted or proxied deployments. */\n\t@property({ type: String, attribute: 'base-url' })\n\tbaseUrl?: string;\n\n\t/** Override the OpenAPI spec URL the self-fetch form introspects. */\n\t@property({ type: String, attribute: 'spec-url' })\n\tspecUrl?: string;\n\n\t/** Consumer backend route that proxies the request (holds the secret key). When set, self-fetch POSTs the request here instead of calling RoxyAPI directly, so no key reaches the browser. The server-rendered (WordPress) path. */\n\t@property({ type: String, attribute: 'submit-url' })\n\tsubmitUrl?: string;\n\n\t/** Persist the last self-fetch form values in sessionStorage (keyed by endpoint) and prefill the form on reload. */\n\t@property({ type: Boolean })\n\tremember = false;\n\n\t/**\n\t * Render the chart and the data, and omit the written interpretation. Off by default, so a component that does not set it is byte-identical to before.\n\t *\n\t * @remarks\n\t * The suppressed content is the prose an endpoint returns ABOUT the result: the interpretation accordion, the interpretive paragraphs, and the keyword chips that belong to them. Everything a practitioner reads the numbers off stays: wheels, tables, grids, legends, pills, counts and dates. The reading is dropped from the DOM rather than hidden with CSS, so a page that publishes the chart alone never ships the prose it is not showing.\n\t *\n\t * Set it when the page supplies its own words, which is the common case for a practitioner site that wants the graphic under its own writing.\n\t */\n\t@property({ type: Boolean, attribute: 'hide-readings', reflect: true })\n\thideReadings = false;\n\n\t/** Override the self-fetch form's submit-button label. Empty derives one from the endpoint. */\n\t@property({ type: String, attribute: 'submit-label' })\n\tsubmitLabel?: string;\n\n\t/** Render a small \"Spiritual data by RoxyAPI\" credit under a self-fetch or auto-mount result. Off by default; any value except \"off\"/\"false\" enables it. The one-tag widgets script turns it on unless data-attribution=\"off\". Never shown in controlled mode. */\n\t@property({ type: String })\n\tattribution?: string;\n\n\t/** True while an uncontrolled self-fetch is in flight. Public so {@link FetchController} can drive it. */\n\t@state()\n\tloading = false;\n\n\t/** Message from a failed self-fetch, or null. Public so {@link FetchController} can drive it. */\n\t@state()\n\terror: string | null = null;\n\n\t/**\n\t * True once a self-fetch (not a consumer-assigned or island-hydrated `data`) produced the current result. It gates the interactive result affordances, so controlled mode never shows an Edit control or a sticky picker.\n\t */\n\t@state()\n\tprivate selfFetched = false;\n\n\t/** True when the visitor asked to edit a self-fetch result, so the form is restored over the result. */\n\t@state()\n\tprivate editing = false;\n\n\t/** True when the last self-fetch form was a single-enum picker, so it stays visible above the result and a change refetches. */\n\t@state()\n\tprivate sticky = false;\n\n\t/** Last submitted form values (nested per group), kept in memory to restore the form on Edit and to prefill the sticky picker. */\n\tprivate lastValues?: Record<string, unknown>;\n\n\tprivate fetcher: FetchController<T>;\n\n\tconstructor() {\n\t\tsuper();\n\t\t// Controlled mode: hydrate `data` from a direct-child roxy-data island when\n\t\t// no JS property was assigned. Keyless; the server already fetched.\n\t\tnew MarkupDataController<T>(this);\n\t\t// Re-render if a chrome-string catalogue lands after this element upgraded.\n\t\tnew LocaleController(this);\n\t\tthis.fetcher = new FetchController<T>(this);\n\t}\n\n\t/**\n\t * The chrome string for this element's language, keyed by its own English source text.\n\t *\n\t * @remarks\n\t * Pass the English copy, never a key. With no catalogue registered the source string is returned unchanged, so an English page pays nothing and a language we do not ship degrades to English rather than to a visible key.\n\t *\n\t * Chrome only. A value the API returned (a planet, a sign, an aspect, a house system) is NOT translated here: it is rendered as the response carries it, so the words on the chart and the words in the response can never disagree.\n\t *\n\t * @example\n\t * ```ts\n\t * this.t('Aspect grid'); // 'Cuadricula de aspectos' under lang=\"es\"\n\t * this.t('{{count}} planets', { count: 12 }); // '12 planetas'\n\t * ```\n\t */\n\tprotected t(source: string, vars?: Record<string, string | number>): string {\n\t\treturn translate(this.effectiveLang(), source, vars);\n\t}\n\n\t/** {@link RoxyDataElement.t} as a value, bound once, for a shared render helper that has no host of its own and therefore cannot resolve a page language (`utils/hd-reading.ts`). Named `translator` and not `translate` because `HTMLElement.translate` is a real DOM property and shadowing it with a protected member makes every `@customElement` decorator in the library fail to typecheck. */\n\tprotected readonly translator = (\n\t\tsource: string,\n\t\tvars?: Record<string, string | number>,\n\t): string => this.t(source, vars);\n\n\tprotected willUpdate(changed: PropertyValues): void {\n\t\tif (changed.has('publishableKey')) {\n\t\t\tthis.fetcher.publishableKey = this.publishableKey;\n\t\t}\n\t\tif (changed.has('baseUrl') && this.baseUrl) {\n\t\t\tthis.fetcher.baseUrl = this.baseUrl;\n\t\t}\n\t\tif (changed.has('submitUrl')) {\n\t\t\tthis.fetcher.submitUrl = this.submitUrl;\n\t\t}\n\t}\n\n\trender(): unknown {\n\t\tif (this.loading) return this.renderLoading();\n\t\tif (this.error != null) return this.renderError(this.error);\n\t\tif (this.data != null) {\n\t\t\t// Controlled mode (consumer-assigned or island-hydrated data) renders the\n\t\t\t// result alone, byte-identical to before: no picker, no Edit. The one\n\t\t\t// exception is the widgets auto-mount attrs-complete path, which assigns\n\t\t\t// data directly AND sets `attribution`; a real controlled consumer never\n\t\t\t// sets the attribute, so this stays byte-identical for them.\n\t\t\tif (!this.selfFetched) {\n\t\t\t\treturn this.showAttribution()\n\t\t\t\t\t? html`${this.renderData(this.data)}${this.renderAttribution()}`\n\t\t\t\t\t: this.renderData(this.data);\n\t\t\t}\n\t\t\tif (this.editing) return this.renderForm();\n\t\t\treturn this.renderResult(this.data);\n\t\t}\n\t\treturn this.renderNoData();\n\t}\n\n\t/** Render the populated response. The single method every component implements. */\n\tprotected abstract renderData(data: T): unknown;\n\n\t/**\n\t * The interpretation accordion, gated by {@link RoxyDataElement.hideReadings}. Every component that shows a written reading routes through here instead of calling {@link renderInterpAccordion} directly.\n\t *\n\t * @remarks\n\t * The gate lives on the base rather than in each component because the property does, and a plain render function cannot read component state. One call site per accordion, one place that decides whether prose renders, and the section it emits carries the same `readings` part in every component.\n\t *\n\t * Prose that is NOT in an accordion (a summary paragraph, a per-item interpretation) is still the component's own to gate, since only the component knows which of its blocks are readings.\n\t */\n\tprotected renderInterpretation(\n\t\tsections: InterpSection[],\n\t\tname: string,\n\t\theading?: string,\n\t): unknown {\n\t\tif (this.hideReadings) return nothing;\n\t\t// The default heading is localized HERE rather than in the accordion:\n\t\t// that is a plain render function with no host, so it cannot read a\n\t\t// language, and this is the one call site every component routes through.\n\t\treturn renderInterpAccordion(sections, name, heading ?? this.t('Reading'));\n\t}\n\n\t/**\n\t * A self-fetch result plus its re-query affordance. A single-enum form keeps its picker above the result so a new selection refetches (a sign switch is a new reading); any other form gets a compact Edit control that restores the form with the previous values.\n\t */\n\tprotected renderResult(data: T): unknown {\n\t\tconst body = this.sticky\n\t\t\t? html`${this.renderForm()}${this.renderData(data)}`\n\t\t\t: html`<div class=\"roxy-edit-bar\" part=\"edit-bar\"><button type=\"button\" class=\"roxy-edit\" @click=\"${this.onEdit}\">${this.t('Edit query')}</button></div>${this.renderData(data)}`;\n\t\treturn this.showAttribution()\n\t\t\t? html`${body}${this.renderAttribution()}`\n\t\t\t: body;\n\t}\n\n\tprivate onEdit = () => {\n\t\tthis.editing = true;\n\t};\n\n\t/** True when the attribution credit renders: the attribute is present and not explicitly disabled. */\n\tprivate showAttribution(): boolean {\n\t\treturn (\n\t\t\tthis.attribution != null &&\n\t\t\tthis.attribution !== 'off' &&\n\t\t\tthis.attribution !== 'false'\n\t\t);\n\t}\n\n\t/** Small muted credit under a self-fetch or auto-mount result. Reached only from the result path, so controlled mode never renders it. */\n\tprotected renderAttribution(): unknown {\n\t\treturn html`<div class=\"roxy-attribution\" part=\"attribution\"><a href=\"https://roxyapi.com/?utm_source=widget&utm_medium=embed\" target=\"_blank\" rel=\"noopener\">${this.t('Spiritual data by RoxyAPI')}</a></div>`;\n\t}\n\n\t/** The data-absent branch: the self-fetch form when an endpoint is set, otherwise the empty state. */\n\tprotected renderNoData(): unknown {\n\t\treturn this.endpoint ? this.renderForm() : this.renderEmpty();\n\t}\n\n\t/** Internal self-fetch form. Reuses the introspecting `<roxy-endpoint-form>`; the consumer never places it. */\n\tprotected renderForm(): unknown {\n\t\treturn html`<roxy-endpoint-form part=\"form\" data-endpoint=\"${this.endpoint}\" method=\"${this.method}\" spec-url=\"${ifDefined(this.specUrl)}\" publishable-key=\"${ifDefined(this.publishableKey)}\" submit-label=\"${ifDefined(this.submitLabel)}\" lang=\"${ifDefined(this.effectiveLang())}\" .initialValues=\"${this.formInitialValues()}\" @roxy-submit=\"${this.onFormSubmit}\"></roxy-endpoint-form>`;\n\t}\n\n\t/** Prefill source for the form: the last submission (Edit / sticky refetch) wins over remembered storage. */\n\tprivate formInitialValues(): Record<string, unknown> | undefined {\n\t\treturn (\n\t\t\tthis.lastValues ?? (this.remember ? this.readRemembered() : undefined)\n\t\t);\n\t}\n\n\t/**\n\t * Site-owner language for this element: the `lang` attribute, the nearest ancestor carrying one, or the document. Protected so a component that composes another can forward it (a child inside this shadow root cannot reach the host page on its own).\n\t *\n\t * Full tag, region included. The truncation to what `?lang=` accepts happens where the request is built, in `<roxy-endpoint-form>`.\n\t */\n\tprotected effectiveLang(): string | undefined {\n\t\treturn resolveLang(this);\n\t}\n\n\tprivate onFormSubmit = (e: Event) => {\n\t\tconst detail = (e as CustomEvent).detail as {\n\t\t\tvalues: Record<string, unknown>;\n\t\t\tqueryKeys?: string[];\n\t\t\tsticky?: boolean;\n\t\t};\n\t\tthis.lastValues = detail.values;\n\t\tthis.sticky = !!detail.sticky;\n\t\tthis.selfFetched = true;\n\t\tthis.editing = false;\n\t\tif (this.remember) this.writeRemembered(detail.values);\n\t\tvoid this.fetcher.run(\n\t\t\tbuildRequest(\n\t\t\t\tthis.endpoint,\n\t\t\t\tthis.method,\n\t\t\t\tdetail.values,\n\t\t\t\tdetail.queryKeys ?? [],\n\t\t\t),\n\t\t);\n\t};\n\n\t/** sessionStorage key for this component's remembered form values, scoped by endpoint. */\n\tprivate rememberKey(): string {\n\t\treturn `roxy-ui:form:${this.endpoint}`;\n\t}\n\n\tprivate readRemembered(): Record<string, unknown> | undefined {\n\t\ttry {\n\t\t\tconst raw = sessionStorage.getItem(this.rememberKey());\n\t\t\treturn raw ? (JSON.parse(raw) as Record<string, unknown>) : undefined;\n\t\t} catch {\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tprivate writeRemembered(values: Record<string, unknown>): void {\n\t\ttry {\n\t\t\tsessionStorage.setItem(this.rememberKey(), JSON.stringify(values));\n\t\t} catch {\n\t\t\t// Private mode / disabled storage: remembering is best-effort, never fatal.\n\t\t}\n\t}\n\n\t/** Terminal empty state. Subclasses override for a domain-specific message. */\n\tprotected renderEmpty(): unknown {\n\t\treturn html`<div class=\"roxy-empty\" role=\"status\">${this.t('No data')}</div>`;\n\t}\n\n\t/** Loading placeholder shown during a self-fetch. */\n\tprotected renderLoading(): unknown {\n\t\treturn html`<div class=\"roxy-skeleton\" style=\"height:8rem\" role=\"status\" aria-label=\"${this.t('Loading')}\" part=\"loading\"></div>`;\n\t}\n\n\t/** Error state shown when a self-fetch fails. Keeps the form in view so the request can be retried. */\n\tprotected renderError(message: string): unknown {\n\t\tconst banner = html`<div class=\"roxy-error\" role=\"alert\" part=\"error\">${message}</div>`;\n\t\treturn this.endpoint ? html`${banner}${this.renderForm()}` : banner;\n\t}\n}\n", "/**\n * Where a component's language comes from, and what is safe to send to the API.\n *\n * @remarks\n * Two different answers, and conflating them is the whole reason this file is separate from the catalogue:\n *\n * - {@link resolveLang} answers \"what language is this PAGE in\", and keeps the full tag, because `es-AR` is a legitimate thing for a catalogue to want to differ on.\n * - {@link apiLang} answers \"what may go on the query string\", which is a narrower question with a hard edge: `?lang=es-AR` is a 400, `?lang=es` is a 200.\n *\n * The full tag is not a nicety the catalogue happens to tolerate: `utils/format.ts` hands it to `Intl`, which reads the region and writes `15 de ene de 1990` for `es-AR` where it writes `15 ene 1990` for `es`. Passing the API answer to a formatter demotes every regional visitor to the base language and nothing fails, so the two values are never interchangeable.\n */\n\nimport { API_LANGUAGES } from '../generated/api-languages.js';\n\n/**\n * The site-owner language for an element, resolved through the four-link chain the revamp design specifies.\n *\n * @remarks\n * 1. the element's own `lang` attribute (the explicit per-embed override),\n * 2. the nearest ancestor carrying `lang`, so one wrapper localizes a whole section,\n * 3. `document.documentElement.lang`, which is what makes this work on a real CMS with no markup change at all: WordPress emits `<html lang=\"es-AR\">` on every page of a Spanish site,\n * 4. nothing, which the callers read as English.\n *\n * Only link 1 used to be implemented, so a component on a fully Spanish page rendered English chrome and there was no way to fix it except hand-editing every embed.\n *\n * `navigator.language` is deliberately NOT in the chain. It is the VISITOR's preference, not the site's: it fragments the API cache across every locale a visitor might carry and silently serves two people different content from the same URL.\n *\n * Link 2 uses `closest`, which stops at a shadow boundary. A component composed INSIDE another component's shadow root therefore cannot see the host page, which is why every composing component forwards `lang` to its children explicitly.\n */\nexport function resolveLang(el: HTMLElement): string | undefined {\n\t// Native accessor, never a Lit @property: declaring one would shadow\n\t// HTMLElement.lang and break the platform attribute for every consumer.\n\tif (el.lang) return el.lang;\n\tif (typeof document === 'undefined') return undefined;\n\tconst inherited = el.closest?.('[lang]')?.getAttribute('lang');\n\tif (inherited) return inherited;\n\treturn document.documentElement.lang || undefined;\n}\n\n/**\n * The value safe to put on `?lang=`, or `undefined` to leave the request on the API default.\n *\n * @remarks\n * Two narrowings, both of which are load-bearing the moment {@link resolveLang} starts reading `<html lang>`:\n *\n * - **The region is dropped.** A regional tag is a 400, so a Spanish WordPress site would go from English-but-working to broken the day the language chain was completed. `es-AR`, `es-419` and `ES` all send `es`.\n * - **An unsupported language is omitted, not sent.** The chain now surfaces whatever the host page carries, including languages the API does not translate, and an unlisted tag is the same 400. Omitting it degrades to English, which is the behaviour those pages already had.\n */\nexport function apiLang(el: HTMLElement): string | undefined {\n\tconst tag = resolveLang(el);\n\tif (!tag) return undefined;\n\tconst base = tag.toLowerCase().split('-')[0] as string;\n\treturn API_LANGUAGES.includes(base) ? base : undefined;\n}\n", "/**\n * The chrome-string catalogue: one resolver reading one registry, so a translation can arrive from anywhere without a component changing.\n *\n * @remarks\n * **The key IS the canonical English string**, folded through {@link lookupKey}. There is no invented key vocabulary to keep in sync with the copy, which is the same rule the glyph tables in `tokens/index.ts` follow (they key off the exact value the API returns). Two consequences that are the whole point:\n *\n * - **English costs zero bytes.** A miss returns the source string, so the English build ships no catalogue at all, and a site that never loads a locale payload is byte-identical to one built before this file existed.\n * - **A missing translation degrades to English, never to a key.** The failure mode of a keyed catalogue is a raw `natal.tabs.wheel` rendered at a customer; here the worst case is the English word.\n *\n * **The registry lives on `globalThis`, not in module scope, because it has to.** Every `dist/cdn/components/*.js` is a self-contained IIFE with its own copy of this module, so a `Map` here would be invisible to the second component on the page. One global object, written by the locale payload and read by every bundle, is what makes `dist/cdn/locales/es.js` a single download that translates all of them.\n *\n * Load order is not guaranteed on a real host (WordPress enqueues scripts in an order the plugin does not fully control, and a payload may be deferred), so {@link onLocaleChange} lets an element that has already rendered in English re-render when its catalogue lands.\n */\n\nimport { lookupKey } from '../utils/string.js';\n\n/** Shared mutable state, addressed by a name rather than a module binding so every bundle on the page reaches the same object. */\ninterface LocaleRegistry {\n\t/** Language tag (lower case) to catalogue, keyed by {@link lookupKey} of the English source string. */\n\tcatalogs: Record<string, Record<string, string>>;\n\t/** Elements waiting to re-render when a catalogue arrives. */\n\tlisteners: Set<() => void>;\n}\n\nconst GLOBAL_KEY = '__ROXY_UI_I18N__';\n\nfunction registry(): LocaleRegistry {\n\tconst holder = globalThis as unknown as Record<string, LocaleRegistry>;\n\tconst existing = holder[GLOBAL_KEY];\n\tif (existing) return existing;\n\tconst created: LocaleRegistry = { catalogs: {}, listeners: new Set() };\n\tholder[GLOBAL_KEY] = created;\n\treturn created;\n}\n\n/**\n * Publish a catalogue for a language tag and wake every mounted element.\n *\n * @remarks\n * The catalogue is authored keyed by the English source string, exactly as it appears at the call site, and normalized here. That keeps the source file readable and diffable against the component that renders it, while the runtime lookup stays a single property read.\n *\n * This is the ONLY way into the registry, so a catalogue can later come from a static file, a server response, or a host page inlining a script tag, without a component knowing the difference.\n */\nexport function registerLocale(\n\tlang: string,\n\tcatalog: Record<string, string>,\n): void {\n\tconst reg = registry();\n\tconst normalized: Record<string, string> = {};\n\tfor (const [source, translated] of Object.entries(catalog)) {\n\t\tnormalized[lookupKey(source)] = translated;\n\t}\n\treg.catalogs[lang.toLowerCase()] = normalized;\n\tfor (const listener of reg.listeners) listener();\n}\n\n/**\n * Replace `{{name}}` placeholders. Copied from the API-side translator so both sides of the product interpolate identically; an unknown placeholder is left verbatim rather than blanked, so a typo in a catalogue is visible instead of silently eating the value.\n */\nexport function interpolate(\n\ttemplate: string,\n\tvars?: Record<string, string | number>,\n): string {\n\tif (!vars) return template;\n\treturn template.replace(/\\{\\{(\\w+)\\}\\}/g, (match, key: string) =>\n\t\tkey in vars ? String(vars[key] ?? '') : match,\n\t);\n}\n\n/**\n * The chrome string for `lang`, falling back to the English `source` it is keyed by.\n *\n * @remarks\n * A regional tag resolves against its base language, so `es-AR` and `es-419` both read the `es` catalogue and a site does not have to know which tags we happen to ship. An exact regional catalogue still wins if one is ever registered.\n */\nexport function translate(\n\tlang: string | undefined,\n\tsource: string,\n\tvars?: Record<string, string | number>,\n): string {\n\tif (!lang) return interpolate(source, vars);\n\tconst { catalogs } = registry();\n\tconst tag = lang.toLowerCase();\n\tconst catalog = catalogs[tag] ?? catalogs[tag.split('-')[0] as string];\n\treturn interpolate(catalog?.[lookupKey(source)] ?? source, vars);\n}\n\n/** Subscribe to catalogue arrivals. Returns the unsubscribe, so an element can drop it on disconnect. */\nexport function onLocaleChange(listener: () => void): () => void {\n\tconst { listeners } = registry();\n\tlisteners.add(listener);\n\treturn () => {\n\t\tlisteners.delete(listener);\n\t};\n}\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\nimport { onLocaleChange } from './registry.js';\n\n/**\n * Re-renders its host when a chrome-string catalogue arrives.\n *\n * @remarks\n * Without this the catalogue would have to be on the page BEFORE the elements upgrade, which is not something a component can require of a real host. WordPress orders enqueued scripts by dependency and a site owner can add `defer` to any of them; a CDN embed is two independent `<script src>` tags. Any of those can land the locale payload after the first paint, and the visible result would be a chart that renders in English on a Spanish page for no reason the site owner can see or fix.\n *\n * Mirrors `MarkupDataController`: constructed in {@link RoxyDataElement}'s constructor, subscribes on connect, drops the subscription on disconnect. Registration is idempotent and a re-register of the same language simply re-renders, so a payload loaded twice is harmless.\n */\nexport class LocaleController implements ReactiveController {\n\tprivate readonly host: ReactiveControllerHost;\n\tprivate unsubscribe?: () => void;\n\n\tconstructor(host: ReactiveControllerHost) {\n\t\tthis.host = host;\n\t\thost.addController(this);\n\t}\n\n\thostConnected(): void {\n\t\tthis.unsubscribe = onLocaleChange(() => this.host.requestUpdate());\n\t}\n\n\thostDisconnected(): void {\n\t\tthis.unsubscribe?.();\n\t\tthis.unsubscribe = undefined;\n\t}\n}\n", "import { css } from 'lit';\n\n/**\n * Shared host styles every component pulls in. Sets default font, color,\n * container query support, and the entry fade-in.\n */\nexport const baseStyles = css`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}:host([bare]){--roxy-surface:transparent;--roxy-shadow-sm:none;--roxy-shadow-md:none}*,:before,:after{box-sizing:border-box}h1,h2,h3,h4{font-family:var(--roxy-font-display,var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif))}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:0;padding:0;position:absolute;overflow:hidden}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}.roxy-error{gap:var(--roxy-space-sm,.5rem);padding:var(--roxy-space-lg,1.5rem);background:var(--roxy-surface,#fff);border:1px solid var(--roxy-danger,#dc2626);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-danger-fg,#991b1b);font-size:var(--roxy-text-sm,.875rem);justify-items:start;display:grid}.roxy-surface{background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-attribution{margin-top:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);text-align:right}.roxy-attribution a{color:inherit;text-decoration:none}.roxy-attribution a:hover{color:var(--roxy-accent-ink,#b45309);text-decoration:underline}.roxy-attribution a:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-edit-bar{margin-bottom:var(--roxy-space-sm,.5rem);justify-content:flex-end;display:flex}.roxy-edit{padding:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-fg,#0a0a0a);font-family:inherit;font-size:var(--roxy-text-sm,.875rem);cursor:pointer;background:0 0}.roxy-edit:hover{border-color:var(--roxy-accent,#f59e0b);color:var(--roxy-accent-ink,#b45309)}.roxy-edit:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;\n", "/**\n * The one place the \"publishable key only\" rule lives. Every client-side fetch boundary ({@link ../components/location-search.ts}, {@link ./fetch-controller.ts}) calls through here so a secret or legacy unprefixed key is refused identically: no network call, the same visible message, the same `roxy-validation-error` event. Centralising it is what stops the two paths drifting, which is exactly how `<roxy-location-search>` used to warn-then-fetch a secret key while the controller fail-closed.\n */\n\n/** Canonical refusal message. Both fetch boundaries surface this exact wording. */\nexport const KEY_REFUSED_MESSAGE =\n\t'Client-side components accept a pk_ publishable key only. Use a publishable key with an origin allowlist, or render server-side.';\n\n/** True when the key is a browser-safe `pk_` publishable key. */\nexport function isPublishableKey(key: string | undefined | null): boolean {\n\treturn !!key && key.startsWith('pk_');\n}\n\n/**\n * The fail-closed condition: a key is PRESENT and is NOT a `pk_` key. An absent key is not refused, so a keyless public call (a form-slotted city search with no key set) still proceeds; only a real secret/legacy token in the browser is stopped.\n */\nexport function keyIsRefused(key: string | undefined | null): boolean {\n\treturn !!key && !key.startsWith('pk_');\n}\n\n/**\n * Announce a refused key: dispatch the shared `roxy-validation-error` (bubbling, composed) and, when `warn` is set, log it once for the developer. The caller sets its own visible error state and skips the fetch; this only handles the parts both boundaries share.\n */\nexport function dispatchKeyRefusal(\n\thost: EventTarget,\n\topts: { warn?: boolean } = {},\n): void {\n\tif (opts.warn) console.warn(KEY_REFUSED_MESSAGE);\n\thost.dispatchEvent(\n\t\tnew CustomEvent('roxy-validation-error', {\n\t\t\tdetail: { reason: 'possible-secret-key', message: KEY_REFUSED_MESSAGE },\n\t\t\tbubbles: true,\n\t\t\tcomposed: true,\n\t\t}),\n\t);\n}\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\nimport {\n\tdispatchKeyRefusal,\n\tKEY_REFUSED_MESSAGE,\n\tkeyIsRefused,\n} from './key-guard.js';\n\n/**\n * Host slots the controller drives. {@link RoxyDataElement} satisfies this, so the form mixin can attach a controller without the component wiring state by hand.\n *\n * @remarks\n * Intersected with `HTMLElement` because the controller dispatches events on the host. Lit's `ReactiveControllerHost` is the update-lifecycle contract only (`addController`, `requestUpdate`, `updateComplete`) and carries no DOM surface, even though every real host is a `LitElement` and therefore an `HTMLElement`. Declaring the DOM half is what the controller actually needs; it used to reach it through a `this.host as unknown as EventTarget` double cast instead, which asserted a capability the type never promised.\n */\ntype FetchHost<T> = ReactiveControllerHost &\n\tHTMLElement & {\n\t\tdata: T | null;\n\t\tloading: boolean;\n\t\terror: string | null;\n\t};\n\n/** Default RoxyAPI v2 origin. A component overrides it per instance via its `base-url` attribute. */\nconst DEFAULT_BASE_URL = 'https://roxyapi.com/api/v2';\n\n/** A single request the controller issues on the component's behalf. */\nexport interface RoxyRequest {\n\t/** Path under the API base, e.g. \"/dreams/symbols/water\" or \"/astrology/natal-chart\". */\n\tpath: string;\n\tmethod?: 'GET' | 'POST';\n\t/** JSON body for POST endpoints. */\n\tbody?: unknown;\n\t/** Query string parameters; nullish values are dropped. */\n\tquery?: Record<string, string | number | undefined>;\n}\n\n/**\n * Client-side fetch for uncontrolled (self-fetching) components: drives `host.data` / `host.loading` / `host.error` and cancels a stale request when a newer one starts or the host disconnects.\n *\n * @remarks\n * Security boundary. The only credential this ever sends is a `pk_` publishable key, which carries a server-side origin allowlist. A secret (`sk_`) or legacy unprefixed key is refused before any network call and surfaced as an error, so a server secret cannot leak into a browser request. This centralizes the guard that originated in `<roxy-location-search>` so every self-fetching component enforces it identically.\n *\n * Controlled-mode components never construct this. When a server injects the response as a `<script class=\"roxy-data\">` island, there is no key and no fetch, which is the path server-rendered consumers (WordPress, JSX SSR, static HTML) rely on.\n */\nexport class FetchController<T = unknown> implements ReactiveController {\n\tprivate readonly host: FetchHost<T>;\n\tprivate abort?: AbortController;\n\n\t/** Browser-safe publishable key. Set by the host from its `publishable-key` attribute. */\n\tpublishableKey?: string;\n\t/** API origin, overridable for self-hosted or proxied deployments. */\n\tbaseUrl = DEFAULT_BASE_URL;\n\t/**\n\t * Consumer backend route that holds the secret key. When set, the request is POSTed here as `{ path, method, body, query }` instead of called against RoxyAPI directly, so no key (publishable or secret) is sent from the browser. This is the canonical path for server-rendered hosts (WordPress); the backend proxies the request with its own `sk_` key and returns the JSON response.\n\t */\n\tsubmitUrl?: string;\n\n\tconstructor(host: FetchHost<T>) {\n\t\tthis.host = host;\n\t\thost.addController(this);\n\t}\n\n\thostDisconnected() {\n\t\tthis.abort?.abort();\n\t\tthis.abort = undefined;\n\t}\n\n\t/**\n\t * Issue the request and resolve once `host.data` (success) or `host.error`\n\t * (failure) is set. A no-op return when a non-publishable key is present:\n\t * the error is already surfaced and nothing is sent.\n\t */\n\tasync run(req: RoxyRequest): Promise<void> {\n\t\t// submit-url proxy: no key leaves the browser; the consumer's backend holds it.\n\t\tif (!this.submitUrl && this.secretKeyRefused()) return;\n\t\tthis.abort?.abort();\n\t\tconst controller = new AbortController();\n\t\tthis.abort = controller;\n\t\tthis.host.loading = true;\n\t\tthis.host.error = null;\n\t\ttry {\n\t\t\tconst res = this.submitUrl\n\t\t\t\t? await fetch(this.submitUrl, {\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\tAccept: 'application/json',\n\t\t\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbody: JSON.stringify(req),\n\t\t\t\t\t\tsignal: controller.signal,\n\t\t\t\t\t})\n\t\t\t\t: await this.callApi(req, controller.signal);\n\t\t\tif (!res.ok) throw new Error(await this.readError(res));\n\t\t\tconst json = (await res.json()) as T;\n\t\t\tif (controller.signal.aborted) return;\n\t\t\tthis.host.data = json;\n\t\t} catch (err) {\n\t\t\tif ((err as { name?: string })?.name === 'AbortError') return;\n\t\t\tthis.host.error = err instanceof Error ? err.message : String(err);\n\t\t} finally {\n\t\t\tif (this.abort === controller) this.abort = undefined;\n\t\t\tif (!controller.signal.aborted) this.host.loading = false;\n\t\t}\n\t}\n\n\t/** Direct call against RoxyAPI with the publishable key (the no-backend path). */\n\tprivate callApi(req: RoxyRequest, signal: AbortSignal): Promise<Response> {\n\t\tconst url = new URL(`${this.baseUrl}${req.path}`);\n\t\tfor (const [k, v] of Object.entries(req.query ?? {})) {\n\t\t\tif (v != null) url.searchParams.set(k, String(v));\n\t\t}\n\t\tconst headers: Record<string, string> = { Accept: 'application/json' };\n\t\tif (this.publishableKey) headers['X-API-Key'] = this.publishableKey;\n\t\tif (req.body != null) headers['Content-Type'] = 'application/json';\n\t\treturn fetch(url, {\n\t\t\tmethod: req.method ?? 'GET',\n\t\t\theaders,\n\t\t\tbody: req.body != null ? JSON.stringify(req.body) : undefined,\n\t\t\tsignal,\n\t\t});\n\t}\n\n\t/** True when a key is set and it is not a browser-safe `pk_` publishable key. Surfaces the error and refuses to send, via the shared {@link keyIsRefused} guard so every fetch boundary fail-closes identically. */\n\tprivate secretKeyRefused(): boolean {\n\t\tif (!keyIsRefused(this.publishableKey)) return false;\n\t\tthis.host.error = KEY_REFUSED_MESSAGE;\n\t\tdispatchKeyRefusal(this.host);\n\t\treturn true;\n\t}\n\n\t/** Surface the `{ error, code }` message the API returns on failure, falling back to the status code. */\n\tprivate async readError(res: Response): Promise<string> {\n\t\ttry {\n\t\t\tconst body = (await res.json()) as { error?: string };\n\t\t\tif (body?.error) return body.error;\n\t\t} catch {\n\t\t\t// Non-JSON error body: fall through to the status line.\n\t\t}\n\t\treturn `Request failed (${res.status})`;\n\t}\n}\n\n/**\n * Translate flat form values into a {@link RoxyRequest} for an endpoint. The `{name}` segments in the endpoint template are substituted from the values and removed; the rest become the JSON body for POST or query parameters for GET. This is the spec-light request builder the base element uses to turn a `<roxy-endpoint-form>` submission into a self-fetch, so a component needs no per-endpoint glue.\n *\n * @param queryKeys - Names the spec declares as `in: query` for this operation, which `<roxy-endpoint-form>` reports on its `roxy-submit` event. A POST operation can still take query parameters (every localized endpoint takes `?lang=`), and sending one in the JSON body silently drops it, so those names are routed to the query string on POST as well as GET.\n */\nexport function buildRequest(\n\tendpoint: string,\n\tmethod: 'GET' | 'POST',\n\tvalues: Record<string, unknown>,\n\tqueryKeys: readonly string[] = [],\n): RoxyRequest {\n\tconst rest: Record<string, unknown> = { ...values };\n\tconst path = `/${endpoint.replace(/^\\//, '')}`.replace(\n\t\t/\\{([^}]+)\\}/g,\n\t\t(_match, name: string) => {\n\t\t\tconst v = rest[name];\n\t\t\tdelete rest[name];\n\t\t\treturn encodeURIComponent(String(v ?? ''));\n\t\t},\n\t);\n\tconst inQuery = new Set(queryKeys);\n\tconst query: Record<string, string | number | undefined> = {};\n\tconst body: Record<string, unknown> = {};\n\tfor (const [k, v] of Object.entries(rest)) {\n\t\tif (v === undefined || v === '') continue;\n\t\tif (method === 'GET' || inQuery.has(k)) query[k] = v as string | number;\n\t\telse body[k] = v;\n\t}\n\treturn { path, method, query, body: method === 'POST' ? body : undefined };\n}\n", "/**\n * The interpretation accordion: the one way this library shows a label, a short value, and a body of prose behind a disclosure.\n *\n * @remarks\n * Exclusive by construction (`<details name>`), so a card grows by at most one open section and never becomes a wall of text. Callers pass their own group `name` so two accordions on one page do not fight over which section is open.\n *\n * This lives here rather than in a component because the same accordion is the right shape wherever an endpoint returns a labelled reading: the Human Design bodygraph and type card use it for strategy, authority, and aura; `roxy-hexagram` uses it for the changing lines. The CSS was copy-pasted into six components before 2026-07 and had already drifted (`.interp-body` had five distinct definitions), which is the drift this exists to stop. Migrate the remaining copies to it when they are next touched.\n *\n * **Call it through `RoxyDataElement.renderInterpretation`, never directly.** That method is where `hide-readings` is honoured, so a direct call renders prose a host asked to be left out. The section it emits carries `part=\"section readings\"` and each row `part=\"reading\"`, which is what makes the readings of EVERY component addressable under one name from outside the shadow root.\n */\n\nimport { css, html, nothing } from 'lit';\nimport { chevron } from './disclosure.js';\n\n/** One row: the label, the short value shown as the aside, and the interpretation body. `extra` renders under the body for a section that carries more than prose. */\nexport interface InterpSection {\n\tlabel: string;\n\taside?: string;\n\tbody: string;\n\textra?: unknown;\n}\n\nexport const interpAccordionStyles = css`.block{border-top:1px solid var(--roxy-border,#e4e4e7);padding-top:var(--roxy-space-md,1rem)}.block h3{margin:0 0 var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-muted,#71717a);text-transform:uppercase;letter-spacing:.06em}.interp-card{border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-sm,.5rem) var(--roxy-space-md,1rem);margin-bottom:var(--roxy-space-xs,.25rem)}.interp-card summary{cursor:pointer;color:var(--roxy-fg,#0a0a0a);align-items:center;gap:var(--roxy-space-sm,.5rem);font-weight:500;font-size:var(--roxy-text-sm,.875rem);display:flex}.interp-card summary:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px;border-radius:var(--roxy-radius-sm,4px)}.interp-lead{flex-wrap:wrap;flex:auto;order:1;align-items:baseline;gap:.4rem;min-width:0;display:inline-flex}.interp-aside{flex-shrink:0;order:2;align-items:center;gap:.5rem;display:inline-flex}.roxy-chevron{order:3}.interp-aside small{color:var(--roxy-muted,#71717a);white-space:nowrap;font-weight:400}@container (width<=26rem){.interp-card summary{flex-wrap:wrap}.roxy-chevron{order:2}.interp-aside{flex-basis:100%;order:3;justify-content:flex-end}}.interp-body{margin-top:var(--roxy-space-sm,.5rem);gap:var(--roxy-space-sm,.5rem);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-sm,.875rem);overflow-wrap:anywhere;line-height:1.6;display:grid}.interp-body p{margin:0}`;\n\n/**\n * Render the accordion. Sections with no body are dropped, so a caller can pass the full set and let a narrower response render only what it carries. `name` groups the `<details>` exclusively, so opening one closes the last.\n */\nexport function renderInterpAccordion(\n\tsections: InterpSection[],\n\tname: string,\n\theading = 'Reading',\n) {\n\tconst shown = sections.filter((s) => Boolean(s.body));\n\tif (shown.length === 0) return nothing;\n\n\treturn html`<section class=\"block\" part=\"section readings\"><h3>${heading}</h3>${shown.map(\n\t\t\t(\n\t\t\t\ts,\n\t\t\t\ti,\n\t\t\t) => html`<details class=\"interp-card\" part=\"reading\" name=\"${name}\" ?open=\"${i === 0}\"><summary><span class=\"interp-lead\">${s.label}</span> ${chevron()} ${s.aside ? html`<span class=\"interp-aside\"><small>${s.aside}</small></span>` : nothing}</summary><div class=\"interp-body\"><p>${s.body}</p>${s.extra ?? nothing}</div></details>`,\n\t\t)}</section>`;\n}\n", "import type { TemplateResult } from 'lit';\nimport { css, html } from 'lit';\n\n/**\n * Disclosure chevron for `<details>`/`<summary>` accordions. Replaces the\n * browser default triangle with a thin chevron that rotates when the host\n * `<details>` opens. Render it inside the `<summary>` and pair with\n * {@link disclosureStyles}.\n */\nexport function chevron(): TemplateResult {\n\treturn html`<svg class=\"roxy-chevron\" viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" aria-hidden=\"true\"><path d=\"M4 6l4 4 4-4\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>`;\n}\n\n/**\n * Shared `<details>` accordion styling: hides the native disclosure triangle\n * and rotates the {@link chevron} 180 degrees when the accordion is open.\n * Import into any component that renders disclosure accordions so the chevron\n * looks and behaves identically.\n */\nexport const disclosureStyles = css`summary{list-style:none}summary::-webkit-details-marker{display:none}.roxy-chevron{aspect-ratio:auto;width:14px;height:14px;color:var(--roxy-muted,#71717a);transition:transform var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);flex-shrink:0}details[open]>summary .roxy-chevron{transform:rotate(180deg)}@media (prefers-reduced-motion:reduce){.roxy-chevron{transition:none}}`;\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\n/**\n * Marker class on the inline JSON script a server emits inside a component.\n *\n * @example\n * ```html\n * <roxy-natal-chart>\n * <script type=\"application/json\" class=\"roxy-data\">{ ...response... }</script>\n * </roxy-natal-chart>\n * ```\n */\nconst ROXY_DATA_CLASS = 'roxy-data';\n\n/**\n * Serialize a RoxyAPI response for embedding inside an inline `<script type=\"application/json\" class=\"roxy-data\">`. This is the safe writer counterpart to {@link MarkupDataController}, the reader: server-rendered and cached consumers (WordPress, JSX SSR, static HTML) emit the script with this, and the component hydrates `data` from it on connect.\n *\n * @remarks\n * Use this instead of a bare `JSON.stringify`. A raw stringify of a response that contains the literal text `</script>` (common in long interpretation prose) closes the script element early, corrupting the page and creating an HTML-injection vector. This escapes the script-unsafe characters to their `\\uXXXX` JSON escapes, which `JSON.parse` restores to the original characters, so the value the component receives is identical to the response you passed.\n *\n * `<` is the load-bearing escape (it defeats `</script>` and `<!--`). `>` and `&` are escaped for defence in depth, and U+2028 / U+2029 because they are valid in JSON yet are line terminators in a `<script>` context and break some parsers. The escapes introduce only `\\uXXXX` sequences, so the replacements never feed each other and order is irrelevant.\n *\n * Pass the unwrapped RoxyAPI response, the same shape you would assign to `element.data`. Do not pass the SDK envelope (`{ data, error, request, response }`).\n *\n * @example\n * ```ts\n * import { serializeRoxyData } from '@roxyapi/ui';\n *\n * const { data } = await roxy.dreams.getDreamSymbol({ path: { id: 'water' } });\n * const html = `<roxy-dream-card><script type=\"application/json\" class=\"roxy-data\">${serializeRoxyData(data)}</script></roxy-dream-card>`;\n * ```\n */\nexport function serializeRoxyData(data: unknown): string {\n\treturn JSON.stringify(data)\n\t\t.replace(/</g, '\\\\u003c')\n\t\t.replace(/>/g, '\\\\u003e')\n\t\t.replace(/&/g, '\\\\u0026')\n\t\t.replace(/\\u2028/g, '\\\\u2028')\n\t\t.replace(/\\u2029/g, '\\\\u2029');\n}\n\n/**\n * Build the complete `<script type=\"application/json\" class=\"roxy-data\">\u2026</script>` element a server nests inside a `roxy-*` component for the no-JavaScript hydration path. The payload is escaped via {@link serializeRoxyData}, so it is safe to drop straight into HTML output.\n *\n * @remarks\n * The element carries both `type=\"application/json\"` and `class=\"roxy-data\"` because {@link MarkupDataController} reads only a direct-child script that has both. Emit one of these inside the target component; the JavaScript `data` property still wins if it is later assigned.\n *\n * @example\n * ```ts\n * import { roxyDataScript } from '@roxyapi/ui';\n *\n * const { data } = await roxy.crystals.getCrystal({ path: { id: 'amethyst' } });\n * const html = `<roxy-crystal-grid>${roxyDataScript(data)}</roxy-crystal-grid>`;\n * ```\n */\nexport function roxyDataScript(data: unknown): string {\n\treturn `<script type=\"application/json\" class=\"${ROXY_DATA_CLASS}\">${serializeRoxyData(data)}</script>`;\n}\n\n/**\n * True when the element is a `<script type=\"application/json\">`. Uses tag name and attribute rather than `instanceof HTMLScriptElement` so the check holds in every DOM implementation, including server-rendered and hydration runtimes where the constructor global may be absent.\n */\nfunction isJsonScript(el: Element): boolean {\n\treturn (\n\t\tel.nodeName === 'SCRIPT' && el.getAttribute('type') === 'application/json'\n\t);\n}\n\n/**\n * Host shape the controller drives: any reactive element that exposes a public `data` slot. The controller only writes `data` when the host left it unset, so the JavaScript property path always wins.\n */\ninterface DataHost extends ReactiveControllerHost, HTMLElement {\n\tdata?: unknown;\n}\n\n/**\n * Reactive controller that lets a component hydrate its `data` from embedded markup when no `data` property was assigned in JavaScript.\n *\n * @remarks\n * The server-side and cached-render model: a backend renders the RoxyAPI response into a direct-child `<script type=\"application/json\" class=\"roxy-data\">` element, ships static HTML, and never runs per-element JavaScript to assign a property. On connect this controller reads that script, parses it, and feeds the result to the host. The JavaScript property path is untouched and authoritative: if `host.data` already holds a value when the host connects, the controller does nothing and the markup is ignored.\n *\n * Source resolution order on connect, first hit wins:\n *\n * 1. `host.data` already set in JavaScript -> leave it, read nothing.\n * 2. A direct-child `<script type=\"application/json\" class=\"roxy-data\">` -> parse and use. Direct-child only, so a nested component's own script is never read by an ancestor.\n *\n * Fetching from a URL is intentionally unsupported: that would require a browser-visible key and breaks the server-rendered, cached model these consumers rely on.\n *\n * Timing: {@link hostConnected} runs inside the host `connectedCallback`. For an element parsed from server HTML, its direct children are present by the time the custom element upgrades and connects, so the script is readable here. For an element created with `document.createElement` and connected before any child is appended, there is nothing to read and the property path is the only source, which is exactly the existing behavior.\n *\n * Failure is safe: malformed JSON or a missing script leaves `host.data` untouched, so the host renders its normal empty state.\n *\n * Reading the script never mutates it, and only the marked script is touched, so any sibling fallback markup a server nested inside the element (for no-JavaScript, AMP, or crawler rendering) is left in place.\n *\n * @example\n * ```ts\n * import { MarkupDataController } from '../utils/markup-data.js';\n *\n * export class RoxyExample extends LitElement {\n * constructor() {\n * super();\n * new MarkupDataController(this);\n * }\n *\n * @property({ attribute: false })\n * data: ExampleResponse | null = null;\n * }\n * ```\n */\nexport class MarkupDataController<T = unknown> implements ReactiveController {\n\tprivate readonly host: DataHost;\n\n\tconstructor(host: DataHost) {\n\t\tthis.host = host;\n\t\thost.addController(this);\n\t}\n\n\thostConnected() {\n\t\t// Property path wins. If the consumer (React, vanilla `.data =`, the\n\t\t// widgets script, an MCP agent) already set data, never look at markup.\n\t\tif (this.host.data != null) return;\n\n\t\tconst parsed = this.read();\n\t\tif (parsed === undefined) return;\n\n\t\tthis.host.data = parsed as T;\n\t\tthis.host.requestUpdate();\n\t}\n\n\t/**\n\t * Resolve the embedded payload. Returns `undefined` when there is nothing valid to read so the caller can leave `host.data` untouched.\n\t */\n\tprivate read(): T | undefined {\n\t\tconst inline = this.findInlineScript();\n\t\treturn inline ? this.parse(inline.textContent) : undefined;\n\t}\n\n\t/**\n\t * Direct-child `<script type=\"application/json\" class=\"roxy-data\">`. Scoped to immediate children so a nested data-driven component never has its script read by an ancestor, and so sibling fallback markup is ignored.\n\t */\n\tprivate findInlineScript(): Element | null {\n\t\tfor (const child of Array.from(this.host.children)) {\n\t\t\tif (isJsonScript(child) && child.classList.contains(ROXY_DATA_CLASS)) {\n\t\t\t\treturn child;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate parse(text: string | null): T | undefined {\n\t\tif (!text?.trim()) return undefined;\n\t\ttry {\n\t\t\treturn JSON.parse(text) as T;\n\t\t} catch {\n\t\t\t// Malformed embedded JSON: fail safe, leave the host empty state in\n\t\t\t// place rather than throwing during connect.\n\t\t\treturn undefined;\n\t\t}\n\t}\n}\n", "/**\n * Math helpers for converting raw ecliptic longitude decimals into the\n * sign / degree / minute / second triplet used across chart components.\n */\n\nimport { SIGNS_ORDER } from '../tokens/index.js';\n\nexport interface SignPosition {\n\tsign: string;\n\tsignIndex: number;\n\tdegree: number;\n\tminute: number;\n\tsecond: number;\n}\n\n/**\n * Wrap longitude into [0, 360) so negative or out-of-range values still\n * resolve to a real sign. Robust to wonky upstream data.\n */\nexport function normalizeLongitude(lon: number): number {\n\tconst wrapped = lon % 360;\n\treturn wrapped < 0 ? wrapped + 360 : wrapped;\n}\n\n/**\n * Convert decimal ecliptic longitude (0-360) into sign/degree/minute/second.\n * Used by every chart wheel and aspect table.\n */\nexport function longitudeToSignPosition(longitude: number): SignPosition {\n\tconst lon = normalizeLongitude(longitude);\n\tconst signIndex = Math.floor(lon / 30) % 12;\n\tconst within = lon % 30;\n\tconst degree = Math.floor(within);\n\tconst minuteFloat = (within - degree) * 60;\n\tconst minute = Math.floor(minuteFloat);\n\tconst second = Math.round((minuteFloat - minute) * 60);\n\treturn {\n\t\tsign: SIGNS_ORDER[signIndex] ?? 'Aries',\n\t\tsignIndex,\n\t\tdegree,\n\t\tminute,\n\t\tsecond,\n\t};\n}\n\n/** Compact display string like \"12\u00B0 Leo 34'\". Used in chart labels. */\nexport function formatSignPosition(longitude: number): string {\n\tconst { sign, degree, minute } = longitudeToSignPosition(longitude);\n\treturn `${degree}\u00B0 ${sign} ${String(minute).padStart(2, '0')}'`;\n}\n\n/**\n * A within-sign decimal degree (0-30) split into whole degrees and minutes, with the rounding carry already applied.\n *\n * @remarks\n * Separate from {@link formatDegreeInSign} because a printed ephemeris interleaves the sign BETWEEN the two halves (`09\u264C56`, the form every published ephemeris has used for a century) rather than putting the sign beside a finished `9\u00B056'`. Rounding 59.6 minutes up has to roll the degree with it, and that carry is the part a caller gets wrong, so it lives here once and both forms read it.\n */\nexport function splitDegreeInSign(deg: number): {\n\tdegree: number;\n\tminute: number;\n} {\n\tlet degree = Math.floor(deg);\n\tlet minute = Math.round((deg - degree) * 60);\n\tif (minute === 60) {\n\t\tminute = 0;\n\t\tdegree += 1;\n\t}\n\treturn { degree, minute };\n}\n\n/** Format a within-sign decimal degree (0-30) as degree-and-minute, e.g. 17.99 to \"17\u00B059'\". The reference-grade form astrologers read when the sign is already known (asteroids, lots, directed points, fixed stars). */\nexport function formatDegreeInSign(deg: number): string {\n\tconst { degree, minute } = splitDegreeInSign(deg);\n\treturn `${degree}\u00B0${String(minute).padStart(2, '0')}'`;\n}\n\n/**\n * The point diametrically opposite a longitude (e.g. Descendant from\n * Ascendant, IC from MC). Exact derivation, always 180 degrees away.\n */\nexport function oppositePoint(longitude: number): number {\n\treturn normalizeLongitude(longitude + 180);\n}\n\n/**\n * Midpoint of the forward arc from `start` to `end` (both ecliptic\n * longitudes). Handles the 360/0 wrap, so a house spanning 350 to 20 degrees\n * yields a midpoint of 5, not 185. Used to place house numbers between two\n * cusps regardless of how unequal the house is.\n */\nexport function arcMidpoint(start: number, end: number): number {\n\tconst s = normalizeLongitude(start);\n\tlet span = normalizeLongitude(end) - s;\n\tif (span < 0) span += 360;\n\treturn normalizeLongitude(s + span / 2);\n}\n\n/** A body placed on a wheel: where it really is, and where its glyph had to be drawn to stay legible. */\nexport interface FannedPoint<T> {\n\titem: T;\n\t/** The true ecliptic longitude. Where a leader line points, and the only value a reader should take as the position. */\n\tlongitude: number;\n\t/** Where the glyph is drawn, pushed forward only as far as it takes to clear its neighbour. Equal to {@link FannedPoint.longitude} whenever nothing was in the way. */\n\tdisplayLongitude: number;\n}\n\n/**\n * Spread a cluster of bodies apart along a wheel so every glyph stays readable,\n * without moving any of them off its real position in the data.\n *\n * @remarks\n * Conjunctions inside a few degrees are the norm, not the exception: a\n * Sun-Mercury-Venus cluster or a stack of outer planets will pile four glyphs on\n * top of each other and print their degree labels over one another. Sorting by\n * longitude and pushing each later member forward until it clears\n * `minSeparation` is the conventional fix in professional chart software, and it\n * is why {@link FannedPoint} carries BOTH longitudes: the caller draws the glyph\n * at the display value and a leader line back to the true one, so nothing about\n * the drawing claims a position the response did not give.\n *\n * `minSeparation` is an ANGLE, so it depends on the radius the caller is drawing\n * at: the same glyph needs more degrees of arc on a small ring than a large one.\n *\n * If a cluster runs past 360 degrees the whole set slides back by the overshoot,\n * which keeps the stack anchored near its real longitudes instead of wrapping\n * one member around to the far side of the wheel.\n */\nexport function fanOut<T>(\n\titems: readonly T[],\n\tlongitudeOf: (item: T) => number,\n\tminSeparation: number,\n): FannedPoint<T>[] {\n\tconst placed: FannedPoint<T>[] = items\n\t\t.filter((item) => Number.isFinite(longitudeOf(item)))\n\t\t.map((item) => {\n\t\t\tconst longitude = normalizeLongitude(longitudeOf(item));\n\t\t\treturn { item, longitude, displayLongitude: longitude };\n\t\t})\n\t\t.sort((a, b) => a.longitude - b.longitude);\n\n\tfor (let i = 1; i < placed.length; i++) {\n\t\tconst prev = placed[i - 1];\n\t\tconst cur = placed[i];\n\t\tif (!prev || !cur) continue;\n\t\tconst wanted = prev.displayLongitude + minSeparation;\n\t\tif (cur.displayLongitude < wanted) cur.displayLongitude = wanted;\n\t}\n\n\tconst last = placed[placed.length - 1];\n\tif (last && last.displayLongitude > 360) {\n\t\tconst shift = last.displayLongitude - 360;\n\t\tfor (const p of placed) p.displayLongitude -= shift;\n\t}\n\treturn placed;\n}\n\n/**\n * Degrees of arc a mark of `width` user units occupies at `radius`, which is the\n * separation {@link fanOut} needs to keep two of them from touching. One\n * expression instead of a magic number per ring, so an inner ring automatically\n * asks for more degrees than an outer one.\n */\nexport function arcSeparation(width: number, radius: number): number {\n\treturn radius > 0 ? (width / radius) * (180 / Math.PI) : 0;\n}\n\n/** Polar to cartesian for SVG wheel positioning. Angle in degrees, 0 at 3 o'clock. */\nexport function polarToCartesian(\n\tcx: number,\n\tcy: number,\n\tradius: number,\n\tangleDeg: number,\n): { x: number; y: number } {\n\tconst angleRad = (angleDeg * Math.PI) / 180;\n\treturn {\n\t\tx: cx + radius * Math.cos(angleRad),\n\t\ty: cy + radius * Math.sin(angleRad),\n\t};\n}\n", "/**\n * Display formatters for ISO timestamps and floats coming back from the API.\n * Every helper returns \"\" for nullish or unparseable input so it falls out of\n * template literals cleanly.\n *\n * @remarks\n * **This file is the ONLY place in the library that may call `Intl` or a `toLocale*` method, and every helper that does takes the locale as its first argument, required.** Both halves are enforced by a source scan in `tests/i18n.test.ts`.\n *\n * The locale is the DISPLAY locale, the full tag `resolveLang` returns, region included. It is NOT the value that goes on `?lang=`: that one is truncated to a supported two-letter code because the API rejects anything else, and handing THAT to Intl would render every Argentine visitor's dates in Castilian conventions. `es-AR` is exactly the tag Intl wants.\n *\n * It is required rather than optional because the defect it replaces was an omission: `toLocaleDateString(undefined, ...)` means \"the locale of whoever is looking\", so a Spanish page rendered `Carta natal` above `Jan 15, 1990, 2:30 PM`, and two visitors to the same page saw two different strings. An optional parameter defaults straight back to that. A missing argument is now a typecheck failure at every call site.\n */\n\nimport { capitalize, humanize } from './string.js';\n\nconst DATE_ONLY = /^\\d{4}-\\d{2}-\\d{2}$/;\nconst BARE_TIME = /^\\d{2}:\\d{2}(:\\d{2})?$/;\n/** An ISO datetime with NO timezone designator: a wall clock, not an instant. */\nconst NAIVE_DATETIME = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?$/;\n\n/** Canonical form per tag seen, so a page carrying an unparseable `lang` does not throw once per rendered date. */\nconst CANONICAL: Map<string, string> = new Map();\n\n/**\n * The locale list to hand Intl: the page's tag first, English behind it.\n *\n * @remarks\n * Two failure modes, both reachable from a `lang` attribute a site owner typed by hand and neither of which may reach a visitor:\n *\n * - **A structurally invalid tag throws.** `lang=\"english\"` or `lang=\"en_US\"` makes every `toLocale*` call raise a RangeError, which inside a render is a blank component rather than a wrong date. Canonicalizing behind a try/catch degrades it to English instead.\n * - **A valid-but-unknown tag falls back to the RUNTIME default**, which is the viewer's browser again, so the bug reappears for exactly the pages least likely to notice. Naming `en` as the second entry makes the fallback the page's, not the visitor's.\n *\n * No language signal at all resolves to English for the same reason the chrome catalogue does: a page that never declares a language is English as far as this library is concerned, and English chrome over German dates is the inconsistency this whole file exists to remove. `navigator.language` is deliberately absent from the chain here as it is in `resolveLang`: it is the VISITOR's preference, not the site's.\n */\nfunction intlLocales(locale: string | undefined): string[] {\n\tif (!locale) return ['en'];\n\tconst cached = CANONICAL.get(locale);\n\tif (cached) return [cached, 'en'];\n\tlet canonical = 'en';\n\ttry {\n\t\tcanonical = Intl.getCanonicalLocales(locale)[0] ?? 'en';\n\t} catch {\n\t\tcanonical = 'en';\n\t}\n\tCANONICAL.set(locale, canonical);\n\treturn [canonical, 'en'];\n}\n\n/**\n * Resolve an API timestamp to a Date plus the timezone it must be RENDERED in.\n *\n * @remarks\n * The API returns chart times naive (`2026-07-13T04:36:00`): that is 04:36 in the CHART's timezone, not UTC and not the viewer's. A wall clock must read the same for every viewer on earth, so hora at sunrise says 04:36 in Tokyo and in Chicago alike.\n *\n * Handing a naive string to `new Date()` makes the runtime interpret it in the VIEWER's zone, which is a silent corruption whenever that wall clock lands in the viewer's DST gap. In America/New_York `2026-03-08T02:30:00` does not exist, so the clock jumps and it renders as `3:30 AM`. Pinning the wall clock to UTC, which has no DST and therefore no gap, preserves the digits exactly while Intl still writes them in the PAGE locale conventions.\n *\n * An offset-bearing timestamp (`...Z`, `...+05:30`) IS a real instant, so it keeps the normal behaviour and converts to the viewer's local time.\n *\n * Deliberately NOT exported. It used to be, so a component needing a shape these helpers did not offer could pin its own wall clock and call Intl itself, which is how `dasha-timeline` came to hardcode `toLocaleString('en', ...)` and pin every boundary date to English. A shape that is missing is added here, beside the locale handling, not reimplemented in a component.\n */\nfunction resolveDisplayDate(input: string): {\n\td: Date;\n\ttimeZone?: string;\n} {\n\tconst naive = BARE_TIME.test(input)\n\t\t? `1970-01-01T${input}`\n\t\t: NAIVE_DATETIME.test(input)\n\t\t\t? input\n\t\t\t: null;\n\treturn naive\n\t\t? { d: new Date(`${naive}Z`), timeZone: 'UTC' }\n\t\t: { d: new Date(input) };\n}\n\n/**\n * The clock, in the page locale: `2:30 PM` in English, `14:30` in German.\n *\n * @remarks\n * The hour cycle is the locale's, never ours. It used to be pinned `hour12: true`, which put an AM/PM clock on every page in Europe and Latin America while the embedded form beside it labelled its own input \"formato de 24 horas\". CLDR already knows which convention each locale reads, including the ones that surprise you (`es` is 24-hour, `es-AR` is 12-hour with `p. m.`), so asserting a cycle here is asserting we know better than the locale data.\n */\nexport function formatTime(locale: string | undefined, input: unknown): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tif (DATE_ONLY.test(input)) return '';\n\tconst { d, timeZone } = resolveDisplayDate(input);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleTimeString(intlLocales(locale), {\n\t\thour: 'numeric',\n\t\tminute: '2-digit',\n\t\ttimeZone,\n\t});\n}\n\nexport function formatDate(locale: string | undefined, input: unknown): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tconst { d, timeZone } = resolveDisplayDate(\n\t\tDATE_ONLY.test(input) ? `${input}T00:00:00` : input,\n\t);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleDateString(intlLocales(locale), {\n\t\tmonth: 'short',\n\t\tday: 'numeric',\n\t\tyear: 'numeric',\n\t\ttimeZone,\n\t});\n}\n\nexport function formatTimeRange(\n\tlocale: string | undefined,\n\tt: { start?: string; end?: string } | undefined,\n): string {\n\tif (!t) return '';\n\tconst start = formatTime(locale, t.start);\n\tconst end = formatTime(locale, t.end);\n\tif (start && end) return `${start} - ${end}`;\n\treturn start || end || '';\n}\n\n/** Two dates as one label: `Jan 1, 2026 - Jan 7, 2026`. Falls back to whichever end parses when the other is absent. */\nexport function formatDateRange(\n\tlocale: string | undefined,\n\tstart: unknown,\n\tend: unknown,\n): string {\n\tconst a = formatDate(locale, start);\n\tconst b = formatDate(locale, end);\n\tif (a && b) return `${a} - ${b}`;\n\treturn a || b;\n}\n\n/** How much of a timestamp a label shows. `time` is the whole date plus the clock. */\nexport type DateGrain = 'year' | 'month' | 'day' | 'time';\n\n/**\n * A timestamp at a chosen granularity, for an axis or a bar end where the full date would not fit.\n *\n * @remarks\n * Every grain below `year` carries the year, because a period routinely straddles new year and a label reading `28 Dec - 3 Jan` says nothing about which side moved. `year` is sliced off the string rather than formatted, since a bare four-digit year is the same in every locale this library ships and running it through Intl would introduce era and numbering-system differences into an axis tick.\n */\nexport function formatDateGrain(\n\tlocale: string | undefined,\n\tinput: unknown,\n\tgrain: DateGrain,\n): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tif (grain === 'year') {\n\t\tconst m = input.match(/^(\\d{4})/);\n\t\treturn m?.[1] ?? input;\n\t}\n\tconst { d, timeZone } = resolveDisplayDate(input);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleString(intlLocales(locale), {\n\t\tday: grain === 'month' ? undefined : 'numeric',\n\t\tmonth: 'short',\n\t\tyear: 'numeric',\n\t\thour: grain === 'time' ? 'numeric' : undefined,\n\t\tminute: grain === 'time' ? '2-digit' : undefined,\n\t\ttimeZone,\n\t});\n}\n\n/**\n * A day inside a month already named elsewhere: `Aug 3`, `3 ago`, `3. Aug.`.\n *\n * @remarks\n * Deliberately WITHOUT the year, which is the one thing {@link formatDateGrain} will not do at any grain below `year`, and for a good reason there: a period can straddle new year and `28 Dec - 3 Jan` says nothing about which side moved. This shape exists for the opposite case, a payload whose own fields pin the month (a monthly ephemeris carries `year` and `month` at the top level and prints them in its header), where repeating the year on thirty-one rows and a dozen chips is noise rather than safety. Do not reach for it where the month is not already on screen.\n *\n * A date-only string is pinned to UTC the way {@link formatDate} pins it, so the digits read the same for every viewer instead of rolling back a day west of Greenwich.\n */\nexport function formatMonthDay(\n\tlocale: string | undefined,\n\tinput: unknown,\n): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tconst { d, timeZone } = resolveDisplayDate(\n\t\tDATE_ONLY.test(input) ? `${input}T00:00:00` : input,\n\t);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleDateString(intlLocales(locale), {\n\t\tmonth: 'short',\n\t\tday: 'numeric',\n\t\ttimeZone,\n\t});\n}\n\n/**\n * A day of the month with its weekday: `1 Sat`, `s\u00E1b 1`, `Sa., 1.`.\n *\n * @remarks\n * The row label a printed ephemeris uses (`01 Sa`, `02 Su`), and it carries neither the month nor the year because the page header already names both. The weekday is not decoration: half of what a practitioner asks a monthly ephemeris is which DAY of the week a placement falls on, and deriving it from a bare number is exactly the arithmetic a table exists to save. Order and separator belong to the locale, which is why this is one Intl call rather than a join.\n *\n * A date-only string is pinned to UTC the way {@link formatDate} pins it, so the weekday cannot roll backwards west of Greenwich.\n */\nexport function formatWeekdayDay(\n\tlocale: string | undefined,\n\tinput: unknown,\n): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tconst { d, timeZone } = resolveDisplayDate(\n\t\tDATE_ONLY.test(input) ? `${input}T00:00:00` : input,\n\t);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleDateString(intlLocales(locale), {\n\t\tweekday: 'short',\n\t\tday: 'numeric',\n\t\ttimeZone,\n\t});\n}\n\n/**\n * A calendar month and its year: `August 2026`, `agosto de 2026`, `August 2026`.\n *\n * @remarks\n * Takes the two NUMBERS an endpoint returns rather than a timestamp, because that is the shape a monthly payload echoes, and anchors them at UTC noon for the same reason {@link monthName} does: no timezone can roll the anchor into the neighbouring month. The connective belongs to the locale (`de` in Spanish, nothing in English), which is why this is one Intl call rather than a join of {@link monthName} and the year.\n */\nexport function formatMonthYear(\n\tlocale: string | undefined,\n\tyear: unknown,\n\tmonth: unknown,\n): string {\n\tif (typeof year !== 'number' || !Number.isFinite(year)) return '';\n\tif (typeof month !== 'number' || !Number.isInteger(month)) return '';\n\tif (month < 1 || month > 12) return '';\n\treturn new Date(Date.UTC(year, month - 1, 1, 12)).toLocaleDateString(\n\t\tintlLocales(locale),\n\t\t{ month: 'long', year: 'numeric', timeZone: 'UTC' },\n\t);\n}\n\n/**\n * Month name from a 1-based month number: `January`, `enero`, `janvier`.\n *\n * @remarks\n * Two components carried a byte-identical array of twelve English month names, which is both a duplicated table and a table of something the platform already knows in every language. Anchored to a UTC noon so no timezone can roll the date into the neighbouring month.\n */\nexport function monthName(locale: string | undefined, month: unknown): string {\n\tif (typeof month !== 'number' || !Number.isInteger(month)) return '';\n\tif (month < 1 || month > 12) return '';\n\treturn new Date(Date.UTC(2000, month - 1, 1, 12)).toLocaleDateString(\n\t\tintlLocales(locale),\n\t\t{ month: 'long', timeZone: 'UTC' },\n\t);\n}\n\n/**\n * A whole number with the page locale's digit grouping: `12,345` in English, `12.345` in Spanish.\n *\n * @remarks\n * Rounds rather than truncating, so a caller testing the magnitude (`Math.round(km) === 0`) and this label agree about which side of a boundary a value fell.\n */\nexport function formatInteger(\n\tlocale: string | undefined,\n\tvalue: unknown,\n): string {\n\tif (typeof value !== 'number' || !Number.isFinite(value)) return '';\n\treturn value.toLocaleString(intlLocales(locale), {\n\t\tmaximumFractionDigits: 0,\n\t});\n}\n\n/**\n * Format a number, dropping trailing zeros in the FRACTIONAL part only: `2.50` becomes `2.5`, `2.0` becomes `2`, and `100` stays `100`.\n *\n * @remarks\n * Guard on the decimal point, and never strip from the integer side. A naive `.replace(/\\.?0+$/, '')` over the whole string eats zeros off the INTEGER whenever there is no decimal point, so at `dp = 0` it turns `100` into `1`, `90` into `9` and `0` into the empty string.\n *\n * @example\n * ```ts\n * formatNumber(100, 0); // '100'\n * formatNumber(2.5, 1); // '2.5'\n * formatNumber(2, 1); // '2'\n * formatNumber(0, 0); // '0'\n * ```\n */\nexport function formatNumber(value: unknown, dp = 1): string {\n\tif (typeof value !== 'number' || !Number.isFinite(value)) return '';\n\tconst fixed = value.toFixed(dp);\n\treturn fixed.includes('.') ? fixed.replace(/\\.?0+$/, '') : fixed;\n}\n\nexport function formatPercent(value: unknown, dp = 1): string {\n\tconst n = formatNumber(value, dp);\n\treturn n ? `${n}%` : '';\n}\n\n/**\n * CSS class name per aspect type. Used by natal and synastry chart aspect\n * lines so the same color encoding (harmonious vs challenging) applies in\n * both wheels. Keys are lowercase canonical names, values are CSS class\n * suffixes the chart components define in their `:host` styles.\n */\nexport const ASPECT_CLASS: Record<string, string> = {\n\tconjunction: 'aspect-conjunction',\n\tsextile: 'aspect-sextile',\n\tsquare: 'aspect-square',\n\ttrine: 'aspect-trine',\n\topposition: 'aspect-opposition',\n};\n\n/**\n * Normalize the `type` field on an aspect entry to a lowercase, hyphen-separated canonical name (`SEMI_SEXTILE` and `SEMI SEXTILE` both become `semi-sextile`). Accepts any aspect-shaped object so both natal and synastry inter-aspect entries can share this.\n *\n * @remarks\n * Spaces are folded as well as underscores because the endpoints do not agree on the separator: aspects returns `SEMI SEXTILE` where synastry returns `SEMI_SEXTILE`. Handling only the underscore left the space form failing every {@link ASPECT_CLASS} and `ASPECT_SYMBOL` lookup, so the same aspect rendered hyphenated and correctly coloured in one component and space-separated in the neutral fallback colour in another.\n */\nexport function normalizeAspect(a: { type?: string }): string {\n\treturn (a.type ?? '')\n\t\t.toLowerCase()\n\t\t.trim()\n\t\t.replace(/[\\s_]+/g, '-');\n}\n\n/**\n * Display label for an aspect: `SEMI_SEXTILE` -> `Semi-sextile`.\n *\n * The raw value is an API enum and the table column it lands in is read by practitioners, not parsers. {@link normalizeAspect} stays the lookup key for classes and glyphs; this is the human-facing form.\n */\nexport function formatAspectName(a: { type?: string }): string {\n\treturn capitalize(normalizeAspect(a));\n}\n\n/**\n * Display label for an ayanamsa identifier. `kp-newcomb` -> `KP Newcomb`.\n *\n * The raw values are API enums, and every one of them needs a human form that {@link humanize} cannot derive: KP is an initialism that must stay uppercase, and `raman` is a person, B.V. Raman, not a word. Anything unmapped degrades to a humanized slug rather than rendering the enum. That fallback is a safety net, not a licence to skip the map, since a humanized slug reads as a bare surname where a full name belongs. A test fails if the committed spec gains a frame this map lacks.\n */\nexport const AYANAMSA_LABEL: Record<string, string> = {\n\t'kp-newcomb': 'KP Newcomb',\n\t'kp-old': 'KP Old',\n\tlahiri: 'Lahiri',\n\traman: 'B.V. Raman',\n\n\tcustom: 'Custom',\n};\n\nexport function formatAyanamsa(type: unknown, degrees?: unknown): string {\n\tconst label =\n\t\ttypeof type === 'string' ? (AYANAMSA_LABEL[type] ?? humanize(type)) : '';\n\tconst deg =\n\t\ttypeof degrees === 'number' ? `${formatNumber(degrees, 2)}\\u00b0` : '';\n\tif (label && deg) return `${label} (${deg})`;\n\treturn label || deg;\n}\n\n/**\n * Date plus time in one label: `Jan 15, 1990, 2:30 PM`.\n *\n * @remarks\n * Components were concatenating a raw date and a raw time (`1990-01-15 \\u00b7 14:30:00`) while siblings rendered the same instant through {@link formatDate}. One helper keeps every card reading the same way.\n *\n * Birth details arrive as two fields rather than one timestamp, so `time` may be passed separately; it is merged into a naive datetime, which {@link formatDate} and {@link formatTime} pin to UTC so the wall clock renders identically for every viewer.\n *\n * @example\n * ```ts\n * formatDateTime('en', '1990-01-15T14:30:00'); // 'Jan 15, 1990, 2:30 PM'\n * formatDateTime('en', '1990-01-15', '14:30:00'); // 'Jan 15, 1990, 2:30 PM'\n * formatDateTime('de', '1990-01-15T14:30:00'); // '15. Jan. 1990, 14:30'\n * formatDateTime('en', '1990-01-15'); // 'Jan 15, 1990'\n * ```\n */\nexport function formatDateTime(\n\tlocale: string | undefined,\n\tinput: unknown,\n\ttime?: unknown,\n): string {\n\tconst merged =\n\t\ttypeof input === 'string' &&\n\t\tDATE_ONLY.test(input) &&\n\t\ttypeof time === 'string' &&\n\t\tBARE_TIME.test(time)\n\t\t\t? `${input}T${time}`\n\t\t\t: input;\n\tconst date = formatDate(locale, merged);\n\tconst clock = formatTime(locale, merged);\n\tif (date && clock) return `${date}, ${clock}`;\n\treturn date || clock;\n}\n\n/**\n * The Sanskrit form of a name, but only when it actually differs from the English one.\n *\n * @remarks\n * Several endpoints pair an English `name` with a `sanskritName` that is sometimes the SAME string, because the tradition and the translation coincide (a nakshatra is `Ashwini` either way). Rendering the pair unconditionally then prints `Ashwini (Ashwini)`. That guard is the whole reason this exists: it is one comparison, it is easy to leave out, and leaving it out is invisible until a reader hits a name where the two agree.\n *\n * Presentation deliberately stays with the caller, since the same fact is drawn as a parenthetical in a table cell and as a middot-separated span on a chart heading.\n */\nexport function distinctSanskrit(\n\tname: unknown,\n\tsanskritName: unknown,\n): string | undefined {\n\tif (typeof sanskritName !== 'string' || !sanskritName) return undefined;\n\treturn sanskritName === name ? undefined : sanskritName;\n}\n\n/**\n * `English (Sanskrit)` for a value that carries both, falling back to whichever one exists.\n *\n * @example\n * ```ts\n * formatWithSanskrit('Tuesday', 'Mangalavara'); // 'Tuesday (Mangalavara)'\n * formatWithSanskrit('Ashwini', 'Ashwini'); // 'Ashwini'\n * ```\n */\nexport function formatWithSanskrit(\n\tname: unknown,\n\tsanskritName: unknown,\n): string {\n\tconst english = typeof name === 'string' ? name : '';\n\tconst sanskrit = distinctSanskrit(english, sanskritName);\n\tif (!english) return sanskrit ?? '';\n\treturn sanskrit ? `${english} (${sanskrit})` : english;\n}\n", "/**\n * The value a READER sees, for a response field the API returns twice.\n *\n * @remarks\n * Several endpoints now echo a display translation beside the canonical value: `nameLocalized` next to `name`, `signLocalized` next to `sign`, `typeLocalized` next to `type`. **The canonical field is deliberately always English, whatever `?lang=` says, so it stays safe to compare against in code**, and the localized one is deliberately absent from an English response.\n *\n * That split is the whole contract, and inverting it breaks charts silently rather than loudly: `planetGlyph`, `signGlyph`, `aspectSymbol`, `ASPECT_CLASS`, `SIGNS_ORDER.indexOf`, every `Map` key and every CSS class fragment is keyed on the English name, so pointing one of them at `nameLocalized` resolves to nothing on a translated page and to the same value on an English one, which is exactly the shape of defect that passes every gate (lesson 24). **The lookup stays on the canonical value; only the printed text node, the `title` and the `aria-label` move.**\n *\n * These two helpers exist so that rule lives in one place rather than as a `??` at every call site, and so an English response, where the localized field simply is not there, degrades by construction instead of by remembering. Both take the KEY of the canonical field and derive its partner, so a mistyped key or a field that is not a display string is a compile error rather than a silent empty string.\n */\n\n/** The one naming convention every helper here derives from. Ratified by the API and spreading to more operations, so it is matched as a convention and never as a list of field names. */\nconst LOCALIZED = 'Localized';\n\n/** A response row carrying a canonical English `K` plus the optional localized partner the API writes beside it. */\nexport type Localizable<K extends string> = Partial<\n\tRecord<K | `${K}Localized`, string>\n>;\n\n/** The same pairing where the value is a LIST of names, e.g. `retrogradePlanets`. */\nexport type LocalizableList<K extends string> = Partial<\n\tRecord<K | `${K}Localized`, string[]>\n>;\n\n/**\n * The text to print for `key`: the localized value when the response carried one, else the English one.\n *\n * @param english - What to print in the English case INSTEAD of the raw field, for a canonical value that is an API enum with a display form of its own (`type` is `SEMI_SEXTILE` on the wire and `Semi-sextile` on screen). Omit it wherever the canonical value is already the readable one.\n *\n * @example\n * ```ts\n * display(planet, 'name'); // 'Sol' on ?lang=es, 'Sun' on English\n * planetGlyph(planet.name) ?? display(planet, 'name'); // the lookup stays English, the fallback TEXT does not\n * display(aspect, 'type', formatAspectName(aspect)); // 'Tr\u00EDgono', else 'Trine' and never 'TRINE'\n * ```\n */\nexport function display<\n\tT extends Localizable<K>,\n\tK extends Extract<keyof T, string>,\n>(row: T | null | undefined, key: K, english?: string): string {\n\tconst rec = row as Record<string, unknown> | null | undefined;\n\tconst localized = rec?.[`${key}${LOCALIZED}`];\n\tif (typeof localized === 'string' && localized !== '') return localized;\n\tif (english !== undefined) return english;\n\tconst canonical = rec?.[key];\n\treturn typeof canonical === 'string' ? canonical : '';\n}\n\n/**\n * A list field as `{ value, label }` pairs: the English `value` every lookup is keyed on, and the `label` a reader sees.\n *\n * @remarks\n * The localized array is INDEX-ALIGNED with the canonical one, which is the only thing that makes the pairing possible, so it is zipped by position and neither side is ever sorted, filtered or deduped on its own. A list that is short or absent falls back per item, so a partial translation still resolves every glyph.\n */\nexport function displayList<\n\tT extends LocalizableList<K>,\n\tK extends Extract<keyof T, string>,\n>(row: T | null | undefined, key: K): Array<{ value: string; label: string }> {\n\tconst rec = row as Record<string, unknown> | null | undefined;\n\tconst canonical = rec?.[key];\n\tif (!Array.isArray(canonical)) return [];\n\tconst localized = rec?.[`${key}${LOCALIZED}`];\n\tconst labels = Array.isArray(localized) ? localized : [];\n\treturn canonical.map((value, i) => {\n\t\tconst label = labels[i];\n\t\treturn {\n\t\t\tvalue: String(value),\n\t\t\tlabel: typeof label === 'string' && label !== '' ? label : String(value),\n\t\t};\n\t});\n}\n\n/**\n * Fold every `XLocalized` field into its `X` partner: the reader's value under the canonical NAME, and the duplicate key gone.\n *\n * @remarks\n * For a renderer that has no idea what its fields MEAN and derives its columns from `Object.keys(row)`, which is how `<roxy-data>` started drawing `Planet | Planet Localized | Longitude | Sign | Sign Localized` the day the API began sending both. Two extra columns, headed in English, carrying the same fact twice, on a page whose owner changed nothing. That is a regression rather than a missing feature, so it is repaired at the key layer every render path already funnels through rather than at each of them.\n *\n * Three rules, and each has a way of going wrong:\n *\n * - **A `*Localized` key with no canonical partner stays put.** Suppressing on the name alone deletes data the response carries and nothing else is rendering.\n * - **The canonical key keeps its POSITION**, so a translated response and an English one lay out identically, column for column.\n * - **A row with nothing to fold is returned as the same object**, so the English path is not merely equivalent but untouched.\n *\n * The English value is dropped rather than shown beside its translation because the two are the same fact, and the caller here is generic: it cannot know that `sign` is the value a lookup would be keyed on. A component that needs both halves reads them itself with {@link display}.\n */\nexport function foldLocalized<V>(row: Record<string, V>): Record<string, V> {\n\tlet folded: Record<string, V> | undefined;\n\tfor (const key of Object.keys(row)) {\n\t\tif (!key.endsWith(LOCALIZED)) continue;\n\t\tconst base = key.slice(0, -LOCALIZED.length);\n\t\tif (base === '' || !(base in row)) continue;\n\t\tfolded ??= { ...row };\n\t\tconst value = row[key];\n\t\tif (value !== undefined && value !== null && value !== '')\n\t\t\tfolded[base] = value;\n\t\tdelete folded[key];\n\t}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AK5B,GAAMwC,EAAO,IAAIxC,EAAE,IAAI,CAAC,CAAE,CACvE,CAAC,EACD,MAAO,CAAE,KAAMJ,EAAK,KAAM,MAAOA,EAAK,MAAO,OAAAgC,EAAQ,KAAAW,CAAK,CAC3D,CACD,EA/Ka9C,EACL,OAAS,CACfgD,EACAC,svHACD,EAIAC,EAAA,CADCC,GAAS,CAAE,KAAM,MAAO,CAAC,GAPdnD,EAQZ,uBARYA,EAANkD,EAAA,CADNE,GAAc,sBAAsB,GACxBpD",
|
|
4
|
+
"sourcesContent": ["import { css, html, nothing } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { planetGlyph, signGlyph } from '../tokens/index.js';\nimport type {\n\tGetMonthlyEphemerisResponse,\n\tGetMonthlyTropicalEphemerisResponse,\n} from '../types/index.js';\nimport { RoxyDataElement } from '../utils/base-element.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport { splitDegreeInSign } from '../utils/degree.js';\nimport {\n\tformatMonthDay,\n\tformatMonthYear,\n\tformatWeekdayDay,\n} from '../utils/format.js';\nimport { display } from '../utils/localized.js';\n\n/**\n * The sample instant every position in both responses is calculated for, printed as a literal rather than a translated phrase.\n *\n * @remarks\n * An ephemeris is unusable without its time basis, which is why every published one declares it in the header: the Astrodienst and Sirius tables print `Time Zone: EDT (04:00 East)`, Astro-Seek prints `00:00 [UT/GMT]` and repeats that literal unchanged in all seven of its localized builds. A clock literal is the same in every language, so this needs no catalogue entry and cannot drift from one.\n *\n * Verified against a published midnight-EDT ephemeris for the same month on 2026-08-10: at 04:00 UTC on 2026-08-01 the Sun reads 8\u00B056'55\" Leo (128.949\u00B0) and this API returns 129.2669\u00B0 for that date, a difference of 0.318\u00B0 against the Sun's 0.955\u00B0/day, which is exactly the eight hours from 04:00 to 12:00 UTC. Both endpoint descriptions state noon UTC and the arithmetic agrees with them.\n */\nconst SAMPLE_INSTANT = '12:00 UTC';\n\n/**\n * The two monthly-ephemeris responses this table renders. Structurally\n * identical: the Western one carries fourteen tropical bodies, the Vedic one\n * the nine sidereal Navagraha, and neither says which frame it is in, so the\n * component never claims one (see the class docblock).\n */\ntype EphemerisResponse =\n\t| GetMonthlyTropicalEphemerisResponse\n\t| GetMonthlyEphemerisResponse;\n\n/** One body on one day, straight off the response. */\ntype Position = EphemerisResponse['days'][number]['positions'][number];\n\n/** A contiguous stretch of sampled days on which a body is retrograde, clipped to the month. */\ninterface RetrogradeRun {\n\tstart: string;\n\tend: string;\n}\n\n/** A body crossing into a new sign, dated by the first day the sample shows it there. */\ninterface Ingress {\n\tdate: string;\n\t/** Canonical English sign: the glyph lookup keys on this. */\n\tsign: string;\n\t/** The sign name a reader sees. */\n\tsignLabel: string;\n}\n\n/** One body read along the whole month: where it began, where it ended, and everything that changed in between. */\ninterface BodyTrack {\n\t/** Canonical English body name. Every glyph lookup and every column key uses this. */\n\tname: string;\n\t/** The body name a reader sees. */\n\tlabel: string;\n\tfirst: Position;\n\tlast: Position;\n\tingresses: Ingress[];\n\tretrogrades: RetrogradeRun[];\n\t/** Dates on which this body changed sign, so the daily grid can mark the same cells the chips name. */\n\tingressDates: Set<string>;\n\t/** Dates on which this body was seen to change direction, which a printed ephemeris marks in the column rather than only listing below it. */\n\tstationDates: Set<string>;\n}\n\n/** One day of the grid: the date plus one cell per body, aligned to {@link ViewModel.bodies}. */\ninterface DayRow {\n\tdate: string;\n\tcells: Array<Position | undefined>;\n}\n\ninterface ViewModel {\n\tyear: number;\n\tmonth: number;\n\tbodies: BodyTrack[];\n\trows: DayRow[];\n}\n\n/**\n * Monthly ephemeris: every body read across a whole month, as the reference\n * table a practitioner works from plus the two things a month view exists to\n * answer.\n *\n * @remarks\n * Renders `POST /astrology/planets/monthly` (fourteen tropical Western bodies)\n * and `POST /vedic-astrology/planetary-positions/monthly` (the nine sidereal\n * Navagraha). One response shape, so one component; nothing selects between\n * them, because the payload is the only honest discriminator and the layout is\n * the same either way.\n *\n * **The grid follows the published ephemeris, which is one of the most\n * convention-bound artifacts in astrology and where a deviation reads as\n * amateurish on sight.** Checked on 2026-08-10 against the Sirius-generated\n * ephemeris for this same month published by Cafe Astrology, and against the\n * Astro-Seek monthly ephemeris: days run DOWN the rows with the weekday beside\n * the day number, bodies run ACROSS the columns headed by their glyphs, a cell\n * is `9\u264C16` with the sign glyph BETWEEN the degree and the minutes rather than a\n * decimal longitude, retrograde is marked in the cell, and the sign changes and\n * direction changes are listed separately beside the grid, which is what those\n * publications call Ingresses and Stations. One deliberate deviation, and it is\n * additive: a printed ephemeris prints the sign glyph only on the row where it\n * changes, because a reader has the whole page in view. A scrolling table has no\n * such anchor, so every cell carries its glyph and the ingress cell is tinted\n * instead, which makes the same day easier to find rather than harder.\n *\n * **Two blocks, both always in the page, and the order is the reading order.**\n * A month of daily positions is 31 rows by up to 14 bodies, and dumping that\n * alone answers \"where was Mars on the 12th\" while burying the questions a\n * practitioner actually opens an ephemeris for: when did a body change sign,\n * and when did it turn retrograde. So the derived answer leads. Each body gets\n * one row carrying its position on the first and last sampled day, a chip per\n * sign it entered with the date, and a chip per retrograde stretch. This is also\n * how the published tables separate the Moon, which changes sign every two or\n * three days and would otherwise swamp a single date-ordered ingress list: one\n * row per body puts its thirteen crossings on their own line. Below it, the full\n * daily grid, so every chip can be checked against the day it came from. Neither\n * block is behind a tab or a disclosure, and the grid scrolls inside its own box\n * so a phone never scrolls the page sideways.\n *\n * **Ingresses and retrograde windows are DERIVED from consecutive days, and the\n * grain of the answer is the grain of the sample.** The API returns one\n * position per day at noon UTC, so an ingress is dated to the first day the\n * body is shown in the new sign and a retrograde run to the first and last days\n * it is shown retrograde. The true crossing and the true station fall somewhere\n * in the preceding 24 hours; a month page cannot say where, and pretending to a\n * time the response does not carry would be the worse error. A run that reaches\n * either edge of the month is clipped there rather than extrapolated, so\n * `Retrograde Aug 1 - Aug 31` means what it says: retrograde on every day this\n * month.\n *\n * **No coordinate-system badge, deliberately.** The Western endpoint is always\n * tropical, but the Vedic one takes `coordinateSystem` as a REQUEST parameter\n * (`sidereal` by default, `tropical` on request) and echoes nothing about it in\n * the response, and neither response carries a `frame`. A card cannot label a\n * zodiac it was not told, and a wrong frame label on an ephemeris is worse than\n * none, so the roster of bodies is left to say what it says.\n *\n * `hide-readings` is a no-op here: neither endpoint returns a word of\n * interpretation, so there is nothing to take away.\n */\n@customElement('roxy-ephemeris-table')\nexport class RoxyEphemerisTable extends RoxyDataElement<EphemerisResponse> {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tcss`:host{overflow-x:clip}.wrap{background:var(--roxy-surface,#fff);width:100%;color:var(--roxy-fg,#0a0a0a);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-lg,1.5rem);box-shadow:var(--roxy-shadow-sm);gap:var(--roxy-space-md,1rem);grid-template-columns:minmax(0,1fr);display:grid}header{justify-content:space-between;align-items:baseline;gap:var(--roxy-space-sm,.5rem) var(--roxy-space-md,1rem);flex-wrap:wrap;display:flex}.title{font-size:var(--roxy-text-lg,1.125rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-primary,#0f172a);margin:0}.month{color:var(--roxy-muted,#71717a);font-size:var(--roxy-text-sm,.875rem);gap:var(--roxy-space-xs,.25rem) var(--roxy-space-sm,.5rem);flex-wrap:wrap;margin:0;display:flex}.basis{font-variant-numeric:tabular-nums}.wrap>*{min-width:0}h3{margin:0 0 var(--roxy-space-xs,.25rem);font-size:var(--roxy-text-xs,.75rem);font-weight:var(--roxy-weight-bold,600);text-transform:uppercase;letter-spacing:.06em;color:var(--roxy-muted,#71717a)}.tracks{background:var(--roxy-border,#e4e4e7);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);grid-template-columns:minmax(0,1fr);gap:1px;display:grid;overflow:hidden}.track{align-items:center;gap:var(--roxy-space-xs,.25rem) var(--roxy-space-sm,.5rem);padding:6px var(--roxy-space-sm,.5rem);background:var(--roxy-surface,#fff);font-size:var(--roxy-text-sm,.875rem);flex-wrap:wrap;display:flex}.body-name{align-items:baseline;gap:.35rem;min-width:8.5rem;font-weight:500;display:inline-flex}.body-name .glyph{color:var(--roxy-accent-ink,#b45309);font-size:1.1em}.span{color:var(--roxy-secondary,#475569);font-variant-numeric:tabular-nums;white-space:nowrap;align-items:baseline;gap:.3rem;display:inline-flex}.arrow{color:var(--roxy-muted,#71717a)}.chip-date{color:var(--roxy-secondary,#475569)}.chips{gap:var(--roxy-space-xs,.25rem);flex-wrap:wrap;margin-left:auto;display:flex}.chip{border-radius:var(--roxy-radius-full,9999px);font-size:var(--roxy-text-xs,.75rem);white-space:nowrap;align-items:baseline;gap:.25rem;padding:1px 8px;display:inline-flex}.chip--ingress{background:color-mix(in srgb, var(--roxy-accent,#f59e0b) 14%, transparent);color:var(--roxy-fg,#0a0a0a)}.chip--retro{background:color-mix(in srgb, var(--roxy-danger,#dc2626) 10%, transparent);color:var(--roxy-danger-fg,#991b1b);font-weight:var(--roxy-weight-bold,600)}.scroll:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b);outline-offset:2px}.scroll{border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);-webkit-overflow-scrolling:touch;min-width:0;overflow-x:auto}table{border-collapse:collapse;font-size:var(--roxy-text-xs,.75rem)}th,td{text-align:left;border-bottom:1px solid var(--roxy-border,#e4e4e7);white-space:nowrap;padding:4px 8px}thead th{color:var(--roxy-muted,#71717a);font-weight:var(--roxy-weight-bold,600);background:color-mix(in srgb, var(--roxy-border,#e4e4e7) 20%, transparent)}thead th .glyph{color:var(--roxy-fg,#0a0a0a);font-size:1.15em}th.day{z-index:1;background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a);font-variant-numeric:tabular-nums;border-right:1px solid var(--roxy-border,#e4e4e7);font-weight:500;position:sticky;left:0}thead th.day{z-index:2;background:var(--roxy-surface,#fff)}td{font-variant-numeric:tabular-nums}.sg{color:var(--roxy-secondary,#475569);font-variant-numeric:normal;margin:0 .15em}.retro-mark{font-weight:var(--roxy-weight-bold,600);margin-left:.25em}td.retro{background:color-mix(in srgb, var(--roxy-danger,#dc2626) 10%, transparent);color:var(--roxy-danger-fg,#991b1b)}td.retro .sg{color:inherit}td.ingress{box-shadow:inset 3px 0 var(--roxy-accent-ink,#b45309);font-weight:var(--roxy-weight-bold,600)}td.station{border-top:2px solid var(--roxy-danger-fg,#991b1b);font-weight:var(--roxy-weight-bold,600)}`,\n\t];\n\n\t/** Override the card heading. Empty keeps the default, which is translated like every other chrome string. */\n\t@property({ type: String })\n\theading = 'Ephemeris';\n\n\tprotected renderEmpty() {\n\t\treturn html`<div class=\"roxy-empty\" role=\"status\">${this.t('No ephemeris data')}</div>`;\n\t}\n\n\tprotected renderData(data: EphemerisResponse) {\n\t\tif (!data.days?.length) return this.renderEmpty();\n\t\tconst vm = this.toViewModel(data);\n\t\tconst locale = this.effectiveLang();\n\t\treturn html`<div class=\"wrap\" part=\"card\"><header part=\"header\"><h2 class=\"title\">${this.t(this.heading)}</h2><p class=\"month\"><span>${formatMonthYear(locale, vm.year, vm.month)}</span><span class=\"basis\">${SAMPLE_INSTANT}</span></p></header><section part=\"section changes\"><h3>${this.t('Sign changes and retrograde periods')}</h3><div class=\"tracks\" role=\"list\">${vm.bodies.map((b) => this.renderTrack(b))}</div></section><section part=\"section daily\"><h3>${this.t('Daily positions')}</h3><div class=\"scroll\" part=\"table\" aria-label=\"${this.t('Daily positions')}\" tabindex=\"0\">${this.renderGrid(vm)}</div></section></div>`;\n\t}\n\n\t/** One body across the month: where it started, where it ended, and every change in between. */\n\tprivate renderTrack(b: BodyTrack) {\n\t\tconst glyph = planetGlyph(b.name);\n\t\treturn html`<div class=\"track\" role=\"listitem\"><span class=\"body-name\">${glyph ? html`<span class=\"glyph\" aria-hidden=\"true\">${glyph}</span>` : nothing}${b.label} </span><span class=\"span\">${this.renderPosition(b.first)}<span class=\"arrow\" aria-hidden=\"true\">\u2192</span>${this.renderPosition(b.last)} </span>${\n\t\t\t\tb.ingresses.length || b.retrogrades.length\n\t\t\t\t\t? html`<span class=\"chips\">${b.ingresses.map((i) => this.renderIngressChip(i))} ${b.retrogrades.map((r) => this.renderRetrogradeChip(r))}</span>`\n\t\t\t\t\t: nothing\n\t\t\t}</div>`;\n\t}\n\n\t/**\n\t * A longitude the way a published ephemeris prints one: `9\u264C16`, degree then\n\t * sign then minutes. The sign name rides on the `title` for a reader who does\n\t * not read glyphs, and it is the localized half.\n\t */\n\tprivate renderPosition(p: Position) {\n\t\tconst { degree, minute } = splitDegreeInSign(p.degreeInSign);\n\t\tconst g = signGlyph(p.sign);\n\t\tconst label = display(p, 'sign');\n\t\treturn html`<span class=\"pos\" title=\"${label}\">${degree}${\n\t\t\t\tg\n\t\t\t\t\t? html`<span class=\"sg\" aria-hidden=\"true\">${g}</span>`\n\t\t\t\t\t: html`<span class=\"sg\">${label}</span>`\n\t\t\t}${String(minute).padStart(2, '0')}</span>`;\n\t}\n\n\tprivate renderIngressChip(i: Ingress) {\n\t\tconst g = signGlyph(i.sign);\n\t\tconst date = formatMonthDay(this.effectiveLang(), i.date);\n\t\treturn html`<span class=\"chip chip--ingress\" aria-label=\"${this.t('Enters {{sign}} on {{date}}', { sign: i.signLabel, date })}\"><span aria-hidden=\"true\">\u2192</span>${g ? html`<span aria-hidden=\"true\">${g}</span>` : nothing}${i.signLabel} <span class=\"chip-date\">${date}</span></span>`;\n\t}\n\n\tprivate renderRetrogradeChip(r: RetrogradeRun) {\n\t\tconst locale = this.effectiveLang();\n\t\tconst start = formatMonthDay(locale, r.start);\n\t\tconst end = formatMonthDay(locale, r.end);\n\t\tconst range = start === end ? start : `${start} - ${end}`;\n\t\treturn html`<span class=\"chip chip--retro\"><span aria-hidden=\"true\">\u211E</span>${this.t('Retrograde {{range}}', { range })}</span>`;\n\t}\n\n\t/** The reference ephemeris: one row per day, one column per body, in the order the response lists them. */\n\tprivate renderGrid(vm: ViewModel) {\n\t\tconst locale = this.effectiveLang();\n\t\treturn html`<table><caption class=\"roxy-sr-only\">${this.t('Every body with its position on each day of the month, as a zodiac sign and a degree.')}</caption><thead><tr><th scope=\"col\" class=\"day\">${this.t('Date')}</th>${vm.bodies.map((b) => {\n\t\t\t\t\t\tconst glyph = planetGlyph(b.name);\n\t\t\t\t\t\treturn html`<th scope=\"col\" title=\"${b.label}\">${\n\t\t\t\t\t\t\t\tglyph\n\t\t\t\t\t\t\t\t\t? html`<span class=\"glyph\" aria-hidden=\"true\">${glyph}</span><span class=\"roxy-sr-only\">${b.label}</span>`\n\t\t\t\t\t\t\t\t\t: b.label\n\t\t\t\t\t\t\t}</th>`;\n\t\t\t\t\t})}</tr></thead><tbody>${vm.rows.map(\n\t\t\t\t\t(row) => html`<tr><th scope=\"row\" class=\"day\">${formatWeekdayDay(locale, row.date)}</th>${row.cells.map((cell, i) => this.renderCell(cell, vm.bodies[i], row.date))}</tr>`,\n\t\t\t\t)}</tbody></table>`;\n\t}\n\n\tprivate renderCell(\n\t\tcell: Position | undefined,\n\t\tbody: BodyTrack | undefined,\n\t\tdate: string,\n\t) {\n\t\tif (!cell) return html`<td>\u2014</td>`;\n\t\tconst classes = [\n\t\t\tcell.isRetrograde ? 'retro' : '',\n\t\t\tbody?.ingressDates.has(date) ? 'ingress' : '',\n\t\t\tbody?.stationDates.has(date) ? 'station' : '',\n\t\t]\n\t\t\t.filter(Boolean)\n\t\t\t.join(' ');\n\t\treturn html`<td class=\"${classes}\">${this.renderPosition(cell)}${\n\t\t\t\tcell.isRetrograde\n\t\t\t\t\t? html`<span class=\"retro-mark\" aria-label=\"${this.t('retrograde')}\">\u211E</span>`\n\t\t\t\t\t: nothing\n\t\t\t}</td>`;\n\t}\n\n\t/**\n\t * Walk the month once, keying every body on its canonical English name.\n\t *\n\t * @remarks\n\t * The column order is the order the response lists bodies on its first day,\n\t * which is the order each domain reads them in (Sun through Pluto then the\n\t * nodes, Chiron and Black Moon Lilith for the Western set; the Navagraha in\n\t * vara order for the Vedic one). A body that only appears on a later day is\n\t * appended rather than dropped, and a body missing from a given day leaves\n\t * that one cell empty instead of shifting the row.\n\t */\n\tprivate toViewModel(data: EphemerisResponse): ViewModel {\n\t\tconst order: string[] = [];\n\t\tconst series = new Map<string, Array<{ date: string; p: Position }>>();\n\t\tfor (const day of data.days) {\n\t\t\tfor (const p of day.positions) {\n\t\t\t\tlet samples = series.get(p.planet);\n\t\t\t\tif (!samples) {\n\t\t\t\t\tsamples = [];\n\t\t\t\t\tseries.set(p.planet, samples);\n\t\t\t\t\torder.push(p.planet);\n\t\t\t\t}\n\t\t\t\tsamples.push({ date: day.date, p });\n\t\t\t}\n\t\t}\n\n\t\tconst bodies: BodyTrack[] = [];\n\t\tfor (const name of order) {\n\t\t\tconst samples = series.get(name);\n\t\t\tconst first = samples?.[0];\n\t\t\tconst last = samples?.[samples.length - 1];\n\t\t\tif (!samples || !first || !last) continue;\n\t\t\tconst ingresses: Ingress[] = [];\n\t\t\tconst retrogrades: RetrogradeRun[] = [];\n\t\t\tconst ingressDates = new Set<string>();\n\t\t\tconst stationDates = new Set<string>();\n\t\t\tfor (let i = 0; i < samples.length; i++) {\n\t\t\t\tconst cur = samples[i];\n\t\t\t\tconst prev = samples[i - 1];\n\t\t\t\tif (!cur) continue;\n\t\t\t\tif (prev && cur.p.sign !== prev.p.sign) {\n\t\t\t\t\tingresses.push({\n\t\t\t\t\t\tdate: cur.date,\n\t\t\t\t\t\tsign: cur.p.sign,\n\t\t\t\t\t\tsignLabel: display(cur.p, 'sign'),\n\t\t\t\t\t});\n\t\t\t\t\tingressDates.add(cur.date);\n\t\t\t\t}\n\t\t\t\t// A direction change is only observable against a previous day, so a\n\t\t\t\t// body that is already retrograde on the first of the month stationed\n\t\t\t\t// before this page begins and is not marked as stationing on it.\n\t\t\t\tif (prev && cur.p.isRetrograde !== prev.p.isRetrograde)\n\t\t\t\t\tstationDates.add(cur.date);\n\t\t\t\tif (!cur.p.isRetrograde) continue;\n\t\t\t\t// Extend the run in progress only when yesterday was retrograde too, so\n\t\t\t\t// a body that stations twice in one month gets two chips rather than one\n\t\t\t\t// spanning the direct stretch between them.\n\t\t\t\tconst open = retrogrades[retrogrades.length - 1];\n\t\t\t\tif (open && prev?.p.isRetrograde) open.end = cur.date;\n\t\t\t\telse retrogrades.push({ start: cur.date, end: cur.date });\n\t\t\t}\n\t\t\tbodies.push({\n\t\t\t\tname,\n\t\t\t\tlabel: display(last.p, 'planet'),\n\t\t\t\tfirst: first.p,\n\t\t\t\tlast: last.p,\n\t\t\t\tingresses,\n\t\t\t\tretrogrades,\n\t\t\t\tingressDates,\n\t\t\t\tstationDates,\n\t\t\t});\n\t\t}\n\n\t\tconst rows: DayRow[] = data.days.map((day) => {\n\t\t\tconst byName = new Map(day.positions.map((p) => [p.planet, p]));\n\t\t\treturn { date: day.date, cells: bodies.map((b) => byName.get(b.name)) };\n\t\t});\n\t\treturn { year: data.year, month: data.month, bodies, rows };\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-ephemeris-table': RoxyEphemerisTable;\n\t}\n}\n", "/**\n * Shared string helpers used across components. Single source of truth so the\n * same formatting rules apply to every key/label/title that surfaces in the\n * shadow tree.\n *\n * - `lookupKey`: the ONE normalizer every lookup table in this library is keyed\n * and read by (`tokens/index.ts` glyphs and abbreviations, `i18n/` chrome\n * strings).\n * - `capitalize`: title-cases the first character, lowercases the rest. A\n * DISPLAY helper only; it is not a lookup key (see `lookupKey`).\n * - `humanize`: turns an API key (`birth_date`, `birthDate`, `mahadasha-end`)\n * into a label suitable for display (\"Birth date\", \"Mahadasha end\").\n */\n\n/**\n * Fold a name to the canonical key its lookup table is stored under: lower case, every run of spaces, underscores and hyphens collapsed to one space, trimmed.\n *\n * @remarks\n * This exists because a GUESSED key spelling is a defect class this repo has now shipped twice. The glyph tables were keyed off whatever {@link capitalize} happened to produce (`North node`), while the API returns `North Node`, so every call site that reached the table without first calling `capitalize` missed and fell through to a fabricated abbreviation. Aspects hit the same wall from the other side: `/aspects` returns `SEMI SEXTILE` where synastry returns `SEMI_SEXTILE`.\n *\n * One normalizer, applied when a table is DEFINED and again when it is READ, removes the whole class: no call site has to remember a convention, and no table has to guess a spelling. Use it for every new table keyed by an API-supplied name.\n *\n * @example\n * ```ts\n * lookupKey('North Node'); // 'north node'\n * lookupKey('SEMI_SEXTILE'); // 'semi sextile'\n * lookupKey('semi-sextile'); // 'semi sextile'\n * ```\n */\nexport function lookupKey(s: string): string {\n\treturn s\n\t\t.toLowerCase()\n\t\t.replace(/[\\s_-]+/g, ' ')\n\t\t.trim();\n}\n\nexport function capitalize(s: string): string {\n\tif (!s) return '';\n\treturn s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();\n}\n\nexport function humanize(s: string): string {\n\treturn (\n\t\ts\n\t\t\t.replace(/[_-]+/g, ' ')\n\t\t\t.replace(/([a-z])([A-Z])/g, '$1 $2')\n\t\t\t// Split a trailing/embedded digit off a word so \"person1\" reads \"Person 1\"\n\t\t\t// and every group legend and field label spaces its ordinal.\n\t\t\t.replace(/([a-z])([0-9])/g, '$1 $2')\n\t\t\t.replace(/^\\w/, (c) => c.toUpperCase())\n\t);\n}\n", "/**\n * Symbol constants used across components. Single source of truth so chart\n * wheels, card headers, hexagram displays, and panchang tables stay visually\n * consistent.\n *\n * @remarks\n * **Every table here is keyed by {@link lookupKey} and read ONLY through the accessor beside it.** The raw records are deliberately not exported: a component that indexes a record directly has to guess the key convention, and a guessed spelling is what shipped `No North Node R`, `So South Node R` and `Bl Black Moon Lilith` into a live customer's natal chart. The API returns `North Node` with a space; the table was keyed `North node`, the spelling {@link capitalize} happens to produce, so every call site that forgot to call `capitalize` first missed the table.\n *\n * **A miss returns `undefined`, never a manufactured abbreviation.** The old `?? name.slice(0, 2)` fallback is what made the defect survive review: a failed lookup renders as a plausible two-letter code that reads exactly like an intentional abbreviation, so nothing about the output says \"this is broken\". A caller that can omit the glyph should omit it (`?? ''`); a caller that must show something falls back to the FULL name, which is visibly wrong at the size these slots are drawn.\n *\n * `tests/tokens.test.ts` resolves every body, sign and aspect name the committed spec can emit against these tables, so a vocabulary the API gains cannot ship unglyphed.\n */\n\nimport { lookupKey } from '../utils/string.js';\n\n/** Look one name up in a normalized table. The single read path for every map in this file. */\nconst resolve = (\n\ttable: Record<string, string>,\n\tname: string | undefined | null,\n): string | undefined => (name ? table[lookupKey(name)] : undefined);\n\nconst PLANET_GLYPH: Record<string, string> = {\n\tsun: '\u2609',\n\tmoon: '\u263D',\n\tmercury: '\u263F',\n\tvenus: '\u2640',\n\tearth: '\u2641',\n\tmars: '\u2642',\n\tjupiter: '\u2643',\n\tsaturn: '\u2644',\n\turanus: '\u2645',\n\tneptune: '\u2646',\n\tpluto: '\u2647',\n\trahu: '\u260A',\n\tketu: '\u260B',\n\tascendant: 'Asc',\n\tlagna: 'La',\n\t'north node': '\u260A',\n\t'south node': '\u260B',\n\tchiron: '\u26B7',\n\tlilith: '\u26B8',\n\t'black moon lilith': '\u26B8',\n};\n\n/** Astrological glyph for a planet or point, or `undefined` when the library has none for it. */\nexport const planetGlyph = (\n\tname: string | undefined | null,\n): string | undefined => resolve(PLANET_GLYPH, name);\n\nconst PLANET_ABBR: Record<string, string> = {\n\tsun: 'Su',\n\tmoon: 'Mo',\n\tmercury: 'Me',\n\tvenus: 'Ve',\n\tmars: 'Ma',\n\tjupiter: 'Ju',\n\tsaturn: 'Sa',\n\turanus: 'Ur',\n\tneptune: 'Ne',\n\tpluto: 'Pl',\n\trahu: 'Ra',\n\tketu: 'Ke',\n\tascendant: 'Asc',\n\tlagna: 'La',\n};\n\n/** Two-letter graha code for the tight cells of a North/South Indian kundli, or `undefined`. */\nexport const planetAbbr = (\n\tname: string | undefined | null,\n): string | undefined => resolve(PLANET_ABBR, name);\n\nconst SIGN_GLYPH: Record<string, string> = {\n\taries: '\u2648',\n\ttaurus: '\u2649',\n\tgemini: '\u264A',\n\tcancer: '\u264B',\n\tleo: '\u264C',\n\tvirgo: '\u264D',\n\tlibra: '\u264E',\n\tscorpio: '\u264F',\n\tsagittarius: '\u2650',\n\tcapricorn: '\u2651',\n\taquarius: '\u2652',\n\tpisces: '\u2653',\n};\n\n/** Zodiac glyph for a sign name in any case, or `undefined`. */\nexport const signGlyph = (\n\tname: string | undefined | null,\n): string | undefined => resolve(SIGN_GLYPH, name);\n\nconst SIGN_ABBR: Record<string, string> = {\n\taries: 'Ar',\n\ttaurus: 'Ta',\n\tgemini: 'Ge',\n\tcancer: 'Cn',\n\tleo: 'Le',\n\tvirgo: 'Vi',\n\tlibra: 'Li',\n\tscorpio: 'Sc',\n\tsagittarius: 'Sg',\n\tcapricorn: 'Cp',\n\taquarius: 'Aq',\n\tpisces: 'Pi',\n};\n\n/** Two-letter rashi code for kundli cells and grid headers, or `undefined`. */\nexport const signAbbr = (name: string | undefined | null): string | undefined =>\n\tresolve(SIGN_ABBR, name);\n\n/** The twelve signs in zodiacal order. Display values, not lookup keys: read them through {@link signGlyph} / {@link signAbbr}. */\nexport const SIGNS_ORDER = [\n\t'Aries',\n\t'Taurus',\n\t'Gemini',\n\t'Cancer',\n\t'Leo',\n\t'Virgo',\n\t'Libra',\n\t'Scorpio',\n\t'Sagittarius',\n\t'Capricorn',\n\t'Aquarius',\n\t'Pisces',\n] as const;\n\n/**\n * Glyph per aspect. Used by the natal, transit and synastry aspect tables.\n *\n * @remarks\n * These are the nine aspects Unicode itself defines as a set, in its Miscellaneous Symbols block note: `260C, 26BA, 2220, 26B9, 25A1, 25B3, 26BC, 26BB, 260D` for 0, 30, 45, 60, 90, 120, 135, 150 and 180 degrees. That is exactly the vocabulary the API returns, so every aspect resolves to a real glyph and none falls through to a truncated slug.\n *\n * Do not substitute the visually similar maths operators. Unicode lists `\u22BB` XOR and `\u22BC` NAND as cross-references FROM the real quincunx and semisextile glyphs, so they look like safe stand-ins and are easy to pair the wrong way round, which renders a 150 degree quincunx with the 30 degree semisextile symbol. An astrologer reads the glyph, not the tooltip.\n */\nconst ASPECT_SYMBOL: Record<string, string> = {\n\tconjunction: '\u260C',\n\tsemisextile: '\u26BA',\n\t'semi sextile': '\u26BA',\n\tsemisquare: '\u2220',\n\t'semi square': '\u2220',\n\tsextile: '\u26B9',\n\tsquare: '\u25A1',\n\ttrine: '\u25B3',\n\tsesquiquadrate: '\u26BC',\n\tquincunx: '\u26BB',\n\topposition: '\u260D',\n};\n\n/** Aspect glyph for any of the separator forms the endpoints use (`SEMI_SEXTILE`, `SEMI SEXTILE`, `semi-sextile`), or `undefined`. */\nexport const aspectSymbol = (\n\tname: string | undefined | null,\n): string | undefined => resolve(ASPECT_SYMBOL, name);\n\n/** Trigrams used by I Ching hexagrams. Eight trigrams compose 64 hexagrams. */\nconst TRIGRAM_GLYPH: Record<string, string> = {\n\theaven: '\u2630',\n\tlake: '\u2631',\n\tfire: '\u2632',\n\tthunder: '\u2633',\n\twind: '\u2634',\n\twater: '\u2635',\n\tmountain: '\u2636',\n\tearth: '\u2637',\n};\n\n/** Trigram glyph for a trigram name in any case, or `undefined`. */\nexport const trigramGlyph = (\n\tname: string | undefined | null,\n): string | undefined => resolve(TRIGRAM_GLYPH, name);\n\n/** Moon phase emoji set. Used by the moon phase card. */\nconst MOON_PHASE_EMOJI: Record<string, string> = {\n\t'new moon': '\uD83C\uDF11',\n\t'waxing crescent': '\uD83C\uDF12',\n\t'first quarter': '\uD83C\uDF13',\n\t'waxing gibbous': '\uD83C\uDF14',\n\t'full moon': '\uD83C\uDF15',\n\t'waning gibbous': '\uD83C\uDF16',\n\t'last quarter': '\uD83C\uDF17',\n\t'waning crescent': '\uD83C\uDF18',\n};\n\n/**\n * Emoji for a lunar phase, or `undefined`.\n *\n * @remarks\n * The live API suffixes most phase names (`Waxing Gibbous Moon`) and calls the third quarter `Third Quarter Moon`, while only new and full moon carry the suffix in the table. Both reconciliations live here rather than in the card, so any component reading a phase name resolves the same eight phases from the same four spellings.\n */\nexport const moonPhaseEmoji = (\n\tname: string | undefined | null,\n): string | undefined => {\n\tif (!name) return undefined;\n\tconst key = lookupKey(name);\n\tconst bare = key.replace(/ moon$/, '');\n\tconst alias = bare === 'third quarter' ? 'last quarter' : bare;\n\treturn MOON_PHASE_EMOJI[key] ?? MOON_PHASE_EMOJI[alias];\n};\n", "import {\n\ttype CSSResultGroup,\n\thtml,\n\tLitElement,\n\tnothing,\n\ttype PropertyValues,\n} from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { resolveLang } from '../i18n/lang.js';\nimport { LocaleController } from '../i18n/locale-controller.js';\nimport { translate } from '../i18n/registry.js';\nimport { baseStyles } from './base-styles.js';\nimport { buildRequest, FetchController } from './fetch-controller.js';\nimport {\n\ttype InterpSection,\n\trenderInterpAccordion,\n} from './interp-accordion.js';\nimport { MarkupDataController } from './markup-data.js';\n\n/**\n * Shared base for every data-driven Roxy component. Consolidates the things every component used to repeat by hand and adds the self-contained, drop-in behavior: controlled-mode hydration, an opt-in self-fetch (form, request, loading, error, empty), the typed `data` slot, and the render switch. A subclass implements one method, {@link RoxyDataElement.renderData}.\n *\n * @remarks\n * Two render modes, one component, which is the whole drop-in contract:\n *\n * - Controlled: a server (WordPress, JSX SSR, static HTML) fetches the response and injects it as a direct-child `<script type=\"application/json\" class=\"roxy-data\">`. {@link MarkupDataController} hydrates `data` from it on connect. No key reaches the browser. This is the path the WordPress plugin drives, and it is unchanged by the base class.\n * - Uncontrolled: no data is injected, but a `data-endpoint` and a `pk_` `publishable-key` are set. The component renders its own `<roxy-endpoint-form>` (an internal detail, never placed by the consumer), and on submit fetches through {@link FetchController}, which refuses any non-publishable key. The result populates `data` and the component renders it.\n *\n * The JavaScript `data` property always wins over markup, so a host that assigns `el.data = \u2026` after upgrade is authoritative.\n *\n * Self-fetch needs `<roxy-endpoint-form>` (and `<roxy-location-search>`) registered. The CDN bundle and the full `@roxyapi/ui` entry register everything; per-component ESM consumers that want self-fetch import the form component too.\n *\n * Two things every subclass inherits for the host page to shape the render from outside the shadow root, with no JavaScript: the `hide-readings` attribute ({@link RoxyDataElement.hideReadings}), and the `part` names on the base's own branches (`form`, `loading`, `error`, `edit-bar`, `attribution`). A component adds `part` to its own structural blocks; the vocabulary is in `docs/authoring.md`.\n *\n * @example\n * ```ts\n * @customElement('roxy-dream-card')\n * export class RoxyDreamCard extends RoxyDataElement<GetDreamSymbolResponse> {\n * static styles = [baseStyles, css`.card { \u2026 }`];\n * protected renderData(d: GetDreamSymbolResponse) {\n * return html`<article class=\"card\">\u2026</article>`;\n * }\n * protected renderEmpty() {\n * return html`<div class=\"roxy-empty\" role=\"status\">No dream symbol</div>`;\n * }\n * }\n * ```\n */\nexport abstract class RoxyDataElement<T = unknown> extends LitElement {\n\tstatic styles: CSSResultGroup = [baseStyles];\n\n\t/** Typed RoxyAPI response. Assigned in JavaScript, hydrated from the roxy-data island, or set by a self-fetch. */\n\t@property({ attribute: false })\n\tdata: T | null = null;\n\n\t/** Endpoint path for self-fetch, e.g. \"astrology/natal-chart\" or \"dreams/symbols/{id}\". Empty disables self-fetch (controlled mode only). */\n\t@property({ type: String, attribute: 'data-endpoint' })\n\tendpoint = '';\n\n\t/** HTTP method for self-fetch. */\n\t@property({ type: String })\n\tmethod: 'GET' | 'POST' = 'POST';\n\n\t/** Browser-safe publishable key (pk_) for self-fetch. A secret key is refused client-side. */\n\t@property({ type: String, attribute: 'publishable-key' })\n\tpublishableKey?: string;\n\n\t/** Override the API origin for self-hosted or proxied deployments. */\n\t@property({ type: String, attribute: 'base-url' })\n\tbaseUrl?: string;\n\n\t/** Override the OpenAPI spec URL the self-fetch form introspects. */\n\t@property({ type: String, attribute: 'spec-url' })\n\tspecUrl?: string;\n\n\t/** Consumer backend route that proxies the request (holds the secret key). When set, self-fetch POSTs the request here instead of calling RoxyAPI directly, so no key reaches the browser. The server-rendered (WordPress) path. */\n\t@property({ type: String, attribute: 'submit-url' })\n\tsubmitUrl?: string;\n\n\t/** Persist the last self-fetch form values in sessionStorage (keyed by endpoint) and prefill the form on reload. */\n\t@property({ type: Boolean })\n\tremember = false;\n\n\t/**\n\t * Render the chart and the data, and omit the written interpretation. Off by default, so a component that does not set it is byte-identical to before.\n\t *\n\t * @remarks\n\t * The suppressed content is the prose an endpoint returns ABOUT the result: the interpretation accordion, the interpretive paragraphs, and the keyword chips that belong to them. Everything a practitioner reads the numbers off stays: wheels, tables, grids, legends, pills, counts and dates. The reading is dropped from the DOM rather than hidden with CSS, so a page that publishes the chart alone never ships the prose it is not showing.\n\t *\n\t * Set it when the page supplies its own words, which is the common case for a practitioner site that wants the graphic under its own writing.\n\t */\n\t@property({ type: Boolean, attribute: 'hide-readings', reflect: true })\n\thideReadings = false;\n\n\t/** Override the self-fetch form's submit-button label. Empty derives one from the endpoint. */\n\t@property({ type: String, attribute: 'submit-label' })\n\tsubmitLabel?: string;\n\n\t/** Render a small \"Spiritual data by RoxyAPI\" credit under a self-fetch or auto-mount result. Off by default; any value except \"off\"/\"false\" enables it. The one-tag widgets script turns it on unless data-attribution=\"off\". Never shown in controlled mode. */\n\t@property({ type: String })\n\tattribution?: string;\n\n\t/** True while an uncontrolled self-fetch is in flight. Public so {@link FetchController} can drive it. */\n\t@state()\n\tloading = false;\n\n\t/** Message from a failed self-fetch, or null. Public so {@link FetchController} can drive it. */\n\t@state()\n\terror: string | null = null;\n\n\t/**\n\t * True once a self-fetch (not a consumer-assigned or island-hydrated `data`) produced the current result. It gates the interactive result affordances, so controlled mode never shows an Edit control or a sticky picker.\n\t */\n\t@state()\n\tprivate selfFetched = false;\n\n\t/** True when the visitor asked to edit a self-fetch result, so the form is restored over the result. */\n\t@state()\n\tprivate editing = false;\n\n\t/** True when the last self-fetch form was a single-enum picker, so it stays visible above the result and a change refetches. */\n\t@state()\n\tprivate sticky = false;\n\n\t/** Last submitted form values (nested per group), kept in memory to restore the form on Edit and to prefill the sticky picker. */\n\tprivate lastValues?: Record<string, unknown>;\n\n\tprivate fetcher: FetchController<T>;\n\n\tconstructor() {\n\t\tsuper();\n\t\t// Controlled mode: hydrate `data` from a direct-child roxy-data island when\n\t\t// no JS property was assigned. Keyless; the server already fetched.\n\t\tnew MarkupDataController<T>(this);\n\t\t// Re-render if a chrome-string catalogue lands after this element upgraded.\n\t\tnew LocaleController(this);\n\t\tthis.fetcher = new FetchController<T>(this);\n\t}\n\n\t/**\n\t * The chrome string for this element's language, keyed by its own English source text.\n\t *\n\t * @remarks\n\t * Pass the English copy, never a key. With no catalogue registered the source string is returned unchanged, so an English page pays nothing and a language we do not ship degrades to English rather than to a visible key.\n\t *\n\t * Chrome only. A value the API returned (a planet, a sign, an aspect, a house system) is NOT translated here: it is rendered as the response carries it, so the words on the chart and the words in the response can never disagree.\n\t *\n\t * @example\n\t * ```ts\n\t * this.t('Aspect grid'); // 'Cuadricula de aspectos' under lang=\"es\"\n\t * this.t('{{count}} planets', { count: 12 }); // '12 planetas'\n\t * ```\n\t */\n\tprotected t(source: string, vars?: Record<string, string | number>): string {\n\t\treturn translate(this.effectiveLang(), source, vars);\n\t}\n\n\t/** {@link RoxyDataElement.t} as a value, bound once, for a shared render helper that has no host of its own and therefore cannot resolve a page language (`utils/hd-reading.ts`). Named `translator` and not `translate` because `HTMLElement.translate` is a real DOM property and shadowing it with a protected member makes every `@customElement` decorator in the library fail to typecheck. */\n\tprotected readonly translator = (\n\t\tsource: string,\n\t\tvars?: Record<string, string | number>,\n\t): string => this.t(source, vars);\n\n\tprotected willUpdate(changed: PropertyValues): void {\n\t\tif (changed.has('publishableKey')) {\n\t\t\tthis.fetcher.publishableKey = this.publishableKey;\n\t\t}\n\t\tif (changed.has('baseUrl') && this.baseUrl) {\n\t\t\tthis.fetcher.baseUrl = this.baseUrl;\n\t\t}\n\t\tif (changed.has('submitUrl')) {\n\t\t\tthis.fetcher.submitUrl = this.submitUrl;\n\t\t}\n\t}\n\n\trender(): unknown {\n\t\tif (this.loading) return this.renderLoading();\n\t\tif (this.error != null) return this.renderError(this.error);\n\t\tif (this.data != null) {\n\t\t\t// Controlled mode (consumer-assigned or island-hydrated data) renders the\n\t\t\t// result alone, byte-identical to before: no picker, no Edit. The one\n\t\t\t// exception is the widgets auto-mount attrs-complete path, which assigns\n\t\t\t// data directly AND sets `attribution`; a real controlled consumer never\n\t\t\t// sets the attribute, so this stays byte-identical for them.\n\t\t\tif (!this.selfFetched) {\n\t\t\t\treturn this.showAttribution()\n\t\t\t\t\t? html`${this.renderData(this.data)}${this.renderAttribution()}`\n\t\t\t\t\t: this.renderData(this.data);\n\t\t\t}\n\t\t\tif (this.editing) return this.renderForm();\n\t\t\treturn this.renderResult(this.data);\n\t\t}\n\t\treturn this.renderNoData();\n\t}\n\n\t/** Render the populated response. The single method every component implements. */\n\tprotected abstract renderData(data: T): unknown;\n\n\t/**\n\t * The interpretation accordion, gated by {@link RoxyDataElement.hideReadings}. Every component that shows a written reading routes through here instead of calling {@link renderInterpAccordion} directly.\n\t *\n\t * @remarks\n\t * The gate lives on the base rather than in each component because the property does, and a plain render function cannot read component state. One call site per accordion, one place that decides whether prose renders, and the section it emits carries the same `readings` part in every component.\n\t *\n\t * Prose that is NOT in an accordion (a summary paragraph, a per-item interpretation) is still the component's own to gate, since only the component knows which of its blocks are readings.\n\t */\n\tprotected renderInterpretation(\n\t\tsections: InterpSection[],\n\t\tname: string,\n\t\theading?: string,\n\t): unknown {\n\t\tif (this.hideReadings) return nothing;\n\t\t// The default heading is localized HERE rather than in the accordion:\n\t\t// that is a plain render function with no host, so it cannot read a\n\t\t// language, and this is the one call site every component routes through.\n\t\treturn renderInterpAccordion(sections, name, heading ?? this.t('Reading'));\n\t}\n\n\t/**\n\t * A self-fetch result plus its re-query affordance. A single-enum form keeps its picker above the result so a new selection refetches (a sign switch is a new reading); any other form gets a compact Edit control that restores the form with the previous values.\n\t */\n\tprotected renderResult(data: T): unknown {\n\t\tconst body = this.sticky\n\t\t\t? html`${this.renderForm()}${this.renderData(data)}`\n\t\t\t: html`<div class=\"roxy-edit-bar\" part=\"edit-bar\"><button type=\"button\" class=\"roxy-edit\" @click=\"${this.onEdit}\">${this.t('Edit query')}</button></div>${this.renderData(data)}`;\n\t\treturn this.showAttribution()\n\t\t\t? html`${body}${this.renderAttribution()}`\n\t\t\t: body;\n\t}\n\n\tprivate onEdit = () => {\n\t\tthis.editing = true;\n\t};\n\n\t/** True when the attribution credit renders: the attribute is present and not explicitly disabled. */\n\tprivate showAttribution(): boolean {\n\t\treturn (\n\t\t\tthis.attribution != null &&\n\t\t\tthis.attribution !== 'off' &&\n\t\t\tthis.attribution !== 'false'\n\t\t);\n\t}\n\n\t/** Small muted credit under a self-fetch or auto-mount result. Reached only from the result path, so controlled mode never renders it. */\n\tprotected renderAttribution(): unknown {\n\t\treturn html`<div class=\"roxy-attribution\" part=\"attribution\"><a href=\"https://roxyapi.com/?utm_source=widget&utm_medium=embed\" target=\"_blank\" rel=\"noopener\">${this.t('Spiritual data by RoxyAPI')}</a></div>`;\n\t}\n\n\t/** The data-absent branch: the self-fetch form when an endpoint is set, otherwise the empty state. */\n\tprotected renderNoData(): unknown {\n\t\treturn this.endpoint ? this.renderForm() : this.renderEmpty();\n\t}\n\n\t/** Internal self-fetch form. Reuses the introspecting `<roxy-endpoint-form>`; the consumer never places it. */\n\tprotected renderForm(): unknown {\n\t\treturn html`<roxy-endpoint-form part=\"form\" data-endpoint=\"${this.endpoint}\" method=\"${this.method}\" spec-url=\"${ifDefined(this.specUrl)}\" publishable-key=\"${ifDefined(this.publishableKey)}\" submit-label=\"${ifDefined(this.submitLabel)}\" lang=\"${ifDefined(this.effectiveLang())}\" .initialValues=\"${this.formInitialValues()}\" @roxy-submit=\"${this.onFormSubmit}\"></roxy-endpoint-form>`;\n\t}\n\n\t/** Prefill source for the form: the last submission (Edit / sticky refetch) wins over remembered storage. */\n\tprivate formInitialValues(): Record<string, unknown> | undefined {\n\t\treturn (\n\t\t\tthis.lastValues ?? (this.remember ? this.readRemembered() : undefined)\n\t\t);\n\t}\n\n\t/**\n\t * Site-owner language for this element: the `lang` attribute, the nearest ancestor carrying one, or the document. Protected so a component that composes another can forward it (a child inside this shadow root cannot reach the host page on its own).\n\t *\n\t * Full tag, region included. The truncation to what `?lang=` accepts happens where the request is built, in `<roxy-endpoint-form>`.\n\t */\n\tprotected effectiveLang(): string | undefined {\n\t\treturn resolveLang(this);\n\t}\n\n\tprivate onFormSubmit = (e: Event) => {\n\t\tconst detail = (e as CustomEvent).detail as {\n\t\t\tvalues: Record<string, unknown>;\n\t\t\tqueryKeys?: string[];\n\t\t\tsticky?: boolean;\n\t\t};\n\t\tthis.lastValues = detail.values;\n\t\tthis.sticky = !!detail.sticky;\n\t\tthis.selfFetched = true;\n\t\tthis.editing = false;\n\t\tif (this.remember) this.writeRemembered(detail.values);\n\t\tvoid this.fetcher.run(\n\t\t\tbuildRequest(\n\t\t\t\tthis.endpoint,\n\t\t\t\tthis.method,\n\t\t\t\tdetail.values,\n\t\t\t\tdetail.queryKeys ?? [],\n\t\t\t),\n\t\t);\n\t};\n\n\t/** sessionStorage key for this component's remembered form values, scoped by endpoint. */\n\tprivate rememberKey(): string {\n\t\treturn `roxy-ui:form:${this.endpoint}`;\n\t}\n\n\tprivate readRemembered(): Record<string, unknown> | undefined {\n\t\ttry {\n\t\t\tconst raw = sessionStorage.getItem(this.rememberKey());\n\t\t\treturn raw ? (JSON.parse(raw) as Record<string, unknown>) : undefined;\n\t\t} catch {\n\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tprivate writeRemembered(values: Record<string, unknown>): void {\n\t\ttry {\n\t\t\tsessionStorage.setItem(this.rememberKey(), JSON.stringify(values));\n\t\t} catch {\n\t\t\t// Private mode / disabled storage: remembering is best-effort, never fatal.\n\t\t}\n\t}\n\n\t/** Terminal empty state. Subclasses override for a domain-specific message. */\n\tprotected renderEmpty(): unknown {\n\t\treturn html`<div class=\"roxy-empty\" role=\"status\">${this.t('No data')}</div>`;\n\t}\n\n\t/** Loading placeholder shown during a self-fetch. */\n\tprotected renderLoading(): unknown {\n\t\treturn html`<div class=\"roxy-skeleton\" style=\"height:8rem\" role=\"status\" aria-label=\"${this.t('Loading')}\" part=\"loading\"></div>`;\n\t}\n\n\t/** Error state shown when a self-fetch fails. Keeps the form in view so the request can be retried. */\n\tprotected renderError(message: string): unknown {\n\t\tconst banner = html`<div class=\"roxy-error\" role=\"alert\" part=\"error\">${message}</div>`;\n\t\treturn this.endpoint ? html`${banner}${this.renderForm()}` : banner;\n\t}\n}\n", "/**\n * Where a component's language comes from, and what is safe to send to the API.\n *\n * @remarks\n * Two different answers, and conflating them is the whole reason this file is separate from the catalogue:\n *\n * - {@link resolveLang} answers \"what language is this PAGE in\", and keeps the full tag, because `es-AR` is a legitimate thing for a catalogue to want to differ on.\n * - {@link apiLang} answers \"what may go on the query string\", which is a narrower question with a hard edge: `?lang=es-AR` is a 400, `?lang=es` is a 200.\n *\n * The full tag is not a nicety the catalogue happens to tolerate: `utils/format.ts` hands it to `Intl`, which reads the region and writes `15 de ene de 1990` for `es-AR` where it writes `15 ene 1990` for `es`. Passing the API answer to a formatter demotes every regional visitor to the base language and nothing fails, so the two values are never interchangeable.\n */\n\nimport { API_LANGUAGES } from '../generated/api-languages.js';\n\n/**\n * The site-owner language for an element, resolved through the four-link chain the revamp design specifies.\n *\n * @remarks\n * 1. the element's own `lang` attribute (the explicit per-embed override),\n * 2. the nearest ancestor carrying `lang`, so one wrapper localizes a whole section,\n * 3. `document.documentElement.lang`, which is what makes this work on a real CMS with no markup change at all: WordPress emits `<html lang=\"es-AR\">` on every page of a Spanish site,\n * 4. nothing, which the callers read as English.\n *\n * Only link 1 used to be implemented, so a component on a fully Spanish page rendered English chrome and there was no way to fix it except hand-editing every embed.\n *\n * `navigator.language` is deliberately NOT in the chain. It is the VISITOR's preference, not the site's: it fragments the API cache across every locale a visitor might carry and silently serves two people different content from the same URL.\n *\n * Link 2 uses `closest`, which stops at a shadow boundary. A component composed INSIDE another component's shadow root therefore cannot see the host page, which is why every composing component forwards `lang` to its children explicitly.\n */\nexport function resolveLang(el: HTMLElement): string | undefined {\n\t// Native accessor, never a Lit @property: declaring one would shadow\n\t// HTMLElement.lang and break the platform attribute for every consumer.\n\tif (el.lang) return el.lang;\n\tif (typeof document === 'undefined') return undefined;\n\tconst inherited = el.closest?.('[lang]')?.getAttribute('lang');\n\tif (inherited) return inherited;\n\treturn document.documentElement.lang || undefined;\n}\n\n/**\n * The value safe to put on `?lang=`, or `undefined` to leave the request on the API default.\n *\n * @remarks\n * Two narrowings, both of which are load-bearing the moment {@link resolveLang} starts reading `<html lang>`:\n *\n * - **The region is dropped.** A regional tag is a 400, so a Spanish WordPress site would go from English-but-working to broken the day the language chain was completed. `es-AR`, `es-419` and `ES` all send `es`.\n * - **An unsupported language is omitted, not sent.** The chain now surfaces whatever the host page carries, including languages the API does not translate, and an unlisted tag is the same 400. Omitting it degrades to English, which is the behaviour those pages already had.\n */\nexport function apiLang(el: HTMLElement): string | undefined {\n\tconst tag = resolveLang(el);\n\tif (!tag) return undefined;\n\tconst base = tag.toLowerCase().split('-')[0] as string;\n\treturn API_LANGUAGES.includes(base) ? base : undefined;\n}\n", "/**\n * The chrome-string catalogue: one resolver reading one registry, so a translation can arrive from anywhere without a component changing.\n *\n * @remarks\n * **The key IS the canonical English string**, folded through {@link lookupKey}. There is no invented key vocabulary to keep in sync with the copy, which is the same rule the glyph tables in `tokens/index.ts` follow (they key off the exact value the API returns). Two consequences that are the whole point:\n *\n * - **English costs zero bytes.** A miss returns the source string, so the English build ships no catalogue at all, and a site that never loads a locale payload is byte-identical to one built before this file existed.\n * - **A missing translation degrades to English, never to a key.** The failure mode of a keyed catalogue is a raw `natal.tabs.wheel` rendered at a customer; here the worst case is the English word.\n *\n * **The registry lives on `globalThis`, not in module scope, because it has to.** Every `dist/cdn/components/*.js` is a self-contained IIFE with its own copy of this module, so a `Map` here would be invisible to the second component on the page. One global object, written by the locale payload and read by every bundle, is what makes `dist/cdn/locales/es.js` a single download that translates all of them.\n *\n * Load order is not guaranteed on a real host (WordPress enqueues scripts in an order the plugin does not fully control, and a payload may be deferred), so {@link onLocaleChange} lets an element that has already rendered in English re-render when its catalogue lands.\n */\n\nimport { lookupKey } from '../utils/string.js';\n\n/** Shared mutable state, addressed by a name rather than a module binding so every bundle on the page reaches the same object. */\ninterface LocaleRegistry {\n\t/** Language tag (lower case) to catalogue, keyed by {@link lookupKey} of the English source string. */\n\tcatalogs: Record<string, Record<string, string>>;\n\t/** Elements waiting to re-render when a catalogue arrives. */\n\tlisteners: Set<() => void>;\n}\n\nconst GLOBAL_KEY = '__ROXY_UI_I18N__';\n\nfunction registry(): LocaleRegistry {\n\tconst holder = globalThis as unknown as Record<string, LocaleRegistry>;\n\tconst existing = holder[GLOBAL_KEY];\n\tif (existing) return existing;\n\tconst created: LocaleRegistry = { catalogs: {}, listeners: new Set() };\n\tholder[GLOBAL_KEY] = created;\n\treturn created;\n}\n\n/**\n * Publish a catalogue for a language tag and wake every mounted element.\n *\n * @remarks\n * The catalogue is authored keyed by the English source string, exactly as it appears at the call site, and normalized here. That keeps the source file readable and diffable against the component that renders it, while the runtime lookup stays a single property read.\n *\n * This is the ONLY way into the registry, so a catalogue can later come from a static file, a server response, or a host page inlining a script tag, without a component knowing the difference.\n */\nexport function registerLocale(\n\tlang: string,\n\tcatalog: Record<string, string>,\n): void {\n\tconst reg = registry();\n\tconst normalized: Record<string, string> = {};\n\tfor (const [source, translated] of Object.entries(catalog)) {\n\t\tnormalized[lookupKey(source)] = translated;\n\t}\n\treg.catalogs[lang.toLowerCase()] = normalized;\n\tfor (const listener of reg.listeners) listener();\n}\n\n/**\n * Replace `{{name}}` placeholders. Copied from the API-side translator so both sides of the product interpolate identically; an unknown placeholder is left verbatim rather than blanked, so a typo in a catalogue is visible instead of silently eating the value.\n */\nexport function interpolate(\n\ttemplate: string,\n\tvars?: Record<string, string | number>,\n): string {\n\tif (!vars) return template;\n\treturn template.replace(/\\{\\{(\\w+)\\}\\}/g, (match, key: string) =>\n\t\tkey in vars ? String(vars[key] ?? '') : match,\n\t);\n}\n\n/**\n * The chrome string for `lang`, falling back to the English `source` it is keyed by.\n *\n * @remarks\n * A regional tag resolves against its base language, so `es-AR` and `es-419` both read the `es` catalogue and a site does not have to know which tags we happen to ship. An exact regional catalogue still wins if one is ever registered.\n */\nexport function translate(\n\tlang: string | undefined,\n\tsource: string,\n\tvars?: Record<string, string | number>,\n): string {\n\tif (!lang) return interpolate(source, vars);\n\tconst { catalogs } = registry();\n\tconst tag = lang.toLowerCase();\n\tconst catalog = catalogs[tag] ?? catalogs[tag.split('-')[0] as string];\n\treturn interpolate(catalog?.[lookupKey(source)] ?? source, vars);\n}\n\n/** Subscribe to catalogue arrivals. Returns the unsubscribe, so an element can drop it on disconnect. */\nexport function onLocaleChange(listener: () => void): () => void {\n\tconst { listeners } = registry();\n\tlisteners.add(listener);\n\treturn () => {\n\t\tlisteners.delete(listener);\n\t};\n}\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\nimport { onLocaleChange } from './registry.js';\n\n/**\n * Re-renders its host when a chrome-string catalogue arrives.\n *\n * @remarks\n * Without this the catalogue would have to be on the page BEFORE the elements upgrade, which is not something a component can require of a real host. WordPress orders enqueued scripts by dependency and a site owner can add `defer` to any of them; a CDN embed is two independent `<script src>` tags. Any of those can land the locale payload after the first paint, and the visible result would be a chart that renders in English on a Spanish page for no reason the site owner can see or fix.\n *\n * Mirrors `MarkupDataController`: constructed in {@link RoxyDataElement}'s constructor, subscribes on connect, drops the subscription on disconnect. Registration is idempotent and a re-register of the same language simply re-renders, so a payload loaded twice is harmless.\n */\nexport class LocaleController implements ReactiveController {\n\tprivate readonly host: ReactiveControllerHost;\n\tprivate unsubscribe?: () => void;\n\n\tconstructor(host: ReactiveControllerHost) {\n\t\tthis.host = host;\n\t\thost.addController(this);\n\t}\n\n\thostConnected(): void {\n\t\tthis.unsubscribe = onLocaleChange(() => this.host.requestUpdate());\n\t}\n\n\thostDisconnected(): void {\n\t\tthis.unsubscribe?.();\n\t\tthis.unsubscribe = undefined;\n\t}\n}\n", "import { css } from 'lit';\n\n/**\n * Shared host styles every component pulls in. Sets default font, color,\n * container query support, and the entry fade-in.\n */\nexport const baseStyles = css`:host{font-family:var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-base,1rem);line-height:var(--roxy-leading-normal,1.5);animation:roxy-fade-in var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,cubic-bezier(.4, 0, .2, 1)) both;background:0 0;display:block;container-type:inline-size}:host([bare]){--roxy-surface:transparent;--roxy-shadow-sm:none;--roxy-shadow-md:none}*,:before,:after{box-sizing:border-box}h1,h2,h3,h4{font-family:var(--roxy-font-display,var(--roxy-font-sans,system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif))}@keyframes roxy-fade-in{0%{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}@media (prefers-reduced-motion:reduce){:host{animation:none}}.roxy-skeleton{background:linear-gradient(90deg, var(--roxy-border,#e4e4e7) 0%, color-mix(in srgb, var(--roxy-border,#e4e4e7) 60%, transparent) 50%, var(--roxy-border,#e4e4e7) 100%);border-radius:var(--roxy-radius-md,8px);background-size:200% 100%;animation:1.4s ease-in-out infinite roxy-shimmer}@keyframes roxy-shimmer{0%{background-position:200% 0}to{background-position:-200% 0}}@media (prefers-reduced-motion:reduce){.roxy-skeleton{animation:none}}.roxy-sr-only{clip-path:inset(50%);white-space:nowrap;border:0;width:1px;height:1px;margin:0;padding:0;position:absolute;overflow:hidden}.roxy-empty{padding:var(--roxy-space-lg,1.5rem);color:var(--roxy-muted,#71717a);text-align:center;font-size:var(--roxy-text-sm,.875rem)}.roxy-error{gap:var(--roxy-space-sm,.5rem);padding:var(--roxy-space-lg,1.5rem);background:var(--roxy-surface,#fff);border:1px solid var(--roxy-danger,#dc2626);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-danger-fg,#991b1b);font-size:var(--roxy-text-sm,.875rem);justify-items:start;display:grid}.roxy-surface{background:var(--roxy-surface,#fff);color:var(--roxy-fg,#0a0a0a)}:host(:focus-within) .roxy-card{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-attribution{margin-top:var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-xs,.75rem);color:var(--roxy-muted,#71717a);text-align:right}.roxy-attribution a{color:inherit;text-decoration:none}.roxy-attribution a:hover{color:var(--roxy-accent-ink,#b45309);text-decoration:underline}.roxy-attribution a:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}.roxy-edit-bar{margin-bottom:var(--roxy-space-sm,.5rem);justify-content:flex-end;display:flex}.roxy-edit{padding:var(--roxy-space-xs,.25rem) var(--roxy-space-md,1rem);border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);color:var(--roxy-fg,#0a0a0a);font-family:inherit;font-size:var(--roxy-text-sm,.875rem);cursor:pointer;background:0 0}.roxy-edit:hover{border-color:var(--roxy-accent,#f59e0b);color:var(--roxy-accent-ink,#b45309)}.roxy-edit:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px}:host{font-variant-emoji:text}`;\n", "/**\n * The one place the \"publishable key only\" rule lives. Every client-side fetch boundary ({@link ../components/location-search.ts}, {@link ./fetch-controller.ts}) calls through here so a secret or legacy unprefixed key is refused identically: no network call, the same visible message, the same `roxy-validation-error` event. Centralising it is what stops the two paths drifting, which is exactly how `<roxy-location-search>` used to warn-then-fetch a secret key while the controller fail-closed.\n */\n\n/** Canonical refusal message. Both fetch boundaries surface this exact wording. */\nexport const KEY_REFUSED_MESSAGE =\n\t'Client-side components accept a pk_ publishable key only. Use a publishable key with an origin allowlist, or render server-side.';\n\n/** True when the key is a browser-safe `pk_` publishable key. */\nexport function isPublishableKey(key: string | undefined | null): boolean {\n\treturn !!key && key.startsWith('pk_');\n}\n\n/**\n * The fail-closed condition: a key is PRESENT and is NOT a `pk_` key. An absent key is not refused, so a keyless public call (a form-slotted city search with no key set) still proceeds; only a real secret/legacy token in the browser is stopped.\n */\nexport function keyIsRefused(key: string | undefined | null): boolean {\n\treturn !!key && !key.startsWith('pk_');\n}\n\n/**\n * Announce a refused key: dispatch the shared `roxy-validation-error` (bubbling, composed) and, when `warn` is set, log it once for the developer. The caller sets its own visible error state and skips the fetch; this only handles the parts both boundaries share.\n */\nexport function dispatchKeyRefusal(\n\thost: EventTarget,\n\topts: { warn?: boolean } = {},\n): void {\n\tif (opts.warn) console.warn(KEY_REFUSED_MESSAGE);\n\thost.dispatchEvent(\n\t\tnew CustomEvent('roxy-validation-error', {\n\t\t\tdetail: { reason: 'possible-secret-key', message: KEY_REFUSED_MESSAGE },\n\t\t\tbubbles: true,\n\t\t\tcomposed: true,\n\t\t}),\n\t);\n}\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\nimport {\n\tdispatchKeyRefusal,\n\tKEY_REFUSED_MESSAGE,\n\tkeyIsRefused,\n} from './key-guard.js';\n\n/**\n * Host slots the controller drives. {@link RoxyDataElement} satisfies this, so the form mixin can attach a controller without the component wiring state by hand.\n *\n * @remarks\n * Intersected with `HTMLElement` because the controller dispatches events on the host. Lit's `ReactiveControllerHost` is the update-lifecycle contract only (`addController`, `requestUpdate`, `updateComplete`) and carries no DOM surface, even though every real host is a `LitElement` and therefore an `HTMLElement`. Declaring the DOM half is what the controller actually needs; it used to reach it through a `this.host as unknown as EventTarget` double cast instead, which asserted a capability the type never promised.\n */\ntype FetchHost<T> = ReactiveControllerHost &\n\tHTMLElement & {\n\t\tdata: T | null;\n\t\tloading: boolean;\n\t\terror: string | null;\n\t};\n\n/** Default RoxyAPI v2 origin. A component overrides it per instance via its `base-url` attribute. */\nconst DEFAULT_BASE_URL = 'https://roxyapi.com/api/v2';\n\n/** A single request the controller issues on the component's behalf. */\nexport interface RoxyRequest {\n\t/** Path under the API base, e.g. \"/dreams/symbols/water\" or \"/astrology/natal-chart\". */\n\tpath: string;\n\tmethod?: 'GET' | 'POST';\n\t/** JSON body for POST endpoints. */\n\tbody?: unknown;\n\t/** Query string parameters; nullish values are dropped. */\n\tquery?: Record<string, string | number | undefined>;\n}\n\n/**\n * Client-side fetch for uncontrolled (self-fetching) components: drives `host.data` / `host.loading` / `host.error` and cancels a stale request when a newer one starts or the host disconnects.\n *\n * @remarks\n * Security boundary. The only credential this ever sends is a `pk_` publishable key, which carries a server-side origin allowlist. A secret (`sk_`) or legacy unprefixed key is refused before any network call and surfaced as an error, so a server secret cannot leak into a browser request. This centralizes the guard that originated in `<roxy-location-search>` so every self-fetching component enforces it identically.\n *\n * Controlled-mode components never construct this. When a server injects the response as a `<script class=\"roxy-data\">` island, there is no key and no fetch, which is the path server-rendered consumers (WordPress, JSX SSR, static HTML) rely on.\n */\nexport class FetchController<T = unknown> implements ReactiveController {\n\tprivate readonly host: FetchHost<T>;\n\tprivate abort?: AbortController;\n\n\t/** Browser-safe publishable key. Set by the host from its `publishable-key` attribute. */\n\tpublishableKey?: string;\n\t/** API origin, overridable for self-hosted or proxied deployments. */\n\tbaseUrl = DEFAULT_BASE_URL;\n\t/**\n\t * Consumer backend route that holds the secret key. When set, the request is POSTed here as `{ path, method, body, query }` instead of called against RoxyAPI directly, so no key (publishable or secret) is sent from the browser. This is the canonical path for server-rendered hosts (WordPress); the backend proxies the request with its own `sk_` key and returns the JSON response.\n\t */\n\tsubmitUrl?: string;\n\n\tconstructor(host: FetchHost<T>) {\n\t\tthis.host = host;\n\t\thost.addController(this);\n\t}\n\n\thostDisconnected() {\n\t\tthis.abort?.abort();\n\t\tthis.abort = undefined;\n\t}\n\n\t/**\n\t * Issue the request and resolve once `host.data` (success) or `host.error`\n\t * (failure) is set. A no-op return when a non-publishable key is present:\n\t * the error is already surfaced and nothing is sent.\n\t */\n\tasync run(req: RoxyRequest): Promise<void> {\n\t\t// submit-url proxy: no key leaves the browser; the consumer's backend holds it.\n\t\tif (!this.submitUrl && this.secretKeyRefused()) return;\n\t\tthis.abort?.abort();\n\t\tconst controller = new AbortController();\n\t\tthis.abort = controller;\n\t\tthis.host.loading = true;\n\t\tthis.host.error = null;\n\t\ttry {\n\t\t\tconst res = this.submitUrl\n\t\t\t\t? await fetch(this.submitUrl, {\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\theaders: {\n\t\t\t\t\t\t\tAccept: 'application/json',\n\t\t\t\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbody: JSON.stringify(req),\n\t\t\t\t\t\tsignal: controller.signal,\n\t\t\t\t\t})\n\t\t\t\t: await this.callApi(req, controller.signal);\n\t\t\tif (!res.ok) throw new Error(await this.readError(res));\n\t\t\tconst json = (await res.json()) as T;\n\t\t\tif (controller.signal.aborted) return;\n\t\t\tthis.host.data = json;\n\t\t} catch (err) {\n\t\t\tif ((err as { name?: string })?.name === 'AbortError') return;\n\t\t\tthis.host.error = err instanceof Error ? err.message : String(err);\n\t\t} finally {\n\t\t\tif (this.abort === controller) this.abort = undefined;\n\t\t\tif (!controller.signal.aborted) this.host.loading = false;\n\t\t}\n\t}\n\n\t/** Direct call against RoxyAPI with the publishable key (the no-backend path). */\n\tprivate callApi(req: RoxyRequest, signal: AbortSignal): Promise<Response> {\n\t\tconst url = new URL(`${this.baseUrl}${req.path}`);\n\t\tfor (const [k, v] of Object.entries(req.query ?? {})) {\n\t\t\tif (v != null) url.searchParams.set(k, String(v));\n\t\t}\n\t\tconst headers: Record<string, string> = { Accept: 'application/json' };\n\t\tif (this.publishableKey) headers['X-API-Key'] = this.publishableKey;\n\t\tif (req.body != null) headers['Content-Type'] = 'application/json';\n\t\treturn fetch(url, {\n\t\t\tmethod: req.method ?? 'GET',\n\t\t\theaders,\n\t\t\tbody: req.body != null ? JSON.stringify(req.body) : undefined,\n\t\t\tsignal,\n\t\t});\n\t}\n\n\t/** True when a key is set and it is not a browser-safe `pk_` publishable key. Surfaces the error and refuses to send, via the shared {@link keyIsRefused} guard so every fetch boundary fail-closes identically. */\n\tprivate secretKeyRefused(): boolean {\n\t\tif (!keyIsRefused(this.publishableKey)) return false;\n\t\tthis.host.error = KEY_REFUSED_MESSAGE;\n\t\tdispatchKeyRefusal(this.host);\n\t\treturn true;\n\t}\n\n\t/** Surface the `{ error, code }` message the API returns on failure, falling back to the status code. */\n\tprivate async readError(res: Response): Promise<string> {\n\t\ttry {\n\t\t\tconst body = (await res.json()) as { error?: string };\n\t\t\tif (body?.error) return body.error;\n\t\t} catch {\n\t\t\t// Non-JSON error body: fall through to the status line.\n\t\t}\n\t\treturn `Request failed (${res.status})`;\n\t}\n}\n\n/**\n * Translate flat form values into a {@link RoxyRequest} for an endpoint. The `{name}` segments in the endpoint template are substituted from the values and removed; the rest become the JSON body for POST or query parameters for GET. This is the spec-light request builder the base element uses to turn a `<roxy-endpoint-form>` submission into a self-fetch, so a component needs no per-endpoint glue.\n *\n * @param queryKeys - Names the spec declares as `in: query` for this operation, which `<roxy-endpoint-form>` reports on its `roxy-submit` event. A POST operation can still take query parameters (every localized endpoint takes `?lang=`), and sending one in the JSON body silently drops it, so those names are routed to the query string on POST as well as GET.\n */\nexport function buildRequest(\n\tendpoint: string,\n\tmethod: 'GET' | 'POST',\n\tvalues: Record<string, unknown>,\n\tqueryKeys: readonly string[] = [],\n): RoxyRequest {\n\tconst rest: Record<string, unknown> = { ...values };\n\tconst path = `/${endpoint.replace(/^\\//, '')}`.replace(\n\t\t/\\{([^}]+)\\}/g,\n\t\t(_match, name: string) => {\n\t\t\tconst v = rest[name];\n\t\t\tdelete rest[name];\n\t\t\treturn encodeURIComponent(String(v ?? ''));\n\t\t},\n\t);\n\tconst inQuery = new Set(queryKeys);\n\tconst query: Record<string, string | number | undefined> = {};\n\tconst body: Record<string, unknown> = {};\n\tfor (const [k, v] of Object.entries(rest)) {\n\t\tif (v === undefined || v === '') continue;\n\t\tif (method === 'GET' || inQuery.has(k)) query[k] = v as string | number;\n\t\telse body[k] = v;\n\t}\n\treturn { path, method, query, body: method === 'POST' ? body : undefined };\n}\n", "/**\n * The interpretation accordion: the one way this library shows a label, a short value, and a body of prose behind a disclosure.\n *\n * @remarks\n * Exclusive by construction (`<details name>`), so a card grows by at most one open section and never becomes a wall of text. Callers pass their own group `name` so two accordions on one page do not fight over which section is open.\n *\n * This lives here rather than in a component because the same accordion is the right shape wherever an endpoint returns a labelled reading: the Human Design bodygraph and type card use it for strategy, authority, and aura; `roxy-hexagram` uses it for the changing lines. The CSS was copy-pasted into six components before 2026-07 and had already drifted (`.interp-body` had five distinct definitions), which is the drift this exists to stop. Migrate the remaining copies to it when they are next touched.\n *\n * **Call it through `RoxyDataElement.renderInterpretation`, never directly.** That method is where `hide-readings` is honoured, so a direct call renders prose a host asked to be left out. The section it emits carries `part=\"section readings\"` and each row `part=\"reading\"`, which is what makes the readings of EVERY component addressable under one name from outside the shadow root.\n */\n\nimport { css, html, nothing } from 'lit';\nimport { chevron } from './disclosure.js';\n\n/** One row: the label, the short value shown as the aside, and the interpretation body. `extra` renders under the body for a section that carries more than prose. */\nexport interface InterpSection {\n\tlabel: string;\n\taside?: string;\n\tbody: string;\n\textra?: unknown;\n}\n\nexport const interpAccordionStyles = css`.block{border-top:1px solid var(--roxy-border,#e4e4e7);padding-top:var(--roxy-space-md,1rem)}.block h3{margin:0 0 var(--roxy-space-sm,.5rem);font-size:var(--roxy-text-sm,.875rem);font-weight:var(--roxy-weight-bold,600);color:var(--roxy-muted,#71717a);text-transform:uppercase;letter-spacing:.06em}.interp-card{border:1px solid var(--roxy-border,#e4e4e7);border-radius:var(--roxy-radius-md,8px);padding:var(--roxy-space-sm,.5rem) var(--roxy-space-md,1rem);margin-bottom:var(--roxy-space-xs,.25rem)}.interp-card summary{cursor:pointer;color:var(--roxy-fg,#0a0a0a);align-items:center;gap:var(--roxy-space-sm,.5rem);font-weight:500;font-size:var(--roxy-text-sm,.875rem);display:flex}.interp-card summary:focus-visible{outline:2px solid var(--roxy-ring,#f59e0b66);outline-offset:2px;border-radius:var(--roxy-radius-sm,4px)}.interp-lead{flex-wrap:wrap;flex:auto;order:1;align-items:baseline;gap:.4rem;min-width:0;display:inline-flex}.interp-aside{flex-shrink:0;order:2;align-items:center;gap:.5rem;display:inline-flex}.roxy-chevron{order:3}.interp-aside small{color:var(--roxy-muted,#71717a);white-space:nowrap;font-weight:400}@container (width<=26rem){.interp-card summary{flex-wrap:wrap}.roxy-chevron{order:2}.interp-aside{flex-basis:100%;order:3;justify-content:flex-end}}.interp-body{margin-top:var(--roxy-space-sm,.5rem);gap:var(--roxy-space-sm,.5rem);color:var(--roxy-fg,#0a0a0a);font-size:var(--roxy-text-sm,.875rem);overflow-wrap:anywhere;line-height:1.6;display:grid}.interp-body p{margin:0}`;\n\n/**\n * Render the accordion. Sections with no body are dropped, so a caller can pass the full set and let a narrower response render only what it carries. `name` groups the `<details>` exclusively, so opening one closes the last.\n */\nexport function renderInterpAccordion(\n\tsections: InterpSection[],\n\tname: string,\n\theading = 'Reading',\n) {\n\tconst shown = sections.filter((s) => Boolean(s.body));\n\tif (shown.length === 0) return nothing;\n\n\treturn html`<section class=\"block\" part=\"section readings\"><h3>${heading}</h3>${shown.map(\n\t\t\t(\n\t\t\t\ts,\n\t\t\t\ti,\n\t\t\t) => html`<details class=\"interp-card\" part=\"reading\" name=\"${name}\" ?open=\"${i === 0}\"><summary><span class=\"interp-lead\">${s.label}</span> ${chevron()} ${s.aside ? html`<span class=\"interp-aside\"><small>${s.aside}</small></span>` : nothing}</summary><div class=\"interp-body\"><p>${s.body}</p>${s.extra ?? nothing}</div></details>`,\n\t\t)}</section>`;\n}\n", "import type { TemplateResult } from 'lit';\nimport { css, html } from 'lit';\n\n/**\n * Disclosure chevron for `<details>`/`<summary>` accordions. Replaces the\n * browser default triangle with a thin chevron that rotates when the host\n * `<details>` opens. Render it inside the `<summary>` and pair with\n * {@link disclosureStyles}.\n */\nexport function chevron(): TemplateResult {\n\treturn html`<svg class=\"roxy-chevron\" viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" aria-hidden=\"true\"><path d=\"M4 6l4 4 4-4\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>`;\n}\n\n/**\n * Shared `<details>` accordion styling: hides the native disclosure triangle\n * and rotates the {@link chevron} 180 degrees when the accordion is open.\n * Import into any component that renders disclosure accordions so the chevron\n * looks and behaves identically.\n */\nexport const disclosureStyles = css`summary{list-style:none}summary::-webkit-details-marker{display:none}.roxy-chevron{aspect-ratio:auto;width:14px;height:14px;color:var(--roxy-muted,#71717a);transition:transform var(--roxy-motion-duration,.2s) var(--roxy-motion-easing,ease);flex-shrink:0}details[open]>summary .roxy-chevron{transform:rotate(180deg)}@media (prefers-reduced-motion:reduce){.roxy-chevron{transition:none}}`;\n", "import type { ReactiveController, ReactiveControllerHost } from 'lit';\n\n/**\n * Marker class on the inline JSON script a server emits inside a component.\n *\n * @example\n * ```html\n * <roxy-natal-chart>\n * <script type=\"application/json\" class=\"roxy-data\">{ ...response... }</script>\n * </roxy-natal-chart>\n * ```\n */\nconst ROXY_DATA_CLASS = 'roxy-data';\n\n/**\n * Serialize a RoxyAPI response for embedding inside an inline `<script type=\"application/json\" class=\"roxy-data\">`. This is the safe writer counterpart to {@link MarkupDataController}, the reader: server-rendered and cached consumers (WordPress, JSX SSR, static HTML) emit the script with this, and the component hydrates `data` from it on connect.\n *\n * @remarks\n * Use this instead of a bare `JSON.stringify`. A raw stringify of a response that contains the literal text `</script>` (common in long interpretation prose) closes the script element early, corrupting the page and creating an HTML-injection vector. This escapes the script-unsafe characters to their `\\uXXXX` JSON escapes, which `JSON.parse` restores to the original characters, so the value the component receives is identical to the response you passed.\n *\n * `<` is the load-bearing escape (it defeats `</script>` and `<!--`). `>` and `&` are escaped for defence in depth, and U+2028 / U+2029 because they are valid in JSON yet are line terminators in a `<script>` context and break some parsers. The escapes introduce only `\\uXXXX` sequences, so the replacements never feed each other and order is irrelevant.\n *\n * Pass the unwrapped RoxyAPI response, the same shape you would assign to `element.data`. Do not pass the SDK envelope (`{ data, error, request, response }`).\n *\n * @example\n * ```ts\n * import { serializeRoxyData } from '@roxyapi/ui';\n *\n * const { data } = await roxy.dreams.getDreamSymbol({ path: { id: 'water' } });\n * const html = `<roxy-dream-card><script type=\"application/json\" class=\"roxy-data\">${serializeRoxyData(data)}</script></roxy-dream-card>`;\n * ```\n */\nexport function serializeRoxyData(data: unknown): string {\n\treturn JSON.stringify(data)\n\t\t.replace(/</g, '\\\\u003c')\n\t\t.replace(/>/g, '\\\\u003e')\n\t\t.replace(/&/g, '\\\\u0026')\n\t\t.replace(/\\u2028/g, '\\\\u2028')\n\t\t.replace(/\\u2029/g, '\\\\u2029');\n}\n\n/**\n * Build the complete `<script type=\"application/json\" class=\"roxy-data\">\u2026</script>` element a server nests inside a `roxy-*` component for the no-JavaScript hydration path. The payload is escaped via {@link serializeRoxyData}, so it is safe to drop straight into HTML output.\n *\n * @remarks\n * The element carries both `type=\"application/json\"` and `class=\"roxy-data\"` because {@link MarkupDataController} reads only a direct-child script that has both. Emit one of these inside the target component; the JavaScript `data` property still wins if it is later assigned.\n *\n * @example\n * ```ts\n * import { roxyDataScript } from '@roxyapi/ui';\n *\n * const { data } = await roxy.crystals.getCrystal({ path: { id: 'amethyst' } });\n * const html = `<roxy-crystal-grid>${roxyDataScript(data)}</roxy-crystal-grid>`;\n * ```\n */\nexport function roxyDataScript(data: unknown): string {\n\treturn `<script type=\"application/json\" class=\"${ROXY_DATA_CLASS}\">${serializeRoxyData(data)}</script>`;\n}\n\n/**\n * True when the element is a `<script type=\"application/json\">`. Uses tag name and attribute rather than `instanceof HTMLScriptElement` so the check holds in every DOM implementation, including server-rendered and hydration runtimes where the constructor global may be absent.\n */\nfunction isJsonScript(el: Element): boolean {\n\treturn (\n\t\tel.nodeName === 'SCRIPT' && el.getAttribute('type') === 'application/json'\n\t);\n}\n\n/**\n * Host shape the controller drives: any reactive element that exposes a public `data` slot. The controller only writes `data` when the host left it unset, so the JavaScript property path always wins.\n */\ninterface DataHost extends ReactiveControllerHost, HTMLElement {\n\tdata?: unknown;\n}\n\n/**\n * Reactive controller that lets a component hydrate its `data` from embedded markup when no `data` property was assigned in JavaScript.\n *\n * @remarks\n * The server-side and cached-render model: a backend renders the RoxyAPI response into a direct-child `<script type=\"application/json\" class=\"roxy-data\">` element, ships static HTML, and never runs per-element JavaScript to assign a property. On connect this controller reads that script, parses it, and feeds the result to the host. The JavaScript property path is untouched and authoritative: if `host.data` already holds a value when the host connects, the controller does nothing and the markup is ignored.\n *\n * Source resolution order on connect, first hit wins:\n *\n * 1. `host.data` already set in JavaScript -> leave it, read nothing.\n * 2. A direct-child `<script type=\"application/json\" class=\"roxy-data\">` -> parse and use. Direct-child only, so a nested component's own script is never read by an ancestor.\n *\n * Fetching from a URL is intentionally unsupported: that would require a browser-visible key and breaks the server-rendered, cached model these consumers rely on.\n *\n * Timing: {@link hostConnected} runs inside the host `connectedCallback`. For an element parsed from server HTML, its direct children are present by the time the custom element upgrades and connects, so the script is readable here. For an element created with `document.createElement` and connected before any child is appended, there is nothing to read and the property path is the only source, which is exactly the existing behavior.\n *\n * Failure is safe: malformed JSON or a missing script leaves `host.data` untouched, so the host renders its normal empty state.\n *\n * Reading the script never mutates it, and only the marked script is touched, so any sibling fallback markup a server nested inside the element (for no-JavaScript, AMP, or crawler rendering) is left in place.\n *\n * @example\n * ```ts\n * import { MarkupDataController } from '../utils/markup-data.js';\n *\n * export class RoxyExample extends LitElement {\n * constructor() {\n * super();\n * new MarkupDataController(this);\n * }\n *\n * @property({ attribute: false })\n * data: ExampleResponse | null = null;\n * }\n * ```\n */\nexport class MarkupDataController<T = unknown> implements ReactiveController {\n\tprivate readonly host: DataHost;\n\n\tconstructor(host: DataHost) {\n\t\tthis.host = host;\n\t\thost.addController(this);\n\t}\n\n\thostConnected() {\n\t\t// Property path wins. If the consumer (React, vanilla `.data =`, the\n\t\t// widgets script, an MCP agent) already set data, never look at markup.\n\t\tif (this.host.data != null) return;\n\n\t\tconst parsed = this.read();\n\t\tif (parsed === undefined) return;\n\n\t\tthis.host.data = parsed as T;\n\t\tthis.host.requestUpdate();\n\t}\n\n\t/**\n\t * Resolve the embedded payload. Returns `undefined` when there is nothing valid to read so the caller can leave `host.data` untouched.\n\t */\n\tprivate read(): T | undefined {\n\t\tconst inline = this.findInlineScript();\n\t\treturn inline ? this.parse(inline.textContent) : undefined;\n\t}\n\n\t/**\n\t * Direct-child `<script type=\"application/json\" class=\"roxy-data\">`. Scoped to immediate children so a nested data-driven component never has its script read by an ancestor, and so sibling fallback markup is ignored.\n\t */\n\tprivate findInlineScript(): Element | null {\n\t\tfor (const child of Array.from(this.host.children)) {\n\t\t\tif (isJsonScript(child) && child.classList.contains(ROXY_DATA_CLASS)) {\n\t\t\t\treturn child;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate parse(text: string | null): T | undefined {\n\t\tif (!text?.trim()) return undefined;\n\t\ttry {\n\t\t\treturn JSON.parse(text) as T;\n\t\t} catch {\n\t\t\t// Malformed embedded JSON: fail safe, leave the host empty state in\n\t\t\t// place rather than throwing during connect.\n\t\t\treturn undefined;\n\t\t}\n\t}\n}\n", "/**\n * Math helpers for converting raw ecliptic longitude decimals into the\n * sign / degree / minute / second triplet used across chart components.\n */\n\nimport { SIGNS_ORDER } from '../tokens/index.js';\n\nexport interface SignPosition {\n\tsign: string;\n\tsignIndex: number;\n\tdegree: number;\n\tminute: number;\n\tsecond: number;\n}\n\n/**\n * Wrap longitude into [0, 360) so negative or out-of-range values still\n * resolve to a real sign. Robust to wonky upstream data.\n */\nexport function normalizeLongitude(lon: number): number {\n\tconst wrapped = lon % 360;\n\treturn wrapped < 0 ? wrapped + 360 : wrapped;\n}\n\n/**\n * Convert decimal ecliptic longitude (0-360) into sign/degree/minute/second.\n * Used by every chart wheel and aspect table.\n */\nexport function longitudeToSignPosition(longitude: number): SignPosition {\n\tconst lon = normalizeLongitude(longitude);\n\tconst signIndex = Math.floor(lon / 30) % 12;\n\tconst within = lon % 30;\n\tconst degree = Math.floor(within);\n\tconst minuteFloat = (within - degree) * 60;\n\tconst minute = Math.floor(minuteFloat);\n\tconst second = Math.round((minuteFloat - minute) * 60);\n\treturn {\n\t\tsign: SIGNS_ORDER[signIndex] ?? 'Aries',\n\t\tsignIndex,\n\t\tdegree,\n\t\tminute,\n\t\tsecond,\n\t};\n}\n\n/** Compact display string like \"12\u00B0 Leo 34'\". Used in chart labels. */\nexport function formatSignPosition(longitude: number): string {\n\tconst { sign, degree, minute } = longitudeToSignPosition(longitude);\n\treturn `${degree}\u00B0 ${sign} ${String(minute).padStart(2, '0')}'`;\n}\n\n/**\n * A within-sign decimal degree (0-30) split into whole degrees and minutes, with the rounding carry already applied.\n *\n * @remarks\n * Separate from {@link formatDegreeInSign} because a printed ephemeris interleaves the sign BETWEEN the two halves (`09\u264C56`, the form every published ephemeris has used for a century) rather than putting the sign beside a finished `9\u00B056'`. Rounding 59.6 minutes up has to roll the degree with it, and that carry is the part a caller gets wrong, so it lives here once and both forms read it.\n */\nexport function splitDegreeInSign(deg: number): {\n\tdegree: number;\n\tminute: number;\n} {\n\tlet degree = Math.floor(deg);\n\tlet minute = Math.round((deg - degree) * 60);\n\tif (minute === 60) {\n\t\tminute = 0;\n\t\tdegree += 1;\n\t}\n\treturn { degree, minute };\n}\n\n/** Format a within-sign decimal degree (0-30) as degree-and-minute, e.g. 17.99 to \"17\u00B059'\". The reference-grade form astrologers read when the sign is already known (asteroids, lots, directed points, fixed stars). */\nexport function formatDegreeInSign(deg: number): string {\n\tconst { degree, minute } = splitDegreeInSign(deg);\n\treturn `${degree}\u00B0${String(minute).padStart(2, '0')}'`;\n}\n\n/**\n * The point diametrically opposite a longitude (e.g. Descendant from\n * Ascendant, IC from MC). Exact derivation, always 180 degrees away.\n */\nexport function oppositePoint(longitude: number): number {\n\treturn normalizeLongitude(longitude + 180);\n}\n\n/**\n * Midpoint of the forward arc from `start` to `end` (both ecliptic\n * longitudes). Handles the 360/0 wrap, so a house spanning 350 to 20 degrees\n * yields a midpoint of 5, not 185. Used to place house numbers between two\n * cusps regardless of how unequal the house is.\n */\nexport function arcMidpoint(start: number, end: number): number {\n\tconst s = normalizeLongitude(start);\n\tlet span = normalizeLongitude(end) - s;\n\tif (span < 0) span += 360;\n\treturn normalizeLongitude(s + span / 2);\n}\n\n/** A body placed on a wheel: where it really is, and where its glyph had to be drawn to stay legible. */\nexport interface FannedPoint<T> {\n\titem: T;\n\t/** The true ecliptic longitude. Where a leader line points, and the only value a reader should take as the position. */\n\tlongitude: number;\n\t/** Where the glyph is drawn, pushed forward only as far as it takes to clear its neighbour. Equal to {@link FannedPoint.longitude} whenever nothing was in the way. */\n\tdisplayLongitude: number;\n}\n\n/**\n * Spread a cluster of bodies apart along a wheel so every glyph stays readable,\n * without moving any of them off its real position in the data.\n *\n * @remarks\n * Conjunctions inside a few degrees are the norm, not the exception: a\n * Sun-Mercury-Venus cluster or a stack of outer planets will pile four glyphs on\n * top of each other and print their degree labels over one another. Sorting by\n * longitude and pushing each later member forward until it clears\n * `minSeparation` is the conventional fix in professional chart software, and it\n * is why {@link FannedPoint} carries BOTH longitudes: the caller draws the glyph\n * at the display value and a leader line back to the true one, so nothing about\n * the drawing claims a position the response did not give.\n *\n * `minSeparation` is an ANGLE, so it depends on the radius the caller is drawing\n * at: the same glyph needs more degrees of arc on a small ring than a large one.\n *\n * If a cluster runs past 360 degrees the whole set slides back by the overshoot,\n * which keeps the stack anchored near its real longitudes instead of wrapping\n * one member around to the far side of the wheel.\n */\nexport function fanOut<T>(\n\titems: readonly T[],\n\tlongitudeOf: (item: T) => number,\n\tminSeparation: number,\n): FannedPoint<T>[] {\n\tconst placed: FannedPoint<T>[] = items\n\t\t.filter((item) => Number.isFinite(longitudeOf(item)))\n\t\t.map((item) => {\n\t\t\tconst longitude = normalizeLongitude(longitudeOf(item));\n\t\t\treturn { item, longitude, displayLongitude: longitude };\n\t\t})\n\t\t.sort((a, b) => a.longitude - b.longitude);\n\n\tfor (let i = 1; i < placed.length; i++) {\n\t\tconst prev = placed[i - 1];\n\t\tconst cur = placed[i];\n\t\tif (!prev || !cur) continue;\n\t\tconst wanted = prev.displayLongitude + minSeparation;\n\t\tif (cur.displayLongitude < wanted) cur.displayLongitude = wanted;\n\t}\n\n\tconst last = placed[placed.length - 1];\n\tif (last && last.displayLongitude > 360) {\n\t\tconst shift = last.displayLongitude - 360;\n\t\tfor (const p of placed) p.displayLongitude -= shift;\n\t}\n\treturn placed;\n}\n\n/**\n * Degrees of arc a mark of `width` user units occupies at `radius`, which is the\n * separation {@link fanOut} needs to keep two of them from touching. One\n * expression instead of a magic number per ring, so an inner ring automatically\n * asks for more degrees than an outer one.\n */\nexport function arcSeparation(width: number, radius: number): number {\n\treturn radius > 0 ? (width / radius) * (180 / Math.PI) : 0;\n}\n\n/** Polar to cartesian for SVG wheel positioning. Angle in degrees, 0 at 3 o'clock. */\nexport function polarToCartesian(\n\tcx: number,\n\tcy: number,\n\tradius: number,\n\tangleDeg: number,\n): { x: number; y: number } {\n\tconst angleRad = (angleDeg * Math.PI) / 180;\n\treturn {\n\t\tx: cx + radius * Math.cos(angleRad),\n\t\ty: cy + radius * Math.sin(angleRad),\n\t};\n}\n", "/**\n * Display formatters for ISO timestamps and floats coming back from the API.\n * Every helper returns \"\" for nullish or unparseable input so it falls out of\n * template literals cleanly.\n *\n * @remarks\n * **This file is the ONLY place in the library that may call `Intl` or a `toLocale*` method, and every helper that does takes the locale as its first argument, required.** Both halves are enforced by a source scan in `tests/i18n.test.ts`.\n *\n * The locale is the DISPLAY locale, the full tag `resolveLang` returns, region included. It is NOT the value that goes on `?lang=`: that one is truncated to a supported two-letter code because the API rejects anything else, and handing THAT to Intl would render every Argentine visitor's dates in Castilian conventions. `es-AR` is exactly the tag Intl wants.\n *\n * It is required rather than optional because the defect it replaces was an omission: `toLocaleDateString(undefined, ...)` means \"the locale of whoever is looking\", so a Spanish page rendered `Carta natal` above `Jan 15, 1990, 2:30 PM`, and two visitors to the same page saw two different strings. An optional parameter defaults straight back to that. A missing argument is now a typecheck failure at every call site.\n */\n\nimport { capitalize, humanize } from './string.js';\n\nconst DATE_ONLY = /^\\d{4}-\\d{2}-\\d{2}$/;\nconst BARE_TIME = /^\\d{2}:\\d{2}(:\\d{2})?$/;\n/** An ISO datetime with NO timezone designator: a wall clock, not an instant. */\nconst NAIVE_DATETIME = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}(:\\d{2}(\\.\\d+)?)?$/;\n\n/** Canonical form per tag seen, so a page carrying an unparseable `lang` does not throw once per rendered date. */\nconst CANONICAL: Map<string, string> = new Map();\n\n/**\n * The locale list to hand Intl: the page's tag first, English behind it.\n *\n * @remarks\n * Two failure modes, both reachable from a `lang` attribute a site owner typed by hand and neither of which may reach a visitor:\n *\n * - **A structurally invalid tag throws.** `lang=\"english\"` or `lang=\"en_US\"` makes every `toLocale*` call raise a RangeError, which inside a render is a blank component rather than a wrong date. Canonicalizing behind a try/catch degrades it to English instead.\n * - **A valid-but-unknown tag falls back to the RUNTIME default**, which is the viewer's browser again, so the bug reappears for exactly the pages least likely to notice. Naming `en` as the second entry makes the fallback the page's, not the visitor's.\n *\n * No language signal at all resolves to English for the same reason the chrome catalogue does: a page that never declares a language is English as far as this library is concerned, and English chrome over German dates is the inconsistency this whole file exists to remove. `navigator.language` is deliberately absent from the chain here as it is in `resolveLang`: it is the VISITOR's preference, not the site's.\n */\nfunction intlLocales(locale: string | undefined): string[] {\n\tif (!locale) return ['en'];\n\tconst cached = CANONICAL.get(locale);\n\tif (cached) return [cached, 'en'];\n\tlet canonical = 'en';\n\ttry {\n\t\tcanonical = Intl.getCanonicalLocales(locale)[0] ?? 'en';\n\t} catch {\n\t\tcanonical = 'en';\n\t}\n\tCANONICAL.set(locale, canonical);\n\treturn [canonical, 'en'];\n}\n\n/**\n * Resolve an API timestamp to a Date plus the timezone it must be RENDERED in.\n *\n * @remarks\n * The API returns chart times naive (`2026-07-13T04:36:00`): that is 04:36 in the CHART's timezone, not UTC and not the viewer's. A wall clock must read the same for every viewer on earth, so hora at sunrise says 04:36 in Tokyo and in Chicago alike.\n *\n * Handing a naive string to `new Date()` makes the runtime interpret it in the VIEWER's zone, which is a silent corruption whenever that wall clock lands in the viewer's DST gap. In America/New_York `2026-03-08T02:30:00` does not exist, so the clock jumps and it renders as `3:30 AM`. Pinning the wall clock to UTC, which has no DST and therefore no gap, preserves the digits exactly while Intl still writes them in the PAGE locale conventions.\n *\n * An offset-bearing timestamp (`...Z`, `...+05:30`) IS a real instant, so it keeps the normal behaviour and converts to the viewer's local time.\n *\n * Deliberately NOT exported. It used to be, so a component needing a shape these helpers did not offer could pin its own wall clock and call Intl itself, which is how `dasha-timeline` came to hardcode `toLocaleString('en', ...)` and pin every boundary date to English. A shape that is missing is added here, beside the locale handling, not reimplemented in a component.\n */\nfunction resolveDisplayDate(input: string): {\n\td: Date;\n\ttimeZone?: string;\n} {\n\tconst naive = BARE_TIME.test(input)\n\t\t? `1970-01-01T${input}`\n\t\t: NAIVE_DATETIME.test(input)\n\t\t\t? input\n\t\t\t: null;\n\treturn naive\n\t\t? { d: new Date(`${naive}Z`), timeZone: 'UTC' }\n\t\t: { d: new Date(input) };\n}\n\n/**\n * The clock, in the page locale: `2:30 PM` in English, `14:30` in German.\n *\n * @remarks\n * The hour cycle is the locale's, never ours. It used to be pinned `hour12: true`, which put an AM/PM clock on every page in Europe and Latin America while the embedded form beside it labelled its own input \"formato de 24 horas\". CLDR already knows which convention each locale reads, including the ones that surprise you (`es` is 24-hour, `es-AR` is 12-hour with `p. m.`), so asserting a cycle here is asserting we know better than the locale data.\n */\nexport function formatTime(locale: string | undefined, input: unknown): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tif (DATE_ONLY.test(input)) return '';\n\tconst { d, timeZone } = resolveDisplayDate(input);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleTimeString(intlLocales(locale), {\n\t\thour: 'numeric',\n\t\tminute: '2-digit',\n\t\ttimeZone,\n\t});\n}\n\nexport function formatDate(locale: string | undefined, input: unknown): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tconst { d, timeZone } = resolveDisplayDate(\n\t\tDATE_ONLY.test(input) ? `${input}T00:00:00` : input,\n\t);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleDateString(intlLocales(locale), {\n\t\tmonth: 'short',\n\t\tday: 'numeric',\n\t\tyear: 'numeric',\n\t\ttimeZone,\n\t});\n}\n\nexport function formatTimeRange(\n\tlocale: string | undefined,\n\tt: { start?: string; end?: string } | undefined,\n): string {\n\tif (!t) return '';\n\tconst start = formatTime(locale, t.start);\n\tconst end = formatTime(locale, t.end);\n\tif (start && end) return `${start} - ${end}`;\n\treturn start || end || '';\n}\n\n/** Two dates as one label: `Jan 1, 2026 - Jan 7, 2026`. Falls back to whichever end parses when the other is absent. */\nexport function formatDateRange(\n\tlocale: string | undefined,\n\tstart: unknown,\n\tend: unknown,\n): string {\n\tconst a = formatDate(locale, start);\n\tconst b = formatDate(locale, end);\n\tif (a && b) return `${a} - ${b}`;\n\treturn a || b;\n}\n\n/** How much of a timestamp a label shows. `time` is the whole date plus the clock. */\nexport type DateGrain = 'year' | 'month' | 'day' | 'time';\n\n/**\n * A timestamp at a chosen granularity, for an axis or a bar end where the full date would not fit.\n *\n * @remarks\n * Every grain below `year` carries the year, because a period routinely straddles new year and a label reading `28 Dec - 3 Jan` says nothing about which side moved. `year` is sliced off the string rather than formatted, since a bare four-digit year is the same in every locale this library ships and running it through Intl would introduce era and numbering-system differences into an axis tick.\n */\nexport function formatDateGrain(\n\tlocale: string | undefined,\n\tinput: unknown,\n\tgrain: DateGrain,\n): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tif (grain === 'year') {\n\t\tconst m = input.match(/^(\\d{4})/);\n\t\treturn m?.[1] ?? input;\n\t}\n\tconst { d, timeZone } = resolveDisplayDate(input);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleString(intlLocales(locale), {\n\t\tday: grain === 'month' ? undefined : 'numeric',\n\t\tmonth: 'short',\n\t\tyear: 'numeric',\n\t\thour: grain === 'time' ? 'numeric' : undefined,\n\t\tminute: grain === 'time' ? '2-digit' : undefined,\n\t\ttimeZone,\n\t});\n}\n\n/**\n * A day inside a month already named elsewhere: `Aug 3`, `3 ago`, `3. Aug.`.\n *\n * @remarks\n * Deliberately WITHOUT the year, which is the one thing {@link formatDateGrain} will not do at any grain below `year`, and for a good reason there: a period can straddle new year and `28 Dec - 3 Jan` says nothing about which side moved. This shape exists for the opposite case, a payload whose own fields pin the month (a monthly ephemeris carries `year` and `month` at the top level and prints them in its header), where repeating the year on thirty-one rows and a dozen chips is noise rather than safety. Do not reach for it where the month is not already on screen.\n *\n * A date-only string is pinned to UTC the way {@link formatDate} pins it, so the digits read the same for every viewer instead of rolling back a day west of Greenwich.\n */\nexport function formatMonthDay(\n\tlocale: string | undefined,\n\tinput: unknown,\n): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tconst { d, timeZone } = resolveDisplayDate(\n\t\tDATE_ONLY.test(input) ? `${input}T00:00:00` : input,\n\t);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleDateString(intlLocales(locale), {\n\t\tmonth: 'short',\n\t\tday: 'numeric',\n\t\ttimeZone,\n\t});\n}\n\n/**\n * A day of the month with its weekday: `1 Sat`, `s\u00E1b 1`, `Sa., 1.`.\n *\n * @remarks\n * The row label a printed ephemeris uses (`01 Sa`, `02 Su`), and it carries neither the month nor the year because the page header already names both. The weekday is not decoration: half of what a practitioner asks a monthly ephemeris is which DAY of the week a placement falls on, and deriving it from a bare number is exactly the arithmetic a table exists to save. Order and separator belong to the locale, which is why this is one Intl call rather than a join.\n *\n * A date-only string is pinned to UTC the way {@link formatDate} pins it, so the weekday cannot roll backwards west of Greenwich.\n */\nexport function formatWeekdayDay(\n\tlocale: string | undefined,\n\tinput: unknown,\n): string {\n\tif (typeof input !== 'string' || input.length === 0) return '';\n\tconst { d, timeZone } = resolveDisplayDate(\n\t\tDATE_ONLY.test(input) ? `${input}T00:00:00` : input,\n\t);\n\tif (Number.isNaN(d.getTime())) return input;\n\treturn d.toLocaleDateString(intlLocales(locale), {\n\t\tweekday: 'short',\n\t\tday: 'numeric',\n\t\ttimeZone,\n\t});\n}\n\n/**\n * A calendar month and its year: `August 2026`, `agosto de 2026`, `August 2026`.\n *\n * @remarks\n * Takes the two NUMBERS an endpoint returns rather than a timestamp, because that is the shape a monthly payload echoes, and anchors them at UTC noon for the same reason {@link monthName} does: no timezone can roll the anchor into the neighbouring month. The connective belongs to the locale (`de` in Spanish, nothing in English), which is why this is one Intl call rather than a join of {@link monthName} and the year.\n */\nexport function formatMonthYear(\n\tlocale: string | undefined,\n\tyear: unknown,\n\tmonth: unknown,\n): string {\n\tif (typeof year !== 'number' || !Number.isFinite(year)) return '';\n\tif (typeof month !== 'number' || !Number.isInteger(month)) return '';\n\tif (month < 1 || month > 12) return '';\n\treturn new Date(Date.UTC(year, month - 1, 1, 12)).toLocaleDateString(\n\t\tintlLocales(locale),\n\t\t{ month: 'long', year: 'numeric', timeZone: 'UTC' },\n\t);\n}\n\n/**\n * Month name from a 1-based month number: `January`, `enero`, `janvier`.\n *\n * @remarks\n * Two components carried a byte-identical array of twelve English month names, which is both a duplicated table and a table of something the platform already knows in every language. Anchored to a UTC noon so no timezone can roll the date into the neighbouring month.\n */\nexport function monthName(locale: string | undefined, month: unknown): string {\n\tif (typeof month !== 'number' || !Number.isInteger(month)) return '';\n\tif (month < 1 || month > 12) return '';\n\treturn new Date(Date.UTC(2000, month - 1, 1, 12)).toLocaleDateString(\n\t\tintlLocales(locale),\n\t\t{ month: 'long', timeZone: 'UTC' },\n\t);\n}\n\n/**\n * A whole number with the page locale's digit grouping: `12,345` in English, `12.345` in Spanish.\n *\n * @remarks\n * Rounds rather than truncating, so a caller testing the magnitude (`Math.round(km) === 0`) and this label agree about which side of a boundary a value fell.\n */\nexport function formatInteger(\n\tlocale: string | undefined,\n\tvalue: unknown,\n): string {\n\tif (typeof value !== 'number' || !Number.isFinite(value)) return '';\n\treturn value.toLocaleString(intlLocales(locale), {\n\t\tmaximumFractionDigits: 0,\n\t});\n}\n\n/**\n * Format a number, dropping trailing zeros in the FRACTIONAL part only: `2.50` becomes `2.5`, `2.0` becomes `2`, and `100` stays `100`.\n *\n * @remarks\n * Guard on the decimal point, and never strip from the integer side. A naive `.replace(/\\.?0+$/, '')` over the whole string eats zeros off the INTEGER whenever there is no decimal point, so at `dp = 0` it turns `100` into `1`, `90` into `9` and `0` into the empty string.\n *\n * @example\n * ```ts\n * formatNumber(100, 0); // '100'\n * formatNumber(2.5, 1); // '2.5'\n * formatNumber(2, 1); // '2'\n * formatNumber(0, 0); // '0'\n * ```\n */\nexport function formatNumber(value: unknown, dp = 1): string {\n\tif (typeof value !== 'number' || !Number.isFinite(value)) return '';\n\tconst fixed = value.toFixed(dp);\n\treturn fixed.includes('.') ? fixed.replace(/\\.?0+$/, '') : fixed;\n}\n\nexport function formatPercent(value: unknown, dp = 1): string {\n\tconst n = formatNumber(value, dp);\n\treturn n ? `${n}%` : '';\n}\n\n/**\n * CSS class name per aspect type. Used by natal and synastry chart aspect\n * lines so the same color encoding (harmonious vs challenging) applies in\n * both wheels. Keys are lowercase canonical names, values are CSS class\n * suffixes the chart components define in their `:host` styles.\n */\nexport const ASPECT_CLASS: Record<string, string> = {\n\tconjunction: 'aspect-conjunction',\n\tsextile: 'aspect-sextile',\n\tsquare: 'aspect-square',\n\ttrine: 'aspect-trine',\n\topposition: 'aspect-opposition',\n};\n\n/**\n * Normalize the `type` field on an aspect entry to a lowercase, hyphen-separated canonical name (`SEMI_SEXTILE` and `SEMI SEXTILE` both become `semi-sextile`). Accepts any aspect-shaped object so both natal and synastry inter-aspect entries can share this.\n *\n * @remarks\n * Spaces are folded as well as underscores because the endpoints do not agree on the separator: aspects returns `SEMI SEXTILE` where synastry returns `SEMI_SEXTILE`. Handling only the underscore left the space form failing every {@link ASPECT_CLASS} and `ASPECT_SYMBOL` lookup, so the same aspect rendered hyphenated and correctly coloured in one component and space-separated in the neutral fallback colour in another.\n */\nexport function normalizeAspect(a: { type?: string }): string {\n\treturn (a.type ?? '')\n\t\t.toLowerCase()\n\t\t.trim()\n\t\t.replace(/[\\s_]+/g, '-');\n}\n\n/**\n * Display label for an aspect: `SEMI_SEXTILE` -> `Semi-sextile`.\n *\n * The raw value is an API enum and the table column it lands in is read by practitioners, not parsers. {@link normalizeAspect} stays the lookup key for classes and glyphs; this is the human-facing form.\n */\nexport function formatAspectName(a: { type?: string }): string {\n\treturn capitalize(normalizeAspect(a));\n}\n\n/**\n * Display label for an ayanamsa identifier. `kp-newcomb` -> `KP Newcomb`.\n *\n * The raw values are API enums, and every one of them needs a human form that {@link humanize} cannot derive: KP is an initialism that must stay uppercase, and `raman` is a person, B.V. Raman, not a word. Anything unmapped degrades to a humanized slug rather than rendering the enum. That fallback is a safety net, not a licence to skip the map, since a humanized slug reads as a bare surname where a full name belongs. A test fails if the committed spec gains a frame this map lacks.\n */\nexport const AYANAMSA_LABEL: Record<string, string> = {\n\t'kp-newcomb': 'KP Newcomb',\n\t'kp-old': 'KP Old',\n\tlahiri: 'Lahiri',\n\traman: 'B.V. Raman',\n\n\tcustom: 'Custom',\n};\n\nexport function formatAyanamsa(type: unknown, degrees?: unknown): string {\n\tconst label =\n\t\ttypeof type === 'string' ? (AYANAMSA_LABEL[type] ?? humanize(type)) : '';\n\tconst deg =\n\t\ttypeof degrees === 'number' ? `${formatNumber(degrees, 2)}\\u00b0` : '';\n\tif (label && deg) return `${label} (${deg})`;\n\treturn label || deg;\n}\n\n/**\n * Date plus time in one label: `Jan 15, 1990, 2:30 PM`.\n *\n * @remarks\n * Components were concatenating a raw date and a raw time (`1990-01-15 \\u00b7 14:30:00`) while siblings rendered the same instant through {@link formatDate}. One helper keeps every card reading the same way.\n *\n * Birth details arrive as two fields rather than one timestamp, so `time` may be passed separately; it is merged into a naive datetime, which {@link formatDate} and {@link formatTime} pin to UTC so the wall clock renders identically for every viewer.\n *\n * @example\n * ```ts\n * formatDateTime('en', '1990-01-15T14:30:00'); // 'Jan 15, 1990, 2:30 PM'\n * formatDateTime('en', '1990-01-15', '14:30:00'); // 'Jan 15, 1990, 2:30 PM'\n * formatDateTime('de', '1990-01-15T14:30:00'); // '15. Jan. 1990, 14:30'\n * formatDateTime('en', '1990-01-15'); // 'Jan 15, 1990'\n * ```\n */\nexport function formatDateTime(\n\tlocale: string | undefined,\n\tinput: unknown,\n\ttime?: unknown,\n): string {\n\tconst merged =\n\t\ttypeof input === 'string' &&\n\t\tDATE_ONLY.test(input) &&\n\t\ttypeof time === 'string' &&\n\t\tBARE_TIME.test(time)\n\t\t\t? `${input}T${time}`\n\t\t\t: input;\n\tconst date = formatDate(locale, merged);\n\tconst clock = formatTime(locale, merged);\n\tif (date && clock) return `${date}, ${clock}`;\n\treturn date || clock;\n}\n\n/**\n * The Sanskrit form of a name, but only when it actually differs from the English one.\n *\n * @remarks\n * Several endpoints pair an English `name` with a `sanskritName` that is sometimes the SAME string, because the tradition and the translation coincide (a nakshatra is `Ashwini` either way). Rendering the pair unconditionally then prints `Ashwini (Ashwini)`. That guard is the whole reason this exists: it is one comparison, it is easy to leave out, and leaving it out is invisible until a reader hits a name where the two agree.\n *\n * Presentation deliberately stays with the caller, since the same fact is drawn as a parenthetical in a table cell and as a middot-separated span on a chart heading.\n */\nexport function distinctSanskrit(\n\tname: unknown,\n\tsanskritName: unknown,\n): string | undefined {\n\tif (typeof sanskritName !== 'string' || !sanskritName) return undefined;\n\treturn sanskritName === name ? undefined : sanskritName;\n}\n\n/**\n * `English (Sanskrit)` for a value that carries both, falling back to whichever one exists.\n *\n * @example\n * ```ts\n * formatWithSanskrit('Tuesday', 'Mangalavara'); // 'Tuesday (Mangalavara)'\n * formatWithSanskrit('Ashwini', 'Ashwini'); // 'Ashwini'\n * ```\n */\nexport function formatWithSanskrit(\n\tname: unknown,\n\tsanskritName: unknown,\n): string {\n\tconst english = typeof name === 'string' ? name : '';\n\tconst sanskrit = distinctSanskrit(english, sanskritName);\n\tif (!english) return sanskrit ?? '';\n\treturn sanskrit ? `${english} (${sanskrit})` : english;\n}\n", "/**\n * The value a READER sees, for a response field the API returns twice.\n *\n * @remarks\n * Several endpoints now echo a display translation beside the canonical value: `nameLocalized` next to `name`, `signLocalized` next to `sign`, `typeLocalized` next to `type`. **The canonical field is deliberately always English, whatever `?lang=` says, so it stays safe to compare against in code**, and the localized one is deliberately absent from an English response.\n *\n * That split is the whole contract, and inverting it breaks charts silently rather than loudly: `planetGlyph`, `signGlyph`, `aspectSymbol`, `ASPECT_CLASS`, `SIGNS_ORDER.indexOf`, every `Map` key and every CSS class fragment is keyed on the English name, so pointing one of them at `nameLocalized` resolves to nothing on a translated page and to the same value on an English one, which is exactly the shape of defect that passes every gate (lesson 24). **The lookup stays on the canonical value; only the printed text node, the `title` and the `aria-label` move.**\n *\n * These two helpers exist so that rule lives in one place rather than as a `??` at every call site, and so an English response, where the localized field simply is not there, degrades by construction instead of by remembering. Both take the KEY of the canonical field and derive its partner, so a mistyped key or a field that is not a display string is a compile error rather than a silent empty string.\n */\n\n/** The one naming convention every helper here derives from. Ratified by the API and spreading to more operations, so it is matched as a convention and never as a list of field names. */\nconst LOCALIZED = 'Localized';\n\n/** A response row carrying a canonical English `K` plus the optional localized partner the API writes beside it. */\nexport type Localizable<K extends string> = Partial<\n\tRecord<K | `${K}Localized`, string>\n>;\n\n/** The same pairing where the value is a LIST of names, e.g. `retrogradePlanets`. */\nexport type LocalizableList<K extends string> = Partial<\n\tRecord<K | `${K}Localized`, string[]>\n>;\n\n/**\n * The text to print for `key`: the localized value when the response carried one, else the English one.\n *\n * @param english - What to print in the English case INSTEAD of the raw field, for a canonical value that is an API enum with a display form of its own (`type` is `SEMI_SEXTILE` on the wire and `Semi-sextile` on screen). Omit it wherever the canonical value is already the readable one.\n *\n * @example\n * ```ts\n * display(planet, 'name'); // 'Sol' on ?lang=es, 'Sun' on English\n * planetGlyph(planet.name) ?? display(planet, 'name'); // the lookup stays English, the fallback TEXT does not\n * display(aspect, 'type', formatAspectName(aspect)); // 'Tr\u00EDgono', else 'Trine' and never 'TRINE'\n * ```\n */\nexport function display<\n\tT extends Localizable<K>,\n\tK extends Extract<keyof T, string>,\n>(row: T | null | undefined, key: K, english?: string): string {\n\tconst rec = row as Record<string, unknown> | null | undefined;\n\tconst localized = rec?.[`${key}${LOCALIZED}`];\n\tif (typeof localized === 'string' && localized !== '') return localized;\n\tif (english !== undefined) return english;\n\tconst canonical = rec?.[key];\n\treturn typeof canonical === 'string' ? canonical : '';\n}\n\n/**\n * A list field as `{ value, label }` pairs: the English `value` every lookup is keyed on, and the `label` a reader sees.\n *\n * @remarks\n * The localized array is INDEX-ALIGNED with the canonical one, which is the only thing that makes the pairing possible, so it is zipped by position and neither side is ever sorted, filtered or deduped on its own. A list that is short or absent falls back per item, so a partial translation still resolves every glyph.\n */\nexport function displayList<\n\tT extends LocalizableList<K>,\n\tK extends Extract<keyof T, string>,\n>(row: T | null | undefined, key: K): Array<{ value: string; label: string }> {\n\tconst rec = row as Record<string, unknown> | null | undefined;\n\tconst canonical = rec?.[key];\n\tif (!Array.isArray(canonical)) return [];\n\tconst localized = rec?.[`${key}${LOCALIZED}`];\n\tconst labels = Array.isArray(localized) ? localized : [];\n\treturn canonical.map((value, i) => {\n\t\tconst label = labels[i];\n\t\treturn {\n\t\t\tvalue: String(value),\n\t\t\tlabel: typeof label === 'string' && label !== '' ? label : String(value),\n\t\t};\n\t});\n}\n\n/**\n * Fold every `XLocalized` field into its `X` partner: the reader's value under the canonical NAME, and the duplicate key gone.\n *\n * @remarks\n * For a renderer that has no idea what its fields MEAN and derives its columns from `Object.keys(row)`, which is how `<roxy-data>` started drawing `Planet | Planet Localized | Longitude | Sign | Sign Localized` the day the API began sending both. Two extra columns, headed in English, carrying the same fact twice, on a page whose owner changed nothing. That is a regression rather than a missing feature, so it is repaired at the key layer every render path already funnels through rather than at each of them.\n *\n * Three rules, and each has a way of going wrong:\n *\n * - **A `*Localized` key with no canonical partner stays put.** Suppressing on the name alone deletes data the response carries and nothing else is rendering.\n * - **The canonical key keeps its POSITION**, so a translated response and an English one lay out identically, column for column.\n * - **A row with nothing to fold is returned as the same object**, so the English path is not merely equivalent but untouched.\n *\n * The English value is dropped rather than shown beside its translation because the two are the same fact, and the caller here is generic: it cannot know that `sign` is the value a lookup would be keyed on. A component that needs both halves reads them itself with {@link display}.\n */\nexport function foldLocalized<V>(row: Record<string, V>): Record<string, V> {\n\tlet folded: Record<string, V> | undefined;\n\tfor (const key of Object.keys(row)) {\n\t\tif (!key.endsWith(LOCALIZED)) continue;\n\t\tconst base = key.slice(0, -LOCALIZED.length);\n\t\tif (base === '' || !(base in row)) continue;\n\t\tfolded ??= { ...row };\n\t\tconst value = row[key];\n\t\tif (value !== undefined && value !== null && value !== '')\n\t\t\tfolded[base] = value;\n\t\tdelete folded[key];\n\t}\n\treturn folded ?? row;\n}\n"],
|
|
5
|
+
"mappings": "4MAAA,OAAS,OAAAA,GAAK,QAAAC,EAAM,WAAAC,MAAe,MACnC,OAAS,iBAAAC,GAAe,YAAAC,OAAgB,oBC4BjC,SAASC,EAAUC,EAAmB,CAC5C,OAAOA,EACL,YAAY,EACZ,QAAQ,WAAY,GAAG,EACvB,KAAK,CACR,CClBA,IAAMC,EAAU,CACfC,EACAC,IACyBA,EAAOD,EAAME,EAAUD,CAAI,CAAC,EAAI,OAEpDE,GAAuC,CAC5C,IAAK,SACL,KAAM,SACN,QAAS,SACT,MAAO,SACP,MAAO,SACP,KAAM,SACN,QAAS,SACT,OAAQ,SACR,OAAQ,SACR,QAAS,SACT,MAAO,SACP,KAAM,SACN,KAAM,SACN,UAAW,MACX,MAAO,KACP,aAAc,SACd,aAAc,SACd,OAAQ,SACR,OAAQ,SACR,oBAAqB,QACtB,EAGaC,EACZH,GACwBF,EAAQI,GAAcF,CAAI,EAwBnD,IAAMI,GAAqC,CAC1C,MAAO,SACP,OAAQ,SACR,OAAQ,SACR,OAAQ,SACR,I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SAIzB,IAAME,EAAOL,EAAYA,EAAY,OAAS,CAAC,EAC3CK,GAAQD,GAAM,EAAE,aAAcC,EAAK,IAAMF,EAAI,KAC5CH,EAAY,KAAK,CAAE,MAAOG,EAAI,KAAM,IAAKA,EAAI,IAAK,CAAC,CACzD,CACAR,EAAO,KAAK,CACX,KAAAC,EACA,MAAOjB,EAAQmB,EAAK,EAAG,QAAQ,EAC/B,MAAOD,EAAM,EACb,KAAMC,EAAK,EACX,UAAAC,EACA,YAAAC,EACA,aAAAC,EACA,aAAAC,CACD,CAAC,CACF,CAEA,IAAMI,EAAiB3C,EAAK,KAAK,IAAK8B,GAAQ,CAC7C,IAAMc,EAAS,IAAI,IAAId,EAAI,UAAU,IAAKrB,GAAM,CAACA,EAAE,OAAQA,CAAC,CAAC,CAAC,EAC9D,MAAO,CAAE,KAAMqB,EAAI,KAAM,MAAOE,EAAO,IAAK5B,GAAMwC,EAAO,IAAIxC,EAAE,IAAI,CAAC,CAAE,CACvE,CAAC,EACD,MAAO,CAAE,KAAMJ,EAAK,KAAM,MAAOA,EAAK,MAAO,OAAAgC,EAAQ,KAAAW,CAAK,CAC3D,CACD,EA/Ka9C,EACL,OAAS,CACfgD,EACAC,4wHACD,EAIAC,EAAA,CADCC,GAAS,CAAE,KAAM,MAAO,CAAC,GAPdnD,EAQZ,uBARYA,EAANkD,EAAA,CADNE,GAAc,sBAAsB,GACxBpD",
|
|
6
6
|
"names": ["css", "html", "nothing", "customElement", "property", "lookupKey", "s", "resolve", "table", "name", "lookupKey", "PLANET_GLYPH", "planetGlyph", "SIGN_GLYPH", "signGlyph", "name", "resolve", "html", "LitElement", "nothing", "property", "state", "ifDefined", "resolveLang", "el", "inherited", "GLOBAL_KEY", "registry", "holder", "existing", "created", "interpolate", "template", "vars", "match", "key", "translate", "lang", "source", "catalogs", "registry", "tag", "catalog", "lookupKey", "onLocaleChange", "listener", "listeners", "LocaleController", "host", "onLocaleChange", "css", "baseStyles", "KEY_REFUSED_MESSAGE", "keyIsRefused", "key", "dispatchKeyRefusal", "host", "opts", "KEY_REFUSED_MESSAGE", "DEFAULT_BASE_URL", "FetchController", "host", "req", "controller", "res", "json", "err", "signal", "url", "k", "v", "headers", "keyIsRefused", "KEY_REFUSED_MESSAGE", "dispatchKeyRefusal", "body", "buildRequest", "endpoint", "method", "values", "queryKeys", "rest", "path", "_match", "name", "inQuery", "query", "css", "html", "nothing", "css", "html", "chevron", "disclosureStyles", "interpAccordionStyles", "css", "renderInterpAccordion", "sections", "name", "heading", "shown", "s", "nothing", "html", "i", "chevron", "ROXY_DATA_CLASS", "isJsonScript", "el", "MarkupDataController", "host", "parsed", "inline", "child", "ROXY_DATA_CLASS", "text", "RoxyDataElement", "LitElement", "source", "vars", "detail", "buildRequest", "MarkupDataController", "LocaleController", "FetchController", "baseStyles", "translate", "changed", "html", "sections", "name", "heading", "nothing", "renderInterpAccordion", "data", "body", "ifDefined", "resolveLang", "raw", "values", "message", "banner", "__decorateClass", "property", "state", "splitDegreeInSign", "deg", "degree", "minute", "DATE_ONLY", "BARE_TIME", "NAIVE_DATETIME", "CANONICAL", "intlLocales", "locale", "cached", "canonical", "resolveDisplayDate", "input", "naive", "formatMonthDay", "locale", "input", "d", "timeZone", "resolveDisplayDate", "DATE_ONLY", "intlLocales", "formatWeekdayDay", "formatMonthYear", "year", "month", "LOCALIZED", "display", "row", "key", "english", "rec", "localized", "canonical", "SAMPLE_INSTANT", "RoxyEphemerisTable", "RoxyDataElement", "html", "data", "vm", "locale", "formatMonthYear", "b", "glyph", "planetGlyph", "nothing", "r", "p", "degree", "minute", "splitDegreeInSign", "g", "signGlyph", "label", "display", "i", "date", "formatMonthDay", "start", "end", "range", "row", "formatWeekdayDay", "cell", "body", "classes", "order", "series", "day", "samples", "bodies", "name", "first", "last", "ingresses", "retrogrades", "ingressDates", "stationDates", "cur", "prev", "open", "rows", "byName", "baseStyles", "css", "__decorateClass", "property", "customElement"]
|
|
7
7
|
}
|