tempest-react-sdk 0.41.0 → 0.42.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 (94) hide show
  1. package/README.md +3 -3
  2. package/bin/tempest.mjs +3 -3
  3. package/dist/br.cjs +1 -1
  4. package/dist/br.cjs.map +1 -1
  5. package/dist/br.d.ts +0 -13
  6. package/dist/br.js +14 -15
  7. package/dist/br.js.map +1 -1
  8. package/dist/charts/palette.cjs +1 -1
  9. package/dist/charts/palette.cjs.map +1 -1
  10. package/dist/charts/palette.js +4 -4
  11. package/dist/charts/palette.js.map +1 -1
  12. package/dist/charts.cjs +1 -1
  13. package/dist/charts.d.ts +0 -3
  14. package/dist/charts.js +8 -8
  15. package/dist/icons/generated/aliases.cjs +1 -1
  16. package/dist/icons/generated/aliases.cjs.map +1 -1
  17. package/dist/icons/generated/aliases.js +9 -0
  18. package/dist/icons/generated/aliases.js.map +1 -1
  19. package/dist/icons/generated/icon-names.cjs +1 -1
  20. package/dist/icons/generated/icon-names.cjs.map +1 -1
  21. package/dist/icons/generated/icon-names.js +1 -1
  22. package/dist/icons/generated/icon-names.js.map +1 -1
  23. package/dist/icons/generated/shard-a.cjs +1 -1
  24. package/dist/icons/generated/shard-a.cjs.map +1 -1
  25. package/dist/icons/generated/shard-a.js +61 -61
  26. package/dist/icons/generated/shard-a.js.map +1 -1
  27. package/dist/icons/generated/shard-b.cjs +1 -1
  28. package/dist/icons/generated/shard-b.cjs.map +1 -1
  29. package/dist/icons/generated/shard-b.js +15 -13
  30. package/dist/icons/generated/shard-b.js.map +1 -1
  31. package/dist/icons/generated/shard-e.cjs +1 -1
  32. package/dist/icons/generated/shard-e.cjs.map +1 -1
  33. package/dist/icons/generated/shard-e.js +20 -19
  34. package/dist/icons/generated/shard-e.js.map +1 -1
  35. package/dist/icons/generated/shard-f.cjs +1 -1
  36. package/dist/icons/generated/shard-f.cjs.map +1 -1
  37. package/dist/icons/generated/shard-f.js +140 -134
  38. package/dist/icons/generated/shard-f.js.map +1 -1
  39. package/dist/icons/generated/shard-h.cjs +1 -1
  40. package/dist/icons/generated/shard-h.cjs.map +1 -1
  41. package/dist/icons/generated/shard-h.js +13 -14
  42. package/dist/icons/generated/shard-h.js.map +1 -1
  43. package/dist/icons/generated/shard-l.cjs +1 -1
  44. package/dist/icons/generated/shard-l.cjs.map +1 -1
  45. package/dist/icons/generated/shard-l.js +73 -69
  46. package/dist/icons/generated/shard-l.js.map +1 -1
  47. package/dist/icons/generated/shard-m.cjs +1 -1
  48. package/dist/icons/generated/shard-m.cjs.map +1 -1
  49. package/dist/icons/generated/shard-m.js +101 -98
  50. package/dist/icons/generated/shard-m.js.map +1 -1
  51. package/dist/icons/generated/shard-p.cjs +1 -1
  52. package/dist/icons/generated/shard-p.cjs.map +1 -1
  53. package/dist/icons/generated/shard-p.js +19 -20
  54. package/dist/icons/generated/shard-p.js.map +1 -1
  55. package/dist/icons/generated/shard-r.cjs +1 -1
  56. package/dist/icons/generated/shard-r.cjs.map +1 -1
  57. package/dist/icons/generated/shard-r.js +19 -17
  58. package/dist/icons/generated/shard-r.js.map +1 -1
  59. package/dist/icons/generated/shard-s.cjs +1 -1
  60. package/dist/icons/generated/shard-s.cjs.map +1 -1
  61. package/dist/icons/generated/shard-s.js +160 -159
  62. package/dist/icons/generated/shard-s.js.map +1 -1
  63. package/dist/icons/generated/shard-u.cjs +1 -1
  64. package/dist/icons/generated/shard-u.cjs.map +1 -1
  65. package/dist/icons/generated/shard-u.js +11 -10
  66. package/dist/icons/generated/shard-u.js.map +1 -1
  67. package/dist/icons/shard-cache.cjs.map +1 -1
  68. package/dist/icons/shard-cache.js.map +1 -1
  69. package/dist/icons.d.ts +5 -5
  70. package/dist/imaging/encode.cjs +1 -1
  71. package/dist/imaging/encode.cjs.map +1 -1
  72. package/dist/imaging/encode.js +1 -4
  73. package/dist/imaging/encode.js.map +1 -1
  74. package/dist/imaging.cjs +1 -1
  75. package/dist/imaging.d.ts +0 -7
  76. package/dist/imaging.js +6 -6
  77. package/dist/tabular/compact.cjs +1 -1
  78. package/dist/tabular/compact.cjs.map +1 -1
  79. package/dist/tabular/compact.js +8 -8
  80. package/dist/tabular/compact.js.map +1 -1
  81. package/dist/tabular/manifest.cjs +1 -1
  82. package/dist/tabular/manifest.cjs.map +1 -1
  83. package/dist/tabular/manifest.js +13 -14
  84. package/dist/tabular/manifest.js.map +1 -1
  85. package/dist/tabular.cjs +1 -1
  86. package/dist/tabular.d.ts +0 -9
  87. package/dist/tabular.js +5 -5
  88. package/dist/tempest-react-sdk.cjs +1 -1
  89. package/dist/tempest-react-sdk.d.ts +0 -299
  90. package/dist/tempest-react-sdk.js +183 -188
  91. package/dist/vite.cjs +1 -1
  92. package/dist/vite.d.ts +0 -25
  93. package/dist/vite.js +6 -6
  94. package/package.json +5 -5
package/dist/icons.d.ts CHANGED
@@ -40,7 +40,7 @@ export declare function createIconRegistry(icons: Record<string, LucideIcon>): I
40
40
  export declare function Icon({ name, size, strokeWidth, fallback, ...rest }: IconProps): ReactNode;
41
41
 
42
42
  /**
43
- * Lucide's 248 deprecated slugs, mapped to the canonical slug that
43
+ * Lucide's 257 deprecated slugs, mapped to the canonical slug that
44
44
  * replaced them (`alert-circle` → `circle-alert`).
45
45
  *
46
46
  * Kept so a name stored in a database years ago keeps rendering after a lucide
@@ -52,14 +52,14 @@ export declare const iconAliases: Record<string, string>;
52
52
  /**
53
53
  * Every icon slug lucide ships, as a union of string literals.
54
54
  *
55
- * Erased at compile time, so the 1997 members cost no bytes — they buy
55
+ * Erased at compile time, so the 2024 members cost no bytes — they buy
56
56
  * autocomplete and a typo caught by `tsc` instead of at runtime.
57
57
  */
58
- export declare type IconName = "a-arrow-down" | "a-arrow-up" | "a-large-small" | "accessibility" | "activity" | "activity-square" | "ad" | "air-vent" | "airplay" | "alarm-check" | "alarm-clock" | "alarm-clock-check" | "alarm-clock-minus" | "alarm-clock-off" | "alarm-clock-plus" | "alarm-minus" | "alarm-plus" | "alarm-smoke" | "album" | "alert-circle" | "alert-octagon" | "alert-triangle" | "align-center" | "align-center-horizontal" | "align-center-vertical" | "align-end-horizontal" | "align-end-vertical" | "align-horizontal-distribute-center" | "align-horizontal-distribute-end" | "align-horizontal-distribute-start" | "align-horizontal-justify-center" | "align-horizontal-justify-end" | "align-horizontal-justify-start" | "align-horizontal-space-around" | "align-horizontal-space-between" | "align-justify" | "align-left" | "align-right" | "align-start-horizontal" | "align-start-vertical" | "align-vertical-distribute-center" | "align-vertical-distribute-end" | "align-vertical-distribute-start" | "align-vertical-justify-center" | "align-vertical-justify-end" | "align-vertical-justify-start" | "align-vertical-space-around" | "align-vertical-space-between" | "ambulance" | "ampersand" | "ampersands" | "amphora" | "anchor" | "angry" | "annoyed" | "antenna" | "anvil" | "aperture" | "app-window" | "app-window-mac" | "apple" | "archive" | "archive-restore" | "archive-x" | "area-chart" | "armchair" | "arrow-big-down" | "arrow-big-down-dash" | "arrow-big-left" | "arrow-big-left-dash" | "arrow-big-right" | "arrow-big-right-dash" | "arrow-big-up" | "arrow-big-up-dash" | "arrow-down" | "arrow-down-0-1" | "arrow-down-01" | "arrow-down-1-0" | "arrow-down-10" | "arrow-down-a-z" | "arrow-down-az" | "arrow-down-circle" | "arrow-down-from-line" | "arrow-down-left" | "arrow-down-left-from-circle" | "arrow-down-left-from-square" | "arrow-down-left-square" | "arrow-down-narrow-wide" | "arrow-down-right" | "arrow-down-right-from-circle" | "arrow-down-right-from-square" | "arrow-down-right-square" | "arrow-down-square" | "arrow-down-to-dot" | "arrow-down-to-line" | "arrow-down-up" | "arrow-down-wide-narrow" | "arrow-down-z-a" | "arrow-down-za" | "arrow-left" | "arrow-left-circle" | "arrow-left-from-line" | "arrow-left-right" | "arrow-left-square" | "arrow-left-to-line" | "arrow-right" | "arrow-right-circle" | "arrow-right-from-line" | "arrow-right-left" | "arrow-right-square" | "arrow-right-to-line" | "arrow-up" | "arrow-up-0-1" | "arrow-up-01" | "arrow-up-1-0" | "arrow-up-10" | "arrow-up-a-z" | "arrow-up-az" | "arrow-up-circle" | "arrow-up-down" | "arrow-up-from-dot" | "arrow-up-from-line" | "arrow-up-left" | "arrow-up-left-from-circle" | "arrow-up-left-from-square" | "arrow-up-left-square" | "arrow-up-narrow-wide" | "arrow-up-right" | "arrow-up-right-from-circle" | "arrow-up-right-from-square" | "arrow-up-right-square" | "arrow-up-square" | "arrow-up-to-line" | "arrow-up-wide-narrow" | "arrow-up-z-a" | "arrow-up-za" | "arrows-up-from-line" | "asterisk" | "asterisk-square" | "astroid" | "at-sign" | "atom" | "audio-lines" | "audio-waveform" | "award" | "axe" | "axis-3-d" | "axis-3d" | "baby" | "backpack" | "badge" | "badge-alert" | "badge-cent" | "badge-check" | "badge-dollar-sign" | "badge-euro" | "badge-help" | "badge-indian-rupee" | "badge-info" | "badge-japanese-yen" | "badge-minus" | "badge-percent" | "badge-plus" | "badge-pound-sterling" | "badge-question-mark" | "badge-russian-ruble" | "badge-swiss-franc" | "badge-turkish-lira" | "badge-x" | "baggage-claim" | "balloon" | "ban" | "banana" | "bandage" | "banknote" | "banknote-arrow-down" | "banknote-arrow-up" | "banknote-check" | "banknote-x" | "bar-chart" | "bar-chart-2" | "bar-chart-3" | "bar-chart-4" | "bar-chart-big" | "bar-chart-horizontal" | "bar-chart-horizontal-big" | "barcode" | "barrel" | "baseline" | "bath" | "battery" | "battery-charging" | "battery-full" | "battery-low" | "battery-medium" | "battery-plus" | "battery-warning" | "beaker" | "bean" | "bean-off" | "bed" | "bed-double" | "bed-single" | "beef" | "beef-off" | "beer" | "beer-off" | "bell" | "bell-check" | "bell-dot" | "bell-electric" | "bell-minus" | "bell-off" | "bell-plus" | "bell-ring" | "between-horizonal-end" | "between-horizonal-start" | "between-horizontal-end" | "between-horizontal-start" | "between-vertical-end" | "between-vertical-start" | "biceps-flexed" | "bike" | "binary" | "binoculars" | "biohazard" | "bird" | "birdhouse" | "bitcoin" | "blend" | "blender" | "blinds" | "blocks" | "bluetooth" | "bluetooth-connected" | "bluetooth-off" | "bluetooth-searching" | "bold" | "bolt" | "bomb" | "bone" | "bone-fracture" | "book" | "book-a" | "book-alert" | "book-audio" | "book-check" | "book-copy" | "book-dashed" | "book-down" | "book-headphones" | "book-heart" | "book-image" | "book-key" | "book-lock" | "book-marked" | "book-minus" | "book-open" | "book-open-check" | "book-open-text" | "book-plus" | "book-search" | "book-template" | "book-text" | "book-type" | "book-up" | "book-up-2" | "book-user" | "book-x" | "bookmark" | "bookmark-check" | "bookmark-minus" | "bookmark-off" | "bookmark-plus" | "bookmark-x" | "boom-box" | "bot" | "bot-message-square" | "bot-off" | "bottle-wine" | "bow-arrow" | "box" | "box-select" | "boxes" | "braces" | "brackets" | "brain" | "brain-circuit" | "brain-cog" | "brick-wall" | "brick-wall-fire" | "brick-wall-shield" | "briefcase" | "briefcase-business" | "briefcase-conveyor-belt" | "briefcase-medical" | "bring-to-front" | "broccoli" | "brush" | "brush-cleaning" | "bubbles" | "bug" | "bug-off" | "bug-play" | "building" | "building-2" | "bus" | "bus-front" | "cable" | "cable-car" | "cake" | "cake-slice" | "calculator" | "calendar" | "calendar-1" | "calendar-arrow-down" | "calendar-arrow-up" | "calendar-check" | "calendar-check-2" | "calendar-clock" | "calendar-cog" | "calendar-days" | "calendar-fold" | "calendar-heart" | "calendar-minus" | "calendar-minus-2" | "calendar-off" | "calendar-plus" | "calendar-plus-2" | "calendar-range" | "calendar-search" | "calendar-sync" | "calendar-x" | "calendar-x-2" | "calendars" | "camera" | "camera-off" | "candlestick-chart" | "candy" | "candy-cane" | "candy-off" | "cannabis" | "cannabis-off" | "captions" | "captions-off" | "car" | "car-front" | "car-taxi-front" | "caravan" | "card-sim" | "carrot" | "case-lower" | "case-sensitive" | "case-upper" | "cassette-tape" | "cast" | "castle" | "cat" | "cctv" | "cctv-off" | "chart-area" | "chart-bar" | "chart-bar-big" | "chart-bar-decreasing" | "chart-bar-increasing" | "chart-bar-stacked" | "chart-candlestick" | "chart-column" | "chart-column-big" | "chart-column-decreasing" | "chart-column-increasing" | "chart-column-stacked" | "chart-gantt" | "chart-line" | "chart-network" | "chart-no-axes-column" | "chart-no-axes-column-decreasing" | "chart-no-axes-column-increasing" | "chart-no-axes-combined" | "chart-no-axes-gantt" | "chart-pie" | "chart-scatter" | "chart-spline" | "check" | "check-check" | "check-circle" | "check-circle-2" | "check-line" | "check-square" | "check-square-2" | "chef-hat" | "cherry" | "chess-bishop" | "chess-king" | "chess-knight" | "chess-pawn" | "chess-queen" | "chess-rook" | "chevron-down" | "chevron-down-circle" | "chevron-down-square" | "chevron-first" | "chevron-last" | "chevron-left" | "chevron-left-circle" | "chevron-left-square" | "chevron-right" | "chevron-right-circle" | "chevron-right-square" | "chevron-up" | "chevron-up-circle" | "chevron-up-square" | "chevrons-down" | "chevrons-down-up" | "chevrons-left" | "chevrons-left-right" | "chevrons-left-right-ellipsis" | "chevrons-right" | "chevrons-right-left" | "chevrons-up" | "chevrons-up-down" | "church" | "cigarette" | "cigarette-off" | "circle" | "circle-alert" | "circle-arrow-down" | "circle-arrow-left" | "circle-arrow-out-down-left" | "circle-arrow-out-down-right" | "circle-arrow-out-up-left" | "circle-arrow-out-up-right" | "circle-arrow-right" | "circle-arrow-up" | "circle-check" | "circle-check-big" | "circle-chevron-down" | "circle-chevron-left" | "circle-chevron-right" | "circle-chevron-up" | "circle-dashed" | "circle-divide" | "circle-dollar-sign" | "circle-dot" | "circle-dot-dashed" | "circle-ellipsis" | "circle-equal" | "circle-euro" | "circle-fading-arrow-up" | "circle-fading-plus" | "circle-gauge" | "circle-help" | "circle-minus" | "circle-off" | "circle-parking" | "circle-parking-off" | "circle-pause" | "circle-percent" | "circle-pile" | "circle-play" | "circle-plus" | "circle-pound-sterling" | "circle-power" | "circle-question-mark" | "circle-slash" | "circle-slash-2" | "circle-slashed" | "circle-small" | "circle-star" | "circle-stop" | "circle-user" | "circle-user-round" | "circle-x" | "circuit-board" | "citrus" | "clapperboard" | "clipboard" | "clipboard-check" | "clipboard-clock" | "clipboard-copy" | "clipboard-edit" | "clipboard-list" | "clipboard-minus" | "clipboard-paste" | "clipboard-pen" | "clipboard-pen-line" | "clipboard-plus" | "clipboard-signature" | "clipboard-type" | "clipboard-x" | "clock" | "clock-1" | "clock-10" | "clock-11" | "clock-12" | "clock-2" | "clock-3" | "clock-4" | "clock-5" | "clock-6" | "clock-7" | "clock-8" | "clock-9" | "clock-alert" | "clock-arrow-down" | "clock-arrow-left" | "clock-arrow-right" | "clock-arrow-up" | "clock-check" | "clock-fading" | "clock-plus" | "closed-caption" | "cloud" | "cloud-alert" | "cloud-backup" | "cloud-check" | "cloud-cog" | "cloud-download" | "cloud-drizzle" | "cloud-fog" | "cloud-hail" | "cloud-lightning" | "cloud-moon" | "cloud-moon-rain" | "cloud-off" | "cloud-rain" | "cloud-rain-wind" | "cloud-snow" | "cloud-sun" | "cloud-sun-rain" | "cloud-sync" | "cloud-upload" | "cloudy" | "clover" | "club" | "code" | "code-2" | "code-square" | "code-xml" | "coffee" | "cog" | "coins" | "columns" | "columns-2" | "columns-3" | "columns-3-cog" | "columns-4" | "columns-settings" | "combine" | "command" | "compass" | "component" | "computer" | "concierge-bell" | "cone" | "construction" | "contact" | "contact-2" | "contact-round" | "container" | "contrast" | "cookie" | "cooking-pot" | "copy" | "copy-check" | "copy-minus" | "copy-plus" | "copy-slash" | "copy-x" | "copyleft" | "copyright" | "corner-down-left" | "corner-down-right" | "corner-left-down" | "corner-left-up" | "corner-right-down" | "corner-right-up" | "corner-up-left" | "corner-up-right" | "cpu" | "creative-commons" | "credit-card" | "croissant" | "crop" | "cross" | "crosshair" | "crown" | "cuboid" | "cup-soda" | "curly-braces" | "currency" | "cylinder" | "dam" | "database" | "database-arrow-down" | "database-arrow-up" | "database-backup" | "database-check" | "database-minus" | "database-plus" | "database-search" | "database-x" | "database-zap" | "decimals-arrow-left" | "decimals-arrow-right" | "delete" | "dessert" | "diameter" | "diamond" | "diamond-minus" | "diamond-percent" | "diamond-plus" | "dice-1" | "dice-2" | "dice-3" | "dice-4" | "dice-5" | "dice-6" | "dices" | "diff" | "disc" | "disc-2" | "disc-3" | "disc-album" | "divide" | "divide-circle" | "divide-square" | "dna" | "dna-off" | "dock" | "dog" | "dollar-sign" | "donut" | "door-closed" | "door-closed-locked" | "door-open" | "dot" | "dot-square" | "download" | "download-cloud" | "drafting-compass" | "drama" | "drill" | "drone" | "droplet" | "droplet-off" | "droplets" | "drum" | "drumstick" | "dumbbell" | "ear" | "ear-off" | "earth" | "earth-lock" | "eclipse" | "edit" | "edit-2" | "edit-3" | "egg" | "egg-fried" | "egg-off" | "ellipse" | "ellipsis" | "ellipsis-vertical" | "equal" | "equal-approximately" | "equal-not" | "equal-square" | "eraser" | "ethernet-port" | "euro" | "ev-charger" | "expand" | "external-link" | "eye" | "eye-closed" | "eye-dashed" | "eye-off" | "factory" | "fan" | "fast-forward" | "feather" | "fence" | "ferris-wheel" | "file" | "file-archive" | "file-audio" | "file-audio-2" | "file-axis-3-d" | "file-axis-3d" | "file-badge" | "file-badge-2" | "file-bar-chart" | "file-bar-chart-2" | "file-box" | "file-braces" | "file-braces-corner" | "file-chart-column" | "file-chart-column-increasing" | "file-chart-line" | "file-chart-pie" | "file-check" | "file-check-2" | "file-check-corner" | "file-clock" | "file-code" | "file-code-2" | "file-code-corner" | "file-cog" | "file-cog-2" | "file-diff" | "file-digit" | "file-down" | "file-edit" | "file-exclamation-point" | "file-headphone" | "file-heart" | "file-image" | "file-input" | "file-json" | "file-json-2" | "file-key" | "file-key-2" | "file-line-chart" | "file-lock" | "file-lock-2" | "file-minus" | "file-minus-2" | "file-minus-corner" | "file-music" | "file-output" | "file-pen" | "file-pen-line" | "file-pie-chart" | "file-play" | "file-plus" | "file-plus-2" | "file-plus-corner" | "file-question" | "file-question-mark" | "file-scan" | "file-search" | "file-search-2" | "file-search-corner" | "file-signal" | "file-signature" | "file-sliders" | "file-spreadsheet" | "file-stack" | "file-symlink" | "file-terminal" | "file-text" | "file-type" | "file-type-2" | "file-type-corner" | "file-up" | "file-user" | "file-video" | "file-video-2" | "file-video-camera" | "file-volume" | "file-volume-2" | "file-warning" | "file-x" | "file-x-2" | "file-x-corner" | "files" | "film" | "filter" | "filter-x" | "fingerprint-pattern" | "fire-extinguisher" | "fish" | "fish-off" | "fish-symbol" | "fishing-hook" | "fishing-rod" | "flag" | "flag-off" | "flag-triangle-left" | "flag-triangle-right" | "flame" | "flame-kindling" | "flashlight" | "flashlight-off" | "flask-conical" | "flask-conical-off" | "flask-round" | "flip-horizontal" | "flip-horizontal-2" | "flip-vertical" | "flip-vertical-2" | "flower" | "flower-2" | "focus" | "fold-horizontal" | "fold-vertical" | "folder" | "folder-archive" | "folder-bookmark" | "folder-check" | "folder-clock" | "folder-closed" | "folder-code" | "folder-cog" | "folder-cog-2" | "folder-dot" | "folder-down" | "folder-edit" | "folder-git" | "folder-git-2" | "folder-heart" | "folder-input" | "folder-kanban" | "folder-key" | "folder-lock" | "folder-minus" | "folder-open" | "folder-open-dot" | "folder-output" | "folder-pen" | "folder-plus" | "folder-root" | "folder-search" | "folder-search-2" | "folder-symlink" | "folder-sync" | "folder-tree" | "folder-up" | "folder-x" | "folders" | "footprints" | "fork-knife" | "fork-knife-crossed" | "forklift" | "form" | "form-input" | "forward" | "frame" | "frown" | "fuel" | "fullscreen" | "function-square" | "funnel" | "funnel-plus" | "funnel-x" | "gallery-horizontal" | "gallery-horizontal-end" | "gallery-thumbnails" | "gallery-vertical" | "gallery-vertical-end" | "gamepad" | "gamepad-2" | "gamepad-directional" | "gantt-chart" | "gantt-chart-square" | "gauge" | "gauge-circle" | "gavel" | "gem" | "georgian-lari" | "ghost" | "gift" | "git-branch" | "git-branch-minus" | "git-branch-plus" | "git-commit" | "git-commit-horizontal" | "git-commit-vertical" | "git-compare" | "git-compare-arrows" | "git-fork" | "git-graph" | "git-merge" | "git-merge-conflict" | "git-pull-request" | "git-pull-request-arrow" | "git-pull-request-closed" | "git-pull-request-create" | "git-pull-request-create-arrow" | "git-pull-request-draft" | "glass-water" | "glasses" | "globe" | "globe-2" | "globe-check" | "globe-lock" | "globe-off" | "globe-x" | "goal" | "gpu" | "grab" | "graduation-cap" | "grape" | "grid" | "grid-2-x-2" | "grid-2-x-2-check" | "grid-2-x-2-plus" | "grid-2-x-2-x" | "grid-2x2" | "grid-2x2-check" | "grid-2x2-plus" | "grid-2x2-x" | "grid-3-x-3" | "grid-3x2" | "grid-3x3" | "grip" | "grip-horizontal" | "grip-vertical" | "group" | "guitar" | "ham" | "hamburger" | "hammer" | "hand" | "hand-coins" | "hand-fist" | "hand-grab" | "hand-heart" | "hand-helping" | "hand-metal" | "hand-platter" | "handbag" | "handshake" | "hard-drive" | "hard-drive-download" | "hard-drive-upload" | "hard-hat" | "hash" | "hat-glasses" | "haze" | "hd" | "hdmi-port" | "heading" | "heading-1" | "heading-2" | "heading-3" | "heading-4" | "heading-5" | "heading-6" | "headphone-off" | "headphones" | "headset" | "heart" | "heart-crack" | "heart-handshake" | "heart-minus" | "heart-off" | "heart-plus" | "heart-pulse" | "heart-x" | "heater" | "helicopter" | "help-circle" | "helping-hand" | "hexagon" | "highlighter" | "history" | "home" | "hop" | "hop-off" | "hospital" | "hotel" | "hourglass" | "house" | "house-heart" | "house-plug" | "house-plus" | "house-wifi" | "ice-cream" | "ice-cream-2" | "ice-cream-bowl" | "ice-cream-cone" | "id-card" | "id-card-lanyard" | "image" | "image-down" | "image-minus" | "image-off" | "image-play" | "image-plus" | "image-up" | "image-upscale" | "images" | "import" | "inbox" | "indent" | "indent-decrease" | "indent-increase" | "indian-rupee" | "infinity" | "info" | "inspect" | "inspection-panel" | "italic" | "iteration-ccw" | "iteration-cw" | "japanese-yen" | "joystick" | "kanban" | "kanban-square" | "kanban-square-dashed" | "kayak" | "key" | "key-round" | "key-square" | "keyboard" | "keyboard-music" | "keyboard-off" | "lamp" | "lamp-ceiling" | "lamp-desk" | "lamp-floor" | "lamp-wall-down" | "lamp-wall-up" | "land-plot" | "landmark" | "languages" | "laptop" | "laptop-2" | "laptop-minimal" | "laptop-minimal-check" | "lasso" | "lasso-select" | "laugh" | "layers" | "layers-2" | "layers-3" | "layers-minus" | "layers-plus" | "layout" | "layout-dashboard" | "layout-grid" | "layout-list" | "layout-panel-left" | "layout-panel-top" | "layout-template" | "leaf" | "leafy-green" | "lectern" | "lens-concave" | "lens-convex" | "letter-text" | "library" | "library-big" | "library-square" | "life-buoy" | "ligature" | "lightbulb" | "lightbulb-off" | "line-chart" | "line-dot-right-horizontal" | "line-squiggle" | "line-style" | "link" | "link-2" | "link-2-off" | "list" | "list-check" | "list-checks" | "list-chevrons-down-up" | "list-chevrons-up-down" | "list-collapse" | "list-end" | "list-filter" | "list-filter-plus" | "list-indent-decrease" | "list-indent-increase" | "list-minus" | "list-music" | "list-ordered" | "list-plus" | "list-restart" | "list-sort-ascending" | "list-sort-descending" | "list-start" | "list-todo" | "list-tree" | "list-video" | "list-x" | "loader" | "loader-2" | "loader-circle" | "loader-pinwheel" | "locate" | "locate-fixed" | "locate-off" | "location-edit" | "lock" | "lock-keyhole" | "lock-keyhole-open" | "lock-open" | "log-in" | "log-out" | "logs" | "lollipop" | "luggage" | "m-square" | "magnet" | "mail" | "mail-check" | "mail-minus" | "mail-open" | "mail-plus" | "mail-question" | "mail-question-mark" | "mail-search" | "mail-warning" | "mail-x" | "mailbox" | "mails" | "map" | "map-minus" | "map-pin" | "map-pin-check" | "map-pin-check-inside" | "map-pin-house" | "map-pin-minus" | "map-pin-minus-inside" | "map-pin-off" | "map-pin-pen" | "map-pin-plus" | "map-pin-plus-inside" | "map-pin-search" | "map-pin-x" | "map-pin-x-inside" | "map-pinned" | "map-plus" | "mars" | "mars-stroke" | "martini" | "maximize" | "maximize-2" | "medal" | "megaphone" | "megaphone-off" | "meh" | "memory-stick" | "menu" | "menu-square" | "merge" | "message-circle" | "message-circle-check" | "message-circle-code" | "message-circle-dashed" | "message-circle-heart" | "message-circle-more" | "message-circle-off" | "message-circle-plus" | "message-circle-question" | "message-circle-question-mark" | "message-circle-reply" | "message-circle-warning" | "message-circle-x" | "message-square" | "message-square-check" | "message-square-code" | "message-square-dashed" | "message-square-diff" | "message-square-dot" | "message-square-heart" | "message-square-lock" | "message-square-more" | "message-square-off" | "message-square-plus" | "message-square-quote" | "message-square-reply" | "message-square-share" | "message-square-text" | "message-square-warning" | "message-square-x" | "messages-square" | "metronome" | "mic" | "mic-2" | "mic-off" | "mic-vocal" | "microchip" | "microscope" | "microwave" | "milestone" | "milk" | "milk-off" | "minimize" | "minimize-2" | "minus" | "minus-circle" | "minus-square" | "mirror-rectangular" | "mirror-round" | "monitor" | "monitor-check" | "monitor-cloud" | "monitor-cog" | "monitor-dot" | "monitor-down" | "monitor-off" | "monitor-pause" | "monitor-play" | "monitor-smartphone" | "monitor-speaker" | "monitor-stop" | "monitor-up" | "monitor-x" | "moon" | "moon-star" | "more-horizontal" | "more-vertical" | "motorbike" | "mountain" | "mountain-snow" | "mouse" | "mouse-left" | "mouse-off" | "mouse-pointer" | "mouse-pointer-2" | "mouse-pointer-2-off" | "mouse-pointer-ban" | "mouse-pointer-click" | "mouse-pointer-square-dashed" | "mouse-right" | "move" | "move-3-d" | "move-3d" | "move-diagonal" | "move-diagonal-2" | "move-down" | "move-down-left" | "move-down-right" | "move-horizontal" | "move-left" | "move-right" | "move-up" | "move-up-left" | "move-up-right" | "move-vertical" | "music" | "music-2" | "music-3" | "music-4" | "navigation" | "navigation-2" | "navigation-2-off" | "navigation-off" | "network" | "newspaper" | "nfc" | "non-binary" | "notebook" | "notebook-pen" | "notebook-tabs" | "notebook-text" | "notepad-text" | "notepad-text-dashed" | "nut" | "nut-off" | "octagon" | "octagon-alert" | "octagon-minus" | "octagon-pause" | "octagon-x" | "omega" | "option" | "orbit" | "origami" | "outdent" | "package" | "package-2" | "package-check" | "package-minus" | "package-open" | "package-plus" | "package-search" | "package-x" | "paint-bucket" | "paint-roller" | "paintbrush" | "paintbrush-2" | "paintbrush-vertical" | "palette" | "palmtree" | "panda" | "panel-bottom" | "panel-bottom-close" | "panel-bottom-dashed" | "panel-bottom-inactive" | "panel-bottom-open" | "panel-left" | "panel-left-close" | "panel-left-dashed" | "panel-left-inactive" | "panel-left-open" | "panel-left-right-dashed" | "panel-right" | "panel-right-close" | "panel-right-dashed" | "panel-right-inactive" | "panel-right-open" | "panel-top" | "panel-top-bottom-dashed" | "panel-top-close" | "panel-top-dashed" | "panel-top-inactive" | "panel-top-open" | "panels-left-bottom" | "panels-left-right" | "panels-right-bottom" | "panels-top-bottom" | "panels-top-left" | "paper-bag" | "paperclip" | "parasol" | "parentheses" | "parking-circle" | "parking-circle-off" | "parking-meter" | "parking-square" | "parking-square-off" | "party-popper" | "pause" | "pause-circle" | "pause-octagon" | "paw-print" | "pc-case" | "pen" | "pen-box" | "pen-line" | "pen-off" | "pen-square" | "pen-tool" | "pencil" | "pencil-line" | "pencil-off" | "pencil-ruler" | "pencil-sparkles" | "pentagon" | "percent" | "percent-circle" | "percent-diamond" | "percent-square" | "person-standing" | "phi" | "philippine-peso" | "phone" | "phone-call" | "phone-forwarded" | "phone-incoming" | "phone-missed" | "phone-off" | "phone-outgoing" | "pi" | "pi-square" | "piano" | "pickaxe" | "picture-in-picture" | "picture-in-picture-2" | "pie-chart" | "piggy-bank" | "pilcrow" | "pilcrow-left" | "pilcrow-right" | "pilcrow-square" | "pill" | "pill-bottle" | "pin" | "pin-off" | "pipette" | "pizza" | "plane" | "plane-landing" | "plane-takeoff" | "play" | "play-circle" | "play-off" | "play-square" | "plug" | "plug-2" | "plug-zap" | "plug-zap-2" | "plus" | "plus-circle" | "plus-square" | "pocket-knife" | "podcast" | "podium" | "pointer" | "pointer-off" | "popcorn" | "popsicle" | "pound-sterling" | "power" | "power-circle" | "power-off" | "power-square" | "presentation" | "printer" | "printer-check" | "printer-x" | "projector" | "proportions" | "puzzle" | "pyramid" | "qr-code" | "quote" | "rabbit" | "radar" | "radiation" | "radical" | "radio" | "radio-off" | "radio-receiver" | "radio-tower" | "radius" | "rainbow" | "rat" | "ratio" | "receipt" | "receipt-cent" | "receipt-euro" | "receipt-indian-rupee" | "receipt-japanese-yen" | "receipt-pound-sterling" | "receipt-russian-ruble" | "receipt-swiss-franc" | "receipt-text" | "receipt-turkish-lira" | "rectangle-circle" | "rectangle-ellipsis" | "rectangle-goggles" | "rectangle-horizontal" | "rectangle-vertical" | "recycle" | "redo" | "redo-2" | "redo-dot" | "refresh-ccw" | "refresh-ccw-dot" | "refresh-cw" | "refresh-cw-off" | "refrigerator" | "regex" | "remove-formatting" | "repeat" | "repeat-1" | "repeat-2" | "repeat-off" | "replace" | "replace-all" | "reply" | "reply-all" | "rewind" | "ribbon" | "road" | "rocket" | "rocking-chair" | "roller-coaster" | "rose" | "rotate-3-d" | "rotate-3d" | "rotate-ccw" | "rotate-ccw-key" | "rotate-ccw-square" | "rotate-cw" | "rotate-cw-square" | "route" | "route-off" | "router" | "rows" | "rows-2" | "rows-3" | "rows-4" | "rss" | "ruler" | "ruler-dimension-line" | "russian-ruble" | "sailboat" | "salad" | "sandwich" | "satellite" | "satellite-dish" | "saudi-riyal" | "save" | "save-all" | "save-check" | "save-off" | "save-pen" | "save-plus" | "scale" | "scale-3-d" | "scale-3d" | "scaling" | "scan" | "scan-barcode" | "scan-box" | "scan-eye" | "scan-face" | "scan-heart" | "scan-line" | "scan-qr-code" | "scan-search" | "scan-text" | "scatter-chart" | "school" | "school-2" | "scissors" | "scissors-line-dashed" | "scissors-square" | "scissors-square-dashed-bottom" | "scooter" | "screen-share" | "screen-share-off" | "scroll" | "scroll-text" | "search" | "search-alert" | "search-check" | "search-code" | "search-slash" | "search-x" | "section" | "send" | "send-horizonal" | "send-horizontal" | "send-to-back" | "separator-horizontal" | "separator-vertical" | "server" | "server-cog" | "server-crash" | "server-off" | "server-plus" | "settings" | "settings-2" | "shapes" | "share" | "share-2" | "sheet" | "shell" | "shelving-unit" | "shield" | "shield-alert" | "shield-ban" | "shield-check" | "shield-close" | "shield-cog" | "shield-cog-corner" | "shield-ellipsis" | "shield-half" | "shield-keyhole" | "shield-minus" | "shield-off" | "shield-plus" | "shield-question" | "shield-question-mark" | "shield-user" | "shield-x" | "ship" | "ship-wheel" | "shirt" | "shopping-bag" | "shopping-basket" | "shopping-cart" | "shovel" | "shower-head" | "shredder" | "shrimp" | "shrink" | "shrub" | "shuffle" | "sidebar" | "sidebar-close" | "sidebar-open" | "sigma" | "sigma-square" | "signal" | "signal-high" | "signal-low" | "signal-medium" | "signal-zero" | "signature" | "signpost" | "signpost-big" | "siren" | "skip-back" | "skip-forward" | "skull" | "slash" | "slash-square" | "slice" | "sliders" | "sliders-horizontal" | "sliders-vertical" | "smartphone" | "smartphone-charging" | "smartphone-nfc" | "smile" | "smile-plus" | "snail" | "snowflake" | "soap-dispenser-droplet" | "sofa" | "solar-panel" | "sort-asc" | "sort-desc" | "soup" | "space" | "spade" | "sparkle" | "sparkles" | "speaker" | "speech" | "spell-check" | "spell-check-2" | "spline" | "spline-pointer" | "split" | "split-square-horizontal" | "split-square-vertical" | "spool" | "sport-shoe" | "spotlight" | "spray-can" | "sprout" | "square" | "square-activity" | "square-arrow-down" | "square-arrow-down-left" | "square-arrow-down-right" | "square-arrow-left" | "square-arrow-out-down-left" | "square-arrow-out-down-right" | "square-arrow-out-up-left" | "square-arrow-out-up-right" | "square-arrow-right" | "square-arrow-right-enter" | "square-arrow-right-exit" | "square-arrow-up" | "square-arrow-up-left" | "square-arrow-up-right" | "square-asterisk" | "square-bottom-dashed-scissors" | "square-centerline-dashed-horizontal" | "square-centerline-dashed-vertical" | "square-chart-gantt" | "square-check" | "square-check-big" | "square-chevron-down" | "square-chevron-left" | "square-chevron-right" | "square-chevron-up" | "square-code" | "square-dashed" | "square-dashed-bottom" | "square-dashed-bottom-code" | "square-dashed-kanban" | "square-dashed-mouse-pointer" | "square-dashed-text" | "square-dashed-top-solid" | "square-divide" | "square-dot" | "square-equal" | "square-function" | "square-gantt-chart" | "square-kanban" | "square-library" | "square-m" | "square-menu" | "square-minus" | "square-mouse-pointer" | "square-parking" | "square-parking-off" | "square-pause" | "square-pen" | "square-percent" | "square-pi" | "square-pilcrow" | "square-play" | "square-plus" | "square-power" | "square-radical" | "square-round-corner" | "square-scissors" | "square-sigma" | "square-slash" | "square-split-horizontal" | "square-split-vertical" | "square-square" | "square-stack" | "square-star" | "square-stop" | "square-terminal" | "square-user" | "square-user-round" | "square-x" | "squares-exclude" | "squares-intersect" | "squares-subtract" | "squares-unite" | "squircle" | "squircle-dashed" | "squirrel" | "stamp" | "star" | "star-check" | "star-half" | "star-minus" | "star-off" | "star-plus" | "star-x" | "stars" | "step-back" | "step-forward" | "stethoscope" | "sticker" | "sticky-note" | "sticky-note-check" | "sticky-note-minus" | "sticky-note-off" | "sticky-note-plus" | "sticky-note-x" | "sticky-notes" | "stone" | "stop-circle" | "store" | "stretch-horizontal" | "stretch-vertical" | "strikethrough" | "subscript" | "subtitles" | "summary" | "sun" | "sun-dim" | "sun-medium" | "sun-moon" | "sun-snow" | "sunrise" | "sunset" | "superscript" | "swatch-book" | "swiss-franc" | "switch-camera" | "sword" | "swords" | "syringe" | "table" | "table-2" | "table-cells-merge" | "table-cells-split" | "table-columns-split" | "table-config" | "table-of-contents" | "table-properties" | "table-rows-split" | "tablet" | "tablet-smartphone" | "tablets" | "tag" | "tag-plus" | "tag-x" | "tags" | "tally-1" | "tally-2" | "tally-3" | "tally-4" | "tally-5" | "tangent" | "target" | "telescope" | "tent" | "tent-tree" | "terminal" | "terminal-square" | "test-tube" | "test-tube-2" | "test-tube-diagonal" | "test-tubes" | "text" | "text-align-center" | "text-align-end" | "text-align-justify" | "text-align-start" | "text-cursor" | "text-cursor-input" | "text-initial" | "text-quote" | "text-search" | "text-select" | "text-selection" | "text-wrap" | "theater" | "thermometer" | "thermometer-snowflake" | "thermometer-sun" | "thumbs-down" | "thumbs-up" | "ticket" | "ticket-check" | "ticket-minus" | "ticket-percent" | "ticket-plus" | "ticket-slash" | "ticket-x" | "tickets" | "tickets-plane" | "timeline" | "timer" | "timer-off" | "timer-reset" | "toggle-left" | "toggle-right" | "toilet" | "tool-case" | "toolbox" | "tornado" | "torus" | "touchpad" | "touchpad-off" | "towel-rack" | "tower-control" | "toy-brick" | "tractor" | "traffic-cone" | "train" | "train-front" | "train-front-tunnel" | "train-track" | "tram-front" | "transgender" | "trash" | "trash-2" | "tree-deciduous" | "tree-palm" | "tree-pine" | "trees" | "trending-down" | "trending-up" | "trending-up-down" | "triangle" | "triangle-alert" | "triangle-dashed" | "triangle-right" | "trophy" | "truck" | "truck-electric" | "turkish-lira" | "turntable" | "turtle" | "tv" | "tv-2" | "tv-minimal" | "tv-minimal-play" | "type" | "type-outline" | "umbrella" | "umbrella-off" | "underline" | "undo" | "undo-2" | "undo-dot" | "unfold-horizontal" | "unfold-vertical" | "ungroup" | "university" | "unlink" | "unlink-2" | "unlock" | "unlock-keyhole" | "unplug" | "upload" | "upload-cloud" | "usb" | "user" | "user-2" | "user-check" | "user-check-2" | "user-circle" | "user-circle-2" | "user-cog" | "user-cog-2" | "user-key" | "user-lock" | "user-minus" | "user-minus-2" | "user-pen" | "user-plus" | "user-plus-2" | "user-round" | "user-round-arrow-left" | "user-round-check" | "user-round-cog" | "user-round-key" | "user-round-minus" | "user-round-pen" | "user-round-plus" | "user-round-search" | "user-round-x" | "user-search" | "user-square" | "user-square-2" | "user-star" | "user-x" | "user-x-2" | "users" | "users-2" | "users-round" | "utensils" | "utensils-crossed" | "utility-pole" | "van" | "variable" | "vault" | "vector-square" | "vegan" | "venetian-mask" | "venus" | "venus-and-mars" | "verified" | "vibrate" | "vibrate-off" | "video" | "video-off" | "videotape" | "view" | "voicemail" | "volleyball" | "volume" | "volume-1" | "volume-2" | "volume-off" | "volume-x" | "vote" | "wallet" | "wallet-2" | "wallet-cards" | "wallet-minimal" | "wallpaper" | "wand" | "wand-2" | "wand-sparkles" | "warehouse" | "washing-machine" | "watch" | "waves" | "waves-arrow-down" | "waves-arrow-up" | "waves-horizontal" | "waves-ladder" | "waves-vertical" | "waypoints" | "webcam" | "webcam-off" | "webhook" | "webhook-off" | "weight" | "weight-tilde" | "wheat" | "wheat-off" | "whole-word" | "wifi" | "wifi-cog" | "wifi-high" | "wifi-low" | "wifi-off" | "wifi-pen" | "wifi-sync" | "wifi-zero" | "wind" | "wind-arrow-down" | "wine" | "wine-off" | "workflow" | "worm" | "wrap-text" | "wrench" | "wrench-off" | "x" | "x-circle" | "x-line-top" | "x-octagon" | "x-square" | "zap" | "zap-off" | "zodiac-aquarius" | "zodiac-aries" | "zodiac-cancer" | "zodiac-capricorn" | "zodiac-gemini" | "zodiac-leo" | "zodiac-libra" | "zodiac-ophiuchus" | "zodiac-pisces" | "zodiac-sagittarius" | "zodiac-scorpio" | "zodiac-taurus" | "zodiac-virgo" | "zoom-in" | "zoom-out";
58
+ export declare type IconName = "a-arrow-down" | "a-arrow-up" | "a-large-small" | "accessibility" | "activity" | "activity-square" | "ad" | "air-vent" | "airplay" | "alarm-check" | "alarm-clock" | "alarm-clock-check" | "alarm-clock-minus" | "alarm-clock-off" | "alarm-clock-plus" | "alarm-minus" | "alarm-plus" | "alarm-smoke" | "album" | "alert-circle" | "alert-octagon" | "alert-triangle" | "align-center" | "align-center-horizontal" | "align-center-vertical" | "align-end-horizontal" | "align-end-vertical" | "align-horizontal-distribute-center" | "align-horizontal-distribute-end" | "align-horizontal-distribute-start" | "align-horizontal-justify-center" | "align-horizontal-justify-end" | "align-horizontal-justify-start" | "align-horizontal-space-around" | "align-horizontal-space-between" | "align-justify" | "align-left" | "align-right" | "align-start-horizontal" | "align-start-vertical" | "align-vertical-distribute-center" | "align-vertical-distribute-end" | "align-vertical-distribute-start" | "align-vertical-justify-center" | "align-vertical-justify-end" | "align-vertical-justify-start" | "align-vertical-space-around" | "align-vertical-space-between" | "ambulance" | "ampersand" | "ampersands" | "amphora" | "anchor" | "angle" | "angry" | "annoyed" | "antenna" | "anvil" | "aperture" | "app-window" | "app-window-mac" | "apple" | "archive" | "archive-restore" | "archive-x" | "area-chart" | "armchair" | "arrow-big-down" | "arrow-big-down-dash" | "arrow-big-left" | "arrow-big-left-dash" | "arrow-big-right" | "arrow-big-right-dash" | "arrow-big-up" | "arrow-big-up-dash" | "arrow-down" | "arrow-down-0-1" | "arrow-down-01" | "arrow-down-1-0" | "arrow-down-10" | "arrow-down-a-z" | "arrow-down-az" | "arrow-down-circle" | "arrow-down-from-line" | "arrow-down-left" | "arrow-down-left-from-circle" | "arrow-down-left-from-square" | "arrow-down-left-square" | "arrow-down-narrow-wide" | "arrow-down-right" | "arrow-down-right-from-circle" | "arrow-down-right-from-square" | "arrow-down-right-square" | "arrow-down-square" | "arrow-down-to-dot" | "arrow-down-to-line" | "arrow-down-up" | "arrow-down-wide-narrow" | "arrow-down-z-a" | "arrow-down-za" | "arrow-left" | "arrow-left-circle" | "arrow-left-from-line" | "arrow-left-right" | "arrow-left-square" | "arrow-left-to-line" | "arrow-right" | "arrow-right-circle" | "arrow-right-from-line" | "arrow-right-left" | "arrow-right-square" | "arrow-right-to-line" | "arrow-up" | "arrow-up-0-1" | "arrow-up-01" | "arrow-up-1-0" | "arrow-up-10" | "arrow-up-a-z" | "arrow-up-az" | "arrow-up-circle" | "arrow-up-down" | "arrow-up-from-dot" | "arrow-up-from-line" | "arrow-up-left" | "arrow-up-left-from-circle" | "arrow-up-left-from-square" | "arrow-up-left-square" | "arrow-up-narrow-wide" | "arrow-up-right" | "arrow-up-right-from-circle" | "arrow-up-right-from-square" | "arrow-up-right-square" | "arrow-up-square" | "arrow-up-to-line" | "arrow-up-wide-narrow" | "arrow-up-z-a" | "arrow-up-za" | "arrows-up-from-line" | "asterisk" | "asterisk-square" | "astroid" | "at-sign" | "atom" | "audio-lines" | "audio-lines-x" | "audio-waveform" | "award" | "axe" | "axis-3-d" | "axis-3d" | "baby" | "backpack" | "badge" | "badge-alert" | "badge-cent" | "badge-check" | "badge-dollar-sign" | "badge-euro" | "badge-help" | "badge-indian-rupee" | "badge-info" | "badge-japanese-yen" | "badge-minus" | "badge-percent" | "badge-plus" | "badge-pound-sterling" | "badge-question-mark" | "badge-russian-ruble" | "badge-swiss-franc" | "badge-turkish-lira" | "badge-x" | "baggage-claim" | "balloon" | "ban" | "banana" | "bandage" | "banknote" | "banknote-arrow-down" | "banknote-arrow-up" | "banknote-check" | "banknote-x" | "bar-chart" | "bar-chart-2" | "bar-chart-3" | "bar-chart-4" | "bar-chart-big" | "bar-chart-horizontal" | "bar-chart-horizontal-big" | "barcode" | "barrel" | "baseline" | "bath" | "battery" | "battery-charging" | "battery-full" | "battery-low" | "battery-medium" | "battery-plus" | "battery-warning" | "beaker" | "bean" | "bean-off" | "bed" | "bed-double" | "bed-single" | "beef" | "beef-off" | "beer" | "beer-off" | "bell" | "bell-check" | "bell-dot" | "bell-electric" | "bell-minus" | "bell-off" | "bell-plus" | "bell-ring" | "between-horizonal-end" | "between-horizonal-start" | "between-horizontal-end" | "between-horizontal-start" | "between-vertical-end" | "between-vertical-start" | "biceps-flexed" | "bike" | "binary" | "binoculars" | "biohazard" | "bird" | "birdhouse" | "bitcoin" | "blend" | "blender" | "blinds" | "blocks" | "bluetooth" | "bluetooth-connected" | "bluetooth-off" | "bluetooth-searching" | "bold" | "bolt" | "bomb" | "bone" | "bone-fracture" | "book" | "book-a" | "book-alert" | "book-audio" | "book-check" | "book-copy" | "book-dashed" | "book-down" | "book-headphones" | "book-heart" | "book-image" | "book-key" | "book-lock" | "book-marked" | "book-minus" | "book-open" | "book-open-check" | "book-open-text" | "book-plus" | "book-search" | "book-template" | "book-text" | "book-type" | "book-up" | "book-up-2" | "book-user" | "book-x" | "bookmark" | "bookmark-check" | "bookmark-minus" | "bookmark-off" | "bookmark-plus" | "bookmark-x" | "boom-box" | "bot" | "bot-message-square" | "bot-off" | "bottle-wine" | "bow-arrow" | "box" | "box-select" | "boxes" | "braces" | "brackets" | "brain" | "brain-circuit" | "brain-cog" | "brick-wall" | "brick-wall-fire" | "brick-wall-shield" | "briefcase" | "briefcase-business" | "briefcase-conveyor-belt" | "briefcase-medical" | "bring-to-front" | "broccoli" | "broom" | "broom-sparkles" | "brush" | "brush-cleaning" | "bubbles" | "bug" | "bug-off" | "bug-play" | "building" | "building-2" | "bus" | "bus-front" | "cable" | "cable-car" | "cake" | "cake-slice" | "calculator" | "calendar" | "calendar-1" | "calendar-arrow-down" | "calendar-arrow-up" | "calendar-check" | "calendar-check-2" | "calendar-clock" | "calendar-cog" | "calendar-days" | "calendar-fold" | "calendar-heart" | "calendar-minus" | "calendar-minus-2" | "calendar-off" | "calendar-plus" | "calendar-plus-2" | "calendar-range" | "calendar-search" | "calendar-sync" | "calendar-x" | "calendar-x-2" | "calendars" | "camera" | "camera-off" | "candlestick-chart" | "candy" | "candy-cane" | "candy-off" | "cannabis" | "cannabis-off" | "captions" | "captions-off" | "car" | "car-front" | "car-taxi-front" | "caravan" | "card-sim" | "carrot" | "case-lower" | "case-sensitive" | "case-upper" | "cassette-tape" | "cast" | "castle" | "cat" | "cctv" | "cctv-off" | "chart-area" | "chart-bar" | "chart-bar-big" | "chart-bar-decreasing" | "chart-bar-increasing" | "chart-bar-stacked" | "chart-candlestick" | "chart-column" | "chart-column-big" | "chart-column-decreasing" | "chart-column-increasing" | "chart-column-stacked" | "chart-gantt" | "chart-line" | "chart-network" | "chart-no-axes-column" | "chart-no-axes-column-decreasing" | "chart-no-axes-column-increasing" | "chart-no-axes-combined" | "chart-no-axes-gantt" | "chart-pie" | "chart-scatter" | "chart-spline" | "check" | "check-check" | "check-circle" | "check-circle-2" | "check-line" | "check-square" | "check-square-2" | "chef-hat" | "cherry" | "chess-bishop" | "chess-king" | "chess-knight" | "chess-pawn" | "chess-queen" | "chess-rook" | "chevron-down" | "chevron-down-circle" | "chevron-down-square" | "chevron-first" | "chevron-last" | "chevron-left" | "chevron-left-circle" | "chevron-left-square" | "chevron-right" | "chevron-right-circle" | "chevron-right-square" | "chevron-up" | "chevron-up-circle" | "chevron-up-square" | "chevrons-down" | "chevrons-down-up" | "chevrons-left" | "chevrons-left-right" | "chevrons-left-right-ellipsis" | "chevrons-right" | "chevrons-right-left" | "chevrons-up" | "chevrons-up-down" | "church" | "cigarette" | "cigarette-off" | "circle" | "circle-alert" | "circle-arrow-down" | "circle-arrow-left" | "circle-arrow-out-down-left" | "circle-arrow-out-down-right" | "circle-arrow-out-up-left" | "circle-arrow-out-up-right" | "circle-arrow-right" | "circle-arrow-up" | "circle-check" | "circle-check-big" | "circle-chevron-down" | "circle-chevron-left" | "circle-chevron-right" | "circle-chevron-up" | "circle-dashed" | "circle-divide" | "circle-dollar-sign" | "circle-dot" | "circle-dot-dashed" | "circle-ellipsis" | "circle-equal" | "circle-euro" | "circle-fading-arrow-up" | "circle-fading-plus" | "circle-gauge" | "circle-help" | "circle-minus" | "circle-off" | "circle-parking" | "circle-parking-off" | "circle-pause" | "circle-percent" | "circle-pile" | "circle-play" | "circle-plus" | "circle-pound-sterling" | "circle-power" | "circle-question-mark" | "circle-slash" | "circle-slash-2" | "circle-slashed" | "circle-small" | "circle-star" | "circle-stop" | "circle-user" | "circle-user-round" | "circle-x" | "circuit-board" | "citrus" | "clapperboard" | "clipboard" | "clipboard-check" | "clipboard-clock" | "clipboard-copy" | "clipboard-edit" | "clipboard-list" | "clipboard-minus" | "clipboard-paste" | "clipboard-pen" | "clipboard-pen-line" | "clipboard-plus" | "clipboard-signature" | "clipboard-type" | "clipboard-x" | "clock" | "clock-1" | "clock-10" | "clock-11" | "clock-12" | "clock-2" | "clock-3" | "clock-4" | "clock-5" | "clock-6" | "clock-7" | "clock-8" | "clock-9" | "clock-alert" | "clock-arrow-down" | "clock-arrow-left" | "clock-arrow-right" | "clock-arrow-up" | "clock-check" | "clock-fading" | "clock-plus" | "closed-caption" | "cloud" | "cloud-alert" | "cloud-backup" | "cloud-check" | "cloud-cog" | "cloud-download" | "cloud-drizzle" | "cloud-fog" | "cloud-hail" | "cloud-lightning" | "cloud-moon" | "cloud-moon-rain" | "cloud-off" | "cloud-rain" | "cloud-rain-wind" | "cloud-snow" | "cloud-sun" | "cloud-sun-rain" | "cloud-sync" | "cloud-upload" | "cloudy" | "clover" | "club" | "code" | "code-2" | "code-square" | "code-xml" | "coffee" | "cog" | "coins" | "columns" | "columns-2" | "columns-3" | "columns-3-cog" | "columns-4" | "columns-settings" | "combine" | "command" | "compass" | "component" | "computer" | "concierge-bell" | "cone" | "construction" | "contact" | "contact-2" | "contact-round" | "container" | "contrast" | "cookie" | "cooking-pot" | "copy" | "copy-check" | "copy-minus" | "copy-plus" | "copy-slash" | "copy-x" | "copyleft" | "copyright" | "corner-down-left" | "corner-down-right" | "corner-left-down" | "corner-left-up" | "corner-right-down" | "corner-right-up" | "corner-up-left" | "corner-up-right" | "cpu" | "creative-commons" | "credit-card" | "croissant" | "crop" | "cross" | "crosshair" | "crown" | "cuboid" | "cup-soda" | "curly-braces" | "currency" | "cylinder" | "dam" | "database" | "database-arrow-down" | "database-arrow-up" | "database-backup" | "database-check" | "database-minus" | "database-plus" | "database-search" | "database-x" | "database-zap" | "decimals-arrow-left" | "decimals-arrow-right" | "delete" | "dessert" | "diameter" | "diamond" | "diamond-minus" | "diamond-percent" | "diamond-plus" | "dice-1" | "dice-2" | "dice-3" | "dice-4" | "dice-5" | "dice-6" | "dices" | "diff" | "disc" | "disc-2" | "disc-3" | "disc-album" | "divide" | "divide-circle" | "divide-square" | "dna" | "dna-off" | "dock" | "dog" | "dollar-sign" | "donut" | "door-closed" | "door-closed-locked" | "door-open" | "dot" | "dot-square" | "download" | "download-cloud" | "drafting-compass" | "drama" | "drill" | "drone" | "droplet" | "droplet-off" | "droplets" | "drum" | "drumstick" | "dumbbell" | "ear" | "ear-off" | "earth" | "earth-lock" | "eclipse" | "edit" | "edit-2" | "edit-3" | "egg" | "egg-fried" | "egg-off" | "eject" | "ellipse" | "ellipsis" | "ellipsis-vertical" | "equal" | "equal-approximately" | "equal-not" | "equal-square" | "eraser" | "ethernet-port" | "euro" | "ev-charger" | "expand" | "external-link" | "eye" | "eye-closed" | "eye-dashed" | "eye-off" | "face-angry" | "face-expressionless" | "face-grinning" | "face-neutral" | "face-slightly-frowning" | "face-slightly-smiling" | "face-slightly-smiling-plus" | "factory" | "fan" | "fast-forward" | "feather" | "fence" | "ferris-wheel" | "file" | "file-archive" | "file-audio" | "file-audio-2" | "file-axis-3-d" | "file-axis-3d" | "file-badge" | "file-badge-2" | "file-bar-chart" | "file-bar-chart-2" | "file-box" | "file-braces" | "file-braces-corner" | "file-chart-column" | "file-chart-column-increasing" | "file-chart-line" | "file-chart-pie" | "file-check" | "file-check-2" | "file-check-corner" | "file-clock" | "file-code" | "file-code-2" | "file-code-corner" | "file-cog" | "file-cog-2" | "file-diff" | "file-digit" | "file-down" | "file-edit" | "file-exclamation-point" | "file-headphone" | "file-heart" | "file-image" | "file-input" | "file-json" | "file-json-2" | "file-key" | "file-key-2" | "file-line-chart" | "file-lock" | "file-lock-2" | "file-minus" | "file-minus-2" | "file-minus-corner" | "file-music" | "file-output" | "file-pen" | "file-pen-line" | "file-pie-chart" | "file-play" | "file-plus" | "file-plus-2" | "file-plus-corner" | "file-question" | "file-question-mark" | "file-scan" | "file-search" | "file-search-2" | "file-search-corner" | "file-signal" | "file-signature" | "file-sliders" | "file-spreadsheet" | "file-stack" | "file-symlink" | "file-terminal" | "file-text" | "file-type" | "file-type-2" | "file-type-corner" | "file-up" | "file-user" | "file-video" | "file-video-2" | "file-video-camera" | "file-volume" | "file-volume-2" | "file-warning" | "file-x" | "file-x-2" | "file-x-corner" | "files" | "film" | "filter" | "filter-x" | "fingerprint-pattern" | "fire-extinguisher" | "fish" | "fish-off" | "fish-symbol" | "fishing-hook" | "fishing-rod" | "flag" | "flag-off" | "flag-triangle-left" | "flag-triangle-right" | "flame" | "flame-kindling" | "flashlight" | "flashlight-off" | "flask-conical" | "flask-conical-off" | "flask-round" | "flip-horizontal" | "flip-horizontal-2" | "flip-vertical" | "flip-vertical-2" | "flower" | "flower-2" | "focus" | "fold-horizontal" | "fold-vertical" | "folder" | "folder-archive" | "folder-bookmark" | "folder-check" | "folder-clock" | "folder-closed" | "folder-code" | "folder-cog" | "folder-cog-2" | "folder-dot" | "folder-down" | "folder-edit" | "folder-git" | "folder-git-2" | "folder-heart" | "folder-input" | "folder-kanban" | "folder-key" | "folder-lock" | "folder-minus" | "folder-open" | "folder-open-dot" | "folder-output" | "folder-pen" | "folder-plus" | "folder-root" | "folder-search" | "folder-search-2" | "folder-symlink" | "folder-sync" | "folder-tree" | "folder-up" | "folder-x" | "folders" | "footprints" | "fork-knife" | "fork-knife-crossed" | "forklift" | "form" | "form-input" | "forward" | "frame" | "frown" | "fuel" | "fullscreen" | "function-square" | "funnel" | "funnel-plus" | "funnel-x" | "gallery-horizontal" | "gallery-horizontal-end" | "gallery-thumbnails" | "gallery-vertical" | "gallery-vertical-end" | "gamepad" | "gamepad-2" | "gamepad-directional" | "gantt-chart" | "gantt-chart-square" | "gauge" | "gauge-circle" | "gavel" | "gem" | "georgian-lari" | "ghost" | "gift" | "git-branch" | "git-branch-minus" | "git-branch-plus" | "git-commit" | "git-commit-horizontal" | "git-commit-vertical" | "git-compare" | "git-compare-arrows" | "git-fork" | "git-graph" | "git-merge" | "git-merge-conflict" | "git-pull-request" | "git-pull-request-arrow" | "git-pull-request-closed" | "git-pull-request-create" | "git-pull-request-create-arrow" | "git-pull-request-draft" | "glass-water" | "glasses" | "globe" | "globe-2" | "globe-check" | "globe-lock" | "globe-off" | "globe-x" | "goal" | "gpu" | "grab" | "graduation-cap" | "grape" | "grid" | "grid-2-x-2" | "grid-2-x-2-check" | "grid-2-x-2-plus" | "grid-2-x-2-x" | "grid-2x2" | "grid-2x2-check" | "grid-2x2-plus" | "grid-2x2-x" | "grid-3-x-3" | "grid-3x2" | "grid-3x3" | "grip" | "grip-horizontal" | "grip-vertical" | "group" | "guitar" | "ham" | "hamburger" | "hammer" | "hand" | "hand-coins" | "hand-fist" | "hand-grab" | "hand-heart" | "hand-helping" | "hand-metal" | "hand-platter" | "handbag" | "handshake" | "hard-drive" | "hard-drive-download" | "hard-drive-upload" | "hard-hat" | "hash" | "hat-glasses" | "haze" | "hd" | "hdmi-port" | "heading" | "heading-1" | "heading-2" | "heading-3" | "heading-4" | "heading-5" | "heading-6" | "headphone-off" | "headphones" | "headset" | "heart" | "heart-crack" | "heart-handshake" | "heart-minus" | "heart-off" | "heart-plus" | "heart-pulse" | "heart-x" | "heater" | "helicopter" | "help-circle" | "helping-hand" | "hexagon" | "highlighter" | "history" | "home" | "hop" | "hop-off" | "hospital" | "hotel" | "hourglass" | "house" | "house-heart" | "house-plug" | "house-plus" | "house-wifi" | "ice-cream" | "ice-cream-2" | "ice-cream-bowl" | "ice-cream-cone" | "id-card" | "id-card-lanyard" | "image" | "image-down" | "image-minus" | "image-off" | "image-play" | "image-plus" | "image-up" | "image-upscale" | "images" | "import" | "inbox" | "indent" | "indent-decrease" | "indent-increase" | "indian-rupee" | "infinity" | "info" | "inspect" | "inspection-panel" | "italic" | "iteration-ccw" | "iteration-cw" | "japanese-yen" | "joystick" | "kanban" | "kanban-square" | "kanban-square-dashed" | "kayak" | "key" | "key-round" | "key-square" | "keyboard" | "keyboard-music" | "keyboard-off" | "lamp" | "lamp-ceiling" | "lamp-desk" | "lamp-floor" | "lamp-wall-down" | "lamp-wall-up" | "land-plot" | "landmark" | "languages" | "laptop" | "laptop-2" | "laptop-minimal" | "laptop-minimal-check" | "lasso" | "lasso-select" | "laugh" | "layer-arrow-down" | "layer-arrow-up" | "layers" | "layers-2" | "layers-3" | "layers-arrow-down" | "layers-arrow-up" | "layers-minus" | "layers-plus" | "layout" | "layout-dashboard" | "layout-freeform" | "layout-grid" | "layout-list" | "layout-panel-left" | "layout-panel-top" | "layout-template" | "leaf" | "leafy-green" | "lectern" | "lens-concave" | "lens-convex" | "letter-text" | "library" | "library-big" | "library-square" | "life-buoy" | "ligature" | "lightbulb" | "lightbulb-off" | "line-chart" | "line-dot-right-horizontal" | "line-squiggle" | "line-style" | "link" | "link-2" | "link-2-off" | "list" | "list-check" | "list-checks" | "list-chevrons-down-up" | "list-chevrons-up-down" | "list-collapse" | "list-end" | "list-filter" | "list-filter-plus" | "list-indent-decrease" | "list-indent-increase" | "list-minus" | "list-music" | "list-ordered" | "list-plus" | "list-restart" | "list-sort-ascending" | "list-sort-descending" | "list-start" | "list-todo" | "list-tree" | "list-video" | "list-x" | "loader" | "loader-2" | "loader-circle" | "loader-pinwheel" | "locate" | "locate-fixed" | "locate-off" | "location-edit" | "lock" | "lock-keyhole" | "lock-keyhole-open" | "lock-open" | "log-in" | "log-out" | "logs" | "lollipop" | "luggage" | "m-square" | "magnet" | "mail" | "mail-badge" | "mail-check" | "mail-minus" | "mail-open" | "mail-plus" | "mail-question" | "mail-question-mark" | "mail-search" | "mail-warning" | "mail-x" | "mailbox" | "mails" | "map" | "map-minus" | "map-pin" | "map-pin-check" | "map-pin-check-inside" | "map-pin-house" | "map-pin-minus" | "map-pin-minus-inside" | "map-pin-off" | "map-pin-pen" | "map-pin-plus" | "map-pin-plus-inside" | "map-pin-search" | "map-pin-x" | "map-pin-x-inside" | "map-pinned" | "map-plus" | "mars" | "mars-stroke" | "martini" | "maximize" | "maximize-2" | "medal" | "megaphone" | "megaphone-off" | "meh" | "memory-stick" | "menu" | "menu-square" | "merge" | "message-circle" | "message-circle-check" | "message-circle-code" | "message-circle-dashed" | "message-circle-heart" | "message-circle-more" | "message-circle-off" | "message-circle-plus" | "message-circle-question" | "message-circle-question-mark" | "message-circle-reply" | "message-circle-warning" | "message-circle-x" | "message-square" | "message-square-check" | "message-square-code" | "message-square-dashed" | "message-square-diff" | "message-square-dot" | "message-square-heart" | "message-square-lock" | "message-square-more" | "message-square-off" | "message-square-plus" | "message-square-quote" | "message-square-reply" | "message-square-share" | "message-square-text" | "message-square-warning" | "message-square-x" | "messages-square" | "metronome" | "mic" | "mic-2" | "mic-audio-lines" | "mic-off" | "mic-signal" | "mic-vocal" | "microchip" | "microscope" | "microwave" | "milestone" | "milk" | "milk-off" | "minimize" | "minimize-2" | "minus" | "minus-circle" | "minus-square" | "mirror-rectangular" | "mirror-round" | "monitor" | "monitor-check" | "monitor-cloud" | "monitor-cog" | "monitor-dot" | "monitor-down" | "monitor-off" | "monitor-pause" | "monitor-play" | "monitor-smartphone" | "monitor-speaker" | "monitor-stop" | "monitor-up" | "monitor-x" | "moon" | "moon-star" | "more-horizontal" | "more-vertical" | "mosque" | "motorbike" | "mountain" | "mountain-snow" | "mouse" | "mouse-left" | "mouse-off" | "mouse-pointer" | "mouse-pointer-2" | "mouse-pointer-2-off" | "mouse-pointer-ban" | "mouse-pointer-click" | "mouse-pointer-square-dashed" | "mouse-right" | "move" | "move-3-d" | "move-3d" | "move-diagonal" | "move-diagonal-2" | "move-down" | "move-down-left" | "move-down-right" | "move-horizontal" | "move-left" | "move-right" | "move-up" | "move-up-left" | "move-up-right" | "move-vertical" | "music" | "music-2" | "music-3" | "music-4" | "navigation" | "navigation-2" | "navigation-2-off" | "navigation-off" | "network" | "newspaper" | "nfc" | "non-binary" | "notebook" | "notebook-pen" | "notebook-tabs" | "notebook-text" | "notepad-text" | "notepad-text-dashed" | "nut" | "nut-off" | "octagon" | "octagon-alert" | "octagon-minus" | "octagon-pause" | "octagon-x" | "omega" | "option" | "orbit" | "origami" | "outdent" | "package" | "package-2" | "package-check" | "package-minus" | "package-open" | "package-plus" | "package-search" | "package-x" | "paint-bucket" | "paint-roller" | "paintbrush" | "paintbrush-2" | "paintbrush-vertical" | "palette" | "palmtree" | "panda" | "panel-bottom" | "panel-bottom-close" | "panel-bottom-dashed" | "panel-bottom-inactive" | "panel-bottom-open" | "panel-left" | "panel-left-close" | "panel-left-dashed" | "panel-left-inactive" | "panel-left-open" | "panel-left-right-dashed" | "panel-right" | "panel-right-close" | "panel-right-dashed" | "panel-right-inactive" | "panel-right-open" | "panel-top" | "panel-top-bottom-dashed" | "panel-top-close" | "panel-top-dashed" | "panel-top-inactive" | "panel-top-open" | "panels-left-bottom" | "panels-left-right" | "panels-right-bottom" | "panels-top-bottom" | "panels-top-left" | "paper-bag" | "paperclip" | "parasol" | "parentheses" | "parking-circle" | "parking-circle-off" | "parking-meter" | "parking-square" | "parking-square-off" | "party-popper" | "pause" | "pause-circle" | "pause-octagon" | "paw-print" | "pc-case" | "pen" | "pen-box" | "pen-line" | "pen-off" | "pen-square" | "pen-tool" | "pencil" | "pencil-line" | "pencil-off" | "pencil-ruler" | "pencil-sparkles" | "pentagon" | "percent" | "percent-circle" | "percent-diamond" | "percent-square" | "person-standing" | "phi" | "philippine-peso" | "phone" | "phone-call" | "phone-forwarded" | "phone-incoming" | "phone-missed" | "phone-off" | "phone-outgoing" | "pi" | "pi-square" | "piano" | "pickaxe" | "picture-in-picture" | "picture-in-picture-2" | "pie-chart" | "piggy-bank" | "pilcrow" | "pilcrow-left" | "pilcrow-right" | "pilcrow-square" | "pill" | "pill-bottle" | "pin" | "pin-off" | "pipette" | "pizza" | "plane" | "plane-landing" | "plane-takeoff" | "play" | "play-circle" | "play-off" | "play-square" | "plug" | "plug-2" | "plug-zap" | "plug-zap-2" | "plus" | "plus-circle" | "plus-square" | "pocket-knife" | "podcast" | "podium" | "pointer" | "pointer-off" | "popcorn" | "popsicle" | "pound-sterling" | "power" | "power-circle" | "power-off" | "power-square" | "presentation" | "printer" | "printer-check" | "printer-x" | "projector" | "proportions" | "puzzle" | "pyramid" | "qr-code" | "quote" | "rabbit" | "radar" | "radiation" | "radical" | "radio" | "radio-off" | "radio-receiver" | "radio-tower" | "radius" | "rainbow" | "rat" | "ratio" | "receipt" | "receipt-cent" | "receipt-euro" | "receipt-indian-rupee" | "receipt-japanese-yen" | "receipt-pound-sterling" | "receipt-russian-ruble" | "receipt-swiss-franc" | "receipt-text" | "receipt-turkish-lira" | "rectangle-circle" | "rectangle-ellipsis" | "rectangle-goggles" | "rectangle-horizontal" | "rectangle-vertical" | "recycle" | "redo" | "redo-2" | "redo-dot" | "refresh-ccw" | "refresh-ccw-dot" | "refresh-cw" | "refresh-cw-off" | "refrigerator" | "regex" | "remove-formatting" | "repeat" | "repeat-1" | "repeat-2" | "repeat-off" | "replace" | "replace-all" | "reply" | "reply-all" | "rewind" | "ribbon" | "road" | "rocket" | "rocking-chair" | "roller-coaster" | "rose" | "rotate-3-d" | "rotate-3d" | "rotate-ccw" | "rotate-ccw-clock" | "rotate-ccw-key" | "rotate-ccw-square" | "rotate-cw" | "rotate-cw-fading-clock" | "rotate-cw-square" | "route" | "route-off" | "router" | "rows" | "rows-2" | "rows-3" | "rows-4" | "rss" | "ruler" | "ruler-dimension-line" | "russian-ruble" | "sailboat" | "salad" | "sandwich" | "satellite" | "satellite-dish" | "saudi-riyal" | "save" | "save-all" | "save-check" | "save-off" | "save-pen" | "save-plus" | "scale" | "scale-3-d" | "scale-3d" | "scaling" | "scan" | "scan-barcode" | "scan-box" | "scan-eye" | "scan-face" | "scan-heart" | "scan-line" | "scan-qr-code" | "scan-search" | "scan-square" | "scan-text" | "scatter-chart" | "school" | "school-2" | "scissors" | "scissors-line-dashed" | "scissors-square" | "scissors-square-dashed-bottom" | "scooter" | "screen-share" | "screen-share-off" | "scroll" | "scroll-text" | "search" | "search-alert" | "search-check" | "search-code" | "search-slash" | "search-x" | "section" | "send" | "send-horizonal" | "send-horizontal" | "send-to-back" | "separator-horizontal" | "separator-vertical" | "server" | "server-cog" | "server-crash" | "server-off" | "server-plus" | "settings" | "settings-2" | "shapes" | "share" | "share-2" | "sheet" | "shell" | "shelving-unit" | "shield" | "shield-alert" | "shield-ban" | "shield-check" | "shield-close" | "shield-cog" | "shield-cog-corner" | "shield-ellipsis" | "shield-half" | "shield-keyhole" | "shield-lock" | "shield-minus" | "shield-off" | "shield-plus" | "shield-question" | "shield-question-mark" | "shield-user" | "shield-x" | "ship" | "ship-wheel" | "shirt" | "shopping-bag" | "shopping-basket" | "shopping-cart" | "shovel" | "shower-head" | "shredder" | "shrimp" | "shrink" | "shrub" | "shuffle" | "sidebar" | "sidebar-close" | "sidebar-open" | "sigma" | "sigma-square" | "signal" | "signal-high" | "signal-low" | "signal-medium" | "signal-zero" | "signature" | "signpost" | "signpost-big" | "siren" | "skip-back" | "skip-forward" | "skull" | "slash" | "slash-square" | "slice" | "sliders" | "sliders-horizontal" | "sliders-vertical" | "smartphone" | "smartphone-charging" | "smartphone-nfc" | "smile" | "smile-plus" | "snail" | "snowflake" | "soap-dispenser-droplet" | "sofa" | "solar-panel" | "sort-asc" | "sort-desc" | "soup" | "space" | "spade" | "sparkle" | "sparkles" | "speaker" | "speech" | "spell-check" | "spell-check-2" | "spline" | "spline-pointer" | "split" | "split-square-horizontal" | "split-square-vertical" | "spool" | "sport-shoe" | "spotlight" | "spray-can" | "sprout" | "square" | "square-activity" | "square-arrow-down" | "square-arrow-down-left" | "square-arrow-down-right" | "square-arrow-left" | "square-arrow-out-down-left" | "square-arrow-out-down-right" | "square-arrow-out-up-left" | "square-arrow-out-up-right" | "square-arrow-right" | "square-arrow-right-enter" | "square-arrow-right-exit" | "square-arrow-up" | "square-arrow-up-left" | "square-arrow-up-right" | "square-asterisk" | "square-bottom-dashed-scissors" | "square-centerline-dashed-horizontal" | "square-centerline-dashed-vertical" | "square-chart-gantt" | "square-check" | "square-check-big" | "square-chevron-down" | "square-chevron-left" | "square-chevron-right" | "square-chevron-up" | "square-code" | "square-dashed" | "square-dashed-bottom" | "square-dashed-bottom-code" | "square-dashed-kanban" | "square-dashed-mouse-pointer" | "square-dashed-text" | "square-dashed-top-solid" | "square-divide" | "square-dot" | "square-equal" | "square-function" | "square-gantt-chart" | "square-kanban" | "square-library" | "square-m" | "square-menu" | "square-minus" | "square-mouse-pointer" | "square-off" | "square-parking" | "square-parking-off" | "square-pause" | "square-pen" | "square-percent" | "square-pi" | "square-pilcrow" | "square-play" | "square-plus" | "square-power" | "square-radical" | "square-round-corner" | "square-scissors" | "square-sigma" | "square-slash" | "square-split-horizontal" | "square-split-vertical" | "square-square" | "square-stack" | "square-star" | "square-stop" | "square-terminal" | "square-user" | "square-user-round" | "square-x" | "squares-exclude" | "squares-intersect" | "squares-subtract" | "squares-unite" | "squircle" | "squircle-dashed" | "squirrel" | "stamp" | "star" | "star-check" | "star-half" | "star-minus" | "star-off" | "star-plus" | "star-x" | "stars" | "step-back" | "step-forward" | "stethoscope" | "sticker" | "sticky-note" | "sticky-note-check" | "sticky-note-minus" | "sticky-note-off" | "sticky-note-plus" | "sticky-note-x" | "sticky-notes" | "stone" | "stop-circle" | "store" | "stretch-horizontal" | "stretch-vertical" | "strikethrough" | "subscript" | "subtitles" | "summary" | "sun" | "sun-dim" | "sun-medium" | "sun-moon" | "sun-snow" | "sunrise" | "sunset" | "superscript" | "swatch-book" | "swiss-franc" | "switch-camera" | "sword" | "swords" | "syringe" | "table" | "table-2" | "table-cells-merge" | "table-cells-split" | "table-columns-split" | "table-config" | "table-of-contents" | "table-properties" | "table-rows-split" | "tablet" | "tablet-smartphone" | "tablets" | "tag" | "tag-plus" | "tag-x" | "tags" | "tally-1" | "tally-2" | "tally-3" | "tally-4" | "tally-5" | "tangent" | "target" | "telescope" | "tent" | "tent-tree" | "terminal" | "terminal-square" | "test-tube" | "test-tube-2" | "test-tube-diagonal" | "test-tubes" | "text" | "text-align-center" | "text-align-end" | "text-align-justify" | "text-align-start" | "text-cursor" | "text-cursor-input" | "text-initial" | "text-quote" | "text-search" | "text-select" | "text-selection" | "text-wrap" | "theater" | "thermometer" | "thermometer-snowflake" | "thermometer-sun" | "thumbs-down" | "thumbs-up" | "ticket" | "ticket-check" | "ticket-minus" | "ticket-percent" | "ticket-plus" | "ticket-slash" | "ticket-x" | "tickets" | "tickets-plane" | "timeline" | "timer" | "timer-off" | "timer-reset" | "toggle-left" | "toggle-right" | "toilet" | "tool-case" | "toolbox" | "tornado" | "torus" | "touchpad" | "touchpad-off" | "towel-rack" | "tower-control" | "toy-brick" | "tractor" | "traffic-cone" | "train" | "train-front" | "train-front-tunnel" | "train-track" | "tram-front" | "transgender" | "trash" | "trash-2" | "tree-deciduous" | "tree-palm" | "tree-pine" | "trees" | "trending-down" | "trending-up" | "trending-up-down" | "triangle" | "triangle-alert" | "triangle-dashed" | "triangle-right" | "trophy" | "truck" | "truck-electric" | "turkish-lira" | "turntable" | "turtle" | "tv" | "tv-2" | "tv-minimal" | "tv-minimal-play" | "type" | "type-outline" | "umbrella" | "umbrella-off" | "underline" | "undo" | "undo-2" | "undo-dot" | "unfold-horizontal" | "unfold-vertical" | "ungroup" | "university" | "unlink" | "unlink-2" | "unlock" | "unlock-keyhole" | "unplug" | "upload" | "upload-cloud" | "usb" | "user" | "user-2" | "user-check" | "user-check-2" | "user-circle" | "user-circle-2" | "user-cog" | "user-cog-2" | "user-key" | "user-lock" | "user-minus" | "user-minus-2" | "user-pen" | "user-plus" | "user-plus-2" | "user-round" | "user-round-arrow-left" | "user-round-check" | "user-round-cog" | "user-round-key" | "user-round-minus" | "user-round-pen" | "user-round-plus" | "user-round-search" | "user-round-x" | "user-search" | "user-shield" | "user-square" | "user-square-2" | "user-star" | "user-x" | "user-x-2" | "users" | "users-2" | "users-round" | "utensils" | "utensils-crossed" | "utility-pole" | "van" | "variable" | "vault" | "vector-square" | "vegan" | "venetian-mask" | "venus" | "venus-and-mars" | "verified" | "vibrate" | "vibrate-off" | "video" | "video-off" | "videotape" | "view" | "voicemail" | "volleyball" | "volume" | "volume-1" | "volume-2" | "volume-off" | "volume-x" | "vote" | "wallet" | "wallet-2" | "wallet-cards" | "wallet-minimal" | "wallpaper" | "wand" | "wand-2" | "wand-sparkles" | "warehouse" | "washing-machine" | "watch" | "waves" | "waves-arrow-down" | "waves-arrow-up" | "waves-horizontal" | "waves-ladder" | "waves-vertical" | "waypoints" | "webcam" | "webcam-off" | "webhook" | "webhook-off" | "weight" | "weight-tilde" | "wheat" | "wheat-off" | "whole-word" | "wifi" | "wifi-cog" | "wifi-high" | "wifi-low" | "wifi-off" | "wifi-pen" | "wifi-sync" | "wifi-zero" | "wind" | "wind-arrow-down" | "wine" | "wine-off" | "workflow" | "worm" | "wrap-text" | "wrench" | "wrench-off" | "x" | "x-circle" | "x-line-top" | "x-octagon" | "x-square" | "zap" | "zap-off" | "zodiac-aquarius" | "zodiac-aries" | "zodiac-cancer" | "zodiac-capricorn" | "zodiac-gemini" | "zodiac-leo" | "zodiac-libra" | "zodiac-ophiuchus" | "zodiac-pisces" | "zodiac-sagittarius" | "zodiac-scorpio" | "zodiac-taurus" | "zodiac-virgo" | "zoom-in" | "zoom-out";
59
59
 
60
60
  /**
61
61
  * Every addressable icon slug — canonical names plus deprecated aliases,
62
- * 1997 in total, sorted.
62
+ * 2024 in total, sorted.
63
63
  *
64
64
  * Importing this pulls in the whole list (~6 KB brotli). Reach for it when you
65
65
  * are building a picker; `<Icon>` itself does not need it.
@@ -191,7 +191,7 @@ export declare function preloadIcons(slugs: readonly string[]): Promise<void>;
191
191
  /**
192
192
  * Map a slug to the canonical slug that owns the icon.
193
193
  *
194
- * Lucide keeps 248 deprecated aliases (`alert-circle` → `circle-alert`), and a
194
+ * Lucide keeps 257 deprecated aliases (`alert-circle` → `circle-alert`), and a
195
195
  * slug persisted in a database years ago is exactly the case this feature exists
196
196
  * for, so an alias must keep resolving after a lucide bump renames it.
197
197
  *
@@ -1,2 +1,2 @@
1
- const e=require("./exceptions.cjs"),t=require("./canvas.cjs");var n=.85,r=`image/jpeg`,i=new Map;async function a(t,n={}){let r=n.type??`image/jpeg`,i=await o(t,r,n.quality??.85);if(i===null)throw new e.ImageEncodeError(`The canvas produced no bytes for ${r}. The image may be too large for this browser's canvas limits.`);return{blob:i,width:t.width,height:t.height,type:i.type||r,bytes:i.size}}async function o(e,t,n){return`convertToBlob`in e?await e.convertToBlob({type:t,quality:n}):await new Promise(r=>{e.toBlob(e=>r(e),t,n)})}async function s(e){let n=i.get(e);if(n!==void 0)return n;let r;try{let{createSurface:n}=await Promise.resolve().then(()=>require("./canvas.cjs")),i=n(1,1);t.getContext(i);let a=await o(i,e,.5);r=a!==null&&a.type===e}catch{r=!1}return i.set(e,r),r}async function c(e=[`image/webp`,`image/jpeg`]){for(let t of e)if(await s(t))return t;return`image/jpeg`}function l(){i.clear()}exports.DEFAULT_QUALITY=n,exports.DEFAULT_TYPE=r,exports.bestSupportedType=c,exports.encodeImage=a,exports.resetImageTypeSupportCache=l,exports.supportsImageType=s;
1
+ const e=require("./exceptions.cjs"),t=require("./canvas.cjs");var n=.85,r=`image/jpeg`,i=new Map;async function a(t,n={}){let r=n.type??`image/jpeg`,i=await o(t,r,n.quality??.85);if(i===null)throw new e.ImageEncodeError(`The canvas produced no bytes for ${r}. The image may be too large for this browser's canvas limits.`);return{blob:i,width:t.width,height:t.height,type:i.type||r,bytes:i.size}}async function o(e,t,n){return`convertToBlob`in e?await e.convertToBlob({type:t,quality:n}):await new Promise(r=>{e.toBlob(e=>r(e),t,n)})}async function s(e){let n=i.get(e);if(n!==void 0)return n;let r;try{let{createSurface:n}=await Promise.resolve().then(()=>require("./canvas.cjs")),i=n(1,1);t.getContext(i);let a=await o(i,e,.5);r=a!==null&&a.type===e}catch{r=!1}return i.set(e,r),r}async function c(e=[`image/webp`,`image/jpeg`]){for(let t of e)if(await s(t))return t;return`image/jpeg`}exports.DEFAULT_QUALITY=n,exports.DEFAULT_TYPE=r,exports.bestSupportedType=c,exports.encodeImage=a,exports.supportsImageType=s;
2
2
  //# sourceMappingURL=encode.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"encode.cjs","names":[],"sources":["../../src/imaging/encode.ts"],"sourcesContent":["/**\n * Getting bytes back out, and knowing which bytes you got.\n *\n * The trap here is silent: `canvas.toBlob(cb, \"image/avif\")` does not throw\n * on a browser without an AVIF encoder. It hands back a **PNG** with the\n * requested type ignored, and an app that trusted the request uploads\n * several megabytes where it planned for a few hundred kilobytes. Every\n * function here reports the type actually produced, and\n * :func:`supportsImageType` answers the question up front.\n */\n\nimport { getContext, type Surface } from \"./canvas\";\nimport { ImageEncodeError } from \"./exceptions\";\nimport type { EncodeOptions, ImageType, ProcessedImage } from \"./types\";\n\n/** Quality used when the caller does not choose. */\nexport const DEFAULT_QUALITY = 0.85;\n\n/** Format used when the caller does not choose. */\nexport const DEFAULT_TYPE: ImageType = \"image/jpeg\";\n\nconst supportCache = new Map<string, boolean>();\n\n/**\n * Encode a surface into image bytes.\n *\n * @param surface The canvas to encode.\n * @param options Format and quality.\n * @returns The blob plus the dimensions and the type actually produced.\n * @throws {@link ImageEncodeError} when the canvas produces nothing.\n */\nexport async function encodeImage(\n surface: Surface,\n options: EncodeOptions = {},\n): Promise<ProcessedImage> {\n const type = options.type ?? DEFAULT_TYPE;\n const quality = options.quality ?? DEFAULT_QUALITY;\n\n const blob = await surfaceToBlob(surface, type, quality);\n if (blob === null) {\n throw new ImageEncodeError(\n `The canvas produced no bytes for ${type}. The image may be too large ` +\n \"for this browser's canvas limits.\",\n );\n }\n\n return {\n blob,\n width: surface.width,\n height: surface.height,\n type: blob.type || type,\n bytes: blob.size,\n };\n}\n\n/**\n * Encode a surface, whichever kind it is.\n *\n * `OffscreenCanvas` and `HTMLCanvasElement` disagree on how to hand back\n * bytes — one returns a promise, the other takes a callback.\n *\n * @param surface The canvas.\n * @param type MIME type to request.\n * @param quality Quality for lossy formats.\n * @returns The blob, or `null` when the canvas produced nothing.\n */\nasync function surfaceToBlob(\n surface: Surface,\n type: string,\n quality: number,\n): Promise<Blob | null> {\n if (\"convertToBlob\" in surface) {\n return await surface.convertToBlob({ type, quality });\n }\n return await new Promise<Blob | null>((resolve) => {\n surface.toBlob((blob) => resolve(blob), type, quality);\n });\n}\n\n/**\n * Whether this browser can actually encode a format.\n *\n * Asks for a 1x1 image in that type and checks what came back, because\n * that is the only answer that counts: a browser that \"supports\" WebP for\n * display may still not encode it.\n *\n * @example\n * ```ts\n * const type = (await supportsImageType(\"image/webp\")) ? \"image/webp\" : \"image/jpeg\";\n * const resized = await resizeImage(file, { width: 1200, type });\n * ```\n *\n * @param type The format to test.\n * @returns Whether encoding produces that type. Cached per type.\n */\nexport async function supportsImageType(type: ImageType): Promise<boolean> {\n const cached = supportCache.get(type);\n if (cached !== undefined) return cached;\n\n let supported: boolean;\n try {\n const { createSurface } = await import(\"./canvas\");\n const surface = createSurface(1, 1);\n getContext(surface);\n const blob = await surfaceToBlob(surface, type, 0.5);\n supported = blob !== null && blob.type === type;\n } catch {\n supported = false;\n }\n\n supportCache.set(type, supported);\n return supported;\n}\n\n/**\n * Pick the smallest format this browser can actually produce.\n *\n * @example\n * ```ts\n * const type = await bestSupportedType([\"image/avif\", \"image/webp\", \"image/jpeg\"]);\n * ```\n *\n * @param preferences Formats in preference order.\n * @returns The first supported one, falling back to `image/jpeg`, which\n * every canvas implementation encodes.\n */\nexport async function bestSupportedType(\n preferences: readonly ImageType[] = [\"image/webp\", \"image/jpeg\"],\n): Promise<ImageType> {\n for (const type of preferences) {\n if (await supportsImageType(type)) return type;\n }\n return \"image/jpeg\";\n}\n\n/**\n * Clear the format-support cache.\n *\n * Only useful in tests: browser support does not change at runtime.\n */\nexport function resetImageTypeSupportCache(): void {\n supportCache.clear();\n}\n"],"mappings":"8DAgBA,IAAa,EAAkB,IAGlB,EAA0B,aAEjC,EAAe,IAAI,IAUzB,eAAsB,EAClB,EACA,EAAyB,CAAC,EACH,CACvB,IAAM,EAAO,EAAQ,MAAA,aAGf,EAAO,MAAM,EAAc,EAAS,EAF1B,EAAQ,SAAA,GAE+B,EACvD,GAAI,IAAS,KACT,MAAM,IAAI,EAAA,iBACN,oCAAoC,EAAK,+DAE7C,EAGJ,MAAO,CACH,OACA,MAAO,EAAQ,MACf,OAAQ,EAAQ,OAChB,KAAM,EAAK,MAAQ,EACnB,MAAO,EAAK,IAChB,CACJ,CAaA,eAAe,EACX,EACA,EACA,EACoB,CAIpB,MAHI,kBAAmB,EACZ,MAAM,EAAQ,cAAc,CAAE,OAAM,SAAQ,CAAC,EAEjD,MAAM,IAAI,QAAsB,GAAY,CAC/C,EAAQ,OAAQ,GAAS,EAAQ,CAAI,EAAG,EAAM,CAAO,CACzD,CAAC,CACL,CAkBA,eAAsB,EAAkB,EAAmC,CACvE,IAAM,EAAS,EAAa,IAAI,CAAI,EACpC,GAAI,IAAW,IAAA,GAAW,OAAO,EAEjC,IAAI,EACJ,GAAI,CACA,GAAM,CAAE,iBAAkB,MAAA,QAAA,QAAA,CAAA,CAAA,SAAA,QAAM,cAAA,CAAA,EAC1B,EAAU,EAAc,EAAG,CAAC,EAClC,EAAA,WAAW,CAAO,EAClB,IAAM,EAAO,MAAM,EAAc,EAAS,EAAM,EAAG,EACnD,EAAY,IAAS,MAAQ,EAAK,OAAS,CAC/C,MAAQ,CACJ,EAAY,EAChB,CAGA,OADA,EAAa,IAAI,EAAM,CAAS,EACzB,CACX,CAcA,eAAsB,EAClB,EAAoC,CAAC,aAAc,YAAY,EAC7C,CAClB,IAAK,IAAM,KAAQ,EACf,GAAI,MAAM,EAAkB,CAAI,EAAG,OAAO,EAE9C,MAAO,YACX,CAOA,SAAgB,GAAmC,CAC/C,EAAa,MAAM,CACvB"}
1
+ {"version":3,"file":"encode.cjs","names":[],"sources":["../../src/imaging/encode.ts"],"sourcesContent":["/**\n * Getting bytes back out, and knowing which bytes you got.\n *\n * The trap here is silent: `canvas.toBlob(cb, \"image/avif\")` does not throw\n * on a browser without an AVIF encoder. It hands back a **PNG** with the\n * requested type ignored, and an app that trusted the request uploads\n * several megabytes where it planned for a few hundred kilobytes. Every\n * function here reports the type actually produced, and\n * :func:`supportsImageType` answers the question up front.\n */\n\nimport { getContext, type Surface } from \"./canvas\";\nimport { ImageEncodeError } from \"./exceptions\";\nimport type { EncodeOptions, ImageType, ProcessedImage } from \"./types\";\n\n/** Quality used when the caller does not choose. */\nexport const DEFAULT_QUALITY = 0.85;\n\n/** Format used when the caller does not choose. */\nexport const DEFAULT_TYPE: ImageType = \"image/jpeg\";\n\nconst supportCache = new Map<string, boolean>();\n\n/**\n * Encode a surface into image bytes.\n *\n * @param surface The canvas to encode.\n * @param options Format and quality.\n * @returns The blob plus the dimensions and the type actually produced.\n * @throws {@link ImageEncodeError} when the canvas produces nothing.\n */\nexport async function encodeImage(\n surface: Surface,\n options: EncodeOptions = {},\n): Promise<ProcessedImage> {\n const type = options.type ?? DEFAULT_TYPE;\n const quality = options.quality ?? DEFAULT_QUALITY;\n\n const blob = await surfaceToBlob(surface, type, quality);\n if (blob === null) {\n throw new ImageEncodeError(\n `The canvas produced no bytes for ${type}. The image may be too large ` +\n \"for this browser's canvas limits.\",\n );\n }\n\n return {\n blob,\n width: surface.width,\n height: surface.height,\n type: blob.type || type,\n bytes: blob.size,\n };\n}\n\n/**\n * Encode a surface, whichever kind it is.\n *\n * `OffscreenCanvas` and `HTMLCanvasElement` disagree on how to hand back\n * bytes — one returns a promise, the other takes a callback.\n *\n * @param surface The canvas.\n * @param type MIME type to request.\n * @param quality Quality for lossy formats.\n * @returns The blob, or `null` when the canvas produced nothing.\n */\nasync function surfaceToBlob(\n surface: Surface,\n type: string,\n quality: number,\n): Promise<Blob | null> {\n if (\"convertToBlob\" in surface) {\n return await surface.convertToBlob({ type, quality });\n }\n return await new Promise<Blob | null>((resolve) => {\n surface.toBlob((blob) => resolve(blob), type, quality);\n });\n}\n\n/**\n * Whether this browser can actually encode a format.\n *\n * Asks for a 1x1 image in that type and checks what came back, because\n * that is the only answer that counts: a browser that \"supports\" WebP for\n * display may still not encode it.\n *\n * @example\n * ```ts\n * const type = (await supportsImageType(\"image/webp\")) ? \"image/webp\" : \"image/jpeg\";\n * const resized = await resizeImage(file, { width: 1200, type });\n * ```\n *\n * @param type The format to test.\n * @returns Whether encoding produces that type. Cached per type.\n */\nexport async function supportsImageType(type: ImageType): Promise<boolean> {\n const cached = supportCache.get(type);\n if (cached !== undefined) return cached;\n\n let supported: boolean;\n try {\n const { createSurface } = await import(\"./canvas\");\n const surface = createSurface(1, 1);\n getContext(surface);\n const blob = await surfaceToBlob(surface, type, 0.5);\n supported = blob !== null && blob.type === type;\n } catch {\n supported = false;\n }\n\n supportCache.set(type, supported);\n return supported;\n}\n\n/**\n * Pick the smallest format this browser can actually produce.\n *\n * @example\n * ```ts\n * const type = await bestSupportedType([\"image/avif\", \"image/webp\", \"image/jpeg\"]);\n * ```\n *\n * @param preferences Formats in preference order.\n * @returns The first supported one, falling back to `image/jpeg`, which\n * every canvas implementation encodes.\n */\nexport async function bestSupportedType(\n preferences: readonly ImageType[] = [\"image/webp\", \"image/jpeg\"],\n): Promise<ImageType> {\n for (const type of preferences) {\n if (await supportsImageType(type)) return type;\n }\n return \"image/jpeg\";\n}\n\n/**\n * Clear the format-support cache.\n *\n * Only useful in tests: browser support does not change at runtime.\n */\nexport function resetImageTypeSupportCache(): void {\n supportCache.clear();\n}\n"],"mappings":"8DAgBA,IAAa,EAAkB,IAGlB,EAA0B,aAEjC,EAAe,IAAI,IAUzB,eAAsB,EAClB,EACA,EAAyB,CAAC,EACH,CACvB,IAAM,EAAO,EAAQ,MAAA,aAGf,EAAO,MAAM,EAAc,EAAS,EAF1B,EAAQ,SAAA,GAE+B,EACvD,GAAI,IAAS,KACT,MAAM,IAAI,EAAA,iBACN,oCAAoC,EAAK,+DAE7C,EAGJ,MAAO,CACH,OACA,MAAO,EAAQ,MACf,OAAQ,EAAQ,OAChB,KAAM,EAAK,MAAQ,EACnB,MAAO,EAAK,IAChB,CACJ,CAaA,eAAe,EACX,EACA,EACA,EACoB,CAIpB,MAHI,kBAAmB,EACZ,MAAM,EAAQ,cAAc,CAAE,OAAM,SAAQ,CAAC,EAEjD,MAAM,IAAI,QAAsB,GAAY,CAC/C,EAAQ,OAAQ,GAAS,EAAQ,CAAI,EAAG,EAAM,CAAO,CACzD,CAAC,CACL,CAkBA,eAAsB,EAAkB,EAAmC,CACvE,IAAM,EAAS,EAAa,IAAI,CAAI,EACpC,GAAI,IAAW,IAAA,GAAW,OAAO,EAEjC,IAAI,EACJ,GAAI,CACA,GAAM,CAAE,iBAAkB,MAAA,QAAA,QAAA,CAAA,CAAA,SAAA,QAAM,cAAA,CAAA,EAC1B,EAAU,EAAc,EAAG,CAAC,EAClC,EAAA,WAAW,CAAO,EAClB,IAAM,EAAO,MAAM,EAAc,EAAS,EAAM,EAAG,EACnD,EAAY,IAAS,MAAQ,EAAK,OAAS,CAC/C,MAAQ,CACJ,EAAY,EAChB,CAGA,OADA,EAAa,IAAI,EAAM,CAAS,EACzB,CACX,CAcA,eAAsB,EAClB,EAAoC,CAAC,aAAc,YAAY,EAC7C,CAClB,IAAK,IAAM,KAAQ,EACf,GAAI,MAAM,EAAkB,CAAI,EAAG,OAAO,EAE9C,MAAO,YACX"}
@@ -39,10 +39,7 @@ async function c(e = ["image/webp", "image/jpeg"]) {
39
39
  for (let t of e) if (await s(t)) return t;
40
40
  return "image/jpeg";
41
41
  }
42
- function l() {
43
- i.clear();
44
- }
45
42
  //#endregion
46
- export { n as DEFAULT_QUALITY, r as DEFAULT_TYPE, c as bestSupportedType, a as encodeImage, l as resetImageTypeSupportCache, s as supportsImageType };
43
+ export { n as DEFAULT_QUALITY, r as DEFAULT_TYPE, c as bestSupportedType, a as encodeImage, s as supportsImageType };
47
44
 
48
45
  //# sourceMappingURL=encode.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"encode.js","names":[],"sources":["../../src/imaging/encode.ts"],"sourcesContent":["/**\n * Getting bytes back out, and knowing which bytes you got.\n *\n * The trap here is silent: `canvas.toBlob(cb, \"image/avif\")` does not throw\n * on a browser without an AVIF encoder. It hands back a **PNG** with the\n * requested type ignored, and an app that trusted the request uploads\n * several megabytes where it planned for a few hundred kilobytes. Every\n * function here reports the type actually produced, and\n * :func:`supportsImageType` answers the question up front.\n */\n\nimport { getContext, type Surface } from \"./canvas\";\nimport { ImageEncodeError } from \"./exceptions\";\nimport type { EncodeOptions, ImageType, ProcessedImage } from \"./types\";\n\n/** Quality used when the caller does not choose. */\nexport const DEFAULT_QUALITY = 0.85;\n\n/** Format used when the caller does not choose. */\nexport const DEFAULT_TYPE: ImageType = \"image/jpeg\";\n\nconst supportCache = new Map<string, boolean>();\n\n/**\n * Encode a surface into image bytes.\n *\n * @param surface The canvas to encode.\n * @param options Format and quality.\n * @returns The blob plus the dimensions and the type actually produced.\n * @throws {@link ImageEncodeError} when the canvas produces nothing.\n */\nexport async function encodeImage(\n surface: Surface,\n options: EncodeOptions = {},\n): Promise<ProcessedImage> {\n const type = options.type ?? DEFAULT_TYPE;\n const quality = options.quality ?? DEFAULT_QUALITY;\n\n const blob = await surfaceToBlob(surface, type, quality);\n if (blob === null) {\n throw new ImageEncodeError(\n `The canvas produced no bytes for ${type}. The image may be too large ` +\n \"for this browser's canvas limits.\",\n );\n }\n\n return {\n blob,\n width: surface.width,\n height: surface.height,\n type: blob.type || type,\n bytes: blob.size,\n };\n}\n\n/**\n * Encode a surface, whichever kind it is.\n *\n * `OffscreenCanvas` and `HTMLCanvasElement` disagree on how to hand back\n * bytes — one returns a promise, the other takes a callback.\n *\n * @param surface The canvas.\n * @param type MIME type to request.\n * @param quality Quality for lossy formats.\n * @returns The blob, or `null` when the canvas produced nothing.\n */\nasync function surfaceToBlob(\n surface: Surface,\n type: string,\n quality: number,\n): Promise<Blob | null> {\n if (\"convertToBlob\" in surface) {\n return await surface.convertToBlob({ type, quality });\n }\n return await new Promise<Blob | null>((resolve) => {\n surface.toBlob((blob) => resolve(blob), type, quality);\n });\n}\n\n/**\n * Whether this browser can actually encode a format.\n *\n * Asks for a 1x1 image in that type and checks what came back, because\n * that is the only answer that counts: a browser that \"supports\" WebP for\n * display may still not encode it.\n *\n * @example\n * ```ts\n * const type = (await supportsImageType(\"image/webp\")) ? \"image/webp\" : \"image/jpeg\";\n * const resized = await resizeImage(file, { width: 1200, type });\n * ```\n *\n * @param type The format to test.\n * @returns Whether encoding produces that type. Cached per type.\n */\nexport async function supportsImageType(type: ImageType): Promise<boolean> {\n const cached = supportCache.get(type);\n if (cached !== undefined) return cached;\n\n let supported: boolean;\n try {\n const { createSurface } = await import(\"./canvas\");\n const surface = createSurface(1, 1);\n getContext(surface);\n const blob = await surfaceToBlob(surface, type, 0.5);\n supported = blob !== null && blob.type === type;\n } catch {\n supported = false;\n }\n\n supportCache.set(type, supported);\n return supported;\n}\n\n/**\n * Pick the smallest format this browser can actually produce.\n *\n * @example\n * ```ts\n * const type = await bestSupportedType([\"image/avif\", \"image/webp\", \"image/jpeg\"]);\n * ```\n *\n * @param preferences Formats in preference order.\n * @returns The first supported one, falling back to `image/jpeg`, which\n * every canvas implementation encodes.\n */\nexport async function bestSupportedType(\n preferences: readonly ImageType[] = [\"image/webp\", \"image/jpeg\"],\n): Promise<ImageType> {\n for (const type of preferences) {\n if (await supportsImageType(type)) return type;\n }\n return \"image/jpeg\";\n}\n\n/**\n * Clear the format-support cache.\n *\n * Only useful in tests: browser support does not change at runtime.\n */\nexport function resetImageTypeSupportCache(): void {\n supportCache.clear();\n}\n"],"mappings":";;;AAgBA,IAAa,IAAkB,KAGlB,IAA0B,cAEjC,oBAAe,IAAI,IAAqB;AAU9C,eAAsB,EAClB,GACA,IAAyB,CAAC,GACH;CACvB,IAAM,IAAO,EAAQ,QAAA,cAGf,IAAO,MAAM,EAAc,GAAS,GAF1B,EAAQ,WAAA,GAE+B;CACvD,IAAI,MAAS,MACT,MAAM,IAAI,EACN,oCAAoC,EAAK,+DAE7C;CAGJ,OAAO;EACH;EACA,OAAO,EAAQ;EACf,QAAQ,EAAQ;EAChB,MAAM,EAAK,QAAQ;EACnB,OAAO,EAAK;CAChB;AACJ;AAaA,eAAe,EACX,GACA,GACA,GACoB;CAIpB,OAHI,mBAAmB,IACZ,MAAM,EAAQ,cAAc;EAAE;EAAM;CAAQ,CAAC,IAEjD,MAAM,IAAI,SAAsB,MAAY;EAC/C,EAAQ,QAAQ,MAAS,EAAQ,CAAI,GAAG,GAAM,CAAO;CACzD,CAAC;AACL;AAkBA,eAAsB,EAAkB,GAAmC;CACvE,IAAM,IAAS,EAAa,IAAI,CAAI;CACpC,IAAI,MAAW,KAAA,GAAW,OAAO;CAEjC,IAAI;CACJ,IAAI;EACA,IAAM,EAAE,qBAAkB,MAAM,OAAO,gBACjC,IAAU,EAAc,GAAG,CAAC;EAClC,EAAW,CAAO;EAClB,IAAM,IAAO,MAAM,EAAc,GAAS,GAAM,EAAG;EACnD,IAAY,MAAS,QAAQ,EAAK,SAAS;CAC/C,QAAQ;EACJ,IAAY;CAChB;CAGA,OADA,EAAa,IAAI,GAAM,CAAS,GACzB;AACX;AAcA,eAAsB,EAClB,IAAoC,CAAC,cAAc,YAAY,GAC7C;CAClB,KAAK,IAAM,KAAQ,GACf,IAAI,MAAM,EAAkB,CAAI,GAAG,OAAO;CAE9C,OAAO;AACX;AAOA,SAAgB,IAAmC;CAC/C,EAAa,MAAM;AACvB"}
1
+ {"version":3,"file":"encode.js","names":[],"sources":["../../src/imaging/encode.ts"],"sourcesContent":["/**\n * Getting bytes back out, and knowing which bytes you got.\n *\n * The trap here is silent: `canvas.toBlob(cb, \"image/avif\")` does not throw\n * on a browser without an AVIF encoder. It hands back a **PNG** with the\n * requested type ignored, and an app that trusted the request uploads\n * several megabytes where it planned for a few hundred kilobytes. Every\n * function here reports the type actually produced, and\n * :func:`supportsImageType` answers the question up front.\n */\n\nimport { getContext, type Surface } from \"./canvas\";\nimport { ImageEncodeError } from \"./exceptions\";\nimport type { EncodeOptions, ImageType, ProcessedImage } from \"./types\";\n\n/** Quality used when the caller does not choose. */\nexport const DEFAULT_QUALITY = 0.85;\n\n/** Format used when the caller does not choose. */\nexport const DEFAULT_TYPE: ImageType = \"image/jpeg\";\n\nconst supportCache = new Map<string, boolean>();\n\n/**\n * Encode a surface into image bytes.\n *\n * @param surface The canvas to encode.\n * @param options Format and quality.\n * @returns The blob plus the dimensions and the type actually produced.\n * @throws {@link ImageEncodeError} when the canvas produces nothing.\n */\nexport async function encodeImage(\n surface: Surface,\n options: EncodeOptions = {},\n): Promise<ProcessedImage> {\n const type = options.type ?? DEFAULT_TYPE;\n const quality = options.quality ?? DEFAULT_QUALITY;\n\n const blob = await surfaceToBlob(surface, type, quality);\n if (blob === null) {\n throw new ImageEncodeError(\n `The canvas produced no bytes for ${type}. The image may be too large ` +\n \"for this browser's canvas limits.\",\n );\n }\n\n return {\n blob,\n width: surface.width,\n height: surface.height,\n type: blob.type || type,\n bytes: blob.size,\n };\n}\n\n/**\n * Encode a surface, whichever kind it is.\n *\n * `OffscreenCanvas` and `HTMLCanvasElement` disagree on how to hand back\n * bytes — one returns a promise, the other takes a callback.\n *\n * @param surface The canvas.\n * @param type MIME type to request.\n * @param quality Quality for lossy formats.\n * @returns The blob, or `null` when the canvas produced nothing.\n */\nasync function surfaceToBlob(\n surface: Surface,\n type: string,\n quality: number,\n): Promise<Blob | null> {\n if (\"convertToBlob\" in surface) {\n return await surface.convertToBlob({ type, quality });\n }\n return await new Promise<Blob | null>((resolve) => {\n surface.toBlob((blob) => resolve(blob), type, quality);\n });\n}\n\n/**\n * Whether this browser can actually encode a format.\n *\n * Asks for a 1x1 image in that type and checks what came back, because\n * that is the only answer that counts: a browser that \"supports\" WebP for\n * display may still not encode it.\n *\n * @example\n * ```ts\n * const type = (await supportsImageType(\"image/webp\")) ? \"image/webp\" : \"image/jpeg\";\n * const resized = await resizeImage(file, { width: 1200, type });\n * ```\n *\n * @param type The format to test.\n * @returns Whether encoding produces that type. Cached per type.\n */\nexport async function supportsImageType(type: ImageType): Promise<boolean> {\n const cached = supportCache.get(type);\n if (cached !== undefined) return cached;\n\n let supported: boolean;\n try {\n const { createSurface } = await import(\"./canvas\");\n const surface = createSurface(1, 1);\n getContext(surface);\n const blob = await surfaceToBlob(surface, type, 0.5);\n supported = blob !== null && blob.type === type;\n } catch {\n supported = false;\n }\n\n supportCache.set(type, supported);\n return supported;\n}\n\n/**\n * Pick the smallest format this browser can actually produce.\n *\n * @example\n * ```ts\n * const type = await bestSupportedType([\"image/avif\", \"image/webp\", \"image/jpeg\"]);\n * ```\n *\n * @param preferences Formats in preference order.\n * @returns The first supported one, falling back to `image/jpeg`, which\n * every canvas implementation encodes.\n */\nexport async function bestSupportedType(\n preferences: readonly ImageType[] = [\"image/webp\", \"image/jpeg\"],\n): Promise<ImageType> {\n for (const type of preferences) {\n if (await supportsImageType(type)) return type;\n }\n return \"image/jpeg\";\n}\n\n/**\n * Clear the format-support cache.\n *\n * Only useful in tests: browser support does not change at runtime.\n */\nexport function resetImageTypeSupportCache(): void {\n supportCache.clear();\n}\n"],"mappings":";;;AAgBA,IAAa,IAAkB,KAGlB,IAA0B,cAEjC,oBAAe,IAAI,IAAqB;AAU9C,eAAsB,EAClB,GACA,IAAyB,CAAC,GACH;CACvB,IAAM,IAAO,EAAQ,QAAA,cAGf,IAAO,MAAM,EAAc,GAAS,GAF1B,EAAQ,WAAA,GAE+B;CACvD,IAAI,MAAS,MACT,MAAM,IAAI,EACN,oCAAoC,EAAK,+DAE7C;CAGJ,OAAO;EACH;EACA,OAAO,EAAQ;EACf,QAAQ,EAAQ;EAChB,MAAM,EAAK,QAAQ;EACnB,OAAO,EAAK;CAChB;AACJ;AAaA,eAAe,EACX,GACA,GACA,GACoB;CAIpB,OAHI,mBAAmB,IACZ,MAAM,EAAQ,cAAc;EAAE;EAAM;CAAQ,CAAC,IAEjD,MAAM,IAAI,SAAsB,MAAY;EAC/C,EAAQ,QAAQ,MAAS,EAAQ,CAAI,GAAG,GAAM,CAAO;CACzD,CAAC;AACL;AAkBA,eAAsB,EAAkB,GAAmC;CACvE,IAAM,IAAS,EAAa,IAAI,CAAI;CACpC,IAAI,MAAW,KAAA,GAAW,OAAO;CAEjC,IAAI;CACJ,IAAI;EACA,IAAM,EAAE,qBAAkB,MAAM,OAAO,gBACjC,IAAU,EAAc,GAAG,CAAC;EAClC,EAAW,CAAO;EAClB,IAAM,IAAO,MAAM,EAAc,GAAS,GAAM,EAAG;EACnD,IAAY,MAAS,QAAQ,EAAK,SAAS;CAC/C,QAAQ;EACJ,IAAY;CAChB;CAGA,OADA,EAAa,IAAI,GAAM,CAAS,GACzB;AACX;AAcA,eAAsB,EAClB,IAAoC,CAAC,cAAc,YAAY,GAC7C;CAClB,KAAK,IAAM,KAAQ,GACf,IAAI,MAAM,EAAkB,CAAI,GAAG,OAAO;CAE9C,OAAO;AACX"}
package/dist/imaging.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./imaging/exceptions.cjs"),t=require("./imaging/canvas.cjs"),n=require("./imaging/decode.cjs"),r=require("./imaging/encode.cjs"),i=require("./imaging/transform.cjs"),a=require("./imaging/compress.cjs"),o=require("./imaging/thumbnails.cjs"),s=require("./imaging/use-image-processing.cjs");exports.DEFAULT_BACKGROUND=i.DEFAULT_BACKGROUND,exports.DEFAULT_COMPRESS_STEPS=a.DEFAULT_COMPRESS_STEPS,exports.DEFAULT_MAX_QUALITY=a.DEFAULT_MAX_QUALITY,exports.DEFAULT_MIN_QUALITY=a.DEFAULT_MIN_QUALITY,exports.DEFAULT_QUALITY=r.DEFAULT_QUALITY,exports.DEFAULT_TYPE=r.DEFAULT_TYPE,exports.ImageDecodeError=e.ImageDecodeError,exports.ImageEncodeError=e.ImageEncodeError,exports.ImagingError=e.ImagingError,exports.ImagingUnavailableError=e.ImagingUnavailableError,exports.UnsupportedImageTypeError=e.UnsupportedImageTypeError,exports.bestSupportedType=r.bestSupportedType,exports.compressToTarget=a.compressToTarget,exports.createSurface=t.createSurface,exports.createThumbnails=o.createThumbnails,exports.cropImage=i.cropImage,exports.decodeImage=n.decodeImage,exports.drawScaled=t.drawScaled,exports.encodeImage=r.encodeImage,exports.flipImage=i.flipImage,exports.getContext=t.getContext,exports.readImageInfo=n.readImageInfo,exports.resetImageTypeSupportCache=r.resetImageTypeSupportCache,exports.resizeImage=i.resizeImage,exports.rotateImage=i.rotateImage,exports.supportsImageType=r.supportsImageType,exports.useImagePreview=s.useImagePreview,exports.useImageProcessing=s.useImageProcessing;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./imaging/exceptions.cjs"),t=require("./imaging/canvas.cjs"),n=require("./imaging/decode.cjs"),r=require("./imaging/encode.cjs"),i=require("./imaging/transform.cjs"),a=require("./imaging/compress.cjs"),o=require("./imaging/thumbnails.cjs"),s=require("./imaging/use-image-processing.cjs");exports.DEFAULT_BACKGROUND=i.DEFAULT_BACKGROUND,exports.DEFAULT_COMPRESS_STEPS=a.DEFAULT_COMPRESS_STEPS,exports.DEFAULT_MAX_QUALITY=a.DEFAULT_MAX_QUALITY,exports.DEFAULT_MIN_QUALITY=a.DEFAULT_MIN_QUALITY,exports.DEFAULT_QUALITY=r.DEFAULT_QUALITY,exports.DEFAULT_TYPE=r.DEFAULT_TYPE,exports.ImageDecodeError=e.ImageDecodeError,exports.ImageEncodeError=e.ImageEncodeError,exports.ImagingError=e.ImagingError,exports.ImagingUnavailableError=e.ImagingUnavailableError,exports.UnsupportedImageTypeError=e.UnsupportedImageTypeError,exports.bestSupportedType=r.bestSupportedType,exports.compressToTarget=a.compressToTarget,exports.createSurface=t.createSurface,exports.createThumbnails=o.createThumbnails,exports.cropImage=i.cropImage,exports.decodeImage=n.decodeImage,exports.drawScaled=t.drawScaled,exports.encodeImage=r.encodeImage,exports.flipImage=i.flipImage,exports.getContext=t.getContext,exports.readImageInfo=n.readImageInfo,exports.resizeImage=i.resizeImage,exports.rotateImage=i.rotateImage,exports.supportsImageType=r.supportsImageType,exports.useImagePreview=s.useImagePreview,exports.useImageProcessing=s.useImageProcessing;
package/dist/imaging.d.ts CHANGED
@@ -333,13 +333,6 @@ export declare interface CompressOptions extends ResizeOptions {
333
333
  */
334
334
  export declare function readImageInfo(blob: Blob): Promise<ImageInfo>;
335
335
 
336
- /**
337
- * Clear the format-support cache.
338
- *
339
- * Only useful in tests: browser support does not change at runtime.
340
- */
341
- export declare function resetImageTypeSupportCache(): void;
342
-
343
336
  /**
344
337
  * How a resize fits the requested box.
345
338
  *
package/dist/imaging.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { ImageDecodeError as e, ImageEncodeError as t, ImagingError as n, ImagingUnavailableError as r, UnsupportedImageTypeError as i } from "./imaging/exceptions.js";
2
2
  import { createSurface as a, drawScaled as o, getContext as s } from "./imaging/canvas.js";
3
3
  import { decodeImage as c, readImageInfo as l } from "./imaging/decode.js";
4
- import { DEFAULT_QUALITY as u, DEFAULT_TYPE as d, bestSupportedType as f, encodeImage as p, resetImageTypeSupportCache as m, supportsImageType as h } from "./imaging/encode.js";
5
- import { DEFAULT_BACKGROUND as g, cropImage as _, flipImage as v, resizeImage as y, rotateImage as b } from "./imaging/transform.js";
6
- import { DEFAULT_COMPRESS_STEPS as x, DEFAULT_MAX_QUALITY as S, DEFAULT_MIN_QUALITY as C, compressToTarget as w } from "./imaging/compress.js";
7
- import { createThumbnails as T } from "./imaging/thumbnails.js";
8
- import { useImagePreview as E, useImageProcessing as D } from "./imaging/use-image-processing.js";
9
- export { g as DEFAULT_BACKGROUND, x as DEFAULT_COMPRESS_STEPS, S as DEFAULT_MAX_QUALITY, C as DEFAULT_MIN_QUALITY, u as DEFAULT_QUALITY, d as DEFAULT_TYPE, e as ImageDecodeError, t as ImageEncodeError, n as ImagingError, r as ImagingUnavailableError, i as UnsupportedImageTypeError, f as bestSupportedType, w as compressToTarget, a as createSurface, T as createThumbnails, _ as cropImage, c as decodeImage, o as drawScaled, p as encodeImage, v as flipImage, s as getContext, l as readImageInfo, m as resetImageTypeSupportCache, y as resizeImage, b as rotateImage, h as supportsImageType, E as useImagePreview, D as useImageProcessing };
4
+ import { DEFAULT_QUALITY as u, DEFAULT_TYPE as d, bestSupportedType as f, encodeImage as p, supportsImageType as m } from "./imaging/encode.js";
5
+ import { DEFAULT_BACKGROUND as h, cropImage as g, flipImage as _, resizeImage as v, rotateImage as y } from "./imaging/transform.js";
6
+ import { DEFAULT_COMPRESS_STEPS as b, DEFAULT_MAX_QUALITY as x, DEFAULT_MIN_QUALITY as S, compressToTarget as C } from "./imaging/compress.js";
7
+ import { createThumbnails as w } from "./imaging/thumbnails.js";
8
+ import { useImagePreview as T, useImageProcessing as E } from "./imaging/use-image-processing.js";
9
+ export { h as DEFAULT_BACKGROUND, b as DEFAULT_COMPRESS_STEPS, x as DEFAULT_MAX_QUALITY, S as DEFAULT_MIN_QUALITY, u as DEFAULT_QUALITY, d as DEFAULT_TYPE, e as ImageDecodeError, t as ImageEncodeError, n as ImagingError, r as ImagingUnavailableError, i as UnsupportedImageTypeError, f as bestSupportedType, C as compressToTarget, a as createSurface, w as createThumbnails, g as cropImage, c as decodeImage, o as drawScaled, p as encodeImage, _ as flipImage, s as getContext, l as readImageInfo, v as resizeImage, y as rotateImage, m as supportsImageType, T as useImagePreview, E as useImageProcessing };
@@ -1,2 +1,2 @@
1
- const e=require("./exceptions.cjs");var t=`TMC1`,n=1,r=class n{header;arrays;info;constructor(e,t,n){this.header=e,this.arrays=t,this.info=n}static async create(r,a){let o=await i(r,a),s=new Uint8Array(o);if(String.fromCharCode(...s.subarray(0,4))!==t)throw new e.CompactFormatError(`This is not a compact model file: it does not start with "${t}". A .onnx file goes through TabularPredictor instead.`);let c=new DataView(o).getUint32(4,!0),l=JSON.parse(new TextDecoder().decode(s.subarray(8,8+c)));if(l.schema_version>1)throw new e.CompactFormatError(`This file uses compact layout ${l.schema_version}, and this SDK understands 1. Upgrade tempest-react-sdk before serving it.`);let u={},d=8+c;for(let e of l.sections)u[e.name]=e.dtype===`float32`?new Float32Array(o,d,e.length):new Int32Array(o,d,e.length),d+=e.length*4;return new n(l,u,{kind:l.kind,classes:l.classes,numFeatures:l.n_features,featureNames:l.feature_names,numTrees:l.n_trees??0,isClassifier:l.task===`classification`,estimator:l.estimator})}async predict(e){let t=a(e,this.header.n_features),n=performance.now(),r=[];for(let n of e){let e=this.preprocess(n,t);r.push(this.header.kind===`linear`?this.linearScores(e):this.treeScores(e))}let{labels:i,probabilities:o}=this.finish(r);return{labels:i,probabilities:o,numRows:e.length,ms:performance.now()-n}}async dispose(){}preprocess(e,t){let n=this.header.preprocess;if(n===null)return e;let r=Array(t);for(let i=0;i<t;i+=1)r[i]=(e[i]-n.offset[i])/n.scale[i];return r}linearScores(e){let t=this.arrays.coef,n=this.arrays.intercept,r=this.header.n_features,i=this.header.n_outputs,a=Array(i);for(let o=0;o<i;o+=1){let i=n[o],s=o*r;for(let n=0;n<r;n+=1)i+=t[s+n]*e[n];a[o]=i}return a}treeScores(e){let t=this.arrays.node_feature,n=this.arrays.node_threshold,r=this.arrays.node_left,i=this.arrays.node_right,a=this.arrays.leaf_value,o=this.arrays.tree_offset,s=this.header.n_outputs,c=o.length-1,l=Array(s).fill(0);for(let u=0;u<c;u+=1){let c=o[u],d=t[c];for(;d>=0;)c=Math.fround(e[d])<=n[c]?r[c]:i[c],d=t[c];let f=(-1-d)*s;for(let e=0;e<s;e+=1)l[e]+=a[f+e]}for(let e=0;e<s;e+=1)l[e]=l[e]/c;return l}finish(e){let t=this.header.link,n=this.header.classes;if(t===`identity`)return{labels:e.map(e=>e[0]),probabilities:[]};let r=e.map(e=>{if(t===`sigmoid`){let t=1/(1+Math.exp(-e[0]));return[1-t,t]}if(t===`softmax`){let t=Math.max(...e),n=e.map(e=>Math.exp(e-t)),r=n.reduce((e,t)=>e+t,0);return n.map(e=>e/r)}let n=e.reduce((e,t)=>e+t,0);return n===0?[...e]:e.map(e=>e/n)}),i=this.header.class_type!==`str`;return{labels:r.map(e=>{let t=0;for(let n=1;n<e.length;n+=1)e[n]>e[t]&&(t=n);let r=n[t];return r===void 0?t:i?Number(r):r}),probabilities:r}}};async function i(t,n){if(typeof t==`string`){let r;try{r=await fetch(t,n)}catch(n){throw new e.ModelFetchError(`Could not download the model: ${t}`,{cause:n})}if(!r.ok)throw new e.ModelFetchError(`Could not download the model: ${r.status} ${r.statusText}`);return await r.arrayBuffer()}return t instanceof Uint8Array?t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength):t}function a(t,n){if(!Array.isArray(t)||t.length===0)throw new e.FeatureShapeError(`predict() needs at least one row, shaped [[f1, f2, ...]].`);let r=t[0]?.length??0,i=t.findIndex(e=>e.length!==r);if(i!==-1)throw new e.FeatureShapeError(`All rows must have the same width; row ${i} has ${t[i]?.length} values, expected ${r}.`);if(r!==n)throw new e.FeatureShapeError(`The model expects ${n} features per row, got ${r}.`);return r}exports.CompactPredictor=r,exports.SUPPORTED_COMPACT_SCHEMA=n;
1
+ const e=require("./exceptions.cjs");var t=`TMC1`,n=class n{header;arrays;info;constructor(e,t,n){this.header=e,this.arrays=t,this.info=n}static async create(i,a){let o=await r(i,a),s=new Uint8Array(o);if(String.fromCharCode(...s.subarray(0,4))!==t)throw new e.CompactFormatError(`This is not a compact model file: it does not start with "${t}". A .onnx file goes through TabularPredictor instead.`);let c=new DataView(o).getUint32(4,!0),l=JSON.parse(new TextDecoder().decode(s.subarray(8,8+c)));if(l.schema_version>1)throw new e.CompactFormatError(`This file uses compact layout ${l.schema_version}, and this SDK understands 1. Upgrade tempest-react-sdk before serving it.`);let u={},d=8+c;for(let e of l.sections)u[e.name]=e.dtype===`float32`?new Float32Array(o,d,e.length):new Int32Array(o,d,e.length),d+=e.length*4;return new n(l,u,{kind:l.kind,classes:l.classes,numFeatures:l.n_features,featureNames:l.feature_names,numTrees:l.n_trees??0,isClassifier:l.task===`classification`,estimator:l.estimator})}async predict(e){let t=i(e,this.header.n_features),n=performance.now(),r=[];for(let n of e){let e=this.preprocess(n,t);r.push(this.header.kind===`linear`?this.linearScores(e):this.treeScores(e))}let{labels:a,probabilities:o}=this.finish(r);return{labels:a,probabilities:o,numRows:e.length,ms:performance.now()-n}}async dispose(){}preprocess(e,t){let n=this.header.preprocess;if(n===null)return e;let r=Array(t);for(let i=0;i<t;i+=1)r[i]=(e[i]-n.offset[i])/n.scale[i];return r}linearScores(e){let t=this.arrays.coef,n=this.arrays.intercept,r=this.header.n_features,i=this.header.n_outputs,a=Array(i);for(let o=0;o<i;o+=1){let i=n[o],s=o*r;for(let n=0;n<r;n+=1)i+=t[s+n]*e[n];a[o]=i}return a}treeScores(e){let t=this.arrays.node_feature,n=this.arrays.node_threshold,r=this.arrays.node_left,i=this.arrays.node_right,a=this.arrays.leaf_value,o=this.arrays.tree_offset,s=this.header.n_outputs,c=o.length-1,l=Array(s).fill(0);for(let u=0;u<c;u+=1){let c=o[u],d=t[c];for(;d>=0;)c=Math.fround(e[d])<=n[c]?r[c]:i[c],d=t[c];let f=(-1-d)*s;for(let e=0;e<s;e+=1)l[e]+=a[f+e]}for(let e=0;e<s;e+=1)l[e]=l[e]/c;return l}finish(e){let t=this.header.link,n=this.header.classes;if(t===`identity`)return{labels:e.map(e=>e[0]),probabilities:[]};let r=e.map(e=>{if(t===`sigmoid`){let t=1/(1+Math.exp(-e[0]));return[1-t,t]}if(t===`softmax`){let t=Math.max(...e),n=e.map(e=>Math.exp(e-t)),r=n.reduce((e,t)=>e+t,0);return n.map(e=>e/r)}let n=e.reduce((e,t)=>e+t,0);return n===0?[...e]:e.map(e=>e/n)}),i=this.header.class_type!==`str`;return{labels:r.map(e=>{let t=0;for(let n=1;n<e.length;n+=1)e[n]>e[t]&&(t=n);let r=n[t];return r===void 0?t:i?Number(r):r}),probabilities:r}}};async function r(t,n){if(typeof t==`string`){let r;try{r=await fetch(t,n)}catch(n){throw new e.ModelFetchError(`Could not download the model: ${t}`,{cause:n})}if(!r.ok)throw new e.ModelFetchError(`Could not download the model: ${r.status} ${r.statusText}`);return await r.arrayBuffer()}return t instanceof Uint8Array?t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength):t}function i(t,n){if(!Array.isArray(t)||t.length===0)throw new e.FeatureShapeError(`predict() needs at least one row, shaped [[f1, f2, ...]].`);let r=t[0]?.length??0,i=t.findIndex(e=>e.length!==r);if(i!==-1)throw new e.FeatureShapeError(`All rows must have the same width; row ${i} has ${t[i]?.length} values, expected ${r}.`);if(r!==n)throw new e.FeatureShapeError(`The model expects ${n} features per row, got ${r}.`);return r}exports.CompactPredictor=n;
2
2
  //# sourceMappingURL=compact.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"compact.cjs","names":[],"sources":["../../src/tabular/compact.ts"],"sourcesContent":["/**\n * @tempest-limits file-lines — the compact model format: the header, the column\n * dictionary, the quantised weights and the decoder that reads them back. Writer and\n * reader in one file because a format whose two halves live apart drifts.\n */\n/**\n * Running a model with no inference runtime at all.\n *\n * ONNX in the browser costs a **25.6 MB WebAssembly runtime** (6.0 MB\n * gzipped) before the first prediction, while the model itself is a few\n * hundred kilobytes. For an app whose only model is tabular, that runtime\n * *is* the download — so this reader replaces it with 1.49 KB of\n * arithmetic (measured, brotli).\n *\n * A linear model is a dot product. A tree is a chain of comparisons. That\n * is the whole implementation; there is nothing here that a WebAssembly\n * kernel would do better at this size.\n *\n * The file it reads (`.tmc`, magic `TMC1`) is written by\n * `tempest-fastapi-sdk`'s `export_sklearn_to_compact`, which verifies the\n * bytes against scikit-learn's own predictions and refuses to write a file\n * that disagrees. **It is data, not code**: no `eval`, no generated\n * JavaScript, nothing a strict CSP forbids.\n *\n * The trade against {@link TabularPredictor}: ONNX covers every estimator,\n * this covers linear models and tree ensembles. Pick by what your app\n * already ships — a page that loads ONNX for vision pays nothing extra for\n * tabular ONNX.\n */\n\nimport { CompactFormatError, FeatureShapeError, ModelFetchError } from \"./exceptions\";\nimport type { FeatureRow, PredictedLabel, TabularPrediction } from \"./types\";\n\n/** Magic bytes opening every compact file. */\nconst MAGIC = \"TMC1\";\n\n/** Layout version this reader understands. */\nexport const SUPPORTED_COMPACT_SCHEMA = 1;\n\n/** What the file holds. */\nexport type CompactKind = \"linear\" | \"tree_ensemble\";\n\n/** How raw scores become probabilities. */\ntype CompactLink = \"softmax\" | \"sigmoid\" | \"normalize\" | \"identity\";\n\n/** One array stored after the header. */\ninterface CompactSection {\n readonly name: string;\n readonly dtype: \"float32\" | \"int32\";\n readonly length: number;\n}\n\n/** The parsed header. */\ninterface CompactHeader {\n readonly schema_version: number;\n readonly kind: CompactKind;\n readonly task: \"classification\" | \"regression\";\n readonly link: CompactLink;\n readonly classes: readonly string[];\n /** How scikit-learn typed those labels: ``int``, ``float`` or ``str``. */\n readonly class_type?: \"int\" | \"float\" | \"str\";\n readonly n_features: number;\n readonly n_outputs: number;\n readonly n_trees?: number;\n readonly estimator: string;\n readonly feature_names: readonly string[];\n readonly preprocess: { readonly offset: number[]; readonly scale: number[] } | null;\n readonly sections: readonly CompactSection[];\n}\n\n/** What a loaded compact model is. */\nexport interface CompactPredictorInfo {\n /** Which reader path the file uses. */\n readonly kind: CompactKind;\n /** Class labels in score-column order; empty for a regressor. */\n readonly classes: readonly string[];\n /** Values expected per row. */\n readonly numFeatures: number;\n /** Column order recorded at training time, when the export had one. */\n readonly featureNames: readonly string[];\n /** Trees in the ensemble; `0` for a linear model. */\n readonly numTrees: number;\n /** Whether the model produces class scores. */\n readonly isClassifier: boolean;\n /** Class name of the exported estimator. */\n readonly estimator: string;\n}\n\n/**\n * A compact model, loaded and ready to answer.\n *\n * @example\n * ```ts\n * const predictor = await CompactPredictor.create(\"/models/risk.tmc\");\n * const { labels, probabilities } = await predictor.predict([[5.1, 3.5, 1.4, 0.2]]);\n * ```\n */\nexport class CompactPredictor {\n private constructor(\n private readonly header: CompactHeader,\n private readonly arrays: Record<string, Float32Array | Int32Array>,\n /** What is loaded. */\n public readonly info: CompactPredictorInfo,\n ) {}\n\n /**\n * Load a `.tmc` file.\n *\n * @param source A URL, or the bytes when the app already has them.\n * @param requestInit `fetch` options, when `source` is a URL.\n * @returns The loaded predictor.\n * @throws {@link ModelFetchError} when a URL cannot be read.\n * @throws {@link CompactFormatError} when the bytes are not a compact\n * model, or use a layout newer than this reader.\n */\n static async create(\n source: string | ArrayBuffer | Uint8Array,\n requestInit?: RequestInit,\n ): Promise<CompactPredictor> {\n const buffer = await toBuffer(source, requestInit);\n const bytes = new Uint8Array(buffer);\n\n if (String.fromCharCode(...bytes.subarray(0, 4)) !== MAGIC) {\n throw new CompactFormatError(\n \"This is not a compact model file: it does not start with \" +\n `\"${MAGIC}\". A .onnx file goes through TabularPredictor instead.`,\n );\n }\n\n const view = new DataView(buffer);\n const headerLength = view.getUint32(4, true);\n const header = JSON.parse(\n new TextDecoder().decode(bytes.subarray(8, 8 + headerLength)),\n ) as CompactHeader;\n\n if (header.schema_version > SUPPORTED_COMPACT_SCHEMA) {\n throw new CompactFormatError(\n `This file uses compact layout ${header.schema_version}, and this ` +\n `SDK understands ${SUPPORTED_COMPACT_SCHEMA}. Upgrade ` +\n \"tempest-react-sdk before serving it.\",\n );\n }\n\n const arrays: Record<string, Float32Array | Int32Array> = {};\n let cursor = 8 + headerLength;\n for (const section of header.sections) {\n arrays[section.name] =\n section.dtype === \"float32\"\n ? new Float32Array(buffer, cursor, section.length)\n : new Int32Array(buffer, cursor, section.length);\n cursor += section.length * 4;\n }\n\n return new CompactPredictor(header, arrays, {\n kind: header.kind,\n classes: header.classes,\n numFeatures: header.n_features,\n featureNames: header.feature_names,\n numTrees: header.n_trees ?? 0,\n isClassifier: header.task === \"classification\",\n estimator: header.estimator,\n });\n }\n\n /**\n * Predict for a batch of rows.\n *\n * @param rows One array of feature values per row, in training column\n * order. A single row is still wrapped: `[[...]]`.\n * @returns Labels, class scores when the model is a classifier, and the\n * call's duration.\n * @throws {@link FeatureShapeError} when the batch is empty, ragged, or\n * the wrong width.\n */\n async predict(rows: readonly FeatureRow[]): Promise<TabularPrediction> {\n const width = validateRows(rows, this.header.n_features);\n const started = performance.now();\n\n const scores: number[][] = [];\n for (const row of rows) {\n const prepared = this.preprocess(row, width);\n scores.push(\n this.header.kind === \"linear\"\n ? this.linearScores(prepared)\n : this.treeScores(prepared),\n );\n }\n\n const { labels, probabilities } = this.finish(scores);\n return {\n labels,\n probabilities,\n numRows: rows.length,\n ms: performance.now() - started,\n };\n }\n\n /** Releasing nothing, so callers can swap predictors without branching. */\n async dispose(): Promise<void> {\n /* no runtime, nothing to release */\n }\n\n /**\n * Apply the folded scaler, when the export had one.\n *\n * @param row The raw feature values.\n * @param width How many there are.\n * @returns The values the model was trained on.\n */\n private preprocess(row: FeatureRow, width: number): number[] {\n const preprocess = this.header.preprocess;\n if (preprocess === null) return row as number[];\n const scaled = new Array<number>(width);\n for (let index = 0; index < width; index += 1) {\n scaled[index] =\n ((row[index] as number) - (preprocess.offset[index] as number)) /\n (preprocess.scale[index] as number);\n }\n return scaled;\n }\n\n /**\n * Score one row against the coefficient matrix.\n *\n * @param row The prepared feature values.\n * @returns One raw score per output.\n */\n private linearScores(row: readonly number[]): number[] {\n const coef = this.arrays.coef as Float32Array;\n const intercept = this.arrays.intercept as Float32Array;\n const features = this.header.n_features;\n const outputs = this.header.n_outputs;\n\n const scores = new Array<number>(outputs);\n for (let output = 0; output < outputs; output += 1) {\n let total = intercept[output] as number;\n const base = output * features;\n for (let index = 0; index < features; index += 1) {\n total += (coef[base + index] as number) * (row[index] as number);\n }\n scores[output] = total;\n }\n return scores;\n }\n\n /**\n * Walk every tree and average what the leaves hold.\n *\n * A leaf is marked by a negative `feature` entry, which also carries\n * its slot in the value array — so the walk needs no second lookup and\n * the file stores values only for leaves.\n *\n * **The comparison runs in float32** (`Math.fround`), because that is\n * what scikit-learn does: it casts its input to float32 before\n * traversing, so a threshold like 5.099999904632568 — a float32 value\n * widened for storage — and an input of 5.1 compare *equal* and go\n * left. Comparing in float64 sends that row right instead, which on an\n * iris forest changed one tree's vote and moved a probability by 0.05.\n *\n * @param row The prepared feature values.\n * @returns One averaged score per output.\n */\n private treeScores(row: readonly number[]): number[] {\n const feature = this.arrays.node_feature as Int32Array;\n const threshold = this.arrays.node_threshold as Float32Array;\n const left = this.arrays.node_left as Int32Array;\n const right = this.arrays.node_right as Int32Array;\n const leaf = this.arrays.leaf_value as Float32Array;\n const offsets = this.arrays.tree_offset as Int32Array;\n const outputs = this.header.n_outputs;\n const trees = offsets.length - 1;\n\n const totals = new Array<number>(outputs).fill(0);\n for (let tree = 0; tree < trees; tree += 1) {\n let node = offsets[tree] as number;\n let column = feature[node] as number;\n while (column >= 0) {\n node =\n Math.fround(row[column] as number) <= (threshold[node] as number)\n ? (left[node] as number)\n : (right[node] as number);\n column = feature[node] as number;\n }\n const slot = (-1 - column) * outputs;\n for (let output = 0; output < outputs; output += 1) {\n totals[output] += leaf[slot + output] as number;\n }\n }\n for (let output = 0; output < outputs; output += 1) {\n totals[output] = (totals[output] as number) / trees;\n }\n return totals;\n }\n\n /**\n * Turn raw scores into labels and probabilities.\n *\n * @param scores One score array per row.\n * @returns Labels and probabilities in the shape the ONNX route uses,\n * so an app can swap runtimes without touching its own code. That\n * includes the label's **type**: an integer class comes back as a\n * number here exactly as ONNX returns it, because two routes over one\n * model that disagree on `0` versus `\"0\"` break the day someone\n * switches.\n */\n private finish(scores: readonly number[][]): {\n labels: PredictedLabel[];\n probabilities: number[][];\n } {\n const link = this.header.link;\n const classes = this.header.classes;\n\n if (link === \"identity\") {\n return { labels: scores.map((row) => row[0] as number), probabilities: [] };\n }\n\n const probabilities = scores.map((row) => {\n if (link === \"sigmoid\") {\n const positive = 1 / (1 + Math.exp(-(row[0] as number)));\n return [1 - positive, positive];\n }\n if (link === \"softmax\") {\n const highest = Math.max(...row);\n const exponentiated = row.map((value) => Math.exp(value - highest));\n const total = exponentiated.reduce((sum, value) => sum + value, 0);\n return exponentiated.map((value) => value / total);\n }\n const total = row.reduce((sum, value) => sum + value, 0);\n return total === 0 ? [...row] : row.map((value) => value / total);\n });\n\n const numeric = this.header.class_type !== \"str\";\n const labels = probabilities.map((row) => {\n let best = 0;\n for (let index = 1; index < row.length; index += 1) {\n if ((row[index] as number) > (row[best] as number)) best = index;\n }\n const label = classes[best];\n if (label === undefined) return best;\n return numeric ? Number(label) : label;\n });\n\n return { labels, probabilities };\n }\n}\n\n/**\n * Read a source into an `ArrayBuffer`.\n *\n * @param source A URL or the bytes.\n * @param requestInit `fetch` options.\n * @returns The bytes.\n * @throws {@link ModelFetchError} when the URL cannot be read.\n */\nasync function toBuffer(\n source: string | ArrayBuffer | Uint8Array,\n requestInit?: RequestInit,\n): Promise<ArrayBuffer> {\n if (typeof source === \"string\") {\n let response: Response;\n try {\n response = await fetch(source, requestInit);\n } catch (error) {\n throw new ModelFetchError(`Could not download the model: ${source}`, {\n cause: error,\n });\n }\n if (!response.ok) {\n throw new ModelFetchError(\n `Could not download the model: ${response.status} ${response.statusText}`,\n );\n }\n return await response.arrayBuffer();\n }\n if (source instanceof Uint8Array) {\n return source.buffer.slice(\n source.byteOffset,\n source.byteOffset + source.byteLength,\n ) as ArrayBuffer;\n }\n return source;\n}\n\n/**\n * Check a batch before predicting on it.\n *\n * @param rows The batch.\n * @param expected Features the model wants per row.\n * @returns The batch width.\n * @throws {@link FeatureShapeError} when the batch cannot be predicted on.\n */\nfunction validateRows(rows: readonly FeatureRow[], expected: number): number {\n if (!Array.isArray(rows) || rows.length === 0) {\n throw new FeatureShapeError(\"predict() needs at least one row, shaped [[f1, f2, ...]].\");\n }\n const width = rows[0]?.length ?? 0;\n const ragged = rows.findIndex((row) => row.length !== width);\n if (ragged !== -1) {\n throw new FeatureShapeError(\n `All rows must have the same width; row ${ragged} has ` +\n `${rows[ragged]?.length} values, expected ${width}.`,\n );\n }\n if (width !== expected) {\n throw new FeatureShapeError(\n `The model expects ${expected} features per row, got ${width}.`,\n );\n }\n return width;\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"compact.cjs","names":[],"sources":["../../src/tabular/compact.ts"],"sourcesContent":["/**\n * @tempest-limits file-lines — the compact model format: the header, the column\n * dictionary, the quantised weights and the decoder that reads them back. Writer and\n * reader in one file because a format whose two halves live apart drifts.\n */\n/**\n * Running a model with no inference runtime at all.\n *\n * ONNX in the browser costs a **25.6 MB WebAssembly runtime** (6.0 MB\n * gzipped) before the first prediction, while the model itself is a few\n * hundred kilobytes. For an app whose only model is tabular, that runtime\n * *is* the download — so this reader replaces it with 1.49 KB of\n * arithmetic (measured, brotli).\n *\n * A linear model is a dot product. A tree is a chain of comparisons. That\n * is the whole implementation; there is nothing here that a WebAssembly\n * kernel would do better at this size.\n *\n * The file it reads (`.tmc`, magic `TMC1`) is written by\n * `tempest-fastapi-sdk`'s `export_sklearn_to_compact`, which verifies the\n * bytes against scikit-learn's own predictions and refuses to write a file\n * that disagrees. **It is data, not code**: no `eval`, no generated\n * JavaScript, nothing a strict CSP forbids.\n *\n * The trade against {@link TabularPredictor}: ONNX covers every estimator,\n * this covers linear models and tree ensembles. Pick by what your app\n * already ships — a page that loads ONNX for vision pays nothing extra for\n * tabular ONNX.\n */\n\nimport { CompactFormatError, FeatureShapeError, ModelFetchError } from \"./exceptions\";\nimport type { FeatureRow, PredictedLabel, TabularPrediction } from \"./types\";\n\n/** Magic bytes opening every compact file. */\nconst MAGIC = \"TMC1\";\n\n/** Layout version this reader understands. */\nexport const SUPPORTED_COMPACT_SCHEMA = 1;\n\n/** What the file holds. */\nexport type CompactKind = \"linear\" | \"tree_ensemble\";\n\n/** How raw scores become probabilities. */\ntype CompactLink = \"softmax\" | \"sigmoid\" | \"normalize\" | \"identity\";\n\n/** One array stored after the header. */\ninterface CompactSection {\n readonly name: string;\n readonly dtype: \"float32\" | \"int32\";\n readonly length: number;\n}\n\n/** The parsed header. */\ninterface CompactHeader {\n readonly schema_version: number;\n readonly kind: CompactKind;\n readonly task: \"classification\" | \"regression\";\n readonly link: CompactLink;\n readonly classes: readonly string[];\n /** How scikit-learn typed those labels: ``int``, ``float`` or ``str``. */\n readonly class_type?: \"int\" | \"float\" | \"str\";\n readonly n_features: number;\n readonly n_outputs: number;\n readonly n_trees?: number;\n readonly estimator: string;\n readonly feature_names: readonly string[];\n readonly preprocess: { readonly offset: number[]; readonly scale: number[] } | null;\n readonly sections: readonly CompactSection[];\n}\n\n/** What a loaded compact model is. */\nexport interface CompactPredictorInfo {\n /** Which reader path the file uses. */\n readonly kind: CompactKind;\n /** Class labels in score-column order; empty for a regressor. */\n readonly classes: readonly string[];\n /** Values expected per row. */\n readonly numFeatures: number;\n /** Column order recorded at training time, when the export had one. */\n readonly featureNames: readonly string[];\n /** Trees in the ensemble; `0` for a linear model. */\n readonly numTrees: number;\n /** Whether the model produces class scores. */\n readonly isClassifier: boolean;\n /** Class name of the exported estimator. */\n readonly estimator: string;\n}\n\n/**\n * A compact model, loaded and ready to answer.\n *\n * @example\n * ```ts\n * const predictor = await CompactPredictor.create(\"/models/risk.tmc\");\n * const { labels, probabilities } = await predictor.predict([[5.1, 3.5, 1.4, 0.2]]);\n * ```\n */\nexport class CompactPredictor {\n private constructor(\n private readonly header: CompactHeader,\n private readonly arrays: Record<string, Float32Array | Int32Array>,\n /** What is loaded. */\n public readonly info: CompactPredictorInfo,\n ) {}\n\n /**\n * Load a `.tmc` file.\n *\n * @param source A URL, or the bytes when the app already has them.\n * @param requestInit `fetch` options, when `source` is a URL.\n * @returns The loaded predictor.\n * @throws {@link ModelFetchError} when a URL cannot be read.\n * @throws {@link CompactFormatError} when the bytes are not a compact\n * model, or use a layout newer than this reader.\n */\n static async create(\n source: string | ArrayBuffer | Uint8Array,\n requestInit?: RequestInit,\n ): Promise<CompactPredictor> {\n const buffer = await toBuffer(source, requestInit);\n const bytes = new Uint8Array(buffer);\n\n if (String.fromCharCode(...bytes.subarray(0, 4)) !== MAGIC) {\n throw new CompactFormatError(\n \"This is not a compact model file: it does not start with \" +\n `\"${MAGIC}\". A .onnx file goes through TabularPredictor instead.`,\n );\n }\n\n const view = new DataView(buffer);\n const headerLength = view.getUint32(4, true);\n const header = JSON.parse(\n new TextDecoder().decode(bytes.subarray(8, 8 + headerLength)),\n ) as CompactHeader;\n\n if (header.schema_version > SUPPORTED_COMPACT_SCHEMA) {\n throw new CompactFormatError(\n `This file uses compact layout ${header.schema_version}, and this ` +\n `SDK understands ${SUPPORTED_COMPACT_SCHEMA}. Upgrade ` +\n \"tempest-react-sdk before serving it.\",\n );\n }\n\n const arrays: Record<string, Float32Array | Int32Array> = {};\n let cursor = 8 + headerLength;\n for (const section of header.sections) {\n arrays[section.name] =\n section.dtype === \"float32\"\n ? new Float32Array(buffer, cursor, section.length)\n : new Int32Array(buffer, cursor, section.length);\n cursor += section.length * 4;\n }\n\n return new CompactPredictor(header, arrays, {\n kind: header.kind,\n classes: header.classes,\n numFeatures: header.n_features,\n featureNames: header.feature_names,\n numTrees: header.n_trees ?? 0,\n isClassifier: header.task === \"classification\",\n estimator: header.estimator,\n });\n }\n\n /**\n * Predict for a batch of rows.\n *\n * @param rows One array of feature values per row, in training column\n * order. A single row is still wrapped: `[[...]]`.\n * @returns Labels, class scores when the model is a classifier, and the\n * call's duration.\n * @throws {@link FeatureShapeError} when the batch is empty, ragged, or\n * the wrong width.\n */\n async predict(rows: readonly FeatureRow[]): Promise<TabularPrediction> {\n const width = validateRows(rows, this.header.n_features);\n const started = performance.now();\n\n const scores: number[][] = [];\n for (const row of rows) {\n const prepared = this.preprocess(row, width);\n scores.push(\n this.header.kind === \"linear\"\n ? this.linearScores(prepared)\n : this.treeScores(prepared),\n );\n }\n\n const { labels, probabilities } = this.finish(scores);\n return {\n labels,\n probabilities,\n numRows: rows.length,\n ms: performance.now() - started,\n };\n }\n\n /** Releasing nothing, so callers can swap predictors without branching. */\n async dispose(): Promise<void> {\n /* no runtime, nothing to release */\n }\n\n /**\n * Apply the folded scaler, when the export had one.\n *\n * @param row The raw feature values.\n * @param width How many there are.\n * @returns The values the model was trained on.\n */\n private preprocess(row: FeatureRow, width: number): number[] {\n const preprocess = this.header.preprocess;\n if (preprocess === null) return row as number[];\n const scaled = new Array<number>(width);\n for (let index = 0; index < width; index += 1) {\n scaled[index] =\n ((row[index] as number) - (preprocess.offset[index] as number)) /\n (preprocess.scale[index] as number);\n }\n return scaled;\n }\n\n /**\n * Score one row against the coefficient matrix.\n *\n * @param row The prepared feature values.\n * @returns One raw score per output.\n */\n private linearScores(row: readonly number[]): number[] {\n const coef = this.arrays.coef as Float32Array;\n const intercept = this.arrays.intercept as Float32Array;\n const features = this.header.n_features;\n const outputs = this.header.n_outputs;\n\n const scores = new Array<number>(outputs);\n for (let output = 0; output < outputs; output += 1) {\n let total = intercept[output] as number;\n const base = output * features;\n for (let index = 0; index < features; index += 1) {\n total += (coef[base + index] as number) * (row[index] as number);\n }\n scores[output] = total;\n }\n return scores;\n }\n\n /**\n * Walk every tree and average what the leaves hold.\n *\n * A leaf is marked by a negative `feature` entry, which also carries\n * its slot in the value array — so the walk needs no second lookup and\n * the file stores values only for leaves.\n *\n * **The comparison runs in float32** (`Math.fround`), because that is\n * what scikit-learn does: it casts its input to float32 before\n * traversing, so a threshold like 5.099999904632568 — a float32 value\n * widened for storage — and an input of 5.1 compare *equal* and go\n * left. Comparing in float64 sends that row right instead, which on an\n * iris forest changed one tree's vote and moved a probability by 0.05.\n *\n * @param row The prepared feature values.\n * @returns One averaged score per output.\n */\n private treeScores(row: readonly number[]): number[] {\n const feature = this.arrays.node_feature as Int32Array;\n const threshold = this.arrays.node_threshold as Float32Array;\n const left = this.arrays.node_left as Int32Array;\n const right = this.arrays.node_right as Int32Array;\n const leaf = this.arrays.leaf_value as Float32Array;\n const offsets = this.arrays.tree_offset as Int32Array;\n const outputs = this.header.n_outputs;\n const trees = offsets.length - 1;\n\n const totals = new Array<number>(outputs).fill(0);\n for (let tree = 0; tree < trees; tree += 1) {\n let node = offsets[tree] as number;\n let column = feature[node] as number;\n while (column >= 0) {\n node =\n Math.fround(row[column] as number) <= (threshold[node] as number)\n ? (left[node] as number)\n : (right[node] as number);\n column = feature[node] as number;\n }\n const slot = (-1 - column) * outputs;\n for (let output = 0; output < outputs; output += 1) {\n totals[output] += leaf[slot + output] as number;\n }\n }\n for (let output = 0; output < outputs; output += 1) {\n totals[output] = (totals[output] as number) / trees;\n }\n return totals;\n }\n\n /**\n * Turn raw scores into labels and probabilities.\n *\n * @param scores One score array per row.\n * @returns Labels and probabilities in the shape the ONNX route uses,\n * so an app can swap runtimes without touching its own code. That\n * includes the label's **type**: an integer class comes back as a\n * number here exactly as ONNX returns it, because two routes over one\n * model that disagree on `0` versus `\"0\"` break the day someone\n * switches.\n */\n private finish(scores: readonly number[][]): {\n labels: PredictedLabel[];\n probabilities: number[][];\n } {\n const link = this.header.link;\n const classes = this.header.classes;\n\n if (link === \"identity\") {\n return { labels: scores.map((row) => row[0] as number), probabilities: [] };\n }\n\n const probabilities = scores.map((row) => {\n if (link === \"sigmoid\") {\n const positive = 1 / (1 + Math.exp(-(row[0] as number)));\n return [1 - positive, positive];\n }\n if (link === \"softmax\") {\n const highest = Math.max(...row);\n const exponentiated = row.map((value) => Math.exp(value - highest));\n const total = exponentiated.reduce((sum, value) => sum + value, 0);\n return exponentiated.map((value) => value / total);\n }\n const total = row.reduce((sum, value) => sum + value, 0);\n return total === 0 ? [...row] : row.map((value) => value / total);\n });\n\n const numeric = this.header.class_type !== \"str\";\n const labels = probabilities.map((row) => {\n let best = 0;\n for (let index = 1; index < row.length; index += 1) {\n if ((row[index] as number) > (row[best] as number)) best = index;\n }\n const label = classes[best];\n if (label === undefined) return best;\n return numeric ? Number(label) : label;\n });\n\n return { labels, probabilities };\n }\n}\n\n/**\n * Read a source into an `ArrayBuffer`.\n *\n * @param source A URL or the bytes.\n * @param requestInit `fetch` options.\n * @returns The bytes.\n * @throws {@link ModelFetchError} when the URL cannot be read.\n */\nasync function toBuffer(\n source: string | ArrayBuffer | Uint8Array,\n requestInit?: RequestInit,\n): Promise<ArrayBuffer> {\n if (typeof source === \"string\") {\n let response: Response;\n try {\n response = await fetch(source, requestInit);\n } catch (error) {\n throw new ModelFetchError(`Could not download the model: ${source}`, {\n cause: error,\n });\n }\n if (!response.ok) {\n throw new ModelFetchError(\n `Could not download the model: ${response.status} ${response.statusText}`,\n );\n }\n return await response.arrayBuffer();\n }\n if (source instanceof Uint8Array) {\n return source.buffer.slice(\n source.byteOffset,\n source.byteOffset + source.byteLength,\n ) as ArrayBuffer;\n }\n return source;\n}\n\n/**\n * Check a batch before predicting on it.\n *\n * @param rows The batch.\n * @param expected Features the model wants per row.\n * @returns The batch width.\n * @throws {@link FeatureShapeError} when the batch cannot be predicted on.\n */\nfunction validateRows(rows: readonly FeatureRow[], expected: number): number {\n if (!Array.isArray(rows) || rows.length === 0) {\n throw new FeatureShapeError(\"predict() needs at least one row, shaped [[f1, f2, ...]].\");\n }\n const width = rows[0]?.length ?? 0;\n const ragged = rows.findIndex((row) => row.length !== width);\n if (ragged !== -1) {\n throw new FeatureShapeError(\n `All rows must have the same width; row ${ragged} has ` +\n `${rows[ragged]?.length} values, expected ${width}.`,\n );\n }\n if (width !== expected) {\n throw new FeatureShapeError(\n `The model expects ${expected} features per row, got ${width}.`,\n );\n }\n return width;\n}\n"],"mappings":"oCAkCA,IAAM,EAAQ,OA+DD,EAAb,MAAa,CAAiB,CAEL,OACA,OAED,KAJpB,YACI,EACA,EAEA,EACF,CAJmB,KAAA,OAAA,EACA,KAAA,OAAA,EAED,KAAA,KAAA,CACjB,CAYH,aAAa,OACT,EACA,EACyB,CACzB,IAAM,EAAS,MAAM,EAAS,EAAQ,CAAW,EAC3C,EAAQ,IAAI,WAAW,CAAM,EAEnC,GAAI,OAAO,aAAa,GAAG,EAAM,SAAS,EAAG,CAAC,CAAC,IAAM,EACjD,MAAM,IAAI,EAAA,mBACN,6DACQ,EAAM,uDAClB,EAIJ,IAAM,EAAe,IADJ,SAAS,CACL,CAAA,CAAK,UAAU,EAAG,EAAI,EACrC,EAAS,KAAK,MAChB,IAAI,YAAY,CAAC,CAAC,OAAO,EAAM,SAAS,EAAG,EAAI,CAAY,CAAC,CAChE,EAEA,GAAI,EAAO,eAAA,EACP,MAAM,IAAI,EAAA,mBACN,iCAAiC,EAAO,eAAe,2EAG3D,EAGJ,IAAM,EAAoD,CAAC,EACvD,EAAS,EAAI,EACjB,IAAK,IAAM,KAAW,EAAO,SACzB,EAAO,EAAQ,MACX,EAAQ,QAAU,UACZ,IAAI,aAAa,EAAQ,EAAQ,EAAQ,MAAM,EAC/C,IAAI,WAAW,EAAQ,EAAQ,EAAQ,MAAM,EACvD,GAAU,EAAQ,OAAS,EAG/B,OAAO,IAAI,EAAiB,EAAQ,EAAQ,CACxC,KAAM,EAAO,KACb,QAAS,EAAO,QAChB,YAAa,EAAO,WACpB,aAAc,EAAO,cACrB,SAAU,EAAO,SAAW,EAC5B,aAAc,EAAO,OAAS,iBAC9B,UAAW,EAAO,SACtB,CAAC,CACL,CAYA,MAAM,QAAQ,EAAyD,CACnE,IAAM,EAAQ,EAAa,EAAM,KAAK,OAAO,UAAU,EACjD,EAAU,YAAY,IAAI,EAE1B,EAAqB,CAAC,EAC5B,IAAK,IAAM,KAAO,EAAM,CACpB,IAAM,EAAW,KAAK,WAAW,EAAK,CAAK,EAC3C,EAAO,KACH,KAAK,OAAO,OAAS,SACf,KAAK,aAAa,CAAQ,EAC1B,KAAK,WAAW,CAAQ,CAClC,CACJ,CAEA,GAAM,CAAE,SAAQ,iBAAkB,KAAK,OAAO,CAAM,EACpD,MAAO,CACH,SACA,gBACA,QAAS,EAAK,OACd,GAAI,YAAY,IAAI,EAAI,CAC5B,CACJ,CAGA,MAAM,SAAyB,CAE/B,CASA,WAAmB,EAAiB,EAAyB,CACzD,IAAM,EAAa,KAAK,OAAO,WAC/B,GAAI,IAAe,KAAM,OAAO,EAChC,IAAM,EAAa,MAAc,CAAK,EACtC,IAAK,IAAI,EAAQ,EAAG,EAAQ,EAAO,GAAS,EACxC,EAAO,IACD,EAAI,GAAqB,EAAW,OAAO,IAC5C,EAAW,MAAM,GAE1B,OAAO,CACX,CAQA,aAAqB,EAAkC,CACnD,IAAM,EAAO,KAAK,OAAO,KACnB,EAAY,KAAK,OAAO,UACxB,EAAW,KAAK,OAAO,WACvB,EAAU,KAAK,OAAO,UAEtB,EAAa,MAAc,CAAO,EACxC,IAAK,IAAI,EAAS,EAAG,EAAS,EAAS,GAAU,EAAG,CAChD,IAAI,EAAQ,EAAU,GAChB,EAAO,EAAS,EACtB,IAAK,IAAI,EAAQ,EAAG,EAAQ,EAAU,GAAS,EAC3C,GAAU,EAAK,EAAO,GAAqB,EAAI,GAEnD,EAAO,GAAU,CACrB,CACA,OAAO,CACX,CAmBA,WAAmB,EAAkC,CACjD,IAAM,EAAU,KAAK,OAAO,aACtB,EAAY,KAAK,OAAO,eACxB,EAAO,KAAK,OAAO,UACnB,EAAQ,KAAK,OAAO,WACpB,EAAO,KAAK,OAAO,WACnB,EAAU,KAAK,OAAO,YACtB,EAAU,KAAK,OAAO,UACtB,EAAQ,EAAQ,OAAS,EAEzB,EAAa,MAAc,CAAO,CAAC,CAAC,KAAK,CAAC,EAChD,IAAK,IAAI,EAAO,EAAG,EAAO,EAAO,GAAQ,EAAG,CACxC,IAAI,EAAO,EAAQ,GACf,EAAS,EAAQ,GACrB,KAAO,GAAU,GACb,EACI,KAAK,OAAO,EAAI,EAAiB,GAAM,EAAU,GAC1C,EAAK,GACL,EAAM,GACjB,EAAS,EAAQ,GAErB,IAAM,GAAQ,GAAK,GAAU,EAC7B,IAAK,IAAI,EAAS,EAAG,EAAS,EAAS,GAAU,EAC7C,EAAO,IAAW,EAAK,EAAO,EAEtC,CACA,IAAK,IAAI,EAAS,EAAG,EAAS,EAAS,GAAU,EAC7C,EAAO,GAAW,EAAO,GAAqB,EAElD,OAAO,CACX,CAaA,OAAe,EAGb,CACE,IAAM,EAAO,KAAK,OAAO,KACnB,EAAU,KAAK,OAAO,QAE5B,GAAI,IAAS,WACT,MAAO,CAAE,OAAQ,EAAO,IAAK,GAAQ,EAAI,EAAY,EAAG,cAAe,CAAC,CAAE,EAG9E,IAAM,EAAgB,EAAO,IAAK,GAAQ,CACtC,GAAI,IAAS,UAAW,CACpB,IAAM,EAAW,GAAK,EAAI,KAAK,IAAI,CAAE,EAAI,EAAa,GACtD,MAAO,CAAC,EAAI,EAAU,CAAQ,CAClC,CACA,GAAI,IAAS,UAAW,CACpB,IAAM,EAAU,KAAK,IAAI,GAAG,CAAG,EACzB,EAAgB,EAAI,IAAK,GAAU,KAAK,IAAI,EAAQ,CAAO,CAAC,EAC5D,EAAQ,EAAc,QAAQ,EAAK,IAAU,EAAM,EAAO,CAAC,EACjE,OAAO,EAAc,IAAK,GAAU,EAAQ,CAAK,CACrD,CACA,IAAM,EAAQ,EAAI,QAAQ,EAAK,IAAU,EAAM,EAAO,CAAC,EACvD,OAAO,IAAU,EAAI,CAAC,GAAG,CAAG,EAAI,EAAI,IAAK,GAAU,EAAQ,CAAK,CACpE,CAAC,EAEK,EAAU,KAAK,OAAO,aAAe,MAW3C,MAAO,CAAE,OAVM,EAAc,IAAK,GAAQ,CACtC,IAAI,EAAO,EACX,IAAK,IAAI,EAAQ,EAAG,EAAQ,EAAI,OAAQ,GAAS,EACxC,EAAI,GAAqB,EAAI,KAAkB,EAAO,GAE/D,IAAM,EAAQ,EAAQ,GAEtB,OADI,IAAU,IAAA,GAAkB,EACzB,EAAU,OAAO,CAAK,EAAI,CACrC,CAES,EAAQ,eAAc,CACnC,CACJ,EAUA,eAAe,EACX,EACA,EACoB,CACpB,GAAI,OAAO,GAAW,SAAU,CAC5B,IAAI,EACJ,GAAI,CACA,EAAW,MAAM,MAAM,EAAQ,CAAW,CAC9C,OAAS,EAAO,CACZ,MAAM,IAAI,EAAA,gBAAgB,iCAAiC,IAAU,CACjE,MAAO,CACX,CAAC,CACL,CACA,GAAI,CAAC,EAAS,GACV,MAAM,IAAI,EAAA,gBACN,iCAAiC,EAAS,OAAO,GAAG,EAAS,YACjE,EAEJ,OAAO,MAAM,EAAS,YAAY,CACtC,CAOA,OANI,aAAkB,WACX,EAAO,OAAO,MACjB,EAAO,WACP,EAAO,WAAa,EAAO,UAC/B,EAEG,CACX,CAUA,SAAS,EAAa,EAA6B,EAA0B,CACzE,GAAI,CAAC,MAAM,QAAQ,CAAI,GAAK,EAAK,SAAW,EACxC,MAAM,IAAI,EAAA,kBAAkB,2DAA2D,EAE3F,IAAM,EAAQ,EAAK,EAAE,EAAE,QAAU,EAC3B,EAAS,EAAK,UAAW,GAAQ,EAAI,SAAW,CAAK,EAC3D,GAAI,IAAW,GACX,MAAM,IAAI,EAAA,kBACN,0CAA0C,EAAO,OAC1C,EAAK,EAAO,EAAE,OAAO,oBAAoB,EAAM,EAC1D,EAEJ,GAAI,IAAU,EACV,MAAM,IAAI,EAAA,kBACN,qBAAqB,EAAS,yBAAyB,EAAM,EACjE,EAEJ,OAAO,CACX"}
@@ -1,6 +1,6 @@
1
1
  import { CompactFormatError as e, FeatureShapeError as t, ModelFetchError as n } from "./exceptions.js";
2
2
  //#region src/tabular/compact.ts
3
- var r = "TMC1", i = 1, a = class t {
3
+ var r = "TMC1", i = class t {
4
4
  header;
5
5
  arrays;
6
6
  info;
@@ -8,12 +8,12 @@ var r = "TMC1", i = 1, a = class t {
8
8
  this.header = e, this.arrays = t, this.info = n;
9
9
  }
10
10
  static async create(n, i) {
11
- let a = await o(n, i), s = new Uint8Array(a);
11
+ let o = await a(n, i), s = new Uint8Array(o);
12
12
  if (String.fromCharCode(...s.subarray(0, 4)) !== r) throw new e(`This is not a compact model file: it does not start with "${r}". A .onnx file goes through TabularPredictor instead.`);
13
- let c = new DataView(a).getUint32(4, !0), l = JSON.parse(new TextDecoder().decode(s.subarray(8, 8 + c)));
13
+ let c = new DataView(o).getUint32(4, !0), l = JSON.parse(new TextDecoder().decode(s.subarray(8, 8 + c)));
14
14
  if (l.schema_version > 1) throw new e(`This file uses compact layout ${l.schema_version}, and this SDK understands 1. Upgrade tempest-react-sdk before serving it.`);
15
15
  let u = {}, d = 8 + c;
16
- for (let e of l.sections) u[e.name] = e.dtype === "float32" ? new Float32Array(a, d, e.length) : new Int32Array(a, d, e.length), d += e.length * 4;
16
+ for (let e of l.sections) u[e.name] = e.dtype === "float32" ? new Float32Array(o, d, e.length) : new Int32Array(o, d, e.length), d += e.length * 4;
17
17
  return new t(l, u, {
18
18
  kind: l.kind,
19
19
  classes: l.classes,
@@ -25,7 +25,7 @@ var r = "TMC1", i = 1, a = class t {
25
25
  });
26
26
  }
27
27
  async predict(e) {
28
- let t = s(e, this.header.n_features), n = performance.now(), r = [];
28
+ let t = o(e, this.header.n_features), n = performance.now(), r = [];
29
29
  for (let n of e) {
30
30
  let e = this.preprocess(n, t);
31
31
  r.push(this.header.kind === "linear" ? this.linearScores(e) : this.treeScores(e));
@@ -95,7 +95,7 @@ var r = "TMC1", i = 1, a = class t {
95
95
  };
96
96
  }
97
97
  };
98
- async function o(e, t) {
98
+ async function a(e, t) {
99
99
  if (typeof e == "string") {
100
100
  let r;
101
101
  try {
@@ -108,7 +108,7 @@ async function o(e, t) {
108
108
  }
109
109
  return e instanceof Uint8Array ? e.buffer.slice(e.byteOffset, e.byteOffset + e.byteLength) : e;
110
110
  }
111
- function s(e, n) {
111
+ function o(e, n) {
112
112
  if (!Array.isArray(e) || e.length === 0) throw new t("predict() needs at least one row, shaped [[f1, f2, ...]].");
113
113
  let r = e[0]?.length ?? 0, i = e.findIndex((e) => e.length !== r);
114
114
  if (i !== -1) throw new t(`All rows must have the same width; row ${i} has ${e[i]?.length} values, expected ${r}.`);
@@ -116,6 +116,6 @@ function s(e, n) {
116
116
  return r;
117
117
  }
118
118
  //#endregion
119
- export { a as CompactPredictor, i as SUPPORTED_COMPACT_SCHEMA };
119
+ export { i as CompactPredictor };
120
120
 
121
121
  //# sourceMappingURL=compact.js.map