@ticketlayer/elements 0.3.3 → 1.0.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.
Files changed (179) hide show
  1. package/README.md +3 -2
  2. package/dist/cjs/{index-BpfoKd9Q.js → index-DanPUX0s.js} +1 -1
  3. package/dist/cjs/index.cjs.js +2 -1
  4. package/dist/cjs/loader.cjs.js +2 -2
  5. package/dist/cjs/ticket-selector-BYVL13k_.js +3623 -0
  6. package/dist/cjs/ticketlayer-elements.cjs.js +2 -2
  7. package/dist/cjs/tl-buy-modal.cjs.entry.js +4 -4
  8. package/dist/cjs/tl-buy-tickets-button.cjs.entry.js +89 -71
  9. package/dist/cjs/tl-buy-tickets-wrapper.cjs.entry.js +62 -31
  10. package/dist/cjs/tl-cart-badge.cjs.entry.js +75 -62
  11. package/dist/cjs/tl-cart-drawer.cjs.entry.js +52 -24
  12. package/dist/cjs/tl-cart.cjs.entry.js +72 -98
  13. package/dist/cjs/tl-checkout-wrapper.cjs.entry.js +52 -30
  14. package/dist/cjs/tl-event-card.cjs.entry.js +44 -105
  15. package/dist/cjs/tl-event-list.cjs.entry.js +73 -36
  16. package/dist/cjs/tl-login.cjs.entry.js +75 -141
  17. package/dist/cjs/tl-my-orders.cjs.entry.js +53 -92
  18. package/dist/cjs/tl-occurrence-selector_2.cjs.entry.js +205 -641
  19. package/dist/cjs/tl-order-confirmation.cjs.entry.js +72 -105
  20. package/dist/cjs/tl-order-tickets_2.cjs.entry.js +50 -76
  21. package/dist/cjs/tl-promo-code.cjs.entry.js +51 -47
  22. package/dist/cjs/tl-seat-map.cjs.entry.js +4 -4
  23. package/dist/cjs/web-query-Ce73jB4k.js +16 -0
  24. package/dist/collection/components/tl-buy-modal/tl-buy-modal.css +12 -19
  25. package/dist/collection/components/tl-buy-modal/tl-buy-modal.js +2 -2
  26. package/dist/collection/components/tl-buy-tickets-button/tl-buy-tickets-button.css +41 -4
  27. package/dist/collection/components/tl-buy-tickets-button/tl-buy-tickets-button.js +105 -76
  28. package/dist/collection/components/tl-buy-tickets-wrapper/tl-buy-tickets-wrapper.css +2 -2
  29. package/dist/collection/components/tl-buy-tickets-wrapper/tl-buy-tickets-wrapper.js +73 -30
  30. package/dist/collection/components/tl-cart/tl-cart.css +52 -51
  31. package/dist/collection/components/tl-cart/tl-cart.js +82 -101
  32. package/dist/collection/components/tl-cart-badge/tl-cart-badge.css +11 -11
  33. package/dist/collection/components/tl-cart-badge/tl-cart-badge.js +62 -62
  34. package/dist/collection/components/tl-cart-drawer/tl-cart-drawer.css +6 -6
  35. package/dist/collection/components/tl-cart-drawer/tl-cart-drawer.js +56 -24
  36. package/dist/collection/components/tl-checkout-wrapper/tl-checkout-wrapper.css +2 -2
  37. package/dist/collection/components/tl-checkout-wrapper/tl-checkout-wrapper.js +61 -29
  38. package/dist/collection/components/tl-event-card/event-card-adapter.js +11 -23
  39. package/dist/collection/components/tl-event-card/tl-event-card.css +22 -22
  40. package/dist/collection/components/tl-event-card/tl-event-card.js +51 -84
  41. package/dist/collection/components/tl-event-list/tl-event-list.css +17 -17
  42. package/dist/collection/components/tl-event-list/tl-event-list.js +82 -38
  43. package/dist/collection/components/tl-login/tl-login.css +26 -26
  44. package/dist/collection/components/tl-login/tl-login.js +83 -147
  45. package/dist/collection/components/tl-my-orders/tl-my-orders.css +40 -40
  46. package/dist/collection/components/tl-my-orders/tl-my-orders.js +58 -96
  47. package/dist/collection/components/tl-occurrence-selector/tl-occurrence-selector.css +54 -65
  48. package/dist/collection/components/tl-occurrence-selector/tl-occurrence-selector.js +137 -516
  49. package/dist/collection/components/tl-order-confirmation/tl-order-confirmation.css +38 -38
  50. package/dist/collection/components/tl-order-confirmation/tl-order-confirmation.js +81 -113
  51. package/dist/collection/components/tl-order-tickets/tl-order-tickets.css +9 -9
  52. package/dist/collection/components/tl-order-tickets/tl-order-tickets.js +57 -92
  53. package/dist/collection/components/tl-promo-code/tl-promo-code.css +25 -25
  54. package/dist/collection/components/tl-promo-code/tl-promo-code.js +55 -50
  55. package/dist/collection/components/tl-seat-map/tl-seat-map.css +10 -10
  56. package/dist/collection/components/tl-seat-map/tl-seat-map.js +2 -2
  57. package/dist/collection/components/tl-ticket/tl-ticket.css +13 -13
  58. package/dist/collection/components/tl-ticket-selector/tl-ticket-selector.css +74 -49
  59. package/dist/collection/components/tl-ticket-selector/tl-ticket-selector.js +95 -135
  60. package/dist/collection/utils/cart-totals.js +9 -0
  61. package/dist/collection/utils/order-summary.js +15 -99
  62. package/dist/collection/utils/testing/deep-text.js +29 -0
  63. package/dist/collection/utils/testing/fixtures.js +290 -0
  64. package/dist/collection/utils/testing/mock-sdk.js +13 -2
  65. package/dist/collection/utils/web-query.js +12 -0
  66. package/dist/collection/utils/web-storage.js +22 -0
  67. package/dist/components/ticket-selector.js +1 -0
  68. package/dist/components/tl-buy-modal.js +1 -1
  69. package/dist/components/tl-buy-tickets-button.js +1 -1
  70. package/dist/components/tl-buy-tickets-wrapper2.js +1 -1
  71. package/dist/components/tl-cart-badge.js +1 -1
  72. package/dist/components/tl-cart-drawer.js +1 -1
  73. package/dist/components/tl-cart2.js +1 -1
  74. package/dist/components/tl-checkout-wrapper2.js +1 -1
  75. package/dist/components/tl-event-card2.js +1 -1
  76. package/dist/components/tl-event-list.js +1 -1
  77. package/dist/components/tl-login2.js +1 -1
  78. package/dist/components/tl-my-orders.js +1 -1
  79. package/dist/components/tl-occurrence-selector2.js +1 -1
  80. package/dist/components/tl-order-confirmation.js +1 -1
  81. package/dist/components/tl-order-tickets2.js +1 -1
  82. package/dist/components/tl-promo-code.js +1 -1
  83. package/dist/components/tl-seat-map.js +1 -1
  84. package/dist/components/tl-ticket-selector2.js +1 -1
  85. package/dist/components/tl-ticket2.js +1 -1
  86. package/dist/components/web-query.js +1 -0
  87. package/dist/elements.docs.json +36 -36
  88. package/dist/esm/{index-CNX8hZa8.js → index-imfxp765.js} +1 -1
  89. package/dist/esm/index.js +2 -1
  90. package/dist/esm/loader.js +3 -3
  91. package/dist/esm/ticket-selector-BwChnHVC.js +3606 -0
  92. package/dist/esm/ticketlayer-elements.js +3 -3
  93. package/dist/esm/tl-buy-modal.entry.js +4 -4
  94. package/dist/esm/tl-buy-tickets-button.entry.js +90 -72
  95. package/dist/esm/tl-buy-tickets-wrapper.entry.js +63 -32
  96. package/dist/esm/tl-cart-badge.entry.js +76 -63
  97. package/dist/esm/tl-cart-drawer.entry.js +53 -25
  98. package/dist/esm/tl-cart.entry.js +73 -99
  99. package/dist/esm/tl-checkout-wrapper.entry.js +53 -31
  100. package/dist/esm/tl-event-card.entry.js +45 -106
  101. package/dist/esm/tl-event-list.entry.js +74 -37
  102. package/dist/esm/tl-login.entry.js +76 -142
  103. package/dist/esm/tl-my-orders.entry.js +54 -93
  104. package/dist/esm/tl-occurrence-selector_2.entry.js +206 -642
  105. package/dist/esm/tl-order-confirmation.entry.js +73 -106
  106. package/dist/esm/tl-order-tickets_2.entry.js +51 -77
  107. package/dist/esm/tl-promo-code.entry.js +52 -48
  108. package/dist/esm/tl-seat-map.entry.js +4 -4
  109. package/dist/esm/web-query-Bdbb2lk5.js +14 -0
  110. package/dist/ticketlayer-elements/index.esm.js +1 -1
  111. package/dist/ticketlayer-elements/p-45923d2c.entry.js +1 -0
  112. package/dist/ticketlayer-elements/p-492adc77.entry.js +1 -0
  113. package/dist/ticketlayer-elements/p-4cfc9e53.entry.js +1 -0
  114. package/dist/ticketlayer-elements/p-5135630e.entry.js +1 -0
  115. package/dist/ticketlayer-elements/p-5bbce3b5.entry.js +1 -0
  116. package/dist/ticketlayer-elements/p-7d547721.entry.js +1 -0
  117. package/dist/ticketlayer-elements/p-7fe7b6ba.entry.js +1 -0
  118. package/dist/ticketlayer-elements/p-8122f0c1.entry.js +1 -0
  119. package/dist/ticketlayer-elements/p-98d40869.entry.js +1 -0
  120. package/dist/ticketlayer-elements/p-Bdbb2lk5.js +1 -0
  121. package/dist/ticketlayer-elements/p-BwChnHVC.js +1 -0
  122. package/dist/ticketlayer-elements/p-abec290a.entry.js +1 -0
  123. package/dist/ticketlayer-elements/p-ac79a3f6.entry.js +1 -0
  124. package/dist/ticketlayer-elements/p-d01f4429.entry.js +1 -0
  125. package/dist/ticketlayer-elements/p-d7ffaf46.entry.js +1 -0
  126. package/dist/ticketlayer-elements/p-e7170f3c.entry.js +1 -0
  127. package/dist/ticketlayer-elements/p-e787e862.entry.js +1 -0
  128. package/dist/ticketlayer-elements/p-f1ff931f.entry.js +1 -0
  129. package/dist/ticketlayer-elements/p-imfxp765.js +3 -0
  130. package/dist/ticketlayer-elements/ticketlayer-elements.css +1 -1
  131. package/dist/ticketlayer-elements/ticketlayer-elements.esm.js +1 -1
  132. package/dist/types/components/tl-buy-tickets-button/tl-buy-tickets-button.d.ts +40 -8
  133. package/dist/types/components/tl-buy-tickets-wrapper/tl-buy-tickets-wrapper.d.ts +20 -1
  134. package/dist/types/components/tl-cart/tl-cart.d.ts +40 -32
  135. package/dist/types/components/tl-cart-badge/tl-cart-badge.d.ts +22 -7
  136. package/dist/types/components/tl-cart-drawer/tl-cart-drawer.d.ts +28 -5
  137. package/dist/types/components/tl-checkout-wrapper/tl-checkout-wrapper.d.ts +18 -1
  138. package/dist/types/components/tl-event-card/event-card-adapter.d.ts +9 -20
  139. package/dist/types/components/tl-event-card/tl-event-card.d.ts +25 -28
  140. package/dist/types/components/tl-event-list/tl-event-list.d.ts +46 -6
  141. package/dist/types/components/tl-login/tl-login.d.ts +68 -22
  142. package/dist/types/components/tl-my-orders/tl-my-orders.d.ts +30 -12
  143. package/dist/types/components/tl-occurrence-selector/tl-occurrence-selector.d.ts +73 -161
  144. package/dist/types/components/tl-order-confirmation/tl-order-confirmation.d.ts +48 -15
  145. package/dist/types/components/tl-order-tickets/tl-order-tickets.d.ts +29 -31
  146. package/dist/types/components/tl-promo-code/tl-promo-code.d.ts +28 -10
  147. package/dist/types/components/tl-ticket/tl-ticket.d.ts +2 -11
  148. package/dist/types/components/tl-ticket-selector/tl-ticket-selector.d.ts +61 -32
  149. package/dist/types/components.d.ts +302 -62
  150. package/dist/types/utils/cart-totals.d.ts +10 -0
  151. package/dist/types/utils/order-summary.d.ts +16 -65
  152. package/dist/types/utils/testing/deep-text.d.ts +13 -0
  153. package/dist/types/utils/testing/fixtures.d.ts +225 -0
  154. package/dist/types/utils/testing/mock-sdk.d.ts +14 -1
  155. package/dist/types/utils/web-query.d.ts +18 -0
  156. package/dist/types/utils/web-storage.d.ts +16 -0
  157. package/elements.catalogue.json +676 -55
  158. package/package.json +14 -6
  159. package/dist/cjs/order-summary-ZMkJ5bez.js +0 -116
  160. package/dist/components/order-summary.js +0 -1
  161. package/dist/esm/order-summary-BGekdjN9.js +0 -103
  162. package/dist/ticketlayer-elements/p-0b1d16f8.entry.js +0 -1
  163. package/dist/ticketlayer-elements/p-1471f6d8.entry.js +0 -1
  164. package/dist/ticketlayer-elements/p-1c51cbc1.entry.js +0 -1
  165. package/dist/ticketlayer-elements/p-5169f68b.entry.js +0 -1
  166. package/dist/ticketlayer-elements/p-895ba1f3.entry.js +0 -1
  167. package/dist/ticketlayer-elements/p-8d5722e1.entry.js +0 -1
  168. package/dist/ticketlayer-elements/p-917d8e09.entry.js +0 -1
  169. package/dist/ticketlayer-elements/p-9629029a.entry.js +0 -1
  170. package/dist/ticketlayer-elements/p-BGekdjN9.js +0 -1
  171. package/dist/ticketlayer-elements/p-CNX8hZa8.js +0 -3
  172. package/dist/ticketlayer-elements/p-a22714d0.entry.js +0 -1
  173. package/dist/ticketlayer-elements/p-bf73044b.entry.js +0 -1
  174. package/dist/ticketlayer-elements/p-e02079fa.entry.js +0 -1
  175. package/dist/ticketlayer-elements/p-e04ace15.entry.js +0 -1
  176. package/dist/ticketlayer-elements/p-e6fab1d5.entry.js +0 -1
  177. package/dist/ticketlayer-elements/p-f826b753.entry.js +0 -1
  178. package/dist/ticketlayer-elements/p-fa639d88.entry.js +0 -1
  179. package/dist/ticketlayer-elements/p-fbaca948.entry.js +0 -1
@@ -1 +0,0 @@
1
- import{r as t,h as n}from"./p-CNX8hZa8.js";import{w as r}from"./p-CqhvfyKV.js";const e=class{constructor(n){t(this,n),this.columns=2,this.tickets=[],this.loading=!0,this.error=null,this.issuing=!1,this.poll=0}watchOrder(){this.reset(),this.load()}async componentWillLoad(){await this.load()}disconnectedCallback(){this.stopPolling()}reset(){this.stopPolling(),this.poll=0,this.tickets=[],this.issuing=!1}stopPolling(){void 0!==this.timer&&(clearTimeout(this.timer),this.timer=void 0)}async load(){try{this.error=null;const t=await r(),n=t.getOrdersManager?.();if(!n)throw new Error("Tickets are not available");const o=await n.get(this.orderId);if(this.tickets=o?.tickets??[],this.tickets.length>0)this.issuing=!1,this.stopPolling();else{const t=e.POLL_DELAYS_MS[this.poll];this.issuing=void 0!==t,void 0!==t&&(this.poll+=1,this.stopPolling(),this.timer=setTimeout((()=>this.load()),t))}}catch(t){this.stopPolling(),this.issuing=!1,this.error=t instanceof Error?t.message:"Failed to load tickets"}finally{this.loading=!1}}render(){return this.loading?n("div",{class:"state"},"Loading tickets…"):this.error?n("div",{class:"state error"},this.error):0===this.tickets.length?this.issuing?n("div",{class:"state issuing",role:"status","aria-live":"polite"},n("span",{class:"spinner","aria-hidden":"true"}),"Preparing your tickets…"):n("div",{class:"state",role:"status"},"Your tickets are taking longer than usual. They will be emailed to you as soon as they are ready."):n("div",{class:`grid cols-${this.columns}`},this.tickets.map((t=>n("tl-ticket",{key:t.id,ticket:t,orderId:this.orderId}))))}static get watchers(){return{orderId:[{watchOrder:0}]}}};function o(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}e.POLL_DELAYS_MS=[1e3,1500,2e3,3e3,4e3,5e3,6e3,8e3,1e4,12e3],e.style=":host{display:block;font-family:var(--tl-font-family, system-ui, sans-serif)}.grid{display:grid;gap:var(--tl-spacing-4, 1rem);grid-template-columns:1fr}@media (min-width: 480px){.grid.cols-2{grid-template-columns:repeat(2, 1fr)}.grid.cols-3{grid-template-columns:repeat(3, 1fr)}}.state{padding:var(--tl-spacing-6, 1.5rem);text-align:center;color:var(--tl-muted-foreground, #6b7280);font-size:0.875rem}.state.error{color:var(--tl-error, #dc2626)}.state.issuing{display:flex;align-items:center;justify-content:center;gap:var(--tl-spacing-2, 0.5rem)}.spinner{width:0.875rem;height:0.875rem;border:2px solid var(--tl-border, #e5e7eb);border-top-color:var(--tl-primary, #6366f1);border-radius:50%;animation:tl-spin 0.7s linear infinite;flex:none}@keyframes tl-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.spinner{animation:none;border-top-color:var(--tl-border, #e5e7eb)}}";var i,s,u={};function c(){return s?i:(s=1,i=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then})}var a,f={},l={};function h(){if(a)return l;let t;a=1;const n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return l.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return 4*t+17},l.getSymbolTotalCodewords=function(t){return n[t]},l.getBCHDigit=function(t){let n=0;for(;0!==t;)n++,t>>>=1;return n},l.setToSJISFunction=function(n){if("function"!=typeof n)throw new Error('"toSJISFunc" is not a valid function.');t=n},l.isKanjiModeEnabled=function(){return void 0!==t},l.toSJIS=function(n){return t(n)},l}var d,w,m,p,g,v={};function y(){return d||(d=1,(t=v).L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(t){return t&&void 0!==t.bit&&t.bit>=0&&t.bit<4},t.from=function(n,r){if(t.isValid(n))return n;try{return function(n){if("string"!=typeof n)throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+n)}}(n)}catch(t){return r}}),v;var t}var b,E,k,x,A={},M={},T={},R={};function P(){if(x)return R;x=1;const t=y(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return R.getBlocksCount=function(r,e){switch(e){case t.L:return n[4*(r-1)+0];case t.M:return n[4*(r-1)+1];case t.Q:return n[4*(r-1)+2];case t.H:return n[4*(r-1)+3];default:return}},R.getTotalCodewordsCount=function(n,e){switch(e){case t.L:return r[4*(n-1)+0];case t.M:return r[4*(n-1)+1];case t.Q:return r[4*(n-1)+2];case t.H:return r[4*(n-1)+3];default:return}},R}var U,I,F,C,N={},_={};var B,q={},L={},$={};function z(){return B||(B=1,$.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),$}var Q,j,S,O={};function Z(){if(Q)return O;Q=1;const t="[0-9]+";let n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";n=n.replace(/u/g,"\\u");const r="(?:(?![A-Z0-9 $%*+\\-./:]|"+n+")(?:.|[\r\n]))+";O.KANJI=new RegExp(n,"g"),O.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),O.BYTE=new RegExp(r,"g"),O.NUMERIC=new RegExp(t,"g"),O.ALPHANUMERIC=new RegExp("[A-Z $%*+\\-./:]+","g");const e=new RegExp("^"+n+"$"),o=new RegExp("^"+t+"$"),i=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return O.testKanji=function(t){return e.test(t)},O.testNumeric=function(t){return o.test(t)},O.testAlphanumeric=function(t){return i.test(t)},O}function D(){return j||(j=1,function(t){const n=z(),r=Z();t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(t,r){if(!t.ccBits)throw new Error("Invalid mode: "+t);if(!n.isValid(r))throw new Error("Invalid version: "+r);return r>=1&&r<10?t.ccBits[0]:r<27?t.ccBits[1]:t.ccBits[2]},t.getBestModeForData=function(n){return r.testNumeric(n)?t.NUMERIC:r.testAlphanumeric(n)?t.ALPHANUMERIC:r.testKanji(n)?t.KANJI:t.BYTE},t.toString=function(t){if(t&&t.id)return t.id;throw new Error("Invalid mode")},t.isValid=function(t){return t&&t.bit&&t.ccBits},t.from=function(n,r){if(t.isValid(n))return n;try{return function(n){if("string"!=typeof n)throw new Error("Param is not a string");switch(n.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+n)}}(n)}catch(t){return r}}}(L)),L}var H,J,K,V,W,Y,X,G,tt,nt,rt,et,ot={},it={},st={exports:{}};function ut(){return nt||(nt=1,function(t){var n={single_source_shortest_paths:function(t,r,e){var o={},i={};i[r]=0;var s,u,c,a,f,l,h=n.PriorityQueue.make();for(h.push(r,0);!h.empty();)for(c in a=(s=h.pop()).cost,f=t[u=s.value]||{})f.hasOwnProperty(c)&&(l=a+f[c],(void 0===i[c]||i[c]>l)&&(i[c]=l,h.push(c,l),o[c]=u));if(void 0!==e&&void 0===i[e]){var d=["Could not find a path from ",r," to ",e,"."].join("");throw new Error(d)}return o},extract_shortest_path_from_predecessor_list:function(t,n){for(var r=[],e=n;e;)r.push(e),e=t[e];return r.reverse(),r},find_path:function(t,r,e){var o=n.single_source_shortest_paths(t,r,e);return n.extract_shortest_path_from_predecessor_list(o,e)},PriorityQueue:{make:function(t){var r,e=n.PriorityQueue,o={};for(r in t=t||{},e)e.hasOwnProperty(r)&&(o[r]=e[r]);return o.queue=[],o.sorter=t.sorter||e.default_sorter,o},default_sorter:function(t,n){return t.cost-n.cost},push:function(t,n){this.queue.push({value:t,cost:n}),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};t.exports=n}(st)),st.exports}function ct(){if(et)return f;et=1;const t=h(),n=y(),r=function(){if(m)return w;function t(){this.buffer=[],this.length=0}return m=1,t.prototype={get:function(t){const n=Math.floor(t/8);return 1==(this.buffer[n]>>>7-t%8&1)},put:function(t,n){for(let r=0;r<n;r++)this.putBit(1==(t>>>n-r-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){const n=Math.floor(this.length/8);this.buffer.length<=n&&this.buffer.push(0),t&&(this.buffer[n]|=128>>>this.length%8),this.length++}},w=t}(),e=function(){if(g)return p;function t(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return g=1,t.prototype.set=function(t,n,r,e){const o=t*this.size+n;this.data[o]=r,e&&(this.reservedBit[o]=!0)},t.prototype.get=function(t,n){return this.data[t*this.size+n]},t.prototype.xor=function(t,n,r){this.data[t*this.size+n]^=r},t.prototype.isReserved=function(t,n){return this.reservedBit[t*this.size+n]},p=t}(),o=(b||(b=1,function(t){const n=h().getSymbolSize;t.getRowColCoords=function(t){if(1===t)return[];const r=Math.floor(t/7)+2,e=n(t),o=145===e?26:2*Math.ceil((e-13)/(2*r-2)),i=[e-7];for(let t=1;t<r-1;t++)i[t]=i[t-1]-o;return i.push(6),i.reverse()},t.getPositions=function(n){const r=[],e=t.getRowColCoords(n),o=e.length;for(let t=0;t<o;t++)for(let n=0;n<o;n++)0===t&&0===n||0===t&&n===o-1||t===o-1&&0===n||r.push([e[t],e[n]]);return r}}(A)),A),i=function(){if(E)return M;E=1;const t=h().getSymbolSize;return M.getPositions=function(n){const r=t(n);return[[0,0],[r-7,0],[0,r-7]]},M}(),s=(k||(k=1,function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};function n(n,r,e){switch(n){case t.Patterns.PATTERN000:return(r+e)%2==0;case t.Patterns.PATTERN001:return r%2==0;case t.Patterns.PATTERN010:return e%3==0;case t.Patterns.PATTERN011:return(r+e)%3==0;case t.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(e/3))%2==0;case t.Patterns.PATTERN101:return r*e%2+r*e%3==0;case t.Patterns.PATTERN110:return(r*e%2+r*e%3)%2==0;case t.Patterns.PATTERN111:return(r*e%3+(r+e)%2)%2==0;default:throw new Error("bad maskPattern:"+n)}}t.isValid=function(t){return null!=t&&""!==t&&!isNaN(t)&&t>=0&&t<=7},t.from=function(n){return t.isValid(n)?parseInt(n,10):void 0},t.getPenaltyN1=function(t){const n=t.size;let r=0,e=0,o=0,i=null,s=null;for(let u=0;u<n;u++){e=o=0,i=s=null;for(let c=0;c<n;c++){let n=t.get(u,c);n===i?e++:(e>=5&&(r+=e-5+3),i=n,e=1),n=t.get(c,u),n===s?o++:(o>=5&&(r+=o-5+3),s=n,o=1)}e>=5&&(r+=e-5+3),o>=5&&(r+=o-5+3)}return r},t.getPenaltyN2=function(t){const n=t.size;let r=0;for(let e=0;e<n-1;e++)for(let o=0;o<n-1;o++){const n=t.get(e,o)+t.get(e,o+1)+t.get(e+1,o)+t.get(e+1,o+1);4!==n&&0!==n||r++}return 3*r},t.getPenaltyN3=function(t){const n=t.size;let r=0,e=0,o=0;for(let i=0;i<n;i++){e=o=0;for(let s=0;s<n;s++)e=e<<1&2047|t.get(i,s),s>=10&&(1488===e||93===e)&&r++,o=o<<1&2047|t.get(s,i),s>=10&&(1488===o||93===o)&&r++}return 40*r},t.getPenaltyN4=function(t){let n=0;const r=t.data.length;for(let e=0;e<r;e++)n+=t.data[e];return 10*Math.abs(Math.ceil(100*n/r/5)-10)},t.applyMask=function(t,r){const e=r.size;for(let o=0;o<e;o++)for(let i=0;i<e;i++)r.isReserved(i,o)||r.xor(i,o,n(t,i,o))},t.getBestMask=function(n,r){const e=Object.keys(t.Patterns).length;let o=0,i=1/0;for(let s=0;s<e;s++){r(s),t.applyMask(s,n);const e=t.getPenaltyN1(n)+t.getPenaltyN2(n)+t.getPenaltyN3(n)+t.getPenaltyN4(n);t.applyMask(s,n),e<i&&(i=e,o=s)}return o}}(T)),T),u=P(),c=function(){if(C)return F;C=1;const t=(I||(I=1,function(t){const n=function(){if(U)return _;U=1;const t=new Uint8Array(512),n=new Uint8Array(256);return function(){let r=1;for(let e=0;e<255;e++)t[e]=r,n[r]=e,r<<=1,256&r&&(r^=285);for(let n=255;n<512;n++)t[n]=t[n-255]}(),_.log=function(t){if(t<1)throw new Error("log("+t+")");return n[t]},_.exp=function(n){return t[n]},_.mul=function(r,e){return 0===r||0===e?0:t[n[r]+n[e]]},_}();t.mul=function(t,r){const e=new Uint8Array(t.length+r.length-1);for(let o=0;o<t.length;o++)for(let i=0;i<r.length;i++)e[o+i]^=n.mul(t[o],r[i]);return e},t.mod=function(t,r){let e=new Uint8Array(t);for(;e.length-r.length>=0;){const t=e[0];for(let o=0;o<r.length;o++)e[o]^=n.mul(r[o],t);let o=0;for(;o<e.length&&0===e[o];)o++;e=e.slice(o)}return e},t.generateECPolynomial=function(r){let e=new Uint8Array([1]);for(let o=0;o<r;o++)e=t.mul(e,new Uint8Array([1,n.exp(o)]));return e}}(N)),N);function n(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}return n.prototype.initialize=function(n){this.degree=n,this.genPoly=t.generateECPolynomial(this.degree)},n.prototype.encode=function(n){if(!this.genPoly)throw new Error("Encoder not initialized");const r=new Uint8Array(n.length+this.degree);r.set(n);const e=t.mod(r,this.genPoly),o=this.degree-e.length;if(o>0){const t=new Uint8Array(this.degree);return t.set(e,o),t}return e},F=n}(),a=(S||(S=1,function(t){const n=h(),r=P(),e=y(),o=D(),i=z(),s=n.getBCHDigit(7973);function u(t,n){return o.getCharCountIndicator(t,n)+4}function c(t,n){let r=0;return t.forEach((function(t){const e=u(t.mode,n);r+=e+t.getBitsLength()})),r}t.from=function(t,n){return i.isValid(t)?parseInt(t,10):n},t.getCapacity=function(t,e,s){if(!i.isValid(t))throw new Error("Invalid QR Code version");void 0===s&&(s=o.BYTE);const c=8*(n.getSymbolTotalCodewords(t)-r.getTotalCodewordsCount(t,e));if(s===o.MIXED)return c;const a=c-u(s,t);switch(s){case o.NUMERIC:return Math.floor(a/10*3);case o.ALPHANUMERIC:return Math.floor(a/11*2);case o.KANJI:return Math.floor(a/13);default:return Math.floor(a/8)}},t.getBestVersionForData=function(n,r){let i;const s=e.from(r,e.M);if(Array.isArray(n)){if(n.length>1)return function(n,r){for(let e=1;e<=40;e++)if(c(n,e)<=t.getCapacity(e,r,o.MIXED))return e}(n,s);if(0===n.length)return 1;i=n[0]}else i=n;return function(n,r,e){for(let o=1;o<=40;o++)if(r<=t.getCapacity(o,e,n))return o}(i.mode,i.getLength(),s)},t.getEncodedBits=function(t){if(!i.isValid(t)||t<7)throw new Error("Invalid QR Code version");let r=t<<12;for(;n.getBCHDigit(r)-s>=0;)r^=7973<<n.getBCHDigit(r)-s;return t<<12|r}}(q)),q),l=function(){if(H)return ot;H=1;const t=h(),n=t.getBCHDigit(1335);return ot.getEncodedBits=function(r,e){const o=r.bit<<3|e;let i=o<<10;for(;t.getBCHDigit(i)-n>=0;)i^=1335<<t.getBCHDigit(i)-n;return 21522^(o<<10|i)},ot}(),d=D(),v=(rt||(rt=1,function(t){const n=D(),r=function(){if(K)return J;K=1;const t=D();function n(n){this.mode=t.NUMERIC,this.data=n.toString()}return n.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){let n,r,e;for(n=0;n+3<=this.data.length;n+=3)r=this.data.substr(n,3),e=parseInt(r,10),t.put(e,10);const o=this.data.length-n;o>0&&(r=this.data.substr(n),e=parseInt(r,10),t.put(e,3*o+1))},J=n}(),e=function(){if(W)return V;W=1;const t=D(),n=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function r(n){this.mode=t.ALPHANUMERIC,this.data=n}return r.getBitsLength=function(t){return 11*Math.floor(t/2)+t%2*6},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(t){let r;for(r=0;r+2<=this.data.length;r+=2){let e=45*n.indexOf(this.data[r]);e+=n.indexOf(this.data[r+1]),t.put(e,11)}this.data.length%2&&t.put(n.indexOf(this.data[r]),6)},V=r}(),o=function(){if(X)return Y;X=1;const t=D();function n(n){this.mode=t.BYTE,this.data="string"==typeof n?(new TextEncoder).encode(n):new Uint8Array(n)}return n.getBitsLength=function(t){return 8*t},n.prototype.getLength=function(){return this.data.length},n.prototype.getBitsLength=function(){return n.getBitsLength(this.data.length)},n.prototype.write=function(t){for(let n=0,r=this.data.length;n<r;n++)t.put(this.data[n],8)},Y=n}(),i=function(){if(tt)return G;tt=1;const t=D(),n=h();function r(n){this.mode=t.KANJI,this.data=n}return r.getBitsLength=function(t){return 13*t},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(t){let r;for(r=0;r<this.data.length;r++){let e=n.toSJIS(this.data[r]);if(e>=33088&&e<=40956)e-=33088;else{if(!(e>=57408&&e<=60351))throw new Error("Invalid SJIS character: "+this.data[r]+"\nMake sure your charset is UTF-8");e-=49472}e=192*(e>>>8&255)+(255&e),t.put(e,13)}},G=r}(),s=Z(),u=h(),c=ut();function a(t){return unescape(encodeURIComponent(t)).length}function f(t,n,r){const e=[];let o;for(;null!==(o=t.exec(r));)e.push({data:o[0],index:o.index,mode:n,length:o[0].length});return e}function l(t){const r=f(s.NUMERIC,n.NUMERIC,t),e=f(s.ALPHANUMERIC,n.ALPHANUMERIC,t);let o,i;return u.isKanjiModeEnabled()?(o=f(s.BYTE,n.BYTE,t),i=f(s.KANJI,n.KANJI,t)):(o=f(s.BYTE_KANJI,n.BYTE,t),i=[]),r.concat(e,o,i).sort((function(t,n){return t.index-n.index})).map((function(t){return{data:t.data,mode:t.mode,length:t.length}}))}function d(t,s){switch(s){case n.NUMERIC:return r.getBitsLength(t);case n.ALPHANUMERIC:return e.getBitsLength(t);case n.KANJI:return i.getBitsLength(t);case n.BYTE:return o.getBitsLength(t)}}function w(t,s){let c;const a=n.getBestModeForData(t);if(c=n.from(s,a),c!==n.BYTE&&c.bit<a.bit)throw new Error('"'+t+'" cannot be encoded with mode '+n.toString(c)+".\n Suggested mode is: "+n.toString(a));switch(c!==n.KANJI||u.isKanjiModeEnabled()||(c=n.BYTE),c){case n.NUMERIC:return new r(t);case n.ALPHANUMERIC:return new e(t);case n.KANJI:return new i(t);case n.BYTE:return new o(t)}}t.fromArray=function(t){return t.reduce((function(t,n){return"string"==typeof n?t.push(w(n,null)):n.data&&t.push(w(n.data,n.mode)),t}),[])},t.fromString=function(r,e){const o=function(t,r){const e={},o={start:{}};let i=["start"];for(let s=0;s<t.length;s++){const u=t[s],c=[];for(let t=0;t<u.length;t++){const a=u[t],f=""+s+t;c.push(f),e[f]={node:a,lastCount:0},o[f]={};for(let t=0;t<i.length;t++){const s=i[t];e[s]&&e[s].node.mode===a.mode?(o[s][f]=d(e[s].lastCount+a.length,a.mode)-d(e[s].lastCount,a.mode),e[s].lastCount+=a.length):(e[s]&&(e[s].lastCount=a.length),o[s][f]=d(a.length,a.mode)+4+n.getCharCountIndicator(a.mode,r))}}i=c}for(let t=0;t<i.length;t++)o[i[t]].end=0;return{map:o,table:e}}(function(t){const r=[];for(let e=0;e<t.length;e++){const o=t[e];switch(o.mode){case n.NUMERIC:r.push([o,{data:o.data,mode:n.ALPHANUMERIC,length:o.length},{data:o.data,mode:n.BYTE,length:o.length}]);break;case n.ALPHANUMERIC:r.push([o,{data:o.data,mode:n.BYTE,length:o.length}]);break;case n.KANJI:r.push([o,{data:o.data,mode:n.BYTE,length:a(o.data)}]);break;case n.BYTE:r.push([{data:o.data,mode:n.BYTE,length:a(o.data)}])}}return r}(l(r,u.isKanjiModeEnabled())),e),i=c.find_path(o.map,"start","end"),s=[];for(let t=1;t<i.length-1;t++)s.push(o.table[i[t]].node);return t.fromArray(s.reduce((function(t,n){const r=t.length-1>=0?t[t.length-1]:null;return r&&r.mode===n.mode?(t[t.length-1].data+=n.data,t):(t.push(n),t)}),[]))},t.rawSplit=function(n){return t.fromArray(l(n,u.isKanjiModeEnabled()))}}(it)),it);function x(t,n,r){const e=t.size,o=l.getEncodedBits(n,r);let i,s;for(i=0;i<15;i++)s=1==(o>>i&1),t.set(i<6?i:i<8?i+1:e-15+i,8,s,!0),t.set(8,i<8?e-i-1:i<9?15-i-1+1:15-i-1,s,!0);t.set(e-8,8,1,!0)}function R(n,f,l,h){let w;if(Array.isArray(n))w=v.fromArray(n);else{if("string"!=typeof n)throw new Error("Invalid data");{let t=f;if(!t){const r=v.rawSplit(n);t=a.getBestVersionForData(r,l)}w=v.fromString(n,t||40)}}const m=a.getBestVersionForData(w,l);if(!m)throw new Error("The amount of data is too big to be stored in a QR Code");if(f){if(f<m)throw new Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+m+".\n")}else f=m;const p=function(n,e,o){const i=new r;o.forEach((function(t){i.put(t.mode.bit,4),i.put(t.getLength(),d.getCharCountIndicator(t.mode,n)),t.write(i)}));const s=8*(t.getSymbolTotalCodewords(n)-u.getTotalCodewordsCount(n,e));for(i.getLengthInBits()+4<=s&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);const a=(s-i.getLengthInBits())/8;for(let t=0;t<a;t++)i.put(t%2?17:236,8);return function(n,r,e){const o=t.getSymbolTotalCodewords(r),i=o-u.getTotalCodewordsCount(r,e),s=u.getBlocksCount(r,e),a=s-o%s,f=Math.floor(o/s),l=Math.floor(i/s),h=l+1,d=f-l,w=new c(d);let m=0;const p=new Array(s),g=new Array(s);let v=0;const y=new Uint8Array(n.buffer);for(let t=0;t<s;t++){const n=t<a?l:h;p[t]=y.slice(m,m+n),g[t]=w.encode(p[t]),m+=n,v=Math.max(v,n)}const b=new Uint8Array(o);let E,k,x=0;for(E=0;E<v;E++)for(k=0;k<s;k++)E<p[k].length&&(b[x++]=p[k][E]);for(E=0;E<d;E++)for(k=0;k<s;k++)b[x++]=g[k][E];return b}(i,n,e)}(f,l,w),g=t.getSymbolSize(f),y=new e(g);return function(t,n){const r=t.size,e=i.getPositions(n);for(let n=0;n<e.length;n++){const o=e[n][0],i=e[n][1];for(let n=-1;n<=7;n++)if(!(o+n<=-1||r<=o+n))for(let e=-1;e<=7;e++)i+e<=-1||r<=i+e||t.set(o+n,i+e,n>=0&&n<=6&&(0===e||6===e)||e>=0&&e<=6&&(0===n||6===n)||n>=2&&n<=4&&e>=2&&e<=4,!0)}}(y,f),function(t){const n=t.size;for(let r=8;r<n-8;r++){const n=r%2==0;t.set(r,6,n,!0),t.set(6,r,n,!0)}}(y),function(t,n){const r=o.getPositions(n);for(let n=0;n<r.length;n++){const e=r[n][0],o=r[n][1];for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)t.set(e+n,o+r,-2===n||2===n||-2===r||2===r||0===n&&0===r,!0)}}(y,f),x(y,l,0),f>=7&&function(t,n){const r=t.size,e=a.getEncodedBits(n);let o,i,s;for(let n=0;n<18;n++)o=Math.floor(n/3),i=n%3+r-8-3,s=1==(e>>n&1),t.set(o,i,s,!0),t.set(i,o,s,!0)}(y,f),function(t,n){const r=t.size;let e=-1,o=r-1,i=7,s=0;for(let u=r-1;u>0;u-=2)for(6===u&&u--;;){for(let r=0;r<2;r++)if(!t.isReserved(o,u-r)){let e=!1;s<n.length&&(e=1==(n[s]>>>i&1)),t.set(o,u-r,e),i--,-1===i&&(s++,i=7)}if(o+=e,o<0||r<=o){o-=e,e=-e;break}}}(y,p),isNaN(h)&&(h=s.getBestMask(y,x.bind(null,y,l))),s.applyMask(h,y),x(y,l,h),{modules:y,version:f,errorCorrectionLevel:l,maskPattern:h,segments:w}}return f.create=function(r,e){if(void 0===r||""===r)throw new Error("No input text");let o,i,u=n.M;return void 0!==e&&(u=n.from(e.errorCorrectionLevel,n.M),o=a.from(e.version),i=s.from(e.maskPattern),e.toSJISFunc&&t.setToSJISFunction(e.toSJISFunc)),R(r,o,u,i)},f}var at,ft,lt={},ht={};function dt(){return at||(at=1,function(t){function n(t){if("number"==typeof t&&(t=t.toString()),"string"!=typeof t)throw new Error("Color should be defined as hex string");let n=t.slice().replace("#","").split("");if(n.length<3||5===n.length||n.length>8)throw new Error("Invalid hex color: "+t);3!==n.length&&4!==n.length||(n=Array.prototype.concat.apply([],n.map((function(t){return[t,t]})))),6===n.length&&n.push("F","F");const r=parseInt(n.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+n.slice(0,6).join("")}}t.getOptions=function(t){t||(t={}),t.color||(t.color={});const r=t.width&&t.width>=21?t.width:void 0;return{width:r,scale:r?4:t.scale||4,margin:null==t.margin||t.margin<0?4:t.margin,color:{dark:n(t.color.dark||"#000000ff"),light:n(t.color.light||"#ffffffff")},type:t.type,rendererOpts:t.rendererOpts||{}}},t.getScale=function(t,n){return n.width&&n.width>=t+2*n.margin?n.width/(t+2*n.margin):n.scale},t.getImageWidth=function(n,r){const e=t.getScale(n,r);return Math.floor((n+2*r.margin)*e)},t.qrToImageData=function(n,r,e){const o=r.modules.size,i=r.modules.data,s=t.getScale(o,e),u=Math.floor((o+2*e.margin)*s),c=e.margin*s,a=[e.color.light,e.color.dark];for(let t=0;t<u;t++)for(let r=0;r<u;r++){let f=4*(t*u+r),l=e.color.light;t>=c&&r>=c&&t<u-c&&r<u-c&&(l=a[i[Math.floor((t-c)/s)*o+Math.floor((r-c)/s)]?1:0]),n[f++]=l.r,n[f++]=l.g,n[f++]=l.b,n[f]=l.a}}}(ht)),ht}var wt,mt,pt={};var gt=function(){if(mt)return u;mt=1;const t=c(),n=ct(),r=(ft||(ft=1,function(t){const n=dt();t.render=function(t,r,e){let o=e,i=r;void 0!==o||r&&r.getContext||(o=r,r=void 0),r||(i=function(){try{return document.createElement("canvas")}catch(t){throw new Error("You need to specify a canvas element")}}()),o=n.getOptions(o);const s=n.getImageWidth(t.modules.size,o),u=i.getContext("2d"),c=u.createImageData(s,s);return n.qrToImageData(c.data,t,o),function(t,n,r){t.clearRect(0,0,n.width,n.height),n.style||(n.style={}),n.height=r,n.width=r,n.style.height=r+"px",n.style.width=r+"px"}(u,i,s),u.putImageData(c,0,0),i},t.renderToDataURL=function(n,r,e){let o=e;return void 0!==o||r&&r.getContext||(o=r,r=void 0),o||(o={}),t.render(n,r,o).toDataURL(o.type||"image/png",(o.rendererOpts||{}).quality)}}(lt)),lt),e=function(){if(wt)return pt;wt=1;const t=dt();function n(t,n){const r=t.a/255,e=n+'="'+t.hex+'"';return r<1?e+" "+n+'-opacity="'+r.toFixed(2).slice(1)+'"':e}function r(t,n,r){let e=t+n;return void 0!==r&&(e+=" "+r),e}return pt.render=function(e,o,i){const s=t.getOptions(o),u=e.modules.size,c=e.modules.data,a=u+2*s.margin,f=s.color.light.a?"<path "+n(s.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",l="<path "+n(s.color.dark,"stroke")+' d="'+function(t,n,e){let o="",i=0,s=!1,u=0;for(let c=0;c<t.length;c++){const a=Math.floor(c%n),f=Math.floor(c/n);a||s||(s=!0),t[c]?(u++,c>0&&a>0&&t[c-1]||(o+=s?r("M",a+e,.5+f+e):r("m",i,0),i=0,s=!1),a+1<n&&t[c+1]||(o+=r("h",u),u=0)):i++}return o}(c,u,s.margin)+'"/>',h='<svg xmlns="http://www.w3.org/2000/svg" '+(s.width?'width="'+s.width+'" height="'+s.width+'" ':"")+'viewBox="0 0 '+a+" "+a+'" shape-rendering="crispEdges">'+f+l+"</svg>\n";return"function"==typeof i&&i(null,h),h},pt}();function o(r,e,o,i,s){const u=[].slice.call(arguments,1),c=u.length,a="function"==typeof u[c-1];if(!a&&!t())throw new Error("Callback required as last argument");if(!a){if(c<1)throw new Error("Too few arguments provided");return 1===c?(o=e,e=i=void 0):2!==c||e.getContext||(i=o,o=e,e=void 0),new Promise((function(t,s){try{const s=n.create(o,i);t(r(s,e,i))}catch(t){s(t)}}))}if(c<2)throw new Error("Too few arguments provided");2===c?(s=o,o=e,e=i=void 0):3===c&&(e.getContext&&void 0===s?(s=i,i=void 0):(s=i,i=o,o=e,e=void 0));try{const t=n.create(o,i);s(null,r(t,e,i))}catch(t){s(t)}}return u.create=n.create,u.toCanvas=o.bind(null,r.render),u.toDataURL=o.bind(null,r.renderToDataURL),u.toString=o.bind(null,(function(t,n,r){return e.render(t,r)})),u}(),vt=o(gt);const yt=class{constructor(n){t(this,n),this.qrSvg="",this.downloading=!1}async generateQr(){this.ticket?.barcode&&(this.qrSvg=await vt.toString(this.ticket.barcode,{type:"svg",margin:0,errorCorrectionLevel:"M"}))}async componentWillLoad(){await this.generateQr()}async download(){try{this.downloading=!0;const t=await r(),n=t.getOrdersManager?.();if(!n)throw new Error("Ticket downloads are not available");const e=await n.ticketPdf(this.orderId,this.ticket.id),o=URL.createObjectURL(e),i=document.createElement("a");i.href=o,i.download=`ticket-${this.ticket.id}.pdf`,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(o)}catch(t){console.error("[tl-ticket] download failed",t)}finally{this.downloading=!1}}render(){const t=this.ticket;if(!t)return null;const r="fully_redeemed"===t.admissionStatus,e=["cancelled","expired"].includes(t.status),o=r||e;return n("div",{class:"ticket"},n("div",{class:"qr-wrap"},n("div",{class:{qr:!0,inactive:o},innerHTML:this.qrSvg}),o&&n("span",{class:"stamp"},r?"Used":"Void")),n("p",{class:"name"},t.name),t.seatLabel&&n("p",{class:"meta"},"Seat ",t.seatLabel),t.holderName&&n("p",{class:"meta"},t.holderName),n("p",{class:"barcode"},t.barcode),n("button",{class:"download",disabled:this.downloading,onClick:()=>this.download()},this.downloading?"Preparing…":"Download PDF"))}static get watchers(){return{ticket:[{generateQr:0}]}}};yt.style=":host{display:block;font-family:var(--tl-font-family, system-ui, sans-serif)}.ticket{border:1px solid var(--tl-border, #e5e7eb);border-radius:var(--tl-radius-lg, 0.75rem);background:var(--tl-card, #ffffff);padding:var(--tl-spacing-5, 1.25rem);text-align:center}.qr-wrap{position:relative;width:160px;height:160px;margin:0 auto}.qr{width:160px;height:160px}.qr svg{width:100%;height:100%;display:block}.qr.inactive{opacity:0.3}.stamp{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);padding:0.25rem 0.5rem;border-radius:var(--tl-radius-sm, 0.25rem);background:rgba(17, 24, 39, 0.85);color:#ffffff;font-size:0.7rem;font-weight:700;text-transform:uppercase;letter-spacing:0.05em}.name{margin:1rem 0 0;font-weight:600;color:var(--tl-foreground, #111827)}.meta{margin:0.125rem 0 0;font-size:0.875rem;color:var(--tl-muted-foreground, #6b7280)}.barcode{margin:0.25rem 0 0;font-family:ui-monospace, monospace;font-size:0.625rem;color:var(--tl-muted-foreground, #9ca3af);word-break:break-all}.download{margin-top:0.75rem;padding:0.375rem 0.75rem;border:1px solid var(--tl-border, #e5e7eb);border-radius:var(--tl-radius-md, 0.5rem);background:transparent;color:var(--tl-foreground, #111827);font-size:0.875rem;font-weight:500;cursor:pointer}.download:hover{background:var(--tl-muted, #f3f4f6)}.download:disabled{opacity:0.5;cursor:default}";export{e as tl_order_tickets,yt as tl_ticket}
@@ -1 +0,0 @@
1
- import{r as i,c as t,h as s}from"./p-CNX8hZa8.js";import{w as e}from"./p-CqhvfyKV.js";import{e as n}from"./p-BGekdjN9.js";const l=class{constructor(s){i(this,s),this.tlAuthChanged=t(this,"tlAuthChanged"),this.tlMagicLinkSent=t(this,"tlMagicLinkSent"),this.tlError=t(this,"tlError"),this.heading="Sign in",this.allowCodeEntry=!0,this.phase="email",this.email="",this.code="",this.busy=!1,this.error=null,this.notice=null,this.customer=null,this.auth=null,this.unsubscribes=[],this.urlCodeUsed=!1,this.handleEmailInput=i=>{this.email=i.target.value,this.error=null},this.handleCodeInput=i=>{this.code=i.target.value,this.error=null},this.handleEmailSubmit=i=>{i.preventDefault(),this.requestLink()},this.handleCodeSubmit=i=>{i.preventDefault(),this.exchange(this.code.trim())}}async componentWillLoad(){const i=await e().catch((()=>null));if(!i)return void(this.error="Sign-in is not available right now");if(this.auth=i.getAuthManager?.()??null,!this.auth)return void(this.error="Sign-in is not available with this SDK");this.syncFromSDK(),this.unsubscribes.push(i.on("auth:changed",(()=>this.syncFromSDK()))),this.unsubscribes.push(i.on("session:changed",(()=>this.syncFromSDK())));const t=this.codeFromUrl();t&&!this.auth.authenticated&&await this.exchange(t)}disconnectedCallback(){this.unsubscribes.forEach((i=>i())),this.unsubscribes=[]}codeFromUrl(){if("undefined"==typeof window||!window.location?.search||this.urlCodeUsed)return null;const i=new URLSearchParams(window.location.search).get("code");return i&&(this.urlCodeUsed=!0),i}syncFromSDK(){this.auth&&(this.auth.authenticated?(this.customer=this.auth.customer??null,this.phase="signed-in"):"signed-in"===this.phase&&(this.customer=null,this.phase="email"))}async requestLink(i=!1){const t=this.email.trim();if(t){if(this.auth){this.busy=!0,this.error=null,this.notice=null;try{await this.auth.requestMagicLink({email:t}),this.phase="sent",this.notice=i?"Sent again. Check your inbox.":null,this.tlMagicLinkSent.emit({email:t})}catch(i){console.error("[tl-login] Magic-link request failed:",i),this.error=n(i,"Could not send your sign-in link"),this.tlError.emit({message:this.error})}finally{this.busy=!1}}}else this.error="Enter your email address"}async exchange(i){if(!i)return void(this.error="Enter the code from your email");if(!this.auth)return;const t=this.phase;this.busy=!0,this.error=null,this.phase="verifying";try{const t=await this.auth.exchange(i);this.customer=this.auth.customer??t?.customer??null,this.phase="signed-in",this.code="",this.tlAuthChanged.emit({customer:this.customer,authenticated:!0})}catch(i){console.error("[tl-login] Code exchange failed:",i),this.phase="verifying"===t||"email"===t?"email":"code",this.error="That code did not work. Check it and try again, or request a new link.",this.tlError.emit({message:this.error})}finally{this.busy=!1}}async signOut(){if(this.auth){this.busy=!0;try{await this.auth.logout()}catch(i){console.error("[tl-login] Sign out failed:",i)}finally{this.busy=!1,this.customer=null,this.phase="email",this.tlAuthChanged.emit({customer:null,authenticated:!1})}}}renderError(){return this.error?s("p",{class:"error",role:"alert"},this.error):null}render(){return"signed-in"===this.phase?s("div",{class:"login signed-in"},s("p",{class:"signed-in-text"},"Signed in as ",s("strong",null,this.customer?.email??"your account")),s("button",{type:"button",class:"secondary",disabled:this.busy,onClick:()=>this.signOut()},"Sign out")):"verifying"===this.phase?s("div",{class:"login"},s("h2",{class:"title"},"Signing you in…"),s("p",{class:"lead"},"Just a moment.")):"sent"===this.phase?s("div",{class:"login"},s("h2",{class:"title"},"Check your inbox"),s("p",{class:"lead"},"We've sent a sign-in link to ",s("strong",null,this.email),". Open it on this device to continue."),this.notice&&s("p",{class:"notice"},this.notice),this.renderError(),s("div",{class:"actions"},s("button",{type:"button",class:"secondary",disabled:this.busy,onClick:()=>this.requestLink(!0)},this.busy?"Sending…":"Resend link"),this.allowCodeEntry&&s("button",{type:"button",class:"link",onClick:()=>this.phase="code"},"Enter the code instead"),s("button",{type:"button",class:"link",onClick:()=>this.phase="email"},"Use a different email"))):"code"===this.phase?s("form",{class:"login",onSubmit:this.handleCodeSubmit},s("h2",{class:"title"},"Enter your code"),s("p",{class:"lead"},"Type the 6-digit code from the email we sent to ",s("strong",null,this.email),"."),s("label",{class:"label",htmlFor:"tl-login-code"},"Code"),s("input",{id:"tl-login-code",class:"input code-input",type:"text",inputmode:"numeric",autocomplete:"one-time-code",placeholder:"123456",value:this.code,disabled:this.busy,onInput:this.handleCodeInput}),this.renderError(),s("button",{type:"submit",class:"primary",disabled:this.busy},this.busy?"Checking…":"Sign in"),s("div",{class:"actions"},s("button",{type:"button",class:"link",onClick:()=>this.requestLink(!0)},"Resend link"),s("button",{type:"button",class:"link",onClick:()=>this.phase="sent"},"Back"))):s("form",{class:"login",onSubmit:this.handleEmailSubmit},s("h2",{class:"title"},this.heading),s("p",{class:"lead"},"Enter your email and we'll send you a secure sign-in link. No password needed."),s("label",{class:"label",htmlFor:"tl-login-email"},"Email address"),s("input",{id:"tl-login-email",class:"input",type:"email",autocomplete:"email",placeholder:"you@example.com",required:!0,value:this.email,disabled:this.busy||!this.auth,onInput:this.handleEmailInput}),this.renderError(),s("button",{type:"submit",class:"primary",disabled:this.busy||!this.auth},this.busy?"Sending link…":"Email me a sign-in link"))}};l.style=":host{display:block;font-family:var(--tl-font-family, system-ui, sans-serif);color:var(--tl-foreground, #111827)}.login{display:flex;flex-direction:column;gap:var(--tl-spacing-3, 0.75rem);padding:var(--tl-spacing-6, 1.5rem);background:var(--tl-background, #ffffff);border:1px solid var(--tl-border, #e5e7eb);border-radius:var(--tl-radius-lg, 0.75rem)}.title{margin:0;font-size:1.25rem;font-weight:600}.lead{margin:0;font-size:0.875rem;color:var(--tl-muted-foreground, #6b7280)}.label{font-size:0.875rem;font-weight:500}.input{padding:var(--tl-spacing-3, 0.75rem);font:inherit;font-size:0.9375rem;color:var(--tl-foreground, #111827);background:var(--tl-background, #ffffff);border:1px solid var(--tl-border, #e5e7eb);border-radius:var(--tl-radius-md, 0.5rem)}.input:focus{outline:2px solid var(--tl-primary, #6366f1);outline-offset:1px}.code-input{font-family:var(--tl-font-family-mono, ui-monospace, monospace);font-size:1.25rem;letter-spacing:0.25em;text-align:center}.primary,.secondary{padding:var(--tl-spacing-3, 0.75rem) var(--tl-spacing-4, 1rem);font:inherit;font-size:0.9375rem;font-weight:600;border-radius:var(--tl-radius-md, 0.5rem);cursor:pointer}.primary{color:var(--tl-primary-foreground, #ffffff);background:var(--tl-primary, #6366f1);border:none}.primary:hover:not(:disabled){opacity:0.9}.secondary{color:var(--tl-foreground, #111827);background:var(--tl-secondary, #f3f4f6);border:1px solid var(--tl-border, #e5e7eb)}.primary:disabled,.secondary:disabled,.input:disabled{opacity:0.6;cursor:not-allowed}.link{padding:0;font:inherit;font-size:0.875rem;color:var(--tl-primary, #6366f1);background:none;border:none;cursor:pointer}.link:hover{text-decoration:underline}.actions{display:flex;flex-wrap:wrap;align-items:center;gap:var(--tl-spacing-4, 1rem)}.error{margin:0;font-size:0.8125rem;color:var(--tl-error, #ef4444)}.notice{margin:0;font-size:0.8125rem;color:var(--tl-success, #10b981)}.signed-in{flex-direction:row;align-items:center;justify-content:space-between;flex-wrap:wrap}.signed-in-text{margin:0;font-size:0.875rem;overflow-wrap:anywhere}";export{l as tl_login}
@@ -1 +0,0 @@
1
- import{r as t,c as r,h as e}from"./p-CNX8hZa8.js";import{o as s,w as i}from"./p-CqhvfyKV.js";import{e as a,r as o,o as l,c as n,d as c,a as d,g as h}from"./p-BGekdjN9.js";const u=class{constructor(e){t(this,e),this.tlOrderLoaded=r(this,"tlOrderLoaded"),this.tlError=r(this,"tlError"),this.showTickets=!0,this.columns=2,this.order=null,this.resolvedOrderId=null,this.loading=!1,this.error=null,this.paymentFailed=!1,this.occurrence=null,this.signedInCustomer=null}watchOrderId(t){this.resolvedOrderId=t||this.orderIdFromUrl(),this.load()}async componentWillLoad(){const t=this.urlParams(),r=t?.get("redirect_status");this.paymentFailed=!!r&&"succeeded"!==r,this.resolvedOrderId=this.orderId||this.orderIdFromUrl(),this.resolvedOrderId&&!this.paymentFailed&&await this.load()}componentDidLoad(){this.unsubscribe=s("checkout:completed",(t=>{const r=t;r?.id&&(this.paymentFailed=!1,this.order=r,this.resolvedOrderId=r.id,this.tlOrderLoaded.emit({order:r}),this.load())}))}disconnectedCallback(){this.unsubscribe?.()}urlParams(){return"undefined"!=typeof window&&window.location?.search?new URLSearchParams(window.location.search):null}orderIdFromUrl(){return this.urlParams()?.get("orderId")||null}async load(){const t=this.resolvedOrderId;if(t)try{this.loading=!this.order,this.error=null;const r=await i(),e=r.getOrdersManager?.();if(!e)throw new Error("Orders are not available");const s=await e.get(t);if(!s)throw new Error("Order not found");this.order=s,this.signedInCustomer=r.getAuthManager?.()?.customer??null,this.tlOrderLoaded.emit({order:s}),this.resolveEvent(r,s)}catch(t){console.error("[tl-order-confirmation] Failed to load order:",t),this.error=a(t,"Failed to load your order"),this.tlError.emit({message:this.error})}finally{this.loading=!1}}async resolveEvent(t,r){const e=r.tickets?.find((t=>t.eventOccurrenceId))?.eventOccurrenceId;if(e)try{const s=await o(t,e);s&&this.order?.id===r.id&&(this.occurrence=s)}catch{}}renderRows(t){const r=this.customerEmail||c(t,this.signedInCustomer),s=this.occurrence?.eventName||l(t),i=this.occurrence?.startsAt;return e("dl",{class:"rows"},e("div",{class:"row"},e("dt",null,"Order reference"),e("dd",{class:"reference"},t.orderNumber)),r&&e("div",{class:"row"},e("dt",null,"Email"),e("dd",null,r)),s&&e("div",{class:"row"},e("dt",null,"Event"),e("dd",null,s)),i&&e("div",{class:"row"},e("dt",null,"Date"),e("dd",null,n(i))))}renderTotals(t){const r=t.currency||"GBP",s=Number(t.totalFees)||0,i=Number(t.totalTax)||0,a=Number(t.totalDiscounts)||0;return e("div",{class:"totals"},e("div",{class:"total-row"},e("span",null,"Subtotal"),e("span",null,d(t.subtotal,r))),s>0&&e("div",{class:"total-row"},e("span",null,"Fees"),e("span",null,d(t.totalFees,r))),i>0&&e("div",{class:"total-row"},e("span",null,"Tax"),e("span",null,d(t.totalTax,r))),a>0&&e("div",{class:"total-row discount"},e("span",null,"Discount"),e("span",null,"-",d(t.totalDiscounts,r))),e("div",{class:"total-row total"},e("span",null,"Total"),e("span",null,d(t.total,r))))}render(){if(this.paymentFailed)return e("div",{class:"confirmation"},e("h1",{class:"title"},"Payment not completed"),e("p",{class:"lead"},"Your payment wasn't completed. Your cart is still saved, so you can try again."));if(!this.resolvedOrderId&&!this.order)return null;if(this.loading)return e("div",{class:"confirmation"},e("div",{class:"skeleton-line short"}),e("div",{class:"skeleton-line long"}),e("div",{class:"skeleton-block"}));const t=this.order,r=t?.id||this.resolvedOrderId;return e("div",{class:"confirmation"},e("div",{class:"check","aria-hidden":"true"},e("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor"},e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"}))),e("h1",{class:"title"},"You're going!"),e("p",{class:"lead"},t?.orderNumber?`Order ${t.orderNumber} is confirmed. Your tickets are on their way to your email.`:"Your order is confirmed. Your tickets are on their way to your email."),this.error&&!t&&e("p",{class:"error"},"We couldn't load your order details yet. ",this.error),t&&Array.isArray(t.items)&&e("div",{class:"summary"},this.renderRows(t),e("ul",{class:"lines"},h(t).map(((r,s)=>e("li",{class:"line",key:s},e("span",{class:"line-name"},r.quantity," x ",r.name),e("span",{class:"line-price"},d(r.subtotal,t.currency)))))),this.renderTotals(t)),this.showTickets&&t&&e("div",{class:"tickets"},e("h2",{class:"subtitle"},"Your tickets"),e("tl-order-tickets",{orderId:r,columns:this.columns}),e("p",{class:"hint"},"Show these QR codes at the door for entry. Use Download PDF on a ticket to save it.")))}static get watchers(){return{orderId:[{watchOrderId:0}]}}};u.style=":host{display:block;font-family:var(--tl-font-family, system-ui, sans-serif);color:var(--tl-foreground, #111827)}.confirmation{text-align:center}.check{width:4rem;height:4rem;margin:0 auto var(--tl-spacing-4, 1rem);display:flex;align-items:center;justify-content:center;border-radius:9999px;background:var(--tl-success, #10b981);color:var(--tl-success-foreground, #ffffff)}.check svg{width:2rem;height:2rem}.title{margin:0 0 var(--tl-spacing-2, 0.5rem);font-size:1.875rem;font-weight:700;line-height:1.2}.lead{margin:0 0 var(--tl-spacing-6, 1.5rem);color:var(--tl-muted-foreground, #6b7280)}.error{margin:0 0 var(--tl-spacing-6, 1.5rem);font-size:0.875rem;color:var(--tl-error, #ef4444)}.summary{text-align:left;padding:var(--tl-spacing-6, 1.5rem);margin-bottom:var(--tl-spacing-6, 1.5rem);background:var(--tl-muted, #f9fafb);border:1px solid var(--tl-border, #e5e7eb);border-radius:var(--tl-radius-lg, 0.75rem)}.rows{display:grid;gap:var(--tl-spacing-2, 0.5rem);margin:0 0 var(--tl-spacing-4, 1rem);padding:0 0 var(--tl-spacing-4, 1rem);border-bottom:1px solid var(--tl-border, #e5e7eb)}.row{display:flex;justify-content:space-between;gap:var(--tl-spacing-4, 1rem);font-size:0.875rem}.row dt{color:var(--tl-muted-foreground, #6b7280)}.row dd{margin:0;text-align:right;overflow-wrap:anywhere}.reference{font-family:var(--tl-font-family-mono, ui-monospace, monospace);font-weight:600}.lines{list-style:none;margin:0;padding:0;display:grid;gap:var(--tl-spacing-2, 0.5rem)}.line{display:flex;justify-content:space-between;gap:var(--tl-spacing-4, 1rem);font-size:0.875rem}.totals{margin-top:var(--tl-spacing-3, 0.75rem);padding-top:var(--tl-spacing-3, 0.75rem);border-top:1px solid var(--tl-border, #e5e7eb);display:grid;gap:var(--tl-spacing-1, 0.25rem);font-size:0.875rem}.total-row{display:flex;justify-content:space-between;color:var(--tl-muted-foreground, #6b7280)}.total-row.discount{color:var(--tl-success, #10b981)}.total-row.total{margin-top:var(--tl-spacing-1, 0.25rem);font-size:1rem;font-weight:600;color:var(--tl-foreground, #111827)}.tickets{text-align:left}.subtitle{margin:0 0 var(--tl-spacing-4, 1rem);font-size:1.125rem;font-weight:600}.hint{margin:var(--tl-spacing-3, 0.75rem) 0 0;font-size:0.75rem;color:var(--tl-muted-foreground, #6b7280)}.skeleton-line,.skeleton-block{background:var(--tl-secondary, #f3f4f6);border-radius:var(--tl-radius-md, 0.5rem);animation:pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;margin:0 auto var(--tl-spacing-3, 0.75rem)}.skeleton-line{height:1rem}.skeleton-line.short{width:40%;height:1.75rem}.skeleton-line.long{width:70%}.skeleton-block{height:8rem}@keyframes pulse{0%,100%{opacity:1}50%{opacity:0.5}}";export{u as tl_order_confirmation}
@@ -1 +0,0 @@
1
- import{r as t,c as i,h as e}from"./p-CNX8hZa8.js";import{w as s}from"./p-CqhvfyKV.js";const n="tl_cart_count",o=class{constructor(e){t(this,e),this.tlClick=i(this,"tlClick"),this.showEmpty=!1,this.size="md",this.badgeOnly=!1,this.itemCount=0,this.handleClick=()=>{this.tlClick.emit({itemCount:this.itemCount})}}componentWillLoad(){this.itemCount=this.getPersistedCartCount()}componentDidLoad(){this.subscribeToCartUpdates()}disconnectedCallback(){this.unsubscribe&&this.unsubscribe()}getPersistedCartCount(){if("undefined"==typeof window)return 0;try{const t=localStorage.getItem(n);return t&&parseInt(t,10)||0}catch{return 0}}persistCartCount(t){if("undefined"!=typeof window)try{localStorage.setItem(n,t.toString())}catch{}}async subscribeToCartUpdates(){const t=await s().catch((()=>null));if(!t)return;const i=t.getCartManager?.();i&&(this.unsubscribe=i.on?.("cart:updated",(t=>{const i=t?.itemCount||0;console.log("[tl-cart-badge] Cart updated:",i),this.itemCount=i,this.persistCartCount(i)})),i.get?.().then((t=>{const i=t?.itemCount||0;this.itemCount=i,this.persistCartCount(i)})).catch((()=>{})))}renderIcon(){return this.icon?e("span",{class:"icon-text"},this.icon):e("svg",{class:"icon-svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor"},e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z"}))}render(){const t=this.itemCount>0||this.showEmpty,i=this.itemCount>99?"99+":this.itemCount.toString();return this.badgeOnly?0===this.itemCount?null:e("span",{class:`badge-only size-${this.size}`},i):e("button",{class:`cart-badge size-${this.size}`,onClick:this.handleClick,"aria-label":`Cart with ${this.itemCount} items`},this.renderIcon(),t&&this.itemCount>0&&e("span",{class:"badge-count"},i))}};o.style=":host{display:inline-block}.cart-badge{position:relative;display:inline-flex;align-items:center;justify-content:center;background:transparent;border:none;cursor:pointer;padding:var(--tl-spacing-2, 0.5rem);border-radius:var(--tl-radius-md, 0.5rem);color:var(--tl-color-foreground, #111827);transition:background-color 0.2s, transform 0.15s}.cart-badge:hover{background-color:var(--tl-color-muted, #f3f4f6)}.cart-badge:active{transform:scale(0.95)}.cart-badge:focus-visible{outline:2px solid var(--tl-color-primary, #6366f1);outline-offset:2px}.size-sm{padding:var(--tl-spacing-1, 0.25rem)}.size-sm .icon-svg,.size-sm .icon-text{width:18px;height:18px;font-size:18px}.size-md .icon-svg,.size-md .icon-text{width:24px;height:24px;font-size:24px}.size-lg{padding:var(--tl-spacing-3, 0.75rem)}.size-lg .icon-svg,.size-lg .icon-text{width:32px;height:32px;font-size:32px}.icon-svg{width:24px;height:24px;stroke-width:2}.icon-text{line-height:1}.badge-count{position:absolute;top:0;right:0;transform:translate(30%, -30%);min-width:18px;height:18px;padding:0 5px;border-radius:9px;background-color:var(--tl-color-primary, #6366f1);color:var(--tl-color-primary-foreground, #ffffff);font-size:11px;font-weight:600;font-family:var(--tl-font-family, system-ui, sans-serif);display:flex;align-items:center;justify-content:center;line-height:1;box-shadow:0 1px 3px rgba(0, 0, 0, 0.2)}.size-sm .badge-count{min-width:16px;height:16px;font-size:10px;padding:0 4px}.size-lg .badge-count{min-width:22px;height:22px;font-size:13px;padding:0 6px}.badge-only{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 6px;border-radius:10px;background-color:rgba(255, 255, 255, 0.3);color:inherit;font-size:12px;font-weight:600;font-family:var(--tl-font-family, system-ui, sans-serif);line-height:1}.badge-only.size-sm{min-width:18px;height:18px;font-size:11px;padding:0 5px}.badge-only.size-lg{min-width:22px;height:22px;font-size:13px;padding:0 7px}";export{o as tl_cart_badge}
@@ -1 +0,0 @@
1
- import{r as e,c as a,h as r,H as t}from"./p-CNX8hZa8.js";import{o}from"./p-CqhvfyKV.js";const d=class{constructor(r){e(this,r),this.tlOpen=a(this,"tlOpen"),this.tlClose=a(this,"tlClose"),this.side="right",this.heading="Your cart",this.open=!1,this.visible=!1,this.onKey=e=>{"Escape"===e.key&&this.visible&&this.setOpen(!1)},this.close=()=>this.setOpen(!1)}connectedCallback(){this.visible=this.open,this.offCart=o("ui:cart-requested",(()=>this.setOpen(!0))),this.offClose=o("ui:modal-close-requested",(()=>this.setOpen(!1))),"undefined"!=typeof document&&document.addEventListener("keydown",this.onKey)}disconnectedCallback(){this.offCart?.(),this.offClose?.(),"undefined"!=typeof document&&document.removeEventListener("keydown",this.onKey)}onOpenProp(e){this.visible=e}setOpen(e){this.visible!==e&&(this.open=e,this.visible=e,e?this.tlOpen.emit():this.tlClose.emit())}render(){return r(t,{key:"022314d9fb612e930da52ece34f2ab8ae8ce44da"},r("div",{key:"985b4001145d72ba91ef7d466adba8ab939e9cc4",class:{overlay:!0,"is-open":this.visible},onClick:e=>{e.target===e.currentTarget&&this.close()}},r("aside",{key:"3ac3588ae8feacd4f8bb96bdae8ef71e80ecb4b3",class:{panel:!0,[`panel--${this.side}`]:!0,"is-open":this.visible},role:"dialog","aria-modal":"true","aria-label":this.heading,"aria-hidden":this.visible?"false":"true"},r("header",{key:"e0126d634e952ebf56b73e54545f6c3981210827",class:"drawer-header"},r("h2",{key:"a72b23114aa836076ec59cd4a5d1438d228179d9",class:"drawer-title"},this.heading),r("button",{key:"92fb5b159490440352a6c23d65aa6e8c956ae3d8",class:"close-btn",onClick:this.close,"aria-label":"Close cart"},r("svg",{key:"138f4dc7669e62fb667091da0ba26dfbe94327c6",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},r("path",{key:"21fedd9dc89937a92f9c1124d4fa834b55908f1e",d:"M6 6l12 12M18 6L6 18","stroke-linecap":"round"})))),r("div",{key:"ebee87cb6a3c98dbf813d0a903a9cb4da2c696f3",class:"drawer-body"},r("tl-cart",{key:"323db3a160837b68ffaa767e647ec67b06fa53b0"})),r("footer",{key:"d35543373eb13ad1acc46ae50aefcb5a04f305a1",class:"drawer-footer"},r("div",{key:"52229c74d39471bf186c965b6a53b38f79ce8d61",class:"pb-links"},r("a",{key:"d0430bf93d920c57fc42043faed7e8fd895855aa",href:"https://ticketlayer.com/privacy",target:"_blank",rel:"noopener noreferrer"},"Privacy Policy"),r("a",{key:"2a75dc8dcdc9ec3010fe83f97d903cdc32767e49",href:"https://ticketlayer.com/report-abuse",target:"_blank",rel:"noopener noreferrer"},"Report Abuse")),r("a",{key:"40642c5c4c003a454dd7ab2b66ebe5948a03df7d",class:"pb-brand",href:"https://ticketlayer.com",target:"_blank",rel:"noopener noreferrer"},r("span",{key:"a5d9b5c023381d25b6aaddf61e56dbdb21580975",class:"pb-pre"},"Powered by"),r("svg",{key:"35bc23af9a35272d7ada24fd66d5f12f1d951ae8",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},r("path",{key:"90139e79acd8920bcd494cc6579dbcb8278b0aef",d:"M4 7.5A1.5 1.5 0 0 1 5.5 6h13A1.5 1.5 0 0 1 20 7.5v2a2 2 0 0 0 0 5v2a1.5 1.5 0 0 1-1.5 1.5h-13A1.5 1.5 0 0 1 4 16.5v-2a2 2 0 0 0 0-5v-2Z",fill:"currentColor"}),r("path",{key:"ba3aa34471395e33752e72f87f93a85381f7caad",d:"M13 7v10",stroke:"var(--tl-pb-perforation, var(--tl-background, #fff))","stroke-width":"1.2","stroke-dasharray":"1.5 1.8","stroke-linecap":"round"})),r("span",{key:"429154bd6c38febe4da8871a7e614bf272a18854",class:"pb-word"},"Ticketlayer"))))))}static get watchers(){return{open:[{onOpenProp:0}]}}};d.style=":host{--_bg:var(--tl-background, #ffffff);--_fg:var(--tl-foreground, #111827);--_muted-fg:var(--tl-muted-foreground, #6b7280);--_muted:var(--tl-muted, #f3f4f6);--_border:var(--tl-border, #e5e7eb);--_font:var(--tl-font-family, system-ui, -apple-system, sans-serif);font-family:var(--_font)}.overlay{position:fixed;inset:0;z-index:2147483640;background:rgba(8, 8, 16, 0.6);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);opacity:0;pointer-events:none;transition:opacity 0.25s ease}.overlay.is-open{opacity:1;pointer-events:auto}.panel{position:fixed;top:0;bottom:0;width:min(420px, 100%);display:flex;flex-direction:column;background:var(--_bg);color:var(--_fg);box-shadow:0 0 48px rgba(0, 0, 0, 0.5);transition:transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);will-change:transform}.panel--right{right:0;border-left:1px solid var(--_border);transform:translateX(100%)}.panel--left{left:0;border-right:1px solid var(--_border);transform:translateX(-100%)}.panel.is-open{transform:translateX(0)}.drawer-header{display:flex;align-items:center;justify-content:space-between;padding:18px 20px;border-bottom:1px solid var(--_border)}.drawer-title{margin:0;font-size:1.1rem;font-weight:700}.close-btn{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border:0;border-radius:999px;background:var(--_muted);color:var(--_muted-fg);cursor:pointer;transition:color 0.15s}.close-btn:hover{color:var(--_fg)}.close-btn svg{width:16px;height:16px}.drawer-body{flex:1;overflow-y:auto;padding:18px 20px}.drawer-footer{flex:none;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 20px;border-top:1px solid var(--_border);font-size:11.5px;font-weight:500;color:var(--_muted-fg)}.drawer-footer a{color:inherit;text-decoration:none;opacity:0.9;transition:opacity 0.15s ease}.drawer-footer a:hover{opacity:1}.drawer-footer .pb-links{display:flex;gap:14px}.drawer-footer .pb-brand{display:inline-flex;align-items:center;gap:5px}.drawer-footer .pb-brand svg{display:block}.drawer-footer .pb-pre{opacity:0.7}.drawer-footer .pb-word{font-weight:700}";export{d as tl_cart_drawer}