@loomui-ng/ui 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +46 -2
  3. package/accordion/README.md +38 -0
  4. package/alert/README.md +32 -0
  5. package/alert-dialog/README.md +37 -0
  6. package/aspect-ratio/README.md +24 -0
  7. package/attachment/README.md +40 -0
  8. package/avatar/README.md +34 -0
  9. package/badge/README.md +29 -0
  10. package/breadcrumb/README.md +33 -0
  11. package/bubble/README.md +32 -0
  12. package/button/README.md +31 -0
  13. package/button-group/README.md +30 -0
  14. package/calendar/README.md +35 -0
  15. package/card/README.md +41 -0
  16. package/carousel/README.md +41 -0
  17. package/chart/README.md +25 -0
  18. package/checkbox/README.md +31 -0
  19. package/collapsible/README.md +31 -0
  20. package/combobox/README.md +47 -0
  21. package/command/README.md +44 -0
  22. package/context-menu/README.md +36 -0
  23. package/data-table/README.md +39 -0
  24. package/date-picker/README.md +23 -0
  25. package/dialog/README.md +52 -0
  26. package/direction/README.md +19 -0
  27. package/drawer/README.md +37 -0
  28. package/dropdown-menu/README.md +46 -0
  29. package/empty/README.md +38 -0
  30. package/fesm2022/loomui-ng-ui-accordion.mjs +555 -0
  31. package/fesm2022/loomui-ng-ui-accordion.mjs.map +1 -0
  32. package/fesm2022/loomui-ng-ui-alert-dialog.mjs +652 -0
  33. package/fesm2022/loomui-ng-ui-alert-dialog.mjs.map +1 -0
  34. package/fesm2022/loomui-ng-ui-alert.mjs +286 -0
  35. package/fesm2022/loomui-ng-ui-alert.mjs.map +1 -0
  36. package/fesm2022/loomui-ng-ui-aspect-ratio.mjs +97 -0
  37. package/fesm2022/loomui-ng-ui-aspect-ratio.mjs.map +1 -0
  38. package/fesm2022/loomui-ng-ui-attachment.mjs +713 -0
  39. package/fesm2022/loomui-ng-ui-attachment.mjs.map +1 -0
  40. package/fesm2022/loomui-ng-ui-avatar.mjs +561 -0
  41. package/fesm2022/loomui-ng-ui-avatar.mjs.map +1 -0
  42. package/fesm2022/loomui-ng-ui-badge.mjs +102 -0
  43. package/fesm2022/loomui-ng-ui-badge.mjs.map +1 -0
  44. package/fesm2022/loomui-ng-ui-breadcrumb.mjs +520 -0
  45. package/fesm2022/loomui-ng-ui-breadcrumb.mjs.map +1 -0
  46. package/fesm2022/loomui-ng-ui-bubble.mjs +386 -0
  47. package/fesm2022/loomui-ng-ui-bubble.mjs.map +1 -0
  48. package/fesm2022/loomui-ng-ui-button-group.mjs +193 -0
  49. package/fesm2022/loomui-ng-ui-button-group.mjs.map +1 -0
  50. package/fesm2022/loomui-ng-ui-button.mjs +162 -0
  51. package/fesm2022/loomui-ng-ui-button.mjs.map +1 -0
  52. package/fesm2022/loomui-ng-ui-calendar.mjs +681 -0
  53. package/fesm2022/loomui-ng-ui-calendar.mjs.map +1 -0
  54. package/fesm2022/loomui-ng-ui-card.mjs +461 -0
  55. package/fesm2022/loomui-ng-ui-card.mjs.map +1 -0
  56. package/fesm2022/loomui-ng-ui-carousel.mjs +532 -0
  57. package/fesm2022/loomui-ng-ui-carousel.mjs.map +1 -0
  58. package/fesm2022/loomui-ng-ui-chart.mjs +373 -0
  59. package/fesm2022/loomui-ng-ui-chart.mjs.map +1 -0
  60. package/fesm2022/loomui-ng-ui-checkbox.mjs +265 -0
  61. package/fesm2022/loomui-ng-ui-checkbox.mjs.map +1 -0
  62. package/fesm2022/loomui-ng-ui-collapsible.mjs +274 -0
  63. package/fesm2022/loomui-ng-ui-collapsible.mjs.map +1 -0
  64. package/fesm2022/loomui-ng-ui-combobox.mjs +971 -0
  65. package/fesm2022/loomui-ng-ui-combobox.mjs.map +1 -0
  66. package/fesm2022/loomui-ng-ui-command.mjs +982 -0
  67. package/fesm2022/loomui-ng-ui-command.mjs.map +1 -0
  68. package/fesm2022/loomui-ng-ui-context-menu.mjs +1359 -0
  69. package/fesm2022/loomui-ng-ui-context-menu.mjs.map +1 -0
  70. package/fesm2022/loomui-ng-ui-data-table.mjs +535 -0
  71. package/fesm2022/loomui-ng-ui-data-table.mjs.map +1 -0
  72. package/fesm2022/loomui-ng-ui-date-picker.mjs +312 -0
  73. package/fesm2022/loomui-ng-ui-date-picker.mjs.map +1 -0
  74. package/fesm2022/loomui-ng-ui-dialog.mjs +508 -0
  75. package/fesm2022/loomui-ng-ui-dialog.mjs.map +1 -0
  76. package/fesm2022/loomui-ng-ui-direction.mjs +112 -0
  77. package/fesm2022/loomui-ng-ui-direction.mjs.map +1 -0
  78. package/fesm2022/loomui-ng-ui-drawer.mjs +590 -0
  79. package/fesm2022/loomui-ng-ui-drawer.mjs.map +1 -0
  80. package/fesm2022/loomui-ng-ui-dropdown-menu.mjs +1322 -0
  81. package/fesm2022/loomui-ng-ui-dropdown-menu.mjs.map +1 -0
  82. package/fesm2022/loomui-ng-ui-empty.mjs +408 -0
  83. package/fesm2022/loomui-ng-ui-empty.mjs.map +1 -0
  84. package/fesm2022/loomui-ng-ui-field.mjs +630 -0
  85. package/fesm2022/loomui-ng-ui-field.mjs.map +1 -0
  86. package/fesm2022/loomui-ng-ui-hover-card.mjs +230 -0
  87. package/fesm2022/loomui-ng-ui-hover-card.mjs.map +1 -0
  88. package/fesm2022/loomui-ng-ui-icon.mjs +498 -0
  89. package/fesm2022/loomui-ng-ui-icon.mjs.map +1 -0
  90. package/fesm2022/loomui-ng-ui-input-group.mjs +463 -0
  91. package/fesm2022/loomui-ng-ui-input-group.mjs.map +1 -0
  92. package/fesm2022/loomui-ng-ui-input-otp.mjs +586 -0
  93. package/fesm2022/loomui-ng-ui-input-otp.mjs.map +1 -0
  94. package/fesm2022/loomui-ng-ui-input.mjs +289 -0
  95. package/fesm2022/loomui-ng-ui-input.mjs.map +1 -0
  96. package/fesm2022/loomui-ng-ui-item.mjs +598 -0
  97. package/fesm2022/loomui-ng-ui-item.mjs.map +1 -0
  98. package/fesm2022/loomui-ng-ui-kbd.mjs +129 -0
  99. package/fesm2022/loomui-ng-ui-kbd.mjs.map +1 -0
  100. package/fesm2022/loomui-ng-ui-label.mjs +68 -0
  101. package/fesm2022/loomui-ng-ui-label.mjs.map +1 -0
  102. package/fesm2022/loomui-ng-ui-marker.mjs +234 -0
  103. package/fesm2022/loomui-ng-ui-marker.mjs.map +1 -0
  104. package/fesm2022/loomui-ng-ui-menubar.mjs +1523 -0
  105. package/fesm2022/loomui-ng-ui-menubar.mjs.map +1 -0
  106. package/fesm2022/loomui-ng-ui-message-scroller.mjs +519 -0
  107. package/fesm2022/loomui-ng-ui-message-scroller.mjs.map +1 -0
  108. package/fesm2022/loomui-ng-ui-message.mjs +408 -0
  109. package/fesm2022/loomui-ng-ui-message.mjs.map +1 -0
  110. package/fesm2022/loomui-ng-ui-native-select.mjs +389 -0
  111. package/fesm2022/loomui-ng-ui-native-select.mjs.map +1 -0
  112. package/fesm2022/loomui-ng-ui-navigation-menu.mjs +609 -0
  113. package/fesm2022/loomui-ng-ui-navigation-menu.mjs.map +1 -0
  114. package/fesm2022/loomui-ng-ui-pagination.mjs +611 -0
  115. package/fesm2022/loomui-ng-ui-pagination.mjs.map +1 -0
  116. package/fesm2022/loomui-ng-ui-popover.mjs +358 -0
  117. package/fesm2022/loomui-ng-ui-popover.mjs.map +1 -0
  118. package/fesm2022/loomui-ng-ui-progress.mjs +159 -0
  119. package/fesm2022/loomui-ng-ui-progress.mjs.map +1 -0
  120. package/fesm2022/loomui-ng-ui-questionnaire.mjs +1012 -0
  121. package/fesm2022/loomui-ng-ui-questionnaire.mjs.map +1 -0
  122. package/fesm2022/loomui-ng-ui-radio-group.mjs +399 -0
  123. package/fesm2022/loomui-ng-ui-radio-group.mjs.map +1 -0
  124. package/fesm2022/loomui-ng-ui-resizable.mjs +518 -0
  125. package/fesm2022/loomui-ng-ui-resizable.mjs.map +1 -0
  126. package/fesm2022/loomui-ng-ui-scroll-area.mjs +135 -0
  127. package/fesm2022/loomui-ng-ui-scroll-area.mjs.map +1 -0
  128. package/fesm2022/loomui-ng-ui-select.mjs +863 -0
  129. package/fesm2022/loomui-ng-ui-select.mjs.map +1 -0
  130. package/fesm2022/loomui-ng-ui-separator.mjs +114 -0
  131. package/fesm2022/loomui-ng-ui-separator.mjs.map +1 -0
  132. package/fesm2022/loomui-ng-ui-sheet.mjs +530 -0
  133. package/fesm2022/loomui-ng-ui-sheet.mjs.map +1 -0
  134. package/fesm2022/loomui-ng-ui-sidebar.mjs +1918 -0
  135. package/fesm2022/loomui-ng-ui-sidebar.mjs.map +1 -0
  136. package/fesm2022/loomui-ng-ui-skeleton.mjs +69 -0
  137. package/fesm2022/loomui-ng-ui-skeleton.mjs.map +1 -0
  138. package/fesm2022/loomui-ng-ui-slider.mjs +390 -0
  139. package/fesm2022/loomui-ng-ui-slider.mjs.map +1 -0
  140. package/fesm2022/loomui-ng-ui-spinner.mjs +85 -0
  141. package/fesm2022/loomui-ng-ui-spinner.mjs.map +1 -0
  142. package/fesm2022/loomui-ng-ui-switch.mjs +212 -0
  143. package/fesm2022/loomui-ng-ui-switch.mjs.map +1 -0
  144. package/fesm2022/loomui-ng-ui-table.mjs +559 -0
  145. package/fesm2022/loomui-ng-ui-table.mjs.map +1 -0
  146. package/fesm2022/loomui-ng-ui-tabs.mjs +544 -0
  147. package/fesm2022/loomui-ng-ui-tabs.mjs.map +1 -0
  148. package/fesm2022/loomui-ng-ui-textarea.mjs +206 -0
  149. package/fesm2022/loomui-ng-ui-textarea.mjs.map +1 -0
  150. package/fesm2022/loomui-ng-ui-toast.mjs +432 -0
  151. package/fesm2022/loomui-ng-ui-toast.mjs.map +1 -0
  152. package/fesm2022/loomui-ng-ui-toggle-group.mjs +477 -0
  153. package/fesm2022/loomui-ng-ui-toggle-group.mjs.map +1 -0
  154. package/fesm2022/loomui-ng-ui-toggle.mjs +219 -0
  155. package/fesm2022/loomui-ng-ui-toggle.mjs.map +1 -0
  156. package/fesm2022/loomui-ng-ui-tooltip.mjs +240 -0
  157. package/fesm2022/loomui-ng-ui-tooltip.mjs.map +1 -0
  158. package/fesm2022/loomui-ng-ui-typography.mjs +129 -0
  159. package/fesm2022/loomui-ng-ui-typography.mjs.map +1 -0
  160. package/fesm2022/loomui-ng-ui-utils.mjs +1533 -0
  161. package/fesm2022/loomui-ng-ui-utils.mjs.map +1 -0
  162. package/fesm2022/loomui-ng-ui.mjs +4 -0
  163. package/fesm2022/loomui-ng-ui.mjs.map +1 -0
  164. package/field/README.md +43 -0
  165. package/hover-card/README.md +31 -0
  166. package/icon/README.md +42 -0
  167. package/input/README.md +26 -0
  168. package/input-group/README.md +40 -0
  169. package/input-otp/README.md +35 -0
  170. package/item/README.md +33 -0
  171. package/kbd/README.md +21 -0
  172. package/label/README.md +24 -0
  173. package/marker/README.md +24 -0
  174. package/menubar/README.md +40 -0
  175. package/message/README.md +32 -0
  176. package/message-scroller/README.md +40 -0
  177. package/native-select/README.md +26 -0
  178. package/navigation-menu/README.md +39 -0
  179. package/package.json +325 -3
  180. package/pagination/README.md +37 -0
  181. package/popover/README.md +37 -0
  182. package/progress/README.md +25 -0
  183. package/questionnaire/README.md +52 -0
  184. package/radio-group/README.md +33 -0
  185. package/resizable/README.md +37 -0
  186. package/scroll-area/README.md +25 -0
  187. package/select/README.md +45 -0
  188. package/separator/README.md +28 -0
  189. package/sheet/README.md +38 -0
  190. package/sidebar/README.md +60 -0
  191. package/skeleton/README.md +21 -0
  192. package/slider/README.md +29 -0
  193. package/spinner/README.md +15 -0
  194. package/styles/loomui.css +330 -0
  195. package/switch/README.md +29 -0
  196. package/table/README.md +31 -0
  197. package/tabs/README.md +42 -0
  198. package/textarea/README.md +28 -0
  199. package/toast/README.md +27 -0
  200. package/toggle/README.md +27 -0
  201. package/toggle-group/README.md +37 -0
  202. package/tooltip/README.md +31 -0
  203. package/types/loomui-ng-ui-accordion.d.ts +141 -0
  204. package/types/loomui-ng-ui-alert-dialog.d.ts +175 -0
  205. package/types/loomui-ng-ui-alert.d.ts +77 -0
  206. package/types/loomui-ng-ui-aspect-ratio.d.ts +31 -0
  207. package/types/loomui-ng-ui-attachment.d.ts +192 -0
  208. package/types/loomui-ng-ui-avatar.d.ts +147 -0
  209. package/types/loomui-ng-ui-badge.d.ts +32 -0
  210. package/types/loomui-ng-ui-breadcrumb.d.ts +118 -0
  211. package/types/loomui-ng-ui-bubble.d.ts +100 -0
  212. package/types/loomui-ng-ui-button-group.d.ts +51 -0
  213. package/types/loomui-ng-ui-button.d.ts +57 -0
  214. package/types/loomui-ng-ui-calendar.d.ts +171 -0
  215. package/types/loomui-ng-ui-card.d.ts +123 -0
  216. package/types/loomui-ng-ui-carousel.d.ts +140 -0
  217. package/types/loomui-ng-ui-chart.d.ts +95 -0
  218. package/types/loomui-ng-ui-checkbox.d.ts +62 -0
  219. package/types/loomui-ng-ui-collapsible.d.ts +74 -0
  220. package/types/loomui-ng-ui-combobox.d.ts +229 -0
  221. package/types/loomui-ng-ui-command.d.ts +231 -0
  222. package/types/loomui-ng-ui-context-menu.d.ts +288 -0
  223. package/types/loomui-ng-ui-data-table.d.ts +111 -0
  224. package/types/loomui-ng-ui-date-picker.d.ts +63 -0
  225. package/types/loomui-ng-ui-dialog.d.ts +127 -0
  226. package/types/loomui-ng-ui-direction.d.ts +42 -0
  227. package/types/loomui-ng-ui-drawer.d.ts +149 -0
  228. package/types/loomui-ng-ui-dropdown-menu.d.ts +258 -0
  229. package/types/loomui-ng-ui-empty.d.ts +109 -0
  230. package/types/loomui-ng-ui-field.d.ts +169 -0
  231. package/types/loomui-ng-ui-hover-card.d.ts +62 -0
  232. package/types/loomui-ng-ui-icon.d.ts +156 -0
  233. package/types/loomui-ng-ui-input-group.d.ts +130 -0
  234. package/types/loomui-ng-ui-input-otp.d.ts +149 -0
  235. package/types/loomui-ng-ui-input.d.ts +89 -0
  236. package/types/loomui-ng-ui-item.d.ts +157 -0
  237. package/types/loomui-ng-ui-kbd.d.ts +36 -0
  238. package/types/loomui-ng-ui-label.d.ts +19 -0
  239. package/types/loomui-ng-ui-marker.d.ts +61 -0
  240. package/types/loomui-ng-ui-menubar.d.ts +321 -0
  241. package/types/loomui-ng-ui-message-scroller.d.ts +138 -0
  242. package/types/loomui-ng-ui-message.d.ts +109 -0
  243. package/types/loomui-ng-ui-native-select.d.ts +84 -0
  244. package/types/loomui-ng-ui-navigation-menu.d.ts +160 -0
  245. package/types/loomui-ng-ui-pagination.d.ts +130 -0
  246. package/types/loomui-ng-ui-popover.d.ts +90 -0
  247. package/types/loomui-ng-ui-progress.d.ts +39 -0
  248. package/types/loomui-ng-ui-questionnaire.d.ts +274 -0
  249. package/types/loomui-ng-ui-radio-group.d.ts +109 -0
  250. package/types/loomui-ng-ui-resizable.d.ts +121 -0
  251. package/types/loomui-ng-ui-scroll-area.d.ts +44 -0
  252. package/types/loomui-ng-ui-select.d.ts +204 -0
  253. package/types/loomui-ng-ui-separator.d.ts +35 -0
  254. package/types/loomui-ng-ui-sheet.d.ts +124 -0
  255. package/types/loomui-ng-ui-sidebar.d.ts +485 -0
  256. package/types/loomui-ng-ui-skeleton.d.ts +20 -0
  257. package/types/loomui-ng-ui-slider.d.ts +103 -0
  258. package/types/loomui-ng-ui-spinner.d.ts +19 -0
  259. package/types/loomui-ng-ui-switch.d.ts +56 -0
  260. package/types/loomui-ng-ui-table.d.ts +148 -0
  261. package/types/loomui-ng-ui-tabs.d.ts +148 -0
  262. package/types/loomui-ng-ui-textarea.d.ts +52 -0
  263. package/types/loomui-ng-ui-toast.d.ts +97 -0
  264. package/types/loomui-ng-ui-toggle-group.d.ts +138 -0
  265. package/types/loomui-ng-ui-toggle.d.ts +63 -0
  266. package/types/loomui-ng-ui-tooltip.d.ts +63 -0
  267. package/types/loomui-ng-ui-typography.d.ts +42 -0
  268. package/types/loomui-ng-ui-utils.d.ts +392 -0
  269. package/types/loomui-ng-ui.d.ts +5 -0
  270. package/typography/README.md +29 -0
@@ -0,0 +1,358 @@
1
+ import { FocusTrapFactory } from "@angular/cdk/a11y";
2
+ import * as i0 from "@angular/core";
3
+ import { Directive, ElementRef, computed, inject, input } from "@angular/core";
4
+ import * as i1 from "@loomui-ng/ui/utils";
5
+ import { UiElementHost, UiLayerRoot, UiPopperContentBase, cn } from "@loomui-ng/ui/utils";
6
+ const CONTENT_CLASS = "z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95";
7
+ var UiPopover = class UiPopover extends UiLayerRoot {
8
+ static ɵfac = i0.ɵɵngDeclareFactory({
9
+ minVersion: "12.0.0",
10
+ version: "22.2.2",
11
+ ngImport: i0,
12
+ type: UiPopover,
13
+ deps: null,
14
+ target: i0.ɵɵFactoryTarget.Directive
15
+ });
16
+ static ɵdir = i0.ɵɵngDeclareDirective({
17
+ minVersion: "14.0.0",
18
+ version: "22.2.2",
19
+ type: UiPopover,
20
+ isStandalone: true,
21
+ selector: "[uiPopover], ui-popover",
22
+ exportAs: ["uiPopover"],
23
+ usesInheritance: true,
24
+ hostDirectives: [{ directive: i1.UiElementHost }],
25
+ ngImport: i0
26
+ });
27
+ };
28
+ i0.ɵɵngDeclareClassMetadata({
29
+ minVersion: "12.0.0",
30
+ version: "22.2.2",
31
+ ngImport: i0,
32
+ type: UiPopover,
33
+ decorators: [{
34
+ type: Directive,
35
+ args: [{
36
+ selector: "[uiPopover], ui-popover",
37
+ hostDirectives: [UiElementHost],
38
+ exportAs: "uiPopover"
39
+ }]
40
+ }]
41
+ });
42
+ var UiPopoverTrigger = class UiPopoverTrigger {
43
+ root = inject(UiPopover);
44
+ constructor() {
45
+ this.root.trigger.set(inject(ElementRef).nativeElement);
46
+ }
47
+ static ɵfac = i0.ɵɵngDeclareFactory({
48
+ minVersion: "12.0.0",
49
+ version: "22.2.2",
50
+ ngImport: i0,
51
+ type: UiPopoverTrigger,
52
+ deps: [],
53
+ target: i0.ɵɵFactoryTarget.Directive
54
+ });
55
+ static ɵdir = i0.ɵɵngDeclareDirective({
56
+ minVersion: "14.0.0",
57
+ version: "22.2.2",
58
+ type: UiPopoverTrigger,
59
+ isStandalone: true,
60
+ selector: "[uiPopoverTrigger], ui-popover-trigger",
61
+ host: {
62
+ attributes: {
63
+ "data-slot": "popover-trigger",
64
+ "aria-haspopup": "dialog"
65
+ },
66
+ listeners: { "click": "root.toggle()" },
67
+ properties: {
68
+ "attr.aria-expanded": "root.open()",
69
+ "attr.aria-controls": "root.id",
70
+ "attr.data-state": "root.open() ? \"open\" : \"closed\""
71
+ }
72
+ },
73
+ hostDirectives: [{ directive: i1.UiElementHost }],
74
+ ngImport: i0
75
+ });
76
+ };
77
+ i0.ɵɵngDeclareClassMetadata({
78
+ minVersion: "12.0.0",
79
+ version: "22.2.2",
80
+ ngImport: i0,
81
+ type: UiPopoverTrigger,
82
+ decorators: [{
83
+ type: Directive,
84
+ args: [{
85
+ selector: "[uiPopoverTrigger], ui-popover-trigger",
86
+ hostDirectives: [UiElementHost],
87
+ host: {
88
+ "data-slot": "popover-trigger",
89
+ "aria-haspopup": "dialog",
90
+ "[attr.aria-expanded]": "root.open()",
91
+ "[attr.aria-controls]": "root.id",
92
+ "[attr.data-state]": "root.open() ? \"open\" : \"closed\"",
93
+ "(click)": "root.toggle()"
94
+ }
95
+ }]
96
+ }],
97
+ ctorParameters: () => []
98
+ });
99
+ var UiPopoverContent = class UiPopoverContent extends UiPopperContentBase {
100
+ root = inject(UiPopover);
101
+ varPrefix = "--radix-popover";
102
+ trapFactory = inject(FocusTrapFactory);
103
+ classes = computed(() => cn(CONTENT_CLASS, this.userClass()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
104
+ constructor() {
105
+ super();
106
+ this.init();
107
+ }
108
+ onAttached() {
109
+ const trap = this.trapFactory.create(this.el);
110
+ trap.focusInitialElementWhenReady().then((ok) => {
111
+ if (!ok) this.el.focus();
112
+ trap.destroy();
113
+ });
114
+ }
115
+ static ɵfac = i0.ɵɵngDeclareFactory({
116
+ minVersion: "12.0.0",
117
+ version: "22.2.2",
118
+ ngImport: i0,
119
+ type: UiPopoverContent,
120
+ deps: [],
121
+ target: i0.ɵɵFactoryTarget.Directive
122
+ });
123
+ static ɵdir = i0.ɵɵngDeclareDirective({
124
+ minVersion: "14.0.0",
125
+ version: "22.2.2",
126
+ type: UiPopoverContent,
127
+ isStandalone: true,
128
+ selector: "[uiPopoverContent], ui-popover-content",
129
+ host: {
130
+ attributes: {
131
+ "role": "dialog",
132
+ "data-slot": "popover-content",
133
+ "tabindex": "-1"
134
+ },
135
+ properties: {
136
+ "id": "root.id",
137
+ "attr.data-state": "root.state()",
138
+ "attr.class": "classes()"
139
+ }
140
+ },
141
+ usesInheritance: true,
142
+ hostDirectives: [{ directive: i1.UiElementHost }],
143
+ ngImport: i0
144
+ });
145
+ };
146
+ i0.ɵɵngDeclareClassMetadata({
147
+ minVersion: "12.0.0",
148
+ version: "22.2.2",
149
+ ngImport: i0,
150
+ type: UiPopoverContent,
151
+ decorators: [{
152
+ type: Directive,
153
+ args: [{
154
+ selector: "[uiPopoverContent], ui-popover-content",
155
+ hostDirectives: [UiElementHost],
156
+ host: {
157
+ role: "dialog",
158
+ "data-slot": "popover-content",
159
+ tabindex: "-1",
160
+ "[id]": "root.id",
161
+ "[attr.data-state]": "root.state()",
162
+ "[attr.class]": "classes()"
163
+ }
164
+ }]
165
+ }],
166
+ ctorParameters: () => []
167
+ });
168
+ var UiPopoverHeader = class UiPopoverHeader {
169
+ userClass = input("", {
170
+ ...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
171
+ alias: "class"
172
+ });
173
+ classes = computed(() => cn("flex flex-col gap-0.5 text-sm", this.userClass()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
174
+ static ɵfac = i0.ɵɵngDeclareFactory({
175
+ minVersion: "12.0.0",
176
+ version: "22.2.2",
177
+ ngImport: i0,
178
+ type: UiPopoverHeader,
179
+ deps: [],
180
+ target: i0.ɵɵFactoryTarget.Directive
181
+ });
182
+ static ɵdir = i0.ɵɵngDeclareDirective({
183
+ minVersion: "17.1.0",
184
+ version: "22.2.2",
185
+ type: UiPopoverHeader,
186
+ isStandalone: true,
187
+ selector: "[uiPopoverHeader], ui-popover-header",
188
+ inputs: { userClass: {
189
+ classPropertyName: "userClass",
190
+ publicName: "class",
191
+ isSignal: true,
192
+ isRequired: false,
193
+ transformFunction: null
194
+ } },
195
+ host: {
196
+ attributes: { "data-slot": "popover-header" },
197
+ properties: { "attr.class": "classes()" }
198
+ },
199
+ hostDirectives: [{ directive: i1.UiElementHost }],
200
+ ngImport: i0
201
+ });
202
+ };
203
+ i0.ɵɵngDeclareClassMetadata({
204
+ minVersion: "12.0.0",
205
+ version: "22.2.2",
206
+ ngImport: i0,
207
+ type: UiPopoverHeader,
208
+ decorators: [{
209
+ type: Directive,
210
+ args: [{
211
+ selector: "[uiPopoverHeader], ui-popover-header",
212
+ hostDirectives: [UiElementHost],
213
+ host: {
214
+ "data-slot": "popover-header",
215
+ "[attr.class]": "classes()"
216
+ }
217
+ }]
218
+ }],
219
+ propDecorators: { userClass: [{
220
+ type: i0.Input,
221
+ args: [{
222
+ isSignal: true,
223
+ alias: "class",
224
+ required: false
225
+ }]
226
+ }] }
227
+ });
228
+ var UiPopoverTitle = class UiPopoverTitle {
229
+ userClass = input("", {
230
+ ...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
231
+ alias: "class"
232
+ });
233
+ classes = computed(() => cn("font-medium", this.userClass()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
234
+ static ɵfac = i0.ɵɵngDeclareFactory({
235
+ minVersion: "12.0.0",
236
+ version: "22.2.2",
237
+ ngImport: i0,
238
+ type: UiPopoverTitle,
239
+ deps: [],
240
+ target: i0.ɵɵFactoryTarget.Directive
241
+ });
242
+ static ɵdir = i0.ɵɵngDeclareDirective({
243
+ minVersion: "17.1.0",
244
+ version: "22.2.2",
245
+ type: UiPopoverTitle,
246
+ isStandalone: true,
247
+ selector: "[uiPopoverTitle], ui-popover-title",
248
+ inputs: { userClass: {
249
+ classPropertyName: "userClass",
250
+ publicName: "class",
251
+ isSignal: true,
252
+ isRequired: false,
253
+ transformFunction: null
254
+ } },
255
+ host: {
256
+ attributes: { "data-slot": "popover-title" },
257
+ properties: { "attr.class": "classes()" }
258
+ },
259
+ hostDirectives: [{ directive: i1.UiElementHost }],
260
+ ngImport: i0
261
+ });
262
+ };
263
+ i0.ɵɵngDeclareClassMetadata({
264
+ minVersion: "12.0.0",
265
+ version: "22.2.2",
266
+ ngImport: i0,
267
+ type: UiPopoverTitle,
268
+ decorators: [{
269
+ type: Directive,
270
+ args: [{
271
+ selector: "[uiPopoverTitle], ui-popover-title",
272
+ hostDirectives: [UiElementHost],
273
+ host: {
274
+ "data-slot": "popover-title",
275
+ "[attr.class]": "classes()"
276
+ }
277
+ }]
278
+ }],
279
+ propDecorators: { userClass: [{
280
+ type: i0.Input,
281
+ args: [{
282
+ isSignal: true,
283
+ alias: "class",
284
+ required: false
285
+ }]
286
+ }] }
287
+ });
288
+ var UiPopoverDescription = class UiPopoverDescription {
289
+ userClass = input("", {
290
+ ...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
291
+ alias: "class"
292
+ });
293
+ classes = computed(() => cn("text-muted-foreground", this.userClass()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
294
+ static ɵfac = i0.ɵɵngDeclareFactory({
295
+ minVersion: "12.0.0",
296
+ version: "22.2.2",
297
+ ngImport: i0,
298
+ type: UiPopoverDescription,
299
+ deps: [],
300
+ target: i0.ɵɵFactoryTarget.Directive
301
+ });
302
+ static ɵdir = i0.ɵɵngDeclareDirective({
303
+ minVersion: "17.1.0",
304
+ version: "22.2.2",
305
+ type: UiPopoverDescription,
306
+ isStandalone: true,
307
+ selector: "[uiPopoverDescription], ui-popover-description",
308
+ inputs: { userClass: {
309
+ classPropertyName: "userClass",
310
+ publicName: "class",
311
+ isSignal: true,
312
+ isRequired: false,
313
+ transformFunction: null
314
+ } },
315
+ host: {
316
+ attributes: { "data-slot": "popover-description" },
317
+ properties: { "attr.class": "classes()" }
318
+ },
319
+ hostDirectives: [{ directive: i1.UiElementHost }],
320
+ ngImport: i0
321
+ });
322
+ };
323
+ i0.ɵɵngDeclareClassMetadata({
324
+ minVersion: "12.0.0",
325
+ version: "22.2.2",
326
+ ngImport: i0,
327
+ type: UiPopoverDescription,
328
+ decorators: [{
329
+ type: Directive,
330
+ args: [{
331
+ selector: "[uiPopoverDescription], ui-popover-description",
332
+ hostDirectives: [UiElementHost],
333
+ host: {
334
+ "data-slot": "popover-description",
335
+ "[attr.class]": "classes()"
336
+ }
337
+ }]
338
+ }],
339
+ propDecorators: { userClass: [{
340
+ type: i0.Input,
341
+ args: [{
342
+ isSignal: true,
343
+ alias: "class",
344
+ required: false
345
+ }]
346
+ }] }
347
+ });
348
+ const UI_POPOVER = [
349
+ UiPopover,
350
+ UiPopoverTrigger,
351
+ UiPopoverContent,
352
+ UiPopoverHeader,
353
+ UiPopoverTitle,
354
+ UiPopoverDescription
355
+ ];
356
+ export { UI_POPOVER, UiPopover, UiPopoverContent, UiPopoverDescription, UiPopoverHeader, UiPopoverTitle, UiPopoverTrigger };
357
+
358
+ //# sourceMappingURL=loomui-ng-ui-popover.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loomui-ng-ui-popover.mjs","names":[],"sources":["../../../libs/ui/popover/popover.ts"],"sourcesContent":["import { FocusTrapFactory } from '@angular/cdk/a11y';\nimport { computed, Directive, ElementRef, inject } from '@angular/core';\nimport { cn } from '@loomui-ng/ui/utils';\nimport { UiLayerRoot } from '@loomui-ng/ui/utils';\nimport { UiPopperContentBase } from '@loomui-ng/ui/utils';\nimport { input } from '@angular/core';\nimport { UiElementHost } from '@loomui-ng/ui/utils';\n\nconst CONTENT_CLASS =\n 'z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95';\n\n/**\n * <div uiPopover [(open)]=\"o\" class=\"contents\">\n * <button uiButton uiPopoverTrigger>Open</button>\n * <div uiPopoverContent side=\"bottom\" align=\"center\">…</div>\n * </div>\n */\n@Directive({ selector: '[uiPopover], ui-popover', hostDirectives: [UiElementHost], exportAs: 'uiPopover' })\nexport class UiPopover extends UiLayerRoot {}\n\n@Directive({\n selector: '[uiPopoverTrigger], ui-popover-trigger', hostDirectives: [UiElementHost],\n host: {\n 'data-slot': 'popover-trigger',\n 'aria-haspopup': 'dialog',\n '[attr.aria-expanded]': 'root.open()',\n '[attr.aria-controls]': 'root.id',\n '[attr.data-state]': 'root.open() ? \"open\" : \"closed\"',\n '(click)': 'root.toggle()',\n },\n})\nexport class UiPopoverTrigger {\n protected readonly root = inject(UiPopover);\n constructor() {\n this.root.trigger.set(inject<ElementRef<HTMLElement>>(ElementRef).nativeElement);\n }\n}\n\n@Directive({\n selector: '[uiPopoverContent], ui-popover-content', hostDirectives: [UiElementHost],\n host: {\n role: 'dialog',\n 'data-slot': 'popover-content',\n tabindex: '-1',\n '[id]': 'root.id',\n '[attr.data-state]': 'root.state()',\n '[attr.class]': 'classes()',\n },\n})\nexport class UiPopoverContent extends UiPopperContentBase {\n protected readonly root = inject(UiPopover);\n protected readonly varPrefix = '--radix-popover';\n private readonly trapFactory = inject(FocusTrapFactory);\n protected readonly classes = computed(() => cn(CONTENT_CLASS, this.userClass()));\n\n constructor() {\n super();\n this.init();\n }\n\n protected override onAttached(): void {\n // Radix Popover moves focus into the content (first tabbable, else the content itself); focus is not trapped.\n const trap = this.trapFactory.create(this.el);\n void trap.focusInitialElementWhenReady().then((ok) => {\n if (!ok) this.el.focus();\n trap.destroy();\n });\n }\n}\n\n@Directive({\n selector: '[uiPopoverHeader], ui-popover-header', hostDirectives: [UiElementHost],\n host: { 'data-slot': 'popover-header', '[attr.class]': 'classes()' },\n})\nexport class UiPopoverHeader {\n readonly userClass = input<string>('', { alias: 'class' });\n protected readonly classes = computed(() => cn('flex flex-col gap-0.5 text-sm', this.userClass()));\n}\n\n@Directive({\n selector: '[uiPopoverTitle], ui-popover-title', hostDirectives: [UiElementHost],\n host: { 'data-slot': 'popover-title', '[attr.class]': 'classes()' },\n})\nexport class UiPopoverTitle {\n readonly userClass = input<string>('', { alias: 'class' });\n protected readonly classes = computed(() => cn('font-medium', this.userClass()));\n}\n\n@Directive({\n selector: '[uiPopoverDescription], ui-popover-description', hostDirectives: [UiElementHost],\n host: { 'data-slot': 'popover-description', '[attr.class]': 'classes()' },\n})\nexport class UiPopoverDescription {\n readonly userClass = input<string>('', { alias: 'class' });\n protected readonly classes = computed(() => cn('text-muted-foreground', this.userClass()));\n}\n\nexport const UI_POPOVER = [\n UiPopover,\n UiPopoverTrigger,\n UiPopoverContent,\n UiPopoverHeader,\n UiPopoverTitle,\n UiPopoverDescription,\n] as const;\n"],"mappings":";;;;;AAQA,MAAM,gBACJ;AASF,IAAa,YAAb,MAAa,kBAAkB,YAAW;CAA7B,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAS,MAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAT,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAS,cAAA;EAAA,UAAA;EAAA,UAAA,CAAA,WAAA;EAAA,iBAAA;EAAA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AA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAoB,YAAA,CAAA;EAJhC,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GAAkD,gBAAgB,CAAC,aAAa;GAC1F,MAAM;IAAE,aAAa;IAAuB,gBAAgB;GAAW;EACxE,CAAA;;;;;;;;;;;AAMD,MAAa,aAAa;CACxB;CACA;CACA;CACA;CACA;CACA;AACQ"}
@@ -0,0 +1,159 @@
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, computed, input, numberAttribute } from "@angular/core";
3
+ import * as i1 from "@loomui-ng/ui/utils";
4
+ import { UiElementHost, cn } from "@loomui-ng/ui/utils";
5
+ var UiProgress = class UiProgress {
6
+ value = input(null, {
7
+ ...ngDevMode ? { debugName: "value" } : /* istanbul ignore next */ {},
8
+ transform: (v) => v === null || v === void 0 || v === "" ? null : numberAttribute(v)
9
+ });
10
+ max = input(100, {
11
+ ...ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {},
12
+ transform: numberAttribute
13
+ });
14
+ userClass = input("", {
15
+ ...ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {},
16
+ alias: "class"
17
+ });
18
+ percent = computed(() => {
19
+ const v = this.value();
20
+ return v === null ? 0 : Math.min(100, Math.max(0, v / this.max() * 100));
21
+ }, ...ngDevMode ? [{ debugName: "percent" }] : /* istanbul ignore next */ []);
22
+ state = computed(() => {
23
+ const v = this.value();
24
+ return v === null ? "indeterminate" : v >= this.max() ? "complete" : "loading";
25
+ }, ...ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []);
26
+ classes = computed(() => cn("relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted rtl:rotate-180", this.userClass()), ...ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []);
27
+ static ɵfac = i0.ɵɵngDeclareFactory({
28
+ minVersion: "12.0.0",
29
+ version: "22.2.2",
30
+ ngImport: i0,
31
+ type: UiProgress,
32
+ deps: [],
33
+ target: i0.ɵɵFactoryTarget.Component
34
+ });
35
+ static ɵcmp = i0.ɵɵngDeclareComponent({
36
+ minVersion: "17.1.0",
37
+ version: "22.2.2",
38
+ type: UiProgress,
39
+ isStandalone: true,
40
+ selector: "div[uiProgress], ui-progress",
41
+ inputs: {
42
+ value: {
43
+ classPropertyName: "value",
44
+ publicName: "value",
45
+ isSignal: true,
46
+ isRequired: false,
47
+ transformFunction: null
48
+ },
49
+ max: {
50
+ classPropertyName: "max",
51
+ publicName: "max",
52
+ isSignal: true,
53
+ isRequired: false,
54
+ transformFunction: null
55
+ },
56
+ userClass: {
57
+ classPropertyName: "userClass",
58
+ publicName: "class",
59
+ isSignal: true,
60
+ isRequired: false,
61
+ transformFunction: null
62
+ }
63
+ },
64
+ host: {
65
+ attributes: {
66
+ "role": "progressbar",
67
+ "aria-valuemin": "0",
68
+ "data-slot": "progress"
69
+ },
70
+ properties: {
71
+ "attr.aria-valuemax": "max()",
72
+ "attr.aria-valuenow": "value()",
73
+ "attr.data-state": "state()",
74
+ "attr.data-value": "value()",
75
+ "attr.data-max": "max()",
76
+ "attr.class": "classes()"
77
+ }
78
+ },
79
+ hostDirectives: [{ directive: i1.UiElementHost }],
80
+ ngImport: i0,
81
+ template: `
82
+ <div
83
+ data-slot="progress-indicator"
84
+ [attr.data-state]="state()"
85
+ [attr.data-value]="value()"
86
+ [attr.data-max]="max()"
87
+ class="size-full flex-1 bg-primary transition-all"
88
+ [style.transform]="'translateX(-' + (100 - percent()) + '%)'"
89
+ ></div>
90
+ `,
91
+ isInline: true,
92
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
93
+ });
94
+ };
95
+ i0.ɵɵngDeclareClassMetadata({
96
+ minVersion: "12.0.0",
97
+ version: "22.2.2",
98
+ ngImport: i0,
99
+ type: UiProgress,
100
+ decorators: [{
101
+ type: Component,
102
+ args: [{
103
+ selector: "div[uiProgress], ui-progress",
104
+ hostDirectives: [UiElementHost],
105
+ changeDetection: ChangeDetectionStrategy.OnPush,
106
+ host: {
107
+ role: "progressbar",
108
+ "aria-valuemin": "0",
109
+ "[attr.aria-valuemax]": "max()",
110
+ "[attr.aria-valuenow]": "value()",
111
+ "[attr.data-state]": "state()",
112
+ "[attr.data-value]": "value()",
113
+ "[attr.data-max]": "max()",
114
+ "data-slot": "progress",
115
+ "[attr.class]": "classes()"
116
+ },
117
+ template: `
118
+ <div
119
+ data-slot="progress-indicator"
120
+ [attr.data-state]="state()"
121
+ [attr.data-value]="value()"
122
+ [attr.data-max]="max()"
123
+ class="size-full flex-1 bg-primary transition-all"
124
+ [style.transform]="'translateX(-' + (100 - percent()) + '%)'"
125
+ ></div>
126
+ `
127
+ }]
128
+ }],
129
+ propDecorators: {
130
+ value: [{
131
+ type: i0.Input,
132
+ args: [{
133
+ isSignal: true,
134
+ alias: "value",
135
+ required: false
136
+ }]
137
+ }],
138
+ max: [{
139
+ type: i0.Input,
140
+ args: [{
141
+ isSignal: true,
142
+ alias: "max",
143
+ required: false
144
+ }]
145
+ }],
146
+ userClass: [{
147
+ type: i0.Input,
148
+ args: [{
149
+ isSignal: true,
150
+ alias: "class",
151
+ required: false
152
+ }]
153
+ }]
154
+ }
155
+ });
156
+ const UI_PROGRESS = [UiProgress];
157
+ export { UI_PROGRESS, UiProgress };
158
+
159
+ //# sourceMappingURL=loomui-ng-ui-progress.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loomui-ng-ui-progress.mjs","names":[],"sources":["../../../libs/ui/progress/progress.manual.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, input, numberAttribute } from '@angular/core';\nimport { cn } from '@loomui-ng/ui/utils';\nimport { UiElementHost } from '@loomui-ng/ui/utils';\n\n/**\n * <div uiProgress [value]=\"60\"></div>\n * Observed (Radix): role=\"progressbar\", aria-valuemin=0, aria-valuemax, data-state, data-max; the indicator is\n * translated by -(100 - value)% and the root flips with `rtl:rotate-180`.\n */\n@Component({\n selector: 'div[uiProgress], ui-progress', hostDirectives: [UiElementHost],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n role: 'progressbar',\n 'aria-valuemin': '0',\n '[attr.aria-valuemax]': 'max()',\n '[attr.aria-valuenow]': 'value()',\n '[attr.data-state]': 'state()',\n '[attr.data-value]': 'value()',\n '[attr.data-max]': 'max()',\n 'data-slot': 'progress',\n '[attr.class]': 'classes()',\n },\n template: `\n <div\n data-slot=\"progress-indicator\"\n [attr.data-state]=\"state()\"\n [attr.data-value]=\"value()\"\n [attr.data-max]=\"max()\"\n class=\"size-full flex-1 bg-primary transition-all\"\n [style.transform]=\"'translateX(-' + (100 - percent()) + '%)'\"\n ></div>\n `,\n})\nexport class UiProgress {\n /** `null` = indeterminate (observed on the live page: data-state=\"indeterminate\"). */\n readonly value = input<number | null, unknown>(null, {\n transform: (v: unknown) => (v === null || v === undefined || v === '' ? null : numberAttribute(v)),\n });\n readonly max = input(100, { transform: numberAttribute });\n readonly userClass = input<string>('', { alias: 'class' });\n protected readonly percent = computed(() => {\n const v = this.value();\n return v === null ? 0 : Math.min(100, Math.max(0, (v / this.max()) * 100));\n });\n protected readonly state = computed(() => {\n const v = this.value();\n return v === null ? 'indeterminate' : v >= this.max() ? 'complete' : 'loading';\n });\n protected readonly classes = computed(() =>\n cn('relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted rtl:rotate-180', this.userClass()),\n );\n}\n\nexport const UI_PROGRESS = [UiProgress] as const;\n"],"mappings":";;;;AAkCA,IAAa,aAAb,MAAa,WAAU;CAEZ,QAAQ,MAA8B,MAAI;EAAA,GAAA,YAAA,EAAA,WAAA,QAAA,+BAAA,CAAA;EACjD,YAAY,MAAgB,MAAM,QAAQ,MAAM,UAAa,MAAM,KAAK,OAAO,gBAAgB,CAAC;CAAE,CAAA;CAE3F,MAAM,MAAM,KAAG;EAAA,GAAA,YAAA,EAAA,WAAA,MAAA,+BAAA,CAAA;EAAI,WAAW;CAAe,CAAA;CAC7C,YAAY,MAAc,IAAE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