create-tauri-ui 0.2.1 → 0.3.1

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 (265) hide show
  1. package/README.md +19 -10
  2. package/dist/index.mjs +26 -26
  3. package/package.json +55 -54
  4. package/templates/.shared/app-icon.png +0 -0
  5. package/templates/.shared/src-tauri/Cargo.lock +3832 -3701
  6. package/templates/.shared/src-tauri/Cargo.toml +4 -1
  7. package/templates/.shared/src-tauri/src/main.rs +3 -0
  8. package/templates/.shared/src-tauri/tauri.conf.json +1 -9
  9. package/templates/next/components.json +1 -1
  10. package/templates/next/package.json +87 -83
  11. package/templates/next/pnpm-lock.yaml +608 -566
  12. package/templates/next/src/app/examples/cards/components/date-picker.tsx +3 -1
  13. package/templates/next/src/app/examples/cards/components/github-card.tsx +2 -0
  14. package/templates/next/src/app/examples/cards/components/notifications.tsx +2 -0
  15. package/templates/next/src/app/examples/cards/components/payment-method.tsx +3 -1
  16. package/templates/next/src/app/examples/cards/components/team-members.tsx +3 -5
  17. package/templates/next/src/app/examples/forms/page.tsx +1 -1
  18. package/templates/next/src/assets/Inter-VariableFont_slnt,wght.ttf +0 -0
  19. package/templates/next/src/components/about-dialog.tsx +111 -0
  20. package/templates/next/src/components/icons.tsx +156 -154
  21. package/templates/next/src/components/menu-mode-toggle.tsx +47 -46
  22. package/templates/next/src/components/menu.tsx +178 -214
  23. package/templates/next/src/components/page-header.tsx +2 -0
  24. package/templates/next/src/components/ui/accordion.tsx +60 -60
  25. package/templates/next/src/components/ui/alert-dialog.tsx +145 -145
  26. package/templates/next/src/components/ui/alert.tsx +59 -59
  27. package/templates/next/src/components/ui/aspect-ratio.tsx +7 -7
  28. package/templates/next/src/components/ui/avatar.tsx +50 -50
  29. package/templates/next/src/components/ui/badge.tsx +36 -36
  30. package/templates/next/src/components/ui/button.tsx +56 -56
  31. package/templates/next/src/components/ui/calendar.tsx +64 -64
  32. package/templates/next/src/components/ui/card.tsx +79 -79
  33. package/templates/next/src/components/ui/checkbox.tsx +30 -30
  34. package/templates/next/src/components/ui/collapsible.tsx +11 -11
  35. package/templates/next/src/components/ui/command.tsx +155 -155
  36. package/templates/next/src/components/ui/context-menu.tsx +200 -200
  37. package/templates/next/src/components/ui/dialog.tsx +123 -123
  38. package/templates/next/src/components/ui/dropdown-menu.tsx +200 -200
  39. package/templates/next/src/components/ui/form.tsx +176 -176
  40. package/templates/next/src/components/ui/hover-card.tsx +29 -29
  41. package/templates/next/src/components/ui/input.tsx +25 -25
  42. package/templates/next/src/components/ui/label.tsx +26 -26
  43. package/templates/next/src/components/ui/menubar.tsx +236 -236
  44. package/templates/next/src/components/ui/navigation-menu.tsx +128 -128
  45. package/templates/next/src/components/ui/popover.tsx +31 -31
  46. package/templates/next/src/components/ui/progress.tsx +28 -28
  47. package/templates/next/src/components/ui/radio-group.tsx +44 -44
  48. package/templates/next/src/components/ui/scroll-area.tsx +48 -48
  49. package/templates/next/src/components/ui/select.tsx +121 -121
  50. package/templates/next/src/components/ui/separator.tsx +31 -31
  51. package/templates/next/src/components/ui/sheet.tsx +144 -144
  52. package/templates/next/src/components/ui/skeleton.tsx +15 -15
  53. package/templates/next/src/components/ui/slider.tsx +28 -28
  54. package/templates/next/src/components/ui/switch.tsx +29 -29
  55. package/templates/next/src/components/ui/table.tsx +114 -114
  56. package/templates/next/src/components/ui/tabs.tsx +55 -55
  57. package/templates/next/src/components/ui/textarea.tsx +24 -24
  58. package/templates/next/src/components/ui/toast.tsx +127 -127
  59. package/templates/next/src/components/ui/toaster.tsx +35 -35
  60. package/templates/next/src/components/ui/toggle.tsx +45 -45
  61. package/templates/next/src/components/ui/tooltip.tsx +30 -30
  62. package/templates/next/src/components/ui/use-toast.ts +192 -192
  63. package/templates/next/src/styles/globals.css +5 -3
  64. package/templates/next/src-tauri/Cargo.lock +270 -139
  65. package/templates/next/src-tauri/Cargo.toml +39 -36
  66. package/templates/next/src-tauri/src/main.rs +22 -19
  67. package/templates/next/src-tauri/tauri.conf.json +1 -9
  68. package/templates/sveltekit/.github/workflows/release.yml +108 -108
  69. package/templates/sveltekit/package.json +85 -84
  70. package/templates/sveltekit/pnpm-lock.yaml +1543 -2703
  71. package/templates/sveltekit/src/app.html +1 -1
  72. package/templates/sveltekit/src/routes/+layout.svelte +4 -3
  73. package/templates/sveltekit/src-tauri/Cargo.lock +3832 -3701
  74. package/templates/sveltekit/src-tauri/Cargo.toml +39 -36
  75. package/templates/sveltekit/src-tauri/src/main.rs +8 -2
  76. package/templates/sveltekit/src-tauri/tauri.conf.json +71 -79
  77. package/templates/sveltekit/static/favicon.ico +0 -0
  78. package/templates/sveltekit/vite.config.js +10 -6
  79. package/templates/vite/index.html +1 -1
  80. package/templates/vite/package.json +83 -76
  81. package/templates/vite/pnpm-lock.yaml +5178 -5110
  82. package/templates/vite/src/assets/Inter-VariableFont_slnt,wght.ttf +0 -0
  83. package/templates/vite/src/components/about-dialog.tsx +101 -0
  84. package/templates/vite/src/components/icons.tsx +2 -2
  85. package/templates/vite/src/components/menu-mode-toggle.tsx +4 -3
  86. package/templates/vite/src/components/menu.tsx +177 -197
  87. package/templates/vite/src/components/ui/accordion.tsx +1 -3
  88. package/templates/vite/src/components/ui/alert-dialog.tsx +3 -10
  89. package/templates/vite/src/components/ui/alert.tsx +3 -5
  90. package/templates/vite/src/components/ui/aspect-ratio.tsx +0 -2
  91. package/templates/vite/src/components/ui/avatar.tsx +0 -2
  92. package/templates/vite/src/components/ui/badge.tsx +5 -5
  93. package/templates/vite/src/components/ui/button.tsx +15 -10
  94. package/templates/vite/src/components/ui/calendar.tsx +0 -2
  95. package/templates/vite/src/components/ui/card.tsx +1 -3
  96. package/templates/vite/src/components/ui/checkbox.tsx +2 -4
  97. package/templates/vite/src/components/ui/collapsible.tsx +0 -2
  98. package/templates/vite/src/components/ui/command.tsx +2 -4
  99. package/templates/vite/src/components/ui/context-menu.tsx +6 -8
  100. package/templates/vite/src/components/ui/dialog.tsx +4 -11
  101. package/templates/vite/src/components/ui/dropdown-menu.tsx +6 -8
  102. package/templates/vite/src/components/ui/form.tsx +176 -0
  103. package/templates/vite/src/components/ui/hover-card.tsx +1 -3
  104. package/templates/vite/src/components/ui/input.tsx +1 -3
  105. package/templates/vite/src/components/ui/label.tsx +1 -3
  106. package/templates/vite/src/components/ui/menubar.tsx +7 -9
  107. package/templates/vite/src/components/ui/navigation-menu.tsx +2 -4
  108. package/templates/vite/src/components/ui/popover.tsx +1 -3
  109. package/templates/vite/src/components/ui/progress.tsx +0 -2
  110. package/templates/vite/src/components/ui/radio-group.tsx +2 -4
  111. package/templates/vite/src/components/ui/scroll-area.tsx +0 -2
  112. package/templates/vite/src/components/ui/select.tsx +4 -5
  113. package/templates/vite/src/components/ui/separator.tsx +0 -2
  114. package/templates/vite/src/components/ui/sheet.tsx +22 -110
  115. package/templates/vite/src/components/ui/skeleton.tsx +0 -2
  116. package/templates/vite/src/components/ui/slider.tsx +0 -2
  117. package/templates/vite/src/components/ui/switch.tsx +1 -3
  118. package/templates/vite/src/components/ui/table.tsx +1 -1
  119. package/templates/vite/src/components/ui/tabs.tsx +1 -3
  120. package/templates/vite/src/components/ui/textarea.tsx +1 -3
  121. package/templates/vite/src/components/ui/toast.tsx +6 -8
  122. package/templates/vite/src/components/ui/toaster.tsx +0 -2
  123. package/templates/vite/src/components/ui/toggle.tsx +3 -5
  124. package/templates/vite/src/components/ui/tooltip.tsx +1 -3
  125. package/templates/vite/src/components/ui/use-toast.ts +5 -4
  126. package/templates/vite/src/styles/globals.css +5 -3
  127. package/templates/vite/src-tauri/Cargo.lock +3832 -3701
  128. package/templates/vite/src-tauri/Cargo.toml +39 -36
  129. package/templates/vite/src-tauri/src/main.rs +8 -2
  130. package/templates/vite/src-tauri/tauri.conf.json +1 -9
  131. package/templates/vite/vite.config.ts +2 -2
  132. package/templates/next/src/assets/Inter.var.woff2 +0 -0
  133. package/templates/vite/src/assets/Inter.var.woff2 +0 -0
  134. package/templates/viteuno/.github/workflows/release.yml +0 -108
  135. package/templates/viteuno/.vscode/extensions.json +0 -3
  136. package/templates/viteuno/README.md +0 -1
  137. package/templates/viteuno/app-icon.png +0 -0
  138. package/templates/viteuno/components.json +0 -16
  139. package/templates/viteuno/index.html +0 -16
  140. package/templates/viteuno/package.json +0 -73
  141. package/templates/viteuno/pnpm-lock.yaml +0 -5298
  142. package/templates/viteuno/preset.shadcn.ts +0 -160
  143. package/templates/viteuno/prettier.config.cjs +0 -34
  144. package/templates/viteuno/public/avatars/01.png +0 -0
  145. package/templates/viteuno/public/avatars/02.png +0 -0
  146. package/templates/viteuno/public/avatars/03.png +0 -0
  147. package/templates/viteuno/public/avatars/04.png +0 -0
  148. package/templates/viteuno/public/avatars/05.png +0 -0
  149. package/templates/viteuno/src/App.tsx +0 -39
  150. package/templates/viteuno/src/assets/Inter.var.woff2 +0 -0
  151. package/templates/viteuno/src/components/icons.tsx +0 -154
  152. package/templates/viteuno/src/components/menu-mode-toggle.tsx +0 -46
  153. package/templates/viteuno/src/components/menu.tsx +0 -232
  154. package/templates/viteuno/src/components/tailwind-indicator.tsx +0 -18
  155. package/templates/viteuno/src/components/theme-provider.tsx +0 -9
  156. package/templates/viteuno/src/components/ui/accordion.tsx +0 -60
  157. package/templates/viteuno/src/components/ui/alert-dialog.tsx +0 -150
  158. package/templates/viteuno/src/components/ui/alert.tsx +0 -61
  159. package/templates/viteuno/src/components/ui/aspect-ratio.tsx +0 -7
  160. package/templates/viteuno/src/components/ui/avatar.tsx +0 -50
  161. package/templates/viteuno/src/components/ui/badge.tsx +0 -36
  162. package/templates/viteuno/src/components/ui/button.tsx +0 -51
  163. package/templates/viteuno/src/components/ui/calendar.tsx +0 -64
  164. package/templates/viteuno/src/components/ui/card.tsx +0 -81
  165. package/templates/viteuno/src/components/ui/checkbox.tsx +0 -30
  166. package/templates/viteuno/src/components/ui/collapsible.tsx +0 -11
  167. package/templates/viteuno/src/components/ui/command.tsx +0 -155
  168. package/templates/viteuno/src/components/ui/context-menu.tsx +0 -200
  169. package/templates/viteuno/src/components/ui/dialog.tsx +0 -128
  170. package/templates/viteuno/src/components/ui/dropdown-menu.tsx +0 -200
  171. package/templates/viteuno/src/components/ui/hover-card.tsx +0 -29
  172. package/templates/viteuno/src/components/ui/index.ts +0 -0
  173. package/templates/viteuno/src/components/ui/input.tsx +0 -27
  174. package/templates/viteuno/src/components/ui/label.tsx +0 -26
  175. package/templates/viteuno/src/components/ui/menubar.tsx +0 -236
  176. package/templates/viteuno/src/components/ui/navigation-menu.tsx +0 -130
  177. package/templates/viteuno/src/components/ui/popover.tsx +0 -31
  178. package/templates/viteuno/src/components/ui/progress.tsx +0 -28
  179. package/templates/viteuno/src/components/ui/radio-group.tsx +0 -44
  180. package/templates/viteuno/src/components/ui/scroll-area.tsx +0 -48
  181. package/templates/viteuno/src/components/ui/select.tsx +0 -120
  182. package/templates/viteuno/src/components/ui/separator.tsx +0 -31
  183. package/templates/viteuno/src/components/ui/sheet.tsx +0 -230
  184. package/templates/viteuno/src/components/ui/skeleton.tsx +0 -17
  185. package/templates/viteuno/src/components/ui/slider.tsx +0 -28
  186. package/templates/viteuno/src/components/ui/switch.tsx +0 -29
  187. package/templates/viteuno/src/components/ui/table.tsx +0 -114
  188. package/templates/viteuno/src/components/ui/tabs.tsx +0 -55
  189. package/templates/viteuno/src/components/ui/textarea.tsx +0 -26
  190. package/templates/viteuno/src/components/ui/toast.tsx +0 -129
  191. package/templates/viteuno/src/components/ui/toaster.tsx +0 -35
  192. package/templates/viteuno/src/components/ui/toggle.tsx +0 -45
  193. package/templates/viteuno/src/components/ui/tooltip.tsx +0 -30
  194. package/templates/viteuno/src/components/ui/use-toast.ts +0 -191
  195. package/templates/viteuno/src/dashboard/components/date-range-picker.tsx +0 -66
  196. package/templates/viteuno/src/dashboard/components/main-nav.tsx +0 -38
  197. package/templates/viteuno/src/dashboard/components/overview.tsx +0 -78
  198. package/templates/viteuno/src/dashboard/components/recent-sales.tsx +0 -67
  199. package/templates/viteuno/src/dashboard/components/search.tsx +0 -13
  200. package/templates/viteuno/src/dashboard/components/team-switcher.tsx +0 -205
  201. package/templates/viteuno/src/dashboard/components/user-nav.tsx +0 -67
  202. package/templates/viteuno/src/dashboard/page.tsx +0 -140
  203. package/templates/viteuno/src/lib/utils.ts +0 -19
  204. package/templates/viteuno/src/main.tsx +0 -14
  205. package/templates/viteuno/src/styles/globals.css +0 -4
  206. package/templates/viteuno/src/vite-env.d.ts +0 -1
  207. package/templates/viteuno/src-tauri/Cargo.lock +0 -3701
  208. package/templates/viteuno/src-tauri/Cargo.toml +0 -36
  209. package/templates/viteuno/src-tauri/build.rs +0 -3
  210. package/templates/viteuno/src-tauri/icons/128x128.png +0 -0
  211. package/templates/viteuno/src-tauri/icons/128x128@2x.png +0 -0
  212. package/templates/viteuno/src-tauri/icons/32x32.png +0 -0
  213. package/templates/viteuno/src-tauri/icons/Square107x107Logo.png +0 -0
  214. package/templates/viteuno/src-tauri/icons/Square142x142Logo.png +0 -0
  215. package/templates/viteuno/src-tauri/icons/Square150x150Logo.png +0 -0
  216. package/templates/viteuno/src-tauri/icons/Square284x284Logo.png +0 -0
  217. package/templates/viteuno/src-tauri/icons/Square30x30Logo.png +0 -0
  218. package/templates/viteuno/src-tauri/icons/Square310x310Logo.png +0 -0
  219. package/templates/viteuno/src-tauri/icons/Square44x44Logo.png +0 -0
  220. package/templates/viteuno/src-tauri/icons/Square71x71Logo.png +0 -0
  221. package/templates/viteuno/src-tauri/icons/Square89x89Logo.png +0 -0
  222. package/templates/viteuno/src-tauri/icons/StoreLogo.png +0 -0
  223. package/templates/viteuno/src-tauri/icons/android/mipmap-hdpi/ic_launcher.png +0 -0
  224. package/templates/viteuno/src-tauri/icons/android/mipmap-hdpi/ic_launcher_foreground.png +0 -0
  225. package/templates/viteuno/src-tauri/icons/android/mipmap-hdpi/ic_launcher_round.png +0 -0
  226. package/templates/viteuno/src-tauri/icons/android/mipmap-mdpi/ic_launcher.png +0 -0
  227. package/templates/viteuno/src-tauri/icons/android/mipmap-mdpi/ic_launcher_foreground.png +0 -0
  228. package/templates/viteuno/src-tauri/icons/android/mipmap-mdpi/ic_launcher_round.png +0 -0
  229. package/templates/viteuno/src-tauri/icons/android/mipmap-xhdpi/ic_launcher.png +0 -0
  230. package/templates/viteuno/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_foreground.png +0 -0
  231. package/templates/viteuno/src-tauri/icons/android/mipmap-xhdpi/ic_launcher_round.png +0 -0
  232. package/templates/viteuno/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher.png +0 -0
  233. package/templates/viteuno/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_foreground.png +0 -0
  234. package/templates/viteuno/src-tauri/icons/android/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  235. package/templates/viteuno/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher.png +0 -0
  236. package/templates/viteuno/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_foreground.png +0 -0
  237. package/templates/viteuno/src-tauri/icons/android/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  238. package/templates/viteuno/src-tauri/icons/icon.icns +0 -0
  239. package/templates/viteuno/src-tauri/icons/icon.ico +0 -0
  240. package/templates/viteuno/src-tauri/icons/icon.png +0 -0
  241. package/templates/viteuno/src-tauri/icons/ios/AppIcon-20x20@1x.png +0 -0
  242. package/templates/viteuno/src-tauri/icons/ios/AppIcon-20x20@2x-1.png +0 -0
  243. package/templates/viteuno/src-tauri/icons/ios/AppIcon-20x20@2x.png +0 -0
  244. package/templates/viteuno/src-tauri/icons/ios/AppIcon-20x20@3x.png +0 -0
  245. package/templates/viteuno/src-tauri/icons/ios/AppIcon-29x29@1x.png +0 -0
  246. package/templates/viteuno/src-tauri/icons/ios/AppIcon-29x29@2x-1.png +0 -0
  247. package/templates/viteuno/src-tauri/icons/ios/AppIcon-29x29@2x.png +0 -0
  248. package/templates/viteuno/src-tauri/icons/ios/AppIcon-29x29@3x.png +0 -0
  249. package/templates/viteuno/src-tauri/icons/ios/AppIcon-40x40@1x.png +0 -0
  250. package/templates/viteuno/src-tauri/icons/ios/AppIcon-40x40@2x-1.png +0 -0
  251. package/templates/viteuno/src-tauri/icons/ios/AppIcon-40x40@2x.png +0 -0
  252. package/templates/viteuno/src-tauri/icons/ios/AppIcon-40x40@3x.png +0 -0
  253. package/templates/viteuno/src-tauri/icons/ios/AppIcon-512@2x.png +0 -0
  254. package/templates/viteuno/src-tauri/icons/ios/AppIcon-60x60@2x.png +0 -0
  255. package/templates/viteuno/src-tauri/icons/ios/AppIcon-60x60@3x.png +0 -0
  256. package/templates/viteuno/src-tauri/icons/ios/AppIcon-76x76@1x.png +0 -0
  257. package/templates/viteuno/src-tauri/icons/ios/AppIcon-76x76@2x.png +0 -0
  258. package/templates/viteuno/src-tauri/icons/ios/AppIcon-83.5x83.5@2x.png +0 -0
  259. package/templates/viteuno/src-tauri/src/main.rs +0 -16
  260. package/templates/viteuno/src-tauri/tauri.conf.json +0 -79
  261. package/templates/viteuno/tsconfig.json +0 -26
  262. package/templates/viteuno/tsconfig.node.json +0 -9
  263. package/templates/viteuno/uno.config.ts +0 -111
  264. package/templates/viteuno/vite.config.ts +0 -33
  265. /package/templates/next/src/app/examples/forms/{profile-form.tsx → components/profile-form.tsx} +0 -0
package/README.md CHANGED
@@ -40,7 +40,7 @@ pnpm create tauri-ui my-tauri-app --template sveltekit
40
40
 
41
41
  </details>
42
42
 
43
- ![cli](https://github.com/agmmnn/tauri-ui/assets/16024979/e678e09b-37ac-4281-95ef-fdca63e5742d)
43
+ ![cli](https://github.com/agmmnn/tauri-ui/assets/16024979/86bf3b81-8671-4de3-bb48-7fb24fe48802)
44
44
  You can use `.` for the project name to scaffold in the current directory.
45
45
 
46
46
  <details>
@@ -62,20 +62,30 @@ pnpm tauri build
62
62
 
63
63
  ## Features
64
64
 
65
- - Support for dark and light modes
66
- - Components-based UI design
67
- - A draggable titlebar with minimize, maximize, and close buttons
68
- - [Radix UI](https://www.radix-ui.com/) for UI primitives
69
- - [Lucide Icons](https://lucide.dev/)
70
- - [Bundle size optimized](https://github.com/johnthagen/min-sized-rust) [`Cargo.toml`](/src-tauri/Cargo.toml) (.msi 2.2mb, .dmg 1.9mb, .deb 2mb)
71
- - [Tauri GitHub Action](https://github.com/tauri-apps/tauri-action) Cross-Platform release
65
+ - Components-based UI design with [shadcn/ui](https://ui.shadcn.com/). [Radix UI](https://www.radix-ui.com/) for UI primitives.
66
+ - Native-looking window controls with [tauri-controls](https://github.com/agmmnn/tauri-controls).
67
+ - Support for dark and light modes.
68
+ - [Lucide Icons](https://lucide.dev/), [Radix Icons](https://icons.radix-ui.com/).
69
+ - [Bundle size optimized](https://github.com/johnthagen/min-sized-rust) [`Cargo.toml`](/src-tauri/Cargo.toml) (.msi 2.5mb, .dmg 1.9mb, .deb 2mb)
70
+ - [Tauri GitHub Action](https://github.com/tauri-apps/tauri-action), Cross-platform releases.
72
71
 
73
72
  ![tauri-ui](https://user-images.githubusercontent.com/16024979/232823230-19d22434-8e28-43c2-bb70-e45a2fc2da88.gif)
74
73
 
75
74
  ## Update Components
76
75
 
76
+ ### shadcn/ui
77
+
78
+ Update all components:
79
+
80
+ ```bash
81
+ npx shadcn-ui@latest add --overwrite
82
+ # press "a" to select all components
77
83
  ```
78
- npx shadcn-ui@latest add [component] --overwrite
84
+
85
+ Update a specific component:
86
+
87
+ ```bash
88
+ npx shadcn-ui@latest add dialog --overwrite
79
89
  ```
80
90
 
81
91
  ## Acknowledgements
@@ -85,4 +95,3 @@ This project utilizes code from the following repository:
85
95
  - [vitejs/create-vite](https://github.com/vitejs/vite/blob/main/packages/create-vite) - Used in _[create-tauri-ui](https://www.npmjs.com/package/create-tauri-ui)_
86
96
  - [shadcn/ui](https://github.com/shadcn/ui/tree/main/apps/www) - Used in _[Next.js](https://github.com/vercel/next.js/)_ and _[Vite](https://github.com/vitejs/vite)_ templates
87
97
  - [huntabyte/shadcn-svelte](https://github.com/huntabyte/shadcn-svelte) - Used in _[SvelteKit](https://github.com/sveltejs/svelte)_ template
88
- - [fisand/uno-shadcn-ui](https://github.com/fisand/uno-shadcn-ui) - Used in _[Vite](https://github.com/vitejs/vite)+[UnoCSS](https://github.com/unocss/unocss)_ template
package/dist/index.mjs CHANGED
@@ -1,41 +1,41 @@
1
- import x from"node:fs";import S from"node:path";import{fileURLToPath as $t}from"node:url";import le from"readline";import T from"sisteransi";import he from"events";function xt(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function ae(s,t){var e=s;t.slice(0,-1).forEach(function(n){e=e[n]||{}});var i=t[t.length-1];return i in e}function St(s){return typeof s=="number"||/^0x[0-9a-f]+$/i.test(s)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(s)}function Ot(s,t){return t==="constructor"&&typeof s[t]=="function"||t==="__proto__"}var ue=function(s,t){t||(t={});var e={bools:{},strings:{},unknownFn:null};typeof t.unknown=="function"&&(e.unknownFn=t.unknown),typeof t.boolean=="boolean"&&t.boolean?e.allBools=!0:[].concat(t.boolean).filter(Boolean).forEach(function(u){e.bools[u]=!0});var i={};function n(u){return i[u].some(function(w){return e.bools[w]})}Object.keys(t.alias||{}).forEach(function(u){i[u]=[].concat(t.alias[u]),i[u].forEach(function(w){i[w]=[u].concat(i[u].filter(function(P){return w!==P}))})}),[].concat(t.string).filter(Boolean).forEach(function(u){e.strings[u]=!0,i[u]&&[].concat(i[u]).forEach(function(w){e.strings[w]=!0})});var o=t.default||{},r={_:[]};function l(u,w){return e.allBools&&/^--[^=]+$/.test(w)||e.strings[u]||e.bools[u]||i[u]}function b(u,w,P){for(var f=u,_=0;_<w.length-1;_++){var d=w[_];if(Ot(f,d))return;f[d]===void 0&&(f[d]={}),(f[d]===Object.prototype||f[d]===Number.prototype||f[d]===String.prototype)&&(f[d]={}),f[d]===Array.prototype&&(f[d]=[]),f=f[d]}var y=w[w.length-1];Ot(f,y)||((f===Object.prototype||f===Number.prototype||f===String.prototype)&&(f={}),f===Array.prototype&&(f=[]),f[y]===void 0||e.bools[y]||typeof f[y]=="boolean"?f[y]=P:Array.isArray(f[y])?f[y].push(P):f[y]=[f[y],P])}function h(u,w,P){if(!(P&&e.unknownFn&&!l(u,P)&&e.unknownFn(P)===!1)){var f=!e.strings[u]&&St(w)?Number(w):w;b(r,u.split("."),f),(i[u]||[]).forEach(function(_){b(r,_.split("."),f)})}}Object.keys(e.bools).forEach(function(u){h(u,o[u]===void 0?!1:o[u])});var D=[];s.indexOf("--")!==-1&&(D=s.slice(s.indexOf("--")+1),s=s.slice(0,s.indexOf("--")));for(var m=0;m<s.length;m++){var a=s[m],c,v;if(/^--.+=/.test(a)){var O=a.match(/^--([^=]+)=([\s\S]*)$/);c=O[1];var z=O[2];e.bools[c]&&(z=z!=="false"),h(c,z,a)}else if(/^--no-.+/.test(a))c=a.match(/^--no-(.+)/)[1],h(c,!1,a);else if(/^--.+/.test(a))c=a.match(/^--(.+)/)[1],v=s[m+1],v!==void 0&&!/^(-|--)[^-]/.test(v)&&!e.bools[c]&&!e.allBools&&(!i[c]||!n(c))?(h(c,v,a),m+=1):/^(true|false)$/.test(v)?(h(c,v==="true",a),m+=1):h(c,e.strings[c]?"":!0,a);else if(/^-[^-]+/.test(a)){for(var M=a.slice(1,-1).split(""),V=!1,$=0;$<M.length;$++){if(v=a.slice($+2),v==="-"){h(M[$],v,a);continue}if(/[A-Za-z]/.test(M[$])&&v[0]==="="){h(M[$],v.slice(1),a),V=!0;break}if(/[A-Za-z]/.test(M[$])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(v)){h(M[$],v,a),V=!0;break}if(M[$+1]&&M[$+1].match(/\W/)){h(M[$],a.slice($+2),a),V=!0;break}else h(M[$],e.strings[M[$]]?"":!0,a)}c=a.slice(-1)[0],!V&&c!=="-"&&(s[m+1]&&!/^(-|--)[^-]/.test(s[m+1])&&!e.bools[c]&&(!i[c]||!n(c))?(h(c,s[m+1],a),m+=1):s[m+1]&&/^(true|false)$/.test(s[m+1])?(h(c,s[m+1]==="true",a),m+=1):h(c,e.strings[c]?"":!0,a))}else if((!e.unknownFn||e.unknownFn(a)!==!1)&&r._.push(e.strings._||!St(a)?a:Number(a)),t.stopEarly){r._.push.apply(r._,s.slice(m+1));break}}return Object.keys(o).forEach(function(u){ae(r,u.split("."))||(b(r,u.split("."),o[u]),(i[u]||[]).forEach(function(w){b(r,w.split("."),o[u])}))}),t["--"]?r["--"]=D.slice():D.forEach(function(u){r._.push(u)}),r};const ce=xt(ue);var Mt={};const{FORCE_COLOR:de,NODE_DISABLE_COLORS:fe,TERM:pe}=process.env,p={enabled:!fe&&pe!=="dumb"&&de!=="0",reset:g(0,0),bold:g(1,22),dim:g(2,22),italic:g(3,23),underline:g(4,24),inverse:g(7,27),hidden:g(8,28),strikethrough:g(9,29),black:g(30,39),red:g(31,39),green:g(32,39),yellow:g(33,39),blue:g(34,39),magenta:g(35,39),cyan:g(36,39),white:g(37,39),gray:g(90,39),grey:g(90,39),bgBlack:g(40,49),bgRed:g(41,49),bgGreen:g(42,49),bgYellow:g(43,49),bgBlue:g(44,49),bgMagenta:g(45,49),bgCyan:g(46,49),bgWhite:g(47,49)};function Pt(s,t){let e=0,i,n="",o="";for(;e<s.length;e++)i=s[e],n+=i.open,o+=i.close,t.includes(i.close)&&(t=t.replace(i.rgx,i.close+i.open));return n+t+o}function me(s,t){let e={has:s,keys:t};return e.reset=p.reset.bind(e),e.bold=p.bold.bind(e),e.dim=p.dim.bind(e),e.italic=p.italic.bind(e),e.underline=p.underline.bind(e),e.inverse=p.inverse.bind(e),e.hidden=p.hidden.bind(e),e.strikethrough=p.strikethrough.bind(e),e.black=p.black.bind(e),e.red=p.red.bind(e),e.green=p.green.bind(e),e.yellow=p.yellow.bind(e),e.blue=p.blue.bind(e),e.magenta=p.magenta.bind(e),e.cyan=p.cyan.bind(e),e.white=p.white.bind(e),e.gray=p.gray.bind(e),e.grey=p.grey.bind(e),e.bgBlack=p.bgBlack.bind(e),e.bgRed=p.bgRed.bind(e),e.bgGreen=p.bgGreen.bind(e),e.bgYellow=p.bgYellow.bind(e),e.bgBlue=p.bgBlue.bind(e),e.bgMagenta=p.bgMagenta.bind(e),e.bgCyan=p.bgCyan.bind(e),e.bgWhite=p.bgWhite.bind(e),e}function g(s,t){let e={open:`\x1B[${s}m`,close:`\x1B[${t}m`,rgx:new RegExp(`\\x1b\\[${t}m`,"g")};return function(i){return this!==void 0&&this.has!==void 0?(this.has.includes(s)||(this.has.push(s),this.keys.push(e)),i===void 0?this:p.enabled?Pt(this.keys,i+""):i+""):i===void 0?me([s],[e]):p.enabled?Pt([e],i+""):i+""}}var C=p,ge=(s,t)=>{if(!(s.meta&&s.name!=="escape")){if(s.ctrl){if(s.name==="a")return"first";if(s.name==="c"||s.name==="d")return"abort";if(s.name==="e")return"last";if(s.name==="g")return"reset"}if(t){if(s.name==="j")return"down";if(s.name==="k")return"up"}return s.name==="return"||s.name==="enter"?"submit":s.name==="backspace"?"delete":s.name==="delete"?"deleteForward":s.name==="abort"?"abort":s.name==="escape"?"exit":s.name==="tab"?"next":s.name==="pagedown"?"nextPage":s.name==="pageup"?"prevPage":s.name==="home"?"home":s.name==="end"?"end":s.name==="up"?"up":s.name==="down"?"down":s.name==="right"?"right":s.name==="left"?"left":!1}},ot=s=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),e=new RegExp(t,"g");return typeof s=="string"?s.replace(e,""):s};const be=ot,{erase:Tt,cursor:ve}=T,we=s=>[...be(s)].length;var ye=function(s,t){if(!t)return Tt.line+ve.to(0);let e=0;const i=s.split(/\r?\n/);for(let n of i)e+=1+Math.floor(Math.max(we(n)-1,0)/t);return Tt.lines(e)};const J={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},$e={arrowUp:J.arrowUp,arrowDown:J.arrowDown,arrowLeft:J.arrowLeft,arrowRight:J.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},xe=process.platform==="win32"?$e:J;var Ct=xe;const k=C,Y=Ct,lt=Object.freeze({password:{scale:1,render:s=>"*".repeat(s.length)},emoji:{scale:2,render:s=>"\u{1F603}".repeat(s.length)},invisible:{scale:0,render:s=>""},default:{scale:1,render:s=>`${s}`}}),Se=s=>lt[s]||lt.default,G=Object.freeze({aborted:k.red(Y.cross),done:k.green(Y.tick),exited:k.yellow(Y.cross),default:k.cyan("?")}),Oe=(s,t,e)=>t?G.aborted:e?G.exited:s?G.done:G.default,Me=s=>k.gray(s?Y.ellipsis:Y.pointerSmall),Pe=(s,t)=>k.gray(s?t?Y.pointerSmall:"+":Y.line);var Te={styles:lt,render:Se,symbols:G,symbol:Oe,delimiter:Me,item:Pe};const Ce=ot;var De=function(s,t){let e=String(Ce(s)||"").split(/\r?\n/);return t?e.map(i=>Math.ceil(i.length/t)).reduce((i,n)=>i+n):e.length},Ee=(s,t={})=>{const e=Number.isSafeInteger(parseInt(t.margin))?new Array(parseInt(t.margin)).fill(" ").join(""):t.margin||"",i=t.width;return(s||"").split(/\r?\n/g).map(n=>n.split(/\s+/g).reduce((o,r)=>(r.length+e.length>=i||o[o.length-1].length+r.length+1<i?o[o.length-1]+=` ${r}`:o.push(`${e}${r}`),o),[e]).join(`
1
+ import $ from"node:fs";import x from"node:path";import{fileURLToPath as yt}from"node:url";import le from"readline";import D from"sisteransi";import he from"events";function $t(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function ae(s,t){var e=s;t.slice(0,-1).forEach(function(n){e=e[n]||{}});var i=t[t.length-1];return i in e}function xt(s){return typeof s=="number"||/^0x[0-9a-f]+$/i.test(s)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(s)}function St(s,t){return t==="constructor"&&typeof s[t]=="function"||t==="__proto__"}var ue=function(s,t){t||(t={});var e={bools:{},strings:{},unknownFn:null};typeof t.unknown=="function"&&(e.unknownFn=t.unknown),typeof t.boolean=="boolean"&&t.boolean?e.allBools=!0:[].concat(t.boolean).filter(Boolean).forEach(function(u){e.bools[u]=!0});var i={};function n(u){return i[u].some(function(y){return e.bools[y]})}Object.keys(t.alias||{}).forEach(function(u){i[u]=[].concat(t.alias[u]),i[u].forEach(function(y){i[y]=[u].concat(i[u].filter(function(C){return y!==C}))})}),[].concat(t.string).filter(Boolean).forEach(function(u){e.strings[u]=!0,i[u]&&[].concat(i[u]).forEach(function(y){e.strings[y]=!0})});var o=t.default||{},r={_:[]};function l(u,y){return e.allBools&&/^--[^=]+$/.test(y)||e.strings[u]||e.bools[u]||i[u]}function b(u,y,C){for(var d=u,p=0;p<y.length-1;p++){var w=y[p];if(St(d,w))return;d[w]===void 0&&(d[w]={}),(d[w]===Object.prototype||d[w]===Number.prototype||d[w]===String.prototype)&&(d[w]={}),d[w]===Array.prototype&&(d[w]=[]),d=d[w]}var P=y[y.length-1];St(d,P)||((d===Object.prototype||d===Number.prototype||d===String.prototype)&&(d={}),d===Array.prototype&&(d=[]),d[P]===void 0||e.bools[P]||typeof d[P]=="boolean"?d[P]=C:Array.isArray(d[P])?d[P].push(C):d[P]=[d[P],C])}function h(u,y,C){if(!(C&&e.unknownFn&&!l(u,C)&&e.unknownFn(C)===!1)){var d=!e.strings[u]&&xt(y)?Number(y):y;b(r,u.split("."),d),(i[u]||[]).forEach(function(p){b(r,p.split("."),d)})}}Object.keys(e.bools).forEach(function(u){h(u,o[u]===void 0?!1:o[u])});var T=[];s.indexOf("--")!==-1&&(T=s.slice(s.indexOf("--")+1),s=s.slice(0,s.indexOf("--")));for(var m=0;m<s.length;m++){var a=s[m],c,v;if(/^--.+=/.test(a)){var O=a.match(/^--([^=]+)=([\s\S]*)$/);c=O[1];var z=O[2];e.bools[c]&&(z=z!=="false"),h(c,z,a)}else if(/^--no-.+/.test(a))c=a.match(/^--no-(.+)/)[1],h(c,!1,a);else if(/^--.+/.test(a))c=a.match(/^--(.+)/)[1],v=s[m+1],v!==void 0&&!/^(-|--)[^-]/.test(v)&&!e.bools[c]&&!e.allBools&&(!i[c]||!n(c))?(h(c,v,a),m+=1):/^(true|false)$/.test(v)?(h(c,v==="true",a),m+=1):h(c,e.strings[c]?"":!0,a);else if(/^-[^-]+/.test(a)){for(var M=a.slice(1,-1).split(""),F=!1,S=0;S<M.length;S++){if(v=a.slice(S+2),v==="-"){h(M[S],v,a);continue}if(/[A-Za-z]/.test(M[S])&&v[0]==="="){h(M[S],v.slice(1),a),F=!0;break}if(/[A-Za-z]/.test(M[S])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(v)){h(M[S],v,a),F=!0;break}if(M[S+1]&&M[S+1].match(/\W/)){h(M[S],a.slice(S+2),a),F=!0;break}else h(M[S],e.strings[M[S]]?"":!0,a)}c=a.slice(-1)[0],!F&&c!=="-"&&(s[m+1]&&!/^(-|--)[^-]/.test(s[m+1])&&!e.bools[c]&&(!i[c]||!n(c))?(h(c,s[m+1],a),m+=1):s[m+1]&&/^(true|false)$/.test(s[m+1])?(h(c,s[m+1]==="true",a),m+=1):h(c,e.strings[c]?"":!0,a))}else if((!e.unknownFn||e.unknownFn(a)!==!1)&&r._.push(e.strings._||!xt(a)?a:Number(a)),t.stopEarly){r._.push.apply(r._,s.slice(m+1));break}}return Object.keys(o).forEach(function(u){ae(r,u.split("."))||(b(r,u.split("."),o[u]),(i[u]||[]).forEach(function(y){b(r,y.split("."),o[u])}))}),t["--"]?r["--"]=T.slice():T.forEach(function(u){r._.push(u)}),r};const ce=$t(ue);var Ot={};const{FORCE_COLOR:de,NODE_DISABLE_COLORS:fe,TERM:pe}=process.env,f={enabled:!fe&&pe!=="dumb"&&de!=="0",reset:g(0,0),bold:g(1,22),dim:g(2,22),italic:g(3,23),underline:g(4,24),inverse:g(7,27),hidden:g(8,28),strikethrough:g(9,29),black:g(30,39),red:g(31,39),green:g(32,39),yellow:g(33,39),blue:g(34,39),magenta:g(35,39),cyan:g(36,39),white:g(37,39),gray:g(90,39),grey:g(90,39),bgBlack:g(40,49),bgRed:g(41,49),bgGreen:g(42,49),bgYellow:g(43,49),bgBlue:g(44,49),bgMagenta:g(45,49),bgCyan:g(46,49),bgWhite:g(47,49)};function Mt(s,t){let e=0,i,n="",o="";for(;e<s.length;e++)i=s[e],n+=i.open,o+=i.close,t.includes(i.close)&&(t=t.replace(i.rgx,i.close+i.open));return n+t+o}function me(s,t){let e={has:s,keys:t};return e.reset=f.reset.bind(e),e.bold=f.bold.bind(e),e.dim=f.dim.bind(e),e.italic=f.italic.bind(e),e.underline=f.underline.bind(e),e.inverse=f.inverse.bind(e),e.hidden=f.hidden.bind(e),e.strikethrough=f.strikethrough.bind(e),e.black=f.black.bind(e),e.red=f.red.bind(e),e.green=f.green.bind(e),e.yellow=f.yellow.bind(e),e.blue=f.blue.bind(e),e.magenta=f.magenta.bind(e),e.cyan=f.cyan.bind(e),e.white=f.white.bind(e),e.gray=f.gray.bind(e),e.grey=f.grey.bind(e),e.bgBlack=f.bgBlack.bind(e),e.bgRed=f.bgRed.bind(e),e.bgGreen=f.bgGreen.bind(e),e.bgYellow=f.bgYellow.bind(e),e.bgBlue=f.bgBlue.bind(e),e.bgMagenta=f.bgMagenta.bind(e),e.bgCyan=f.bgCyan.bind(e),e.bgWhite=f.bgWhite.bind(e),e}function g(s,t){let e={open:`\x1B[${s}m`,close:`\x1B[${t}m`,rgx:new RegExp(`\\x1b\\[${t}m`,"g")};return function(i){return this!==void 0&&this.has!==void 0?(this.has.includes(s)||(this.has.push(s),this.keys.push(e)),i===void 0?this:f.enabled?Mt(this.keys,i+""):i+""):i===void 0?me([s],[e]):f.enabled?Mt([e],i+""):i+""}}var E=f,ge=(s,t)=>{if(!(s.meta&&s.name!=="escape")){if(s.ctrl){if(s.name==="a")return"first";if(s.name==="c"||s.name==="d")return"abort";if(s.name==="e")return"last";if(s.name==="g")return"reset"}if(t){if(s.name==="j")return"down";if(s.name==="k")return"up"}return s.name==="return"||s.name==="enter"?"submit":s.name==="backspace"?"delete":s.name==="delete"?"deleteForward":s.name==="abort"?"abort":s.name==="escape"?"exit":s.name==="tab"?"next":s.name==="pagedown"?"nextPage":s.name==="pageup"?"prevPage":s.name==="home"?"home":s.name==="end"?"end":s.name==="up"?"up":s.name==="down"?"down":s.name==="right"?"right":s.name==="left"?"left":!1}},rt=s=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))"].join("|"),e=new RegExp(t,"g");return typeof s=="string"?s.replace(e,""):s};const be=rt,{erase:Pt,cursor:ve}=D,we=s=>[...be(s)].length;var ye=function(s,t){if(!t)return Pt.line+ve.to(0);let e=0;const i=s.split(/\r?\n/);for(let n of i)e+=1+Math.floor(Math.max(we(n)-1,0)/t);return Pt.lines(e)};const J={arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",radioOn:"\u25C9",radioOff:"\u25EF",tick:"\u2714",cross:"\u2716",ellipsis:"\u2026",pointerSmall:"\u203A",line:"\u2500",pointer:"\u276F"},$e={arrowUp:J.arrowUp,arrowDown:J.arrowDown,arrowLeft:J.arrowLeft,arrowRight:J.arrowRight,radioOn:"(*)",radioOff:"( )",tick:"\u221A",cross:"\xD7",ellipsis:"...",pointerSmall:"\xBB",line:"\u2500",pointer:">"},xe=process.platform==="win32"?$e:J;var Tt=xe;const k=E,V=Tt,nt=Object.freeze({password:{scale:1,render:s=>"*".repeat(s.length)},emoji:{scale:2,render:s=>"\u{1F603}".repeat(s.length)},invisible:{scale:0,render:s=>""},default:{scale:1,render:s=>`${s}`}}),Se=s=>nt[s]||nt.default,G=Object.freeze({aborted:k.red(V.cross),done:k.green(V.tick),exited:k.yellow(V.cross),default:k.cyan("?")}),Oe=(s,t,e)=>t?G.aborted:e?G.exited:s?G.done:G.default,Me=s=>k.gray(s?V.ellipsis:V.pointerSmall),Pe=(s,t)=>k.gray(s?t?V.pointerSmall:"+":V.line);var Te={styles:nt,render:Se,symbols:G,symbol:Oe,delimiter:Me,item:Pe};const Ce=rt;var De=function(s,t){let e=String(Ce(s)||"").split(/\r?\n/);return t?e.map(i=>Math.ceil(i.length/t)).reduce((i,n)=>i+n):e.length},Ee=(s,t={})=>{const e=Number.isSafeInteger(parseInt(t.margin))?new Array(parseInt(t.margin)).fill(" ").join(""):t.margin||"",i=t.width;return(s||"").split(/\r?\n/g).map(n=>n.split(/\s+/g).reduce((o,r)=>(r.length+e.length>=i||o[o.length-1].length+r.length+1<i?o[o.length-1]+=` ${r}`:o.push(`${e}${r}`),o),[e]).join(`
2
2
  `)).join(`
3
- `)},Ie=(s,t,e)=>{e=e||t;let i=Math.min(t-e,s-Math.floor(e/2));i<0&&(i=0);let n=Math.min(i+e,t);return{startIndex:i,endIndex:n}},E={action:ge,clear:ye,style:Te,strip:ot,figures:Ct,lines:De,wrap:Ee,entriesToDisplay:Ie};const Dt=le,{action:_e}=E,Re=he,{beep:Ae,cursor:je}=T,Fe=C;let Ne=class extends Re{constructor(t={}){super(),this.firstRender=!0,this.in=t.stdin||process.stdin,this.out=t.stdout||process.stdout,this.onRender=(t.onRender||(()=>{})).bind(this);const e=Dt.createInterface({input:this.in,escapeCodeTimeout:50});Dt.emitKeypressEvents(this.in,e),this.in.isTTY&&this.in.setRawMode(!0);const i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,n=(o,r)=>{let l=_e(r,i);l===!1?this._&&this._(o,r):typeof this[l]=="function"?this[l](r):this.bell()};this.close=()=>{this.out.write(je.show),this.in.removeListener("keypress",n),this.in.isTTY&&this.in.setRawMode(!1),e.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",n)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(Ae)}render(){this.onRender(Fe),this.firstRender&&(this.firstRender=!1)}};var F=Ne;const X=C,Le=F,{erase:Ve,cursor:W}=T,{style:ht,clear:at,lines:Ye,figures:He}=E;class ke extends Le{constructor(t={}){super(t),this.transform=ht.render(t.style),this.scale=this.transform.scale,this.msg=t.message,this.initial=t.initial||"",this.validator=t.validate||(()=>!0),this.value="",this.errorMsg=t.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=at("",this.out.columns),this.render()}set value(t){!t&&this.initial?(this.placeholder=!0,this.rendered=X.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(t)),this._value=t,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
3
+ `)},Ie=(s,t,e)=>{e=e||t;let i=Math.min(t-e,s-Math.floor(e/2));i<0&&(i=0);let n=Math.min(i+e,t);return{startIndex:i,endIndex:n}},I={action:ge,clear:ye,style:Te,strip:rt,figures:Tt,lines:De,wrap:Ee,entriesToDisplay:Ie};const Ct=le,{action:_e}=I,Re=he,{beep:Ae,cursor:je}=D,Fe=E;let Ne=class extends Re{constructor(t={}){super(),this.firstRender=!0,this.in=t.stdin||process.stdin,this.out=t.stdout||process.stdout,this.onRender=(t.onRender||(()=>{})).bind(this);const e=Ct.createInterface({input:this.in,escapeCodeTimeout:50});Ct.emitKeypressEvents(this.in,e),this.in.isTTY&&this.in.setRawMode(!0);const i=["SelectPrompt","MultiselectPrompt"].indexOf(this.constructor.name)>-1,n=(o,r)=>{let l=_e(r,i);l===!1?this._&&this._(o,r):typeof this[l]=="function"?this[l](r):this.bell()};this.close=()=>{this.out.write(je.show),this.in.removeListener("keypress",n),this.in.isTTY&&this.in.setRawMode(!1),e.close(),this.emit(this.aborted?"abort":this.exited?"exit":"submit",this.value),this.closed=!0},this.in.on("keypress",n)}fire(){this.emit("state",{value:this.value,aborted:!!this.aborted,exited:!!this.exited})}bell(){this.out.write(Ae)}render(){this.onRender(Fe),this.firstRender&&(this.firstRender=!1)}};var N=Ne;const q=E,Le=N,{erase:Ye,cursor:W}=D,{style:ot,clear:lt,lines:Ve,figures:He}=I;class ke extends Le{constructor(t={}){super(t),this.transform=ot.render(t.style),this.scale=this.transform.scale,this.msg=t.message,this.initial=t.initial||"",this.validator=t.validate||(()=>!0),this.value="",this.errorMsg=t.error||"Please Enter A Valid Value",this.cursor=+!!this.initial,this.cursorOffset=0,this.clear=lt("",this.out.columns),this.render()}set value(t){!t&&this.initial?(this.placeholder=!0,this.rendered=q.gray(this.transform.render(this.initial))):(this.placeholder=!1,this.rendered=this.transform.render(t)),this._value=t,this.fire()}get value(){return this._value}reset(){this.value="",this.cursor=+!!this.initial,this.cursorOffset=0,this.fire(),this.render()}exit(){this.abort()}abort(){this.value=this.value||this.initial,this.done=this.aborted=!0,this.error=!1,this.red=!1,this.fire(),this.render(),this.out.write(`
4
4
  `),this.close()}async validate(){let t=await this.validator(this.value);typeof t=="string"&&(this.errorMsg=t,t=!1),this.error=!t}async submit(){if(this.value=this.value||this.initial,this.cursorOffset=0,this.cursor=this.rendered.length,await this.validate(),this.error){this.red=!0,this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
5
- `),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(t){this.placeholder||(this.cursor=this.cursor+t,this.cursorOffset+=t)}_(t,e){let i=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.value=`${i}${t}${n}`,this.red=!1,this.cursor=this.placeholder?0:i.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1),e=this.value.slice(this.cursor);this.value=`${t}${e}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let t=this.value.slice(0,this.cursor),e=this.value.slice(this.cursor+1);this.value=`${t}${e}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(W.down(Ye(this.outputError,this.out.columns)-1)+at(this.outputError,this.out.columns)),this.out.write(at(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[ht.symbol(this.done,this.aborted),X.bold(this.msg),ht.delimiter(this.done),this.red?X.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
5
+ `),this.close()}next(){if(!this.placeholder)return this.bell();this.value=this.initial,this.cursor=this.rendered.length,this.fire(),this.render()}moveCursor(t){this.placeholder||(this.cursor=this.cursor+t,this.cursorOffset+=t)}_(t,e){let i=this.value.slice(0,this.cursor),n=this.value.slice(this.cursor);this.value=`${i}${t}${n}`,this.red=!1,this.cursor=this.placeholder?0:i.length+1,this.render()}delete(){if(this.isCursorAtStart())return this.bell();let t=this.value.slice(0,this.cursor-1),e=this.value.slice(this.cursor);this.value=`${t}${e}`,this.red=!1,this.isCursorAtStart()?this.cursorOffset=0:(this.cursorOffset++,this.moveCursor(-1)),this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();let t=this.value.slice(0,this.cursor),e=this.value.slice(this.cursor+1);this.value=`${t}${e}`,this.red=!1,this.isCursorAtEnd()?this.cursorOffset=0:this.cursorOffset++,this.render()}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length,this.render()}left(){if(this.cursor<=0||this.placeholder)return this.bell();this.moveCursor(-1),this.render()}right(){if(this.cursor*this.scale>=this.rendered.length||this.placeholder)return this.bell();this.moveCursor(1),this.render()}isCursorAtStart(){return this.cursor===0||this.placeholder&&this.cursor===1}isCursorAtEnd(){return this.cursor===this.rendered.length||this.placeholder&&this.cursor===this.rendered.length+1}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(W.down(Ve(this.outputError,this.out.columns)-1)+lt(this.outputError,this.out.columns)),this.out.write(lt(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[ot.symbol(this.done,this.aborted),q.bold(this.msg),ot.delimiter(this.done),this.red?q.red(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
6
6
  `).reduce((t,e,i)=>t+`
7
- ${i?" ":He.pointerSmall} ${X.red().italic(e)}`,"")),this.out.write(Ve.line+W.to(0)+this.outputText+W.save+this.outputError+W.restore+W.move(this.cursorOffset,0)))}}var Be=ke;const R=C,Ue=F,{style:Et,clear:It,figures:Q,wrap:ze,entriesToDisplay:Je}=E,{cursor:Ge}=T;class We extends Ue{constructor(t={}){super(t),this.msg=t.message,this.hint=t.hint||"- Use arrow-keys. Return to submit.",this.warn=t.warn||"- This option is disabled",this.cursor=t.initial||0,this.choices=t.choices.map((e,i)=>(typeof e=="string"&&(e={title:e,value:i}),{title:e&&(e.title||e.value||e),value:e&&(e.value===void 0?i:e.value),description:e&&e.description,selected:e&&e.selected,disabled:e&&e.disabled})),this.optionsPerPage=t.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=It("",this.out.columns),this.render()}moveCursor(t){this.cursor=t,this.value=this.choices[t].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
7
+ ${i?" ":He.pointerSmall} ${q.red().italic(e)}`,"")),this.out.write(Ye.line+W.to(0)+this.outputText+W.save+this.outputError+W.restore+W.move(this.cursorOffset,0)))}}var Be=ke;const R=E,Ue=N,{style:Dt,clear:Et,figures:X,wrap:ze,entriesToDisplay:Je}=I,{cursor:Ge}=D;class We extends Ue{constructor(t={}){super(t),this.msg=t.message,this.hint=t.hint||"- Use arrow-keys. Return to submit.",this.warn=t.warn||"- This option is disabled",this.cursor=t.initial||0,this.choices=t.choices.map((e,i)=>(typeof e=="string"&&(e={title:e,value:i}),{title:e&&(e.title||e.value||e),value:e&&(e.value===void 0?i:e.value),description:e&&e.description,selected:e&&e.selected,disabled:e&&e.disabled})),this.optionsPerPage=t.optionsPerPage||10,this.value=(this.choices[this.cursor]||{}).value,this.clear=Et("",this.out.columns),this.render()}moveCursor(t){this.cursor=t,this.value=this.choices[t].value,this.fire()}reset(){this.moveCursor(0),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
8
8
  `),this.close()}submit(){this.selection.disabled?this.bell():(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
9
- `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(t,e){if(t===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(Ge.hide):this.out.write(It(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:e}=Je(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[Et.symbol(this.done,this.aborted),R.bold(this.msg),Et.delimiter(!1),this.done?this.selection.title:this.selection.disabled?R.yellow(this.warn):R.gray(this.hint)].join(" "),!this.done){this.outputText+=`
10
- `;for(let i=t;i<e;i++){let n,o,r="",l=this.choices[i];i===t&&t>0?o=Q.arrowUp:i===e-1&&e<this.choices.length?o=Q.arrowDown:o=" ",l.disabled?(n=this.cursor===i?R.gray().underline(l.title):R.strikethrough().gray(l.title),o=(this.cursor===i?R.bold().gray(Q.pointer)+" ":" ")+o):(n=this.cursor===i?R.cyan().underline(l.title):l.title,o=(this.cursor===i?R.cyan(Q.pointer)+" ":" ")+o,l.description&&this.cursor===i&&(r=` - ${l.description}`,(o.length+n.length+r.length>=this.out.columns||l.description.split(/\r?\n/).length>1)&&(r=`
9
+ `),this.close())}first(){this.moveCursor(0),this.render()}last(){this.moveCursor(this.choices.length-1),this.render()}up(){this.cursor===0?this.moveCursor(this.choices.length-1):this.moveCursor(this.cursor-1),this.render()}down(){this.cursor===this.choices.length-1?this.moveCursor(0):this.moveCursor(this.cursor+1),this.render()}next(){this.moveCursor((this.cursor+1)%this.choices.length),this.render()}_(t,e){if(t===" ")return this.submit()}get selection(){return this.choices[this.cursor]}render(){if(this.closed)return;this.firstRender?this.out.write(Ge.hide):this.out.write(Et(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:e}=Je(this.cursor,this.choices.length,this.optionsPerPage);if(this.outputText=[Dt.symbol(this.done,this.aborted),R.bold(this.msg),Dt.delimiter(!1),this.done?this.selection.title:this.selection.disabled?R.yellow(this.warn):R.gray(this.hint)].join(" "),!this.done){this.outputText+=`
10
+ `;for(let i=t;i<e;i++){let n,o,r="",l=this.choices[i];i===t&&t>0?o=X.arrowUp:i===e-1&&e<this.choices.length?o=X.arrowDown:o=" ",l.disabled?(n=this.cursor===i?R.gray().underline(l.title):R.strikethrough().gray(l.title),o=(this.cursor===i?R.bold().gray(X.pointer)+" ":" ")+o):(n=this.cursor===i?R.cyan().underline(l.title):l.title,o=(this.cursor===i?R.cyan(X.pointer)+" ":" ")+o,l.description&&this.cursor===i&&(r=` - ${l.description}`,(o.length+n.length+r.length>=this.out.columns||l.description.split(/\r?\n/).length>1)&&(r=`
11
11
  `+ze(l.description,{margin:3,width:this.out.columns})))),this.outputText+=`${o} ${n}${R.gray(r)}
12
- `}}this.out.write(this.outputText)}}var Ke=We;const tt=C,Ze=F,{style:_t,clear:qe}=E,{cursor:Rt,erase:Xe}=T;class Qe extends Ze{constructor(t={}){super(t),this.msg=t.message,this.value=!!t.initial,this.active=t.active||"on",this.inactive=t.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
12
+ `}}this.out.write(this.outputText)}}var Ke=We;const Q=E,Ze=N,{style:It,clear:qe}=I,{cursor:_t,erase:Xe}=D;class Qe extends Ze{constructor(t={}){super(t),this.msg=t.message,this.value=!!t.initial,this.active=t.active||"on",this.inactive=t.inactive||"off",this.initialValue=this.value,this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
13
13
  `),this.close()}submit(){this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
14
- `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(t,e){if(t===" ")this.value=!this.value;else if(t==="1")this.value=!0;else if(t==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(Rt.hide):this.out.write(qe(this.outputText,this.out.columns)),super.render(),this.outputText=[_t.symbol(this.done,this.aborted),tt.bold(this.msg),_t.delimiter(this.done),this.value?this.inactive:tt.cyan().underline(this.inactive),tt.gray("/"),this.value?tt.cyan().underline(this.active):this.active].join(" "),this.out.write(Xe.line+Rt.to(0)+this.outputText))}}var ts=Qe;let es=class yt{constructor({token:t,date:e,parts:i,locales:n}){this.token=t,this.date=e||new Date,this.parts=i||[this],this.locales=n||{}}up(){}down(){}next(){const t=this.parts.indexOf(this);return this.parts.find((e,i)=>i>t&&e instanceof yt)}setTo(t){}prev(){let t=[].concat(this.parts).reverse();const e=t.indexOf(this);return t.find((i,n)=>n>e&&i instanceof yt)}toString(){return String(this.date)}};var A=es;const ss=A;let is=class extends ss{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}};var rs=is;const ns=A,os=s=>(s=s%10,s===1?"st":s===2?"nd":s===3?"rd":"th");let ls=class extends ns{constructor(t={}){super(t)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(t){this.date.setDate(parseInt(t.substr(-2)))}toString(){let t=this.date.getDate(),e=this.date.getDay();return this.token==="DD"?String(t).padStart(2,"0"):this.token==="Do"?t+os(t):this.token==="d"?e+1:this.token==="ddd"?this.locales.weekdaysShort[e]:this.token==="dddd"?this.locales.weekdays[e]:t}};var hs=ls;const as=A;let us=class extends as{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();return/h/.test(this.token)&&(t=t%12||12),this.token.length>1?String(t).padStart(2,"0"):t}};var cs=us;const ds=A;let fs=class extends ds{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};var ps=fs;const ms=A;let gs=class extends ms{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}};var bs=gs;const vs=A;let ws=class extends vs{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1,this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth(),e=this.token.length;return e===2?String(t+1).padStart(2,"0"):e===3?this.locales.monthsShort[t]:e===4?this.locales.months[t]:String(t+1)}};var ys=ws;const $s=A;let xs=class extends $s{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}};var Ss=xs;const Os=A;let Ms=class extends Os{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?t.substr(-2):t}};var Ps=Ms,Ts={DatePart:A,Meridiem:rs,Day:hs,Hours:cs,Milliseconds:ps,Minutes:bs,Month:ys,Seconds:Ss,Year:Ps};const ut=C,Cs=F,{style:At,clear:jt,figures:Ds}=E,{erase:Es,cursor:Ft}=T,{DatePart:Nt,Meridiem:Is,Day:_s,Hours:Rs,Milliseconds:As,Minutes:js,Month:Fs,Seconds:Ns,Year:Ls}=Ts,Vs=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,Lt={1:({token:s})=>s.replace(/\\(.)/g,"$1"),2:s=>new _s(s),3:s=>new Fs(s),4:s=>new Ls(s),5:s=>new Is(s),6:s=>new Rs(s),7:s=>new js(s),8:s=>new Ns(s),9:s=>new As(s)},Ys={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class Hs extends Cs{constructor(t={}){super(t),this.msg=t.message,this.cursor=0,this.typed="",this.locales=Object.assign(Ys,t.locales),this._date=t.initial||new Date,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.mask=t.mask||"YYYY-MM-DD HH:mm:ss",this.clear=jt("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(t){t&&this._date.setTime(t.getTime())}set mask(t){let e;for(this.parts=[];e=Vs.exec(t);){let n=e.shift(),o=e.findIndex(r=>r!=null);this.parts.push(o in Lt?Lt[o]({token:e[o]||n,date:this.date,parts:this.parts,locales:this.locales}):e[o]||n)}let i=this.parts.reduce((n,o)=>(typeof o=="string"&&typeof n[n.length-1]=="string"?n[n.length-1]+=o:n.push(o),n),[]);this.parts.splice(0),this.parts.push(...i),this.reset()}moveCursor(t){this.typed="",this.cursor=t,this.fire()}reset(){this.moveCursor(this.parts.findIndex(t=>t instanceof Nt)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
14
+ `),this.close()}deactivate(){if(this.value===!1)return this.bell();this.value=!1,this.render()}activate(){if(this.value===!0)return this.bell();this.value=!0,this.render()}delete(){this.deactivate()}left(){this.deactivate()}right(){this.activate()}down(){this.deactivate()}up(){this.activate()}next(){this.value=!this.value,this.fire(),this.render()}_(t,e){if(t===" ")this.value=!this.value;else if(t==="1")this.value=!0;else if(t==="0")this.value=!1;else return this.bell();this.render()}render(){this.closed||(this.firstRender?this.out.write(_t.hide):this.out.write(qe(this.outputText,this.out.columns)),super.render(),this.outputText=[It.symbol(this.done,this.aborted),Q.bold(this.msg),It.delimiter(this.done),this.value?this.inactive:Q.cyan().underline(this.inactive),Q.gray("/"),this.value?Q.cyan().underline(this.active):this.active].join(" "),this.out.write(Xe.line+_t.to(0)+this.outputText))}}var ts=Qe;let es=class wt{constructor({token:t,date:e,parts:i,locales:n}){this.token=t,this.date=e||new Date,this.parts=i||[this],this.locales=n||{}}up(){}down(){}next(){const t=this.parts.indexOf(this);return this.parts.find((e,i)=>i>t&&e instanceof wt)}setTo(t){}prev(){let t=[].concat(this.parts).reverse();const e=t.indexOf(this);return t.find((i,n)=>n>e&&i instanceof wt)}toString(){return String(this.date)}};var A=es;const ss=A;let is=class extends ss{constructor(t={}){super(t)}up(){this.date.setHours((this.date.getHours()+12)%24)}down(){this.up()}toString(){let t=this.date.getHours()>12?"pm":"am";return/\A/.test(this.token)?t.toUpperCase():t}};var rs=is;const ns=A,os=s=>(s=s%10,s===1?"st":s===2?"nd":s===3?"rd":"th");let ls=class extends ns{constructor(t={}){super(t)}up(){this.date.setDate(this.date.getDate()+1)}down(){this.date.setDate(this.date.getDate()-1)}setTo(t){this.date.setDate(parseInt(t.substr(-2)))}toString(){let t=this.date.getDate(),e=this.date.getDay();return this.token==="DD"?String(t).padStart(2,"0"):this.token==="Do"?t+os(t):this.token==="d"?e+1:this.token==="ddd"?this.locales.weekdaysShort[e]:this.token==="dddd"?this.locales.weekdays[e]:t}};var hs=ls;const as=A;let us=class extends as{constructor(t={}){super(t)}up(){this.date.setHours(this.date.getHours()+1)}down(){this.date.setHours(this.date.getHours()-1)}setTo(t){this.date.setHours(parseInt(t.substr(-2)))}toString(){let t=this.date.getHours();return/h/.test(this.token)&&(t=t%12||12),this.token.length>1?String(t).padStart(2,"0"):t}};var cs=us;const ds=A;let fs=class extends ds{constructor(t={}){super(t)}up(){this.date.setMilliseconds(this.date.getMilliseconds()+1)}down(){this.date.setMilliseconds(this.date.getMilliseconds()-1)}setTo(t){this.date.setMilliseconds(parseInt(t.substr(-this.token.length)))}toString(){return String(this.date.getMilliseconds()).padStart(4,"0").substr(0,this.token.length)}};var ps=fs;const ms=A;let gs=class extends ms{constructor(t={}){super(t)}up(){this.date.setMinutes(this.date.getMinutes()+1)}down(){this.date.setMinutes(this.date.getMinutes()-1)}setTo(t){this.date.setMinutes(parseInt(t.substr(-2)))}toString(){let t=this.date.getMinutes();return this.token.length>1?String(t).padStart(2,"0"):t}};var bs=gs;const vs=A;let ws=class extends vs{constructor(t={}){super(t)}up(){this.date.setMonth(this.date.getMonth()+1)}down(){this.date.setMonth(this.date.getMonth()-1)}setTo(t){t=parseInt(t.substr(-2))-1,this.date.setMonth(t<0?0:t)}toString(){let t=this.date.getMonth(),e=this.token.length;return e===2?String(t+1).padStart(2,"0"):e===3?this.locales.monthsShort[t]:e===4?this.locales.months[t]:String(t+1)}};var ys=ws;const $s=A;let xs=class extends $s{constructor(t={}){super(t)}up(){this.date.setSeconds(this.date.getSeconds()+1)}down(){this.date.setSeconds(this.date.getSeconds()-1)}setTo(t){this.date.setSeconds(parseInt(t.substr(-2)))}toString(){let t=this.date.getSeconds();return this.token.length>1?String(t).padStart(2,"0"):t}};var Ss=xs;const Os=A;let Ms=class extends Os{constructor(t={}){super(t)}up(){this.date.setFullYear(this.date.getFullYear()+1)}down(){this.date.setFullYear(this.date.getFullYear()-1)}setTo(t){this.date.setFullYear(t.substr(-4))}toString(){let t=String(this.date.getFullYear()).padStart(4,"0");return this.token.length===2?t.substr(-2):t}};var Ps=Ms,Ts={DatePart:A,Meridiem:rs,Day:hs,Hours:cs,Milliseconds:ps,Minutes:bs,Month:ys,Seconds:Ss,Year:Ps};const ht=E,Cs=N,{style:Rt,clear:At,figures:Ds}=I,{erase:Es,cursor:jt}=D,{DatePart:Ft,Meridiem:Is,Day:_s,Hours:Rs,Milliseconds:As,Minutes:js,Month:Fs,Seconds:Ns,Year:Ls}=Ts,Ys=/\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g,Nt={1:({token:s})=>s.replace(/\\(.)/g,"$1"),2:s=>new _s(s),3:s=>new Fs(s),4:s=>new Ls(s),5:s=>new Is(s),6:s=>new Rs(s),7:s=>new js(s),8:s=>new Ns(s),9:s=>new As(s)},Vs={months:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),monthsShort:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),weekdaysShort:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(",")};class Hs extends Cs{constructor(t={}){super(t),this.msg=t.message,this.cursor=0,this.typed="",this.locales=Object.assign(Vs,t.locales),this._date=t.initial||new Date,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.mask=t.mask||"YYYY-MM-DD HH:mm:ss",this.clear=At("",this.out.columns),this.render()}get value(){return this.date}get date(){return this._date}set date(t){t&&this._date.setTime(t.getTime())}set mask(t){let e;for(this.parts=[];e=Ys.exec(t);){let n=e.shift(),o=e.findIndex(r=>r!=null);this.parts.push(o in Nt?Nt[o]({token:e[o]||n,date:this.date,parts:this.parts,locales:this.locales}):e[o]||n)}let i=this.parts.reduce((n,o)=>(typeof o=="string"&&typeof n[n.length-1]=="string"?n[n.length-1]+=o:n.push(o),n),[]);this.parts.splice(0),this.parts.push(...i),this.reset()}moveCursor(t){this.typed="",this.cursor=t,this.fire()}reset(){this.moveCursor(this.parts.findIndex(t=>t instanceof Ft)),this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
15
15
  `),this.close()}async validate(){let t=await this.validator(this.value);typeof t=="string"&&(this.errorMsg=t,t=!1),this.error=!t}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
16
- `),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let t=this.parts[this.cursor].prev();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}right(){let t=this.parts[this.cursor].next();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}next(){let t=this.parts[this.cursor].next();this.moveCursor(t?this.parts.indexOf(t):this.parts.findIndex(e=>e instanceof Nt)),this.render()}_(t){/\d/.test(t)&&(this.typed+=t,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(Ft.hide):this.out.write(jt(this.outputText,this.out.columns)),super.render(),this.outputText=[At.symbol(this.done,this.aborted),ut.bold(this.msg),At.delimiter(!1),this.parts.reduce((t,e,i)=>t.concat(i===this.cursor&&!this.done?ut.cyan().underline(e.toString()):e),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
16
+ `),this.close()}up(){this.typed="",this.parts[this.cursor].up(),this.render()}down(){this.typed="",this.parts[this.cursor].down(),this.render()}left(){let t=this.parts[this.cursor].prev();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}right(){let t=this.parts[this.cursor].next();if(t==null)return this.bell();this.moveCursor(this.parts.indexOf(t)),this.render()}next(){let t=this.parts[this.cursor].next();this.moveCursor(t?this.parts.indexOf(t):this.parts.findIndex(e=>e instanceof Ft)),this.render()}_(t){/\d/.test(t)&&(this.typed+=t,this.parts[this.cursor].setTo(this.typed),this.render())}render(){this.closed||(this.firstRender?this.out.write(jt.hide):this.out.write(At(this.outputText,this.out.columns)),super.render(),this.outputText=[Rt.symbol(this.done,this.aborted),ht.bold(this.msg),Rt.delimiter(!1),this.parts.reduce((t,e,i)=>t.concat(i===this.cursor&&!this.done?ht.cyan().underline(e.toString()):e),[]).join("")].join(" "),this.error&&(this.outputText+=this.errorMsg.split(`
17
17
  `).reduce((t,e,i)=>t+`
18
- ${i?" ":Ds.pointerSmall} ${ut.red().italic(e)}`,"")),this.out.write(Es.line+Ft.to(0)+this.outputText))}}var ks=Hs;const et=C,Bs=F,{cursor:st,erase:Us}=T,{style:ct,figures:zs,clear:Vt,lines:Js}=E,Gs=/[0-9]/,dt=s=>s!==void 0,Yt=(s,t)=>{let e=Math.pow(10,t);return Math.round(s*e)/e};class Ws extends Bs{constructor(t={}){super(t),this.transform=ct.render(t.style),this.msg=t.message,this.initial=dt(t.initial)?t.initial:"",this.float=!!t.float,this.round=t.round||2,this.inc=t.increment||1,this.min=dt(t.min)?t.min:-1/0,this.max=dt(t.max)?t.max:1/0,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(t){!t&&t!==0?(this.placeholder=!0,this.rendered=et.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${Yt(t,this.round)}`),this._value=Yt(t,this.round)),this.fire()}get value(){return this._value}parse(t){return this.float?parseFloat(t):parseInt(t)}valid(t){return t==="-"||t==="."&&this.float||Gs.test(t)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let t=this.value;this.value=t!==""?t:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
18
+ ${i?" ":Ds.pointerSmall} ${ht.red().italic(e)}`,"")),this.out.write(Es.line+jt.to(0)+this.outputText))}}var ks=Hs;const tt=E,Bs=N,{cursor:et,erase:Us}=D,{style:at,figures:zs,clear:Lt,lines:Js}=I,Gs=/[0-9]/,ut=s=>s!==void 0,Yt=(s,t)=>{let e=Math.pow(10,t);return Math.round(s*e)/e};class Ws extends Bs{constructor(t={}){super(t),this.transform=at.render(t.style),this.msg=t.message,this.initial=ut(t.initial)?t.initial:"",this.float=!!t.float,this.round=t.round||2,this.inc=t.increment||1,this.min=ut(t.min)?t.min:-1/0,this.max=ut(t.max)?t.max:1/0,this.errorMsg=t.error||"Please Enter A Valid Value",this.validator=t.validate||(()=>!0),this.color="cyan",this.value="",this.typed="",this.lastHit=0,this.render()}set value(t){!t&&t!==0?(this.placeholder=!0,this.rendered=tt.gray(this.transform.render(`${this.initial}`)),this._value=""):(this.placeholder=!1,this.rendered=this.transform.render(`${Yt(t,this.round)}`),this._value=Yt(t,this.round)),this.fire()}get value(){return this._value}parse(t){return this.float?parseFloat(t):parseInt(t)}valid(t){return t==="-"||t==="."&&this.float||Gs.test(t)}reset(){this.typed="",this.value="",this.fire(),this.render()}exit(){this.abort()}abort(){let t=this.value;this.value=t!==""?t:this.initial,this.done=this.aborted=!0,this.error=!1,this.fire(),this.render(),this.out.write(`
19
19
  `),this.close()}async validate(){let t=await this.validator(this.value);typeof t=="string"&&(this.errorMsg=t,t=!1),this.error=!t}async submit(){if(await this.validate(),this.error){this.color="red",this.fire(),this.render();return}let t=this.value;this.value=t!==""?t:this.initial,this.done=!0,this.aborted=!1,this.error=!1,this.fire(),this.render(),this.out.write(`
20
- `),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let t=this.value.toString();if(t.length===0)return this.bell();this.value=this.parse(t=t.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(t,e){if(!this.valid(t))return this.bell();const i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=t,this.lastHit=i,this.color="cyan",t===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(st.down(Js(this.outputError,this.out.columns)-1)+Vt(this.outputError,this.out.columns)),this.out.write(Vt(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[ct.symbol(this.done,this.aborted),et.bold(this.msg),ct.delimiter(this.done),!this.done||!this.done&&!this.placeholder?et[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
20
+ `),this.close()}up(){if(this.typed="",this.value===""&&(this.value=this.min-this.inc),this.value>=this.max)return this.bell();this.value+=this.inc,this.color="cyan",this.fire(),this.render()}down(){if(this.typed="",this.value===""&&(this.value=this.min+this.inc),this.value<=this.min)return this.bell();this.value-=this.inc,this.color="cyan",this.fire(),this.render()}delete(){let t=this.value.toString();if(t.length===0)return this.bell();this.value=this.parse(t=t.slice(0,-1))||"",this.value!==""&&this.value<this.min&&(this.value=this.min),this.color="cyan",this.fire(),this.render()}next(){this.value=this.initial,this.fire(),this.render()}_(t,e){if(!this.valid(t))return this.bell();const i=Date.now();if(i-this.lastHit>1e3&&(this.typed=""),this.typed+=t,this.lastHit=i,this.color="cyan",t===".")return this.fire();this.value=Math.min(this.parse(this.typed),this.max),this.value>this.max&&(this.value=this.max),this.value<this.min&&(this.value=this.min),this.fire(),this.render()}render(){this.closed||(this.firstRender||(this.outputError&&this.out.write(et.down(Js(this.outputError,this.out.columns)-1)+Lt(this.outputError,this.out.columns)),this.out.write(Lt(this.outputText,this.out.columns))),super.render(),this.outputError="",this.outputText=[at.symbol(this.done,this.aborted),tt.bold(this.msg),at.delimiter(this.done),!this.done||!this.done&&!this.placeholder?tt[this.color]().underline(this.rendered):this.rendered].join(" "),this.error&&(this.outputError+=this.errorMsg.split(`
21
21
  `).reduce((t,e,i)=>t+`
22
- ${i?" ":zs.pointerSmall} ${et.red().italic(e)}`,"")),this.out.write(Us.line+st.to(0)+this.outputText+st.save+this.outputError+st.restore))}}var Ks=Ws;const I=C,{cursor:Zs}=T,qs=F,{clear:Ht,figures:N,style:kt,wrap:Xs,entriesToDisplay:Qs}=E;let ti=class extends qs{constructor(t={}){super(t),this.msg=t.message,this.cursor=t.cursor||0,this.scrollIndex=t.cursor||0,this.hint=t.hint||"",this.warn=t.warn||"- This option is disabled -",this.minSelected=t.min,this.showMinError=!1,this.maxChoices=t.max,this.instructions=t.instructions,this.optionsPerPage=t.optionsPerPage||10,this.value=t.choices.map((e,i)=>(typeof e=="string"&&(e={title:e,value:i}),{title:e&&(e.title||e.value||e),description:e&&e.description,value:e&&(e.value===void 0?i:e.value),selected:e&&e.selected,disabled:e&&e.disabled})),this.clear=Ht("",this.out.columns),t.overrideRender||this.render()}reset(){this.value.map(t=>!t.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(t=>t.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
22
+ ${i?" ":zs.pointerSmall} ${tt.red().italic(e)}`,"")),this.out.write(Us.line+et.to(0)+this.outputText+et.save+this.outputError+et.restore))}}var Ks=Ws;const _=E,{cursor:Zs}=D,qs=N,{clear:Vt,figures:L,style:Ht,wrap:Xs,entriesToDisplay:Qs}=I;let ti=class extends qs{constructor(t={}){super(t),this.msg=t.message,this.cursor=t.cursor||0,this.scrollIndex=t.cursor||0,this.hint=t.hint||"",this.warn=t.warn||"- This option is disabled -",this.minSelected=t.min,this.showMinError=!1,this.maxChoices=t.max,this.instructions=t.instructions,this.optionsPerPage=t.optionsPerPage||10,this.value=t.choices.map((e,i)=>(typeof e=="string"&&(e={title:e,value:i}),{title:e&&(e.title||e.value||e),description:e&&e.description,value:e&&(e.value===void 0?i:e.value),selected:e&&e.selected,disabled:e&&e.disabled})),this.clear=Vt("",this.out.columns),t.overrideRender||this.render()}reset(){this.value.map(t=>!t.selected),this.cursor=0,this.fire(),this.render()}selected(){return this.value.filter(t=>t.selected)}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
23
23
  `),this.close()}submit(){const t=this.value.filter(e=>e.selected);this.minSelected&&t.length<this.minSelected?(this.showMinError=!0,this.render()):(this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
24
24
  `),this.close())}first(){this.cursor=0,this.render()}last(){this.cursor=this.value.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.value.length,this.render()}up(){this.cursor===0?this.cursor=this.value.length-1:this.cursor--,this.render()}down(){this.cursor===this.value.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.value[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();this.value[this.cursor].selected=!0,this.render()}handleSpaceToggle(){const t=this.value[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}toggleAll(){if(this.maxChoices!==void 0||this.value[this.cursor].disabled)return this.bell();const t=!this.value[this.cursor].selected;this.value.filter(e=>!e.disabled).forEach(e=>e.selected=t),this.render()}_(t,e){if(t===" ")this.handleSpaceToggle();else if(t==="a")this.toggleAll();else return this.bell()}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
25
25
  Instructions:
26
- ${N.arrowUp}/${N.arrowDown}: Highlight option
27
- ${N.arrowLeft}/${N.arrowRight}/[space]: Toggle selection
26
+ ${L.arrowUp}/${L.arrowDown}: Highlight option
27
+ ${L.arrowLeft}/${L.arrowRight}/[space]: Toggle selection
28
28
  `+(this.maxChoices===void 0?` a: Toggle all
29
- `:"")+" enter/return: Complete answer":""}renderOption(t,e,i,n){const o=(e.selected?I.green(N.radioOn):N.radioOff)+" "+n+" ";let r,l;return e.disabled?r=t===i?I.gray().underline(e.title):I.strikethrough().gray(e.title):(r=t===i?I.cyan().underline(e.title):e.title,t===i&&e.description&&(l=` - ${e.description}`,(o.length+r.length+l.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(l=`
30
- `+Xs(e.description,{margin:o.length,width:this.out.columns})))),o+r+I.gray(l||"")}paginateOptions(t){if(t.length===0)return I.red("No matches for this query.");let{startIndex:e,endIndex:i}=Qs(this.cursor,t.length,this.optionsPerPage),n,o=[];for(let r=e;r<i;r++)r===e&&e>0?n=N.arrowUp:r===i-1&&i<t.length?n=N.arrowDown:n=" ",o.push(this.renderOption(this.cursor,t[r],r,n));return`
29
+ `:"")+" enter/return: Complete answer":""}renderOption(t,e,i,n){const o=(e.selected?_.green(L.radioOn):L.radioOff)+" "+n+" ";let r,l;return e.disabled?r=t===i?_.gray().underline(e.title):_.strikethrough().gray(e.title):(r=t===i?_.cyan().underline(e.title):e.title,t===i&&e.description&&(l=` - ${e.description}`,(o.length+r.length+l.length>=this.out.columns||e.description.split(/\r?\n/).length>1)&&(l=`
30
+ `+Xs(e.description,{margin:o.length,width:this.out.columns})))),o+r+_.gray(l||"")}paginateOptions(t){if(t.length===0)return _.red("No matches for this query.");let{startIndex:e,endIndex:i}=Qs(this.cursor,t.length,this.optionsPerPage),n,o=[];for(let r=e;r<i;r++)r===e&&e>0?n=L.arrowUp:r===i-1&&i<t.length?n=L.arrowDown:n=" ",o.push(this.renderOption(this.cursor,t[r],r,n));return`
31
31
  `+o.join(`
32
- `)}renderOptions(t){return this.done?"":this.paginateOptions(t)}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(", ");const t=[I.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&t.push(I.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Zs.hide),super.render();let t=[kt.symbol(this.done,this.aborted),I.bold(this.msg),kt.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=I.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.value),this.out.write(this.clear+t),this.clear=Ht(t,this.out.columns)}};var Bt=ti;const K=C,ei=F,{erase:si,cursor:Ut}=T,{style:ft,clear:zt,figures:pt,wrap:ii,entriesToDisplay:ri}=E,Jt=(s,t)=>s[t]&&(s[t].value||s[t].title||s[t]),ni=(s,t)=>s[t]&&(s[t].title||s[t].value||s[t]),oi=(s,t)=>{const e=s.findIndex(i=>i.value===t||i.title===t);return e>-1?e:void 0};class li extends ei{constructor(t={}){super(t),this.msg=t.message,this.suggest=t.suggest,this.choices=t.choices,this.initial=typeof t.initial=="number"?t.initial:oi(t.choices,t.initial),this.select=this.initial||t.cursor||0,this.i18n={noMatches:t.noMatches||"no matches found"},this.fallback=t.fallback||this.initial,this.clearFirst=t.clearFirst||!1,this.suggestions=[],this.input="",this.limit=t.limit||10,this.cursor=0,this.transform=ft.render(t.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=zt("",this.out.columns),this.complete(this.render),this.render()}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t}get fallback(){let t;return typeof this._fb=="number"?t=this.choices[this._fb]:typeof this._fb=="string"&&(t={title:this._fb}),t||this._fb||{title:this.i18n.noMatches}}moveSelect(t){this.select=t,this.suggestions.length>0?this.value=Jt(this.suggestions,t):this.value=this.fallback.value,this.fire()}async complete(t){const e=this.completing=this.suggest(this.input,this.choices),i=await e;if(this.completing!==e)return;this.suggestions=i.map((o,r,l)=>({title:ni(l,r),value:Jt(l,r),description:o.description})),this.completing=!1;const n=Math.max(i.length-1,0);this.moveSelect(Math.min(n,this.select)),t&&t()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
32
+ `)}renderOptions(t){return this.done?"":this.paginateOptions(t)}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(", ");const t=[_.gray(this.hint),this.renderInstructions()];return this.value[this.cursor].disabled&&t.push(_.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(Zs.hide),super.render();let t=[Ht.symbol(this.done,this.aborted),_.bold(this.msg),Ht.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=_.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.value),this.out.write(this.clear+t),this.clear=Vt(t,this.out.columns)}};var kt=ti;const K=E,ei=N,{erase:si,cursor:Bt}=D,{style:ct,clear:Ut,figures:dt,wrap:ii,entriesToDisplay:ri}=I,zt=(s,t)=>s[t]&&(s[t].value||s[t].title||s[t]),ni=(s,t)=>s[t]&&(s[t].title||s[t].value||s[t]),oi=(s,t)=>{const e=s.findIndex(i=>i.value===t||i.title===t);return e>-1?e:void 0};class li extends ei{constructor(t={}){super(t),this.msg=t.message,this.suggest=t.suggest,this.choices=t.choices,this.initial=typeof t.initial=="number"?t.initial:oi(t.choices,t.initial),this.select=this.initial||t.cursor||0,this.i18n={noMatches:t.noMatches||"no matches found"},this.fallback=t.fallback||this.initial,this.clearFirst=t.clearFirst||!1,this.suggestions=[],this.input="",this.limit=t.limit||10,this.cursor=0,this.transform=ct.render(t.style),this.scale=this.transform.scale,this.render=this.render.bind(this),this.complete=this.complete.bind(this),this.clear=Ut("",this.out.columns),this.complete(this.render),this.render()}set fallback(t){this._fb=Number.isSafeInteger(parseInt(t))?parseInt(t):t}get fallback(){let t;return typeof this._fb=="number"?t=this.choices[this._fb]:typeof this._fb=="string"&&(t={title:this._fb}),t||this._fb||{title:this.i18n.noMatches}}moveSelect(t){this.select=t,this.suggestions.length>0?this.value=zt(this.suggestions,t):this.value=this.fallback.value,this.fire()}async complete(t){const e=this.completing=this.suggest(this.input,this.choices),i=await e;if(this.completing!==e)return;this.suggestions=i.map((o,r,l)=>({title:ni(l,r),value:zt(l,r),description:o.description})),this.completing=!1;const n=Math.max(i.length-1,0);this.moveSelect(Math.min(n,this.select)),t&&t()}reset(){this.input="",this.complete(()=>{this.moveSelect(this.initial!==void 0?this.initial:0),this.render()}),this.render()}exit(){this.clearFirst&&this.input.length>0?this.reset():(this.done=this.exited=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
33
33
  `),this.close())}abort(){this.done=this.aborted=!0,this.exited=!1,this.fire(),this.render(),this.out.write(`
34
34
  `),this.close()}submit(){this.done=!0,this.aborted=this.exited=!1,this.fire(),this.render(),this.out.write(`
35
- `),this.close()}_(t,e){let i=this.input.slice(0,this.cursor),n=this.input.slice(this.cursor);this.input=`${i}${t}${n}`,this.cursor=i.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let t=this.input.slice(0,this.cursor-1),e=this.input.slice(this.cursor);this.input=`${t}${e}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor),e=this.input.slice(this.cursor+1);this.input=`${t}${e}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(t,e,i,n){let o,r=i?pt.arrowUp:n?pt.arrowDown:" ",l=e?K.cyan().underline(t.title):t.title;return r=(e?K.cyan(pt.pointer)+" ":" ")+r,t.description&&(o=` - ${t.description}`,(r.length+l.length+o.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(o=`
36
- `+ii(t.description,{margin:3,width:this.out.columns}))),r+" "+l+K.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(Ut.hide):this.out.write(zt(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:e}=ri(this.select,this.choices.length,this.limit);if(this.outputText=[ft.symbol(this.done,this.aborted,this.exited),K.bold(this.msg),ft.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const i=this.suggestions.slice(t,e).map((n,o)=>this.renderOption(n,this.select===o+t,o===0&&t>0,o+t===e-1&&e<this.choices.length)).join(`
35
+ `),this.close()}_(t,e){let i=this.input.slice(0,this.cursor),n=this.input.slice(this.cursor);this.input=`${i}${t}${n}`,this.cursor=i.length+1,this.complete(this.render),this.render()}delete(){if(this.cursor===0)return this.bell();let t=this.input.slice(0,this.cursor-1),e=this.input.slice(this.cursor);this.input=`${t}${e}`,this.complete(this.render),this.cursor=this.cursor-1,this.render()}deleteForward(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();let t=this.input.slice(0,this.cursor),e=this.input.slice(this.cursor+1);this.input=`${t}${e}`,this.complete(this.render),this.render()}first(){this.moveSelect(0),this.render()}last(){this.moveSelect(this.suggestions.length-1),this.render()}up(){this.select===0?this.moveSelect(this.suggestions.length-1):this.moveSelect(this.select-1),this.render()}down(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}next(){this.select===this.suggestions.length-1?this.moveSelect(0):this.moveSelect(this.select+1),this.render()}nextPage(){this.moveSelect(Math.min(this.select+this.limit,this.suggestions.length-1)),this.render()}prevPage(){this.moveSelect(Math.max(this.select-this.limit,0)),this.render()}left(){if(this.cursor<=0)return this.bell();this.cursor=this.cursor-1,this.render()}right(){if(this.cursor*this.scale>=this.rendered.length)return this.bell();this.cursor=this.cursor+1,this.render()}renderOption(t,e,i,n){let o,r=i?dt.arrowUp:n?dt.arrowDown:" ",l=e?K.cyan().underline(t.title):t.title;return r=(e?K.cyan(dt.pointer)+" ":" ")+r,t.description&&(o=` - ${t.description}`,(r.length+l.length+o.length>=this.out.columns||t.description.split(/\r?\n/).length>1)&&(o=`
36
+ `+ii(t.description,{margin:3,width:this.out.columns}))),r+" "+l+K.gray(o||"")}render(){if(this.closed)return;this.firstRender?this.out.write(Bt.hide):this.out.write(Ut(this.outputText,this.out.columns)),super.render();let{startIndex:t,endIndex:e}=ri(this.select,this.choices.length,this.limit);if(this.outputText=[ct.symbol(this.done,this.aborted,this.exited),K.bold(this.msg),ct.delimiter(this.completing),this.done&&this.suggestions[this.select]?this.suggestions[this.select].title:this.rendered=this.transform.render(this.input)].join(" "),!this.done){const i=this.suggestions.slice(t,e).map((n,o)=>this.renderOption(n,this.select===o+t,o===0&&t>0,o+t===e-1&&e<this.choices.length)).join(`
37
37
  `);this.outputText+=`
38
- `+(i||K.gray(this.fallback.title))}this.out.write(si.line+Ut.to(0)+this.outputText)}}var hi=li;const j=C,{cursor:ai}=T,ui=Bt,{clear:Gt,style:Wt,figures:B}=E;class ci extends ui{constructor(t={}){t.overrideRender=!0,super(t),this.inputValue="",this.clear=Gt("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){const t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);const e=this.filteredOptions.findIndex(i=>i===t);this.cursor=e<0?0:e,this.render()}handleSpaceToggle(){const t=this.filteredOptions[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t,this.updateFilteredOptions()}_(t,e){t===" "?this.handleSpaceToggle():this.handleInputChange(t)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
38
+ `+(i||K.gray(this.fallback.title))}this.out.write(si.line+Bt.to(0)+this.outputText)}}var hi=li;const j=E,{cursor:ai}=D,ui=kt,{clear:Jt,style:Gt,figures:B}=I;class ci extends ui{constructor(t={}){t.overrideRender=!0,super(t),this.inputValue="",this.clear=Jt("",this.out.columns),this.filteredOptions=this.value,this.render()}last(){this.cursor=this.filteredOptions.length-1,this.render()}next(){this.cursor=(this.cursor+1)%this.filteredOptions.length,this.render()}up(){this.cursor===0?this.cursor=this.filteredOptions.length-1:this.cursor--,this.render()}down(){this.cursor===this.filteredOptions.length-1?this.cursor=0:this.cursor++,this.render()}left(){this.filteredOptions[this.cursor].selected=!1,this.render()}right(){if(this.value.filter(t=>t.selected).length>=this.maxChoices)return this.bell();this.filteredOptions[this.cursor].selected=!0,this.render()}delete(){this.inputValue.length&&(this.inputValue=this.inputValue.substr(0,this.inputValue.length-1),this.updateFilteredOptions())}updateFilteredOptions(){const t=this.filteredOptions[this.cursor];this.filteredOptions=this.value.filter(i=>this.inputValue?!!(typeof i.title=="string"&&i.title.toLowerCase().includes(this.inputValue.toLowerCase())||typeof i.value=="string"&&i.value.toLowerCase().includes(this.inputValue.toLowerCase())):!0);const e=this.filteredOptions.findIndex(i=>i===t);this.cursor=e<0?0:e,this.render()}handleSpaceToggle(){const t=this.filteredOptions[this.cursor];if(t.selected)t.selected=!1,this.render();else{if(t.disabled||this.value.filter(e=>e.selected).length>=this.maxChoices)return this.bell();t.selected=!0,this.render()}}handleInputChange(t){this.inputValue=this.inputValue+t,this.updateFilteredOptions()}_(t,e){t===" "?this.handleSpaceToggle():this.handleInputChange(t)}renderInstructions(){return this.instructions===void 0||this.instructions?typeof this.instructions=="string"?this.instructions:`
39
39
  Instructions:
40
40
  ${B.arrowUp}/${B.arrowDown}: Highlight option
41
41
  ${B.arrowLeft}/${B.arrowRight}/[space]: Toggle selection
@@ -43,10 +43,10 @@ Instructions:
43
43
  enter/return: Complete answer
44
44
  `:""}renderCurrentInput(){return`
45
45
  Filtered results for: ${this.inputValue?this.inputValue:j.gray("Enter something to filter")}
46
- `}renderOption(t,e,i){let n;return e.disabled?n=t===i?j.gray().underline(e.title):j.strikethrough().gray(e.title):n=t===i?j.cyan().underline(e.title):e.title,(e.selected?j.green(B.radioOn):B.radioOff)+" "+n}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(", ");const t=[j.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(j.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(ai.hide),super.render();let t=[Wt.symbol(this.done,this.aborted),j.bold(this.msg),Wt.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=j.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+t),this.clear=Gt(t,this.out.columns)}}var di=ci;const Kt=C,fi=F,{style:Zt,clear:pi}=E,{erase:mi,cursor:qt}=T;class gi extends fi{constructor(t={}){super(t),this.msg=t.message,this.value=t.initial,this.initialValue=!!t.initial,this.yesMsg=t.yes||"yes",this.yesOption=t.yesOption||"(Y/n)",this.noMsg=t.no||"no",this.noOption=t.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
46
+ `}renderOption(t,e,i){let n;return e.disabled?n=t===i?j.gray().underline(e.title):j.strikethrough().gray(e.title):n=t===i?j.cyan().underline(e.title):e.title,(e.selected?j.green(B.radioOn):B.radioOff)+" "+n}renderDoneOrInstructions(){if(this.done)return this.value.filter(e=>e.selected).map(e=>e.title).join(", ");const t=[j.gray(this.hint),this.renderInstructions(),this.renderCurrentInput()];return this.filteredOptions.length&&this.filteredOptions[this.cursor].disabled&&t.push(j.yellow(this.warn)),t.join(" ")}render(){if(this.closed)return;this.firstRender&&this.out.write(ai.hide),super.render();let t=[Gt.symbol(this.done,this.aborted),j.bold(this.msg),Gt.delimiter(!1),this.renderDoneOrInstructions()].join(" ");this.showMinError&&(t+=j.red(`You must select a minimum of ${this.minSelected} choices.`),this.showMinError=!1),t+=this.renderOptions(this.filteredOptions),this.out.write(this.clear+t),this.clear=Jt(t,this.out.columns)}}var di=ci;const Wt=E,fi=N,{style:Kt,clear:pi}=I,{erase:mi,cursor:Zt}=D;class gi extends fi{constructor(t={}){super(t),this.msg=t.message,this.value=t.initial,this.initialValue=!!t.initial,this.yesMsg=t.yes||"yes",this.yesOption=t.yesOption||"(Y/n)",this.noMsg=t.no||"no",this.noOption=t.noOption||"(y/N)",this.render()}reset(){this.value=this.initialValue,this.fire(),this.render()}exit(){this.abort()}abort(){this.done=this.aborted=!0,this.fire(),this.render(),this.out.write(`
47
47
  `),this.close()}submit(){this.value=this.value||!1,this.done=!0,this.aborted=!1,this.fire(),this.render(),this.out.write(`
48
- `),this.close()}_(t,e){return t.toLowerCase()==="y"?(this.value=!0,this.submit()):t.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(qt.hide):this.out.write(pi(this.outputText,this.out.columns)),super.render(),this.outputText=[Zt.symbol(this.done,this.aborted),Kt.bold(this.msg),Zt.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Kt.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(mi.line+qt.to(0)+this.outputText))}}var bi=gi,vi={TextPrompt:Be,SelectPrompt:Ke,TogglePrompt:ts,DatePrompt:ks,NumberPrompt:Ks,MultiselectPrompt:Bt,AutocompletePrompt:hi,AutocompleteMultiselectPrompt:di,ConfirmPrompt:bi};(function(s){const t=s,e=vi,i=r=>r;function n(r,l,b={}){return new Promise((h,D)=>{const m=new e[r](l),a=b.onAbort||i,c=b.onSubmit||i,v=b.onExit||i;m.on("state",l.onState||i),m.on("submit",O=>h(c(O))),m.on("exit",O=>h(v(O))),m.on("abort",O=>D(a(O)))})}t.text=r=>n("TextPrompt",r),t.password=r=>(r.style="password",t.text(r)),t.invisible=r=>(r.style="invisible",t.text(r)),t.number=r=>n("NumberPrompt",r),t.date=r=>n("DatePrompt",r),t.confirm=r=>n("ConfirmPrompt",r),t.list=r=>{const l=r.separator||",";return n("TextPrompt",r,{onSubmit:b=>b.split(l).map(h=>h.trim())})},t.toggle=r=>n("TogglePrompt",r),t.select=r=>n("SelectPrompt",r),t.multiselect=r=>{r.choices=[].concat(r.choices||[]);const l=b=>b.filter(h=>h.selected).map(h=>h.value);return n("MultiselectPrompt",r,{onAbort:l,onSubmit:l})},t.autocompleteMultiselect=r=>{r.choices=[].concat(r.choices||[]);const l=b=>b.filter(h=>h.selected).map(h=>h.value);return n("AutocompleteMultiselectPrompt",r,{onAbort:l,onSubmit:l})};const o=(r,l)=>Promise.resolve(l.filter(b=>b.title.slice(0,r.length).toLowerCase()===r.toLowerCase()));t.autocomplete=r=>(r.suggest=r.suggest||o,r.choices=[].concat(r.choices||[]),n("AutocompletePrompt",r))})(Mt);const mt=Mt,wi=["suggest","format","onState","validate","onRender","type"],Xt=()=>{};async function L(s=[],{onSubmit:t=Xt,onCancel:e=Xt}={}){const i={},n=L._override||{};s=[].concat(s);let o,r,l,b,h,D;const m=async(a,c,v=!1)=>{if(!(!v&&a.validate&&a.validate(c)!==!0))return a.format?await a.format(c,i):c};for(r of s)if({name:b,type:h}=r,typeof h=="function"&&(h=await h(o,{...i},r),r.type=h),!!h){for(let a in r){if(wi.includes(a))continue;let c=r[a];r[a]=typeof c=="function"?await c(o,{...i},D):c}if(D=r,typeof r.message!="string")throw new Error("prompt message is required");if({name:b,type:h}=r,mt[h]===void 0)throw new Error(`prompt type (${h}) is not defined`);if(n[r.name]!==void 0&&(o=await m(r,n[r.name]),o!==void 0)){i[b]=o;continue}try{o=L._injected?yi(L._injected,r.initial):await mt[h](r),i[b]=o=await m(r,o,!0),l=await t(r,o,i)}catch{l=!await e(r,i)}if(l)return i}return i}function yi(s,t){const e=s.shift();if(e instanceof Error)throw e;return e===void 0?t:e}function $i(s){L._injected=(L._injected||[]).concat(s)}function xi(s){L._override=Object.assign({},s)}var Si=Object.assign(L,{prompt:L,prompts:mt,inject:$i,override:xi});const Oi=xt(Si);let H=!0;const U=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let Z=0;if(U.process&&U.process.env&&U.process.stdout){const{FORCE_COLOR:s,NODE_DISABLE_COLORS:t,NO_COLOR:e,TERM:i,COLORTERM:n}=U.process.env;t||e||s==="0"?H=!1:s==="1"||s==="2"||s==="3"?H=!0:i==="dumb"?H=!1:"CI"in U.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(o=>o in U.process.env)?H=!0:H=process.stdout.isTTY,H&&(process.platform==="win32"||n&&(n==="truecolor"||n==="24bit")?Z=3:i&&(i.endsWith("-256color")||i.endsWith("256"))?Z=2:Z=1)}let Qt={enabled:H,supportLevel:Z};function it(s,t,e=1){const i=`\x1B[${s}m`,n=`\x1B[${t}m`,o=new RegExp(`\\x1b\\[${t}m`,"g");return r=>Qt.enabled&&Qt.supportLevel>=e?i+(""+r).replace(o,i)+n:""+r}const rt=it(0,0),te=it(31,39),nt=it(34,39),Mi=it(90,39);function ee(s){return s?.trim().replace(/\/+$/g,"")}function gt(s,t){x.statSync(s).isDirectory()?Ti(s,t):x.copyFileSync(s,t)}function se(s){return/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(s)}function Pi(s){return s.trim().toLowerCase().replace(/\s+/g,"-").replace(/^[._]/,"").replace(/[^a-z\d\-~]+/g,"-")}function Ti(s,t){x.mkdirSync(t,{recursive:!0});for(const e of x.readdirSync(s)){const i=S.resolve(s,e),n=S.resolve(t,e);gt(i,n)}}function Ci(s){const t=x.readdirSync(s);return t.length===0||t.length===1&&t[0]===".git"}function Di(s){if(x.existsSync(s))for(const t of x.readdirSync(s))t!==".git"&&x.rmSync(S.resolve(s,t),{recursive:!0,force:!0})}function Ei(s){if(!s)return;const t=s.split(" ")[0].split("/");return{name:t[0],version:t[1]}}const bt=ce(process.argv.slice(2),{string:["_"]}),vt=process.cwd(),ie=[{name:"vite",display:"\u26A1Vite + React",color:nt},{name:"next",display:"\u25B2 Next.js",color:nt},{name:"viteuno",display:"\u26A1Vite + UnoCSS ",color:nt},{name:"sveltekit",display:"\u26A1Vite + SvelteKit",color:nt}],re=ie.map(s=>s.name),ne=[{title:"Windows (x64)",value:"windows-latest"},{title:"macOS (x64)",value:"macos-latest"},{title:"Linux (x64)",value:"ubuntu-latest"}],oe=ne.map(s=>s.value),Ii={_gitignore:".gitignore"},wt="tauri-ui";async function _i(){const s=ee(bt._[0]),t=bt.selectedTemplate||bt.t;let e=s||wt;const i=()=>e==="."?S.basename(S.resolve()):e,n=await Oi([{type:s?null:"text",name:"projectName",message:rt("Project name:"),initial:wt,onState:d=>{e=ee(d.value)||wt}},{type:()=>!x.existsSync(e)||Ci(e)?null:"confirm",name:"overwrite",message:()=>(e==="."?"Current directory":`Target directory "${e}"`)+" is not empty. Remove existing templateFiles and continue?"},{type:(d,{overwrite:y})=>{if(y===!1)throw new Error(te("\u2716")+" Operation cancelled");return null},name:"overwriteChecker"},{type:()=>se(i())?null:"text",name:"packageName",message:rt("Package name:"),initial:()=>Pi(i()),validate:d=>se(d)||"Invalid package.json name"},{type:t&&re.includes(t)?null:"select",name:"framework",message:typeof t=="string"&&!re.includes(t)?rt(`"${t}" isn't a valid selectedTemplate . Please choose from below: `):rt("Select a framework:"),initial:0,choices:ie.map(d=>{const y=d.color;return{title:y(d.display||d.name),value:d}})},{type:"multiselect",name:"releaseOS",message:"Target operating systems for the Tauri Github Action",choices:ne.map(d=>({title:d.title,value:d.value,selected:!0})),instructions:!1,hint:"- Space to select/deselect. Press Enter to submit"}],{onCancel:()=>{throw new Error(te("\u2716")+" Operation cancelled")}}),{framework:o,overwrite:r,packageName:l,releaseOS:b}=n,h=S.join(vt,e);r?Di(h):x.existsSync(h)||x.mkdirSync(h,{recursive:!0});let D=o?.name||t;const m=Ei(process.env.npm_config_user_agent),a=m?m.name:"npm";console.log(`
49
- Scaffolding project in ${Mi(h)}`);const c=S.resolve($t(import.meta.url),"../../templates/",D),v=S.resolve($t(import.meta.url),"../../templates/.shared"),O=(d,y)=>{const q=S.join(h,Ii[d]??d);y?x.writeFileSync(q,y):gt(S.join(c,d),q)},z=x.readdirSync(c);for(const d of z.filter(y=>y!=="package.json"||"tauri.conf.json"))O(d);const M=x.readdirSync(v);for(const d of M){const y=S.join(v,d),q=S.join(h,d);gt(y,q)}const V=JSON.parse(x.readFileSync(S.join(c,"package.json"),"utf-8"));V.name=l||i(),O("package.json",JSON.stringify(V,null,2)+`
50
- `);const $=JSON.parse(x.readFileSync(S.join(c,"/src-tauri/tauri.conf.json"),"utf-8"));$.tauri.windows[0].title=l||i(),$.package.productName=l||i(),O("/src-tauri/tauri.conf.json",JSON.stringify($,null,2)+`
51
- `);const u=S.join(v,"/src-tauri/Cargo.toml"),w=x.readFileSync(u,"utf-8").replace(/name\s*=\s*"tauri-ui"/,`name = "${l||i()}"`);O("/src-tauri/Cargo.toml",w);const P=S.join(v,".github/workflows/release.yml"),f=x.readFileSync(P,"utf-8").replace("platform: [macos-latest, ubuntu-latest, windows-latest]",`platform: [${b.join(", ")}]`+(b.length<oe.length?` # ${oe.filter(d=>!b.includes(d)).join(", ")}`:""));O(".github/workflows/release.yml",f);const _=S.relative(vt,h);switch(console.log(`
52
- Done. Now run:`),h!==vt&&console.log(` cd ${_.includes(" ")?`"${_}"`:_}`),a){case"yarn":console.log(" yarn"),console.log(" yarn tauri dev");break;case"pnpm":console.log(" pnpm i"),console.log(" pnpm tauri dev");break;default:console.log(` ${a} install`),console.log(` ${a} run tauri dev`);break}console.log()}_i().catch(s=>{console.error(s)});
48
+ `),this.close()}_(t,e){return t.toLowerCase()==="y"?(this.value=!0,this.submit()):t.toLowerCase()==="n"?(this.value=!1,this.submit()):this.bell()}render(){this.closed||(this.firstRender?this.out.write(Zt.hide):this.out.write(pi(this.outputText,this.out.columns)),super.render(),this.outputText=[Kt.symbol(this.done,this.aborted),Wt.bold(this.msg),Kt.delimiter(this.done),this.done?this.value?this.yesMsg:this.noMsg:Wt.gray(this.initialValue?this.yesOption:this.noOption)].join(" "),this.out.write(mi.line+Zt.to(0)+this.outputText))}}var bi=gi,vi={TextPrompt:Be,SelectPrompt:Ke,TogglePrompt:ts,DatePrompt:ks,NumberPrompt:Ks,MultiselectPrompt:kt,AutocompletePrompt:hi,AutocompleteMultiselectPrompt:di,ConfirmPrompt:bi};(function(s){const t=s,e=vi,i=r=>r;function n(r,l,b={}){return new Promise((h,T)=>{const m=new e[r](l),a=b.onAbort||i,c=b.onSubmit||i,v=b.onExit||i;m.on("state",l.onState||i),m.on("submit",O=>h(c(O))),m.on("exit",O=>h(v(O))),m.on("abort",O=>T(a(O)))})}t.text=r=>n("TextPrompt",r),t.password=r=>(r.style="password",t.text(r)),t.invisible=r=>(r.style="invisible",t.text(r)),t.number=r=>n("NumberPrompt",r),t.date=r=>n("DatePrompt",r),t.confirm=r=>n("ConfirmPrompt",r),t.list=r=>{const l=r.separator||",";return n("TextPrompt",r,{onSubmit:b=>b.split(l).map(h=>h.trim())})},t.toggle=r=>n("TogglePrompt",r),t.select=r=>n("SelectPrompt",r),t.multiselect=r=>{r.choices=[].concat(r.choices||[]);const l=b=>b.filter(h=>h.selected).map(h=>h.value);return n("MultiselectPrompt",r,{onAbort:l,onSubmit:l})},t.autocompleteMultiselect=r=>{r.choices=[].concat(r.choices||[]);const l=b=>b.filter(h=>h.selected).map(h=>h.value);return n("AutocompleteMultiselectPrompt",r,{onAbort:l,onSubmit:l})};const o=(r,l)=>Promise.resolve(l.filter(b=>b.title.slice(0,r.length).toLowerCase()===r.toLowerCase()));t.autocomplete=r=>(r.suggest=r.suggest||o,r.choices=[].concat(r.choices||[]),n("AutocompletePrompt",r))})(Ot);const ft=Ot,wi=["suggest","format","onState","validate","onRender","type"],qt=()=>{};async function Y(s=[],{onSubmit:t=qt,onCancel:e=qt}={}){const i={},n=Y._override||{};s=[].concat(s);let o,r,l,b,h,T;const m=async(a,c,v=!1)=>{if(!(!v&&a.validate&&a.validate(c)!==!0))return a.format?await a.format(c,i):c};for(r of s)if({name:b,type:h}=r,typeof h=="function"&&(h=await h(o,{...i},r),r.type=h),!!h){for(let a in r){if(wi.includes(a))continue;let c=r[a];r[a]=typeof c=="function"?await c(o,{...i},T):c}if(T=r,typeof r.message!="string")throw new Error("prompt message is required");if({name:b,type:h}=r,ft[h]===void 0)throw new Error(`prompt type (${h}) is not defined`);if(n[r.name]!==void 0&&(o=await m(r,n[r.name]),o!==void 0)){i[b]=o;continue}try{o=Y._injected?yi(Y._injected,r.initial):await ft[h](r),i[b]=o=await m(r,o,!0),l=await t(r,o,i)}catch{l=!await e(r,i)}if(l)return i}return i}function yi(s,t){const e=s.shift();if(e instanceof Error)throw e;return e===void 0?t:e}function $i(s){Y._injected=(Y._injected||[]).concat(s)}function xi(s){Y._override=Object.assign({},s)}var Si=Object.assign(Y,{prompt:Y,prompts:ft,inject:$i,override:xi});const Oi=$t(Si);let H=!0;const U=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let Z=0;if(U.process&&U.process.env&&U.process.stdout){const{FORCE_COLOR:s,NODE_DISABLE_COLORS:t,NO_COLOR:e,TERM:i,COLORTERM:n}=U.process.env;t||e||s==="0"?H=!1:s==="1"||s==="2"||s==="3"?H=!0:i==="dumb"?H=!1:"CI"in U.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(o=>o in U.process.env)?H=!0:H=process.stdout.isTTY,H&&(process.platform==="win32"||n&&(n==="truecolor"||n==="24bit")?Z=3:i&&(i.endsWith("-256color")||i.endsWith("256"))?Z=2:Z=1)}let Xt={enabled:H,supportLevel:Z};function st(s,t,e=1){const i=`\x1B[${s}m`,n=`\x1B[${t}m`,o=new RegExp(`\\x1b\\[${t}m`,"g");return r=>Xt.enabled&&Xt.supportLevel>=e?i+(""+r).replace(o,i)+n:""+r}const it=st(0,0),Qt=st(31,39),pt=st(34,39),Mi=st(90,39);function te(s){return s?.trim().replace(/\/+$/g,"")}function mt(s,t){$.statSync(s).isDirectory()?Ti(s,t):$.copyFileSync(s,t)}function ee(s){return/^(?:@[a-z\d\-*~][a-z\d\-*._~]*\/)?[a-z\d\-~][a-z\d\-._~]*$/.test(s)}function Pi(s){return s.trim().toLowerCase().replace(/\s+/g,"-").replace(/^[._]/,"").replace(/[^a-z\d\-~]+/g,"-")}function Ti(s,t){$.mkdirSync(t,{recursive:!0});for(const e of $.readdirSync(s)){const i=x.resolve(s,e),n=x.resolve(t,e);mt(i,n)}}function Ci(s){const t=$.readdirSync(s);return t.length===0||t.length===1&&t[0]===".git"}function Di(s){if($.existsSync(s))for(const t of $.readdirSync(s))t!==".git"&&$.rmSync(x.resolve(s,t),{recursive:!0,force:!0})}function Ei(s){if(!s)return;const t=s.split(" ")[0].split("/");return{name:t[0],version:t[1]}}const gt=ce(process.argv.slice(2),{string:["_"]}),bt=process.cwd(),se=[{name:"vite",display:"\u26A1Vite + React",color:pt},{name:"next",display:"\u25B2 Next.js",color:pt},{name:"sveltekit",display:"\u26A1Vite + SvelteKit",color:pt}],ie=se.map(s=>s.name),re=[{title:"Windows (x64)",value:"windows-latest"},{title:"macOS (x64)",value:"macos-latest"},{title:"Linux (x64)",value:"ubuntu-latest"}],ne=re.map(s=>s.value),Ii={_gitignore:".gitignore"},vt="tauri-ui";async function _i(){const s=te(gt._[0]),t=gt.selectedTemplate||gt.t;let e=s||vt;const i=()=>e==="."?x.basename(x.resolve()):e,n=await Oi([{type:s?null:"text",name:"projectName",message:it("Project name:"),initial:vt,onState:p=>{e=te(p.value)||vt}},{type:()=>!$.existsSync(e)||Ci(e)?null:"confirm",name:"overwrite",message:()=>(e==="."?"Current directory":`Target directory "${e}"`)+" is not empty. Remove existing templateFiles and continue?"},{type:(p,{overwrite:w})=>{if(w===!1)throw new Error(Qt("\u2716")+" Operation cancelled");return null},name:"overwriteChecker"},{type:()=>ee(i())?null:"text",name:"packageName",message:it("Package name:"),initial:()=>Pi(i()),validate:p=>ee(p)||"Invalid package.json name"},{type:t&&ie.includes(t)?null:"select",name:"framework",message:typeof t=="string"&&!ie.includes(t)?it(`"${t}" isn't a valid selectedTemplate . Please choose from below: `):it("Select a framework:"),initial:0,choices:se.map(p=>{const w=p.color;return{title:w(p.display||p.name),value:p}})},{type:"multiselect",name:"releaseOS",message:"Target operating systems for the Tauri Github Action",choices:re.map(p=>({title:p.title,value:p.value,selected:!0})),instructions:!1,hint:"- Space to select/deselect. Press Enter to submit"}],{onCancel:()=>{throw new Error(Qt("\u2716")+" Operation cancelled")}}),{framework:o,overwrite:r,packageName:l,releaseOS:b}=n,h=x.join(bt,e);r?Di(h):$.existsSync(h)||$.mkdirSync(h,{recursive:!0});let T=o?.name||t;const m=Ei(process.env.npm_config_user_agent),a=m?m.name:"npm";console.log(`
49
+ Scaffolding project in ${Mi(h)}`);const c=x.resolve(yt(import.meta.url),"../../templates/",T),v=x.resolve(yt(import.meta.url),"../../templates/.shared"),O=(p,w)=>{const P=x.join(h,Ii[p]??p);w?$.writeFileSync(P,w):mt(x.join(c,p),P)},z=$.readdirSync(c);for(const p of z.filter(w=>w!=="package.json"||"tauri.conf.json"))O(p);if(T!=="sveltekit"){const p=$.readdirSync(v);for(const w of p){const P=x.join(v,w),oe=x.join(h,w);mt(P,oe)}}const M=JSON.parse($.readFileSync(x.join(c,"package.json"),"utf-8"));M.name=l||i(),O("package.json",JSON.stringify(M,null,2)+`
50
+ `);const F=JSON.parse($.readFileSync(x.join(c,"/src-tauri/tauri.conf.json"),"utf-8"));F.tauri.windows[0].title=l||i(),F.package.productName=l||i(),O("/src-tauri/tauri.conf.json",JSON.stringify(F,null,2)+`
51
+ `);const S=x.join(v,"/src-tauri/Cargo.toml"),u=$.readFileSync(S,"utf-8").replace(/name\s*=\s*"tauri-ui"/,`name = "${l||i()}"`);O("/src-tauri/Cargo.toml",u);const y=x.join(v,".github/workflows/release.yml"),C=$.readFileSync(y,"utf-8").replace("platform: [macos-latest, ubuntu-latest, windows-latest]",`platform: [${b.join(", ")}]`+(b.length<ne.length?` # ${ne.filter(p=>!b.includes(p)).join(", ")}`:""));O(".github/workflows/release.yml",C);const d=x.relative(bt,h);switch(console.log(`
52
+ Done. Now run:`),h!==bt&&console.log(` cd ${d.includes(" ")?`"${d}"`:d}`),a){case"yarn":console.log(" yarn"),console.log(" yarn tauri dev");break;case"pnpm":console.log(" pnpm i"),console.log(" pnpm tauri dev");break;default:console.log(` ${a} install`),console.log(` ${a} run tauri dev`);break}console.log()}_i().catch(s=>{console.error(s)});
package/package.json CHANGED
@@ -1,54 +1,55 @@
1
- {
2
- "name": "create-tauri-ui",
3
- "version": "0.2.1",
4
- "description": "🦀 Create modern Tauri desktop apps in just a few simple steps.",
5
- "main": "index.js",
6
- "author": "agmmnn",
7
- "license": "MIT",
8
- "type": "module",
9
- "scripts": {
10
- "dev": "unbuild --stub",
11
- "build": "unbuild",
12
- "start": "unbuild --stub && node index.js",
13
- "typecheck": "tsc --noEmit",
14
- "prepublishOnly": "npm run build",
15
- "format": "npx prettier --write . --ignore-path .gitignore ",
16
- "taze": "taze minor -r -w -i false -I",
17
- "taze:major": "taze major -r -w -i false -I",
18
- "updatesub": "git submodule update --init --recursive --remote"
19
- },
20
- "bin": {
21
- "create-tauri-ui": "index.js"
22
- },
23
- "files": [
24
- "index.js",
25
- "templates",
26
- "dist"
27
- ],
28
- "repository": {
29
- "type": "git",
30
- "url": "git+https://github.com/agmmnn/tauri-ui.git"
31
- },
32
- "bugs": {
33
- "url": "https://github.com/agmmnn/tauri-ui/issues"
34
- },
35
- "homepage": "https://github.com/agmmnn/tauri-ui",
36
- "dependencies": {
37
- "@clack/core": "^0.3.2",
38
- "@clack/prompts": "^0.6.3",
39
- "picocolors": "^1.0.0",
40
- "sisteransi": "^1.0.5",
41
- "zod": "^3.21.4"
42
- },
43
- "devDependencies": {
44
- "@types/minimist": "^1.2.2",
45
- "@types/node": "^20.4.1",
46
- "@types/prompts": "^2.4.4",
47
- "commander": "^11.0.0",
48
- "kolorist": "^1.8.0",
49
- "minimist": "^1.2.8",
50
- "prompts": "^2.4.2",
51
- "typescript": "^5.1.6",
52
- "unbuild": "^1.2.1"
53
- }
54
- }
1
+ {
2
+ "name": "create-tauri-ui",
3
+ "version": "0.3.1",
4
+ "description": "🦀 Create modern Tauri desktop apps in just a few simple steps.",
5
+ "main": "index.js",
6
+ "author": "agmmnn",
7
+ "license": "MIT",
8
+ "type": "module",
9
+ "scripts": {
10
+ "dev": "unbuild --stub",
11
+ "build": "unbuild",
12
+ "start": "unbuild --stub && node index.js",
13
+ "typecheck": "tsc --noEmit",
14
+ "prepublishOnly": "npm run build",
15
+ "format": "npx prettier --write . --ignore-path .gitignore ",
16
+ "taze": "taze minor -r -w -i false -I",
17
+ "taze:major": "taze major -r -w -i false -I",
18
+ "updatesub": "git submodule update --init --recursive --remote"
19
+ },
20
+ "bin": {
21
+ "create-tauri-ui": "index.js"
22
+ },
23
+ "files": [
24
+ "index.js",
25
+ "templates",
26
+ "dist"
27
+ ],
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/agmmnn/tauri-ui.git"
31
+ },
32
+ "bugs": {
33
+ "url": "https://github.com/agmmnn/tauri-ui/issues"
34
+ },
35
+ "homepage": "https://github.com/agmmnn/tauri-ui",
36
+ "dependencies": {
37
+ "@clack/core": "^0.3.2",
38
+ "@clack/prompts": "^0.6.3",
39
+ "picocolors": "^1.0.0",
40
+ "sisteransi": "^1.0.5",
41
+ "zod": "^3.21.4"
42
+ },
43
+ "devDependencies": {
44
+ "@types/minimist": "^1.2.2",
45
+ "@types/node": "^20.4.5",
46
+ "@types/prompts": "^2.4.4",
47
+ "commander": "^11.0.0",
48
+ "kolorist": "^1.8.0",
49
+ "minimist": "^1.2.8",
50
+ "prompts": "^2.4.2",
51
+ "tauri-controls": "^0.0.8",
52
+ "typescript": "^5.1.6",
53
+ "unbuild": "^1.2.1"
54
+ }
55
+ }
Binary file