@mindbill/react 0.31.0 → 0.31.2

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/README.md CHANGED
@@ -8,7 +8,7 @@ npm install @mindbill/react @mindbill/node
8
8
 
9
9
  ## Connected lifecycle
10
10
 
11
- `ConnectedBillLifecycle` starts after `BillSubmissionForm` atomically submits an immutable bill. Its only bill input is `billId`; `getSession` returns the short-lived token. The component fetches the submitted snapshot, progress, human-readable history, EOR/remittance amounts, payments, and available actions from MindBill. Do not pass lifecycle seed data or duplicate this state in the host app. The only persistent header action is **Download packet**; status-dependent actions remain visible in a sticky bottom action bar when MindBill makes them available. Actions that require input open a focused form dialog.
11
+ `ConnectedBillLifecycle` starts after `BillSubmissionForm` atomically submits an immutable bill. Its only bill input is `billId`; `getSession` returns the short-lived token. The component fetches the submitted snapshot, progress, human-readable history, rejection details, EOR/remittance amounts, payments, and available actions from MindBill. Do not pass lifecycle seed data or duplicate this state in the host app. The only persistent header action is **Download packet**, which opens the authenticated PDF packet directly in a new browser tab; status-dependent actions remain visible in a sticky bottom action bar when MindBill makes them available. Actions that require input open a focused form dialog.
12
12
 
13
13
  ```tsx
14
14
  import { ConnectedBillLifecycle } from "@mindbill/react";
@@ -95,6 +95,8 @@ import { BillReadOnlyForm } from "@mindbill/react";
95
95
 
96
96
  `ConnectedBillLifecycle` composes this component with the Details / Bill history switch, so most partners should not assemble these pieces themselves.
97
97
 
98
+ `BillRejectionNotice` is also exported for custom lifecycle layouts. It renders the API-provided rejection reason, acknowledgement code, source, and receipt time as an accessible alert. The connected lifecycle includes it automatically whenever the current state is `rejected`.
99
+
98
100
  ## Lifecycle actions
99
101
 
100
102
  MindBill returns the actions that are valid for the bill's current state. Render that server-authoritative list instead of duplicating rejection, EOR, denial, review, payment, and closure rules in your application.
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { MindBillAppearance, MindBillEventDetail, MindBillErrorDetail } from '@mindbill/embed';
2
2
  export { MindBillAppearance, MindBillErrorDetail, MindBillEventDetail } from '@mindbill/embed';
3
3
  import { CSSProperties, ReactElement, ReactNode } from 'react';
4
- import { BillReviewData as BillReviewData$1, BillLifecycleDelivery, BillReviewAttachment as BillReviewAttachment$1, BrowserBillSubmissionResult, BillLifecycleSessionProvider, BillReviewPayer as BillReviewPayer$1, BrowserBillSubmissionDocument, OrganizationProfileData, BillRemittanceSummary, BillEorDocument, BillPaymentRecord, BillLifecycleAction, BillLifecycleData, BillLifecycleClientOptions, BillLifecycleClient } from '@mindbill/browser';
5
- export { BillActivityRecord, BillClaimsAdministratorContact, BillClaimsAdministratorDirectory, BillClaimsAdministratorMailingAddress, BillClaimsAdministratorPattern, BillEorDocument, BillLifecycleAction, BillLifecycleActionId, BillLifecycleClient, BillLifecycleClientOptions, BillLifecycleData, BillLifecycleDelivery, BillLifecycleSession, BillLifecycleSessionProvider, BillLifecycleSessionRequest, BillPaymentRecord, BillRemittanceSummary, BrowserBillSubmissionResult, CloseBillInput, PostBillPaymentInput, ReopenBillInput, SubmitSecondReviewInput, createBillLifecycleClient } from '@mindbill/browser';
4
+ import { BillReviewData as BillReviewData$1, BillLifecycleDelivery, BillReviewAttachment as BillReviewAttachment$1, BrowserBillSubmissionResult, BillLifecycleSessionProvider, BillReviewPayer as BillReviewPayer$1, BrowserBillSubmissionDocument, OrganizationProfileData, BillRemittanceSummary, BillEorDocument, BillPaymentRecord, BillLifecycleAction, BillRejection, BillLifecycleData, BillLifecycleClientOptions, BillLifecycleClient } from '@mindbill/browser';
5
+ export { BillActivityRecord, BillClaimsAdministratorContact, BillClaimsAdministratorDirectory, BillClaimsAdministratorMailingAddress, BillClaimsAdministratorPattern, BillEorDocument, BillLifecycleAction, BillLifecycleActionId, BillLifecycleClient, BillLifecycleClientOptions, BillLifecycleData, BillLifecycleDelivery, BillLifecycleSession, BillLifecycleSessionProvider, BillLifecycleSessionRequest, BillPaymentRecord, BillRejection, BillRemittanceSummary, BrowserBillSubmissionResult, CloseBillInput, PostBillPaymentInput, ReopenBillInput, SubmitSecondReviewInput, createBillLifecycleClient } from '@mindbill/browser';
6
6
 
7
7
  type MindBillThemePreset = "mindbill" | "qme-companion" | "orange-bright" | "clinical-blue" | "midnight-cyan";
8
8
  type MindBillReactAppearance = MindBillAppearance & {
@@ -865,6 +865,12 @@ type BillLifecycleProgressProps = SurfaceProps & {
865
865
  agingDays?: number | null;
866
866
  };
867
867
  declare function BillLifecycleProgress({ state, nativeStatus, submittedAt, agingDays, appearance, className, style }: BillLifecycleProgressProps): ReactElement;
868
+ type BillRejectionNoticeProps = SurfaceProps & {
869
+ rejection: BillRejection;
870
+ title?: string;
871
+ };
872
+ /** A prominent, end-user-readable explanation of a rejected submission. */
873
+ declare function BillRejectionNotice({ rejection, title, appearance, className, style }: BillRejectionNoticeProps): ReactElement;
868
874
  type BillSnapshotSummaryProps = SurfaceProps & Pick<BillLifecycleData, "bill" | "patient" | "injury" | "delivery">;
869
875
  declare function BillSnapshotSummary({ bill, patient, injury, delivery, appearance, className, style }: BillSnapshotSummaryProps): ReactElement;
870
876
  type BillRemittanceCardProps = SurfaceProps & {
@@ -945,4 +951,4 @@ type MindBillWidgetProps = {
945
951
  declare function MindBillBillTimeline(props: MindBillWidgetProps): ReactElement;
946
952
  declare function MindBillBillReview(props: MindBillWidgetProps): ReactElement;
947
953
 
948
- export { BILL_STATUS_AGING_BUCKETS, BILL_SUBMISSION_DIAGNOSIS_QUICK_PICKS, BILL_SUBMISSION_DOCUMENT_TYPES, BILL_SUBMISSION_REPORT_TYPES, BILL_SUBMISSION_REQUIRED_FIELDS, type BillActivityEvent, BillActivityTimeline, type BillActivityTimelineProps, type BillAgingBucket, type BillAgingBucketId, BillAgingSummary, type BillAgingSummaryProps, BillExplanationOfReview, type BillExplanationOfReviewProps, BillLifecycleActions, type BillLifecycleActionsProps, BillLifecycleProgress, type BillLifecycleProgressProps, type BillLifecycleStage, BillList, type BillListProps, BillPayerContactCard, type BillPayerContactCardProps, BillPaymentLedger, type BillPaymentLedgerProps, BillReadOnlyForm, type BillReadOnlyFormProps, BillRemittanceCard, type BillRemittanceCardProps, type BillReviewAttachment, type BillReviewBillingProvider, type BillReviewClinician, type BillReviewData, type BillReviewDocumentType, type BillReviewDraft, type BillReviewFeatures, BillReviewForm, type BillReviewFormProps, type BillReviewLineItem, type BillReviewLocation, type BillReviewPayer, type BillReviewSaveInput, BillSnapshotSummary, type BillSnapshotSummaryProps, type BillStatusAction, type BillStatusAgingCell, BillStatusAgingMatrix, type BillStatusAgingMatrixData, type BillStatusAgingMatrixProps, type BillStatusAgingRow, type BillStatusClient, type BillStatusClientOptions, type BillStatusData, type BillStatusSession, type BillStatusSessionProvider, type BillStatusSessionRequest, BillStatusSummary, type BillStatusSummaryProps, BillSubmissionActions, type BillSubmissionAddress, type BillSubmissionAttachmentReportTypeMode, BillSubmissionAttachmentsSection, BillSubmissionClaimSection, type BillSubmissionDiagnosisOption, type BillSubmissionDocumentType, type BillSubmissionEvaluationType, BillSubmissionForm, type BillSubmissionFormProps, type BillSubmissionFormValue, BillSubmissionHeader, type BillSubmissionInput, type BillSubmissionModifierOption, BillSubmissionPatientSection, type BillSubmissionPostalPlace, type BillSubmissionProcedureOption, BillSubmissionProvidersSection, type BillSubmissionReportTypeOption, type BillSubmissionRoute, type BillSubmissionSectionId, BillSubmissionServiceLinesSection, type BillSubmissionSourceAttachment, type BillSubmissionTaxonomyOption, type BillSubmissionUpload, type BillSubmissionValidation, type BillingComponentProps, BillingDashboard, type BillingDashboardBill, type BillingDashboardProps, type BillingDashboardSummary, BillingReport, type BillingReportDimension, type BillingReportProps, type BillingReportRow, BillingSettings, ConnectedBillLifecycle, type ConnectedBillLifecycleProps, ConnectedBillStatus, type ConnectedBillStatusProps, DEFAULT_BILL_SUBMISSION_MODIFIERS, DEFAULT_BILL_SUBMISSION_PROCEDURES, DEFAULT_BILL_SUBMISSION_TAXONOMIES, MED_LEGAL_REPORT_TYPE_CODE, MindBillBillReview, MindBillBillTimeline, type MindBillReactAppearance, type MindBillThemePreset, type MindBillWidgetProps, OrganizationOnboarding, type OrganizationOnboardingProps, PSYCH_QME_DEFAULT_DIAGNOSIS, type UseBillLifecycleOptions, type UseBillLifecycleResult, type UseBillStatusOptions, type UseBillStatusResult, applyBillSubmissionEvaluationDiagnoses, applyBillSubmissionEvaluationModifiers, billActivityEventLabel, billAgingBucket, billAgingDays, billLifecycleDisplayLabel, billLifecycleStage, buildBillReviewSaveInput, buildBillStatusAgingCsv, buildBillStatusAgingMatrix, buildBillingReportCsv, buildBillingReportRows, calculateBillSubmissionAllowedAmount, claimsAdministratorRecommendations, createBillStatusClient, ensureTrailingBillSubmissionLine, ensureTrailingProcedureLine, exactClaimsAdministratorMatch, formatBillSubmissionDate, mindBillAppearanceStyle, mindBillThemePresets, normalizeClaimsAdministratorName, parseBillSubmissionDate, prepareBillSubmissionDocuments, resolveMindBillAppearance, summarizeBillingDashboard, useBillLifecycle, useBillStatus, validateBillSubmission, visibleBillLifecycleActions };
954
+ export { BILL_STATUS_AGING_BUCKETS, BILL_SUBMISSION_DIAGNOSIS_QUICK_PICKS, BILL_SUBMISSION_DOCUMENT_TYPES, BILL_SUBMISSION_REPORT_TYPES, BILL_SUBMISSION_REQUIRED_FIELDS, type BillActivityEvent, BillActivityTimeline, type BillActivityTimelineProps, type BillAgingBucket, type BillAgingBucketId, BillAgingSummary, type BillAgingSummaryProps, BillExplanationOfReview, type BillExplanationOfReviewProps, BillLifecycleActions, type BillLifecycleActionsProps, BillLifecycleProgress, type BillLifecycleProgressProps, type BillLifecycleStage, BillList, type BillListProps, BillPayerContactCard, type BillPayerContactCardProps, BillPaymentLedger, type BillPaymentLedgerProps, BillReadOnlyForm, type BillReadOnlyFormProps, BillRejectionNotice, type BillRejectionNoticeProps, BillRemittanceCard, type BillRemittanceCardProps, type BillReviewAttachment, type BillReviewBillingProvider, type BillReviewClinician, type BillReviewData, type BillReviewDocumentType, type BillReviewDraft, type BillReviewFeatures, BillReviewForm, type BillReviewFormProps, type BillReviewLineItem, type BillReviewLocation, type BillReviewPayer, type BillReviewSaveInput, BillSnapshotSummary, type BillSnapshotSummaryProps, type BillStatusAction, type BillStatusAgingCell, BillStatusAgingMatrix, type BillStatusAgingMatrixData, type BillStatusAgingMatrixProps, type BillStatusAgingRow, type BillStatusClient, type BillStatusClientOptions, type BillStatusData, type BillStatusSession, type BillStatusSessionProvider, type BillStatusSessionRequest, BillStatusSummary, type BillStatusSummaryProps, BillSubmissionActions, type BillSubmissionAddress, type BillSubmissionAttachmentReportTypeMode, BillSubmissionAttachmentsSection, BillSubmissionClaimSection, type BillSubmissionDiagnosisOption, type BillSubmissionDocumentType, type BillSubmissionEvaluationType, BillSubmissionForm, type BillSubmissionFormProps, type BillSubmissionFormValue, BillSubmissionHeader, type BillSubmissionInput, type BillSubmissionModifierOption, BillSubmissionPatientSection, type BillSubmissionPostalPlace, type BillSubmissionProcedureOption, BillSubmissionProvidersSection, type BillSubmissionReportTypeOption, type BillSubmissionRoute, type BillSubmissionSectionId, BillSubmissionServiceLinesSection, type BillSubmissionSourceAttachment, type BillSubmissionTaxonomyOption, type BillSubmissionUpload, type BillSubmissionValidation, type BillingComponentProps, BillingDashboard, type BillingDashboardBill, type BillingDashboardProps, type BillingDashboardSummary, BillingReport, type BillingReportDimension, type BillingReportProps, type BillingReportRow, BillingSettings, ConnectedBillLifecycle, type ConnectedBillLifecycleProps, ConnectedBillStatus, type ConnectedBillStatusProps, DEFAULT_BILL_SUBMISSION_MODIFIERS, DEFAULT_BILL_SUBMISSION_PROCEDURES, DEFAULT_BILL_SUBMISSION_TAXONOMIES, MED_LEGAL_REPORT_TYPE_CODE, MindBillBillReview, MindBillBillTimeline, type MindBillReactAppearance, type MindBillThemePreset, type MindBillWidgetProps, OrganizationOnboarding, type OrganizationOnboardingProps, PSYCH_QME_DEFAULT_DIAGNOSIS, type UseBillLifecycleOptions, type UseBillLifecycleResult, type UseBillStatusOptions, type UseBillStatusResult, applyBillSubmissionEvaluationDiagnoses, applyBillSubmissionEvaluationModifiers, billActivityEventLabel, billAgingBucket, billAgingDays, billLifecycleDisplayLabel, billLifecycleStage, buildBillReviewSaveInput, buildBillStatusAgingCsv, buildBillStatusAgingMatrix, buildBillingReportCsv, buildBillingReportRows, calculateBillSubmissionAllowedAmount, claimsAdministratorRecommendations, createBillStatusClient, ensureTrailingBillSubmissionLine, ensureTrailingProcedureLine, exactClaimsAdministratorMatch, formatBillSubmissionDate, mindBillAppearanceStyle, mindBillThemePresets, normalizeClaimsAdministratorName, parseBillSubmissionDate, prepareBillSubmissionDocuments, resolveMindBillAppearance, summarizeBillingDashboard, useBillLifecycle, useBillStatus, validateBillSubmission, visibleBillLifecycleActions };
package/dist/index.js CHANGED
@@ -3530,6 +3530,44 @@ function BillLifecycleProgress({ state, nativeStatus, submittedAt, agingDays, ap
3530
3530
  ] }, step.id)) })
3531
3531
  ] });
3532
3532
  }
3533
+ function BillRejectionNotice({ rejection, title = "Rejected \u2014 action required", appearance, className, style }) {
3534
+ const issues = rejection.issues?.length ? rejection.issues : [{ code: rejection.code, description: rejection.reason }];
3535
+ return /* @__PURE__ */ jsxs8("section", { className: classes("mb-surface mb-rejection-notice", className), style: mindBillAppearanceStyle(appearance, style), role: "alert", "aria-label": "Bill rejection reason", children: [
3536
+ /* @__PURE__ */ jsx8("style", { children: lifecycleSurfaceStyles }),
3537
+ /* @__PURE__ */ jsxs8("header", { className: "mb-rejection-heading", children: [
3538
+ /* @__PURE__ */ jsx8("span", { className: "mb-rejection-icon", "aria-hidden": "true", children: "!" }),
3539
+ /* @__PURE__ */ jsxs8("div", { children: [
3540
+ /* @__PURE__ */ jsx8("strong", { children: title }),
3541
+ /* @__PURE__ */ jsxs8("span", { children: [
3542
+ "Fix the ",
3543
+ issues.length === 1 ? "issue" : `${issues.length} issues`,
3544
+ " below, then resubmit."
3545
+ ] })
3546
+ ] })
3547
+ ] }),
3548
+ /* @__PURE__ */ jsxs8("ol", { className: "mb-rejection-progress", "aria-label": "Submission status", children: [
3549
+ /* @__PURE__ */ jsxs8("li", { className: "is-complete", children: [
3550
+ /* @__PURE__ */ jsx8("span", { "aria-hidden": "true", children: "\u2713" }),
3551
+ /* @__PURE__ */ jsx8("b", { children: "Sent" })
3552
+ ] }),
3553
+ /* @__PURE__ */ jsxs8("li", { className: "is-rejected", children: [
3554
+ /* @__PURE__ */ jsx8("span", { "aria-hidden": "true", children: "!" }),
3555
+ /* @__PURE__ */ jsx8("b", { children: "Rejected" })
3556
+ ] })
3557
+ ] }),
3558
+ /* @__PURE__ */ jsxs8("div", { className: "mb-rejection-issues", children: [
3559
+ /* @__PURE__ */ jsx8("strong", { children: issues.length === 1 ? "Issue to correct" : `${issues.length} issues to correct` }),
3560
+ /* @__PURE__ */ jsx8("ol", { children: issues.map((issue, index) => /* @__PURE__ */ jsxs8("li", { children: [
3561
+ issue.code ? /* @__PURE__ */ jsx8("span", { className: "mb-rejection-code", children: issue.code }) : null,
3562
+ /* @__PURE__ */ jsx8("p", { children: issue.description })
3563
+ ] }, `${issue.code ?? "issue"}-${index}`)) })
3564
+ ] }),
3565
+ rejection.receivedAt || rejection.source ? /* @__PURE__ */ jsxs8("p", { className: "mb-rejection-meta", children: [
3566
+ rejection.receivedAt ? `Received ${defaultFormatDate(rejection.receivedAt)}` : "Received from payer",
3567
+ rejection.source ? ` \xB7 ${rejection.source}` : ""
3568
+ ] }) : null
3569
+ ] });
3570
+ }
3533
3571
  function BillSnapshotSummary({ bill, patient, injury, delivery, appearance, className, style }) {
3534
3572
  const values = [
3535
3573
  ["Patient", patient.name || [patient.firstName, patient.lastName].filter(Boolean).join(" ")],
@@ -3799,11 +3837,12 @@ var lifecycleSurfaceStyles = `
3799
3837
  .mb-lifecycle-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-start}.mb-lifecycle-action{display:grid;gap:5px;max-width:260px}.mb-action-button{appearance:none;border:1px solid var(--mb-border);border-radius:var(--mb-control-radius,8px);background:var(--mb-surface);color:var(--mb-text);font:inherit;font-weight:700;line-height:1.2;padding:11px 15px;cursor:pointer}.mb-action-button:hover:not(:disabled){border-color:var(--mb-accent);color:var(--mb-accent)}.mb-action-button:focus-visible{outline:3px solid color-mix(in srgb,var(--mb-accent) 28%,transparent);outline-offset:2px}.mb-action-button.is-primary{background:var(--mb-accent);border-color:var(--mb-accent);color:var(--mb-accent-contrast)}.mb-action-button:disabled{cursor:not-allowed;opacity:.55}.mb-action-reason{color:var(--mb-muted);font-size:12px;line-height:1.35}
3800
3838
  .mb-activity-list{list-style:none;margin:0;padding:0}.mb-activity-item{display:grid;grid-template-columns:18px minmax(0,1fr);gap:12px;position:relative;padding:0 0 22px}.mb-activity-item:last-child{padding-bottom:0}.mb-activity-item:not(:last-child)::before{background:var(--mb-border);content:"";left:8px;position:absolute;top:10px;bottom:0;width:1px}.mb-activity-marker{background:var(--mb-surface);border:3px solid var(--mb-accent);border-radius:999px;height:11px;margin-top:4px;position:relative;width:11px;z-index:1}.mb-activity-content{display:grid;gap:4px;min-width:0}.mb-activity-content strong{font-size:15px;line-height:1.35}.mb-activity-content p{color:var(--mb-text);font-size:14px;line-height:1.5;margin:0}.mb-activity-content span,.mb-activity-empty{color:var(--mb-muted);font-size:13px;line-height:1.45}.mb-activity-empty,.mb-empty{margin:0}
3801
3839
  .mb-progress-list{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));list-style:none;margin:0;padding:0}.mb-progress-list li{display:grid;gap:7px;position:relative;text-align:center;color:var(--mb-muted);font-size:12px}.mb-progress-list li:not(:last-child)::after{content:"";position:absolute;left:calc(50% + 14px);right:calc(-50% + 14px);top:13px;height:2px;background:var(--mb-border)}.mb-progress-list li.is-complete:not(:last-child)::after{background:var(--mb-accent)}.mb-progress-list li>span{display:grid;place-items:center;justify-self:center;position:relative;z-index:1;width:28px;height:28px;border:2px solid var(--mb-border);border-radius:50%;background:var(--mb-surface);font-weight:800}.mb-progress-list li.is-complete>span,.mb-progress-list li.is-current>span{border-color:var(--mb-accent);background:var(--mb-accent);color:var(--mb-accent-contrast)}.mb-progress-list li.is-current{color:var(--mb-text)}
3802
- .mb-progress.is-rejected{border-color:color-mix(in srgb,var(--mb-danger) 48%,var(--mb-border));background:color-mix(in srgb,var(--mb-danger) 5%,var(--mb-surface));box-shadow:0 8px 24px color-mix(in srgb,var(--mb-danger) 12%,transparent)}.mb-progress.is-rejected .mb-surface-heading strong,.mb-progress.is-rejected .mb-progress-list li.is-current{color:var(--mb-danger)}.mb-progress.is-rejected .mb-progress-list li.is-complete:not(:last-child)::after{background:var(--mb-danger)}.mb-progress.is-rejected .mb-progress-list li.is-complete>span,.mb-progress.is-rejected .mb-progress-list li.is-current>span{border-color:var(--mb-danger);background:var(--mb-danger);color:#fff}
3840
+ .mb-progress.is-rejected{border-color:color-mix(in srgb,var(--mb-danger) 34%,var(--mb-border));background:color-mix(in srgb,var(--mb-danger) 3%,var(--mb-surface));box-shadow:0 8px 24px color-mix(in srgb,var(--mb-danger) 8%,transparent)}.mb-progress.is-rejected .mb-surface-heading strong,.mb-progress.is-rejected .mb-progress-list li.is-current{color:var(--mb-danger)}.mb-progress.is-rejected .mb-progress-list li.is-current>span{border-color:var(--mb-danger);background:var(--mb-danger);color:#fff}
3841
+ .mb-rejection-notice{border:1px solid color-mix(in srgb,var(--mb-danger) 38%,var(--mb-border));border-top:5px solid var(--mb-danger);background:color-mix(in srgb,var(--mb-danger) 7%,var(--mb-surface));box-shadow:0 10px 28px color-mix(in srgb,var(--mb-danger) 10%,transparent);padding:19px 20px 16px}.mb-rejection-heading{display:flex;align-items:flex-start;gap:12px}.mb-rejection-heading>div{display:grid;gap:3px}.mb-rejection-heading strong{color:var(--mb-danger);font-size:17px;line-height:1.25}.mb-rejection-heading span{color:color-mix(in srgb,var(--mb-danger) 62%,var(--mb-text));font-size:13px}.mb-rejection-icon{display:grid;place-items:center;flex:0 0 auto;width:30px;height:30px;border-radius:50%;background:var(--mb-danger);color:#fff;font-size:17px;font-weight:900}.mb-rejection-progress{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));list-style:none;margin:19px 0 18px;padding:0}.mb-rejection-progress li{display:grid;gap:7px;position:relative;text-align:center;color:var(--mb-text);font-size:12px}.mb-rejection-progress li:first-child::after{content:"";position:absolute;left:calc(50% + 14px);right:calc(-50% + 14px);top:13px;height:2px;background:var(--mb-danger)}.mb-rejection-progress li>span{display:grid;place-items:center;justify-self:center;position:relative;z-index:1;width:28px;height:28px;border-radius:50%;background:var(--mb-danger);color:#fff;font-weight:800}.mb-rejection-progress li.is-complete>span{background:color-mix(in srgb,var(--mb-danger) 72%,var(--mb-text))}.mb-rejection-issues{border:1px solid color-mix(in srgb,var(--mb-danger) 22%,var(--mb-border));border-radius:10px;background:color-mix(in srgb,var(--mb-danger) 3%,var(--mb-surface));overflow:hidden}.mb-rejection-issues>strong{display:block;padding:10px 13px;border-bottom:1px solid color-mix(in srgb,var(--mb-danger) 18%,var(--mb-border));color:color-mix(in srgb,var(--mb-danger) 74%,var(--mb-text));font-size:12px;letter-spacing:.02em;text-transform:uppercase}.mb-rejection-issues ol{list-style:none;margin:0;padding:0}.mb-rejection-issues li{display:flex;align-items:flex-start;gap:11px;padding:12px 13px}.mb-rejection-issues li+li{border-top:1px solid color-mix(in srgb,var(--mb-danger) 13%,var(--mb-border))}.mb-rejection-issues p{margin:1px 0 0;font-size:14px;line-height:1.45}.mb-rejection-code{flex:0 0 auto;border:1px solid color-mix(in srgb,var(--mb-danger) 35%,var(--mb-border));border-radius:999px;background:color-mix(in srgb,var(--mb-danger) 6%,var(--mb-surface));color:var(--mb-danger);font-size:11px;font-weight:850;line-height:1.2;padding:4px 8px}.mb-rejection-meta{margin:11px 1px 0;color:color-mix(in srgb,var(--mb-danger) 50%,var(--mb-muted));font-size:12px}
3803
3842
  .mb-snapshot dl,.mb-remittance dl,.mb-contacts dl{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;margin:0}.mb-remittance dl{grid-template-columns:repeat(4,minmax(0,1fr));row-gap:1px;background:var(--mb-border)}.mb-snapshot dl>div,.mb-remittance dl>div,.mb-contacts dl>div{display:grid;gap:3px;padding:10px 14px;border-left:1px solid var(--mb-border)}.mb-remittance dl>div{border:0;background:var(--mb-surface)}.mb-snapshot dl>div:nth-child(3n+1),.mb-contacts dl>div:first-child{border-left:0}.mb-snapshot dt,.mb-remittance dt,.mb-contacts dt,.mb-payment-list dt{color:var(--mb-muted);font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.mb-snapshot dd,.mb-remittance dd,.mb-contacts dd,.mb-payment-list dd{font-size:14px;font-weight:750;margin:0;overflow-wrap:anywhere}.mb-contacts a{color:var(--mb-accent)}.mb-denial{margin-top:16px;border-left:4px solid var(--mb-danger);border-radius:var(--mb-control-radius);background:color-mix(in srgb,var(--mb-danger) 8%,var(--mb-surface));padding:12px 14px}.mb-denial p{margin:4px 0 0}
3804
3843
  .mb-payment-list{display:grid}.mb-payment-list article{display:grid;grid-template-columns:minmax(120px,.35fr) 1fr;gap:14px 24px;padding:16px 0;border-top:1px solid var(--mb-border)}.mb-payment-list article:first-child{border-top:0}.mb-payment-amount{display:grid;align-content:start;gap:2px}.mb-payment-amount strong{font-size:1.2rem}.mb-payment-list article>dl{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:0}.mb-payment-list article>dl>div{display:grid;align-content:start;gap:3px}.mb-payment-list article span{color:var(--mb-muted);font-size:12px}.mb-payment-list article p{grid-column:1/-1;margin:0;color:var(--mb-muted);font-size:13px}
3805
3844
  .mb-eor-review{border-top:4px solid var(--mb-accent);padding-top:17px}.mb-eor-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));margin:0 0 18px;border:1px solid var(--mb-border);border-radius:10px;overflow:hidden}.mb-eor-metrics>div{display:grid;gap:4px;padding:13px 15px;border-left:1px solid var(--mb-border);border-top:1px solid var(--mb-border)}.mb-eor-metrics>div:nth-child(-n+4){border-top:0}.mb-eor-metrics>div:nth-child(4n+1){border-left:0}.mb-eor-metrics dt{color:var(--mb-muted);font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.mb-eor-metrics dd{margin:0;font-size:15px;font-weight:800}.mb-eor-metrics .is-balance{background:color-mix(in srgb,var(--mb-accent) 7%,var(--mb-surface))}.mb-eor-table-wrap{overflow-x:auto;border:1px solid var(--mb-border);border-radius:10px}.mb-eor-table{width:100%;min-width:1080px;border-collapse:collapse;font-size:12px}.mb-eor-table th,.mb-eor-table td{padding:10px 12px;border-left:1px solid var(--mb-border);border-top:1px solid var(--mb-border);text-align:left;vertical-align:top}.mb-eor-table th:first-child,.mb-eor-table td:first-child{border-left:0}.mb-eor-table thead th{background:var(--mb-soft);color:var(--mb-muted);font-weight:800}.mb-eor-table .mb-eor-groups th{border-top:0;background:color-mix(in srgb,var(--mb-accent) 13%,var(--mb-surface));color:var(--mb-text);text-align:center}.mb-eor-table td>strong,.mb-eor-table td>span{display:block}.mb-eor-table td>span{margin-top:3px;color:var(--mb-muted)}.mb-eor-link,.mb-eor-documents button{border:0;background:transparent;color:var(--mb-accent);font:inherit;font-weight:750;padding:0;text-align:left;text-decoration:underline;cursor:pointer;overflow-wrap:anywhere}.mb-eor-documents{display:flex;flex-wrap:wrap;gap:12px;margin-top:12px}
3806
- @media(max-width:700px){.mb-surface.mb-progress{padding:16px 10px}.mb-progress-list{grid-template-columns:repeat(4,minmax(0,1fr))}.mb-progress-list li{display:grid;grid-template-columns:1fr;align-items:start;gap:6px;text-align:center;font-size:10px;min-width:0}.mb-progress-list li b{font-size:10px;white-space:nowrap}.mb-progress-list li:not(:last-child)::after{left:calc(50% + 12px);right:calc(-50% + 12px);top:11px;bottom:auto;width:auto;height:2px}.mb-progress-list li>span{grid-row:auto;width:24px;height:24px;font-size:11px}.mb-snapshot dl,.mb-remittance dl,.mb-contacts dl{grid-template-columns:1fr 1fr}.mb-snapshot dl>div,.mb-remittance dl>div,.mb-contacts dl>div{border:0;border-top:1px solid var(--mb-border);padding:10px 0}.mb-snapshot dl>div:nth-child(-n+2),.mb-remittance dl>div:nth-child(-n+2),.mb-contacts dl>div:nth-child(-n+2){border-top:0}.mb-payment-list article{grid-template-columns:1fr}.mb-payment-list article>dl{grid-template-columns:1fr 1fr}}
3845
+ @media(max-width:700px){.mb-surface.mb-progress{padding:16px 10px}.mb-progress-list{grid-template-columns:repeat(4,minmax(0,1fr))}.mb-progress-list li{display:grid;grid-template-columns:1fr;align-items:start;gap:6px;text-align:center;font-size:10px;min-width:0}.mb-progress-list li b{font-size:10px;white-space:nowrap}.mb-progress-list li:not(:last-child)::after{left:calc(50% + 12px);right:calc(-50% + 12px);top:11px;bottom:auto;width:auto;height:2px}.mb-progress-list li>span{grid-row:auto;width:24px;height:24px;font-size:11px}.mb-rejection-notice{padding:16px 13px 13px}.mb-rejection-issues li{display:grid;gap:7px}.mb-snapshot dl,.mb-remittance dl,.mb-contacts dl{grid-template-columns:1fr 1fr}.mb-snapshot dl>div,.mb-remittance dl>div,.mb-contacts dl>div{border:0;border-top:1px solid var(--mb-border);padding:10px 0}.mb-snapshot dl>div:nth-child(-n+2),.mb-remittance dl>div:nth-child(-n+2),.mb-contacts dl>div:nth-child(-n+2){border-top:0}.mb-payment-list article{grid-template-columns:1fr}.mb-payment-list article>dl{grid-template-columns:1fr 1fr}}
3807
3846
  `;
3808
3847
 
3809
3848
  // src/connected-bill-lifecycle.tsx
@@ -3832,14 +3871,9 @@ function reservePreviewWindow() {
3832
3871
  }
3833
3872
  return preview;
3834
3873
  }
3835
- function renderPreview(preview, title, body) {
3836
- preview.document.open();
3837
- preview.document.write(`<!doctype html><title>${title}</title><meta name="viewport" content="width=device-width,initial-scale=1"><style>html,body{height:100%;margin:0;background:#202124;font:14px system-ui}iframe{width:100%;height:100%;border:0}.fallback{position:fixed;right:12px;top:12px;z-index:2;border-radius:8px;background:#fff;padding:9px 12px;color:#17282d;text-decoration:none;box-shadow:0 2px 12px #0005}</style>${body}`);
3838
- preview.document.close();
3839
- }
3840
3874
  function previewBlob(blob, preview) {
3841
3875
  const url = URL.createObjectURL(blob);
3842
- if (preview) renderPreview(preview, "PDF preview", `<a class="fallback" href="${url}" target="_self">Open PDF directly</a><iframe title="PDF preview" src="${url}"></iframe>`);
3876
+ if (preview) preview.location.replace(url);
3843
3877
  else {
3844
3878
  const link = document.createElement("a");
3845
3879
  link.href = url;
@@ -3854,7 +3888,7 @@ async function openPdfFromUserGesture(loadPdf) {
3854
3888
  try {
3855
3889
  previewBlob(await loadPdf(), preview);
3856
3890
  } catch (error) {
3857
- if (preview) renderPreview(preview, "PDF unavailable", '<p style="margin:0;padding:32px;color:#fff">The PDF could not be opened. Close this tab and try again.</p>');
3891
+ preview?.close();
3858
3892
  throw error;
3859
3893
  }
3860
3894
  }
@@ -4068,7 +4102,7 @@ function ConnectedBillLifecycle({ appearance, sandboxControls = false, className
4068
4102
  const simulations = showSandboxControls ? sandboxScenarios(data.lifecycle.state) : [];
4069
4103
  return /* @__PURE__ */ jsxs9("section", { className: ["mb-connected-lifecycle", className].filter(Boolean).join(" "), style: mindBillAppearanceStyle(appearance, style), children: [
4070
4104
  /* @__PURE__ */ jsx9("style", { children: CONNECTED_LIFECYCLE_STYLES }),
4071
- /* @__PURE__ */ jsx9(BillLifecycleProgress, { state: data.lifecycle.state, nativeStatus: data.lifecycle.nativeStatus, submittedAt: data.lifecycle.submittedAt ?? null, agingDays: data.lifecycle.agingDays ?? null, ...appearance ? { appearance } : {} }),
4105
+ data.lifecycle.state.toLowerCase() === "rejected" && data.rejection ? /* @__PURE__ */ jsx9(BillRejectionNotice, { rejection: data.rejection, ...appearance ? { appearance } : {} }) : /* @__PURE__ */ jsx9(BillLifecycleProgress, { state: data.lifecycle.state, nativeStatus: data.lifecycle.nativeStatus, submittedAt: data.lifecycle.submittedAt ?? null, agingDays: data.lifecycle.agingDays ?? null, ...appearance ? { appearance } : {} }),
4072
4106
  /* @__PURE__ */ jsxs9("header", { className: "mb-lifecycle-head", children: [
4073
4107
  /* @__PURE__ */ jsxs9("div", { children: [
4074
4108
  /* @__PURE__ */ jsx9("div", { className: "mb-lifecycle-title", children: /* @__PURE__ */ jsxs9("h2", { children: [
@@ -4294,6 +4328,7 @@ export {
4294
4328
  BillPayerContactCard,
4295
4329
  BillPaymentLedger,
4296
4330
  BillReadOnlyForm,
4331
+ BillRejectionNotice,
4297
4332
  BillRemittanceCard,
4298
4333
  BillReviewForm,
4299
4334
  BillSnapshotSummary,