@alfadocs/ui-kit 1.135.0 → 1.136.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/{ai-prompt-input-JIPbrTF3.js → ai-prompt-input-CVNeusoW.js} +2 -2
- package/dist/_chunks/ai-summary-panel-BhCo2vZF.js +1045 -0
- package/dist/_chunks/{alia-sidebar-CtwhdASP.js → alia-sidebar-CVBlKur9.js} +3 -3
- package/dist/_chunks/{anamnesis-summary-rows-CCNmkq55.js → anamnesis-summary-rows-Dr2V1Rtf.js} +3 -3
- package/dist/_chunks/{audio-recorder-CsnM_WDy.js → audio-recorder-BOF5YYoC.js} +2 -2
- package/dist/_chunks/{balance-badge-cell-DTiMdnCZ.js → balance-badge-cell-BSB02Bwo.js} +4 -4
- package/dist/_chunks/{bill-line-table-DHKb_O7c.js → bill-line-table-By-YL2ms.js} +2 -2
- package/dist/_chunks/{bishop-score-CKztphVz.js → bishop-score-DWGESRP9.js} +2 -2
- package/dist/_chunks/{calendar-appointment-editor-dialog-I5PfWudy.js → calendar-appointment-editor-dialog-CB4cQOtc.js} +5 -5
- package/dist/_chunks/call-status-chip-pajxN5eZ.js +180 -0
- package/dist/_chunks/calls-panel-BIfatK90.js +1094 -0
- package/dist/_chunks/{chat-input-CX4dxBq7.js → chat-input-BmvnuZqj.js} +114 -109
- package/dist/_chunks/{chat-message-CfIyXrxA.js → chat-message-B4TMeZ2m.js} +35 -30
- package/dist/_chunks/circle-x-W8Enq3i4.js +16 -0
- package/dist/_chunks/communications-panel-SQ-55e3V.js +1079 -0
- package/dist/_chunks/{data-grid-B2oaI7Lt.js → data-grid-CxKz8flO.js} +2 -2
- package/dist/_chunks/{data-table-FTV3uRjX.js → data-table-_tgj0C_T.js} +2 -2
- package/dist/_chunks/{default-tabs-DbebYO04.js → default-tabs-oDWQzbN7.js} +3 -3
- package/dist/_chunks/{document-preview-DLVIrOYV.js → document-preview-DWlejd8A.js} +2 -2
- package/dist/_chunks/entity-summary-CPUHzyil.js +297 -0
- package/dist/_chunks/{file-manager-Bzr5NK1t.js → file-manager-CEi4z2i0.js} +2 -2
- package/dist/_chunks/{gestational-age-calculator-mB6brTlp.js → gestational-age-calculator-CHbpC4vL.js} +2 -2
- package/dist/_chunks/{heatmap-C5gJin_F.js → heatmap-_546qI2V.js} +2 -2
- package/dist/_chunks/{invoice-upload-list-B5aMffTy.js → invoice-upload-list-CQI9MUl6.js} +3 -3
- package/dist/_chunks/{kit-extensions-DUaIYyMD.js → kit-extensions-BNBf4m8O.js} +3 -3
- package/dist/_chunks/{link-cell-renderer-D3JLPURZ.js → link-cell-renderer-Xx5T8u5Q.js} +3 -3
- package/dist/_chunks/{muscle-scheme-BGJD62op.js → muscle-scheme-D_rSyGDj.js} +2 -2
- package/dist/_chunks/{optical-prescription-Da_r8pMr.js → optical-prescription-DaSbsh4p.js} +2 -2
- package/dist/_chunks/{patient-account-settings-B2XbN_Fe.js → patient-account-settings-Bmfeclpd.js} +2 -2
- package/dist/_chunks/{patient-card-DTh3QTyS.js → patient-card-Cpr8iD19.js} +4 -4
- package/dist/_chunks/{patient-check-in-resume-B7NY-6KI.js → patient-check-in-resume-CYZ-SvsF.js} +38 -38
- package/dist/_chunks/{patient-details-DBtEITfE.js → patient-details-9eh9cNy7.js} +2 -2
- package/dist/_chunks/{patient-field-row-a5d4QijH.js → patient-field-row-B782eT0C.js} +2 -2
- package/dist/_chunks/{patient-sign-in-pin-CDBqV254.js → patient-sign-in-pin-DmMBwWet.js} +2 -2
- package/dist/_chunks/{patient-sign-in-steps-C2JSqlok.js → patient-sign-in-steps-BKcxNkdY.js} +37 -59
- package/dist/_chunks/{patient-summary-card-Bl2NknPe.js → patient-summary-card-K9zaMl1O.js} +2 -2
- package/dist/_chunks/phone-off-DQSTLz4l.js +28 -0
- package/dist/_chunks/{portal-documents-DJOH8pZx.js → portal-documents-DVKj6Sco.js} +3 -3
- package/dist/_chunks/{pregnancy-dating-BNI32qNw.js → pregnancy-dating-lJbzai73.js} +2 -2
- package/dist/_chunks/{registration-form-DS3RuKHu.js → registration-form-CuLiTA52.js} +2 -2
- package/dist/_chunks/{reserved.agent-DOzOBUW7.js → reserved.agent-CabZHFJC.js} +2 -2
- package/dist/_chunks/{select-uESzXTX6.js → select-CIXKyUMw.js} +172 -149
- package/dist/_chunks/{session-countdown-DOx1IBUB.js → session-countdown-StcyUU5O.js} +56 -66
- package/dist/_chunks/{signature-request-CHsM_iWi.js → signature-request-vJDSHZld.js} +2 -2
- package/dist/_chunks/{tabs-CRIDBLP7.js → tabs-Czkmw5ou.js} +2 -2
- package/dist/_chunks/{task-editor-DvwqPfFR.js → task-editor-BfXSn6U1.js} +2 -2
- package/dist/_chunks/{tasks-panel-6EzdnwT8.js → tasks-panel-DbtJS4QI.js} +2 -2
- package/dist/_chunks/{toolbar-CfdoJzMV.js → toolbar-DjG-cpD_.js} +2 -2
- package/dist/_chunks/{unit-converter-YKlHyUC2.js → unit-converter-CUAUTu2B.js} +2 -2
- package/dist/_chunks/{use-appointment-details-read-6_OmOwUs.js → use-appointment-details-read-7J0j1FP7.js} +2 -2
- package/dist/_chunks/{voice-control-panel-Be_c0CQ0.js → voice-control-panel-Cp4vs1iy.js} +2 -2
- package/dist/agent-catalog.json +282 -6
- package/dist/agent-i18n/en.json +26 -4
- package/dist/browser-support.js +1 -1
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/ai-summary-panel/ai-summary-panel.d.ts +68 -5
- package/dist/components/ai-summary-panel/index.d.ts +1 -1
- package/dist/components/ai-summary-panel/index.js +1 -1
- package/dist/components/ai-summary-panel/summary-markdown.d.ts +15 -0
- package/dist/components/appointment-details-panel/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/bill-line-table/index.js +1 -1
- package/dist/components/bill-table/index.js +1 -1
- package/dist/components/bishop-score/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/call-status-chip/call-status-chip.d.ts +30 -0
- package/dist/components/call-status-chip/index.d.ts +3 -0
- package/dist/components/call-status-chip/index.js +5 -0
- package/dist/components/calls-panel/calls-panel.agent.d.ts +4 -0
- package/dist/components/calls-panel/calls-panel.d.ts +153 -0
- package/dist/components/calls-panel/index.d.ts +4 -0
- package/dist/components/calls-panel/index.js +6 -0
- package/dist/components/chat-input/chat-input.d.ts +17 -0
- package/dist/components/chat-input/index.js +1 -1
- package/dist/components/chat-message/index.js +1 -1
- package/dist/components/communications-panel/communications-panel.d.ts +15 -3
- package/dist/components/communications-panel/index.js +1 -1
- package/dist/components/data-grid/index.js +2 -2
- package/dist/components/data-table/index.js +2 -2
- package/dist/components/document-preview/index.js +1 -1
- package/dist/components/entity-summary/entity-summary.d.ts +29 -1
- package/dist/components/entity-summary/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/heatmap/index.js +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/components/invoice-upload-list/index.js +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-summary-card/index.js +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/select/select.d.ts +8 -0
- package/dist/components/session-countdown/index.js +1 -1
- package/dist/components/skeleton-scheme/index.js +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/task-editor/index.js +1 -1
- package/dist/components/tasks-panel/index.js +1 -1
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/components/voice-control-panel/index.js +1 -1
- package/dist/core.css +1 -1
- package/dist/host-compat.css +4 -1
- package/dist/i18n/locales/ar.d.ts +72 -3
- package/dist/i18n/locales/ar.js +74 -5
- package/dist/i18n/locales/de.d.ts +72 -3
- package/dist/i18n/locales/de.js +74 -5
- package/dist/i18n/locales/el.d.ts +72 -3
- package/dist/i18n/locales/el.js +74 -5
- package/dist/i18n/locales/en.d.ts +72 -3
- package/dist/i18n/locales/en.js +73 -4
- package/dist/i18n/locales/es.d.ts +72 -3
- package/dist/i18n/locales/es.js +74 -5
- package/dist/i18n/locales/fr.d.ts +72 -3
- package/dist/i18n/locales/fr.js +74 -5
- package/dist/i18n/locales/hi.d.ts +72 -3
- package/dist/i18n/locales/hi.js +74 -5
- package/dist/i18n/locales/it.d.ts +83 -14
- package/dist/i18n/locales/it.js +84 -15
- package/dist/i18n/locales/ja.d.ts +72 -3
- package/dist/i18n/locales/ja.js +74 -5
- package/dist/i18n/locales/nl.d.ts +72 -3
- package/dist/i18n/locales/nl.js +74 -5
- package/dist/i18n/locales/pl.d.ts +72 -3
- package/dist/i18n/locales/pl.js +74 -5
- package/dist/i18n/locales/pt.d.ts +72 -3
- package/dist/i18n/locales/pt.js +74 -5
- package/dist/i18n/locales/ro.d.ts +72 -3
- package/dist/i18n/locales/ro.js +74 -5
- package/dist/i18n/locales/ru.d.ts +72 -3
- package/dist/i18n/locales/ru.js +74 -5
- package/dist/i18n/locales/sq.d.ts +72 -3
- package/dist/i18n/locales/sq.js +74 -5
- package/dist/i18n/locales/sv.d.ts +72 -3
- package/dist/i18n/locales/sv.js +74 -5
- package/dist/i18n/locales/tr.d.ts +72 -3
- package/dist/i18n/locales/tr.js +74 -5
- package/dist/i18n/locales/zh.d.ts +72 -3
- package/dist/i18n/locales/zh.js +74 -5
- package/dist/index.js +707 -702
- package/dist/locales/ar.json +74 -5
- package/dist/locales/de.json +74 -5
- package/dist/locales/el.json +74 -5
- package/dist/locales/en.json +73 -4
- package/dist/locales/es.json +74 -5
- package/dist/locales/fr.json +74 -5
- package/dist/locales/hi.json +74 -5
- package/dist/locales/it.json +84 -15
- package/dist/locales/ja.json +74 -5
- package/dist/locales/nl.json +74 -5
- package/dist/locales/pl.json +74 -5
- package/dist/locales/pt.json +74 -5
- package/dist/locales/ro.json +74 -5
- package/dist/locales/ru.json +74 -5
- package/dist/locales/sq.json +74 -5
- package/dist/locales/sv.json +74 -5
- package/dist/locales/tr.json +74 -5
- package/dist/locales/zh.json +74 -5
- package/dist/patterns/alia-assistant/index.js +1 -1
- package/dist/patterns/anamnesis/index.js +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/dist/patterns/patient-account-settings/index.js +1 -1
- package/dist/patterns/patient-check-in/index.js +1 -1
- package/dist/patterns/patient-portal/index.js +1 -1
- package/dist/patterns/patient-sign-in/index.js +2 -2
- package/dist/patterns/registration-form/index.js +1 -1
- package/dist/patterns/signature-request/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +9 -1
- package/dist/_chunks/ai-summary-panel-B70S2lgC.js +0 -455
- package/dist/_chunks/communications-panel-BKPHCiMB.js +0 -973
- package/dist/_chunks/entity-summary-CpNk6ybN.js +0 -266
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfadocs/ui-kit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.136.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "AlfaDocs shared design system — tokens, components, patterns, and translations for platform, booking, and alfascribe.",
|
|
6
6
|
"license": "BUSL-1.1",
|
|
@@ -837,6 +837,14 @@
|
|
|
837
837
|
"types": "./dist/components/communications-panel/index.d.ts",
|
|
838
838
|
"import": "./dist/components/communications-panel/index.js"
|
|
839
839
|
},
|
|
840
|
+
"./call-status-chip": {
|
|
841
|
+
"types": "./dist/components/call-status-chip/index.d.ts",
|
|
842
|
+
"import": "./dist/components/call-status-chip/index.js"
|
|
843
|
+
},
|
|
844
|
+
"./calls-panel": {
|
|
845
|
+
"types": "./dist/components/calls-panel/index.d.ts",
|
|
846
|
+
"import": "./dist/components/calls-panel/index.js"
|
|
847
|
+
},
|
|
840
848
|
"./ai-summary-panel": {
|
|
841
849
|
"types": "./dist/components/ai-summary-panel/index.d.ts",
|
|
842
850
|
"import": "./dist/components/ai-summary-panel/index.js"
|
|
@@ -1,455 +0,0 @@
|
|
|
1
|
-
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as Pe, useId as xe, useRef as o, useImperativeHandle as Te, useState as M, useEffect as F, useCallback as O, useMemo as le } from "react";
|
|
3
|
-
import { c as be } from "./index-D2ZczOXr.js";
|
|
4
|
-
import { useTranslation as ce } from "react-i18next";
|
|
5
|
-
import { u as Ne } from "./registry-DvAUVLHh.js";
|
|
6
|
-
import { g as Ae } from "./get-error-message-DbFUzuja.js";
|
|
7
|
-
import { A as Ce } from "./ai-permission-notice-C-xR2_iS.js";
|
|
8
|
-
import { A as Ee } from "./ai-credits-exhausted-notice-Lws3113e.js";
|
|
9
|
-
import { A as l } from "./alert-C4WKViaS.js";
|
|
10
|
-
import { B as te } from "./button-DohK_Ak_.js";
|
|
11
|
-
import { E as b } from "./empty-state-DwJ5YNzz.js";
|
|
12
|
-
import { E as Re } from "./entity-summary-CpNk6ybN.js";
|
|
13
|
-
import { P as ne } from "./panel-header-CbtlTe85.js";
|
|
14
|
-
import { S as ie } from "./skeleton-tTWJpvAq.js";
|
|
15
|
-
import { A as se } from "./astroid-BN4f5VXU.js";
|
|
16
|
-
import { R as ke } from "./refresh-cw-DnI0cLFC.js";
|
|
17
|
-
import { C as Be } from "./clock-Drd4Wtis.js";
|
|
18
|
-
const De = {
|
|
19
|
-
id: "ai-summary-panel",
|
|
20
|
-
// 'confirm' backs grant_consent. generate and regenerate have no dedicated
|
|
21
|
-
// capability in the closed vocabulary.
|
|
22
|
-
capabilities: ["confirm"],
|
|
23
|
-
state: {
|
|
24
|
-
status: {
|
|
25
|
-
type: "'consent-required' | 'loading' | 'ready' | 'stale' | 'insufficient-data' | 'credits-exhausted' | 'error'",
|
|
26
|
-
descriptionKey: "ui.agent.aiSummaryPanel.state.status",
|
|
27
|
-
description: "The face the panel shows.",
|
|
28
|
-
read: (t) => t.getState().status
|
|
29
|
-
},
|
|
30
|
-
ageBand: {
|
|
31
|
-
type: "'fresh' | 'old' | 'very-old' | null",
|
|
32
|
-
descriptionKey: "ui.agent.aiSummaryPanel.state.ageBand",
|
|
33
|
-
description: "How old the summary is: fresh (under 6 hours), old (6 to 24 hours) or very-old (over 24 hours). Null when there is no summary.",
|
|
34
|
-
read: (t) => t.getState().ageBand
|
|
35
|
-
},
|
|
36
|
-
sectionCount: {
|
|
37
|
-
type: "number",
|
|
38
|
-
descriptionKey: "ui.agent.aiSummaryPanel.state.sectionCount",
|
|
39
|
-
description: "How many sections the summary holds. A count only.",
|
|
40
|
-
read: (t) => t.getState().sectionCount
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
actions: {
|
|
44
|
-
grant_consent: {
|
|
45
|
-
safety: "write",
|
|
46
|
-
openWorld: !0,
|
|
47
|
-
idempotent: !0,
|
|
48
|
-
errors: [
|
|
49
|
-
"The panel is not asking for consent, is read-only or privacy mode is on.",
|
|
50
|
-
"The host could not save the consent. The panel shows the host's message."
|
|
51
|
-
],
|
|
52
|
-
descriptionKey: "ui.agent.aiSummaryPanel.actions.grantConsent",
|
|
53
|
-
description: "Record that the patient was told and agrees, then ask for the first summary. The summary spends AI credits. Only call this when the user says the patient agreed. Settles with the host's answer.",
|
|
54
|
-
invoke: (t) => t.grantConsent()
|
|
55
|
-
},
|
|
56
|
-
generate: {
|
|
57
|
-
safety: "write",
|
|
58
|
-
openWorld: !0,
|
|
59
|
-
errors: [
|
|
60
|
-
"The panel is not in the error or not-enough-data face, is read-only or privacy mode is on.",
|
|
61
|
-
"A request is already in flight."
|
|
62
|
-
],
|
|
63
|
-
descriptionKey: "ui.agent.aiSummaryPanel.actions.generate",
|
|
64
|
-
description: "Ask for a summary again after an error or when data was added. Spends AI credits. Settles with the host's answer.",
|
|
65
|
-
invoke: (t) => t.generate()
|
|
66
|
-
},
|
|
67
|
-
regenerate: {
|
|
68
|
-
safety: "write",
|
|
69
|
-
openWorld: !0,
|
|
70
|
-
errors: [
|
|
71
|
-
"The panel shows no summary, is read-only or privacy mode is on.",
|
|
72
|
-
"A request is already in flight."
|
|
73
|
-
],
|
|
74
|
-
descriptionKey: "ui.agent.aiSummaryPanel.actions.regenerate",
|
|
75
|
-
description: "Replace the summary with a new one. Spends AI credits. Settles with the host's answer.",
|
|
76
|
-
invoke: (t) => t.regenerate()
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
domHooks: {
|
|
80
|
-
root: {
|
|
81
|
-
attr: "data-component",
|
|
82
|
-
value: "ai-summary-panel",
|
|
83
|
-
description: "Marks the AiSummaryPanel region."
|
|
84
|
-
},
|
|
85
|
-
instanceId: {
|
|
86
|
-
attr: "data-component-id",
|
|
87
|
-
sourceProp: "id",
|
|
88
|
-
description: "Sourced from the id prop. Required to address a specific panel from the agent."
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}, qe = be(
|
|
92
|
-
"ds:flex ds:h-full ds:min-h-0 ds:min-w-0 ds:flex-col ds:bg-[color:var(--card)]"
|
|
93
|
-
), W = "ds:px-[var(--spacing-md)] ds:pt-[var(--spacing-md)]", oe = 36e5, de = 6, ue = 24, He = {
|
|
94
|
-
note: "aiSummaryPanel.minNote",
|
|
95
|
-
"plan-entry": "aiSummaryPanel.minPlanEntry",
|
|
96
|
-
appointment: "aiSummaryPanel.minAppointment",
|
|
97
|
-
anamnesis: "aiSummaryPanel.minAnamnesis"
|
|
98
|
-
};
|
|
99
|
-
function Ie(t, s) {
|
|
100
|
-
const d = new Date(s).getTime() - new Date(t).getTime();
|
|
101
|
-
return Number.isFinite(d) ? d > ue * oe ? "very-old" : d > de * oe ? "old" : "fresh" : "fresh";
|
|
102
|
-
}
|
|
103
|
-
const Le = Pe(
|
|
104
|
-
({
|
|
105
|
-
id: t,
|
|
106
|
-
title: s,
|
|
107
|
-
"aria-label": d,
|
|
108
|
-
locale: y,
|
|
109
|
-
nowIso: N,
|
|
110
|
-
status: n,
|
|
111
|
-
patientName: p,
|
|
112
|
-
patientHref: A,
|
|
113
|
-
generatedAtIso: g,
|
|
114
|
-
stats: me,
|
|
115
|
-
sections: C = [],
|
|
116
|
-
minimumData: E,
|
|
117
|
-
errorMessage: j,
|
|
118
|
-
privacy: m = !1,
|
|
119
|
-
readOnly: v = !1,
|
|
120
|
-
onGrantConsent: R,
|
|
121
|
-
onGenerate: k,
|
|
122
|
-
onRetry: U,
|
|
123
|
-
onOpenPatient: V,
|
|
124
|
-
className: fe,
|
|
125
|
-
...he
|
|
126
|
-
}, ye) => {
|
|
127
|
-
const { t: a, i18n: pe } = ce("ui"), B = xe(), Y = s ?? a("aiSummaryPanel.title"), $ = y ?? pe.language, D = o(null);
|
|
128
|
-
Te(ye, () => D.current, []);
|
|
129
|
-
const [q, J] = M(!1), S = o(!1), [Q, X] = M(null), w = o(!0);
|
|
130
|
-
F(() => (w.current = !0, () => {
|
|
131
|
-
w.current = !1;
|
|
132
|
-
}), []);
|
|
133
|
-
const H = (n === "ready" || n === "stale") && g ? Ie(g, N) : null, P = o(R);
|
|
134
|
-
P.current = R;
|
|
135
|
-
const f = o(k);
|
|
136
|
-
f.current = k;
|
|
137
|
-
const x = O(
|
|
138
|
-
async (r, i) => {
|
|
139
|
-
if (!S.current) {
|
|
140
|
-
S.current = !0, J(!0), X(null);
|
|
141
|
-
try {
|
|
142
|
-
await r();
|
|
143
|
-
} catch (u) {
|
|
144
|
-
throw w.current && X(Ae(u, i())), u;
|
|
145
|
-
} finally {
|
|
146
|
-
S.current = !1, w.current && J(!1);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
[]
|
|
151
|
-
), I = O(() => {
|
|
152
|
-
let r = "grant";
|
|
153
|
-
return x(
|
|
154
|
-
async () => {
|
|
155
|
-
var i, u;
|
|
156
|
-
await ((i = P.current) == null ? void 0 : i.call(P)), r = "generate", await ((u = f.current) == null ? void 0 : u.call(f, { regenerate: !1 }));
|
|
157
|
-
},
|
|
158
|
-
() => a(r === "grant" ? "aiSummaryPanel.consentSaveFailed" : "aiSummaryPanel.errorTitle")
|
|
159
|
-
);
|
|
160
|
-
}, [x, a]), T = O(
|
|
161
|
-
(r) => x(
|
|
162
|
-
async () => {
|
|
163
|
-
var i;
|
|
164
|
-
await ((i = f.current) == null ? void 0 : i.call(f, { regenerate: r }));
|
|
165
|
-
},
|
|
166
|
-
() => a("aiSummaryPanel.errorTitle")
|
|
167
|
-
),
|
|
168
|
-
[x, a]
|
|
169
|
-
), h = o({ status: n, ageBand: H, sectionCount: C.length });
|
|
170
|
-
h.current = { status: n, ageBand: H, sectionCount: C.length };
|
|
171
|
-
const L = o({ readOnly: v, privacy: m });
|
|
172
|
-
L.current = { readOnly: v, privacy: m };
|
|
173
|
-
const ge = le(() => {
|
|
174
|
-
const r = async (i) => {
|
|
175
|
-
if (L.current.privacy)
|
|
176
|
-
throw new Error("The summary is hidden by privacy mode.");
|
|
177
|
-
if (L.current.readOnly)
|
|
178
|
-
throw new Error("The panel is read-only.");
|
|
179
|
-
if (!i.includes(h.current.status))
|
|
180
|
-
throw new Error(
|
|
181
|
-
`The panel is in the ${h.current.status} face, which does not offer this.`
|
|
182
|
-
);
|
|
183
|
-
if (S.current) throw new Error("A request is already in flight.");
|
|
184
|
-
};
|
|
185
|
-
return {
|
|
186
|
-
getState: () => ({
|
|
187
|
-
status: h.current.status,
|
|
188
|
-
ageBand: h.current.ageBand,
|
|
189
|
-
sectionCount: h.current.sectionCount
|
|
190
|
-
}),
|
|
191
|
-
grantConsent: async () => {
|
|
192
|
-
await r(["consent-required"]), await I();
|
|
193
|
-
},
|
|
194
|
-
generate: async () => {
|
|
195
|
-
await r(["error", "insufficient-data"]), await T(!1);
|
|
196
|
-
},
|
|
197
|
-
regenerate: async () => {
|
|
198
|
-
await r(["ready", "stale"]), await T(!0);
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
}, [I, T]);
|
|
202
|
-
Ne(De, ge, t);
|
|
203
|
-
const Z = o(!1), z = o(!1);
|
|
204
|
-
F(() => {
|
|
205
|
-
const r = D.current;
|
|
206
|
-
if (!r) return;
|
|
207
|
-
const i = z.current && (!document.activeElement || document.activeElement === document.body);
|
|
208
|
-
if (Z.current && !i) return;
|
|
209
|
-
Z.current = !0;
|
|
210
|
-
const u = m ? null : r.querySelector('[role="checkbox"]');
|
|
211
|
-
if (n === "consent-required" && u && !i) {
|
|
212
|
-
u.focus({ preventScroll: !0 });
|
|
213
|
-
return;
|
|
214
|
-
}
|
|
215
|
-
const _ = r.querySelector("h2");
|
|
216
|
-
_ && (_.setAttribute("tabindex", "-1"), _.focus({ preventScroll: !0, focusVisible: !1 }));
|
|
217
|
-
}, [m, n]);
|
|
218
|
-
const G = m ? a("aiSummaryPanel.privacyTitle") : q && (n === "ready" || n === "stale") ? a("aiSummaryPanel.loading") : {
|
|
219
|
-
"consent-required": a("aiSummaryPanel.consentTitle"),
|
|
220
|
-
loading: a("aiSummaryPanel.loading"),
|
|
221
|
-
ready: a("aiSummaryPanel.statusReady"),
|
|
222
|
-
stale: a("aiSummaryPanel.staleTitle"),
|
|
223
|
-
"insufficient-data": a("aiSummaryPanel.insufficientTitle"),
|
|
224
|
-
"credits-exhausted": a("aiSummaryPanel.creditsExhausted"),
|
|
225
|
-
error: a("aiSummaryPanel.errorTitle")
|
|
226
|
-
}[n], [ee, ve] = M("");
|
|
227
|
-
F(() => {
|
|
228
|
-
ve(G);
|
|
229
|
-
}, [G]);
|
|
230
|
-
const Se = (r) => {
|
|
231
|
-
if (!V || !A) return;
|
|
232
|
-
const i = r.target.closest("a");
|
|
233
|
-
i && i.getAttribute("href") === A && (r.preventDefault(), V());
|
|
234
|
-
}, ae = {
|
|
235
|
-
ref: D,
|
|
236
|
-
"data-component": "ai-summary-panel",
|
|
237
|
-
"data-component-id": t,
|
|
238
|
-
"data-status": m ? "privacy" : n,
|
|
239
|
-
onFocusCapture: () => {
|
|
240
|
-
z.current = !0;
|
|
241
|
-
},
|
|
242
|
-
onBlurCapture: (r) => {
|
|
243
|
-
r.relatedTarget && (z.current = !1);
|
|
244
|
-
},
|
|
245
|
-
// The summary inside is its own region named by the title, so this
|
|
246
|
-
// region carries the longer name: two regions may not share one.
|
|
247
|
-
"aria-label": d ?? a("aiSummaryPanel.regionLabel"),
|
|
248
|
-
className: [qe(), fe].filter(Boolean).join(" "),
|
|
249
|
-
...he
|
|
250
|
-
};
|
|
251
|
-
if (m)
|
|
252
|
-
return /* @__PURE__ */ c("section", { ...ae, children: [
|
|
253
|
-
/* @__PURE__ */ e(
|
|
254
|
-
ne,
|
|
255
|
-
{
|
|
256
|
-
title: Y,
|
|
257
|
-
icon: /* @__PURE__ */ e(se, { "aria-hidden": "true" }),
|
|
258
|
-
headingId: B,
|
|
259
|
-
divider: !0
|
|
260
|
-
}
|
|
261
|
-
),
|
|
262
|
-
/* @__PURE__ */ e("span", { role: "status", className: "ds:sr-only", children: ee }),
|
|
263
|
-
/* @__PURE__ */ e("div", { className: "ds:p-[var(--spacing-md)]", children: /* @__PURE__ */ e(
|
|
264
|
-
b,
|
|
265
|
-
{
|
|
266
|
-
variant: "first-use",
|
|
267
|
-
size: "sm",
|
|
268
|
-
title: a("aiSummaryPanel.privacyTitle"),
|
|
269
|
-
description: a("aiSummaryPanel.privacyDescription")
|
|
270
|
-
}
|
|
271
|
-
) })
|
|
272
|
-
] });
|
|
273
|
-
const K = n === "ready" || n === "stale", we = K && !v && !!k, re = K && g ? /* @__PURE__ */ e(
|
|
274
|
-
ze,
|
|
275
|
-
{
|
|
276
|
-
generatedAtIso: g,
|
|
277
|
-
band: H ?? "fresh",
|
|
278
|
-
lang: $
|
|
279
|
-
}
|
|
280
|
-
) : null;
|
|
281
|
-
return /* @__PURE__ */ c("section", { ...ae, children: [
|
|
282
|
-
/* @__PURE__ */ e(
|
|
283
|
-
ne,
|
|
284
|
-
{
|
|
285
|
-
title: Y,
|
|
286
|
-
icon: /* @__PURE__ */ e(se, { "aria-hidden": "true" }),
|
|
287
|
-
headingId: B,
|
|
288
|
-
divider: !0,
|
|
289
|
-
actions: we ? /* @__PURE__ */ e(
|
|
290
|
-
te,
|
|
291
|
-
{
|
|
292
|
-
type: "button",
|
|
293
|
-
size: "sm",
|
|
294
|
-
intent: "ghost",
|
|
295
|
-
startIcon: /* @__PURE__ */ e(ke, { "aria-hidden": "true" }),
|
|
296
|
-
loading: q,
|
|
297
|
-
onClick: () => {
|
|
298
|
-
T(!0).catch(() => {
|
|
299
|
-
});
|
|
300
|
-
},
|
|
301
|
-
children: a("aiSummaryPanel.regenerate")
|
|
302
|
-
}
|
|
303
|
-
) : void 0
|
|
304
|
-
}
|
|
305
|
-
),
|
|
306
|
-
/* @__PURE__ */ e("span", { role: "status", className: "ds:sr-only", children: ee }),
|
|
307
|
-
/* @__PURE__ */ c(
|
|
308
|
-
"div",
|
|
309
|
-
{
|
|
310
|
-
tabIndex: 0,
|
|
311
|
-
role: "group",
|
|
312
|
-
"aria-labelledby": B,
|
|
313
|
-
onClick: Se,
|
|
314
|
-
className: "ds:min-h-0 ds:flex-1 ds:overflow-y-auto ds:focus-visible:outline-[length:var(--focus-ring-width)] ds:focus-visible:outline-solid ds:focus-visible:outline-[color:var(--ring)] ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]",
|
|
315
|
-
children: [
|
|
316
|
-
n === "consent-required" ? /* @__PURE__ */ e("div", { className: "ds:p-[var(--spacing-md)]", children: /* @__PURE__ */ e(
|
|
317
|
-
Ce,
|
|
318
|
-
{
|
|
319
|
-
granted: !1,
|
|
320
|
-
canGrant: !v && !!R,
|
|
321
|
-
pending: q,
|
|
322
|
-
headingLevel: 3,
|
|
323
|
-
className: "ds:[&_p:not(:last-child)]:mb-[var(--spacing-sm)]",
|
|
324
|
-
copy: {
|
|
325
|
-
title: a("aiSummaryPanel.consentTitle"),
|
|
326
|
-
descriptionRequired: a("aiSummaryPanel.consentDescription"),
|
|
327
|
-
confirmLabel: a("aiSummaryPanel.consentCheckbox"),
|
|
328
|
-
grantButton: a("aiSummaryPanel.generate"),
|
|
329
|
-
pendingLabel: a("aiSummaryPanel.loading")
|
|
330
|
-
},
|
|
331
|
-
onGrantConsent: () => {
|
|
332
|
-
I().catch(() => {
|
|
333
|
-
});
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
) }) : null,
|
|
337
|
-
n === "loading" ? /* @__PURE__ */ e(
|
|
338
|
-
"div",
|
|
339
|
-
{
|
|
340
|
-
"data-ai-summary-state": "loading",
|
|
341
|
-
"aria-hidden": "true",
|
|
342
|
-
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:p-[var(--spacing-md)]",
|
|
343
|
-
children: ["a", "b", "c"].map((r, i) => /* @__PURE__ */ c(
|
|
344
|
-
"div",
|
|
345
|
-
{
|
|
346
|
-
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]",
|
|
347
|
-
children: [
|
|
348
|
-
/* @__PURE__ */ e(ie, { variant: "text", size: "sm", width: "40%", stagger: i }),
|
|
349
|
-
/* @__PURE__ */ e(ie, { variant: "text", size: "sm", lines: 3, stagger: i })
|
|
350
|
-
]
|
|
351
|
-
},
|
|
352
|
-
r
|
|
353
|
-
))
|
|
354
|
-
}
|
|
355
|
-
) : null,
|
|
356
|
-
n === "stale" ? /* @__PURE__ */ e("div", { className: W, children: /* @__PURE__ */ c(l, { variant: "warning", announce: "off", "data-ai-summary-stale": "", children: [
|
|
357
|
-
/* @__PURE__ */ e(l.Title, { as: "h3", children: a("aiSummaryPanel.staleTitle") }),
|
|
358
|
-
/* @__PURE__ */ e(l.Description, { children: a("aiSummaryPanel.staleDescription") })
|
|
359
|
-
] }) }) : null,
|
|
360
|
-
re ? /* @__PURE__ */ e("div", { className: W, children: re }) : null,
|
|
361
|
-
K ? /* @__PURE__ */ e(
|
|
362
|
-
Re,
|
|
363
|
-
{
|
|
364
|
-
showHeader: !1,
|
|
365
|
-
entityName: p,
|
|
366
|
-
entityHref: A,
|
|
367
|
-
stats: me,
|
|
368
|
-
sections: C,
|
|
369
|
-
locale: $,
|
|
370
|
-
disclaimer: a("aiSummaryPanel.disclaimer")
|
|
371
|
-
}
|
|
372
|
-
) : null,
|
|
373
|
-
n === "insufficient-data" ? /* @__PURE__ */ e(
|
|
374
|
-
"div",
|
|
375
|
-
{
|
|
376
|
-
"data-ai-summary-state": "insufficient-data",
|
|
377
|
-
className: "ds:p-[var(--spacing-md)]",
|
|
378
|
-
children: /* @__PURE__ */ c(b, { variant: "first-use", size: "sm", headingLevel: 3, children: [
|
|
379
|
-
/* @__PURE__ */ e(b.Title, { children: a("aiSummaryPanel.insufficientTitle") }),
|
|
380
|
-
/* @__PURE__ */ e(b.Description, { children: a("aiSummaryPanel.insufficientDescription") }),
|
|
381
|
-
E && E.length > 0 ? /* @__PURE__ */ e("ul", { className: "ds:m-0 ds:flex ds:list-disc ds:flex-col ds:gap-[var(--spacing-2xs)] ds:ps-[var(--spacing-md)] ds:text-start type-body-sm", children: E.map((r) => /* @__PURE__ */ e("li", { children: a(He[r]) }, r)) }) : null
|
|
382
|
-
] })
|
|
383
|
-
}
|
|
384
|
-
) : null,
|
|
385
|
-
n === "credits-exhausted" ? /* @__PURE__ */ e(
|
|
386
|
-
"div",
|
|
387
|
-
{
|
|
388
|
-
"data-ai-summary-state": "credits-exhausted",
|
|
389
|
-
className: "ds:p-[var(--spacing-md)]",
|
|
390
|
-
children: /* @__PURE__ */ e(Ee, { headingLevel: 3, announce: "off" })
|
|
391
|
-
}
|
|
392
|
-
) : null,
|
|
393
|
-
n === "error" ? /* @__PURE__ */ e(
|
|
394
|
-
"div",
|
|
395
|
-
{
|
|
396
|
-
"data-ai-summary-state": "error",
|
|
397
|
-
className: "ds:p-[var(--spacing-md)]",
|
|
398
|
-
children: /* @__PURE__ */ c(l, { variant: "error", announce: "off", children: [
|
|
399
|
-
/* @__PURE__ */ e(l.Title, { as: "h3", children: a("aiSummaryPanel.errorTitle") }),
|
|
400
|
-
j ? /* @__PURE__ */ e(l.Description, { children: j }) : null,
|
|
401
|
-
U ? /* @__PURE__ */ e(l.Action, { children: /* @__PURE__ */ e(
|
|
402
|
-
te,
|
|
403
|
-
{
|
|
404
|
-
type: "button",
|
|
405
|
-
intent: "secondary",
|
|
406
|
-
size: "sm",
|
|
407
|
-
onClick: U,
|
|
408
|
-
children: a("aiSummaryPanel.retry")
|
|
409
|
-
}
|
|
410
|
-
) }) : null
|
|
411
|
-
] })
|
|
412
|
-
}
|
|
413
|
-
) : null,
|
|
414
|
-
Q ? /* @__PURE__ */ e("div", { className: W, children: /* @__PURE__ */ e(l, { variant: "error", "data-ai-summary-action-error": "", children: /* @__PURE__ */ e(l.Description, { children: Q }) }) }) : null
|
|
415
|
-
]
|
|
416
|
-
}
|
|
417
|
-
)
|
|
418
|
-
] });
|
|
419
|
-
}
|
|
420
|
-
);
|
|
421
|
-
Le.displayName = "AiSummaryPanel";
|
|
422
|
-
function ze({
|
|
423
|
-
generatedAtIso: t,
|
|
424
|
-
band: s,
|
|
425
|
-
lang: d
|
|
426
|
-
}) {
|
|
427
|
-
const { t: y } = ce("ui"), N = le(() => {
|
|
428
|
-
const p = new Date(t);
|
|
429
|
-
return Number.isNaN(p.getTime()) ? "" : new Intl.DateTimeFormat(d, {
|
|
430
|
-
dateStyle: "medium",
|
|
431
|
-
timeStyle: "short"
|
|
432
|
-
}).format(p);
|
|
433
|
-
}, [t, d]);
|
|
434
|
-
return /* @__PURE__ */ c(
|
|
435
|
-
"div",
|
|
436
|
-
{
|
|
437
|
-
"data-ai-summary-age": s,
|
|
438
|
-
className: `ds:flex ds:flex-col ds:gap-[var(--spacing-2xs)] type-meta ${s === "very-old" ? "ds:text-[color:var(--destructive)]" : s === "old" ? "ds:text-[color:var(--warning-foreground)]" : "ds:text-[color:var(--muted-foreground)]"}`,
|
|
439
|
-
children: [
|
|
440
|
-
/* @__PURE__ */ c("span", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-2xs)]", children: [
|
|
441
|
-
/* @__PURE__ */ e(Be, { "aria-hidden": "true", className: "ds:size-3.5 ds:shrink-0" }),
|
|
442
|
-
/* @__PURE__ */ e("span", { children: y("aiSummaryPanel.generatedAt", { date: N }) })
|
|
443
|
-
] }),
|
|
444
|
-
s !== "fresh" ? /* @__PURE__ */ e("span", { children: y("aiSummaryPanel.ageNotice", {
|
|
445
|
-
hours: s === "very-old" ? ue : de
|
|
446
|
-
}) }) : null
|
|
447
|
-
]
|
|
448
|
-
}
|
|
449
|
-
);
|
|
450
|
-
}
|
|
451
|
-
export {
|
|
452
|
-
Le as A,
|
|
453
|
-
De as a
|
|
454
|
-
};
|
|
455
|
-
//# sourceMappingURL=ai-summary-panel-B70S2lgC.js.map
|