@mindbill/react 0.77.45 → 0.77.46

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/index.js CHANGED
@@ -1077,7 +1077,7 @@ function organizationProfileOptions(profile) {
1077
1077
 
1078
1078
  // src/index.tsx
1079
1079
  import "@mindbill/embed";
1080
- import { createElement, useEffect as useEffect35, useRef as useRef30 } from "react";
1080
+ import { createElement, useEffect as useEffect35, useRef as useRef31 } from "react";
1081
1081
 
1082
1082
  // src/claim-form-summary.tsx
1083
1083
  import { jsx as jsx5 } from "react/jsx-runtime";
@@ -10042,7 +10042,7 @@ function BillSubmissionForm({
10042
10042
  import { useId as useId9, useMemo as useMemo13, useState as useState33 } from "react";
10043
10043
 
10044
10044
  // src/rfa-dashboard.tsx
10045
- import { useEffect as useEffect26, useId as useId8, useMemo as useMemo12, useRef as useRef23, useState as useState32 } from "react";
10045
+ import { useEffect as useEffect26, useId as useId8, useMemo as useMemo12, useRef as useRef24, useState as useState32 } from "react";
10046
10046
  import { getRfaLifecycleStatus as getRfaLifecycleStatus4, RFA_LIFECYCLE_LABELS as RFA_LIFECYCLE_LABELS5, createRfaClient as createRfaClient4, createBillReferenceClient as createBillReferenceClient2, createOrganizationClient as createOrganizationClient4 } from "@mindbill/browser";
10047
10047
 
10048
10048
  // src/rfa-display.tsx
@@ -10519,6 +10519,7 @@ function TreatmentDraftShell({ title, description, children, hideHeading = false
10519
10519
  .mbtd .mbrfa-template-save{display:grid;grid-template-columns:minmax(0,420px);gap:10px 16px;margin-top:10px}.mbtd .mbrfa-template-save>label{display:grid;gap:4px;font-size:12px;color:var(--mb-muted)}.mbtd .mbrfa-template-save>.mbrfa-check{display:flex;flex-direction:row;align-items:center;gap:8px;cursor:pointer}.mbtd .mbrfa-template-save>.mbrfa-check>input{width:16px;height:16px;min-height:16px;margin:0;padding:0;flex:0 0 16px;accent-color:var(--mb-accent)}.mbtd .mbrfa-template-save>:is(.mbrfa-check,.mbrfa-section-actions){grid-column:1/-1;margin-top:0;padding-top:0;border-top:0}
10520
10520
  @media(max-width:760px){.mbtd .mbrfa-template-save{grid-template-columns:minmax(0,1fr)}}
10521
10521
  .mbtd .mbrfa-form-grid>.mbrfa-row-start{grid-column:1/span 3}.mbtd .mbrfa-form-grid textarea[rows="2"]{min-height:44px}
10522
+ .mbtd .mbrfa-doc-hint{margin:0 0 12px;font-size:12px;color:var(--mb-muted)}
10522
10523
  .mbtd .mbrfa-treatments{display:grid;gap:14px}.mbtd .mbrfa-treatment+.mbrfa-treatment{padding-top:16px;border-top:1px solid var(--mb-border)}
10523
10524
  .mbtd .mbrfa-treatment-head{display:flex;align-items:center;gap:14px;margin-bottom:10px;font-size:13px}.mbtd .mbrfa-treatment-head>strong{font-weight:600;margin-right:auto}.mbtd button.mbrfa-link.mbrfa-link.mbrfa-treatment-remove{color:var(--mb-danger,#b42318)}
10524
10525
  .mbtd .mbrfa-add-treatment{display:block;width:100%;min-height:44px;border:1px dashed color-mix(in srgb,var(--mb-accent) 55%,var(--mb-border));background:color-mix(in srgb,var(--mb-accent) 5%,var(--mb-surface));color:var(--mb-accent);font-weight:600;text-align:center;cursor:pointer}.mbtd .mbrfa-add-treatment:hover:not(:disabled){background:color-mix(in srgb,var(--mb-accent) 10%,var(--mb-surface))}
@@ -12778,7 +12779,7 @@ function RfaPracticePicker({ profile, value, onChange, managePracticeHref, manag
12778
12779
  import { useEffect as useEffect22, useId as useId7, useState as useState25 } from "react";
12779
12780
 
12780
12781
  // src/rfa-draft-fields.tsx
12781
- import { useEffect as useEffect21, useId as useId6, useState as useState24 } from "react";
12782
+ import { useEffect as useEffect21, useId as useId6, useRef as useRef19, useState as useState24 } from "react";
12782
12783
  import { Fragment as Fragment22, jsx as jsx39, jsxs as jsxs37 } from "react/jsx-runtime";
12783
12784
  function RfaContactFields({ title, value, onChange }) {
12784
12785
  return /* @__PURE__ */ jsxs37("fieldset", { children: [
@@ -12800,7 +12801,7 @@ function RfaContactFields({ title, value, onChange }) {
12800
12801
  ] });
12801
12802
  }
12802
12803
  var diagnosisCache = /* @__PURE__ */ new WeakMap();
12803
- function RfaDiagnosisFields({ code, description, onChange, search, officialForm = false }) {
12804
+ function RfaDiagnosisFields({ code, description, onChange, search, officialForm = false, savedCodes = [] }) {
12804
12805
  const id = useId6();
12805
12806
  const [query, setQuery] = useState24("");
12806
12807
  const [results, setResults] = useState24([]);
@@ -12844,10 +12845,28 @@ function RfaDiagnosisFields({ code, description, onChange, search, officialForm
12844
12845
  clearTimeout(timer);
12845
12846
  };
12846
12847
  }, [query, search]);
12848
+ const resolved = useRef19(/* @__PURE__ */ new Set());
12849
+ const [resolving, setResolving] = useState24(false);
12850
+ useEffect21(() => {
12851
+ if (!officialForm || !search || !code || description || manualDiagnosis || resolved.current.has(code)) return;
12852
+ resolved.current.add(code);
12853
+ let active = true;
12854
+ setResolving(true);
12855
+ void search(code).then((items) => {
12856
+ const match = items.find((item) => item.code.replace(".", "").toUpperCase() === code.replace(".", "").toUpperCase());
12857
+ if (active && match) onChange({ diagnosisCode: match.code, diagnosisDescription: match.description });
12858
+ }).catch(() => void 0).finally(() => {
12859
+ if (active) setResolving(false);
12860
+ });
12861
+ return () => {
12862
+ active = false;
12863
+ };
12864
+ }, [code, description, search, officialForm, manualDiagnosis]);
12847
12865
  if (officialForm && search) {
12848
12866
  const typed = query.trim().toUpperCase(), known = results.some((item) => item.code.toUpperCase() === typed);
12849
12867
  const options = [
12850
12868
  ...code && !typed && !results.some((item) => item.code === code) ? [{ id: code, label: code, ...description ? { detail: description } : {} }] : [],
12869
+ ...!typed ? savedCodes.filter((saved) => saved && saved !== code).map((saved) => ({ id: `saved:${saved}`, label: saved, detail: "Saved on this injury" })) : [],
12851
12870
  ...results.map((item) => ({ id: item.code, label: item.code, detail: item.description })),
12852
12871
  .../^[A-Z]\d[0-9A-Z](\.?[0-9A-Z]{1,4})?$/.test(typed) && !known && typed !== code ? [{ id: `entered:${typed}`, label: `Use ${typed}`, detail: "Enter the diagnosis yourself" }] : []
12853
12872
  ];
@@ -12871,11 +12890,12 @@ function RfaDiagnosisFields({ code, description, onChange, search, officialForm
12871
12890
  const item = results.find((item2) => item2.code === value);
12872
12891
  if (item) onChange({ diagnosisCode: item.code, diagnosisDescription: item.description });
12873
12892
  else if (value.startsWith("entered:")) onChange({ diagnosisCode: value.slice(8), diagnosisDescription: "" });
12893
+ else if (value.startsWith("saved:")) onChange({ diagnosisCode: value.slice(6), diagnosisDescription: "" });
12874
12894
  setQuery("");
12875
12895
  }
12876
12896
  }
12877
12897
  ) }) }),
12878
- code && !listed && (manualDiagnosis || !description) ? /* @__PURE__ */ jsxs37("label", { className: "mbrfa-s3", children: [
12898
+ code && !listed && !resolving && (manualDiagnosis || !description) ? /* @__PURE__ */ jsxs37("label", { className: "mbrfa-s3", children: [
12879
12899
  /* @__PURE__ */ jsxs37("span", { children: [
12880
12900
  "Diagnosis",
12881
12901
  /* @__PURE__ */ jsx39(RfaRequired, {})
@@ -13160,12 +13180,12 @@ function RfaTemplateBar({ templates, items, renderingProviderId, physicianName,
13160
13180
  }
13161
13181
 
13162
13182
  // src/rfa-document-drop.tsx
13163
- import { useRef as useRef19, useState as useState27 } from "react";
13183
+ import { useRef as useRef20, useState as useState27 } from "react";
13164
13184
  import { jsx as jsx42, jsxs as jsxs40 } from "react/jsx-runtime";
13165
13185
  var size = (bytes) => bytes >= 1048576 ? `${(bytes / 1048576).toFixed(1)} MB` : `${Math.max(1, Math.round(bytes / 1024))} KB`;
13166
13186
  var isPdf = (file) => file.type === "application/pdf" || /\.pdf$/i.test(file.name);
13167
13187
  function RfaDocumentDrop({ files, onChange, disabled }) {
13168
- const input = useRef19(null);
13188
+ const input = useRef20(null);
13169
13189
  const [over, setOver] = useState27(false);
13170
13190
  const [skipped, setSkipped] = useState27(0);
13171
13191
  const add = (chosen) => {
@@ -13228,7 +13248,7 @@ function RfaDocumentDrop({ files, onChange, disabled }) {
13228
13248
  }
13229
13249
 
13230
13250
  // src/rfa-draft-form.tsx
13231
- import { useEffect as useEffect23, useRef as useRef20, useState as useState28 } from "react";
13251
+ import { useEffect as useEffect23, useRef as useRef21, useState as useState28 } from "react";
13232
13252
  import { Fragment as Fragment23, jsx as jsx43, jsxs as jsxs41 } from "react/jsx-runtime";
13233
13253
  function normalizeRfaDraft(draft2) {
13234
13254
  const copy = structuredClone(draft2);
@@ -13296,7 +13316,7 @@ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetail
13296
13316
  useEffect23(() => {
13297
13317
  if (officialForm && returnEmail && !physicianEmail) setDraft((current) => current.requestingPractice?.email?.trim() ? current : { ...current, requestingPractice: { ...current.requestingPractice, email: returnEmail } });
13298
13318
  }, [officialForm, returnEmail, physicianEmail, savedDraft.requestingPractice?.email]);
13299
- const filledEmail = useRef20(void 0);
13319
+ const filledEmail = useRef21(void 0);
13300
13320
  useEffect23(() => {
13301
13321
  if (!officialForm || !physicianEmail) return;
13302
13322
  const previous = filledEmail.current;
@@ -13324,7 +13344,7 @@ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetail
13324
13344
  const practiceManual = practiceManualChoice ?? (organizationProfile ? savedPractices.length === 0 || typedPractice && !savedPractices.some((provider) => provider.name === savedDraft.requestingPractice?.name) : !profilePending);
13325
13345
  const [administratorOverride, setAdministratorOverride] = useState28(null);
13326
13346
  const identityKey = `${identity?.claimId ?? ""}:${identity?.claimsAdminId ?? ""}`;
13327
- const previousClaim = useRef20(identityKey);
13347
+ const previousClaim = useRef21(identityKey);
13328
13348
  useEffect23(() => {
13329
13349
  if (previousClaim.current !== identityKey) {
13330
13350
  setAdministratorOverride(null);
@@ -13345,7 +13365,7 @@ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetail
13345
13365
  else delete draft2.claimsAdminId;
13346
13366
  }
13347
13367
  const [intent, setIntent] = useState28("save");
13348
- const intentRef = useRef20(intent);
13368
+ const intentRef = useRef21(intent);
13349
13369
  const chooseIntent = (value) => {
13350
13370
  intentRef.current = value;
13351
13371
  setIntent(value);
@@ -13374,7 +13394,11 @@ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetail
13374
13394
  }) }));
13375
13395
  };
13376
13396
  const supportingDocumentFields = supportingDocuments && officialForm ? /* @__PURE__ */ jsxs41("fieldset", { disabled: locked, children: [
13377
- /* @__PURE__ */ jsx43("legend", { children: "Supporting documents" }),
13397
+ /* @__PURE__ */ jsxs41("legend", { children: [
13398
+ "Supporting documents",
13399
+ /* @__PURE__ */ jsx43(RfaRequired, {})
13400
+ ] }),
13401
+ /* @__PURE__ */ jsx43("p", { className: "mbrfa-doc-hint", children: "A request must be sent with the report that supports it: a PR-2, Doctor\\u2019s First Report, or narrative report." }),
13378
13402
  /* @__PURE__ */ jsx43(RfaDocumentDrop, { files: supportingDocuments.files, onChange: supportingDocuments.onChange, disabled: locked })
13379
13403
  ] }) : supportingDocuments ? /* @__PURE__ */ jsxs41("fieldset", { disabled: locked, children: [
13380
13404
  /* @__PURE__ */ jsx43("legend", { children: "Supporting documents" }),
@@ -13398,7 +13422,7 @@ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetail
13398
13422
  event.preventDefault();
13399
13423
  if (locked) return;
13400
13424
  const next = normalizeRfaDraft(draft2);
13401
- void action.save(next, validateRfaDraft(next) ?? (officialForm && intentRef.current === "review" && !next.requestingPractice?.fax?.trim() ? "Requesting Physician fax number is required." : null));
13425
+ void action.save(next, validateRfaDraft(next) ?? (officialForm && intentRef.current === "review" && !next.requestingPractice?.fax?.trim() ? "Requesting Physician fax number is required." : officialForm && intentRef.current === "review" && supportingDocuments && !supportingDocuments.files.length ? "Attach the report that supports this request before submitting." : null));
13402
13426
  };
13403
13427
  const saveError = action.error ? /* @__PURE__ */ jsxs41("p", { role: "alert", children: [
13404
13428
  action.error,
@@ -13503,7 +13527,7 @@ function RfaDraftForm({ initialDraft, identity, officialForm = false, formDetail
13503
13527
  /* @__PURE__ */ jsx43("button", { type: "button", className: "mbrfa-link mbrfa-treatment-remove", "aria-label": `Remove treatment ${index + 1}`, onClick: () => update({ items: draft2.items.filter((_, position) => position !== index) }), children: "Remove" })
13504
13528
  ] }) : null,
13505
13529
  /* @__PURE__ */ jsxs41("div", { className: "mbrfa-form-grid", children: [
13506
- /* @__PURE__ */ jsx43(RfaDiagnosisFields, { officialForm: true, code: item.diagnosisCode, ...item.diagnosisDescription !== void 0 ? { description: item.diagnosisDescription } : {}, ...searchDiagnosisCodes ? { search: searchDiagnosisCodes } : {}, onChange: (value) => updateItem(index, value) }),
13530
+ /* @__PURE__ */ jsx43(RfaDiagnosisFields, { officialForm: true, savedCodes: savedDiagnosisCodes, code: item.diagnosisCode, ...item.diagnosisDescription !== void 0 ? { description: item.diagnosisDescription } : {}, ...searchDiagnosisCodes ? { search: searchDiagnosisCodes } : {}, onChange: (value) => updateItem(index, value) }),
13507
13531
  /* @__PURE__ */ jsxs41("label", { className: "mbrfa-s3 mbrfa-row-start", children: [
13508
13532
  /* @__PURE__ */ jsxs41("span", { children: [
13509
13533
  "Service/Good Requested",
@@ -14040,7 +14064,7 @@ function rfaDraftReplacement(draft2, expectedRevision) {
14040
14064
  }
14041
14065
 
14042
14066
  // src/rfa-lifecycle-controls.tsx
14043
- import { useEffect as useEffect25, useMemo as useMemo11, useRef as useRef21, useState as useState30 } from "react";
14067
+ import { useEffect as useEffect25, useMemo as useMemo11, useRef as useRef22, useState as useState30 } from "react";
14044
14068
  import { createRfaClient as createRfaClient3, createRfaLifecycleClient as createRfaLifecycleClient3 } from "@mindbill/browser";
14045
14069
  import { Fragment as Fragment25, jsx as jsx45, jsxs as jsxs43 } from "react/jsx-runtime";
14046
14070
  var text2 = (form, name) => String(form.get(name) ?? "").trim();
@@ -14091,9 +14115,9 @@ function LifecycleContent({ rfa: providedRfa, options, permissions = [], onUpdat
14091
14115
  };
14092
14116
  }, [records, rfa.id, responseDocument, rfa.documents, previewReload]);
14093
14117
  const [outcomes, setOutcomes] = useState30({});
14094
- const alive = useRef21(true);
14095
- const pending = useRef21(false);
14096
- const keys = useRef21(/* @__PURE__ */ new Map());
14118
+ const alive = useRef22(true);
14119
+ const pending = useRef22(false);
14120
+ const keys = useRef22(/* @__PURE__ */ new Map());
14097
14121
  useEffect25(() => {
14098
14122
  alive.current = true;
14099
14123
  return () => {
@@ -14524,7 +14548,7 @@ function FollowUpForm({ task, selected, editable, disabled, onSave, onReview, ha
14524
14548
  }
14525
14549
 
14526
14550
  // src/rfa-provider-signature-setup.tsx
14527
- import { useRef as useRef22, useState as useState31 } from "react";
14551
+ import { useRef as useRef23, useState as useState31 } from "react";
14528
14552
  import { jsx as jsx46, jsxs as jsxs44 } from "react/jsx-runtime";
14529
14553
  function RfaProviderSignatureSetup(props) {
14530
14554
  return /* @__PURE__ */ jsx46(SignatureForm, { ...props }, props.renderingProviderId);
@@ -14535,7 +14559,7 @@ function SignatureForm({ client, renderingProviderId, providerName, disabled, on
14535
14559
  const [authorized, setAuthorized] = useState31(false);
14536
14560
  const [busy, setBusy] = useState31(false);
14537
14561
  const [error, setError] = useState31("");
14538
- const attempt = useRef22(null);
14562
+ const attempt = useRef23(null);
14539
14563
  return /* @__PURE__ */ jsx46("form", { onSubmit: async (event) => {
14540
14564
  event.preventDefault();
14541
14565
  if (busy || disabled || !file || !authorized || !actor.trim() || !client.saveProviderSignature) return;
@@ -14614,7 +14638,7 @@ function RfaDashboard({ sessionEndpoint, getSession, apiBaseUrl, fetch: fetchOve
14614
14638
  return /* @__PURE__ */ jsx47(RfaDashboardContent, { ...props, ...patientId ? { patientId } : {}, ...claimId ? { claimId } : {}, ...renderingProviderId ? { renderingProviderId } : {}, client, signatureClient, options }, `${identity.key}:${patientId ?? ""}:${claimId ?? ""}:${renderingProviderId ?? ""}`);
14615
14639
  }
14616
14640
  function RfaDashboardContent({ client, signatureClient, options, patientId, claimId, renderingProviderId, initialDraft, initialView = "overview", initialOverviewView, initialStatus = "", initialAgingBucket = "", taskPresentation, taskQuery: taskQuery2, renderTaskIdentity, navigation, permissions = [], canCreateClaim = false, renderClaimSelector, renderProviderSelector, officialForm = false, managePracticeHref, onEditPractice, onAddPractice, onEditLocation, treatmentTemplates, onSaveTreatmentTemplate, onManageTreatmentTemplates, savedProfileChanges, manageLocationsHref, onPreviewRequest, canManageProviderSignatures = false, environment = "sandbox", actorReference, onCreated, onContinue, selectedRfaId, selectedTreatmentId, selectedResponseDocumentId: controlledResponseDocumentId, onSelectRfa, getRfaHref, getPatientHref, getClaimHref, getProviderHref, formPreviewUrl, hideBackButton = false, hideHeading = false, layout = "classic", ...appearance }) {
14617
- const active = useRef23(true);
14641
+ const active = useRef24(true);
14618
14642
  useEffect26(() => {
14619
14643
  active.current = true;
14620
14644
  return () => {
@@ -14683,7 +14707,7 @@ function RfaDashboardContent({ client, signatureClient, options, patientId, clai
14683
14707
  };
14684
14708
  }, [options, creating, selected]);
14685
14709
  const [loading, setLoading] = useState32(true);
14686
- const createKeys = useRef23(/* @__PURE__ */ new Map());
14710
+ const createKeys = useRef24(/* @__PURE__ */ new Map());
14687
14711
  useEffect26(() => {
14688
14712
  const timer = setTimeout(() => {
14689
14713
  setSearch(searchInput.trim());
@@ -14893,17 +14917,17 @@ function RfaDetail({ layout, id, selectedItem, selectedResponseDocumentId, clien
14893
14917
  useEffect26(() => {
14894
14918
  if (selectedItem || selectedResponseDocumentId) setDetailTab("details");
14895
14919
  }, [selectedResponseDocumentId, selectedItem]);
14896
- const responseFocused = useRef23(false);
14920
+ const responseFocused = useRef24(false);
14897
14921
  useEffect26(() => {
14898
14922
  if (simple && rfa && selectedResponseDocumentId && !responseFocused.current) {
14899
14923
  responseFocused.current = true;
14900
14924
  document.getElementById(`${tabId}-review`)?.scrollIntoView?.({ block: "start" });
14901
14925
  }
14902
14926
  }, [simple, rfa, selectedResponseDocumentId, tabId]);
14903
- const alive = useRef23(true);
14904
- const pending = useRef23(false);
14905
- const loadGeneration = useRef23(0);
14906
- const keys = useRef23(/* @__PURE__ */ new Map());
14927
+ const alive = useRef24(true);
14928
+ const pending = useRef24(false);
14929
+ const loadGeneration = useRef24(0);
14930
+ const keys = useRef24(/* @__PURE__ */ new Map());
14907
14931
  const [descriptions2, setDescriptions] = useState32({});
14908
14932
  const [preview, setPreview] = useState32(null);
14909
14933
  const [previewPdf, setPreviewPdf] = useState32(null);
@@ -14946,7 +14970,7 @@ function RfaDetail({ layout, id, selectedItem, selectedResponseDocumentId, clien
14946
14970
  active = false;
14947
14971
  };
14948
14972
  }, [client, id, reload]);
14949
- const currentRfa = useRef23(rfa);
14973
+ const currentRfa = useRef24(rfa);
14950
14974
  currentRfa.current = rfa;
14951
14975
  useEffect26(() => {
14952
14976
  let active = true;
@@ -14978,7 +15002,7 @@ function RfaDetail({ layout, id, selectedItem, selectedResponseDocumentId, clien
14978
15002
  document.removeEventListener("visibilitychange", resume);
14979
15003
  };
14980
15004
  }, [client, id, editing]);
14981
- const focusedTreatment = useRef23(null);
15005
+ const focusedTreatment = useRef24(null);
14982
15006
  useEffect26(() => {
14983
15007
  if (!rfa || !selectedItem || focusedTreatment.current === selectedItem) return;
14984
15008
  const element = document.getElementById(`rfa-treatment-${selectedItem}`);
@@ -17013,7 +17037,7 @@ function ConnectedPaymentReview({ initialQuery, onSelectBill, onPostPayment, app
17013
17037
  }
17014
17038
 
17015
17039
  // src/notification-settings.tsx
17016
- import { useEffect as useEffect29, useId as useId10, useRef as useRef24, useState as useState36 } from "react";
17040
+ import { useEffect as useEffect29, useId as useId10, useRef as useRef25, useState as useState36 } from "react";
17017
17041
  import { Fragment as Fragment31, jsx as jsx56, jsxs as jsxs53 } from "react/jsx-runtime";
17018
17042
  function defaultNotificationPreferences() {
17019
17043
  return { enabled: false, statusUpdates: false, agingDays: [], quietHours: true, reportDigest: "off" };
@@ -17055,7 +17079,7 @@ function NotificationSettingsSession({ adapter, appearance, className, style, on
17055
17079
  const [notice, setNotice] = useState36("");
17056
17080
  const [failed, setFailed] = useState36(false);
17057
17081
  const [reload, setReload] = useState36(0);
17058
- const request = useRef24(0);
17082
+ const request = useRef25(0);
17059
17083
  useEffect29(() => {
17060
17084
  const current = ++request.current;
17061
17085
  setPhase("loading");
@@ -17199,7 +17223,7 @@ function NotificationSettingsSession({ adapter, appearance, className, style, on
17199
17223
  }
17200
17224
 
17201
17225
  // src/notification-recipients.tsx
17202
- import { useEffect as useEffect30, useId as useId11, useRef as useRef25, useState as useState37 } from "react";
17226
+ import { useEffect as useEffect30, useId as useId11, useRef as useRef26, useState as useState37 } from "react";
17203
17227
  import { jsx as jsx57, jsxs as jsxs54 } from "react/jsx-runtime";
17204
17228
  function notificationRecipientInvitation(input, requestId) {
17205
17229
  const preferences = notificationSettingsUpdate({ ...input, enabled: false }, false);
@@ -17240,8 +17264,8 @@ function RecipientSettingsSession({ adapter, appearance, className, style }) {
17240
17264
  const [notice, setNotice] = useState37("");
17241
17265
  const [failed, setFailed] = useState37(false);
17242
17266
  const [hasReceipt, setHasReceipt] = useState37(false);
17243
- const generation = useRef25(0);
17244
- const pending = useRef25(null);
17267
+ const generation = useRef26(0);
17268
+ const pending = useRef26(null);
17245
17269
  useEffect30(() => {
17246
17270
  const current = ++generation.current;
17247
17271
  setBusy(true);
@@ -17399,7 +17423,7 @@ import {
17399
17423
  useCallback as useCallback4,
17400
17424
  useEffect as useEffect31,
17401
17425
  useMemo as useMemo16,
17402
- useRef as useRef26,
17426
+ useRef as useRef27,
17403
17427
  useState as useState38
17404
17428
  } from "react";
17405
17429
  import {
@@ -17550,11 +17574,11 @@ function useBillStatus({
17550
17574
  const [error, setError] = useState38(null);
17551
17575
  const [isLoading, setIsLoading] = useState38(enabled && !initialData);
17552
17576
  const [isRefreshing, setIsRefreshing] = useState38(false);
17553
- const dataRef = useRef26(initialData);
17554
- const initialDataRef = useRef26(initialData);
17577
+ const dataRef = useRef27(initialData);
17578
+ const initialDataRef = useRef27(initialData);
17555
17579
  initialDataRef.current = initialData;
17556
- const activeControllerRef = useRef26(null);
17557
- const requestSequence = useRef26(0);
17580
+ const activeControllerRef = useRef27(null);
17581
+ const requestSequence = useRef27(0);
17558
17582
  useEffect31(() => {
17559
17583
  const seed = initialDataRef.current;
17560
17584
  dataRef.current = seed;
@@ -17657,7 +17681,7 @@ function ConnectedBillStatus({
17657
17681
  }
17658
17682
 
17659
17683
  // src/bill-lifecycle-surfaces.tsx
17660
- import { useEffect as useEffect32, useRef as useRef27, useState as useState39 } from "react";
17684
+ import { useEffect as useEffect32, useRef as useRef28, useState as useState39 } from "react";
17661
17685
  import { Fragment as Fragment33, jsx as jsx59, jsxs as jsxs56 } from "react/jsx-runtime";
17662
17686
  function visibleBillLifecycleActions(actions2, showUnavailable = false, maxVisible) {
17663
17687
  const visible = actions2.filter((action) => action.enabled || showUnavailable);
@@ -17735,7 +17759,7 @@ function historyDate(iso) {
17735
17759
  }
17736
17760
  function BillHistoryTable({ entries, selectedEntryId, emptyLabel = "No bill history yet.", appearance, className, style, formatDate = historyDate, documentHref, onOpenDocument }) {
17737
17761
  const [expanded, setExpanded] = useState39({});
17738
- const selectedRowRef = useRef27(null);
17762
+ const selectedRowRef = useRef28(null);
17739
17763
  useEffect32(() => {
17740
17764
  if (!selectedEntryId) return;
17741
17765
  const selected = entries.find((entry) => entry.id === selectedEntryId);
@@ -18297,7 +18321,7 @@ import {
18297
18321
  useCallback as useCallback5,
18298
18322
  useEffect as useEffect33,
18299
18323
  useMemo as useMemo18,
18300
- useRef as useRef28,
18324
+ useRef as useRef29,
18301
18325
  useState as useState41
18302
18326
  } from "react";
18303
18327
  import {
@@ -18689,7 +18713,7 @@ function useBillLifecycle({
18689
18713
  const [isLoading, setIsLoading] = useState41(enabled);
18690
18714
  const [isRefreshing, setIsRefreshing] = useState41(false);
18691
18715
  const [isMutating, setIsMutating] = useState41(false);
18692
- const mounted = useRef28(true);
18716
+ const mounted = useRef29(true);
18693
18717
  const client = useMemo18(() => createBillLifecycleClient({
18694
18718
  billId: providedBillId,
18695
18719
  sessionEndpoint,
@@ -18852,8 +18876,8 @@ function useBillLifecycle({
18852
18876
  };
18853
18877
  }
18854
18878
  function LifecycleDialog({ children, title, wide = false, onClose }) {
18855
- const dialog = useRef28(null);
18856
- const onCloseRef = useRef28(onClose);
18879
+ const dialog = useRef29(null);
18880
+ const onCloseRef = useRef29(onClose);
18857
18881
  onCloseRef.current = onClose;
18858
18882
  useEffect33(() => {
18859
18883
  const previous = document.activeElement;
@@ -19151,7 +19175,7 @@ function ConnectedBillLifecycle({
19151
19175
  setPanel("");
19152
19176
  }, [currentAttemptKey]);
19153
19177
  const actor = actorName?.trim() ? { actorName: actorName.trim() } : {};
19154
- const lastData = useRef28(null);
19178
+ const lastData = useRef29(null);
19155
19179
  const correctionInitialBill = useMemo18(() => data ? correctionBill(data) : null, [data]);
19156
19180
  const correctionAttachments = useMemo18(() => data ? data.bill.attachments.map((attachment) => {
19157
19181
  const documentType = correctionDocumentType(attachment.documentType);
@@ -19666,7 +19690,7 @@ import {
19666
19690
  useId as useId12,
19667
19691
  useLayoutEffect,
19668
19692
  useMemo as useMemo19,
19669
- useRef as useRef29,
19693
+ useRef as useRef30,
19670
19694
  useState as useState42
19671
19695
  } from "react";
19672
19696
  import { Fragment as Fragment36, jsx as jsx62, jsxs as jsxs59 } from "react/jsx-runtime";
@@ -19722,7 +19746,7 @@ function Surface({ appearance, className = "", style, children, surfaceRef }) {
19722
19746
  ] });
19723
19747
  }
19724
19748
  function useAvailableViewportHeight() {
19725
- const workspaceRef = useRef29(null);
19749
+ const workspaceRef = useRef30(null);
19726
19750
  const [availableHeight, setAvailableHeight] = useState42(null);
19727
19751
  useLayoutEffect(() => {
19728
19752
  const element = workspaceRef.current;
@@ -20343,7 +20367,7 @@ function DentalDraftEditor({ initialContent, onSave, disabled = false, ...appear
20343
20367
 
20344
20368
  // src/index.tsx
20345
20369
  function widget(tagName, props) {
20346
- const ref = useRef30(null);
20370
+ const ref = useRef31(null);
20347
20371
  const { onMindBill, onMindBillError } = props;
20348
20372
  useEffect35(() => {
20349
20373
  const element = ref.current;