@seatlayer/js 0.57.0 → 0.59.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.
@@ -1182,6 +1182,15 @@ interface SeatManagerOptions {
1182
1182
  tokenExpiresAt?: number;
1183
1183
  /** Initial mode. Default 'view'. */
1184
1184
  mode?: SeatManagerMode;
1185
+ /**
1186
+ * Which tools the cockpit offers. Default: every tool the token's
1187
+ * capabilities permit. Listing a tool never grants it — capabilities still
1188
+ * gate Categories, Tables and Channels — this only HIDES tools a host has no
1189
+ * use for (a dashboard that does not consume `onSelectionChange` should not
1190
+ * show a Select tab that leads nowhere). Monitor ('view') is always kept:
1191
+ * it is the fail-closed fallback for every refused mode.
1192
+ */
1193
+ tools?: SeatManagerMode[];
1185
1194
  /** Public labels to preselect after live inventory has loaded in Select mode. */
1186
1195
  selectedObjects?: string[];
1187
1196
  /**
@@ -1695,7 +1704,31 @@ declare class SeatManager {
1695
1704
  private filterableSections;
1696
1705
  private applyFilteredSectionCanvas;
1697
1706
  private buildSectionOptions;
1707
+ /**
1708
+ * A tool is offered when the token's capability permits it AND the host has
1709
+ * not hidden it through `options.tools`. No channel-view capability ⇒ the
1710
+ * pill is not rendered at all: a hidden control is honest about authority;
1711
+ * a disabled one advertises it. Authority, not readiness — the Channels
1712
+ * pill must never wait on the lazy module. Monitor is always available; it
1713
+ * is where every refused mode lands.
1714
+ */
1715
+ private toolAvailable;
1716
+ /**
1717
+ * Re-run the availability gate against freshly-loaded facts. `options.mode`
1718
+ * and a deep link are both accepted before the chart exists, so this is where
1719
+ * a now-impossible tool is exchanged for Monitor.
1720
+ */
1721
+ private settleMode;
1722
+ /** Every table object on the chart, across floors. */
1723
+ private tables;
1698
1724
  private paintModeTabs;
1725
+ /**
1726
+ * Every rail opens the same way: what the tool is called, whether it changes
1727
+ * anything (and for whom), and one plain sentence on how to use it. An
1728
+ * operator switching tabs should never have to guess whether a click here
1729
+ * touches live inventory.
1730
+ */
1731
+ private railHeader;
1699
1732
  private paintFollowLiveButton;
1700
1733
  private paintHeatButton;
1701
1734
  private paintMomentumHelp;
@@ -1715,6 +1748,8 @@ declare class SeatManager {
1715
1748
  private renderSelectRail;
1716
1749
  private paintSelectSelection;
1717
1750
  private renderFilterSectionsRail;
1751
+ /** Seats in a chart category that the operator may act on in this mode. */
1752
+ private categorySeats;
1718
1753
  private renderCategoriesRail;
1719
1754
  private paintCategorySelection;
1720
1755
  private renderTablesRail;
@@ -1182,6 +1182,15 @@ interface SeatManagerOptions {
1182
1182
  tokenExpiresAt?: number;
1183
1183
  /** Initial mode. Default 'view'. */
1184
1184
  mode?: SeatManagerMode;
1185
+ /**
1186
+ * Which tools the cockpit offers. Default: every tool the token's
1187
+ * capabilities permit. Listing a tool never grants it — capabilities still
1188
+ * gate Categories, Tables and Channels — this only HIDES tools a host has no
1189
+ * use for (a dashboard that does not consume `onSelectionChange` should not
1190
+ * show a Select tab that leads nowhere). Monitor ('view') is always kept:
1191
+ * it is the fail-closed fallback for every refused mode.
1192
+ */
1193
+ tools?: SeatManagerMode[];
1185
1194
  /** Public labels to preselect after live inventory has loaded in Select mode. */
1186
1195
  selectedObjects?: string[];
1187
1196
  /**
@@ -1695,7 +1704,31 @@ declare class SeatManager {
1695
1704
  private filterableSections;
1696
1705
  private applyFilteredSectionCanvas;
1697
1706
  private buildSectionOptions;
1707
+ /**
1708
+ * A tool is offered when the token's capability permits it AND the host has
1709
+ * not hidden it through `options.tools`. No channel-view capability ⇒ the
1710
+ * pill is not rendered at all: a hidden control is honest about authority;
1711
+ * a disabled one advertises it. Authority, not readiness — the Channels
1712
+ * pill must never wait on the lazy module. Monitor is always available; it
1713
+ * is where every refused mode lands.
1714
+ */
1715
+ private toolAvailable;
1716
+ /**
1717
+ * Re-run the availability gate against freshly-loaded facts. `options.mode`
1718
+ * and a deep link are both accepted before the chart exists, so this is where
1719
+ * a now-impossible tool is exchanged for Monitor.
1720
+ */
1721
+ private settleMode;
1722
+ /** Every table object on the chart, across floors. */
1723
+ private tables;
1698
1724
  private paintModeTabs;
1725
+ /**
1726
+ * Every rail opens the same way: what the tool is called, whether it changes
1727
+ * anything (and for whom), and one plain sentence on how to use it. An
1728
+ * operator switching tabs should never have to guess whether a click here
1729
+ * touches live inventory.
1730
+ */
1731
+ private railHeader;
1699
1732
  private paintFollowLiveButton;
1700
1733
  private paintHeatButton;
1701
1734
  private paintMomentumHelp;
@@ -1715,6 +1748,8 @@ declare class SeatManager {
1715
1748
  private renderSelectRail;
1716
1749
  private paintSelectSelection;
1717
1750
  private renderFilterSectionsRail;
1751
+ /** Seats in a chart category that the operator may act on in this mode. */
1752
+ private categorySeats;
1718
1753
  private renderCategoriesRail;
1719
1754
  private paintCategorySelection;
1720
1755
  private renderTablesRail;
@@ -1,6 +1,12 @@
1
1
  import"./chunk-OSZ7DOEH.js";var F="https://checkout.razorpay.com/v1/checkout.js",Y="seatlayer-checkout-style",W=`
2
+ /* The card is centred, but max-height:100% lets a long form reach the bottom
3
+ edge \u2014 and on the hosted buyer page that edge is the phone's edge, with the
4
+ Pay button last in the scroll. Reserve the home-indicator gutter here too.
5
+ --sl-safe-b is declared on .sl-picker, which this overlay lives inside, so it
6
+ inherits; it resolves to 0px in any host that is not inset. */
2
7
  .sl-hco{position:absolute;inset:0;z-index:60;display:flex;align-items:center;justify-content:center;
3
- padding:16px;background:color-mix(in srgb, var(--sl-bg) 82%, transparent);backdrop-filter:blur(3px)}
8
+ padding:16px 16px calc(16px + var(--sl-safe-b,0px));
9
+ background:color-mix(in srgb, var(--sl-bg) 82%, transparent);backdrop-filter:blur(3px)}
4
10
  .sl-hco-card{width:100%;max-width:380px;max-height:100%;overflow:auto;padding:22px;
5
11
  background:var(--sl-surface);color:var(--sl-text);border:1px solid var(--sl-line);
6
12
  border-radius:var(--sl-radius);box-shadow:0 18px 48px rgba(0,0,0,.28)}
@@ -32,4 +38,4 @@ import"./chunk-OSZ7DOEH.js";var F="https://checkout.razorpay.com/v1/checkout.js"
32
38
  .sl-hco-tickets{display:block;width:100%;margin-top:14px;padding:12px;font:inherit;font-size:15px;
33
39
  font-weight:650;text-align:center;text-decoration:none;color:var(--sl-accent-ink);
34
40
  background:var(--sl-accent);border-radius:calc(var(--sl-radius) * .55)}
35
- `;function q(){if(typeof document>"u"||document.getElementById(Y))return;let t=document.createElement("style");t.id=Y,t.textContent=W,document.head.appendChild(t)}function Q(t,n){let s=`${n} ${n===1?"seat is":"seats are"} held for a limited time.`;return t==="payments_off_for_event"?{title:"This event isn\u2019t sold online",body:`${s} The organiser isn\u2019t taking payment for this event here.`,detail:"Nothing has been charged. Check where you found this event for how to get tickets."}:t==="unavailable_for_event"?{title:"This event isn\u2019t taking payment yet",body:`${s} Online payment is not switched on for this event.`,detail:"Nothing has been charged. If you were sent here to pay, let the organiser know \u2014 only they can turn payment on for this event."}:{title:"Finish in the ticketing checkout",body:`${s} Payment for this event is taken elsewhere.`,detail:"Nothing has been charged. Continue in the checkout on this page to pay for your seats."}}function D(t){switch(t){case"gateway_not_connected":case"payments_not_enabled_for_event":return"This event is not taking online payments. Contact the organiser to buy these seats.";case"provider_mismatch":return"This event\u2019s payment setup changed while you were choosing. Nothing was charged \u2014 please try again.";case"hold_not_active":case"hold_not_found":return"Your seats were released before checkout started. Nothing was charged \u2014 please pick again.";case"checkout_already_started":return"A payment for these seats is already in progress. Finish that one, or wait for it to time out before starting again.";case"event_closed":return"Sales for this event have closed.";case"insufficient_hosted_credits":return"Ticket sales are temporarily paused while the organiser updates their SeatLayer balance. Nothing was charged \u2014 please try again later or contact the organiser.";case"gateway_currency_mismatch":case"unsupported_currency":case"mixed_currency_hold":case"price_unusable":return"These seats cannot be checked out right now because of a pricing configuration problem. Nothing was charged \u2014 please contact the organiser.";case"rate_limited":return"Too many attempts. Wait a moment and try again.";default:return"We could not start the payment. Nothing was charged \u2014 please try again."}}function V(){let t=window.Razorpay;return t?Promise.resolve(t):new Promise((n,s)=>{let a=document.querySelector(`script[src="${F}"]`),l=a??document.createElement("script"),p=()=>{let d=window.Razorpay;d?n(d):s(new Error("razorpay_unavailable"))};l.addEventListener("load",p,{once:!0}),l.addEventListener("error",()=>s(new Error("razorpay_script_failed")),{once:!0}),!a&&(l.src=F,l.async=!0,document.head.appendChild(l))})}function e(t,n,s){let a=document.createElement(t);return n&&(a.className=n),s!==void 0&&(a.textContent=s),a}function Z(t){q();let n=!0,s=!1,a=e("div","sl-hco");a.setAttribute("role","dialog"),a.setAttribute("aria-modal","true");let l=e("div","sl-hco-card");a.appendChild(l);let p=()=>{n=!1,a.remove(),document.removeEventListener("keydown",E,!0)},d=()=>{p(),t.onCancel()};function E(r){r.key!=="Escape"||!a.isConnected||(r.stopPropagation(),r.preventDefault(),d())}document.addEventListener("keydown",E,!0);let h=e("h2","sl-hco-title","Checkout"),b=`sl-hco-t-${Math.random().toString(36).slice(2,8)}`;h.id=b,a.setAttribute("aria-labelledby",b);let y=(...r)=>{l.replaceChildren(h,...r)},v=r=>{if(!n)return;let i=e("p","sl-hco-status sl-hco-error",r);i.setAttribute("role","alert");let o=e("button","sl-hco-back","Back to seats");o.type="button",o.addEventListener("click",d),y(i,o)},k=r=>{if(!n)return;let i=e("p","sl-hco-status",r);i.setAttribute("role","status"),y(i)},I=async r=>{k("Payment received \u2014 confirming your seats\u2026");let i=Date.now()+9e4;for(;n&&Date.now()<i;){try{let o=await t.orderStatus(r);if(!n)return;if(o.status==="confirmed"){s=!0,h.textContent="Your tickets are confirmed";let A=e("p","sl-hco-status",`${o.seatCount} ${o.seatCount===1?"seat":"seats"} confirmed. Your tickets \u2014 with their door QR codes \u2014 are in your email.`),w=e("dl","sl-hco-receipt"),U=(o.tickets??[]).map(m=>m.label);U.length&&w.append(e("dt",void 0,"Seats"),e("dd",void 0,U.join(", "))),w.append(e("dt",void 0,"Paid"),e("dd",void 0,`${o.amountFormatted} ${o.currency}`),e("dt",void 0,"Order"),e("dd","sl-hco-ref",o.orderId));let C=e("button","sl-hco-back","Close");if(C.type="button",C.addEventListener("click",d),o.ticketUrl){let m=e("a","sl-hco-tickets","View tickets & QR codes");m.href=o.ticketUrl,m.target="_blank",m.rel="noreferrer",y(A,w,m,C)}else y(A,w,C);t.onConfirmed(o);return}if(o.status==="failed"||o.status==="expired"){v(o.status==="expired"?"Your seats were released before payment completed. Nothing was charged \u2014 please pick again.":"The payment did not complete. If you were charged, it has been refunded automatically.");return}}catch{}await new Promise(o=>setTimeout(o,2e3))}!n||s||v("Still confirming with the payment provider. If your payment went through, your tickets will arrive by email shortly \u2014 you do not need to pay again.")};if(t.state.kind==="unavailable"){let r=Q(t.state.reason,t.state.seatCount);h.textContent=r.title;let i=e("p","sl-hco-label","Seats held"),o=e("button","sl-hco-back","Back to seat map");return o.type="button",o.addEventListener("click",d),l.replaceChildren(i,h,e("p","sl-hco-status",r.body),e("p","sl-hco-note",r.detail),o),t.root.appendChild(a),o.focus(),{destroy:p}}if(t.state.kind==="resume")return t.root.appendChild(a),I(t.state.orderId),{destroy:p};let{order:g,provider:H}=t.state,T=e("div","sl-hco-summary"),L=e("div","sl-hco-seats");for(let r of g.labels)L.appendChild(e("span","sl-hco-seat",r));let M=t.formatMoney(g.total,g.currency),P=e("div","sl-hco-total");P.append(e("span",void 0,"Total"),e("strong",void 0,M)),T.append(L,P);let _=e("form","sl-hco-form"),N=e("label","sl-hco-label","Email \u2014 your tickets go here"),c=e("input","sl-hco-input");c.type="email",c.required=!0,c.autocomplete="email",c.placeholder="you@example.com",c.id=`${b}-email`,N.htmlFor=c.id;let O=e("label","sl-hco-label","Name (optional)"),u=e("input","sl-hco-input");u.type="text",u.autocomplete="name",u.placeholder="Your name",u.id=`${b}-name`,O.htmlFor=u.id;let f=e("button","sl-hco-pay",`Pay ${M}`);f.type="submit",f.disabled=!0;let S=e("button","sl-hco-back","Back to seats");S.type="button",S.addEventListener("click",d);let K=new Date(g.expiresAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),B=e("p","sl-hco-note",`Your seats are held until ${K}. Payment is handled by ${H==="razorpay"?"Razorpay":"Stripe"} \u2014 we never see your card details.`),z=e("p","sl-hco-note");z.append("The event organizer and SeatLayer use your email to issue and manage your tickets. ");let x=e("a",void 0,"Privacy Policy");x.href="https://seatlayer.io/privacy/",x.target="_blank",x.rel="noreferrer",z.appendChild(x);let R=()=>/.+@.+\..+/.test(c.value.trim());c.addEventListener("input",()=>{f.disabled=!R()});let j=async()=>{k("Opening secure payment\u2026");try{let r=await t.startSession({holdId:g.holdId,buyerEmail:c.value.trim(),...u.value.trim()?{buyerName:u.value.trim()}:{}});if(!n)return;if(r.redirectUrl){k("Taking you to secure payment\u2026"),window.location.assign(r.redirectUrl);return}if(r.clientPayload){let i=r.clientPayload,o=await V();if(!n)return;k("Waiting for payment\u2026"),new o({key:i.key,order_id:i.orderId,amount:i.amount,currency:i.currency,name:i.name,prefill:i.prefill,handler:()=>{I(r.orderId)},modal:{ondismiss:()=>{n&&$()}}}).open();return}v(D("gateway_unavailable"))}catch(r){t.onError?.(r),v(D(r?.code))}};_.addEventListener("submit",r=>{r.preventDefault(),R()&&j()}),_.append(N,c,O,u,z,f,S,B);let $=()=>{h.textContent="Checkout",y(T,_),f.disabled=!R()};return $(),t.root.appendChild(a),c.focus(),{destroy:p}}export{D as errorCopy,Z as mountCheckout,Q as unavailableCopy};
41
+ `;function q(){if(typeof document>"u"||document.getElementById(Y))return;let t=document.createElement("style");t.id=Y,t.textContent=W,document.head.appendChild(t)}function Q(t,n){let s=`${n} ${n===1?"seat is":"seats are"} held for a limited time.`;return t==="payments_off_for_event"?{title:"This event isn\u2019t sold online",body:`${s} The organiser isn\u2019t taking payment for this event here.`,detail:"Nothing has been charged. Check where you found this event for how to get tickets."}:t==="unavailable_for_event"?{title:"This event isn\u2019t taking payment yet",body:`${s} Online payment is not switched on for this event.`,detail:"Nothing has been charged. If you were sent here to pay, let the organiser know \u2014 only they can turn payment on for this event."}:{title:"Finish in the ticketing checkout",body:`${s} Payment for this event is taken elsewhere.`,detail:"Nothing has been charged. Continue in the checkout on this page to pay for your seats."}}function D(t){switch(t){case"gateway_not_connected":case"payments_not_enabled_for_event":return"This event is not taking online payments. Contact the organiser to buy these seats.";case"provider_mismatch":return"This event\u2019s payment setup changed while you were choosing. Nothing was charged \u2014 please try again.";case"hold_not_active":case"hold_not_found":return"Your seats were released before checkout started. Nothing was charged \u2014 please pick again.";case"checkout_already_started":return"A payment for these seats is already in progress. Finish that one, or wait for it to time out before starting again.";case"event_closed":return"Sales for this event have closed.";case"insufficient_hosted_credits":return"Ticket sales are temporarily paused while the organiser updates their SeatLayer balance. Nothing was charged \u2014 please try again later or contact the organiser.";case"gateway_currency_mismatch":case"unsupported_currency":case"mixed_currency_hold":case"price_unusable":return"These seats cannot be checked out right now because of a pricing configuration problem. Nothing was charged \u2014 please contact the organiser.";case"rate_limited":return"Too many attempts. Wait a moment and try again.";default:return"We could not start the payment. Nothing was charged \u2014 please try again."}}function V(){let t=window.Razorpay;return t?Promise.resolve(t):new Promise((n,s)=>{let a=document.querySelector(`script[src="${F}"]`),l=a??document.createElement("script"),p=()=>{let d=window.Razorpay;d?n(d):s(new Error("razorpay_unavailable"))};l.addEventListener("load",p,{once:!0}),l.addEventListener("error",()=>s(new Error("razorpay_script_failed")),{once:!0}),!a&&(l.src=F,l.async=!0,document.head.appendChild(l))})}function e(t,n,s){let a=document.createElement(t);return n&&(a.className=n),s!==void 0&&(a.textContent=s),a}function Z(t){q();let n=!0,s=!1,a=e("div","sl-hco");a.setAttribute("role","dialog"),a.setAttribute("aria-modal","true");let l=e("div","sl-hco-card");a.appendChild(l);let p=()=>{n=!1,a.remove(),document.removeEventListener("keydown",E,!0)},d=()=>{p(),t.onCancel()};function E(r){r.key!=="Escape"||!a.isConnected||(r.stopPropagation(),r.preventDefault(),d())}document.addEventListener("keydown",E,!0);let h=e("h2","sl-hco-title","Checkout"),b=`sl-hco-t-${Math.random().toString(36).slice(2,8)}`;h.id=b,a.setAttribute("aria-labelledby",b);let y=(...r)=>{l.replaceChildren(h,...r)},v=r=>{if(!n)return;let i=e("p","sl-hco-status sl-hco-error",r);i.setAttribute("role","alert");let o=e("button","sl-hco-back","Back to seats");o.type="button",o.addEventListener("click",d),y(i,o)},k=r=>{if(!n)return;let i=e("p","sl-hco-status",r);i.setAttribute("role","status"),y(i)},T=async r=>{k("Payment received \u2014 confirming your seats\u2026");let i=Date.now()+9e4;for(;n&&Date.now()<i;){try{let o=await t.orderStatus(r);if(!n)return;if(o.status==="confirmed"){s=!0,h.textContent="Your tickets are confirmed";let A=e("p","sl-hco-status",`${o.seatCount} ${o.seatCount===1?"seat":"seats"} confirmed. Your tickets \u2014 with their door QR codes \u2014 are in your email.`),w=e("dl","sl-hco-receipt"),U=(o.tickets??[]).map(m=>m.label);U.length&&w.append(e("dt",void 0,"Seats"),e("dd",void 0,U.join(", "))),w.append(e("dt",void 0,"Paid"),e("dd",void 0,`${o.amountFormatted} ${o.currency}`),e("dt",void 0,"Order"),e("dd","sl-hco-ref",o.orderId));let C=e("button","sl-hco-back","Close");if(C.type="button",C.addEventListener("click",d),o.ticketUrl){let m=e("a","sl-hco-tickets","View tickets & QR codes");m.href=o.ticketUrl,m.target="_blank",m.rel="noreferrer",y(A,w,m,C)}else y(A,w,C);t.onConfirmed(o);return}if(o.status==="failed"||o.status==="expired"){v(o.status==="expired"?"Your seats were released before payment completed. Nothing was charged \u2014 please pick again.":"The payment did not complete. If you were charged, it has been refunded automatically.");return}}catch{}await new Promise(o=>setTimeout(o,2e3))}!n||s||v("Still confirming with the payment provider. If your payment went through, your tickets will arrive by email shortly \u2014 you do not need to pay again.")};if(t.state.kind==="unavailable"){let r=Q(t.state.reason,t.state.seatCount);h.textContent=r.title;let i=e("p","sl-hco-label","Seats held"),o=e("button","sl-hco-back","Back to seat map");return o.type="button",o.addEventListener("click",d),l.replaceChildren(i,h,e("p","sl-hco-status",r.body),e("p","sl-hco-note",r.detail),o),t.root.appendChild(a),o.focus(),{destroy:p}}if(t.state.kind==="resume")return t.root.appendChild(a),T(t.state.orderId),{destroy:p};let{order:g,provider:H}=t.state,I=e("div","sl-hco-summary"),L=e("div","sl-hco-seats");for(let r of g.labels)L.appendChild(e("span","sl-hco-seat",r));let P=t.formatMoney(g.total,g.currency),M=e("div","sl-hco-total");M.append(e("span",void 0,"Total"),e("strong",void 0,P)),I.append(L,M);let _=e("form","sl-hco-form"),N=e("label","sl-hco-label","Email \u2014 your tickets go here"),c=e("input","sl-hco-input");c.type="email",c.required=!0,c.autocomplete="email",c.placeholder="you@example.com",c.id=`${b}-email`,N.htmlFor=c.id;let O=e("label","sl-hco-label","Name (optional)"),u=e("input","sl-hco-input");u.type="text",u.autocomplete="name",u.placeholder="Your name",u.id=`${b}-name`,O.htmlFor=u.id;let f=e("button","sl-hco-pay",`Pay ${P}`);f.type="submit",f.disabled=!0;let S=e("button","sl-hco-back","Back to seats");S.type="button",S.addEventListener("click",d);let K=new Date(g.expiresAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),B=e("p","sl-hco-note",`Your seats are held until ${K}. Payment is handled by ${H==="razorpay"?"Razorpay":"Stripe"} \u2014 we never see your card details.`),z=e("p","sl-hco-note");z.append("The event organizer and SeatLayer use your email to issue and manage your tickets. ");let x=e("a",void 0,"Privacy Policy");x.href="https://seatlayer.io/privacy/",x.target="_blank",x.rel="noreferrer",z.appendChild(x);let R=()=>/.+@.+\..+/.test(c.value.trim());c.addEventListener("input",()=>{f.disabled=!R()});let j=async()=>{k("Opening secure payment\u2026");try{let r=await t.startSession({holdId:g.holdId,buyerEmail:c.value.trim(),...u.value.trim()?{buyerName:u.value.trim()}:{}});if(!n)return;if(r.redirectUrl){k("Taking you to secure payment\u2026"),window.location.assign(r.redirectUrl);return}if(r.clientPayload){let i=r.clientPayload,o=await V();if(!n)return;k("Waiting for payment\u2026"),new o({key:i.key,order_id:i.orderId,amount:i.amount,currency:i.currency,name:i.name,prefill:i.prefill,handler:()=>{T(r.orderId)},modal:{ondismiss:()=>{n&&$()}}}).open();return}v(D("gateway_unavailable"))}catch(r){t.onError?.(r),v(D(r?.code))}};_.addEventListener("submit",r=>{r.preventDefault(),R()&&j()}),_.append(N,c,O,u,z,f,S,B);let $=()=>{h.textContent="Checkout",y(I,_),f.disabled=!R()};return $(),t.root.appendChild(a),c.focus(),{destroy:p}}export{D as errorCopy,Z as mountCheckout,Q as unavailableCopy};