@alfadocs/ui-kit-debug 1.12.6 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{actions-cell-renderer-DnSLrgQD.js → actions-cell-renderer-ReurEy5i.js} +2 -2
- package/dist/_chunks/{actions-cell-renderer-DnSLrgQD.js.map → actions-cell-renderer-ReurEy5i.js.map} +1 -1
- package/dist/_chunks/{address-fields-CZP4Wncx.js → address-fields-CZ0pEdEI.js} +4 -4
- package/dist/_chunks/{address-fields-CZP4Wncx.js.map → address-fields-CZ0pEdEI.js.map} +1 -1
- package/dist/_chunks/{ai-prompt-input-DnbfEJnr.js → ai-prompt-input-CrHr-5H8.js} +2 -2
- package/dist/_chunks/{ai-prompt-input-DnbfEJnr.js.map → ai-prompt-input-CrHr-5H8.js.map} +1 -1
- package/dist/_chunks/{anamnesis-summary-rows-BfhxWPO3.js → anamnesis-summary-rows-CRWO8x8g.js} +4 -4
- package/dist/_chunks/{anamnesis-summary-rows-BfhxWPO3.js.map → anamnesis-summary-rows-CRWO8x8g.js.map} +1 -1
- package/dist/_chunks/{audio-recorder-EWBCNIsd.js → audio-recorder-DXG6LTtO.js} +2 -2
- package/dist/_chunks/{audio-recorder-EWBCNIsd.js.map → audio-recorder-DXG6LTtO.js.map} +1 -1
- package/dist/_chunks/{autocomplete-BrONKN8l.js → autocomplete-MpBhz-fG.js} +86 -74
- package/dist/_chunks/{autocomplete-BrONKN8l.js.map → autocomplete-MpBhz-fG.js.map} +1 -1
- package/dist/_chunks/{balance-badge-cell-7L6nzB29.js → balance-badge-cell--iQ_gtmi.js} +4 -4
- package/dist/_chunks/{balance-badge-cell-7L6nzB29.js.map → balance-badge-cell--iQ_gtmi.js.map} +1 -1
- package/dist/_chunks/{bishop-score-Cnu0xs-z.js → bishop-score-CJUVBfAu.js} +2 -2
- package/dist/_chunks/{bishop-score-Cnu0xs-z.js.map → bishop-score-CJUVBfAu.js.map} +1 -1
- package/dist/_chunks/{booking-CBHKdsZl.js → booking-DQbo6mQF.js} +609 -591
- package/dist/_chunks/booking-DQbo6mQF.js.map +1 -0
- package/dist/_chunks/{care-plan-card-aDN4oem9.js → care-plan-card-D-FMfDKH.js} +2 -2
- package/dist/_chunks/{care-plan-card-aDN4oem9.js.map → care-plan-card-D-FMfDKH.js.map} +1 -1
- package/dist/_chunks/{care-plan-entry-card-BEhANdBE.js → care-plan-entry-card-Bvw_9T-d.js} +2 -2
- package/dist/_chunks/{care-plan-entry-card-BEhANdBE.js.map → care-plan-entry-card-Bvw_9T-d.js.map} +1 -1
- package/dist/_chunks/{care-plan-header-CkpPyQqG.js → care-plan-header-B5CBE0zu.js} +2 -2
- package/dist/_chunks/{care-plan-header-CkpPyQqG.js.map → care-plan-header-B5CBE0zu.js.map} +1 -1
- package/dist/_chunks/{city-input-towzBenY.js → city-input-DaQc-Hbj.js} +2 -2
- package/dist/_chunks/{city-input-towzBenY.js.map → city-input-DaQc-Hbj.js.map} +1 -1
- package/dist/_chunks/{combobox-DiMLItyu.js → combobox-D7_NLE2Z.js} +89 -81
- package/dist/_chunks/{combobox-DiMLItyu.js.map → combobox-D7_NLE2Z.js.map} +1 -1
- package/dist/_chunks/{contact-profile-card-BMIBr5s9.js → contact-profile-card-BZqi8Hck.js} +38 -36
- package/dist/_chunks/{contact-profile-card-BMIBr5s9.js.map → contact-profile-card-BZqi8Hck.js.map} +1 -1
- package/dist/_chunks/{country-select-UEF9BEeQ.js → country-select-DzbPFktV.js} +2 -2
- package/dist/_chunks/{country-select-UEF9BEeQ.js.map → country-select-DzbPFktV.js.map} +1 -1
- package/dist/_chunks/{document-preview-oyx9RhCo.js → document-preview-CDb-n_W7.js} +2 -2
- package/dist/_chunks/{document-preview-oyx9RhCo.js.map → document-preview-CDb-n_W7.js.map} +1 -1
- package/dist/_chunks/{face-scheme-CZaKm6fG.js → face-scheme-DA2vjqaM.js} +2 -2
- package/dist/_chunks/{face-scheme-CZaKm6fG.js.map → face-scheme-DA2vjqaM.js.map} +1 -1
- package/dist/_chunks/{file-manager-C0y7HBAN.js → file-manager-UsD8e_AB.js} +2 -2
- package/dist/_chunks/{file-manager-C0y7HBAN.js.map → file-manager-UsD8e_AB.js.map} +1 -1
- package/dist/_chunks/{gestational-age-calculator-CxZelpu2.js → gestational-age-calculator-CiOQjzgx.js} +2 -2
- package/dist/_chunks/{gestational-age-calculator-CxZelpu2.js.map → gestational-age-calculator-CiOQjzgx.js.map} +1 -1
- package/dist/_chunks/key-value-pair-BIBdZBLg.js +188 -0
- package/dist/_chunks/key-value-pair-BIBdZBLg.js.map +1 -0
- package/dist/_chunks/{link-cell-renderer-CenJx-_7.js → link-cell-renderer-CIASXsVM.js} +4 -4
- package/dist/_chunks/{link-cell-renderer-CenJx-_7.js.map → link-cell-renderer-CIASXsVM.js.map} +1 -1
- package/dist/_chunks/{multi-select-DqL4o0qV.js → multi-select-DYOvx2SJ.js} +56 -48
- package/dist/_chunks/{multi-select-DqL4o0qV.js.map → multi-select-DYOvx2SJ.js.map} +1 -1
- package/dist/_chunks/{muscle-scheme-yfzP_xoJ.js → muscle-scheme-BSJsI4-I.js} +2 -2
- package/dist/_chunks/{muscle-scheme-yfzP_xoJ.js.map → muscle-scheme-BSJsI4-I.js.map} +1 -1
- package/dist/_chunks/{optical-prescription-Dj3Eh5Ok.js → optical-prescription-BvwuqTpl.js} +2 -2
- package/dist/_chunks/{optical-prescription-Dj3Eh5Ok.js.map → optical-prescription-BvwuqTpl.js.map} +1 -1
- package/dist/_chunks/{patient-details-xrqe13az.js → patient-details-BQaUzPqp.js} +5 -5
- package/dist/_chunks/{patient-details-xrqe13az.js.map → patient-details-BQaUzPqp.js.map} +1 -1
- package/dist/_chunks/{patient-search-D5ufYoRc.js → patient-search-HeEUB-_X.js} +2 -2
- package/dist/_chunks/{patient-search-D5ufYoRc.js.map → patient-search-HeEUB-_X.js.map} +1 -1
- package/dist/_chunks/{patient-summary-card-CBfuDvJ5.js → patient-summary-card-CvDxhbBR.js} +2 -2
- package/dist/_chunks/{patient-summary-card-CBfuDvJ5.js.map → patient-summary-card-CvDxhbBR.js.map} +1 -1
- package/dist/_chunks/{payment-request-card-YVCcCZ25.js → payment-request-card-lmKLwsDs.js} +2 -2
- package/dist/_chunks/{payment-request-card-YVCcCZ25.js.map → payment-request-card-lmKLwsDs.js.map} +1 -1
- package/dist/_chunks/{periodontal-chart-BatZEFar.js → periodontal-chart-B9fphroR.js} +2 -2
- package/dist/_chunks/{periodontal-chart-BatZEFar.js.map → periodontal-chart-B9fphroR.js.map} +1 -1
- package/dist/_chunks/{periodontal-chart-card-BBpY_rBc.js → periodontal-chart-card-qEZPXj83.js} +2 -2
- package/dist/_chunks/{periodontal-chart-card-BBpY_rBc.js.map → periodontal-chart-card-qEZPXj83.js.map} +1 -1
- package/dist/_chunks/{pregnancy-dating-DtToyMyc.js → pregnancy-dating-D2wchD11.js} +2 -2
- package/dist/_chunks/{pregnancy-dating-DtToyMyc.js.map → pregnancy-dating-D2wchD11.js.map} +1 -1
- package/dist/_chunks/{province-select-BDywtmL-.js → province-select-BBc7s7vR.js} +2 -2
- package/dist/_chunks/{province-select-BDywtmL-.js.map → province-select-BBc7s7vR.js.map} +1 -1
- package/dist/_chunks/{select-BW5ecXlX.js → select-Bi8zril7.js} +165 -136
- package/dist/_chunks/select-Bi8zril7.js.map +1 -0
- package/dist/_chunks/{signature-request-DVDTKLjM.js → signature-request-CUe903hj.js} +2 -2
- package/dist/_chunks/{signature-request-DVDTKLjM.js.map → signature-request-CUe903hj.js.map} +1 -1
- package/dist/_chunks/{tabs-CBb2AidH.js → tabs-DqKtTIjZ.js} +2 -2
- package/dist/_chunks/{tabs-CBb2AidH.js.map → tabs-DqKtTIjZ.js.map} +1 -1
- package/dist/_chunks/{tasks-panel-Do5SFp-j.js → tasks-panel-DPCNaRko.js} +2 -2
- package/dist/_chunks/{tasks-panel-Do5SFp-j.js.map → tasks-panel-DPCNaRko.js.map} +1 -1
- package/dist/_chunks/{tooth-scheme-WdyVymQ1.js → tooth-scheme-2IsmbE6w.js} +2 -2
- package/dist/_chunks/{tooth-scheme-WdyVymQ1.js.map → tooth-scheme-2IsmbE6w.js.map} +1 -1
- package/dist/_chunks/{unit-converter-BPumXMA6.js → unit-converter-C6jMjqL9.js} +2 -2
- package/dist/_chunks/{unit-converter-BPumXMA6.js.map → unit-converter-C6jMjqL9.js.map} +1 -1
- package/dist/_chunks/{workflow-map-DE_ribRM.js → workflow-map-wcw3t6g4.js} +2 -2
- package/dist/_chunks/{workflow-map-DE_ribRM.js.map → workflow-map-wcw3t6g4.js.map} +1 -1
- package/dist/agent-catalog.json +1 -1
- package/dist/components/_shared/option.d.ts +1 -0
- package/dist/components/_shared/option.d.ts.map +1 -1
- package/dist/components/address-fields/index.js +1 -1
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
- package/dist/components/autocomplete/index.js +1 -1
- package/dist/components/bishop-score/index.js +1 -1
- package/dist/components/booking/booking.d.ts.map +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/care-plan-card/index.js +1 -1
- package/dist/components/care-plan-entry-card/index.js +1 -1
- package/dist/components/care-plan-header/index.js +1 -1
- package/dist/components/city-input/index.js +1 -1
- package/dist/components/combobox/combobox.d.ts.map +1 -1
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/contact-profile-card/contact-profile-card.d.ts.map +1 -1
- package/dist/components/contact-profile-card/index.js +1 -1
- package/dist/components/country-select/index.js +1 -1
- package/dist/components/data-table/index.js +2 -2
- package/dist/components/document-preview/index.js +1 -1
- package/dist/components/face-scheme/index.js +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/key-value-pair/index.js +1 -1
- package/dist/components/key-value-pair/key-value-pair.d.ts +16 -0
- package/dist/components/key-value-pair/key-value-pair.d.ts.map +1 -1
- package/dist/components/multi-select/index.js +1 -1
- package/dist/components/multi-select/multi-select.d.ts.map +1 -1
- package/dist/components/muscle-scheme/index.js +1 -1
- package/dist/components/optical-prescription/index.js +1 -1
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-search/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/payment-card/index.js +1 -1
- package/dist/components/periodontal-chart/index.js +1 -1
- package/dist/components/periodontal-chart-card/index.js +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/province-select/index.js +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/select/select.d.ts +24 -0
- package/dist/components/select/select.d.ts.map +1 -1
- package/dist/components/skeleton-scheme/index.js +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tasks-panel/index.js +1 -1
- package/dist/components/tooth-scheme/index.js +1 -1
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/index.js +40 -40
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/signature-request/index.js +1 -1
- package/package.json +1 -1
- package/dist/_chunks/booking-CBHKdsZl.js.map +0 -1
- package/dist/_chunks/key-value-pair-BubG4fUa.js +0 -144
- package/dist/_chunks/key-value-pair-BubG4fUa.js.map +0 -1
- package/dist/_chunks/select-BW5ecXlX.js.map +0 -1
|
@@ -4,7 +4,7 @@ import { c as A } from "./index-D2ZczOXr.js";
|
|
|
4
4
|
import { useTranslation as K } from "react-i18next";
|
|
5
5
|
import { u as L } from "./registry-DvAUVLHh.js";
|
|
6
6
|
import { F } from "./form-field-CahJzTxp.js";
|
|
7
|
-
import { S as H } from "./select-
|
|
7
|
+
import { S as H } from "./select-Bi8zril7.js";
|
|
8
8
|
import { C as O } from "./card-DPmk26CL.js";
|
|
9
9
|
import { B as M } from "./badge-sTusUqZD.js";
|
|
10
10
|
import { I as j } from "./insert-result-LCNTskNJ.js";
|
|
@@ -301,4 +301,4 @@ export {
|
|
|
301
301
|
V as d,
|
|
302
302
|
G as e
|
|
303
303
|
};
|
|
304
|
-
//# sourceMappingURL=bishop-score-
|
|
304
|
+
//# sourceMappingURL=bishop-score-CJUVBfAu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bishop-score-Cnu0xs-z.js","sources":["../../src/components/bishop-score/bishop-score.agent.ts","../../src/components/bishop-score/bishop.ts","../../src/components/bishop-score/bishop-score.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — BishopScore. */\n/* */\n/* Cervical-favourability calculator. The agent-relevant surface is the */\n/* read-only computed result (total + band) plus the five enumerated */\n/* findings, and `set_value` actions to drive each finding. NO patient */\n/* identity is ever exposed — only the structural exam findings and the */\n/* derived score. The handle is the curated `BishopScoreHandle`, never */\n/* React state. See `src/docs/26-agent-readiness.mdx`. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { BishopScoreHandle } from './bishop-score';\nimport type { BishopComponent } from './bishop';\n\n/**\n * Enumerated finding ids, mirrored from `./bishop`'s `BISHOP_COMPONENTS`.\n * Inlined as a literal (rather than runtime-imported) so the ESM catalog\n * build can load this pure module without TS path resolution. The `satisfies`\n * keeps it in lockstep with the `BishopComponent` union at compile time.\n */\nconst COMPONENT_IDS = [\n 'dilation',\n 'effacement',\n 'station',\n 'consistency',\n 'position',\n] as const satisfies readonly BishopComponent[];\n\nexport const bishopScoreAgent: AgentAdapter<BishopScoreHandle> = {\n id: 'bishop-score',\n capabilities: ['set_value'],\n state: {\n selection: {\n type: 'Partial<Record<BishopComponent, string>>',\n descriptionKey: 'ui.agent.bishopScore.state.selection',\n description:\n 'The five cervical-exam findings keyed by component (dilation, effacement, station, consistency, position). Each value is an enumerated option key, not free text.',\n read: (handle) => handle.getSelection(),\n },\n result: {\n type: '{ total: number, band: string } | null',\n descriptionKey: 'ui.agent.bishopScore.state.result',\n description:\n 'Computed Bishop result — total (0–13) and favourability band (unfavourable / intermediate / favourable). Null until all five findings are set.',\n read: (handle) => handle.getResult(),\n },\n },\n actions: {\n set_value: {\n safety: 'write',\n argsType: '{ component: BishopComponent, value: string }',\n argsSchema: {\n type: 'object',\n properties: {\n component: {\n enum: [...COMPONENT_IDS],\n description: 'Which cervical-exam finding to set.',\n },\n value: {\n type: 'string',\n description:\n 'Enumerated option key for that finding (e.g. dilation \"closed\" | \"1-2\" | \"3-4\" | \"5+\").',\n },\n },\n required: ['component', 'value'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.bishopScore.actions.setValue',\n description:\n 'Set one cervical-exam finding to an enumerated option value. Unknown component/value pairs are ignored.',\n examples: [\n {\n args: { component: 'dilation', value: '3-4' },\n note: 'Record cervical dilation of 3–4 cm (2 points).',\n },\n ],\n invoke: (handle, args: { component: BishopComponent; value: string }) => {\n handle.setComponent(args.component, args.value);\n },\n },\n reset: {\n safety: 'write',\n idempotent: true,\n descriptionKey: 'ui.agent.bishopScore.actions.reset',\n description: 'Clear all five findings and the computed result.',\n invoke: (handle) => {\n handle.reset();\n },\n },\n get_result: {\n safety: 'read',\n returns: '{ total: number, band: string } | null',\n returnsSchema: {\n oneOf: [\n {\n type: 'object',\n properties: {\n total: { type: 'integer', minimum: 0, maximum: 13 },\n band: {\n enum: ['unfavourable', 'intermediate', 'favourable'],\n },\n },\n required: ['total', 'band'],\n },\n { type: 'null' },\n ],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.bishopScore.actions.getResult',\n description:\n 'Return the computed Bishop result, or null until all five findings are set.',\n invoke: (handle) => handle.getResult(),\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'bishop-score',\n description: 'Marks the BishopScore calculator wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Required to address a specific calculator instance.',\n },\n },\n};\n","/* ------------------------------------------------------------------ */\n/* Bishop score — cervical favourability for induction of labour. */\n/* */\n/* Pure, framework-free, unit-testable. Five components scored 0–3 */\n/* (dilation, effacement, station) or 0–2 (consistency, position), */\n/* summed to a 0–13 total. Bands per ACOG: ≤6 unfavourable (cervical */\n/* ripening advised), 7 intermediate, ≥8 favourable. */\n/* */\n/* Bishop EH, Obstet Gynecol 1964; thresholds per ACOG Practice */\n/* Bulletin 107 (Induction of Labor). */\n/* ------------------------------------------------------------------ */\n\nexport type BishopComponent =\n | 'dilation'\n | 'effacement'\n | 'station'\n | 'consistency'\n | 'position';\n\n/** The component fields in the order they are scored / displayed. */\nexport const BISHOP_COMPONENTS: readonly BishopComponent[] = [\n 'dilation',\n 'effacement',\n 'station',\n 'consistency',\n 'position',\n] as const;\n\nexport interface BishopOption {\n /** Stable value key → i18n lookup `bishopScore.<component>.<value>`. */\n value: string;\n /** Points this option contributes. */\n score: number;\n}\n\n/**\n * Scored options per component. Dilation / effacement / station run 0–3;\n * consistency / position run 0–2 (the classic Bishop weighting).\n */\nexport const BISHOP_OPTIONS: Record<BishopComponent, BishopOption[]> = {\n dilation: [\n { value: 'closed', score: 0 },\n { value: '1-2', score: 1 },\n { value: '3-4', score: 2 },\n { value: '5+', score: 3 },\n ],\n effacement: [\n { value: '0-30', score: 0 },\n { value: '40-50', score: 1 },\n { value: '60-70', score: 2 },\n { value: '80+', score: 3 },\n ],\n station: [\n { value: '-3', score: 0 },\n { value: '-2', score: 1 },\n { value: '-1-0', score: 2 },\n { value: '+1+2', score: 3 },\n ],\n consistency: [\n { value: 'firm', score: 0 },\n { value: 'medium', score: 1 },\n { value: 'soft', score: 2 },\n ],\n position: [\n { value: 'posterior', score: 0 },\n { value: 'mid', score: 1 },\n { value: 'anterior', score: 2 },\n ],\n};\n\nexport type BishopBand = 'unfavourable' | 'intermediate' | 'favourable';\n\n/** Highest attainable total (3 + 3 + 3 + 2 + 2). */\nexport const BISHOP_MAX_SCORE = 13;\n\n/** Classify a total into a favourability band (ACOG thresholds). */\nexport function bishopBand(total: number): BishopBand {\n if (total <= 6) return 'unfavourable';\n if (total >= 8) return 'favourable';\n return 'intermediate';\n}\n\nexport type BishopSelection = Partial<Record<BishopComponent, string>>;\n\nexport interface BishopResult {\n total: number;\n band: BishopBand;\n}\n\n/** Look up the score for a component's selected option, or `null` if unknown. */\nfunction scoreFor(component: BishopComponent, value: string): number | null {\n return (\n BISHOP_OPTIONS[component].find((o) => o.value === value)?.score ?? null\n );\n}\n\n/**\n * Sum the Bishop score. Returns `null` until every one of the five components\n * has a valid selection (a partial exam doesn't yield a meaningful total).\n */\nexport function bishopScore(selection: BishopSelection): BishopResult | null {\n let total = 0;\n for (const component of BISHOP_COMPONENTS) {\n const value = selection[component];\n if (value === undefined) return null;\n const score = scoreFor(component, value);\n if (score === null) return null;\n total += score;\n }\n return { total, band: bishopBand(total) };\n}\n","/* ------------------------------------------------------------------ */\n/* BishopScore — cervical favourability for induction of labour. */\n/* */\n/* Five enumerated cervical-exam findings → a 0–13 total with a */\n/* favourability band. Maths lives in `./bishop` (pure, tested). */\n/* ------------------------------------------------------------------ */\n\nimport { forwardRef, useEffect, useMemo, useRef, useState } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { bishopScoreAgent } from './bishop-score.agent';\nimport { FormField } from '../form-field';\nimport { Select } from '../select';\nimport { Card } from '../card';\nimport { Badge } from '../badge';\nimport {\n InsertButton,\n type InsertPayload,\n type InsertVariant,\n type InsertMode,\n} from '../_shared/insert-result';\nimport {\n type BishopComponent,\n type BishopSelection,\n type BishopResult,\n type BishopBand,\n BISHOP_COMPONENTS,\n BISHOP_OPTIONS,\n BISHOP_MAX_SCORE,\n bishopScore,\n} from './bishop';\n\nconst rootVariants = cva('ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]', {\n variants: {\n width: { full: 'ds:w-full', auto: 'ds:inline-flex' },\n },\n defaultVariants: { width: 'full' },\n});\n\n/** Band → on-screen Badge variant + inserted-card chip token. */\nconst BAND_BADGE: Record<BishopBand, 'warning' | 'info' | 'success'> = {\n unfavourable: 'warning',\n intermediate: 'info',\n favourable: 'success',\n};\nconst BAND_TOKEN: Record<BishopBand, string> = {\n unfavourable: '--warning-readable',\n intermediate: '--info',\n favourable: '--success',\n};\n\nexport interface BishopScoreProps extends VariantProps<typeof rootVariants> {\n /** Fires whenever all five findings are set (and `null` when not). */\n onResultChange?: (result: BishopResult | null) => void;\n /** When provided, shows the result-action buttons that emit / copy the result. */\n onInsert?: (payload: InsertPayload) => void;\n /** Which verb the result button performs. Defaults to `'insert'`. */\n insertVariant?: InsertVariant;\n /** `copy` variant only — fired after a successful clipboard write. */\n onCopy?: (mode: InsertMode) => void;\n /** `copy` variant only — fired if the clipboard write can't proceed. */\n onError?: (error: unknown) => void;\n /** Brand wordmark printed in the inserted/copied result-card footer. */\n insertBrand?: string | false;\n /** Opaque instance id, emitted as `data-component-id`. */\n id?: string;\n /** Extra class names on the wrapper. */\n className?: string;\n}\n\n/**\n * Curated imperative handle for agent / external automation. Exposes the\n * structural exam findings + computed result and lets a caller set one\n * finding at a time. Never exposes patient identity. Consumed by the\n * `bishop-score.agent.ts` adapter; the public `ref` stays the DOM element.\n */\nexport interface BishopScoreHandle {\n /** Snapshot of the five findings keyed by component. */\n getSelection: () => BishopSelection;\n /** Current computed result, or null until all five findings are set. */\n getResult: () => BishopResult | null;\n /** Set one finding to an enumerated option value (unknown pairs are ignored). */\n setComponent: (component: BishopComponent, value: string) => void;\n /** Clear all findings. */\n reset: () => void;\n}\n\nexport const BishopScore = forwardRef<HTMLDivElement, BishopScoreProps>(\n (\n {\n onResultChange,\n onInsert,\n insertVariant = 'insert',\n onCopy,\n onError,\n insertBrand,\n id,\n width,\n className,\n },\n ref,\n ) => {\n const { t } = useTranslation();\n\n const [selection, setSelection] = useState<BishopSelection>({});\n\n const result = useMemo(() => bishopScore(selection), [selection]);\n\n useEffect(() => {\n onResultChange?.(result);\n }, [result, onResultChange]);\n\n // Live refs so the once-built agent handle reads/writes current state\n // without re-creating on every keystroke. Public `ref` stays the DOM node.\n const selectionRef = useRef(selection);\n selectionRef.current = selection;\n const resultRef = useRef(result);\n resultRef.current = result;\n const agentHandle = useMemo<BishopScoreHandle>(\n () => ({\n getSelection: () => ({ ...selectionRef.current }),\n getResult: () => resultRef.current,\n setComponent: (component, value) => {\n const allowed = BISHOP_OPTIONS[component]?.some(\n (o) => o.value === value,\n );\n if (!allowed) return;\n setSelection((prev) => ({ ...prev, [component]: value }));\n },\n reset: () => setSelection({}),\n }),\n [],\n );\n useAgentRegistration(bishopScoreAgent, agentHandle, id);\n\n const optionsFor = (component: BishopComponent) =>\n BISHOP_OPTIONS[component].map((o) => ({\n value: o.value,\n label: t(`bishopScore.${component}.${o.value}`),\n }));\n\n const bandLabel = (band: BishopBand): string =>\n t(`bishopScore.band.${band}`);\n\n return (\n <div\n ref={ref}\n data-component=\"bishop-score\"\n data-component-id={id}\n className={rootVariants({ width, className })}\n >\n <div className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2\">\n {BISHOP_COMPONENTS.map((component) => (\n <FormField\n key={component}\n label={t(`bishopScore.${component}.label`)}\n >\n <Select\n options={optionsFor(component)}\n value={selection[component] ?? ''}\n onValueChange={(next) =>\n setSelection((prev) => ({ ...prev, [component]: next }))\n }\n />\n </FormField>\n ))}\n </div>\n\n <p className=\"ds:sr-only\" role=\"status\" aria-live=\"polite\">\n {result\n ? `${t('bishopScore.totalLabel')}: ${t('bishopScore.scoreOf', {\n score: result.total,\n max: BISHOP_MAX_SCORE,\n })}. ${bandLabel(result.band)}.`\n : ''}\n </p>\n\n {result ? (\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n <dl className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2\">\n <div className=\"ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)]\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('bishopScore.totalLabel')}\n </dt>\n <dd className=\"type-metric ds:text-foreground\">\n {t('bishopScore.scoreOf', {\n score: result.total,\n max: BISHOP_MAX_SCORE,\n })}\n </dd>\n </div>\n <div className=\"ds:flex ds:flex-col ds:items-end ds:gap-[var(--spacing-xs)] ds:text-end\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('bishopScore.bandLabel')}\n </dt>\n <dd>\n <Badge variant={BAND_BADGE[result.band]} size=\"lg\">\n {bandLabel(result.band)}\n </Badge>\n </dd>\n </div>\n </dl>\n <p className=\"type-body-sm ds:text-muted-foreground\">\n {t(`bishopScore.interpretation.${result.band}`)}\n </p>\n {insertVariant === 'copy' || onInsert ? (\n <InsertButton\n onInsert={onInsert}\n variant={insertVariant}\n onCopy={onCopy}\n onError={onError}\n card={{\n title: t('insert.title.bishop'),\n icon: 'activity',\n highlight: bandLabel(result.band),\n highlightToken: BAND_TOKEN[result.band],\n brand: insertBrand,\n fields: [\n {\n icon: 'percent',\n label: t('bishopScore.totalLabel'),\n value: t('bishopScore.scoreOf', {\n score: result.total,\n max: BISHOP_MAX_SCORE,\n }),\n },\n {\n icon: 'tag',\n label: t('bishopScore.bandLabel'),\n value: bandLabel(result.band),\n },\n ],\n }}\n />\n ) : null}\n </Card.Body>\n </Card>\n ) : (\n <p className=\"type-body ds:text-muted-foreground\">\n {t('bishopScore.empty')}\n </p>\n )}\n </div>\n );\n },\n);\n\nBishopScore.displayName = 'BishopScore';\n"],"names":["COMPONENT_IDS","bishopScoreAgent","handle","args","BISHOP_COMPONENTS","BISHOP_OPTIONS","BISHOP_MAX_SCORE","bishopBand","total","scoreFor","component","value","_a","o","bishopScore","selection","score","rootVariants","cva","BAND_BADGE","BAND_TOKEN","BishopScore","forwardRef","onResultChange","onInsert","insertVariant","onCopy","onError","insertBrand","id","width","className","ref","t","useTranslation","setSelection","useState","result","useMemo","useEffect","selectionRef","useRef","resultRef","agentHandle","prev","useAgentRegistration","optionsFor","bandLabel","band","j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AA,sBACjC,OAAOA,EAAE,uBAAuB;AAAA,wBAC9B,OAAOI,EAAO;AAAA,wBACd,KAAK/B;AAAA,sBAAA,CACN;AAAA,oBAAA;AAAA,oBAEH;AAAA,sBACE,MAAM;AAAA,sBACN,OAAO2B,EAAE,uBAAuB;AAAA,sBAChC,OAAOc,EAAUV,EAAO,IAAI;AAAA,oBAAA;AAAA,kBAC9B;AAAA,gBACF;AAAA,cACF;AAAA,YAAA,IAEA;AAAA,UAAA,EAAA,CACN,EAAA,CACF,IAEA,gBAAAa,EAAC,KAAA,EAAE,WAAU,sCACV,UAAAjB,EAAE,mBAAmB,EAAA,CACxB;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEAZ,EAAY,cAAc;"}
|
|
1
|
+
{"version":3,"file":"bishop-score-CJUVBfAu.js","sources":["../../src/components/bishop-score/bishop-score.agent.ts","../../src/components/bishop-score/bishop.ts","../../src/components/bishop-score/bishop-score.tsx"],"sourcesContent":["/* -------------------------------------------------------------------- */\n/* Agent adapter — BishopScore. */\n/* */\n/* Cervical-favourability calculator. The agent-relevant surface is the */\n/* read-only computed result (total + band) plus the five enumerated */\n/* findings, and `set_value` actions to drive each finding. NO patient */\n/* identity is ever exposed — only the structural exam findings and the */\n/* derived score. The handle is the curated `BishopScoreHandle`, never */\n/* React state. See `src/docs/26-agent-readiness.mdx`. */\n/* -------------------------------------------------------------------- */\n\nimport type { AgentAdapter } from '../../agent/types';\nimport type { BishopScoreHandle } from './bishop-score';\nimport type { BishopComponent } from './bishop';\n\n/**\n * Enumerated finding ids, mirrored from `./bishop`'s `BISHOP_COMPONENTS`.\n * Inlined as a literal (rather than runtime-imported) so the ESM catalog\n * build can load this pure module without TS path resolution. The `satisfies`\n * keeps it in lockstep with the `BishopComponent` union at compile time.\n */\nconst COMPONENT_IDS = [\n 'dilation',\n 'effacement',\n 'station',\n 'consistency',\n 'position',\n] as const satisfies readonly BishopComponent[];\n\nexport const bishopScoreAgent: AgentAdapter<BishopScoreHandle> = {\n id: 'bishop-score',\n capabilities: ['set_value'],\n state: {\n selection: {\n type: 'Partial<Record<BishopComponent, string>>',\n descriptionKey: 'ui.agent.bishopScore.state.selection',\n description:\n 'The five cervical-exam findings keyed by component (dilation, effacement, station, consistency, position). Each value is an enumerated option key, not free text.',\n read: (handle) => handle.getSelection(),\n },\n result: {\n type: '{ total: number, band: string } | null',\n descriptionKey: 'ui.agent.bishopScore.state.result',\n description:\n 'Computed Bishop result — total (0–13) and favourability band (unfavourable / intermediate / favourable). Null until all five findings are set.',\n read: (handle) => handle.getResult(),\n },\n },\n actions: {\n set_value: {\n safety: 'write',\n argsType: '{ component: BishopComponent, value: string }',\n argsSchema: {\n type: 'object',\n properties: {\n component: {\n enum: [...COMPONENT_IDS],\n description: 'Which cervical-exam finding to set.',\n },\n value: {\n type: 'string',\n description:\n 'Enumerated option key for that finding (e.g. dilation \"closed\" | \"1-2\" | \"3-4\" | \"5+\").',\n },\n },\n required: ['component', 'value'],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.bishopScore.actions.setValue',\n description:\n 'Set one cervical-exam finding to an enumerated option value. Unknown component/value pairs are ignored.',\n examples: [\n {\n args: { component: 'dilation', value: '3-4' },\n note: 'Record cervical dilation of 3–4 cm (2 points).',\n },\n ],\n invoke: (handle, args: { component: BishopComponent; value: string }) => {\n handle.setComponent(args.component, args.value);\n },\n },\n reset: {\n safety: 'write',\n idempotent: true,\n descriptionKey: 'ui.agent.bishopScore.actions.reset',\n description: 'Clear all five findings and the computed result.',\n invoke: (handle) => {\n handle.reset();\n },\n },\n get_result: {\n safety: 'read',\n returns: '{ total: number, band: string } | null',\n returnsSchema: {\n oneOf: [\n {\n type: 'object',\n properties: {\n total: { type: 'integer', minimum: 0, maximum: 13 },\n band: {\n enum: ['unfavourable', 'intermediate', 'favourable'],\n },\n },\n required: ['total', 'band'],\n },\n { type: 'null' },\n ],\n },\n idempotent: true,\n descriptionKey: 'ui.agent.bishopScore.actions.getResult',\n description:\n 'Return the computed Bishop result, or null until all five findings are set.',\n invoke: (handle) => handle.getResult(),\n },\n },\n domHooks: {\n root: {\n attr: 'data-component',\n value: 'bishop-score',\n description: 'Marks the BishopScore calculator wrapper.',\n },\n instanceId: {\n attr: 'data-component-id',\n sourceProp: 'id',\n description:\n 'Sourced from the id prop. Required to address a specific calculator instance.',\n },\n },\n};\n","/* ------------------------------------------------------------------ */\n/* Bishop score — cervical favourability for induction of labour. */\n/* */\n/* Pure, framework-free, unit-testable. Five components scored 0–3 */\n/* (dilation, effacement, station) or 0–2 (consistency, position), */\n/* summed to a 0–13 total. Bands per ACOG: ≤6 unfavourable (cervical */\n/* ripening advised), 7 intermediate, ≥8 favourable. */\n/* */\n/* Bishop EH, Obstet Gynecol 1964; thresholds per ACOG Practice */\n/* Bulletin 107 (Induction of Labor). */\n/* ------------------------------------------------------------------ */\n\nexport type BishopComponent =\n | 'dilation'\n | 'effacement'\n | 'station'\n | 'consistency'\n | 'position';\n\n/** The component fields in the order they are scored / displayed. */\nexport const BISHOP_COMPONENTS: readonly BishopComponent[] = [\n 'dilation',\n 'effacement',\n 'station',\n 'consistency',\n 'position',\n] as const;\n\nexport interface BishopOption {\n /** Stable value key → i18n lookup `bishopScore.<component>.<value>`. */\n value: string;\n /** Points this option contributes. */\n score: number;\n}\n\n/**\n * Scored options per component. Dilation / effacement / station run 0–3;\n * consistency / position run 0–2 (the classic Bishop weighting).\n */\nexport const BISHOP_OPTIONS: Record<BishopComponent, BishopOption[]> = {\n dilation: [\n { value: 'closed', score: 0 },\n { value: '1-2', score: 1 },\n { value: '3-4', score: 2 },\n { value: '5+', score: 3 },\n ],\n effacement: [\n { value: '0-30', score: 0 },\n { value: '40-50', score: 1 },\n { value: '60-70', score: 2 },\n { value: '80+', score: 3 },\n ],\n station: [\n { value: '-3', score: 0 },\n { value: '-2', score: 1 },\n { value: '-1-0', score: 2 },\n { value: '+1+2', score: 3 },\n ],\n consistency: [\n { value: 'firm', score: 0 },\n { value: 'medium', score: 1 },\n { value: 'soft', score: 2 },\n ],\n position: [\n { value: 'posterior', score: 0 },\n { value: 'mid', score: 1 },\n { value: 'anterior', score: 2 },\n ],\n};\n\nexport type BishopBand = 'unfavourable' | 'intermediate' | 'favourable';\n\n/** Highest attainable total (3 + 3 + 3 + 2 + 2). */\nexport const BISHOP_MAX_SCORE = 13;\n\n/** Classify a total into a favourability band (ACOG thresholds). */\nexport function bishopBand(total: number): BishopBand {\n if (total <= 6) return 'unfavourable';\n if (total >= 8) return 'favourable';\n return 'intermediate';\n}\n\nexport type BishopSelection = Partial<Record<BishopComponent, string>>;\n\nexport interface BishopResult {\n total: number;\n band: BishopBand;\n}\n\n/** Look up the score for a component's selected option, or `null` if unknown. */\nfunction scoreFor(component: BishopComponent, value: string): number | null {\n return (\n BISHOP_OPTIONS[component].find((o) => o.value === value)?.score ?? null\n );\n}\n\n/**\n * Sum the Bishop score. Returns `null` until every one of the five components\n * has a valid selection (a partial exam doesn't yield a meaningful total).\n */\nexport function bishopScore(selection: BishopSelection): BishopResult | null {\n let total = 0;\n for (const component of BISHOP_COMPONENTS) {\n const value = selection[component];\n if (value === undefined) return null;\n const score = scoreFor(component, value);\n if (score === null) return null;\n total += score;\n }\n return { total, band: bishopBand(total) };\n}\n","/* ------------------------------------------------------------------ */\n/* BishopScore — cervical favourability for induction of labour. */\n/* */\n/* Five enumerated cervical-exam findings → a 0–13 total with a */\n/* favourability band. Maths lives in `./bishop` (pure, tested). */\n/* ------------------------------------------------------------------ */\n\nimport { forwardRef, useEffect, useMemo, useRef, useState } from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { useAgentRegistration } from '../../agent/registry';\nimport { bishopScoreAgent } from './bishop-score.agent';\nimport { FormField } from '../form-field';\nimport { Select } from '../select';\nimport { Card } from '../card';\nimport { Badge } from '../badge';\nimport {\n InsertButton,\n type InsertPayload,\n type InsertVariant,\n type InsertMode,\n} from '../_shared/insert-result';\nimport {\n type BishopComponent,\n type BishopSelection,\n type BishopResult,\n type BishopBand,\n BISHOP_COMPONENTS,\n BISHOP_OPTIONS,\n BISHOP_MAX_SCORE,\n bishopScore,\n} from './bishop';\n\nconst rootVariants = cva('ds:flex ds:flex-col ds:gap-[var(--spacing-lg)]', {\n variants: {\n width: { full: 'ds:w-full', auto: 'ds:inline-flex' },\n },\n defaultVariants: { width: 'full' },\n});\n\n/** Band → on-screen Badge variant + inserted-card chip token. */\nconst BAND_BADGE: Record<BishopBand, 'warning' | 'info' | 'success'> = {\n unfavourable: 'warning',\n intermediate: 'info',\n favourable: 'success',\n};\nconst BAND_TOKEN: Record<BishopBand, string> = {\n unfavourable: '--warning-readable',\n intermediate: '--info',\n favourable: '--success',\n};\n\nexport interface BishopScoreProps extends VariantProps<typeof rootVariants> {\n /** Fires whenever all five findings are set (and `null` when not). */\n onResultChange?: (result: BishopResult | null) => void;\n /** When provided, shows the result-action buttons that emit / copy the result. */\n onInsert?: (payload: InsertPayload) => void;\n /** Which verb the result button performs. Defaults to `'insert'`. */\n insertVariant?: InsertVariant;\n /** `copy` variant only — fired after a successful clipboard write. */\n onCopy?: (mode: InsertMode) => void;\n /** `copy` variant only — fired if the clipboard write can't proceed. */\n onError?: (error: unknown) => void;\n /** Brand wordmark printed in the inserted/copied result-card footer. */\n insertBrand?: string | false;\n /** Opaque instance id, emitted as `data-component-id`. */\n id?: string;\n /** Extra class names on the wrapper. */\n className?: string;\n}\n\n/**\n * Curated imperative handle for agent / external automation. Exposes the\n * structural exam findings + computed result and lets a caller set one\n * finding at a time. Never exposes patient identity. Consumed by the\n * `bishop-score.agent.ts` adapter; the public `ref` stays the DOM element.\n */\nexport interface BishopScoreHandle {\n /** Snapshot of the five findings keyed by component. */\n getSelection: () => BishopSelection;\n /** Current computed result, or null until all five findings are set. */\n getResult: () => BishopResult | null;\n /** Set one finding to an enumerated option value (unknown pairs are ignored). */\n setComponent: (component: BishopComponent, value: string) => void;\n /** Clear all findings. */\n reset: () => void;\n}\n\nexport const BishopScore = forwardRef<HTMLDivElement, BishopScoreProps>(\n (\n {\n onResultChange,\n onInsert,\n insertVariant = 'insert',\n onCopy,\n onError,\n insertBrand,\n id,\n width,\n className,\n },\n ref,\n ) => {\n const { t } = useTranslation();\n\n const [selection, setSelection] = useState<BishopSelection>({});\n\n const result = useMemo(() => bishopScore(selection), [selection]);\n\n useEffect(() => {\n onResultChange?.(result);\n }, [result, onResultChange]);\n\n // Live refs so the once-built agent handle reads/writes current state\n // without re-creating on every keystroke. Public `ref` stays the DOM node.\n const selectionRef = useRef(selection);\n selectionRef.current = selection;\n const resultRef = useRef(result);\n resultRef.current = result;\n const agentHandle = useMemo<BishopScoreHandle>(\n () => ({\n getSelection: () => ({ ...selectionRef.current }),\n getResult: () => resultRef.current,\n setComponent: (component, value) => {\n const allowed = BISHOP_OPTIONS[component]?.some(\n (o) => o.value === value,\n );\n if (!allowed) return;\n setSelection((prev) => ({ ...prev, [component]: value }));\n },\n reset: () => setSelection({}),\n }),\n [],\n );\n useAgentRegistration(bishopScoreAgent, agentHandle, id);\n\n const optionsFor = (component: BishopComponent) =>\n BISHOP_OPTIONS[component].map((o) => ({\n value: o.value,\n label: t(`bishopScore.${component}.${o.value}`),\n }));\n\n const bandLabel = (band: BishopBand): string =>\n t(`bishopScore.band.${band}`);\n\n return (\n <div\n ref={ref}\n data-component=\"bishop-score\"\n data-component-id={id}\n className={rootVariants({ width, className })}\n >\n <div className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2\">\n {BISHOP_COMPONENTS.map((component) => (\n <FormField\n key={component}\n label={t(`bishopScore.${component}.label`)}\n >\n <Select\n options={optionsFor(component)}\n value={selection[component] ?? ''}\n onValueChange={(next) =>\n setSelection((prev) => ({ ...prev, [component]: next }))\n }\n />\n </FormField>\n ))}\n </div>\n\n <p className=\"ds:sr-only\" role=\"status\" aria-live=\"polite\">\n {result\n ? `${t('bishopScore.totalLabel')}: ${t('bishopScore.scoreOf', {\n score: result.total,\n max: BISHOP_MAX_SCORE,\n })}. ${bandLabel(result.band)}.`\n : ''}\n </p>\n\n {result ? (\n <Card variant=\"elevated\">\n <Card.Body className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-md)]\">\n <dl className=\"ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-md)] ds:sm:grid-cols-2\">\n <div className=\"ds:flex ds:flex-col ds:items-start ds:gap-[var(--spacing-xs)]\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('bishopScore.totalLabel')}\n </dt>\n <dd className=\"type-metric ds:text-foreground\">\n {t('bishopScore.scoreOf', {\n score: result.total,\n max: BISHOP_MAX_SCORE,\n })}\n </dd>\n </div>\n <div className=\"ds:flex ds:flex-col ds:items-end ds:gap-[var(--spacing-xs)] ds:text-end\">\n <dt className=\"type-label ds:text-muted-foreground\">\n {t('bishopScore.bandLabel')}\n </dt>\n <dd>\n <Badge variant={BAND_BADGE[result.band]} size=\"lg\">\n {bandLabel(result.band)}\n </Badge>\n </dd>\n </div>\n </dl>\n <p className=\"type-body-sm ds:text-muted-foreground\">\n {t(`bishopScore.interpretation.${result.band}`)}\n </p>\n {insertVariant === 'copy' || onInsert ? (\n <InsertButton\n onInsert={onInsert}\n variant={insertVariant}\n onCopy={onCopy}\n onError={onError}\n card={{\n title: t('insert.title.bishop'),\n icon: 'activity',\n highlight: bandLabel(result.band),\n highlightToken: BAND_TOKEN[result.band],\n brand: insertBrand,\n fields: [\n {\n icon: 'percent',\n label: t('bishopScore.totalLabel'),\n value: t('bishopScore.scoreOf', {\n score: result.total,\n max: BISHOP_MAX_SCORE,\n }),\n },\n {\n icon: 'tag',\n label: t('bishopScore.bandLabel'),\n value: bandLabel(result.band),\n },\n ],\n }}\n />\n ) : null}\n </Card.Body>\n </Card>\n ) : (\n <p className=\"type-body ds:text-muted-foreground\">\n {t('bishopScore.empty')}\n </p>\n )}\n </div>\n );\n },\n);\n\nBishopScore.displayName = 'BishopScore';\n"],"names":["COMPONENT_IDS","bishopScoreAgent","handle","args","BISHOP_COMPONENTS","BISHOP_OPTIONS","BISHOP_MAX_SCORE","bishopBand","total","scoreFor","component","value","_a","o","bishopScore","selection","score","rootVariants","cva","BAND_BADGE","BAND_TOKEN","BishopScore","forwardRef","onResultChange","onInsert","insertVariant","onCopy","onError","insertBrand","id","width","className","ref","t","useTranslation","setSelection","useState","result","useMemo","useEffect","selectionRef","useRef","resultRef","agentHandle","prev","useAgentRegistration","optionsFor","bandLabel","band","jsxs","jsx","FormField","Select","next","Card","Badge","InsertButton"],"mappings":";;;;;;;;;;AAqBA,MAAMA,IAAgB;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEaC,IAAoD;AAAA,EAC/D,IAAI;AAAA,EACJ,cAAc,CAAC,WAAW;AAAA,EAC1B,OAAO;AAAA,IACL,WAAW;AAAA,MACT,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACC,MAAWA,EAAO,aAAA;AAAA,IAAa;AAAA,IAExC,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,MAAM,CAACA,MAAWA,EAAO,UAAA;AAAA,IAAU;AAAA,EACrC;AAAA,EAEF,SAAS;AAAA,IACP,WAAW;AAAA,MACT,QAAQ;AAAA,MACR,UAAU;AAAA,MACV,YAAY;AAAA,QACV,MAAM;AAAA,QACN,YAAY;AAAA,UACV,WAAW;AAAA,YACT,MAAM,CAAC,GAAGF,CAAa;AAAA,YACvB,aAAa;AAAA,UAAA;AAAA,UAEf,OAAO;AAAA,YACL,MAAM;AAAA,YACN,aACE;AAAA,UAAA;AAAA,QACJ;AAAA,QAEF,UAAU,CAAC,aAAa,OAAO;AAAA,MAAA;AAAA,MAEjC,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,aACE;AAAA,MACF,UAAU;AAAA,QACR;AAAA,UACE,MAAM,EAAE,WAAW,Y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