@mindbill/react 0.34.0 → 0.35.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 useEffect8, useRef as useRef6 } from "react";
5
+ import { createElement, useEffect as useEffect9, useRef as useRef6 } from "react";
6
6
 
7
7
  // src/appearance.ts
8
8
  var mindBillThemePresets = {
@@ -3319,19 +3319,509 @@ function BillStatusAgingMatrix({
3319
3319
  ] });
3320
3320
  }
3321
3321
 
3322
+ // src/bill-tasks-dashboard.tsx
3323
+ import {
3324
+ BILL_TASKS_AGING_BUCKETS
3325
+ } from "@mindbill/browser";
3326
+ import {
3327
+ BILL_TASKS_AGING_BUCKETS as BILL_TASKS_AGING_BUCKETS2,
3328
+ billTasksAgingBucketIndex,
3329
+ buildBillTasksDashboard
3330
+ } from "@mindbill/browser";
3331
+ import { Fragment as Fragment5, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
3332
+ var TONES = {
3333
+ violet: "#7c53c3",
3334
+ red: "#cf4437",
3335
+ blue: "#2f7fd1",
3336
+ green: "#2c9a5b",
3337
+ amber: "#d9931f",
3338
+ neutral: "#8195a1"
3339
+ };
3340
+ var BUCKET_PILL_BASES = ["#2c9a5b", "#1f9aa8", "#dcbb28", "#e08a2e", "#d75d8a"];
3341
+ var css5 = `
3342
+ .mbtk{color:var(--mb-text);font-family:var(--mb-font);font-size:14px}.mbtk *{box-sizing:border-box}.mbtk h2,.mbtk p{margin:0}
3343
+ .mbtk-heading{margin-bottom:14px}.mbtk-heading h2{font-size:24px}
3344
+ .mbtk-toolbar{margin-bottom:14px}
3345
+ .mbtk-section{margin-bottom:16px;border:1.5px solid var(--mbtk-tone,var(--mb-border));border-radius:var(--mb-radius);background:var(--mb-surface);box-shadow:var(--mb-shadow);overflow:hidden}
3346
+ .mbtk-section.is-grand{border-color:var(--mb-border)}
3347
+ .mbtk-grid{display:grid;grid-template-columns:var(--mbtk-cols);gap:0 10px;align-items:center;padding:0 16px}
3348
+ .mbtk-head{padding:12px 16px;border-bottom:1px solid color-mix(in srgb,var(--mbtk-tone,var(--mb-border)) 22%,var(--mb-border))}
3349
+ .mbtk-title{display:flex;align-items:center;gap:9px;min-width:0}
3350
+ .mbtk-dot{flex:0 0 auto;width:11px;height:11px;border-radius:50%;background:var(--mbtk-tone,var(--mb-muted))}
3351
+ .mbtk-title-text{min-width:0}
3352
+ .mbtk-title-text strong{display:block;font-size:15.5px;line-height:1.3}
3353
+ .mbtk-basis{display:block;color:var(--mb-muted);font-size:12px;line-height:1.35}
3354
+ .mbtk-pill{justify-self:stretch;padding:5px 6px;border-radius:999px;background:color-mix(in srgb,var(--mbtk-pill) 20%,var(--mb-surface));color:color-mix(in srgb,var(--mbtk-pill) 62%,var(--mb-text));font-size:11px;font-weight:750;line-height:1.25;text-align:center;white-space:nowrap}
3355
+ .mbtk-colhead{justify-self:stretch;color:var(--mb-muted);font-size:11px;font-weight:800;letter-spacing:.05em;text-transform:uppercase;text-align:center;white-space:nowrap}
3356
+ .mbtk-row{border-top:1px solid color-mix(in srgb,var(--mb-border) 60%,transparent);min-height:44px}
3357
+ .mbtk-row:first-of-type{border-top:0}
3358
+ .mbtk-rowlabel{color:var(--mb-muted);font-size:13px;line-height:1.35;padding:9px 0;overflow-wrap:anywhere}
3359
+ .mbtk-count{text-align:center;font-variant-numeric:tabular-nums}
3360
+ .mbtk-zero{color:var(--mb-muted)}
3361
+ .mbtk-link{border:0;background:none;padding:6px 8px;color:var(--mb-accent);font:inherit;font-weight:750;font-variant-numeric:tabular-nums;cursor:pointer;border-radius:6px}
3362
+ .mbtk-link:hover{text-decoration:underline;background:color-mix(in srgb,var(--mb-accent) 8%,transparent)}
3363
+ .mbtk-total{text-align:center}
3364
+ .mbtk-totals{background:var(--mb-soft);border-top:1px solid var(--mb-border);font-weight:760}
3365
+ .mbtk-totals .mbtk-rowlabel{color:var(--mb-text);font-weight:760}
3366
+ .mbtk-empty{padding:22px 16px;color:var(--mb-muted);text-align:center}
3367
+ .mbtk-grand .mbtk-rowlabel{color:var(--mb-text);font-size:14px;font-weight:800}
3368
+ .mbtk-grand{min-height:52px}
3369
+ .mbtk-footnote{margin-top:12px;color:var(--mb-muted);font-size:12.5px}
3370
+ @media(max-width:760px){.mbtk-pill,.mbtk-colhead,.mbtk-count{display:none}.mbtk-grid{grid-template-columns:minmax(0,1fr) auto}}
3371
+ `;
3372
+ function cellButton(key, count, className, label, onSelect) {
3373
+ if (count > 0 && onSelect) {
3374
+ return /* @__PURE__ */ jsx7("span", { className, children: /* @__PURE__ */ jsx7("button", { type: "button", className: "mbtk-link", "aria-label": label, onClick: onSelect, children: count }) }, key);
3375
+ }
3376
+ return /* @__PURE__ */ jsx7("span", { className: `${className}${count === 0 ? " mbtk-zero" : ""}`, children: count }, key);
3377
+ }
3378
+ function TaskRow({
3379
+ sectionId,
3380
+ row,
3381
+ buckets,
3382
+ onSelectCell
3383
+ }) {
3384
+ const allRefs = row.refs.flat();
3385
+ return /* @__PURE__ */ jsxs7("div", { className: "mbtk-grid mbtk-row", children: [
3386
+ /* @__PURE__ */ jsx7("span", { className: "mbtk-rowlabel", children: row.label }),
3387
+ buckets.map((bucket, index) => {
3388
+ const count = row.counts[index] ?? 0;
3389
+ return cellButton(
3390
+ bucket.id,
3391
+ count,
3392
+ "mbtk-count",
3393
+ `${row.label} \xB7 ${bucket.label}: ${count} tasks`,
3394
+ onSelectCell ? () => onSelectCell({ sectionId, rowId: row.id, bucketId: bucket.id, refs: row.refs[index] ?? [], count }) : null
3395
+ );
3396
+ }),
3397
+ cellButton(
3398
+ "task-total",
3399
+ row.total,
3400
+ "mbtk-total",
3401
+ `${row.label} \xB7 all ages: ${row.total} tasks`,
3402
+ onSelectCell ? () => onSelectCell({ sectionId, rowId: row.id, bucketId: null, refs: allRefs, count: row.total }) : null
3403
+ )
3404
+ ] });
3405
+ }
3406
+ function SectionCard({
3407
+ section,
3408
+ buckets,
3409
+ emptyLabel,
3410
+ onSelectCell
3411
+ }) {
3412
+ return /* @__PURE__ */ jsxs7(
3413
+ "section",
3414
+ {
3415
+ className: "mbtk-section",
3416
+ style: { "--mbtk-tone": TONES[section.tone] },
3417
+ "aria-label": section.label,
3418
+ children: [
3419
+ /* @__PURE__ */ jsxs7("div", { className: "mbtk-grid mbtk-head", children: [
3420
+ /* @__PURE__ */ jsxs7("span", { className: "mbtk-title", children: [
3421
+ /* @__PURE__ */ jsx7("i", { className: "mbtk-dot", "aria-hidden": "true" }),
3422
+ /* @__PURE__ */ jsxs7("span", { className: "mbtk-title-text", children: [
3423
+ /* @__PURE__ */ jsx7("strong", { children: section.label }),
3424
+ /* @__PURE__ */ jsxs7("span", { className: "mbtk-basis", children: [
3425
+ "by ",
3426
+ section.agingBasisLabel
3427
+ ] })
3428
+ ] })
3429
+ ] }),
3430
+ buckets.map((bucket, index) => /* @__PURE__ */ jsx7(
3431
+ "span",
3432
+ {
3433
+ className: "mbtk-pill",
3434
+ style: { "--mbtk-pill": BUCKET_PILL_BASES[index % BUCKET_PILL_BASES.length] },
3435
+ children: bucket.label
3436
+ },
3437
+ bucket.id
3438
+ )),
3439
+ /* @__PURE__ */ jsx7("span", { className: "mbtk-colhead", children: "Task Total" })
3440
+ ] }),
3441
+ section.empty ? /* @__PURE__ */ jsx7("p", { className: "mbtk-empty", children: emptyLabel }) : /* @__PURE__ */ jsxs7(Fragment5, { children: [
3442
+ section.rows.map((row) => /* @__PURE__ */ jsx7(TaskRow, { sectionId: section.id, row, buckets, onSelectCell }, row.id)),
3443
+ /* @__PURE__ */ jsxs7("div", { className: "mbtk-grid mbtk-row mbtk-totals", children: [
3444
+ /* @__PURE__ */ jsx7("span", { className: "mbtk-rowlabel", children: "Total" }),
3445
+ buckets.map((bucket, index) => /* @__PURE__ */ jsx7("span", { className: "mbtk-count", children: section.totals[index] ?? 0 }, bucket.id)),
3446
+ /* @__PURE__ */ jsx7("span", { className: "mbtk-total", children: section.total })
3447
+ ] })
3448
+ ] })
3449
+ ]
3450
+ }
3451
+ );
3452
+ }
3453
+ function BillTasksDashboard({
3454
+ data,
3455
+ buckets = BILL_TASKS_AGING_BUCKETS,
3456
+ heading,
3457
+ grandTotalLabel = "Bill Tasks Total",
3458
+ emptyLabel = "No Tasks",
3459
+ onSelectCell,
3460
+ toolbar,
3461
+ footnote,
3462
+ appearance,
3463
+ className = "",
3464
+ style
3465
+ }) {
3466
+ const columns = `minmax(150px,1.6fr) repeat(${buckets.length},minmax(84px,1fr)) minmax(84px,1fr)`;
3467
+ return /* @__PURE__ */ jsxs7(
3468
+ "div",
3469
+ {
3470
+ className: `mbtk ${className}`.trim(),
3471
+ style: { ...mindBillAppearanceStyle(appearance), "--mbtk-cols": columns, ...style },
3472
+ children: [
3473
+ /* @__PURE__ */ jsx7("style", { children: css5 }),
3474
+ heading ? /* @__PURE__ */ jsx7("div", { className: "mbtk-heading", children: typeof heading === "string" ? /* @__PURE__ */ jsx7("h2", { children: heading }) : heading }) : null,
3475
+ toolbar ? /* @__PURE__ */ jsx7("div", { className: "mbtk-toolbar", children: toolbar }) : null,
3476
+ data.sections.map((section) => /* @__PURE__ */ jsx7(
3477
+ SectionCard,
3478
+ {
3479
+ section,
3480
+ buckets,
3481
+ emptyLabel,
3482
+ onSelectCell
3483
+ },
3484
+ section.id
3485
+ )),
3486
+ /* @__PURE__ */ jsx7("section", { className: "mbtk-section is-grand", "aria-label": grandTotalLabel, children: /* @__PURE__ */ jsxs7("div", { className: "mbtk-grid mbtk-row mbtk-grand mbtk-totals", children: [
3487
+ /* @__PURE__ */ jsx7("span", { className: "mbtk-rowlabel", children: grandTotalLabel }),
3488
+ buckets.map((bucket, index) => /* @__PURE__ */ jsx7("span", { className: "mbtk-count", children: data.grandTotals[index] ?? 0 }, bucket.id)),
3489
+ /* @__PURE__ */ jsx7("span", { className: "mbtk-total", children: data.grandTotal })
3490
+ ] }) }),
3491
+ footnote ? /* @__PURE__ */ jsx7("p", { className: "mbtk-footnote", children: footnote }) : null
3492
+ ]
3493
+ }
3494
+ );
3495
+ }
3496
+
3497
+ // src/bill-submissions-ribbon.tsx
3498
+ import { Fragment as Fragment6, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
3499
+ function billSubmissionsRibbonDeliveryLabel(summary) {
3500
+ if (/electronically sent/i.test(summary)) return "e-Bill (837)";
3501
+ if (/faxed/i.test(summary)) return "Fax";
3502
+ if (/emailed/i.test(summary)) return "Email";
3503
+ if (/mailed/i.test(summary)) return "Mail";
3504
+ return "Sent";
3505
+ }
3506
+ function ribbonDate(iso) {
3507
+ const parsed = new Date(iso);
3508
+ if (Number.isNaN(parsed.getTime())) return iso;
3509
+ return new Intl.DateTimeFormat("en-US", { month: "2-digit", day: "2-digit", year: "numeric" }).format(parsed);
3510
+ }
3511
+ function billSubmissionsRibbonFromHistory(history) {
3512
+ return history.filter((entry) => entry.kind === "submission").map((entry) => ({
3513
+ id: entry.id,
3514
+ label: entry.action,
3515
+ meta: [
3516
+ { label: "Delivery", value: billSubmissionsRibbonDeliveryLabel(entry.summary) },
3517
+ { label: "Sent", value: ribbonDate(entry.date) }
3518
+ ]
3519
+ }));
3520
+ }
3521
+ var css6 = `
3522
+ .mbsr{display:flex;gap:10px;overflow-x:auto;padding-bottom:4px;color:var(--mb-text);font-family:var(--mb-font);font-size:13px}
3523
+ .mbsr *{box-sizing:border-box}
3524
+ .mbsr-chip{flex:0 0 auto;display:grid;gap:7px;min-width:180px;max-width:280px;padding:11px 13px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);background:var(--mb-surface);color:inherit;font:inherit;text-align:left;text-decoration:none;cursor:pointer}
3525
+ .mbsr-chip:hover{border-color:var(--mb-accent)}
3526
+ .mbsr-chip[data-active=true]{border-color:var(--mb-accent);background:color-mix(in srgb,var(--mb-accent) 7%,var(--mb-surface));box-shadow:0 0 0 1px var(--mb-accent) inset}
3527
+ .mbsr-top{display:flex;align-items:center;gap:8px;min-width:0}
3528
+ .mbsr-label{font-size:13.5px;font-weight:760;line-height:1.3;overflow-wrap:anywhere}
3529
+ .mbsr-badge{flex:0 0 auto;padding:2px 8px;border:1px solid color-mix(in srgb,var(--mb-warning) 55%,var(--mb-border));border-radius:999px;background:color-mix(in srgb,var(--mb-warning) 12%,var(--mb-surface));font-size:11px;font-weight:700;white-space:nowrap}
3530
+ .mbsr-meta{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,auto);gap:2px 14px;justify-content:start}
3531
+ .mbsr-meta>span{display:grid;gap:1px;min-width:0}
3532
+ .mbsr-meta i{color:var(--mb-muted);font-size:10.5px;font-style:normal;font-weight:800;letter-spacing:.05em;text-transform:uppercase;white-space:nowrap}
3533
+ .mbsr-meta b{font-size:12.5px;font-weight:700;white-space:nowrap}
3534
+ `;
3535
+ function BillSubmissionsRibbon({
3536
+ items,
3537
+ onSelect,
3538
+ appearance,
3539
+ className = "",
3540
+ style
3541
+ }) {
3542
+ return /* @__PURE__ */ jsxs8(
3543
+ "div",
3544
+ {
3545
+ className: `mbsr ${className}`.trim(),
3546
+ style: mindBillAppearanceStyle(appearance, style),
3547
+ role: "list",
3548
+ "aria-label": "Bill submissions",
3549
+ children: [
3550
+ /* @__PURE__ */ jsx8("style", { children: css6 }),
3551
+ items.map((item) => {
3552
+ const content = /* @__PURE__ */ jsxs8(Fragment6, { children: [
3553
+ /* @__PURE__ */ jsxs8("span", { className: "mbsr-top", children: [
3554
+ /* @__PURE__ */ jsx8("span", { className: "mbsr-label", children: item.label }),
3555
+ item.badge ? /* @__PURE__ */ jsx8("span", { className: "mbsr-badge", children: item.badge }) : null
3556
+ ] }),
3557
+ item.meta?.length ? /* @__PURE__ */ jsx8("span", { className: "mbsr-meta", children: item.meta.slice(0, 3).map((pair) => /* @__PURE__ */ jsxs8("span", { children: [
3558
+ /* @__PURE__ */ jsx8("i", { children: pair.label }),
3559
+ /* @__PURE__ */ jsx8("b", { children: pair.value })
3560
+ ] }, pair.label)) }) : null
3561
+ ] });
3562
+ return item.href ? /* @__PURE__ */ jsx8(
3563
+ "a",
3564
+ {
3565
+ className: "mbsr-chip",
3566
+ "data-active": Boolean(item.active),
3567
+ href: item.href,
3568
+ role: "listitem",
3569
+ onClick: () => onSelect?.(item),
3570
+ children: content
3571
+ },
3572
+ item.id
3573
+ ) : /* @__PURE__ */ jsx8(
3574
+ "button",
3575
+ {
3576
+ type: "button",
3577
+ className: "mbsr-chip",
3578
+ "data-active": Boolean(item.active),
3579
+ role: "listitem",
3580
+ onClick: () => onSelect?.(item),
3581
+ children: content
3582
+ },
3583
+ item.id
3584
+ );
3585
+ })
3586
+ ]
3587
+ }
3588
+ );
3589
+ }
3590
+
3591
+ // src/report-bill-status-dialog.tsx
3592
+ import { useEffect as useEffect5, useState as useState6 } from "react";
3593
+ import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
3594
+ var REPORT_BILL_STATUS_OPTIONS = [
3595
+ {
3596
+ id: "message_left",
3597
+ label: "Message Left Requesting Bill Payment Status",
3598
+ description: "Claims Administrator/Bill Review representative unavailable."
3599
+ },
3600
+ {
3601
+ id: "eor_pending",
3602
+ label: "Explanation of Review (EOR) Pending",
3603
+ description: "Claims Administrator/Bill Review reported the bill is still in process and an EOR has not been generated or sent."
3604
+ },
3605
+ {
3606
+ id: "eor_sent",
3607
+ label: "Explanation of Review (EOR) Sent",
3608
+ description: "Claims Administrator/Bill Review reported sending an EOR to the provider."
3609
+ },
3610
+ {
3611
+ id: "bill_not_on_file",
3612
+ label: "Bill Not On File",
3613
+ description: "Claims Administrator/Bill Review reported not receiving the bill."
3614
+ },
3615
+ {
3616
+ id: "forwarded",
3617
+ label: "Bill Forwarded to Different Payer / Network",
3618
+ description: "Claims Administrator/Bill Review reported forwarding the bill to a different payer."
3619
+ }
3620
+ ];
3621
+ var css7 = `
3622
+ .mbbs-overlay{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:20px;background:rgba(15,30,40,.45)}
3623
+ .mbbs{display:grid;gap:18px;width:min(860px,100%);max-height:min(90vh,960px);overflow:auto;overscroll-behavior:contain;padding:24px;border:1px solid var(--mb-border);border-radius:var(--mb-radius);background:var(--mb-surface);color:var(--mb-text);font-family:var(--mb-font);font-size:14px;box-shadow:0 24px 60px rgba(17,38,49,.28)}
3624
+ .mbbs *{box-sizing:border-box}
3625
+ .mbbs-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
3626
+ .mbbs-title{margin:0;font-size:20px;font-weight:760}
3627
+ .mbbs-close{border:0;background:transparent;color:var(--mb-muted);font-size:22px;line-height:1;cursor:pointer}
3628
+ .mbbs-section h4{margin:0 0 4px;font-size:15px}
3629
+ .mbbs-copy{margin:0 0 10px;color:var(--mb-muted);font-size:13px}
3630
+ .mbbs-contacts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
3631
+ .mbbs-contact{border:1px solid var(--mb-border);border-left:4px solid var(--mb-accent);border-radius:var(--mb-control-radius);background:color-mix(in srgb,var(--mb-accent) 3%,var(--mb-surface));padding:12px 14px}
3632
+ .mbbs-contact h5{margin:0 0 6px;color:var(--mb-muted);font-size:11px;font-weight:800;letter-spacing:.07em;text-transform:uppercase}
3633
+ .mbbs-contact dl{display:grid;gap:4px;margin:0}
3634
+ .mbbs-contact dl>div{display:grid;grid-template-columns:130px minmax(0,1fr);gap:10px}
3635
+ .mbbs-contact dt{color:var(--mb-muted);font-size:12.5px}
3636
+ .mbbs-contact dd{margin:0;font-weight:700;overflow-wrap:anywhere}
3637
+ .mbbs-receipt{border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);padding:10px}
3638
+ .mbbs-report{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:18px}
3639
+ .mbbs-options{display:grid;gap:8px;align-content:start}
3640
+ .mbbs-option{display:flex;align-items:flex-start;gap:10px;padding:10px 12px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);background:var(--mb-surface);cursor:pointer}
3641
+ .mbbs-option[data-selected=true]{border-color:var(--mb-accent);background:color-mix(in srgb,var(--mb-accent) 5%,var(--mb-surface))}
3642
+ .mbbs-option input{margin-top:3px;accent-color:var(--mb-accent)}
3643
+ .mbbs-option-label{display:block;font-weight:750;line-height:1.35}
3644
+ .mbbs-option-copy{display:block;margin-top:2px;color:var(--mb-muted);font-size:12.5px;line-height:1.4}
3645
+ .mbbs-fields{display:grid;gap:10px;align-content:start}
3646
+ .mbbs-field{display:grid;gap:5px;font-size:13px}
3647
+ .mbbs-label{font-weight:650}
3648
+ .mbbs-input,.mbbs-textarea{width:100%;padding:9px 11px;border:1px solid var(--mb-border);border-radius:calc(var(--mb-control-radius) - 2px);background:var(--mb-input);color:var(--mb-text);font:inherit;font-size:14px}
3649
+ .mbbs-textarea{resize:vertical;min-height:74px}
3650
+ .mbbs-input:focus,.mbbs-textarea:focus{outline:3px solid color-mix(in srgb,var(--mb-accent) 22%,transparent);border-color:var(--mb-accent)}
3651
+ .mbbs-alert{padding:10px 12px;border-radius:var(--mb-control-radius);background:color-mix(in srgb,var(--mb-danger) 10%,transparent);color:var(--mb-danger);font-size:13px}
3652
+ .mbbs-actions{display:flex;justify-content:flex-end;gap:10px}
3653
+ .mbbs-cancel{min-height:42px;padding:9px 16px;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius);background:var(--mb-surface);color:var(--mb-text);font:inherit;font-weight:680;cursor:pointer}
3654
+ .mbbs-save{min-height:42px;min-width:130px;padding:9px 18px;border:0;border-radius:var(--mb-control-radius);background:var(--mb-accent);color:var(--mb-accent-contrast);font:inherit;font-weight:760;cursor:pointer}
3655
+ .mbbs-save:disabled,.mbbs-cancel:disabled{opacity:.6;cursor:not-allowed}
3656
+ @media(max-width:700px){.mbbs-contacts,.mbbs-report{grid-template-columns:1fr}}
3657
+ `;
3658
+ function ReportBillStatusDialog({
3659
+ title = "Report Bill Status",
3660
+ claimsAdmin,
3661
+ billReview,
3662
+ receipt,
3663
+ submitting = false,
3664
+ error = null,
3665
+ onCancel,
3666
+ onSave,
3667
+ appearance,
3668
+ className = "",
3669
+ style
3670
+ }) {
3671
+ const [status, setStatus] = useState6(null);
3672
+ const [company, setCompany] = useState6("");
3673
+ const [representativeName, setRepresentativeName] = useState6("");
3674
+ const [representativeRole, setRepresentativeRole] = useState6("");
3675
+ const [phone, setPhone] = useState6("");
3676
+ const [callReference, setCallReference] = useState6("");
3677
+ const [note, setNote] = useState6("");
3678
+ useEffect5(() => {
3679
+ const onKey = (event) => {
3680
+ if (event.key === "Escape" && !submitting) onCancel();
3681
+ };
3682
+ window.addEventListener("keydown", onKey);
3683
+ return () => window.removeEventListener("keydown", onKey);
3684
+ }, [onCancel, submitting]);
3685
+ const save = () => {
3686
+ if (!status) return;
3687
+ onSave({
3688
+ status,
3689
+ ...company.trim() ? { company: company.trim() } : {},
3690
+ ...representativeName.trim() ? { representativeName: representativeName.trim() } : {},
3691
+ ...representativeRole.trim() ? { representativeRole: representativeRole.trim() } : {},
3692
+ ...phone.trim() ? { phone: phone.trim() } : {},
3693
+ ...callReference.trim() ? { callReference: callReference.trim() } : {},
3694
+ ...note.trim() ? { note: note.trim() } : {}
3695
+ });
3696
+ };
3697
+ const field = (label, value, onChange) => /* @__PURE__ */ jsxs9("label", { className: "mbbs-field", children: [
3698
+ /* @__PURE__ */ jsx9("span", { className: "mbbs-label", children: label }),
3699
+ /* @__PURE__ */ jsx9("input", { className: "mbbs-input", value, disabled: submitting, onChange: (event) => onChange(event.target.value) })
3700
+ ] }, label);
3701
+ return /* @__PURE__ */ jsxs9(
3702
+ "div",
3703
+ {
3704
+ className: "mbbs-overlay",
3705
+ role: "presentation",
3706
+ onMouseDown: (event) => {
3707
+ if (event.target === event.currentTarget && !submitting) onCancel();
3708
+ },
3709
+ children: [
3710
+ /* @__PURE__ */ jsx9("style", { children: css7 }),
3711
+ /* @__PURE__ */ jsxs9(
3712
+ "div",
3713
+ {
3714
+ className: `mbbs ${className}`.trim(),
3715
+ style: mindBillAppearanceStyle(appearance, style),
3716
+ role: "dialog",
3717
+ "aria-modal": "true",
3718
+ "aria-label": typeof title === "string" ? title : "Report Bill Status",
3719
+ children: [
3720
+ /* @__PURE__ */ jsxs9("div", { className: "mbbs-head", children: [
3721
+ /* @__PURE__ */ jsx9("h3", { className: "mbbs-title", children: title }),
3722
+ /* @__PURE__ */ jsx9("button", { className: "mbbs-close", type: "button", "aria-label": "Close", disabled: submitting, onClick: onCancel, children: "\xD7" })
3723
+ ] }),
3724
+ claimsAdmin || billReview ? /* @__PURE__ */ jsxs9("div", { className: "mbbs-section", children: [
3725
+ /* @__PURE__ */ jsx9("h4", { children: "1. Call Claims Administrator or Bill Review" }),
3726
+ /* @__PURE__ */ jsx9("p", { className: "mbbs-copy", children: "Contact the payer to request the payment status of this bill." }),
3727
+ /* @__PURE__ */ jsxs9("div", { className: "mbbs-contacts", children: [
3728
+ claimsAdmin ? /* @__PURE__ */ jsxs9("div", { className: "mbbs-contact", children: [
3729
+ /* @__PURE__ */ jsx9("h5", { children: "Claims Admin" }),
3730
+ /* @__PURE__ */ jsxs9("dl", { children: [
3731
+ /* @__PURE__ */ jsxs9("div", { children: [
3732
+ /* @__PURE__ */ jsx9("dt", { children: "Name" }),
3733
+ /* @__PURE__ */ jsx9("dd", { children: claimsAdmin.name })
3734
+ ] }),
3735
+ claimsAdmin.hoursOfOperation ? /* @__PURE__ */ jsxs9("div", { children: [
3736
+ /* @__PURE__ */ jsx9("dt", { children: "Hours of Operation" }),
3737
+ /* @__PURE__ */ jsx9("dd", { children: claimsAdmin.hoursOfOperation })
3738
+ ] }) : null,
3739
+ (claimsAdmin.phones ?? []).map((entry) => /* @__PURE__ */ jsxs9("div", { children: [
3740
+ /* @__PURE__ */ jsx9("dt", { children: entry.label }),
3741
+ /* @__PURE__ */ jsx9("dd", { children: entry.value })
3742
+ ] }, `${entry.label}-${entry.value}`))
3743
+ ] })
3744
+ ] }) : null,
3745
+ billReview ? /* @__PURE__ */ jsxs9("div", { className: "mbbs-contact", children: [
3746
+ /* @__PURE__ */ jsx9("h5", { children: "Bill Review" }),
3747
+ /* @__PURE__ */ jsxs9("dl", { children: [
3748
+ /* @__PURE__ */ jsxs9("div", { children: [
3749
+ /* @__PURE__ */ jsx9("dt", { children: "Name" }),
3750
+ /* @__PURE__ */ jsx9("dd", { children: billReview.name })
3751
+ ] }),
3752
+ billReview.phone ? /* @__PURE__ */ jsxs9("div", { children: [
3753
+ /* @__PURE__ */ jsx9("dt", { children: "Phone" }),
3754
+ /* @__PURE__ */ jsx9("dd", { children: billReview.phone })
3755
+ ] }) : null
3756
+ ] })
3757
+ ] }) : null
3758
+ ] })
3759
+ ] }) : null,
3760
+ receipt ? /* @__PURE__ */ jsxs9("div", { className: "mbbs-section", children: [
3761
+ /* @__PURE__ */ jsx9("h4", { children: "2. Review Bill Submission Receipt" }),
3762
+ /* @__PURE__ */ jsx9("p", { className: "mbbs-copy", children: "Reference the submission receipt below when the payer asks how and when the bill was sent." }),
3763
+ /* @__PURE__ */ jsx9("div", { className: "mbbs-receipt", children: receipt })
3764
+ ] }) : null,
3765
+ /* @__PURE__ */ jsxs9("div", { className: "mbbs-section", children: [
3766
+ /* @__PURE__ */ jsx9("h4", { children: "3. Report Bill Payment Status" }),
3767
+ /* @__PURE__ */ jsx9("p", { className: "mbbs-copy", children: "Select the status reported by the payer, then record who provided it." }),
3768
+ /* @__PURE__ */ jsxs9("div", { className: "mbbs-report", children: [
3769
+ /* @__PURE__ */ jsx9("div", { className: "mbbs-options", role: "radiogroup", "aria-label": "Reported bill payment status", children: REPORT_BILL_STATUS_OPTIONS.map((option) => /* @__PURE__ */ jsxs9("label", { className: "mbbs-option", "data-selected": status === option.id, children: [
3770
+ /* @__PURE__ */ jsx9(
3771
+ "input",
3772
+ {
3773
+ type: "radio",
3774
+ name: "mbbs-status",
3775
+ value: option.id,
3776
+ checked: status === option.id,
3777
+ disabled: submitting,
3778
+ onChange: () => setStatus(option.id)
3779
+ }
3780
+ ),
3781
+ /* @__PURE__ */ jsxs9("span", { children: [
3782
+ /* @__PURE__ */ jsx9("span", { className: "mbbs-option-label", children: option.label }),
3783
+ /* @__PURE__ */ jsx9("span", { className: "mbbs-option-copy", children: option.description })
3784
+ ] })
3785
+ ] }, option.id)) }),
3786
+ /* @__PURE__ */ jsxs9("div", { className: "mbbs-fields", children: [
3787
+ field("Company", company, setCompany),
3788
+ field("Name", representativeName, setRepresentativeName),
3789
+ field("Role", representativeRole, setRepresentativeRole),
3790
+ field("Phone Number", phone, setPhone),
3791
+ field("Call Reference Number", callReference, setCallReference),
3792
+ /* @__PURE__ */ jsxs9("label", { className: "mbbs-field", children: [
3793
+ /* @__PURE__ */ jsx9("span", { className: "mbbs-label", children: "Message Note" }),
3794
+ /* @__PURE__ */ jsx9("textarea", { className: "mbbs-textarea", value: note, disabled: submitting, onChange: (event) => setNote(event.target.value) })
3795
+ ] })
3796
+ ] })
3797
+ ] })
3798
+ ] }),
3799
+ error ? /* @__PURE__ */ jsx9("div", { className: "mbbs-alert", role: "alert", children: error }) : null,
3800
+ /* @__PURE__ */ jsxs9("div", { className: "mbbs-actions", children: [
3801
+ /* @__PURE__ */ jsx9("button", { className: "mbbs-cancel", type: "button", disabled: submitting, onClick: onCancel, children: "Cancel" }),
3802
+ /* @__PURE__ */ jsx9("button", { className: "mbbs-save", type: "button", disabled: submitting || !status, onClick: save, children: submitting ? "Saving\u2026" : "Save" })
3803
+ ] })
3804
+ ]
3805
+ }
3806
+ )
3807
+ ]
3808
+ }
3809
+ );
3810
+ }
3811
+
3322
3812
  // src/organization-onboarding.tsx
3323
- import { useCallback as useCallback2, useEffect as useEffect5, useMemo as useMemo6, useRef as useRef3, useState as useState6 } from "react";
3813
+ import { useCallback as useCallback2, useEffect as useEffect6, useMemo as useMemo6, useRef as useRef3, useState as useState7 } from "react";
3324
3814
  import {
3325
3815
  createOrganizationClient
3326
3816
  } from "@mindbill/browser";
3327
- import { Fragment as Fragment5, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
3817
+ import { Fragment as Fragment7, jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
3328
3818
  var STEPS = [
3329
3819
  { id: "practice", label: "Practice & billing" },
3330
3820
  { id: "locations", label: "Locations" },
3331
3821
  { id: "w9", label: "W-9" },
3332
3822
  { id: "review", label: "Review" }
3333
3823
  ];
3334
- var css5 = `
3824
+ var css8 = `
3335
3825
  .mbob{color:var(--mb-text);font-family:var(--mb-font);font-size:15px}.mbob *{box-sizing:border-box}.mbob h2,.mbob h3,.mbob p{margin:0}
3336
3826
  .mbob-card{border:1px solid var(--mb-border);border-radius:var(--mb-radius);background:var(--mb-surface);box-shadow:var(--mb-shadow);padding:24px}
3337
3827
  .mbob-head{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin-bottom:18px}.mbob-head h2{font-size:22px}.mbob-copy{color:var(--mb-muted);margin-top:5px!important}
@@ -3395,16 +3885,16 @@ function OrganizationOnboarding({
3395
3885
  }),
3396
3886
  [sessionEndpoint, getSession, apiBaseUrl]
3397
3887
  );
3398
- const [profile, setProfile] = useState6(null);
3399
- const [loadError, setLoadError] = useState6(null);
3400
- const [step, setStep] = useState6("practice");
3401
- const [identity, setIdentity] = useState6({ name: "", legalName: "", taxId: "", npi: "", phone: "", email: "" });
3402
- const [provider, setProvider] = useState6({ name: "", taxId: "", npi: "", billType: "Professional", phone: "", billingStreet: "", billingCity: "", billingState: "", billingZip: "" });
3403
- const [locations, setLocations] = useState6([blankLocation()]);
3404
- const [w9File, setW9File] = useState6(null);
3405
- const [saving, setSaving] = useState6(false);
3406
- const [error, setError] = useState6(null);
3407
- const [savedStep, setSavedStep] = useState6({});
3888
+ const [profile, setProfile] = useState7(null);
3889
+ const [loadError, setLoadError] = useState7(null);
3890
+ const [step, setStep] = useState7("practice");
3891
+ const [identity, setIdentity] = useState7({ name: "", legalName: "", taxId: "", npi: "", phone: "", email: "" });
3892
+ const [provider, setProvider] = useState7({ name: "", taxId: "", npi: "", billType: "Professional", phone: "", billingStreet: "", billingCity: "", billingState: "", billingZip: "" });
3893
+ const [locations, setLocations] = useState7([blankLocation()]);
3894
+ const [w9File, setW9File] = useState7(null);
3895
+ const [saving, setSaving] = useState7(false);
3896
+ const [error, setError] = useState7(null);
3897
+ const [savedStep, setSavedStep] = useState7({});
3408
3898
  const completedFired = useRef3(false);
3409
3899
  const adoptProfile = useCallback2((next) => {
3410
3900
  setProfile(next);
@@ -3423,7 +3913,7 @@ function OrganizationOnboarding({
3423
3913
  onCompleted?.(next);
3424
3914
  }
3425
3915
  }, [onCompleted]);
3426
- useEffect5(() => {
3916
+ useEffect6(() => {
3427
3917
  let alive = true;
3428
3918
  client.getOrganization().then((next) => {
3429
3919
  if (alive) {
@@ -3470,16 +3960,16 @@ function OrganizationOnboarding({
3470
3960
  if (!w9File) throw new Error("Choose the practice W-9 PDF first.");
3471
3961
  return client.saveW9({ filename: w9File.name, contentBase64: await fileToBase64(w9File) });
3472
3962
  }, "w9");
3473
- const field = (label, value, onChange, span = false, placeholder = "") => /* @__PURE__ */ jsxs7("label", { className: `mbob-field${span ? " mbob-span" : ""}`, children: [
3963
+ const field = (label, value, onChange, span = false, placeholder = "") => /* @__PURE__ */ jsxs10("label", { className: `mbob-field${span ? " mbob-span" : ""}`, children: [
3474
3964
  label,
3475
- /* @__PURE__ */ jsx7("input", { value, placeholder, onChange: (event) => onChange(event.target.value), disabled: saving })
3965
+ /* @__PURE__ */ jsx10("input", { value, placeholder, onChange: (event) => onChange(event.target.value), disabled: saving })
3476
3966
  ] });
3477
3967
  const setLocation = (index, patch) => setLocations((current) => current.map((item, itemIndex) => {
3478
3968
  if (itemIndex !== index) return patch.isPrimary ? { ...item, isPrimary: false } : item;
3479
3969
  return { ...item, ...patch };
3480
3970
  }));
3481
- const practiceSection = /* @__PURE__ */ jsxs7("div", { children: [
3482
- /* @__PURE__ */ jsxs7("div", { className: "mbob-grid", children: [
3971
+ const practiceSection = /* @__PURE__ */ jsxs10("div", { children: [
3972
+ /* @__PURE__ */ jsxs10("div", { className: "mbob-grid", children: [
3483
3973
  field("Practice name", identity.name, (name) => setIdentity((c) => ({ ...c, name }))),
3484
3974
  field("Legal name", identity.legalName, (legalName) => setIdentity((c) => ({ ...c, legalName }))),
3485
3975
  field("Tax ID (EIN)", identity.taxId, (taxId) => setIdentity((c) => ({ ...c, taxId })), false, "94-1234567"),
@@ -3487,8 +3977,8 @@ function OrganizationOnboarding({
3487
3977
  field("Phone", identity.phone, (phone) => setIdentity((c) => ({ ...c, phone }))),
3488
3978
  field("Email", identity.email, (email) => setIdentity((c) => ({ ...c, email })))
3489
3979
  ] }),
3490
- /* @__PURE__ */ jsx7("h3", { className: "mbob-subhead", children: "Billing provider (pay-to)" }),
3491
- /* @__PURE__ */ jsxs7("div", { className: "mbob-grid", children: [
3980
+ /* @__PURE__ */ jsx10("h3", { className: "mbob-subhead", children: "Billing provider (pay-to)" }),
3981
+ /* @__PURE__ */ jsxs10("div", { className: "mbob-grid", children: [
3492
3982
  field("Billing provider name", provider.name, (name) => setProvider((c) => ({ ...c, name }))),
3493
3983
  field("Billing tax ID", provider.taxId, (taxId) => setProvider((c) => ({ ...c, taxId }))),
3494
3984
  field("Billing NPI", provider.npi, (npi) => setProvider((c) => ({ ...c, npi }))),
@@ -3498,88 +3988,88 @@ function OrganizationOnboarding({
3498
3988
  field("State", provider.billingState ?? "", (billingState) => setProvider((c) => ({ ...c, billingState: billingState.toUpperCase().slice(0, 2) }))),
3499
3989
  field("ZIP", provider.billingZip ?? "", (billingZip) => setProvider((c) => ({ ...c, billingZip })))
3500
3990
  ] }),
3501
- /* @__PURE__ */ jsxs7("div", { className: "mbob-actions", children: [
3502
- /* @__PURE__ */ jsx7("span", { className: "mbob-status", children: savedStep["practice"] ? "Saved to MindBill." : "Saved once, used on every bill." }),
3503
- /* @__PURE__ */ jsx7("button", { className: "mbob-save", type: "button", disabled: saving, onClick: savePractice, children: saving ? "Saving\u2026" : "Save practice" })
3991
+ /* @__PURE__ */ jsxs10("div", { className: "mbob-actions", children: [
3992
+ /* @__PURE__ */ jsx10("span", { className: "mbob-status", children: savedStep["practice"] ? "Saved to MindBill." : "Saved once, used on every bill." }),
3993
+ /* @__PURE__ */ jsx10("button", { className: "mbob-save", type: "button", disabled: saving, onClick: savePractice, children: saving ? "Saving\u2026" : "Save practice" })
3504
3994
  ] })
3505
3995
  ] });
3506
- const locationsSection = /* @__PURE__ */ jsxs7("div", { children: [
3507
- locations.map((location, index) => /* @__PURE__ */ jsxs7("div", { className: "mbob-loc", children: [
3996
+ const locationsSection = /* @__PURE__ */ jsxs10("div", { children: [
3997
+ locations.map((location, index) => /* @__PURE__ */ jsxs10("div", { className: "mbob-loc", children: [
3508
3998
  field("Name", location.name, (name) => setLocation(index, { name })),
3509
3999
  field("Street", location.street, (street) => setLocation(index, { street })),
3510
4000
  field("City", location.city, (city) => setLocation(index, { city })),
3511
4001
  field("State", location.state, (state) => setLocation(index, { state: state.toUpperCase().slice(0, 2) })),
3512
4002
  field("ZIP", location.zip, (zip) => setLocation(index, { zip })),
3513
- /* @__PURE__ */ jsxs7("label", { className: "mbob-primary", children: [
3514
- /* @__PURE__ */ jsx7("input", { type: "radio", name: "mbob-primary", checked: location.isPrimary === true, onChange: () => setLocation(index, { isPrimary: true }) }),
4003
+ /* @__PURE__ */ jsxs10("label", { className: "mbob-primary", children: [
4004
+ /* @__PURE__ */ jsx10("input", { type: "radio", name: "mbob-primary", checked: location.isPrimary === true, onChange: () => setLocation(index, { isPrimary: true }) }),
3515
4005
  " Primary"
3516
4006
  ] }),
3517
- /* @__PURE__ */ jsx7("button", { className: "mbob-remove", type: "button", "aria-label": "Remove location", onClick: () => setLocations((current) => current.filter((_, itemIndex) => itemIndex !== index)), children: "\xD7" })
4007
+ /* @__PURE__ */ jsx10("button", { className: "mbob-remove", type: "button", "aria-label": "Remove location", onClick: () => setLocations((current) => current.filter((_, itemIndex) => itemIndex !== index)), children: "\xD7" })
3518
4008
  ] }, location.id ?? index)),
3519
- /* @__PURE__ */ jsx7("button", { className: "mbob-add", type: "button", onClick: () => setLocations((current) => [...current, blankLocation()]), children: "+ Add location" }),
3520
- /* @__PURE__ */ jsxs7("div", { className: "mbob-actions", children: [
3521
- /* @__PURE__ */ jsx7("span", { className: "mbob-status", children: savedStep["locations"] ? "Saved to MindBill." : "Where evaluations happen." }),
3522
- /* @__PURE__ */ jsx7("button", { className: "mbob-save", type: "button", disabled: saving, onClick: saveLocations, children: saving ? "Saving\u2026" : "Save locations" })
4009
+ /* @__PURE__ */ jsx10("button", { className: "mbob-add", type: "button", onClick: () => setLocations((current) => [...current, blankLocation()]), children: "+ Add location" }),
4010
+ /* @__PURE__ */ jsxs10("div", { className: "mbob-actions", children: [
4011
+ /* @__PURE__ */ jsx10("span", { className: "mbob-status", children: savedStep["locations"] ? "Saved to MindBill." : "Where evaluations happen." }),
4012
+ /* @__PURE__ */ jsx10("button", { className: "mbob-save", type: "button", disabled: saving, onClick: saveLocations, children: saving ? "Saving\u2026" : "Save locations" })
3523
4013
  ] })
3524
4014
  ] });
3525
- const w9Section = /* @__PURE__ */ jsxs7("div", { children: [
3526
- profile?.w9 ? /* @__PURE__ */ jsxs7("div", { className: "mbob-w9-current", children: [
3527
- /* @__PURE__ */ jsxs7("div", { children: [
3528
- /* @__PURE__ */ jsx7("strong", { children: profile.w9.filename }),
3529
- /* @__PURE__ */ jsxs7("span", { children: [
4015
+ const w9Section = /* @__PURE__ */ jsxs10("div", { children: [
4016
+ profile?.w9 ? /* @__PURE__ */ jsxs10("div", { className: "mbob-w9-current", children: [
4017
+ /* @__PURE__ */ jsxs10("div", { children: [
4018
+ /* @__PURE__ */ jsx10("strong", { children: profile.w9.filename }),
4019
+ /* @__PURE__ */ jsxs10("span", { children: [
3530
4020
  " \xB7 added ",
3531
4021
  profile.w9.addDate
3532
4022
  ] })
3533
4023
  ] }),
3534
- /* @__PURE__ */ jsx7("span", { children: "Rides on every bill automatically" })
4024
+ /* @__PURE__ */ jsx10("span", { children: "Rides on every bill automatically" })
3535
4025
  ] }) : null,
3536
- /* @__PURE__ */ jsxs7("label", { className: "mbob-drop", children: [
3537
- /* @__PURE__ */ jsx7("input", { type: "file", accept: "application/pdf,.pdf", onChange: (event) => setW9File(event.target.files?.[0] ?? null) }),
3538
- /* @__PURE__ */ jsx7("strong", { children: w9File ? w9File.name : profile?.w9 ? "Replace the W-9 PDF" : "Drop the practice W-9 PDF here, or click to choose" }),
3539
- /* @__PURE__ */ jsx7("span", { children: "The W-9 is auto-attached to every submission." })
4026
+ /* @__PURE__ */ jsxs10("label", { className: "mbob-drop", children: [
4027
+ /* @__PURE__ */ jsx10("input", { type: "file", accept: "application/pdf,.pdf", onChange: (event) => setW9File(event.target.files?.[0] ?? null) }),
4028
+ /* @__PURE__ */ jsx10("strong", { children: w9File ? w9File.name : profile?.w9 ? "Replace the W-9 PDF" : "Drop the practice W-9 PDF here, or click to choose" }),
4029
+ /* @__PURE__ */ jsx10("span", { children: "The W-9 is auto-attached to every submission." })
3540
4030
  ] }),
3541
- /* @__PURE__ */ jsxs7("div", { className: "mbob-actions", children: [
3542
- /* @__PURE__ */ jsx7("span", { className: "mbob-status", children: savedStep["w9"] ? "Saved to MindBill." : "" }),
3543
- /* @__PURE__ */ jsx7("button", { className: "mbob-save", type: "button", disabled: saving || !w9File, onClick: saveW9, children: saving ? "Uploading\u2026" : "Save W-9" })
4031
+ /* @__PURE__ */ jsxs10("div", { className: "mbob-actions", children: [
4032
+ /* @__PURE__ */ jsx10("span", { className: "mbob-status", children: savedStep["w9"] ? "Saved to MindBill." : "" }),
4033
+ /* @__PURE__ */ jsx10("button", { className: "mbob-save", type: "button", disabled: saving || !w9File, onClick: saveW9, children: saving ? "Uploading\u2026" : "Save W-9" })
3544
4034
  ] })
3545
4035
  ] });
3546
- const reviewSection = /* @__PURE__ */ jsxs7("div", { className: "mbob-check", children: [
3547
- (profile?.onboarding.checklist ?? []).map((item) => /* @__PURE__ */ jsxs7("div", { className: "mbob-check-item", "data-complete": item.complete, children: [
3548
- /* @__PURE__ */ jsx7("i", { children: item.complete ? "\u2713" : "\u2022" }),
3549
- /* @__PURE__ */ jsx7("span", { children: item.label })
4036
+ const reviewSection = /* @__PURE__ */ jsxs10("div", { className: "mbob-check", children: [
4037
+ (profile?.onboarding.checklist ?? []).map((item) => /* @__PURE__ */ jsxs10("div", { className: "mbob-check-item", "data-complete": item.complete, children: [
4038
+ /* @__PURE__ */ jsx10("i", { children: item.complete ? "\u2713" : "\u2022" }),
4039
+ /* @__PURE__ */ jsx10("span", { children: item.label })
3550
4040
  ] }, item.id)),
3551
- profile?.onboarding.complete ? /* @__PURE__ */ jsx7("p", { className: "mbob-done", children: "Billing setup is complete \u2014 bills submitted from your product carry this profile automatically." }) : /* @__PURE__ */ jsx7("p", { className: "mbob-status", children: "Items above complete themselves as each section is saved." })
4041
+ profile?.onboarding.complete ? /* @__PURE__ */ jsx10("p", { className: "mbob-done", children: "Billing setup is complete \u2014 bills submitted from your product carry this profile automatically." }) : /* @__PURE__ */ jsx10("p", { className: "mbob-status", children: "Items above complete themselves as each section is saved." })
3552
4042
  ] });
3553
4043
  const sections = { practice: practiceSection, locations: locationsSection, w9: w9Section, review: reviewSection };
3554
- return /* @__PURE__ */ jsxs7("div", { className: `mbob ${className}`.trim(), style: { ...mindBillAppearanceStyle(appearance), ...style }, children: [
3555
- /* @__PURE__ */ jsx7("style", { children: css5 }),
3556
- /* @__PURE__ */ jsxs7("div", { className: "mbob-card", children: [
3557
- /* @__PURE__ */ jsx7("div", { className: "mbob-head", children: /* @__PURE__ */ jsxs7("div", { children: [
3558
- /* @__PURE__ */ jsx7("h2", { children: heading }),
3559
- /* @__PURE__ */ jsx7("p", { className: "mbob-copy", children: description })
4044
+ return /* @__PURE__ */ jsxs10("div", { className: `mbob ${className}`.trim(), style: { ...mindBillAppearanceStyle(appearance), ...style }, children: [
4045
+ /* @__PURE__ */ jsx10("style", { children: css8 }),
4046
+ /* @__PURE__ */ jsxs10("div", { className: "mbob-card", children: [
4047
+ /* @__PURE__ */ jsx10("div", { className: "mbob-head", children: /* @__PURE__ */ jsxs10("div", { children: [
4048
+ /* @__PURE__ */ jsx10("h2", { children: heading }),
4049
+ /* @__PURE__ */ jsx10("p", { className: "mbob-copy", children: description })
3560
4050
  ] }) }),
3561
- loadError ? /* @__PURE__ */ jsx7("div", { className: "mbob-error", role: "alert", children: loadError }) : null,
3562
- variant === "onboarding" ? /* @__PURE__ */ jsxs7(Fragment5, { children: [
3563
- /* @__PURE__ */ jsx7("div", { className: "mbob-steps", children: STEPS.map((item) => /* @__PURE__ */ jsxs7("button", { className: "mbob-step", type: "button", "data-active": step === item.id, "data-done": Boolean(savedStep[item.id]), onClick: () => setStep(item.id), children: [
3564
- /* @__PURE__ */ jsx7("i", { children: savedStep[item.id] ? "\u2713" : "" }),
4051
+ loadError ? /* @__PURE__ */ jsx10("div", { className: "mbob-error", role: "alert", children: loadError }) : null,
4052
+ variant === "onboarding" ? /* @__PURE__ */ jsxs10(Fragment7, { children: [
4053
+ /* @__PURE__ */ jsx10("div", { className: "mbob-steps", children: STEPS.map((item) => /* @__PURE__ */ jsxs10("button", { className: "mbob-step", type: "button", "data-active": step === item.id, "data-done": Boolean(savedStep[item.id]), onClick: () => setStep(item.id), children: [
4054
+ /* @__PURE__ */ jsx10("i", { children: savedStep[item.id] ? "\u2713" : "" }),
3565
4055
  item.label
3566
4056
  ] }, item.id)) }),
3567
4057
  sections[step]
3568
- ] }) : /* @__PURE__ */ jsxs7(Fragment5, { children: [
4058
+ ] }) : /* @__PURE__ */ jsxs10(Fragment7, { children: [
3569
4059
  practiceSection,
3570
- /* @__PURE__ */ jsx7("h3", { className: "mbob-subhead", children: "Locations" }),
4060
+ /* @__PURE__ */ jsx10("h3", { className: "mbob-subhead", children: "Locations" }),
3571
4061
  locationsSection,
3572
- /* @__PURE__ */ jsx7("h3", { className: "mbob-subhead", children: "Practice W-9" }),
4062
+ /* @__PURE__ */ jsx10("h3", { className: "mbob-subhead", children: "Practice W-9" }),
3573
4063
  w9Section,
3574
- /* @__PURE__ */ jsx7("h3", { className: "mbob-subhead", children: "Checklist" }),
4064
+ /* @__PURE__ */ jsx10("h3", { className: "mbob-subhead", children: "Checklist" }),
3575
4065
  reviewSection
3576
4066
  ] }),
3577
- error ? /* @__PURE__ */ jsx7("div", { className: "mbob-error", role: "alert", children: error }) : null
4067
+ error ? /* @__PURE__ */ jsx10("div", { className: "mbob-error", role: "alert", children: error }) : null
3578
4068
  ] })
3579
4069
  ] });
3580
4070
  }
3581
4071
  function BillingSettings(props) {
3582
- return /* @__PURE__ */ jsx7(
4072
+ return /* @__PURE__ */ jsx10(
3583
4073
  OrganizationOnboarding,
3584
4074
  {
3585
4075
  heading: "Billing settings",
@@ -3593,16 +4083,16 @@ function BillingSettings(props) {
3593
4083
  // src/connected-bill-status.tsx
3594
4084
  import {
3595
4085
  useCallback as useCallback3,
3596
- useEffect as useEffect6,
4086
+ useEffect as useEffect7,
3597
4087
  useMemo as useMemo7,
3598
4088
  useRef as useRef4,
3599
- useState as useState7
4089
+ useState as useState8
3600
4090
  } from "react";
3601
4091
  import {
3602
4092
  DEFAULT_API_BASE_URL,
3603
4093
  DEFAULT_SESSION_ENDPOINT
3604
4094
  } from "@mindbill/browser";
3605
- import { Fragment as Fragment6, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
4095
+ import { Fragment as Fragment8, jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
3606
4096
  var DEFAULT_REFRESH_INTERVAL = 6e4;
3607
4097
  async function responseError(response, fallback) {
3608
4098
  const body = await response.json().catch(() => null);
@@ -3742,16 +4232,16 @@ function useBillStatus({
3742
4232
  apiBaseUrl,
3743
4233
  ...fetchOverride ? { fetch: fetchOverride } : {}
3744
4234
  }), [apiBaseUrl, billId, fetchOverride, getSession, sessionEndpoint]);
3745
- const [data, setData] = useState7(initialData);
3746
- const [error, setError] = useState7(null);
3747
- const [isLoading, setIsLoading] = useState7(enabled && !initialData);
3748
- const [isRefreshing, setIsRefreshing] = useState7(false);
4235
+ const [data, setData] = useState8(initialData);
4236
+ const [error, setError] = useState8(null);
4237
+ const [isLoading, setIsLoading] = useState8(enabled && !initialData);
4238
+ const [isRefreshing, setIsRefreshing] = useState8(false);
3749
4239
  const dataRef = useRef4(initialData);
3750
4240
  const initialDataRef = useRef4(initialData);
3751
4241
  initialDataRef.current = initialData;
3752
4242
  const activeControllerRef = useRef4(null);
3753
4243
  const requestSequence = useRef4(0);
3754
- useEffect6(() => {
4244
+ useEffect7(() => {
3755
4245
  const seed = initialDataRef.current;
3756
4246
  dataRef.current = seed;
3757
4247
  setData(seed);
@@ -3792,10 +4282,10 @@ function useBillStatus({
3792
4282
  }
3793
4283
  }
3794
4284
  }, [billId, client, enabled]);
3795
- useEffect6(() => {
4285
+ useEffect7(() => {
3796
4286
  if (enabled) void load();
3797
4287
  }, [enabled, load]);
3798
- useEffect6(() => {
4288
+ useEffect7(() => {
3799
4289
  if (!enabled || refreshInterval <= 0) return;
3800
4290
  const timer = window.setInterval(() => void load(), refreshInterval);
3801
4291
  const onFocus = () => void load();
@@ -3823,17 +4313,17 @@ function ConnectedBillStatus({
3823
4313
  }) {
3824
4314
  const status = useBillStatus(options);
3825
4315
  if (status.isLoading && !status.data) {
3826
- return /* @__PURE__ */ jsx8(Fragment6, { children: loadingFallback ?? /* @__PURE__ */ jsx8("div", { role: "status", children: "Loading bill status\u2026" }) });
4316
+ return /* @__PURE__ */ jsx11(Fragment8, { children: loadingFallback ?? /* @__PURE__ */ jsx11("div", { role: "status", children: "Loading bill status\u2026" }) });
3827
4317
  }
3828
4318
  if (status.error && !status.data) {
3829
- return /* @__PURE__ */ jsx8(Fragment6, { children: errorFallback?.(status.error, status.refresh) ?? /* @__PURE__ */ jsxs8("div", { role: "alert", children: [
4319
+ return /* @__PURE__ */ jsx11(Fragment8, { children: errorFallback?.(status.error, status.refresh) ?? /* @__PURE__ */ jsxs11("div", { role: "alert", children: [
3830
4320
  status.error.message,
3831
4321
  " ",
3832
- /* @__PURE__ */ jsx8("button", { type: "button", onClick: () => void status.refresh(), children: "Retry" })
4322
+ /* @__PURE__ */ jsx11("button", { type: "button", onClick: () => void status.refresh(), children: "Retry" })
3833
4323
  ] }) });
3834
4324
  }
3835
4325
  if (!status.data) return null;
3836
- return /* @__PURE__ */ jsx8(
4326
+ return /* @__PURE__ */ jsx11(
3837
4327
  BillStatusSummary,
3838
4328
  {
3839
4329
  status: status.data.state,
@@ -3852,8 +4342,8 @@ function ConnectedBillStatus({
3852
4342
  }
3853
4343
 
3854
4344
  // src/bill-lifecycle-surfaces.tsx
3855
- import { useState as useState8 } from "react";
3856
- import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
4345
+ import { useState as useState9 } from "react";
4346
+ import { jsx as jsx12, jsxs as jsxs12 } from "react/jsx-runtime";
3857
4347
  function visibleBillLifecycleActions(actions, showUnavailable = false) {
3858
4348
  return actions.filter((action) => action.enabled || showUnavailable);
3859
4349
  }
@@ -3868,11 +4358,11 @@ function BillLifecycleActions({
3868
4358
  }) {
3869
4359
  const visible = visibleBillLifecycleActions(actions, showUnavailable);
3870
4360
  if (!visible.length) return null;
3871
- return /* @__PURE__ */ jsxs9("div", { className: classes("mb-lifecycle-actions", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill actions", children: [
3872
- /* @__PURE__ */ jsx9("style", { children: lifecycleSurfaceStyles }),
3873
- visible.map((action) => /* @__PURE__ */ jsxs9("div", { className: "mb-lifecycle-action", children: [
3874
- /* @__PURE__ */ jsx9("button", { type: "button", className: action.primary ? "mb-action-button is-primary" : "mb-action-button", disabled: disabled || !action.enabled, onClick: () => onAction(action), children: action.label }),
3875
- !action.enabled && action.reason ? /* @__PURE__ */ jsx9("span", { className: "mb-action-reason", children: action.reason }) : null
4361
+ return /* @__PURE__ */ jsxs12("div", { className: classes("mb-lifecycle-actions", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill actions", children: [
4362
+ /* @__PURE__ */ jsx12("style", { children: lifecycleSurfaceStyles }),
4363
+ visible.map((action) => /* @__PURE__ */ jsxs12("div", { className: "mb-lifecycle-action", children: [
4364
+ /* @__PURE__ */ jsx12("button", { type: "button", className: action.primary ? "mb-action-button is-primary" : "mb-action-button", disabled: disabled || !action.enabled, onClick: () => onAction(action), children: action.label }),
4365
+ !action.enabled && action.reason ? /* @__PURE__ */ jsx12("span", { className: "mb-action-reason", children: action.reason }) : null
3876
4366
  ] }, action.id))
3877
4367
  ] });
3878
4368
  }
@@ -3902,18 +4392,18 @@ function defaultFormatDate(createdAt) {
3902
4392
  return new Intl.DateTimeFormat(void 0, { dateStyle: "medium", timeStyle: "short" }).format(parsed);
3903
4393
  }
3904
4394
  function BillActivityTimeline({ events, emptyLabel = "No bill activity yet.", appearance, className, style, formatDate = defaultFormatDate }) {
3905
- return /* @__PURE__ */ jsxs9("section", { className: classes("mb-surface mb-activity", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill activity", children: [
3906
- /* @__PURE__ */ jsx9("style", { children: lifecycleSurfaceStyles }),
3907
- /* @__PURE__ */ jsx9("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs9("div", { children: [
3908
- /* @__PURE__ */ jsx9("strong", { children: "Bill history" }),
3909
- /* @__PURE__ */ jsx9("span", { children: "Submission, payer responses, follow-up, and payments." })
4395
+ return /* @__PURE__ */ jsxs12("section", { className: classes("mb-surface mb-activity", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill activity", children: [
4396
+ /* @__PURE__ */ jsx12("style", { children: lifecycleSurfaceStyles }),
4397
+ /* @__PURE__ */ jsx12("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs12("div", { children: [
4398
+ /* @__PURE__ */ jsx12("strong", { children: "Bill history" }),
4399
+ /* @__PURE__ */ jsx12("span", { children: "Submission, payer responses, follow-up, and payments." })
3910
4400
  ] }) }),
3911
- !events.length ? /* @__PURE__ */ jsx9("p", { className: "mb-activity-empty", children: emptyLabel }) : /* @__PURE__ */ jsx9("ol", { className: "mb-activity-list", children: events.map((event) => /* @__PURE__ */ jsxs9("li", { className: "mb-activity-item", children: [
3912
- /* @__PURE__ */ jsx9("span", { className: "mb-activity-marker", "aria-hidden": "true" }),
3913
- /* @__PURE__ */ jsxs9("div", { className: "mb-activity-content", children: [
3914
- /* @__PURE__ */ jsx9("strong", { children: event.title ?? billActivityEventLabel(event.type) }),
3915
- event.description ? /* @__PURE__ */ jsx9("p", { children: event.description }) : null,
3916
- /* @__PURE__ */ jsxs9("span", { children: [
4401
+ !events.length ? /* @__PURE__ */ jsx12("p", { className: "mb-activity-empty", children: emptyLabel }) : /* @__PURE__ */ jsx12("ol", { className: "mb-activity-list", children: events.map((event) => /* @__PURE__ */ jsxs12("li", { className: "mb-activity-item", children: [
4402
+ /* @__PURE__ */ jsx12("span", { className: "mb-activity-marker", "aria-hidden": "true" }),
4403
+ /* @__PURE__ */ jsxs12("div", { className: "mb-activity-content", children: [
4404
+ /* @__PURE__ */ jsx12("strong", { children: event.title ?? billActivityEventLabel(event.type) }),
4405
+ event.description ? /* @__PURE__ */ jsx12("p", { children: event.description }) : null,
4406
+ /* @__PURE__ */ jsxs12("span", { children: [
3917
4407
  formatDate(event.createdAt),
3918
4408
  event.actor ? ` \xB7 ${event.actor}` : ""
3919
4409
  ] })
@@ -3927,26 +4417,26 @@ function historyDate(iso) {
3927
4417
  return new Intl.DateTimeFormat("en-US", { month: "2-digit", day: "2-digit", year: "numeric" }).format(parsed);
3928
4418
  }
3929
4419
  function BillHistoryTable({ entries, emptyLabel = "No bill history yet.", appearance, className, style, formatDate = historyDate, documentHref }) {
3930
- const [expanded, setExpanded] = useState8({});
3931
- return /* @__PURE__ */ jsxs9("section", { className: classes("mb-surface mb-history", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill history", children: [
3932
- /* @__PURE__ */ jsx9("style", { children: lifecycleSurfaceStyles }),
3933
- /* @__PURE__ */ jsx9("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs9("div", { children: [
3934
- /* @__PURE__ */ jsx9("strong", { children: "Bill history" }),
3935
- /* @__PURE__ */ jsx9("span", { children: "Submissions, payer responses, follow-up, and payments." })
4420
+ const [expanded, setExpanded] = useState9({});
4421
+ return /* @__PURE__ */ jsxs12("section", { className: classes("mb-surface mb-history", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill history", children: [
4422
+ /* @__PURE__ */ jsx12("style", { children: lifecycleSurfaceStyles }),
4423
+ /* @__PURE__ */ jsx12("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs12("div", { children: [
4424
+ /* @__PURE__ */ jsx12("strong", { children: "Bill history" }),
4425
+ /* @__PURE__ */ jsx12("span", { children: "Submissions, payer responses, follow-up, and payments." })
3936
4426
  ] }) }),
3937
- !entries.length ? /* @__PURE__ */ jsx9("p", { className: "mb-activity-empty", children: emptyLabel }) : /* @__PURE__ */ jsxs9("div", { className: "mb-history-table", children: [
3938
- /* @__PURE__ */ jsxs9("div", { className: "mb-history-head", "aria-hidden": "true", children: [
3939
- /* @__PURE__ */ jsx9("span", { children: "Date" }),
3940
- /* @__PURE__ */ jsx9("span", { children: "Action" }),
3941
- /* @__PURE__ */ jsx9("span", { children: "User" }),
3942
- /* @__PURE__ */ jsx9("span", { children: "Details" })
4427
+ !entries.length ? /* @__PURE__ */ jsx12("p", { className: "mb-activity-empty", children: emptyLabel }) : /* @__PURE__ */ jsxs12("div", { className: "mb-history-table", children: [
4428
+ /* @__PURE__ */ jsxs12("div", { className: "mb-history-head", "aria-hidden": "true", children: [
4429
+ /* @__PURE__ */ jsx12("span", { children: "Date" }),
4430
+ /* @__PURE__ */ jsx12("span", { children: "Action" }),
4431
+ /* @__PURE__ */ jsx12("span", { children: "User" }),
4432
+ /* @__PURE__ */ jsx12("span", { children: "Details" })
3943
4433
  ] }),
3944
- /* @__PURE__ */ jsx9("ul", { className: "mb-history-rows", children: entries.map((entry) => {
4434
+ /* @__PURE__ */ jsx12("ul", { className: "mb-history-rows", children: entries.map((entry) => {
3945
4435
  const expandable = Boolean(entry.details);
3946
4436
  const isOpen = expandable && Boolean(expanded[entry.id]);
3947
4437
  const details = entry.details;
3948
- return /* @__PURE__ */ jsxs9("li", { className: `mb-history-row is-${entry.tone}`, children: [
3949
- /* @__PURE__ */ jsxs9(
4438
+ return /* @__PURE__ */ jsxs12("li", { className: `mb-history-row is-${entry.tone}`, children: [
4439
+ /* @__PURE__ */ jsxs12(
3950
4440
  "button",
3951
4441
  {
3952
4442
  type: "button",
@@ -3955,40 +4445,40 @@ function BillHistoryTable({ entries, emptyLabel = "No bill history yet.", appear
3955
4445
  "aria-expanded": expandable ? isOpen : void 0,
3956
4446
  onClick: expandable ? () => setExpanded((current) => ({ ...current, [entry.id]: !current[entry.id] })) : void 0,
3957
4447
  children: [
3958
- /* @__PURE__ */ jsx9("span", { className: "mb-history-date", children: formatDate(entry.date) }),
3959
- /* @__PURE__ */ jsx9("span", { className: "mb-history-action", children: entry.action }),
3960
- /* @__PURE__ */ jsx9("span", { className: "mb-history-actor", children: entry.actor ?? "\u2014" }),
3961
- /* @__PURE__ */ jsxs9("span", { className: "mb-history-summary", children: [
3962
- expandable ? /* @__PURE__ */ jsx9("i", { className: `mb-history-caret${isOpen ? " is-open" : ""}`, "aria-hidden": "true" }) : null,
4448
+ /* @__PURE__ */ jsx12("span", { className: "mb-history-date", children: formatDate(entry.date) }),
4449
+ /* @__PURE__ */ jsx12("span", { className: "mb-history-action", children: entry.action }),
4450
+ /* @__PURE__ */ jsx12("span", { className: "mb-history-actor", children: entry.actor ?? "\u2014" }),
4451
+ /* @__PURE__ */ jsxs12("span", { className: "mb-history-summary", children: [
4452
+ expandable ? /* @__PURE__ */ jsx12("i", { className: `mb-history-caret${isOpen ? " is-open" : ""}`, "aria-hidden": "true" }) : null,
3963
4453
  entry.summary
3964
4454
  ] })
3965
4455
  ]
3966
4456
  }
3967
4457
  ),
3968
- isOpen && details ? /* @__PURE__ */ jsxs9("div", { className: "mb-history-details", children: [
3969
- details.rows?.length ? /* @__PURE__ */ jsx9("dl", { className: "mb-history-kv", children: details.rows.map((row) => /* @__PURE__ */ jsxs9("div", { children: [
3970
- /* @__PURE__ */ jsx9("dt", { children: row.label }),
3971
- /* @__PURE__ */ jsx9("dd", { children: row.value })
4458
+ isOpen && details ? /* @__PURE__ */ jsxs12("div", { className: "mb-history-details", children: [
4459
+ details.rows?.length ? /* @__PURE__ */ jsx12("dl", { className: "mb-history-kv", children: details.rows.map((row) => /* @__PURE__ */ jsxs12("div", { children: [
4460
+ /* @__PURE__ */ jsx12("dt", { children: row.label }),
4461
+ /* @__PURE__ */ jsx12("dd", { children: row.value })
3972
4462
  ] }, `${row.label}-${row.value}`)) }) : null,
3973
- details.documents?.length ? /* @__PURE__ */ jsx9("div", { className: "mb-history-kv", children: /* @__PURE__ */ jsxs9("div", { children: [
3974
- /* @__PURE__ */ jsx9("dt", { children: "Documents" }),
3975
- /* @__PURE__ */ jsx9("dd", { children: details.documents.map((doc) => {
4463
+ details.documents?.length ? /* @__PURE__ */ jsx12("div", { className: "mb-history-kv", children: /* @__PURE__ */ jsxs12("div", { children: [
4464
+ /* @__PURE__ */ jsx12("dt", { children: "Documents" }),
4465
+ /* @__PURE__ */ jsx12("dd", { children: details.documents.map((doc) => {
3976
4466
  const href = documentHref?.(doc) ?? null;
3977
- return href ? /* @__PURE__ */ jsx9("a", { className: "mb-history-doc", href, target: "_blank", rel: "noreferrer", children: doc.filename }, doc.id) : /* @__PURE__ */ jsx9("span", { className: "mb-history-doc", children: doc.filename }, doc.id);
4467
+ return href ? /* @__PURE__ */ jsx12("a", { className: "mb-history-doc", href, target: "_blank", rel: "noreferrer", children: doc.filename }, doc.id) : /* @__PURE__ */ jsx12("span", { className: "mb-history-doc", children: doc.filename }, doc.id);
3978
4468
  }) })
3979
4469
  ] }) }) : null,
3980
- details.codes?.length ? /* @__PURE__ */ jsx9("dl", { className: "mb-history-codes", children: details.codes.map((code) => /* @__PURE__ */ jsxs9("div", { children: [
3981
- /* @__PURE__ */ jsx9("dt", { children: code.code }),
3982
- /* @__PURE__ */ jsx9("dd", { children: code.text })
4470
+ details.codes?.length ? /* @__PURE__ */ jsx12("dl", { className: "mb-history-codes", children: details.codes.map((code) => /* @__PURE__ */ jsxs12("div", { children: [
4471
+ /* @__PURE__ */ jsx12("dt", { children: code.code }),
4472
+ /* @__PURE__ */ jsx12("dd", { children: code.text })
3983
4473
  ] }, code.code)) }) : null,
3984
- details.complianceDueDates?.length ? /* @__PURE__ */ jsxs9("div", { className: "mb-history-due", children: [
3985
- /* @__PURE__ */ jsx9("em", { children: "Compliance Due Dates" }),
3986
- /* @__PURE__ */ jsx9("dl", { children: details.complianceDueDates.map((due) => /* @__PURE__ */ jsxs9("div", { children: [
3987
- /* @__PURE__ */ jsx9("dt", { children: formatDate(due.date) }),
3988
- /* @__PURE__ */ jsx9("dd", { children: due.text })
4474
+ details.complianceDueDates?.length ? /* @__PURE__ */ jsxs12("div", { className: "mb-history-due", children: [
4475
+ /* @__PURE__ */ jsx12("em", { children: "Compliance Due Dates" }),
4476
+ /* @__PURE__ */ jsx12("dl", { children: details.complianceDueDates.map((due) => /* @__PURE__ */ jsxs12("div", { children: [
4477
+ /* @__PURE__ */ jsx12("dt", { children: formatDate(due.date) }),
4478
+ /* @__PURE__ */ jsx12("dd", { children: due.text })
3989
4479
  ] }, `${due.date}-${due.text}`)) })
3990
4480
  ] }) : null,
3991
- details.text ? /* @__PURE__ */ jsx9("p", { className: "mb-history-text", children: details.text }) : null
4481
+ details.text ? /* @__PURE__ */ jsx12("p", { className: "mb-history-text", children: details.text }) : null
3992
4482
  ] }) : null
3993
4483
  ] }, entry.id);
3994
4484
  }) })
@@ -4036,15 +4526,15 @@ function billLifecycleDisplayLabel(state, nativeStatus) {
4036
4526
  function BillLifecycleProgress({ state, nativeStatus, submittedAt, agingDays, appearance, className, style }) {
4037
4527
  const rejected = state.toLowerCase() === "rejected";
4038
4528
  const steps = billLifecycleProgressSteps(state);
4039
- return /* @__PURE__ */ jsxs9("section", { className: classes(`mb-surface mb-progress${rejected ? " is-rejected" : ""}`, className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill lifecycle", children: [
4040
- /* @__PURE__ */ jsx9("style", { children: lifecycleSurfaceStyles }),
4041
- /* @__PURE__ */ jsx9("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs9("div", { children: [
4042
- /* @__PURE__ */ jsx9("strong", { children: billLifecycleDisplayLabel(state, nativeStatus) }),
4043
- /* @__PURE__ */ jsx9("span", { children: rejected ? "The payer rejected this submission." : `${submittedAt ? `Submitted ${defaultFormatDate(submittedAt)}` : "Submitted"}${typeof agingDays === "number" ? ` \xB7 ${agingDays} days old` : ""}` })
4529
+ return /* @__PURE__ */ jsxs12("section", { className: classes(`mb-surface mb-progress${rejected ? " is-rejected" : ""}`, className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill lifecycle", children: [
4530
+ /* @__PURE__ */ jsx12("style", { children: lifecycleSurfaceStyles }),
4531
+ /* @__PURE__ */ jsx12("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs12("div", { children: [
4532
+ /* @__PURE__ */ jsx12("strong", { children: billLifecycleDisplayLabel(state, nativeStatus) }),
4533
+ /* @__PURE__ */ jsx12("span", { children: rejected ? "The payer rejected this submission." : `${submittedAt ? `Submitted ${defaultFormatDate(submittedAt)}` : "Submitted"}${typeof agingDays === "number" ? ` \xB7 ${agingDays} days old` : ""}` })
4044
4534
  ] }) }),
4045
- /* @__PURE__ */ jsx9("ol", { className: "mb-progress-list", style: { gridTemplateColumns: `repeat(${steps.length}, minmax(0, 1fr))` }, children: steps.map((step, index) => /* @__PURE__ */ jsxs9("li", { className: `is-${step.status}`, "aria-current": step.status === "current" ? "step" : void 0, children: [
4046
- /* @__PURE__ */ jsx9("span", { "aria-hidden": "true", children: step.status === "complete" ? "\u2713" : rejected && step.status === "current" ? "!" : index + 1 }),
4047
- /* @__PURE__ */ jsx9("b", { children: step.label })
4535
+ /* @__PURE__ */ jsx12("ol", { className: "mb-progress-list", style: { gridTemplateColumns: `repeat(${steps.length}, minmax(0, 1fr))` }, children: steps.map((step, index) => /* @__PURE__ */ jsxs12("li", { className: `is-${step.status}`, "aria-current": step.status === "current" ? "step" : void 0, children: [
4536
+ /* @__PURE__ */ jsx12("span", { "aria-hidden": "true", children: step.status === "complete" ? "\u2713" : rejected && step.status === "current" ? "!" : index + 1 }),
4537
+ /* @__PURE__ */ jsx12("b", { children: step.label })
4048
4538
  ] }, step.id)) })
4049
4539
  ] });
4050
4540
  }
@@ -4058,48 +4548,48 @@ function billRejectionIssueSummary(rejection, count) {
4058
4548
  function BillRejectionNotice({ rejection, title = "Rejected \u2014 action required", submittedAt, appearance, className, style, formatDate = defaultFormatDate }) {
4059
4549
  const issues = rejection.issues?.length ? rejection.issues : [{ code: rejection.code, description: rejection.reason }];
4060
4550
  const hasCodes = issues.some((issue) => Boolean(issue.code));
4061
- return /* @__PURE__ */ jsxs9("section", { className: classes("mb-surface mb-rejection-notice", className), style: mindBillAppearanceStyle(appearance, style), role: "alert", "aria-label": "Bill rejection reasons", children: [
4062
- /* @__PURE__ */ jsx9("style", { children: lifecycleSurfaceStyles }),
4063
- /* @__PURE__ */ jsxs9("div", { className: "mb-rejection-overview", children: [
4064
- /* @__PURE__ */ jsxs9("header", { className: "mb-rejection-heading", children: [
4065
- /* @__PURE__ */ jsx9("span", { className: "mb-rejection-icon", "aria-hidden": "true", children: "!" }),
4066
- /* @__PURE__ */ jsxs9("div", { children: [
4067
- /* @__PURE__ */ jsx9("strong", { children: title }),
4068
- /* @__PURE__ */ jsxs9("span", { children: [
4551
+ return /* @__PURE__ */ jsxs12("section", { className: classes("mb-surface mb-rejection-notice", className), style: mindBillAppearanceStyle(appearance, style), role: "alert", "aria-label": "Bill rejection reasons", children: [
4552
+ /* @__PURE__ */ jsx12("style", { children: lifecycleSurfaceStyles }),
4553
+ /* @__PURE__ */ jsxs12("div", { className: "mb-rejection-overview", children: [
4554
+ /* @__PURE__ */ jsxs12("header", { className: "mb-rejection-heading", children: [
4555
+ /* @__PURE__ */ jsx12("span", { className: "mb-rejection-icon", "aria-hidden": "true", children: "!" }),
4556
+ /* @__PURE__ */ jsxs12("div", { children: [
4557
+ /* @__PURE__ */ jsx12("strong", { children: title }),
4558
+ /* @__PURE__ */ jsxs12("span", { children: [
4069
4559
  "Fix the ",
4070
4560
  issues.length === 1 ? "issue" : "issues",
4071
4561
  " below, then resubmit."
4072
4562
  ] })
4073
4563
  ] })
4074
4564
  ] }),
4075
- /* @__PURE__ */ jsxs9("ol", { className: "mb-rejection-progress", "aria-label": "Submission status", children: [
4076
- /* @__PURE__ */ jsxs9("li", { className: "is-complete", children: [
4077
- /* @__PURE__ */ jsx9("span", { "aria-hidden": "true", children: "\u2713" }),
4078
- /* @__PURE__ */ jsx9("b", { children: "Sent" }),
4079
- submittedAt ? /* @__PURE__ */ jsx9("small", { children: formatDate(submittedAt) }) : null
4565
+ /* @__PURE__ */ jsxs12("ol", { className: "mb-rejection-progress", "aria-label": "Submission status", children: [
4566
+ /* @__PURE__ */ jsxs12("li", { className: "is-complete", children: [
4567
+ /* @__PURE__ */ jsx12("span", { "aria-hidden": "true", children: "\u2713" }),
4568
+ /* @__PURE__ */ jsx12("b", { children: "Sent" }),
4569
+ submittedAt ? /* @__PURE__ */ jsx12("small", { children: formatDate(submittedAt) }) : null
4080
4570
  ] }),
4081
- /* @__PURE__ */ jsxs9("li", { className: "is-rejected", "aria-current": "step", children: [
4082
- /* @__PURE__ */ jsx9("span", { "aria-hidden": "true", children: "!" }),
4083
- /* @__PURE__ */ jsx9("b", { children: "Rejected" }),
4084
- rejection.receivedAt ? /* @__PURE__ */ jsx9("small", { children: formatDate(rejection.receivedAt) }) : null
4571
+ /* @__PURE__ */ jsxs12("li", { className: "is-rejected", "aria-current": "step", children: [
4572
+ /* @__PURE__ */ jsx12("span", { "aria-hidden": "true", children: "!" }),
4573
+ /* @__PURE__ */ jsx12("b", { children: "Rejected" }),
4574
+ rejection.receivedAt ? /* @__PURE__ */ jsx12("small", { children: formatDate(rejection.receivedAt) }) : null
4085
4575
  ] })
4086
4576
  ] })
4087
4577
  ] }),
4088
- /* @__PURE__ */ jsxs9("div", { className: "mb-rejection-issues", "aria-label": "Rejection reasons", children: [
4089
- /* @__PURE__ */ jsxs9("div", { className: "mb-rejection-issues-heading", children: [
4090
- /* @__PURE__ */ jsxs9("strong", { children: [
4091
- /* @__PURE__ */ jsx9("span", { "aria-hidden": "true", children: "\u25B3" }),
4578
+ /* @__PURE__ */ jsxs12("div", { className: "mb-rejection-issues", "aria-label": "Rejection reasons", children: [
4579
+ /* @__PURE__ */ jsxs12("div", { className: "mb-rejection-issues-heading", children: [
4580
+ /* @__PURE__ */ jsxs12("strong", { children: [
4581
+ /* @__PURE__ */ jsx12("span", { "aria-hidden": "true", children: "\u25B3" }),
4092
4582
  " Rejection reasons"
4093
4583
  ] }),
4094
- /* @__PURE__ */ jsx9("span", { children: billRejectionIssueSummary(rejection, issues.length) })
4584
+ /* @__PURE__ */ jsx12("span", { children: billRejectionIssueSummary(rejection, issues.length) })
4095
4585
  ] }),
4096
- /* @__PURE__ */ jsx9("ol", { "aria-label": `${issues.length} rejection ${issues.length === 1 ? "reason" : "reasons"}`, children: issues.map((issue, index) => /* @__PURE__ */ jsxs9("li", { children: [
4097
- /* @__PURE__ */ jsx9("span", { className: "mb-rejection-bullet", "aria-hidden": "true" }),
4098
- /* @__PURE__ */ jsx9("p", { children: issue.description }),
4099
- issue.code ? /* @__PURE__ */ jsx9("span", { className: "mb-rejection-code", children: issue.code }) : null
4586
+ /* @__PURE__ */ jsx12("ol", { "aria-label": `${issues.length} rejection ${issues.length === 1 ? "reason" : "reasons"}`, children: issues.map((issue, index) => /* @__PURE__ */ jsxs12("li", { children: [
4587
+ /* @__PURE__ */ jsx12("span", { className: "mb-rejection-bullet", "aria-hidden": "true" }),
4588
+ /* @__PURE__ */ jsx12("p", { children: issue.description }),
4589
+ issue.code ? /* @__PURE__ */ jsx12("span", { className: "mb-rejection-code", children: issue.code }) : null
4100
4590
  ] }, `${issue.code ?? "issue"}-${index}`)) }),
4101
- hasCodes ? /* @__PURE__ */ jsxs9("p", { className: "mb-rejection-code-note", children: [
4102
- /* @__PURE__ */ jsx9("span", { "aria-hidden": "true", children: "i" }),
4591
+ hasCodes ? /* @__PURE__ */ jsxs12("p", { className: "mb-rejection-code-note", children: [
4592
+ /* @__PURE__ */ jsx12("span", { "aria-hidden": "true", children: "i" }),
4103
4593
  " Technical error codes are included for support and auditability."
4104
4594
  ] }) : null
4105
4595
  ] })
@@ -4114,18 +4604,18 @@ function BillSnapshotSummary({ bill, patient, injury, delivery, appearance, clas
4114
4604
  ["Charged", currency(bill.totalCharge)],
4115
4605
  ["Balance", currency(bill.balanceDue)]
4116
4606
  ];
4117
- return /* @__PURE__ */ jsxs9("section", { className: classes("mb-surface mb-snapshot", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill snapshot", children: [
4118
- /* @__PURE__ */ jsx9("style", { children: lifecycleSurfaceStyles }),
4119
- /* @__PURE__ */ jsx9("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs9("div", { children: [
4120
- /* @__PURE__ */ jsx9("strong", { children: "Bill snapshot" }),
4121
- /* @__PURE__ */ jsxs9("span", { children: [
4607
+ return /* @__PURE__ */ jsxs12("section", { className: classes("mb-surface mb-snapshot", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Bill snapshot", children: [
4608
+ /* @__PURE__ */ jsx12("style", { children: lifecycleSurfaceStyles }),
4609
+ /* @__PURE__ */ jsx12("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs12("div", { children: [
4610
+ /* @__PURE__ */ jsx12("strong", { children: "Bill snapshot" }),
4611
+ /* @__PURE__ */ jsxs12("span", { children: [
4122
4612
  "Bill #",
4123
4613
  bill.billNumber
4124
4614
  ] })
4125
4615
  ] }) }),
4126
- /* @__PURE__ */ jsx9("dl", { children: values.map(([label, value]) => /* @__PURE__ */ jsxs9("div", { children: [
4127
- /* @__PURE__ */ jsx9("dt", { children: label }),
4128
- /* @__PURE__ */ jsx9("dd", { children: value })
4616
+ /* @__PURE__ */ jsx12("dl", { children: values.map(([label, value]) => /* @__PURE__ */ jsxs12("div", { children: [
4617
+ /* @__PURE__ */ jsx12("dt", { children: label }),
4618
+ /* @__PURE__ */ jsx12("dd", { children: value })
4129
4619
  ] }, label)) })
4130
4620
  ] });
4131
4621
  }
@@ -4140,140 +4630,140 @@ function BillExplanationOfReview({
4140
4630
  style
4141
4631
  }) {
4142
4632
  const rows = payments.length ? payments : [null];
4143
- return /* @__PURE__ */ jsxs9("section", { className: classes("mb-surface mb-eor-review", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Explanation of Review and payments", children: [
4144
- /* @__PURE__ */ jsx9("style", { children: lifecycleSurfaceStyles }),
4145
- /* @__PURE__ */ jsx9("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs9("div", { children: [
4146
- /* @__PURE__ */ jsx9("strong", { children: "Explanation of Review" }),
4147
- /* @__PURE__ */ jsx9("span", { children: "Payer response and payment reconciliation." })
4633
+ return /* @__PURE__ */ jsxs12("section", { className: classes("mb-surface mb-eor-review", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Explanation of Review and payments", children: [
4634
+ /* @__PURE__ */ jsx12("style", { children: lifecycleSurfaceStyles }),
4635
+ /* @__PURE__ */ jsx12("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs12("div", { children: [
4636
+ /* @__PURE__ */ jsx12("strong", { children: "Explanation of Review" }),
4637
+ /* @__PURE__ */ jsx12("span", { children: "Payer response and payment reconciliation." })
4148
4638
  ] }) }),
4149
- /* @__PURE__ */ jsxs9("dl", { className: "mb-eor-metrics", children: [
4150
- /* @__PURE__ */ jsxs9("div", { children: [
4151
- /* @__PURE__ */ jsx9("dt", { children: "Amount billed" }),
4152
- /* @__PURE__ */ jsx9("dd", { children: currency(remittance.billedAmount) })
4639
+ /* @__PURE__ */ jsxs12("dl", { className: "mb-eor-metrics", children: [
4640
+ /* @__PURE__ */ jsxs12("div", { children: [
4641
+ /* @__PURE__ */ jsx12("dt", { children: "Amount billed" }),
4642
+ /* @__PURE__ */ jsx12("dd", { children: currency(remittance.billedAmount) })
4153
4643
  ] }),
4154
- /* @__PURE__ */ jsxs9("div", { children: [
4155
- /* @__PURE__ */ jsx9("dt", { children: "Payer allowed" }),
4156
- /* @__PURE__ */ jsx9("dd", { children: remittance.payerAllowedAmount === null ? "\u2014" : currency(remittance.payerAllowedAmount) })
4644
+ /* @__PURE__ */ jsxs12("div", { children: [
4645
+ /* @__PURE__ */ jsx12("dt", { children: "Payer allowed" }),
4646
+ /* @__PURE__ */ jsx12("dd", { children: remittance.payerAllowedAmount === null ? "\u2014" : currency(remittance.payerAllowedAmount) })
4157
4647
  ] }),
4158
- /* @__PURE__ */ jsxs9("div", { children: [
4159
- /* @__PURE__ */ jsx9("dt", { children: "Payer reported paid" }),
4160
- /* @__PURE__ */ jsx9("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
4648
+ /* @__PURE__ */ jsxs12("div", { children: [
4649
+ /* @__PURE__ */ jsx12("dt", { children: "Payer reported paid" }),
4650
+ /* @__PURE__ */ jsx12("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
4161
4651
  ] }),
4162
- /* @__PURE__ */ jsxs9("div", { className: "is-balance", children: [
4163
- /* @__PURE__ */ jsx9("dt", { children: "Balance due" }),
4164
- /* @__PURE__ */ jsx9("dd", { children: currency(remittance.balanceDue) })
4652
+ /* @__PURE__ */ jsxs12("div", { className: "is-balance", children: [
4653
+ /* @__PURE__ */ jsx12("dt", { children: "Balance due" }),
4654
+ /* @__PURE__ */ jsx12("dd", { children: currency(remittance.balanceDue) })
4165
4655
  ] }),
4166
- /* @__PURE__ */ jsxs9("div", { children: [
4167
- /* @__PURE__ */ jsx9("dt", { children: "Payment posted" }),
4168
- /* @__PURE__ */ jsx9("dd", { children: currency(remittance.postedPrincipal) })
4656
+ /* @__PURE__ */ jsxs12("div", { children: [
4657
+ /* @__PURE__ */ jsx12("dt", { children: "Payment posted" }),
4658
+ /* @__PURE__ */ jsx12("dd", { children: currency(remittance.postedPrincipal) })
4169
4659
  ] }),
4170
- /* @__PURE__ */ jsxs9("div", { children: [
4171
- /* @__PURE__ */ jsx9("dt", { children: "Penalty & interest" }),
4172
- /* @__PURE__ */ jsx9("dd", { children: currency(remittance.postedAdditional) })
4660
+ /* @__PURE__ */ jsxs12("div", { children: [
4661
+ /* @__PURE__ */ jsx12("dt", { children: "Penalty & interest" }),
4662
+ /* @__PURE__ */ jsx12("dd", { children: currency(remittance.postedAdditional) })
4173
4663
  ] }),
4174
- /* @__PURE__ */ jsxs9("div", { children: [
4175
- /* @__PURE__ */ jsx9("dt", { children: "Total received" }),
4176
- /* @__PURE__ */ jsx9("dd", { children: currency(remittance.totalPostedCash) })
4664
+ /* @__PURE__ */ jsxs12("div", { children: [
4665
+ /* @__PURE__ */ jsx12("dt", { children: "Total received" }),
4666
+ /* @__PURE__ */ jsx12("dd", { children: currency(remittance.totalPostedCash) })
4177
4667
  ] }),
4178
- /* @__PURE__ */ jsxs9("div", { children: [
4179
- /* @__PURE__ */ jsx9("dt", { children: "Expected" }),
4180
- /* @__PURE__ */ jsx9("dd", { children: currency(remittance.expectedAmount) })
4668
+ /* @__PURE__ */ jsxs12("div", { children: [
4669
+ /* @__PURE__ */ jsx12("dt", { children: "Expected" }),
4670
+ /* @__PURE__ */ jsx12("dd", { children: currency(remittance.expectedAmount) })
4181
4671
  ] })
4182
4672
  ] }),
4183
- remittance.denialReason ? /* @__PURE__ */ jsxs9("div", { className: "mb-denial", children: [
4184
- /* @__PURE__ */ jsx9("strong", { children: "Denial reason" }),
4185
- /* @__PURE__ */ jsx9("p", { children: remittance.denialReason })
4673
+ remittance.denialReason ? /* @__PURE__ */ jsxs12("div", { className: "mb-denial", children: [
4674
+ /* @__PURE__ */ jsx12("strong", { children: "Denial reason" }),
4675
+ /* @__PURE__ */ jsx12("p", { children: remittance.denialReason })
4186
4676
  ] }) : null,
4187
- /* @__PURE__ */ jsx9("div", { className: "mb-eor-table-wrap", children: /* @__PURE__ */ jsxs9("table", { className: "mb-eor-table", children: [
4188
- /* @__PURE__ */ jsxs9("thead", { children: [
4189
- /* @__PURE__ */ jsxs9("tr", { className: "mb-eor-groups", children: [
4190
- /* @__PURE__ */ jsx9("th", { colSpan: 2, children: "Submission" }),
4191
- /* @__PURE__ */ jsx9("th", { colSpan: 5, children: "EOR payment information" }),
4192
- /* @__PURE__ */ jsx9("th", { colSpan: 2, children: "EOR post" }),
4193
- /* @__PURE__ */ jsx9("th", { children: "EOR" })
4677
+ /* @__PURE__ */ jsx12("div", { className: "mb-eor-table-wrap", children: /* @__PURE__ */ jsxs12("table", { className: "mb-eor-table", children: [
4678
+ /* @__PURE__ */ jsxs12("thead", { children: [
4679
+ /* @__PURE__ */ jsxs12("tr", { className: "mb-eor-groups", children: [
4680
+ /* @__PURE__ */ jsx12("th", { colSpan: 2, children: "Submission" }),
4681
+ /* @__PURE__ */ jsx12("th", { colSpan: 5, children: "EOR payment information" }),
4682
+ /* @__PURE__ */ jsx12("th", { colSpan: 2, children: "EOR post" }),
4683
+ /* @__PURE__ */ jsx12("th", { children: "EOR" })
4194
4684
  ] }),
4195
- /* @__PURE__ */ jsxs9("tr", { children: [
4196
- /* @__PURE__ */ jsx9("th", { children: "Submission" }),
4197
- /* @__PURE__ */ jsx9("th", { children: "Submission payment" }),
4198
- /* @__PURE__ */ jsx9("th", { children: "Payment method" }),
4199
- /* @__PURE__ */ jsx9("th", { children: "Reference" }),
4200
- /* @__PURE__ */ jsx9("th", { children: "Effective date" }),
4201
- /* @__PURE__ */ jsx9("th", { children: "Payment total" }),
4202
- /* @__PURE__ */ jsx9("th", { children: "Deposit date" }),
4203
- /* @__PURE__ */ jsx9("th", { children: "Post date" }),
4204
- /* @__PURE__ */ jsx9("th", { children: "Source" }),
4205
- /* @__PURE__ */ jsx9("th", { children: "Document" })
4685
+ /* @__PURE__ */ jsxs12("tr", { children: [
4686
+ /* @__PURE__ */ jsx12("th", { children: "Submission" }),
4687
+ /* @__PURE__ */ jsx12("th", { children: "Submission payment" }),
4688
+ /* @__PURE__ */ jsx12("th", { children: "Payment method" }),
4689
+ /* @__PURE__ */ jsx12("th", { children: "Reference" }),
4690
+ /* @__PURE__ */ jsx12("th", { children: "Effective date" }),
4691
+ /* @__PURE__ */ jsx12("th", { children: "Payment total" }),
4692
+ /* @__PURE__ */ jsx12("th", { children: "Deposit date" }),
4693
+ /* @__PURE__ */ jsx12("th", { children: "Post date" }),
4694
+ /* @__PURE__ */ jsx12("th", { children: "Source" }),
4695
+ /* @__PURE__ */ jsx12("th", { children: "Document" })
4206
4696
  ] })
4207
4697
  ] }),
4208
- /* @__PURE__ */ jsx9("tbody", { children: rows.map((payment, index) => {
4698
+ /* @__PURE__ */ jsx12("tbody", { children: rows.map((payment, index) => {
4209
4699
  const eor = eors[index] ?? eors[0];
4210
- return /* @__PURE__ */ jsxs9("tr", { children: [
4211
- /* @__PURE__ */ jsxs9("td", { "data-label": "Submission", children: [
4212
- /* @__PURE__ */ jsx9("strong", { children: "Original bill" }),
4213
- submittedAt ? /* @__PURE__ */ jsxs9("span", { children: [
4700
+ return /* @__PURE__ */ jsxs12("tr", { children: [
4701
+ /* @__PURE__ */ jsxs12("td", { "data-label": "Submission", children: [
4702
+ /* @__PURE__ */ jsx12("strong", { children: "Original bill" }),
4703
+ submittedAt ? /* @__PURE__ */ jsxs12("span", { children: [
4214
4704
  "Sent ",
4215
4705
  defaultFormatDate(submittedAt)
4216
4706
  ] }) : null
4217
4707
  ] }),
4218
- /* @__PURE__ */ jsx9("td", { "data-label": "Submission payment", children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) }),
4219
- /* @__PURE__ */ jsx9("td", { "data-label": "Payment method", children: payment ? humanize(payment.method) : "\u2014" }),
4220
- /* @__PURE__ */ jsx9("td", { "data-label": "Reference", children: payment?.checkNumber || "\u2014" }),
4221
- /* @__PURE__ */ jsx9("td", { "data-label": "Effective date", children: payment ? payment.receivedDate || payment.depositDate || defaultFormatDate(payment.postedAt) : "\u2014" }),
4222
- /* @__PURE__ */ jsx9("td", { "data-label": "Payment total", children: payment ? currency(payment.amount) : currency(0) }),
4223
- /* @__PURE__ */ jsx9("td", { "data-label": "Deposit date", children: payment?.depositDate || "Not recorded" }),
4224
- /* @__PURE__ */ jsx9("td", { "data-label": "Post date", children: payment ? defaultFormatDate(payment.postedAt) : eor ? defaultFormatDate(eor.addedAt) : "\u2014" }),
4225
- /* @__PURE__ */ jsx9("td", { "data-label": "Source", children: payment ? payment.source.toUpperCase() : eor ? "EOR" : "\u2014" }),
4226
- /* @__PURE__ */ jsx9("td", { "data-label": "EOR", children: eor && onOpenEor ? /* @__PURE__ */ jsx9("button", { type: "button", className: "mb-eor-link", onClick: () => void onOpenEor(eor), children: eor.filename }) : eor?.filename || "\u2014" })
4708
+ /* @__PURE__ */ jsx12("td", { "data-label": "Submission payment", children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) }),
4709
+ /* @__PURE__ */ jsx12("td", { "data-label": "Payment method", children: payment ? humanize(payment.method) : "\u2014" }),
4710
+ /* @__PURE__ */ jsx12("td", { "data-label": "Reference", children: payment?.checkNumber || "\u2014" }),
4711
+ /* @__PURE__ */ jsx12("td", { "data-label": "Effective date", children: payment ? payment.receivedDate || payment.depositDate || defaultFormatDate(payment.postedAt) : "\u2014" }),
4712
+ /* @__PURE__ */ jsx12("td", { "data-label": "Payment total", children: payment ? currency(payment.amount) : currency(0) }),
4713
+ /* @__PURE__ */ jsx12("td", { "data-label": "Deposit date", children: payment?.depositDate || "Not recorded" }),
4714
+ /* @__PURE__ */ jsx12("td", { "data-label": "Post date", children: payment ? defaultFormatDate(payment.postedAt) : eor ? defaultFormatDate(eor.addedAt) : "\u2014" }),
4715
+ /* @__PURE__ */ jsx12("td", { "data-label": "Source", children: payment ? payment.source.toUpperCase() : eor ? "EOR" : "\u2014" }),
4716
+ /* @__PURE__ */ jsx12("td", { "data-label": "EOR", children: eor && onOpenEor ? /* @__PURE__ */ jsx12("button", { type: "button", className: "mb-eor-link", onClick: () => void onOpenEor(eor), children: eor.filename }) : eor?.filename || "\u2014" })
4227
4717
  ] }, payment?.id ?? `empty-${index}`);
4228
4718
  }) })
4229
4719
  ] }) }),
4230
- eors.length > rows.length ? /* @__PURE__ */ jsx9("div", { className: "mb-eor-documents", children: eors.slice(rows.length).map((eor) => /* @__PURE__ */ jsx9("button", { type: "button", onClick: () => void onOpenEor?.(eor), children: eor.filename }, eor.id)) }) : null
4720
+ eors.length > rows.length ? /* @__PURE__ */ jsx12("div", { className: "mb-eor-documents", children: eors.slice(rows.length).map((eor) => /* @__PURE__ */ jsx12("button", { type: "button", onClick: () => void onOpenEor?.(eor), children: eor.filename }, eor.id)) }) : null
4231
4721
  ] });
4232
4722
  }
4233
4723
  function BillRemittanceCard({ remittance, appearance, className, style }) {
4234
- return /* @__PURE__ */ jsxs9("section", { className: classes("mb-surface mb-remittance", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Remittance summary", children: [
4235
- /* @__PURE__ */ jsx9("style", { children: lifecycleSurfaceStyles }),
4236
- /* @__PURE__ */ jsx9("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs9("div", { children: [
4237
- /* @__PURE__ */ jsx9("strong", { children: "Remittance" }),
4238
- /* @__PURE__ */ jsx9("span", { children: "Amounts reported by the payer and posted to the bill." })
4724
+ return /* @__PURE__ */ jsxs12("section", { className: classes("mb-surface mb-remittance", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Remittance summary", children: [
4725
+ /* @__PURE__ */ jsx12("style", { children: lifecycleSurfaceStyles }),
4726
+ /* @__PURE__ */ jsx12("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs12("div", { children: [
4727
+ /* @__PURE__ */ jsx12("strong", { children: "Remittance" }),
4728
+ /* @__PURE__ */ jsx12("span", { children: "Amounts reported by the payer and posted to the bill." })
4239
4729
  ] }) }),
4240
- /* @__PURE__ */ jsxs9("dl", { children: [
4241
- /* @__PURE__ */ jsxs9("div", { children: [
4242
- /* @__PURE__ */ jsx9("dt", { children: "Amount billed" }),
4243
- /* @__PURE__ */ jsx9("dd", { children: currency(remittance.billedAmount) })
4730
+ /* @__PURE__ */ jsxs12("dl", { children: [
4731
+ /* @__PURE__ */ jsxs12("div", { children: [
4732
+ /* @__PURE__ */ jsx12("dt", { children: "Amount billed" }),
4733
+ /* @__PURE__ */ jsx12("dd", { children: currency(remittance.billedAmount) })
4244
4734
  ] }),
4245
- /* @__PURE__ */ jsxs9("div", { children: [
4246
- /* @__PURE__ */ jsx9("dt", { children: "Expected" }),
4247
- /* @__PURE__ */ jsx9("dd", { children: currency(remittance.expectedAmount) })
4735
+ /* @__PURE__ */ jsxs12("div", { children: [
4736
+ /* @__PURE__ */ jsx12("dt", { children: "Expected" }),
4737
+ /* @__PURE__ */ jsx12("dd", { children: currency(remittance.expectedAmount) })
4248
4738
  ] }),
4249
- /* @__PURE__ */ jsxs9("div", { children: [
4250
- /* @__PURE__ */ jsx9("dt", { children: "Payer allowed" }),
4251
- /* @__PURE__ */ jsx9("dd", { children: remittance.payerAllowedAmount === null ? "\u2014" : currency(remittance.payerAllowedAmount) })
4739
+ /* @__PURE__ */ jsxs12("div", { children: [
4740
+ /* @__PURE__ */ jsx12("dt", { children: "Payer allowed" }),
4741
+ /* @__PURE__ */ jsx12("dd", { children: remittance.payerAllowedAmount === null ? "\u2014" : currency(remittance.payerAllowedAmount) })
4252
4742
  ] }),
4253
- /* @__PURE__ */ jsxs9("div", { children: [
4254
- /* @__PURE__ */ jsx9("dt", { children: "Payer reported paid" }),
4255
- /* @__PURE__ */ jsx9("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
4743
+ /* @__PURE__ */ jsxs12("div", { children: [
4744
+ /* @__PURE__ */ jsx12("dt", { children: "Payer reported paid" }),
4745
+ /* @__PURE__ */ jsx12("dd", { children: remittance.payerReportedPaid === null ? "\u2014" : currency(remittance.payerReportedPaid) })
4256
4746
  ] }),
4257
- /* @__PURE__ */ jsxs9("div", { children: [
4258
- /* @__PURE__ */ jsx9("dt", { children: "Payment posted" }),
4259
- /* @__PURE__ */ jsx9("dd", { children: currency(remittance.postedPrincipal) })
4747
+ /* @__PURE__ */ jsxs12("div", { children: [
4748
+ /* @__PURE__ */ jsx12("dt", { children: "Payment posted" }),
4749
+ /* @__PURE__ */ jsx12("dd", { children: currency(remittance.postedPrincipal) })
4260
4750
  ] }),
4261
- /* @__PURE__ */ jsxs9("div", { children: [
4262
- /* @__PURE__ */ jsx9("dt", { children: "Penalty & interest" }),
4263
- /* @__PURE__ */ jsx9("dd", { children: currency(remittance.postedAdditional) })
4751
+ /* @__PURE__ */ jsxs12("div", { children: [
4752
+ /* @__PURE__ */ jsx12("dt", { children: "Penalty & interest" }),
4753
+ /* @__PURE__ */ jsx12("dd", { children: currency(remittance.postedAdditional) })
4264
4754
  ] }),
4265
- /* @__PURE__ */ jsxs9("div", { children: [
4266
- /* @__PURE__ */ jsx9("dt", { children: "Total received" }),
4267
- /* @__PURE__ */ jsx9("dd", { children: currency(remittance.totalPostedCash) })
4755
+ /* @__PURE__ */ jsxs12("div", { children: [
4756
+ /* @__PURE__ */ jsx12("dt", { children: "Total received" }),
4757
+ /* @__PURE__ */ jsx12("dd", { children: currency(remittance.totalPostedCash) })
4268
4758
  ] }),
4269
- /* @__PURE__ */ jsxs9("div", { children: [
4270
- /* @__PURE__ */ jsx9("dt", { children: "Balance due" }),
4271
- /* @__PURE__ */ jsx9("dd", { children: currency(remittance.balanceDue) })
4759
+ /* @__PURE__ */ jsxs12("div", { children: [
4760
+ /* @__PURE__ */ jsx12("dt", { children: "Balance due" }),
4761
+ /* @__PURE__ */ jsx12("dd", { children: currency(remittance.balanceDue) })
4272
4762
  ] })
4273
4763
  ] }),
4274
- remittance.denialReason ? /* @__PURE__ */ jsxs9("div", { className: "mb-denial", children: [
4275
- /* @__PURE__ */ jsx9("strong", { children: "Denial reason" }),
4276
- /* @__PURE__ */ jsx9("p", { children: remittance.denialReason })
4764
+ remittance.denialReason ? /* @__PURE__ */ jsxs12("div", { className: "mb-denial", children: [
4765
+ /* @__PURE__ */ jsx12("strong", { children: "Denial reason" }),
4766
+ /* @__PURE__ */ jsx12("p", { children: remittance.denialReason })
4277
4767
  ] }) : null
4278
4768
  ] });
4279
4769
  }
@@ -4288,72 +4778,72 @@ function BillPayerContactCard({ delivery, appearance, className, style }) {
4288
4778
  delivery.contacts.portalUrl ? ["Portal", "Open payer portal", delivery.contacts.portalUrl] : null
4289
4779
  ].filter(Boolean);
4290
4780
  if (!delivery.payerName && !contacts.length) return null;
4291
- return /* @__PURE__ */ jsxs9("section", { className: classes("mb-surface mb-contacts", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payer contact information", children: [
4292
- /* @__PURE__ */ jsx9("style", { children: lifecycleSurfaceStyles }),
4293
- /* @__PURE__ */ jsx9("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs9("div", { children: [
4294
- /* @__PURE__ */ jsx9("strong", { children: delivery.payerName || "Claims administrator" }),
4295
- /* @__PURE__ */ jsx9("span", { children: "Billing and follow-up contacts." })
4781
+ return /* @__PURE__ */ jsxs12("section", { className: classes("mb-surface mb-contacts", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payer contact information", children: [
4782
+ /* @__PURE__ */ jsx12("style", { children: lifecycleSurfaceStyles }),
4783
+ /* @__PURE__ */ jsx12("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs12("div", { children: [
4784
+ /* @__PURE__ */ jsx12("strong", { children: delivery.payerName || "Claims administrator" }),
4785
+ /* @__PURE__ */ jsx12("span", { children: "Billing and follow-up contacts." })
4296
4786
  ] }) }),
4297
- !contacts.length ? /* @__PURE__ */ jsx9("p", { className: "mb-empty", children: "No payer contact details are available." }) : /* @__PURE__ */ jsx9("dl", { children: contacts.map(([label, value, href]) => /* @__PURE__ */ jsxs9("div", { children: [
4298
- /* @__PURE__ */ jsx9("dt", { children: label }),
4299
- /* @__PURE__ */ jsx9("dd", { children: href ? /* @__PURE__ */ jsx9("a", { href, target: label === "Portal" ? "_blank" : void 0, rel: label === "Portal" ? "noreferrer noopener" : void 0, children: value }) : value })
4787
+ !contacts.length ? /* @__PURE__ */ jsx12("p", { className: "mb-empty", children: "No payer contact details are available." }) : /* @__PURE__ */ jsx12("dl", { children: contacts.map(([label, value, href]) => /* @__PURE__ */ jsxs12("div", { children: [
4788
+ /* @__PURE__ */ jsx12("dt", { children: label }),
4789
+ /* @__PURE__ */ jsx12("dd", { children: href ? /* @__PURE__ */ jsx12("a", { href, target: label === "Portal" ? "_blank" : void 0, rel: label === "Portal" ? "noreferrer noopener" : void 0, children: value }) : value })
4300
4790
  ] }, label)) })
4301
4791
  ] });
4302
4792
  }
4303
4793
  function BillPaymentLedger({ payments, appearance, className, style }) {
4304
- return /* @__PURE__ */ jsxs9("section", { className: classes("mb-surface mb-payments", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payment ledger", children: [
4305
- /* @__PURE__ */ jsx9("style", { children: lifecycleSurfaceStyles }),
4306
- /* @__PURE__ */ jsx9("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs9("div", { children: [
4307
- /* @__PURE__ */ jsx9("strong", { children: "Payments" }),
4308
- /* @__PURE__ */ jsx9("span", { children: "Funds recorded against this bill." })
4794
+ return /* @__PURE__ */ jsxs12("section", { className: classes("mb-surface mb-payments", className), style: mindBillAppearanceStyle(appearance, style), "aria-label": "Payment ledger", children: [
4795
+ /* @__PURE__ */ jsx12("style", { children: lifecycleSurfaceStyles }),
4796
+ /* @__PURE__ */ jsx12("header", { className: "mb-surface-heading", children: /* @__PURE__ */ jsxs12("div", { children: [
4797
+ /* @__PURE__ */ jsx12("strong", { children: "Payments" }),
4798
+ /* @__PURE__ */ jsx12("span", { children: "Funds recorded against this bill." })
4309
4799
  ] }) }),
4310
- !payments.length ? /* @__PURE__ */ jsx9("p", { className: "mb-empty", children: "No payments posted." }) : /* @__PURE__ */ jsx9("div", { className: "mb-payment-list", children: payments.map((payment) => {
4800
+ !payments.length ? /* @__PURE__ */ jsx12("p", { className: "mb-empty", children: "No payments posted." }) : /* @__PURE__ */ jsx12("div", { className: "mb-payment-list", children: payments.map((payment) => {
4311
4801
  const additional = payment.feeAmount ?? 0;
4312
- return /* @__PURE__ */ jsxs9("article", { children: [
4313
- /* @__PURE__ */ jsxs9("div", { className: "mb-payment-amount", children: [
4314
- /* @__PURE__ */ jsx9("strong", { children: currency(payment.amount) }),
4315
- /* @__PURE__ */ jsx9("span", { children: "Total received" })
4802
+ return /* @__PURE__ */ jsxs12("article", { children: [
4803
+ /* @__PURE__ */ jsxs12("div", { className: "mb-payment-amount", children: [
4804
+ /* @__PURE__ */ jsx12("strong", { children: currency(payment.amount) }),
4805
+ /* @__PURE__ */ jsx12("span", { children: "Total received" })
4316
4806
  ] }),
4317
- /* @__PURE__ */ jsxs9("dl", { children: [
4318
- /* @__PURE__ */ jsxs9("div", { children: [
4319
- /* @__PURE__ */ jsx9("dt", { children: "Applied to bill" }),
4320
- /* @__PURE__ */ jsx9("dd", { children: currency(payment.principalAmount) })
4807
+ /* @__PURE__ */ jsxs12("dl", { children: [
4808
+ /* @__PURE__ */ jsxs12("div", { children: [
4809
+ /* @__PURE__ */ jsx12("dt", { children: "Applied to bill" }),
4810
+ /* @__PURE__ */ jsx12("dd", { children: currency(payment.principalAmount) })
4321
4811
  ] }),
4322
- additional > 0 ? /* @__PURE__ */ jsxs9("div", { children: [
4323
- /* @__PURE__ */ jsx9("dt", { children: "Penalty & interest" }),
4324
- /* @__PURE__ */ jsx9("dd", { children: currency(additional) })
4812
+ additional > 0 ? /* @__PURE__ */ jsxs12("div", { children: [
4813
+ /* @__PURE__ */ jsx12("dt", { children: "Penalty & interest" }),
4814
+ /* @__PURE__ */ jsx12("dd", { children: currency(additional) })
4325
4815
  ] }) : null,
4326
- /* @__PURE__ */ jsxs9("div", { children: [
4327
- /* @__PURE__ */ jsx9("dt", { children: "Method" }),
4328
- /* @__PURE__ */ jsx9("dd", { children: payment.method.toUpperCase() })
4816
+ /* @__PURE__ */ jsxs12("div", { children: [
4817
+ /* @__PURE__ */ jsx12("dt", { children: "Method" }),
4818
+ /* @__PURE__ */ jsx12("dd", { children: payment.method.toUpperCase() })
4329
4819
  ] }),
4330
- /* @__PURE__ */ jsxs9("div", { children: [
4331
- /* @__PURE__ */ jsx9("dt", { children: "Reference" }),
4332
- /* @__PURE__ */ jsx9("dd", { children: payment.checkNumber || "\u2014" })
4820
+ /* @__PURE__ */ jsxs12("div", { children: [
4821
+ /* @__PURE__ */ jsx12("dt", { children: "Reference" }),
4822
+ /* @__PURE__ */ jsx12("dd", { children: payment.checkNumber || "\u2014" })
4333
4823
  ] }),
4334
- /* @__PURE__ */ jsxs9("div", { children: [
4335
- /* @__PURE__ */ jsx9("dt", { children: "Effective date" }),
4336
- /* @__PURE__ */ jsx9("dd", { children: payment.receivedDate || payment.depositDate || defaultFormatDate(payment.postedAt) })
4824
+ /* @__PURE__ */ jsxs12("div", { children: [
4825
+ /* @__PURE__ */ jsx12("dt", { children: "Effective date" }),
4826
+ /* @__PURE__ */ jsx12("dd", { children: payment.receivedDate || payment.depositDate || defaultFormatDate(payment.postedAt) })
4337
4827
  ] }),
4338
- /* @__PURE__ */ jsxs9("div", { children: [
4339
- /* @__PURE__ */ jsx9("dt", { children: "Deposit date" }),
4340
- /* @__PURE__ */ jsx9("dd", { children: payment.depositDate || "Not recorded" })
4828
+ /* @__PURE__ */ jsxs12("div", { children: [
4829
+ /* @__PURE__ */ jsx12("dt", { children: "Deposit date" }),
4830
+ /* @__PURE__ */ jsx12("dd", { children: payment.depositDate || "Not recorded" })
4341
4831
  ] }),
4342
- /* @__PURE__ */ jsxs9("div", { children: [
4343
- /* @__PURE__ */ jsx9("dt", { children: "Posted" }),
4344
- /* @__PURE__ */ jsxs9("dd", { children: [
4832
+ /* @__PURE__ */ jsxs12("div", { children: [
4833
+ /* @__PURE__ */ jsx12("dt", { children: "Posted" }),
4834
+ /* @__PURE__ */ jsxs12("dd", { children: [
4345
4835
  defaultFormatDate(payment.postedAt),
4346
4836
  " \xB7 ",
4347
4837
  payment.source.toUpperCase()
4348
4838
  ] })
4349
4839
  ] }),
4350
- /* @__PURE__ */ jsxs9("div", { children: [
4351
- /* @__PURE__ */ jsx9("dt", { children: "Status" }),
4352
- /* @__PURE__ */ jsx9("dd", { children: humanize(payment.status || "posted") })
4840
+ /* @__PURE__ */ jsxs12("div", { children: [
4841
+ /* @__PURE__ */ jsx12("dt", { children: "Status" }),
4842
+ /* @__PURE__ */ jsx12("dd", { children: humanize(payment.status || "posted") })
4353
4843
  ] })
4354
4844
  ] }),
4355
- payment.feeReason ? /* @__PURE__ */ jsx9("p", { children: payment.feeReason }) : null,
4356
- payment.note ? /* @__PURE__ */ jsx9("p", { children: payment.note }) : null
4845
+ payment.feeReason ? /* @__PURE__ */ jsx12("p", { children: payment.feeReason }) : null,
4846
+ payment.note ? /* @__PURE__ */ jsx12("p", { children: payment.note }) : null
4357
4847
  ] }, payment.id);
4358
4848
  }) })
4359
4849
  ] });
@@ -4408,10 +4898,10 @@ var lifecycleSurfaceStyles = `
4408
4898
  // src/connected-bill-lifecycle.tsx
4409
4899
  import {
4410
4900
  useCallback as useCallback4,
4411
- useEffect as useEffect7,
4901
+ useEffect as useEffect8,
4412
4902
  useMemo as useMemo8,
4413
4903
  useRef as useRef5,
4414
- useState as useState9
4904
+ useState as useState10
4415
4905
  } from "react";
4416
4906
  import {
4417
4907
  DEFAULT_API_BASE_URL as DEFAULT_API_BASE_URL2,
@@ -4419,7 +4909,7 @@ import {
4419
4909
  createBillLifecycleClient
4420
4910
  } from "@mindbill/browser";
4421
4911
  import { createBillLifecycleClient as createBillLifecycleClient2 } from "@mindbill/browser";
4422
- import { Fragment as Fragment7, jsx as jsx10, jsxs as jsxs10 } from "react/jsx-runtime";
4912
+ import { Fragment as Fragment9, jsx as jsx13, jsxs as jsxs13 } from "react/jsx-runtime";
4423
4913
  var DEFAULT_REFRESH_INTERVAL2 = 6e4;
4424
4914
  function reservePreviewWindow() {
4425
4915
  const preview = window.open("about:blank", "_blank");
@@ -4461,11 +4951,11 @@ function useBillLifecycle({
4461
4951
  enabled = true,
4462
4952
  fetch: fetchOverride
4463
4953
  }) {
4464
- const [data, setData] = useState9(null);
4465
- const [error, setError] = useState9(null);
4466
- const [isLoading, setIsLoading] = useState9(enabled);
4467
- const [isRefreshing, setIsRefreshing] = useState9(false);
4468
- const [isMutating, setIsMutating] = useState9(false);
4954
+ const [data, setData] = useState10(null);
4955
+ const [error, setError] = useState10(null);
4956
+ const [isLoading, setIsLoading] = useState10(enabled);
4957
+ const [isRefreshing, setIsRefreshing] = useState10(false);
4958
+ const [isMutating, setIsMutating] = useState10(false);
4469
4959
  const mounted = useRef5(true);
4470
4960
  const client = useMemo8(() => createBillLifecycleClient({
4471
4961
  billId: providedBillId,
@@ -4474,12 +4964,12 @@ function useBillLifecycle({
4474
4964
  apiBaseUrl,
4475
4965
  fetch: fetchOverride
4476
4966
  }), [apiBaseUrl, fetchOverride, getSession, providedBillId, sessionEndpoint]);
4477
- useEffect7(() => {
4967
+ useEffect8(() => {
4478
4968
  setData(null);
4479
4969
  setError(null);
4480
4970
  setIsLoading(enabled);
4481
4971
  }, [enabled, providedBillId]);
4482
- useEffect7(() => {
4972
+ useEffect8(() => {
4483
4973
  mounted.current = true;
4484
4974
  return () => {
4485
4975
  mounted.current = false;
@@ -4503,7 +4993,7 @@ function useBillLifecycle({
4503
4993
  }
4504
4994
  }
4505
4995
  }, [client, enabled]);
4506
- useEffect7(() => {
4996
+ useEffect8(() => {
4507
4997
  if (!enabled) return;
4508
4998
  void refresh();
4509
4999
  const interval = refreshInterval > 0 ? window.setInterval(() => void refresh(), refreshInterval) : null;
@@ -4568,7 +5058,7 @@ function useBillLifecycle({
4568
5058
  }
4569
5059
  function LifecycleDialog({ children, title, onClose }) {
4570
5060
  const dialog = useRef5(null);
4571
- useEffect7(() => {
5061
+ useEffect8(() => {
4572
5062
  const previous = document.activeElement;
4573
5063
  dialog.current?.focus();
4574
5064
  const onKeyDown = (event) => event.key === "Escape" && onClose();
@@ -4578,8 +5068,8 @@ function LifecycleDialog({ children, title, onClose }) {
4578
5068
  previous?.focus();
4579
5069
  };
4580
5070
  }, [onClose]);
4581
- return /* @__PURE__ */ jsx10("div", { className: "mb-lifecycle-dialog-backdrop", onMouseDown: (event) => event.currentTarget === event.target && onClose(), children: /* @__PURE__ */ jsxs10("div", { ref: dialog, className: "mb-lifecycle-dialog", role: "dialog", "aria-modal": "true", "aria-label": title, tabIndex: -1, children: [
4582
- /* @__PURE__ */ jsx10("button", { type: "button", className: "mb-lifecycle-dialog-close", "aria-label": "Close", onClick: onClose, children: "\xD7" }),
5071
+ return /* @__PURE__ */ jsx13("div", { className: "mb-lifecycle-dialog-backdrop", onMouseDown: (event) => event.currentTarget === event.target && onClose(), children: /* @__PURE__ */ jsxs13("div", { ref: dialog, className: "mb-lifecycle-dialog", role: "dialog", "aria-modal": "true", "aria-label": title, tabIndex: -1, children: [
5072
+ /* @__PURE__ */ jsx13("button", { type: "button", className: "mb-lifecycle-dialog-close", "aria-label": "Close", onClick: onClose, children: "\xD7" }),
4583
5073
  children
4584
5074
  ] }) });
4585
5075
  }
@@ -4612,14 +5102,14 @@ function shouldShowSandboxControls(environment, enabled = false) {
4612
5102
  function ConnectedBillLifecycle({ appearance, sandboxControls = false, className, style, loadingFallback, errorFallback, onChanged, ...options }) {
4613
5103
  const lifecycle = useBillLifecycle(options);
4614
5104
  const { data } = lifecycle;
4615
- const [tab, setTab] = useState9("details");
4616
- const [panel, setPanel] = useState9("");
4617
- const [notice, setNotice] = useState9("");
4618
- const [reason, setReason] = useState9("");
4619
- const [payment, setPayment] = useState9({ amount: 0, penaltyAmount: 0, interestAmount: 0, method: "check", checkNumber: "", depositDate: today(), note: "" });
4620
- const [review, setReview] = useState9({ reason: "", payerClaimControlNumber: "", disputedAmount: void 0, attachmentIds: [], route: "ebill" });
5105
+ const [tab, setTab] = useState10("details");
5106
+ const [panel, setPanel] = useState10("");
5107
+ const [notice, setNotice] = useState10("");
5108
+ const [reason, setReason] = useState10("");
5109
+ const [payment, setPayment] = useState10({ amount: 0, penaltyAmount: 0, interestAmount: 0, method: "check", checkNumber: "", depositDate: today(), note: "" });
5110
+ const [review, setReview] = useState10({ reason: "", payerClaimControlNumber: "", disputedAmount: void 0, attachmentIds: [], route: "ebill" });
4621
5111
  const lastData = useRef5(null);
4622
- useEffect7(() => {
5112
+ useEffect8(() => {
4623
5113
  if (!data || data === lastData.current) return;
4624
5114
  lastData.current = data;
4625
5115
  onChanged?.(data);
@@ -4636,13 +5126,13 @@ function ConnectedBillLifecycle({ appearance, sandboxControls = false, className
4636
5126
  attachmentIds: current.attachmentIds.length ? current.attachmentIds.filter((id) => data.bill.attachments.some((document2) => document2.id === id)) : data.bill.attachments.map((document2) => document2.id)
4637
5127
  }));
4638
5128
  }, [data, onChanged]);
4639
- if (lifecycle.isLoading && !data) return /* @__PURE__ */ jsx10(Fragment7, { children: loadingFallback ?? /* @__PURE__ */ jsx10("div", { className: "mb-lifecycle-loading", children: "Loading bill\u2026" }) });
5129
+ if (lifecycle.isLoading && !data) return /* @__PURE__ */ jsx13(Fragment9, { children: loadingFallback ?? /* @__PURE__ */ jsx13("div", { className: "mb-lifecycle-loading", children: "Loading bill\u2026" }) });
4640
5130
  if (!data) {
4641
5131
  const error = lifecycle.error ?? new Error("Bill could not be loaded.");
4642
- return /* @__PURE__ */ jsx10(Fragment7, { children: errorFallback?.(error, lifecycle.refresh) ?? /* @__PURE__ */ jsxs10("div", { className: "mb-lifecycle-error", role: "alert", children: [
4643
- /* @__PURE__ */ jsx10("strong", { children: "Billing is unavailable." }),
4644
- /* @__PURE__ */ jsx10("span", { children: error.message }),
4645
- /* @__PURE__ */ jsx10("button", { type: "button", onClick: () => void lifecycle.refresh(), children: "Try again" })
5132
+ return /* @__PURE__ */ jsx13(Fragment9, { children: errorFallback?.(error, lifecycle.refresh) ?? /* @__PURE__ */ jsxs13("div", { className: "mb-lifecycle-error", role: "alert", children: [
5133
+ /* @__PURE__ */ jsx13("strong", { children: "Billing is unavailable." }),
5134
+ /* @__PURE__ */ jsx13("span", { children: error.message }),
5135
+ /* @__PURE__ */ jsx13("button", { type: "button", onClick: () => void lifecycle.refresh(), children: "Try again" })
4646
5136
  ] }) });
4647
5137
  }
4648
5138
  const complete = async (message, task) => {
@@ -4660,170 +5150,170 @@ function ConnectedBillLifecycle({ appearance, sandboxControls = false, className
4660
5150
  const actions = data.lifecycle.actions.filter((action) => action.enabled && supportedActions.has(action.id));
4661
5151
  const showSandboxControls = shouldShowSandboxControls(data.environment, sandboxControls);
4662
5152
  const simulations = showSandboxControls ? sandboxScenarios(data.lifecycle.state) : [];
4663
- return /* @__PURE__ */ jsxs10("section", { className: ["mb-connected-lifecycle", className].filter(Boolean).join(" "), style: mindBillAppearanceStyle(appearance, style), children: [
4664
- /* @__PURE__ */ jsx10("style", { children: CONNECTED_LIFECYCLE_STYLES }),
4665
- data.lifecycle.state.toLowerCase() === "rejected" && data.rejection ? /* @__PURE__ */ jsx10(BillRejectionNotice, { rejection: data.rejection, submittedAt: data.lifecycle.submittedAt ?? null, ...appearance ? { appearance } : {} }) : /* @__PURE__ */ jsx10(BillLifecycleProgress, { state: data.lifecycle.state, nativeStatus: data.lifecycle.nativeStatus, submittedAt: data.lifecycle.submittedAt ?? null, agingDays: data.lifecycle.agingDays ?? null, ...appearance ? { appearance } : {} }),
4666
- /* @__PURE__ */ jsxs10("header", { className: "mb-lifecycle-head", children: [
4667
- /* @__PURE__ */ jsxs10("div", { children: [
4668
- /* @__PURE__ */ jsx10("div", { className: "mb-lifecycle-title", children: /* @__PURE__ */ jsxs10("h2", { children: [
5153
+ return /* @__PURE__ */ jsxs13("section", { className: ["mb-connected-lifecycle", className].filter(Boolean).join(" "), style: mindBillAppearanceStyle(appearance, style), children: [
5154
+ /* @__PURE__ */ jsx13("style", { children: CONNECTED_LIFECYCLE_STYLES }),
5155
+ data.lifecycle.state.toLowerCase() === "rejected" && data.rejection ? /* @__PURE__ */ jsx13(BillRejectionNotice, { rejection: data.rejection, submittedAt: data.lifecycle.submittedAt ?? null, ...appearance ? { appearance } : {} }) : /* @__PURE__ */ jsx13(BillLifecycleProgress, { state: data.lifecycle.state, nativeStatus: data.lifecycle.nativeStatus, submittedAt: data.lifecycle.submittedAt ?? null, agingDays: data.lifecycle.agingDays ?? null, ...appearance ? { appearance } : {} }),
5156
+ /* @__PURE__ */ jsxs13("header", { className: "mb-lifecycle-head", children: [
5157
+ /* @__PURE__ */ jsxs13("div", { children: [
5158
+ /* @__PURE__ */ jsx13("div", { className: "mb-lifecycle-title", children: /* @__PURE__ */ jsxs13("h2", { children: [
4669
5159
  "Bill #",
4670
5160
  data.bill.billNumber
4671
5161
  ] }) }),
4672
- /* @__PURE__ */ jsxs10("p", { children: [
5162
+ /* @__PURE__ */ jsxs13("p", { children: [
4673
5163
  "Claim ",
4674
5164
  data.injury.claimNumber || "\u2014",
4675
5165
  lifecycle.isRefreshing ? " \xB7 Refreshing\u2026" : ""
4676
5166
  ] })
4677
5167
  ] }),
4678
- /* @__PURE__ */ jsx10("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating, onClick: () => void lifecycle.downloadPacket().catch(() => void 0), children: "Download packet" })
5168
+ /* @__PURE__ */ jsx13("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating, onClick: () => void lifecycle.downloadPacket().catch(() => void 0), children: "Download packet" })
4679
5169
  ] }),
4680
- /* @__PURE__ */ jsxs10("div", { className: "mb-lifecycle-tabs", role: "tablist", "aria-label": "Bill view", children: [
4681
- /* @__PURE__ */ jsx10("button", { type: "button", role: "tab", "aria-selected": tab === "details", onClick: () => setTab("details"), children: "Bill details" }),
4682
- /* @__PURE__ */ jsx10("button", { type: "button", role: "tab", "aria-selected": tab === "history", onClick: () => setTab("history"), children: "Bill history" })
5170
+ /* @__PURE__ */ jsxs13("div", { className: "mb-lifecycle-tabs", role: "tablist", "aria-label": "Bill view", children: [
5171
+ /* @__PURE__ */ jsx13("button", { type: "button", role: "tab", "aria-selected": tab === "details", onClick: () => setTab("details"), children: "Bill details" }),
5172
+ /* @__PURE__ */ jsx13("button", { type: "button", role: "tab", "aria-selected": tab === "history", onClick: () => setTab("history"), children: "Bill history" })
4683
5173
  ] }),
4684
- tab === "details" ? /* @__PURE__ */ jsxs10("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: [
4685
- data.eors.length || data.payments.length || ["processed", "denied", "partially_paid"].includes(data.lifecycle.state) ? /* @__PURE__ */ jsx10(BillExplanationOfReview, { remittance: data.remittance, eors: data.eors, payments: data.payments, submittedAt: data.lifecycle.submittedAt ?? null, onOpenEor: lifecycle.openEor, ...appearance ? { appearance } : {} }) : null,
4686
- showSandboxControls ? /* @__PURE__ */ jsxs10("section", { className: "mb-lifecycle-simulator", "aria-label": "Sandbox lifecycle simulator", children: [
4687
- /* @__PURE__ */ jsxs10("div", { children: [
4688
- /* @__PURE__ */ jsx10("span", { children: "Sandbox demo controls" }),
4689
- /* @__PURE__ */ jsx10("h3", { children: "Simulate the next payer response" }),
4690
- /* @__PURE__ */ jsx10("p", { children: "This changes sandbox data only. The host receives the result through the same lifecycle API and components partners use." })
5174
+ tab === "details" ? /* @__PURE__ */ jsxs13("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: [
5175
+ data.eors.length || data.payments.length || ["processed", "denied", "partially_paid"].includes(data.lifecycle.state) ? /* @__PURE__ */ jsx13(BillExplanationOfReview, { remittance: data.remittance, eors: data.eors, payments: data.payments, submittedAt: data.lifecycle.submittedAt ?? null, onOpenEor: lifecycle.openEor, ...appearance ? { appearance } : {} }) : null,
5176
+ showSandboxControls ? /* @__PURE__ */ jsxs13("section", { className: "mb-lifecycle-simulator", "aria-label": "Sandbox lifecycle simulator", children: [
5177
+ /* @__PURE__ */ jsxs13("div", { children: [
5178
+ /* @__PURE__ */ jsx13("span", { children: "Sandbox demo controls" }),
5179
+ /* @__PURE__ */ jsx13("h3", { children: "Simulate the next payer response" }),
5180
+ /* @__PURE__ */ jsx13("p", { children: "This changes sandbox data only. The host receives the result through the same lifecycle API and components partners use." })
4691
5181
  ] }),
4692
- simulations.length ? /* @__PURE__ */ jsx10("div", { className: "mb-lifecycle-simulator-actions", children: simulations.map((scenario) => /* @__PURE__ */ jsxs10("button", { type: "button", disabled: lifecycle.isMutating, onClick: () => void complete(`${scenario.label} simulated.`, () => lifecycle.simulateSandbox({ scenario: scenario.id })), children: [
4693
- /* @__PURE__ */ jsx10("strong", { children: scenario.label }),
4694
- /* @__PURE__ */ jsx10("span", { children: scenario.detail })
4695
- ] }, scenario.id)) }) : /* @__PURE__ */ jsx10("p", { className: "mb-lifecycle-simulator-idle", children: "No simulated payer transition is needed at this stage. Use the bill action below to continue." })
5182
+ simulations.length ? /* @__PURE__ */ jsx13("div", { className: "mb-lifecycle-simulator-actions", children: simulations.map((scenario) => /* @__PURE__ */ jsxs13("button", { type: "button", disabled: lifecycle.isMutating, onClick: () => void complete(`${scenario.label} simulated.`, () => lifecycle.simulateSandbox({ scenario: scenario.id })), children: [
5183
+ /* @__PURE__ */ jsx13("strong", { children: scenario.label }),
5184
+ /* @__PURE__ */ jsx13("span", { children: scenario.detail })
5185
+ ] }, scenario.id)) }) : /* @__PURE__ */ jsx13("p", { className: "mb-lifecycle-simulator-idle", children: "No simulated payer transition is needed at this stage. Use the bill action below to continue." })
4696
5186
  ] }) : null,
4697
- /* @__PURE__ */ jsx10(BillReadOnlyForm, { data, onOpenAttachment: lifecycle.openAttachment, ...appearance ? { appearance } : {} })
4698
- ] }) : /* @__PURE__ */ jsx10("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: data.history?.length ? /* @__PURE__ */ jsx10(BillHistoryTable, { entries: data.history, ...appearance ? { appearance } : {} }) : /* @__PURE__ */ jsx10(BillActivityTimeline, { events: data.activity, ...appearance ? { appearance } : {} }) }),
4699
- viewEor || actions.length ? /* @__PURE__ */ jsxs10("aside", { className: "mb-lifecycle-actions-sheet", "aria-label": "Bill actions", children: [
4700
- viewEor && data.eors[0] ? /* @__PURE__ */ jsx10("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => void lifecycle.openEor(data.eors[0]).catch(() => void 0), children: viewEor.label }) : null,
4701
- actions.map((action) => /* @__PURE__ */ jsx10("button", { type: "button", className: action.primary ? "mb-lifecycle-button primary" : "mb-lifecycle-button secondary", onClick: () => {
5187
+ /* @__PURE__ */ jsx13(BillReadOnlyForm, { data, onOpenAttachment: lifecycle.openAttachment, ...appearance ? { appearance } : {} })
5188
+ ] }) : /* @__PURE__ */ jsx13("div", { className: "mb-lifecycle-tabpanel", role: "tabpanel", children: data.history?.length ? /* @__PURE__ */ jsx13(BillHistoryTable, { entries: data.history, ...appearance ? { appearance } : {} }) : /* @__PURE__ */ jsx13(BillActivityTimeline, { events: data.activity, ...appearance ? { appearance } : {} }) }),
5189
+ viewEor || actions.length ? /* @__PURE__ */ jsxs13("aside", { className: "mb-lifecycle-actions-sheet", "aria-label": "Bill actions", children: [
5190
+ viewEor && data.eors[0] ? /* @__PURE__ */ jsx13("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => void lifecycle.openEor(data.eors[0]).catch(() => void 0), children: viewEor.label }) : null,
5191
+ actions.map((action) => /* @__PURE__ */ jsx13("button", { type: "button", className: action.primary ? "mb-lifecycle-button primary" : "mb-lifecycle-button secondary", onClick: () => {
4702
5192
  const next = actionPanel(action);
4703
5193
  if (next) setPanel(next);
4704
5194
  }, children: action.label }, action.id))
4705
5195
  ] }) : null,
4706
- panel === "resubmit" ? /* @__PURE__ */ jsx10(LifecycleDialog, { title: "Correct and resubmit", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs10("section", { className: "mb-lifecycle-panel", children: [
4707
- /* @__PURE__ */ jsxs10("div", { children: [
4708
- /* @__PURE__ */ jsx10("h3", { children: "Correct and resubmit" }),
4709
- /* @__PURE__ */ jsx10("p", { children: "The original submission remains immutable. This records a new submission attempt after the routing issue is corrected." })
5196
+ panel === "resubmit" ? /* @__PURE__ */ jsx13(LifecycleDialog, { title: "Correct and resubmit", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs13("section", { className: "mb-lifecycle-panel", children: [
5197
+ /* @__PURE__ */ jsxs13("div", { children: [
5198
+ /* @__PURE__ */ jsx13("h3", { children: "Correct and resubmit" }),
5199
+ /* @__PURE__ */ jsx13("p", { children: "The original submission remains immutable. This records a new submission attempt after the routing issue is corrected." })
4710
5200
  ] }),
4711
- /* @__PURE__ */ jsxs10("label", { children: [
4712
- /* @__PURE__ */ jsx10("span", { children: "Correction note (optional)" }),
4713
- /* @__PURE__ */ jsx10("textarea", { value: reason, placeholder: "What changed before resubmission?", onChange: (event) => setReason(event.target.value) })
5201
+ /* @__PURE__ */ jsxs13("label", { children: [
5202
+ /* @__PURE__ */ jsx13("span", { children: "Correction note (optional)" }),
5203
+ /* @__PURE__ */ jsx13("textarea", { value: reason, placeholder: "What changed before resubmission?", onChange: (event) => setReason(event.target.value) })
4714
5204
  ] }),
4715
- /* @__PURE__ */ jsxs10("div", { className: "mb-lifecycle-panel-actions", children: [
4716
- /* @__PURE__ */ jsx10("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
4717
- /* @__PURE__ */ jsx10("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating, onClick: () => void complete("Bill resubmitted.", () => lifecycle.resubmitBill({ reason })), children: lifecycle.isMutating ? "Resubmitting\u2026" : "Resubmit bill" })
5205
+ /* @__PURE__ */ jsxs13("div", { className: "mb-lifecycle-panel-actions", children: [
5206
+ /* @__PURE__ */ jsx13("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
5207
+ /* @__PURE__ */ jsx13("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating, onClick: () => void complete("Bill resubmitted.", () => lifecycle.resubmitBill({ reason })), children: lifecycle.isMutating ? "Resubmitting\u2026" : "Resubmit bill" })
4718
5208
  ] })
4719
5209
  ] }) }) : null,
4720
- panel === "second_review" ? /* @__PURE__ */ jsx10(LifecycleDialog, { title: "Submit Second Review", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs10("section", { className: "mb-lifecycle-panel", children: [
4721
- /* @__PURE__ */ jsxs10("div", { children: [
4722
- /* @__PURE__ */ jsx10("h3", { children: "Submit Second Review" }),
4723
- /* @__PURE__ */ jsx10("p", { children: "Explain the dispute and include the payer control number and supporting documents." })
5210
+ panel === "second_review" ? /* @__PURE__ */ jsx13(LifecycleDialog, { title: "Submit Second Review", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs13("section", { className: "mb-lifecycle-panel", children: [
5211
+ /* @__PURE__ */ jsxs13("div", { children: [
5212
+ /* @__PURE__ */ jsx13("h3", { children: "Submit Second Review" }),
5213
+ /* @__PURE__ */ jsx13("p", { children: "Explain the dispute and include the payer control number and supporting documents." })
4724
5214
  ] }),
4725
- /* @__PURE__ */ jsxs10("div", { className: "mb-lifecycle-fields two", children: [
4726
- /* @__PURE__ */ jsxs10("label", { className: "full", children: [
4727
- /* @__PURE__ */ jsx10("span", { children: "Reason" }),
4728
- /* @__PURE__ */ jsx10("textarea", { required: true, value: review.reason, onChange: (event) => setReview((current) => ({ ...current, reason: event.target.value })) })
5215
+ /* @__PURE__ */ jsxs13("div", { className: "mb-lifecycle-fields two", children: [
5216
+ /* @__PURE__ */ jsxs13("label", { className: "full", children: [
5217
+ /* @__PURE__ */ jsx13("span", { children: "Reason" }),
5218
+ /* @__PURE__ */ jsx13("textarea", { required: true, value: review.reason, onChange: (event) => setReview((current) => ({ ...current, reason: event.target.value })) })
4729
5219
  ] }),
4730
- /* @__PURE__ */ jsxs10("label", { children: [
4731
- /* @__PURE__ */ jsx10("span", { children: "Payer claim control number" }),
4732
- /* @__PURE__ */ jsx10("input", { required: true, value: review.payerClaimControlNumber, onChange: (event) => setReview((current) => ({ ...current, payerClaimControlNumber: event.target.value })) })
5220
+ /* @__PURE__ */ jsxs13("label", { children: [
5221
+ /* @__PURE__ */ jsx13("span", { children: "Payer claim control number" }),
5222
+ /* @__PURE__ */ jsx13("input", { required: true, value: review.payerClaimControlNumber, onChange: (event) => setReview((current) => ({ ...current, payerClaimControlNumber: event.target.value })) })
4733
5223
  ] }),
4734
- /* @__PURE__ */ jsxs10("label", { children: [
4735
- /* @__PURE__ */ jsx10("span", { children: "Disputed amount" }),
4736
- /* @__PURE__ */ jsx10("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 })) })
5224
+ /* @__PURE__ */ jsxs13("label", { children: [
5225
+ /* @__PURE__ */ jsx13("span", { children: "Disputed amount" }),
5226
+ /* @__PURE__ */ jsx13("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 })) })
4737
5227
  ] }),
4738
- /* @__PURE__ */ jsxs10("label", { children: [
4739
- /* @__PURE__ */ jsx10("span", { children: "Send via" }),
4740
- /* @__PURE__ */ jsxs10("select", { value: review.route, onChange: (event) => setReview((current) => ({ ...current, route: event.target.value })), children: [
4741
- /* @__PURE__ */ jsx10("option", { value: "ebill", children: "E-bill" }),
4742
- /* @__PURE__ */ jsx10("option", { value: "fax", children: "Fax" }),
4743
- /* @__PURE__ */ jsx10("option", { value: "mail", children: "Mail" }),
4744
- /* @__PURE__ */ jsx10("option", { value: "email", children: "Email" })
5228
+ /* @__PURE__ */ jsxs13("label", { children: [
5229
+ /* @__PURE__ */ jsx13("span", { children: "Send via" }),
5230
+ /* @__PURE__ */ jsxs13("select", { value: review.route, onChange: (event) => setReview((current) => ({ ...current, route: event.target.value })), children: [
5231
+ /* @__PURE__ */ jsx13("option", { value: "ebill", children: "E-bill" }),
5232
+ /* @__PURE__ */ jsx13("option", { value: "fax", children: "Fax" }),
5233
+ /* @__PURE__ */ jsx13("option", { value: "mail", children: "Mail" }),
5234
+ /* @__PURE__ */ jsx13("option", { value: "email", children: "Email" })
4745
5235
  ] })
4746
5236
  ] })
4747
5237
  ] }),
4748
- /* @__PURE__ */ jsxs10("fieldset", { className: "mb-lifecycle-packet", children: [
4749
- /* @__PURE__ */ jsx10("legend", { children: "Supporting packet" }),
4750
- data.bill.attachments.map((attachment) => /* @__PURE__ */ jsxs10("label", { children: [
4751
- /* @__PURE__ */ jsx10("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) })) }),
4752
- /* @__PURE__ */ jsxs10("span", { children: [
4753
- /* @__PURE__ */ jsx10("strong", { children: attachment.filename }),
4754
- /* @__PURE__ */ jsx10("small", { children: attachment.description || attachment.documentType })
5238
+ /* @__PURE__ */ jsxs13("fieldset", { className: "mb-lifecycle-packet", children: [
5239
+ /* @__PURE__ */ jsx13("legend", { children: "Supporting packet" }),
5240
+ data.bill.attachments.map((attachment) => /* @__PURE__ */ jsxs13("label", { children: [
5241
+ /* @__PURE__ */ jsx13("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) })) }),
5242
+ /* @__PURE__ */ jsxs13("span", { children: [
5243
+ /* @__PURE__ */ jsx13("strong", { children: attachment.filename }),
5244
+ /* @__PURE__ */ jsx13("small", { children: attachment.description || attachment.documentType })
4755
5245
  ] }),
4756
- /* @__PURE__ */ jsx10("button", { type: "button", onClick: () => void lifecycle.openAttachment(attachment).catch(() => void 0), children: "View" })
5246
+ /* @__PURE__ */ jsx13("button", { type: "button", onClick: () => void lifecycle.openAttachment(attachment).catch(() => void 0), children: "View" })
4757
5247
  ] }, attachment.id))
4758
5248
  ] }),
4759
- /* @__PURE__ */ jsxs10("div", { className: "mb-lifecycle-panel-actions", children: [
4760
- /* @__PURE__ */ jsx10("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
4761
- /* @__PURE__ */ jsx10("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" })
5249
+ /* @__PURE__ */ jsxs13("div", { className: "mb-lifecycle-panel-actions", children: [
5250
+ /* @__PURE__ */ jsx13("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
5251
+ /* @__PURE__ */ jsx13("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" })
4762
5252
  ] })
4763
5253
  ] }) }) : null,
4764
- panel === "payment" ? /* @__PURE__ */ jsx10(LifecycleDialog, { title: "Post payment", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs10("section", { className: "mb-lifecycle-panel", children: [
4765
- /* @__PURE__ */ jsxs10("div", { children: [
4766
- /* @__PURE__ */ jsx10("h3", { children: "Post payment" }),
4767
- /* @__PURE__ */ jsx10("p", { children: "Record a full or partial payment, plus any penalty and interest received." })
5254
+ panel === "payment" ? /* @__PURE__ */ jsx13(LifecycleDialog, { title: "Post payment", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs13("section", { className: "mb-lifecycle-panel", children: [
5255
+ /* @__PURE__ */ jsxs13("div", { children: [
5256
+ /* @__PURE__ */ jsx13("h3", { children: "Post payment" }),
5257
+ /* @__PURE__ */ jsx13("p", { children: "Record a full or partial payment, plus any penalty and interest received." })
4768
5258
  ] }),
4769
- /* @__PURE__ */ jsxs10("div", { className: "mb-lifecycle-fields two", children: [
4770
- /* @__PURE__ */ jsxs10("label", { children: [
4771
- /* @__PURE__ */ jsx10("span", { children: "Amount applied to bill" }),
4772
- /* @__PURE__ */ jsx10("input", { type: "number", min: "0.01", max: data.bill.balanceDue, step: "0.01", value: payment.amount || "", onChange: (event) => setPayment((current) => ({ ...current, amount: Number(event.target.value) })) })
5259
+ /* @__PURE__ */ jsxs13("div", { className: "mb-lifecycle-fields two", children: [
5260
+ /* @__PURE__ */ jsxs13("label", { children: [
5261
+ /* @__PURE__ */ jsx13("span", { children: "Amount applied to bill" }),
5262
+ /* @__PURE__ */ jsx13("input", { type: "number", min: "0.01", max: data.bill.balanceDue, step: "0.01", value: payment.amount || "", onChange: (event) => setPayment((current) => ({ ...current, amount: Number(event.target.value) })) })
4773
5263
  ] }),
4774
- /* @__PURE__ */ jsxs10("label", { children: [
4775
- /* @__PURE__ */ jsx10("span", { children: "Penalty" }),
4776
- /* @__PURE__ */ jsx10("input", { type: "number", min: "0", step: "0.01", value: payment.penaltyAmount || "", placeholder: "0.00", onChange: (event) => setPayment((current) => ({ ...current, penaltyAmount: Number(event.target.value) })) })
5264
+ /* @__PURE__ */ jsxs13("label", { children: [
5265
+ /* @__PURE__ */ jsx13("span", { children: "Penalty" }),
5266
+ /* @__PURE__ */ jsx13("input", { type: "number", min: "0", step: "0.01", value: payment.penaltyAmount || "", placeholder: "0.00", onChange: (event) => setPayment((current) => ({ ...current, penaltyAmount: Number(event.target.value) })) })
4777
5267
  ] }),
4778
- /* @__PURE__ */ jsxs10("label", { children: [
4779
- /* @__PURE__ */ jsx10("span", { children: "Interest" }),
4780
- /* @__PURE__ */ jsx10("input", { type: "number", min: "0", step: "0.01", value: payment.interestAmount || "", placeholder: "0.00", onChange: (event) => setPayment((current) => ({ ...current, interestAmount: Number(event.target.value) })) })
5268
+ /* @__PURE__ */ jsxs13("label", { children: [
5269
+ /* @__PURE__ */ jsx13("span", { children: "Interest" }),
5270
+ /* @__PURE__ */ jsx13("input", { type: "number", min: "0", step: "0.01", value: payment.interestAmount || "", placeholder: "0.00", onChange: (event) => setPayment((current) => ({ ...current, interestAmount: Number(event.target.value) })) })
4781
5271
  ] }),
4782
- /* @__PURE__ */ jsxs10("label", { children: [
4783
- /* @__PURE__ */ jsx10("span", { children: "Method" }),
4784
- /* @__PURE__ */ jsxs10("select", { value: payment.method, onChange: (event) => setPayment((current) => ({ ...current, method: event.target.value })), children: [
4785
- /* @__PURE__ */ jsx10("option", { value: "check", children: "Check" }),
4786
- /* @__PURE__ */ jsx10("option", { value: "eft", children: "EFT" })
5272
+ /* @__PURE__ */ jsxs13("label", { children: [
5273
+ /* @__PURE__ */ jsx13("span", { children: "Method" }),
5274
+ /* @__PURE__ */ jsxs13("select", { value: payment.method, onChange: (event) => setPayment((current) => ({ ...current, method: event.target.value })), children: [
5275
+ /* @__PURE__ */ jsx13("option", { value: "check", children: "Check" }),
5276
+ /* @__PURE__ */ jsx13("option", { value: "eft", children: "EFT" })
4787
5277
  ] })
4788
5278
  ] }),
4789
- /* @__PURE__ */ jsxs10("label", { children: [
4790
- /* @__PURE__ */ jsx10("span", { children: payment.method === "check" ? "Check number" : "EFT reference" }),
4791
- /* @__PURE__ */ jsx10("input", { value: payment.checkNumber, onChange: (event) => setPayment((current) => ({ ...current, checkNumber: event.target.value })) })
5279
+ /* @__PURE__ */ jsxs13("label", { children: [
5280
+ /* @__PURE__ */ jsx13("span", { children: payment.method === "check" ? "Check number" : "EFT reference" }),
5281
+ /* @__PURE__ */ jsx13("input", { value: payment.checkNumber, onChange: (event) => setPayment((current) => ({ ...current, checkNumber: event.target.value })) })
4792
5282
  ] }),
4793
- /* @__PURE__ */ jsxs10("label", { children: [
4794
- /* @__PURE__ */ jsx10("span", { children: "Deposit date" }),
4795
- /* @__PURE__ */ jsx10("input", { required: true, value: payment.depositDate, placeholder: "MM/DD/YYYY", onChange: (event) => setPayment((current) => ({ ...current, depositDate: event.target.value })) })
5283
+ /* @__PURE__ */ jsxs13("label", { children: [
5284
+ /* @__PURE__ */ jsx13("span", { children: "Deposit date" }),
5285
+ /* @__PURE__ */ jsx13("input", { required: true, value: payment.depositDate, placeholder: "MM/DD/YYYY", onChange: (event) => setPayment((current) => ({ ...current, depositDate: event.target.value })) })
4796
5286
  ] }),
4797
- /* @__PURE__ */ jsxs10("label", { className: "full", children: [
4798
- /* @__PURE__ */ jsx10("span", { children: "Note (optional)" }),
4799
- /* @__PURE__ */ jsx10("input", { value: payment.note, onChange: (event) => setPayment((current) => ({ ...current, note: event.target.value })) })
5287
+ /* @__PURE__ */ jsxs13("label", { className: "full", children: [
5288
+ /* @__PURE__ */ jsx13("span", { children: "Note (optional)" }),
5289
+ /* @__PURE__ */ jsx13("input", { value: payment.note, onChange: (event) => setPayment((current) => ({ ...current, note: event.target.value })) })
4800
5290
  ] })
4801
5291
  ] }),
4802
- /* @__PURE__ */ jsxs10("div", { className: "mb-payment-total", children: [
4803
- /* @__PURE__ */ jsx10("span", { children: "Total received" }),
4804
- /* @__PURE__ */ jsx10("strong", { children: new Intl.NumberFormat(void 0, { style: "currency", currency: "USD" }).format(payment.amount + (payment.penaltyAmount ?? 0) + (payment.interestAmount ?? 0)) })
5292
+ /* @__PURE__ */ jsxs13("div", { className: "mb-payment-total", children: [
5293
+ /* @__PURE__ */ jsx13("span", { children: "Total received" }),
5294
+ /* @__PURE__ */ jsx13("strong", { children: new Intl.NumberFormat(void 0, { style: "currency", currency: "USD" }).format(payment.amount + (payment.penaltyAmount ?? 0) + (payment.interestAmount ?? 0)) })
4805
5295
  ] }),
4806
- /* @__PURE__ */ jsxs10("div", { className: "mb-lifecycle-panel-actions", children: [
4807
- /* @__PURE__ */ jsx10("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
4808
- /* @__PURE__ */ jsx10("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || payment.amount <= 0 || payment.amount > data.bill.balanceDue || (payment.penaltyAmount ?? 0) < 0 || (payment.interestAmount ?? 0) < 0 || !payment.depositDate, onClick: () => void complete("Payment posted.", () => lifecycle.postPayment(payment)), children: lifecycle.isMutating ? "Posting\u2026" : "Post payment" })
5296
+ /* @__PURE__ */ jsxs13("div", { className: "mb-lifecycle-panel-actions", children: [
5297
+ /* @__PURE__ */ jsx13("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
5298
+ /* @__PURE__ */ jsx13("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || payment.amount <= 0 || payment.amount > data.bill.balanceDue || (payment.penaltyAmount ?? 0) < 0 || (payment.interestAmount ?? 0) < 0 || !payment.depositDate, onClick: () => void complete("Payment posted.", () => lifecycle.postPayment(payment)), children: lifecycle.isMutating ? "Posting\u2026" : "Post payment" })
4809
5299
  ] })
4810
5300
  ] }) }) : null,
4811
- panel === "close" || panel === "reopen" ? /* @__PURE__ */ jsx10(LifecycleDialog, { title: panel === "close" ? "Close bill" : "Reopen bill", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs10("section", { className: "mb-lifecycle-panel", children: [
4812
- /* @__PURE__ */ jsxs10("div", { children: [
4813
- /* @__PURE__ */ jsx10("h3", { children: panel === "close" ? "Close bill" : "Reopen bill" }),
4814
- /* @__PURE__ */ jsx10("p", { children: panel === "close" ? "The immutable submission and history remain available." : "Return this bill to active follow-up without changing the submitted snapshot." })
5301
+ panel === "close" || panel === "reopen" ? /* @__PURE__ */ jsx13(LifecycleDialog, { title: panel === "close" ? "Close bill" : "Reopen bill", onClose: () => setPanel(""), children: /* @__PURE__ */ jsxs13("section", { className: "mb-lifecycle-panel", children: [
5302
+ /* @__PURE__ */ jsxs13("div", { children: [
5303
+ /* @__PURE__ */ jsx13("h3", { children: panel === "close" ? "Close bill" : "Reopen bill" }),
5304
+ /* @__PURE__ */ jsx13("p", { children: panel === "close" ? "The immutable submission and history remain available." : "Return this bill to active follow-up without changing the submitted snapshot." })
4815
5305
  ] }),
4816
- /* @__PURE__ */ jsxs10("label", { children: [
4817
- /* @__PURE__ */ jsx10("span", { children: "Reason" }),
4818
- /* @__PURE__ */ jsx10("textarea", { required: true, value: reason, onChange: (event) => setReason(event.target.value) })
5306
+ /* @__PURE__ */ jsxs13("label", { children: [
5307
+ /* @__PURE__ */ jsx13("span", { children: "Reason" }),
5308
+ /* @__PURE__ */ jsx13("textarea", { required: true, value: reason, onChange: (event) => setReason(event.target.value) })
4819
5309
  ] }),
4820
- /* @__PURE__ */ jsxs10("div", { className: "mb-lifecycle-panel-actions", children: [
4821
- /* @__PURE__ */ jsx10("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
4822
- /* @__PURE__ */ jsx10("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || !reason.trim(), onClick: () => void complete(panel === "close" ? "Bill closed." : "Bill reopened.", () => panel === "close" ? lifecycle.closeBill({ reason }) : lifecycle.reopenBill({ reason })), children: lifecycle.isMutating ? "Saving\u2026" : panel === "close" ? "Close bill" : "Reopen bill" })
5310
+ /* @__PURE__ */ jsxs13("div", { className: "mb-lifecycle-panel-actions", children: [
5311
+ /* @__PURE__ */ jsx13("button", { type: "button", className: "mb-lifecycle-button secondary", onClick: () => setPanel(""), children: "Cancel" }),
5312
+ /* @__PURE__ */ jsx13("button", { type: "button", className: "mb-lifecycle-button primary", disabled: lifecycle.isMutating || !reason.trim(), onClick: () => void complete(panel === "close" ? "Bill closed." : "Bill reopened.", () => panel === "close" ? lifecycle.closeBill({ reason }) : lifecycle.reopenBill({ reason })), children: lifecycle.isMutating ? "Saving\u2026" : panel === "close" ? "Close bill" : "Reopen bill" })
4823
5313
  ] })
4824
5314
  ] }) }) : null,
4825
- notice ? /* @__PURE__ */ jsx10("div", { className: "mb-lifecycle-message success", role: "status", children: notice }) : null,
4826
- lifecycle.error ? /* @__PURE__ */ jsx10("div", { className: "mb-lifecycle-message error", role: "alert", children: lifecycle.error.message }) : null
5315
+ notice ? /* @__PURE__ */ jsx13("div", { className: "mb-lifecycle-message success", role: "status", children: notice }) : null,
5316
+ lifecycle.error ? /* @__PURE__ */ jsx13("div", { className: "mb-lifecycle-message error", role: "alert", children: lifecycle.error.message }) : null
4827
5317
  ] });
4828
5318
  }
4829
5319
  var CONNECTED_LIFECYCLE_STYLES = `
@@ -4837,7 +5327,7 @@ var CONNECTED_LIFECYCLE_STYLES = `
4837
5327
  function widget(tagName, props) {
4838
5328
  const ref = useRef6(null);
4839
5329
  const { onMindBill, onMindBillError } = props;
4840
- useEffect8(() => {
5330
+ useEffect9(() => {
4841
5331
  const element = ref.current;
4842
5332
  if (!element) return;
4843
5333
  const handleEvent = (event) => onMindBill?.(event);
@@ -4879,6 +5369,7 @@ export {
4879
5369
  BILL_SUBMISSION_DOCUMENT_TYPES,
4880
5370
  BILL_SUBMISSION_REPORT_TYPES,
4881
5371
  BILL_SUBMISSION_REQUIRED_FIELDS,
5372
+ BILL_TASKS_AGING_BUCKETS2 as BILL_TASKS_AGING_BUCKETS,
4882
5373
  BillActivityTimeline,
4883
5374
  BillAgingSummary,
4884
5375
  BillExplanationOfReview,
@@ -4903,6 +5394,8 @@ export {
4903
5394
  BillSubmissionPatientSection,
4904
5395
  BillSubmissionProvidersSection,
4905
5396
  BillSubmissionServiceLinesSection,
5397
+ BillSubmissionsRibbon,
5398
+ BillTasksDashboard,
4906
5399
  BillingDashboard,
4907
5400
  BillingReport,
4908
5401
  BillingSettings,
@@ -4916,6 +5409,8 @@ export {
4916
5409
  MindBillBillTimeline,
4917
5410
  OrganizationOnboarding,
4918
5411
  PSYCH_QME_DEFAULT_DIAGNOSIS,
5412
+ REPORT_BILL_STATUS_OPTIONS,
5413
+ ReportBillStatusDialog,
4919
5414
  SendRouteDialog,
4920
5415
  applyBillSubmissionEvaluationDiagnoses,
4921
5416
  applyBillSubmissionEvaluationModifiers,
@@ -4924,9 +5419,13 @@ export {
4924
5419
  billAgingDays,
4925
5420
  billLifecycleDisplayLabel,
4926
5421
  billLifecycleStage,
5422
+ billSubmissionsRibbonDeliveryLabel,
5423
+ billSubmissionsRibbonFromHistory,
5424
+ billTasksAgingBucketIndex,
4927
5425
  buildBillReviewSaveInput,
4928
5426
  buildBillStatusAgingCsv,
4929
5427
  buildBillStatusAgingMatrix,
5428
+ buildBillTasksDashboard,
4930
5429
  buildBillingReportCsv,
4931
5430
  buildBillingReportRows,
4932
5431
  calculateBillSubmissionAllowedAmount,