@edsis/angular 21.3.15 → 22.0.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 (514) hide show
  1. package/.npmignore +2 -0
  2. package/README.md +261 -88
  3. package/collection.json +30 -0
  4. package/component/accordion/README.md +195 -0
  5. package/component/accordion/package.json +4 -0
  6. package/component/alert/README.md +182 -0
  7. package/component/alert/package.json +4 -0
  8. package/component/alert-dialog/README.md +239 -0
  9. package/component/alert-dialog/package.json +4 -0
  10. package/component/aspect-ratio/README.md +112 -0
  11. package/component/aspect-ratio/package.json +4 -0
  12. package/component/avatar/README.md +176 -0
  13. package/component/avatar/package.json +4 -0
  14. package/component/badge/README.md +133 -0
  15. package/component/badge/package.json +4 -0
  16. package/component/breadcrumb/README.md +216 -0
  17. package/component/breadcrumb/package.json +4 -0
  18. package/component/button/README.md +139 -0
  19. package/component/button/package.json +4 -0
  20. package/component/button-group/README.md +208 -0
  21. package/component/button-group/package.json +4 -0
  22. package/component/calendar/README.md +132 -0
  23. package/component/calendar/package.json +4 -0
  24. package/component/card/README.md +220 -0
  25. package/component/card/package.json +4 -0
  26. package/component/carousel/README.md +276 -0
  27. package/component/carousel/package.json +4 -0
  28. package/component/chart/README.md +249 -0
  29. package/component/chart/area/package.json +4 -0
  30. package/component/chart/bar/package.json +4 -0
  31. package/component/chart/line/package.json +4 -0
  32. package/component/chart/package.json +4 -0
  33. package/component/chart/pie/package.json +4 -0
  34. package/component/chart/radar/package.json +4 -0
  35. package/component/chart/radial/package.json +4 -0
  36. package/component/chart/scatter/package.json +4 -0
  37. package/component/checkbox/README.md +149 -0
  38. package/component/checkbox/package.json +4 -0
  39. package/component/collapsible/README.md +195 -0
  40. package/component/collapsible/package.json +4 -0
  41. package/component/combobox/README.md +198 -0
  42. package/component/combobox/package.json +4 -0
  43. package/component/command/README.md +275 -0
  44. package/component/command/package.json +4 -0
  45. package/component/composer/README.md +235 -0
  46. package/component/composer/package.json +4 -0
  47. package/component/context-menu/README.md +267 -0
  48. package/component/context-menu/package.json +4 -0
  49. package/component/date-picker/README.md +177 -0
  50. package/component/date-picker/package.json +4 -0
  51. package/component/dialog/README.md +237 -0
  52. package/component/dialog/package.json +4 -0
  53. package/component/drawer/README.md +145 -0
  54. package/component/drawer/package.json +4 -0
  55. package/component/dropdown-menu/README.md +311 -0
  56. package/component/dropdown-menu/package.json +4 -0
  57. package/component/editor/README.md +136 -0
  58. package/component/editor/package.json +4 -0
  59. package/component/empty/README.md +183 -0
  60. package/component/empty/package.json +4 -0
  61. package/component/form/README.md +210 -0
  62. package/component/form/package.json +4 -0
  63. package/component/hover-card/README.md +146 -0
  64. package/component/hover-card/package.json +4 -0
  65. package/component/input/README.md +159 -0
  66. package/component/input/package.json +4 -0
  67. package/component/input-group/README.md +239 -0
  68. package/component/input-group/package.json +4 -0
  69. package/component/input-otp/README.md +278 -0
  70. package/component/input-otp/package.json +4 -0
  71. package/component/item/README.md +247 -0
  72. package/component/item/package.json +4 -0
  73. package/component/kanban/README.md +81 -0
  74. package/component/kanban/package.json +4 -0
  75. package/component/kbd/README.md +139 -0
  76. package/component/kbd/package.json +4 -0
  77. package/component/label/README.md +136 -0
  78. package/component/label/package.json +4 -0
  79. package/component/menubar/README.md +269 -0
  80. package/component/menubar/package.json +4 -0
  81. package/component/native-select/README.md +176 -0
  82. package/component/native-select/package.json +4 -0
  83. package/component/navigation-menu/README.md +160 -0
  84. package/component/navigation-menu/package.json +4 -0
  85. package/component/pagination/README.md +144 -0
  86. package/component/pagination/package.json +4 -0
  87. package/component/pillbox/README.md +67 -0
  88. package/component/pillbox/package.json +4 -0
  89. package/component/popover/README.md +43 -0
  90. package/component/popover/package.json +4 -0
  91. package/component/progress/README.md +160 -0
  92. package/component/progress/package.json +4 -0
  93. package/component/radio/README.md +209 -0
  94. package/component/radio/package.json +4 -0
  95. package/component/resizable/README.md +168 -0
  96. package/component/resizable/package.json +4 -0
  97. package/component/scroll-area/README.md +143 -0
  98. package/component/scroll-area/package.json +4 -0
  99. package/component/select/README.md +174 -0
  100. package/component/select/package.json +4 -0
  101. package/component/separator/README.md +170 -0
  102. package/component/separator/package.json +4 -0
  103. package/component/sheet/README.md +183 -0
  104. package/component/sheet/package.json +4 -0
  105. package/component/skeleton/README.md +158 -0
  106. package/component/skeleton/package.json +4 -0
  107. package/component/slider/README.md +207 -0
  108. package/component/slider/package.json +4 -0
  109. package/component/spinner/README.md +160 -0
  110. package/component/spinner/package.json +4 -0
  111. package/component/switch/README.md +166 -0
  112. package/component/switch/package.json +4 -0
  113. package/component/table/README.md +291 -0
  114. package/component/table/package.json +4 -0
  115. package/component/tabs/README.md +219 -0
  116. package/component/tabs/package.json +4 -0
  117. package/component/textarea/README.md +154 -0
  118. package/component/textarea/package.json +4 -0
  119. package/component/timeline/README.md +94 -0
  120. package/component/timeline/package.json +4 -0
  121. package/component/toast/README.md +321 -0
  122. package/component/toast/package.json +4 -0
  123. package/component/toggle/README.md +131 -0
  124. package/component/toggle/package.json +4 -0
  125. package/component/toggle-group/README.md +206 -0
  126. package/component/toggle-group/package.json +4 -0
  127. package/component/tooltip/README.md +211 -0
  128. package/component/tooltip/package.json +4 -0
  129. package/component/utils/package.json +4 -0
  130. package/fesm2022/ojiepermana-angular-component-accordion.mjs +189 -0
  131. package/fesm2022/ojiepermana-angular-component-accordion.mjs.map +1 -0
  132. package/fesm2022/ojiepermana-angular-component-alert-dialog.mjs +276 -0
  133. package/fesm2022/ojiepermana-angular-component-alert-dialog.mjs.map +1 -0
  134. package/fesm2022/ojiepermana-angular-component-alert.mjs +99 -0
  135. package/fesm2022/ojiepermana-angular-component-alert.mjs.map +1 -0
  136. package/fesm2022/ojiepermana-angular-component-aspect-ratio.mjs +37 -0
  137. package/fesm2022/ojiepermana-angular-component-aspect-ratio.mjs.map +1 -0
  138. package/fesm2022/ojiepermana-angular-component-avatar.mjs +139 -0
  139. package/fesm2022/ojiepermana-angular-component-avatar.mjs.map +1 -0
  140. package/fesm2022/ojiepermana-angular-component-badge.mjs +50 -0
  141. package/fesm2022/ojiepermana-angular-component-badge.mjs.map +1 -0
  142. package/fesm2022/ojiepermana-angular-component-breadcrumb.mjs +200 -0
  143. package/fesm2022/ojiepermana-angular-component-breadcrumb.mjs.map +1 -0
  144. package/fesm2022/ojiepermana-angular-component-button-group.mjs +103 -0
  145. package/fesm2022/ojiepermana-angular-component-button-group.mjs.map +1 -0
  146. package/fesm2022/ojiepermana-angular-component-button.mjs +68 -0
  147. package/fesm2022/ojiepermana-angular-component-button.mjs.map +1 -0
  148. package/fesm2022/ojiepermana-angular-component-calendar.mjs +88 -0
  149. package/fesm2022/ojiepermana-angular-component-calendar.mjs.map +1 -0
  150. package/fesm2022/ojiepermana-angular-component-card.mjs +152 -0
  151. package/fesm2022/ojiepermana-angular-component-card.mjs.map +1 -0
  152. package/fesm2022/ojiepermana-angular-component-carousel.mjs +334 -0
  153. package/fesm2022/ojiepermana-angular-component-carousel.mjs.map +1 -0
  154. package/fesm2022/ojiepermana-angular-component-chart-area.mjs +6 -0
  155. package/fesm2022/ojiepermana-angular-component-chart-area.mjs.map +1 -0
  156. package/fesm2022/ojiepermana-angular-component-chart-bar.mjs +6 -0
  157. package/fesm2022/ojiepermana-angular-component-chart-bar.mjs.map +1 -0
  158. package/fesm2022/ojiepermana-angular-component-chart-line.mjs +6 -0
  159. package/fesm2022/ojiepermana-angular-component-chart-line.mjs.map +1 -0
  160. package/fesm2022/ojiepermana-angular-component-chart-pie.mjs +6 -0
  161. package/fesm2022/ojiepermana-angular-component-chart-pie.mjs.map +1 -0
  162. package/fesm2022/ojiepermana-angular-component-chart-radar.mjs +6 -0
  163. package/fesm2022/ojiepermana-angular-component-chart-radar.mjs.map +1 -0
  164. package/fesm2022/ojiepermana-angular-component-chart-radial.mjs +6 -0
  165. package/fesm2022/ojiepermana-angular-component-chart-radial.mjs.map +1 -0
  166. package/fesm2022/ojiepermana-angular-component-chart-scatter.mjs +6 -0
  167. package/fesm2022/ojiepermana-angular-component-chart-scatter.mjs.map +1 -0
  168. package/fesm2022/ojiepermana-angular-component-chart.mjs +3925 -0
  169. package/fesm2022/ojiepermana-angular-component-chart.mjs.map +1 -0
  170. package/fesm2022/ojiepermana-angular-component-checkbox.mjs +114 -0
  171. package/fesm2022/ojiepermana-angular-component-checkbox.mjs.map +1 -0
  172. package/fesm2022/ojiepermana-angular-component-collapsible.mjs +124 -0
  173. package/fesm2022/ojiepermana-angular-component-collapsible.mjs.map +1 -0
  174. package/fesm2022/ojiepermana-angular-component-combobox.mjs +272 -0
  175. package/fesm2022/ojiepermana-angular-component-combobox.mjs.map +1 -0
  176. package/fesm2022/ojiepermana-angular-component-command.mjs +293 -0
  177. package/fesm2022/ojiepermana-angular-component-command.mjs.map +1 -0
  178. package/fesm2022/ojiepermana-angular-component-composer.mjs +352 -0
  179. package/fesm2022/ojiepermana-angular-component-composer.mjs.map +1 -0
  180. package/fesm2022/ojiepermana-angular-component-context-menu.mjs +103 -0
  181. package/fesm2022/ojiepermana-angular-component-context-menu.mjs.map +1 -0
  182. package/fesm2022/ojiepermana-angular-component-date-picker.mjs +170 -0
  183. package/fesm2022/ojiepermana-angular-component-date-picker.mjs.map +1 -0
  184. package/fesm2022/ojiepermana-angular-component-dialog.mjs +279 -0
  185. package/fesm2022/ojiepermana-angular-component-dialog.mjs.map +1 -0
  186. package/fesm2022/ojiepermana-angular-component-drawer.mjs +6 -0
  187. package/fesm2022/ojiepermana-angular-component-drawer.mjs.map +1 -0
  188. package/fesm2022/ojiepermana-angular-component-dropdown-menu.mjs +492 -0
  189. package/fesm2022/ojiepermana-angular-component-dropdown-menu.mjs.map +1 -0
  190. package/fesm2022/ojiepermana-angular-component-editor.mjs +717 -0
  191. package/fesm2022/ojiepermana-angular-component-editor.mjs.map +1 -0
  192. package/fesm2022/ojiepermana-angular-component-empty.mjs +145 -0
  193. package/fesm2022/ojiepermana-angular-component-empty.mjs.map +1 -0
  194. package/fesm2022/ojiepermana-angular-component-form.mjs +366 -0
  195. package/fesm2022/ojiepermana-angular-component-form.mjs.map +1 -0
  196. package/fesm2022/ojiepermana-angular-component-hover-card.mjs +297 -0
  197. package/fesm2022/ojiepermana-angular-component-hover-card.mjs.map +1 -0
  198. package/fesm2022/ojiepermana-angular-component-input-group.mjs +179 -0
  199. package/fesm2022/ojiepermana-angular-component-input-group.mjs.map +1 -0
  200. package/fesm2022/ojiepermana-angular-component-input-otp.mjs +514 -0
  201. package/fesm2022/ojiepermana-angular-component-input-otp.mjs.map +1 -0
  202. package/fesm2022/ojiepermana-angular-component-input.mjs +45 -0
  203. package/fesm2022/ojiepermana-angular-component-input.mjs.map +1 -0
  204. package/fesm2022/ojiepermana-angular-component-item.mjs +264 -0
  205. package/fesm2022/ojiepermana-angular-component-item.mjs.map +1 -0
  206. package/fesm2022/ojiepermana-angular-component-kanban.mjs +314 -0
  207. package/fesm2022/ojiepermana-angular-component-kanban.mjs.map +1 -0
  208. package/fesm2022/ojiepermana-angular-component-kbd.mjs +55 -0
  209. package/fesm2022/ojiepermana-angular-component-kbd.mjs.map +1 -0
  210. package/fesm2022/ojiepermana-angular-component-label.mjs +33 -0
  211. package/fesm2022/ojiepermana-angular-component-label.mjs.map +1 -0
  212. package/fesm2022/ojiepermana-angular-component-menubar.mjs +308 -0
  213. package/fesm2022/ojiepermana-angular-component-menubar.mjs.map +1 -0
  214. package/fesm2022/ojiepermana-angular-component-native-select.mjs +67 -0
  215. package/fesm2022/ojiepermana-angular-component-native-select.mjs.map +1 -0
  216. package/fesm2022/ojiepermana-angular-component-navigation-menu.mjs +413 -0
  217. package/fesm2022/ojiepermana-angular-component-navigation-menu.mjs.map +1 -0
  218. package/fesm2022/ojiepermana-angular-component-pagination.mjs +226 -0
  219. package/fesm2022/ojiepermana-angular-component-pagination.mjs.map +1 -0
  220. package/fesm2022/ojiepermana-angular-component-pillbox.mjs +812 -0
  221. package/fesm2022/ojiepermana-angular-component-pillbox.mjs.map +1 -0
  222. package/fesm2022/ojiepermana-angular-component-popover.mjs +169 -0
  223. package/fesm2022/ojiepermana-angular-component-popover.mjs.map +1 -0
  224. package/fesm2022/ojiepermana-angular-component-progress.mjs +60 -0
  225. package/fesm2022/ojiepermana-angular-component-progress.mjs.map +1 -0
  226. package/fesm2022/ojiepermana-angular-component-radio.mjs +122 -0
  227. package/fesm2022/ojiepermana-angular-component-radio.mjs.map +1 -0
  228. package/fesm2022/ojiepermana-angular-component-resizable.mjs +481 -0
  229. package/fesm2022/ojiepermana-angular-component-resizable.mjs.map +1 -0
  230. package/fesm2022/ojiepermana-angular-component-scroll-area.mjs +54 -0
  231. package/fesm2022/ojiepermana-angular-component-scroll-area.mjs.map +1 -0
  232. package/fesm2022/ojiepermana-angular-component-select.mjs +176 -0
  233. package/fesm2022/ojiepermana-angular-component-select.mjs.map +1 -0
  234. package/fesm2022/ojiepermana-angular-component-separator.mjs +37 -0
  235. package/fesm2022/ojiepermana-angular-component-separator.mjs.map +1 -0
  236. package/fesm2022/ojiepermana-angular-component-sheet.mjs +284 -0
  237. package/fesm2022/ojiepermana-angular-component-sheet.mjs.map +1 -0
  238. package/fesm2022/ojiepermana-angular-component-skeleton.mjs +31 -0
  239. package/fesm2022/ojiepermana-angular-component-skeleton.mjs.map +1 -0
  240. package/fesm2022/ojiepermana-angular-component-slider.mjs +423 -0
  241. package/fesm2022/ojiepermana-angular-component-slider.mjs.map +1 -0
  242. package/fesm2022/ojiepermana-angular-component-spinner.mjs +60 -0
  243. package/fesm2022/ojiepermana-angular-component-spinner.mjs.map +1 -0
  244. package/fesm2022/ojiepermana-angular-component-switch.mjs +116 -0
  245. package/fesm2022/ojiepermana-angular-component-switch.mjs.map +1 -0
  246. package/fesm2022/ojiepermana-angular-component-table.mjs +155 -0
  247. package/fesm2022/ojiepermana-angular-component-table.mjs.map +1 -0
  248. package/fesm2022/ojiepermana-angular-component-tabs.mjs +272 -0
  249. package/fesm2022/ojiepermana-angular-component-tabs.mjs.map +1 -0
  250. package/fesm2022/ojiepermana-angular-component-textarea.mjs +39 -0
  251. package/fesm2022/ojiepermana-angular-component-textarea.mjs.map +1 -0
  252. package/fesm2022/ojiepermana-angular-component-timeline.mjs +237 -0
  253. package/fesm2022/ojiepermana-angular-component-timeline.mjs.map +1 -0
  254. package/fesm2022/ojiepermana-angular-component-toast.mjs +71 -0
  255. package/fesm2022/ojiepermana-angular-component-toast.mjs.map +1 -0
  256. package/fesm2022/ojiepermana-angular-component-toggle-group.mjs +289 -0
  257. package/fesm2022/ojiepermana-angular-component-toggle-group.mjs.map +1 -0
  258. package/fesm2022/ojiepermana-angular-component-toggle.mjs +82 -0
  259. package/fesm2022/ojiepermana-angular-component-toggle.mjs.map +1 -0
  260. package/fesm2022/ojiepermana-angular-component-tooltip.mjs +354 -0
  261. package/fesm2022/ojiepermana-angular-component-tooltip.mjs.map +1 -0
  262. package/fesm2022/ojiepermana-angular-component-utils.mjs +13 -0
  263. package/fesm2022/ojiepermana-angular-component-utils.mjs.map +1 -0
  264. package/fesm2022/ojiepermana-angular-generator-api.mjs +68 -0
  265. package/fesm2022/ojiepermana-angular-generator-api.mjs.map +1 -0
  266. package/fesm2022/ojiepermana-angular-layout-component.mjs +602 -0
  267. package/fesm2022/ojiepermana-angular-layout-component.mjs.map +1 -0
  268. package/fesm2022/ojiepermana-angular-layout-provider.mjs +21 -0
  269. package/fesm2022/ojiepermana-angular-layout-provider.mjs.map +1 -0
  270. package/fesm2022/ojiepermana-angular-layout-services.mjs +116 -0
  271. package/fesm2022/ojiepermana-angular-layout-services.mjs.map +1 -0
  272. package/fesm2022/ojiepermana-angular-layout-shell.mjs +48 -0
  273. package/fesm2022/ojiepermana-angular-layout-shell.mjs.map +1 -0
  274. package/fesm2022/ojiepermana-angular-layout-token-directive.mjs +30 -0
  275. package/fesm2022/ojiepermana-angular-layout-token-directive.mjs.map +1 -0
  276. package/fesm2022/ojiepermana-angular-layout-token.mjs +33 -0
  277. package/fesm2022/ojiepermana-angular-layout-token.mjs.map +1 -0
  278. package/fesm2022/ojiepermana-angular-layout-type-empty.mjs +49 -0
  279. package/fesm2022/ojiepermana-angular-layout-type-empty.mjs.map +1 -0
  280. package/fesm2022/ojiepermana-angular-layout-type-horizontal.mjs +128 -0
  281. package/fesm2022/ojiepermana-angular-layout-type-horizontal.mjs.map +1 -0
  282. package/fesm2022/ojiepermana-angular-layout-type-vertical.mjs +123 -0
  283. package/fesm2022/ojiepermana-angular-layout-type-vertical.mjs.map +1 -0
  284. package/fesm2022/ojiepermana-angular-layout.mjs +485 -0
  285. package/fesm2022/ojiepermana-angular-layout.mjs.map +1 -0
  286. package/fesm2022/ojiepermana-angular-navigation-demo-data.mjs +334 -0
  287. package/fesm2022/ojiepermana-angular-navigation-demo-data.mjs.map +1 -0
  288. package/fesm2022/ojiepermana-angular-navigation-icon.mjs +63 -0
  289. package/fesm2022/ojiepermana-angular-navigation-icon.mjs.map +1 -0
  290. package/fesm2022/ojiepermana-angular-navigation-item.mjs +559 -0
  291. package/fesm2022/ojiepermana-angular-navigation-item.mjs.map +1 -0
  292. package/fesm2022/ojiepermana-angular-navigation-service.mjs +213 -0
  293. package/fesm2022/ojiepermana-angular-navigation-service.mjs.map +1 -0
  294. package/fesm2022/ojiepermana-angular-navigation-sidebar.mjs +401 -0
  295. package/fesm2022/ojiepermana-angular-navigation-sidebar.mjs.map +1 -0
  296. package/fesm2022/ojiepermana-angular-navigation-topbar.mjs +670 -0
  297. package/fesm2022/ojiepermana-angular-navigation-topbar.mjs.map +1 -0
  298. package/fesm2022/ojiepermana-angular-navigation-types.mjs +4 -0
  299. package/fesm2022/ojiepermana-angular-navigation-types.mjs.map +1 -0
  300. package/fesm2022/ojiepermana-angular-theme-provider.mjs +35 -0
  301. package/fesm2022/ojiepermana-angular-theme-provider.mjs.map +1 -0
  302. package/fesm2022/ojiepermana-angular-theme-services.mjs +294 -0
  303. package/fesm2022/ojiepermana-angular-theme-services.mjs.map +1 -0
  304. package/fesm2022/ojiepermana-angular-theme-token.mjs +56 -0
  305. package/fesm2022/ojiepermana-angular-theme-token.mjs.map +1 -0
  306. package/fesm2022/ojiepermana-angular-theme.mjs +390 -0
  307. package/fesm2022/ojiepermana-angular-theme.mjs.map +1 -0
  308. package/fesm2022/ojiepermana-angular.mjs +22 -0
  309. package/fesm2022/ojiepermana-angular.mjs.map +1 -0
  310. package/generator/api/README.md +252 -0
  311. package/generator/api/bin/package.json +3 -0
  312. package/generator/api/bin/schematics/init/index.js +90 -0
  313. package/generator/api/bin/schematics/ng-add/index.js +131 -0
  314. package/generator/api/bin/schematics/sdk/index.js +76 -0
  315. package/generator/api/bin/src/config/loader.js +41 -0
  316. package/generator/api/bin/src/config/schema.js +57 -0
  317. package/generator/api/bin/src/emit/client.js +248 -0
  318. package/generator/api/bin/src/emit/metadata.js +295 -0
  319. package/generator/api/bin/src/emit/models.js +106 -0
  320. package/generator/api/bin/src/emit/navigation.js +56 -0
  321. package/generator/api/bin/src/emit/operations.js +122 -0
  322. package/generator/api/bin/src/emit/public-api.js +54 -0
  323. package/generator/api/bin/src/emit/services.js +87 -0
  324. package/generator/api/bin/src/engine.js +65 -0
  325. package/generator/api/bin/src/layout/per-domain.js +359 -0
  326. package/generator/api/bin/src/parser/bundle.js +25 -0
  327. package/generator/api/bin/src/parser/ir.js +320 -0
  328. package/generator/api/bin/src/parser/types.js +7 -0
  329. package/generator/api/bin/src/render/template.js +58 -0
  330. package/generator/api/bin/src/writer/index.js +278 -0
  331. package/generator/api/package.json +4 -0
  332. package/generator/api/schematics/init/schema.json +19 -0
  333. package/generator/api/schematics/ng-add/schema.json +14 -0
  334. package/generator/api/schematics/sdk/schema.json +19 -0
  335. package/generator/api/sdk.config.example.json +24 -0
  336. package/generator/guide/README.md +84 -0
  337. package/generator/guide/bin/package.json +3 -0
  338. package/generator/guide/bin/schematics/build/index.js +36 -0
  339. package/generator/guide/bin/schematics/init/index.js +70 -0
  340. package/generator/guide/bin/src/config/loader.js +50 -0
  341. package/generator/guide/bin/src/config/schema.js +12 -0
  342. package/generator/guide/bin/src/engine/component.js +74 -0
  343. package/generator/guide/bin/src/engine/frontmatter.js +42 -0
  344. package/generator/guide/bin/src/engine/index.js +42 -0
  345. package/generator/guide/bin/src/engine/naming.js +39 -0
  346. package/generator/guide/bin/src/engine/render.js +36 -0
  347. package/generator/guide/bin/src/engine/routes.js +106 -0
  348. package/generator/guide/bin/src/engine/walk.js +35 -0
  349. package/generator/guide/guide.config.example.json +9 -0
  350. package/generator/guide/schematics/build/schema.json +14 -0
  351. package/generator/guide/schematics/init/schema.json +19 -0
  352. package/layout/component/package.json +4 -0
  353. package/layout/package.json +4 -0
  354. package/layout/provider/package.json +4 -0
  355. package/layout/services/package.json +4 -0
  356. package/layout/shell/package.json +4 -0
  357. package/layout/token/directive/package.json +4 -0
  358. package/layout/token/package.json +4 -0
  359. package/layout/type/empty/package.json +4 -0
  360. package/layout/type/horizontal/package.json +4 -0
  361. package/layout/type/vertical/package.json +4 -0
  362. package/navigation/demo-data/package.json +4 -0
  363. package/navigation/icon/package.json +4 -0
  364. package/navigation/item/package.json +4 -0
  365. package/navigation/service/package.json +4 -0
  366. package/navigation/sidebar/package.json +4 -0
  367. package/navigation/topbar/README.md +196 -0
  368. package/navigation/topbar/package.json +4 -0
  369. package/navigation/types/package.json +4 -0
  370. package/package.json +433 -18
  371. package/theme/README.md +174 -0
  372. package/theme/package.json +4 -0
  373. package/theme/provider/package.json +4 -0
  374. package/theme/services/package.json +4 -0
  375. package/theme/styles/foundation/components.css +81 -0
  376. package/theme/styles/foundation/layers.css +15 -0
  377. package/theme/styles/foundation/tokens.css +55 -0
  378. package/theme/styles/index.css +37 -0
  379. package/theme/styles/integrations/material/autocomplete.css +178 -0
  380. package/theme/styles/integrations/material/button.css +468 -0
  381. package/theme/styles/integrations/material/dialog.css +152 -0
  382. package/theme/styles/integrations/material/select.css +175 -0
  383. package/theme/styles/integrations/material/slide-toggle.css +234 -0
  384. package/theme/styles/integrations/material/slider.css +194 -0
  385. package/theme/styles/integrations/material/tabs.css +229 -0
  386. package/theme/styles/integrations/material.css +264 -0
  387. package/theme/styles/integrations/tailwind.css +114 -0
  388. package/theme/styles/variants/color/amber.css +31 -0
  389. package/theme/styles/variants/color/base.css +36 -0
  390. package/theme/styles/variants/color/blue.css +31 -0
  391. package/theme/styles/variants/color/cyan.css +31 -0
  392. package/theme/styles/variants/color/emerald.css +31 -0
  393. package/theme/styles/variants/color/fuchsia.css +31 -0
  394. package/theme/styles/variants/color/green.css +31 -0
  395. package/theme/styles/variants/color/index.css +22 -0
  396. package/theme/styles/variants/color/indigo.css +31 -0
  397. package/theme/styles/variants/color/lime.css +31 -0
  398. package/theme/styles/variants/color/orange.css +31 -0
  399. package/theme/styles/variants/color/pink.css +31 -0
  400. package/theme/styles/variants/color/purple.css +31 -0
  401. package/theme/styles/variants/color/red.css +31 -0
  402. package/theme/styles/variants/color/rose.css +31 -0
  403. package/theme/styles/variants/color/sky.css +31 -0
  404. package/theme/styles/variants/color/teal.css +31 -0
  405. package/theme/styles/variants/color/violet.css +31 -0
  406. package/theme/styles/variants/color/yellow.css +31 -0
  407. package/theme/styles/variants/mode/dark.css +20 -0
  408. package/theme/styles/variants/mode/index.css +6 -0
  409. package/theme/styles/variants/mode/light.css +24 -0
  410. package/theme/styles/variants/style/brutal.css +50 -0
  411. package/theme/styles/variants/style/default.css +54 -0
  412. package/theme/styles/variants/style/index.css +8 -0
  413. package/theme/styles/variants/style/sharp.css +50 -0
  414. package/theme/styles/variants/style/soft.css +50 -0
  415. package/theme/token/package.json +4 -0
  416. package/types/ojiepermana-angular-component-accordion.d.ts +51 -0
  417. package/types/ojiepermana-angular-component-alert-dialog.d.ts +93 -0
  418. package/types/ojiepermana-angular-component-alert.d.ts +37 -0
  419. package/types/ojiepermana-angular-component-aspect-ratio.d.ts +12 -0
  420. package/types/ojiepermana-angular-component-avatar.d.ts +51 -0
  421. package/types/ojiepermana-angular-component-badge.d.ts +19 -0
  422. package/types/ojiepermana-angular-component-breadcrumb.d.ts +46 -0
  423. package/types/ojiepermana-angular-component-button-group.d.ts +26 -0
  424. package/types/ojiepermana-angular-component-button.d.ts +22 -0
  425. package/types/ojiepermana-angular-component-calendar.d.ts +33 -0
  426. package/types/ojiepermana-angular-component-card.d.ts +60 -0
  427. package/types/ojiepermana-angular-component-carousel.d.ts +86 -0
  428. package/types/ojiepermana-angular-component-chart-area.d.ts +1 -0
  429. package/types/ojiepermana-angular-component-chart-bar.d.ts +1 -0
  430. package/types/ojiepermana-angular-component-chart-line.d.ts +1 -0
  431. package/types/ojiepermana-angular-component-chart-pie.d.ts +1 -0
  432. package/types/ojiepermana-angular-component-chart-radar.d.ts +1 -0
  433. package/types/ojiepermana-angular-component-chart-radial.d.ts +1 -0
  434. package/types/ojiepermana-angular-component-chart-scatter.d.ts +1 -0
  435. package/types/ojiepermana-angular-component-chart.d.ts +1094 -0
  436. package/types/ojiepermana-angular-component-checkbox.d.ts +35 -0
  437. package/types/ojiepermana-angular-component-collapsible.d.ts +42 -0
  438. package/types/ojiepermana-angular-component-combobox.d.ts +50 -0
  439. package/types/ojiepermana-angular-component-command.d.ts +99 -0
  440. package/types/ojiepermana-angular-component-composer.d.ts +90 -0
  441. package/types/ojiepermana-angular-component-context-menu.d.ts +35 -0
  442. package/types/ojiepermana-angular-component-date-picker.d.ts +41 -0
  443. package/types/ojiepermana-angular-component-dialog.d.ts +87 -0
  444. package/types/ojiepermana-angular-component-drawer.d.ts +1 -0
  445. package/types/ojiepermana-angular-component-dropdown-menu.d.ts +137 -0
  446. package/types/ojiepermana-angular-component-editor.d.ts +123 -0
  447. package/types/ojiepermana-angular-component-empty.d.ts +50 -0
  448. package/types/ojiepermana-angular-component-form.d.ts +141 -0
  449. package/types/ojiepermana-angular-component-hover-card.d.ts +74 -0
  450. package/types/ojiepermana-angular-component-input-group.d.ts +51 -0
  451. package/types/ojiepermana-angular-component-input-otp.d.ts +136 -0
  452. package/types/ojiepermana-angular-component-input.d.ts +16 -0
  453. package/types/ojiepermana-angular-component-item.d.ts +88 -0
  454. package/types/ojiepermana-angular-component-kanban.d.ts +70 -0
  455. package/types/ojiepermana-angular-component-kbd.d.ts +16 -0
  456. package/types/ojiepermana-angular-component-label.d.ts +11 -0
  457. package/types/ojiepermana-angular-component-menubar.d.ts +67 -0
  458. package/types/ojiepermana-angular-component-native-select.d.ts +26 -0
  459. package/types/ojiepermana-angular-component-navigation-menu.d.ts +96 -0
  460. package/types/ojiepermana-angular-component-pagination.d.ts +33 -0
  461. package/types/ojiepermana-angular-component-pillbox.d.ts +157 -0
  462. package/types/ojiepermana-angular-component-popover.d.ts +43 -0
  463. package/types/ojiepermana-angular-component-progress.d.ts +17 -0
  464. package/types/ojiepermana-angular-component-radio.d.ts +40 -0
  465. package/types/ojiepermana-angular-component-resizable.d.ts +99 -0
  466. package/types/ojiepermana-angular-component-scroll-area.d.ts +19 -0
  467. package/types/ojiepermana-angular-component-select.d.ts +57 -0
  468. package/types/ojiepermana-angular-component-separator.d.ts +14 -0
  469. package/types/ojiepermana-angular-component-sheet.d.ts +76 -0
  470. package/types/ojiepermana-angular-component-skeleton.d.ts +10 -0
  471. package/types/ojiepermana-angular-component-slider.d.ts +74 -0
  472. package/types/ojiepermana-angular-component-spinner.d.ts +13 -0
  473. package/types/ojiepermana-angular-component-switch.d.ts +40 -0
  474. package/types/ojiepermana-angular-component-table.d.ts +52 -0
  475. package/types/ojiepermana-angular-component-tabs.d.ts +92 -0
  476. package/types/ojiepermana-angular-component-textarea.d.ts +12 -0
  477. package/types/ojiepermana-angular-component-timeline.d.ts +63 -0
  478. package/types/ojiepermana-angular-component-toast.d.ts +38 -0
  479. package/types/ojiepermana-angular-component-toggle-group.d.ts +89 -0
  480. package/types/ojiepermana-angular-component-toggle.d.ts +25 -0
  481. package/types/ojiepermana-angular-component-tooltip.d.ts +89 -0
  482. package/types/ojiepermana-angular-component-utils.d.ts +5 -0
  483. package/types/ojiepermana-angular-generator-api.d.ts +86 -0
  484. package/types/ojiepermana-angular-layout-component.d.ts +205 -0
  485. package/types/ojiepermana-angular-layout-provider.d.ts +6 -0
  486. package/types/ojiepermana-angular-layout-services.d.ts +25 -0
  487. package/types/ojiepermana-angular-layout-shell.d.ts +8 -0
  488. package/types/ojiepermana-angular-layout-token-directive.d.ts +13 -0
  489. package/types/ojiepermana-angular-layout-token.d.ts +36 -0
  490. package/types/ojiepermana-angular-layout-type-empty.d.ts +22 -0
  491. package/types/ojiepermana-angular-layout-type-horizontal.d.ts +36 -0
  492. package/types/ojiepermana-angular-layout-type-vertical.d.ts +38 -0
  493. package/types/ojiepermana-angular-layout.d.ts +164 -0
  494. package/types/ojiepermana-angular-navigation-demo-data.d.ts +5 -0
  495. package/types/ojiepermana-angular-navigation-icon.d.ts +17 -0
  496. package/types/ojiepermana-angular-navigation-item.d.ts +54 -0
  497. package/types/ojiepermana-angular-navigation-service.d.ts +77 -0
  498. package/types/ojiepermana-angular-navigation-sidebar.d.ts +75 -0
  499. package/types/ojiepermana-angular-navigation-topbar.d.ts +74 -0
  500. package/types/ojiepermana-angular-navigation-types.d.ts +135 -0
  501. package/types/ojiepermana-angular-theme-provider.d.ts +11 -0
  502. package/types/ojiepermana-angular-theme-services.d.ts +55 -0
  503. package/types/ojiepermana-angular-theme-token.d.ts +57 -0
  504. package/types/ojiepermana-angular-theme.d.ts +116 -0
  505. package/types/ojiepermana-angular.d.ts +3 -0
  506. package/fesm2022/edsis-angular-block-shell.mjs +0 -703
  507. package/fesm2022/edsis-angular-block-shell.mjs.map +0 -1
  508. package/fesm2022/edsis-angular-module-auth.mjs +0 -1560
  509. package/fesm2022/edsis-angular-module-auth.mjs.map +0 -1
  510. package/fesm2022/edsis-angular.mjs +0 -8
  511. package/fesm2022/edsis-angular.mjs.map +0 -1
  512. package/types/edsis-angular-block-shell.d.ts +0 -114
  513. package/types/edsis-angular-module-auth.d.ts +0 -140
  514. package/types/edsis-angular.d.ts +0 -2
@@ -1,1560 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, makeEnvironmentProviders, provideEnvironmentInitializer, ChangeDetectionStrategy, Component, DestroyRef, signal, computed, input, effect } from '@angular/core';
3
- import { DOCUMENT, Location } from '@angular/common';
4
- import { HttpErrorResponse, HttpContextToken, provideHttpClient, withFetch, withInterceptors, HttpContext } from '@angular/common/http';
5
- import { Router, RouterOutlet, RouterLink, ActivatedRoute } from '@angular/router';
6
- import { AuthSessionService, AuthMagicLinkService } from '@edsis/sdk/auth';
7
- import { ApiConfiguration, provideApiConfiguration } from '@edsis/sdk/shared';
8
- import { UserProfileService } from '@edsis/sdk/user';
9
- import { firstValueFrom, throwError, from, startWith, finalize } from 'rxjs';
10
- import { switchMap, catchError } from 'rxjs/operators';
11
- import { UiLayoutComponent, UiLayoutFluidComponent } from '@edsis/ui/layout';
12
- import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
13
- import * as i1 from '@angular/forms';
14
- import { FormBuilder, Validators, ReactiveFormsModule } from '@angular/forms';
15
- import { AspectRatioComponent } from '@edsis/ui/aspect-ratio';
16
- import { ButtonComponent } from '@edsis/ui/button';
17
- import { CardActionComponent, CardComponent, CardContentComponent, CardDescriptionComponent, CardHeaderComponent, CardTitleComponent, CardFooterComponent } from '@edsis/ui/card';
18
- import { InputGroupAddonComponent, InputGroupButtonComponent, InputGroupComponent, InputGroupInputComponent } from '@edsis/ui/input-group';
19
- import { LabelComponent } from '@edsis/ui/label';
20
- import { SeparatorComponent } from '@edsis/ui/separator';
21
- import { AlertComponent, AlertDescriptionComponent } from '@edsis/ui/alert';
22
- import { SpinnerComponent } from '@edsis/ui/spinner';
23
-
24
- const DEFAULT_LOGIN_PATH = '/login';
25
- const DEFAULT_LOGOUT_PATH = '/logout';
26
- const DEFAULT_VERIFY_PATH = '/verify';
27
- const DEFAULT_AUTHENTICATED_HOME_PATH = '/dashboard';
28
- const EDSIS_AUTH_CONFIG = new InjectionToken('EDSIS_AUTH_CONFIG');
29
- function resolveEdsisAuthConfig(config) {
30
- const loginPath = normalizePath(config.loginPath, DEFAULT_LOGIN_PATH);
31
- return {
32
- apiUrl: normalizeAbsoluteUrl(config.apiUrl, 'apiUrl'),
33
- appUrl: normalizeAbsoluteUrl(config.appUrl, 'appUrl'),
34
- loginPath,
35
- logoutPath: normalizePath(config.logoutPath, DEFAULT_LOGOUT_PATH),
36
- verifyPath: normalizePath(config.verifyPath, DEFAULT_VERIFY_PATH),
37
- authenticatedHomePath: normalizePath(config.authenticatedHomePath, DEFAULT_AUTHENTICATED_HOME_PATH),
38
- guestHomePath: normalizePath(config.guestHomePath, loginPath),
39
- };
40
- }
41
- function normalizeAbsoluteUrl(value, label) {
42
- const normalizedValue = value.trim();
43
- if (!normalizedValue) {
44
- throw new Error(`Edsis auth requires a non-empty ${label}.`);
45
- }
46
- const normalizedUrl = new URL(normalizedValue);
47
- return normalizedUrl.toString().replace(/\/$/, '');
48
- }
49
- function normalizePath(value, fallback) {
50
- const normalizedValue = value?.trim();
51
- if (!normalizedValue) {
52
- return fallback;
53
- }
54
- return (normalizedValue.startsWith('/') ? normalizedValue : `/${normalizedValue}`);
55
- }
56
-
57
- const AUTH_SESSION_STORAGE_KEYS = ['access_token', 'user_id', 'role', 'name'];
58
- const AUTH_SESSION_METADATA_STORAGE_KEYS = ['access_token_trusted'];
59
- const AUTH_SESSION_PERSISTENT_HINT_KEY = 'edsis_auth_refresh_hint';
60
- const AUTH_SESSION_CHANGE_EVENT = 'edsis-auth-session-change';
61
- const AUTH_SESSION_PEER_CHANNEL_NAME = 'edsis-auth-session-peer';
62
- const EMPTY_SESSION_FINGERPRINT = '__empty_session__';
63
- const JWT_PART_COUNT = 3;
64
- const TOKEN_EXPIRY_SKEW_MS = 30_000;
65
- const PEER_SESSION_REQUEST_TIMEOUT_MS = 150;
66
- const TRUSTED_OPAQUE_TOKEN_REVALIDATION_MS = 90_000;
67
- const AUTH_SESSION_MONITOR_INTERVAL_MS = 10_000;
68
- let validatedAccessToken = '';
69
- let validatedUntilEpochMs = 0;
70
- let failedSessionFingerprint = null;
71
- let pendingSessionValidation = null;
72
- let sessionPeerChannel = null;
73
- let sessionPeerChannelOwner = null;
74
- let sessionPeerId = '';
75
- let sessionMonitorCleanup = null;
76
- let sessionMonitorOwner = null;
77
- function clearSessionMonitor() {
78
- sessionMonitorCleanup?.();
79
- sessionMonitorCleanup = null;
80
- sessionMonitorOwner = null;
81
- }
82
- function ɵresetAuthSessionModuleState() {
83
- clearValidatedSession();
84
- clearFailedSessionFingerprint();
85
- pendingSessionValidation = null;
86
- clearSessionMonitor();
87
- sessionPeerChannel?.close();
88
- sessionPeerChannel = null;
89
- sessionPeerChannelOwner = null;
90
- sessionPeerId = '';
91
- }
92
- function getSessionStorage(documentRef) {
93
- return documentRef.defaultView?.sessionStorage ?? null;
94
- }
95
- function getLocalStorage(documentRef) {
96
- return documentRef.defaultView?.localStorage ?? null;
97
- }
98
- function createSessionPeerId(windowRef) {
99
- return windowRef.crypto?.randomUUID?.() ?? `${Date.now()}-${Math.random().toString(16).slice(2)}`;
100
- }
101
- function isSessionPeerResponseMessage(message) {
102
- return message.type === 'session-response';
103
- }
104
- function buildStoredSessionData(documentRef) {
105
- const session = readStoredSession(documentRef);
106
- if (!session) {
107
- return null;
108
- }
109
- return {
110
- access_token: session.accessToken,
111
- name: session.name,
112
- role: session.role,
113
- user_id: session.userId,
114
- };
115
- }
116
- function ensureSessionPeerChannel(documentRef) {
117
- const windowRef = documentRef.defaultView;
118
- if (!windowRef?.BroadcastChannel) {
119
- return null;
120
- }
121
- if (sessionPeerChannel && sessionPeerChannelOwner === windowRef) {
122
- return sessionPeerChannel;
123
- }
124
- sessionPeerChannel?.close();
125
- sessionPeerId = createSessionPeerId(windowRef);
126
- sessionPeerChannelOwner = windowRef;
127
- sessionPeerChannel = new windowRef.BroadcastChannel(AUTH_SESSION_PEER_CHANNEL_NAME);
128
- sessionPeerChannel.addEventListener('message', (event) => {
129
- const message = event.data;
130
- if (message.type !== 'session-request' || message.senderId === sessionPeerId) {
131
- return;
132
- }
133
- const sessionData = buildStoredSessionData(documentRef);
134
- if (!sessionData) {
135
- return;
136
- }
137
- sessionPeerChannel?.postMessage({
138
- type: 'session-response',
139
- requestId: message.requestId,
140
- senderId: sessionPeerId,
141
- sessionData,
142
- });
143
- });
144
- return sessionPeerChannel;
145
- }
146
- async function restoreSessionFromPeer(documentRef) {
147
- const windowRef = documentRef.defaultView;
148
- const channel = ensureSessionPeerChannel(documentRef);
149
- if (!windowRef || !channel || !sessionPeerId) {
150
- return false;
151
- }
152
- const requestId = createSessionPeerId(windowRef);
153
- return new Promise((resolve) => {
154
- let settled = false;
155
- let timeoutId = 0;
156
- const finish = (result) => {
157
- if (settled) {
158
- return;
159
- }
160
- settled = true;
161
- windowRef.clearTimeout(timeoutId);
162
- channel.removeEventListener('message', handleMessage);
163
- resolve(result);
164
- };
165
- const handleMessage = (event) => {
166
- const message = event.data;
167
- if (!isSessionPeerResponseMessage(message) ||
168
- message.senderId === sessionPeerId ||
169
- message.requestId !== requestId) {
170
- return;
171
- }
172
- if (!readSessionDataValue(message.sessionData, 'access_token')) {
173
- finish(false);
174
- return;
175
- }
176
- persistSession(documentRef, message.sessionData);
177
- finish(true);
178
- };
179
- timeoutId = windowRef.setTimeout(() => finish(false), PEER_SESSION_REQUEST_TIMEOUT_MS);
180
- channel.addEventListener('message', handleMessage);
181
- channel.postMessage({
182
- type: 'session-request',
183
- requestId,
184
- senderId: sessionPeerId,
185
- });
186
- });
187
- }
188
- function readSessionStorageValue(documentRef, storageKey) {
189
- return getSessionStorage(documentRef)?.getItem(storageKey)?.trim() ?? '';
190
- }
191
- function readSessionDataValue(sessionData, storageKey) {
192
- const value = sessionData?.[storageKey];
193
- return typeof value === 'string' ? value.trim() : '';
194
- }
195
- function notifySessionChange(documentRef) {
196
- documentRef.defaultView?.dispatchEvent(new Event(AUTH_SESSION_CHANGE_EVENT));
197
- }
198
- function clearValidatedSession() {
199
- validatedAccessToken = '';
200
- validatedUntilEpochMs = 0;
201
- }
202
- function clearFailedSessionFingerprint() {
203
- failedSessionFingerprint = null;
204
- }
205
- function readSessionFingerprint(documentRef) {
206
- return readStoredAccessToken(documentRef) || EMPTY_SESSION_FINGERPRINT;
207
- }
208
- function hasFailedSessionFingerprint(documentRef) {
209
- return failedSessionFingerprint === readSessionFingerprint(documentRef);
210
- }
211
- function markFailedSessionFingerprint(documentRef) {
212
- failedSessionFingerprint = readSessionFingerprint(documentRef);
213
- }
214
- function readTrustedAccessToken(documentRef) {
215
- return readSessionStorageValue(documentRef, 'access_token_trusted');
216
- }
217
- function hasRefreshCandidate(documentRef) {
218
- return Boolean(readStoredAccessToken(documentRef) ||
219
- readTrustedAccessToken(documentRef) ||
220
- getLocalStorage(documentRef)?.getItem(AUTH_SESSION_PERSISTENT_HINT_KEY));
221
- }
222
- function shouldClearSessionAfterRefreshFailure(error) {
223
- if (error instanceof HttpErrorResponse) {
224
- return error.status === 401 || error.status === 403;
225
- }
226
- if (error instanceof Error) {
227
- return /invalid refresh token|unauthorized|forbidden/iu.test(error.message);
228
- }
229
- return false;
230
- }
231
- function getTokenExpiryEpochMs(documentRef, accessToken) {
232
- const windowRef = documentRef.defaultView;
233
- const tokenParts = accessToken.split('.');
234
- if (!windowRef?.atob || tokenParts.length !== JWT_PART_COUNT) {
235
- return null;
236
- }
237
- const normalizedPayload = tokenParts[1].replace(/-/g, '+').replace(/_/g, '/');
238
- const paddedPayload = normalizedPayload.padEnd(Math.ceil(normalizedPayload.length / 4) * 4, '=');
239
- try {
240
- const parsedPayload = JSON.parse(windowRef.atob(paddedPayload));
241
- return typeof parsedPayload.exp === 'number' ? parsedPayload.exp * 1000 : null;
242
- }
243
- catch {
244
- return null;
245
- }
246
- }
247
- function markValidatedSession(documentRef) {
248
- const accessToken = readStoredAccessToken(documentRef);
249
- if (!accessToken) {
250
- clearValidatedSession();
251
- return;
252
- }
253
- const tokenExpiryEpochMs = getTokenExpiryEpochMs(documentRef, accessToken);
254
- if (!tokenExpiryEpochMs) {
255
- if (readTrustedAccessToken(documentRef) !== accessToken) {
256
- clearValidatedSession();
257
- return;
258
- }
259
- validatedAccessToken = accessToken;
260
- validatedUntilEpochMs = Date.now() + TRUSTED_OPAQUE_TOKEN_REVALIDATION_MS;
261
- return;
262
- }
263
- validatedAccessToken = accessToken;
264
- validatedUntilEpochMs = tokenExpiryEpochMs;
265
- }
266
- function hasValidatedSession(documentRef) {
267
- const accessToken = readStoredAccessToken(documentRef);
268
- if (!accessToken) {
269
- clearValidatedSession();
270
- return false;
271
- }
272
- if (accessToken !== validatedAccessToken) {
273
- markValidatedSession(documentRef);
274
- }
275
- if (!validatedAccessToken) {
276
- clearValidatedSession();
277
- return false;
278
- }
279
- return validatedUntilEpochMs > Date.now() + TOKEN_EXPIRY_SKEW_MS;
280
- }
281
- function hasStoredSession(documentRef) {
282
- return Boolean(readStoredAccessToken(documentRef));
283
- }
284
- function readStoredAccessToken(documentRef) {
285
- return readSessionStorageValue(documentRef, 'access_token');
286
- }
287
- function readStoredSession(documentRef) {
288
- const accessToken = readStoredAccessToken(documentRef);
289
- if (!accessToken) {
290
- return null;
291
- }
292
- const userId = readSessionStorageValue(documentRef, 'user_id');
293
- const role = readSessionStorageValue(documentRef, 'role');
294
- const name = readSessionStorageValue(documentRef, 'name');
295
- return {
296
- accessToken,
297
- userId: userId || undefined,
298
- role: role || undefined,
299
- name: name || undefined,
300
- };
301
- }
302
- function persistSession(documentRef, sessionData) {
303
- ensureSessionPeerChannel(documentRef);
304
- const sessionStorageRef = getSessionStorage(documentRef);
305
- if (!sessionStorageRef) {
306
- clearValidatedSession();
307
- notifySessionChange(documentRef);
308
- return null;
309
- }
310
- const nextAccessToken = readSessionDataValue(sessionData, 'access_token');
311
- if (!nextAccessToken) {
312
- for (const storageKey of AUTH_SESSION_STORAGE_KEYS) {
313
- sessionStorageRef.removeItem(storageKey);
314
- }
315
- for (const storageKey of AUTH_SESSION_METADATA_STORAGE_KEYS) {
316
- sessionStorageRef.removeItem(storageKey);
317
- }
318
- getLocalStorage(documentRef)?.removeItem(AUTH_SESSION_PERSISTENT_HINT_KEY);
319
- clearValidatedSession();
320
- clearFailedSessionFingerprint();
321
- notifySessionChange(documentRef);
322
- return null;
323
- }
324
- sessionStorageRef.setItem('access_token', nextAccessToken);
325
- sessionStorageRef.setItem('access_token_trusted', nextAccessToken);
326
- getLocalStorage(documentRef)?.setItem(AUTH_SESSION_PERSISTENT_HINT_KEY, '1');
327
- for (const storageKey of AUTH_SESSION_STORAGE_KEYS.slice(1)) {
328
- if (!sessionData || !Object.hasOwn(sessionData, storageKey)) {
329
- continue;
330
- }
331
- const nextValue = readSessionDataValue(sessionData, storageKey);
332
- if (nextValue) {
333
- sessionStorageRef.setItem(storageKey, nextValue);
334
- continue;
335
- }
336
- sessionStorageRef.removeItem(storageKey);
337
- }
338
- markValidatedSession(documentRef);
339
- clearFailedSessionFingerprint();
340
- notifySessionChange(documentRef);
341
- return readStoredSession(documentRef);
342
- }
343
- function clearStoredSession(documentRef, options) {
344
- const sessionStorageRef = getSessionStorage(documentRef);
345
- for (const storageKey of AUTH_SESSION_STORAGE_KEYS) {
346
- sessionStorageRef?.removeItem(storageKey);
347
- }
348
- for (const storageKey of AUTH_SESSION_METADATA_STORAGE_KEYS) {
349
- sessionStorageRef?.removeItem(storageKey);
350
- }
351
- getLocalStorage(documentRef)?.removeItem(AUTH_SESSION_PERSISTENT_HINT_KEY);
352
- clearValidatedSession();
353
- if (!options?.preserveFailedSessionFingerprint) {
354
- clearFailedSessionFingerprint();
355
- }
356
- notifySessionChange(documentRef);
357
- }
358
- function startAuthSessionMonitor(documentRef, authSessionService, options) {
359
- const windowRef = documentRef.defaultView;
360
- if (!windowRef) {
361
- return;
362
- }
363
- if (sessionMonitorCleanup && sessionMonitorOwner === windowRef) {
364
- return;
365
- }
366
- clearSessionMonitor();
367
- let disposed = false;
368
- const runValidation = async () => {
369
- const hadRefreshCandidate = hasRefreshCandidate(documentRef);
370
- if (!hadRefreshCandidate) {
371
- return;
372
- }
373
- const isSessionValid = options?.validateSession
374
- ? await options.validateSession()
375
- : await validateStoredSession(documentRef, authSessionService, { forceRefresh: true });
376
- if (!disposed && !isSessionValid && hadRefreshCandidate) {
377
- options?.onSessionInvalid?.();
378
- }
379
- };
380
- const handleFocus = () => {
381
- void runValidation();
382
- };
383
- const handleVisibilityChange = () => {
384
- if (documentRef.visibilityState === 'visible') {
385
- void runValidation();
386
- }
387
- };
388
- const intervalId = windowRef.setInterval(handleFocus, AUTH_SESSION_MONITOR_INTERVAL_MS);
389
- windowRef.addEventListener('focus', handleFocus);
390
- documentRef.addEventListener('visibilitychange', handleVisibilityChange);
391
- sessionMonitorOwner = windowRef;
392
- sessionMonitorCleanup = () => {
393
- disposed = true;
394
- windowRef.clearInterval(intervalId);
395
- windowRef.removeEventListener('focus', handleFocus);
396
- documentRef.removeEventListener('visibilitychange', handleVisibilityChange);
397
- };
398
- }
399
- async function validateStoredSession(documentRef, authSessionService, options) {
400
- ensureSessionPeerChannel(documentRef);
401
- if (!options?.forceRefresh && hasValidatedSession(documentRef)) {
402
- return true;
403
- }
404
- if (pendingSessionValidation) {
405
- return pendingSessionValidation;
406
- }
407
- pendingSessionValidation = (async () => {
408
- try {
409
- if (!options?.forceRefresh && !hasStoredSession(documentRef) && (await restoreSessionFromPeer(documentRef))) {
410
- return true;
411
- }
412
- if (!options?.forceRefresh && hasValidatedSession(documentRef)) {
413
- return true;
414
- }
415
- if (!options?.forceRefresh && !hasRefreshCandidate(documentRef)) {
416
- clearValidatedSession();
417
- return false;
418
- }
419
- if (hasFailedSessionFingerprint(documentRef)) {
420
- return false;
421
- }
422
- const response = await firstValueFrom(authSessionService.refreshAuthToken());
423
- persistSession(documentRef, response.data);
424
- return hasValidatedSession(documentRef);
425
- }
426
- catch (error) {
427
- if (!shouldClearSessionAfterRefreshFailure(error)) {
428
- clearValidatedSession();
429
- return hasStoredSession(documentRef);
430
- }
431
- clearStoredSession(documentRef, { preserveFailedSessionFingerprint: true });
432
- markFailedSessionFingerprint(documentRef);
433
- return false;
434
- }
435
- finally {
436
- pendingSessionValidation = null;
437
- }
438
- })();
439
- return pendingSessionValidation;
440
- }
441
- function injectSessionState() {
442
- const documentRef = inject(DOCUMENT);
443
- const authSessionService = inject(AuthSessionService);
444
- return validateStoredSession(documentRef, authSessionService);
445
- }
446
- function injectSessionRefresh() {
447
- const documentRef = inject(DOCUMENT);
448
- const authSessionService = inject(AuthSessionService);
449
- return validateStoredSession(documentRef, authSessionService, { forceRefresh: true });
450
- }
451
- function injectSessionClear() {
452
- clearStoredSession(inject(DOCUMENT));
453
- }
454
-
455
- const PROTECTED_API_PATH_PREFIX = '/v1/';
456
- const AUTH_PATH_PREFIX = '/v1/auth/';
457
- const HEALTH_PATH = '/health';
458
- const EDSIS_SKIP_AUTH = new HttpContextToken(() => false);
459
- const EDSIS_SKIP_SESSION_REFRESH = new HttpContextToken(() => false);
460
- const EDSIS_AUTH_RETRY = new HttpContextToken(() => false);
461
- function normalizeUrl(url) {
462
- try {
463
- return new URL(url);
464
- }
465
- catch {
466
- return null;
467
- }
468
- }
469
- function resolveApiPath(url, rootUrl) {
470
- const normalizedUrl = normalizeUrl(url);
471
- const normalizedRootUrl = normalizeUrl(rootUrl);
472
- if (normalizedUrl && normalizedRootUrl) {
473
- if (normalizedUrl.origin !== normalizedRootUrl.origin) {
474
- return null;
475
- }
476
- if (!normalizedUrl.pathname.startsWith(normalizedRootUrl.pathname)) {
477
- return null;
478
- }
479
- const apiPath = normalizedUrl.pathname.slice(normalizedRootUrl.pathname.length) || '/';
480
- return apiPath.startsWith('/') ? apiPath : `/${apiPath}`;
481
- }
482
- if (url.startsWith(rootUrl)) {
483
- const apiPath = url.slice(rootUrl.length).split(/[?#]/, 1)[0] ?? '/';
484
- return apiPath.startsWith('/') ? apiPath : `/${apiPath}`;
485
- }
486
- if (url.startsWith('/')) {
487
- return url.split(/[?#]/, 1)[0] ?? url;
488
- }
489
- return null;
490
- }
491
- function isAuthRequest(apiPath) {
492
- return apiPath.startsWith(AUTH_PATH_PREFIX);
493
- }
494
- function isProtectedApiRequest(apiPath) {
495
- return apiPath.startsWith(PROTECTED_API_PATH_PREFIX) && !isAuthRequest(apiPath);
496
- }
497
- function isHealthRequest(apiPath) {
498
- return apiPath === HEALTH_PATH;
499
- }
500
- function isHandledRequest(apiPath) {
501
- return isProtectedApiRequest(apiPath) || isAuthRequest(apiPath) || isHealthRequest(apiPath);
502
- }
503
- function applyCookieCredentials(request, apiPath) {
504
- return isAuthRequest(apiPath) && !request.withCredentials ? request.clone({ withCredentials: true }) : request;
505
- }
506
- function applyBearerToken(request, accessToken, isRetry = false) {
507
- return request.clone({
508
- context: isRetry ? request.context.set(EDSIS_AUTH_RETRY, true) : request.context,
509
- setHeaders: {
510
- Authorization: `Bearer ${accessToken}`,
511
- },
512
- });
513
- }
514
- async function resolveAccessToken(documentRef, authSessionService, options) {
515
- const isSessionValid = await validateStoredSession(documentRef, authSessionService, options);
516
- return isSessionValid ? readStoredAccessToken(documentRef) : '';
517
- }
518
- function handleUnauthorizedError(error, request, next, documentRef, authSessionService) {
519
- if (!(error instanceof HttpErrorResponse) ||
520
- error.status !== 401 ||
521
- request.context.get(EDSIS_AUTH_RETRY) ||
522
- request.context.get(EDSIS_SKIP_SESSION_REFRESH)) {
523
- return throwError(() => error);
524
- }
525
- return from(resolveAccessToken(documentRef, authSessionService, { forceRefresh: true })).pipe(switchMap((refreshedAccessToken) => {
526
- if (!refreshedAccessToken) {
527
- clearStoredSession(documentRef);
528
- return throwError(() => error);
529
- }
530
- return next(applyBearerToken(request, refreshedAccessToken, true));
531
- }), catchError((refreshError) => {
532
- if (shouldClearSessionAfterRefreshFailure(refreshError)) {
533
- clearStoredSession(documentRef);
534
- }
535
- return throwError(() => error);
536
- }));
537
- }
538
- const edsisAuthInterceptor = (request, next) => {
539
- const documentRef = inject(DOCUMENT);
540
- const apiConfiguration = inject(ApiConfiguration);
541
- const authSessionService = inject(AuthSessionService);
542
- if (request.context.get(EDSIS_SKIP_AUTH)) {
543
- return next(request);
544
- }
545
- const apiPath = resolveApiPath(request.url, apiConfiguration.rootUrl);
546
- if (!apiPath || !isHandledRequest(apiPath)) {
547
- return next(request);
548
- }
549
- const preparedRequest = applyCookieCredentials(request, apiPath);
550
- if (isAuthRequest(apiPath) || isHealthRequest(apiPath)) {
551
- return next(preparedRequest);
552
- }
553
- const skipSessionRefresh = request.context.get(EDSIS_SKIP_SESSION_REFRESH);
554
- return from(skipSessionRefresh
555
- ? Promise.resolve(readStoredAccessToken(documentRef))
556
- : resolveAccessToken(documentRef, authSessionService)).pipe(switchMap((accessToken) => {
557
- const authorizedRequest = accessToken ? applyBearerToken(preparedRequest, accessToken) : preparedRequest;
558
- return next(authorizedRequest).pipe(catchError((error) => handleUnauthorizedError(error, preparedRequest, next, documentRef, authSessionService)));
559
- }));
560
- };
561
-
562
- function provideEdsisAuth(config) {
563
- const resolvedConfig = resolveEdsisAuthConfig(config);
564
- return makeEnvironmentProviders([
565
- provideApiConfiguration(resolvedConfig.apiUrl),
566
- provideHttpClient(withFetch(), withInterceptors([edsisAuthInterceptor])),
567
- provideEnvironmentInitializer(() => {
568
- const documentRef = inject(DOCUMENT);
569
- const authSessionService = inject(AuthSessionService);
570
- const router = inject(Router, { optional: true });
571
- const userProfileService = inject(UserProfileService);
572
- startAuthSessionMonitor(documentRef, authSessionService, {
573
- validateSession: async () => {
574
- if (!readStoredAccessToken(documentRef)) {
575
- return true;
576
- }
577
- try {
578
- await firstValueFrom(userProfileService.getCurrentUser(undefined, new HttpContext().set(EDSIS_SKIP_SESSION_REFRESH, true)));
579
- return true;
580
- }
581
- catch (error) {
582
- if (error instanceof HttpErrorResponse && error.status === 401) {
583
- clearStoredSession(documentRef);
584
- return false;
585
- }
586
- return true;
587
- }
588
- },
589
- onSessionInvalid: () => {
590
- if (router) {
591
- void router.navigateByUrl(resolvedConfig.guestHomePath, { replaceUrl: true });
592
- return;
593
- }
594
- const windowRef = documentRef.defaultView;
595
- if (!windowRef) {
596
- return;
597
- }
598
- const guestUrl = new URL(resolvedConfig.guestHomePath, windowRef.location.origin).toString();
599
- if (windowRef.location.href !== guestUrl) {
600
- windowRef.location.replace(guestUrl);
601
- }
602
- },
603
- });
604
- }),
605
- {
606
- provide: EDSIS_AUTH_CONFIG,
607
- useValue: resolvedConfig,
608
- },
609
- ]);
610
- }
611
-
612
- const authenticatedGuard = async () => {
613
- const router = inject(Router);
614
- const authConfig = inject(EDSIS_AUTH_CONFIG);
615
- if (await injectSessionState()) {
616
- return true;
617
- }
618
- return router.parseUrl(authConfig.guestHomePath);
619
- };
620
- const homeRedirectGuard = async () => {
621
- const router = inject(Router);
622
- const authConfig = inject(EDSIS_AUTH_CONFIG);
623
- return router.parseUrl((await injectSessionState()) ? authConfig.authenticatedHomePath : authConfig.guestHomePath);
624
- };
625
- const guestOnlyGuard = async () => {
626
- const router = inject(Router);
627
- const authConfig = inject(EDSIS_AUTH_CONFIG);
628
- if (!(await injectSessionState())) {
629
- return true;
630
- }
631
- return router.parseUrl(authConfig.authenticatedHomePath);
632
- };
633
-
634
- class AuthShellPage {
635
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: AuthShellPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
636
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.15", type: AuthShellPage, isStandalone: true, selector: "edsis-auth-shell-page", host: { classAttribute: "contents" }, ngImport: i0, template: `
637
- <ui-layout surface="grid" appearance="border-rail" width="fluid">
638
- <ui-layout-fluid>
639
- <div class="w-full max-w-xl">
640
- <router-outlet />
641
- </div>
642
- </ui-layout-fluid>
643
- </ui-layout>
644
- `, isInline: true, dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "component", type: UiLayoutComponent, selector: "ui-layout", inputs: ["surface", "appearance", "layout-style", "width", "class"] }, { kind: "component", type: UiLayoutFluidComponent, selector: "ui-layout-fluid", inputs: ["class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
645
- }
646
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: AuthShellPage, decorators: [{
647
- type: Component,
648
- args: [{
649
- selector: 'edsis-auth-shell-page',
650
- imports: [RouterOutlet, UiLayoutComponent, UiLayoutFluidComponent],
651
- host: {
652
- class: 'contents',
653
- },
654
- template: `
655
- <ui-layout surface="grid" appearance="border-rail" width="fluid">
656
- <ui-layout-fluid>
657
- <div class="w-full max-w-xl">
658
- <router-outlet />
659
- </div>
660
- </ui-layout-fluid>
661
- </ui-layout>
662
- `,
663
- changeDetection: ChangeDetectionStrategy.OnPush,
664
- }]
665
- }] });
666
-
667
- function buildVerifyUrl(config, runtimeOrigin = readRuntimeOrigin()) {
668
- const baseUrl = normalizeText(runtimeOrigin) ?? config.appUrl;
669
- return new URL(config.verifyPath, `${baseUrl}/`).toString();
670
- }
671
- function readRuntimeOrigin() {
672
- if (typeof window === 'undefined') {
673
- return null;
674
- }
675
- return normalizeText(window.location.origin);
676
- }
677
- function extractMagicToken(queryToken, fragment) {
678
- const tokenFromQuery = normalizeText(queryToken);
679
- if (tokenFromQuery) {
680
- return tokenFromQuery;
681
- }
682
- const normalizedFragment = normalizeText(fragment?.startsWith('#') ? fragment.slice(1) : fragment);
683
- if (!normalizedFragment) {
684
- return null;
685
- }
686
- const fragmentParams = new URLSearchParams(normalizedFragment);
687
- const tokenFromFragment = normalizeText(fragmentParams.get('token')) ??
688
- normalizeText(fragmentParams.get('magic_token')) ??
689
- normalizeText(fragmentParams.get('value'));
690
- if (tokenFromFragment) {
691
- return tokenFromFragment;
692
- }
693
- return normalizedFragment.includes('=') ? null : normalizedFragment;
694
- }
695
- function getResponseMessage(response, fallback) {
696
- if (!hasMessage(response)) {
697
- return fallback;
698
- }
699
- return normalizeText(response.message) ?? fallback;
700
- }
701
- function getErrorMessage(error, fallback) {
702
- if (error instanceof HttpErrorResponse) {
703
- const errorBody = error.error;
704
- if (typeof errorBody === 'string') {
705
- return normalizeText(errorBody) ?? fallback;
706
- }
707
- if (hasMessage(errorBody)) {
708
- return normalizeText(errorBody.message) ?? fallback;
709
- }
710
- return normalizeText(error.message) ?? fallback;
711
- }
712
- if (error instanceof Error) {
713
- return normalizeText(error.message) ?? fallback;
714
- }
715
- return fallback;
716
- }
717
- function hasMessage(value) {
718
- return typeof value === 'object' && value !== null && 'message' in value;
719
- }
720
- function normalizeText(value) {
721
- if (typeof value !== 'string') {
722
- return null;
723
- }
724
- const normalizedValue = value.trim();
725
- return normalizedValue.length > 0 ? normalizedValue : null;
726
- }
727
-
728
- class AuthLoginPage {
729
- destroyRef = inject(DestroyRef);
730
- formBuilder = inject(FormBuilder);
731
- authMagicLinkService = inject(AuthMagicLinkService);
732
- authConfig = inject(EDSIS_AUTH_CONFIG);
733
- form = this.formBuilder.nonNullable.group({
734
- email: ['', [Validators.required, Validators.email, Validators.maxLength(255)]],
735
- });
736
- isSubmitting = signal(false, ...(ngDevMode ? [{ debugName: "isSubmitting" }] : /* istanbul ignore next */ []));
737
- responseMessage = signal(null, ...(ngDevMode ? [{ debugName: "responseMessage" }] : /* istanbul ignore next */ []));
738
- errorMessage = signal(null, ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
739
- emailControl = this.form.controls.email;
740
- emailFeedbackId = 'email-feedback';
741
- emailControlState = toSignal(this.emailControl.events.pipe(startWith(null)), {
742
- initialValue: null,
743
- });
744
- hasInlineError = computed(() => {
745
- this.emailControlState();
746
- return this.emailControl.invalid && (this.emailControl.dirty || this.emailControl.touched);
747
- }, ...(ngDevMode ? [{ debugName: "hasInlineError" }] : /* istanbul ignore next */ []));
748
- inlineErrorMessage = computed(() => {
749
- if (!this.hasInlineError()) {
750
- return null;
751
- }
752
- return this.emailControl.hasError('required')
753
- ? 'Email wajib diisi.'
754
- : 'Gunakan format email yang valid dengan panjang maksimal 255 karakter.';
755
- }, ...(ngDevMode ? [{ debugName: "inlineErrorMessage" }] : /* istanbul ignore next */ []));
756
- feedbackMessage = computed(() => this.inlineErrorMessage() ?? this.responseMessage() ?? this.errorMessage(), ...(ngDevMode ? [{ debugName: "feedbackMessage" }] : /* istanbul ignore next */ []));
757
- feedbackTone = computed(() => {
758
- if (this.inlineErrorMessage() || this.errorMessage()) {
759
- return 'error';
760
- }
761
- if (this.responseMessage()) {
762
- return 'success';
763
- }
764
- return null;
765
- }, ...(ngDevMode ? [{ debugName: "feedbackTone" }] : /* istanbul ignore next */ []));
766
- fieldTone = computed(() => {
767
- if (this.hasInlineError() || this.errorMessage()) {
768
- return 'error';
769
- }
770
- if (this.responseMessage()) {
771
- return 'success';
772
- }
773
- return 'idle';
774
- }, ...(ngDevMode ? [{ debugName: "fieldTone" }] : /* istanbul ignore next */ []));
775
- emailFieldClasses = computed(() => {
776
- const baseClasses = 'flex-nowrap bg-background/70 shadow-sm [&>[data-slot=input-group-control]]:h-12! [&>[data-slot=input-group-control]]:px-4! [&>[data-slot=input-group-control]]:text-base!';
777
- switch (this.fieldTone()) {
778
- case 'error':
779
- return `${baseClasses} border-destructive focus-within:border-destructive focus-within:ring-destructive/20`;
780
- case 'success':
781
- return `${baseClasses} border-emerald-500 focus-within:border-emerald-500 focus-within:ring-emerald-500/20`;
782
- default:
783
- return baseClasses;
784
- }
785
- }, ...(ngDevMode ? [{ debugName: "emailFieldClasses" }] : /* istanbul ignore next */ []));
786
- submit() {
787
- if (this.form.invalid) {
788
- this.form.markAllAsTouched();
789
- return;
790
- }
791
- this.isSubmitting.set(true);
792
- this.responseMessage.set(null);
793
- this.errorMessage.set(null);
794
- const email = this.emailControl.getRawValue().trim().toLowerCase();
795
- this.emailControl.setValue(email);
796
- this.authMagicLinkService
797
- .requestMagicLoginLink({
798
- body: {
799
- email,
800
- frontend_url: buildVerifyUrl(this.authConfig),
801
- },
802
- })
803
- .pipe(takeUntilDestroyed(this.destroyRef), finalize(() => this.isSubmitting.set(false)))
804
- .subscribe({
805
- next: (response) => {
806
- this.responseMessage.set(getResponseMessage(response, 'Magic link berhasil dikirim.'));
807
- },
808
- error: (error) => {
809
- this.errorMessage.set(getErrorMessage(error, 'Gagal mengirim magic link.'));
810
- },
811
- });
812
- }
813
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: AuthLoginPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
814
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: AuthLoginPage, isStandalone: true, selector: "edsis-auth-login-page", host: { classAttribute: "block" }, ngImport: i0, template: `
815
- <ui-card class="w-full overflow-hidden rounded-none border-border/80 bg-card/95 shadow-2xl backdrop-blur-sm">
816
- <ui-card-header
817
- class="grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-x-4 gap-y-3 border-b border-border/60 bg-muted/15 pb-4 sm:pb-5">
818
- <div class="w-16 shrink-0 sm:w-20">
819
- <ui-aspect-ratio [ratio]="3 / 2" class="overflow-hidden rounded-none bg-primary">
820
- <div
821
- class="flex h-full w-full items-center justify-center px-1 text-[1.25rem] leading-none tracking-[-0.08em] text-primary-foreground sm:text-[1.55rem]"
822
- style="font-family: 'Arial Black', Arial, sans-serif;">
823
- ETOS
824
- </div>
825
- </ui-aspect-ratio>
826
- </div>
827
- <div class="min-w-0 space-y-0.5 pt-0.5 sm:pt-1">
828
- <ui-card-title class="text-xl leading-tight sm:text-2xl">Etos Account Center</ui-card-title>
829
- <p ui-card-description class="max-w-xl leading-6">
830
- Masukkan email yang terdaftar. Kami akan mengirimkan tautan verifikasi untuk masuk ke aplikasi.
831
- </p>
832
- </div>
833
- <ui-card-action
834
- class="col-start-3 row-span-1 mt-0! pt-0.5 text-xs font-medium uppercase tracking-[0.24em] text-muted-foreground sm:pt-1 sm:text-sm">
835
- LOGIN
836
- </ui-card-action>
837
- </ui-card-header>
838
-
839
- <ui-card-content class="pt-4 sm:pt-5">
840
- <form class="space-y-6" [formGroup]="form" (ngSubmit)="submit()">
841
- <div class="space-y-3">
842
- <label ui-label for="email" class="sr-only">Alamat email</label>
843
- <ui-input-group [class]="emailFieldClasses()">
844
- <ui-input-group-addon
845
- aria-hidden="true"
846
- class="min-h-12 px-4 bg-transparent text-primary [&_svg]:size-6!">
847
- <svg
848
- viewBox="0 0 24 24"
849
- class="fill-none stroke-current"
850
- stroke-width="1.8"
851
- stroke-linecap="round"
852
- stroke-linejoin="round">
853
- <path d="M4 7.5h16" />
854
- <path d="M5 6h14a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1Z" />
855
- <path d="m5 8 7 5 7-5" />
856
- </svg>
857
- </ui-input-group-addon>
858
-
859
- <input
860
- ui-input-group-input
861
- class="h-12! px-4! text-base!"
862
- id="email"
863
- type="email"
864
- inputmode="email"
865
- autocomplete="email"
866
- [attr.aria-describedby]="feedbackMessage() ? emailFeedbackId : null"
867
- [attr.aria-invalid]="fieldTone() === 'error' ? 'true' : null"
868
- formControlName="email"
869
- placeholder="your@email.com" />
870
-
871
- <button
872
- ui-input-group-button
873
- type="submit"
874
- variant="default"
875
- size="sm"
876
- [disabled]="form.invalid || isSubmitting()"
877
- class="order-30 h-12! min-w-24 rounded-none px-5 text-sm font-medium">
878
- {{ isSubmitting() ? 'Mengirim...' : 'Kirim' }}
879
- </button>
880
- </ui-input-group>
881
-
882
- @if (feedbackMessage(); as feedback) {
883
- <p
884
- [id]="emailFeedbackId"
885
- class="text-sm"
886
- [class.text-destructive]="feedbackTone() === 'error'"
887
- [class.text-emerald-700]="feedbackTone() === 'success'"
888
- [attr.role]="feedbackTone() === 'error' ? 'alert' : 'status'"
889
- [attr.aria-live]="feedbackTone() === 'error' ? 'assertive' : 'polite'">
890
- {{ feedback }}
891
- </p>
892
- }
893
- </div>
894
-
895
- <div class="grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center gap-3 pt-2">
896
- <ui-separator class="w-full" />
897
- <span class="min-w-14 text-center text-sm font-medium uppercase tracking-[0.18em] text-muted-foreground">
898
- Atau
899
- </span>
900
- <ui-separator class="w-full" />
901
- </div>
902
-
903
- <div class="grid gap-3 pt-2 sm:grid-cols-3">
904
- <button
905
- ui-button
906
- type="button"
907
- variant="outline"
908
- size="lg"
909
- disabled
910
- aria-label="Login dengan Google segera hadir"
911
- title="Segera hadir"
912
- class="h-12 gap-3 text-[0.74rem] font-medium uppercase tracking-[0.16em]">
913
- <span class="inline-flex size-6 shrink-0 items-center justify-center" aria-hidden="true">
914
- <svg viewBox="0 0 24 24" class="size-5" xmlns="http://www.w3.org/2000/svg">
915
- <path
916
- fill="#EA4335"
917
- d="M12.24 10.285v3.965h5.514c-.24 1.285-.96 2.374-2.045 3.105l3.305 2.565c1.925-1.775 3.03-4.39 3.03-7.49 0-.73-.065-1.43-.185-2.145z" />
918
- <path
919
- fill="#34A853"
920
- d="M12 22c2.7 0 4.965-.895 6.62-2.425l-3.305-2.565c-.915.615-2.085.985-3.315.985-2.545 0-4.7-1.72-5.47-4.03H3.115v2.53A9.996 9.996 0 0 0 12 22" />
921
- <path
922
- fill="#4A90E2"
923
- d="M6.53 13.965A5.996 5.996 0 0 1 6.24 12c0-.68.115-1.34.29-1.965v-2.53H3.115A9.996 9.996 0 0 0 2 12c0 1.61.385 3.135 1.115 4.495z" />
924
- <path
925
- fill="#FBBC05"
926
- d="M12 6.005c1.47 0 2.79.505 3.83 1.495l2.87-2.87C16.96 3.01 14.695 2 12 2a9.996 9.996 0 0 0-8.885 5.505l3.415 2.53c.77-2.31 2.925-4.03 5.47-4.03" />
927
- </svg>
928
- </span>
929
- Google
930
- </button>
931
- <button
932
- ui-button
933
- type="button"
934
- variant="outline"
935
- size="lg"
936
- disabled
937
- aria-label="Login dengan Microsoft segera hadir"
938
- title="Segera hadir"
939
- class="h-12 gap-3 text-[0.74rem] font-medium uppercase tracking-[0.16em]">
940
- <span class="inline-flex size-6 shrink-0 items-center justify-center" aria-hidden="true">
941
- <svg viewBox="0 0 24 24" class="size-5" xmlns="http://www.w3.org/2000/svg">
942
- <path fill="#F25022" d="M2 2h9.5v9.5H2z" />
943
- <path fill="#7FBA00" d="M12.5 2H22v9.5h-9.5z" />
944
- <path fill="#00A4EF" d="M2 12.5h9.5V22H2z" />
945
- <path fill="#FFB900" d="M12.5 12.5H22V22h-9.5z" />
946
- </svg>
947
- </span>
948
- Microsoft
949
- </button>
950
- <button
951
- ui-button
952
- type="button"
953
- variant="outline"
954
- size="lg"
955
- disabled
956
- aria-label="Login dengan Apple segera hadir"
957
- title="Segera hadir"
958
- class="h-12 gap-3 text-[0.74rem] font-medium uppercase tracking-[0.16em]">
959
- <span class="inline-flex size-6 shrink-0 items-center justify-center" aria-hidden="true">
960
- <svg viewBox="0 0 24 24" class="size-5 fill-current" xmlns="http://www.w3.org/2000/svg">
961
- <path
962
- d="M15.482 2c.13 1.25-.31 2.19-.84 2.81-.55.65-1.47 1.15-2.39 1.08-.12-1.21.38-2.17.92-2.79.6-.68 1.61-1.17 2.31-1.1Zm3.94 16.85c-.41.94-.91 1.8-1.54 2.59-.86 1.07-1.57 1.8-2.39 1.8-.59 0-.99-.17-1.44-.36-.47-.2-.95-.4-1.63-.4-.71 0-1.22.2-1.7.4-.46.19-.85.35-1.38.37-.79.03-1.55-.8-2.42-1.87-1.86-2.28-3.3-6.43-1.38-9.77.96-1.66 2.68-2.72 4.55-2.75.71-.01 1.39.21 1.98.41.45.15.86.29 1.19.29.3 0 .73-.15 1.19-.31.68-.23 1.46-.49 2.28-.42 1.14.09 2.17.55 2.98 1.38-2.66 1.45-2.23 5.2.71 6.54Z" />
963
- </svg>
964
- </span>
965
- Apple
966
- </button>
967
- </div>
968
- </form>
969
- </ui-card-content>
970
- </ui-card>
971
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: AspectRatioComponent, selector: "ui-aspect-ratio", inputs: ["ratio", "class"] }, { kind: "component", type: ButtonComponent, selector: "button[ui-button], a[ui-button]", inputs: ["variant", "size", "class"] }, { kind: "component", type: CardActionComponent, selector: "ui-card-action", inputs: ["class"] }, { kind: "component", type: CardComponent, selector: "ui-card", inputs: ["size", "class"] }, { kind: "component", type: CardContentComponent, selector: "ui-card-content", inputs: ["class"] }, { kind: "component", type: CardDescriptionComponent, selector: "ui-card-description, p[ui-card-description]", inputs: ["class"] }, { kind: "component", type: CardHeaderComponent, selector: "ui-card-header", inputs: ["class"] }, { kind: "component", type: CardTitleComponent, selector: "ui-card-title, h3[ui-card-title]", inputs: ["class"] }, { kind: "component", type: InputGroupAddonComponent, selector: "ui-input-group-addon", inputs: ["align", "class"] }, { kind: "component", type: InputGroupButtonComponent, selector: "button[ui-input-group-button], a[ui-input-group-button]", inputs: ["variant", "size", "class"] }, { kind: "component", type: InputGroupComponent, selector: "ui-input-group", inputs: ["class"] }, { kind: "component", type: InputGroupInputComponent, selector: "input[ui-input-group-input]", inputs: ["class"] }, { kind: "component", type: LabelComponent, selector: "ui-label, label[ui-label]", inputs: ["for", "class"] }, { kind: "component", type: SeparatorComponent, selector: "ui-separator", inputs: ["orientation", "decorative", "class"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
972
- }
973
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: AuthLoginPage, decorators: [{
974
- type: Component,
975
- args: [{
976
- selector: 'edsis-auth-login-page',
977
- imports: [
978
- ReactiveFormsModule,
979
- AspectRatioComponent,
980
- ButtonComponent,
981
- CardActionComponent,
982
- CardComponent,
983
- CardContentComponent,
984
- CardDescriptionComponent,
985
- CardHeaderComponent,
986
- CardTitleComponent,
987
- InputGroupAddonComponent,
988
- InputGroupButtonComponent,
989
- InputGroupComponent,
990
- InputGroupInputComponent,
991
- LabelComponent,
992
- SeparatorComponent,
993
- ],
994
- host: {
995
- class: 'block',
996
- },
997
- template: `
998
- <ui-card class="w-full overflow-hidden rounded-none border-border/80 bg-card/95 shadow-2xl backdrop-blur-sm">
999
- <ui-card-header
1000
- class="grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-x-4 gap-y-3 border-b border-border/60 bg-muted/15 pb-4 sm:pb-5">
1001
- <div class="w-16 shrink-0 sm:w-20">
1002
- <ui-aspect-ratio [ratio]="3 / 2" class="overflow-hidden rounded-none bg-primary">
1003
- <div
1004
- class="flex h-full w-full items-center justify-center px-1 text-[1.25rem] leading-none tracking-[-0.08em] text-primary-foreground sm:text-[1.55rem]"
1005
- style="font-family: 'Arial Black', Arial, sans-serif;">
1006
- ETOS
1007
- </div>
1008
- </ui-aspect-ratio>
1009
- </div>
1010
- <div class="min-w-0 space-y-0.5 pt-0.5 sm:pt-1">
1011
- <ui-card-title class="text-xl leading-tight sm:text-2xl">Etos Account Center</ui-card-title>
1012
- <p ui-card-description class="max-w-xl leading-6">
1013
- Masukkan email yang terdaftar. Kami akan mengirimkan tautan verifikasi untuk masuk ke aplikasi.
1014
- </p>
1015
- </div>
1016
- <ui-card-action
1017
- class="col-start-3 row-span-1 mt-0! pt-0.5 text-xs font-medium uppercase tracking-[0.24em] text-muted-foreground sm:pt-1 sm:text-sm">
1018
- LOGIN
1019
- </ui-card-action>
1020
- </ui-card-header>
1021
-
1022
- <ui-card-content class="pt-4 sm:pt-5">
1023
- <form class="space-y-6" [formGroup]="form" (ngSubmit)="submit()">
1024
- <div class="space-y-3">
1025
- <label ui-label for="email" class="sr-only">Alamat email</label>
1026
- <ui-input-group [class]="emailFieldClasses()">
1027
- <ui-input-group-addon
1028
- aria-hidden="true"
1029
- class="min-h-12 px-4 bg-transparent text-primary [&_svg]:size-6!">
1030
- <svg
1031
- viewBox="0 0 24 24"
1032
- class="fill-none stroke-current"
1033
- stroke-width="1.8"
1034
- stroke-linecap="round"
1035
- stroke-linejoin="round">
1036
- <path d="M4 7.5h16" />
1037
- <path d="M5 6h14a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1Z" />
1038
- <path d="m5 8 7 5 7-5" />
1039
- </svg>
1040
- </ui-input-group-addon>
1041
-
1042
- <input
1043
- ui-input-group-input
1044
- class="h-12! px-4! text-base!"
1045
- id="email"
1046
- type="email"
1047
- inputmode="email"
1048
- autocomplete="email"
1049
- [attr.aria-describedby]="feedbackMessage() ? emailFeedbackId : null"
1050
- [attr.aria-invalid]="fieldTone() === 'error' ? 'true' : null"
1051
- formControlName="email"
1052
- placeholder="your@email.com" />
1053
-
1054
- <button
1055
- ui-input-group-button
1056
- type="submit"
1057
- variant="default"
1058
- size="sm"
1059
- [disabled]="form.invalid || isSubmitting()"
1060
- class="order-30 h-12! min-w-24 rounded-none px-5 text-sm font-medium">
1061
- {{ isSubmitting() ? 'Mengirim...' : 'Kirim' }}
1062
- </button>
1063
- </ui-input-group>
1064
-
1065
- @if (feedbackMessage(); as feedback) {
1066
- <p
1067
- [id]="emailFeedbackId"
1068
- class="text-sm"
1069
- [class.text-destructive]="feedbackTone() === 'error'"
1070
- [class.text-emerald-700]="feedbackTone() === 'success'"
1071
- [attr.role]="feedbackTone() === 'error' ? 'alert' : 'status'"
1072
- [attr.aria-live]="feedbackTone() === 'error' ? 'assertive' : 'polite'">
1073
- {{ feedback }}
1074
- </p>
1075
- }
1076
- </div>
1077
-
1078
- <div class="grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center gap-3 pt-2">
1079
- <ui-separator class="w-full" />
1080
- <span class="min-w-14 text-center text-sm font-medium uppercase tracking-[0.18em] text-muted-foreground">
1081
- Atau
1082
- </span>
1083
- <ui-separator class="w-full" />
1084
- </div>
1085
-
1086
- <div class="grid gap-3 pt-2 sm:grid-cols-3">
1087
- <button
1088
- ui-button
1089
- type="button"
1090
- variant="outline"
1091
- size="lg"
1092
- disabled
1093
- aria-label="Login dengan Google segera hadir"
1094
- title="Segera hadir"
1095
- class="h-12 gap-3 text-[0.74rem] font-medium uppercase tracking-[0.16em]">
1096
- <span class="inline-flex size-6 shrink-0 items-center justify-center" aria-hidden="true">
1097
- <svg viewBox="0 0 24 24" class="size-5" xmlns="http://www.w3.org/2000/svg">
1098
- <path
1099
- fill="#EA4335"
1100
- d="M12.24 10.285v3.965h5.514c-.24 1.285-.96 2.374-2.045 3.105l3.305 2.565c1.925-1.775 3.03-4.39 3.03-7.49 0-.73-.065-1.43-.185-2.145z" />
1101
- <path
1102
- fill="#34A853"
1103
- d="M12 22c2.7 0 4.965-.895 6.62-2.425l-3.305-2.565c-.915.615-2.085.985-3.315.985-2.545 0-4.7-1.72-5.47-4.03H3.115v2.53A9.996 9.996 0 0 0 12 22" />
1104
- <path
1105
- fill="#4A90E2"
1106
- d="M6.53 13.965A5.996 5.996 0 0 1 6.24 12c0-.68.115-1.34.29-1.965v-2.53H3.115A9.996 9.996 0 0 0 2 12c0 1.61.385 3.135 1.115 4.495z" />
1107
- <path
1108
- fill="#FBBC05"
1109
- d="M12 6.005c1.47 0 2.79.505 3.83 1.495l2.87-2.87C16.96 3.01 14.695 2 12 2a9.996 9.996 0 0 0-8.885 5.505l3.415 2.53c.77-2.31 2.925-4.03 5.47-4.03" />
1110
- </svg>
1111
- </span>
1112
- Google
1113
- </button>
1114
- <button
1115
- ui-button
1116
- type="button"
1117
- variant="outline"
1118
- size="lg"
1119
- disabled
1120
- aria-label="Login dengan Microsoft segera hadir"
1121
- title="Segera hadir"
1122
- class="h-12 gap-3 text-[0.74rem] font-medium uppercase tracking-[0.16em]">
1123
- <span class="inline-flex size-6 shrink-0 items-center justify-center" aria-hidden="true">
1124
- <svg viewBox="0 0 24 24" class="size-5" xmlns="http://www.w3.org/2000/svg">
1125
- <path fill="#F25022" d="M2 2h9.5v9.5H2z" />
1126
- <path fill="#7FBA00" d="M12.5 2H22v9.5h-9.5z" />
1127
- <path fill="#00A4EF" d="M2 12.5h9.5V22H2z" />
1128
- <path fill="#FFB900" d="M12.5 12.5H22V22h-9.5z" />
1129
- </svg>
1130
- </span>
1131
- Microsoft
1132
- </button>
1133
- <button
1134
- ui-button
1135
- type="button"
1136
- variant="outline"
1137
- size="lg"
1138
- disabled
1139
- aria-label="Login dengan Apple segera hadir"
1140
- title="Segera hadir"
1141
- class="h-12 gap-3 text-[0.74rem] font-medium uppercase tracking-[0.16em]">
1142
- <span class="inline-flex size-6 shrink-0 items-center justify-center" aria-hidden="true">
1143
- <svg viewBox="0 0 24 24" class="size-5 fill-current" xmlns="http://www.w3.org/2000/svg">
1144
- <path
1145
- d="M15.482 2c.13 1.25-.31 2.19-.84 2.81-.55.65-1.47 1.15-2.39 1.08-.12-1.21.38-2.17.92-2.79.6-.68 1.61-1.17 2.31-1.1Zm3.94 16.85c-.41.94-.91 1.8-1.54 2.59-.86 1.07-1.57 1.8-2.39 1.8-.59 0-.99-.17-1.44-.36-.47-.2-.95-.4-1.63-.4-.71 0-1.22.2-1.7.4-.46.19-.85.35-1.38.37-.79.03-1.55-.8-2.42-1.87-1.86-2.28-3.3-6.43-1.38-9.77.96-1.66 2.68-2.72 4.55-2.75.71-.01 1.39.21 1.98.41.45.15.86.29 1.19.29.3 0 .73-.15 1.19-.31.68-.23 1.46-.49 2.28-.42 1.14.09 2.17.55 2.98 1.38-2.66 1.45-2.23 5.2.71 6.54Z" />
1146
- </svg>
1147
- </span>
1148
- Apple
1149
- </button>
1150
- </div>
1151
- </form>
1152
- </ui-card-content>
1153
- </ui-card>
1154
- `,
1155
- changeDetection: ChangeDetectionStrategy.OnPush,
1156
- }]
1157
- }] });
1158
-
1159
- class AuthLogoutPage {
1160
- destroyRef = inject(DestroyRef);
1161
- documentRef = inject(DOCUMENT);
1162
- router = inject(Router);
1163
- authSessionService = inject(AuthSessionService);
1164
- authConfig = inject(EDSIS_AUTH_CONFIG);
1165
- guestHomePath = this.authConfig.guestHomePath;
1166
- authenticatedHomePath = this.authConfig.authenticatedHomePath;
1167
- state = signal('pending', ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
1168
- message = signal('Mengakhiri sesi...', ...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
1169
- ngOnInit() {
1170
- clearStoredSession(this.documentRef);
1171
- this.authSessionService
1172
- .logoutAuthSession()
1173
- .pipe(takeUntilDestroyed(this.destroyRef), finalize(() => {
1174
- if (this.state() === 'pending') {
1175
- this.state.set('success');
1176
- }
1177
- }))
1178
- .subscribe({
1179
- next: (response) => {
1180
- this.state.set('success');
1181
- this.message.set(getResponseMessage(response, 'Sesi berhasil diakhiri.'));
1182
- void this.router.navigateByUrl(this.guestHomePath, { replaceUrl: true });
1183
- },
1184
- error: (error) => {
1185
- this.state.set('error');
1186
- this.message.set(getErrorMessage(error, 'Sesi lokal sudah dihapus, tetapi request logout gagal.'));
1187
- },
1188
- });
1189
- }
1190
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: AuthLogoutPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
1191
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: AuthLogoutPage, isStandalone: true, selector: "edsis-auth-logout-page", host: { classAttribute: "block" }, ngImport: i0, template: `
1192
- <ui-card class="w-full overflow-hidden rounded-none border-border/80 bg-card/95 shadow-2xl backdrop-blur-sm">
1193
- <ui-card-header
1194
- class="grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-x-4 gap-y-3 border-b border-border/60 bg-muted/15 pb-4 sm:pb-5">
1195
- <div class="w-16 shrink-0 sm:w-20">
1196
- <ui-aspect-ratio [ratio]="3 / 2" class="overflow-hidden rounded-none bg-primary">
1197
- <div
1198
- class="flex h-full w-full items-center justify-center px-1 text-[1.25rem] leading-none tracking-[-0.08em] text-primary-foreground sm:text-[1.55rem]"
1199
- style="font-family: 'Arial Black', Arial, sans-serif;">
1200
- ETOS
1201
- </div>
1202
- </ui-aspect-ratio>
1203
- </div>
1204
- <div class="min-w-0 space-y-0.5 pt-0.5 sm:pt-1">
1205
- <ui-card-title class="text-xl leading-tight sm:text-2xl">Mengakhiri sesi Edsis.</ui-card-title>
1206
- <p ui-card-description class="max-w-xl leading-6">
1207
- Halaman ini membersihkan sesi lokal lalu memanggil endpoint logout untuk merevoke refresh-token cookie pada
1208
- backend.
1209
- </p>
1210
- </div>
1211
- <ui-card-action
1212
- class="col-start-3 row-span-1 mt-0! pt-0.5 text-xs font-medium uppercase tracking-[0.24em] text-muted-foreground sm:pt-1 sm:text-sm">
1213
- LOGOUT
1214
- </ui-card-action>
1215
- </ui-card-header>
1216
-
1217
- <ui-card-content class="space-y-4 pt-6 sm:pt-7">
1218
- <ui-alert [variant]="state() === 'error' ? 'destructive' : 'default'" class="bg-background/70 shadow-sm">
1219
- @if (state() === 'pending') {
1220
- <ui-spinner class="mt-0.5 size-4" aria-label="Mengakhiri sesi" />
1221
- }
1222
-
1223
- <ui-alert-description>
1224
- {{ message() }}
1225
- </ui-alert-description>
1226
- </ui-alert>
1227
-
1228
- @if (state() === 'error') {
1229
- <ui-alert variant="destructive" class="shadow-sm">
1230
- <ui-alert-description>
1231
- Backend tidak mengonfirmasi logout, tetapi sesi lokal sudah dihapus.
1232
- </ui-alert-description>
1233
- </ui-alert>
1234
- }
1235
- </ui-card-content>
1236
-
1237
- <ui-card-footer class="flex flex-wrap gap-3 border-t border-border/60 bg-muted/10 pt-4 sm:pt-5">
1238
- <a ui-button [routerLink]="guestHomePath" variant="default"> Kembali ke login </a>
1239
- <a ui-button [routerLink]="authenticatedHomePath" variant="outline"> Buka dashboard </a>
1240
- </ui-card-footer>
1241
- </ui-card>
1242
- `, isInline: true, dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: AlertComponent, selector: "ui-alert", inputs: ["variant", "class"] }, { kind: "component", type: AlertDescriptionComponent, selector: "ui-alert-description", inputs: ["class"] }, { kind: "component", type: AspectRatioComponent, selector: "ui-aspect-ratio", inputs: ["ratio", "class"] }, { kind: "component", type: ButtonComponent, selector: "button[ui-button], a[ui-button]", inputs: ["variant", "size", "class"] }, { kind: "component", type: CardActionComponent, selector: "ui-card-action", inputs: ["class"] }, { kind: "component", type: CardComponent, selector: "ui-card", inputs: ["size", "class"] }, { kind: "component", type: CardContentComponent, selector: "ui-card-content", inputs: ["class"] }, { kind: "component", type: CardDescriptionComponent, selector: "ui-card-description, p[ui-card-description]", inputs: ["class"] }, { kind: "component", type: CardFooterComponent, selector: "ui-card-footer", inputs: ["class"] }, { kind: "component", type: CardHeaderComponent, selector: "ui-card-header", inputs: ["class"] }, { kind: "component", type: CardTitleComponent, selector: "ui-card-title, h3[ui-card-title]", inputs: ["class"] }, { kind: "component", type: SpinnerComponent, selector: "ui-spinner", inputs: ["class", "decorative", "aria-label", "aria-labelledby"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1243
- }
1244
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: AuthLogoutPage, decorators: [{
1245
- type: Component,
1246
- args: [{
1247
- selector: 'edsis-auth-logout-page',
1248
- imports: [
1249
- RouterLink,
1250
- AlertComponent,
1251
- AlertDescriptionComponent,
1252
- AspectRatioComponent,
1253
- ButtonComponent,
1254
- CardActionComponent,
1255
- CardComponent,
1256
- CardContentComponent,
1257
- CardDescriptionComponent,
1258
- CardFooterComponent,
1259
- CardHeaderComponent,
1260
- CardTitleComponent,
1261
- SpinnerComponent,
1262
- ],
1263
- host: {
1264
- class: 'block',
1265
- },
1266
- template: `
1267
- <ui-card class="w-full overflow-hidden rounded-none border-border/80 bg-card/95 shadow-2xl backdrop-blur-sm">
1268
- <ui-card-header
1269
- class="grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-x-4 gap-y-3 border-b border-border/60 bg-muted/15 pb-4 sm:pb-5">
1270
- <div class="w-16 shrink-0 sm:w-20">
1271
- <ui-aspect-ratio [ratio]="3 / 2" class="overflow-hidden rounded-none bg-primary">
1272
- <div
1273
- class="flex h-full w-full items-center justify-center px-1 text-[1.25rem] leading-none tracking-[-0.08em] text-primary-foreground sm:text-[1.55rem]"
1274
- style="font-family: 'Arial Black', Arial, sans-serif;">
1275
- ETOS
1276
- </div>
1277
- </ui-aspect-ratio>
1278
- </div>
1279
- <div class="min-w-0 space-y-0.5 pt-0.5 sm:pt-1">
1280
- <ui-card-title class="text-xl leading-tight sm:text-2xl">Mengakhiri sesi Edsis.</ui-card-title>
1281
- <p ui-card-description class="max-w-xl leading-6">
1282
- Halaman ini membersihkan sesi lokal lalu memanggil endpoint logout untuk merevoke refresh-token cookie pada
1283
- backend.
1284
- </p>
1285
- </div>
1286
- <ui-card-action
1287
- class="col-start-3 row-span-1 mt-0! pt-0.5 text-xs font-medium uppercase tracking-[0.24em] text-muted-foreground sm:pt-1 sm:text-sm">
1288
- LOGOUT
1289
- </ui-card-action>
1290
- </ui-card-header>
1291
-
1292
- <ui-card-content class="space-y-4 pt-6 sm:pt-7">
1293
- <ui-alert [variant]="state() === 'error' ? 'destructive' : 'default'" class="bg-background/70 shadow-sm">
1294
- @if (state() === 'pending') {
1295
- <ui-spinner class="mt-0.5 size-4" aria-label="Mengakhiri sesi" />
1296
- }
1297
-
1298
- <ui-alert-description>
1299
- {{ message() }}
1300
- </ui-alert-description>
1301
- </ui-alert>
1302
-
1303
- @if (state() === 'error') {
1304
- <ui-alert variant="destructive" class="shadow-sm">
1305
- <ui-alert-description>
1306
- Backend tidak mengonfirmasi logout, tetapi sesi lokal sudah dihapus.
1307
- </ui-alert-description>
1308
- </ui-alert>
1309
- }
1310
- </ui-card-content>
1311
-
1312
- <ui-card-footer class="flex flex-wrap gap-3 border-t border-border/60 bg-muted/10 pt-4 sm:pt-5">
1313
- <a ui-button [routerLink]="guestHomePath" variant="default"> Kembali ke login </a>
1314
- <a ui-button [routerLink]="authenticatedHomePath" variant="outline"> Buka dashboard </a>
1315
- </ui-card-footer>
1316
- </ui-card>
1317
- `,
1318
- changeDetection: ChangeDetectionStrategy.OnPush,
1319
- }]
1320
- }] });
1321
-
1322
- class AuthVerifyPage {
1323
- documentRef = inject(DOCUMENT);
1324
- destroyRef = inject(DestroyRef);
1325
- route = inject(ActivatedRoute);
1326
- router = inject(Router);
1327
- location = inject(Location);
1328
- authMagicLinkService = inject(AuthMagicLinkService);
1329
- authConfig = inject(EDSIS_AUTH_CONFIG);
1330
- queryParamMap = toSignal(this.route.queryParamMap, {
1331
- initialValue: this.route.snapshot.queryParamMap,
1332
- });
1333
- fragment = toSignal(this.route.fragment, {
1334
- initialValue: this.route.snapshot.fragment,
1335
- });
1336
- handledToken = undefined;
1337
- verifySubscription = null;
1338
- guestHomePath = this.authConfig.guestHomePath;
1339
- authenticatedHomePath = this.authConfig.authenticatedHomePath;
1340
- state = signal('pending', ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
1341
- message = signal('Memverifikasi magic link...', ...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
1342
- token = input(undefined, ...(ngDevMode ? [{ debugName: "token" }] : /* istanbul ignore next */ []));
1343
- constructor() {
1344
- this.destroyRef.onDestroy(() => this.verifySubscription?.unsubscribe());
1345
- effect(() => {
1346
- const token = extractMagicToken(this.token() ?? this.queryParamMap().get('token'), this.fragment());
1347
- if (!token) {
1348
- if (this.handledToken === null) {
1349
- return;
1350
- }
1351
- this.handledToken = null;
1352
- this.clearTokenFromAddressBar();
1353
- this.state.set('error');
1354
- this.message.set('Token magic link tidak ditemukan pada URL yang dibuka.');
1355
- return;
1356
- }
1357
- if (token === this.handledToken) {
1358
- return;
1359
- }
1360
- this.handledToken = token;
1361
- this.clearTokenFromAddressBar();
1362
- this.state.set('pending');
1363
- this.message.set('Memverifikasi magic link...');
1364
- this.verify(token);
1365
- });
1366
- }
1367
- clearTokenFromAddressBar() {
1368
- this.location.replaceState(this.authConfig.verifyPath);
1369
- }
1370
- verify(token) {
1371
- this.verifySubscription?.unsubscribe();
1372
- this.verifySubscription = this.authMagicLinkService
1373
- .verifyMagicLink({
1374
- body: {
1375
- token,
1376
- device_type: 'web',
1377
- },
1378
- })
1379
- .subscribe({
1380
- next: (response) => {
1381
- const session = persistSession(this.documentRef, response.data);
1382
- if (!session) {
1383
- this.state.set('error');
1384
- this.message.set('Verifikasi berhasil, tetapi access token tidak ditemukan di respons backend.');
1385
- return;
1386
- }
1387
- this.state.set('success');
1388
- this.message.set(getResponseMessage(response, 'Verifikasi berhasil. Mengarahkan ke dashboard...'));
1389
- void this.router.navigateByUrl(this.authenticatedHomePath, { replaceUrl: true });
1390
- },
1391
- error: (error) => {
1392
- this.state.set('error');
1393
- this.message.set(getErrorMessage(error, 'Magic link tidak valid atau sudah kedaluwarsa.'));
1394
- },
1395
- });
1396
- }
1397
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: AuthVerifyPage, deps: [], target: i0.ɵɵFactoryTarget.Component });
1398
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: AuthVerifyPage, isStandalone: true, selector: "edsis-auth-verify-page", inputs: { token: { classPropertyName: "token", publicName: "token", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "block" }, ngImport: i0, template: `
1399
- <ui-card class="w-full overflow-hidden rounded-none border-border/80 bg-card/95 shadow-2xl backdrop-blur-sm">
1400
- <ui-card-header
1401
- class="grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-x-4 gap-y-3 border-b border-border/60 bg-muted/15 pb-4 sm:pb-5">
1402
- <div class="w-16 shrink-0 sm:w-20">
1403
- <ui-aspect-ratio [ratio]="3 / 2" class="overflow-hidden rounded-none bg-primary">
1404
- <div
1405
- class="flex h-full w-full items-center justify-center px-1 text-[1.25rem] leading-none tracking-[-0.08em] text-primary-foreground sm:text-[1.55rem]"
1406
- style="font-family: 'Arial Black', Arial, sans-serif;">
1407
- ETOS
1408
- </div>
1409
- </ui-aspect-ratio>
1410
- </div>
1411
- <div class="min-w-0 space-y-0.5 pt-0.5 sm:pt-1">
1412
- <ui-card-title class="text-xl leading-tight sm:text-2xl">Memverifikasi magic link.</ui-card-title>
1413
- <p ui-card-description class="max-w-xl leading-6">
1414
- Token akan dikonsumsi satu kali, sesi refresh cookie dibentuk di backend, lalu access token disimpan secara
1415
- lokal untuk aplikasi.
1416
- </p>
1417
- </div>
1418
- <ui-card-action
1419
- class="col-start-3 row-span-1 mt-0! pt-0.5 text-xs font-medium uppercase tracking-[0.24em] text-muted-foreground sm:pt-1 sm:text-sm">
1420
- VERIFY
1421
- </ui-card-action>
1422
- </ui-card-header>
1423
-
1424
- <ui-card-content class="space-y-4 pt-6 sm:pt-7">
1425
- <ui-alert [variant]="state() === 'error' ? 'destructive' : 'default'" class="bg-background/70 shadow-sm">
1426
- @if (state() === 'pending') {
1427
- <ui-spinner class="mt-0.5 size-4" aria-label="Memverifikasi magic link" />
1428
- }
1429
-
1430
- <ui-alert-description>
1431
- {{ message() }}
1432
- </ui-alert-description>
1433
- </ui-alert>
1434
-
1435
- @if (state() === 'error') {
1436
- <ui-alert variant="destructive" class="shadow-sm">
1437
- <ui-alert-description>
1438
- Pastikan Anda membuka link terbaru dari email dan token belum pernah dipakai sebelumnya.
1439
- </ui-alert-description>
1440
- </ui-alert>
1441
- }
1442
- </ui-card-content>
1443
-
1444
- <ui-card-footer class="flex flex-wrap gap-3 border-t border-border/60 bg-muted/10 pt-4 sm:pt-5">
1445
- <a ui-button [routerLink]="guestHomePath" variant="outline"> Minta link baru </a>
1446
- <a ui-button [routerLink]="authenticatedHomePath" variant="default"> Buka dashboard </a>
1447
- </ui-card-footer>
1448
- </ui-card>
1449
- `, isInline: true, dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: AlertComponent, selector: "ui-alert", inputs: ["variant", "class"] }, { kind: "component", type: AlertDescriptionComponent, selector: "ui-alert-description", inputs: ["class"] }, { kind: "component", type: AspectRatioComponent, selector: "ui-aspect-ratio", inputs: ["ratio", "class"] }, { kind: "component", type: ButtonComponent, selector: "button[ui-button], a[ui-button]", inputs: ["variant", "size", "class"] }, { kind: "component", type: CardActionComponent, selector: "ui-card-action", inputs: ["class"] }, { kind: "component", type: CardComponent, selector: "ui-card", inputs: ["size", "class"] }, { kind: "component", type: CardContentComponent, selector: "ui-card-content", inputs: ["class"] }, { kind: "component", type: CardDescriptionComponent, selector: "ui-card-description, p[ui-card-description]", inputs: ["class"] }, { kind: "component", type: CardFooterComponent, selector: "ui-card-footer", inputs: ["class"] }, { kind: "component", type: CardHeaderComponent, selector: "ui-card-header", inputs: ["class"] }, { kind: "component", type: CardTitleComponent, selector: "ui-card-title, h3[ui-card-title]", inputs: ["class"] }, { kind: "component", type: SpinnerComponent, selector: "ui-spinner", inputs: ["class", "decorative", "aria-label", "aria-labelledby"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1450
- }
1451
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: AuthVerifyPage, decorators: [{
1452
- type: Component,
1453
- args: [{
1454
- selector: 'edsis-auth-verify-page',
1455
- imports: [
1456
- RouterLink,
1457
- AlertComponent,
1458
- AlertDescriptionComponent,
1459
- AspectRatioComponent,
1460
- ButtonComponent,
1461
- CardActionComponent,
1462
- CardComponent,
1463
- CardContentComponent,
1464
- CardDescriptionComponent,
1465
- CardFooterComponent,
1466
- CardHeaderComponent,
1467
- CardTitleComponent,
1468
- SpinnerComponent,
1469
- ],
1470
- host: {
1471
- class: 'block',
1472
- },
1473
- template: `
1474
- <ui-card class="w-full overflow-hidden rounded-none border-border/80 bg-card/95 shadow-2xl backdrop-blur-sm">
1475
- <ui-card-header
1476
- class="grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-x-4 gap-y-3 border-b border-border/60 bg-muted/15 pb-4 sm:pb-5">
1477
- <div class="w-16 shrink-0 sm:w-20">
1478
- <ui-aspect-ratio [ratio]="3 / 2" class="overflow-hidden rounded-none bg-primary">
1479
- <div
1480
- class="flex h-full w-full items-center justify-center px-1 text-[1.25rem] leading-none tracking-[-0.08em] text-primary-foreground sm:text-[1.55rem]"
1481
- style="font-family: 'Arial Black', Arial, sans-serif;">
1482
- ETOS
1483
- </div>
1484
- </ui-aspect-ratio>
1485
- </div>
1486
- <div class="min-w-0 space-y-0.5 pt-0.5 sm:pt-1">
1487
- <ui-card-title class="text-xl leading-tight sm:text-2xl">Memverifikasi magic link.</ui-card-title>
1488
- <p ui-card-description class="max-w-xl leading-6">
1489
- Token akan dikonsumsi satu kali, sesi refresh cookie dibentuk di backend, lalu access token disimpan secara
1490
- lokal untuk aplikasi.
1491
- </p>
1492
- </div>
1493
- <ui-card-action
1494
- class="col-start-3 row-span-1 mt-0! pt-0.5 text-xs font-medium uppercase tracking-[0.24em] text-muted-foreground sm:pt-1 sm:text-sm">
1495
- VERIFY
1496
- </ui-card-action>
1497
- </ui-card-header>
1498
-
1499
- <ui-card-content class="space-y-4 pt-6 sm:pt-7">
1500
- <ui-alert [variant]="state() === 'error' ? 'destructive' : 'default'" class="bg-background/70 shadow-sm">
1501
- @if (state() === 'pending') {
1502
- <ui-spinner class="mt-0.5 size-4" aria-label="Memverifikasi magic link" />
1503
- }
1504
-
1505
- <ui-alert-description>
1506
- {{ message() }}
1507
- </ui-alert-description>
1508
- </ui-alert>
1509
-
1510
- @if (state() === 'error') {
1511
- <ui-alert variant="destructive" class="shadow-sm">
1512
- <ui-alert-description>
1513
- Pastikan Anda membuka link terbaru dari email dan token belum pernah dipakai sebelumnya.
1514
- </ui-alert-description>
1515
- </ui-alert>
1516
- }
1517
- </ui-card-content>
1518
-
1519
- <ui-card-footer class="flex flex-wrap gap-3 border-t border-border/60 bg-muted/10 pt-4 sm:pt-5">
1520
- <a ui-button [routerLink]="guestHomePath" variant="outline"> Minta link baru </a>
1521
- <a ui-button [routerLink]="authenticatedHomePath" variant="default"> Buka dashboard </a>
1522
- </ui-card-footer>
1523
- </ui-card>
1524
- `,
1525
- changeDetection: ChangeDetectionStrategy.OnPush,
1526
- }]
1527
- }], ctorParameters: () => [], propDecorators: { token: [{ type: i0.Input, args: [{ isSignal: true, alias: "token", required: false }] }] } });
1528
-
1529
- const authRoutes = [
1530
- {
1531
- path: '',
1532
- component: AuthShellPage,
1533
- children: [
1534
- {
1535
- path: 'login',
1536
- title: 'Login',
1537
- canActivate: [guestOnlyGuard],
1538
- component: AuthLoginPage,
1539
- },
1540
- {
1541
- path: 'logout',
1542
- title: 'Logout',
1543
- component: AuthLogoutPage,
1544
- },
1545
- {
1546
- path: 'verify',
1547
- title: 'Verify',
1548
- canActivate: [guestOnlyGuard],
1549
- component: AuthVerifyPage,
1550
- },
1551
- ],
1552
- },
1553
- ];
1554
-
1555
- /**
1556
- * Generated bundle index. Do not edit.
1557
- */
1558
-
1559
- export { AUTH_SESSION_CHANGE_EVENT, AuthLoginPage, AuthLogoutPage, AuthShellPage, AuthVerifyPage, EDSIS_AUTH_CONFIG, EDSIS_SKIP_AUTH, EDSIS_SKIP_SESSION_REFRESH, authRoutes, authenticatedGuard, clearStoredSession, edsisAuthInterceptor, guestOnlyGuard, hasStoredSession, homeRedirectGuard, injectSessionClear, injectSessionRefresh, injectSessionState, persistSession, provideEdsisAuth, readStoredAccessToken, readStoredSession, resolveEdsisAuthConfig, shouldClearSessionAfterRefreshFailure, startAuthSessionMonitor, validateStoredSession, ɵresetAuthSessionModuleState };
1560
- //# sourceMappingURL=edsis-angular-module-auth.mjs.map