@area8975/ui 0.2.2-dev.49 → 0.2.2-dev.50

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 (182) hide show
  1. package/README.md +3 -2
  2. package/fesm2022/area8975-ui-alert.mjs +113 -0
  3. package/fesm2022/area8975-ui-alert.mjs.map +1 -0
  4. package/fesm2022/area8975-ui-avatar.mjs +157 -0
  5. package/fesm2022/area8975-ui-avatar.mjs.map +1 -0
  6. package/fesm2022/area8975-ui-badge.mjs +116 -0
  7. package/fesm2022/area8975-ui-badge.mjs.map +1 -0
  8. package/fesm2022/area8975-ui-button.mjs +314 -0
  9. package/fesm2022/area8975-ui-button.mjs.map +1 -0
  10. package/fesm2022/area8975-ui-calendar.mjs +549 -0
  11. package/fesm2022/area8975-ui-calendar.mjs.map +1 -0
  12. package/fesm2022/area8975-ui-card-header.mjs +96 -0
  13. package/fesm2022/area8975-ui-card-header.mjs.map +1 -0
  14. package/fesm2022/area8975-ui-card.mjs +73 -0
  15. package/fesm2022/area8975-ui-card.mjs.map +1 -0
  16. package/fesm2022/area8975-ui-chart-palette.mjs +225 -0
  17. package/fesm2022/area8975-ui-chart-palette.mjs.map +1 -0
  18. package/fesm2022/area8975-ui-charts.mjs +2813 -0
  19. package/fesm2022/area8975-ui-charts.mjs.map +1 -0
  20. package/fesm2022/area8975-ui-checkbox.mjs +202 -0
  21. package/fesm2022/area8975-ui-checkbox.mjs.map +1 -0
  22. package/fesm2022/area8975-ui-colour.mjs +200 -0
  23. package/fesm2022/area8975-ui-colour.mjs.map +1 -0
  24. package/fesm2022/area8975-ui-container.mjs +40 -0
  25. package/fesm2022/area8975-ui-container.mjs.map +1 -0
  26. package/fesm2022/area8975-ui-counter.mjs +246 -0
  27. package/fesm2022/area8975-ui-counter.mjs.map +1 -0
  28. package/fesm2022/area8975-ui-date-range-picker.mjs +554 -0
  29. package/fesm2022/area8975-ui-date-range-picker.mjs.map +1 -0
  30. package/fesm2022/area8975-ui-datepicker.mjs +547 -0
  31. package/fesm2022/area8975-ui-datepicker.mjs.map +1 -0
  32. package/fesm2022/area8975-ui-disclosure.mjs +279 -0
  33. package/fesm2022/area8975-ui-disclosure.mjs.map +1 -0
  34. package/fesm2022/area8975-ui-drawer.mjs +106 -0
  35. package/fesm2022/area8975-ui-drawer.mjs.map +1 -0
  36. package/fesm2022/area8975-ui-dropdown-button.mjs +141 -0
  37. package/fesm2022/area8975-ui-dropdown-button.mjs.map +1 -0
  38. package/fesm2022/area8975-ui-dropdown-menu.mjs +96 -0
  39. package/fesm2022/area8975-ui-dropdown-menu.mjs.map +1 -0
  40. package/fesm2022/area8975-ui-dropdown.mjs +208 -0
  41. package/fesm2022/area8975-ui-dropdown.mjs.map +1 -0
  42. package/fesm2022/area8975-ui-dropzone.mjs +332 -0
  43. package/fesm2022/area8975-ui-dropzone.mjs.map +1 -0
  44. package/fesm2022/area8975-ui-field.mjs +191 -0
  45. package/fesm2022/area8975-ui-field.mjs.map +1 -0
  46. package/fesm2022/area8975-ui-file-input.mjs +340 -0
  47. package/fesm2022/area8975-ui-file-input.mjs.map +1 -0
  48. package/fesm2022/area8975-ui-file.mjs +47 -0
  49. package/fesm2022/area8975-ui-file.mjs.map +1 -0
  50. package/fesm2022/area8975-ui-format.mjs +70 -0
  51. package/fesm2022/area8975-ui-format.mjs.map +1 -0
  52. package/fesm2022/area8975-ui-input-addon.mjs +42 -0
  53. package/fesm2022/area8975-ui-input-addon.mjs.map +1 -0
  54. package/fesm2022/area8975-ui-input-group.mjs +86 -0
  55. package/fesm2022/area8975-ui-input-group.mjs.map +1 -0
  56. package/fesm2022/area8975-ui-input.mjs +682 -0
  57. package/fesm2022/area8975-ui-input.mjs.map +1 -0
  58. package/fesm2022/area8975-ui-kpi.mjs +167 -0
  59. package/fesm2022/area8975-ui-kpi.mjs.map +1 -0
  60. package/fesm2022/area8975-ui-layout.mjs +63 -0
  61. package/fesm2022/area8975-ui-layout.mjs.map +1 -0
  62. package/fesm2022/area8975-ui-loading.mjs +76 -0
  63. package/fesm2022/area8975-ui-loading.mjs.map +1 -0
  64. package/fesm2022/area8975-ui-modal-close-btn.mjs +89 -0
  65. package/fesm2022/area8975-ui-modal-close-btn.mjs.map +1 -0
  66. package/fesm2022/area8975-ui-modal.mjs +235 -0
  67. package/fesm2022/area8975-ui-modal.mjs.map +1 -0
  68. package/fesm2022/area8975-ui-money.mjs +230 -0
  69. package/fesm2022/area8975-ui-money.mjs.map +1 -0
  70. package/fesm2022/area8975-ui-overlay.mjs +317 -0
  71. package/fesm2022/area8975-ui-overlay.mjs.map +1 -0
  72. package/fesm2022/area8975-ui-pagination.mjs +152 -0
  73. package/fesm2022/area8975-ui-pagination.mjs.map +1 -0
  74. package/fesm2022/area8975-ui-private.mjs +63 -0
  75. package/fesm2022/area8975-ui-private.mjs.map +1 -0
  76. package/fesm2022/area8975-ui-progress.mjs +307 -0
  77. package/fesm2022/area8975-ui-progress.mjs.map +1 -0
  78. package/fesm2022/area8975-ui-radio.mjs +199 -0
  79. package/fesm2022/area8975-ui-radio.mjs.map +1 -0
  80. package/fesm2022/area8975-ui-rich-text-editor.mjs +778 -0
  81. package/fesm2022/area8975-ui-rich-text-editor.mjs.map +1 -0
  82. package/fesm2022/area8975-ui-search.mjs +266 -0
  83. package/fesm2022/area8975-ui-search.mjs.map +1 -0
  84. package/fesm2022/area8975-ui-segmented.mjs +118 -0
  85. package/fesm2022/area8975-ui-segmented.mjs.map +1 -0
  86. package/fesm2022/area8975-ui-select.mjs +926 -0
  87. package/fesm2022/area8975-ui-select.mjs.map +1 -0
  88. package/fesm2022/area8975-ui-sidebar-group.mjs +60 -0
  89. package/fesm2022/area8975-ui-sidebar-group.mjs.map +1 -0
  90. package/fesm2022/area8975-ui-sidebar-item.mjs +107 -0
  91. package/fesm2022/area8975-ui-sidebar-item.mjs.map +1 -0
  92. package/fesm2022/area8975-ui-sidebar.mjs +109 -0
  93. package/fesm2022/area8975-ui-sidebar.mjs.map +1 -0
  94. package/fesm2022/area8975-ui-skeleton.mjs +116 -0
  95. package/fesm2022/area8975-ui-skeleton.mjs.map +1 -0
  96. package/fesm2022/area8975-ui-stat.mjs +55 -0
  97. package/fesm2022/area8975-ui-stat.mjs.map +1 -0
  98. package/fesm2022/area8975-ui-switch.mjs +132 -0
  99. package/fesm2022/area8975-ui-switch.mjs.map +1 -0
  100. package/fesm2022/area8975-ui-tab.mjs +217 -0
  101. package/fesm2022/area8975-ui-tab.mjs.map +1 -0
  102. package/fesm2022/area8975-ui-table-filters.mjs +499 -0
  103. package/fesm2022/area8975-ui-table-filters.mjs.map +1 -0
  104. package/fesm2022/area8975-ui-table.mjs +1237 -0
  105. package/fesm2022/area8975-ui-table.mjs.map +1 -0
  106. package/fesm2022/area8975-ui-textarea.mjs +375 -0
  107. package/fesm2022/area8975-ui-textarea.mjs.map +1 -0
  108. package/fesm2022/area8975-ui-theme.mjs +246 -0
  109. package/fesm2022/area8975-ui-theme.mjs.map +1 -0
  110. package/fesm2022/area8975-ui-time-select.mjs +170 -0
  111. package/fesm2022/area8975-ui-time-select.mjs.map +1 -0
  112. package/fesm2022/area8975-ui-toast.mjs +269 -0
  113. package/fesm2022/area8975-ui-toast.mjs.map +1 -0
  114. package/fesm2022/area8975-ui-toaster.mjs +117 -0
  115. package/fesm2022/area8975-ui-toaster.mjs.map +1 -0
  116. package/fesm2022/area8975-ui-tooltip.mjs +196 -0
  117. package/fesm2022/area8975-ui-tooltip.mjs.map +1 -0
  118. package/fesm2022/area8975-ui-user-menu.mjs +186 -0
  119. package/fesm2022/area8975-ui-user-menu.mjs.map +1 -0
  120. package/fesm2022/area8975-ui.mjs +0 -16520
  121. package/package.json +237 -1
  122. package/types/area8975-ui-alert.d.ts +25 -0
  123. package/types/area8975-ui-avatar.d.ts +40 -0
  124. package/types/area8975-ui-badge.d.ts +31 -0
  125. package/types/area8975-ui-button.d.ts +129 -0
  126. package/types/area8975-ui-calendar.d.ts +177 -0
  127. package/types/area8975-ui-card-header.d.ts +28 -0
  128. package/types/area8975-ui-card.d.ts +18 -0
  129. package/types/area8975-ui-chart-palette.d.ts +176 -0
  130. package/types/area8975-ui-charts.d.ts +747 -0
  131. package/types/area8975-ui-checkbox.d.ts +61 -0
  132. package/types/area8975-ui-colour.d.ts +31 -0
  133. package/types/area8975-ui-container.d.ts +5 -0
  134. package/types/area8975-ui-counter.d.ts +43 -0
  135. package/types/area8975-ui-date-range-picker.d.ts +132 -0
  136. package/types/area8975-ui-datepicker.d.ts +124 -0
  137. package/types/area8975-ui-disclosure.d.ts +79 -0
  138. package/types/area8975-ui-drawer.d.ts +25 -0
  139. package/types/area8975-ui-dropdown-button.d.ts +32 -0
  140. package/types/area8975-ui-dropdown-menu.d.ts +25 -0
  141. package/types/area8975-ui-dropdown.d.ts +56 -0
  142. package/types/area8975-ui-dropzone.d.ts +96 -0
  143. package/types/area8975-ui-field.d.ts +72 -0
  144. package/types/area8975-ui-file-input.d.ts +72 -0
  145. package/types/area8975-ui-file.d.ts +21 -0
  146. package/types/area8975-ui-format.d.ts +37 -0
  147. package/types/area8975-ui-input-addon.d.ts +10 -0
  148. package/types/area8975-ui-input-group.d.ts +18 -0
  149. package/types/area8975-ui-input.d.ts +224 -0
  150. package/types/area8975-ui-kpi.d.ts +36 -0
  151. package/types/area8975-ui-layout.d.ts +7 -0
  152. package/types/area8975-ui-loading.d.ts +16 -0
  153. package/types/area8975-ui-modal-close-btn.d.ts +14 -0
  154. package/types/area8975-ui-modal.d.ts +45 -0
  155. package/types/area8975-ui-money.d.ts +77 -0
  156. package/types/area8975-ui-overlay.d.ts +75 -0
  157. package/types/area8975-ui-pagination.d.ts +27 -0
  158. package/types/area8975-ui-private.d.ts +20 -0
  159. package/types/area8975-ui-progress.d.ts +127 -0
  160. package/types/area8975-ui-radio.d.ts +61 -0
  161. package/types/area8975-ui-rich-text-editor.d.ts +165 -0
  162. package/types/area8975-ui-search.d.ts +56 -0
  163. package/types/area8975-ui-segmented.d.ts +41 -0
  164. package/types/area8975-ui-select.d.ts +293 -0
  165. package/types/area8975-ui-sidebar-group.d.ts +15 -0
  166. package/types/area8975-ui-sidebar-item.d.ts +20 -0
  167. package/types/area8975-ui-sidebar.d.ts +16 -0
  168. package/types/area8975-ui-skeleton.d.ts +35 -0
  169. package/types/area8975-ui-stat.d.ts +13 -0
  170. package/types/area8975-ui-switch.d.ts +32 -0
  171. package/types/area8975-ui-tab.d.ts +45 -0
  172. package/types/area8975-ui-table-filters.d.ts +138 -0
  173. package/types/area8975-ui-table.d.ts +371 -0
  174. package/types/area8975-ui-textarea.d.ts +126 -0
  175. package/types/area8975-ui-theme.d.ts +61 -0
  176. package/types/area8975-ui-time-select.d.ts +35 -0
  177. package/types/area8975-ui-toast.d.ts +78 -0
  178. package/types/area8975-ui-toaster.d.ts +23 -0
  179. package/types/area8975-ui-tooltip.d.ts +47 -0
  180. package/types/area8975-ui-user-menu.d.ts +39 -0
  181. package/types/area8975-ui.d.ts +1 -4546
  182. package/fesm2022/area8975-ui.mjs.map +0 -1
@@ -0,0 +1,96 @@
1
+ import * as i0 from "@angular/core";
2
+ import { Component, input } from "@angular/core";
3
+ var UiCardHeaderComponent = class UiCardHeaderComponent {
4
+ heading = input.required(...ngDevMode ? [{ debugName: "heading" }] : /* istanbul ignore next */ []);
5
+ subtitle = input("", ...ngDevMode ? [{ debugName: "subtitle" }] : /* istanbul ignore next */ []);
6
+ headingLevel = input(2, ...ngDevMode ? [{ debugName: "headingLevel" }] : /* istanbul ignore next */ []);
7
+ static ɵfac = i0.ɵɵngDeclareFactory({
8
+ minVersion: "12.0.0",
9
+ version: "22.2.1",
10
+ ngImport: i0,
11
+ type: UiCardHeaderComponent,
12
+ deps: [],
13
+ target: i0.ɵɵFactoryTarget.Component
14
+ });
15
+ static ɵcmp = i0.ɵɵngDeclareComponent({
16
+ minVersion: "17.0.0",
17
+ version: "22.2.1",
18
+ type: UiCardHeaderComponent,
19
+ isStandalone: true,
20
+ selector: "ui-card-header",
21
+ inputs: {
22
+ heading: {
23
+ classPropertyName: "heading",
24
+ publicName: "heading",
25
+ isSignal: true,
26
+ isRequired: true,
27
+ transformFunction: null
28
+ },
29
+ subtitle: {
30
+ classPropertyName: "subtitle",
31
+ publicName: "subtitle",
32
+ isSignal: true,
33
+ isRequired: false,
34
+ transformFunction: null
35
+ },
36
+ headingLevel: {
37
+ classPropertyName: "headingLevel",
38
+ publicName: "headingLevel",
39
+ isSignal: true,
40
+ isRequired: false,
41
+ transformFunction: null
42
+ }
43
+ },
44
+ host: { classAttribute: "block" },
45
+ ngImport: i0,
46
+ template: "<header class=\"flex flex-wrap justify-between items-start gap-x-4 gap-y-3 mb-4\">\n <div class=\"min-w-0\">\n @switch (headingLevel()) {\n @case (3) {\n <h3 class=\"text-foreground ui-text-h4\">{{ heading() }}</h3>\n }\n @case (4) {\n <h4 class=\"text-foreground ui-text-h4\">{{ heading() }}</h4>\n }\n @default {\n <h2 class=\"text-foreground ui-text-h4\">{{ heading() }}</h2>\n }\n }\n\n @if (subtitle()) {\n <p class=\"mt-1 text-muted-foreground-1 ui-text-body-alt\">{{ subtitle() }}</p>\n }\n </div>\n\n <div class=\"flex flex-wrap empty:hidden items-center gap-2\"><ng-content /></div>\n</header>\n"
47
+ });
48
+ };
49
+ i0.ɵɵngDeclareClassMetadata({
50
+ minVersion: "12.0.0",
51
+ version: "22.2.1",
52
+ ngImport: i0,
53
+ type: UiCardHeaderComponent,
54
+ decorators: [{
55
+ type: Component,
56
+ args: [{
57
+ selector: "ui-card-header",
58
+ host: { class: "block" },
59
+ template: "<header class=\"flex flex-wrap justify-between items-start gap-x-4 gap-y-3 mb-4\">\n <div class=\"min-w-0\">\n @switch (headingLevel()) {\n @case (3) {\n <h3 class=\"text-foreground ui-text-h4\">{{ heading() }}</h3>\n }\n @case (4) {\n <h4 class=\"text-foreground ui-text-h4\">{{ heading() }}</h4>\n }\n @default {\n <h2 class=\"text-foreground ui-text-h4\">{{ heading() }}</h2>\n }\n }\n\n @if (subtitle()) {\n <p class=\"mt-1 text-muted-foreground-1 ui-text-body-alt\">{{ subtitle() }}</p>\n }\n </div>\n\n <div class=\"flex flex-wrap empty:hidden items-center gap-2\"><ng-content /></div>\n</header>\n"
60
+ }]
61
+ }],
62
+ propDecorators: {
63
+ heading: [{
64
+ type: i0.Input,
65
+ args: [{
66
+ isSignal: true,
67
+ alias: "heading",
68
+ required: true
69
+ }]
70
+ }],
71
+ subtitle: [{
72
+ type: i0.Input,
73
+ args: [{
74
+ isSignal: true,
75
+ alias: "subtitle",
76
+ required: false
77
+ }]
78
+ }],
79
+ headingLevel: [{
80
+ type: i0.Input,
81
+ args: [{
82
+ isSignal: true,
83
+ alias: "headingLevel",
84
+ required: false
85
+ }]
86
+ }]
87
+ }
88
+ });
89
+ const CardHeadingLevels = [
90
+ 2,
91
+ 3,
92
+ 4
93
+ ];
94
+ export { CardHeadingLevels, UiCardHeaderComponent };
95
+
96
+ //# sourceMappingURL=area8975-ui-card-header.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"area8975-ui-card-header.mjs","names":[],"sources":["../../../projects/ui/card-header/card-header.component.ts","../../../projects/ui/card-header/card-header.component.html","../../../projects/ui/card-header/card-header.types.ts"],"sourcesContent":["import { Component, input } from '@angular/core';\n\nimport type { CardHeadingLevel } from './card-header.types';\n\n\n@Component({\n selector: 'ui-card-header',\n templateUrl: './card-header.component.html',\n host: { class: 'block' }\n})\nexport class UiCardHeaderComponent {\n // not `title`, that would also show the native tooltip\n readonly heading = input.required<string>();\n readonly subtitle = input<string>('');\n\n /** Pick the level that fits the page's outline, it doesn't change the look. */\n readonly headingLevel = input<CardHeadingLevel>(2);\n}\n","<header class=\"flex flex-wrap justify-between items-start gap-x-4 gap-y-3 mb-4\">\n <div class=\"min-w-0\">\n @switch (headingLevel()) {\n @case (3) {\n <h3 class=\"text-foreground ui-text-h4\">{{ heading() }}</h3>\n }\n @case (4) {\n <h4 class=\"text-foreground ui-text-h4\">{{ heading() }}</h4>\n }\n @default {\n <h2 class=\"text-foreground ui-text-h4\">{{ heading() }}</h2>\n }\n }\n\n @if (subtitle()) {\n <p class=\"mt-1 text-muted-foreground-1 ui-text-body-alt\">{{ subtitle() }}</p>\n }\n </div>\n\n <div class=\"flex flex-wrap empty:hidden items-center gap-2\"><ng-content /></div>\n</header>\n","export const CardHeadingLevels = [2, 3, 4] as const;\n\n/** @see {@link CardHeadingLevels} */\nexport type CardHeadingLevel = typeof CardHeadingLevels[number];\n"],"mappings":";;AAUA,IAAa,wBAAb,MAAa,sBAAqB;CAErB,UAAU,MAAM,SAAkB,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAClC,WAAW,MAAc,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAG5B,eAAe,MAAwB,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,eAAA,CAAA,+BAAA,CAAA,CAAA;CANzC,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAqB,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAArB,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAqB,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,SAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,UAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,cAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,MAAA,EAAA,gBAAA,QAAA;EAAA,UAAA;EAAA,UCVlC;CAqBA,CAAA;;ADXa,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAqB,YAAA,CAAA;EALjC,MAAA;EACa,MAAA,CAAA;GAAA,UAAA;GAAgB,MAEpB,EAAE,OAAO,QAAO;GAAE,UAAA;EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AER5B,MAAa,oBAAoB;CAAC;CAAG;CAAG;AAAC"}
@@ -0,0 +1,73 @@
1
+ import * as i0 from "@angular/core";
2
+ import { Component, computed, input } from "@angular/core";
3
+ const CardRadii = [
4
+ "none",
5
+ "sm",
6
+ "md",
7
+ "lg",
8
+ "xl"
9
+ ];
10
+ const radiusClasses = {
11
+ none: "rounded-none",
12
+ sm: "rounded-sm",
13
+ md: "rounded-md",
14
+ lg: "rounded-lg",
15
+ xl: "rounded-xl"
16
+ };
17
+ var UiCardComponent = class UiCardComponent {
18
+ radius = input("md", ...ngDevMode ? [{ debugName: "radius" }] : /* istanbul ignore next */ []);
19
+ generatedClasses = computed(() => radiusClasses[this.radius()], ...ngDevMode ? [{ debugName: "generatedClasses" }] : /* istanbul ignore next */ []);
20
+ static ɵfac = i0.ɵɵngDeclareFactory({
21
+ minVersion: "12.0.0",
22
+ version: "22.2.1",
23
+ ngImport: i0,
24
+ type: UiCardComponent,
25
+ deps: [],
26
+ target: i0.ɵɵFactoryTarget.Component
27
+ });
28
+ static ɵcmp = i0.ɵɵngDeclareComponent({
29
+ minVersion: "17.1.0",
30
+ version: "22.2.1",
31
+ type: UiCardComponent,
32
+ isStandalone: true,
33
+ selector: "ui-card",
34
+ inputs: { radius: {
35
+ classPropertyName: "radius",
36
+ publicName: "radius",
37
+ isSignal: true,
38
+ isRequired: false,
39
+ transformFunction: null
40
+ } },
41
+ host: { properties: { "class": "generatedClasses()" } },
42
+ ngImport: i0,
43
+ template: "<ng-content />",
44
+ isInline: true,
45
+ styles: ["@layer properties;:host{display:block;border-style:var(--tw-border-style);border-width:1px;border-color:var(--card-line);background-color:var(--card);--tw-shadow: 0 1px var(--tw-shadow-color, rgb(0 0 0 / .05));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
46
+ });
47
+ };
48
+ i0.ɵɵngDeclareClassMetadata({
49
+ minVersion: "12.0.0",
50
+ version: "22.2.1",
51
+ ngImport: i0,
52
+ type: UiCardComponent,
53
+ decorators: [{
54
+ type: Component,
55
+ args: [{
56
+ selector: "ui-card",
57
+ template: "<ng-content />",
58
+ host: { "[class]": "generatedClasses()" },
59
+ styles: ["@layer properties;:host{display:block;border-style:var(--tw-border-style);border-width:1px;border-color:var(--card-line);background-color:var(--card);--tw-shadow: 0 1px var(--tw-shadow-color, rgb(0 0 0 / .05));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}@property --tw-border-style{syntax: \"*\"; inherits: false; initial-value: solid;}@property --tw-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: \"*\"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: \"<percentage>\"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: \"*\"; inherits: false;}@property --tw-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: \"*\"; inherits: false;}@property --tw-inset-ring-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: \"*\"; inherits: false;}@property --tw-ring-offset-width{syntax: \"<length>\"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: \"*\"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: \"*\"; inherits: false; initial-value: 0 0 #0000;}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style: solid;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000}}}\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n"]
60
+ }]
61
+ }],
62
+ propDecorators: { radius: [{
63
+ type: i0.Input,
64
+ args: [{
65
+ isSignal: true,
66
+ alias: "radius",
67
+ required: false
68
+ }]
69
+ }] }
70
+ });
71
+ export { CardRadii, UiCardComponent, radiusClasses };
72
+
73
+ //# sourceMappingURL=area8975-ui-card.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"area8975-ui-card.mjs","names":[],"sources":["../../../projects/ui/card/card.types.ts","../../../projects/ui/card/card.component.ts"],"sourcesContent":["/** The radius that a card can hold. Maps directly to tailwindcss' rounded classes. */\nexport const CardRadii = ['none', 'sm', 'md', 'lg', 'xl'] as const;\n\n/** @see {@link CardRadii} */\nexport type CardRadius = typeof CardRadii[number];\n\n// Written out in full so tailwind picks them up\nexport const radiusClasses: Record<CardRadius, string> = {\n none: 'rounded-none',\n sm: 'rounded-sm',\n md: 'rounded-md',\n lg: 'rounded-lg',\n xl: 'rounded-xl'\n};\n","import { Component, computed, input } from '@angular/core';\n\nimport { CardRadius, radiusClasses } from './card.types';\n\n\n@Component({\n selector: 'ui-card',\n template: '<ng-content />',\n styleUrl: './card.component.css',\n host: { '[class]': 'generatedClasses()' }\n})\nexport class UiCardComponent {\n readonly radius = input<CardRadius>('md');\n\n readonly generatedClasses = computed<string>(() =>\n radiusClasses[this.radius()]\n );\n}\n"],"mappings":";;AACA,MAAa,YAAY;CAAC;CAAQ;CAAM;CAAM;CAAM;AAAI;AAMxD,MAAa,gBAA4C;CACrD,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
18
+ "#8a7cf0",
19
+ "#e34948"
20
+ ];
21
+ const CHART_COLOURS = [
22
+ {
23
+ key: "blue",
24
+ label: "Blue",
25
+ light: "#2a78d6",
26
+ dark: "#2a78d6"
27
+ },
28
+ {
29
+ key: "orange",
30
+ label: "Orange",
31
+ light: "#eb6834",
32
+ dark: "#eb6834"
33
+ },
34
+ {
35
+ key: "teal",
36
+ label: "Teal",
37
+ light: "#1baf7a",
38
+ dark: "#1baf7a"
39
+ },
40
+ {
41
+ key: "amber",
42
+ label: "Amber",
43
+ light: "#eda100",
44
+ dark: "#eda100"
45
+ },
46
+ {
47
+ key: "pink",
48
+ label: "Pink",
49
+ light: "#e87ba4",
50
+ dark: "#e87ba4"
51
+ },
52
+ {
53
+ key: "green",
54
+ label: "Green",
55
+ light: "#008300",
56
+ dark: "#2e9e2e"
57
+ },
58
+ {
59
+ key: "violet",
60
+ label: "Violet",
61
+ light: "#4a3aa7",
62
+ dark: "#8a7cf0"
63
+ },
64
+ {
65
+ key: "red",
66
+ label: "Red",
67
+ light: "#e34948",
68
+ dark: "#e34948"
69
+ },
70
+ {
71
+ key: "magenta",
72
+ label: "Magenta",
73
+ light: "#7e147e",
74
+ dark: "#ab46aa"
75
+ },
76
+ {
77
+ key: "dark-yellow",
78
+ label: "Dark yellow",
79
+ light: "#a16d03",
80
+ dark: "#a16d03"
81
+ },
82
+ {
83
+ key: "dark-cyan",
84
+ label: "Dark cyan",
85
+ light: "#046971",
86
+ dark: "#247b83"
87
+ },
88
+ {
89
+ key: "mauve",
90
+ label: "Mauve",
91
+ light: "#693c5f",
92
+ dark: "#916185"
93
+ },
94
+ {
95
+ key: "cyan",
96
+ label: "Cyan",
97
+ light: "#309fb3",
98
+ dark: "#309fb3"
99
+ },
100
+ {
101
+ key: "light-purple",
102
+ label: "Light purple",
103
+ light: "#cb65e1",
104
+ dark: "#cb65e1"
105
+ },
106
+ {
107
+ key: "lilac",
108
+ label: "Lilac",
109
+ light: "#ad87b6",
110
+ dark: "#ad87b6"
111
+ },
112
+ {
113
+ key: "olive",
114
+ label: "Olive",
115
+ light: "#989401",
116
+ dark: "#989401"
117
+ },
118
+ {
119
+ key: "dark-red",
120
+ label: "Dark red",
121
+ light: "#842e26",
122
+ dark: "#ae544a"
123
+ },
124
+ {
125
+ key: "dark-green",
126
+ label: "Dark green",
127
+ light: "#406020",
128
+ dark: "#597b3a"
129
+ },
130
+ {
131
+ key: "tan",
132
+ label: "Tan",
133
+ light: "#bd8a66",
134
+ dark: "#bd8a66"
135
+ },
136
+ {
137
+ key: "purple",
138
+ label: "Purple",
139
+ light: "#7845ce",
140
+ dark: "#8452db"
141
+ },
142
+ {
143
+ key: "deep-pink",
144
+ label: "Deep pink",
145
+ light: "#db4594",
146
+ dark: "#db4594"
147
+ },
148
+ {
149
+ key: "grey-blue",
150
+ label: "Grey blue",
151
+ light: "#6f7db0",
152
+ dark: "#6f7db0"
153
+ }
154
+ ];
155
+ function pickedChartColour(key, dark = false) {
156
+ const colour = CHART_COLOURS.find((each) => each.key === key);
157
+ return dark ? colour.dark : colour.light;
158
+ }
159
+ const CHART_MAX_SERIES = CHART_PALETTE.length;
160
+ const CHART_MAX_LINE_SERIES = CHART_PALETTE.length * 2;
161
+ const CHART_INK = {
162
+ text: "#1e2939",
163
+ muted: "#6a7282",
164
+ grid: "#e5e7eb",
165
+ surface: "#ffffff",
166
+ context: "#d1d5dc"
167
+ };
168
+ const CHART_INK_DARK = {
169
+ text: "#e5e5e5",
170
+ muted: "#a1a1a1",
171
+ grid: "#404040",
172
+ surface: "#262626",
173
+ context: "#525252"
174
+ };
175
+ function chartInk(dark) {
176
+ return dark ? CHART_INK_DARK : CHART_INK;
177
+ }
178
+ function chartColour(index, dark = false) {
179
+ return (dark ? CHART_PALETTE_DARK : CHART_PALETTE)[index] ?? chartInk(dark).context;
180
+ }
181
+ function chartSeriesStyle(index, dashes, dark = false) {
182
+ if (dashes && index >= CHART_PALETTE.length && index < CHART_MAX_LINE_SERIES) return {
183
+ colour: chartColour(index - CHART_PALETTE.length, dark),
184
+ dashed: true
185
+ };
186
+ return {
187
+ colour: chartColour(index, dark),
188
+ dashed: false
189
+ };
190
+ }
191
+ const HEX_COLOUR = /^#([0-9a-f]{6})$/i;
192
+ function hexChannels(colour) {
193
+ const digits = HEX_COLOUR.exec(colour)?.[1];
194
+ return digits ? [
195
+ 0,
196
+ 2,
197
+ 4
198
+ ].map((at) => parseInt(digits.slice(at, at + 2), 16)) : null;
199
+ }
200
+ function mixChartColours(colour, towards, strength) {
201
+ const from = hexChannels(colour);
202
+ const to = hexChannels(towards);
203
+ if (!from || !to) return null;
204
+ return `#${from.map((channel, index) => Math.round(channel * strength + to[index] * (1 - strength))).map((channel) => channel.toString(16).padStart(2, "0")).join("")}`;
205
+ }
206
+ const DARK_LABEL = CHART_INK.text;
207
+ const LIGHT_LABEL = "#ffffff";
208
+ function chartLabelInk(background) {
209
+ const channels = hexChannels(background);
210
+ if (!channels) return DARK_LABEL;
211
+ const backgroundLuminance = screenLuminance(channels);
212
+ return lightnessContrast(screenLuminance(hexChannels(LIGHT_LABEL)), backgroundLuminance) > lightnessContrast(screenLuminance(hexChannels(DARK_LABEL)), backgroundLuminance) ? LIGHT_LABEL : DARK_LABEL;
213
+ }
214
+ function screenLuminance(channels) {
215
+ const [red, green, blue] = channels.map((channel) => (channel / 255) ** 2.4);
216
+ const luminance = .2126729 * red + .7151522 * green + .072175 * blue;
217
+ return luminance < .022 ? luminance + (.022 - luminance) ** 1.414 : luminance;
218
+ }
219
+ function lightnessContrast(textLuminance, backgroundLuminance) {
220
+ const contrast = backgroundLuminance > textLuminance ? (backgroundLuminance ** .56 - textLuminance ** .57) * 1.14 : (backgroundLuminance ** .65 - textLuminance ** .62) * 1.14;
221
+ return Math.max(Math.abs(contrast) - .027, 0) * 100;
222
+ }
223
+ export { CHART_COLOURS, CHART_INK, CHART_INK_DARK, CHART_MAX_LINE_SERIES, CHART_MAX_SERIES, CHART_PALETTE, CHART_PALETTE_DARK, chartColour, chartInk, chartLabelInk, chartSeriesStyle, mixChartColours, pickedChartColour };
224
+
225
+ //# sourceMappingURL=area8975-ui-chart-palette.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"area8975-ui-chart-palette.mjs","names":[],"sources":["../../../projects/ui/chart-palette/chart.palette.ts"],"sourcesContent":["/**\n * Categorical colours for chart series, in a fixed order that was checked for\n * colour blindness (adjacent pairs stay apart for protan, deutan and tritan).\n * Keep the order, a series takes the next slot, never a generated colour.\n */\nexport const CHART_PALETTE = [\n '#2a78d6', // blue\n '#eb6834', // orange\n '#1baf7a', // aqua\n '#eda100', // yellow\n '#e87ba4', // magenta\n '#008300', // green\n '#4a3aa7', // violet\n '#e34948' // red\n] as const;\n\n/** Violet and green are lightened to keep 3:1 contrast on a dark card. */\nexport const CHART_PALETTE_DARK = [\n '#2a78d6', // blue\n '#eb6834', // orange\n '#1baf7a', // aqua\n '#eda100', // yellow\n '#e87ba4', // magenta\n '#2e9e2e', // green\n '#8a7cf0', // violet\n '#e34948' // red\n] as const;\n\n/** A colour someone picks for a thing, e.g. a category, that every chart then draws it in. */\nexport interface ChartColour {\n /** Stable, safe to store. Never rename or reuse one. */\n readonly key: string;\n /** What to call it in a picker, and for screen readers. */\n readonly label: string;\n /** On a light card (`CHART_INK.surface`), at least 3:1. */\n readonly light: string;\n /** On a dark card (`CHART_INK_DARK.surface`), at least 3:1. */\n readonly dark: string;\n}\n\n/**\n * Every colour that can be picked, the automatic palette first. Too many to tell\n * apart by colour alone for everyone, so always show a label alongside.\n */\nexport const CHART_COLOURS = [\n { key: 'blue', label: 'Blue', light: '#2a78d6', dark: '#2a78d6' },\n { key: 'orange', label: 'Orange', light: '#eb6834', dark: '#eb6834' },\n { key: 'teal', label: 'Teal', light: '#1baf7a', dark: '#1baf7a' },\n { key: 'amber', label: 'Amber', light: '#eda100', dark: '#eda100' },\n { key: 'pink', label: 'Pink', light: '#e87ba4', dark: '#e87ba4' },\n { key: 'green', label: 'Green', light: '#008300', dark: '#2e9e2e' },\n { key: 'violet', label: 'Violet', light: '#4a3aa7', dark: '#8a7cf0' },\n { key: 'red', label: 'Red', light: '#e34948', dark: '#e34948' },\n { key: 'magenta', label: 'Magenta', light: '#7e147e', dark: '#ab46aa' },\n { key: 'dark-yellow', label: 'Dark yellow', light: '#a16d03', dark: '#a16d03' },\n { key: 'dark-cyan', label: 'Dark cyan', light: '#046971', dark: '#247b83' },\n { key: 'mauve', label: 'Mauve', light: '#693c5f', dark: '#916185' },\n { key: 'cyan', label: 'Cyan', light: '#309fb3', dark: '#309fb3' },\n { key: 'light-purple', label: 'Light purple', light: '#cb65e1', dark: '#cb65e1' },\n { key: 'lilac', label: 'Lilac', light: '#ad87b6', dark: '#ad87b6' },\n { key: 'olive', label: 'Olive', light: '#989401', dark: '#989401' },\n { key: 'dark-red', label: 'Dark red', light: '#842e26', dark: '#ae544a' },\n { key: 'dark-green', label: 'Dark green', light: '#406020', dark: '#597b3a' },\n { key: 'tan', label: 'Tan', light: '#bd8a66', dark: '#bd8a66' },\n { key: 'purple', label: 'Purple', light: '#7845ce', dark: '#8452db' },\n { key: 'deep-pink', label: 'Deep pink', light: '#db4594', dark: '#db4594' },\n { key: 'grey-blue', label: 'Grey blue', light: '#6f7db0', dark: '#6f7db0' }\n] as const satisfies readonly ChartColour[];\n\nexport type ChartColourKey = typeof CHART_COLOURS[number]['key'];\n\n/** The shade of a picked colour for the current theme. */\nexport function pickedChartColour(key: ChartColourKey, dark = false): string {\n const colour = CHART_COLOURS.find(each => each.key === key)!;\n return dark ? colour.dark : colour.light;\n}\n\n/** Past eight series, fold the rest into \"Other\" instead of reusing a colour. */\nexport const CHART_MAX_SERIES = CHART_PALETTE.length;\n\n/** Lines can go to sixteen, the second eight reuse the colours dashed. */\nexport const CHART_MAX_LINE_SERIES = CHART_PALETTE.length * 2;\n\n/** Chart chrome, apex needs real colours so these can't be CSS variables. */\nexport interface ChartInk {\n text: string;\n muted: string;\n grid: string;\n surface: string;\n\n context: string;\n}\n\nexport const CHART_INK: ChartInk = {\n text: '#1e2939', // gray-800\n muted: '#6a7282', // gray-500\n grid: '#e5e7eb', // gray-200\n surface: '#ffffff',\n context: '#d1d5dc' // gray-300\n};\n\nexport const CHART_INK_DARK: ChartInk = {\n text: '#e5e5e5', // neutral-200\n muted: '#a1a1a1', // neutral-400\n grid: '#404040', // neutral-700\n surface: '#262626', // neutral-800\n context: '#525252' // neutral-600\n};\n\nexport function chartInk(dark: boolean): ChartInk {\n return dark ? CHART_INK_DARK : CHART_INK;\n}\n\nexport interface ChartSeriesStyle {\n colour: string;\n dashed: boolean;\n}\n\n/** Past the eighth slot a series goes grey, reusing a colour would make two series look the same. */\nexport function chartColour(index: number, dark = false): string {\n return (dark ? CHART_PALETTE_DARK : CHART_PALETTE)[index] ?? chartInk(dark).context;\n}\n\n/**\n * Colour plus line style for a slot. With `dashes` the ninth to sixteenth\n * slots reuse the colours as dashed lines, colour and dash together keep\n * them apart. Anything past that is grey.\n */\nexport function chartSeriesStyle(index: number, dashes: boolean, dark = false): ChartSeriesStyle {\n if (dashes && index >= CHART_PALETTE.length && index < CHART_MAX_LINE_SERIES) {\n return { colour: chartColour(index - CHART_PALETTE.length, dark), dashed: true };\n }\n\n return { colour: chartColour(index, dark), dashed: false };\n}\n\nconst HEX_COLOUR = /^#([0-9a-f]{6})$/i;\n\nfunction hexChannels(colour: string): number[] | null {\n const digits = HEX_COLOUR.exec(colour)?.[1];\n\n return digits\n ? [0, 2, 4].map(at => parseInt(digits.slice(at, at + 2), 16))\n : null;\n}\n\n/**\n * Blends `colour` towards `towards`, keeping `strength` of the original: 1 leaves\n * it as it is, 0 gives `towards`. Apex can't parse color-mix(), so it's done\n * here. Both must be six digit hex, anything else gives null.\n */\nexport function mixChartColours(colour: string, towards: string, strength: number): string | null {\n const from = hexChannels(colour);\n const to = hexChannels(towards);\n\n if (!from || !to) {\n return null;\n }\n\n const mixed = from.map((channel, index) =>\n Math.round(channel * strength + to[index] * (1 - strength))\n );\n\n return `#${mixed.map(channel => channel.toString(16).padStart(2, '0')).join('')}`;\n}\n\nconst DARK_LABEL = CHART_INK.text;\nconst LIGHT_LABEL = '#ffffff';\n\n/**\n * Dark or light text, whichever reads better on a mark filled with `background`.\n * Judged by APCA, the contrast model drafted for WCAG 3: the WCAG 2 ratio\n * puts black text on saturated orange and red, where white reads far better.\n */\nexport function chartLabelInk(background: string): string {\n const channels = hexChannels(background);\n\n if (!channels) {\n return DARK_LABEL;\n }\n\n const backgroundLuminance = screenLuminance(channels);\n const lightContrast = lightnessContrast(screenLuminance(hexChannels(LIGHT_LABEL)!), backgroundLuminance);\n const darkContrast = lightnessContrast(screenLuminance(hexChannels(DARK_LABEL)!), backgroundLuminance);\n\n return lightContrast > darkContrast ? LIGHT_LABEL : DARK_LABEL;\n}\n\n// APCA's luminance, with its soft clamp that lifts near-black colours\nfunction screenLuminance(channels: number[]): number {\n const [red, green, blue] = channels.map(channel => (channel / 255) ** 2.4);\n const luminance = 0.2126729 * red + 0.7151522 * green + 0.072175 * blue;\n\n return luminance < 0.022 ? luminance + (0.022 - luminance) ** 1.414 : luminance;\n}\n\n// APCA's lightness contrast (Lc) between text and its background, as a size whichever way round\nfunction lightnessContrast(textLuminance: number, backgroundLuminance: number): number {\n const darkOnLight = backgroundLuminance > textLuminance;\n const contrast = darkOnLight\n ? (backgroundLuminance ** 0.56 - textLuminance ** 0.57) * 1.14\n : (backgroundLuminance ** 0.65 - textLuminance ** 0.62) * 1.14;\n\n return Math.max(Math.abs(contrast) - 0.027, 0) * 100;\n}\n"],"mappings":"AAKA,MAAa,gBAAgB;CACzB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACM;AAGV,MAAa,qBAAqB;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACM;AAkBV,MAAa,gBAAgB;CACzB;EAAE,KAAK;EAAQ,OAAO;EAAQ,OAAO;EAAW,MAAM;CAAS;CAC/D;EAAE,KAAK;EAAU,OAAO;EAAU,OAAO;EAAW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