@mindbill/react 0.16.0 → 0.18.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/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  // src/index.tsx
4
4
  import "@mindbill/embed";
5
- import { createElement, useEffect as useEffect4, useRef as useRef4 } from "react";
5
+ import { createElement, useEffect as useEffect5, useRef as useRef4 } from "react";
6
6
 
7
7
  // src/appearance.ts
8
8
  var mindBillThemePresets = {
@@ -258,8 +258,11 @@ function Field({
258
258
  return /* @__PURE__ */ jsxs("label", { className: "mb-native-field", children: [
259
259
  /* @__PURE__ */ jsxs("span", { children: [
260
260
  label,
261
- " ",
262
- optional ? /* @__PURE__ */ jsx("small", { children: "Optional" }) : null
261
+ required ? /* @__PURE__ */ jsx("span", { className: "mb-native-required", "aria-hidden": "true", children: " *" }) : null,
262
+ optional ? /* @__PURE__ */ jsxs(Fragment, { children: [
263
+ " ",
264
+ /* @__PURE__ */ jsx("small", { children: "Optional" })
265
+ ] }) : null
263
266
  ] }),
264
267
  /* @__PURE__ */ jsx(
265
268
  "input",
@@ -314,7 +317,10 @@ function Combobox({ label, value, options, onChange, placeholder, required, disa
314
317
  };
315
318
  return /* @__PURE__ */ jsxs("div", { className: "mb-native-combo", ref: root, children: [
316
319
  /* @__PURE__ */ jsxs("label", { className: "mb-native-field", children: [
317
- /* @__PURE__ */ jsx("span", { children: label }),
320
+ /* @__PURE__ */ jsxs("span", { children: [
321
+ label,
322
+ required ? /* @__PURE__ */ jsx("span", { className: "mb-native-required", "aria-hidden": "true", children: " *" }) : null
323
+ ] }),
318
324
  /* @__PURE__ */ jsx(
319
325
  "input",
320
326
  {
@@ -394,6 +400,8 @@ function applyPreset(lines, preset) {
394
400
  }
395
401
  function BillReviewForm({
396
402
  data,
403
+ mode = "review",
404
+ initialSubmission = { route: "ebill" },
397
405
  onSave,
398
406
  onSubmit,
399
407
  onGetDeliveryOptions,
@@ -414,7 +422,7 @@ function BillReviewForm({
414
422
  const [payerResults, setPayerResults] = useState([]);
415
423
  const [payerBusy, setPayerBusy] = useState(false);
416
424
  const [deliveryOptions, setDeliveryOptions] = useState(null);
417
- const [submission, setSubmission] = useState({ route: "ebill" });
425
+ const [submission, setSubmission] = useState(initialSubmission);
418
426
  const [showSubmit, setShowSubmit] = useState(false);
419
427
  const [deliveryBusy, setDeliveryBusy] = useState(false);
420
428
  const [file, setFile] = useState(null);
@@ -422,7 +430,7 @@ function BillReviewForm({
422
430
  const [busy, setBusy] = useState("");
423
431
  const [error, setError] = useState("");
424
432
  const [notice, setNotice] = useState("");
425
- const editable = data.bill.status === "incomplete" && !disabled;
433
+ const editable = (mode === "submission" || data.bill.status === "incomplete") && !disabled;
426
434
  useEffect(() => {
427
435
  setDraft(toDraft(data));
428
436
  setPayerQuery(data.injury.claimsAdminName || "");
@@ -530,12 +538,19 @@ function BillReviewForm({
530
538
  }
531
539
  const handleSave = (event) => {
532
540
  event.preventDefault();
541
+ if (mode === "submission") {
542
+ if (!canSubmit) return;
543
+ void run("submit", () => onSubmit(buildBillReviewSaveInput(draft), initialSubmission));
544
+ return;
545
+ }
546
+ if (!onSave) return;
533
547
  void run("save", async () => {
534
548
  const updated = await onSave(buildBillReviewSaveInput(draft));
535
549
  if (updated) setDraft(toDraft(updated));
536
550
  });
537
551
  };
538
552
  const openSubmit = async () => {
553
+ if (!onGetDeliveryOptions) return;
539
554
  setDeliveryBusy(true);
540
555
  setError("");
541
556
  try {
@@ -588,51 +603,51 @@ function BillReviewForm({
588
603
  /* @__PURE__ */ jsx("style", { children: NATIVE_BILL_REVIEW_STYLES }),
589
604
  /* @__PURE__ */ jsx("style", { children: NATIVE_THEME_OVERRIDE_STYLES }),
590
605
  /* @__PURE__ */ jsx("style", { children: NATIVE_SUBMISSION_DIALOG_STYLES }),
591
- /* @__PURE__ */ jsxs("header", { className: "mb-native-heading", children: [
592
- /* @__PURE__ */ jsxs("div", { children: [
593
- /* @__PURE__ */ jsx("span", { className: "mb-native-eyebrow", children: "Billing review" }),
594
- /* @__PURE__ */ jsxs("h2", { children: [
595
- "Bill #",
596
- data.bill.billNumber
606
+ mode === "review" ? /* @__PURE__ */ jsxs(Fragment, { children: [
607
+ /* @__PURE__ */ jsxs("header", { className: "mb-native-heading", children: [
608
+ /* @__PURE__ */ jsxs("div", { children: [
609
+ /* @__PURE__ */ jsx("span", { className: "mb-native-eyebrow", children: "Billing review" }),
610
+ /* @__PURE__ */ jsxs("h2", { children: [
611
+ "Bill #",
612
+ data.bill.billNumber
613
+ ] }),
614
+ /* @__PURE__ */ jsx("p", { children: "Review the prefilled claim and payer packet, then submit." })
597
615
  ] }),
598
- /* @__PURE__ */ jsx("p", { children: "Review the prefilled claim and payer packet, then submit." })
599
- ] }),
600
- /* @__PURE__ */ jsxs("div", { className: "mb-native-total", children: [
601
- /* @__PURE__ */ jsx("span", { children: data.bill.status }),
602
- /* @__PURE__ */ jsx("strong", { children: money(data.bill.totalCharge) })
603
- ] })
604
- ] }),
605
- /* @__PURE__ */ jsxs("dl", { className: "mb-native-summary", children: [
606
- /* @__PURE__ */ jsxs("div", { children: [
607
- /* @__PURE__ */ jsx("dt", { children: "Patient" }),
608
- /* @__PURE__ */ jsx("dd", { children: [draft.patientFirstName, draft.patientMiddleName, draft.patientLastName].filter(Boolean).join(" ") || "\u2014" })
609
- ] }),
610
- /* @__PURE__ */ jsxs("div", { children: [
611
- /* @__PURE__ */ jsx("dt", { children: "Claim" }),
612
- /* @__PURE__ */ jsx("dd", { children: draft.claimNumber || "\u2014" })
613
- ] }),
614
- /* @__PURE__ */ jsxs("div", { children: [
615
- /* @__PURE__ */ jsx("dt", { children: "Employer" }),
616
- /* @__PURE__ */ jsx("dd", { children: draft.employer || "\u2014" })
616
+ /* @__PURE__ */ jsxs("div", { className: "mb-native-total", children: [
617
+ /* @__PURE__ */ jsx("span", { children: data.bill.status }),
618
+ /* @__PURE__ */ jsx("strong", { children: money(data.bill.totalCharge) })
619
+ ] })
617
620
  ] }),
618
- /* @__PURE__ */ jsxs("div", { children: [
619
- /* @__PURE__ */ jsx("dt", { children: "Date of injury" }),
620
- /* @__PURE__ */ jsx("dd", { children: draft.doi || "\u2014" })
621
- ] })
622
- ] }),
623
- /* @__PURE__ */ jsxs("section", { className: sectionClass, children: [
624
- /* @__PURE__ */ jsxs("div", { className: "mb-native-section-head", children: [
621
+ /* @__PURE__ */ jsxs("dl", { className: "mb-native-summary", children: [
625
622
  /* @__PURE__ */ jsxs("div", { children: [
626
- /* @__PURE__ */ jsx("h3", { children: "Claims administrator" }),
627
- /* @__PURE__ */ jsx("p", { children: "Select the carrier or administrator that should receive this bill." })
623
+ /* @__PURE__ */ jsx("dt", { children: "Patient" }),
624
+ /* @__PURE__ */ jsx("dd", { children: [draft.patientFirstName, draft.patientMiddleName, draft.patientLastName].filter(Boolean).join(" ") || "\u2014" })
628
625
  ] }),
629
- draft.claimsAdminId ? /* @__PURE__ */ jsx("span", { children: "Selected" }) : /* @__PURE__ */ jsx("span", { children: "Required" })
630
- ] }),
626
+ /* @__PURE__ */ jsxs("div", { children: [
627
+ /* @__PURE__ */ jsx("dt", { children: "Claim" }),
628
+ /* @__PURE__ */ jsx("dd", { children: draft.claimNumber || "\u2014" })
629
+ ] }),
630
+ /* @__PURE__ */ jsxs("div", { children: [
631
+ /* @__PURE__ */ jsx("dt", { children: "Employer" }),
632
+ /* @__PURE__ */ jsx("dd", { children: draft.employer || "\u2014" })
633
+ ] }),
634
+ /* @__PURE__ */ jsxs("div", { children: [
635
+ /* @__PURE__ */ jsx("dt", { children: "Date of injury" }),
636
+ /* @__PURE__ */ jsx("dd", { children: draft.doi || "\u2014" })
637
+ ] })
638
+ ] })
639
+ ] }) : null,
640
+ /* @__PURE__ */ jsxs("section", { className: sectionClass, children: [
641
+ /* @__PURE__ */ jsx("div", { className: "mb-native-section-head", children: /* @__PURE__ */ jsxs("div", { children: [
642
+ /* @__PURE__ */ jsx("h3", { children: "Claims administrator" }),
643
+ /* @__PURE__ */ jsx("p", { children: "Select the carrier or administrator that should receive this bill." })
644
+ ] }) }),
631
645
  /* @__PURE__ */ jsxs("div", { className: "mb-native-payer-picker", children: [
632
646
  /* @__PURE__ */ jsx(
633
647
  Combobox,
634
648
  {
635
649
  label: "Insurance company or claims administrator",
650
+ required: true,
636
651
  value: payerQuery,
637
652
  disabled: !editable,
638
653
  placeholder: "Search by payer or administrator name",
@@ -664,13 +679,10 @@ function BillReviewForm({
664
679
  ] })
665
680
  ] }),
666
681
  /* @__PURE__ */ jsxs("section", { className: sectionClass, children: [
667
- /* @__PURE__ */ jsxs("div", { className: "mb-native-section-head", children: [
668
- /* @__PURE__ */ jsxs("div", { children: [
669
- /* @__PURE__ */ jsx("h3", { children: "Patient and claim" }),
670
- /* @__PURE__ */ jsx("p", { children: "Prefilled from the case. Correct anything that should print differently on this bill." })
671
- ] }),
672
- /* @__PURE__ */ jsx("span", { children: "Editable" })
673
- ] }),
682
+ /* @__PURE__ */ jsx("div", { className: "mb-native-section-head", children: /* @__PURE__ */ jsxs("div", { children: [
683
+ /* @__PURE__ */ jsx("h3", { children: "Patient and claim" }),
684
+ /* @__PURE__ */ jsx("p", { children: "Review the case details that will print on this bill." })
685
+ ] }) }),
674
686
  /* @__PURE__ */ jsxs("div", { className: "mb-native-grid three", children: [
675
687
  /* @__PURE__ */ jsx(Field, { label: "Patient first name", required: true, disabled: !editable, value: draft.patientFirstName, onChange: (patientFirstName) => setDraft((current) => ({ ...current, patientFirstName })) }),
676
688
  /* @__PURE__ */ jsx(Field, { label: "Middle name", optional: true, disabled: !editable, value: draft.patientMiddleName, onChange: (patientMiddleName) => setDraft((current) => ({ ...current, patientMiddleName })) }),
@@ -700,56 +712,47 @@ function BillReviewForm({
700
712
  ] })
701
713
  ] }),
702
714
  /* @__PURE__ */ jsxs("section", { className: sectionClass, children: [
703
- /* @__PURE__ */ jsxs("div", { className: "mb-native-section-head", children: [
704
- /* @__PURE__ */ jsxs("div", { children: [
705
- /* @__PURE__ */ jsx("h3", { children: "Billing practice" }),
706
- /* @__PURE__ */ jsx("p", { children: "Payee identity and billing address for this claim." })
707
- ] }),
708
- /* @__PURE__ */ jsx("span", { children: "Prefilled" })
709
- ] }),
715
+ /* @__PURE__ */ jsx("div", { className: "mb-native-section-head", children: /* @__PURE__ */ jsxs("div", { children: [
716
+ /* @__PURE__ */ jsx("h3", { children: "Billing practice" }),
717
+ /* @__PURE__ */ jsx("p", { children: "Payee identity and billing address for this claim." })
718
+ ] }) }),
710
719
  /* @__PURE__ */ jsxs("div", { className: "mb-native-grid three", children: [
711
- /* @__PURE__ */ jsx(Field, { label: "Practice name", required: true, value: draft.billingProvider.name, onChange: (value) => updateBillingProvider("name", value) }),
712
- /* @__PURE__ */ jsx(Field, { label: "Tax ID", required: true, value: draft.billingProvider.taxId, onChange: (value) => updateBillingProvider("taxId", value) }),
713
- /* @__PURE__ */ jsx(Field, { label: "Billing NPI", required: true, value: draft.billingProvider.npi, onChange: (value) => updateBillingProvider("npi", value) }),
714
- /* @__PURE__ */ jsx(Field, { label: "Phone", optional: true, value: draft.billingProvider.phone || "", onChange: (value) => updateBillingProvider("phone", value) }),
715
- /* @__PURE__ */ jsx(Field, { label: "Billing street", required: true, value: draft.billingProvider.billingStreet || "", onChange: (value) => updateBillingProvider("billingStreet", value) }),
716
- /* @__PURE__ */ jsx(Field, { label: "City", required: true, value: draft.billingProvider.billingCity || "", onChange: (value) => updateBillingProvider("billingCity", value) }),
720
+ /* @__PURE__ */ jsx(Field, { label: "Practice name", required: true, disabled: !editable, value: draft.billingProvider.name, onChange: (value) => updateBillingProvider("name", value) }),
721
+ /* @__PURE__ */ jsx(Field, { label: "Tax ID", required: true, disabled: !editable, value: draft.billingProvider.taxId, onChange: (value) => updateBillingProvider("taxId", value) }),
722
+ /* @__PURE__ */ jsx(Field, { label: "Billing NPI", required: true, disabled: !editable, value: draft.billingProvider.npi, onChange: (value) => updateBillingProvider("npi", value) }),
723
+ /* @__PURE__ */ jsx(Field, { label: "Phone", optional: true, disabled: !editable, value: draft.billingProvider.phone || "", onChange: (value) => updateBillingProvider("phone", value) }),
724
+ /* @__PURE__ */ jsx(Field, { label: "Billing street", required: true, disabled: !editable, value: draft.billingProvider.billingStreet || "", onChange: (value) => updateBillingProvider("billingStreet", value) }),
725
+ /* @__PURE__ */ jsx(Field, { label: "City", required: true, disabled: !editable, value: draft.billingProvider.billingCity || "", onChange: (value) => updateBillingProvider("billingCity", value) }),
717
726
  /* @__PURE__ */ jsx(StateCombobox, { label: "State", required: true, disabled: !editable, value: draft.billingProvider.billingState || "", onChange: (value) => updateBillingProvider("billingState", value) }),
718
- /* @__PURE__ */ jsx(Field, { label: "ZIP", required: true, value: draft.billingProvider.billingZip || "", onChange: (value) => updateBillingProvider("billingZip", value) })
727
+ /* @__PURE__ */ jsx(Field, { label: "ZIP", required: true, disabled: !editable, value: draft.billingProvider.billingZip || "", onChange: (value) => updateBillingProvider("billingZip", value) })
719
728
  ] })
720
729
  ] }),
721
730
  /* @__PURE__ */ jsxs("section", { className: sectionClass, children: [
722
- /* @__PURE__ */ jsxs("div", { className: "mb-native-section-head", children: [
723
- /* @__PURE__ */ jsxs("div", { children: [
724
- /* @__PURE__ */ jsx("h3", { children: "Clinician" }),
725
- /* @__PURE__ */ jsx("p", { children: "Provider identity printed on the claim." })
726
- ] }),
727
- /* @__PURE__ */ jsx("span", { children: "Prefilled" })
728
- ] }),
731
+ /* @__PURE__ */ jsx("div", { className: "mb-native-section-head", children: /* @__PURE__ */ jsxs("div", { children: [
732
+ /* @__PURE__ */ jsx("h3", { children: "Clinician" }),
733
+ /* @__PURE__ */ jsx("p", { children: "Provider identity printed on the claim." })
734
+ ] }) }),
729
735
  /* @__PURE__ */ jsxs("div", { className: "mb-native-grid three", children: [
730
- /* @__PURE__ */ jsx(Field, { label: "Clinician name", required: true, value: draft.clinician.name, onChange: (value) => updateClinician("name", value) }),
731
- /* @__PURE__ */ jsx(Field, { label: "Specialty", value: draft.clinician.specialty, onChange: (value) => updateClinician("specialty", value) }),
732
- /* @__PURE__ */ jsx(Field, { label: "NPI", required: true, value: draft.clinician.npi, onChange: (value) => updateClinician("npi", value) }),
733
- /* @__PURE__ */ jsx(Field, { label: "Taxonomy", optional: true, value: draft.clinician.taxonomy || "", onChange: (value) => updateClinician("taxonomy", value) }),
734
- /* @__PURE__ */ jsx(Field, { label: "License number", optional: true, value: draft.clinician.licenseNumber || "", onChange: (value) => updateClinician("licenseNumber", value) }),
736
+ /* @__PURE__ */ jsx(Field, { label: "Clinician name", required: true, disabled: !editable, value: draft.clinician.name, onChange: (value) => updateClinician("name", value) }),
737
+ /* @__PURE__ */ jsx(Field, { label: "Specialty", disabled: !editable, value: draft.clinician.specialty, onChange: (value) => updateClinician("specialty", value) }),
738
+ /* @__PURE__ */ jsx(Field, { label: "NPI", required: true, disabled: !editable, value: draft.clinician.npi, onChange: (value) => updateClinician("npi", value) }),
739
+ /* @__PURE__ */ jsx(Field, { label: "Taxonomy", optional: true, disabled: !editable, value: draft.clinician.taxonomy || "", onChange: (value) => updateClinician("taxonomy", value) }),
740
+ /* @__PURE__ */ jsx(Field, { label: "License number", optional: true, disabled: !editable, value: draft.clinician.licenseNumber || "", onChange: (value) => updateClinician("licenseNumber", value) }),
735
741
  /* @__PURE__ */ jsx(StateCombobox, { label: "License state (optional)", disabled: !editable, value: draft.clinician.licenseState || "", onChange: (value) => updateClinician("licenseState", value) })
736
742
  ] })
737
743
  ] }),
738
744
  /* @__PURE__ */ jsxs("section", { className: sectionClass, children: [
739
- /* @__PURE__ */ jsxs("div", { className: "mb-native-section-head", children: [
740
- /* @__PURE__ */ jsxs("div", { children: [
741
- /* @__PURE__ */ jsx("h3", { children: "Service location" }),
742
- /* @__PURE__ */ jsx("p", { children: "The exact place of service for this bill." })
743
- ] }),
744
- /* @__PURE__ */ jsx("span", { children: "Prefilled" })
745
- ] }),
745
+ /* @__PURE__ */ jsx("div", { className: "mb-native-section-head", children: /* @__PURE__ */ jsxs("div", { children: [
746
+ /* @__PURE__ */ jsx("h3", { children: "Service location" }),
747
+ /* @__PURE__ */ jsx("p", { children: "The exact place of service for this bill." })
748
+ ] }) }),
746
749
  /* @__PURE__ */ jsxs("div", { className: "mb-native-grid three", children: [
747
- /* @__PURE__ */ jsx(Field, { label: "Location name", required: true, value: draft.location.name, onChange: (value) => updateLocation("name", value) }),
748
- /* @__PURE__ */ jsx(Field, { label: "Street", required: true, value: draft.location.street, onChange: (value) => updateLocation("street", value) }),
749
- /* @__PURE__ */ jsx(Field, { label: "City", required: true, value: draft.location.city, onChange: (value) => updateLocation("city", value) }),
750
+ /* @__PURE__ */ jsx(Field, { label: "Location name", required: true, disabled: !editable, value: draft.location.name, onChange: (value) => updateLocation("name", value) }),
751
+ /* @__PURE__ */ jsx(Field, { label: "Street", required: true, disabled: !editable, value: draft.location.street, onChange: (value) => updateLocation("street", value) }),
752
+ /* @__PURE__ */ jsx(Field, { label: "City", required: true, disabled: !editable, value: draft.location.city, onChange: (value) => updateLocation("city", value) }),
750
753
  /* @__PURE__ */ jsx(StateCombobox, { label: "State", required: true, disabled: !editable, value: draft.location.state, onChange: (value) => updateLocation("state", value) }),
751
- /* @__PURE__ */ jsx(Field, { label: "ZIP", required: true, value: draft.location.zip, onChange: (value) => updateLocation("zip", value) }),
752
- /* @__PURE__ */ jsx(Field, { label: "Place of service code", required: true, value: draft.location.posCode || "11", onChange: (value) => updateLocation("posCode", value) })
754
+ /* @__PURE__ */ jsx(Field, { label: "ZIP", required: true, disabled: !editable, value: draft.location.zip, onChange: (value) => updateLocation("zip", value) }),
755
+ /* @__PURE__ */ jsx(Field, { label: "Place of service code", required: true, disabled: !editable, value: draft.location.posCode || "11", onChange: (value) => updateLocation("posCode", value) })
753
756
  ] })
754
757
  ] }),
755
758
  /* @__PURE__ */ jsxs("section", { className: sectionClass, children: [
@@ -766,7 +769,10 @@ function BillReviewForm({
766
769
  ] }),
767
770
  /* @__PURE__ */ jsx("div", { className: "mb-native-lines", children: draft.lineItems.map((line, index) => /* @__PURE__ */ jsxs("div", { className: `mb-native-line ${data.bill.billingMode === "professional" ? "professional" : ""}`, children: [
768
771
  /* @__PURE__ */ jsxs("label", { className: "mb-native-field", children: [
769
- /* @__PURE__ */ jsx("span", { children: "Procedure" }),
772
+ /* @__PURE__ */ jsxs("span", { children: [
773
+ "Procedure",
774
+ /* @__PURE__ */ jsx("span", { className: "mb-native-required", "aria-hidden": "true", children: " *" })
775
+ ] }),
770
776
  data.bill.billingMode === "professional" ? /* @__PURE__ */ jsx("input", { disabled: !editable, placeholder: "CPT / HCPCS code", value: line.code, onChange: (event) => {
771
777
  const code = event.target.value.toUpperCase();
772
778
  setDraft((current) => ({ ...current, lineItems: ensureTrailingProcedureLine(current.lineItems.map((item, itemIndex) => itemIndex === index ? { ...item, code } : item)) }));
@@ -820,12 +826,18 @@ function BillReviewForm({
820
826
  ] }, modifier)) : null })
821
827
  ] }),
822
828
  /* @__PURE__ */ jsxs("label", { className: "mb-native-field", children: [
823
- /* @__PURE__ */ jsx("span", { children: "Units" }),
829
+ /* @__PURE__ */ jsxs("span", { children: [
830
+ "Units",
831
+ /* @__PURE__ */ jsx("span", { className: "mb-native-required", "aria-hidden": "true", children: " *" })
832
+ ] }),
824
833
  /* @__PURE__ */ jsx("input", { type: "number", min: "1", required: true, disabled: !editable, value: line.units, onChange: (event) => setDraft((current) => ({ ...current, lineItems: ensureTrailingProcedureLine(current.lineItems.map((item, itemIndex) => itemIndex === index ? { ...item, units: Number(event.target.value) } : item)) })) })
825
834
  ] }),
826
835
  data.bill.billingMode === "professional" ? /* @__PURE__ */ jsxs(Fragment, { children: [
827
836
  /* @__PURE__ */ jsxs("label", { className: "mb-native-field", children: [
828
- /* @__PURE__ */ jsx("span", { children: "Service date" }),
837
+ /* @__PURE__ */ jsxs("span", { children: [
838
+ "Service date",
839
+ /* @__PURE__ */ jsx("span", { className: "mb-native-required", "aria-hidden": "true", children: " *" })
840
+ ] }),
829
841
  /* @__PURE__ */ jsx("input", { type: "date", required: Boolean(line.code), disabled: !editable, value: line.serviceDate || "", onChange: (event) => setDraft((current) => ({ ...current, lineItems: ensureTrailingProcedureLine(current.lineItems.map((item, itemIndex) => itemIndex === index ? { ...item, serviceDate: event.target.value } : item)) })) })
830
842
  ] }),
831
843
  /* @__PURE__ */ jsxs("label", { className: "mb-native-field", children: [
@@ -836,7 +848,10 @@ function BillReviewForm({
836
848
  /* @__PURE__ */ jsx("input", { type: "date", disabled: !editable, value: line.serviceDateEnd || "", onChange: (event) => setDraft((current) => ({ ...current, lineItems: ensureTrailingProcedureLine(current.lineItems.map((item, itemIndex) => itemIndex === index ? { ...item, serviceDateEnd: event.target.value } : item)) })) })
837
849
  ] }),
838
850
  /* @__PURE__ */ jsxs("label", { className: "mb-native-field", children: [
839
- /* @__PURE__ */ jsx("span", { children: "Charge" }),
851
+ /* @__PURE__ */ jsxs("span", { children: [
852
+ "Charge",
853
+ /* @__PURE__ */ jsx("span", { className: "mb-native-required", "aria-hidden": "true", children: " *" })
854
+ ] }),
840
855
  /* @__PURE__ */ jsx("input", { type: "number", min: "0.01", step: "0.01", required: Boolean(line.code), disabled: !editable, value: line.charge || "", onChange: (event) => setDraft((current) => ({ ...current, lineItems: ensureTrailingProcedureLine(current.lineItems.map((item, itemIndex) => itemIndex === index ? { ...item, charge: Number(event.target.value) } : item)) })) })
841
856
  ] }),
842
857
  /* @__PURE__ */ jsxs("label", { className: "mb-native-field", children: [
@@ -858,16 +873,10 @@ function BillReviewForm({
858
873
  ] }, line.id || index)) })
859
874
  ] }),
860
875
  /* @__PURE__ */ jsxs("section", { className: sectionClass, children: [
861
- /* @__PURE__ */ jsxs("div", { className: "mb-native-section-head", children: [
862
- /* @__PURE__ */ jsxs("div", { children: [
863
- /* @__PURE__ */ jsx("h3", { children: "Payer billing packet" }),
864
- /* @__PURE__ */ jsx("p", { children: "Review exactly what will be sent with this bill." })
865
- ] }),
866
- /* @__PURE__ */ jsxs("span", { children: [
867
- data.bill.attachments.length,
868
- " files"
869
- ] })
870
- ] }),
876
+ /* @__PURE__ */ jsx("div", { className: "mb-native-section-head", children: /* @__PURE__ */ jsxs("div", { children: [
877
+ /* @__PURE__ */ jsx("h3", { children: "Payer billing packet" }),
878
+ /* @__PURE__ */ jsx("p", { children: "Review exactly what will be sent with this bill." })
879
+ ] }) }),
871
880
  /* @__PURE__ */ jsxs("div", { className: "mb-native-note", children: [
872
881
  /* @__PURE__ */ jsx("strong", { children: "Separate from attorney report service." }),
873
882
  " Final reports, proof of service, and required billing forms may be preselected. Medical records are never silently attached."
@@ -893,9 +902,8 @@ function BillReviewForm({
893
902
  ] }),
894
903
  /* @__PURE__ */ jsxs("section", { className: "mb-native-submit", children: [
895
904
  /* @__PURE__ */ jsxs("div", { children: [
896
- /* @__PURE__ */ jsx("span", { className: "mb-native-eyebrow", children: "Delivery" }),
897
- /* @__PURE__ */ jsx("h3", { children: "Submit this bill" }),
898
- /* @__PURE__ */ jsx("p", { children: "After submission, status, payments, denials, and resubmissions stay available here." })
905
+ /* @__PURE__ */ jsx("h3", { children: "Submit bill" }),
906
+ /* @__PURE__ */ jsx("p", { children: "Submitting creates the bill as an immutable snapshot of the information and documents above." })
899
907
  ] }),
900
908
  error ? /* @__PURE__ */ jsx("div", { className: "mb-native-message error", role: "alert", children: error }) : null,
901
909
  notice ? /* @__PURE__ */ jsx("div", { className: "mb-native-message success", role: "status", children: notice }) : null,
@@ -903,10 +911,10 @@ function BillReviewForm({
903
911
  /* @__PURE__ */ jsx("strong", { children: "Before you can submit:" }),
904
912
  /* @__PURE__ */ jsx("span", { children: blockers.join(" \xB7 ") })
905
913
  ] }) : null,
906
- /* @__PURE__ */ jsxs("div", { className: "mb-native-actions", children: [
914
+ /* @__PURE__ */ jsx("div", { className: "mb-native-actions", children: mode === "submission" ? /* @__PURE__ */ jsx("button", { className: "mb-native-button primary", type: "submit", disabled: !editable || !canSubmit || busy !== "", children: busy === "submit" ? "Submitting\u2026" : "Submit bill" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
907
915
  /* @__PURE__ */ jsx("button", { className: "mb-native-button secondary", type: "submit", disabled: !editable || busy !== "", children: busy === "save" ? "Saving\u2026" : "Save changes" }),
908
916
  /* @__PURE__ */ jsx("button", { className: "mb-native-button primary", type: "button", disabled: !editable || !canSubmit || busy !== "" || deliveryBusy, onClick: () => void openSubmit(), children: deliveryBusy ? "Loading delivery\u2026" : "Review delivery" })
909
- ] })
917
+ ] }) })
910
918
  ] }),
911
919
  showSubmit && deliveryOptions ? /* @__PURE__ */ jsx("div", { className: "mb-native-modal-backdrop", role: "presentation", onMouseDown: (event) => {
912
920
  if (event.target === event.currentTarget && busy !== "submit") setShowSubmit(false);
@@ -991,7 +999,7 @@ var NATIVE_SUBMISSION_DIALOG_STYLES = `
991
999
  `;
992
1000
  var NATIVE_BILL_REVIEW_STYLES = `
993
1001
  .mb-native-review,.mb-native-status{font-family:var(--mb-font,Inter,ui-sans-serif,system-ui,sans-serif)}
994
- .mb-native-review,.mb-native-status{--mb-accent:#238dbd;--mb-accent-dark:#176f98;--mb-text:#203743;--mb-muted:#657982;--mb-border:#dbe6ea;--mb-soft:#f3f8fa;--mb-surface:#fff;color:var(--mb-text);font:14px/1.45 Inter,ui-sans-serif,system-ui,sans-serif}.mb-native-review *,.mb-native-status *{box-sizing:border-box}.mb-native-review{display:grid;gap:16px}.mb-native-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;padding:6px 2px}.mb-native-heading h2,.mb-native-section h3,.mb-native-submit h3,.mb-native-status h3{margin:3px 0 2px;line-height:1.2}.mb-native-heading h2{font-size:25px}.mb-native-heading p,.mb-native-section p,.mb-native-submit p,.mb-native-status p{margin:0;color:var(--mb-muted)}.mb-native-eyebrow{color:#59727d;font-size:11px;font-weight:800;letter-spacing:.14em;text-transform:uppercase}.mb-native-total{display:flex;align-items:center;gap:18px}.mb-native-total span,.mb-native-section-head>span{border-radius:999px;background:var(--mb-soft);color:#58717c;font-size:11px;font-weight:800;padding:6px 10px;text-transform:capitalize}.mb-native-total strong{font-size:24px}.mb-native-summary{display:grid;grid-template-columns:repeat(4,1fr);margin:0;border:1px solid var(--mb-border);border-radius:12px;background:var(--mb-surface);overflow:hidden}.mb-native-summary div{padding:17px 20px;border-right:1px solid var(--mb-border)}.mb-native-summary div:last-child{border:0}.mb-native-summary dt,.mb-native-allowed span{color:#647982;font-size:10px;font-weight:800;letter-spacing:.12em;text-transform:uppercase}.mb-native-summary dd{margin:5px 0 0;font-weight:750}.mb-native-section{padding:20px;border:1px solid var(--mb-border);border-radius:14px;background:var(--mb-surface);box-shadow:0 8px 24px rgba(28,58,72,.04)}.mb-native-section-head{display:flex;align-items:start;justify-content:space-between;gap:16px;margin-bottom:17px}.mb-native-section h3,.mb-native-submit h3,.mb-native-status h3{font-size:19px}.mb-native-grid{display:grid;gap:14px}.mb-native-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}.mb-native-field{display:grid;gap:6px;min-width:0;color:var(--mb-text);font-size:12px;font-weight:750}.mb-native-field small{color:var(--mb-muted);font-size:inherit;font-weight:500}.mb-native-field input,.mb-native-attach select,.mb-native-attach input{width:100%;min-height:43px;border:1px solid var(--mb-border);border-radius:8px;background:#fff;color:var(--mb-text);font:inherit;padding:10px 12px}.mb-native-field input:focus,.mb-native-attach select:focus,.mb-native-attach input:focus{border-color:var(--mb-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--mb-accent) 14%,transparent);outline:0}.mb-native-lines{display:grid;gap:10px}.mb-native-line{display:grid;grid-template-columns:1.1fr 1.1fr 110px 120px 28px;align-items:end;gap:12px;padding:13px;background:var(--mb-soft);border:1px solid #e3edf0;border-radius:10px}.mb-native-allowed{display:grid;gap:5px;padding:0 8px 11px;text-align:right}.mb-native-allowed strong{font-size:16px}.mb-native-remove{border:0;background:transparent;color:#667d86;cursor:pointer;font-size:20px;padding:7px}.mb-native-note{padding:13px 15px;border:1px solid #bdd9e4;border-radius:9px;background:#f2f9fc;color:#526d78}.mb-native-note strong{color:var(--mb-text);margin-right:12px}.mb-native-documents{list-style:none;margin:14px 0;padding:0}.mb-native-documents li{display:grid;grid-template-columns:42px 1fr auto 28px;align-items:center;gap:12px;padding:12px 4px;border-bottom:1px solid var(--mb-border)}.mb-native-documents li>div{display:grid}.mb-native-documents li span{color:var(--mb-muted);font-size:12px}.mb-native-file{display:grid;place-items:center;width:40px;height:40px;border-radius:8px;background:#eaf5f9;color:var(--mb-accent)!important;font-size:11px!important;font-weight:850}.mb-native-attach{display:grid;grid-template-columns:1fr 230px minmax(220px,1fr) auto;align-items:end;gap:12px;padding:15px;border-radius:10px;background:var(--mb-soft)}.mb-native-attach>div{display:grid;gap:3px}.mb-native-attach span{color:var(--mb-muted);font-size:12px}.mb-native-button{min-height:40px;border:1px solid var(--mb-border);border-radius:8px;background:#fff;color:var(--mb-text);cursor:pointer;font:inherit;font-weight:750;padding:9px 14px}.mb-native-button.primary{border-color:var(--mb-accent);background:var(--mb-accent);color:#fff}.mb-native-button.primary:hover{background:var(--mb-accent-dark)}.mb-native-button.secondary{background:#fff}.mb-native-button.quiet{min-height:auto;background:var(--mb-soft);padding:7px 11px}.mb-native-button:disabled,.mb-native-remove:disabled{cursor:not-allowed;opacity:.5}.mb-native-submit{display:grid;grid-template-columns:1fr auto;align-items:end;gap:18px;padding:22px;border:1px solid #bcd8e2;border-radius:14px;background:linear-gradient(135deg,#f3fafc,#eaf6fa)}.mb-native-submit fieldset{display:flex;gap:6px;margin:0;padding:0;border:0}.mb-native-submit legend{position:absolute;width:1px;height:1px;overflow:hidden}.mb-native-submit fieldset label{display:flex;align-items:center;gap:6px;padding:9px 11px;border:1px solid #c9dce3;border-radius:8px;background:#fff;font-weight:700}.mb-native-actions{display:flex;justify-content:flex-end;gap:10px;grid-column:1/-1}.mb-native-message{grid-column:1/-1;padding:10px 12px;border-radius:8px}.mb-native-message.error{background:#fff0ef;color:#9d3029}.mb-native-message.success{background:#edf9f2;color:#217449}.mb-native-status{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:20px;border:1px solid var(--mb-border);border-radius:12px;background:#fff}.mb-native-status h3{text-transform:capitalize}.mb-native-status dl{display:flex;margin:0}.mb-native-status dl div{min-width:110px;padding:0 18px;border-left:1px solid var(--mb-border)}.mb-native-status dt{color:var(--mb-muted);font-size:11px}.mb-native-status dd{margin:4px 0 0;font-size:17px;font-weight:800}@media(max-width:900px){.mb-native-grid.three{grid-template-columns:repeat(2,minmax(0,1fr))}.mb-native-summary{grid-template-columns:repeat(2,1fr)}.mb-native-summary div:nth-child(2){border-right:0}.mb-native-summary div:nth-child(-n+2){border-bottom:1px solid var(--mb-border)}.mb-native-line{grid-template-columns:1fr 1fr 90px}.mb-native-allowed{align-self:center}.mb-native-attach{grid-template-columns:1fr 1fr}.mb-native-submit{grid-template-columns:1fr}.mb-native-submit fieldset,.mb-native-actions{grid-column:1}.mb-native-actions{justify-content:start}}@media(max-width:620px){.mb-native-heading,.mb-native-total,.mb-native-status{align-items:start;flex-direction:column}.mb-native-grid.three,.mb-native-summary,.mb-native-line,.mb-native-attach{grid-template-columns:1fr}.mb-native-summary div,.mb-native-summary div:nth-child(2){border-right:0;border-bottom:1px solid var(--mb-border)}.mb-native-line{align-items:stretch}.mb-native-allowed{text-align:left}.mb-native-submit fieldset{display:grid;grid-template-columns:1fr 1fr}.mb-native-status dl{width:100%}.mb-native-status dl div{min-width:0;flex:1;padding:0 10px}.mb-native-status dl div:first-child{padding-left:0;border-left:0}}
1002
+ .mb-native-review,.mb-native-status{--mb-accent:#238dbd;--mb-accent-dark:#176f98;--mb-text:#203743;--mb-muted:#657982;--mb-border:#dbe6ea;--mb-soft:#f3f8fa;--mb-surface:#fff;color:var(--mb-text);font:14px/1.45 Inter,ui-sans-serif,system-ui,sans-serif}.mb-native-review *,.mb-native-status *{box-sizing:border-box}.mb-native-review{display:grid;gap:16px}.mb-native-heading{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;padding:6px 2px}.mb-native-heading h2,.mb-native-section h3,.mb-native-submit h3,.mb-native-status h3{margin:3px 0 2px;line-height:1.2}.mb-native-heading h2{font-size:25px}.mb-native-heading p,.mb-native-section p,.mb-native-submit p,.mb-native-status p{margin:0;color:var(--mb-muted)}.mb-native-eyebrow{color:#59727d;font-size:11px;font-weight:800;letter-spacing:.14em;text-transform:uppercase}.mb-native-total{display:flex;align-items:center;gap:18px}.mb-native-total span,.mb-native-section-head>span{border-radius:999px;background:var(--mb-soft);color:#58717c;font-size:11px;font-weight:800;padding:6px 10px;text-transform:capitalize}.mb-native-total strong{font-size:24px}.mb-native-summary{display:grid;grid-template-columns:repeat(4,1fr);margin:0;border:1px solid var(--mb-border);border-radius:12px;background:var(--mb-surface);overflow:hidden}.mb-native-summary div{padding:17px 20px;border-right:1px solid var(--mb-border)}.mb-native-summary div:last-child{border:0}.mb-native-summary dt,.mb-native-allowed span{color:#647982;font-size:10px;font-weight:800;letter-spacing:.12em;text-transform:uppercase}.mb-native-summary dd{margin:5px 0 0;font-weight:750}.mb-native-section{padding:20px;border:1px solid var(--mb-border);border-radius:14px;background:var(--mb-surface);box-shadow:0 8px 24px rgba(28,58,72,.04)}.mb-native-section-head{display:flex;align-items:start;justify-content:space-between;gap:16px;margin-bottom:17px}.mb-native-section h3,.mb-native-submit h3,.mb-native-status h3{font-size:19px}.mb-native-grid{display:grid;gap:14px}.mb-native-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}.mb-native-field{display:grid;gap:6px;min-width:0;color:var(--mb-text);font-size:12px;font-weight:750}.mb-native-required{color:#c5352e}.mb-native-field small{color:var(--mb-muted);font-size:inherit;font-weight:500}.mb-native-field input,.mb-native-attach select,.mb-native-attach input{width:100%;min-height:43px;border:1px solid var(--mb-border);border-radius:8px;background:#fff;color:var(--mb-text);font:inherit;padding:10px 12px}.mb-native-field input:focus,.mb-native-attach select:focus,.mb-native-attach input:focus{border-color:var(--mb-accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--mb-accent) 14%,transparent);outline:0}.mb-native-lines{display:grid;gap:10px}.mb-native-line{display:grid;grid-template-columns:1.1fr 1.1fr 110px 120px 28px;align-items:end;gap:12px;padding:13px;background:var(--mb-soft);border:1px solid #e3edf0;border-radius:10px}.mb-native-allowed{display:grid;gap:5px;padding:0 8px 11px;text-align:right}.mb-native-allowed strong{font-size:16px}.mb-native-remove{border:0;background:transparent;color:#667d86;cursor:pointer;font-size:20px;padding:7px}.mb-native-note{padding:13px 15px;border:1px solid #bdd9e4;border-radius:9px;background:#f2f9fc;color:#526d78}.mb-native-note strong{color:var(--mb-text);margin-right:12px}.mb-native-documents{list-style:none;margin:14px 0;padding:0}.mb-native-documents li{display:grid;grid-template-columns:42px 1fr auto 28px;align-items:center;gap:12px;padding:12px 4px;border-bottom:1px solid var(--mb-border)}.mb-native-documents li>div{display:grid}.mb-native-documents li span{color:var(--mb-muted);font-size:12px}.mb-native-file{display:grid;place-items:center;width:40px;height:40px;border-radius:8px;background:#eaf5f9;color:var(--mb-accent)!important;font-size:11px!important;font-weight:850}.mb-native-attach{display:grid;grid-template-columns:1fr 230px minmax(220px,1fr) auto;align-items:end;gap:12px;padding:15px;border-radius:10px;background:var(--mb-soft)}.mb-native-attach>div{display:grid;gap:3px}.mb-native-attach span{color:var(--mb-muted);font-size:12px}.mb-native-button{min-height:40px;border:1px solid var(--mb-border);border-radius:8px;background:#fff;color:var(--mb-text);cursor:pointer;font:inherit;font-weight:750;padding:9px 14px}.mb-native-button.primary{border-color:var(--mb-accent);background:var(--mb-accent);color:#fff}.mb-native-button.primary:hover{background:var(--mb-accent-dark)}.mb-native-button.secondary{background:#fff}.mb-native-button.quiet{min-height:auto;background:var(--mb-soft);padding:7px 11px}.mb-native-button:disabled,.mb-native-remove:disabled{cursor:not-allowed;opacity:.5}.mb-native-submit{display:grid;grid-template-columns:1fr auto;align-items:end;gap:18px;padding:22px;border:1px solid #bcd8e2;border-radius:14px;background:linear-gradient(135deg,#f3fafc,#eaf6fa)}.mb-native-submit fieldset{display:flex;gap:6px;margin:0;padding:0;border:0}.mb-native-submit legend{position:absolute;width:1px;height:1px;overflow:hidden}.mb-native-submit fieldset label{display:flex;align-items:center;gap:6px;padding:9px 11px;border:1px solid #c9dce3;border-radius:8px;background:#fff;font-weight:700}.mb-native-actions{display:flex;justify-content:flex-end;gap:10px;grid-column:1/-1}.mb-native-message{grid-column:1/-1;padding:10px 12px;border-radius:8px}.mb-native-message.error{background:#fff0ef;color:#9d3029}.mb-native-message.success{background:#edf9f2;color:#217449}.mb-native-status{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:20px;border:1px solid var(--mb-border);border-radius:12px;background:#fff}.mb-native-status h3{text-transform:capitalize}.mb-native-status dl{display:flex;margin:0}.mb-native-status dl div{min-width:110px;padding:0 18px;border-left:1px solid var(--mb-border)}.mb-native-status dt{color:var(--mb-muted);font-size:11px}.mb-native-status dd{margin:4px 0 0;font-size:17px;font-weight:800}@media(max-width:900px){.mb-native-grid.three{grid-template-columns:repeat(2,minmax(0,1fr))}.mb-native-summary{grid-template-columns:repeat(2,1fr)}.mb-native-summary div:nth-child(2){border-right:0}.mb-native-summary div:nth-child(-n+2){border-bottom:1px solid var(--mb-border)}.mb-native-line{grid-template-columns:1fr 1fr 90px}.mb-native-allowed{align-self:center}.mb-native-attach{grid-template-columns:1fr 1fr}.mb-native-submit{grid-template-columns:1fr}.mb-native-submit fieldset,.mb-native-actions{grid-column:1}.mb-native-actions{justify-content:start}}@media(max-width:620px){.mb-native-heading,.mb-native-total,.mb-native-status{align-items:start;flex-direction:column}.mb-native-grid.three,.mb-native-summary,.mb-native-line,.mb-native-attach{grid-template-columns:1fr}.mb-native-summary div,.mb-native-summary div:nth-child(2){border-right:0;border-bottom:1px solid var(--mb-border)}.mb-native-line{align-items:stretch}.mb-native-allowed{text-align:left}.mb-native-submit fieldset{display:grid;grid-template-columns:1fr 1fr}.mb-native-status dl{width:100%}.mb-native-status dl div{min-width:0;flex:1;padding:0 10px}.mb-native-status dl div:first-child{padding-left:0;border-left:0}}
995
1003
  .mb-native-status-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}.mb-native-status-copy{min-width:150px}.mb-native-review,.mb-native-status{font-family:var(--mb-font,Inter,ui-sans-serif,system-ui,sans-serif)}
996
1004
  .mb-native-review{padding:clamp(16px,2vw,24px)}
997
1005
  .mb-native-grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}
@@ -1035,19 +1043,490 @@ var NATIVE_THEME_OVERRIDE_STYLES = `
1035
1043
  .mb-native-combo-list{border-color:var(--mb-border);border-radius:var(--mb-control-radius);background:var(--mb-surface);box-shadow:var(--mb-shadow)}
1036
1044
  `;
1037
1045
 
1046
+ // src/bill-submission-form.tsx
1047
+ import { useEffect as useEffect2, useMemo as useMemo2, useState as useState2 } from "react";
1048
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
1049
+ var BILL_SUBMISSION_DOCUMENT_TYPES = [
1050
+ "final_report",
1051
+ "proof_of_service",
1052
+ "letter_of_attestation",
1053
+ "form_122",
1054
+ "return_to_work_voucher",
1055
+ "w9",
1056
+ "medical_records",
1057
+ "appeal",
1058
+ "other"
1059
+ ];
1060
+ var BILL_SUBMISSION_REQUIRED_FIELDS = [
1061
+ "patient.firstName",
1062
+ "patient.lastName",
1063
+ "patient.address.line1",
1064
+ "patient.address.city",
1065
+ "patient.address.state",
1066
+ "patient.address.postalCode",
1067
+ "claim.claimNumber",
1068
+ "service.date",
1069
+ "serviceLines[].code",
1070
+ "serviceLines[].units"
1071
+ ];
1072
+ function validateBillSubmission(bill) {
1073
+ const errors = {};
1074
+ const required = (path, value) => {
1075
+ if (typeof value !== "string" || !value.trim()) errors[path] = "Required";
1076
+ };
1077
+ required("patient.firstName", bill.patient.firstName);
1078
+ required("patient.lastName", bill.patient.lastName);
1079
+ required("patient.address.line1", bill.patient.address.line1);
1080
+ required("patient.address.city", bill.patient.address.city);
1081
+ required("patient.address.state", bill.patient.address.state);
1082
+ required("patient.address.postalCode", bill.patient.address.postalCode);
1083
+ required("claim.claimNumber", bill.claim.claimNumber);
1084
+ required("service.date", bill.service.date);
1085
+ if (bill.patient.address.state.trim().length !== 2)
1086
+ errors["patient.address.state"] = "Use a 2-letter state code";
1087
+ if (!bill.serviceLines.length) errors.serviceLines = "Add at least one service line";
1088
+ bill.serviceLines.forEach((line, index) => {
1089
+ required(`serviceLines.${index}.code`, line.code);
1090
+ if (!Number.isInteger(line.units) || (line.units ?? 0) < 1)
1091
+ errors[`serviceLines.${index}.units`] = "Enter at least 1 unit";
1092
+ if (bill.billingMode === "professional" && (!Number.isFinite(line.charge) || (line.charge ?? 0) < 0))
1093
+ errors[`serviceLines.${index}.charge`] = "Enter the billed charge";
1094
+ });
1095
+ return { valid: Object.keys(errors).length === 0, fieldErrors: errors };
1096
+ }
1097
+ var MAX_PDF_BYTES = 25 * 1024 * 1024;
1098
+ var MAX_UPLOAD_BYTES = 100 * 1024 * 1024;
1099
+ var MAX_DOCUMENTS = 25;
1100
+ var EMPTY_ATTACHMENTS = [];
1101
+ var documentLabels = {
1102
+ final_report: "Final report",
1103
+ proof_of_service: "Proof of service",
1104
+ letter_of_attestation: "Letter of attestation",
1105
+ form_122: "Form 122",
1106
+ return_to_work_voucher: "Return-to-work voucher",
1107
+ w9: "W-9",
1108
+ medical_records: "Medical records",
1109
+ appeal: "Appeal",
1110
+ other: "Other"
1111
+ };
1112
+ function cloneBill(bill) {
1113
+ return {
1114
+ ...bill,
1115
+ patient: { ...bill.patient, address: { ...bill.patient.address } },
1116
+ claim: {
1117
+ ...bill.claim,
1118
+ ...bill.claim.claimsAdministrator ? { claimsAdministrator: { ...bill.claim.claimsAdministrator } } : {}
1119
+ },
1120
+ service: { ...bill.service },
1121
+ ...bill.billingProvider ? {
1122
+ billingProvider: {
1123
+ ...bill.billingProvider,
1124
+ ...bill.billingProvider.address ? { address: { ...bill.billingProvider.address } } : {}
1125
+ }
1126
+ } : {},
1127
+ ...bill.renderingProvider ? { renderingProvider: { ...bill.renderingProvider } } : {},
1128
+ ...bill.serviceLocation ? {
1129
+ serviceLocation: {
1130
+ ...bill.serviceLocation,
1131
+ ...bill.serviceLocation.address ? { address: { ...bill.serviceLocation.address } } : {}
1132
+ }
1133
+ } : {},
1134
+ diagnoses: [...bill.diagnoses ?? []],
1135
+ serviceLines: bill.serviceLines.length ? bill.serviceLines.map((line) => ({
1136
+ ...line,
1137
+ modifiers: [...line.modifiers ?? []],
1138
+ diagnosisPointers: [...line.diagnosisPointers ?? []],
1139
+ units: line.units ?? 1
1140
+ })) : [{ code: "", modifiers: [], units: 1 }]
1141
+ };
1142
+ }
1143
+ var styles = {
1144
+ root: {
1145
+ display: "grid",
1146
+ gap: 18,
1147
+ color: "var(--mb-text)",
1148
+ fontFamily: "var(--mb-font)"
1149
+ },
1150
+ heading: {
1151
+ display: "flex",
1152
+ alignItems: "start",
1153
+ justifyContent: "space-between",
1154
+ gap: 20
1155
+ },
1156
+ title: { margin: 0, fontSize: 22, lineHeight: 1.2 },
1157
+ copy: { margin: "5px 0 0", color: "var(--mb-muted)", fontSize: 14 },
1158
+ requiredNote: { color: "var(--mb-muted)", fontSize: 13, whiteSpace: "nowrap" },
1159
+ section: {
1160
+ minWidth: 0,
1161
+ margin: 0,
1162
+ padding: 20,
1163
+ border: "1px solid var(--mb-border)",
1164
+ borderRadius: "var(--mb-radius)",
1165
+ background: "var(--mb-surface)",
1166
+ boxShadow: "var(--mb-shadow)"
1167
+ },
1168
+ legend: { padding: "0 8px", fontWeight: 700, fontSize: 15 },
1169
+ grid: {
1170
+ display: "grid",
1171
+ gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, 210px), 1fr))",
1172
+ gap: 14
1173
+ },
1174
+ field: { display: "grid", alignContent: "start", gap: 6, minWidth: 0 },
1175
+ label: { color: "var(--mb-muted)", fontSize: 12, fontWeight: 700 },
1176
+ input: {
1177
+ boxSizing: "border-box",
1178
+ width: "100%",
1179
+ minHeight: 40,
1180
+ padding: "9px 11px",
1181
+ border: "1px solid var(--mb-border)",
1182
+ borderRadius: "var(--mb-control-radius)",
1183
+ background: "var(--mb-input)",
1184
+ color: "var(--mb-text)",
1185
+ font: "inherit"
1186
+ },
1187
+ tableWrap: { overflowX: "auto" },
1188
+ table: { width: "100%", minWidth: 610, borderCollapse: "collapse" },
1189
+ th: {
1190
+ padding: "0 8px 8px",
1191
+ color: "var(--mb-muted)",
1192
+ fontSize: 12,
1193
+ textAlign: "left"
1194
+ },
1195
+ td: { padding: "7px 8px", borderTop: "1px solid var(--mb-border)" },
1196
+ secondaryButton: {
1197
+ minHeight: 36,
1198
+ padding: "7px 11px",
1199
+ border: "1px solid var(--mb-border)",
1200
+ borderRadius: "var(--mb-control-radius)",
1201
+ background: "var(--mb-surface)",
1202
+ color: "var(--mb-text)",
1203
+ font: "inherit",
1204
+ fontWeight: 650,
1205
+ cursor: "pointer"
1206
+ },
1207
+ attachment: {
1208
+ display: "flex",
1209
+ alignItems: "center",
1210
+ justifyContent: "space-between",
1211
+ gap: 12,
1212
+ padding: "11px 0",
1213
+ borderBottom: "1px solid var(--mb-border)"
1214
+ },
1215
+ attachmentName: { display: "grid", gap: 2, minWidth: 0, flex: 1 },
1216
+ attachmentMeta: { color: "var(--mb-muted)", fontSize: 12 },
1217
+ error: {
1218
+ padding: "11px 13px",
1219
+ borderRadius: "var(--mb-control-radius)",
1220
+ background: "color-mix(in srgb, var(--mb-danger) 10%, transparent)",
1221
+ color: "var(--mb-danger)",
1222
+ fontSize: 13
1223
+ },
1224
+ actions: { display: "flex", justifyContent: "flex-end" },
1225
+ submit: {
1226
+ minWidth: 150,
1227
+ minHeight: 42,
1228
+ padding: "10px 20px",
1229
+ border: 0,
1230
+ borderRadius: "var(--mb-control-radius)",
1231
+ background: "var(--mb-accent)",
1232
+ color: "var(--mb-accent-contrast)",
1233
+ font: "inherit",
1234
+ fontWeight: 750,
1235
+ cursor: "pointer"
1236
+ }
1237
+ };
1238
+ function RequiredMark() {
1239
+ return /* @__PURE__ */ jsx2("span", { className: "required-mark", style: { color: "var(--mb-danger)" }, children: " *" });
1240
+ }
1241
+ function Field2({
1242
+ label,
1243
+ required,
1244
+ error,
1245
+ children
1246
+ }) {
1247
+ return /* @__PURE__ */ jsxs2("label", { style: styles.field, children: [
1248
+ /* @__PURE__ */ jsxs2("span", { style: styles.label, children: [
1249
+ label,
1250
+ required ? /* @__PURE__ */ jsx2(RequiredMark, {}) : null
1251
+ ] }),
1252
+ children,
1253
+ error ? /* @__PURE__ */ jsx2("span", { style: { color: "var(--mb-danger)", fontSize: 12 }, children: error }) : null
1254
+ ] });
1255
+ }
1256
+ function inputValue(value) {
1257
+ return value ?? "";
1258
+ }
1259
+ function BillSubmissionForm({
1260
+ initialBill,
1261
+ attachments = EMPTY_ATTACHMENTS,
1262
+ onSubmit,
1263
+ appearance,
1264
+ className = "bill-submission-form",
1265
+ style,
1266
+ disabled = false,
1267
+ submitLabel = "Submit bill",
1268
+ heading = "Bill information",
1269
+ description = "Review the bill details, add attachments, and submit."
1270
+ }) {
1271
+ const [bill, setBill] = useState2(() => cloneBill(initialBill));
1272
+ const [selectedIds, setSelectedIds] = useState2(
1273
+ () => attachments.filter((item) => item.selected !== false).map((item) => item.id)
1274
+ );
1275
+ const [uploads, setUploads] = useState2([]);
1276
+ const [errors, setErrors] = useState2({});
1277
+ const [formError, setFormError] = useState2(null);
1278
+ const [submitting, setSubmitting] = useState2(false);
1279
+ useEffect2(() => {
1280
+ setBill(cloneBill(initialBill));
1281
+ setSelectedIds(
1282
+ attachments.filter((item) => item.selected !== false).map((item) => item.id)
1283
+ );
1284
+ setUploads([]);
1285
+ setErrors({});
1286
+ setFormError(null);
1287
+ }, [initialBill, attachments]);
1288
+ const diagnoses = useMemo2(() => (bill.diagnoses ?? []).join(", "), [bill.diagnoses]);
1289
+ const locked = disabled || submitting;
1290
+ const setPatient = (patch) => setBill((current) => ({ ...current, patient: { ...current.patient, ...patch } }));
1291
+ const setOptionalPatient = (key, value) => setBill((current) => {
1292
+ const patient = { ...current.patient };
1293
+ if (value) patient[key] = value;
1294
+ else delete patient[key];
1295
+ return { ...current, patient };
1296
+ });
1297
+ const setAddress = (patch) => setBill((current) => ({
1298
+ ...current,
1299
+ patient: {
1300
+ ...current.patient,
1301
+ address: { ...current.patient.address, ...patch }
1302
+ }
1303
+ }));
1304
+ const setClaim = (patch) => setBill((current) => ({ ...current, claim: { ...current.claim, ...patch } }));
1305
+ const setOptionalClaim = (key, value) => setBill((current) => {
1306
+ const claim = { ...current.claim };
1307
+ if (value) claim[key] = value;
1308
+ else delete claim[key];
1309
+ return { ...current, claim };
1310
+ });
1311
+ const setService = (patch) => setBill((current) => ({ ...current, service: { ...current.service, ...patch } }));
1312
+ const setLine = (index, patch) => setBill((current) => ({
1313
+ ...current,
1314
+ serviceLines: current.serviceLines.map(
1315
+ (line, lineIndex) => lineIndex === index ? { ...line, ...patch } : line
1316
+ )
1317
+ }));
1318
+ const setOptionalLineNumber = (index, key, value) => setBill((current) => ({
1319
+ ...current,
1320
+ serviceLines: current.serviceLines.map((line, lineIndex) => {
1321
+ if (lineIndex !== index) return line;
1322
+ const next = { ...line };
1323
+ if (value === "") delete next[key];
1324
+ else next[key] = Number(value);
1325
+ return next;
1326
+ })
1327
+ }));
1328
+ const textInput = (value, onChange, options) => /* @__PURE__ */ jsx2(
1329
+ "input",
1330
+ {
1331
+ style: styles.input,
1332
+ value: inputValue(value),
1333
+ disabled: locked,
1334
+ onChange: (event) => onChange(event.target.value),
1335
+ ...options
1336
+ }
1337
+ );
1338
+ async function submit() {
1339
+ const validation = validateBillSubmission(bill);
1340
+ setErrors(validation.fieldErrors);
1341
+ setFormError(null);
1342
+ if (!validation.valid) {
1343
+ setFormError("Complete the required fields before submitting.");
1344
+ return;
1345
+ }
1346
+ if (selectedIds.length + uploads.length > MAX_DOCUMENTS) {
1347
+ setFormError(`A bill can include at most ${MAX_DOCUMENTS} attachments.`);
1348
+ return;
1349
+ }
1350
+ setSubmitting(true);
1351
+ try {
1352
+ await onSubmit({ bill: cloneBill(bill), sourceAttachmentIds: selectedIds, uploads });
1353
+ } catch (caught) {
1354
+ setFormError(caught instanceof Error ? caught.message : "Unable to submit the bill.");
1355
+ } finally {
1356
+ setSubmitting(false);
1357
+ }
1358
+ }
1359
+ return /* @__PURE__ */ jsxs2(
1360
+ "form",
1361
+ {
1362
+ className,
1363
+ style: { ...mindBillAppearanceStyle(appearance), ...styles.root, ...style },
1364
+ onSubmit: (event) => {
1365
+ event.preventDefault();
1366
+ void submit();
1367
+ },
1368
+ noValidate: true,
1369
+ children: [
1370
+ /* @__PURE__ */ jsxs2("div", { style: styles.heading, children: [
1371
+ /* @__PURE__ */ jsxs2("div", { children: [
1372
+ /* @__PURE__ */ jsx2("h3", { style: styles.title, children: heading }),
1373
+ /* @__PURE__ */ jsx2("p", { style: styles.copy, children: description })
1374
+ ] }),
1375
+ /* @__PURE__ */ jsxs2("span", { style: styles.requiredNote, children: [
1376
+ /* @__PURE__ */ jsx2(RequiredMark, {}),
1377
+ " Required"
1378
+ ] })
1379
+ ] }),
1380
+ /* @__PURE__ */ jsxs2("fieldset", { style: styles.section, disabled: locked, children: [
1381
+ /* @__PURE__ */ jsx2("legend", { style: styles.legend, children: "Patient" }),
1382
+ /* @__PURE__ */ jsxs2("div", { style: styles.grid, children: [
1383
+ /* @__PURE__ */ jsx2(Field2, { label: "First name", required: true, error: errors["patient.firstName"], children: textInput(bill.patient.firstName, (firstName) => setPatient({ firstName }), { required: true }) }),
1384
+ /* @__PURE__ */ jsx2(Field2, { label: "Middle name", children: textInput(bill.patient.middleName, (middleName) => setPatient({ middleName })) }),
1385
+ /* @__PURE__ */ jsx2(Field2, { label: "Last name", required: true, error: errors["patient.lastName"], children: textInput(bill.patient.lastName, (lastName) => setPatient({ lastName }), { required: true }) }),
1386
+ /* @__PURE__ */ jsx2(Field2, { label: "Date of birth", children: textInput(bill.patient.dateOfBirth, (dateOfBirth) => setOptionalPatient("dateOfBirth", dateOfBirth), { type: "date" }) }),
1387
+ /* @__PURE__ */ jsx2(Field2, { label: "Phone", children: textInput(bill.patient.phone, (phone) => setPatient({ phone }), { type: "tel" }) }),
1388
+ /* @__PURE__ */ jsx2(Field2, { label: "Address", required: true, error: errors["patient.address.line1"], children: textInput(bill.patient.address.line1, (line1) => setAddress({ line1 }), { required: true }) }),
1389
+ /* @__PURE__ */ jsx2(Field2, { label: "City", required: true, error: errors["patient.address.city"], children: textInput(bill.patient.address.city, (city) => setAddress({ city }), { required: true }) }),
1390
+ /* @__PURE__ */ jsx2(Field2, { label: "State", required: true, error: errors["patient.address.state"], children: textInput(bill.patient.address.state, (state) => setAddress({ state }), { required: true, maxLength: 2 }) }),
1391
+ /* @__PURE__ */ jsx2(Field2, { label: "ZIP", required: true, error: errors["patient.address.postalCode"], children: textInput(bill.patient.address.postalCode, (postalCode) => setAddress({ postalCode }), { required: true }) })
1392
+ ] })
1393
+ ] }),
1394
+ /* @__PURE__ */ jsxs2("fieldset", { style: styles.section, disabled: locked, children: [
1395
+ /* @__PURE__ */ jsx2("legend", { style: styles.legend, children: "Claim & service" }),
1396
+ /* @__PURE__ */ jsxs2("div", { style: styles.grid, children: [
1397
+ /* @__PURE__ */ jsx2(Field2, { label: "Claim number", required: true, error: errors["claim.claimNumber"], children: textInput(bill.claim.claimNumber, (claimNumber) => setClaim({ claimNumber }), { required: true }) }),
1398
+ /* @__PURE__ */ jsx2(Field2, { label: "ADJ number", children: textInput(bill.claim.adjNumber, (adjNumber) => setClaim({ adjNumber })) }),
1399
+ /* @__PURE__ */ jsx2(Field2, { label: "Employer", children: textInput(bill.claim.employer, (employer) => setClaim({ employer })) }),
1400
+ /* @__PURE__ */ jsx2(Field2, { label: "Date of injury", children: textInput(bill.claim.dateOfInjury, (dateOfInjury) => setOptionalClaim("dateOfInjury", dateOfInjury), { type: "date" }) }),
1401
+ /* @__PURE__ */ jsx2(Field2, { label: "Claims administrator", children: textInput(bill.claim.claimsAdministrator?.name, (name) => setBill((current) => {
1402
+ const claim = { ...current.claim };
1403
+ if (name) claim.claimsAdministrator = { ...claim.claimsAdministrator, name };
1404
+ else delete claim.claimsAdministrator;
1405
+ return { ...current, claim };
1406
+ })) }),
1407
+ /* @__PURE__ */ jsx2(Field2, { label: "Service date", required: true, error: errors["service.date"], children: textInput(bill.service.date, (date) => setService({ date }), { type: "date", required: true }) }),
1408
+ /* @__PURE__ */ jsx2(Field2, { label: "Diagnoses", children: textInput(diagnoses, (value) => setBill((current) => ({ ...current, diagnoses: value.split(",").map((item) => item.trim()).filter(Boolean) })), { placeholder: "Comma-separated codes" }) })
1409
+ ] })
1410
+ ] }),
1411
+ /* @__PURE__ */ jsxs2("fieldset", { style: styles.section, disabled: locked, children: [
1412
+ /* @__PURE__ */ jsx2("legend", { style: styles.legend, children: "Providers & location" }),
1413
+ /* @__PURE__ */ jsxs2("div", { style: styles.grid, children: [
1414
+ /* @__PURE__ */ jsx2(Field2, { label: "Billing provider", children: textInput(bill.billingProvider?.name, (name) => setBill((current) => ({ ...current, billingProvider: { ...current.billingProvider, name } }))) }),
1415
+ /* @__PURE__ */ jsx2(Field2, { label: "Billing tax ID", children: textInput(bill.billingProvider?.taxId, (taxId) => setBill((current) => ({ ...current, billingProvider: { ...current.billingProvider, taxId } }))) }),
1416
+ /* @__PURE__ */ jsx2(Field2, { label: "Billing NPI", children: textInput(bill.billingProvider?.npi, (npi) => setBill((current) => ({ ...current, billingProvider: { ...current.billingProvider, npi } }))) }),
1417
+ /* @__PURE__ */ jsx2(Field2, { label: "Billing phone", children: textInput(bill.billingProvider?.phone, (phone) => setBill((current) => ({ ...current, billingProvider: { ...current.billingProvider, phone } }))) }),
1418
+ /* @__PURE__ */ jsx2(Field2, { label: "Rendering provider", children: textInput(bill.renderingProvider?.name, (name) => setBill((current) => ({ ...current, renderingProvider: { ...current.renderingProvider, name } }))) }),
1419
+ /* @__PURE__ */ jsx2(Field2, { label: "Specialty", children: textInput(bill.renderingProvider?.specialty, (specialty) => setBill((current) => ({ ...current, renderingProvider: { ...current.renderingProvider, specialty } }))) }),
1420
+ /* @__PURE__ */ jsx2(Field2, { label: "Rendering NPI", children: textInput(bill.renderingProvider?.npi, (npi) => setBill((current) => ({ ...current, renderingProvider: { ...current.renderingProvider, npi } }))) }),
1421
+ /* @__PURE__ */ jsx2(Field2, { label: "License number", children: textInput(bill.renderingProvider?.licenseNumber, (licenseNumber) => setBill((current) => ({ ...current, renderingProvider: { ...current.renderingProvider, licenseNumber } }))) }),
1422
+ /* @__PURE__ */ jsx2(Field2, { label: "License state", children: textInput(bill.renderingProvider?.licenseState, (licenseState) => setBill((current) => ({ ...current, renderingProvider: { ...current.renderingProvider, licenseState } })), { maxLength: 2 }) }),
1423
+ /* @__PURE__ */ jsx2(Field2, { label: "Service location", children: textInput(bill.serviceLocation?.name, (name) => setBill((current) => ({ ...current, serviceLocation: { ...current.serviceLocation, name } }))) }),
1424
+ /* @__PURE__ */ jsx2(Field2, { label: "Place of service", children: textInput(bill.serviceLocation?.placeOfServiceCode, (placeOfServiceCode) => setBill((current) => ({ ...current, serviceLocation: { ...current.serviceLocation, placeOfServiceCode } })), { maxLength: 2 }) })
1425
+ ] })
1426
+ ] }),
1427
+ /* @__PURE__ */ jsxs2("fieldset", { style: styles.section, disabled: locked, children: [
1428
+ /* @__PURE__ */ jsx2("legend", { style: styles.legend, children: "Service lines" }),
1429
+ /* @__PURE__ */ jsx2("div", { style: styles.tableWrap, children: /* @__PURE__ */ jsxs2("table", { "aria-label": "Service lines", style: styles.table, children: [
1430
+ /* @__PURE__ */ jsx2("thead", { children: /* @__PURE__ */ jsxs2("tr", { children: [
1431
+ /* @__PURE__ */ jsxs2("th", { style: styles.th, children: [
1432
+ "Code",
1433
+ /* @__PURE__ */ jsx2(RequiredMark, {})
1434
+ ] }),
1435
+ /* @__PURE__ */ jsx2("th", { style: styles.th, children: "Modifiers" }),
1436
+ /* @__PURE__ */ jsxs2("th", { style: styles.th, children: [
1437
+ "Units",
1438
+ /* @__PURE__ */ jsx2(RequiredMark, {})
1439
+ ] }),
1440
+ bill.billingMode === "professional" ? /* @__PURE__ */ jsxs2("th", { style: styles.th, children: [
1441
+ "Charge",
1442
+ /* @__PURE__ */ jsx2(RequiredMark, {})
1443
+ ] }) : null,
1444
+ /* @__PURE__ */ jsx2("th", { style: styles.th, "aria-label": "Actions" })
1445
+ ] }) }),
1446
+ /* @__PURE__ */ jsx2("tbody", { children: bill.serviceLines.map((line, index) => /* @__PURE__ */ jsxs2("tr", { children: [
1447
+ /* @__PURE__ */ jsxs2("td", { style: styles.td, children: [
1448
+ textInput(line.code, (code) => setLine(index, { code }), { required: true }),
1449
+ errors[`serviceLines.${index}.code`] ? /* @__PURE__ */ jsx2("span", { style: { color: "var(--mb-danger)", fontSize: 12 }, children: errors[`serviceLines.${index}.code`] }) : null
1450
+ ] }),
1451
+ /* @__PURE__ */ jsx2("td", { style: styles.td, children: textInput((line.modifiers ?? []).join(", "), (value) => setLine(index, { modifiers: value.split(",").map((item) => item.trim()).filter(Boolean) })) }),
1452
+ /* @__PURE__ */ jsxs2("td", { style: styles.td, children: [
1453
+ /* @__PURE__ */ jsx2("input", { style: styles.input, type: "number", min: 1, required: true, value: line.units ?? 1, onChange: (event) => setLine(index, { units: Number(event.target.value) }) }),
1454
+ errors[`serviceLines.${index}.units`] ? /* @__PURE__ */ jsx2("span", { style: { color: "var(--mb-danger)", fontSize: 12 }, children: errors[`serviceLines.${index}.units`] }) : null
1455
+ ] }),
1456
+ bill.billingMode === "professional" ? /* @__PURE__ */ jsxs2("td", { style: styles.td, children: [
1457
+ /* @__PURE__ */ jsx2("input", { style: styles.input, type: "number", min: 0, step: "0.01", required: true, value: line.charge ?? "", onChange: (event) => setOptionalLineNumber(index, "charge", event.target.value) }),
1458
+ errors[`serviceLines.${index}.charge`] ? /* @__PURE__ */ jsx2("span", { style: { color: "var(--mb-danger)", fontSize: 12 }, children: errors[`serviceLines.${index}.charge`] }) : null
1459
+ ] }) : null,
1460
+ /* @__PURE__ */ jsx2("td", { style: styles.td, children: /* @__PURE__ */ jsx2("button", { style: styles.secondaryButton, type: "button", disabled: locked || bill.serviceLines.length === 1, onClick: () => setBill((current) => ({ ...current, serviceLines: current.serviceLines.filter((_, lineIndex) => lineIndex !== index) })), children: "Remove" }) })
1461
+ ] }, index)) })
1462
+ ] }) }),
1463
+ errors.serviceLines ? /* @__PURE__ */ jsx2("p", { style: { color: "var(--mb-danger)", fontSize: 12 }, children: errors.serviceLines }) : null,
1464
+ /* @__PURE__ */ jsx2("button", { style: { ...styles.secondaryButton, marginTop: 12 }, type: "button", disabled: locked, onClick: () => setBill((current) => ({ ...current, serviceLines: [...current.serviceLines, { code: "", modifiers: [], units: 1 }] })), children: "+ Add service line" })
1465
+ ] }),
1466
+ /* @__PURE__ */ jsxs2("fieldset", { style: styles.section, disabled: locked, children: [
1467
+ /* @__PURE__ */ jsx2("legend", { style: styles.legend, children: "Attachments" }),
1468
+ attachments.map((attachment) => /* @__PURE__ */ jsxs2("label", { style: styles.attachment, children: [
1469
+ /* @__PURE__ */ jsx2("input", { type: "checkbox", checked: selectedIds.includes(attachment.id), onChange: (event) => {
1470
+ if (event.target.checked && selectedIds.length + uploads.length >= MAX_DOCUMENTS) {
1471
+ setFormError(`A bill can include at most ${MAX_DOCUMENTS} attachments.`);
1472
+ return;
1473
+ }
1474
+ setSelectedIds((current) => event.target.checked ? [.../* @__PURE__ */ new Set([...current, attachment.id])] : current.filter((id) => id !== attachment.id));
1475
+ } }),
1476
+ /* @__PURE__ */ jsxs2("span", { style: styles.attachmentName, children: [
1477
+ /* @__PURE__ */ jsx2("strong", { children: attachment.fileName }),
1478
+ /* @__PURE__ */ jsx2("span", { style: styles.attachmentMeta, children: attachment.description || documentLabels[attachment.documentType] })
1479
+ ] })
1480
+ ] }, attachment.id)),
1481
+ uploads.map((upload, index) => /* @__PURE__ */ jsxs2("div", { style: styles.attachment, children: [
1482
+ /* @__PURE__ */ jsxs2("span", { style: styles.attachmentName, children: [
1483
+ /* @__PURE__ */ jsx2("strong", { children: upload.file.name }),
1484
+ /* @__PURE__ */ jsxs2("span", { style: styles.attachmentMeta, children: [
1485
+ (upload.file.size / 1024 / 1024).toFixed(1),
1486
+ " MB"
1487
+ ] })
1488
+ ] }),
1489
+ /* @__PURE__ */ jsx2("select", { style: { ...styles.input, width: 180 }, value: upload.documentType, onChange: (event) => setUploads((current) => current.map((item, itemIndex) => itemIndex === index ? { ...item, documentType: event.target.value } : item)), children: BILL_SUBMISSION_DOCUMENT_TYPES.map((type) => /* @__PURE__ */ jsx2("option", { value: type, children: documentLabels[type] }, type)) }),
1490
+ /* @__PURE__ */ jsx2("button", { style: styles.secondaryButton, type: "button", onClick: () => setUploads((current) => current.filter((_, itemIndex) => itemIndex !== index)), children: "Remove" })
1491
+ ] }, `${upload.file.name}-${index}`)),
1492
+ !attachments.length && !uploads.length ? /* @__PURE__ */ jsx2("p", { style: styles.copy, children: "No attachments added." }) : null,
1493
+ /* @__PURE__ */ jsxs2("label", { style: { ...styles.secondaryButton, display: "inline-flex", alignItems: "center", marginTop: 14 }, children: [
1494
+ "Add PDF attachments",
1495
+ /* @__PURE__ */ jsx2("input", { hidden: true, type: "file", accept: "application/pdf,.pdf", multiple: true, onChange: (event) => {
1496
+ const files = Array.from(event.target.files ?? []);
1497
+ event.target.value = "";
1498
+ setFormError(null);
1499
+ const invalid = files.find((file) => file.type !== "application/pdf" && !file.name.toLowerCase().endsWith(".pdf"));
1500
+ if (invalid) return setFormError(`${invalid.name} is not a PDF.`);
1501
+ const oversized = files.find((file) => file.size > MAX_PDF_BYTES);
1502
+ if (oversized) return setFormError(`${oversized.name} is larger than 25 MB.`);
1503
+ const nextBytes = [...uploads.map((item) => item.file), ...files].reduce((sum, file) => sum + file.size, 0);
1504
+ if (nextBytes > MAX_UPLOAD_BYTES) return setFormError("Attachments exceed the 100 MB upload limit.");
1505
+ if (selectedIds.length + uploads.length + files.length > MAX_DOCUMENTS) return setFormError(`A bill can include at most ${MAX_DOCUMENTS} attachments.`);
1506
+ setUploads((current) => [...current, ...files.map((file) => ({ file, documentType: "other" }))]);
1507
+ } })
1508
+ ] })
1509
+ ] }),
1510
+ formError ? /* @__PURE__ */ jsx2("div", { style: styles.error, role: "alert", children: formError }) : null,
1511
+ /* @__PURE__ */ jsx2("div", { style: styles.actions, children: /* @__PURE__ */ jsx2("button", { style: { ...styles.submit, opacity: locked ? 0.65 : 1 }, type: "submit", disabled: locked, children: submitting ? "Submitting\u2026" : submitLabel }) })
1512
+ ]
1513
+ }
1514
+ );
1515
+ }
1516
+
1038
1517
  // src/connected-bill-status.tsx
1039
1518
  import {
1040
1519
  useCallback,
1041
- useEffect as useEffect2,
1042
- useMemo as useMemo2,
1520
+ useEffect as useEffect3,
1521
+ useMemo as useMemo3,
1043
1522
  useRef as useRef2,
1044
- useState as useState2
1523
+ useState as useState3
1045
1524
  } from "react";
1046
1525
  import {
1047
1526
  DEFAULT_API_BASE_URL,
1048
1527
  DEFAULT_SESSION_ENDPOINT
1049
1528
  } from "@mindbill/browser";
1050
- import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
1529
+ import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
1051
1530
  var DEFAULT_REFRESH_INTERVAL = 6e4;
1052
1531
  async function responseError(response, fallback) {
1053
1532
  const body = await response.json().catch(() => null);
@@ -1180,23 +1659,23 @@ function useBillStatus({
1180
1659
  initialData = null,
1181
1660
  fetch: fetchOverride
1182
1661
  }) {
1183
- const client = useMemo2(() => createBillStatusClient({
1662
+ const client = useMemo3(() => createBillStatusClient({
1184
1663
  billId,
1185
1664
  sessionEndpoint,
1186
1665
  ...getSession ? { getSession } : {},
1187
1666
  apiBaseUrl,
1188
1667
  ...fetchOverride ? { fetch: fetchOverride } : {}
1189
1668
  }), [apiBaseUrl, billId, fetchOverride, getSession, sessionEndpoint]);
1190
- const [data, setData] = useState2(initialData);
1191
- const [error, setError] = useState2(null);
1192
- const [isLoading, setIsLoading] = useState2(enabled && !initialData);
1193
- const [isRefreshing, setIsRefreshing] = useState2(false);
1669
+ const [data, setData] = useState3(initialData);
1670
+ const [error, setError] = useState3(null);
1671
+ const [isLoading, setIsLoading] = useState3(enabled && !initialData);
1672
+ const [isRefreshing, setIsRefreshing] = useState3(false);
1194
1673
  const dataRef = useRef2(initialData);
1195
1674
  const initialDataRef = useRef2(initialData);
1196
1675
  initialDataRef.current = initialData;
1197
1676
  const activeControllerRef = useRef2(null);
1198
1677
  const requestSequence = useRef2(0);
1199
- useEffect2(() => {
1678
+ useEffect3(() => {
1200
1679
  const seed = initialDataRef.current;
1201
1680
  dataRef.current = seed;
1202
1681
  setData(seed);
@@ -1237,10 +1716,10 @@ function useBillStatus({
1237
1716
  }
1238
1717
  }
1239
1718
  }, [billId, client, enabled]);
1240
- useEffect2(() => {
1719
+ useEffect3(() => {
1241
1720
  if (enabled) void load();
1242
1721
  }, [enabled, load]);
1243
- useEffect2(() => {
1722
+ useEffect3(() => {
1244
1723
  if (!enabled || refreshInterval <= 0) return;
1245
1724
  const timer = window.setInterval(() => void load(), refreshInterval);
1246
1725
  const onFocus = () => void load();
@@ -1268,17 +1747,17 @@ function ConnectedBillStatus({
1268
1747
  }) {
1269
1748
  const status = useBillStatus(options);
1270
1749
  if (status.isLoading && !status.data) {
1271
- return /* @__PURE__ */ jsx2(Fragment2, { children: loadingFallback ?? /* @__PURE__ */ jsx2("div", { role: "status", children: "Loading bill status\u2026" }) });
1750
+ return /* @__PURE__ */ jsx3(Fragment2, { children: loadingFallback ?? /* @__PURE__ */ jsx3("div", { role: "status", children: "Loading bill status\u2026" }) });
1272
1751
  }
1273
1752
  if (status.error && !status.data) {
1274
- return /* @__PURE__ */ jsx2(Fragment2, { children: errorFallback?.(status.error, status.refresh) ?? /* @__PURE__ */ jsxs2("div", { role: "alert", children: [
1753
+ return /* @__PURE__ */ jsx3(Fragment2, { children: errorFallback?.(status.error, status.refresh) ?? /* @__PURE__ */ jsxs3("div", { role: "alert", children: [
1275
1754
  status.error.message,
1276
1755
  " ",
1277
- /* @__PURE__ */ jsx2("button", { type: "button", onClick: () => void status.refresh(), children: "Retry" })
1756
+ /* @__PURE__ */ jsx3("button", { type: "button", onClick: () => void status.refresh(), children: "Retry" })
1278
1757
  ] }) });
1279
1758
  }
1280
1759
  if (!status.data) return null;
1281
- return /* @__PURE__ */ jsx2(
1760
+ return /* @__PURE__ */ jsx3(
1282
1761
  BillStatusSummary,
1283
1762
  {
1284
1763
  status: status.data.state,
@@ -1297,7 +1776,7 @@ function ConnectedBillStatus({
1297
1776
  }
1298
1777
 
1299
1778
  // src/bill-lifecycle-surfaces.tsx
1300
- import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
1779
+ import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
1301
1780
  function visibleBillLifecycleActions(actions, showUnavailable = false) {
1302
1781
  return actions.filter((action) => action.enabled || showUnavailable);
1303
1782
  }
@@ -1312,30 +1791,13 @@ function BillLifecycleActions({
1312
1791
  }) {
1313
1792
  const visible = visibleBillLifecycleActions(actions, showUnavailable);
1314
1793
  if (!visible.length) return null;
1315
- return /* @__PURE__ */ jsxs3(
1316
- "div",
1317
- {
1318
- className: ["mb-lifecycle-actions", className].filter(Boolean).join(" "),
1319
- style: mindBillAppearanceStyle(appearance, style),
1320
- "aria-label": "Bill actions",
1321
- children: [
1322
- /* @__PURE__ */ jsx3("style", { children: lifecycleSurfaceStyles }),
1323
- visible.map((action) => /* @__PURE__ */ jsxs3("div", { className: "mb-lifecycle-action", children: [
1324
- /* @__PURE__ */ jsx3(
1325
- "button",
1326
- {
1327
- type: "button",
1328
- className: action.primary ? "mb-action-button is-primary" : "mb-action-button",
1329
- disabled: disabled || !action.enabled,
1330
- onClick: () => onAction(action),
1331
- children: action.label
1332
- }
1333
- ),
1334
- !action.enabled && action.reason ? /* @__PURE__ */ jsx3("span", { className: "mb-action-reason", children: action.reason }) : null
1335
- ] }, action.id))
1336
- ]
1337
- }
1338
- );
1794
+ return /* @__PURE__ */ jsxs4("div", { className: classes("mb-lifecycle-actions", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill actions", children: [
1795
+ /* @__PURE__ */ jsx4("style", { children: lifecycleSurfaceStyles }),
1796
+ visible.map((action) => /* @__PURE__ */ jsxs4("div", { className: "mb-lifecycle-action", children: [
1797
+ /* @__PURE__ */ jsx4("button", { type: "button", className: action.primary ? "mb-action-button is-primary" : "mb-action-button", disabled: disabled || !action.enabled, onClick: () => onAction(action), children: action.label }),
1798
+ !action.enabled && action.reason ? /* @__PURE__ */ jsx4("span", { className: "mb-action-reason", children: action.reason }) : null
1799
+ ] }, action.id))
1800
+ ] });
1339
1801
  }
1340
1802
  var activityLabels = {
1341
1803
  "bill.created": "Bill created",
@@ -1362,72 +1824,198 @@ function billActivityEventLabel(type) {
1362
1824
  function defaultFormatDate(createdAt) {
1363
1825
  const parsed = new Date(createdAt);
1364
1826
  if (Number.isNaN(parsed.getTime())) return createdAt;
1365
- return new Intl.DateTimeFormat(void 0, {
1366
- dateStyle: "medium",
1367
- timeStyle: "short"
1368
- }).format(parsed);
1827
+ return new Intl.DateTimeFormat(void 0, { dateStyle: "medium", timeStyle: "short" }).format(parsed);
1369
1828
  }
1370
- function BillActivityTimeline({
1371
- events,
1372
- emptyLabel = "No bill activity yet.",
1373
- appearance,
1374
- className,
1375
- style,
1376
- formatDate = defaultFormatDate
1377
- }) {
1378
- return /* @__PURE__ */ jsxs3(
1379
- "section",
1380
- {
1381
- className: ["mb-activity", className].filter(Boolean).join(" "),
1382
- style: mindBillAppearanceStyle(appearance, style),
1383
- "aria-label": "Bill activity",
1384
- children: [
1385
- /* @__PURE__ */ jsx3("style", { children: lifecycleSurfaceStyles }),
1386
- !events.length ? /* @__PURE__ */ jsx3("p", { className: "mb-activity-empty", children: emptyLabel }) : /* @__PURE__ */ jsx3("ol", { className: "mb-activity-list", children: events.map((event) => /* @__PURE__ */ jsxs3("li", { className: "mb-activity-item", children: [
1387
- /* @__PURE__ */ jsx3("span", { className: "mb-activity-marker", "aria-hidden": "true" }),
1388
- /* @__PURE__ */ jsxs3("div", { className: "mb-activity-content", children: [
1389
- /* @__PURE__ */ jsx3("strong", { children: event.title ?? billActivityEventLabel(event.type) }),
1390
- event.description ? /* @__PURE__ */ jsx3("p", { children: event.description }) : null,
1391
- /* @__PURE__ */ jsxs3("span", { children: [
1392
- formatDate(event.createdAt),
1393
- event.actor ? ` \xB7 ${event.actor}` : ""
1394
- ] })
1395
- ] })
1396
- ] }, event.id)) })
1397
- ]
1398
- }
1399
- );
1829
+ function BillActivityTimeline({ events, emptyLabel = "No bill activity yet.", appearance, className, style, formatDate = defaultFormatDate }) {
1830
+ return /* @__PURE__ */ jsxs4("section", { className: classes("mb-surface mb-activity", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill activity", children: [
1831
+ /* @__PURE__ */ jsx4("style", { children: lifecycleSurfaceStyles }),
1832
+ /* @__PURE__ */ jsxs4("header", { className: "mb-surface-heading", children: [
1833
+ /* @__PURE__ */ jsxs4("div", { children: [
1834
+ /* @__PURE__ */ jsx4("strong", { children: "Bill history" }),
1835
+ /* @__PURE__ */ jsx4("span", { children: "Submission, payer responses, follow-up, and payments." })
1836
+ ] }),
1837
+ /* @__PURE__ */ jsx4("span", { children: events.length })
1838
+ ] }),
1839
+ !events.length ? /* @__PURE__ */ jsx4("p", { className: "mb-activity-empty", children: emptyLabel }) : /* @__PURE__ */ jsx4("ol", { className: "mb-activity-list", children: events.map((event) => /* @__PURE__ */ jsxs4("li", { className: "mb-activity-item", children: [
1840
+ /* @__PURE__ */ jsx4("span", { className: "mb-activity-marker", "aria-hidden": "true" }),
1841
+ /* @__PURE__ */ jsxs4("div", { className: "mb-activity-content", children: [
1842
+ /* @__PURE__ */ jsx4("strong", { children: event.title ?? billActivityEventLabel(event.type) }),
1843
+ event.description ? /* @__PURE__ */ jsx4("p", { children: event.description }) : null,
1844
+ /* @__PURE__ */ jsxs4("span", { children: [
1845
+ formatDate(event.createdAt),
1846
+ event.actor ? ` \xB7 ${event.actor}` : ""
1847
+ ] })
1848
+ ] })
1849
+ ] }, event.id)) })
1850
+ ] });
1851
+ }
1852
+ var lifecycleStages = [
1853
+ { id: "created", label: "Created" },
1854
+ { id: "submitted", label: "Submitted" },
1855
+ { id: "accepted", label: "Accepted" },
1856
+ { id: "response", label: "Payer response" },
1857
+ { id: "follow_up", label: "Follow-up" },
1858
+ { id: "closed", label: "Closed" }
1859
+ ];
1860
+ function billLifecycleStage(state) {
1861
+ const value = state.toLowerCase();
1862
+ if (value.includes("closed") || value.includes("written_off")) return "closed";
1863
+ if (value.includes("second_review") || value.includes("ibr") || value.includes("lien") || value.includes("appeal")) return "follow_up";
1864
+ if (value.includes("processed") || value.includes("paid") || value.includes("denied") || value.includes("rejected") || value.includes("response")) return "response";
1865
+ if (value.includes("accepted")) return "accepted";
1866
+ if (value.includes("submitted") || value.includes("queued") || value.includes("sent")) return "submitted";
1867
+ return "created";
1868
+ }
1869
+ function BillLifecycleProgress({ state, nativeStatus, submittedAt, agingDays, appearance, className, style }) {
1870
+ const current = billLifecycleStage(state);
1871
+ const currentIndex = lifecycleStages.findIndex((stage) => stage.id === current);
1872
+ return /* @__PURE__ */ jsxs4("section", { className: classes("mb-surface mb-progress", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill lifecycle", children: [
1873
+ /* @__PURE__ */ jsx4("style", { children: lifecycleSurfaceStyles }),
1874
+ /* @__PURE__ */ jsx4("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs4("div", { children: [
1875
+ /* @__PURE__ */ jsx4("strong", { children: humanize(nativeStatus || state) }),
1876
+ /* @__PURE__ */ jsxs4("span", { children: [
1877
+ submittedAt ? `Submitted ${defaultFormatDate(submittedAt)}` : "Not submitted",
1878
+ typeof agingDays === "number" ? ` \xB7 ${agingDays} days old` : ""
1879
+ ] })
1880
+ ] }) }),
1881
+ /* @__PURE__ */ jsx4("ol", { className: "mb-progress-list", children: lifecycleStages.map((stage, index) => {
1882
+ const status = index < currentIndex ? "complete" : index === currentIndex ? "current" : "upcoming";
1883
+ return /* @__PURE__ */ jsxs4("li", { className: `is-${status}`, "aria-current": status === "current" ? "step" : void 0, children: [
1884
+ /* @__PURE__ */ jsx4("span", { "aria-hidden": "true", children: status === "complete" ? "\u2713" : index + 1 }),
1885
+ /* @__PURE__ */ jsx4("b", { children: stage.label })
1886
+ ] }, stage.id);
1887
+ }) })
1888
+ ] });
1889
+ }
1890
+ function BillSnapshotSummary({ bill, patient, injury, delivery, appearance, className, style }) {
1891
+ const values = [
1892
+ ["Patient", patient.name || [patient.firstName, patient.lastName].filter(Boolean).join(" ")],
1893
+ ["Claim", injury.claimNumber || "\u2014"],
1894
+ ["Payer", delivery.payerName || injury.claimsAdminName || "\u2014"],
1895
+ ["Date of service", bill.dos || "\u2014"],
1896
+ ["Charged", currency(bill.totalCharge)],
1897
+ ["Balance", currency(bill.balanceDue)]
1898
+ ];
1899
+ return /* @__PURE__ */ jsxs4("section", { className: classes("mb-surface mb-snapshot", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill snapshot", children: [
1900
+ /* @__PURE__ */ jsx4("style", { children: lifecycleSurfaceStyles }),
1901
+ /* @__PURE__ */ jsx4("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs4("div", { children: [
1902
+ /* @__PURE__ */ jsx4("strong", { children: "Bill snapshot" }),
1903
+ /* @__PURE__ */ jsxs4("span", { children: [
1904
+ "Bill #",
1905
+ bill.billNumber
1906
+ ] })
1907
+ ] }) }),
1908
+ /* @__PURE__ */ jsx4("dl", { children: values.map(([label, value]) => /* @__PURE__ */ jsxs4("div", { children: [
1909
+ /* @__PURE__ */ jsx4("dt", { children: label }),
1910
+ /* @__PURE__ */ jsx4("dd", { children: value })
1911
+ ] }, label)) })
1912
+ ] });
1913
+ }
1914
+ function BillRemittanceCard({ remittance, appearance, className, style }) {
1915
+ return /* @__PURE__ */ jsxs4("section", { className: classes("mb-surface mb-remittance", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Remittance summary", children: [
1916
+ /* @__PURE__ */ jsx4("style", { children: lifecycleSurfaceStyles }),
1917
+ /* @__PURE__ */ jsx4("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs4("div", { children: [
1918
+ /* @__PURE__ */ jsx4("strong", { children: "Remittance" }),
1919
+ /* @__PURE__ */ jsx4("span", { children: "Amounts reported by the payer and posted to the bill." })
1920
+ ] }) }),
1921
+ /* @__PURE__ */ jsxs4("dl", { children: [
1922
+ /* @__PURE__ */ jsxs4("div", { children: [
1923
+ /* @__PURE__ */ jsx4("dt", { children: "Payer reported" }),
1924
+ /* @__PURE__ */ jsx4("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
1925
+ ] }),
1926
+ /* @__PURE__ */ jsxs4("div", { children: [
1927
+ /* @__PURE__ */ jsx4("dt", { children: "Posted" }),
1928
+ /* @__PURE__ */ jsx4("dd", { children: currency(remittance.totalPaid) })
1929
+ ] }),
1930
+ /* @__PURE__ */ jsxs4("div", { children: [
1931
+ /* @__PURE__ */ jsx4("dt", { children: "Balance" }),
1932
+ /* @__PURE__ */ jsx4("dd", { children: currency(remittance.balanceDue) })
1933
+ ] })
1934
+ ] }),
1935
+ remittance.denialReason ? /* @__PURE__ */ jsxs4("div", { className: "mb-denial", children: [
1936
+ /* @__PURE__ */ jsx4("strong", { children: "Denial reason" }),
1937
+ /* @__PURE__ */ jsx4("p", { children: remittance.denialReason })
1938
+ ] }) : null
1939
+ ] });
1940
+ }
1941
+ function BillPayerContactCard({ delivery, appearance, className, style }) {
1942
+ const contacts = [
1943
+ delivery.contacts.adjusterName ? ["Adjuster", delivery.contacts.adjusterName, null] : null,
1944
+ delivery.contacts.adjusterPhone ? ["Adjuster phone", delivery.contacts.adjusterPhone, `tel:${delivery.contacts.adjusterPhone}`] : null,
1945
+ delivery.contacts.adjusterEmail ? ["Adjuster email", delivery.contacts.adjusterEmail, `mailto:${delivery.contacts.adjusterEmail}`] : null,
1946
+ delivery.contacts.faxNumber ? ["Fax", delivery.contacts.faxNumber, `tel:${delivery.contacts.faxNumber}`] : null,
1947
+ delivery.contacts.claimsEmail ? ["Email", delivery.contacts.claimsEmail, `mailto:${delivery.contacts.claimsEmail}`] : null,
1948
+ delivery.contacts.mailingAddress ? ["Mail", delivery.contacts.mailingAddress, null] : null,
1949
+ delivery.contacts.portalUrl ? ["Portal", "Open payer portal", delivery.contacts.portalUrl] : null
1950
+ ].filter(Boolean);
1951
+ if (!delivery.payerName && !contacts.length) return null;
1952
+ return /* @__PURE__ */ jsxs4("section", { className: classes("mb-surface mb-contacts", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payer contact information", children: [
1953
+ /* @__PURE__ */ jsx4("style", { children: lifecycleSurfaceStyles }),
1954
+ /* @__PURE__ */ jsx4("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs4("div", { children: [
1955
+ /* @__PURE__ */ jsx4("strong", { children: delivery.payerName || "Claims administrator" }),
1956
+ /* @__PURE__ */ jsx4("span", { children: "Billing and follow-up contacts." })
1957
+ ] }) }),
1958
+ !contacts.length ? /* @__PURE__ */ jsx4("p", { className: "mb-empty", children: "No payer contact details are available." }) : /* @__PURE__ */ jsx4("dl", { children: contacts.map(([label, value, href]) => /* @__PURE__ */ jsxs4("div", { children: [
1959
+ /* @__PURE__ */ jsx4("dt", { children: label }),
1960
+ /* @__PURE__ */ jsx4("dd", { children: href ? /* @__PURE__ */ jsx4("a", { href, target: label === "Portal" ? "_blank" : void 0, rel: label === "Portal" ? "noreferrer noopener" : void 0, children: value }) : value })
1961
+ ] }, label)) })
1962
+ ] });
1963
+ }
1964
+ function BillPaymentLedger({ payments, appearance, className, style }) {
1965
+ return /* @__PURE__ */ jsxs4("section", { className: classes("mb-surface mb-payments", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payment ledger", children: [
1966
+ /* @__PURE__ */ jsx4("style", { children: lifecycleSurfaceStyles }),
1967
+ /* @__PURE__ */ jsxs4("header", { className: "mb-surface-heading", children: [
1968
+ /* @__PURE__ */ jsxs4("div", { children: [
1969
+ /* @__PURE__ */ jsx4("strong", { children: "Payments" }),
1970
+ /* @__PURE__ */ jsx4("span", { children: "Payments posted to this bill." })
1971
+ ] }),
1972
+ /* @__PURE__ */ jsx4("span", { children: payments.length })
1973
+ ] }),
1974
+ !payments.length ? /* @__PURE__ */ jsx4("p", { className: "mb-empty", children: "No payments posted." }) : /* @__PURE__ */ jsx4("div", { className: "mb-payment-list", children: payments.map((payment) => /* @__PURE__ */ jsxs4("article", { children: [
1975
+ /* @__PURE__ */ jsxs4("div", { children: [
1976
+ /* @__PURE__ */ jsx4("strong", { children: currency(payment.amount) }),
1977
+ /* @__PURE__ */ jsxs4("span", { children: [
1978
+ humanize(payment.status || "posted"),
1979
+ " \xB7 ",
1980
+ payment.method.toUpperCase()
1981
+ ] })
1982
+ ] }),
1983
+ /* @__PURE__ */ jsxs4("div", { children: [
1984
+ /* @__PURE__ */ jsx4("span", { children: payment.checkNumber ? `#${payment.checkNumber}` : payment.source.toUpperCase() }),
1985
+ /* @__PURE__ */ jsx4("span", { children: payment.depositDate || defaultFormatDate(payment.postedAt) })
1986
+ ] }),
1987
+ payment.note ? /* @__PURE__ */ jsx4("p", { children: payment.note }) : null
1988
+ ] }, payment.id)) })
1989
+ ] });
1990
+ }
1991
+ function classes(base, className) {
1992
+ return [base, className].filter(Boolean).join(" ");
1993
+ }
1994
+ function humanize(value) {
1995
+ return value.replace(/[._-]+/g, " ").replace(/\b\w/g, (character) => character.toUpperCase());
1996
+ }
1997
+ function currency(value) {
1998
+ return new Intl.NumberFormat(void 0, { style: "currency", currency: "USD" }).format(value);
1400
1999
  }
1401
2000
  var lifecycleSurfaceStyles = `
1402
- .mb-lifecycle-actions,.mb-activity{box-sizing:border-box;color:var(--mb-text);font-family:var(--mb-font,ui-sans-serif,system-ui,sans-serif)}
1403
- .mb-lifecycle-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-start}
1404
- .mb-lifecycle-action{display:grid;gap:5px;max-width:260px}
1405
- .mb-action-button{appearance:none;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius,8px);background:var(--mb-surface);color:var(--mb-text);font:inherit;font-weight:700;line-height:1.2;padding:11px 15px;cursor:pointer}
1406
- .mb-action-button:hover:not(:disabled){border-color:var(--mb-accent);color:var(--mb-accent)}
1407
- .mb-action-button:focus-visible{outline:3px solid color-mix(in srgb,var(--mb-accent) 28%,transparent);outline-offset:2px}
1408
- .mb-action-button.is-primary{background:var(--mb-accent);border-color:var(--mb-accent);color:var(--mb-accent-contrast)}
1409
- .mb-action-button:disabled{cursor:not-allowed;opacity:.55}
1410
- .mb-action-reason{color:var(--mb-muted);font-size:12px;line-height:1.35}
1411
- .mb-activity{background:var(--mb-surface);border:1px solid var(--mb-border);border-radius:var(--mb-radius,12px);box-shadow:var(--mb-shadow);padding:20px}
1412
- .mb-activity-list{list-style:none;margin:0;padding:0}
1413
- .mb-activity-item{display:grid;grid-template-columns:18px minmax(0,1fr);gap:12px;position:relative;padding:0 0 22px}
1414
- .mb-activity-item:last-child{padding-bottom:0}
1415
- .mb-activity-item:not(:last-child)::before{background:var(--mb-border);content:"";left:8px;position:absolute;top:10px;bottom:0;width:1px}
1416
- .mb-activity-marker{background:var(--mb-surface);border:3px solid var(--mb-accent);border-radius:999px;height:11px;margin-top:4px;position:relative;width:11px;z-index:1}
1417
- .mb-activity-content{display:grid;gap:4px;min-width:0}
1418
- .mb-activity-content strong{font-size:15px;line-height:1.35}
1419
- .mb-activity-content p{color:var(--mb-text);font-size:14px;line-height:1.5;margin:0}
1420
- .mb-activity-content span,.mb-activity-empty{color:var(--mb-muted);font-size:13px;line-height:1.45}
1421
- .mb-activity-empty{margin:0}
2001
+ .mb-lifecycle-actions,.mb-surface{box-sizing:border-box;color:var(--mb-text);font-family:var(--mb-font,ui-sans-serif,system-ui,sans-serif)}
2002
+ .mb-surface *{box-sizing:border-box}.mb-surface{background:var(--mb-surface);border:1px solid var(--mb-border);border-radius:var(--mb-radius,12px);box-shadow:var(--mb-shadow);padding:20px}
2003
+ .mb-surface-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:16px}.mb-surface-heading>div{display:grid;gap:2px}.mb-surface-heading strong{font-size:16px}.mb-surface-heading span,.mb-empty{color:var(--mb-muted);font-size:13px}.mb-surface-heading>span{border-radius:999px;background:var(--mb-soft);font-weight:750;padding:4px 8px}
2004
+ .mb-lifecycle-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-start}.mb-lifecycle-action{display:grid;gap:5px;max-width:260px}.mb-action-button{appearance:none;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius,8px);background:var(--mb-surface);color:var(--mb-text);font:inherit;font-weight:700;line-height:1.2;padding:11px 15px;cursor:pointer}.mb-action-button:hover:not(:disabled){border-color:var(--mb-accent);color:var(--mb-accent)}.mb-action-button:focus-visible{outline:3px solid color-mix(in srgb,var(--mb-accent) 28%,transparent);outline-offset:2px}.mb-action-button.is-primary{background:var(--mb-accent);border-color:var(--mb-accent);color:var(--mb-accent-contrast)}.mb-action-button:disabled{cursor:not-allowed;opacity:.55}.mb-action-reason{color:var(--mb-muted);font-size:12px;line-height:1.35}
2005
+ .mb-activity-list{list-style:none;margin:0;padding:0}.mb-activity-item{display:grid;grid-template-columns:18px minmax(0,1fr);gap:12px;position:relative;padding:0 0 22px}.mb-activity-item:last-child{padding-bottom:0}.mb-activity-item:not(:last-child)::before{background:var(--mb-border);content:"";left:8px;position:absolute;top:10px;bottom:0;width:1px}.mb-activity-marker{background:var(--mb-surface);border:3px solid var(--mb-accent);border-radius:999px;height:11px;margin-top:4px;position:relative;width:11px;z-index:1}.mb-activity-content{display:grid;gap:4px;min-width:0}.mb-activity-content strong{font-size:15px;line-height:1.35}.mb-activity-content p{color:var(--mb-text);font-size:14px;line-height:1.5;margin:0}.mb-activity-content span,.mb-activity-empty{color:var(--mb-muted);font-size:13px;line-height:1.45}.mb-activity-empty,.mb-empty{margin:0}
2006
+ .mb-progress-list{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));list-style:none;margin:0;padding:0}.mb-progress-list li{display:grid;gap:7px;position:relative;text-align:center;color:var(--mb-muted);font-size:12px}.mb-progress-list li:not(:last-child)::after{content:"";position:absolute;left:calc(50% + 14px);right:calc(-50% + 14px);top:13px;height:2px;background:var(--mb-border)}.mb-progress-list li.is-complete:not(:last-child)::after{background:var(--mb-accent)}.mb-progress-list li>span{display:grid;place-items:center;justify-self:center;position:relative;z-index:1;width:28px;height:28px;border:2px solid var(--mb-border);border-radius:50%;background:var(--mb-surface);font-weight:800}.mb-progress-list li.is-complete>span,.mb-progress-list li.is-current>span{border-color:var(--mb-accent);background:var(--mb-accent);color:var(--mb-accent-contrast)}.mb-progress-list li.is-current{color:var(--mb-text)}
2007
+ .mb-snapshot dl,.mb-remittance dl,.mb-contacts dl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;margin:0}.mb-snapshot dl>div,.mb-remittance dl>div,.mb-contacts dl>div{display:grid;gap:3px;padding:10px 14px;border-left:1px solid var(--mb-border)}.mb-snapshot dl>div:nth-child(3n+1),.mb-remittance dl>div:first-child,.mb-contacts dl>div:first-child{border-left:0}.mb-snapshot dt,.mb-remittance dt,.mb-contacts dt{color:var(--mb-muted);font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.mb-snapshot dd,.mb-remittance dd,.mb-contacts dd{font-size:14px;font-weight:750;margin:0;overflow-wrap:anywhere}.mb-contacts a{color:var(--mb-accent)}.mb-denial{margin-top:16px;border-left:4px solid var(--mb-danger);border-radius:var(--mb-control-radius);background:color-mix(in srgb,var(--mb-danger) 8%,var(--mb-surface));padding:12px 14px}.mb-denial p{margin:4px 0 0}
2008
+ .mb-payment-list{display:grid}.mb-payment-list article{display:grid;grid-template-columns:1fr auto;gap:5px 18px;padding:12px 0;border-top:1px solid var(--mb-border)}.mb-payment-list article:first-child{border-top:0}.mb-payment-list article>div{display:grid;gap:2px}.mb-payment-list article>div:nth-child(2){text-align:right}.mb-payment-list article span{color:var(--mb-muted);font-size:12px}.mb-payment-list article p{grid-column:1/-1;margin:0;color:var(--mb-muted);font-size:13px}
2009
+ @media(max-width:700px){.mb-progress-list{grid-template-columns:1fr;text-align:left}.mb-progress-list li{grid-template-columns:28px 1fr;align-items:center;text-align:left}.mb-progress-list li:not(:last-child)::after{left:13px;right:auto;top:28px;bottom:-7px;width:2px;height:auto}.mb-progress-list li>span{grid-row:1}.mb-snapshot dl,.mb-remittance dl,.mb-contacts dl{grid-template-columns:1fr 1fr}.mb-snapshot dl>div,.mb-remittance dl>div,.mb-contacts dl>div{border:0;border-top:1px solid var(--mb-border);padding:10px 0}.mb-snapshot dl>div:nth-child(-n+2),.mb-remittance dl>div:nth-child(-n+2),.mb-contacts dl>div:nth-child(-n+2){border-top:0}.mb-payment-list article{grid-template-columns:1fr}.mb-payment-list article>div:nth-child(2){text-align:left}}
1422
2010
  `;
1423
2011
 
1424
2012
  // src/connected-bill-lifecycle.tsx
1425
2013
  import {
1426
2014
  useCallback as useCallback2,
1427
- useEffect as useEffect3,
1428
- useMemo as useMemo3,
2015
+ useEffect as useEffect4,
2016
+ useMemo as useMemo4,
1429
2017
  useRef as useRef3,
1430
- useState as useState3
2018
+ useState as useState4
1431
2019
  } from "react";
1432
2020
  import {
1433
2021
  DEFAULT_API_BASE_URL as DEFAULT_API_BASE_URL2,
@@ -1435,7 +2023,7 @@ import {
1435
2023
  createBillLifecycleClient
1436
2024
  } from "@mindbill/browser";
1437
2025
  import { createBillLifecycleClient as createBillLifecycleClient2 } from "@mindbill/browser";
1438
- import { Fragment as Fragment3, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
2026
+ import { Fragment as Fragment3, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
1439
2027
  var DEFAULT_REFRESH_INTERVAL2 = 6e4;
1440
2028
  function openPdf(blob, filename) {
1441
2029
  const url = URL.createObjectURL(blob);
@@ -1449,37 +2037,33 @@ function openPdf(blob, filename) {
1449
2037
  }
1450
2038
  function useBillLifecycle({
1451
2039
  billId: providedBillId,
1452
- create,
1453
2040
  sessionEndpoint = DEFAULT_SESSION_ENDPOINT2,
1454
2041
  getSession,
1455
2042
  apiBaseUrl = DEFAULT_API_BASE_URL2,
1456
2043
  refreshInterval = DEFAULT_REFRESH_INTERVAL2,
1457
2044
  enabled = true,
1458
2045
  initialData = null,
1459
- onBillCreated,
1460
- onBillIdChange,
1461
2046
  fetch: fetchOverride
1462
2047
  }) {
1463
- const [billId, setBillId] = useState3(providedBillId ?? null);
1464
- const [data, setData] = useState3(initialData);
1465
- const [error, setError] = useState3(null);
1466
- const [isLoading, setIsLoading] = useState3(enabled && !initialData);
1467
- const [isRefreshing, setIsRefreshing] = useState3(false);
1468
- const [isMutating, setIsMutating] = useState3(false);
2048
+ const billId = providedBillId;
2049
+ const [data, setData] = useState4(initialData);
2050
+ const [error, setError] = useState4(null);
2051
+ const [isLoading, setIsLoading] = useState4(enabled && !initialData);
2052
+ const [isRefreshing, setIsRefreshing] = useState4(false);
2053
+ const [isMutating, setIsMutating] = useState4(false);
1469
2054
  const mounted = useRef3(true);
1470
- useEffect3(() => {
1471
- setBillId(providedBillId ?? null);
2055
+ useEffect4(() => {
1472
2056
  setData(initialData);
1473
2057
  setError(null);
1474
2058
  }, [initialData, providedBillId]);
1475
- const client = useMemo3(() => createBillLifecycleClient({
1476
- ...providedBillId ? { billId: providedBillId } : {},
2059
+ const client = useMemo4(() => createBillLifecycleClient({
2060
+ billId: providedBillId,
1477
2061
  sessionEndpoint,
1478
2062
  getSession,
1479
2063
  apiBaseUrl,
1480
2064
  fetch: fetchOverride
1481
2065
  }), [apiBaseUrl, fetchOverride, getSession, providedBillId, sessionEndpoint]);
1482
- useEffect3(() => {
2066
+ useEffect4(() => {
1483
2067
  mounted.current = true;
1484
2068
  return () => {
1485
2069
  mounted.current = false;
@@ -1490,17 +2074,7 @@ function useBillLifecycle({
1490
2074
  if (!enabled) return;
1491
2075
  setIsRefreshing(true);
1492
2076
  try {
1493
- let next;
1494
- if (!client.getBillId()) {
1495
- if (!create) throw new Error("Pass billId to open a bill or create to start a new one.");
1496
- const created = await client.createBill(create);
1497
- await onBillCreated?.(created.billId, created.data);
1498
- await onBillIdChange?.(created.billId, null);
1499
- if (mounted.current) setBillId(created.billId);
1500
- next = created.data;
1501
- } else {
1502
- next = await client.getLifecycle();
1503
- }
2077
+ const next = await client.getLifecycle();
1504
2078
  if (!mounted.current) return;
1505
2079
  setData(next);
1506
2080
  setError(null);
@@ -1513,8 +2087,8 @@ function useBillLifecycle({
1513
2087
  setIsRefreshing(false);
1514
2088
  }
1515
2089
  }
1516
- }, [client, create, enabled, onBillCreated, onBillIdChange]);
1517
- useEffect3(() => {
2090
+ }, [client, enabled]);
2091
+ useEffect4(() => {
1518
2092
  if (!enabled) return;
1519
2093
  void refresh();
1520
2094
  const interval = refreshInterval > 0 ? window.setInterval(() => void refresh(), refreshInterval) : null;
@@ -1540,10 +2114,6 @@ function useBillLifecycle({
1540
2114
  if (mounted.current) setIsMutating(false);
1541
2115
  }
1542
2116
  }, []);
1543
- const saveReview = useCallback2(
1544
- (input) => mutate(() => client.saveReview(input)),
1545
- [client, mutate]
1546
- );
1547
2117
  const searchClaimsAdministrators = useCallback2(
1548
2118
  (query, claimNumber) => client.searchClaimsAdministrators(query, claimNumber),
1549
2119
  [client]
@@ -1552,18 +2122,6 @@ function useBillLifecycle({
1552
2122
  () => client.getDeliveryOptions(),
1553
2123
  [client]
1554
2124
  );
1555
- const submitBill = useCallback2(
1556
- (input, submission) => mutate(() => client.submitBill(input, submission)),
1557
- [client, mutate]
1558
- );
1559
- const addAttachment = useCallback2(
1560
- (file, type, description) => mutate(() => client.addAttachment(file, type, description)),
1561
- [client, mutate]
1562
- );
1563
- const removeAttachment = useCallback2(
1564
- (attachmentId) => mutate(() => client.removeAttachment(attachmentId)),
1565
- [client, mutate]
1566
- );
1567
2125
  const closeBill = useCallback2(
1568
2126
  (input) => mutate(() => client.closeBill(input)),
1569
2127
  [client, mutate]
@@ -1576,24 +2134,6 @@ function useBillLifecycle({
1576
2134
  (input) => mutate(() => client.submitSecondReview(input)),
1577
2135
  [client, mutate]
1578
2136
  );
1579
- const startCorrection = useCallback2(async () => {
1580
- setIsMutating(true);
1581
- setError(null);
1582
- try {
1583
- const result = await client.startCorrection();
1584
- const previousBillId = billId;
1585
- await onBillIdChange?.(result.replacementBillId, previousBillId);
1586
- setBillId(result.replacementBillId);
1587
- setData(result.data);
1588
- return result.data;
1589
- } catch (cause) {
1590
- const nextError = cause instanceof Error ? cause : new Error("Correction draft could not be created.");
1591
- setError(nextError);
1592
- throw nextError;
1593
- } finally {
1594
- setIsMutating(false);
1595
- }
1596
- }, [billId, client, onBillIdChange]);
1597
2137
  const openAttachment = useCallback2(async (attachment) => {
1598
2138
  openPdf(await client.getAttachment(attachment.id), attachment.filename);
1599
2139
  }, [client]);
@@ -1610,51 +2150,45 @@ function useBillLifecycle({
1610
2150
  refresh,
1611
2151
  searchClaimsAdministrators,
1612
2152
  getDeliveryOptions,
1613
- saveReview,
1614
- submitBill,
1615
- addAttachment,
1616
- removeAttachment,
1617
2153
  openAttachment,
1618
2154
  openEor,
1619
2155
  closeBill,
1620
2156
  postPayment,
1621
- submitSecondReview,
1622
- startCorrection
2157
+ submitSecondReview
1623
2158
  };
1624
2159
  }
2160
+ function LifecycleDialog({
2161
+ children,
2162
+ title,
2163
+ onClose
2164
+ }) {
2165
+ const dialog = useRef3(null);
2166
+ useEffect4(() => {
2167
+ const previous = document.activeElement;
2168
+ dialog.current?.focus();
2169
+ const onKeyDown = (event) => {
2170
+ if (event.key === "Escape") onClose();
2171
+ };
2172
+ document.addEventListener("keydown", onKeyDown);
2173
+ return () => {
2174
+ document.removeEventListener("keydown", onKeyDown);
2175
+ previous?.focus();
2176
+ };
2177
+ }, [onClose]);
2178
+ return /* @__PURE__ */ jsx5("div", { className: "mb-lifecycle-dialog-backdrop", onMouseDown: (event) => {
2179
+ if (event.currentTarget === event.target) onClose();
2180
+ }, children: /* @__PURE__ */ jsxs5("div", { ref: dialog, className: "mb-lifecycle-dialog", role: "dialog", "aria-modal": "true", "aria-label": title, tabIndex: -1, children: [
2181
+ /* @__PURE__ */ jsx5("button", { type: "button", className: "mb-lifecycle-dialog-close", "aria-label": "Close", onClick: onClose, children: "\xD7" }),
2182
+ children
2183
+ ] }) });
2184
+ }
1625
2185
  function dateInputValue() {
1626
2186
  const now = /* @__PURE__ */ new Date();
1627
2187
  const offset = now.getTimezoneOffset() * 6e4;
1628
2188
  return new Date(now.getTime() - offset).toISOString().slice(0, 10);
1629
2189
  }
1630
- function SupportingDocumentControl({
1631
- disabled,
1632
- onAdd
1633
- }) {
1634
- const [file, setFile] = useState3(null);
1635
- const [type, setType] = useState3("appeal");
1636
- const [busy, setBusy] = useState3(false);
1637
- return /* @__PURE__ */ jsxs4("div", { className: "mb-lifecycle-upload", children: [
1638
- /* @__PURE__ */ jsxs4("select", { "aria-label": "Supporting document type", value: type, disabled: disabled || busy, onChange: (event) => setType(event.target.value), children: [
1639
- /* @__PURE__ */ jsx4("option", { value: "appeal", children: "Second Review support" }),
1640
- /* @__PURE__ */ jsx4("option", { value: "final_report", children: "Final report" }),
1641
- /* @__PURE__ */ jsx4("option", { value: "proof_of_service", children: "Proof of service" }),
1642
- /* @__PURE__ */ jsx4("option", { value: "letter_of_attestation", children: "Letter of attestation" }),
1643
- /* @__PURE__ */ jsx4("option", { value: "form_122", children: "DWC Form 122" }),
1644
- /* @__PURE__ */ jsx4("option", { value: "w9", children: "W-9" }),
1645
- /* @__PURE__ */ jsx4("option", { value: "other", children: "Other supporting document" })
1646
- ] }),
1647
- /* @__PURE__ */ jsx4("input", { "aria-label": "Choose supporting PDF", type: "file", accept: "application/pdf,.pdf", disabled: disabled || busy, onChange: (event) => setFile(event.target.files?.[0] ?? null) }),
1648
- /* @__PURE__ */ jsx4("button", { type: "button", className: "mb-lifecycle-button secondary", disabled: disabled || busy || !file, onClick: () => {
1649
- if (!file) return;
1650
- setBusy(true);
1651
- void onAdd(file, type).then(() => setFile(null)).catch(() => void 0).finally(() => setBusy(false));
1652
- }, children: busy ? "Attaching\u2026" : "Attach PDF" })
1653
- ] });
1654
- }
1655
2190
  function ConnectedBillLifecycle({
1656
2191
  appearance,
1657
- features,
1658
2192
  className,
1659
2193
  style,
1660
2194
  loadingFallback,
@@ -1664,17 +2198,17 @@ function ConnectedBillLifecycle({
1664
2198
  }) {
1665
2199
  const lifecycle = useBillLifecycle(options);
1666
2200
  const { data } = lifecycle;
1667
- const [panel, setPanel] = useState3("");
1668
- const [notice, setNotice] = useState3("");
1669
- const [closeReason, setCloseReason] = useState3("");
1670
- const [payment, setPayment] = useState3({
2201
+ const [panel, setPanel] = useState4("");
2202
+ const [notice, setNotice] = useState4("");
2203
+ const [closeReason, setCloseReason] = useState4("");
2204
+ const [payment, setPayment] = useState4({
1671
2205
  amount: 0,
1672
2206
  method: "check",
1673
2207
  checkNumber: "",
1674
2208
  depositDate: dateInputValue(),
1675
2209
  note: ""
1676
2210
  });
1677
- const [review, setReview] = useState3({
2211
+ const [review, setReview] = useState4({
1678
2212
  reason: "",
1679
2213
  payerClaimControlNumber: "",
1680
2214
  disputedAmount: void 0,
@@ -1682,7 +2216,8 @@ function ConnectedBillLifecycle({
1682
2216
  route: "ebill"
1683
2217
  });
1684
2218
  const lastData = useRef3(null);
1685
- useEffect3(() => {
2219
+ const closePanel = useCallback2(() => setPanel(""), []);
2220
+ useEffect4(() => {
1686
2221
  if (!data || data === lastData.current) return;
1687
2222
  lastData.current = data;
1688
2223
  onChanged?.(data);
@@ -1697,14 +2232,14 @@ function ConnectedBillLifecycle({
1697
2232
  }));
1698
2233
  }, [data, onChanged]);
1699
2234
  if (lifecycle.isLoading && !data) {
1700
- return /* @__PURE__ */ jsx4(Fragment3, { children: loadingFallback ?? /* @__PURE__ */ jsx4("div", { className: "mb-lifecycle-loading", children: "Loading billing\u2026" }) });
2235
+ return /* @__PURE__ */ jsx5(Fragment3, { children: loadingFallback ?? /* @__PURE__ */ jsx5("div", { className: "mb-lifecycle-loading", children: "Loading billing\u2026" }) });
1701
2236
  }
1702
2237
  if (!data) {
1703
2238
  const error = lifecycle.error ?? new Error("Bill could not be loaded.");
1704
- return /* @__PURE__ */ jsx4(Fragment3, { children: errorFallback?.(error, lifecycle.refresh) ?? /* @__PURE__ */ jsxs4("div", { className: "mb-lifecycle-error", role: "alert", children: [
1705
- /* @__PURE__ */ jsx4("strong", { children: "Billing is unavailable." }),
1706
- /* @__PURE__ */ jsx4("span", { children: error.message }),
1707
- /* @__PURE__ */ jsx4("button", { type: "button", onClick: () => void lifecycle.refresh(), children: "Try again" })
2239
+ return /* @__PURE__ */ jsx5(Fragment3, { children: errorFallback?.(error, lifecycle.refresh) ?? /* @__PURE__ */ jsxs5("div", { className: "mb-lifecycle-error", role: "alert", children: [
2240
+ /* @__PURE__ */ jsx5("strong", { children: "Billing is unavailable." }),
2241
+ /* @__PURE__ */ jsx5("span", { children: error.message }),
2242
+ /* @__PURE__ */ jsx5("button", { type: "button", onClick: () => void lifecycle.refresh(), children: "Try again" })
1708
2243
  ] }) });
1709
2244
  }
1710
2245
  const actionMap = new Map(data.lifecycle.actions.map((action) => [action.id, action]));
@@ -1722,43 +2257,40 @@ function ConnectedBillLifecycle({
1722
2257
  } catch {
1723
2258
  }
1724
2259
  };
1725
- const actionButtons = data.lifecycle.actions.filter((action) => action.id !== "edit_and_submit" && action.id !== "view_eor" && action.id !== "independent_bill_review").map((action) => ({
2260
+ const actionButtons = data.lifecycle.actions.filter((action) => action.id !== "view_eor" && action.id !== "independent_bill_review").map((action) => ({
1726
2261
  ...action,
1727
2262
  onClick: () => {
1728
2263
  if (!action.enabled) return;
1729
- if (action.id === "correct_and_resubmit") selectPanel("correction");
1730
2264
  if (action.id === "second_review") selectPanel("second_review");
1731
2265
  if (action.id === "post_payment") selectPanel("payment");
1732
2266
  if (action.id === "close") selectPanel("close");
1733
2267
  },
1734
2268
  disabled: !action.enabled || lifecycle.isMutating
1735
2269
  }));
1736
- const canEditAndSubmit = Boolean(has("edit_and_submit"));
1737
- return /* @__PURE__ */ jsxs4("section", { className: ["mb-connected-lifecycle", className].filter(Boolean).join(" "), style: mindBillAppearanceStyle(appearance, style), children: [
1738
- /* @__PURE__ */ jsx4("style", { children: CONNECTED_LIFECYCLE_STYLES }),
1739
- /* @__PURE__ */ jsx4("style", { children: CONNECTED_THEME_OVERRIDE_STYLES }),
1740
- canEditAndSubmit ? /* @__PURE__ */ jsx4(
1741
- BillReviewForm,
2270
+ return /* @__PURE__ */ jsxs5("section", { className: ["mb-connected-lifecycle", className].filter(Boolean).join(" "), style: mindBillAppearanceStyle(appearance, style), children: [
2271
+ /* @__PURE__ */ jsx5("style", { children: CONNECTED_LIFECYCLE_STYLES }),
2272
+ /* @__PURE__ */ jsx5("style", { children: CONNECTED_THEME_OVERRIDE_STYLES }),
2273
+ /* @__PURE__ */ jsx5(
2274
+ BillLifecycleProgress,
1742
2275
  {
1743
- data,
1744
- ...appearance ? { appearance } : {},
1745
- ...features ? { features } : {},
1746
- disabled: lifecycle.isMutating,
1747
- onSearchClaimsAdministrators: lifecycle.searchClaimsAdministrators,
1748
- onGetDeliveryOptions: lifecycle.getDeliveryOptions,
1749
- onSave: lifecycle.saveReview,
1750
- onSubmit: async (input, submission) => {
1751
- await complete("Bill submitted.", () => lifecycle.submitBill(input, submission));
1752
- },
1753
- onAddAttachment: async (file, type, description) => {
1754
- await lifecycle.addAttachment(file, type, description);
1755
- },
1756
- onRemoveAttachment: async (attachmentId) => {
1757
- await lifecycle.removeAttachment(attachmentId);
1758
- },
1759
- onOpenAttachment: (attachment) => void lifecycle.openAttachment(attachment).catch(() => void 0)
2276
+ state: data.lifecycle.state,
2277
+ nativeStatus: data.lifecycle.nativeStatus,
2278
+ submittedAt: data.lifecycle.submittedAt ?? null,
2279
+ agingDays: data.lifecycle.agingDays ?? null,
2280
+ ...appearance ? { appearance } : {}
1760
2281
  }
1761
- ) : /* @__PURE__ */ jsx4(
2282
+ ),
2283
+ /* @__PURE__ */ jsx5(
2284
+ BillSnapshotSummary,
2285
+ {
2286
+ bill: data.bill,
2287
+ patient: data.patient,
2288
+ injury: data.injury,
2289
+ delivery: data.delivery,
2290
+ ...appearance ? { appearance } : {}
2291
+ }
2292
+ ),
2293
+ /* @__PURE__ */ jsx5(
1762
2294
  BillStatusSummary,
1763
2295
  {
1764
2296
  status: data.lifecycle.state,
@@ -1772,168 +2304,153 @@ function ConnectedBillLifecycle({
1772
2304
  ...appearance ? { appearance } : {}
1773
2305
  }
1774
2306
  ),
1775
- /* @__PURE__ */ jsxs4("div", { className: "mb-lifecycle-toolbar", children: [
1776
- /* @__PURE__ */ jsxs4("div", { children: [
1777
- /* @__PURE__ */ jsxs4("strong", { children: [
2307
+ /* @__PURE__ */ jsxs5("div", { className: "mb-lifecycle-toolbar", children: [
2308
+ /* @__PURE__ */ jsxs5("div", { children: [
2309
+ /* @__PURE__ */ jsxs5("strong", { children: [
1778
2310
  "Bill #",
1779
2311
  data.bill.billNumber
1780
2312
  ] }),
1781
- /* @__PURE__ */ jsx4("span", { children: lifecycle.isRefreshing ? "Refreshing\u2026" : "Status and actions update automatically." })
2313
+ /* @__PURE__ */ jsx5("span", { children: lifecycle.isRefreshing ? "Refreshing\u2026" : "Status and actions update automatically." })
1782
2314
  ] }),
1783
- /* @__PURE__ */ jsxs4("div", { className: "mb-lifecycle-toolbar-actions", children: [
1784
- has("view_eor") ? /* @__PURE__ */ jsx4("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => document.getElementById(`mb-eors-${data.bill.id}`)?.scrollIntoView({ behavior: "smooth", block: "center" }), children: "View EOR" }) : null,
1785
- canEditAndSubmit && has("close") ? /* @__PURE__ */ jsx4("button", { type: "button", className: "mb-lifecycle-button quiet", onClick: () => selectPanel("close"), children: "Close bill" }) : null
2315
+ /* @__PURE__ */ jsxs5("div", { className: "mb-lifecycle-toolbar-actions", children: [
2316
+ has("view_eor") ? /* @__PURE__ */ jsx5("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => document.getElementById(`mb-eors-${data.bill.id}`)?.scrollIntoView({ behavior: "smooth", block: "center" }), children: "View EOR" }) : null,
2317
+ has("close") ? /* @__PURE__ */ jsx5("button", { type: "button", className: "mb-lifecycle-button quiet", onClick: () => selectPanel("close"), children: "Close bill" }) : null
1786
2318
  ] })
1787
2319
  ] }),
1788
- data.eors.length ? /* @__PURE__ */ jsxs4("section", { className: "mb-lifecycle-card", id: `mb-eors-${data.bill.id}`, children: [
1789
- /* @__PURE__ */ jsxs4("header", { children: [
1790
- /* @__PURE__ */ jsxs4("div", { children: [
1791
- /* @__PURE__ */ jsx4("h3", { children: "Explanation of Review" }),
1792
- /* @__PURE__ */ jsx4("p", { children: "Review the payer response and original PDF before posting payment." })
2320
+ data.eors.length ? /* @__PURE__ */ jsxs5("section", { className: "mb-lifecycle-card", id: `mb-eors-${data.bill.id}`, children: [
2321
+ /* @__PURE__ */ jsxs5("header", { children: [
2322
+ /* @__PURE__ */ jsxs5("div", { children: [
2323
+ /* @__PURE__ */ jsx5("h3", { children: "Explanation of Review" }),
2324
+ /* @__PURE__ */ jsx5("p", { children: "Review the payer response and original PDF before posting payment." })
1793
2325
  ] }),
1794
- /* @__PURE__ */ jsxs4("span", { children: [
2326
+ /* @__PURE__ */ jsxs5("span", { children: [
1795
2327
  data.eors.length,
1796
2328
  " PDF",
1797
2329
  data.eors.length === 1 ? "" : "s"
1798
2330
  ] })
1799
2331
  ] }),
1800
- /* @__PURE__ */ jsx4("ul", { className: "mb-lifecycle-documents", children: data.eors.map((eor) => /* @__PURE__ */ jsxs4("li", { children: [
1801
- /* @__PURE__ */ jsxs4("div", { children: [
1802
- /* @__PURE__ */ jsx4("strong", { children: eor.filename }),
1803
- /* @__PURE__ */ jsx4("span", { children: eor.description || `Added ${new Date(eor.addedAt).toLocaleDateString()}` })
2332
+ /* @__PURE__ */ jsx5("ul", { className: "mb-lifecycle-documents", children: data.eors.map((eor) => /* @__PURE__ */ jsxs5("li", { children: [
2333
+ /* @__PURE__ */ jsxs5("div", { children: [
2334
+ /* @__PURE__ */ jsx5("strong", { children: eor.filename }),
2335
+ /* @__PURE__ */ jsx5("span", { children: eor.description || `Added ${new Date(eor.addedAt).toLocaleDateString()}` })
1804
2336
  ] }),
1805
- /* @__PURE__ */ jsx4("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => void lifecycle.openEor(eor).catch(() => void 0), children: "View PDF" })
2337
+ /* @__PURE__ */ jsx5("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => void lifecycle.openEor(eor).catch(() => void 0), children: "View PDF" })
1806
2338
  ] }, eor.id)) })
1807
2339
  ] }) : null,
1808
- has("independent_bill_review") ? /* @__PURE__ */ jsxs4("div", { className: "mb-lifecycle-info", children: [
1809
- /* @__PURE__ */ jsx4("strong", { children: has("independent_bill_review")?.label }),
1810
- /* @__PURE__ */ jsx4("span", { children: has("independent_bill_review")?.reason })
1811
- ] }) : null,
1812
- panel === "correction" ? /* @__PURE__ */ jsxs4("section", { className: "mb-lifecycle-panel", children: [
1813
- /* @__PURE__ */ jsxs4("div", { children: [
1814
- /* @__PURE__ */ jsx4("h3", { children: "Correct and resubmit" }),
1815
- /* @__PURE__ */ jsx4("p", { children: "A new correction draft will preserve this rejected bill in history. Review the copied values before submitting." })
1816
- ] }),
1817
- /* @__PURE__ */ jsxs4("div", { className: "mb-lifecycle-panel-actions", children: [
1818
- /* @__PURE__ */ jsx4("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
1819
- /* @__PURE__ */ jsx4("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating, onClick: () => void complete("Correction draft created.", lifecycle.startCorrection), children: lifecycle.isMutating ? "Creating\u2026" : "Create correction draft" })
1820
- ] })
2340
+ /* @__PURE__ */ jsxs5("div", { className: "mb-lifecycle-detail-grid", children: [
2341
+ /* @__PURE__ */ jsx5(BillRemittanceCard, { remittance: data.remittance, ...appearance ? { appearance } : {} }),
2342
+ /* @__PURE__ */ jsx5(BillPayerContactCard, { delivery: data.delivery, ...appearance ? { appearance } : {} }),
2343
+ /* @__PURE__ */ jsx5(BillPaymentLedger, { payments: data.payments, ...appearance ? { appearance } : {} })
2344
+ ] }),
2345
+ /* @__PURE__ */ jsx5(BillActivityTimeline, { events: data.activity, ...appearance ? { appearance } : {} }),
2346
+ has("independent_bill_review") ? /* @__PURE__ */ jsxs5("div", { className: "mb-lifecycle-info", children: [
2347
+ /* @__PURE__ */ jsx5("strong", { children: has("independent_bill_review")?.label }),
2348
+ /* @__PURE__ */ jsx5("span", { children: has("independent_bill_review")?.reason })
1821
2349
  ] }) : null,
1822
- panel === "second_review" ? /* @__PURE__ */ jsxs4("section", { className: "mb-lifecycle-panel wide", children: [
1823
- /* @__PURE__ */ jsxs4("div", { children: [
1824
- /* @__PURE__ */ jsx4("h3", { children: "Submit Second Review" }),
1825
- /* @__PURE__ */ jsx4("p", { children: "State why payment is disputed, confirm the payer control number, and choose the supporting documents to send." })
2350
+ panel === "second_review" ? /* @__PURE__ */ jsx5(LifecycleDialog, { title: "Submit Second Review", onClose: closePanel, children: /* @__PURE__ */ jsxs5("section", { className: "mb-lifecycle-panel wide", children: [
2351
+ /* @__PURE__ */ jsxs5("div", { children: [
2352
+ /* @__PURE__ */ jsx5("h3", { children: "Submit Second Review" }),
2353
+ /* @__PURE__ */ jsx5("p", { children: "State why payment is disputed, confirm the payer control number, and choose the supporting documents to send." })
1826
2354
  ] }),
1827
- /* @__PURE__ */ jsxs4("div", { className: "mb-lifecycle-fields two", children: [
1828
- /* @__PURE__ */ jsxs4("label", { children: [
1829
- /* @__PURE__ */ jsx4("span", { children: "Reason for Second Review" }),
1830
- /* @__PURE__ */ jsx4("textarea", { required: true, value: review.reason, onChange: (event) => setReview((current) => ({ ...current, reason: event.target.value })) })
2355
+ /* @__PURE__ */ jsxs5("div", { className: "mb-lifecycle-fields two", children: [
2356
+ /* @__PURE__ */ jsxs5("label", { children: [
2357
+ /* @__PURE__ */ jsx5("span", { children: "Reason for Second Review" }),
2358
+ /* @__PURE__ */ jsx5("textarea", { required: true, value: review.reason, onChange: (event) => setReview((current) => ({ ...current, reason: event.target.value })) })
1831
2359
  ] }),
1832
- /* @__PURE__ */ jsxs4("div", { className: "mb-lifecycle-fields", children: [
1833
- /* @__PURE__ */ jsxs4("label", { children: [
1834
- /* @__PURE__ */ jsx4("span", { children: "Payer claim control number" }),
1835
- /* @__PURE__ */ jsx4("input", { required: true, value: review.payerClaimControlNumber, onChange: (event) => setReview((current) => ({ ...current, payerClaimControlNumber: event.target.value })) })
2360
+ /* @__PURE__ */ jsxs5("div", { className: "mb-lifecycle-fields", children: [
2361
+ /* @__PURE__ */ jsxs5("label", { children: [
2362
+ /* @__PURE__ */ jsx5("span", { children: "Payer claim control number" }),
2363
+ /* @__PURE__ */ jsx5("input", { required: true, value: review.payerClaimControlNumber, onChange: (event) => setReview((current) => ({ ...current, payerClaimControlNumber: event.target.value })) })
1836
2364
  ] }),
1837
- /* @__PURE__ */ jsxs4("label", { children: [
1838
- /* @__PURE__ */ jsx4("span", { children: "Disputed amount" }),
1839
- /* @__PURE__ */ jsx4("input", { type: "number", min: "0.01", step: "0.01", value: review.disputedAmount ?? "", onChange: (event) => setReview((current) => ({ ...current, disputedAmount: event.target.value ? Number(event.target.value) : void 0 })) })
2365
+ /* @__PURE__ */ jsxs5("label", { children: [
2366
+ /* @__PURE__ */ jsx5("span", { children: "Disputed amount" }),
2367
+ /* @__PURE__ */ jsx5("input", { type: "number", min: "0.01", step: "0.01", value: review.disputedAmount ?? "", onChange: (event) => setReview((current) => ({ ...current, disputedAmount: event.target.value ? Number(event.target.value) : void 0 })) })
1840
2368
  ] }),
1841
- /* @__PURE__ */ jsxs4("label", { children: [
1842
- /* @__PURE__ */ jsx4("span", { children: "Send via" }),
1843
- /* @__PURE__ */ jsxs4("select", { value: review.route, onChange: (event) => setReview((current) => ({ ...current, route: event.target.value })), children: [
1844
- /* @__PURE__ */ jsx4("option", { value: "ebill", children: "E-bill" }),
1845
- /* @__PURE__ */ jsx4("option", { value: "fax", children: "Fax" }),
1846
- /* @__PURE__ */ jsx4("option", { value: "mail", children: "Mail" }),
1847
- /* @__PURE__ */ jsx4("option", { value: "email", children: "Email" })
2369
+ /* @__PURE__ */ jsxs5("label", { children: [
2370
+ /* @__PURE__ */ jsx5("span", { children: "Send via" }),
2371
+ /* @__PURE__ */ jsxs5("select", { value: review.route, onChange: (event) => setReview((current) => ({ ...current, route: event.target.value })), children: [
2372
+ /* @__PURE__ */ jsx5("option", { value: "ebill", children: "E-bill" }),
2373
+ /* @__PURE__ */ jsx5("option", { value: "fax", children: "Fax" }),
2374
+ /* @__PURE__ */ jsx5("option", { value: "mail", children: "Mail" }),
2375
+ /* @__PURE__ */ jsx5("option", { value: "email", children: "Email" })
1848
2376
  ] })
1849
2377
  ] })
1850
2378
  ] })
1851
2379
  ] }),
1852
- /* @__PURE__ */ jsxs4("fieldset", { className: "mb-lifecycle-packet", children: [
1853
- /* @__PURE__ */ jsx4("legend", { children: "Supporting packet" }),
1854
- data.bill.attachments.map((attachment) => /* @__PURE__ */ jsxs4("label", { children: [
1855
- /* @__PURE__ */ jsx4("input", { type: "checkbox", checked: review.attachmentIds.includes(attachment.id), onChange: (event) => setReview((current) => ({ ...current, attachmentIds: event.target.checked ? [...current.attachmentIds, attachment.id] : current.attachmentIds.filter((id) => id !== attachment.id) })) }),
1856
- /* @__PURE__ */ jsxs4("span", { children: [
1857
- /* @__PURE__ */ jsx4("strong", { children: attachment.filename }),
1858
- /* @__PURE__ */ jsx4("small", { children: attachment.description || attachment.documentType })
2380
+ /* @__PURE__ */ jsxs5("fieldset", { className: "mb-lifecycle-packet", children: [
2381
+ /* @__PURE__ */ jsx5("legend", { children: "Supporting packet" }),
2382
+ data.bill.attachments.map((attachment) => /* @__PURE__ */ jsxs5("label", { children: [
2383
+ /* @__PURE__ */ jsx5("input", { type: "checkbox", checked: review.attachmentIds.includes(attachment.id), onChange: (event) => setReview((current) => ({ ...current, attachmentIds: event.target.checked ? [...current.attachmentIds, attachment.id] : current.attachmentIds.filter((id) => id !== attachment.id) })) }),
2384
+ /* @__PURE__ */ jsxs5("span", { children: [
2385
+ /* @__PURE__ */ jsx5("strong", { children: attachment.filename }),
2386
+ /* @__PURE__ */ jsx5("small", { children: attachment.description || attachment.documentType })
1859
2387
  ] }),
1860
- /* @__PURE__ */ jsx4("button", { type: "button", onClick: () => void lifecycle.openAttachment(attachment).catch(() => void 0), children: "View" }),
1861
- /* @__PURE__ */ jsx4("button", { type: "button", "aria-label": `Remove ${attachment.filename}`, onClick: () => void lifecycle.removeAttachment(attachment.id).catch(() => void 0), children: "\xD7" })
2388
+ /* @__PURE__ */ jsx5("button", { type: "button", onClick: () => void lifecycle.openAttachment(attachment).catch(() => void 0), children: "View" })
1862
2389
  ] }, attachment.id))
1863
2390
  ] }),
1864
- /* @__PURE__ */ jsx4(SupportingDocumentControl, { disabled: lifecycle.isMutating, onAdd: async (file, type, description) => {
1865
- const next = await lifecycle.addAttachment(file, type, description);
1866
- setReview((current) => ({
1867
- ...current,
1868
- attachmentIds: Array.from(/* @__PURE__ */ new Set([
1869
- ...current.attachmentIds,
1870
- ...next.bill.attachments.map((attachment) => attachment.id)
1871
- ]))
1872
- }));
1873
- } }),
1874
- /* @__PURE__ */ jsxs4("div", { className: "mb-lifecycle-panel-actions", children: [
1875
- /* @__PURE__ */ jsx4("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
1876
- /* @__PURE__ */ jsx4("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || !review.reason.trim() || !review.payerClaimControlNumber.trim(), onClick: () => void complete("Second Review submitted.", () => lifecycle.submitSecondReview(review)), children: lifecycle.isMutating ? "Submitting\u2026" : "Submit Second Review" })
2391
+ /* @__PURE__ */ jsxs5("div", { className: "mb-lifecycle-panel-actions", children: [
2392
+ /* @__PURE__ */ jsx5("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: closePanel, children: "Cancel" }),
2393
+ /* @__PURE__ */ jsx5("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || !review.reason.trim() || !review.payerClaimControlNumber.trim(), onClick: () => void complete("Second Review submitted.", () => lifecycle.submitSecondReview(review)), children: lifecycle.isMutating ? "Submitting\u2026" : "Submit Second Review" })
1877
2394
  ] })
1878
- ] }) : null,
1879
- panel === "payment" ? /* @__PURE__ */ jsxs4("section", { className: "mb-lifecycle-panel", children: [
1880
- /* @__PURE__ */ jsxs4("div", { children: [
1881
- /* @__PURE__ */ jsx4("h3", { children: "Post payment" }),
1882
- /* @__PURE__ */ jsx4("p", { children: "Record funds shown on the EOR. The balance updates and the bill closes automatically when configured." })
2395
+ ] }) }) : null,
2396
+ panel === "payment" ? /* @__PURE__ */ jsx5(LifecycleDialog, { title: "Post payment", onClose: closePanel, children: /* @__PURE__ */ jsxs5("section", { className: "mb-lifecycle-panel", children: [
2397
+ /* @__PURE__ */ jsxs5("div", { children: [
2398
+ /* @__PURE__ */ jsx5("h3", { children: "Post payment" }),
2399
+ /* @__PURE__ */ jsx5("p", { children: "Record funds shown on the EOR. The balance updates and the bill closes automatically when configured." })
1883
2400
  ] }),
1884
- /* @__PURE__ */ jsxs4("div", { className: "mb-lifecycle-fields two", children: [
1885
- /* @__PURE__ */ jsxs4("label", { children: [
1886
- /* @__PURE__ */ jsx4("span", { children: "Amount" }),
1887
- /* @__PURE__ */ jsx4("input", { type: "number", min: "0.01", max: data.bill.balanceDue, step: "0.01", required: true, value: payment.amount || "", onChange: (event) => setPayment((current) => ({ ...current, amount: Number(event.target.value) })) })
2401
+ /* @__PURE__ */ jsxs5("div", { className: "mb-lifecycle-fields two", children: [
2402
+ /* @__PURE__ */ jsxs5("label", { children: [
2403
+ /* @__PURE__ */ jsx5("span", { children: "Amount" }),
2404
+ /* @__PURE__ */ jsx5("input", { type: "number", min: "0.01", max: data.bill.balanceDue, step: "0.01", required: true, value: payment.amount || "", onChange: (event) => setPayment((current) => ({ ...current, amount: Number(event.target.value) })) })
1888
2405
  ] }),
1889
- /* @__PURE__ */ jsxs4("label", { children: [
1890
- /* @__PURE__ */ jsx4("span", { children: "Method" }),
1891
- /* @__PURE__ */ jsxs4("select", { value: payment.method, onChange: (event) => setPayment((current) => ({ ...current, method: event.target.value })), children: [
1892
- /* @__PURE__ */ jsx4("option", { value: "check", children: "Check" }),
1893
- /* @__PURE__ */ jsx4("option", { value: "eft", children: "EFT" })
2406
+ /* @__PURE__ */ jsxs5("label", { children: [
2407
+ /* @__PURE__ */ jsx5("span", { children: "Method" }),
2408
+ /* @__PURE__ */ jsxs5("select", { value: payment.method, onChange: (event) => setPayment((current) => ({ ...current, method: event.target.value })), children: [
2409
+ /* @__PURE__ */ jsx5("option", { value: "check", children: "Check" }),
2410
+ /* @__PURE__ */ jsx5("option", { value: "eft", children: "EFT" })
1894
2411
  ] })
1895
2412
  ] }),
1896
- /* @__PURE__ */ jsxs4("label", { children: [
1897
- /* @__PURE__ */ jsx4("span", { children: payment.method === "check" ? "Check number" : "EFT reference" }),
1898
- /* @__PURE__ */ jsx4("input", { value: payment.checkNumber, onChange: (event) => setPayment((current) => ({ ...current, checkNumber: event.target.value })) })
2413
+ /* @__PURE__ */ jsxs5("label", { children: [
2414
+ /* @__PURE__ */ jsx5("span", { children: payment.method === "check" ? "Check number" : "EFT reference" }),
2415
+ /* @__PURE__ */ jsx5("input", { value: payment.checkNumber, onChange: (event) => setPayment((current) => ({ ...current, checkNumber: event.target.value })) })
1899
2416
  ] }),
1900
- /* @__PURE__ */ jsxs4("label", { children: [
1901
- /* @__PURE__ */ jsx4("span", { children: "Deposit date" }),
1902
- /* @__PURE__ */ jsx4("input", { type: "date", required: true, value: payment.depositDate, onChange: (event) => setPayment((current) => ({ ...current, depositDate: event.target.value })) })
2417
+ /* @__PURE__ */ jsxs5("label", { children: [
2418
+ /* @__PURE__ */ jsx5("span", { children: "Deposit date" }),
2419
+ /* @__PURE__ */ jsx5("input", { type: "date", required: true, value: payment.depositDate, onChange: (event) => setPayment((current) => ({ ...current, depositDate: event.target.value })) })
1903
2420
  ] }),
1904
- /* @__PURE__ */ jsxs4("label", { className: "full", children: [
1905
- /* @__PURE__ */ jsxs4("span", { children: [
2421
+ /* @__PURE__ */ jsxs5("label", { className: "full", children: [
2422
+ /* @__PURE__ */ jsxs5("span", { children: [
1906
2423
  "Note ",
1907
- /* @__PURE__ */ jsx4("small", { children: "Optional" })
2424
+ /* @__PURE__ */ jsx5("small", { children: "Optional" })
1908
2425
  ] }),
1909
- /* @__PURE__ */ jsx4("input", { value: payment.note, onChange: (event) => setPayment((current) => ({ ...current, note: event.target.value })) })
2426
+ /* @__PURE__ */ jsx5("input", { value: payment.note, onChange: (event) => setPayment((current) => ({ ...current, note: event.target.value })) })
1910
2427
  ] })
1911
2428
  ] }),
1912
- /* @__PURE__ */ jsxs4("div", { className: "mb-lifecycle-panel-actions", children: [
1913
- /* @__PURE__ */ jsx4("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
1914
- /* @__PURE__ */ jsx4("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || payment.amount <= 0 || payment.amount > data.bill.balanceDue || !payment.depositDate, onClick: () => void complete("Payment posted.", () => lifecycle.postPayment(payment)), children: lifecycle.isMutating ? "Posting\u2026" : "Post payment" })
2429
+ /* @__PURE__ */ jsxs5("div", { className: "mb-lifecycle-panel-actions", children: [
2430
+ /* @__PURE__ */ jsx5("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: closePanel, children: "Cancel" }),
2431
+ /* @__PURE__ */ jsx5("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || payment.amount <= 0 || payment.amount > data.bill.balanceDue || !payment.depositDate, onClick: () => void complete("Payment posted.", () => lifecycle.postPayment(payment)), children: lifecycle.isMutating ? "Posting\u2026" : "Post payment" })
1915
2432
  ] })
1916
- ] }) : null,
1917
- panel === "close" ? /* @__PURE__ */ jsxs4("section", { className: "mb-lifecycle-panel danger", children: [
1918
- /* @__PURE__ */ jsxs4("div", { children: [
1919
- /* @__PURE__ */ jsx4("h3", { children: "Close bill" }),
1920
- /* @__PURE__ */ jsx4("p", { children: "Closing removes this bill from active A/R. Any remaining balance will be written off and the original lifecycle is preserved." })
2433
+ ] }) }) : null,
2434
+ panel === "close" ? /* @__PURE__ */ jsx5(LifecycleDialog, { title: "Close bill", onClose: closePanel, children: /* @__PURE__ */ jsxs5("section", { className: "mb-lifecycle-panel danger", children: [
2435
+ /* @__PURE__ */ jsxs5("div", { children: [
2436
+ /* @__PURE__ */ jsx5("h3", { children: "Close bill" }),
2437
+ /* @__PURE__ */ jsx5("p", { children: "Closing removes this bill from active A/R. Any remaining balance will be written off and the original lifecycle is preserved." })
1921
2438
  ] }),
1922
- /* @__PURE__ */ jsxs4("label", { children: [
1923
- /* @__PURE__ */ jsx4("span", { children: "Reason for closing" }),
1924
- /* @__PURE__ */ jsx4("textarea", { required: true, value: closeReason, onChange: (event) => setCloseReason(event.target.value) })
2439
+ /* @__PURE__ */ jsxs5("label", { children: [
2440
+ /* @__PURE__ */ jsx5("span", { children: "Reason for closing" }),
2441
+ /* @__PURE__ */ jsx5("textarea", { required: true, value: closeReason, onChange: (event) => setCloseReason(event.target.value) })
1925
2442
  ] }),
1926
- /* @__PURE__ */ jsxs4("div", { className: "mb-lifecycle-panel-actions", children: [
1927
- /* @__PURE__ */ jsx4("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
1928
- /* @__PURE__ */ jsx4("button", { type: "button", className: "mb-lifecycle-button danger", disabled: lifecycle.isMutating || !closeReason.trim(), onClick: () => void complete("Bill closed.", () => lifecycle.closeBill({ reason: closeReason })), children: lifecycle.isMutating ? "Closing\u2026" : "Close bill" })
2443
+ /* @__PURE__ */ jsxs5("div", { className: "mb-lifecycle-panel-actions", children: [
2444
+ /* @__PURE__ */ jsx5("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: closePanel, children: "Cancel" }),
2445
+ /* @__PURE__ */ jsx5("button", { type: "button", className: "mb-lifecycle-button danger", disabled: lifecycle.isMutating || !closeReason.trim(), onClick: () => void complete("Bill closed.", () => lifecycle.closeBill({ reason: closeReason })), children: lifecycle.isMutating ? "Closing\u2026" : "Close bill" })
1929
2446
  ] })
1930
- ] }) : null,
1931
- notice ? /* @__PURE__ */ jsx4("div", { className: "mb-lifecycle-message success", role: "status", children: notice }) : null,
1932
- lifecycle.error ? /* @__PURE__ */ jsx4("div", { className: "mb-lifecycle-message error", role: "alert", children: lifecycle.error.message }) : null
2447
+ ] }) }) : null,
2448
+ notice ? /* @__PURE__ */ jsx5("div", { className: "mb-lifecycle-message success", role: "status", children: notice }) : null,
2449
+ lifecycle.error ? /* @__PURE__ */ jsx5("div", { className: "mb-lifecycle-message error", role: "alert", children: lifecycle.error.message }) : null
1933
2450
  ] });
1934
2451
  }
1935
2452
  var CONNECTED_LIFECYCLE_STYLES = `
1936
- .mb-connected-lifecycle{--mb-accent:#238dbd;--mb-text:#203743;--mb-muted:#657982;--mb-border:#dbe6ea;--mb-soft:#f3f8fa;--mb-surface:#fff;display:grid;gap:14px;color:var(--mb-text);font:14px/1.45 var(--mb-font,Inter,ui-sans-serif,system-ui,sans-serif)}.mb-connected-lifecycle *{box-sizing:border-box}.mb-lifecycle-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 14px;border:1px solid var(--mb-border);border-radius:10px;background:var(--mb-surface)}.mb-lifecycle-toolbar>div:first-child{display:grid;gap:2px}.mb-lifecycle-toolbar span,.mb-lifecycle-card p,.mb-lifecycle-panel p,.mb-lifecycle-info span{color:var(--mb-muted)}.mb-lifecycle-toolbar-actions,.mb-lifecycle-panel-actions{display:flex;justify-content:flex-end;gap:8px}.mb-lifecycle-button{min-height:38px;border:1px solid var(--mb-border);border-radius:8px;background:#fff;color:var(--mb-text);cursor:pointer;font:inherit;font-weight:750;padding:8px 13px}.mb-lifecycle-button.primary{border-color:var(--mb-accent);background:var(--mb-accent);color:#fff}.mb-lifecycle-button.quiet{border-color:transparent;background:transparent;color:var(--mb-muted)}.mb-lifecycle-button.danger{border-color:#b63d35;background:#b63d35;color:#fff}.mb-lifecycle-button:disabled{cursor:not-allowed;opacity:.5}.mb-lifecycle-card,.mb-lifecycle-panel{padding:18px;border:1px solid var(--mb-border);border-radius:12px;background:var(--mb-surface)}.mb-lifecycle-card header{display:flex;align-items:start;justify-content:space-between;gap:16px}.mb-lifecycle-card h3,.mb-lifecycle-panel h3{margin:0;font-size:18px}.mb-lifecycle-card p,.mb-lifecycle-panel p{margin:3px 0 0}.mb-lifecycle-card header>span{padding:5px 8px;border-radius:999px;background:var(--mb-soft);color:var(--mb-muted);font-size:11px;font-weight:800;text-transform:uppercase}.mb-lifecycle-documents{list-style:none;margin:12px 0 0;padding:0}.mb-lifecycle-documents li{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:11px 0;border-top:1px solid var(--mb-border)}.mb-lifecycle-documents li>div{display:grid}.mb-lifecycle-documents span{color:var(--mb-muted);font-size:12px}.mb-lifecycle-info{display:grid;gap:3px;padding:13px 15px;border:1px solid #cddfe5;border-radius:10px;background:var(--mb-soft)}.mb-lifecycle-panel{display:grid;gap:16px;box-shadow:0 14px 38px rgba(30,56,68,.08)}.mb-lifecycle-panel.danger{border-color:#ecc5c2}.mb-lifecycle-panel label{display:grid;gap:6px;font-size:12px;font-weight:750}.mb-lifecycle-panel label small{color:var(--mb-muted);font-size:inherit;font-weight:500}.mb-lifecycle-panel input,.mb-lifecycle-panel select,.mb-lifecycle-panel textarea,.mb-lifecycle-upload input,.mb-lifecycle-upload select{width:100%;min-height:42px;border:1px solid var(--mb-border);border-radius:8px;background:#fff;color:var(--mb-text);font:inherit;padding:9px 11px}.mb-lifecycle-panel textarea{min-height:100px;resize:vertical}.mb-lifecycle-fields{display:grid;gap:12px}.mb-lifecycle-fields.two{grid-template-columns:repeat(2,minmax(0,1fr))}.mb-lifecycle-fields .full{grid-column:1/-1}.mb-lifecycle-packet{display:grid;gap:0;margin:0;padding:0;border:0}.mb-lifecycle-packet legend{margin-bottom:7px;font-size:12px;font-weight:800}.mb-lifecycle-packet>label{display:grid;grid-template-columns:auto 1fr auto auto;align-items:center;gap:10px;padding:10px 2px;border-top:1px solid var(--mb-border)}.mb-lifecycle-packet>label>input{width:16px;min-height:16px}.mb-lifecycle-packet>label>span{display:grid}.mb-lifecycle-packet button{border:0;background:transparent;color:var(--mb-accent);cursor:pointer;font:inherit}.mb-lifecycle-upload{display:grid;grid-template-columns:220px 1fr auto;align-items:end;gap:10px;padding:12px;border-radius:9px;background:var(--mb-soft)}.mb-lifecycle-message,.mb-lifecycle-error,.mb-lifecycle-loading{padding:12px 14px;border-radius:9px}.mb-lifecycle-message.success{background:#edf9f2;color:#217449}.mb-lifecycle-message.error,.mb-lifecycle-error{background:#fff0ef;color:#9d3029}.mb-lifecycle-error{display:flex;align-items:center;gap:12px}.mb-lifecycle-error span{flex:1}.mb-lifecycle-error button{border:1px solid currentColor;border-radius:7px;background:transparent;color:inherit;padding:7px 10px}@media(max-width:760px){.mb-lifecycle-toolbar,.mb-lifecycle-card header{align-items:stretch;flex-direction:column}.mb-lifecycle-toolbar-actions,.mb-lifecycle-panel-actions{justify-content:start}.mb-lifecycle-fields.two,.mb-lifecycle-upload{grid-template-columns:1fr}.mb-lifecycle-documents li{align-items:start}.mb-lifecycle-packet>label{grid-template-columns:auto 1fr auto}}
2453
+ .mb-connected-lifecycle{--mb-accent:#238dbd;--mb-text:#203743;--mb-muted:#657982;--mb-border:#dbe6ea;--mb-soft:#f3f8fa;--mb-surface:#fff;display:grid;gap:14px;color:var(--mb-text);font:14px/1.45 var(--mb-font,Inter,ui-sans-serif,system-ui,sans-serif)}.mb-connected-lifecycle *{box-sizing:border-box}.mb-lifecycle-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.mb-lifecycle-detail-grid>*:last-child:nth-child(odd){grid-column:1/-1}.mb-lifecycle-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 14px;border:1px solid var(--mb-border);border-radius:10px;background:var(--mb-surface)}.mb-lifecycle-toolbar>div:first-child{display:grid;gap:2px}.mb-lifecycle-toolbar span,.mb-lifecycle-card p,.mb-lifecycle-panel p,.mb-lifecycle-info span{color:var(--mb-muted)}.mb-lifecycle-toolbar-actions,.mb-lifecycle-panel-actions{display:flex;justify-content:flex-end;gap:8px}.mb-lifecycle-button{min-height:38px;border:1px solid var(--mb-border);border-radius:8px;background:#fff;color:var(--mb-text);cursor:pointer;font:inherit;font-weight:750;padding:8px 13px}.mb-lifecycle-button.primary{border-color:var(--mb-accent);background:var(--mb-accent);color:#fff}.mb-lifecycle-button.quiet{border-color:transparent;background:transparent;color:var(--mb-muted)}.mb-lifecycle-button.danger{border-color:#b63d35;background:#b63d35;color:#fff}.mb-lifecycle-button:disabled{cursor:not-allowed;opacity:.5}.mb-lifecycle-card,.mb-lifecycle-panel{padding:18px;border:1px solid var(--mb-border);border-radius:12px;background:var(--mb-surface)}.mb-lifecycle-card header{display:flex;align-items:start;justify-content:space-between;gap:16px}.mb-lifecycle-card h3,.mb-lifecycle-panel h3{margin:0;font-size:18px}.mb-lifecycle-card p,.mb-lifecycle-panel p{margin:3px 0 0}.mb-lifecycle-card header>span{padding:5px 8px;border-radius:999px;background:var(--mb-soft);color:var(--mb-muted);font-size:11px;font-weight:800;text-transform:uppercase}.mb-lifecycle-documents{list-style:none;margin:12px 0 0;padding:0}.mb-lifecycle-documents li{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:11px 0;border-top:1px solid var(--mb-border)}.mb-lifecycle-documents li>div{display:grid}.mb-lifecycle-documents span{color:var(--mb-muted);font-size:12px}.mb-lifecycle-info{display:grid;gap:3px;padding:13px 15px;border:1px solid #cddfe5;border-radius:10px;background:var(--mb-soft)}.mb-lifecycle-dialog-backdrop{position:fixed;z-index:2147483000;inset:0;display:grid;place-items:center;padding:20px;background:rgba(18,35,43,.56);backdrop-filter:blur(3px)}.mb-lifecycle-dialog{position:relative;width:min(760px,100%);max-height:calc(100vh - 40px);overflow:auto;outline:0}.mb-lifecycle-dialog-close{position:absolute;z-index:1;top:12px;right:12px;width:34px;height:34px;border:1px solid var(--mb-border);border-radius:8px;background:var(--mb-surface);color:var(--mb-text);cursor:pointer;font:22px/1 inherit}.mb-lifecycle-panel{display:grid;gap:16px;padding-top:24px;box-shadow:0 24px 70px rgba(18,35,43,.22)}.mb-lifecycle-panel.danger{border-color:#ecc5c2}.mb-lifecycle-panel label{display:grid;gap:6px;font-size:12px;font-weight:750}.mb-lifecycle-panel label small{color:var(--mb-muted);font-size:inherit;font-weight:500}.mb-lifecycle-panel input,.mb-lifecycle-panel select,.mb-lifecycle-panel textarea,.mb-lifecycle-upload input,.mb-lifecycle-upload select{width:100%;min-height:42px;border:1px solid var(--mb-border);border-radius:8px;background:#fff;color:var(--mb-text);font:inherit;padding:9px 11px}.mb-lifecycle-panel textarea{min-height:100px;resize:vertical}.mb-lifecycle-fields{display:grid;gap:12px}.mb-lifecycle-fields.two{grid-template-columns:repeat(2,minmax(0,1fr))}.mb-lifecycle-fields .full{grid-column:1/-1}.mb-lifecycle-packet{display:grid;gap:0;margin:0;padding:0;border:0}.mb-lifecycle-packet legend{margin-bottom:7px;font-size:12px;font-weight:800}.mb-lifecycle-packet>label{display:grid;grid-template-columns:auto 1fr auto auto;align-items:center;gap:10px;padding:10px 2px;border-top:1px solid var(--mb-border)}.mb-lifecycle-packet>label>input{width:16px;min-height:16px}.mb-lifecycle-packet>label>span{display:grid}.mb-lifecycle-packet button{border:0;background:transparent;color:var(--mb-accent);cursor:pointer;font:inherit}.mb-lifecycle-upload{display:grid;grid-template-columns:220px 1fr auto;align-items:end;gap:10px;padding:12px;border-radius:9px;background:var(--mb-soft)}.mb-lifecycle-message,.mb-lifecycle-error,.mb-lifecycle-loading{padding:12px 14px;border-radius:9px}.mb-lifecycle-message.success{background:#edf9f2;color:#217449}.mb-lifecycle-message.error,.mb-lifecycle-error{background:#fff0ef;color:#9d3029}.mb-lifecycle-error{display:flex;align-items:center;gap:12px}.mb-lifecycle-error span{flex:1}.mb-lifecycle-error button{border:1px solid currentColor;border-radius:7px;background:transparent;color:inherit;padding:7px 10px}@media(max-width:760px){.mb-lifecycle-detail-grid{grid-template-columns:1fr}.mb-lifecycle-detail-grid>*:last-child:nth-child(odd){grid-column:auto}.mb-lifecycle-toolbar,.mb-lifecycle-card header{align-items:stretch;flex-direction:column}.mb-lifecycle-toolbar-actions,.mb-lifecycle-panel-actions{justify-content:start}.mb-lifecycle-fields.two,.mb-lifecycle-upload{grid-template-columns:1fr}.mb-lifecycle-documents li{align-items:start}.mb-lifecycle-packet>label{grid-template-columns:auto 1fr auto}.mb-lifecycle-dialog-backdrop{align-items:end;padding:0}.mb-lifecycle-dialog{max-height:92vh}.mb-lifecycle-dialog .mb-lifecycle-panel{border-radius:18px 18px 0 0}.mb-lifecycle-packet>label>button:last-child{grid-column:3}}
1937
2454
  `;
1938
2455
  var CONNECTED_THEME_OVERRIDE_STYLES = `
1939
2456
  .mb-connected-lifecycle{color:var(--mb-text);font-family:var(--mb-font,Inter,ui-sans-serif,system-ui,sans-serif)}
@@ -1956,7 +2473,7 @@ var CONNECTED_THEME_OVERRIDE_STYLES = `
1956
2473
  function widget(tagName, props) {
1957
2474
  const ref = useRef4(null);
1958
2475
  const { onMindBill, onMindBillError } = props;
1959
- useEffect4(() => {
2476
+ useEffect5(() => {
1960
2477
  const element = ref.current;
1961
2478
  if (!element) return;
1962
2479
  const handleEvent = (event) => onMindBill?.(event);
@@ -1993,15 +2510,24 @@ function MindBillBillReview(props) {
1993
2510
  return widget("mindbill-bill-review", props);
1994
2511
  }
1995
2512
  export {
2513
+ BILL_SUBMISSION_DOCUMENT_TYPES,
2514
+ BILL_SUBMISSION_REQUIRED_FIELDS,
1996
2515
  BillActivityTimeline,
1997
2516
  BillLifecycleActions,
2517
+ BillLifecycleProgress,
2518
+ BillPayerContactCard,
2519
+ BillPaymentLedger,
2520
+ BillRemittanceCard,
1998
2521
  BillReviewForm,
2522
+ BillSnapshotSummary,
1999
2523
  BillStatusSummary,
2524
+ BillSubmissionForm,
2000
2525
  ConnectedBillLifecycle,
2001
2526
  ConnectedBillStatus,
2002
2527
  MindBillBillReview,
2003
2528
  MindBillBillTimeline,
2004
2529
  billActivityEventLabel,
2530
+ billLifecycleStage,
2005
2531
  buildBillReviewSaveInput,
2006
2532
  createBillLifecycleClient2 as createBillLifecycleClient,
2007
2533
  createBillStatusClient,
@@ -2011,6 +2537,7 @@ export {
2011
2537
  resolveMindBillAppearance,
2012
2538
  useBillLifecycle,
2013
2539
  useBillStatus,
2540
+ validateBillSubmission,
2014
2541
  visibleBillLifecycleActions
2015
2542
  };
2016
2543
  //# sourceMappingURL=index.js.map