snice 7.8.0 → 7.9.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 (302) hide show
  1. package/README.md +1 -1
  2. package/adapters/react/SniceProvider.js +1 -1
  3. package/adapters/react/SniceRouter.js +1 -1
  4. package/adapters/react/matchRoute.js +1 -1
  5. package/adapters/react/table.d.ts +1 -0
  6. package/adapters/react/table.d.ts.map +1 -1
  7. package/adapters/react/table.js +1 -1
  8. package/adapters/react/table.js.map +1 -1
  9. package/adapters/react/table.tsx +2 -1
  10. package/adapters/react/useRequestHandler.js +1 -1
  11. package/bin/analyzer-contracts.js +17 -1
  12. package/custom-elements.json +57 -3
  13. package/dist/cdn/accordion/snice-accordion.js +1 -1
  14. package/dist/cdn/action-bar/snice-action-bar.js +1 -1
  15. package/dist/cdn/activity-feed/snice-activity-feed.js +1 -1
  16. package/dist/cdn/alert/snice-alert.js +1 -1
  17. package/dist/cdn/app-tiles/snice-app-tiles.js +1 -1
  18. package/dist/cdn/approval-flow/snice-approval-flow.js +1 -1
  19. package/dist/cdn/audio-recorder/snice-audio-recorder.js +1 -1
  20. package/dist/cdn/availability/snice-availability.js +1 -1
  21. package/dist/cdn/avatar/snice-avatar.js +1 -1
  22. package/dist/cdn/avatar-group/snice-avatar-group.js +1 -1
  23. package/dist/cdn/badge/snice-badge.js +1 -1
  24. package/dist/cdn/banner/snice-banner.js +1 -1
  25. package/dist/cdn/binpack/snice-binpack.js +1 -1
  26. package/dist/cdn/book/snice-book.js +1 -1
  27. package/dist/cdn/booking/snice-booking.js +1 -1
  28. package/dist/cdn/breadcrumbs/snice-breadcrumbs.js +1 -1
  29. package/dist/cdn/button/snice-button.js +1 -1
  30. package/dist/cdn/calendar/README.md +2 -2
  31. package/dist/cdn/calendar/snice-calendar.js +537 -44
  32. package/dist/cdn/calendar/snice-calendar.js.map +1 -1
  33. package/dist/cdn/calendar/snice-calendar.min.js +2 -2
  34. package/dist/cdn/calendar/snice-calendar.min.js.map +1 -1
  35. package/dist/cdn/camera/snice-camera.js +1 -1
  36. package/dist/cdn/camera-annotate/snice-camera-annotate.js +1 -1
  37. package/dist/cdn/candlestick/snice-candlestick.js +1 -1
  38. package/dist/cdn/card/snice-card.js +1 -1
  39. package/dist/cdn/carousel/snice-carousel.js +1 -1
  40. package/dist/cdn/cart/snice-cart.js +1 -1
  41. package/dist/cdn/chart/snice-chart.js +1 -1
  42. package/dist/cdn/chat/snice-chat.js +1 -1
  43. package/dist/cdn/checkbox/snice-checkbox.js +1 -1
  44. package/dist/cdn/chip/snice-chip.js +1 -1
  45. package/dist/cdn/code-block/README.md +2 -2
  46. package/dist/cdn/code-block/snice-code-block.js +177 -167
  47. package/dist/cdn/code-block/snice-code-block.js.map +1 -1
  48. package/dist/cdn/code-block/snice-code-block.min.js +2 -2
  49. package/dist/cdn/code-block/snice-code-block.min.js.map +1 -1
  50. package/dist/cdn/color-display/snice-color-display.js +1 -1
  51. package/dist/cdn/color-picker/snice-color-picker.js +1 -1
  52. package/dist/cdn/command-palette/README.md +1 -1
  53. package/dist/cdn/command-palette/snice-command-palette.js +2 -2
  54. package/dist/cdn/command-palette/snice-command-palette.js.map +1 -1
  55. package/dist/cdn/command-palette/snice-command-palette.min.js +1 -1
  56. package/dist/cdn/command-palette/snice-command-palette.min.js.map +1 -1
  57. package/dist/cdn/comments/snice-comments.js +1 -1
  58. package/dist/cdn/countdown/snice-countdown.js +1 -1
  59. package/dist/cdn/cropper/snice-cropper.js +1 -1
  60. package/dist/cdn/data-card/snice-data-card.js +1 -1
  61. package/dist/cdn/date-picker/snice-date-picker.js +1 -1
  62. package/dist/cdn/date-range-picker/snice-date-range-picker.js +1 -1
  63. package/dist/cdn/date-time-picker/snice-date-time-picker.js +1 -1
  64. package/dist/cdn/diff/snice-diff.js +1 -1
  65. package/dist/cdn/divider/snice-divider.js +1 -1
  66. package/dist/cdn/doc/snice-doc.js +1 -1
  67. package/dist/cdn/draw/snice-draw.js +1 -1
  68. package/dist/cdn/drawer/snice-drawer.js +1 -1
  69. package/dist/cdn/empty-state/snice-empty-state.js +1 -1
  70. package/dist/cdn/estimate/snice-estimate.js +1 -1
  71. package/dist/cdn/file-gallery/snice-file-gallery.js +1 -1
  72. package/dist/cdn/file-upload/snice-file-upload.js +1 -1
  73. package/dist/cdn/flip-card/snice-flip-card.js +1 -1
  74. package/dist/cdn/flow/snice-flow.js +1 -1
  75. package/dist/cdn/form-layout/snice-form-layout.js +1 -1
  76. package/dist/cdn/funnel/snice-funnel.js +1 -1
  77. package/dist/cdn/gantt/snice-gantt.js +1 -1
  78. package/dist/cdn/gauge/snice-gauge.js +1 -1
  79. package/dist/cdn/grid/snice-grid.js +1 -1
  80. package/dist/cdn/heatmap/snice-heatmap.js +1 -1
  81. package/dist/cdn/image/snice-image.js +1 -1
  82. package/dist/cdn/input/snice-input.js +1 -1
  83. package/dist/cdn/invoice/snice-invoice.js +1 -1
  84. package/dist/cdn/kanban/snice-kanban.js +1 -1
  85. package/dist/cdn/key-value/snice-key-value.js +1 -1
  86. package/dist/cdn/kpi/snice-kpi.js +1 -1
  87. package/dist/cdn/layout/snice-layout.js +1 -1
  88. package/dist/cdn/leaderboard/snice-leaderboard.js +1 -1
  89. package/dist/cdn/link/snice-link.js +1 -1
  90. package/dist/cdn/link-preview/snice-link-preview.js +1 -1
  91. package/dist/cdn/list/snice-list.js +1 -1
  92. package/dist/cdn/location/snice-location.js +1 -1
  93. package/dist/cdn/login/snice-login.js +1 -1
  94. package/dist/cdn/map/snice-map.js +1 -1
  95. package/dist/cdn/markdown/snice-markdown.js +1 -1
  96. package/dist/cdn/masonry/snice-masonry.js +1 -1
  97. package/dist/cdn/menu/snice-menu.js +1 -1
  98. package/dist/cdn/message-strip/snice-message-strip.js +1 -1
  99. package/dist/cdn/modal/snice-modal.js +1 -1
  100. package/dist/cdn/music-player/snice-music-player.js +1 -1
  101. package/dist/cdn/nav/snice-nav.js +1 -1
  102. package/dist/cdn/network-graph/snice-network-graph.js +1 -1
  103. package/dist/cdn/notification-center/snice-notification-center.js +1 -1
  104. package/dist/cdn/order-tracker/snice-order-tracker.js +1 -1
  105. package/dist/cdn/org-chart/snice-org-chart.js +1 -1
  106. package/dist/cdn/pagination/snice-pagination.js +1 -1
  107. package/dist/cdn/paint/snice-paint.js +1 -1
  108. package/dist/cdn/pdf-viewer/snice-pdf-viewer.js +1 -1
  109. package/dist/cdn/permission-matrix/snice-permission-matrix.js +1 -1
  110. package/dist/cdn/podcast-player/snice-podcast-player.js +1 -1
  111. package/dist/cdn/popover/snice-popover.js +1 -1
  112. package/dist/cdn/pricing-table/snice-pricing-table.js +1 -1
  113. package/dist/cdn/product-card/snice-product-card.js +1 -1
  114. package/dist/cdn/progress/snice-progress.js +2 -2
  115. package/dist/cdn/progress/snice-progress.js.map +1 -1
  116. package/dist/cdn/progress/snice-progress.min.js +1 -1
  117. package/dist/cdn/progress/snice-progress.min.js.map +1 -1
  118. package/dist/cdn/progress-ring/snice-progress-ring.js +1 -1
  119. package/dist/cdn/qr-code/README.md +2 -2
  120. package/dist/cdn/qr-code/snice-qr-code.js +19 -3
  121. package/dist/cdn/qr-code/snice-qr-code.js.map +1 -1
  122. package/dist/cdn/qr-code/snice-qr-code.min.js +2 -2
  123. package/dist/cdn/qr-code/snice-qr-code.min.js.map +1 -1
  124. package/dist/cdn/qr-reader/snice-qr-reader.js +1 -1
  125. package/dist/cdn/radio/snice-radio.js +1 -1
  126. package/dist/cdn/range-slider/snice-range-slider.js +1 -1
  127. package/dist/cdn/rating/snice-rating.js +1 -1
  128. package/dist/cdn/receipt/snice-receipt.js +5 -2
  129. package/dist/cdn/receipt/snice-receipt.js.map +1 -1
  130. package/dist/cdn/receipt/snice-receipt.min.js +1 -1
  131. package/dist/cdn/receipt/snice-receipt.min.js.map +1 -1
  132. package/dist/cdn/recipe/snice-recipe.js +1 -1
  133. package/dist/cdn/runtime/snice-runtime.esm.js +4 -4
  134. package/dist/cdn/runtime/snice-runtime.esm.js.map +1 -1
  135. package/dist/cdn/runtime/snice-runtime.esm.min.js.map +1 -1
  136. package/dist/cdn/runtime/snice-runtime.js +4 -4
  137. package/dist/cdn/runtime/snice-runtime.js.map +1 -1
  138. package/dist/cdn/runtime/snice-runtime.min.js.map +1 -1
  139. package/dist/cdn/sankey/snice-sankey.js +1 -1
  140. package/dist/cdn/segmented-control/snice-segmented-control.js +1 -1
  141. package/dist/cdn/select/README.md +2 -2
  142. package/dist/cdn/select/snice-select.js +6 -9
  143. package/dist/cdn/select/snice-select.js.map +1 -1
  144. package/dist/cdn/select/snice-select.min.js +2 -2
  145. package/dist/cdn/select/snice-select.min.js.map +1 -1
  146. package/dist/cdn/skeleton/snice-skeleton.js +1 -1
  147. package/dist/cdn/slider/snice-slider.js +1 -1
  148. package/dist/cdn/sortable/snice-sortable.js +1 -1
  149. package/dist/cdn/sparkline/snice-sparkline.js +1 -1
  150. package/dist/cdn/spinner/snice-spinner.js +1 -1
  151. package/dist/cdn/split-button/snice-split-button.js +1 -1
  152. package/dist/cdn/split-pane/snice-split-pane.js +1 -1
  153. package/dist/cdn/spotlight/snice-spotlight.js +1 -1
  154. package/dist/cdn/stat-group/snice-stat-group.js +1 -1
  155. package/dist/cdn/step-input/snice-step-input.js +1 -1
  156. package/dist/cdn/stepper/snice-stepper.js +1 -1
  157. package/dist/cdn/switch/snice-switch.js +1 -1
  158. package/dist/cdn/table/README.md +2 -2
  159. package/dist/cdn/table/snice-table.esm.js +1940 -407
  160. package/dist/cdn/table/snice-table.esm.js.map +1 -1
  161. package/dist/cdn/table/snice-table.esm.min.js +242 -53
  162. package/dist/cdn/table/snice-table.esm.min.js.map +1 -1
  163. package/dist/cdn/table/snice-table.js +1940 -407
  164. package/dist/cdn/table/snice-table.js.map +1 -1
  165. package/dist/cdn/table/snice-table.min.js +234 -45
  166. package/dist/cdn/table/snice-table.min.js.map +1 -1
  167. package/dist/cdn/tabs/snice-tabs.js +1 -1
  168. package/dist/cdn/tag/snice-tag.js +1 -1
  169. package/dist/cdn/tag-input/snice-tag-input.js +1 -1
  170. package/dist/cdn/terminal/snice-terminal.js +1 -1
  171. package/dist/cdn/testimonial/snice-testimonial.js +1 -1
  172. package/dist/cdn/textarea/snice-textarea.js +1 -1
  173. package/dist/cdn/time-picker/snice-time-picker.js +1 -1
  174. package/dist/cdn/time-range-picker/snice-time-range-picker.js +1 -1
  175. package/dist/cdn/timeline/snice-timeline.js +1 -1
  176. package/dist/cdn/timer/snice-timer.js +1 -1
  177. package/dist/cdn/toast/snice-toast.js +1 -1
  178. package/dist/cdn/tooltip/snice-tooltip.js +1 -1
  179. package/dist/cdn/tree/snice-tree.js +1 -1
  180. package/dist/cdn/treemap/snice-treemap.js +1 -1
  181. package/dist/cdn/user-card/snice-user-card.js +1 -1
  182. package/dist/cdn/video-player/snice-video-player.js +1 -1
  183. package/dist/cdn/virtual-scroller/snice-virtual-scroller.js +1 -1
  184. package/dist/cdn/waterfall/snice-waterfall.js +1 -1
  185. package/dist/cdn/weather/snice-weather.js +1 -1
  186. package/dist/cdn/work-order/snice-work-order.js +1 -1
  187. package/dist/components/calendar/snice-calendar.d.ts +187 -5
  188. package/dist/components/calendar/snice-calendar.js +537 -44
  189. package/dist/components/calendar/snice-calendar.js.map +1 -1
  190. package/dist/components/calendar/snice-calendar.types.d.ts +2 -1
  191. package/dist/components/code-block/formatter.d.ts +6 -0
  192. package/dist/components/code-block/formatter.js +174 -164
  193. package/dist/components/code-block/formatter.js.map +1 -1
  194. package/dist/components/code-block/grammars/snice.json +1 -1
  195. package/dist/components/code-block/grammars/typescript.json +1 -1
  196. package/dist/components/command-palette/snice-command-palette.js +1 -1
  197. package/dist/components/command-palette/snice-command-palette.js.map +1 -1
  198. package/dist/components/progress/snice-progress.js +1 -1
  199. package/dist/components/progress/snice-progress.js.map +1 -1
  200. package/dist/components/qr-code/qrcode.d.ts +1 -1
  201. package/dist/components/qr-code/qrcode.js +18 -2
  202. package/dist/components/qr-code/qrcode.js.map +1 -1
  203. package/dist/components/receipt/snice-receipt.js +4 -1
  204. package/dist/components/receipt/snice-receipt.js.map +1 -1
  205. package/dist/components/select/snice-select.d.ts +1 -1
  206. package/dist/components/select/snice-select.js +5 -8
  207. package/dist/components/select/snice-select.js.map +1 -1
  208. package/dist/components/table/snice-cell-actions.js +1 -1
  209. package/dist/components/table/snice-cell-actions.js.map +1 -1
  210. package/dist/components/table/snice-cell-color.js +1 -1
  211. package/dist/components/table/snice-cell-color.js.map +1 -1
  212. package/dist/components/table/snice-cell-date.js +20 -8
  213. package/dist/components/table/snice-cell-date.js.map +1 -1
  214. package/dist/components/table/snice-cell-email.js +1 -1
  215. package/dist/components/table/snice-cell-email.js.map +1 -1
  216. package/dist/components/table/snice-cell-image.js +1 -1
  217. package/dist/components/table/snice-cell-image.js.map +1 -1
  218. package/dist/components/table/snice-cell-json.js +1 -1
  219. package/dist/components/table/snice-cell-json.js.map +1 -1
  220. package/dist/components/table/snice-cell-link.js +1 -1
  221. package/dist/components/table/snice-cell-link.js.map +1 -1
  222. package/dist/components/table/snice-cell-location.js +1 -1
  223. package/dist/components/table/snice-cell-location.js.map +1 -1
  224. package/dist/components/table/snice-cell-phone.js +1 -1
  225. package/dist/components/table/snice-cell-phone.js.map +1 -1
  226. package/dist/components/table/snice-cell-status.js +1 -1
  227. package/dist/components/table/snice-cell-status.js.map +1 -1
  228. package/dist/components/table/snice-cell.d.ts +10 -0
  229. package/dist/components/table/snice-cell.js +59 -13
  230. package/dist/components/table/snice-cell.js.map +1 -1
  231. package/dist/components/table/snice-row.d.ts +0 -1
  232. package/dist/components/table/snice-row.js +4 -10
  233. package/dist/components/table/snice-row.js.map +1 -1
  234. package/dist/components/table/snice-table.d.ts +170 -2
  235. package/dist/components/table/snice-table.js +868 -189
  236. package/dist/components/table/snice-table.js.map +1 -1
  237. package/dist/components/table/snice-table.types.d.ts +17 -0
  238. package/dist/components/table/table-cell-presentation.d.ts +17 -4
  239. package/dist/components/table/table-cell-presentation.js +37 -11
  240. package/dist/components/table/table-cell-presentation.js.map +1 -1
  241. package/dist/components/table/table-column-manager.d.ts +153 -2
  242. package/dist/components/table/table-column-manager.js +364 -43
  243. package/dist/components/table/table-column-manager.js.map +1 -1
  244. package/dist/components/table/table-date.d.ts +29 -0
  245. package/dist/components/table/table-date.js +78 -0
  246. package/dist/components/table/table-date.js.map +1 -0
  247. package/dist/components/table/table-export.js +6 -2
  248. package/dist/components/table/table-export.js.map +1 -1
  249. package/dist/components/table/table-filter-engine.d.ts +9 -0
  250. package/dist/components/table/table-filter-engine.js +58 -14
  251. package/dist/components/table/table-filter-engine.js.map +1 -1
  252. package/dist/components/table/table-keyboard.d.ts +8 -0
  253. package/dist/components/table/table-keyboard.js +14 -3
  254. package/dist/components/table/table-keyboard.js.map +1 -1
  255. package/dist/components/table/table-toolbar.js +1 -0
  256. package/dist/components/table/table-toolbar.js.map +1 -1
  257. package/dist/components/table/table-tree-data.d.ts +2 -0
  258. package/dist/components/table/table-tree-data.js +35 -9
  259. package/dist/components/table/table-tree-data.js.map +1 -1
  260. package/dist/components/table/table-virtualizer.d.ts +44 -7
  261. package/dist/components/table/table-virtualizer.js +101 -54
  262. package/dist/components/table/table-virtualizer.js.map +1 -1
  263. package/dist/components/theme/theme.css +9 -0
  264. package/dist/index.cjs +1 -1
  265. package/dist/index.esm.js +1 -1
  266. package/dist/index.iife.js +1 -1
  267. package/dist/react/SniceProvider.js +1 -1
  268. package/dist/react/SniceRouter.js +1 -1
  269. package/dist/react/index.js +1 -1
  270. package/dist/react/matchRoute.js +1 -1
  271. package/dist/react/useRequestHandler.js +1 -1
  272. package/dist/symbols.cjs +1 -1
  273. package/dist/symbols.esm.js +1 -1
  274. package/dist/testing-dom.cjs +1 -1
  275. package/dist/testing-dom.esm.js +1 -1
  276. package/dist/transitions.cjs +1 -1
  277. package/dist/transitions.esm.js +1 -1
  278. package/docs/ai/DEVELOPMENT.md +93 -2
  279. package/docs/ai/components/calendar.md +113 -10
  280. package/docs/ai/components/code-block.md +4 -0
  281. package/docs/ai/components/doc.md +1 -1
  282. package/docs/ai/components/progress.md +1 -0
  283. package/docs/ai/components/receipt.md +1 -1
  284. package/docs/ai/components/table.md +29 -30
  285. package/docs/ai/components/theme.md +1 -0
  286. package/docs/ai/events.md +30 -0
  287. package/docs/ai/theme.md +1 -0
  288. package/docs/components/calendar.md +171 -11
  289. package/docs/components/code-block.md +2 -0
  290. package/docs/components/doc.md +1 -1
  291. package/docs/components/progress.md +13 -0
  292. package/docs/components/receipt.md +1 -0
  293. package/docs/components/table.md +274 -15
  294. package/docs/components/theme.md +5 -0
  295. package/docs/events.md +49 -0
  296. package/docs/plans/2026-03-06-date-range-picker-plan.md +4 -4
  297. package/docs/plans/2026-03-07-table-mui-parity-design.md +1 -1
  298. package/docs/plans/2026-03-09-action-bar-plan.md +11 -11
  299. package/docs/superpowers/specs/2026-07-09-table-incredible-design.md +1 -1
  300. package/docs/superpowers/specs/2026-07-09-table-phase0-implementation.md +2 -2
  301. package/package.json +3 -1
  302. package/vscode.html-custom-data.json +13 -1
@@ -1,4 +1,4 @@
1
- void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be loaded before snice-qr-code.min.js");var SniceQrCode=function(t,e){"use strict";function i(t,e,i,r,s,n){function a(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var o,l=r.kind,h="getter"===l?"get":"setter"===l?"set":"value",c=!e&&t?r.static?t:t.prototype:null,u=e||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),d=!1,g=i.length-1;g>=0;g--){var m={};for(var f in r)m[f]="access"===f?{}:r[f];for(var f in r.access)m.access[f]=r.access[f];m.addInitializer=function(t){if(d)throw new TypeError("Cannot add initializers after decoration has completed");n.push(a(t||null))};var p=(0,i[g])("accessor"===l?{get:u.get,set:u.set}:u[h],m);if("accessor"===l){if(void 0===p)continue;if(null===p||"object"!=typeof p)throw new TypeError("Object expected");(o=a(p.get))&&(u.get=o),(o=a(p.set))&&(u.set=o),(o=a(p.init))&&s.unshift(o)}else(o=a(p))&&("field"===l?s.unshift(o):u[h]=o)}c&&Object.defineProperty(c,r.name,u),d=!0}function r(t,e,i){for(var r=arguments.length>2,s=0;s<e.length;s++)i=r?e[s].call(t,i):e[s].call(t);return r?i:void 0}"function"==typeof SuppressedError&&SuppressedError;const s={L:1,M:0,Q:3,H:2},n=(()=>{const t=new Array(256),e=new Array(256);for(let e=0;e<8;e++)t[e]=1<<e;for(let e=8;e<256;e++)t[e]=t[e-4]^t[e-5]^t[e-6]^t[e-8];for(let i=0;i<255;i++)e[t[i]]=i;return{log:t=>{if(t<1)throw new Error("Invalid input");return e[t]},exp:e=>{for(;e<0;)e+=255;for(;e>=256;)e-=255;return t[e]}}})();class a{constructor(t,e){if(void 0===t.length)throw new Error("Invalid polynomial");let i=0;for(;i<t.length&&0===t[i];)i++;this.num=new Array(t.length-i+e);for(let e=0;e<t.length-i;e++)this.num[e]=t[e+i]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let i=0;i<this.getLength();i++)for(let r=0;r<t.getLength();r++)e[i+r]^=n.exp(n.log(this.get(i))+n.log(t.get(r)));return new a(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=n.log(this.get(0))-n.log(t.get(0)),i=new Array(this.getLength());for(let t=0;t<this.getLength();t++)i[t]=this.get(t);for(let r=0;r<t.getLength();r++)i[r]^=n.exp(n.log(t.get(r))+e);return new a(i,0).mod(t)}}class o{constructor(){this.buffer=[],this.length=0}get(t){const e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)}put(t,e){for(let i=0;i<e;i++)this.putBit(1==(t>>>e-i-1&1))}getLengthInBits(){return this.length}putBit(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}}class l{constructor(t){this.mode=4,this.data=t,this.parsedData=[];for(let t=0,e=this.data.length;t<e;t++){const e=[],i=this.data.charCodeAt(t);i>65536?(e[0]=240|(1835008&i)>>>18,e[1]=128|(258048&i)>>>12,e[2]=128|(4032&i)>>>6,e[3]=128|63&i):i>2048?(e[0]=224|(61440&i)>>>12,e[1]=128|(4032&i)>>>6,e[2]=128|63&i):i>128?(e[0]=192|(1984&i)>>>6,e[1]=128|63&i):e[0]=i,this.parsedData.push(...e)}this.parsedData.length!==this.data.length&&this.parsedData.unshift(239,187,191)}getLength(){return this.parsedData.length}write(t){for(let e=0,i=this.parsedData.length;e<i;e++)t.put(this.parsedData[e],8)}}const h=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];class c{constructor(t,e){this.totalCount=t,this.dataCount=e}static getRSBlocks(t,e){const i=this.getRsBlockTable(t,e);if(void 0===i)throw new Error("Invalid type number or error correction level");const r=i.length/3,s=[];for(let t=0;t<r;t++){const e=i[3*t+0],r=i[3*t+1],n=i[3*t+2];for(let t=0;t<e;t++)s.push(new c(r,n))}return s}static getRsBlockTable(t,e){switch(e){case s.L:return h[4*(t-1)+0];case s.M:return h[4*(t-1)+1];case s.Q:return h[4*(t-1)+2];case s.H:return h[4*(t-1)+3];default:return}}}const u=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],d=1335,g=7973,m={getBCHTypeInfo(t){let e=t<<10;for(;this.getBCHDigit(e)-this.getBCHDigit(d)>=0;)e^=d<<this.getBCHDigit(e)-this.getBCHDigit(d);return 21522^(t<<10|e)},getBCHTypeNumber(t){let e=t<<12;for(;this.getBCHDigit(e)-this.getBCHDigit(g)>=0;)e^=g<<this.getBCHDigit(e)-this.getBCHDigit(g);return t<<12|e},getBCHDigit(t){let e=0;for(;0!==t;)e++,t>>>=1;return e},getPatternPosition:t=>u[t-1],getMask(t,e,i){switch(t){case 0:return(e+i)%2==0;case 1:return e%2==0;case 2:return i%3==0;case 3:return(e+i)%3==0;case 4:return(Math.floor(e/2)+Math.floor(i/3))%2==0;case 5:return e*i%2+e*i%3==0;case 6:return(e*i%2+e*i%3)%2==0;case 7:return(e*i%3+(e+i)%2)%2==0;default:throw new Error("Invalid mask pattern")}},getErrorCorrectPolynomial(t){let e=new a([1],0);for(let i=0;i<t;i++)e=e.multiply(new a([1,n.exp(i)],0));return e},getLengthInBits(t,e){if(e>=1&&e<10)switch(t){case 1:return 10;case 2:return 9;case 4:case 8:return 8;default:throw new Error("Invalid mode")}else if(e<27)switch(t){case 1:return 12;case 2:return 11;case 4:return 16;case 8:return 10;default:throw new Error("Invalid mode")}else{if(!(e<41))throw new Error("Invalid type");switch(t){case 1:return 14;case 2:return 13;case 4:return 16;case 8:return 12;default:throw new Error("Invalid mode")}}},getLostPoint(t){const e=t.getModuleCount();let i=0;for(let r=0;r<e;r++)for(let s=0;s<e;s++){let n=0;const a=t.isDark(r,s);for(let i=-1;i<=1;i++)if(!(r+i<0||e<=r+i))for(let o=-1;o<=1;o++)s+o<0||e<=s+o||0===i&&0===o||a===t.isDark(r+i,s+o)&&n++;n>5&&(i+=3+n-5)}for(let r=0;r<e-1;r++)for(let s=0;s<e-1;s++){let e=0;t.isDark(r,s)&&e++,t.isDark(r+1,s)&&e++,t.isDark(r,s+1)&&e++,t.isDark(r+1,s+1)&&e++,0!==e&&4!==e||(i+=3)}for(let r=0;r<e;r++)for(let s=0;s<e-6;s++)t.isDark(r,s)&&!t.isDark(r,s+1)&&t.isDark(r,s+2)&&t.isDark(r,s+3)&&t.isDark(r,s+4)&&!t.isDark(r,s+5)&&t.isDark(r,s+6)&&(i+=40);for(let r=0;r<e;r++)for(let s=0;s<e-6;s++)t.isDark(s,r)&&!t.isDark(s+1,r)&&t.isDark(s+2,r)&&t.isDark(s+3,r)&&t.isDark(s+4,r)&&!t.isDark(s+5,r)&&t.isDark(s+6,r)&&(i+=40);let r=0;for(let i=0;i<e;i++)for(let s=0;s<e;s++)t.isDark(s,i)&&r++;return i+=Math.abs(100*r/e/e-50)/5*10,i}},f=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];class p{constructor(t,e){this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[],this.typeNumber=t,this.errorCorrectLevel=e}addData(t){const e=new l(t);this.dataList.push(e),this.dataCache=null}isDark(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(`Invalid position: ${t},${e}`);return this.modules[t][e]??!1}getModuleCount(){return this.moduleCount}make(){this.makeImpl(!1,this.getBestMaskPattern())}makeImpl(t,e){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(let t=0;t<this.moduleCount;t++){this.modules[t]=new Array(this.moduleCount);for(let e=0;e<this.moduleCount;e++)this.modules[t][e]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),null===this.dataCache&&(this.dataCache=p.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let i=-1;i<=7;i++)if(!(t+i<=-1||this.moduleCount<=t+i))for(let r=-1;r<=7;r++)e+r<=-1||this.moduleCount<=e+r||(this.modules[t+i][e+r]=i>=0&&i<=6&&(0===r||6===r)||r>=0&&r<=6&&(0===i||6===i)||i>=2&&i<=4&&r>=2&&r<=4)}getBestMaskPattern(){let t=0,e=0;for(let i=0;i<8;i++){this.makeImpl(!0,i);const r=m.getLostPoint(this);(0===i||t>r)&&(t=r,e=i)}return e}setupTimingPattern(){for(let t=8;t<this.moduleCount-8;t++)null===this.modules[t][6]&&(this.modules[t][6]=t%2==0);for(let t=8;t<this.moduleCount-8;t++)null===this.modules[6][t]&&(this.modules[6][t]=t%2==0)}setupPositionAdjustPattern(){const t=m.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let i=0;i<t.length;i++){const r=t[e],s=t[i];if(null===this.modules[r][s])for(let t=-2;t<=2;t++)for(let e=-2;e<=2;e++)this.modules[r+t][s+e]=-2===t||2===t||-2===e||2===e||0===t&&0===e}}setupTypeNumber(t){const e=m.getBCHTypeNumber(this.typeNumber);for(let i=0;i<18;i++){const r=!t&&1==(e>>i&1);this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=r}for(let i=0;i<18;i++){const r=!t&&1==(e>>i&1);this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=r}}setupTypeInfo(t,e){const i=m.getBCHTypeInfo(this.errorCorrectLevel<<3|e);for(let e=0;e<15;e++){const r=!t&&1==(i>>e&1);e<6?this.modules[e][8]=r:e<8?this.modules[e+1][8]=r:this.modules[this.moduleCount-15+e][8]=r}for(let e=0;e<15;e++){const r=!t&&1==(i>>e&1);e<8?this.modules[8][this.moduleCount-e-1]=r:e<9?this.modules[8][15-e-1+1]=r:this.modules[8][15-e-1]=r}this.modules[this.moduleCount-8][8]=!t}mapData(t,e){let i=-1,r=this.moduleCount-1,s=7,n=0;for(let a=this.moduleCount-1;a>0;a-=2)for(6===a&&a--;;){for(let i=0;i<2;i++)if(null===this.modules[r][a-i]){let o=!1;n<t.length&&(o=1==(t[n]>>>s&1)),m.getMask(e,r,a-i)&&(o=!o),this.modules[r][a-i]=o,s--,-1===s&&(n++,s=7)}if(r+=i,r<0||this.moduleCount<=r){r-=i,i=-i;break}}}static{this.PAD0=236}static{this.PAD1=17}static createData(t,e,i){const r=c.getRSBlocks(t,e),s=new o;for(let e=0;e<i.length;e++){const r=i[e];s.put(r.mode,4),s.put(r.getLength(),m.getLengthInBits(r.mode,t)),r.write(s)}let n=0;for(let t=0;t<r.length;t++)n+=r[t].dataCount;if(s.getLengthInBits()>8*n)throw new Error(`Code length overflow. (${s.getLengthInBits()}>${8*n})`);for(s.getLengthInBits()+4<=8*n&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=8*n||(s.put(p.PAD0,8),s.getLengthInBits()>=8*n));)s.put(p.PAD1,8);return p.createBytes(s,r)}static createBytes(t,e){let i=0,r=0,s=0;const n=new Array(e.length),o=new Array(e.length);for(let l=0;l<e.length;l++){const h=e[l].dataCount,c=e[l].totalCount-h;r=Math.max(r,h),s=Math.max(s,c),n[l]=new Array(h);for(let e=0;e<n[l].length;e++)n[l][e]=255&t.buffer[e+i];i+=h;const u=m.getErrorCorrectPolynomial(c),d=new a(n[l],u.getLength()-1).mod(u);o[l]=new Array(u.getLength()-1);for(let t=0;t<o[l].length;t++){const e=t+d.getLength()-o[l].length;o[l][t]=e>=0?d.get(e):0}}let l=0;for(let t=0;t<e.length;t++)l+=e[t].totalCount;const h=new Array(l);let c=0;for(let t=0;t<r;t++)for(let i=0;i<e.length;i++)t<n[i].length&&(h[c++]=n[i][t]);for(let t=0;t<s;t++)for(let i=0;i<e.length;i++)t<o[i].length&&(h[c++]=o[i][t]);return h}}class w{constructor(t,e){this.element=t,this.options=e}draw(t){const e=this.options,i=t.getModuleCount(),r=e.margin||0,s=i+2*r;this.clear();const n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("viewBox",`0 0 ${s} ${s}`),n.setAttribute("width","100%"),n.setAttribute("height","100%"),n.setAttribute("fill",e.colorLight),n.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),this.element.appendChild(n),n.appendChild(this.createSVGElement("rect",{fill:e.colorLight,width:"100%",height:"100%"})),n.appendChild(this.createSVGElement("rect",{fill:e.colorDark,width:"1",height:"1",id:"template"}));for(let e=0;e<i;e++)for(let s=0;s<i;s++)if(t.isDark(e,s)){const t=this.createSVGElement("use",{x:String(r+s),y:String(r+e)});t.setAttributeNS("http://www.w3.org/1999/xlink","href","#template"),n.appendChild(t)}}clear(){for(;this.element.hasChildNodes();)this.element.removeChild(this.element.lastChild)}createSVGElement(t,e){const i=document.createElementNS("http://www.w3.org/2000/svg",t);for(const t in e)e.hasOwnProperty(t)&&i.setAttribute(t,e[t]);return i}}class y{constructor(t,e){this.painted=!1,this.element=t,this.options=e,this.canvas=document.createElement("canvas"),this.canvas.width=e.width,this.canvas.height=e.height,t.appendChild(this.canvas);try{this.context=this.canvas.getContext("2d")}catch(t){this.context=null}}draw(t){if(!this.context)return;const e=this.options,i=this.context,r=e.margin||0,s=t.getModuleCount(),n=Math.min(e.width,e.height)-2*r,a=n/s,o=n/s,l=Math.round(a),h=Math.round(o);this.clear(),i.fillStyle=e.colorLight,i.fillRect(0,0,this.canvas.width,this.canvas.height);for(let n=0;n<s;n++)for(let c=0;c<s;c++){const s=t.isDark(n,c),u=r+c*a,d=r+n*o,g=s?e.colorDark:e.colorLight;if(i.fillStyle=g,"dots"===e.dotStyle)if(s){const t=u+a/2,e=d+o/2,r=Math.min(a,o)/2.2;i.beginPath(),i.arc(t,e,r,0,2*Math.PI),i.fill()}else i.fillRect(u,d,a,o);else if("rounded"===e.dotStyle)if(s){const t=Math.min(a,o)/4;i.beginPath(),i.roundRect(u,d,a,o,t),i.fill()}else i.fillRect(u,d,a,o);else i.fillRect(u,d,a,o),i.strokeStyle=g,i.lineWidth=1,i.strokeRect(Math.floor(u)+.5,Math.floor(d)+.5,l,h),i.strokeRect(Math.ceil(u)-.5,Math.ceil(d)-.5,l,h)}this.painted=!0}clear(){this.context&&(this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.painted=!1)}isPainted(){return this.painted}}class C{static{this.CorrectLevel=s}constructor(t,e){this.qrCodeModel=null,this.options={width:256,height:256,typeNumber:4,colorDark:"#000000",colorLight:"#ffffff",correctLevel:"H",useSVG:!1,dotStyle:"square",margin:4};let i=e;if("string"==typeof i&&(i={text:i}),i&&"object"==typeof i)for(const t in i)this.options[t]=i[t];"string"==typeof t&&(t=document.getElementById(t)),this.element=t,this.drawing=new(this.options.useSVG?w:y)(this.element,this.options),e?.text&&this.makeCode(e.text)}makeCode(t){const e=this.options.correctLevel||s.H;this.qrCodeModel=new p(function(t,e){let i=1;const r=function(t){const e=encodeURI(t).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return e.length+(e.length!==t.length?3:0)}(t);for(let t=0,n=f.length;t<=n;t++){let n=0;switch(e){case s.L:n=f[t][0];break;case s.M:n=f[t][1];break;case s.Q:n=f[t][2];break;case s.H:n=f[t][3]}if(r<=n)break;i++}if(i>f.length)throw new Error("Data too long");return i}(t,e),e),this.qrCodeModel.addData(t),this.qrCodeModel.make(),this.element.title=t,this.drawing.draw(this.qrCodeModel)}clear(){this.drawing.clear()}}let v=(()=>{let t,s,n,a,o,l,h,c,u,d,g,m,f,p,w,y,v,b,x,S,k,L,D,A=[e.element("snice-qr-code")],T=[],I=HTMLElement,M=[],P=[],z=[],B=[],E=[],R=[],q=[],N=[],O=[],U=[],H=[],j=[],F=[],G=[],V=[],Q=[],$=[],W=[],X=[],J=[],K=[],Y=[],Z=[],_=[],tt=[],et=[],it=[],rt=[],st=[],nt=[],at=[],ot=[],lt=[],ht=[],ct=[];return class extends I{static{s=this}constructor(){super(...arguments),this.value=(r(this,M),r(this,P,"")),this.size=(r(this,z),r(this,B,200)),this.errorCorrectionLevel=(r(this,E),r(this,R,"M")),this.renderMode=(r(this,q),r(this,N,"canvas")),this.dotStyle=(r(this,O),r(this,U,"square")),this.margin=(r(this,H),r(this,j,4)),this.fgColor=(r(this,F),r(this,G,"#000000")),this.bgColor=(r(this,V),r(this,Q,"#ffffff")),this.includeImage=(r(this,$),r(this,W,!1)),this.imageUrl=(r(this,X),r(this,J,"")),this.imageSize=(r(this,K),r(this,Y,40)),this.centerText=(r(this,Z),r(this,_,"")),this.centerTextSize=(r(this,tt),r(this,et,16)),this.textFillColor=(r(this,it),r(this,rt,"#000000")),this.textOutlineColor=(r(this,st),r(this,nt,"#ffffff")),this.container=(r(this,at),r(this,ot,void 0)),this.canvas=(r(this,lt),r(this,ht,void 0)),this.qrCode=(r(this,ct),null)}static{const C="function"==typeof Symbol&&Symbol.metadata?Object.create(I[Symbol.metadata]??null):void 0;n=[e.property({type:String})],a=[e.property({type:Number})],o=[e.property({type:String,attribute:"error-correction-level"})],l=[e.property({type:String,attribute:"render-mode"})],h=[e.property({type:String,attribute:"dot-style"})],c=[e.property({type:Number})],u=[e.property({type:String,attribute:"fg-color"})],d=[e.property({type:String,attribute:"bg-color"})],g=[e.property({type:Boolean,attribute:"include-image"})],m=[e.property({type:String,attribute:"image-url"})],f=[e.property({type:Number,attribute:"image-size"})],p=[e.property({type:String,attribute:"center-text"})],w=[e.property({type:Number,attribute:"center-text-size"})],y=[e.property({type:String,attribute:"text-fill-color"})],v=[e.property({type:String,attribute:"text-outline-color"})],b=[e.query(".qr-container")],x=[e.query("canvas")],S=[e.styles()],k=[e.ready()],L=[e.watch("value"),e.watch("size"),e.watch("errorCorrectionLevel"),e.watch("renderMode"),e.watch("dotStyle"),e.watch("margin"),e.watch("fgColor"),e.watch("bgColor"),e.watch("includeImage"),e.watch("imageUrl"),e.watch("imageSize"),e.watch("centerText"),e.watch("centerTextSize"),e.watch("textFillColor"),e.watch("textOutlineColor")],D=[e.render()],i(this,null,S,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:C},null,M),i(this,null,k,{kind:"method",name:"ready",static:!1,private:!1,access:{has:t=>"ready"in t,get:t=>t.ready},metadata:C},null,M),i(this,null,L,{kind:"method",name:"onPropertyChange",static:!1,private:!1,access:{has:t=>"onPropertyChange"in t,get:t=>t.onPropertyChange},metadata:C},null,M),i(this,null,D,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:C},null,M),i(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:C},P,z),i(null,null,a,{kind:"field",name:"size",static:!1,private:!1,access:{has:t=>"size"in t,get:t=>t.size,set:(t,e)=>{t.size=e}},metadata:C},B,E),i(null,null,o,{kind:"field",name:"errorCorrectionLevel",static:!1,private:!1,access:{has:t=>"errorCorrectionLevel"in t,get:t=>t.errorCorrectionLevel,set:(t,e)=>{t.errorCorrectionLevel=e}},metadata:C},R,q),i(null,null,l,{kind:"field",name:"renderMode",static:!1,private:!1,access:{has:t=>"renderMode"in t,get:t=>t.renderMode,set:(t,e)=>{t.renderMode=e}},metadata:C},N,O),i(null,null,h,{kind:"field",name:"dotStyle",static:!1,private:!1,access:{has:t=>"dotStyle"in t,get:t=>t.dotStyle,set:(t,e)=>{t.dotStyle=e}},metadata:C},U,H),i(null,null,c,{kind:"field",name:"margin",static:!1,private:!1,access:{has:t=>"margin"in t,get:t=>t.margin,set:(t,e)=>{t.margin=e}},metadata:C},j,F),i(null,null,u,{kind:"field",name:"fgColor",static:!1,private:!1,access:{has:t=>"fgColor"in t,get:t=>t.fgColor,set:(t,e)=>{t.fgColor=e}},metadata:C},G,V),i(null,null,d,{kind:"field",name:"bgColor",static:!1,private:!1,access:{has:t=>"bgColor"in t,get:t=>t.bgColor,set:(t,e)=>{t.bgColor=e}},metadata:C},Q,$),i(null,null,g,{kind:"field",name:"includeImage",static:!1,private:!1,access:{has:t=>"includeImage"in t,get:t=>t.includeImage,set:(t,e)=>{t.includeImage=e}},metadata:C},W,X),i(null,null,m,{kind:"field",name:"imageUrl",static:!1,private:!1,access:{has:t=>"imageUrl"in t,get:t=>t.imageUrl,set:(t,e)=>{t.imageUrl=e}},metadata:C},J,K),i(null,null,f,{kind:"field",name:"imageSize",static:!1,private:!1,access:{has:t=>"imageSize"in t,get:t=>t.imageSize,set:(t,e)=>{t.imageSize=e}},metadata:C},Y,Z),i(null,null,p,{kind:"field",name:"centerText",static:!1,private:!1,access:{has:t=>"centerText"in t,get:t=>t.centerText,set:(t,e)=>{t.centerText=e}},metadata:C},_,tt),i(null,null,w,{kind:"field",name:"centerTextSize",static:!1,private:!1,access:{has:t=>"centerTextSize"in t,get:t=>t.centerTextSize,set:(t,e)=>{t.centerTextSize=e}},metadata:C},et,it),i(null,null,y,{kind:"field",name:"textFillColor",static:!1,private:!1,access:{has:t=>"textFillColor"in t,get:t=>t.textFillColor,set:(t,e)=>{t.textFillColor=e}},metadata:C},rt,st),i(null,null,v,{kind:"field",name:"textOutlineColor",static:!1,private:!1,access:{has:t=>"textOutlineColor"in t,get:t=>t.textOutlineColor,set:(t,e)=>{t.textOutlineColor=e}},metadata:C},nt,at),i(null,null,b,{kind:"field",name:"container",static:!1,private:!1,access:{has:t=>"container"in t,get:t=>t.container,set:(t,e)=>{t.container=e}},metadata:C},ot,lt),i(null,null,x,{kind:"field",name:"canvas",static:!1,private:!1,access:{has:t=>"canvas"in t,get:t=>t.canvas,set:(t,e)=>{t.canvas=e}},metadata:C},ht,ct),i(null,t={value:s},A,{kind:"class",name:s.name,metadata:C},null,T),s=t.value,C&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:C}),r(s,T)}styles(){return e.css`${":host([hidden]){display:none}:host{display:inline-block;width:fit-content;height:fit-content}.qr-container{display:flex;align-items:center;justify-content:center;background:var(--qr-bg,hsl(0 0% 100%));border-radius:var(--qr-border-radius,0);padding:var(--qr-padding,0);overflow:hidden}canvas,svg{display:block;max-width:100%;height:auto}.qr-image{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);border-radius:var(--snice-border-radius-md,.25rem);background:hsl(0 0% 100%);padding:4px}"}`}ready(){this.value&&this.generateQRCode()}onPropertyChange(){this.value&&this.generateQRCode()}render(){return e.html`
1
+ void 0===globalThis.Snice&&console.warn("[snice] snice-runtime.min.js must be loaded before snice-qr-code.min.js");var SniceQrCode=function(t,e){"use strict";function i(t,e,i,r,s,n){function a(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var o,l=r.kind,h="getter"===l?"get":"setter"===l?"set":"value",c=!e&&t?r.static?t:t.prototype:null,u=e||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),d=!1,g=i.length-1;g>=0;g--){var m={};for(var f in r)m[f]="access"===f?{}:r[f];for(var f in r.access)m.access[f]=r.access[f];m.addInitializer=function(t){if(d)throw new TypeError("Cannot add initializers after decoration has completed");n.push(a(t||null))};var p=(0,i[g])("accessor"===l?{get:u.get,set:u.set}:u[h],m);if("accessor"===l){if(void 0===p)continue;if(null===p||"object"!=typeof p)throw new TypeError("Object expected");(o=a(p.get))&&(u.get=o),(o=a(p.set))&&(u.set=o),(o=a(p.init))&&s.unshift(o)}else(o=a(p))&&("field"===l?s.unshift(o):u[h]=o)}c&&Object.defineProperty(c,r.name,u),d=!0}function r(t,e,i){for(var r=arguments.length>2,s=0;s<e.length;s++)i=r?e[s].call(t,i):e[s].call(t);return r?i:void 0}"function"==typeof SuppressedError&&SuppressedError;const s={L:1,M:0,Q:3,H:2},n=[s.L,s.M,s.Q,s.H],a=(()=>{const t=new Array(256),e=new Array(256);for(let e=0;e<8;e++)t[e]=1<<e;for(let e=8;e<256;e++)t[e]=t[e-4]^t[e-5]^t[e-6]^t[e-8];for(let i=0;i<255;i++)e[t[i]]=i;return{log:t=>{if(t<1)throw new Error("Invalid input");return e[t]},exp:e=>{for(;e<0;)e+=255;for(;e>=256;)e-=255;return t[e]}}})();class o{constructor(t,e){if(void 0===t.length)throw new Error("Invalid polynomial");let i=0;for(;i<t.length&&0===t[i];)i++;this.num=new Array(t.length-i+e);for(let e=0;e<t.length-i;e++)this.num[e]=t[e+i]}get(t){return this.num[t]}getLength(){return this.num.length}multiply(t){const e=new Array(this.getLength()+t.getLength()-1);for(let i=0;i<this.getLength();i++)for(let r=0;r<t.getLength();r++)e[i+r]^=a.exp(a.log(this.get(i))+a.log(t.get(r)));return new o(e,0)}mod(t){if(this.getLength()-t.getLength()<0)return this;const e=a.log(this.get(0))-a.log(t.get(0)),i=new Array(this.getLength());for(let t=0;t<this.getLength();t++)i[t]=this.get(t);for(let r=0;r<t.getLength();r++)i[r]^=a.exp(a.log(t.get(r))+e);return new o(i,0).mod(t)}}class l{constructor(){this.buffer=[],this.length=0}get(t){const e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)}put(t,e){for(let i=0;i<e;i++)this.putBit(1==(t>>>e-i-1&1))}getLengthInBits(){return this.length}putBit(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}}class h{constructor(t){this.mode=4,this.data=t,this.parsedData=[];for(let t=0,e=this.data.length;t<e;t++){const e=[],i=this.data.charCodeAt(t);i>65536?(e[0]=240|(1835008&i)>>>18,e[1]=128|(258048&i)>>>12,e[2]=128|(4032&i)>>>6,e[3]=128|63&i):i>2048?(e[0]=224|(61440&i)>>>12,e[1]=128|(4032&i)>>>6,e[2]=128|63&i):i>128?(e[0]=192|(1984&i)>>>6,e[1]=128|63&i):e[0]=i,this.parsedData.push(...e)}this.parsedData.length!==this.data.length&&this.parsedData.unshift(239,187,191)}getLength(){return this.parsedData.length}write(t){for(let e=0,i=this.parsedData.length;e<i;e++)t.put(this.parsedData[e],8)}}const c=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];class u{constructor(t,e){this.totalCount=t,this.dataCount=e}static getRSBlocks(t,e){const i=this.getRsBlockTable(t,e);if(void 0===i)throw new Error("Invalid type number or error correction level");const r=i.length/3,s=[];for(let t=0;t<r;t++){const e=i[3*t+0],r=i[3*t+1],n=i[3*t+2];for(let t=0;t<e;t++)s.push(new u(r,n))}return s}static getRsBlockTable(t,e){switch(e){case s.L:return c[4*(t-1)+0];case s.M:return c[4*(t-1)+1];case s.Q:return c[4*(t-1)+2];case s.H:return c[4*(t-1)+3];default:return}}}const d=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],g=1335,m=7973,f={getBCHTypeInfo(t){let e=t<<10;for(;this.getBCHDigit(e)-this.getBCHDigit(g)>=0;)e^=g<<this.getBCHDigit(e)-this.getBCHDigit(g);return 21522^(t<<10|e)},getBCHTypeNumber(t){let e=t<<12;for(;this.getBCHDigit(e)-this.getBCHDigit(m)>=0;)e^=m<<this.getBCHDigit(e)-this.getBCHDigit(m);return t<<12|e},getBCHDigit(t){let e=0;for(;0!==t;)e++,t>>>=1;return e},getPatternPosition:t=>d[t-1],getMask(t,e,i){switch(t){case 0:return(e+i)%2==0;case 1:return e%2==0;case 2:return i%3==0;case 3:return(e+i)%3==0;case 4:return(Math.floor(e/2)+Math.floor(i/3))%2==0;case 5:return e*i%2+e*i%3==0;case 6:return(e*i%2+e*i%3)%2==0;case 7:return(e*i%3+(e+i)%2)%2==0;default:throw new Error("Invalid mask pattern")}},getErrorCorrectPolynomial(t){let e=new o([1],0);for(let i=0;i<t;i++)e=e.multiply(new o([1,a.exp(i)],0));return e},getLengthInBits(t,e){if(e>=1&&e<10)switch(t){case 1:return 10;case 2:return 9;case 4:case 8:return 8;default:throw new Error("Invalid mode")}else if(e<27)switch(t){case 1:return 12;case 2:return 11;case 4:return 16;case 8:return 10;default:throw new Error("Invalid mode")}else{if(!(e<41))throw new Error("Invalid type");switch(t){case 1:return 14;case 2:return 13;case 4:return 16;case 8:return 12;default:throw new Error("Invalid mode")}}},getLostPoint(t){const e=t.getModuleCount();let i=0;for(let r=0;r<e;r++)for(let s=0;s<e;s++){let n=0;const a=t.isDark(r,s);for(let i=-1;i<=1;i++)if(!(r+i<0||e<=r+i))for(let o=-1;o<=1;o++)s+o<0||e<=s+o||0===i&&0===o||a===t.isDark(r+i,s+o)&&n++;n>5&&(i+=3+n-5)}for(let r=0;r<e-1;r++)for(let s=0;s<e-1;s++){let e=0;t.isDark(r,s)&&e++,t.isDark(r+1,s)&&e++,t.isDark(r,s+1)&&e++,t.isDark(r+1,s+1)&&e++,0!==e&&4!==e||(i+=3)}for(let r=0;r<e;r++)for(let s=0;s<e-6;s++)t.isDark(r,s)&&!t.isDark(r,s+1)&&t.isDark(r,s+2)&&t.isDark(r,s+3)&&t.isDark(r,s+4)&&!t.isDark(r,s+5)&&t.isDark(r,s+6)&&(i+=40);for(let r=0;r<e;r++)for(let s=0;s<e-6;s++)t.isDark(s,r)&&!t.isDark(s+1,r)&&t.isDark(s+2,r)&&t.isDark(s+3,r)&&t.isDark(s+4,r)&&!t.isDark(s+5,r)&&t.isDark(s+6,r)&&(i+=40);let r=0;for(let i=0;i<e;i++)for(let s=0;s<e;s++)t.isDark(s,i)&&r++;return i+=Math.abs(100*r/e/e-50)/5*10,i}},p=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];class w{constructor(t,e){this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[],this.typeNumber=t,this.errorCorrectLevel=e}addData(t){const e=new h(t);this.dataList.push(e),this.dataCache=null}isDark(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(`Invalid position: ${t},${e}`);return this.modules[t][e]??!1}getModuleCount(){return this.moduleCount}make(){this.makeImpl(!1,this.getBestMaskPattern())}makeImpl(t,e){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(let t=0;t<this.moduleCount;t++){this.modules[t]=new Array(this.moduleCount);for(let e=0;e<this.moduleCount;e++)this.modules[t][e]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),null===this.dataCache&&(this.dataCache=w.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)}setupPositionProbePattern(t,e){for(let i=-1;i<=7;i++)if(!(t+i<=-1||this.moduleCount<=t+i))for(let r=-1;r<=7;r++)e+r<=-1||this.moduleCount<=e+r||(this.modules[t+i][e+r]=i>=0&&i<=6&&(0===r||6===r)||r>=0&&r<=6&&(0===i||6===i)||i>=2&&i<=4&&r>=2&&r<=4)}getBestMaskPattern(){let t=0,e=0;for(let i=0;i<8;i++){this.makeImpl(!0,i);const r=f.getLostPoint(this);(0===i||t>r)&&(t=r,e=i)}return e}setupTimingPattern(){for(let t=8;t<this.moduleCount-8;t++)null===this.modules[t][6]&&(this.modules[t][6]=t%2==0);for(let t=8;t<this.moduleCount-8;t++)null===this.modules[6][t]&&(this.modules[6][t]=t%2==0)}setupPositionAdjustPattern(){const t=f.getPatternPosition(this.typeNumber);for(let e=0;e<t.length;e++)for(let i=0;i<t.length;i++){const r=t[e],s=t[i];if(null===this.modules[r][s])for(let t=-2;t<=2;t++)for(let e=-2;e<=2;e++)this.modules[r+t][s+e]=-2===t||2===t||-2===e||2===e||0===t&&0===e}}setupTypeNumber(t){const e=f.getBCHTypeNumber(this.typeNumber);for(let i=0;i<18;i++){const r=!t&&1==(e>>i&1);this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=r}for(let i=0;i<18;i++){const r=!t&&1==(e>>i&1);this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=r}}setupTypeInfo(t,e){const i=f.getBCHTypeInfo(this.errorCorrectLevel<<3|e);for(let e=0;e<15;e++){const r=!t&&1==(i>>e&1);e<6?this.modules[e][8]=r:e<8?this.modules[e+1][8]=r:this.modules[this.moduleCount-15+e][8]=r}for(let e=0;e<15;e++){const r=!t&&1==(i>>e&1);e<8?this.modules[8][this.moduleCount-e-1]=r:e<9?this.modules[8][15-e-1+1]=r:this.modules[8][15-e-1]=r}this.modules[this.moduleCount-8][8]=!t}mapData(t,e){let i=-1,r=this.moduleCount-1,s=7,n=0;for(let a=this.moduleCount-1;a>0;a-=2)for(6===a&&a--;;){for(let i=0;i<2;i++)if(null===this.modules[r][a-i]){let o=!1;n<t.length&&(o=1==(t[n]>>>s&1)),f.getMask(e,r,a-i)&&(o=!o),this.modules[r][a-i]=o,s--,-1===s&&(n++,s=7)}if(r+=i,r<0||this.moduleCount<=r){r-=i,i=-i;break}}}static{this.PAD0=236}static{this.PAD1=17}static createData(t,e,i){const r=u.getRSBlocks(t,e),s=new l;for(let e=0;e<i.length;e++){const r=i[e];s.put(r.mode,4),s.put(r.getLength(),f.getLengthInBits(r.mode,t)),r.write(s)}let n=0;for(let t=0;t<r.length;t++)n+=r[t].dataCount;if(s.getLengthInBits()>8*n)throw new Error(`Code length overflow. (${s.getLengthInBits()}>${8*n})`);for(s.getLengthInBits()+4<=8*n&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;!(s.getLengthInBits()>=8*n||(s.put(w.PAD0,8),s.getLengthInBits()>=8*n));)s.put(w.PAD1,8);return w.createBytes(s,r)}static createBytes(t,e){let i=0,r=0,s=0;const n=new Array(e.length),a=new Array(e.length);for(let l=0;l<e.length;l++){const h=e[l].dataCount,c=e[l].totalCount-h;r=Math.max(r,h),s=Math.max(s,c),n[l]=new Array(h);for(let e=0;e<n[l].length;e++)n[l][e]=255&t.buffer[e+i];i+=h;const u=f.getErrorCorrectPolynomial(c),d=new o(n[l],u.getLength()-1).mod(u);a[l]=new Array(u.getLength()-1);for(let t=0;t<a[l].length;t++){const e=t+d.getLength()-a[l].length;a[l][t]=e>=0?d.get(e):0}}let l=0;for(let t=0;t<e.length;t++)l+=e[t].totalCount;const h=new Array(l);let c=0;for(let t=0;t<r;t++)for(let i=0;i<e.length;i++)t<n[i].length&&(h[c++]=n[i][t]);for(let t=0;t<s;t++)for(let i=0;i<e.length;i++)t<a[i].length&&(h[c++]=a[i][t]);return h}}class y{constructor(t,e){this.element=t,this.options=e}draw(t){const e=this.options,i=t.getModuleCount(),r=e.margin||0,s=i+2*r;this.clear();const n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("viewBox",`0 0 ${s} ${s}`),n.setAttribute("width","100%"),n.setAttribute("height","100%"),n.setAttribute("fill",e.colorLight),n.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),this.element.appendChild(n),n.appendChild(this.createSVGElement("rect",{fill:e.colorLight,width:"100%",height:"100%"})),n.appendChild(this.createSVGElement("rect",{fill:e.colorDark,width:"1",height:"1",id:"template"}));for(let e=0;e<i;e++)for(let s=0;s<i;s++)if(t.isDark(e,s)){const t=this.createSVGElement("use",{x:String(r+s),y:String(r+e)});t.setAttributeNS("http://www.w3.org/1999/xlink","href","#template"),n.appendChild(t)}}clear(){for(;this.element.hasChildNodes();)this.element.removeChild(this.element.lastChild)}createSVGElement(t,e){const i=document.createElementNS("http://www.w3.org/2000/svg",t);for(const t in e)e.hasOwnProperty(t)&&i.setAttribute(t,e[t]);return i}}class C{constructor(t,e){this.painted=!1,this.element=t,this.options=e,this.canvas=document.createElement("canvas"),this.canvas.width=e.width,this.canvas.height=e.height,t.appendChild(this.canvas);try{this.context=this.canvas.getContext("2d")}catch(t){this.context=null}}draw(t){if(!this.context)return;const e=this.options,i=this.context,r=e.margin||0,s=t.getModuleCount(),n=Math.min(e.width,e.height)-2*r,a=n/s,o=n/s,l=Math.round(a),h=Math.round(o);this.clear(),i.fillStyle=e.colorLight,i.fillRect(0,0,this.canvas.width,this.canvas.height);for(let n=0;n<s;n++)for(let c=0;c<s;c++){const s=t.isDark(n,c),u=r+c*a,d=r+n*o,g=s?e.colorDark:e.colorLight;if(i.fillStyle=g,"dots"===e.dotStyle)if(s){const t=u+a/2,e=d+o/2,r=Math.min(a,o)/2.2;i.beginPath(),i.arc(t,e,r,0,2*Math.PI),i.fill()}else i.fillRect(u,d,a,o);else if("rounded"===e.dotStyle)if(s){const t=Math.min(a,o)/4;i.beginPath(),i.roundRect(u,d,a,o,t),i.fill()}else i.fillRect(u,d,a,o);else i.fillRect(u,d,a,o),i.strokeStyle=g,i.lineWidth=1,i.strokeRect(Math.floor(u)+.5,Math.floor(d)+.5,l,h),i.strokeRect(Math.ceil(u)-.5,Math.ceil(d)-.5,l,h)}this.painted=!0}clear(){this.context&&(this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this.painted=!1)}isPainted(){return this.painted}}class v{static{this.CorrectLevel=s}constructor(t,e){this.qrCodeModel=null,this.options={width:256,height:256,typeNumber:4,colorDark:"#000000",colorLight:"#ffffff",correctLevel:"H",useSVG:!1,dotStyle:"square",margin:4};let i=e;if("string"==typeof i&&(i={text:i}),i&&"object"==typeof i)for(const t in i)this.options[t]=i[t];"string"==typeof t&&(t=document.getElementById(t)),this.element=t,this.drawing=new(this.options.useSVG?y:C)(this.element,this.options),e?.text&&this.makeCode(e.text)}makeCode(t){const e=function(t){if("string"==typeof t){const e=s[t];return void 0===e?s.H:e}return"number"==typeof t&&n.includes(t)?t:s.H}(this.options.correctLevel);this.qrCodeModel=new w(function(t,e){let i=1;const r=function(t){const e=encodeURI(t).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return e.length+(e.length!==t.length?3:0)}(t);for(let t=0,n=p.length;t<=n;t++){let n=0;switch(e){case s.L:n=p[t][0];break;case s.M:n=p[t][1];break;case s.Q:n=p[t][2];break;case s.H:n=p[t][3]}if(r<=n)break;i++}if(i>p.length)throw new Error("Data too long");return i}(t,e),e),this.qrCodeModel.addData(t),this.qrCodeModel.make(),this.element.title=t,this.drawing.draw(this.qrCodeModel)}clear(){this.drawing.clear()}}let b=(()=>{let t,s,n,a,o,l,h,c,u,d,g,m,f,p,w,y,C,b,x,S,k,L,D,A=[e.element("snice-qr-code")],T=[],I=HTMLElement,M=[],P=[],z=[],B=[],E=[],R=[],q=[],N=[],O=[],U=[],H=[],j=[],F=[],G=[],Q=[],V=[],$=[],W=[],X=[],J=[],K=[],Y=[],Z=[],_=[],tt=[],et=[],it=[],rt=[],st=[],nt=[],at=[],ot=[],lt=[],ht=[],ct=[];return class extends I{static{s=this}constructor(){super(...arguments),this.value=(r(this,M),r(this,P,"")),this.size=(r(this,z),r(this,B,200)),this.errorCorrectionLevel=(r(this,E),r(this,R,"M")),this.renderMode=(r(this,q),r(this,N,"canvas")),this.dotStyle=(r(this,O),r(this,U,"square")),this.margin=(r(this,H),r(this,j,4)),this.fgColor=(r(this,F),r(this,G,"#000000")),this.bgColor=(r(this,Q),r(this,V,"#ffffff")),this.includeImage=(r(this,$),r(this,W,!1)),this.imageUrl=(r(this,X),r(this,J,"")),this.imageSize=(r(this,K),r(this,Y,40)),this.centerText=(r(this,Z),r(this,_,"")),this.centerTextSize=(r(this,tt),r(this,et,16)),this.textFillColor=(r(this,it),r(this,rt,"#000000")),this.textOutlineColor=(r(this,st),r(this,nt,"#ffffff")),this.container=(r(this,at),r(this,ot,void 0)),this.canvas=(r(this,lt),r(this,ht,void 0)),this.qrCode=(r(this,ct),null)}static{const v="function"==typeof Symbol&&Symbol.metadata?Object.create(I[Symbol.metadata]??null):void 0;n=[e.property({type:String})],a=[e.property({type:Number})],o=[e.property({type:String,attribute:"error-correction-level"})],l=[e.property({type:String,attribute:"render-mode"})],h=[e.property({type:String,attribute:"dot-style"})],c=[e.property({type:Number})],u=[e.property({type:String,attribute:"fg-color"})],d=[e.property({type:String,attribute:"bg-color"})],g=[e.property({type:Boolean,attribute:"include-image"})],m=[e.property({type:String,attribute:"image-url"})],f=[e.property({type:Number,attribute:"image-size"})],p=[e.property({type:String,attribute:"center-text"})],w=[e.property({type:Number,attribute:"center-text-size"})],y=[e.property({type:String,attribute:"text-fill-color"})],C=[e.property({type:String,attribute:"text-outline-color"})],b=[e.query(".qr-container")],x=[e.query("canvas")],S=[e.styles()],k=[e.ready()],L=[e.watch("value"),e.watch("size"),e.watch("errorCorrectionLevel"),e.watch("renderMode"),e.watch("dotStyle"),e.watch("margin"),e.watch("fgColor"),e.watch("bgColor"),e.watch("includeImage"),e.watch("imageUrl"),e.watch("imageSize"),e.watch("centerText"),e.watch("centerTextSize"),e.watch("textFillColor"),e.watch("textOutlineColor")],D=[e.render()],i(this,null,S,{kind:"method",name:"styles",static:!1,private:!1,access:{has:t=>"styles"in t,get:t=>t.styles},metadata:v},null,M),i(this,null,k,{kind:"method",name:"ready",static:!1,private:!1,access:{has:t=>"ready"in t,get:t=>t.ready},metadata:v},null,M),i(this,null,L,{kind:"method",name:"onPropertyChange",static:!1,private:!1,access:{has:t=>"onPropertyChange"in t,get:t=>t.onPropertyChange},metadata:v},null,M),i(this,null,D,{kind:"method",name:"render",static:!1,private:!1,access:{has:t=>"render"in t,get:t=>t.render},metadata:v},null,M),i(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:t=>"value"in t,get:t=>t.value,set:(t,e)=>{t.value=e}},metadata:v},P,z),i(null,null,a,{kind:"field",name:"size",static:!1,private:!1,access:{has:t=>"size"in t,get:t=>t.size,set:(t,e)=>{t.size=e}},metadata:v},B,E),i(null,null,o,{kind:"field",name:"errorCorrectionLevel",static:!1,private:!1,access:{has:t=>"errorCorrectionLevel"in t,get:t=>t.errorCorrectionLevel,set:(t,e)=>{t.errorCorrectionLevel=e}},metadata:v},R,q),i(null,null,l,{kind:"field",name:"renderMode",static:!1,private:!1,access:{has:t=>"renderMode"in t,get:t=>t.renderMode,set:(t,e)=>{t.renderMode=e}},metadata:v},N,O),i(null,null,h,{kind:"field",name:"dotStyle",static:!1,private:!1,access:{has:t=>"dotStyle"in t,get:t=>t.dotStyle,set:(t,e)=>{t.dotStyle=e}},metadata:v},U,H),i(null,null,c,{kind:"field",name:"margin",static:!1,private:!1,access:{has:t=>"margin"in t,get:t=>t.margin,set:(t,e)=>{t.margin=e}},metadata:v},j,F),i(null,null,u,{kind:"field",name:"fgColor",static:!1,private:!1,access:{has:t=>"fgColor"in t,get:t=>t.fgColor,set:(t,e)=>{t.fgColor=e}},metadata:v},G,Q),i(null,null,d,{kind:"field",name:"bgColor",static:!1,private:!1,access:{has:t=>"bgColor"in t,get:t=>t.bgColor,set:(t,e)=>{t.bgColor=e}},metadata:v},V,$),i(null,null,g,{kind:"field",name:"includeImage",static:!1,private:!1,access:{has:t=>"includeImage"in t,get:t=>t.includeImage,set:(t,e)=>{t.includeImage=e}},metadata:v},W,X),i(null,null,m,{kind:"field",name:"imageUrl",static:!1,private:!1,access:{has:t=>"imageUrl"in t,get:t=>t.imageUrl,set:(t,e)=>{t.imageUrl=e}},metadata:v},J,K),i(null,null,f,{kind:"field",name:"imageSize",static:!1,private:!1,access:{has:t=>"imageSize"in t,get:t=>t.imageSize,set:(t,e)=>{t.imageSize=e}},metadata:v},Y,Z),i(null,null,p,{kind:"field",name:"centerText",static:!1,private:!1,access:{has:t=>"centerText"in t,get:t=>t.centerText,set:(t,e)=>{t.centerText=e}},metadata:v},_,tt),i(null,null,w,{kind:"field",name:"centerTextSize",static:!1,private:!1,access:{has:t=>"centerTextSize"in t,get:t=>t.centerTextSize,set:(t,e)=>{t.centerTextSize=e}},metadata:v},et,it),i(null,null,y,{kind:"field",name:"textFillColor",static:!1,private:!1,access:{has:t=>"textFillColor"in t,get:t=>t.textFillColor,set:(t,e)=>{t.textFillColor=e}},metadata:v},rt,st),i(null,null,C,{kind:"field",name:"textOutlineColor",static:!1,private:!1,access:{has:t=>"textOutlineColor"in t,get:t=>t.textOutlineColor,set:(t,e)=>{t.textOutlineColor=e}},metadata:v},nt,at),i(null,null,b,{kind:"field",name:"container",static:!1,private:!1,access:{has:t=>"container"in t,get:t=>t.container,set:(t,e)=>{t.container=e}},metadata:v},ot,lt),i(null,null,x,{kind:"field",name:"canvas",static:!1,private:!1,access:{has:t=>"canvas"in t,get:t=>t.canvas,set:(t,e)=>{t.canvas=e}},metadata:v},ht,ct),i(null,t={value:s},A,{kind:"class",name:s.name,metadata:v},null,T),s=t.value,v&&Object.defineProperty(s,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:v}),r(s,T)}styles(){return e.css`${":host([hidden]){display:none}:host{display:inline-block;width:fit-content;height:fit-content}.qr-container{display:flex;align-items:center;justify-content:center;background:var(--qr-bg,hsl(0 0% 100%));border-radius:var(--qr-border-radius,0);padding:var(--qr-padding,0);overflow:hidden}canvas,svg{display:block;max-width:100%;height:auto}.qr-image{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);border-radius:var(--snice-border-radius-md,.25rem);background:hsl(0 0% 100%);padding:4px}"}`}ready(){this.value&&this.generateQRCode()}onPropertyChange(){this.value&&this.generateQRCode()}render(){return e.html`
2
2
  <div part="base" class="qr-container" role="img" aria-label="QR code: ${this.value}"></div>
3
- `}generateQRCode(){if(this.value&&this.container){for(this.qrCode&&this.qrCode.clear();this.container.firstChild;)this.container.removeChild(this.container.firstChild);this.qrCode=new C(this.container,{text:this.value,width:this.size,height:this.size,colorDark:this.fgColor,colorLight:this.bgColor,correctLevel:C.CorrectLevel[this.errorCorrectionLevel],useSVG:"svg"===this.renderMode,dotStyle:this.dotStyle,margin:this.margin}),requestAnimationFrame(()=>this.applyOverlays())}}applyOverlays(){const t=this.container?.querySelector("svg");if(t)return void this.applySvgOverlays(t);const e=this.container?.querySelector("canvas");if(!e)return;let i;try{i=e.getContext("2d")}catch(t){return}if(!i)return;const r=this.margin;if(r>0){const t=this.size,e=t-2*r,s=i.getImageData(0,0,t,t),n=document.createElement("canvas");n.width=t,n.height=t,n.getContext("2d").putImageData(s,0,0),i.fillStyle=this.bgColor,i.fillRect(0,0,t,t),i.drawImage(n,0,0,t,t,r,r,e,e)}if(this.includeImage&&this.imageUrl){const t=new Image;t.crossOrigin="anonymous",t.onload=()=>{const e=this.imageSize;i.drawImage(t,(this.size-e)/2,(this.size-e)/2,e,e),this.centerText&&this.drawCenterText(i)},t.src=this.imageUrl}else this.centerText&&this.drawCenterText(i)}applySvgOverlays(t){const e=(t.getAttribute("viewBox")?.split(" ").map(Number)||[])[2]||100,i=e/2,r=e/this.size;if(this.includeImage&&this.imageUrl){const e=this.imageSize*r,s=i-e/2,n=i-e/2,a=new Image;a.crossOrigin="anonymous",a.onload=()=>{const o=document.createElement("canvas");o.width=a.naturalWidth,o.height=a.naturalHeight,o.getContext("2d").drawImage(a,0,0);const l=o.toDataURL("image/png"),h=document.createElementNS("http://www.w3.org/2000/svg","image");h.setAttribute("x",String(s)),h.setAttribute("y",String(n)),h.setAttribute("width",String(e)),h.setAttribute("height",String(e)),h.setAttributeNS("http://www.w3.org/1999/xlink","href",l),t.appendChild(h),this.centerText&&this.drawSvgCenterText(t,i,r)},a.src=this.imageUrl}else this.centerText&&this.drawSvgCenterText(t,i,r)}drawSvgCenterText(t,e,i){const r=this.centerTextSize*i,s=6*i,n=document.createElementNS("http://www.w3.org/2000/svg","text");n.setAttribute("x",String(e)),n.setAttribute("y",String(e)),n.setAttribute("text-anchor","middle"),n.setAttribute("dominant-baseline","central"),n.setAttribute("font-size",String(r)),n.setAttribute("font-weight","bold"),n.setAttribute("font-family","sans-serif"),n.setAttribute("stroke",this.textOutlineColor),n.setAttribute("stroke-width",String(s)),n.setAttribute("stroke-linejoin","round"),n.setAttribute("fill",this.textOutlineColor),n.textContent=this.centerText,t.appendChild(n);const a=document.createElementNS("http://www.w3.org/2000/svg","text");a.setAttribute("x",String(e)),a.setAttribute("y",String(e)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central"),a.setAttribute("font-size",String(r)),a.setAttribute("font-weight","bold"),a.setAttribute("font-family","sans-serif"),a.setAttribute("fill",this.textFillColor),a.textContent=this.centerText,t.appendChild(a)}drawCenterText(t){t.font=`bold ${this.centerTextSize}px sans-serif`,t.textAlign="center",t.textBaseline="middle";const e=this.size/2,i=this.size/2;t.strokeStyle=this.textOutlineColor,t.lineWidth=6,t.lineJoin="round",t.miterLimit=2,t.strokeText(this.centerText,e,i),t.fillStyle=this.textFillColor,t.fillText(this.centerText,e,i)}toSVGString(){const t=this.container?.querySelector("svg");return t?(new XMLSerializer).serializeToString(t):""}async toDataURL(t="image/png",e=.92){if("image/svg+xml"===t){const t=this.toSVGString();return t?"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(t):""}const i=this.container?.querySelector("canvas");if(i)return i.toDataURL(t,e);const r=this.container?.querySelector("svg");if(!r)return"";const s=(new XMLSerializer).serializeToString(r),n=new Blob([s],{type:"image/svg+xml;charset=utf-8"}),a=URL.createObjectURL(n),o=new Image;return new Promise(i=>{o.onload=()=>{const r=document.createElement("canvas");r.width=this.size,r.height=this.size,r.getContext("2d").drawImage(o,0,0,this.size,this.size),URL.revokeObjectURL(a),i(r.toDataURL(t,e))},o.onerror=()=>{URL.revokeObjectURL(a),i("")},o.src=a})}async toBlob(t="image/png",e=.92){if("image/svg+xml"===t){const t=this.toSVGString();return new Blob([t],{type:"image/svg+xml;charset=utf-8"})}const i=await this.toDataURL(t,e);return(await fetch(i)).blob()}async download(t="qr-code.png"){const e=t.endsWith(".svg"),i=await this.toDataURL(e?"image/svg+xml":"image/png"),r=document.createElement("a");r.href=i,r.download=t,r.click()}},s})();return t.SniceQRCode=v,t}({},Snice);
3
+ `}generateQRCode(){if(this.value&&this.container){for(this.qrCode&&this.qrCode.clear();this.container.firstChild;)this.container.removeChild(this.container.firstChild);this.qrCode=new v(this.container,{text:this.value,width:this.size,height:this.size,colorDark:this.fgColor,colorLight:this.bgColor,correctLevel:v.CorrectLevel[this.errorCorrectionLevel],useSVG:"svg"===this.renderMode,dotStyle:this.dotStyle,margin:this.margin}),requestAnimationFrame(()=>this.applyOverlays())}}applyOverlays(){const t=this.container?.querySelector("svg");if(t)return void this.applySvgOverlays(t);const e=this.container?.querySelector("canvas");if(!e)return;let i;try{i=e.getContext("2d")}catch(t){return}if(!i)return;const r=this.margin;if(r>0){const t=this.size,e=t-2*r,s=i.getImageData(0,0,t,t),n=document.createElement("canvas");n.width=t,n.height=t,n.getContext("2d").putImageData(s,0,0),i.fillStyle=this.bgColor,i.fillRect(0,0,t,t),i.drawImage(n,0,0,t,t,r,r,e,e)}if(this.includeImage&&this.imageUrl){const t=new Image;t.crossOrigin="anonymous",t.onload=()=>{const e=this.imageSize;i.drawImage(t,(this.size-e)/2,(this.size-e)/2,e,e),this.centerText&&this.drawCenterText(i)},t.src=this.imageUrl}else this.centerText&&this.drawCenterText(i)}applySvgOverlays(t){const e=(t.getAttribute("viewBox")?.split(" ").map(Number)||[])[2]||100,i=e/2,r=e/this.size;if(this.includeImage&&this.imageUrl){const e=this.imageSize*r,s=i-e/2,n=i-e/2,a=new Image;a.crossOrigin="anonymous",a.onload=()=>{const o=document.createElement("canvas");o.width=a.naturalWidth,o.height=a.naturalHeight,o.getContext("2d").drawImage(a,0,0);const l=o.toDataURL("image/png"),h=document.createElementNS("http://www.w3.org/2000/svg","image");h.setAttribute("x",String(s)),h.setAttribute("y",String(n)),h.setAttribute("width",String(e)),h.setAttribute("height",String(e)),h.setAttributeNS("http://www.w3.org/1999/xlink","href",l),t.appendChild(h),this.centerText&&this.drawSvgCenterText(t,i,r)},a.src=this.imageUrl}else this.centerText&&this.drawSvgCenterText(t,i,r)}drawSvgCenterText(t,e,i){const r=this.centerTextSize*i,s=6*i,n=document.createElementNS("http://www.w3.org/2000/svg","text");n.setAttribute("x",String(e)),n.setAttribute("y",String(e)),n.setAttribute("text-anchor","middle"),n.setAttribute("dominant-baseline","central"),n.setAttribute("font-size",String(r)),n.setAttribute("font-weight","bold"),n.setAttribute("font-family","sans-serif"),n.setAttribute("stroke",this.textOutlineColor),n.setAttribute("stroke-width",String(s)),n.setAttribute("stroke-linejoin","round"),n.setAttribute("fill",this.textOutlineColor),n.textContent=this.centerText,t.appendChild(n);const a=document.createElementNS("http://www.w3.org/2000/svg","text");a.setAttribute("x",String(e)),a.setAttribute("y",String(e)),a.setAttribute("text-anchor","middle"),a.setAttribute("dominant-baseline","central"),a.setAttribute("font-size",String(r)),a.setAttribute("font-weight","bold"),a.setAttribute("font-family","sans-serif"),a.setAttribute("fill",this.textFillColor),a.textContent=this.centerText,t.appendChild(a)}drawCenterText(t){t.font=`bold ${this.centerTextSize}px sans-serif`,t.textAlign="center",t.textBaseline="middle";const e=this.size/2,i=this.size/2;t.strokeStyle=this.textOutlineColor,t.lineWidth=6,t.lineJoin="round",t.miterLimit=2,t.strokeText(this.centerText,e,i),t.fillStyle=this.textFillColor,t.fillText(this.centerText,e,i)}toSVGString(){const t=this.container?.querySelector("svg");return t?(new XMLSerializer).serializeToString(t):""}async toDataURL(t="image/png",e=.92){if("image/svg+xml"===t){const t=this.toSVGString();return t?"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(t):""}const i=this.container?.querySelector("canvas");if(i)return i.toDataURL(t,e);const r=this.container?.querySelector("svg");if(!r)return"";const s=(new XMLSerializer).serializeToString(r),n=new Blob([s],{type:"image/svg+xml;charset=utf-8"}),a=URL.createObjectURL(n),o=new Image;return new Promise(i=>{o.onload=()=>{const r=document.createElement("canvas");r.width=this.size,r.height=this.size,r.getContext("2d").drawImage(o,0,0,this.size,this.size),URL.revokeObjectURL(a),i(r.toDataURL(t,e))},o.onerror=()=>{URL.revokeObjectURL(a),i("")},o.src=a})}async toBlob(t="image/png",e=.92){if("image/svg+xml"===t){const t=this.toSVGString();return new Blob([t],{type:"image/svg+xml;charset=utf-8"})}const i=await this.toDataURL(t,e);return(await fetch(i)).blob()}async download(t="qr-code.png"){const e=t.endsWith(".svg"),i=await this.toDataURL(e?"image/svg+xml":"image/png"),r=document.createElement("a");r.href=i,r.download=t,r.click()}},s})();return t.SniceQRCode=b,t}({},Snice);
4
4
  //# sourceMappingURL=snice-qr-code.min.js.map