@sdcorejs/angular 21.3.1 → 21.3.3

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 (386) hide show
  1. package/assets/STYLE-GUIDE.md +25 -5
  2. package/assets/THEME.md +289 -5
  3. package/assets/licenses/tiptap-oss-NOTICES.txt +332 -0
  4. package/assets/scss/ckeditor5.scss +2 -88
  5. package/assets/scss/core/_control.scss +39 -0
  6. package/assets/scss/core/form.scss +444 -45
  7. package/assets/scss/core/view.scss +24 -0
  8. package/assets/scss/editor-content.scss +173 -0
  9. package/assets/scss/sd-core.scss +1 -0
  10. package/assets/scss/themes/_component-tokens.scss +123 -32
  11. package/assets/scss/themes/_material-tokens.scss +112 -0
  12. package/assets/scss/themes/_presets.scss +25 -0
  13. package/assets/scss/themes/_scales.scss +10 -0
  14. package/assets/scss/themes/_semantic.scss +13 -0
  15. package/assets/scss/themes/default.scss +8 -2
  16. package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs +5 -5
  17. package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs.map +1 -1
  18. package/fesm2022/sdcorejs-angular-components-avatar.mjs +142 -11
  19. package/fesm2022/sdcorejs-angular-components-avatar.mjs.map +1 -1
  20. package/fesm2022/sdcorejs-angular-components-badge.mjs +542 -24
  21. package/fesm2022/sdcorejs-angular-components-badge.mjs.map +1 -1
  22. package/fesm2022/sdcorejs-angular-components-button.mjs +31 -3
  23. package/fesm2022/sdcorejs-angular-components-button.mjs.map +1 -1
  24. package/fesm2022/sdcorejs-angular-components-ckeditor-styles.mjs +5 -20
  25. package/fesm2022/sdcorejs-angular-components-ckeditor-styles.mjs.map +1 -1
  26. package/fesm2022/sdcorejs-angular-components-data-state.mjs +1 -1
  27. package/fesm2022/sdcorejs-angular-components-data-state.mjs.map +1 -1
  28. package/fesm2022/sdcorejs-angular-components-editor-engine.mjs +1872 -0
  29. package/fesm2022/sdcorejs-angular-components-editor-engine.mjs.map +1 -0
  30. package/fesm2022/sdcorejs-angular-components-editor.mjs +457 -756
  31. package/fesm2022/sdcorejs-angular-components-editor.mjs.map +1 -1
  32. package/fesm2022/sdcorejs-angular-components-file-explorer.mjs +68 -37
  33. package/fesm2022/sdcorejs-angular-components-file-explorer.mjs.map +1 -1
  34. package/fesm2022/sdcorejs-angular-components-form-generic.mjs +2118 -1159
  35. package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
  36. package/fesm2022/sdcorejs-angular-components-history.mjs +5 -2
  37. package/fesm2022/sdcorejs-angular-components-history.mjs.map +1 -1
  38. package/fesm2022/sdcorejs-angular-components-image-editor.mjs +1 -1
  39. package/fesm2022/sdcorejs-angular-components-image-editor.mjs.map +1 -1
  40. package/fesm2022/sdcorejs-angular-components-import-excel.mjs +21 -6
  41. package/fesm2022/sdcorejs-angular-components-import-excel.mjs.map +1 -1
  42. package/fesm2022/sdcorejs-angular-components-inform.mjs +1 -1
  43. package/fesm2022/sdcorejs-angular-components-inform.mjs.map +1 -1
  44. package/fesm2022/sdcorejs-angular-components-kanban.mjs +12 -2
  45. package/fesm2022/sdcorejs-angular-components-kanban.mjs.map +1 -1
  46. package/fesm2022/sdcorejs-angular-components-mini-editor.mjs +177 -283
  47. package/fesm2022/sdcorejs-angular-components-mini-editor.mjs.map +1 -1
  48. package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs +1 -308
  49. package/fesm2022/sdcorejs-angular-components-modal-resizable.mjs.map +1 -1
  50. package/fesm2022/sdcorejs-angular-components-modal.mjs +2 -2
  51. package/fesm2022/sdcorejs-angular-components-modal.mjs.map +1 -1
  52. package/fesm2022/sdcorejs-angular-components-operator.mjs +260 -43
  53. package/fesm2022/sdcorejs-angular-components-operator.mjs.map +1 -1
  54. package/fesm2022/sdcorejs-angular-components-query-bar.mjs +12 -12
  55. package/fesm2022/sdcorejs-angular-components-query-bar.mjs.map +1 -1
  56. package/fesm2022/sdcorejs-angular-components-query-builder.mjs +1 -1
  57. package/fesm2022/sdcorejs-angular-components-query-builder.mjs.map +1 -1
  58. package/fesm2022/sdcorejs-angular-components-section.mjs +17 -5
  59. package/fesm2022/sdcorejs-angular-components-section.mjs.map +1 -1
  60. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +2 -2
  61. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
  62. package/fesm2022/sdcorejs-angular-components-splitter.mjs.map +1 -1
  63. package/fesm2022/sdcorejs-angular-components-tab-router.mjs +559 -94
  64. package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
  65. package/fesm2022/sdcorejs-angular-components-table.mjs +1001 -119
  66. package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
  67. package/fesm2022/sdcorejs-angular-components-tree.mjs +1 -1
  68. package/fesm2022/sdcorejs-angular-components-tree.mjs.map +1 -1
  69. package/fesm2022/sdcorejs-angular-components-upload-file.mjs +887 -174
  70. package/fesm2022/sdcorejs-angular-components-upload-file.mjs.map +1 -1
  71. package/fesm2022/sdcorejs-angular-components-view.mjs +2 -2
  72. package/fesm2022/sdcorejs-angular-components-view.mjs.map +1 -1
  73. package/fesm2022/sdcorejs-angular-components-window.mjs +484 -0
  74. package/fesm2022/sdcorejs-angular-components-window.mjs.map +1 -0
  75. package/fesm2022/sdcorejs-angular-components.mjs +1 -0
  76. package/fesm2022/sdcorejs-angular-components.mjs.map +1 -1
  77. package/fesm2022/sdcorejs-angular-configurations.mjs.map +1 -1
  78. package/fesm2022/sdcorejs-angular-directives.mjs +18 -1
  79. package/fesm2022/sdcorejs-angular-directives.mjs.map +1 -1
  80. package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs +20 -2
  81. package/fesm2022/sdcorejs-angular-forms-autocomplete.mjs.map +1 -1
  82. package/fesm2022/sdcorejs-angular-forms-checkbox.mjs +2 -2
  83. package/fesm2022/sdcorejs-angular-forms-checkbox.mjs.map +1 -1
  84. package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs +457 -125
  85. package/fesm2022/sdcorejs-angular-forms-chip-calendar.mjs.map +1 -1
  86. package/fesm2022/sdcorejs-angular-forms-chip.mjs +414 -122
  87. package/fesm2022/sdcorejs-angular-forms-chip.mjs.map +1 -1
  88. package/fesm2022/sdcorejs-angular-forms-date-range.mjs +79 -13
  89. package/fesm2022/sdcorejs-angular-forms-date-range.mjs.map +1 -1
  90. package/fesm2022/sdcorejs-angular-forms-date.mjs +75 -18
  91. package/fesm2022/sdcorejs-angular-forms-date.mjs.map +1 -1
  92. package/fesm2022/sdcorejs-angular-forms-datetime.mjs +79 -16
  93. package/fesm2022/sdcorejs-angular-forms-datetime.mjs.map +1 -1
  94. package/fesm2022/sdcorejs-angular-forms-directives.mjs +82 -2
  95. package/fesm2022/sdcorejs-angular-forms-directives.mjs.map +1 -1
  96. package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs +2 -2
  97. package/fesm2022/sdcorejs-angular-forms-entity-picker.mjs.map +1 -1
  98. package/fesm2022/sdcorejs-angular-forms-input-color.mjs +1 -1
  99. package/fesm2022/sdcorejs-angular-forms-input-color.mjs.map +1 -1
  100. package/fesm2022/sdcorejs-angular-forms-input-number.mjs +56 -6
  101. package/fesm2022/sdcorejs-angular-forms-input-number.mjs.map +1 -1
  102. package/fesm2022/sdcorejs-angular-forms-input.mjs +54 -7
  103. package/fesm2022/sdcorejs-angular-forms-input.mjs.map +1 -1
  104. package/fesm2022/sdcorejs-angular-forms-models.mjs +88 -5
  105. package/fesm2022/sdcorejs-angular-forms-models.mjs.map +1 -1
  106. package/fesm2022/sdcorejs-angular-forms-radio.mjs +2 -2
  107. package/fesm2022/sdcorejs-angular-forms-radio.mjs.map +1 -1
  108. package/fesm2022/sdcorejs-angular-forms-segmented.mjs +5 -4
  109. package/fesm2022/sdcorejs-angular-forms-segmented.mjs.map +1 -1
  110. package/fesm2022/sdcorejs-angular-forms-select.mjs +87 -33
  111. package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
  112. package/fesm2022/sdcorejs-angular-forms-switch.mjs +2 -2
  113. package/fesm2022/sdcorejs-angular-forms-switch.mjs.map +1 -1
  114. package/fesm2022/sdcorejs-angular-forms-textarea.mjs +16 -3
  115. package/fesm2022/sdcorejs-angular-forms-textarea.mjs.map +1 -1
  116. package/fesm2022/sdcorejs-angular-forms-time.mjs +2 -2
  117. package/fesm2022/sdcorejs-angular-forms-time.mjs.map +1 -1
  118. package/fesm2022/sdcorejs-angular-forms-tree-select.mjs +1 -1
  119. package/fesm2022/sdcorejs-angular-forms-tree-select.mjs.map +1 -1
  120. package/fesm2022/sdcorejs-angular-i18n.mjs +1745 -22
  121. package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
  122. package/fesm2022/sdcorejs-angular-interceptors.mjs +1 -1
  123. package/fesm2022/sdcorejs-angular-interceptors.mjs.map +1 -1
  124. package/fesm2022/sdcorejs-angular-modules-generic-generic-configuration.page-BR6jxyYd.mjs +478 -0
  125. package/fesm2022/sdcorejs-angular-modules-generic-generic-configuration.page-BR6jxyYd.mjs.map +1 -0
  126. package/fesm2022/sdcorejs-angular-modules-generic-generic-form-host.page-BsEL-y-M.mjs +214 -0
  127. package/fesm2022/sdcorejs-angular-modules-generic-generic-form-host.page-BsEL-y-M.mjs.map +1 -0
  128. package/fesm2022/sdcorejs-angular-modules-generic-generic-list.page-qTFKh4UG.mjs +277 -0
  129. package/fesm2022/sdcorejs-angular-modules-generic-generic-list.page-qTFKh4UG.mjs.map +1 -0
  130. package/fesm2022/sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-Cq0GFfo1.mjs +1556 -0
  131. package/fesm2022/sdcorejs-angular-modules-generic-sdcorejs-angular-modules-generic-Cq0GFfo1.mjs.map +1 -0
  132. package/fesm2022/sdcorejs-angular-modules-generic.mjs +2 -0
  133. package/fesm2022/sdcorejs-angular-modules-generic.mjs.map +1 -0
  134. package/fesm2022/sdcorejs-angular-modules-icon.mjs +96 -3
  135. package/fesm2022/sdcorejs-angular-modules-icon.mjs.map +1 -1
  136. package/fesm2022/sdcorejs-angular-modules-layout.mjs +2055 -37
  137. package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
  138. package/fesm2022/sdcorejs-angular-modules-pattern-api-error-BBWwQ6h2.mjs +23 -0
  139. package/fesm2022/sdcorejs-angular-modules-pattern-api-error-BBWwQ6h2.mjs.map +1 -0
  140. package/fesm2022/sdcorejs-angular-modules-pattern-approval-inbox-BMwD6_FC.mjs +16 -0
  141. package/fesm2022/sdcorejs-angular-modules-pattern-approval-inbox-BMwD6_FC.mjs.map +1 -0
  142. package/fesm2022/sdcorejs-angular-modules-pattern-base-api.service-p8-V_Ol9.mjs +51 -0
  143. package/fesm2022/sdcorejs-angular-modules-pattern-base-api.service-p8-V_Ol9.mjs.map +1 -0
  144. package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-DTcpSsbe.mjs +130 -0
  145. package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-DTcpSsbe.mjs.map +1 -0
  146. package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-T2ox0oMZ.mjs +131 -0
  147. package/fesm2022/sdcorejs-angular-modules-pattern-create-side-drawer.component-T2ox0oMZ.mjs.map +1 -0
  148. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DAjVXHXc.mjs +99 -0
  149. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DAjVXHXc.mjs.map +1 -0
  150. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DkHR_ix2.mjs +118 -0
  151. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DkHR_ix2.mjs.map +1 -0
  152. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DxWuy1ul.mjs +460 -0
  153. package/fesm2022/sdcorejs-angular-modules-pattern-create.component-DxWuy1ul.mjs.map +1 -0
  154. package/fesm2022/sdcorejs-angular-modules-pattern-customer.model-C3fr4yNw.mjs +18 -0
  155. package/fesm2022/sdcorejs-angular-modules-pattern-customer.model-C3fr4yNw.mjs.map +1 -0
  156. package/fesm2022/sdcorejs-angular-modules-pattern-customer.service-Cbs05A2j.mjs +66 -0
  157. package/fesm2022/sdcorejs-angular-modules-pattern-customer.service-Cbs05A2j.mjs.map +1 -0
  158. package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-Bkk3_Lf0.mjs +148 -0
  159. package/fesm2022/sdcorejs-angular-modules-pattern-detail-side-drawer.component-Bkk3_Lf0.mjs.map +1 -0
  160. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-BIuEchUV.mjs +467 -0
  161. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-BIuEchUV.mjs.map +1 -0
  162. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CH21RSWx.mjs +172 -0
  163. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CH21RSWx.mjs.map +1 -0
  164. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CX4WWzER.mjs +90 -0
  165. package/fesm2022/sdcorejs-angular-modules-pattern-detail.component-CX4WWzER.mjs.map +1 -0
  166. package/fesm2022/sdcorejs-angular-modules-pattern-flow.component-D1kpfcf_.mjs +514 -0
  167. package/fesm2022/sdcorejs-angular-modules-pattern-flow.component-D1kpfcf_.mjs.map +1 -0
  168. package/fesm2022/sdcorejs-angular-modules-pattern-form-api-errors-DYyFPZUU.mjs +61 -0
  169. package/fesm2022/sdcorejs-angular-modules-pattern-form-api-errors-DYyFPZUU.mjs.map +1 -0
  170. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-B9vCzIT6.mjs +232 -0
  171. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-B9vCzIT6.mjs.map +1 -0
  172. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-BnROr-Wg.mjs +87 -0
  173. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-BnROr-Wg.mjs.map +1 -0
  174. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-qs8Yoxn0.mjs +170 -0
  175. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-form.component-qs8Yoxn0.mjs.map +1 -0
  176. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-view.component-Cbwdhc0Z.mjs +70 -0
  177. package/fesm2022/sdcorejs-angular-modules-pattern-general-information-view.component-Cbwdhc0Z.mjs.map +1 -0
  178. package/fesm2022/sdcorejs-angular-modules-pattern-index.component-DYphTR6C.mjs +100 -0
  179. package/fesm2022/sdcorejs-angular-modules-pattern-index.component-DYphTR6C.mjs.map +1 -0
  180. package/fesm2022/sdcorejs-angular-modules-pattern-lines-form.component-C692P-z0.mjs +522 -0
  181. package/fesm2022/sdcorejs-angular-modules-pattern-lines-form.component-C692P-z0.mjs.map +1 -0
  182. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-5sLtmhG1.mjs +71 -0
  183. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-5sLtmhG1.mjs.map +1 -0
  184. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-BIFg9bUW.mjs +629 -0
  185. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-BIFg9bUW.mjs.map +1 -0
  186. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CZ1NoLIo.mjs +115 -0
  187. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CZ1NoLIo.mjs.map +1 -0
  188. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CmZeYoF7.mjs +118 -0
  189. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-CmZeYoF7.mjs.map +1 -0
  190. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-Dy2Rkh8f.mjs +164 -0
  191. package/fesm2022/sdcorejs-angular-modules-pattern-list.component-Dy2Rkh8f.mjs.map +1 -0
  192. package/fesm2022/sdcorejs-angular-modules-pattern-mock-backend.factory-BdxQkZXW.mjs +1069 -0
  193. package/fesm2022/sdcorejs-angular-modules-pattern-mock-backend.factory-BdxQkZXW.mjs.map +1 -0
  194. package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source-viewer-BpLQaYP5.mjs +186 -0
  195. package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source-viewer-BpLQaYP5.mjs.map +1 -0
  196. package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source.generated-BrejHvB2.mjs +97 -0
  197. package/fesm2022/sdcorejs-angular-modules-pattern-pattern-source.generated-BrejHvB2.mjs.map +1 -0
  198. package/fesm2022/sdcorejs-angular-modules-pattern-product.model-BoHLJ8vf.mjs +12 -0
  199. package/fesm2022/sdcorejs-angular-modules-pattern-product.model-BoHLJ8vf.mjs.map +1 -0
  200. package/fesm2022/sdcorejs-angular-modules-pattern-product.service-BpSTfkeT.mjs +48 -0
  201. package/fesm2022/sdcorejs-angular-modules-pattern-product.service-BpSTfkeT.mjs.map +1 -0
  202. package/fesm2022/sdcorejs-angular-modules-pattern-profile.component-D3QP1i9v.mjs +293 -0
  203. package/fesm2022/sdcorejs-angular-modules-pattern-profile.component-D3QP1i9v.mjs.map +1 -0
  204. package/fesm2022/sdcorejs-angular-modules-pattern-routes-BA64XAgv.mjs +74 -0
  205. package/fesm2022/sdcorejs-angular-modules-pattern-routes-BA64XAgv.mjs.map +1 -0
  206. package/fesm2022/sdcorejs-angular-modules-pattern-routes-CWTlhZzo.mjs +50 -0
  207. package/fesm2022/sdcorejs-angular-modules-pattern-routes-CWTlhZzo.mjs.map +1 -0
  208. package/fesm2022/sdcorejs-angular-modules-pattern-routes-ClRXOw9g.mjs +165 -0
  209. package/fesm2022/sdcorejs-angular-modules-pattern-routes-ClRXOw9g.mjs.map +1 -0
  210. package/fesm2022/sdcorejs-angular-modules-pattern-routes-DYT6cDVo.mjs +45 -0
  211. package/fesm2022/sdcorejs-angular-modules-pattern-routes-DYT6cDVo.mjs.map +1 -0
  212. package/fesm2022/sdcorejs-angular-modules-pattern-routes-Dww3V1b9.mjs +43 -0
  213. package/fesm2022/sdcorejs-angular-modules-pattern-routes-Dww3V1b9.mjs.map +1 -0
  214. package/fesm2022/sdcorejs-angular-modules-pattern-routes-HwJm344-.mjs +74 -0
  215. package/fesm2022/sdcorejs-angular-modules-pattern-routes-HwJm344-.mjs.map +1 -0
  216. package/fesm2022/sdcorejs-angular-modules-pattern-routes-ZkBSRFv_.mjs +99 -0
  217. package/fesm2022/sdcorejs-angular-modules-pattern-routes-ZkBSRFv_.mjs.map +1 -0
  218. package/fesm2022/sdcorejs-angular-modules-pattern-routes-px1VU73r.mjs +66 -0
  219. package/fesm2022/sdcorejs-angular-modules-pattern-routes-px1VU73r.mjs.map +1 -0
  220. package/fesm2022/sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-BSDQaT9e.mjs +406 -0
  221. package/fesm2022/sdcorejs-angular-modules-pattern-sdcorejs-angular-modules-pattern-BSDQaT9e.mjs.map +1 -0
  222. package/fesm2022/sdcorejs-angular-modules-pattern-shell.component-2EN7PuIE.mjs +317 -0
  223. package/fesm2022/sdcorejs-angular-modules-pattern-shell.component-2EN7PuIE.mjs.map +1 -0
  224. package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-Crg1J2V5.mjs +132 -0
  225. package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-Crg1J2V5.mjs.map +1 -0
  226. package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-LIBiOZLn.mjs +143 -0
  227. package/fesm2022/sdcorejs-angular-modules-pattern-update-side-drawer.component-LIBiOZLn.mjs.map +1 -0
  228. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-4Mm8-ehz.mjs +128 -0
  229. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-4Mm8-ehz.mjs.map +1 -0
  230. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-ClEGOr5D.mjs +357 -0
  231. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-ClEGOr5D.mjs.map +1 -0
  232. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-CoGA7wxY.mjs +100 -0
  233. package/fesm2022/sdcorejs-angular-modules-pattern-update.component-CoGA7wxY.mjs.map +1 -0
  234. package/fesm2022/sdcorejs-angular-modules-pattern.mjs +2 -0
  235. package/fesm2022/sdcorejs-angular-modules-pattern.mjs.map +1 -0
  236. package/fesm2022/sdcorejs-angular-modules.mjs +1 -0
  237. package/fesm2022/sdcorejs-angular-modules.mjs.map +1 -1
  238. package/fesm2022/sdcorejs-angular-pipes.mjs +27 -7
  239. package/fesm2022/sdcorejs-angular-pipes.mjs.map +1 -1
  240. package/fesm2022/sdcorejs-angular-services-confirm.mjs +1 -1
  241. package/fesm2022/sdcorejs-angular-services-confirm.mjs.map +1 -1
  242. package/fesm2022/sdcorejs-angular-services-date-time.mjs +143 -0
  243. package/fesm2022/sdcorejs-angular-services-date-time.mjs.map +1 -0
  244. package/fesm2022/sdcorejs-angular-services-storage.mjs +44 -8
  245. package/fesm2022/sdcorejs-angular-services-storage.mjs.map +1 -1
  246. package/fesm2022/sdcorejs-angular-services-unsaved-changes.mjs +104 -4
  247. package/fesm2022/sdcorejs-angular-services-unsaved-changes.mjs.map +1 -1
  248. package/fesm2022/sdcorejs-angular-services.mjs +1 -0
  249. package/fesm2022/sdcorejs-angular-services.mjs.map +1 -1
  250. package/fesm2022/sdcorejs-angular-utilities-read-state.mjs +4 -0
  251. package/fesm2022/sdcorejs-angular-utilities-read-state.mjs.map +1 -1
  252. package/fesm2022/sdcorejs-angular-utilities-theme.mjs +10 -0
  253. package/fesm2022/sdcorejs-angular-utilities-theme.mjs.map +1 -1
  254. package/modules/pattern/README.md +76 -0
  255. package/modules/pattern/docs/detail.md +237 -0
  256. package/modules/pattern/docs/drawer.md +484 -0
  257. package/modules/pattern/docs/flow.md +631 -0
  258. package/modules/pattern/docs/form.md +518 -0
  259. package/modules/pattern/docs/header-actions.md +342 -0
  260. package/modules/pattern/docs/list.md +247 -0
  261. package/modules/pattern/docs/relation.md +180 -0
  262. package/modules/pattern/docs/select.md +206 -0
  263. package/modules/pattern/docs/split.md +350 -0
  264. package/modules/pattern/docs/states.md +168 -0
  265. package/modules/pattern/features/approval/entity.resolver.ts +21 -0
  266. package/modules/pattern/features/approval/pages/detail/detail.component.ts +139 -0
  267. package/modules/pattern/features/approval/pages/list/approval-inbox.ts +7 -0
  268. package/modules/pattern/features/approval/pages/list/list.component.html +20 -0
  269. package/modules/pattern/features/approval/pages/list/list.component.ts +149 -0
  270. package/modules/pattern/features/approval/routes.ts +30 -0
  271. package/modules/pattern/features/approval/services/approval.model.ts +38 -0
  272. package/modules/pattern/features/approval/services/approval.service.ts +23 -0
  273. package/modules/pattern/features/category/components/create-side-drawer/create-side-drawer.component.ts +123 -0
  274. package/modules/pattern/features/category/components/general-information-form/general-information-form.component.ts +61 -0
  275. package/modules/pattern/features/category/components/update-side-drawer/update-side-drawer.component.ts +134 -0
  276. package/modules/pattern/features/category/entity.resolver.ts +27 -0
  277. package/modules/pattern/features/category/pages/list/list.component.html +20 -0
  278. package/modules/pattern/features/category/pages/list/list.component.ts +105 -0
  279. package/modules/pattern/features/category/routes.ts +42 -0
  280. package/modules/pattern/features/category/services/category.model.ts +39 -0
  281. package/modules/pattern/features/category/services/category.service.ts +36 -0
  282. package/modules/pattern/features/customer/components/create-side-drawer/create-side-drawer.component.ts +131 -0
  283. package/modules/pattern/features/customer/components/customer-select/customer-select.component.ts +72 -0
  284. package/modules/pattern/features/customer/components/customer-type-select/customer-type-select.component.ts +30 -0
  285. package/modules/pattern/features/customer/components/debts-view/debts-view.component.ts +28 -0
  286. package/modules/pattern/features/customer/components/detail-side-drawer/detail-side-drawer.component.ts +106 -0
  287. package/modules/pattern/features/customer/components/documents-view/documents-view.component.ts +50 -0
  288. package/modules/pattern/features/customer/components/general-information-form/general-information-form.component.ts +140 -0
  289. package/modules/pattern/features/customer/components/general-information-view/general-information-view.component.ts +39 -0
  290. package/modules/pattern/features/customer/components/orders-view/orders-view.component.ts +35 -0
  291. package/modules/pattern/features/customer/components/summary-cards/summary-cards.component.ts +101 -0
  292. package/modules/pattern/features/customer/components/update-side-drawer/update-side-drawer.component.ts +127 -0
  293. package/modules/pattern/features/customer/entity.resolver.ts +21 -0
  294. package/modules/pattern/features/customer/pages/list/list.component.html +22 -0
  295. package/modules/pattern/features/customer/pages/list/list.component.ts +113 -0
  296. package/modules/pattern/features/customer/pages/profile/profile.component.ts +120 -0
  297. package/modules/pattern/features/customer/pipes/customer-detail.pipe.ts +18 -0
  298. package/modules/pattern/features/customer/routes.ts +59 -0
  299. package/modules/pattern/features/customer/services/customer.model.ts +87 -0
  300. package/modules/pattern/features/customer/services/customer.service.ts +79 -0
  301. package/modules/pattern/features/import/components/mapping-form/mapping-form.component.ts +41 -0
  302. package/modules/pattern/features/import/components/preview-view/preview-view.component.ts +44 -0
  303. package/modules/pattern/features/import/pages/flow/flow.component.ts +269 -0
  304. package/modules/pattern/features/import/routes.ts +19 -0
  305. package/modules/pattern/features/import/services/import.model.ts +82 -0
  306. package/modules/pattern/features/import/services/import.service.ts +18 -0
  307. package/modules/pattern/features/order/components/approval-steps/approval-steps.component.ts +74 -0
  308. package/modules/pattern/features/order/components/bulk-result/bulk-result.component.ts +46 -0
  309. package/modules/pattern/features/order/components/general-information-form/general-information-form.component.ts +96 -0
  310. package/modules/pattern/features/order/components/lines-form/lines-form.component.ts +205 -0
  311. package/modules/pattern/features/order/components/lines-view/lines-view.component.ts +42 -0
  312. package/modules/pattern/features/order/components/summary-cards/summary-cards.component.ts +128 -0
  313. package/modules/pattern/features/order/entity.resolver.ts +37 -0
  314. package/modules/pattern/features/order/pages/create/create.component.ts +99 -0
  315. package/modules/pattern/features/order/pages/detail/detail.component.ts +222 -0
  316. package/modules/pattern/features/order/pages/list/list.component.html +38 -0
  317. package/modules/pattern/features/order/pages/list/list.component.ts +291 -0
  318. package/modules/pattern/features/order/pages/update/update.component.ts +119 -0
  319. package/modules/pattern/features/order/routes.ts +54 -0
  320. package/modules/pattern/features/order/services/order.model.ts +109 -0
  321. package/modules/pattern/features/order/services/order.service.ts +63 -0
  322. package/modules/pattern/features/partner/pages/create/create.component.ts +324 -0
  323. package/modules/pattern/features/partner/routes.ts +20 -0
  324. package/modules/pattern/features/partner/services/partner.model.ts +30 -0
  325. package/modules/pattern/features/partner/services/partner.service.ts +17 -0
  326. package/modules/pattern/features/product/components/general-information-form/general-information-form.component.ts +88 -0
  327. package/modules/pattern/features/product/components/product-select/product-select.component.ts +65 -0
  328. package/modules/pattern/features/product/components/product-status-select/product-status-select.component.ts +30 -0
  329. package/modules/pattern/features/product/entity.resolver.ts +21 -0
  330. package/modules/pattern/features/product/pages/create/create.component.ts +85 -0
  331. package/modules/pattern/features/product/pages/detail/detail.component.ts +53 -0
  332. package/modules/pattern/features/product/pages/list/list.component.html +30 -0
  333. package/modules/pattern/features/product/pages/list/list.component.ts +71 -0
  334. package/modules/pattern/features/product/pages/update/update.component.ts +86 -0
  335. package/modules/pattern/features/product/pipes/product-detail.pipe.ts +18 -0
  336. package/modules/pattern/features/product/routes.ts +48 -0
  337. package/modules/pattern/features/product/services/product.model.ts +38 -0
  338. package/modules/pattern/features/product/services/product.service.ts +48 -0
  339. package/modules/pattern/features/settings/pages/update/update.component.ts +227 -0
  340. package/modules/pattern/features/settings/routes.ts +24 -0
  341. package/modules/pattern/features/settings/services/settings.model.ts +18 -0
  342. package/modules/pattern/features/settings/services/settings.service.ts +15 -0
  343. package/modules/pattern/features/settings/settings.resolver.ts +8 -0
  344. package/package.json +44 -7
  345. package/types/sdcorejs-angular-components-avatar.d.ts +67 -2
  346. package/types/sdcorejs-angular-components-badge.d.ts +206 -6
  347. package/types/sdcorejs-angular-components-button.d.ts +20 -1
  348. package/types/sdcorejs-angular-components-ckeditor-styles.d.ts +3 -18
  349. package/types/sdcorejs-angular-components-editor-engine.d.ts +246 -0
  350. package/types/sdcorejs-angular-components-editor.d.ts +20 -17
  351. package/types/sdcorejs-angular-components-file-explorer.d.ts +4 -2
  352. package/types/sdcorejs-angular-components-form-generic.d.ts +246 -35
  353. package/types/sdcorejs-angular-components-mini-editor.d.ts +33 -70
  354. package/types/sdcorejs-angular-components-modal-resizable.d.ts +1 -124
  355. package/types/sdcorejs-angular-components-operator.d.ts +137 -8
  356. package/types/sdcorejs-angular-components-section.d.ts +13 -1
  357. package/types/sdcorejs-angular-components-splitter.d.ts +1 -1
  358. package/types/sdcorejs-angular-components-tab-router.d.ts +74 -19
  359. package/types/sdcorejs-angular-components-table.d.ts +210 -18
  360. package/types/sdcorejs-angular-components-upload-file.d.ts +181 -21
  361. package/types/sdcorejs-angular-components-window.d.ts +81 -0
  362. package/types/sdcorejs-angular-components.d.ts +1 -0
  363. package/types/sdcorejs-angular-configurations.d.ts +8 -1
  364. package/types/sdcorejs-angular-forms-autocomplete.d.ts +5 -0
  365. package/types/sdcorejs-angular-forms-chip-calendar.d.ts +163 -18
  366. package/types/sdcorejs-angular-forms-chip.d.ts +136 -26
  367. package/types/sdcorejs-angular-forms-date-range.d.ts +24 -2
  368. package/types/sdcorejs-angular-forms-date.d.ts +23 -2
  369. package/types/sdcorejs-angular-forms-directives.d.ts +47 -2
  370. package/types/sdcorejs-angular-forms-input-number.d.ts +23 -2
  371. package/types/sdcorejs-angular-forms-input.d.ts +23 -2
  372. package/types/sdcorejs-angular-forms-models.d.ts +38 -3
  373. package/types/sdcorejs-angular-forms-select.d.ts +32 -2
  374. package/types/sdcorejs-angular-i18n.d.ts +344 -2
  375. package/types/sdcorejs-angular-modules-generic.d.ts +316 -0
  376. package/types/sdcorejs-angular-modules-icon.d.ts +37 -6
  377. package/types/sdcorejs-angular-modules-layout.d.ts +622 -89
  378. package/types/sdcorejs-angular-modules-pattern.d.ts +50 -0
  379. package/types/sdcorejs-angular-modules.d.ts +1 -0
  380. package/types/sdcorejs-angular-pipes.d.ts +2 -0
  381. package/types/sdcorejs-angular-services-date-time.d.ts +57 -0
  382. package/types/sdcorejs-angular-services-storage.d.ts +8 -1
  383. package/types/sdcorejs-angular-services-unsaved-changes.d.ts +11 -0
  384. package/types/sdcorejs-angular-services.d.ts +1 -0
  385. package/types/sdcorejs-angular-utilities-read-state.d.ts +2 -0
  386. package/types/sdcorejs-angular-utilities-theme.d.ts +1 -1
@@ -1,12 +1,18 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ElementRef, input, booleanAttribute, effect, Component, InjectionToken, Injectable, signal, computed, Pipe, DestroyRef, viewChild, output, isSignal, ChangeDetectionStrategy, untracked, model, NgModule } from '@angular/core';
2
+ import { inject, ElementRef, NgZone, DestroyRef, Injector, input, booleanAttribute, computed, signal, viewChild, effect, afterNextRender, isDevMode, forwardRef, ChangeDetectionStrategy, Component, InjectionToken, Injectable, Pipe, ViewContainerRef, untracked, output, isSignal, model, ChangeDetectorRef, NgModule } from '@angular/core';
3
3
  import * as i2 from '@angular/common';
4
- import { DOCUMENT, CommonModule, NgTemplateOutlet } from '@angular/common';
4
+ import { DOCUMENT, NgTemplateOutlet, CommonModule } from '@angular/common';
5
5
  import * as i1$3 from '@angular/router';
6
- import { Router, NavigationEnd, RouterModule, ActivatedRoute } from '@angular/router';
6
+ import { RouterLink, RouterOutlet, Router, NavigationEnd, RouterModule, NavigationSkipped, ActivatedRoute } from '@angular/router';
7
7
  import { __decorate } from 'tslib';
8
8
  import { SdAvatar, SdTabComponent, SdButton } from '@sdcorejs/angular/components';
9
- import { I18nService, I18N_STORAGE_KEY, I18N_MESSAGES, SdTranslatePipe } from '@sdcorejs/angular/i18n';
9
+ import { SdTranslatePipe, I18nService, I18N_STORAGE_KEY, I18N_MESSAGES } from '@sdcorejs/angular/i18n';
10
+ import { SdBadge } from '@sdcorejs/angular/components/badge';
11
+ import { SD_SECTION_REGISTRY } from '@sdcorejs/angular/components/section';
12
+ import { SdIcon, SD_ICON_CONFIGURATION } from '@sdcorejs/angular/modules/icon';
13
+ import { SdConfirmService } from '@sdcorejs/angular/services/confirm';
14
+ import { SdUnsavedChangesService } from '@sdcorejs/angular/services/unsaved-changes';
15
+ import { SD_TABLE_LAYOUT } from '@sdcorejs/angular/components/table';
10
16
  import { SdStorageService } from '@sdcorejs/angular/services';
11
17
  import { StringUtilities, Utilities } from '@sdcorejs/utils/fns';
12
18
  import { SD_VIEWPORT, SdViewportService } from '@sdcorejs/angular/services/viewport';
@@ -24,31 +30,282 @@ import { MatTooltipModule } from '@angular/material/tooltip';
24
30
  import * as i3 from '@angular/material/tree';
25
31
  import { MatTreeNestedDataSource, MatTreeModule } from '@angular/material/tree';
26
32
  import { SdSafeHtmlPipe } from '@sdcorejs/angular/pipes';
27
- import { SdIcon } from '@sdcorejs/angular/modules/icon';
33
+ import * as i1$2 from '@angular/cdk/a11y';
34
+ import { CdkTrapFocus, A11yModule } from '@angular/cdk/a11y';
35
+ import { Overlay, CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay';
36
+ import { TemplatePortal } from '@angular/cdk/portal';
28
37
  import { isObservable } from 'rxjs';
29
38
  import { SdInput } from '@sdcorejs/angular/forms';
30
- import * as i1$2 from '@angular/cdk/a11y';
31
- import { A11yModule } from '@angular/cdk/a11y';
32
39
 
40
+ const SD_PAGE_MAX_BADGES = 2;
41
+ // why: một component cho cả ba selector, mặc định khác nhau theo tên thẻ host.
42
+ const SD_PAGE_DEFAULT_WIDTH = {
43
+ 'sd-page': 'full',
44
+ 'sd-page-detail': 'wide',
45
+ 'sd-page-form': 'medium',
46
+ };
33
47
  class SdPageComponent {
34
48
  el = inject(ElementRef);
49
+ #zone = inject(NgZone);
50
+ #destroyRef = inject(DestroyRef);
51
+ #injector = inject(Injector);
52
+ #defaultWidth = SD_PAGE_DEFAULT_WIDTH[this.el.nativeElement.tagName.toLowerCase()] ?? 'full';
35
53
  title = input('', { ...(ngDevMode ? { debugName: "title" } : /* istanbul ignore next */ {}), alias: 'title' });
36
54
  description = input('', { ...(ngDevMode ? { debugName: "description" } : /* istanbul ignore next */ {}), alias: 'description' });
37
55
  noHeader = input(false, { ...(ngDevMode ? { debugName: "noHeader" } : /* istanbul ignore next */ {}), transform: booleanAttribute, alias: 'noHeader' });
56
+ /** Hiện nút ← trước title; title, description và badges vẫn lấy từ input. */
57
+ backLink = input(...(ngDevMode ? [undefined, { debugName: "backLink" }] : /* istanbul ignore next */ []));
58
+ /** Tối đa 2 badge cạnh title: trạng thái trước, thuộc tính sau. Badge không có `title` bị bỏ qua. */
59
+ badges = input(...(ngDevMode ? [undefined, { debugName: "badges" }] : /* istanbul ignore next */ []));
60
+ /** `null` / không truyền thì lấy mặc định theo selector: `sd-page` full · `sd-page-detail` wide · `sd-page-form` medium. */
61
+ width = input(...(ngDevMode ? [undefined, { debugName: "width" }] : /* istanbul ignore next */ []));
62
+ /** Cột phụ ở cuối (mặc định) hay ở đầu. Viewport < 1200px thì cột phụ luôn xuống dưới nội dung. */
63
+ aside = input(...(ngDevMode ? [undefined, { debugName: "aside" }] : /* istanbul ignore next */ []));
64
+ /** Mục lục ở cột phụ, liệt kê các `sd-section` có `title` ở cấp ngoài cùng của thân trang. */
65
+ toc = input(false, { ...(ngDevMode ? { debugName: "toc" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
66
+ resolvedWidth = computed(() => this.width() ?? this.#defaultWidth, ...(ngDevMode ? [{ debugName: "resolvedWidth" }] : /* istanbul ignore next */ []));
67
+ visibleBadges = computed(() => (this.badges() ?? []).filter(badge => badge.title !== null && badge.title !== undefined && badge.title !== ''), ...(ngDevMode ? [{ debugName: "visibleBadges" }] : /* istanbul ignore next */ []));
68
+ /** Header có nút ← hoặc badge: title một dòng, cắt bằng dấu "…". Màn cũ giữ title xuống dòng như trước. */
69
+ hasLead = computed(() => !!this.backLink() || this.visibleBadges().length > 0, ...(ngDevMode ? [{ debugName: "hasLead" }] : /* istanbul ignore next */ []));
70
+ // why: section tự đăng ký qua SD_SECTION_REGISTRY, kể cả section nằm trong component con của thân trang (form
71
+ // tách theo nhóm), điều mà contentChildren không thấy được.
72
+ #sections = signal([], ...(ngDevMode ? [{ debugName: "#sections" }] : /* istanbul ignore next */ []));
73
+ // why: section lồng được chèn vào section cha khi view của section cha render, tức sau template của sd-page,
74
+ // nên danh sách tính lại sau mỗi lần render chứ không tính ngay trong computed.
75
+ tocItems = signal([], ...(ngDevMode ? [{ debugName: "tocItems" }] : /* istanbul ignore next */ []));
76
+ activeTocIndex = signal(0, ...(ngDevMode ? [{ debugName: "activeTocIndex" }] : /* istanbul ignore next */ []));
77
+ // why: fallback của slot headerLeft chỉ render khi không có headerLeft/sdHeaderLeft, nên vắng nó nghĩa là
78
+ // vùng trái đã bị thay và backLink không có chỗ hiện.
79
+ titleBlock = viewChild('titleBlock', ...(ngDevMode ? [{ debugName: "titleBlock" }] : /* istanbul ignore next */ []));
80
+ wrapper = viewChild.required('wrapper');
38
81
  constructor() {
39
82
  effect(() => {
40
83
  if (this.title()) {
41
84
  this.el.nativeElement.removeAttribute('title');
42
85
  }
43
86
  });
87
+ effect(() => {
88
+ const enabled = this.toc();
89
+ const entries = this.#sections().map(entry => ({ title: entry.section.title(), el: entry.el }));
90
+ afterNextRender(() => this.tocItems.set(enabled ? this.#collectToc(entries) : []), { injector: this.#injector });
91
+ });
92
+ afterNextRender(() => {
93
+ const wrapper = this.wrapper().nativeElement;
94
+ const onScroll = () => this.#syncActiveToc();
95
+ // why: scroll bắn liên tục; chỉ signal đổi mới cần render lại, không cần chạy change detection mỗi lần.
96
+ this.#zone.runOutsideAngular(() => wrapper.addEventListener('scroll', onScroll, { passive: true }));
97
+ this.#destroyRef.onDestroy(() => wrapper.removeEventListener('scroll', onScroll));
98
+ });
99
+ if (isDevMode()) {
100
+ effect(() => {
101
+ const badges = this.badges() ?? [];
102
+ const types = badges.map(badge => badge.type ?? 'round');
103
+ if (badges.length > SD_PAGE_MAX_BADGES || new Set(types).size !== types.length) {
104
+ console.warn(`[sd-page] badges nhận tối đa ${SD_PAGE_MAX_BADGES} badge và không trùng type (mặc định 'round'): badge đầu là trạng thái, badge sau là thuộc tính. Đang có: ${JSON.stringify(types)}.`);
105
+ }
106
+ });
107
+ effect(() => {
108
+ const backLink = this.backLink();
109
+ const noHeader = this.noHeader();
110
+ // why: the effect of a routed page runs before its view exists, when titleBlock is still undefined; read it
111
+ // after render, or every page with a backLink warns once.
112
+ afterNextRender(() => {
113
+ if (backLink && !noHeader && !this.titleBlock()) {
114
+ console.warn('[sd-page] backLink bị bỏ qua vì headerLeft/sdHeaderLeft đã thay cả vùng trái của header.');
115
+ }
116
+ }, { injector: this.#injector });
117
+ });
118
+ }
119
+ }
120
+ /** Cuộn tới section của mục lục thứ `index`. */
121
+ scrollToSection(index) {
122
+ const item = this.tocItems()[index];
123
+ if (!item)
124
+ return;
125
+ this.activeTocIndex.set(index);
126
+ const reduceMotion = typeof matchMedia === 'function' && matchMedia('(prefers-reduced-motion: reduce)').matches;
127
+ item.el.scrollIntoView({ block: 'start', behavior: reduceMotion ? 'auto' : 'smooth' });
128
+ }
129
+ /** Thêm một section ngoài cùng của thân trang vào mục lục (gọi bởi `sd-section`). */
130
+ register(section, el) {
131
+ this.#sections.update(entries => [...entries, { section, el }]);
132
+ return () => this.#sections.update(entries => entries.filter(entry => entry.section !== section));
133
+ }
134
+ #collectToc(entries) {
135
+ const content = this.el.nativeElement.querySelector(':scope > .c-page-wrapper > .c-page-content');
136
+ return entries
137
+ .filter((entry) => !!entry.title && !!content?.contains(entry.el))
138
+ .sort((left, right) => (left.el.compareDocumentPosition(right.el) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1));
139
+ }
140
+ #syncActiveToc() {
141
+ const items = this.tocItems();
142
+ if (!items.length)
143
+ return;
144
+ const wrapper = this.wrapper().nativeElement;
145
+ // why: cuộn tới đáy thì section cuối có thể không bao giờ chạm mép trên; khi đó nó là section đang đọc.
146
+ if (wrapper.scrollTop + wrapper.clientHeight >= wrapper.scrollHeight - 1) {
147
+ this.activeTocIndex.set(items.length - 1);
148
+ return;
149
+ }
150
+ const top = wrapper.getBoundingClientRect().top;
151
+ let active = 0;
152
+ items.forEach((item, index) => {
153
+ if (item.el.getBoundingClientRect().top - top <= 8)
154
+ active = index;
155
+ });
156
+ this.activeTocIndex.set(active);
44
157
  }
45
158
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdPageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
46
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdPageComponent, isStandalone: true, selector: "sd-page", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, noHeader: { classPropertyName: "noHeader", publicName: "noHeader", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (!noHeader()) {\n <div class=\"c-page-header bg-white\">\n <div class=\"p-16 d-flex align-items-center w-full justify-content-between\">\n <div class=\"d-flex\">\n <ng-content select=\"[headerLeft]\">\n <div class=\"d-flex flex-column\">\n <div class=\"T20M\">{{ title() }}</div>\n @if (description()) {\n <div class=\"T14R text-secondary mt-4\">{{ description() }}</div>\n }\n </div>\n </ng-content>\n </div>\n <ng-content select=\"[headerRight]\"></ng-content>\n </div>\n </div>\n}\n\n<div class=\"c-page-wrapper px-0\">\n <div class=\"c-page-content\">\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [":host{height:100%;display:flex;flex-direction:column;background-color:var(--sd-page-bg, #f9f9f9)}.c-page-header{box-shadow:0 1px 2px 0 var(--sd-page-shadow, rgba(47, 49, 54, .1019607843));z-index:1;position:relative}.c-page-wrapper{flex:1;display:flex;flex-direction:row;width:100%;overflow-y:auto;max-height:100vh}.c-page-wrapper .c-page-content{flex:1;height:100%;width:100%}.c-page-wrapper .c-page-right{position:-webkit-sticky;position:sticky;top:0;height:100%;overflow-y:auto}\n"] });
159
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdPageComponent, isStandalone: true, selector: "sd-page, sd-page-detail, sd-page-form", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, noHeader: { classPropertyName: "noHeader", publicName: "noHeader", isSignal: true, isRequired: false, transformFunction: null }, backLink: { classPropertyName: "backLink", publicName: "backLink", isSignal: true, isRequired: false, transformFunction: null }, badges: { classPropertyName: "badges", publicName: "badges", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, aside: { classPropertyName: "aside", publicName: "aside", isSignal: true, isRequired: false, transformFunction: null }, toc: { classPropertyName: "toc", publicName: "toc", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.sd-page--wide": "resolvedWidth() === 'wide'", "class.sd-page--medium": "resolvedWidth() === 'medium'", "class.sd-page--narrow": "resolvedWidth() === 'narrow'", "class.sd-page--aside-start": "aside() === 'start'" } }, providers: [{ provide: SD_SECTION_REGISTRY, useExisting: forwardRef(() => SdPageComponent) }], viewQueries: [{ propertyName: "titleBlock", first: true, predicate: ["titleBlock"], descendants: true, isSignal: true }, { propertyName: "wrapper", first: true, predicate: ["wrapper"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _backLink = backLink();\n@let _badges = visibleBadges();\n@let _hasLead = hasLead();\n@if (!noHeader()) {\n <header class=\"c-page-header bg-white\">\n <div class=\"p-16 d-flex align-items-center w-full justify-content-between\">\n <div class=\"d-flex\" [class.c-page-lead]=\"_hasLead\">\n <ng-content select=\"[headerLeft],[sdHeaderLeft]\">\n @if (_backLink) {\n <a class=\"c-page-back\" [routerLink]=\"_backLink\" [attr.aria-label]=\"'core.common.back' | sdTranslate\">\n <sd-icon name=\"arrow_back\"></sd-icon>\n </a>\n }\n <div #titleBlock class=\"d-flex flex-column\" [class.c-page-title-block]=\"_hasLead\">\n @if (_badges.length) {\n <div class=\"c-page-title-row\">\n <h1 class=\"T20M c-page-title\">{{ title() }}</h1>\n @for (badge of _badges; track $index) {\n <sd-badge\n size=\"md\"\n [type]=\"badge.type ?? 'round'\"\n [color]=\"badge.color\"\n [icon]=\"badge.icon\"\n [title]=\"badge.title\"\n [label]=\"badge.label\"\n [tooltip]=\"badge.tooltip\"></sd-badge>\n }\n </div>\n } @else {\n <h1 class=\"T20M\" [class.c-page-title]=\"_hasLead\">{{ title() }}</h1>\n }\n @if (description()) {\n <div class=\"T14R text-secondary mt-4\">{{ description() }}</div>\n }\n </div>\n </ng-content>\n </div>\n <ng-content select=\"[headerRight],[sdHeaderRight]\"></ng-content>\n </div>\n <ng-content select=\"[sdSubheader]\"></ng-content>\n </header>\n}\n\n<!-- why: px-0 l\u00E0 utility !important; c\u1ED9t c\u00F3 gi\u1EDBi h\u1EA1n b\u1EC1 r\u1ED9ng c\u1EA7n padding ri\u00EAng n\u00EAn b\u1ECF n\u00F3 \u0111i. -->\n<div #wrapper class=\"c-page-wrapper\" [class.px-0]=\"resolvedWidth() === 'full'\">\n <div class=\"c-page-content\">\n <ng-content></ng-content>\n </div>\n <ng-content select=\"[sdAside]\"></ng-content>\n @let _tocItems = tocItems();\n @if (_tocItems.length) {\n @let _activeToc = activeTocIndex();\n <nav class=\"c-page-toc\" [attr.aria-label]=\"'core.module.layout.page.toc' | sdTranslate\">\n @for (item of _tocItems; track item.el; let index = $index) {\n <button\n type=\"button\"\n class=\"c-page-toc-item\"\n [class.active]=\"index === _activeToc\"\n [attr.aria-current]=\"index === _activeToc ? 'true' : null\"\n (click)=\"scrollToSection(index)\">\n {{ item.title }}\n </button>\n }\n </nav>\n }\n</div>\n\n<!-- why: footer ch\u1EC9 c\u00F3 hai slot chi\u1EBFu th\u1EB3ng v\u00E0o, kh\u00F4ng c\u00F3 wrapper, n\u00EAn CSS :empty \u1EA9n n\u00F3 khi m\u00E0n kh\u00F4ng d\u00F9ng footer. -->\n<footer class=\"c-page-footer\" role=\"group\" [attr.aria-label]=\"'core.module.layout.page.actions' | sdTranslate\">\n <ng-content select=\"[sdFooterLeft]\"></ng-content>\n <ng-content select=\"[sdFooterRight]\"></ng-content>\n</footer>\n", styles: [":host{height:100%;display:flex;flex-direction:column;background-color:var(--sd-page-bg, #f9f9f9)}:host(.sd-page--wide){--sd-page-column-max: 1200px}:host(.sd-page--medium){--sd-page-column-max: 960px}:host(.sd-page--narrow){--sd-page-column-max: 720px}.c-page-header{box-shadow:0 1px 2px 0 var(--sd-page-shadow, rgba(47, 49, 54, .1019607843));z-index:1;position:relative}.c-page-header h1{margin:0}.c-page-lead{align-items:center;gap:12px;min-width:0}.c-page-title-block{min-width:0}.c-page-title-row{display:flex;align-items:center;gap:8px;min-width:0}.c-page-title-row sd-badge{flex:none}.c-page-title{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.c-page-back{flex:none;display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;color:var(--sd-page-back-fg, #44474e);text-decoration:none}.c-page-back:hover{background-color:var(--sd-page-back-hover-bg, #eceef2)}.c-page-back:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.c-page-header ::ng-deep>[sdSubheader]{display:block;border-top:1px solid var(--sd-page-divider, #eceef2)}:host(.sd-page--wide)>.c-page-wrapper,:host(.sd-page--medium)>.c-page-wrapper,:host(.sd-page--narrow)>.c-page-wrapper{padding:16px max(24px,(100% - var(--sd-page-column-max)) / 2 + 24px)}:host(.sd-page--wide)>.c-page-header ::ng-deep>[sdSubheader],:host(.sd-page--medium)>.c-page-header ::ng-deep>[sdSubheader],:host(.sd-page--narrow)>.c-page-header ::ng-deep>[sdSubheader]{padding-inline:max(24px,(100% - var(--sd-page-column-max)) / 2 + 24px)}:host(.sd-page--wide)>.c-page-footer,:host(.sd-page--medium)>.c-page-footer,:host(.sd-page--narrow)>.c-page-footer{padding-inline:max(24px,(100% - var(--sd-page-column-max)) / 2 + 24px)}.c-page-wrapper{flex:1;display:flex;flex-direction:row;width:100%;overflow-y:auto;max-height:100vh;box-sizing:border-box}.c-page-wrapper .c-page-content{flex:1;height:100%;width:100%}.c-page-wrapper .c-page-right{position:-webkit-sticky;position:sticky;top:0;height:100%;overflow-y:auto}:host ::ng-deep>.c-page-wrapper:has(>[sdAside]),:host ::ng-deep>.c-page-wrapper:has(>.c-page-toc){gap:16px}:host ::ng-deep>.c-page-wrapper:has(>[sdAside])>.c-page-content,:host ::ng-deep>.c-page-wrapper:has(>.c-page-toc)>.c-page-content{min-width:0}.c-page-wrapper ::ng-deep>[sdAside],.c-page-wrapper>.c-page-toc{flex:0 0 320px;width:320px;box-sizing:border-box;align-self:flex-start;position:sticky;top:0;max-height:100%;overflow-y:auto}@media(min-width:1200px){:host(.sd-page--aside-start) ::ng-deep>.c-page-wrapper>[sdAside],:host(.sd-page--aside-start)>.c-page-wrapper>.c-page-toc{order:-1}}.c-page-toc{display:flex;flex-direction:column}.c-page-toc-item{padding:8px 24px;border:0;border-left:2px solid var(--sd-secondary-light);background:transparent;color:var(--sd-text);font:inherit;text-align:left;cursor:pointer}.c-page-toc-item.active{border-left-color:var(--sd-primary);color:var(--sd-primary);font-weight:var(--sd-font-weight-bold, 700)}.c-page-toc-item:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:-2px}@media(max-width:1199.98px){.c-page-wrapper>.c-page-toc{display:none}:host ::ng-deep>.c-page-wrapper:has(>[sdAside]){flex-direction:column}:host ::ng-deep>.c-page-wrapper:has(>[sdAside])>.c-page-content{flex:none;height:auto}.c-page-wrapper ::ng-deep>[sdAside]{flex:none;width:auto;align-self:stretch;position:static;max-height:none;overflow-y:visible}}.c-page-footer{flex:none;display:flex;align-items:center;gap:8px;padding:12px 16px;border-top:1px solid var(--sd-page-divider, #eceef2);background-color:var(--sd-surface, #ffffff)}.c-page-footer:empty{display:none}.c-page-footer ::ng-deep>[sdFooterRight]{margin-left:auto}.c-page-footer ::ng-deep>[sdFooterRight]~[sdFooterRight]{margin-left:0}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: SdBadge, selector: "sd-badge", inputs: ["type", "color", "primary", "secondary", "success", "info", "warning", "error", "fontSet", "title", "label", "description", "tooltip", "icon", "size", "pulse"], outputs: ["click"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
47
160
  }
48
161
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdPageComponent, decorators: [{
49
162
  type: Component,
50
- args: [{ selector: 'sd-page', template: "@if (!noHeader()) {\n <div class=\"c-page-header bg-white\">\n <div class=\"p-16 d-flex align-items-center w-full justify-content-between\">\n <div class=\"d-flex\">\n <ng-content select=\"[headerLeft]\">\n <div class=\"d-flex flex-column\">\n <div class=\"T20M\">{{ title() }}</div>\n @if (description()) {\n <div class=\"T14R text-secondary mt-4\">{{ description() }}</div>\n }\n </div>\n </ng-content>\n </div>\n <ng-content select=\"[headerRight]\"></ng-content>\n </div>\n </div>\n}\n\n<div class=\"c-page-wrapper px-0\">\n <div class=\"c-page-content\">\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [":host{height:100%;display:flex;flex-direction:column;background-color:var(--sd-page-bg, #f9f9f9)}.c-page-header{box-shadow:0 1px 2px 0 var(--sd-page-shadow, rgba(47, 49, 54, .1019607843));z-index:1;position:relative}.c-page-wrapper{flex:1;display:flex;flex-direction:row;width:100%;overflow-y:auto;max-height:100vh}.c-page-wrapper .c-page-content{flex:1;height:100%;width:100%}.c-page-wrapper .c-page-right{position:-webkit-sticky;position:sticky;top:0;height:100%;overflow-y:auto}\n"] }]
51
- }], ctorParameters: () => [], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], noHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "noHeader", required: false }] }] } });
163
+ args: [{ selector: 'sd-page, sd-page-detail, sd-page-form', changeDetection: ChangeDetectionStrategy.OnPush, imports: [RouterLink, SdBadge, SdIcon, SdTranslatePipe], host: {
164
+ '[class.sd-page--wide]': "resolvedWidth() === 'wide'",
165
+ '[class.sd-page--medium]': "resolvedWidth() === 'medium'",
166
+ '[class.sd-page--narrow]': "resolvedWidth() === 'narrow'",
167
+ '[class.sd-page--aside-start]': "aside() === 'start'",
168
+ }, providers: [{ provide: SD_SECTION_REGISTRY, useExisting: forwardRef(() => SdPageComponent) }], template: "@let _backLink = backLink();\n@let _badges = visibleBadges();\n@let _hasLead = hasLead();\n@if (!noHeader()) {\n <header class=\"c-page-header bg-white\">\n <div class=\"p-16 d-flex align-items-center w-full justify-content-between\">\n <div class=\"d-flex\" [class.c-page-lead]=\"_hasLead\">\n <ng-content select=\"[headerLeft],[sdHeaderLeft]\">\n @if (_backLink) {\n <a class=\"c-page-back\" [routerLink]=\"_backLink\" [attr.aria-label]=\"'core.common.back' | sdTranslate\">\n <sd-icon name=\"arrow_back\"></sd-icon>\n </a>\n }\n <div #titleBlock class=\"d-flex flex-column\" [class.c-page-title-block]=\"_hasLead\">\n @if (_badges.length) {\n <div class=\"c-page-title-row\">\n <h1 class=\"T20M c-page-title\">{{ title() }}</h1>\n @for (badge of _badges; track $index) {\n <sd-badge\n size=\"md\"\n [type]=\"badge.type ?? 'round'\"\n [color]=\"badge.color\"\n [icon]=\"badge.icon\"\n [title]=\"badge.title\"\n [label]=\"badge.label\"\n [tooltip]=\"badge.tooltip\"></sd-badge>\n }\n </div>\n } @else {\n <h1 class=\"T20M\" [class.c-page-title]=\"_hasLead\">{{ title() }}</h1>\n }\n @if (description()) {\n <div class=\"T14R text-secondary mt-4\">{{ description() }}</div>\n }\n </div>\n </ng-content>\n </div>\n <ng-content select=\"[headerRight],[sdHeaderRight]\"></ng-content>\n </div>\n <ng-content select=\"[sdSubheader]\"></ng-content>\n </header>\n}\n\n<!-- why: px-0 l\u00E0 utility !important; c\u1ED9t c\u00F3 gi\u1EDBi h\u1EA1n b\u1EC1 r\u1ED9ng c\u1EA7n padding ri\u00EAng n\u00EAn b\u1ECF n\u00F3 \u0111i. -->\n<div #wrapper class=\"c-page-wrapper\" [class.px-0]=\"resolvedWidth() === 'full'\">\n <div class=\"c-page-content\">\n <ng-content></ng-content>\n </div>\n <ng-content select=\"[sdAside]\"></ng-content>\n @let _tocItems = tocItems();\n @if (_tocItems.length) {\n @let _activeToc = activeTocIndex();\n <nav class=\"c-page-toc\" [attr.aria-label]=\"'core.module.layout.page.toc' | sdTranslate\">\n @for (item of _tocItems; track item.el; let index = $index) {\n <button\n type=\"button\"\n class=\"c-page-toc-item\"\n [class.active]=\"index === _activeToc\"\n [attr.aria-current]=\"index === _activeToc ? 'true' : null\"\n (click)=\"scrollToSection(index)\">\n {{ item.title }}\n </button>\n }\n </nav>\n }\n</div>\n\n<!-- why: footer ch\u1EC9 c\u00F3 hai slot chi\u1EBFu th\u1EB3ng v\u00E0o, kh\u00F4ng c\u00F3 wrapper, n\u00EAn CSS :empty \u1EA9n n\u00F3 khi m\u00E0n kh\u00F4ng d\u00F9ng footer. -->\n<footer class=\"c-page-footer\" role=\"group\" [attr.aria-label]=\"'core.module.layout.page.actions' | sdTranslate\">\n <ng-content select=\"[sdFooterLeft]\"></ng-content>\n <ng-content select=\"[sdFooterRight]\"></ng-content>\n</footer>\n", styles: [":host{height:100%;display:flex;flex-direction:column;background-color:var(--sd-page-bg, #f9f9f9)}:host(.sd-page--wide){--sd-page-column-max: 1200px}:host(.sd-page--medium){--sd-page-column-max: 960px}:host(.sd-page--narrow){--sd-page-column-max: 720px}.c-page-header{box-shadow:0 1px 2px 0 var(--sd-page-shadow, rgba(47, 49, 54, .1019607843));z-index:1;position:relative}.c-page-header h1{margin:0}.c-page-lead{align-items:center;gap:12px;min-width:0}.c-page-title-block{min-width:0}.c-page-title-row{display:flex;align-items:center;gap:8px;min-width:0}.c-page-title-row sd-badge{flex:none}.c-page-title{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.c-page-back{flex:none;display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;color:var(--sd-page-back-fg, #44474e);text-decoration:none}.c-page-back:hover{background-color:var(--sd-page-back-hover-bg, #eceef2)}.c-page-back:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.c-page-header ::ng-deep>[sdSubheader]{display:block;border-top:1px solid var(--sd-page-divider, #eceef2)}:host(.sd-page--wide)>.c-page-wrapper,:host(.sd-page--medium)>.c-page-wrapper,:host(.sd-page--narrow)>.c-page-wrapper{padding:16px max(24px,(100% - var(--sd-page-column-max)) / 2 + 24px)}:host(.sd-page--wide)>.c-page-header ::ng-deep>[sdSubheader],:host(.sd-page--medium)>.c-page-header ::ng-deep>[sdSubheader],:host(.sd-page--narrow)>.c-page-header ::ng-deep>[sdSubheader]{padding-inline:max(24px,(100% - var(--sd-page-column-max)) / 2 + 24px)}:host(.sd-page--wide)>.c-page-footer,:host(.sd-page--medium)>.c-page-footer,:host(.sd-page--narrow)>.c-page-footer{padding-inline:max(24px,(100% - var(--sd-page-column-max)) / 2 + 24px)}.c-page-wrapper{flex:1;display:flex;flex-direction:row;width:100%;overflow-y:auto;max-height:100vh;box-sizing:border-box}.c-page-wrapper .c-page-content{flex:1;height:100%;width:100%}.c-page-wrapper .c-page-right{position:-webkit-sticky;position:sticky;top:0;height:100%;overflow-y:auto}:host ::ng-deep>.c-page-wrapper:has(>[sdAside]),:host ::ng-deep>.c-page-wrapper:has(>.c-page-toc){gap:16px}:host ::ng-deep>.c-page-wrapper:has(>[sdAside])>.c-page-content,:host ::ng-deep>.c-page-wrapper:has(>.c-page-toc)>.c-page-content{min-width:0}.c-page-wrapper ::ng-deep>[sdAside],.c-page-wrapper>.c-page-toc{flex:0 0 320px;width:320px;box-sizing:border-box;align-self:flex-start;position:sticky;top:0;max-height:100%;overflow-y:auto}@media(min-width:1200px){:host(.sd-page--aside-start) ::ng-deep>.c-page-wrapper>[sdAside],:host(.sd-page--aside-start)>.c-page-wrapper>.c-page-toc{order:-1}}.c-page-toc{display:flex;flex-direction:column}.c-page-toc-item{padding:8px 24px;border:0;border-left:2px solid var(--sd-secondary-light);background:transparent;color:var(--sd-text);font:inherit;text-align:left;cursor:pointer}.c-page-toc-item.active{border-left-color:var(--sd-primary);color:var(--sd-primary);font-weight:var(--sd-font-weight-bold, 700)}.c-page-toc-item:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:-2px}@media(max-width:1199.98px){.c-page-wrapper>.c-page-toc{display:none}:host ::ng-deep>.c-page-wrapper:has(>[sdAside]){flex-direction:column}:host ::ng-deep>.c-page-wrapper:has(>[sdAside])>.c-page-content{flex:none;height:auto}.c-page-wrapper ::ng-deep>[sdAside]{flex:none;width:auto;align-self:stretch;position:static;max-height:none;overflow-y:visible}}.c-page-footer{flex:none;display:flex;align-items:center;gap:8px;padding:12px 16px;border-top:1px solid var(--sd-page-divider, #eceef2);background-color:var(--sd-surface, #ffffff)}.c-page-footer:empty{display:none}.c-page-footer ::ng-deep>[sdFooterRight]{margin-left:auto}.c-page-footer ::ng-deep>[sdFooterRight]~[sdFooterRight]{margin-left:0}\n"] }]
169
+ }], ctorParameters: () => [], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], noHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "noHeader", required: false }] }], backLink: [{ type: i0.Input, args: [{ isSignal: true, alias: "backLink", required: false }] }], badges: [{ type: i0.Input, args: [{ isSignal: true, alias: "badges", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], aside: [{ type: i0.Input, args: [{ isSignal: true, alias: "aside", required: false }] }], toc: [{ type: i0.Input, args: [{ isSignal: true, alias: "toc", required: false }] }], titleBlock: [{ type: i0.ViewChild, args: ['titleBlock', { isSignal: true }] }], wrapper: [{ type: i0.ViewChild, args: ['wrapper', { isSignal: true }] }] } });
170
+
171
+ /**
172
+ * Guard rời trang của `sd-page-form`: còn thay đổi chưa lưu (watcher của `SdUnsavedChangesService`, thường đăng ký
173
+ * bằng `registerSdUnsavedChangesForm(..., { dirty: 'value' })`) thì hỏi bằng dialog xác nhận của Core.
174
+ *
175
+ * why: adapter của service là của cả app (mặc định `window.confirm`); guard này truyền adapter riêng cho lần hỏi
176
+ * này nên app đang dùng `sdUnsavedChangesGuard` không đổi hành vi.
177
+ */
178
+ const sdPageFormLeaveGuard = () => {
179
+ const confirmService = inject(SdConfirmService);
180
+ const i18n = inject(I18nService);
181
+ const adapter = {
182
+ confirm: async (context) => {
183
+ const message = context.watchers.find(watcher => watcher.message)?.message ?? i18n.t('core.module.layout.page.leave.message');
184
+ try {
185
+ await confirmService.confirm(message, {
186
+ title: i18n.t('core.module.layout.page.leave.title'),
187
+ yesTitle: i18n.t('core.module.layout.page.leave.leave'),
188
+ noTitle: i18n.t('core.module.layout.page.leave.stay'),
189
+ yesButtonColor: 'warning',
190
+ });
191
+ return 'discard';
192
+ }
193
+ catch {
194
+ return 'cancel';
195
+ }
196
+ },
197
+ };
198
+ return inject(SdUnsavedChangesService).confirmLeave({ reason: 'navigation', adapter });
199
+ };
200
+
201
+ const SD_PAGE_LIST = new InjectionToken('SD_PAGE_LIST');
202
+ const SHORT_VIEWPORT = '(max-height: 719px)';
203
+ class SdPageList {
204
+ #host = inject(ElementRef).nativeElement;
205
+ #injector = inject(Injector);
206
+ #destroyRef = inject(DestroyRef);
207
+ title = input('', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
208
+ description = input('', ...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
209
+ backLink = input(...(ngDevMode ? [undefined, { debugName: "backLink" }] : /* istanbul ignore next */ []));
210
+ badges = input(...(ngDevMode ? [undefined, { debugName: "badges" }] : /* istanbul ignore next */ []));
211
+ width = input(...(ngDevMode ? [undefined, { debugName: "width" }] : /* istanbul ignore next */ []));
212
+ /** Chi tiết là route con: `page` thay danh sách bằng trang con, `drawer` giữ danh sách và mở drawer. */
213
+ detail = input('page', ...(ngDevMode ? [{ debugName: "detail" }] : /* istanbul ignore next */ []));
214
+ /** Tự thu gọn vùng phụ khi viewport thấp. Tắt thì vùng phụ luôn đầy đủ và thân trang cuộn khi thiếu chỗ. */
215
+ autoCompact = input(true, { ...(ngDevMode ? { debugName: "autoCompact" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
216
+ #shortViewport = signal(false, ...(ngDevMode ? [{ debugName: "#shortViewport" }] : /* istanbul ignore next */ []));
217
+ compact = computed(() => this.autoCompact() && this.#shortViewport(), ...(ngDevMode ? [{ debugName: "compact" }] : /* istanbul ignore next */ []));
218
+ childActive = signal(false, ...(ngDevMode ? [{ debugName: "childActive" }] : /* istanbul ignore next */ []));
219
+ /** Bảng chính: `[sdPageListMain]`, hoặc `sd-table` con trực tiếp cuối cùng của thân trang. */
220
+ fillTarget = signal(null, ...(ngDevMode ? [{ debugName: "fillTarget" }] : /* istanbul ignore next */ []));
221
+ externalFilterCollapsed = this.compact;
222
+ hidesList = computed(() => this.childActive() && this.detail() === 'page', ...(ngDevMode ? [{ debugName: "hidesList" }] : /* istanbul ignore next */ []));
223
+ #savedScroll = [];
224
+ #returnFocus = null;
225
+ constructor() {
226
+ const media = typeof matchMedia === 'function' ? matchMedia(SHORT_VIEWPORT) : null;
227
+ if (media) {
228
+ this.#shortViewport.set(media.matches);
229
+ const onChange = (event) => this.#shortViewport.set(event.matches);
230
+ media.addEventListener('change', onChange);
231
+ this.#destroyRef.onDestroy(() => media.removeEventListener('change', onChange));
232
+ }
233
+ afterNextRender(() => {
234
+ const content = this.#content();
235
+ if (!content)
236
+ return;
237
+ this.#syncMain(content);
238
+ // why: bảng có thể nằm trong @if của feature; nội dung đổi thì chọn lại bảng chính.
239
+ const observer = new MutationObserver(() => this.#syncMain(content));
240
+ observer.observe(content, { childList: true });
241
+ this.#destroyRef.onDestroy(() => observer.disconnect());
242
+ });
243
+ }
244
+ onActivate() {
245
+ const active = document.activeElement;
246
+ const list = this.#list();
247
+ // why: một route con thay route con khác (chi tiết → cập nhật) thì phần tử đang focus nằm trong route con cũ;
248
+ // giữ phần tử của danh sách đã mở route con đầu tiên, và vị trí cuộn ghi lúc danh sách còn hiện.
249
+ const opener = active instanceof HTMLElement && list?.contains(active) ? active : null;
250
+ this.#returnFocus = opener ?? this.#returnFocus;
251
+ // why: display:none làm mất vị trí cuộn; ghi lại trước khi ẩn danh sách để trả về khi quay lại.
252
+ const scroll = this.detail() === 'page' && list ? this.#captureScroll(list) : [];
253
+ this.#savedScroll = scroll.length ? scroll : this.#savedScroll;
254
+ this.childActive.set(true);
255
+ }
256
+ onDeactivate() {
257
+ this.childActive.set(false);
258
+ afterNextRender(() => {
259
+ // Route con khác đã mở ngay sau (đổi route con): danh sách vẫn ẩn, giữ focus và vị trí cuộn cho lúc quay về.
260
+ if (this.childActive())
261
+ return;
262
+ for (const saved of this.#savedScroll) {
263
+ saved.el.scrollTop = saved.top;
264
+ saved.el.scrollLeft = saved.left;
265
+ }
266
+ this.#savedScroll = [];
267
+ if (this.#returnFocus?.isConnected)
268
+ this.#returnFocus.focus();
269
+ this.#returnFocus = null;
270
+ }, { injector: this.#injector });
271
+ }
272
+ #list() {
273
+ return this.#host.querySelector(':scope > sd-page');
274
+ }
275
+ #content() {
276
+ return this.#host.querySelector(':scope > sd-page > .c-page-wrapper > .c-page-content');
277
+ }
278
+ #syncMain(content) {
279
+ const children = [...content.children];
280
+ const marked = children.filter(child => child.hasAttribute('sdPageListMain'));
281
+ if (isDevMode() && marked.length > 1) {
282
+ console.warn('[sd-page-list] Chỉ một phần tử được gắn sdPageListMain; dùng phần tử đầu tiên.');
283
+ }
284
+ const main = marked[0] ?? children.filter(child => child.tagName === 'SD-TABLE').at(-1) ?? null;
285
+ if (main !== this.fillTarget())
286
+ this.fillTarget.set(main);
287
+ }
288
+ #captureScroll(root) {
289
+ const saved = [];
290
+ for (const el of [root, ...root.querySelectorAll('*')]) {
291
+ if (el.scrollTop || el.scrollLeft)
292
+ saved.push({ el, top: el.scrollTop, left: el.scrollLeft });
293
+ }
294
+ return saved;
295
+ }
296
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdPageList, deps: [], target: i0.ɵɵFactoryTarget.Component });
297
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdPageList, isStandalone: true, selector: "sd-page-list", inputs: { title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, backLink: { classPropertyName: "backLink", publicName: "backLink", isSignal: true, isRequired: false, transformFunction: null }, badges: { classPropertyName: "badges", publicName: "badges", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, detail: { classPropertyName: "detail", publicName: "detail", isSignal: true, isRequired: false, transformFunction: null }, autoCompact: { classPropertyName: "autoCompact", publicName: "autoCompact", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.sd-page-list--child-page": "hidesList()" } }, providers: [
298
+ { provide: SD_PAGE_LIST, useExisting: forwardRef(() => SdPageList) },
299
+ { provide: SD_TABLE_LAYOUT, useExisting: forwardRef(() => SdPageList) },
300
+ ], ngImport: i0, template: "<sd-page\n [title]=\"title()\"\n [description]=\"description()\"\n [backLink]=\"backLink()\"\n [badges]=\"badges()\"\n [width]=\"width()\"\n [style.display]=\"hidesList() ? 'none' : null\">\n <!-- why: chuy\u1EC3n ti\u1EBFp slot c\u1EE7a sd-page. Kh\u00F4ng chuy\u1EC3n ti\u1EBFp headerLeft: ng-container r\u1ED7ng v\u1EABn chi\u1EBFm slot v\u00E0 l\u00E0m m\u1EA5t\n title m\u1EB7c \u0111\u1ECBnh c\u1EE7a sd-page. -->\n <ng-container ngProjectAs=\"[sdHeaderRight]\"><ng-content select=\"[headerRight],[sdHeaderRight]\"></ng-content></ng-container>\n <ng-container ngProjectAs=\"[sdSubheader]\"><ng-content select=\"[sdSubheader]\"></ng-content></ng-container>\n <ng-container ngProjectAs=\"[sdFooterLeft]\"><ng-content select=\"[sdFooterLeft]\"></ng-content></ng-container>\n <ng-container ngProjectAs=\"[sdFooterRight]\"><ng-content select=\"[sdFooterRight]\"></ng-content></ng-container>\n <ng-content></ng-content>\n</sd-page>\n@if (detail() !== 'none') {\n <router-outlet (activate)=\"onActivate()\" (deactivate)=\"onDeactivate()\"></router-outlet>\n}\n", styles: [":host{display:flex;flex-direction:column;height:100%;min-height:0}:host>sd-page{flex:1 1 0;min-height:0;height:auto}:host ::ng-deep>sd-page>.c-page-wrapper{padding:16px!important}:host ::ng-deep>sd-page>.c-page-wrapper>.c-page-content{display:flex;flex-direction:column;gap:12px;min-width:0;min-height:0}:host ::ng-deep>sd-page>.c-page-wrapper>.c-page-content>[sdPageListMain]{display:flex;flex-direction:column;flex:1 1 0;min-width:0}:host(.sd-page-list--child-page) ::ng-deep>router-outlet~*{display:flex;flex-direction:column;flex:1 1 0;min-height:0}\n"], dependencies: [{ kind: "component", type: SdPageComponent, selector: "sd-page, sd-page-detail, sd-page-form", inputs: ["title", "description", "noHeader", "backLink", "badges", "width", "aside", "toc"] }, { kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
301
+ }
302
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdPageList, decorators: [{
303
+ type: Component,
304
+ args: [{ selector: 'sd-page-list', changeDetection: ChangeDetectionStrategy.OnPush, imports: [SdPageComponent, RouterOutlet], host: { '[class.sd-page-list--child-page]': 'hidesList()' }, providers: [
305
+ { provide: SD_PAGE_LIST, useExisting: forwardRef(() => SdPageList) },
306
+ { provide: SD_TABLE_LAYOUT, useExisting: forwardRef(() => SdPageList) },
307
+ ], template: "<sd-page\n [title]=\"title()\"\n [description]=\"description()\"\n [backLink]=\"backLink()\"\n [badges]=\"badges()\"\n [width]=\"width()\"\n [style.display]=\"hidesList() ? 'none' : null\">\n <!-- why: chuy\u1EC3n ti\u1EBFp slot c\u1EE7a sd-page. Kh\u00F4ng chuy\u1EC3n ti\u1EBFp headerLeft: ng-container r\u1ED7ng v\u1EABn chi\u1EBFm slot v\u00E0 l\u00E0m m\u1EA5t\n title m\u1EB7c \u0111\u1ECBnh c\u1EE7a sd-page. -->\n <ng-container ngProjectAs=\"[sdHeaderRight]\"><ng-content select=\"[headerRight],[sdHeaderRight]\"></ng-content></ng-container>\n <ng-container ngProjectAs=\"[sdSubheader]\"><ng-content select=\"[sdSubheader]\"></ng-content></ng-container>\n <ng-container ngProjectAs=\"[sdFooterLeft]\"><ng-content select=\"[sdFooterLeft]\"></ng-content></ng-container>\n <ng-container ngProjectAs=\"[sdFooterRight]\"><ng-content select=\"[sdFooterRight]\"></ng-content></ng-container>\n <ng-content></ng-content>\n</sd-page>\n@if (detail() !== 'none') {\n <router-outlet (activate)=\"onActivate()\" (deactivate)=\"onDeactivate()\"></router-outlet>\n}\n", styles: [":host{display:flex;flex-direction:column;height:100%;min-height:0}:host>sd-page{flex:1 1 0;min-height:0;height:auto}:host ::ng-deep>sd-page>.c-page-wrapper{padding:16px!important}:host ::ng-deep>sd-page>.c-page-wrapper>.c-page-content{display:flex;flex-direction:column;gap:12px;min-width:0;min-height:0}:host ::ng-deep>sd-page>.c-page-wrapper>.c-page-content>[sdPageListMain]{display:flex;flex-direction:column;flex:1 1 0;min-width:0}:host(.sd-page-list--child-page) ::ng-deep>router-outlet~*{display:flex;flex-direction:column;flex:1 1 0;min-height:0}\n"] }]
308
+ }], ctorParameters: () => [], propDecorators: { title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], backLink: [{ type: i0.Input, args: [{ isSignal: true, alias: "backLink", required: false }] }], badges: [{ type: i0.Input, args: [{ isSignal: true, alias: "badges", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], detail: [{ type: i0.Input, args: [{ isSignal: true, alias: "detail", required: false }] }], autoCompact: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoCompact", required: false }] }] } });
52
309
 
53
310
  function getMenuStableKey(menu, ancestors = []) {
54
311
  if (!menu || typeof menu !== 'object')
@@ -70,6 +327,14 @@ function searchMenuLeaves(menus, query) {
70
327
  return leaves;
71
328
  return leaves.filter(menu => [menu.title, menu.tooltipTitle].some(value => value && StringUtilities.aliasIncludes(value, normalizedQuery)));
72
329
  }
330
+ /** Matches like `searchMenuLeaves` but leaves out `comingSoon` leaves and every leaf under a `comingSoon` group (sidebar V4 search). */
331
+ function searchAvailableMenuLeaves(menus, query) {
332
+ const leaves = collectAvailableMenuLeaves(menus, []);
333
+ const normalizedQuery = query?.trim();
334
+ if (!normalizedQuery)
335
+ return leaves;
336
+ return leaves.filter(menu => [menu.title, menu.tooltipTitle].some(value => value && StringUtilities.aliasIncludes(value, normalizedQuery)));
337
+ }
73
338
  function selectPrimaryMenuGroups(menus, requestedIds, maximum = 3) {
74
339
  const limit = Number.isFinite(maximum) && maximum > 0 ? Math.min(3, Math.floor(maximum)) : 3;
75
340
  const byId = new Map(menus.filter(menu => typeof menu.id === 'string').map(menu => [menu.id, menu]));
@@ -113,6 +378,70 @@ function flattenMenuLeaves(menus) {
113
378
  });
114
379
  return leaves;
115
380
  }
381
+ /**
382
+ * Groups top-level menus by `section` in order of first appearance (sidebar V4).
383
+ * An unsectioned menu joins only the immediately preceding output group when that group is unsectioned (`section: null`);
384
+ * otherwise it starts a new unsectioned group.
385
+ */
386
+ function groupMenusBySection(menus) {
387
+ const groups = [];
388
+ const groupBySection = new Map();
389
+ for (const menu of menus ?? []) {
390
+ if (!menu || typeof menu !== 'object')
391
+ continue;
392
+ const section = typeof menu.section === 'string' ? menu.section.trim() : '';
393
+ if (!section) {
394
+ // why: chỉ nối vào nhóm null nếu nó là nhóm cuối, để không gộp vượt qua một nhóm có section
395
+ const last = groups[groups.length - 1];
396
+ if (last?.section === null)
397
+ last.menus.push(menu);
398
+ else
399
+ groups.push({ section: null, menus: [menu] });
400
+ continue;
401
+ }
402
+ const group = groupBySection.get(section);
403
+ if (group) {
404
+ group.menus.push(menu);
405
+ continue;
406
+ }
407
+ const created = { section, menus: [menu] };
408
+ groupBySection.set(section, created);
409
+ groups.push(created);
410
+ }
411
+ return groups;
412
+ }
413
+ /** The one trailing element sidebar V4 renders, in the order `comingSoon`, `badge`, `status`; empty values are skipped. */
414
+ function resolveMenuTrailing(menu) {
415
+ if (!menu || typeof menu !== 'object')
416
+ return null;
417
+ if (menu.comingSoon === true)
418
+ return { kind: 'soon' };
419
+ const badge = menu.badge;
420
+ if (badge && hasBadgeValue(badge.value)) {
421
+ return badge.tone === 'warning' || badge.tone === 'error'
422
+ ? { kind: 'badge', value: badge.value, tone: badge.tone }
423
+ : { kind: 'count', value: badge.value };
424
+ }
425
+ const status = menu.status;
426
+ if (status && typeof status.label === 'string' && status.label.trim()) {
427
+ return { kind: 'status', label: status.label, tone: status.tone, live: status.live === true };
428
+ }
429
+ return null;
430
+ }
431
+ function hasBadgeValue(value) {
432
+ return typeof value === 'number' ? Number.isFinite(value) : typeof value === 'string' && !!value.trim();
433
+ }
434
+ function collectAvailableMenuLeaves(menus, leaves) {
435
+ for (const menu of menus ?? []) {
436
+ if (!menu || typeof menu !== 'object' || menu.comingSoon === true)
437
+ continue;
438
+ if ('path' in menu && typeof menu.path === 'string' && menu.path)
439
+ leaves.push(menu);
440
+ if ('children' in menu && Array.isArray(menu.children))
441
+ collectAvailableMenuLeaves(menu.children, leaves);
442
+ }
443
+ return leaves;
444
+ }
116
445
  function visitMenus(menus, ancestors, visitor) {
117
446
  for (const menu of menus ?? []) {
118
447
  if (!menu || typeof menu !== 'object')
@@ -135,7 +464,7 @@ function visitMenus(menus, ancestors, visitor) {
135
464
  *
136
465
  * ⚠️ `SdLayoutStorageService` là singleton `providedIn: 'root'`, thường được khởi tạo TRƯỚC khi biết
137
466
  * người dùng là ai. Vì vậy hãy cấp một **hàm** — nó được gọi lại ở mỗi lần truy cập handle, nên khi
138
- * danh tính đến (hoặc đổi) thì cả bảy handle tự dựng lại trên namespace mới:
467
+ * danh tính đến (hoặc đổi) thì cả tám handle tự dựng lại trên namespace mới:
139
468
  *
140
469
  * ```ts
141
470
  * providers: [
@@ -160,7 +489,7 @@ class SdLayoutStorageService {
160
489
  // nên nó chạy ở lần inject đầu tiên, thường TRƯỚC khi đăng nhập xong, và factory theo user trả về
161
490
  // `undefined` cho cả phiên; biện pháp "pinned/recent của A không lộ sang B" quảng cáo trong doc khi
162
491
  // đó không bao giờ có hiệu lực. Giải quyết bằng cách resolve LƯỜI ở mỗi lần truy cập handle: khi
163
- // danh tính đến (hoặc đổi user trong cùng phiên SPA) thì bảy handle được dựng lại trên namespace mới.
492
+ // danh tính đến (hoặc đổi user trong cùng phiên SPA) thì tám handle được dựng lại trên namespace mới.
164
493
  get isShowSidebar() {
165
494
  return this.#resolveHandles().isShowSidebar;
166
495
  }
@@ -182,6 +511,10 @@ class SdLayoutStorageService {
182
511
  get versionStates() {
183
512
  return this.#resolveHandles().versionStates;
184
513
  }
514
+ /** Snapshot context hiện tại (`{ id, title, subtitle?, avatar? }`), chỉ `SdLayoutContextService` đọc/ghi. */
515
+ get currentContext() {
516
+ return this.#resolveHandles().currentContext;
517
+ }
185
518
  /**
186
519
  * Xoá toàn bộ state layout đã persist.
187
520
  *
@@ -198,6 +531,13 @@ class SdLayoutStorageService {
198
531
  for (const handle of this.#allHandles(handles))
199
532
  handle.remove();
200
533
  }
534
+ /**
535
+ * Namespace mà các handle đang dùng tại lúc gọi (đã trim; rỗng/không cấu hình → `undefined`).
536
+ * So hai lần gọi để biết partition lưu trữ đã đổi (đăng nhập/đăng xuất trong SPA).
537
+ */
538
+ resolvedNamespace() {
539
+ return this.#resolveNamespace();
540
+ }
201
541
  // why: namespace rỗng/space phải quy về undefined, nếu không mỗi chuỗi rác lại tạo ra một không
202
542
  // gian lưu trữ khác và state của chính user đó biến mất sau khi reload.
203
543
  #resolveNamespace() {
@@ -233,6 +573,7 @@ class SdLayoutStorageService {
233
573
  pinnedMenuKeys: this.#sdStorageService.create('4bdc7f80-9ff4-4fe0-908f-6c9f7fe4100a', option),
234
574
  recentMenuKeys: this.#sdStorageService.create('fb989dc1-f6e7-4b62-a611-861a8f214a51', option),
235
575
  versionStates: this.#sdStorageService.create('ca8e4261-fbd4-4209-af88-2dbe278c1a1b', option),
576
+ currentContext: this.#sdStorageService.create('f628621f-7d5d-4f22-b40d-4cc5bf0fa7ae', option),
236
577
  };
237
578
  }
238
579
  #allHandles(handles) {
@@ -244,6 +585,7 @@ class SdLayoutStorageService {
244
585
  handles.pinnedMenuKeys,
245
586
  handles.recentMenuKeys,
246
587
  handles.versionStates,
588
+ handles.currentContext,
247
589
  ];
248
590
  }
249
591
  readPinnedMenuKeys(menus) {
@@ -277,6 +619,24 @@ class SdLayoutStorageService {
277
619
  this.versionStates.set({ ...states, [String(version)]: nextState });
278
620
  return nextState;
279
621
  }
622
+ /** Đọc snapshot context từ bộ nhớ; trả bản sao, hoặc `null` khi chưa có hay sai dạng (thiếu/rỗng `id`, `title`). */
623
+ readCurrentContext() {
624
+ return this.#parseContext(this.currentContext.get());
625
+ }
626
+ /** Lưu snapshot context, chỉ giữ `id`, `title`, `subtitle`, `avatar`; bỏ field tuỳ chọn đang `undefined`. */
627
+ writeCurrentContext(context) {
628
+ const { id, title, subtitle, avatar } = context;
629
+ this.currentContext.set({ id, title, ...(subtitle === undefined ? {} : { subtitle }), ...(avatar === undefined ? {} : { avatar }) });
630
+ }
631
+ /**
632
+ * Đọc lại snapshot context từ storage, bỏ qua entry trong bộ nhớ; kiểm dạng như `readCurrentContext()`.
633
+ *
634
+ * why: `set()` cập nhật bộ nhớ trước và không báo ghi lỗi, còn tab khác ghi thì entry trong bộ nhớ không
635
+ * đổi — chỉ `refresh()` mới cho biết giá trị thật sự đã lưu.
636
+ */
637
+ refreshCurrentContext() {
638
+ return this.#parseContext(this.currentContext.refresh());
639
+ }
280
640
  #getLegacyPinnedKeys() {
281
641
  const legacyGroup = this.pinnedMenuGroup.get();
282
642
  if (!legacyGroup || !Array.isArray(legacyGroup.children))
@@ -291,6 +651,23 @@ class SdLayoutStorageService {
291
651
  #sameKeys(left, right) {
292
652
  return left.length === right.length && left.every((key, index) => key === right[index]);
293
653
  }
654
+ // why: giá trị trong storage có thể do bản cũ, tab khác hoặc tay người sửa — không tin kiểu đã khai báo.
655
+ #parseContext(value) {
656
+ if (typeof value !== 'object' || value === null)
657
+ return null;
658
+ const { id, title, subtitle, avatar } = value;
659
+ if (!this.#isFilledString(id) || !this.#isFilledString(title))
660
+ return null;
661
+ return {
662
+ id,
663
+ title,
664
+ ...(typeof subtitle === 'string' ? { subtitle } : {}),
665
+ ...(typeof avatar === 'string' ? { avatar } : {}),
666
+ };
667
+ }
668
+ #isFilledString(value) {
669
+ return typeof value === 'string' && value.trim().length > 0;
670
+ }
294
671
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdLayoutStorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
295
672
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdLayoutStorageService, providedIn: 'root' });
296
673
  }
@@ -319,6 +696,10 @@ function resolveSidebarV3Recent(sidebar) {
319
696
  maxItems,
320
697
  };
321
698
  }
699
+ function sanitizeSidebarV4BottomBar(bottomBar) {
700
+ const ids = Array.isArray(bottomBar) ? bottomBar.filter((id) => typeof id === 'string').map(id => id.trim()) : [];
701
+ return [...new Set(ids.filter(Boolean))].slice(0, 4);
702
+ }
322
703
  function normalizeSidebarConfiguration(sidebar) {
323
704
  if (sidebar.version === 2) {
324
705
  return {
@@ -334,6 +715,20 @@ function normalizeSidebarConfiguration(sidebar) {
334
715
  recent: resolveSidebarV3Recent(sidebar),
335
716
  };
336
717
  }
718
+ if (sidebar.version === 4) {
719
+ const { mobile } = sidebar;
720
+ return {
721
+ ...sidebar,
722
+ defaultCollapsed: sidebar.defaultCollapsed ?? false,
723
+ // why: V4 kế thừa `recent` của V3; dùng lại đúng resolver V3 mà không nới kiểu tham số public của nó.
724
+ recent: resolveSidebarV3Recent({ version: 3, recent: sidebar.recent }),
725
+ itemShape: sidebar.itemShape === 'soft' ? 'soft' : 'pill',
726
+ density: sidebar.density === 'comfortable' ? 'comfortable' : 'compact',
727
+ collapsedGroup: sidebar.collapsedGroup === 'expand' ? 'expand' : 'flyout',
728
+ // why: không có `bottomBar` thì giữ nguyên `mobile` (kể cả vắng mặt) — không tự tạo bottom bar rỗng.
729
+ ...(mobile?.bottomBar == null ? {} : { mobile: { ...mobile, bottomBar: sanitizeSidebarV4BottomBar(mobile.bottomBar) } }),
730
+ };
731
+ }
337
732
  return sidebar;
338
733
  }
339
734
  const SD_LAYOUT_CONFIGURATION = new InjectionToken('sd.layout.configuration');
@@ -506,6 +901,317 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
506
901
  }]
507
902
  }], ctorParameters: () => [] });
508
903
 
904
+ /** Session storage key of the per-tab reconcile marker (id of the last context reconcile reload target). */
905
+ const SD_LAYOUT_CONTEXT_MARKER_KEY = 'sd.layout.context.reconcile-marker';
906
+
907
+ /**
908
+ * Browser effects of the layout context feature: page reload, cross-tab `storage` events and the
909
+ * per-tab reconcile marker. Defaults to the document window; provide a fake `SdLayoutContextRuntime`
910
+ * in specs and demos so nothing reloads for real:
911
+ *
912
+ * ```ts
913
+ * providers: [{ provide: SD_LAYOUT_CONTEXT_RUNTIME, useValue: fakeRuntime }];
914
+ * ```
915
+ */
916
+ const SD_LAYOUT_CONTEXT_RUNTIME = new InjectionToken('sd.layout.context.runtime', {
917
+ providedIn: 'root',
918
+ factory: () => createSdLayoutContextBrowserRuntime(inject(DOCUMENT).defaultView),
919
+ });
920
+ /** Creates the default runtime over `view`; without a window every operation is a no-op. */
921
+ function createSdLayoutContextBrowserRuntime(view) {
922
+ if (!view) {
923
+ return {
924
+ reload: () => undefined,
925
+ onStorage: () => () => undefined,
926
+ readMarker: () => undefined,
927
+ writeMarker: () => false,
928
+ };
929
+ }
930
+ return {
931
+ reload: () => view.location.reload(),
932
+ onStorage: listener => {
933
+ const handler = (event) => {
934
+ // why: chỉ localStorage mới chứa snapshot. `localStorage.clear()` ở tab khác vẫn mang `storageArea`
935
+ // (chỉ `key` là null); `storageArea` null chỉ gặp ở sự kiện tự dựng — vẫn chuyển tiếp cho an toàn.
936
+ const area = event.storageArea;
937
+ if (area === null || (area !== undefined && area === readLocalStorage(view)))
938
+ listener();
939
+ };
940
+ view.addEventListener('storage', handler);
941
+ return () => view.removeEventListener('storage', handler);
942
+ },
943
+ readMarker: () => {
944
+ try {
945
+ const storage = view.sessionStorage;
946
+ return storage ? storage.getItem(SD_LAYOUT_CONTEXT_MARKER_KEY) : undefined;
947
+ }
948
+ catch {
949
+ return undefined;
950
+ }
951
+ },
952
+ writeMarker: value => {
953
+ try {
954
+ const storage = view.sessionStorage;
955
+ if (!storage)
956
+ return false;
957
+ if (value === null)
958
+ storage.removeItem(SD_LAYOUT_CONTEXT_MARKER_KEY);
959
+ else
960
+ storage.setItem(SD_LAYOUT_CONTEXT_MARKER_KEY, value);
961
+ // why: đọc lại để xác nhận — có trình duyệt nuốt lỗi ghi thay vì ném.
962
+ return storage.getItem(SD_LAYOUT_CONTEXT_MARKER_KEY) === value;
963
+ }
964
+ catch {
965
+ return false;
966
+ }
967
+ },
968
+ };
969
+ }
970
+ // why: truy cập `localStorage` có thể ném SecurityError khi trình duyệt chặn storage.
971
+ function readLocalStorage(view) {
972
+ try {
973
+ return view.localStorage ?? undefined;
974
+ }
975
+ catch {
976
+ return undefined;
977
+ }
978
+ }
979
+
980
+ /**
981
+ * Owns the current layout context (for example a store or a legal entity) and its persisted snapshot.
982
+ *
983
+ * The snapshot is captured once, when the service is first injected, so `SD_LAYOUT_STORAGE_NAMESPACE`
984
+ * must already resolve at that moment (see `sd-layout.md`). Switching reloads the page — there is no
985
+ * change event. Read the context during bootstrap:
986
+ *
987
+ * ```ts
988
+ * provideAppInitializer(() => {
989
+ * const context = inject(SdLayoutContextService).getCurrentContext();
990
+ * inject(ApiContextHeader).set(context?.id);
991
+ * });
992
+ * ```
993
+ *
994
+ * The service works without `SD_LAYOUT_CONFIGURATION`; the context switcher passes the configured items to
995
+ * `syncItems()`, which reconciles the snapshot. A reconcile reload happens at most once per target id
996
+ * while the per-tab marker holds that id.
997
+ */
998
+ class SdLayoutContextService {
999
+ #storage = inject(SdLayoutStorageService);
1000
+ #runtime = inject(SD_LAYOUT_CONTEXT_RUNTIME);
1001
+ #destroyRef = inject(DestroyRef);
1002
+ // why: chụp một lần lúc khởi tạo (D-008) — id này quyết định có cần reload đối chiếu hay không,
1003
+ // còn namespace lúc chụp giúp nhận ra partition lưu trữ đã đổi (đăng nhập/đăng xuất trong SPA).
1004
+ #loadTimeId;
1005
+ #capturedNamespace;
1006
+ #stopListening;
1007
+ // why: đã xin reload thì trang sắp tải lại — mọi lời gọi sau trong lần load này bỏ qua, tránh ghi đè
1008
+ // đích đang chờ, reload lần hai hay cảnh báo marker giả.
1009
+ #reloadRequested = false;
1010
+ #markerWarned = false;
1011
+ #current = signal(null, ...(ngDevMode ? [{ debugName: "#current" }] : /* istanbul ignore next */ []));
1012
+ #items = signal([], ...(ngDevMode ? [{ debugName: "#items" }] : /* istanbul ignore next */ []));
1013
+ #switchingId = signal(null, ...(ngDevMode ? [{ debugName: "#switchingId" }] : /* istanbul ignore next */ []));
1014
+ #switchFailed = signal(false, ...(ngDevMode ? [{ debugName: "#switchFailed" }] : /* istanbul ignore next */ []));
1015
+ #changedElsewhere = signal(false, ...(ngDevMode ? [{ debugName: "#changedElsewhere" }] : /* istanbul ignore next */ []));
1016
+ /** Context of this page load; title, subtitle and avatar may refresh from the configured items. */
1017
+ current = this.#current.asReadonly();
1018
+ /** Valid items last passed to `syncItems()` (entries without `id`/`title` and duplicate ids are dropped). */
1019
+ items = this.#items.asReadonly();
1020
+ /** Id of the context being switched to, or `null`. */
1021
+ switchingId = this.#switchingId.asReadonly();
1022
+ /** `true` when the last switch could not be persisted (no reload happened). */
1023
+ switchFailed = this.#switchFailed.asReadonly();
1024
+ /** `true` when another tab switched the stored context; this tab keeps its context until reloaded. */
1025
+ changedElsewhere = this.#changedElsewhere.asReadonly();
1026
+ constructor() {
1027
+ const snapshot = this.#storage.readCurrentContext();
1028
+ this.#loadTimeId = snapshot?.id ?? null;
1029
+ this.#capturedNamespace = this.#storage.resolvedNamespace();
1030
+ this.#current.set(snapshot);
1031
+ }
1032
+ /** Returns a copy of the current context, or `null` before any context was stored. */
1033
+ getCurrentContext() {
1034
+ const current = this.#current();
1035
+ return current ? { ...current } : null;
1036
+ }
1037
+ /**
1038
+ * Switches to the item with `id`, then reloads the page once the snapshot is confirmed in storage.
1039
+ * Ignored for the active id, before `syncItems()`, for ids that are not in `items` and once a reload
1040
+ * was requested in this page load.
1041
+ */
1042
+ setCurrentContext(id) {
1043
+ if (this.#reloadRequested || id === this.#current()?.id)
1044
+ return;
1045
+ const item = this.#items().find(entry => entry.id === id);
1046
+ if (!item)
1047
+ return;
1048
+ this.#switchingId.set(id);
1049
+ this.#switchFailed.set(false);
1050
+ if (this.#persist(toSnapshot(item))) {
1051
+ // why: ghi marker = đích để namespace resolve trễ không tốn thêm một reload đối chiếu ở lần load sau;
1052
+ // ghi lỗi không chặn — người dùng chủ động chuyển nên vẫn reload.
1053
+ this.#runtime.writeMarker(id);
1054
+ this.#requestReload();
1055
+ return;
1056
+ }
1057
+ this.#switchingId.set(null);
1058
+ this.#switchFailed.set(true);
1059
+ }
1060
+ /**
1061
+ * Reconciles the stored snapshot with the configured items: a valid id only refreshes its metadata;
1062
+ * a missing or stale id falls back to `items[0]` and reloads, unless the per-tab marker already holds
1063
+ * that target. Empty items store nothing. While the load-time context is still in `items`, a different
1064
+ * stored id only raises `changedElsewhere` and a removed snapshot keeps the context in memory.
1065
+ * Repeated calls with the same items neither write nor reload again.
1066
+ */
1067
+ syncItems(items) {
1068
+ if (this.#reloadRequested)
1069
+ return;
1070
+ const validItems = normalizeItems(items);
1071
+ this.#items.set(validItems);
1072
+ // why: listener chỉ đăng ký ở lần gọi đầu (D-021) — app không cấu hình `context` không tạo listener.
1073
+ this.#listenToStorage();
1074
+ if (!validItems.length)
1075
+ return;
1076
+ const namespace = this.#storage.resolvedNamespace();
1077
+ const namespaceChanged = namespace !== this.#capturedNamespace;
1078
+ if (namespaceChanged)
1079
+ this.#recapture(namespace);
1080
+ const fresh = this.#storage.refreshCurrentContext();
1081
+ const current = this.#current();
1082
+ const currentItem = !namespaceChanged && current ? validItems.find(item => item.id === current.id) : undefined;
1083
+ // why: INV-004/D-011/D-026 đứng trên D-025 bước 4 — context của lần load còn hợp lệ thì không bị thay:
1084
+ // storage giữ id khác nghĩa là tab khác đã chuyển → chỉ báo; snapshot mất (clear() ở tab khác, hoặc
1085
+ // lần chuyển ghi lỗi) → giữ context, chỉ làm mới metadata trong bộ nhớ. Không ghi, không marker, không reload.
1086
+ if (currentItem && fresh?.id !== currentItem.id) {
1087
+ if (fresh)
1088
+ this.#changedElsewhere.set(true);
1089
+ else
1090
+ this.#current.set(toSnapshot(currentItem));
1091
+ return;
1092
+ }
1093
+ const target = toSnapshot(validItems.find(item => item.id === fresh?.id) ?? validItems[0]);
1094
+ if (!sameContext(target, fresh) && !this.#persist(target)) {
1095
+ this.#current.set(target);
1096
+ // @i18n-ignore
1097
+ this.#warn('Could not persist the current context; it is kept in memory and the page is not reloaded.');
1098
+ return;
1099
+ }
1100
+ this.#current.set(target);
1101
+ if (target.id === this.#loadTimeId) {
1102
+ this.#runtime.writeMarker(null);
1103
+ return;
1104
+ }
1105
+ // why: marker phiên chặn vòng lặp reload khi namespace theo user resolve SAU getCurrentContext() —
1106
+ // mỗi lần load đều thấy id lúc load khác đích; marker cho tối đa một reload đối chiếu mỗi id đích
1107
+ // trong lúc nó còn giữ id đó (D-025).
1108
+ const marker = this.#runtime.readMarker();
1109
+ if (marker === undefined || marker === target.id || !this.#runtime.writeMarker(target.id)) {
1110
+ this.#warnMarkerBlocked();
1111
+ return;
1112
+ }
1113
+ this.#requestReload();
1114
+ }
1115
+ /** Reloads the page, for example from the "changed in another tab" notice. Does nothing once a reload was requested. */
1116
+ reload() {
1117
+ this.#requestReload();
1118
+ }
1119
+ #requestReload() {
1120
+ if (this.#reloadRequested)
1121
+ return;
1122
+ this.#reloadRequested = true;
1123
+ this.#runtime.reload();
1124
+ }
1125
+ // why: cảnh báo một lần mỗi instance — lời gọi lặp của switcher không làm ngập console.
1126
+ #warnMarkerBlocked() {
1127
+ if (this.#markerWarned)
1128
+ return;
1129
+ this.#markerWarned = true;
1130
+ this.#warn(
1131
+ // @i18n-ignore
1132
+ 'Skipped the context reconcile reload to avoid a reload loop: the per-tab marker already holds the target or is unavailable. ' +
1133
+ // @i18n-ignore
1134
+ 'Make SD_LAYOUT_STORAGE_NAMESPACE resolvable before SdLayoutContextService is first injected (see sd-layout.md).');
1135
+ }
1136
+ #persist(snapshot) {
1137
+ this.#storage.writeCurrentContext(snapshot);
1138
+ // why: `set()` cập nhật bộ nhớ trước và không báo ghi lỗi — chỉ đọc lại từ storage mới xác nhận được (D-019).
1139
+ return this.#storage.refreshCurrentContext()?.id === snapshot.id;
1140
+ }
1141
+ // why: đổi namespace (đăng nhập/đăng xuất trong SPA) là partition khác, không phải đổi ở tab khác → tắt thông báo.
1142
+ #recapture(namespace) {
1143
+ this.#capturedNamespace = namespace;
1144
+ this.#current.set(this.#storage.refreshCurrentContext());
1145
+ this.#changedElsewhere.set(false);
1146
+ }
1147
+ #listenToStorage() {
1148
+ if (this.#stopListening)
1149
+ return;
1150
+ this.#stopListening = this.#runtime.onStorage(() => this.#onStorage());
1151
+ this.#destroyRef.onDestroy(() => this.#stopListening?.());
1152
+ }
1153
+ // why: key thật là digest nên không lọc theo key được — mọi sự kiện đều đọc lại rồi so id (D-020).
1154
+ #onStorage() {
1155
+ if (this.#reloadRequested)
1156
+ return;
1157
+ const namespace = this.#storage.resolvedNamespace();
1158
+ if (namespace !== this.#capturedNamespace) {
1159
+ this.#recapture(namespace);
1160
+ return;
1161
+ }
1162
+ const fresh = this.#storage.refreshCurrentContext();
1163
+ // why: tính lại cả hai chiều để cờ tắt khi tab khác chuyển về; snapshot bị xoá (signout nơi khác) giữ nguyên cờ.
1164
+ if (fresh)
1165
+ this.#changedElsewhere.set(fresh.id !== this.#current()?.id);
1166
+ }
1167
+ #warn(message) {
1168
+ if (!isDevMode())
1169
+ return;
1170
+ // @i18n-ignore dev-facing console.warn — không cần dịch
1171
+ console.warn(`[SdLayoutContextService] ${message}`);
1172
+ }
1173
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdLayoutContextService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1174
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdLayoutContextService, providedIn: 'root' });
1175
+ }
1176
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdLayoutContextService, decorators: [{
1177
+ type: Injectable,
1178
+ args: [{ providedIn: 'root' }]
1179
+ }], ctorParameters: () => [] });
1180
+ // why: chỉ giữ đúng 4 field của snapshot và bỏ field tuỳ chọn không phải chuỗi — khớp cách
1181
+ // `SdLayoutStorageService` đọc lại, nên so sánh ổn định và lời gọi lặp không ghi lại.
1182
+ function toSnapshot(item) {
1183
+ const { id, title, subtitle, avatar } = item;
1184
+ return {
1185
+ id,
1186
+ title,
1187
+ ...(typeof subtitle === 'string' ? { subtitle } : {}),
1188
+ ...(typeof avatar === 'string' ? { avatar } : {}),
1189
+ };
1190
+ }
1191
+ function sameContext(left, right) {
1192
+ return !!right && left.id === right.id && left.title === right.title && left.subtitle === right.subtitle && left.avatar === right.avatar;
1193
+ }
1194
+ function normalizeItems(items) {
1195
+ if (!Array.isArray(items))
1196
+ return [];
1197
+ const seen = new Set();
1198
+ const result = [];
1199
+ for (const item of items) {
1200
+ if (typeof item !== 'object' || item === null)
1201
+ continue;
1202
+ const { id, title } = item;
1203
+ // why: cùng luật hợp lệ với `SdLayoutStorageService` (chuỗi không rỗng sau trim) — mục nào ghi được thì đọc lại được.
1204
+ if (!isFilledString(id) || !isFilledString(title) || seen.has(id))
1205
+ continue;
1206
+ seen.add(id);
1207
+ result.push(item);
1208
+ }
1209
+ return result;
1210
+ }
1211
+ function isFilledString(value) {
1212
+ return typeof value === 'string' && value.trim().length > 0;
1213
+ }
1214
+
509
1215
  // End
510
1216
  class MenuPipe {
511
1217
  permissionService = inject(SdPermissionService);
@@ -821,6 +1527,247 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
821
1527
  }]
822
1528
  }] });
823
1529
 
1530
+ /**
1531
+ * CSS variable a sidebar can set on (or above) the switcher host to size the header popover. It wins over the
1532
+ * width derived from `anchor`. The popover lives in the CDK overlay container, so the resolved value is copied
1533
+ * onto it when it opens.
1534
+ */
1535
+ const POPOVER_WIDTH_VARIABLE = '--sd-layout-context-switcher-popover-width';
1536
+ /** Horizontal inset of the header popover inside its anchor (the popover is `anchor width − 2 × inset` wide). */
1537
+ const ANCHOR_INSET = 12;
1538
+ const BELOW_TRIGGER_POSITIONS = [
1539
+ { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 6 },
1540
+ { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -6 },
1541
+ ];
1542
+ const BELOW_ANCHOR_POSITIONS = [
1543
+ { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetX: ANCHOR_INSET },
1544
+ { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetX: ANCHOR_INSET },
1545
+ ];
1546
+ const RIGHT_POSITIONS = [
1547
+ { originX: 'end', originY: 'top', overlayX: 'start', overlayY: 'top', offsetX: 8 },
1548
+ { originX: 'end', originY: 'bottom', overlayX: 'start', overlayY: 'bottom', offsetX: 8 },
1549
+ ];
1550
+ let nextSheetTitleId = 0;
1551
+ /**
1552
+ * Context switcher shared by sidebar versions 1–4 and their mobile drawers.
1553
+ *
1554
+ * Forwards `configuration.items` to `SdLayoutContextService.syncItems()` and renders the service state:
1555
+ * the current context, the switching row and the "changed in another tab" notice. Selecting another
1556
+ * context calls `setCurrentContext()`, which reloads the page; there is no change event.
1557
+ */
1558
+ class SdLayoutContextSwitcher {
1559
+ #context = inject(SdLayoutContextService);
1560
+ #iconConfiguration = inject(SD_ICON_CONFIGURATION);
1561
+ #overlay = inject(Overlay);
1562
+ #viewContainerRef = inject(ViewContainerRef);
1563
+ #host = inject(ElementRef);
1564
+ #document = inject(DOCUMENT);
1565
+ trigger = viewChild('trigger', ...(ngDevMode ? [{ debugName: "trigger" }] : /* istanbul ignore next */ []));
1566
+ sheetTemplate = viewChild.required('sheet');
1567
+ #sheetRef;
1568
+ /** Context configuration of the sidebar; nothing renders without items. */
1569
+ configuration = input(...(ngDevMode ? [undefined, { debugName: "configuration" }] : /* istanbul ignore next */ []));
1570
+ /** Header trigger, collapsed-rail avatar, or mobile row that opens a bottom sheet. */
1571
+ appearance = input('header', ...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
1572
+ /** Side the desktop popover opens on; defaults to `below` for the header and `right` for the rail. The sheet ignores it. */
1573
+ placement = input(...(ngDevMode ? [undefined, { debugName: "placement" }] : /* istanbul ignore next */ []));
1574
+ /**
1575
+ * Element the desktop popover aligns to; defaults to the trigger. Pass the sidebar header for `below`
1576
+ * (the popover sits under it, 12px inside both edges) and the rail or aside for `right` (the popover opens
1577
+ * 8px from its right edge, top-aligned with the trigger).
1578
+ */
1579
+ anchor = input(...(ngDevMode ? [undefined, { debugName: "anchor" }] : /* istanbul ignore next */ []));
1580
+ #isOpen = signal(false, ...(ngDevMode ? [{ debugName: "#isOpen" }] : /* istanbul ignore next */ []));
1581
+ /** `true` while the popover or the bottom sheet is open. */
1582
+ isOpen = this.#isOpen.asReadonly();
1583
+ query = signal('', ...(ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []));
1584
+ popoverWidth = signal(null, ...(ngDevMode ? [{ debugName: "popoverWidth" }] : /* istanbul ignore next */ []));
1585
+ popoverOrigin = signal(null, ...(ngDevMode ? [{ debugName: "popoverOrigin" }] : /* istanbul ignore next */ []));
1586
+ #failedAvatars = signal(new Set(), ...(ngDevMode ? [{ debugName: "#failedAvatars" }] : /* istanbul ignore next */ []));
1587
+ sheetTitleId = `sd-layout-context-switcher-sheet-title-${nextSheetTitleId++}`;
1588
+ // why: Lucide chỉ render icon đã đăng ký và ném lỗi với tên lạ — `unfold_less` không có alias Lucide mặc định,
1589
+ // nên khi app dùng Lucide mà không tự alias thì giữ `unfold_more` (đã có alias) cho trạng thái mở.
1590
+ openIcon = this.#iconConfiguration.defaultFontSet === 'lucide' && !this.#iconConfiguration.lucideAliases['unfold_less']
1591
+ ? 'unfold_more'
1592
+ : 'unfold_less';
1593
+ switchFailed = this.#context.switchFailed;
1594
+ changedElsewhere = this.#context.changedElsewhere;
1595
+ /** Normalized items of the service; empty while no configuration is bound (INV-013). */
1596
+ items = computed(() => (this.configuration() ? this.#context.items() : []), ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
1597
+ customLabel = computed(() => this.configuration()?.label?.trim() || null, ...(ngDevMode ? [{ debugName: "customLabel" }] : /* istanbul ignore next */ []));
1598
+ canOpen = computed(() => this.items().length > 1, ...(ngDevMode ? [{ debugName: "canOpen" }] : /* istanbul ignore next */ []));
1599
+ searchable = computed(() => this.configuration()?.searchable ?? this.items().length > 7, ...(ngDevMode ? [{ debugName: "searchable" }] : /* istanbul ignore next */ []));
1600
+ activeId = computed(() => this.#context.current()?.id ?? null, ...(ngDevMode ? [{ debugName: "activeId" }] : /* istanbul ignore next */ []));
1601
+ activeItem = computed(() => {
1602
+ const items = this.items();
1603
+ return items.find(item => item.id === this.activeId()) ?? items[0] ?? null;
1604
+ }, ...(ngDevMode ? [{ debugName: "activeItem" }] : /* istanbul ignore next */ []));
1605
+ activeInitial = computed(() => initialOf(this.activeItem()?.title), ...(ngDevMode ? [{ debugName: "activeInitial" }] : /* istanbul ignore next */ []));
1606
+ #placement = computed(() => this.placement() ?? (this.appearance() === 'rail' ? 'right' : 'below'), ...(ngDevMode ? [{ debugName: "#placement" }] : /* istanbul ignore next */ []));
1607
+ positions = computed(() => {
1608
+ if (this.#placement() === 'right')
1609
+ return RIGHT_POSITIONS;
1610
+ return this.anchor() ? BELOW_ANCHOR_POSITIONS : BELOW_TRIGGER_POSITIONS;
1611
+ }, ...(ngDevMode ? [{ debugName: "positions" }] : /* istanbul ignore next */ []));
1612
+ rows = computed(() => {
1613
+ const query = this.searchable() ? this.query().trim() : '';
1614
+ const activeId = this.activeId();
1615
+ const switchingId = this.#context.switchingId();
1616
+ return this.items()
1617
+ .filter(item => !query || [item.title, item.subtitle].some(value => !!value && StringUtilities.aliasIncludes(value, query)))
1618
+ .map(item => ({
1619
+ item,
1620
+ initial: initialOf(item.title),
1621
+ active: item.id === activeId,
1622
+ busy: item.id === switchingId,
1623
+ disabled: !!switchingId && item.id !== switchingId,
1624
+ }));
1625
+ }, ...(ngDevMode ? [{ debugName: "rows" }] : /* istanbul ignore next */ []));
1626
+ isSwitching = computed(() => !!this.#context.switchingId(), ...(ngDevMode ? [{ debugName: "isSwitching" }] : /* istanbul ignore next */ []));
1627
+ constructor() {
1628
+ // why: switcher chuyển items vào syncItems (D-021). Sidebar mobile có switcher nằm trong drawer/sheet render
1629
+ // lười cũng tự chuyển items lúc khởi tạo (EXEC-D1) — syncItems idempotent nên gọi lặp không ghi/reload thêm.
1630
+ // untracked để signal đọc trong service không thành dependency của effect. Không có configuration thì không
1631
+ // gọi — app không cấu hình context không tạo listener.
1632
+ effect(() => {
1633
+ const configuration = this.configuration();
1634
+ if (!configuration)
1635
+ return;
1636
+ const items = configuration.items;
1637
+ untracked(() => this.#context.syncItems(items));
1638
+ });
1639
+ // why: đổi appearance (thu gọn/mở rộng) hoặc còn ≤ 1 mục khi đang mở thì đóng hẳn, tránh overlay mồ côi.
1640
+ effect(() => {
1641
+ this.appearance();
1642
+ this.canOpen();
1643
+ untracked(() => this.close(false));
1644
+ });
1645
+ inject(DestroyRef).onDestroy(() => this.#disposeSheet());
1646
+ }
1647
+ /** Opens or closes the popover (header, rail) or the bottom sheet (sheet). */
1648
+ toggle() {
1649
+ if (this.#isOpen())
1650
+ this.close();
1651
+ else
1652
+ this.open();
1653
+ }
1654
+ /** Opens the popover or the bottom sheet; ignored with fewer than two contexts. */
1655
+ open() {
1656
+ if (this.#isOpen() || !this.canOpen())
1657
+ return;
1658
+ this.query.set('');
1659
+ if (this.appearance() === 'sheet') {
1660
+ this.#isOpen.set(true);
1661
+ this.#openSheet();
1662
+ return;
1663
+ }
1664
+ // why: đo lúc mở — popover nằm ngoài sidebar nên không kế thừa được kích thước/biến CSS của nó.
1665
+ this.popoverOrigin.set(this.#resolveOrigin());
1666
+ this.popoverWidth.set(this.#resolvePopoverWidth());
1667
+ this.#isOpen.set(true);
1668
+ }
1669
+ /** Closes the popover or the bottom sheet; focus returns to the trigger unless `restoreFocus` is false. */
1670
+ close(restoreFocus = true) {
1671
+ if (!this.#isOpen())
1672
+ return;
1673
+ this.#isOpen.set(false);
1674
+ this.query.set('');
1675
+ this.#disposeSheet();
1676
+ if (restoreFocus)
1677
+ this.trigger()?.nativeElement.focus();
1678
+ }
1679
+ select(row) {
1680
+ // why: đang chuyển thì trang sắp reload — khoá mọi lựa chọn để setCurrentContext chỉ chạy một lần (CS2).
1681
+ if (this.isSwitching())
1682
+ return;
1683
+ if (row.active) {
1684
+ this.close();
1685
+ return;
1686
+ }
1687
+ this.#context.setCurrentContext(row.item.id);
1688
+ }
1689
+ reload() {
1690
+ this.#context.reload();
1691
+ }
1692
+ onSearch(event) {
1693
+ this.query.set(event.target.value);
1694
+ }
1695
+ onPanelKeydown(event) {
1696
+ if (event.key !== 'Escape')
1697
+ return;
1698
+ event.preventDefault();
1699
+ // why: sheet nằm trên drawer/sheet menu (D-027) — Esc chỉ đóng sheet context, không tới handler của lớp dưới.
1700
+ event.stopPropagation();
1701
+ this.close();
1702
+ }
1703
+ showAvatarImage(item) {
1704
+ return !!item?.avatar && !this.#failedAvatars().has(item.avatar);
1705
+ }
1706
+ onAvatarError(url) {
1707
+ if (!url)
1708
+ return;
1709
+ this.#failedAvatars.update(failed => new Set(failed).add(url));
1710
+ }
1711
+ #openSheet() {
1712
+ const ref = this.#overlay.create({
1713
+ positionStrategy: this.#overlay.position().global().top('0').left('0'),
1714
+ width: '100%',
1715
+ height: '100%',
1716
+ scrollStrategy: this.#overlay.scrollStrategies.block(),
1717
+ panelClass: 'sd-layout-context-switcher-sheet-pane',
1718
+ });
1719
+ this.#sheetRef = ref;
1720
+ ref.attach(new TemplatePortal(this.sheetTemplate(), this.#viewContainerRef)).detectChanges();
1721
+ }
1722
+ #disposeSheet() {
1723
+ this.#sheetRef?.dispose();
1724
+ this.#sheetRef = undefined;
1725
+ }
1726
+ /** `null` keeps the trigger as origin. */
1727
+ #resolveOrigin() {
1728
+ const anchor = this.anchor();
1729
+ if (!anchor)
1730
+ return null;
1731
+ if (this.#placement() === 'below')
1732
+ return anchor;
1733
+ const trigger = this.trigger()?.nativeElement;
1734
+ if (!trigger)
1735
+ return anchor;
1736
+ // why: mở từ mép phải của anchor (rail/aside) nhưng canh đỉnh theo trigger — một điểm gốc gộp cả hai trục.
1737
+ const anchorRect = anchor.getBoundingClientRect();
1738
+ const triggerRect = trigger.getBoundingClientRect();
1739
+ return { x: anchorRect.right, y: triggerRect.top, width: 0, height: triggerRect.height };
1740
+ }
1741
+ #resolvePopoverWidth() {
1742
+ const fromVariable = this.#document.defaultView
1743
+ ?.getComputedStyle(this.#host.nativeElement)
1744
+ .getPropertyValue(POPOVER_WIDTH_VARIABLE)
1745
+ .trim();
1746
+ if (fromVariable)
1747
+ return fromVariable;
1748
+ const anchor = this.anchor();
1749
+ if (!anchor || this.#placement() !== 'below')
1750
+ return null;
1751
+ const width = anchor.getBoundingClientRect().width - 2 * ANCHOR_INSET;
1752
+ return width > 0 ? `${width}px` : null;
1753
+ }
1754
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdLayoutContextSwitcher, deps: [], target: i0.ɵɵFactoryTarget.Component });
1755
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdLayoutContextSwitcher, isStandalone: true, selector: "sd-layout-context-switcher", inputs: { configuration: { classPropertyName: "configuration", publicName: "configuration", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, placement: { classPropertyName: "placement", publicName: "placement", isSignal: true, isRequired: false, transformFunction: null }, anchor: { classPropertyName: "anchor", publicName: "anchor", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.sd-layout-context-switcher--header": "appearance() === \"header\"", "class.sd-layout-context-switcher--rail": "appearance() === \"rail\"", "class.sd-layout-context-switcher--sheet": "appearance() === \"sheet\"" }, classAttribute: "sd-layout-context-switcher" }, viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "sheetTemplate", first: true, predicate: ["sheet"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _items = items();\n@let _appearance = appearance();\n@let _active = activeItem();\n@let _open = isOpen();\n@let _label = customLabel() ?? ('core.module.layout.context.default-label' | sdTranslate);\n@let _chooseTitle = 'core.module.layout.context.choose-title' | sdTranslate: { label: _label };\n@let _triggerName = (_active?.title ?? '') + ', ' + ('core.module.layout.context.trigger' | sdTranslate: { label: _label });\n@if (_items.length) {\n @if (!canOpen()) {\n @if (_appearance === 'rail') {\n <span\n data-context-static\n class=\"sd-layout-context-switcher__rail-avatar\"\n role=\"img\"\n [attr.title]=\"_active?.title\"\n [attr.aria-label]=\"_active?.title\">\n <ng-container\n [ngTemplateOutlet]=\"avatar\"\n [ngTemplateOutletContext]=\"{ $implicit: _active, initial: activeInitial(), active: true }\" />\n @if (changedElsewhere()) {\n <span data-context-dot class=\"sd-layout-context-switcher__dot\" aria-hidden=\"true\"></span>\n }\n </span>\n } @else {\n <span\n data-context-static\n class=\"sd-layout-context-switcher__static\"\n [class.sd-layout-context-switcher__static--sheet]=\"_appearance === 'sheet'\">\n {{ _active?.title }}\n </span>\n }\n } @else if (_appearance === 'sheet') {\n <button\n #trigger\n data-context-trigger\n type=\"button\"\n class=\"sd-layout-context-switcher__trigger sd-layout-context-switcher__trigger--sheet\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"_open\"\n [attr.aria-label]=\"_triggerName\"\n (click)=\"toggle()\">\n <span class=\"sd-layout-context-switcher__trigger-title\">{{ _active?.title }}</span>\n <sd-icon name=\"unfold_more\" size=\"20px\"></sd-icon>\n </button>\n } @else {\n <button\n #trigger\n data-context-trigger\n cdkOverlayOrigin\n #origin=\"cdkOverlayOrigin\"\n type=\"button\"\n class=\"sd-layout-context-switcher__trigger\"\n [class.sd-layout-context-switcher__trigger--header]=\"_appearance === 'header'\"\n [class.sd-layout-context-switcher__trigger--rail]=\"_appearance === 'rail'\"\n [class.sd-layout-context-switcher__trigger--open]=\"_open\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"_open\"\n [attr.aria-label]=\"_triggerName\"\n [attr.title]=\"_appearance === 'rail' ? _active?.title : null\"\n (click)=\"toggle()\">\n @if (_appearance === 'rail') {\n <span class=\"sd-layout-context-switcher__rail-avatar\">\n <ng-container\n [ngTemplateOutlet]=\"avatar\"\n [ngTemplateOutletContext]=\"{ $implicit: _active, initial: activeInitial(), active: true }\" />\n @if (changedElsewhere()) {\n <span data-context-dot class=\"sd-layout-context-switcher__dot\" aria-hidden=\"true\"></span>\n }\n </span>\n } @else {\n <span class=\"sd-layout-context-switcher__trigger-title\">{{ _active?.title }}</span>\n <sd-icon [name]=\"_open ? openIcon : 'unfold_more'\" size=\"16px\"></sd-icon>\n }\n </button>\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"popoverOrigin() ?? origin\"\n [cdkConnectedOverlayOpen]=\"_open\"\n [cdkConnectedOverlayPositions]=\"positions()\"\n [cdkConnectedOverlayViewportMargin]=\"8\"\n [cdkConnectedOverlayFlexibleDimensions]=\"false\"\n [cdkConnectedOverlayPush]=\"true\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n (backdropClick)=\"close(false)\">\n <div\n data-context-popover\n class=\"sd-layout-context-switcher__popover\"\n [class.sd-layout-context-switcher__popover--rail]=\"_appearance === 'rail'\"\n role=\"dialog\"\n [attr.aria-label]=\"_chooseTitle\"\n [style.--sd-layout-context-switcher-popover-width]=\"popoverWidth()\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onPanelKeydown($event)\">\n @if (_appearance === 'rail' && changedElsewhere()) {\n <ng-container [ngTemplateOutlet]=\"notice\" />\n }\n <ng-container [ngTemplateOutlet]=\"list\" [ngTemplateOutletContext]=\"{ $implicit: 'popover' }\" />\n </div>\n </ng-template>\n }\n\n @if (_appearance !== 'rail' && changedElsewhere()) {\n <ng-container [ngTemplateOutlet]=\"notice\" />\n }\n}\n\n<ng-template #sheet>\n <div class=\"sd-layout-context-switcher__sheet-layer\">\n <div class=\"sd-layout-context-switcher__sheet-backdrop\" aria-hidden=\"true\" (click)=\"close()\"></div>\n <div\n data-context-sheet\n class=\"sd-layout-context-switcher__sheet\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"sheetTitleId\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onPanelKeydown($event)\">\n <span class=\"sd-layout-context-switcher__handle\" aria-hidden=\"true\"></span>\n <div class=\"sd-layout-context-switcher__sheet-header\">\n <h2 class=\"sd-layout-context-switcher__sheet-title\" [id]=\"sheetTitleId\">{{ _chooseTitle }}</h2>\n <button\n data-context-close\n type=\"button\"\n class=\"sd-layout-context-switcher__close\"\n [attr.aria-label]=\"'core.common.close' | sdTranslate\"\n (click)=\"close()\">\n <sd-icon name=\"close\" size=\"22px\"></sd-icon>\n </button>\n </div>\n <ng-container [ngTemplateOutlet]=\"list\" [ngTemplateOutletContext]=\"{ $implicit: 'sheet' }\" />\n </div>\n </div>\n</ng-template>\n\n<ng-template #list let-variant>\n @let _sheet = variant === 'sheet';\n @let _switching = isSwitching();\n @if (searchable()) {\n @let _placeholder = 'core.module.layout.context.search-placeholder' | sdTranslate: { label: _label };\n <label data-context-search class=\"sd-layout-context-switcher__search\">\n <sd-icon name=\"search\" size=\"20px\"></sd-icon>\n <input\n type=\"search\"\n class=\"sd-layout-context-switcher__search-input\"\n cdkFocusInitial\n autocomplete=\"off\"\n [value]=\"query()\"\n [attr.placeholder]=\"_placeholder\"\n [attr.aria-label]=\"_placeholder\"\n (input)=\"onSearch($event)\" />\n </label>\n }\n @if (!_sheet) {\n <div data-context-label class=\"sd-layout-context-switcher__label\">{{ _label }} \u00B7 {{ _items.length }}</div>\n }\n @if (switchFailed()) {\n <div data-context-error class=\"sd-layout-context-switcher__error\" role=\"alert\">\n {{ 'core.module.layout.context.switch-failed' | sdTranslate }}\n </div>\n }\n <div class=\"sd-layout-context-switcher__list\">\n @for (row of rows(); track row.item.id) {\n @let _highlighted = row.busy || (row.active && !_switching);\n <button\n data-context-row\n type=\"button\"\n class=\"sd-layout-context-switcher__row\"\n [class.sd-layout-context-switcher__row--sheet]=\"_sheet\"\n [class.sd-layout-context-switcher__row--active]=\"row.active && !_switching\"\n [class.sd-layout-context-switcher__row--busy]=\"row.busy\"\n [attr.aria-current]=\"row.active ? 'true' : null\"\n [attr.aria-busy]=\"row.busy ? 'true' : null\"\n [attr.cdkFocusInitial]=\"row.active && !searchable() ? '' : null\"\n [disabled]=\"row.disabled\"\n (click)=\"select(row)\">\n <ng-container\n [ngTemplateOutlet]=\"avatar\"\n [ngTemplateOutletContext]=\"{ $implicit: row.item, initial: row.initial, active: _highlighted, large: _sheet }\" />\n <span class=\"sd-layout-context-switcher__row-text\">\n <span data-context-row-title class=\"sd-layout-context-switcher__row-title\">{{ row.item.title }}</span>\n @if (row.busy) {\n <span data-context-row-subtitle class=\"sd-layout-context-switcher__row-subtitle\">\n {{ 'core.module.layout.context.switching' | sdTranslate }}\n </span>\n } @else if (row.item.subtitle) {\n <span data-context-row-subtitle class=\"sd-layout-context-switcher__row-subtitle\">{{ row.item.subtitle }}</span>\n }\n </span>\n @if (row.busy) {\n <sd-icon\n class=\"sd-layout-context-switcher__row-icon sd-layout-context-switcher__spinner\"\n name=\"refresh\"\n [size]=\"_sheet ? '22px' : '20px'\"></sd-icon>\n } @else if (row.active && !_switching) {\n <sd-icon class=\"sd-layout-context-switcher__row-icon\" name=\"check\" [size]=\"_sheet ? '22px' : '20px'\"></sd-icon>\n }\n </button>\n }\n </div>\n</ng-template>\n\n<ng-template #avatar let-item let-initial=\"initial\" let-active=\"active\" let-large=\"large\">\n <span\n data-context-avatar\n class=\"sd-layout-context-switcher__avatar\"\n [class.sd-layout-context-switcher__avatar--active]=\"active\"\n [class.sd-layout-context-switcher__avatar--large]=\"large\"\n aria-hidden=\"true\">\n @if (showAvatarImage(item)) {\n <img [src]=\"item.avatar\" alt=\"\" (error)=\"onAvatarError(item.avatar)\" />\n } @else {\n {{ initial }}\n }\n </span>\n</ng-template>\n\n<ng-template #notice>\n <div data-context-notice class=\"sd-layout-context-switcher__notice\" role=\"status\">\n <span class=\"sd-layout-context-switcher__notice-text\">{{ 'core.module.layout.context.changed-elsewhere' | sdTranslate }}</span>\n <button data-context-reload type=\"button\" class=\"sd-layout-context-switcher__notice-action\" (click)=\"reload()\">\n {{ 'core.common.reload' | sdTranslate }}\n </button>\n </div>\n</ng-template>\n", styles: [":host{--sd-layout-context-switcher-hover-bg: color-mix(in srgb, var(--sd-text) 6%, transparent);--sd-layout-context-switcher-muted-ink: color-mix(in srgb, var(--sd-text) 60%, transparent);display:block;min-width:0;color:var(--sd-text)}:host(.sd-layout-context-switcher--rail){display:flex;justify-content:center}.sd-layout-context-switcher__popover,.sd-layout-context-switcher__sheet{--sd-layout-context-switcher-hover-bg: color-mix(in srgb, var(--sd-text) 6%, transparent);--sd-layout-context-switcher-muted-ink: color-mix(in srgb, var(--sd-text) 60%, transparent)}.sd-layout-context-switcher__trigger{display:inline-flex;align-items:center;max-width:100%;min-width:0;margin:0;padding:0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease}.sd-layout-context-switcher__trigger:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary))}.sd-layout-context-switcher__trigger--header{gap:2px;margin-inline-start:-6px;padding:2px 4px 2px 6px;border-radius:var(--sd-radius-12, 12px);color:var(--sd-text-secondary);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px)}.sd-layout-context-switcher__trigger--header:hover,.sd-layout-context-switcher__trigger--header.sd-layout-context-switcher__trigger--open{background:var(--sd-layout-context-switcher-hover-bg)}.sd-layout-context-switcher__trigger--sheet{justify-content:space-between;gap:var(--sd-space-8, 8px);width:100%;min-height:44px;padding:0 var(--sd-space-12, 12px);border-radius:var(--sd-radius-999, 999px);color:var(--sd-text-secondary);font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px)}.sd-layout-context-switcher__trigger--sheet:hover{background:var(--sd-layout-context-switcher-hover-bg)}.sd-layout-context-switcher__trigger-title,.sd-layout-context-switcher__static{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sd-layout-context-switcher__static{display:block;color:var(--sd-text-secondary);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px)}.sd-layout-context-switcher__static--sheet{display:flex;align-items:center;min-height:44px;padding:0 var(--sd-space-12, 12px);font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px)}.sd-layout-context-switcher__trigger--rail{flex:none;justify-content:center;width:28px;max-width:none;height:28px;border-radius:var(--sd-radius-8, 8px)}.sd-layout-context-switcher__trigger--rail:focus-visible{outline:2px solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px;box-shadow:none}.sd-layout-context-switcher__rail-avatar{position:relative;display:inline-flex}.sd-layout-context-switcher__dot{position:absolute;top:-3px;right:-3px;width:8px;height:8px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-primary);box-shadow:0 0 0 2px var(--sd-layout-context-switcher-dot-ring-color, var(--sd-surface))}.sd-layout-context-switcher__avatar{display:inline-flex;flex:none;align-items:center;justify-content:center;width:28px;height:28px;overflow:hidden;border-radius:var(--sd-radius-8, 8px);background:color-mix(in srgb,var(--sd-text) 10%,var(--sd-surface));color:var(--sd-text-secondary);font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:1}.sd-layout-context-switcher__avatar img{display:block;width:100%;height:100%;object-fit:cover}.sd-layout-context-switcher__avatar--active{background:var(--sd-primary);color:var(--sd-primary-contrast)}.sd-layout-context-switcher__avatar--large{width:32px;height:32px;font-size:var(--sd-font-size-12, 12px)}.sd-layout-context-switcher__popover{box-sizing:border-box;width:var(--sd-layout-context-switcher-popover-width, min(256px, 100vw - 32px));padding:var(--sd-space-8, 8px);border:1px solid color-mix(in srgb,var(--sd-border) 45%,var(--sd-surface));border-radius:var(--sd-radius-16, 16px);background:var(--sd-surface);color:var(--sd-text);box-shadow:0 6px 24px color-mix(in srgb,var(--sd-text) 14%,transparent)}.sd-layout-context-switcher__popover--rail{width:232px}.sd-layout-context-switcher__search{display:flex;align-items:center;gap:var(--sd-space-8, 8px);height:36px;padding:0 var(--sd-space-12, 12px);border-radius:var(--sd-radius-999, 999px);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--sd-border) 55%,var(--sd-surface));color:var(--sd-text-secondary);cursor:text}.sd-layout-context-switcher__search:focus-within{box-shadow:inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary))}.sd-layout-context-switcher__search-input{flex:1;min-width:0;padding:0;border:0;background:transparent;color:var(--sd-text);font:inherit;font-size:var(--sd-font-size-13, 13px);appearance:none}.sd-layout-context-switcher__search-input::-webkit-search-decoration{appearance:none}.sd-layout-context-switcher__search-input::placeholder{color:var(--sd-layout-context-switcher-muted-ink)}.sd-layout-context-switcher__search-input:focus,.sd-layout-context-switcher__search-input:focus-visible{outline:none}.sd-layout-context-switcher__label{padding:10px var(--sd-space-12, 12px) var(--sd-space-4, 4px);color:var(--sd-text-secondary);font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-16, 16px);letter-spacing:.3px}.sd-layout-context-switcher__label:first-child{padding-top:var(--sd-space-6, 6px)}.sd-layout-context-switcher__error{margin:var(--sd-space-4, 4px) var(--sd-space-12, 12px);color:var(--sd-error);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px)}.sd-layout-context-switcher__list{display:flex;flex-direction:column;max-height:336px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}.sd-layout-context-switcher__row{display:flex;flex:none;align-items:center;gap:var(--sd-space-12, 12px);width:100%;min-height:48px;margin:0;padding:0 var(--sd-space-12, 12px);border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-text);font:inherit;text-align:left;cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease}.sd-layout-context-switcher__row:hover:not(:disabled){background:var(--sd-layout-context-switcher-hover-bg)}.sd-layout-context-switcher__row:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary))}.sd-layout-context-switcher__row:disabled{color:var(--sd-layout-context-switcher-muted-ink);cursor:default}.sd-layout-context-switcher__row:disabled .sd-layout-context-switcher__avatar{background:color-mix(in srgb,var(--sd-text) 6%,var(--sd-surface));color:var(--sd-layout-context-switcher-muted-ink)}.sd-layout-context-switcher__row:disabled .sd-layout-context-switcher__row-subtitle{color:inherit}.sd-layout-context-switcher__row--active,.sd-layout-context-switcher__row--active:hover:not(:disabled),.sd-layout-context-switcher__row--busy,.sd-layout-context-switcher__row--busy:hover:not(:disabled){background:var(--sd-primary-light)}.sd-layout-context-switcher__row--active .sd-layout-context-switcher__row-title,.sd-layout-context-switcher__row--busy .sd-layout-context-switcher__row-title{color:var(--sd-primary);font-weight:var(--sd-font-weight-medium, 500)}.sd-layout-context-switcher__row--busy{cursor:progress}.sd-layout-context-switcher__row-text{display:flex;flex:1;flex-direction:column;min-width:0}.sd-layout-context-switcher__row-title,.sd-layout-context-switcher__row-subtitle{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sd-layout-context-switcher__row-title{font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px)}.sd-layout-context-switcher__row-subtitle{color:var(--sd-text-secondary);font-size:11.5px;line-height:var(--sd-line-height-16, 16px)}.sd-layout-context-switcher__row-icon{color:var(--sd-primary)}.sd-layout-context-switcher__spinner{animation:sd-layout-context-switcher-spin 1s linear infinite}@keyframes sd-layout-context-switcher-spin{to{transform:rotate(360deg)}}.sd-layout-context-switcher__row--sheet{gap:14px;min-height:56px;padding:0 var(--sd-space-16, 16px)}.sd-layout-context-switcher__row--sheet .sd-layout-context-switcher__row-title{font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px)}.sd-layout-context-switcher__row--sheet .sd-layout-context-switcher__row-subtitle{font-size:var(--sd-font-size-12, 12px)}.sd-layout-context-switcher__notice{display:flex;flex-wrap:wrap;align-items:center;gap:var(--sd-space-4, 4px) var(--sd-space-8, 8px);margin-top:var(--sd-space-6, 6px);padding:var(--sd-space-6, 6px) var(--sd-space-6, 6px) var(--sd-space-6, 6px) var(--sd-space-10, 10px);border-radius:var(--sd-radius-12, 12px);background:var(--sd-primary-light);color:var(--sd-text);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px)}.sd-layout-context-switcher__popover>.sd-layout-context-switcher__notice:first-child{margin:0 0 var(--sd-space-6, 6px)}.sd-layout-context-switcher__notice-text{flex:1 1 auto;min-width:0}.sd-layout-context-switcher__notice-action{min-height:28px;padding:0 var(--sd-space-10, 10px);border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-primary);font:inherit;font-weight:var(--sd-font-weight-medium, 500);cursor:pointer}.sd-layout-context-switcher__notice-action:hover{background:color-mix(in srgb,var(--sd-primary) 10%,transparent)}.sd-layout-context-switcher__notice-action:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary))}.sd-layout-context-switcher__sheet-layer{position:relative;display:flex;flex-direction:column;justify-content:flex-end;width:100%;height:100%}.sd-layout-context-switcher__sheet-backdrop{position:absolute;inset:0;background:var(--sd-overlay-backdrop, color-mix(in srgb, var(--sd-text) 40%, transparent))}.sd-layout-context-switcher__sheet{position:relative;display:flex;flex-direction:column;box-sizing:border-box;max-height:85dvh;padding:var(--sd-space-8, 8px) var(--sd-space-8, 8px) calc(28px + env(safe-area-inset-bottom,0px));border-radius:28px 28px 0 0;background:var(--sd-surface);color:var(--sd-text)}.sd-layout-context-switcher__sheet .sd-layout-context-switcher__search{flex:none;margin:0 var(--sd-space-8, 8px) var(--sd-space-8, 8px)}.sd-layout-context-switcher__sheet .sd-layout-context-switcher__list{flex:1 1 auto;min-height:0;max-height:none}.sd-layout-context-switcher__handle{flex:none;align-self:center;width:32px;height:4px;margin:var(--sd-space-4, 4px) 0 var(--sd-space-8, 8px);border-radius:var(--sd-radius-2, 2px);background:var(--sd-border)}.sd-layout-context-switcher__sheet-header{display:flex;flex:none;align-items:center;min-height:48px;padding:0 var(--sd-space-4, 4px) 0 var(--sd-space-16, 16px)}.sd-layout-context-switcher__sheet-title{flex:1;min-width:0;margin:0;overflow:hidden;color:var(--sd-text);font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-24, 24px);text-overflow:ellipsis;white-space:nowrap}.sd-layout-context-switcher__close{display:inline-flex;flex:none;align-items:center;justify-content:center;width:44px;height:44px;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-text-secondary);cursor:pointer}.sd-layout-context-switcher__close:hover{background:var(--sd-layout-context-switcher-hover-bg)}.sd-layout-context-switcher__close:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary))}@media(pointer:coarse){.sd-layout-context-switcher__trigger--header,.sd-layout-context-switcher__notice-action{min-height:44px}.sd-layout-context-switcher__trigger--rail{width:44px;height:44px;margin:-8px;border-radius:var(--sd-radius-16, 16px)}.sd-layout-context-switcher__trigger--rail:focus-visible{outline-offset:-6px}.sd-layout-context-switcher__search{height:44px}}@media(prefers-reduced-motion:reduce){.sd-layout-context-switcher__trigger,.sd-layout-context-switcher__row{transition:none}.sd-layout-context-switcher__spinner{animation:none}}\n"], dependencies: [{ kind: "directive", type: CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1756
+ }
1757
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdLayoutContextSwitcher, decorators: [{
1758
+ type: Component,
1759
+ args: [{ selector: 'sd-layout-context-switcher', standalone: true, imports: [CdkConnectedOverlay, CdkOverlayOrigin, CdkTrapFocus, NgTemplateOutlet, SdIcon, SdTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, host: {
1760
+ class: 'sd-layout-context-switcher',
1761
+ '[class.sd-layout-context-switcher--header]': 'appearance() === "header"',
1762
+ '[class.sd-layout-context-switcher--rail]': 'appearance() === "rail"',
1763
+ '[class.sd-layout-context-switcher--sheet]': 'appearance() === "sheet"',
1764
+ }, template: "@let _items = items();\n@let _appearance = appearance();\n@let _active = activeItem();\n@let _open = isOpen();\n@let _label = customLabel() ?? ('core.module.layout.context.default-label' | sdTranslate);\n@let _chooseTitle = 'core.module.layout.context.choose-title' | sdTranslate: { label: _label };\n@let _triggerName = (_active?.title ?? '') + ', ' + ('core.module.layout.context.trigger' | sdTranslate: { label: _label });\n@if (_items.length) {\n @if (!canOpen()) {\n @if (_appearance === 'rail') {\n <span\n data-context-static\n class=\"sd-layout-context-switcher__rail-avatar\"\n role=\"img\"\n [attr.title]=\"_active?.title\"\n [attr.aria-label]=\"_active?.title\">\n <ng-container\n [ngTemplateOutlet]=\"avatar\"\n [ngTemplateOutletContext]=\"{ $implicit: _active, initial: activeInitial(), active: true }\" />\n @if (changedElsewhere()) {\n <span data-context-dot class=\"sd-layout-context-switcher__dot\" aria-hidden=\"true\"></span>\n }\n </span>\n } @else {\n <span\n data-context-static\n class=\"sd-layout-context-switcher__static\"\n [class.sd-layout-context-switcher__static--sheet]=\"_appearance === 'sheet'\">\n {{ _active?.title }}\n </span>\n }\n } @else if (_appearance === 'sheet') {\n <button\n #trigger\n data-context-trigger\n type=\"button\"\n class=\"sd-layout-context-switcher__trigger sd-layout-context-switcher__trigger--sheet\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"_open\"\n [attr.aria-label]=\"_triggerName\"\n (click)=\"toggle()\">\n <span class=\"sd-layout-context-switcher__trigger-title\">{{ _active?.title }}</span>\n <sd-icon name=\"unfold_more\" size=\"20px\"></sd-icon>\n </button>\n } @else {\n <button\n #trigger\n data-context-trigger\n cdkOverlayOrigin\n #origin=\"cdkOverlayOrigin\"\n type=\"button\"\n class=\"sd-layout-context-switcher__trigger\"\n [class.sd-layout-context-switcher__trigger--header]=\"_appearance === 'header'\"\n [class.sd-layout-context-switcher__trigger--rail]=\"_appearance === 'rail'\"\n [class.sd-layout-context-switcher__trigger--open]=\"_open\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"_open\"\n [attr.aria-label]=\"_triggerName\"\n [attr.title]=\"_appearance === 'rail' ? _active?.title : null\"\n (click)=\"toggle()\">\n @if (_appearance === 'rail') {\n <span class=\"sd-layout-context-switcher__rail-avatar\">\n <ng-container\n [ngTemplateOutlet]=\"avatar\"\n [ngTemplateOutletContext]=\"{ $implicit: _active, initial: activeInitial(), active: true }\" />\n @if (changedElsewhere()) {\n <span data-context-dot class=\"sd-layout-context-switcher__dot\" aria-hidden=\"true\"></span>\n }\n </span>\n } @else {\n <span class=\"sd-layout-context-switcher__trigger-title\">{{ _active?.title }}</span>\n <sd-icon [name]=\"_open ? openIcon : 'unfold_more'\" size=\"16px\"></sd-icon>\n }\n </button>\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"popoverOrigin() ?? origin\"\n [cdkConnectedOverlayOpen]=\"_open\"\n [cdkConnectedOverlayPositions]=\"positions()\"\n [cdkConnectedOverlayViewportMargin]=\"8\"\n [cdkConnectedOverlayFlexibleDimensions]=\"false\"\n [cdkConnectedOverlayPush]=\"true\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n (backdropClick)=\"close(false)\">\n <div\n data-context-popover\n class=\"sd-layout-context-switcher__popover\"\n [class.sd-layout-context-switcher__popover--rail]=\"_appearance === 'rail'\"\n role=\"dialog\"\n [attr.aria-label]=\"_chooseTitle\"\n [style.--sd-layout-context-switcher-popover-width]=\"popoverWidth()\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onPanelKeydown($event)\">\n @if (_appearance === 'rail' && changedElsewhere()) {\n <ng-container [ngTemplateOutlet]=\"notice\" />\n }\n <ng-container [ngTemplateOutlet]=\"list\" [ngTemplateOutletContext]=\"{ $implicit: 'popover' }\" />\n </div>\n </ng-template>\n }\n\n @if (_appearance !== 'rail' && changedElsewhere()) {\n <ng-container [ngTemplateOutlet]=\"notice\" />\n }\n}\n\n<ng-template #sheet>\n <div class=\"sd-layout-context-switcher__sheet-layer\">\n <div class=\"sd-layout-context-switcher__sheet-backdrop\" aria-hidden=\"true\" (click)=\"close()\"></div>\n <div\n data-context-sheet\n class=\"sd-layout-context-switcher__sheet\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"sheetTitleId\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onPanelKeydown($event)\">\n <span class=\"sd-layout-context-switcher__handle\" aria-hidden=\"true\"></span>\n <div class=\"sd-layout-context-switcher__sheet-header\">\n <h2 class=\"sd-layout-context-switcher__sheet-title\" [id]=\"sheetTitleId\">{{ _chooseTitle }}</h2>\n <button\n data-context-close\n type=\"button\"\n class=\"sd-layout-context-switcher__close\"\n [attr.aria-label]=\"'core.common.close' | sdTranslate\"\n (click)=\"close()\">\n <sd-icon name=\"close\" size=\"22px\"></sd-icon>\n </button>\n </div>\n <ng-container [ngTemplateOutlet]=\"list\" [ngTemplateOutletContext]=\"{ $implicit: 'sheet' }\" />\n </div>\n </div>\n</ng-template>\n\n<ng-template #list let-variant>\n @let _sheet = variant === 'sheet';\n @let _switching = isSwitching();\n @if (searchable()) {\n @let _placeholder = 'core.module.layout.context.search-placeholder' | sdTranslate: { label: _label };\n <label data-context-search class=\"sd-layout-context-switcher__search\">\n <sd-icon name=\"search\" size=\"20px\"></sd-icon>\n <input\n type=\"search\"\n class=\"sd-layout-context-switcher__search-input\"\n cdkFocusInitial\n autocomplete=\"off\"\n [value]=\"query()\"\n [attr.placeholder]=\"_placeholder\"\n [attr.aria-label]=\"_placeholder\"\n (input)=\"onSearch($event)\" />\n </label>\n }\n @if (!_sheet) {\n <div data-context-label class=\"sd-layout-context-switcher__label\">{{ _label }} \u00B7 {{ _items.length }}</div>\n }\n @if (switchFailed()) {\n <div data-context-error class=\"sd-layout-context-switcher__error\" role=\"alert\">\n {{ 'core.module.layout.context.switch-failed' | sdTranslate }}\n </div>\n }\n <div class=\"sd-layout-context-switcher__list\">\n @for (row of rows(); track row.item.id) {\n @let _highlighted = row.busy || (row.active && !_switching);\n <button\n data-context-row\n type=\"button\"\n class=\"sd-layout-context-switcher__row\"\n [class.sd-layout-context-switcher__row--sheet]=\"_sheet\"\n [class.sd-layout-context-switcher__row--active]=\"row.active && !_switching\"\n [class.sd-layout-context-switcher__row--busy]=\"row.busy\"\n [attr.aria-current]=\"row.active ? 'true' : null\"\n [attr.aria-busy]=\"row.busy ? 'true' : null\"\n [attr.cdkFocusInitial]=\"row.active && !searchable() ? '' : null\"\n [disabled]=\"row.disabled\"\n (click)=\"select(row)\">\n <ng-container\n [ngTemplateOutlet]=\"avatar\"\n [ngTemplateOutletContext]=\"{ $implicit: row.item, initial: row.initial, active: _highlighted, large: _sheet }\" />\n <span class=\"sd-layout-context-switcher__row-text\">\n <span data-context-row-title class=\"sd-layout-context-switcher__row-title\">{{ row.item.title }}</span>\n @if (row.busy) {\n <span data-context-row-subtitle class=\"sd-layout-context-switcher__row-subtitle\">\n {{ 'core.module.layout.context.switching' | sdTranslate }}\n </span>\n } @else if (row.item.subtitle) {\n <span data-context-row-subtitle class=\"sd-layout-context-switcher__row-subtitle\">{{ row.item.subtitle }}</span>\n }\n </span>\n @if (row.busy) {\n <sd-icon\n class=\"sd-layout-context-switcher__row-icon sd-layout-context-switcher__spinner\"\n name=\"refresh\"\n [size]=\"_sheet ? '22px' : '20px'\"></sd-icon>\n } @else if (row.active && !_switching) {\n <sd-icon class=\"sd-layout-context-switcher__row-icon\" name=\"check\" [size]=\"_sheet ? '22px' : '20px'\"></sd-icon>\n }\n </button>\n }\n </div>\n</ng-template>\n\n<ng-template #avatar let-item let-initial=\"initial\" let-active=\"active\" let-large=\"large\">\n <span\n data-context-avatar\n class=\"sd-layout-context-switcher__avatar\"\n [class.sd-layout-context-switcher__avatar--active]=\"active\"\n [class.sd-layout-context-switcher__avatar--large]=\"large\"\n aria-hidden=\"true\">\n @if (showAvatarImage(item)) {\n <img [src]=\"item.avatar\" alt=\"\" (error)=\"onAvatarError(item.avatar)\" />\n } @else {\n {{ initial }}\n }\n </span>\n</ng-template>\n\n<ng-template #notice>\n <div data-context-notice class=\"sd-layout-context-switcher__notice\" role=\"status\">\n <span class=\"sd-layout-context-switcher__notice-text\">{{ 'core.module.layout.context.changed-elsewhere' | sdTranslate }}</span>\n <button data-context-reload type=\"button\" class=\"sd-layout-context-switcher__notice-action\" (click)=\"reload()\">\n {{ 'core.common.reload' | sdTranslate }}\n </button>\n </div>\n</ng-template>\n", styles: [":host{--sd-layout-context-switcher-hover-bg: color-mix(in srgb, var(--sd-text) 6%, transparent);--sd-layout-context-switcher-muted-ink: color-mix(in srgb, var(--sd-text) 60%, transparent);display:block;min-width:0;color:var(--sd-text)}:host(.sd-layout-context-switcher--rail){display:flex;justify-content:center}.sd-layout-context-switcher__popover,.sd-layout-context-switcher__sheet{--sd-layout-context-switcher-hover-bg: color-mix(in srgb, var(--sd-text) 6%, transparent);--sd-layout-context-switcher-muted-ink: color-mix(in srgb, var(--sd-text) 60%, transparent)}.sd-layout-context-switcher__trigger{display:inline-flex;align-items:center;max-width:100%;min-width:0;margin:0;padding:0;border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease}.sd-layout-context-switcher__trigger:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary))}.sd-layout-context-switcher__trigger--header{gap:2px;margin-inline-start:-6px;padding:2px 4px 2px 6px;border-radius:var(--sd-radius-12, 12px);color:var(--sd-text-secondary);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px)}.sd-layout-context-switcher__trigger--header:hover,.sd-layout-context-switcher__trigger--header.sd-layout-context-switcher__trigger--open{background:var(--sd-layout-context-switcher-hover-bg)}.sd-layout-context-switcher__trigger--sheet{justify-content:space-between;gap:var(--sd-space-8, 8px);width:100%;min-height:44px;padding:0 var(--sd-space-12, 12px);border-radius:var(--sd-radius-999, 999px);color:var(--sd-text-secondary);font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px)}.sd-layout-context-switcher__trigger--sheet:hover{background:var(--sd-layout-context-switcher-hover-bg)}.sd-layout-context-switcher__trigger-title,.sd-layout-context-switcher__static{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sd-layout-context-switcher__static{display:block;color:var(--sd-text-secondary);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px)}.sd-layout-context-switcher__static--sheet{display:flex;align-items:center;min-height:44px;padding:0 var(--sd-space-12, 12px);font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px)}.sd-layout-context-switcher__trigger--rail{flex:none;justify-content:center;width:28px;max-width:none;height:28px;border-radius:var(--sd-radius-8, 8px)}.sd-layout-context-switcher__trigger--rail:focus-visible{outline:2px solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px;box-shadow:none}.sd-layout-context-switcher__rail-avatar{position:relative;display:inline-flex}.sd-layout-context-switcher__dot{position:absolute;top:-3px;right:-3px;width:8px;height:8px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-primary);box-shadow:0 0 0 2px var(--sd-layout-context-switcher-dot-ring-color, var(--sd-surface))}.sd-layout-context-switcher__avatar{display:inline-flex;flex:none;align-items:center;justify-content:center;width:28px;height:28px;overflow:hidden;border-radius:var(--sd-radius-8, 8px);background:color-mix(in srgb,var(--sd-text) 10%,var(--sd-surface));color:var(--sd-text-secondary);font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:1}.sd-layout-context-switcher__avatar img{display:block;width:100%;height:100%;object-fit:cover}.sd-layout-context-switcher__avatar--active{background:var(--sd-primary);color:var(--sd-primary-contrast)}.sd-layout-context-switcher__avatar--large{width:32px;height:32px;font-size:var(--sd-font-size-12, 12px)}.sd-layout-context-switcher__popover{box-sizing:border-box;width:var(--sd-layout-context-switcher-popover-width, min(256px, 100vw - 32px));padding:var(--sd-space-8, 8px);border:1px solid color-mix(in srgb,var(--sd-border) 45%,var(--sd-surface));border-radius:var(--sd-radius-16, 16px);background:var(--sd-surface);color:var(--sd-text);box-shadow:0 6px 24px color-mix(in srgb,var(--sd-text) 14%,transparent)}.sd-layout-context-switcher__popover--rail{width:232px}.sd-layout-context-switcher__search{display:flex;align-items:center;gap:var(--sd-space-8, 8px);height:36px;padding:0 var(--sd-space-12, 12px);border-radius:var(--sd-radius-999, 999px);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--sd-border) 55%,var(--sd-surface));color:var(--sd-text-secondary);cursor:text}.sd-layout-context-switcher__search:focus-within{box-shadow:inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary))}.sd-layout-context-switcher__search-input{flex:1;min-width:0;padding:0;border:0;background:transparent;color:var(--sd-text);font:inherit;font-size:var(--sd-font-size-13, 13px);appearance:none}.sd-layout-context-switcher__search-input::-webkit-search-decoration{appearance:none}.sd-layout-context-switcher__search-input::placeholder{color:var(--sd-layout-context-switcher-muted-ink)}.sd-layout-context-switcher__search-input:focus,.sd-layout-context-switcher__search-input:focus-visible{outline:none}.sd-layout-context-switcher__label{padding:10px var(--sd-space-12, 12px) var(--sd-space-4, 4px);color:var(--sd-text-secondary);font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-16, 16px);letter-spacing:.3px}.sd-layout-context-switcher__label:first-child{padding-top:var(--sd-space-6, 6px)}.sd-layout-context-switcher__error{margin:var(--sd-space-4, 4px) var(--sd-space-12, 12px);color:var(--sd-error);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px)}.sd-layout-context-switcher__list{display:flex;flex-direction:column;max-height:336px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}.sd-layout-context-switcher__row{display:flex;flex:none;align-items:center;gap:var(--sd-space-12, 12px);width:100%;min-height:48px;margin:0;padding:0 var(--sd-space-12, 12px);border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-text);font:inherit;text-align:left;cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease}.sd-layout-context-switcher__row:hover:not(:disabled){background:var(--sd-layout-context-switcher-hover-bg)}.sd-layout-context-switcher__row:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary))}.sd-layout-context-switcher__row:disabled{color:var(--sd-layout-context-switcher-muted-ink);cursor:default}.sd-layout-context-switcher__row:disabled .sd-layout-context-switcher__avatar{background:color-mix(in srgb,var(--sd-text) 6%,var(--sd-surface));color:var(--sd-layout-context-switcher-muted-ink)}.sd-layout-context-switcher__row:disabled .sd-layout-context-switcher__row-subtitle{color:inherit}.sd-layout-context-switcher__row--active,.sd-layout-context-switcher__row--active:hover:not(:disabled),.sd-layout-context-switcher__row--busy,.sd-layout-context-switcher__row--busy:hover:not(:disabled){background:var(--sd-primary-light)}.sd-layout-context-switcher__row--active .sd-layout-context-switcher__row-title,.sd-layout-context-switcher__row--busy .sd-layout-context-switcher__row-title{color:var(--sd-primary);font-weight:var(--sd-font-weight-medium, 500)}.sd-layout-context-switcher__row--busy{cursor:progress}.sd-layout-context-switcher__row-text{display:flex;flex:1;flex-direction:column;min-width:0}.sd-layout-context-switcher__row-title,.sd-layout-context-switcher__row-subtitle{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sd-layout-context-switcher__row-title{font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px)}.sd-layout-context-switcher__row-subtitle{color:var(--sd-text-secondary);font-size:11.5px;line-height:var(--sd-line-height-16, 16px)}.sd-layout-context-switcher__row-icon{color:var(--sd-primary)}.sd-layout-context-switcher__spinner{animation:sd-layout-context-switcher-spin 1s linear infinite}@keyframes sd-layout-context-switcher-spin{to{transform:rotate(360deg)}}.sd-layout-context-switcher__row--sheet{gap:14px;min-height:56px;padding:0 var(--sd-space-16, 16px)}.sd-layout-context-switcher__row--sheet .sd-layout-context-switcher__row-title{font-size:var(--sd-font-size-14, 14px);line-height:var(--sd-line-height-20, 20px)}.sd-layout-context-switcher__row--sheet .sd-layout-context-switcher__row-subtitle{font-size:var(--sd-font-size-12, 12px)}.sd-layout-context-switcher__notice{display:flex;flex-wrap:wrap;align-items:center;gap:var(--sd-space-4, 4px) var(--sd-space-8, 8px);margin-top:var(--sd-space-6, 6px);padding:var(--sd-space-6, 6px) var(--sd-space-6, 6px) var(--sd-space-6, 6px) var(--sd-space-10, 10px);border-radius:var(--sd-radius-12, 12px);background:var(--sd-primary-light);color:var(--sd-text);font-size:var(--sd-font-size-12, 12px);line-height:var(--sd-line-height-16, 16px)}.sd-layout-context-switcher__popover>.sd-layout-context-switcher__notice:first-child{margin:0 0 var(--sd-space-6, 6px)}.sd-layout-context-switcher__notice-text{flex:1 1 auto;min-width:0}.sd-layout-context-switcher__notice-action{min-height:28px;padding:0 var(--sd-space-10, 10px);border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-primary);font:inherit;font-weight:var(--sd-font-weight-medium, 500);cursor:pointer}.sd-layout-context-switcher__notice-action:hover{background:color-mix(in srgb,var(--sd-primary) 10%,transparent)}.sd-layout-context-switcher__notice-action:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary))}.sd-layout-context-switcher__sheet-layer{position:relative;display:flex;flex-direction:column;justify-content:flex-end;width:100%;height:100%}.sd-layout-context-switcher__sheet-backdrop{position:absolute;inset:0;background:var(--sd-overlay-backdrop, color-mix(in srgb, var(--sd-text) 40%, transparent))}.sd-layout-context-switcher__sheet{position:relative;display:flex;flex-direction:column;box-sizing:border-box;max-height:85dvh;padding:var(--sd-space-8, 8px) var(--sd-space-8, 8px) calc(28px + env(safe-area-inset-bottom,0px));border-radius:28px 28px 0 0;background:var(--sd-surface);color:var(--sd-text)}.sd-layout-context-switcher__sheet .sd-layout-context-switcher__search{flex:none;margin:0 var(--sd-space-8, 8px) var(--sd-space-8, 8px)}.sd-layout-context-switcher__sheet .sd-layout-context-switcher__list{flex:1 1 auto;min-height:0;max-height:none}.sd-layout-context-switcher__handle{flex:none;align-self:center;width:32px;height:4px;margin:var(--sd-space-4, 4px) 0 var(--sd-space-8, 8px);border-radius:var(--sd-radius-2, 2px);background:var(--sd-border)}.sd-layout-context-switcher__sheet-header{display:flex;flex:none;align-items:center;min-height:48px;padding:0 var(--sd-space-4, 4px) 0 var(--sd-space-16, 16px)}.sd-layout-context-switcher__sheet-title{flex:1;min-width:0;margin:0;overflow:hidden;color:var(--sd-text);font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-24, 24px);text-overflow:ellipsis;white-space:nowrap}.sd-layout-context-switcher__close{display:inline-flex;flex:none;align-items:center;justify-content:center;width:44px;height:44px;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sd-text-secondary);cursor:pointer}.sd-layout-context-switcher__close:hover{background:var(--sd-layout-context-switcher-hover-bg)}.sd-layout-context-switcher__close:focus-visible{outline:none;box-shadow:inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary))}@media(pointer:coarse){.sd-layout-context-switcher__trigger--header,.sd-layout-context-switcher__notice-action{min-height:44px}.sd-layout-context-switcher__trigger--rail{width:44px;height:44px;margin:-8px;border-radius:var(--sd-radius-16, 16px)}.sd-layout-context-switcher__trigger--rail:focus-visible{outline-offset:-6px}.sd-layout-context-switcher__search{height:44px}}@media(prefers-reduced-motion:reduce){.sd-layout-context-switcher__trigger,.sd-layout-context-switcher__row{transition:none}.sd-layout-context-switcher__spinner{animation:none}}\n"] }]
1765
+ }], ctorParameters: () => [], propDecorators: { trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], sheetTemplate: [{ type: i0.ViewChild, args: ['sheet', { isSignal: true }] }], configuration: [{ type: i0.Input, args: [{ isSignal: true, alias: "configuration", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], placement: [{ type: i0.Input, args: [{ isSignal: true, alias: "placement", required: false }] }], anchor: [{ type: i0.Input, args: [{ isSignal: true, alias: "anchor", required: false }] }] } });
1766
+ function initialOf(title) {
1767
+ const first = Array.from(title?.trim() ?? '')[0];
1768
+ return first ? first.toLocaleUpperCase() : '';
1769
+ }
1770
+
824
1771
  class SdLayoutUserMenuComponent {
825
1772
  #configuration = inject(SD_LAYOUT_CONFIGURATION, { optional: true });
826
1773
  #destroyRef = inject(DestroyRef);
@@ -966,11 +1913,11 @@ class SdLayoutUserMenuComponent {
966
1913
  return Number.isFinite(value) && Number(value) > 0 ? Math.floor(Number(value)) : 0;
967
1914
  }
968
1915
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdLayoutUserMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
969
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdLayoutUserMenuComponent, isStandalone: true, selector: "sd-layout-user-menu", inputs: { userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, signout: { classPropertyName: "signout", publicName: "signout", isSignal: true, isRequired: false, transformFunction: null }, changePassword: { classPropertyName: "changePassword", publicName: "changePassword", isSignal: true, isRequired: false, transformFunction: null }, updateProfile: { classPropertyName: "updateProfile", publicName: "updateProfile", isSignal: true, isRequired: false, transformFunction: null }, setting: { classPropertyName: "setting", publicName: "setting", isSignal: true, isRequired: false, transformFunction: null }, notification: { classPropertyName: "notification", publicName: "notification", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, presentation: { classPropertyName: "presentation", publicName: "presentation", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { opened: "opened", closed: "closed" }, viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "menu", first: true, predicate: ["menu"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _presentation = presentation();\n@let _role = role();\n@let _notificationBadge = notificationBadge();\n<div class=\"sd-layout-user-menu position-relative\">\n @if (_presentation !== 'disclosure') {\n <div class=\"sd-layout-user-menu__mobile d-flex flex-column gap-8\">\n <div\n data-mobile-account-row\n class=\"sd-layout-user-menu__mobile-row sd-layout-user-menu__mobile--inline d-flex align-items-center gap-8\">\n <div data-user-summary class=\"sd-layout-user-menu__summary d-flex align-items-center gap-8 flex-1\">\n <sd-avatar [src]=\"avatar()\" [size]=\"40\"></sd-avatar>\n <span class=\"d-flex flex-column flex-1 overflow-hidden\">\n <span class=\"T14M text-ellipsis\">{{ displayName() }}</span>\n @if (userInfo().email) {\n <span class=\"T12R text-black400 text-ellipsis\">{{ userInfo().email }}</span>\n }\n @if (_role) {\n <span\n data-user-role\n class=\"sd-layout-user-menu__role d-flex align-items-center gap-4 T12R text-ellipsis\"\n [style.color]=\"_role.color\">\n @if (_role.icon) {\n <sd-icon [name]=\"_role.icon\"></sd-icon>\n }\n {{ _role.text }}\n </span>\n }\n </span>\n </div>\n @if (signoutAction()) {\n <button\n type=\"button\"\n data-user-action=\"signout\"\n class=\"sd-layout-user-menu__action sd-layout-user-menu__signout d-flex align-items-center gap-8 px-8 py-8 T14R text-left text-error\"\n (click)=\"runSignout()\">\n <sd-icon name=\"logout\"></sd-icon>\n {{ 'core.module.layout.user.logout' | sdTranslate }}\n </button>\n }\n </div>\n\n @if (updateProfileAction() || settingAction() || notificationAction() || changePasswordAction()) {\n <div data-mobile-account-actions class=\"sd-layout-user-menu__mobile-actions d-flex flex-column gap-4\">\n @if (updateProfileAction()) {\n <button\n type=\"button\"\n data-user-action=\"update-profile\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runUpdateProfile()\">\n <sd-icon name=\"edit\"></sd-icon>\n {{ 'core.module.layout.user.update-profile' | sdTranslate }}\n </button>\n }\n @if (settingAction()) {\n <button\n type=\"button\"\n data-user-action=\"setting\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runSetting()\">\n <sd-icon name=\"settings\"></sd-icon>\n {{ 'core.module.layout.user.setting' | sdTranslate }}\n </button>\n }\n @if (notificationAction()) {\n <button\n type=\"button\"\n data-user-action=\"notification\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runNotification()\">\n <sd-icon name=\"notifications\"></sd-icon>\n <span class=\"flex-1\">{{ 'core.module.layout.user.notification' | sdTranslate }}</span>\n @if (_notificationBadge) {\n <span data-notification-badge class=\"sd-layout-user-menu__badge\">{{ _notificationBadge }}</span>\n }\n </button>\n }\n @if (changePasswordAction()) {\n <button\n type=\"button\"\n data-user-action=\"change-password\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runChangePassword()\">\n <sd-icon name=\"lock\"></sd-icon>\n {{ 'core.module.layout.user.change-password' | sdTranslate }}\n </button>\n }\n </div>\n }\n </div>\n } @else {\n <button\n #trigger\n type=\"button\"\n data-user-trigger\n class=\"sd-layout-user-menu__trigger d-flex align-items-center text-left\"\n [class.sd-layout-user-menu__trigger--compact]=\"compact()\"\n [class.w-full]=\"!compact()\"\n [class.gap-8]=\"!compact()\"\n [class.w-56]=\"compact()\"\n [class.gap-0]=\"compact()\"\n aria-haspopup=\"menu\"\n [attr.aria-label]=\"compact() ? displayName() : null\"\n [attr.aria-expanded]=\"isOpen()\"\n (click)=\"toggle()\">\n <sd-avatar [src]=\"avatar()\" [size]=\"compact() ? 32 : 40\"></sd-avatar>\n @if (!compact()) {\n <span class=\"d-flex flex-column flex-1 overflow-hidden\">\n <span class=\"T14M text-ellipsis\">{{ displayName() }}</span>\n @if (userInfo().email) {\n <span class=\"T12R text-black400 text-ellipsis\">{{ userInfo().email }}</span>\n }\n </span>\n <sd-icon [name]=\"isOpen() ? 'expand_less' : 'expand_more'\"></sd-icon>\n }\n </button>\n\n @if (isOpen()) {\n <div\n #menu\n data-user-menu\n class=\"sd-layout-user-menu__popup d-flex flex-column gap-4 p-8 bg-white border border-black200 rounded-8 mat-elevation-z4\"\n role=\"menu\"\n tabindex=\"-1\"\n (keydown)=\"onMenuKeydown($event)\">\n <div data-user-identity class=\"sd-layout-user-menu__identity d-flex align-items-center gap-8 px-8 py-4\">\n <sd-avatar [src]=\"avatar()\" [size]=\"40\"></sd-avatar>\n <span class=\"d-flex flex-column flex-1 overflow-hidden\">\n <span class=\"T14M text-ellipsis\">{{ displayName() }}</span>\n @if (userInfo().email) {\n <span class=\"T12R text-black400 text-ellipsis\">{{ userInfo().email }}</span>\n }\n @if (_role) {\n <span\n data-user-role\n class=\"sd-layout-user-menu__role d-flex align-items-center gap-4 T12R text-ellipsis\"\n [style.color]=\"_role.color\">\n @if (_role.icon) {\n <sd-icon [name]=\"_role.icon\"></sd-icon>\n }\n {{ _role.text }}\n </span>\n }\n </span>\n </div>\n @if (updateProfileAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"update-profile\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runUpdateProfile()\">\n <sd-icon name=\"edit\"></sd-icon>\n {{ 'core.module.layout.user.update-profile' | sdTranslate }}\n </button>\n }\n @if (settingAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"setting\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runSetting()\">\n <sd-icon name=\"settings\"></sd-icon>\n {{ 'core.module.layout.user.setting' | sdTranslate }}\n </button>\n }\n @if (notificationAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"notification\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runNotification()\">\n <sd-icon name=\"notifications\"></sd-icon>\n <span class=\"flex-1\">{{ 'core.module.layout.user.notification' | sdTranslate }}</span>\n @if (_notificationBadge) {\n <span data-notification-badge class=\"sd-layout-user-menu__badge\">{{ _notificationBadge }}</span>\n }\n </button>\n }\n @if (changePasswordAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"change-password\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runChangePassword()\">\n <sd-icon name=\"lock\"></sd-icon>\n {{ 'core.module.layout.user.change-password' | sdTranslate }}\n </button>\n }\n @if (signoutAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"signout\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left text-error\"\n (click)=\"runSignout()\">\n <sd-icon name=\"logout\"></sd-icon>\n {{ 'core.module.layout.user.logout' | sdTranslate }}\n </button>\n }\n </div>\n }\n }\n</div>\n", styles: [".sd-layout-user-menu__trigger,.sd-layout-user-menu__action{border:0;background:transparent;color:var(--sd-black500, var(--sd-text, #1a1b1f));cursor:pointer;border-radius:var(--sd-radius-8, 8px);transition:background-color var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}.sd-layout-user-menu__trigger:hover,.sd-layout-user-menu__action:hover{background:var(--sd-black100, var(--sd-surface-muted, #f3f3f3))}.sd-layout-user-menu__trigger:focus-visible,.sd-layout-user-menu__action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-layout-user-menu__trigger--compact{width:56px;min-height:52px;justify-content:center;gap:0;padding:0}.sd-layout-user-menu__popup{position:absolute;z-index:var(--sd-z-popover, 40);left:0;bottom:calc(100% + 8px);width:272px}.sd-layout-user-menu__popup .sd-layout-user-menu__action,.sd-layout-user-menu__mobile-actions .sd-layout-user-menu__action{width:100%}.sd-layout-user-menu__summary{min-width:0;padding:0 8px}.sd-layout-user-menu__identity{min-width:0}.sd-layout-user-menu__signout{width:auto;flex:0 0 auto;min-height:40px;white-space:nowrap}.sd-layout-user-menu__role sd-icon{width:14px;height:14px;font-size:var(--sd-font-size-14, 14px);flex:0 0 auto}.sd-layout-user-menu__badge{min-width:20px;padding:1px 6px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-error, #ba1a1a);color:var(--sd-white, #ffffff);font-size:var(--sd-font-size-11, 11px);line-height:var(--sd-line-height-18, 18px);text-align:center}.sd-layout-user-menu__signout:hover{background:var(--sd-error-light, #ffdad6);color:var(--sd-error-dark, var(--sd-error, #ba1a1a))}@media(prefers-reduced-motion:reduce){.sd-layout-user-menu__trigger,.sd-layout-user-menu__action{transition:none}}\n"], dependencies: [{ kind: "component", type: SdAvatar, selector: "sd-avatar", inputs: ["src", "size"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1916
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdLayoutUserMenuComponent, isStandalone: true, selector: "sd-layout-user-menu", inputs: { userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, signout: { classPropertyName: "signout", publicName: "signout", isSignal: true, isRequired: false, transformFunction: null }, changePassword: { classPropertyName: "changePassword", publicName: "changePassword", isSignal: true, isRequired: false, transformFunction: null }, updateProfile: { classPropertyName: "updateProfile", publicName: "updateProfile", isSignal: true, isRequired: false, transformFunction: null }, setting: { classPropertyName: "setting", publicName: "setting", isSignal: true, isRequired: false, transformFunction: null }, notification: { classPropertyName: "notification", publicName: "notification", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, presentation: { classPropertyName: "presentation", publicName: "presentation", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { opened: "opened", closed: "closed" }, viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "menu", first: true, predicate: ["menu"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _presentation = presentation();\n@let _role = role();\n@let _notificationBadge = notificationBadge();\n<div class=\"sd-layout-user-menu position-relative\">\n @if (_presentation !== 'disclosure') {\n <div class=\"sd-layout-user-menu__mobile d-flex flex-column gap-8\">\n <div\n data-mobile-account-row\n class=\"sd-layout-user-menu__mobile-row sd-layout-user-menu__mobile--inline d-flex align-items-center gap-8\">\n <div data-user-summary class=\"sd-layout-user-menu__summary d-flex align-items-center gap-8 flex-1\">\n <sd-avatar aria-hidden=\"true\" [src]=\"avatar()\" [size]=\"40\"></sd-avatar>\n <span class=\"d-flex flex-column flex-1 overflow-hidden\">\n <span class=\"T14M text-ellipsis\">{{ displayName() }}</span>\n @if (userInfo().email) {\n <span class=\"T12R text-black400 text-ellipsis\">{{ userInfo().email }}</span>\n }\n @if (_role) {\n <span\n data-user-role\n class=\"sd-layout-user-menu__role d-flex align-items-center gap-4 T12R text-ellipsis\"\n [style.color]=\"_role.color\">\n @if (_role.icon) {\n <sd-icon [name]=\"_role.icon\"></sd-icon>\n }\n {{ _role.text }}\n </span>\n }\n </span>\n </div>\n @if (signoutAction()) {\n <button\n type=\"button\"\n data-user-action=\"signout\"\n class=\"sd-layout-user-menu__action sd-layout-user-menu__signout d-flex align-items-center gap-8 px-8 py-8 T14R text-left text-error\"\n (click)=\"runSignout()\">\n <sd-icon name=\"logout\"></sd-icon>\n {{ 'core.module.layout.user.logout' | sdTranslate }}\n </button>\n }\n </div>\n\n @if (updateProfileAction() || settingAction() || notificationAction() || changePasswordAction()) {\n <div data-mobile-account-actions class=\"sd-layout-user-menu__mobile-actions d-flex flex-column gap-4\">\n @if (updateProfileAction()) {\n <button\n type=\"button\"\n data-user-action=\"update-profile\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runUpdateProfile()\">\n <sd-icon name=\"edit\"></sd-icon>\n {{ 'core.module.layout.user.update-profile' | sdTranslate }}\n </button>\n }\n @if (settingAction()) {\n <button\n type=\"button\"\n data-user-action=\"setting\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runSetting()\">\n <sd-icon name=\"settings\"></sd-icon>\n {{ 'core.module.layout.user.setting' | sdTranslate }}\n </button>\n }\n @if (notificationAction()) {\n <button\n type=\"button\"\n data-user-action=\"notification\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runNotification()\">\n <sd-icon name=\"notifications\"></sd-icon>\n <span class=\"flex-1\">{{ 'core.module.layout.user.notification' | sdTranslate }}</span>\n @if (_notificationBadge) {\n <span data-notification-badge class=\"sd-layout-user-menu__badge\">{{ _notificationBadge }}</span>\n }\n </button>\n }\n @if (changePasswordAction()) {\n <button\n type=\"button\"\n data-user-action=\"change-password\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runChangePassword()\">\n <sd-icon name=\"lock\"></sd-icon>\n {{ 'core.module.layout.user.change-password' | sdTranslate }}\n </button>\n }\n </div>\n }\n </div>\n } @else {\n <button\n #trigger\n type=\"button\"\n data-user-trigger\n class=\"sd-layout-user-menu__trigger d-flex align-items-center text-left\"\n [class.sd-layout-user-menu__trigger--compact]=\"compact()\"\n [class.w-full]=\"!compact()\"\n [class.gap-8]=\"!compact()\"\n [class.w-56]=\"compact()\"\n [class.gap-0]=\"compact()\"\n aria-haspopup=\"menu\"\n [attr.aria-label]=\"compact() ? displayName() : null\"\n [attr.aria-expanded]=\"isOpen()\"\n (click)=\"toggle()\">\n <sd-avatar aria-hidden=\"true\" [src]=\"avatar()\" [size]=\"compact() ? 32 : 40\"></sd-avatar>\n @if (!compact()) {\n <span class=\"d-flex flex-column flex-1 overflow-hidden\">\n <span class=\"T14M text-ellipsis\">{{ displayName() }}</span>\n @if (userInfo().email) {\n <span class=\"T12R text-black400 text-ellipsis\">{{ userInfo().email }}</span>\n }\n </span>\n <sd-icon [name]=\"isOpen() ? 'expand_less' : 'expand_more'\"></sd-icon>\n }\n </button>\n\n @if (isOpen()) {\n <div\n #menu\n data-user-menu\n class=\"sd-layout-user-menu__popup d-flex flex-column gap-4 p-8 bg-white border border-black200 rounded-8 mat-elevation-z4\"\n role=\"menu\"\n tabindex=\"-1\"\n (keydown)=\"onMenuKeydown($event)\">\n <div data-user-identity class=\"sd-layout-user-menu__identity d-flex align-items-center gap-8 px-8 py-4\">\n <sd-avatar aria-hidden=\"true\" [src]=\"avatar()\" [size]=\"40\"></sd-avatar>\n <span class=\"d-flex flex-column flex-1 overflow-hidden\">\n <span class=\"T14M text-ellipsis\">{{ displayName() }}</span>\n @if (userInfo().email) {\n <span class=\"T12R text-black400 text-ellipsis\">{{ userInfo().email }}</span>\n }\n @if (_role) {\n <span\n data-user-role\n class=\"sd-layout-user-menu__role d-flex align-items-center gap-4 T12R text-ellipsis\"\n [style.color]=\"_role.color\">\n @if (_role.icon) {\n <sd-icon [name]=\"_role.icon\"></sd-icon>\n }\n {{ _role.text }}\n </span>\n }\n </span>\n </div>\n @if (updateProfileAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"update-profile\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runUpdateProfile()\">\n <sd-icon name=\"edit\"></sd-icon>\n {{ 'core.module.layout.user.update-profile' | sdTranslate }}\n </button>\n }\n @if (settingAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"setting\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runSetting()\">\n <sd-icon name=\"settings\"></sd-icon>\n {{ 'core.module.layout.user.setting' | sdTranslate }}\n </button>\n }\n @if (notificationAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"notification\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runNotification()\">\n <sd-icon name=\"notifications\"></sd-icon>\n <span class=\"flex-1\">{{ 'core.module.layout.user.notification' | sdTranslate }}</span>\n @if (_notificationBadge) {\n <span data-notification-badge class=\"sd-layout-user-menu__badge\">{{ _notificationBadge }}</span>\n }\n </button>\n }\n @if (changePasswordAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"change-password\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runChangePassword()\">\n <sd-icon name=\"lock\"></sd-icon>\n {{ 'core.module.layout.user.change-password' | sdTranslate }}\n </button>\n }\n @if (signoutAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"signout\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left text-error\"\n (click)=\"runSignout()\">\n <sd-icon name=\"logout\"></sd-icon>\n {{ 'core.module.layout.user.logout' | sdTranslate }}\n </button>\n }\n </div>\n }\n }\n</div>\n", styles: [".sd-layout-user-menu__trigger,.sd-layout-user-menu__action{border:0;background:transparent;color:var(--sd-black500, var(--sd-text, #1a1b1f));cursor:pointer;border-radius:var(--sd-radius-8, 8px);transition:background-color var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}.sd-layout-user-menu__trigger:hover,.sd-layout-user-menu__action:hover{background:var(--sd-black100, var(--sd-surface-muted, #f3f3f3))}.sd-layout-user-menu__trigger:focus-visible,.sd-layout-user-menu__action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-layout-user-menu__trigger--compact{width:56px;min-height:52px;justify-content:center;gap:0;padding:0}.sd-layout-user-menu__popup{position:absolute;z-index:var(--sd-z-popover, 40);left:0;bottom:calc(100% + 8px);width:272px}.sd-layout-user-menu__popup .sd-layout-user-menu__action,.sd-layout-user-menu__mobile-actions .sd-layout-user-menu__action{width:100%}.sd-layout-user-menu__summary{min-width:0;padding:0 8px}.sd-layout-user-menu__identity{min-width:0}.sd-layout-user-menu__signout{width:auto;flex:0 0 auto;min-height:40px;white-space:nowrap}.sd-layout-user-menu__role sd-icon{width:14px;height:14px;font-size:var(--sd-font-size-14, 14px);flex:0 0 auto}.sd-layout-user-menu__badge{min-width:20px;padding:1px 6px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-error, #ba1a1a);color:var(--sd-white, #ffffff);font-size:var(--sd-font-size-11, 11px);line-height:var(--sd-line-height-18, 18px);text-align:center}.sd-layout-user-menu__signout:hover{background:var(--sd-error-light, #ffdad6);color:var(--sd-error-dark, var(--sd-error, #ba1a1a))}@media(prefers-reduced-motion:reduce){.sd-layout-user-menu__trigger,.sd-layout-user-menu__action{transition:none}}\n"], dependencies: [{ kind: "component", type: SdAvatar, selector: "sd-avatar", inputs: ["src", "size", "name", "status", "statusLabel", "statusPulse", "tooltip"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
970
1917
  }
971
1918
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdLayoutUserMenuComponent, decorators: [{
972
1919
  type: Component,
973
- args: [{ selector: 'sd-layout-user-menu', standalone: true, imports: [SdAvatar, SdIcon, SdTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let _presentation = presentation();\n@let _role = role();\n@let _notificationBadge = notificationBadge();\n<div class=\"sd-layout-user-menu position-relative\">\n @if (_presentation !== 'disclosure') {\n <div class=\"sd-layout-user-menu__mobile d-flex flex-column gap-8\">\n <div\n data-mobile-account-row\n class=\"sd-layout-user-menu__mobile-row sd-layout-user-menu__mobile--inline d-flex align-items-center gap-8\">\n <div data-user-summary class=\"sd-layout-user-menu__summary d-flex align-items-center gap-8 flex-1\">\n <sd-avatar [src]=\"avatar()\" [size]=\"40\"></sd-avatar>\n <span class=\"d-flex flex-column flex-1 overflow-hidden\">\n <span class=\"T14M text-ellipsis\">{{ displayName() }}</span>\n @if (userInfo().email) {\n <span class=\"T12R text-black400 text-ellipsis\">{{ userInfo().email }}</span>\n }\n @if (_role) {\n <span\n data-user-role\n class=\"sd-layout-user-menu__role d-flex align-items-center gap-4 T12R text-ellipsis\"\n [style.color]=\"_role.color\">\n @if (_role.icon) {\n <sd-icon [name]=\"_role.icon\"></sd-icon>\n }\n {{ _role.text }}\n </span>\n }\n </span>\n </div>\n @if (signoutAction()) {\n <button\n type=\"button\"\n data-user-action=\"signout\"\n class=\"sd-layout-user-menu__action sd-layout-user-menu__signout d-flex align-items-center gap-8 px-8 py-8 T14R text-left text-error\"\n (click)=\"runSignout()\">\n <sd-icon name=\"logout\"></sd-icon>\n {{ 'core.module.layout.user.logout' | sdTranslate }}\n </button>\n }\n </div>\n\n @if (updateProfileAction() || settingAction() || notificationAction() || changePasswordAction()) {\n <div data-mobile-account-actions class=\"sd-layout-user-menu__mobile-actions d-flex flex-column gap-4\">\n @if (updateProfileAction()) {\n <button\n type=\"button\"\n data-user-action=\"update-profile\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runUpdateProfile()\">\n <sd-icon name=\"edit\"></sd-icon>\n {{ 'core.module.layout.user.update-profile' | sdTranslate }}\n </button>\n }\n @if (settingAction()) {\n <button\n type=\"button\"\n data-user-action=\"setting\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runSetting()\">\n <sd-icon name=\"settings\"></sd-icon>\n {{ 'core.module.layout.user.setting' | sdTranslate }}\n </button>\n }\n @if (notificationAction()) {\n <button\n type=\"button\"\n data-user-action=\"notification\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runNotification()\">\n <sd-icon name=\"notifications\"></sd-icon>\n <span class=\"flex-1\">{{ 'core.module.layout.user.notification' | sdTranslate }}</span>\n @if (_notificationBadge) {\n <span data-notification-badge class=\"sd-layout-user-menu__badge\">{{ _notificationBadge }}</span>\n }\n </button>\n }\n @if (changePasswordAction()) {\n <button\n type=\"button\"\n data-user-action=\"change-password\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runChangePassword()\">\n <sd-icon name=\"lock\"></sd-icon>\n {{ 'core.module.layout.user.change-password' | sdTranslate }}\n </button>\n }\n </div>\n }\n </div>\n } @else {\n <button\n #trigger\n type=\"button\"\n data-user-trigger\n class=\"sd-layout-user-menu__trigger d-flex align-items-center text-left\"\n [class.sd-layout-user-menu__trigger--compact]=\"compact()\"\n [class.w-full]=\"!compact()\"\n [class.gap-8]=\"!compact()\"\n [class.w-56]=\"compact()\"\n [class.gap-0]=\"compact()\"\n aria-haspopup=\"menu\"\n [attr.aria-label]=\"compact() ? displayName() : null\"\n [attr.aria-expanded]=\"isOpen()\"\n (click)=\"toggle()\">\n <sd-avatar [src]=\"avatar()\" [size]=\"compact() ? 32 : 40\"></sd-avatar>\n @if (!compact()) {\n <span class=\"d-flex flex-column flex-1 overflow-hidden\">\n <span class=\"T14M text-ellipsis\">{{ displayName() }}</span>\n @if (userInfo().email) {\n <span class=\"T12R text-black400 text-ellipsis\">{{ userInfo().email }}</span>\n }\n </span>\n <sd-icon [name]=\"isOpen() ? 'expand_less' : 'expand_more'\"></sd-icon>\n }\n </button>\n\n @if (isOpen()) {\n <div\n #menu\n data-user-menu\n class=\"sd-layout-user-menu__popup d-flex flex-column gap-4 p-8 bg-white border border-black200 rounded-8 mat-elevation-z4\"\n role=\"menu\"\n tabindex=\"-1\"\n (keydown)=\"onMenuKeydown($event)\">\n <div data-user-identity class=\"sd-layout-user-menu__identity d-flex align-items-center gap-8 px-8 py-4\">\n <sd-avatar [src]=\"avatar()\" [size]=\"40\"></sd-avatar>\n <span class=\"d-flex flex-column flex-1 overflow-hidden\">\n <span class=\"T14M text-ellipsis\">{{ displayName() }}</span>\n @if (userInfo().email) {\n <span class=\"T12R text-black400 text-ellipsis\">{{ userInfo().email }}</span>\n }\n @if (_role) {\n <span\n data-user-role\n class=\"sd-layout-user-menu__role d-flex align-items-center gap-4 T12R text-ellipsis\"\n [style.color]=\"_role.color\">\n @if (_role.icon) {\n <sd-icon [name]=\"_role.icon\"></sd-icon>\n }\n {{ _role.text }}\n </span>\n }\n </span>\n </div>\n @if (updateProfileAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"update-profile\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runUpdateProfile()\">\n <sd-icon name=\"edit\"></sd-icon>\n {{ 'core.module.layout.user.update-profile' | sdTranslate }}\n </button>\n }\n @if (settingAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"setting\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runSetting()\">\n <sd-icon name=\"settings\"></sd-icon>\n {{ 'core.module.layout.user.setting' | sdTranslate }}\n </button>\n }\n @if (notificationAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"notification\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runNotification()\">\n <sd-icon name=\"notifications\"></sd-icon>\n <span class=\"flex-1\">{{ 'core.module.layout.user.notification' | sdTranslate }}</span>\n @if (_notificationBadge) {\n <span data-notification-badge class=\"sd-layout-user-menu__badge\">{{ _notificationBadge }}</span>\n }\n </button>\n }\n @if (changePasswordAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"change-password\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runChangePassword()\">\n <sd-icon name=\"lock\"></sd-icon>\n {{ 'core.module.layout.user.change-password' | sdTranslate }}\n </button>\n }\n @if (signoutAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"signout\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left text-error\"\n (click)=\"runSignout()\">\n <sd-icon name=\"logout\"></sd-icon>\n {{ 'core.module.layout.user.logout' | sdTranslate }}\n </button>\n }\n </div>\n }\n }\n</div>\n", styles: [".sd-layout-user-menu__trigger,.sd-layout-user-menu__action{border:0;background:transparent;color:var(--sd-black500, var(--sd-text, #1a1b1f));cursor:pointer;border-radius:var(--sd-radius-8, 8px);transition:background-color var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}.sd-layout-user-menu__trigger:hover,.sd-layout-user-menu__action:hover{background:var(--sd-black100, var(--sd-surface-muted, #f3f3f3))}.sd-layout-user-menu__trigger:focus-visible,.sd-layout-user-menu__action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-layout-user-menu__trigger--compact{width:56px;min-height:52px;justify-content:center;gap:0;padding:0}.sd-layout-user-menu__popup{position:absolute;z-index:var(--sd-z-popover, 40);left:0;bottom:calc(100% + 8px);width:272px}.sd-layout-user-menu__popup .sd-layout-user-menu__action,.sd-layout-user-menu__mobile-actions .sd-layout-user-menu__action{width:100%}.sd-layout-user-menu__summary{min-width:0;padding:0 8px}.sd-layout-user-menu__identity{min-width:0}.sd-layout-user-menu__signout{width:auto;flex:0 0 auto;min-height:40px;white-space:nowrap}.sd-layout-user-menu__role sd-icon{width:14px;height:14px;font-size:var(--sd-font-size-14, 14px);flex:0 0 auto}.sd-layout-user-menu__badge{min-width:20px;padding:1px 6px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-error, #ba1a1a);color:var(--sd-white, #ffffff);font-size:var(--sd-font-size-11, 11px);line-height:var(--sd-line-height-18, 18px);text-align:center}.sd-layout-user-menu__signout:hover{background:var(--sd-error-light, #ffdad6);color:var(--sd-error-dark, var(--sd-error, #ba1a1a))}@media(prefers-reduced-motion:reduce){.sd-layout-user-menu__trigger,.sd-layout-user-menu__action{transition:none}}\n"] }]
1920
+ args: [{ selector: 'sd-layout-user-menu', standalone: true, imports: [SdAvatar, SdIcon, SdTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let _presentation = presentation();\n@let _role = role();\n@let _notificationBadge = notificationBadge();\n<div class=\"sd-layout-user-menu position-relative\">\n @if (_presentation !== 'disclosure') {\n <div class=\"sd-layout-user-menu__mobile d-flex flex-column gap-8\">\n <div\n data-mobile-account-row\n class=\"sd-layout-user-menu__mobile-row sd-layout-user-menu__mobile--inline d-flex align-items-center gap-8\">\n <div data-user-summary class=\"sd-layout-user-menu__summary d-flex align-items-center gap-8 flex-1\">\n <sd-avatar aria-hidden=\"true\" [src]=\"avatar()\" [size]=\"40\"></sd-avatar>\n <span class=\"d-flex flex-column flex-1 overflow-hidden\">\n <span class=\"T14M text-ellipsis\">{{ displayName() }}</span>\n @if (userInfo().email) {\n <span class=\"T12R text-black400 text-ellipsis\">{{ userInfo().email }}</span>\n }\n @if (_role) {\n <span\n data-user-role\n class=\"sd-layout-user-menu__role d-flex align-items-center gap-4 T12R text-ellipsis\"\n [style.color]=\"_role.color\">\n @if (_role.icon) {\n <sd-icon [name]=\"_role.icon\"></sd-icon>\n }\n {{ _role.text }}\n </span>\n }\n </span>\n </div>\n @if (signoutAction()) {\n <button\n type=\"button\"\n data-user-action=\"signout\"\n class=\"sd-layout-user-menu__action sd-layout-user-menu__signout d-flex align-items-center gap-8 px-8 py-8 T14R text-left text-error\"\n (click)=\"runSignout()\">\n <sd-icon name=\"logout\"></sd-icon>\n {{ 'core.module.layout.user.logout' | sdTranslate }}\n </button>\n }\n </div>\n\n @if (updateProfileAction() || settingAction() || notificationAction() || changePasswordAction()) {\n <div data-mobile-account-actions class=\"sd-layout-user-menu__mobile-actions d-flex flex-column gap-4\">\n @if (updateProfileAction()) {\n <button\n type=\"button\"\n data-user-action=\"update-profile\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runUpdateProfile()\">\n <sd-icon name=\"edit\"></sd-icon>\n {{ 'core.module.layout.user.update-profile' | sdTranslate }}\n </button>\n }\n @if (settingAction()) {\n <button\n type=\"button\"\n data-user-action=\"setting\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runSetting()\">\n <sd-icon name=\"settings\"></sd-icon>\n {{ 'core.module.layout.user.setting' | sdTranslate }}\n </button>\n }\n @if (notificationAction()) {\n <button\n type=\"button\"\n data-user-action=\"notification\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runNotification()\">\n <sd-icon name=\"notifications\"></sd-icon>\n <span class=\"flex-1\">{{ 'core.module.layout.user.notification' | sdTranslate }}</span>\n @if (_notificationBadge) {\n <span data-notification-badge class=\"sd-layout-user-menu__badge\">{{ _notificationBadge }}</span>\n }\n </button>\n }\n @if (changePasswordAction()) {\n <button\n type=\"button\"\n data-user-action=\"change-password\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runChangePassword()\">\n <sd-icon name=\"lock\"></sd-icon>\n {{ 'core.module.layout.user.change-password' | sdTranslate }}\n </button>\n }\n </div>\n }\n </div>\n } @else {\n <button\n #trigger\n type=\"button\"\n data-user-trigger\n class=\"sd-layout-user-menu__trigger d-flex align-items-center text-left\"\n [class.sd-layout-user-menu__trigger--compact]=\"compact()\"\n [class.w-full]=\"!compact()\"\n [class.gap-8]=\"!compact()\"\n [class.w-56]=\"compact()\"\n [class.gap-0]=\"compact()\"\n aria-haspopup=\"menu\"\n [attr.aria-label]=\"compact() ? displayName() : null\"\n [attr.aria-expanded]=\"isOpen()\"\n (click)=\"toggle()\">\n <sd-avatar aria-hidden=\"true\" [src]=\"avatar()\" [size]=\"compact() ? 32 : 40\"></sd-avatar>\n @if (!compact()) {\n <span class=\"d-flex flex-column flex-1 overflow-hidden\">\n <span class=\"T14M text-ellipsis\">{{ displayName() }}</span>\n @if (userInfo().email) {\n <span class=\"T12R text-black400 text-ellipsis\">{{ userInfo().email }}</span>\n }\n </span>\n <sd-icon [name]=\"isOpen() ? 'expand_less' : 'expand_more'\"></sd-icon>\n }\n </button>\n\n @if (isOpen()) {\n <div\n #menu\n data-user-menu\n class=\"sd-layout-user-menu__popup d-flex flex-column gap-4 p-8 bg-white border border-black200 rounded-8 mat-elevation-z4\"\n role=\"menu\"\n tabindex=\"-1\"\n (keydown)=\"onMenuKeydown($event)\">\n <div data-user-identity class=\"sd-layout-user-menu__identity d-flex align-items-center gap-8 px-8 py-4\">\n <sd-avatar aria-hidden=\"true\" [src]=\"avatar()\" [size]=\"40\"></sd-avatar>\n <span class=\"d-flex flex-column flex-1 overflow-hidden\">\n <span class=\"T14M text-ellipsis\">{{ displayName() }}</span>\n @if (userInfo().email) {\n <span class=\"T12R text-black400 text-ellipsis\">{{ userInfo().email }}</span>\n }\n @if (_role) {\n <span\n data-user-role\n class=\"sd-layout-user-menu__role d-flex align-items-center gap-4 T12R text-ellipsis\"\n [style.color]=\"_role.color\">\n @if (_role.icon) {\n <sd-icon [name]=\"_role.icon\"></sd-icon>\n }\n {{ _role.text }}\n </span>\n }\n </span>\n </div>\n @if (updateProfileAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"update-profile\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runUpdateProfile()\">\n <sd-icon name=\"edit\"></sd-icon>\n {{ 'core.module.layout.user.update-profile' | sdTranslate }}\n </button>\n }\n @if (settingAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"setting\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runSetting()\">\n <sd-icon name=\"settings\"></sd-icon>\n {{ 'core.module.layout.user.setting' | sdTranslate }}\n </button>\n }\n @if (notificationAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"notification\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runNotification()\">\n <sd-icon name=\"notifications\"></sd-icon>\n <span class=\"flex-1\">{{ 'core.module.layout.user.notification' | sdTranslate }}</span>\n @if (_notificationBadge) {\n <span data-notification-badge class=\"sd-layout-user-menu__badge\">{{ _notificationBadge }}</span>\n }\n </button>\n }\n @if (changePasswordAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"change-password\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left\"\n (click)=\"runChangePassword()\">\n <sd-icon name=\"lock\"></sd-icon>\n {{ 'core.module.layout.user.change-password' | sdTranslate }}\n </button>\n }\n @if (signoutAction()) {\n <button\n type=\"button\"\n role=\"menuitem\"\n data-user-action=\"signout\"\n class=\"sd-layout-user-menu__action d-flex align-items-center gap-8 px-8 py-8 T14R text-left text-error\"\n (click)=\"runSignout()\">\n <sd-icon name=\"logout\"></sd-icon>\n {{ 'core.module.layout.user.logout' | sdTranslate }}\n </button>\n }\n </div>\n }\n }\n</div>\n", styles: [".sd-layout-user-menu__trigger,.sd-layout-user-menu__action{border:0;background:transparent;color:var(--sd-black500, var(--sd-text, #1a1b1f));cursor:pointer;border-radius:var(--sd-radius-8, 8px);transition:background-color var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}.sd-layout-user-menu__trigger:hover,.sd-layout-user-menu__action:hover{background:var(--sd-black100, var(--sd-surface-muted, #f3f3f3))}.sd-layout-user-menu__trigger:focus-visible,.sd-layout-user-menu__action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-layout-user-menu__trigger--compact{width:56px;min-height:52px;justify-content:center;gap:0;padding:0}.sd-layout-user-menu__popup{position:absolute;z-index:var(--sd-z-popover, 40);left:0;bottom:calc(100% + 8px);width:272px}.sd-layout-user-menu__popup .sd-layout-user-menu__action,.sd-layout-user-menu__mobile-actions .sd-layout-user-menu__action{width:100%}.sd-layout-user-menu__summary{min-width:0;padding:0 8px}.sd-layout-user-menu__identity{min-width:0}.sd-layout-user-menu__signout{width:auto;flex:0 0 auto;min-height:40px;white-space:nowrap}.sd-layout-user-menu__role sd-icon{width:14px;height:14px;font-size:var(--sd-font-size-14, 14px);flex:0 0 auto}.sd-layout-user-menu__badge{min-width:20px;padding:1px 6px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-error, #ba1a1a);color:var(--sd-white, #ffffff);font-size:var(--sd-font-size-11, 11px);line-height:var(--sd-line-height-18, 18px);text-align:center}.sd-layout-user-menu__signout:hover{background:var(--sd-error-light, #ffdad6);color:var(--sd-error-dark, var(--sd-error, #ba1a1a))}@media(prefers-reduced-motion:reduce){.sd-layout-user-menu__trigger,.sd-layout-user-menu__action{transition:none}}\n"] }]
974
1921
  }], ctorParameters: () => [], propDecorators: { trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], menu: [{ type: i0.ViewChild, args: ['menu', { isSignal: true }] }], userInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "userInfo", required: true }] }], signout: [{ type: i0.Input, args: [{ isSignal: true, alias: "signout", required: false }] }], changePassword: [{ type: i0.Input, args: [{ isSignal: true, alias: "changePassword", required: false }] }], updateProfile: [{ type: i0.Input, args: [{ isSignal: true, alias: "updateProfile", required: false }] }], setting: [{ type: i0.Input, args: [{ isSignal: true, alias: "setting", required: false }] }], notification: [{ type: i0.Input, args: [{ isSignal: true, alias: "notification", required: false }] }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }], presentation: [{ type: i0.Input, args: [{ isSignal: true, alias: "presentation", required: false }] }], opened: [{ type: i0.Output, args: ["opened"] }], closed: [{ type: i0.Output, args: ["closed"] }] } });
975
1922
 
976
1923
  let LayoutUserComponent$1 = class LayoutUserComponent {
@@ -1022,6 +1969,11 @@ class SdSidebarV1Panel {
1022
1969
  popupUserMenuOpened = output();
1023
1970
  showSideBar = output();
1024
1971
  // ==========================================
1972
+ // CONTEXT SWITCHER (chỉ render khi cấu hình `sidebar.context`)
1973
+ // ==========================================
1974
+ headerContextSwitcher = viewChild('headerContextSwitcher', ...(ngDevMode ? [{ debugName: "headerContextSwitcher" }] : /* istanbul ignore next */ []));
1975
+ #isContextPopoverOpen = false;
1976
+ // ==========================================
1025
1977
  // STATE SIGNALS
1026
1978
  // ==========================================
1027
1979
  isMenuLock = signal(this.#layoutStorageService.menuLockStatus?.get() ?? true, ...(ngDevMode ? [{ debugName: "isMenuLock" }] : /* istanbul ignore next */ []));
@@ -1077,6 +2029,23 @@ class SdSidebarV1Panel {
1077
2029
  this.#isFirstBindingMenu.set(false);
1078
2030
  });
1079
2031
  });
2032
+ // why: popover context nằm trong overlay CDK có backdrop phủ màn hình — chuột rời sidenav thì main thu gọn
2033
+ // sidebar đang mở tạm (hover) và huỷ luôn switcher. Báo qua cặp output popup như menu người dùng để main giữ
2034
+ // sidebar mở. Chỉ bản header: báo từ rail sẽ làm main mở rộng sidebar và thay mất switcher rail đang mở.
2035
+ effect(() => {
2036
+ const isOpen = this.headerContextSwitcher()?.isOpen() ?? false;
2037
+ untracked(() => {
2038
+ if (isOpen === this.#isContextPopoverOpen)
2039
+ return;
2040
+ this.#isContextPopoverOpen = isOpen;
2041
+ if (isOpen) {
2042
+ this.popupUserMenuOpened.emit();
2043
+ }
2044
+ else {
2045
+ this.popupUserMenuClosed.emit();
2046
+ }
2047
+ });
2048
+ });
1080
2049
  }
1081
2050
  #setupSubscriptions() {
1082
2051
  this.#router.events.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(event => {
@@ -1562,7 +2531,7 @@ class SdSidebarV1Panel {
1562
2531
  return count;
1563
2532
  };
1564
2533
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdSidebarV1Panel, deps: [], target: i0.ɵɵFactoryTarget.Component });
1565
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdSidebarV1Panel, isStandalone: true, selector: "sd-sidebar-v1-panel", inputs: { isShowSidebar: { classPropertyName: "isShowSidebar", publicName: "isShowSidebar", isSignal: true, isRequired: true, transformFunction: null }, menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: true, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null }, isMobile: { classPropertyName: "isMobile", publicName: "isMobile", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expandSideBar: "expandSideBar", popupUserMenuClosed: "popupUserMenuClosed", popupUserMenuOpened: "popupUserMenuOpened", showSideBar: "showSideBar" }, ngImport: i0, template: "@let _userInfo = userInfo();\n@let _sidebar = sidebar();\n@let _isShowSidebar = isShowSidebar();\n@let _searchText = searchText();\n@let _currentPath = currentPath();\n@let _activeMenuPath = activeMenuPath();\n@let _idMenuGroupActive = idMenuGroupActive();\n@let _pinnedMenuGroup = pinnedMenuGroup();\n\n@if (_userInfo && _sidebar) {\n <div\n class=\"wrapper\"\n [style.--sidebar-accent]=\"_sidebar.brandColor || 'var(--sd-primary, #005cbb)'\"\n [style.height]=\"isMobile() ? '100dvh' : '100%'\">\n <div class=\"c-header\">\n <div class=\"c-logo\">\n <a\n href=\"/layout/home\"\n [attr.aria-label]=\"'core.module.layout.home.tab-name' | sdTranslate\"\n (click)=\"$event.preventDefault(); openHomePage()\">\n @if (logoUrl(); as _logoUrl) {\n <img alt=\"\" [src]=\"_logoUrl\" />\n } @else {\n <sd-icon fontSet=\"material-icons-outlined\" name=\"apps\"></sd-icon>\n }\n </a>\n </div>\n <div class=\"c-title-menu-group\" [class.d-none]=\"!_isShowSidebar\">\n <span>{{ titleMenuGroup() || _sidebar.defaultTitle || 'Back Office' }}</span>\n </div>\n </div>\n <div class=\"c-body\">\n <div class=\"c-menu\">\n <div class=\"c-menu-group\">\n @if (_sidebar?.pin?.enabled && _pinnedMenuGroup.children?.length) {\n <button\n type=\"button\"\n [attr.aria-label]=\"'core.module.layout.sidebar.pinned' | sdTranslate\"\n (mouseenter)=\"onMouseOverMenuGroupNode($event, _pinnedMenuGroup)\"\n (mouseleave)=\"onMouseLeaveMenuGroupNode($event, _pinnedMenuGroup)\"\n (click)=\"expandPinnedGroup()\"\n [matTooltip]=\"'core.module.layout.sidebar.pinned' | sdTranslate\"\n [matTooltipClass]=\"'c-tooltip-menu-group-7a22ab15-0083-4d4c-9c0c-00a30bc8c140'\"\n [matTooltipPosition]=\"'right'\"\n style=\"padding: 0; margin: 0; border: none; background-color: transparent\">\n <sd-icon\n fontSet=\"material-icons-outlined\"\n class=\"c-menu-group-icon\"\n size=\"22px\"\n [ngStyle]=\"{\n color: isPinnedMenuGroupActive()\n ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)'\n : 'var(--sd-text-secondary, #44474f)',\n backgroundColor: isPinnedMenuGroupActive()\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\"\n name=\"push_pin\"></sd-icon>\n </button>\n }\n @for (nodeMenuGroup of menus(); track nodeMenuGroup.id) {\n <button\n type=\"button\"\n [attr.aria-label]=\"nodeMenuGroup.tooltipTitle || nodeMenuGroup.title\"\n (mouseenter)=\"onMouseOverMenuGroupNode($event, nodeMenuGroup)\"\n (mouseleave)=\"onMouseLeaveMenuGroupNode($event, nodeMenuGroup)\"\n (click)=\"expandMenuGroup(nodeMenuGroup)\"\n [matTooltip]=\"nodeMenuGroup.tooltipTitle || nodeMenuGroup.title\"\n [matTooltipClass]=\"'c-tooltip-menu-group-7a22ab15-0083-4d4c-9c0c-00a30bc8c140'\"\n [matTooltipPosition]=\"'right'\"\n style=\"padding: 0; margin: 0; border: none; background-color: transparent\">\n @if (nodeMenuGroup.iconUrl) {\n <span\n class=\"c-menu-group-icon\"\n size=\"22px\"\n [ngStyle]=\"{\n backgroundColor:\n _idMenuGroupActive === nodeMenuGroup?.id\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\">\n <img width=\"24px\" height=\"24px\" [src]=\"nodeMenuGroup.iconUrl\" [alt]=\"nodeMenuGroup.title\" />\n </span>\n } @else {\n <sd-icon\n fontSet=\"material-icons-outlined\"\n class=\"c-menu-group-icon\"\n size=\"22px\"\n [ngStyle]=\"{\n color:\n _idMenuGroupActive === nodeMenuGroup?.id\n ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)'\n : 'var(--sd-text-secondary, #44474f)',\n backgroundColor:\n _idMenuGroupActive === nodeMenuGroup?.id\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\"\n [name]=\"nodeMenuGroup.icon || 'widgets'\"></sd-icon>\n }\n </button>\n }\n </div>\n <div class=\"c-menu-tree\" [class.d-none]=\"!_isShowSidebar\" [attr.inert]=\"!_isShowSidebar ? '' : null\">\n @if (totalMenuInMenusByGroup() > 10) {\n <div class=\"c-menu-tree-search\">\n @let _searchLabel = 'core.module.layout.sidebar.search' | sdTranslate;\n <div class=\"c-menu-search-field\">\n <sd-icon\n class=\"c-menu-search-icon\"\n fontSet=\"material-icons-outlined\"\n name=\"search\"\n size=\"18px\"\n aria-hidden=\"true\"></sd-icon>\n <input\n #menuSearch\n class=\"c-menu-search-input\"\n type=\"search\"\n autocomplete=\"off\"\n [attr.aria-label]=\"_searchLabel\"\n [placeholder]=\"_searchLabel\"\n data-autoId=\"layout-v1-menu-search\"\n [ngModel]=\"_searchText\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"onFilterSearchText($event)\" />\n @if (_searchText) {\n <button\n type=\"button\"\n class=\"c-menu-search-clear\"\n [attr.aria-label]=\"'core.module.layout.sidebar.clear-search' | sdTranslate\"\n (click)=\"onClearSearchText(); menuSearch.focus()\">\n <sd-icon fontSet=\"material-icons-outlined\" name=\"close\" size=\"18px\" aria-hidden=\"true\"></sd-icon>\n </button>\n }\n </div>\n </div>\n }\n <div class=\"c-menu-tree-container\">\n <mat-tree [dataSource]=\"dataSource\" [treeControl]=\"treeControl\" [style.backgroundColor]=\"'transparent'\">\n <mat-nested-tree-node *matTreeNodeDef=\"let node; when: !hasChild\">\n <div\n class=\"c-menu-node\"\n [class.is-active]=\"_currentPath | menuFocus: node : _activeMenuPath\"\n (mouseenter)=\"onMouseOverMenuNode($event, node)\"\n (mouseleave)=\"onMouseLeaveMenuNode($event, node)\"\n [ngStyle]=\"{\n backgroundColor:\n (_currentPath | menuFocus: node : _activeMenuPath)\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\">\n <div class=\"c-menu-node-description\" [class.d-none]=\"!_isShowSidebar\">\n <a\n class=\"c-menu-node-description-content\"\n [href]=\"menuNodeHref(node)\"\n [attr.aria-current]=\"(_currentPath | menuFocus: node : _activeMenuPath) ? 'page' : null\"\n (click)=\"onMenuNodeClick($event, node)\"\n [ngStyle]=\"{\n color:\n (_currentPath | menuFocus: node : _activeMenuPath)\n ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)'\n : 'var(--sd-text, #1a1b1f)',\n }\">\n @if (node.iconUrl) {\n <img class=\"c-menu-node-icon\" [src]=\"node.iconUrl\" alt=\"\" />\n } @else if (node.icon) {\n <sd-icon class=\"c-menu-node-icon\" [name]=\"node.icon\" size=\"20px\" fontSet=\"material-icons-outlined\"></sd-icon>\n }\n <span class=\"c-menu-node-label\" [innerHTML]=\"node.title | highLightSearch: _searchText | sdSafeHtml\"></span>\n </a>\n\n <!-- why: n\u00FAt ghim tr\u01B0\u1EDBc \u0111\u00E2y l\u00E0 <sd-icon fontSet=\"material-icons-outlined\" (click)> \u2014 custom element kh\u00F4ng nh\u1EADn\n focus b\u00E0n ph\u00EDm v\u00E0 kh\u00F4ng c\u00F3 t\u00EAn kh\u1EA3 truy c\u1EADp, n\u00EAn kh\u00F4ng ghim \u0111\u01B0\u1EE3c b\u1EB1ng ph\u00EDm.\n \u0110\u1ED5i sang <button type=\"button\"> + aria-pressed, gi\u1ED1ng pattern \u0111\u00E3 d\u00F9ng \u1EDF\n `shared/menu-tree`. -->\n @if (_sidebar?.pin?.enabled) {\n <button\n type=\"button\"\n class=\"c-menu-node-description-icon-pin\"\n [style.opacity]=\"isPinnedNode(node) || isHoveredNode(node) ? '1' : null\"\n [style.color]=\"\n isPinnedNode(node) || isHoveredNode(node) ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)' : null\n \"\n [attr.aria-pressed]=\"isPinnedNode(node)\"\n [attr.aria-label]=\"\n (isPinnedNode(node) ? 'core.module.layout.menu.unpin' : 'core.module.layout.menu.pin')\n | sdTranslate: { title: node.title }\n \"\n (click)=\"onTogglePin($event, node)\">\n <sd-icon fontSet=\"material-icons-outlined\" size=\"18px\" name=\"push_pin\"></sd-icon>\n </button>\n }\n </div>\n </div>\n </mat-nested-tree-node>\n\n <mat-nested-tree-node\n *matTreeNodeDef=\"let node; when: hasChild\"\n [class]=\"{ expanded: treeControl.isExpanded(node), isfocus: _currentPath | menuFocus: node : _activeMenuPath }\">\n <div\n class=\"c-menu-node\"\n [class.is-ancestor]=\"_currentPath | menuFocus: node : _activeMenuPath\"\n (mouseenter)=\"onMouseOverMenuNode($event, node)\"\n (mouseleave)=\"onMouseLeaveMenuNode($event, node)\">\n <div class=\"d-flex align-items-center\" style=\"gap: 10px; width: 100%\">\n <button\n type=\"button\"\n [class.d-none]=\"!_isShowSidebar\"\n class=\"c-menu-node-description\"\n [attr.aria-expanded]=\"treeControl.isExpanded(node)\"\n (click)=\"onToggleMenuNode(node)\">\n <span class=\"c-menu-node-description-content\">\n @if (node.iconUrl) {\n <img class=\"c-menu-node-icon\" [src]=\"node.iconUrl\" alt=\"\" />\n } @else if (node.icon) {\n <sd-icon class=\"c-menu-node-icon\" [name]=\"node.icon\" size=\"20px\" fontSet=\"material-icons-outlined\"></sd-icon>\n }\n <span class=\"c-menu-node-label\" [innerHTML]=\"node.title | highLightSearch: _searchText | sdSafeHtml\"></span>\n </span>\n <sd-icon\n fontSet=\"material-icons-outlined\"\n aria-hidden=\"true\"\n size=\"18px\"\n class=\"c-menu-node-description-icon-expand\"\n [name]=\"treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'\"></sd-icon>\n </button>\n </div>\n </div>\n <div class=\"c-menu-node-group\" role=\"group\" [class.d-none]=\"!treeControl.isExpanded(node)\">\n <ng-container matTreeNodeOutlet></ng-container>\n </div>\n </mat-nested-tree-node>\n </mat-tree>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"c-footer\">\n <lib-layout-user\n [userInfo]=\"_userInfo\"\n [isMobileOrTablet]=\"isMobile()\"\n (menuOpened)=\"onUserMenuOpened()\"\n (menuClosed)=\"onUserMenuClosed()\"\n [isShowSidebar]=\"_isShowSidebar\"\n (toggleMenuLock)=\"toggleMenuLock($event)\">\n </lib-layout-user>\n </div>\n </div>\n}\n", styles: ["::ng-deep .mat-mdc-tooltip-panel:has(.c-tooltip-menu-group-7a22ab15-0083-4d4c-9c0c-00a30bc8c140){pointer-events:none}:host{display:block;height:100%}.wrapper{--sidebar-surface: var(--sd-white, #fff);--sidebar-rail: color-mix(in srgb, var(--sd-surface-muted, #e7e8ed) 35%, var(--sidebar-surface));--sidebar-line: color-mix(in srgb, var(--sd-border, #c4c6d0) 45%, var(--sidebar-surface));--sidebar-ink: var(--sd-text, #252c38);--sidebar-muted: var(--sd-text-secondary, #6b7280);position:relative;display:flex;flex-direction:column;width:min(304px,100vw);color:var(--sidebar-ink);background:linear-gradient(to right,var(--sidebar-rail) 56px,var(--sidebar-surface) 56px)}.wrapper,.wrapper *{box-sizing:border-box}.wrapper:before{content:\"\";position:absolute;inset:0 auto 0 55px;width:1px;background:var(--sidebar-line);pointer-events:none}.c-header{flex:0 0 auto;display:grid;grid-template-columns:56px minmax(0,1fr);min-height:42px}.c-logo{grid-column:1;display:grid;place-items:center;height:42px}.c-logo a{display:grid;place-items:center;width:38px;height:40px;border-radius:9px;color:var(--sidebar-muted)}.c-logo img{width:30px;height:30px;object-fit:contain}.c-title-menu-group{grid-column:2;display:flex;align-items:center;min-width:0;padding:10px 14px 12px;color:var(--sidebar-ink);font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-bold, 700);line-height:var(--sd-line-height-22, 22px);letter-spacing:-.2px;overflow-wrap:anywhere}.c-body{flex:1;min-height:0;overflow:hidden}.c-menu{display:flex;height:100%}.c-menu-group{display:flex;flex:0 0 56px;flex-direction:column;align-items:center;gap:10px;width:56px;min-height:0;margin-bottom:86px;padding:5px 0 8px;overflow-y:auto;scrollbar-width:none}.c-menu-group>button{flex:0 0 auto;border-radius:9px}.c-menu-group .c-menu-group-icon{display:flex;align-items:center;justify-content:center;width:38px;height:40px;min-height:40px;border-radius:9px;font-size:var(--sd-font-size-22, 22px)}.c-menu-group .c-menu-group-icon img{width:22px;height:22px;object-fit:contain}.c-menu-tree{display:flex;flex:1;flex-direction:column;min-width:0;min-height:0}.c-menu-tree-search{flex:0 0 auto;padding:0 14px 12px;border-bottom:1px solid var(--sidebar-line)}.c-menu-search-field{display:flex;align-items:center;gap:8px;height:36px;padding:0 9px;border:1px solid var(--sidebar-line);border-radius:7px;background:var(--sidebar-rail);color:var(--sidebar-muted)}.c-menu-search-field:hover{border-color:color-mix(in srgb,var(--sidebar-muted) 35%,var(--sidebar-surface))}.c-menu-search-field:focus-within{border-color:color-mix(in srgb,var(--sidebar-accent, var(--sd-primary, #005cbb)) 75%,var(--sidebar-surface));background:var(--sidebar-surface)}.c-menu-search-icon{flex:0 0 18px;width:18px;height:18px;font-size:var(--sd-font-size-18, 18px);pointer-events:none}.c-menu-search-input{flex:1 1 0;width:0;min-width:0;height:100%;margin:0;padding:0;border:0;border-radius:0;outline:none;box-shadow:none;appearance:none;background:transparent;color:var(--sidebar-ink);font:inherit;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-20, 20px)}.c-menu-search-input:focus,.c-menu-search-input:focus-visible{outline:none;box-shadow:none}.c-menu-search-input::placeholder{color:var(--sidebar-muted);opacity:1}.c-menu-search-input::-webkit-search-decoration,.c-menu-search-input::-webkit-search-cancel-button{appearance:none}.c-menu-search-clear{display:grid;flex:0 0 24px;place-items:center;width:24px;min-width:24px;height:24px;margin:0;padding:0;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:var(--sidebar-muted);cursor:pointer}.c-menu-search-clear sd-icon,.c-menu-search-clear mat-icon{width:18px;height:18px;font-size:var(--sd-font-size-18, 18px)}.c-menu-search-clear:hover{background:color-mix(in srgb,var(--sidebar-ink) 7%,transparent);color:var(--sidebar-ink)}.c-menu-search-clear:focus-visible{outline:1px solid var(--sidebar-accent, var(--sd-focus-ring-color, var(--sd-primary)));outline-offset:1px}.c-menu-tree-container{flex:1;min-height:0;padding:10px 8px 14px;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--sidebar-line) transparent;overscroll-behavior:contain}.c-menu-node{position:relative;display:flex;align-items:center;width:100%;min-height:40px;margin:2px 0;padding:0;border-radius:7px;cursor:pointer;color:var(--sidebar-ink);font-size:var(--sd-font-size-13, 13px);line-height:1.4}.c-menu-node-description{display:flex;flex:1;align-items:center;gap:6px;width:100%;min-width:0;min-height:40px;padding:0;border:0;border-radius:inherit;color:inherit;background:transparent;font:inherit;text-align:left;cursor:pointer}.c-menu-node-description-content{display:flex;flex:1;align-items:center;align-self:stretch;gap:9px;min-width:0;padding:8px;color:inherit;font:inherit;font-weight:var(--sd-font-weight-medium, 500);text-decoration:none}.c-menu-node-label{flex:1;min-width:0;white-space:normal;overflow-wrap:anywhere}.c-menu-node-icon{flex:0 0 20px;width:20px;height:20px;font-size:var(--sd-font-size-20, 20px);object-fit:contain;color:var(--sidebar-muted)}.c-menu-node-description-icon-expand,.c-menu-node-description-icon-pin{display:flex;flex:0 0 20px;align-items:center;justify-content:center;width:20px;height:24px;margin-right:6px;padding:0;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:var(--sidebar-muted);font-size:var(--sd-font-size-18, 18px);cursor:pointer}.c-menu-node-description-icon-pin{opacity:0}.c-menu-node-description-icon-pin:focus-visible{opacity:1!important}.c-menu-node.is-ancestor{color:var(--sidebar-accent)}.c-menu-node.is-ancestor .c-menu-node-description-content,.c-menu-node.is-ancestor .c-menu-node-icon,.c-menu-node.is-ancestor .c-menu-node-description-icon-expand{color:inherit}.c-menu-node.is-active{color:var(--sidebar-accent)}.c-menu-node.is-active .c-menu-node-icon{color:inherit}.c-menu-node.is-active:before{content:\"\";position:absolute;left:0;top:9px;bottom:9px;width:3px;border-radius:var(--sd-radius-2, 2px);background:var(--sidebar-accent)}.c-menu-node-group{position:relative;margin:0 0 7px 19px;padding:1px 0 1px 16px;border-left:1px solid var(--sidebar-line)}.c-menu-node-group .c-menu-node{min-height:34px;border-radius:var(--sd-radius-6, 6px)}.c-menu-node-group .c-menu-node-description-content{padding:7px 8px;font-weight:var(--sd-font-weight-regular, 400)}.c-menu-node-group .c-menu-node-description{min-height:34px}.c-menu-node-group .c-menu-node-icon{display:none}.c-menu-node-group .c-menu-node.is-active:before{left:-18px}.c-menu-node-group .c-menu-node.is-active .c-menu-node-description-content,.c-menu-node-group .c-menu-node.is-ancestor .c-menu-node-description-content{font-weight:var(--sd-font-weight-medium, 500)}.c-menu-node-group .c-menu-node-group{margin-left:8px;padding-left:7px}.c-menu-node-group .c-menu-node-group .c-menu-node.is-active:before{left:-9px}.c-footer{position:absolute;bottom:0;left:0;width:56px;height:86px;background:var(--sidebar-rail)}a:focus-visible,button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sidebar-accent, var(--sd-focus-ring-color, var(--sd-primary)));outline-offset:-2px}@media(pointer:coarse){.c-menu-node,.c-menu-node-group .c-menu-node,.c-menu-node-description,.c-menu-node-group .c-menu-node-description{min-height:44px}}@media(prefers-reduced-motion:reduce){.c-menu-group-icon,.c-menu-node,.c-menu-node *{transition:none!important}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: FormsModule }, { 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.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: MatTreeModule }, { kind: "directive", type: i3.MatNestedTreeNode, selector: "mat-nested-tree-node", inputs: ["matNestedTreeNode", "disabled", "tabIndex"], outputs: ["activation", "expandedChange"], exportAs: ["matNestedTreeNode"] }, { kind: "directive", type: i3.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { kind: "component", type: i3.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { kind: "directive", type: i3.MatTreeNodeOutlet, selector: "[matTreeNodeOutlet]" }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: LayoutUserComponent$1, selector: "lib-layout-user", inputs: ["isMobileOrTablet", "isMenuLock", "isShowSidebar", "userInfo"], outputs: ["menuClosed", "menuOpened", "toggleMenuLock"] }, { kind: "pipe", type: SdSafeHtmlPipe, name: "sdSafeHtml" }, { kind: "pipe", type: MenuFocusPipe, name: "menuFocus" }, { kind: "pipe", type: HighlightSearchPipe, name: "highLightSearch" }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2534
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdSidebarV1Panel, isStandalone: true, selector: "sd-sidebar-v1-panel", inputs: { isShowSidebar: { classPropertyName: "isShowSidebar", publicName: "isShowSidebar", isSignal: true, isRequired: true, transformFunction: null }, menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: true, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null }, isMobile: { classPropertyName: "isMobile", publicName: "isMobile", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { expandSideBar: "expandSideBar", popupUserMenuClosed: "popupUserMenuClosed", popupUserMenuOpened: "popupUserMenuOpened", showSideBar: "showSideBar" }, viewQueries: [{ propertyName: "headerContextSwitcher", first: true, predicate: ["headerContextSwitcher"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _userInfo = userInfo();\n@let _sidebar = sidebar();\n@let _isShowSidebar = isShowSidebar();\n@let _searchText = searchText();\n@let _currentPath = currentPath();\n@let _activeMenuPath = activeMenuPath();\n@let _idMenuGroupActive = idMenuGroupActive();\n@let _pinnedMenuGroup = pinnedMenuGroup();\n\n@if (_userInfo && _sidebar) {\n <div\n class=\"wrapper\"\n [style.--sidebar-accent]=\"_sidebar.brandColor || 'var(--sd-primary, #005cbb)'\"\n [style.height]=\"isMobile() ? '100dvh' : '100%'\">\n <div #headerElement class=\"c-header\">\n <div #logoElement class=\"c-logo\">\n <a\n href=\"/layout/home\"\n [attr.aria-label]=\"'core.module.layout.home.tab-name' | sdTranslate\"\n (click)=\"$event.preventDefault(); openHomePage()\">\n @if (logoUrl(); as _logoUrl) {\n <img alt=\"\" [src]=\"_logoUrl\" />\n } @else {\n <sd-icon fontSet=\"material-icons-outlined\" name=\"apps\"></sd-icon>\n }\n </a>\n </div>\n <!-- Context switcher (D-010): avatar ngay d\u01B0\u1EDBi logo khi thu g\u1ECDn v\u1EC1 rail, d\u00F2ng ph\u1EE5 d\u01B0\u1EDBi ti\u00EAu \u0111\u1EC1 khi m\u1EDF. -->\n @if (_sidebar.context && !_isShowSidebar) {\n <sd-layout-context-switcher class=\"c-rail-context\" appearance=\"rail\" [configuration]=\"_sidebar.context\" [anchor]=\"logoElement\" />\n }\n <div class=\"c-title-menu-group\" [class.d-none]=\"!_isShowSidebar\" [class.c-title-menu-group--context]=\"!!_sidebar.context\">\n <span>{{ titleMenuGroup() || _sidebar.defaultTitle || 'Back Office' }}</span>\n @if (_sidebar.context && _isShowSidebar) {\n <sd-layout-context-switcher\n #headerContextSwitcher\n class=\"c-header-context\"\n appearance=\"header\"\n [configuration]=\"_sidebar.context\"\n [anchor]=\"headerElement\" />\n }\n </div>\n </div>\n <div class=\"c-body\">\n <div class=\"c-menu\">\n <div class=\"c-menu-group\">\n @if (_sidebar?.pin?.enabled && _pinnedMenuGroup.children?.length) {\n <button\n type=\"button\"\n [attr.aria-label]=\"'core.module.layout.sidebar.pinned' | sdTranslate\"\n (mouseenter)=\"onMouseOverMenuGroupNode($event, _pinnedMenuGroup)\"\n (mouseleave)=\"onMouseLeaveMenuGroupNode($event, _pinnedMenuGroup)\"\n (click)=\"expandPinnedGroup()\"\n [matTooltip]=\"'core.module.layout.sidebar.pinned' | sdTranslate\"\n [matTooltipClass]=\"'c-tooltip-menu-group-7a22ab15-0083-4d4c-9c0c-00a30bc8c140'\"\n [matTooltipPosition]=\"'right'\"\n style=\"padding: 0; margin: 0; border: none; background-color: transparent\">\n <sd-icon\n fontSet=\"material-icons-outlined\"\n class=\"c-menu-group-icon\"\n size=\"22px\"\n [ngStyle]=\"{\n color: isPinnedMenuGroupActive()\n ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)'\n : 'var(--sd-text-secondary, #44474f)',\n backgroundColor: isPinnedMenuGroupActive()\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\"\n name=\"push_pin\"></sd-icon>\n </button>\n }\n @for (nodeMenuGroup of menus(); track nodeMenuGroup.id) {\n <button\n type=\"button\"\n [attr.aria-label]=\"nodeMenuGroup.tooltipTitle || nodeMenuGroup.title\"\n (mouseenter)=\"onMouseOverMenuGroupNode($event, nodeMenuGroup)\"\n (mouseleave)=\"onMouseLeaveMenuGroupNode($event, nodeMenuGroup)\"\n (click)=\"expandMenuGroup(nodeMenuGroup)\"\n [matTooltip]=\"nodeMenuGroup.tooltipTitle || nodeMenuGroup.title\"\n [matTooltipClass]=\"'c-tooltip-menu-group-7a22ab15-0083-4d4c-9c0c-00a30bc8c140'\"\n [matTooltipPosition]=\"'right'\"\n style=\"padding: 0; margin: 0; border: none; background-color: transparent\">\n @if (nodeMenuGroup.iconUrl) {\n <span\n class=\"c-menu-group-icon\"\n size=\"22px\"\n [ngStyle]=\"{\n backgroundColor:\n _idMenuGroupActive === nodeMenuGroup?.id\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\">\n <img width=\"24px\" height=\"24px\" [src]=\"nodeMenuGroup.iconUrl\" [alt]=\"nodeMenuGroup.title\" />\n </span>\n } @else {\n <sd-icon\n fontSet=\"material-icons-outlined\"\n class=\"c-menu-group-icon\"\n size=\"22px\"\n [ngStyle]=\"{\n color:\n _idMenuGroupActive === nodeMenuGroup?.id\n ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)'\n : 'var(--sd-text-secondary, #44474f)',\n backgroundColor:\n _idMenuGroupActive === nodeMenuGroup?.id\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\"\n [name]=\"nodeMenuGroup.icon || 'widgets'\"></sd-icon>\n }\n </button>\n }\n </div>\n <div class=\"c-menu-tree\" [class.d-none]=\"!_isShowSidebar\" [attr.inert]=\"!_isShowSidebar ? '' : null\">\n @if (totalMenuInMenusByGroup() > 10) {\n <div class=\"c-menu-tree-search\">\n @let _searchLabel = 'core.module.layout.sidebar.search' | sdTranslate;\n <div class=\"c-menu-search-field\">\n <sd-icon\n class=\"c-menu-search-icon\"\n fontSet=\"material-icons-outlined\"\n name=\"search\"\n size=\"18px\"\n aria-hidden=\"true\"></sd-icon>\n <input\n #menuSearch\n class=\"c-menu-search-input\"\n type=\"search\"\n autocomplete=\"off\"\n [attr.aria-label]=\"_searchLabel\"\n [placeholder]=\"_searchLabel\"\n data-autoId=\"layout-v1-menu-search\"\n [ngModel]=\"_searchText\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"onFilterSearchText($event)\" />\n @if (_searchText) {\n <button\n type=\"button\"\n class=\"c-menu-search-clear\"\n [attr.aria-label]=\"'core.module.layout.sidebar.clear-search' | sdTranslate\"\n (click)=\"onClearSearchText(); menuSearch.focus()\">\n <sd-icon fontSet=\"material-icons-outlined\" name=\"close\" size=\"18px\" aria-hidden=\"true\"></sd-icon>\n </button>\n }\n </div>\n </div>\n }\n <div class=\"c-menu-tree-container\">\n <mat-tree [dataSource]=\"dataSource\" [treeControl]=\"treeControl\" [style.backgroundColor]=\"'transparent'\">\n <mat-nested-tree-node *matTreeNodeDef=\"let node; when: !hasChild\">\n <div\n class=\"c-menu-node\"\n [class.is-active]=\"_currentPath | menuFocus: node : _activeMenuPath\"\n (mouseenter)=\"onMouseOverMenuNode($event, node)\"\n (mouseleave)=\"onMouseLeaveMenuNode($event, node)\"\n [ngStyle]=\"{\n backgroundColor:\n (_currentPath | menuFocus: node : _activeMenuPath)\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\">\n <div class=\"c-menu-node-description\" [class.d-none]=\"!_isShowSidebar\">\n <a\n class=\"c-menu-node-description-content\"\n [href]=\"menuNodeHref(node)\"\n [attr.aria-current]=\"(_currentPath | menuFocus: node : _activeMenuPath) ? 'page' : null\"\n (click)=\"onMenuNodeClick($event, node)\"\n [ngStyle]=\"{\n color:\n (_currentPath | menuFocus: node : _activeMenuPath)\n ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)'\n : 'var(--sd-text, #1a1b1f)',\n }\">\n @if (node.iconUrl) {\n <img class=\"c-menu-node-icon\" [src]=\"node.iconUrl\" alt=\"\" />\n } @else if (node.icon) {\n <sd-icon class=\"c-menu-node-icon\" [name]=\"node.icon\" size=\"20px\" fontSet=\"material-icons-outlined\"></sd-icon>\n }\n <span class=\"c-menu-node-label\" [innerHTML]=\"node.title | highLightSearch: _searchText | sdSafeHtml\"></span>\n </a>\n\n <!-- why: n\u00FAt ghim tr\u01B0\u1EDBc \u0111\u00E2y l\u00E0 <sd-icon fontSet=\"material-icons-outlined\" (click)> \u2014 custom element kh\u00F4ng nh\u1EADn\n focus b\u00E0n ph\u00EDm v\u00E0 kh\u00F4ng c\u00F3 t\u00EAn kh\u1EA3 truy c\u1EADp, n\u00EAn kh\u00F4ng ghim \u0111\u01B0\u1EE3c b\u1EB1ng ph\u00EDm.\n \u0110\u1ED5i sang <button type=\"button\"> + aria-pressed, gi\u1ED1ng pattern \u0111\u00E3 d\u00F9ng \u1EDF\n `shared/menu-tree`. -->\n @if (_sidebar?.pin?.enabled) {\n <button\n type=\"button\"\n class=\"c-menu-node-description-icon-pin\"\n [style.opacity]=\"isPinnedNode(node) || isHoveredNode(node) ? '1' : null\"\n [style.color]=\"\n isPinnedNode(node) || isHoveredNode(node) ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)' : null\n \"\n [attr.aria-pressed]=\"isPinnedNode(node)\"\n [attr.aria-label]=\"\n (isPinnedNode(node) ? 'core.module.layout.menu.unpin' : 'core.module.layout.menu.pin')\n | sdTranslate: { title: node.title }\n \"\n (click)=\"onTogglePin($event, node)\">\n <sd-icon fontSet=\"material-icons-outlined\" size=\"18px\" name=\"push_pin\"></sd-icon>\n </button>\n }\n </div>\n </div>\n </mat-nested-tree-node>\n\n <mat-nested-tree-node\n *matTreeNodeDef=\"let node; when: hasChild\"\n [class]=\"{ expanded: treeControl.isExpanded(node), isfocus: _currentPath | menuFocus: node : _activeMenuPath }\">\n <div\n class=\"c-menu-node\"\n [class.is-ancestor]=\"_currentPath | menuFocus: node : _activeMenuPath\"\n (mouseenter)=\"onMouseOverMenuNode($event, node)\"\n (mouseleave)=\"onMouseLeaveMenuNode($event, node)\">\n <div class=\"d-flex align-items-center\" style=\"gap: 10px; width: 100%\">\n <button\n type=\"button\"\n [class.d-none]=\"!_isShowSidebar\"\n class=\"c-menu-node-description\"\n [attr.aria-expanded]=\"treeControl.isExpanded(node)\"\n (click)=\"onToggleMenuNode(node)\">\n <span class=\"c-menu-node-description-content\">\n @if (node.iconUrl) {\n <img class=\"c-menu-node-icon\" [src]=\"node.iconUrl\" alt=\"\" />\n } @else if (node.icon) {\n <sd-icon class=\"c-menu-node-icon\" [name]=\"node.icon\" size=\"20px\" fontSet=\"material-icons-outlined\"></sd-icon>\n }\n <span class=\"c-menu-node-label\" [innerHTML]=\"node.title | highLightSearch: _searchText | sdSafeHtml\"></span>\n </span>\n <sd-icon\n fontSet=\"material-icons-outlined\"\n aria-hidden=\"true\"\n size=\"18px\"\n class=\"c-menu-node-description-icon-expand\"\n [name]=\"treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'\"></sd-icon>\n </button>\n </div>\n </div>\n <div class=\"c-menu-node-group\" role=\"group\" [class.d-none]=\"!treeControl.isExpanded(node)\">\n <ng-container matTreeNodeOutlet></ng-container>\n </div>\n </mat-nested-tree-node>\n </mat-tree>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"c-footer\">\n <lib-layout-user\n [userInfo]=\"_userInfo\"\n [isMobileOrTablet]=\"isMobile()\"\n (menuOpened)=\"onUserMenuOpened()\"\n (menuClosed)=\"onUserMenuClosed()\"\n [isShowSidebar]=\"_isShowSidebar\"\n (toggleMenuLock)=\"toggleMenuLock($event)\">\n </lib-layout-user>\n </div>\n </div>\n}\n", styles: ["::ng-deep .mat-mdc-tooltip-panel:has(.c-tooltip-menu-group-7a22ab15-0083-4d4c-9c0c-00a30bc8c140){pointer-events:none}:host{display:block;height:100%}.wrapper{--sidebar-surface: var(--sd-white, #fff);--sidebar-rail: color-mix(in srgb, var(--sd-surface-muted, #e7e8ed) 35%, var(--sidebar-surface));--sidebar-line: color-mix(in srgb, var(--sd-border, #c4c6d0) 45%, var(--sidebar-surface));--sidebar-ink: var(--sd-text, #252c38);--sidebar-muted: var(--sd-text-secondary, #6b7280);position:relative;display:flex;flex-direction:column;width:min(304px,100vw);color:var(--sidebar-ink);background:linear-gradient(to right,var(--sidebar-rail) 56px,var(--sidebar-surface) 56px)}.wrapper,.wrapper *{box-sizing:border-box}.wrapper:before{content:\"\";position:absolute;inset:0 auto 0 55px;width:1px;background:var(--sidebar-line);pointer-events:none}.c-header{flex:0 0 auto;display:grid;grid-template-columns:56px minmax(0,1fr);min-height:42px}.c-logo{grid-column:1;display:grid;place-items:center;height:42px}.c-logo a{display:grid;place-items:center;width:38px;height:40px;border-radius:9px;color:var(--sidebar-muted)}.c-logo img{width:30px;height:30px;object-fit:contain}.c-title-menu-group{grid-column:2;display:flex;align-items:center;min-width:0;padding:10px 14px 12px;color:var(--sidebar-ink);font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-bold, 700);line-height:var(--sd-line-height-22, 22px);letter-spacing:-.2px;overflow-wrap:anywhere}.c-title-menu-group--context{--sd-layout-context-switcher-popover-width: calc(min(304px, 100vw) - 24px) ;flex-direction:column;align-items:stretch;justify-content:center}.c-header-context{font-weight:var(--sd-font-weight-regular, 400);letter-spacing:normal}.c-rail-context{grid-column:1;grid-row:2}.c-rail-context:not(:empty){margin:4px 0 6px}@media(pointer:coarse){.c-rail-context:not(:empty){margin-top:8px}}.c-body{flex:1;min-height:0;overflow:hidden}.c-menu{display:flex;height:100%}.c-menu-group{display:flex;flex:0 0 56px;flex-direction:column;align-items:center;gap:10px;width:56px;min-height:0;margin-bottom:86px;padding:5px 0 8px;overflow-y:auto;scrollbar-width:none}.c-menu-group>button{flex:0 0 auto;border-radius:9px}.c-menu-group .c-menu-group-icon{display:flex;align-items:center;justify-content:center;width:38px;height:40px;min-height:40px;border-radius:9px;font-size:var(--sd-font-size-22, 22px)}.c-menu-group .c-menu-group-icon img{width:22px;height:22px;object-fit:contain}.c-menu-tree{display:flex;flex:1;flex-direction:column;min-width:0;min-height:0}.c-menu-tree-search{flex:0 0 auto;padding:0 14px 12px;border-bottom:1px solid var(--sidebar-line)}.c-menu-search-field{display:flex;align-items:center;gap:8px;height:36px;padding:0 9px;border:1px solid var(--sidebar-line);border-radius:7px;background:var(--sidebar-rail);color:var(--sidebar-muted)}.c-menu-search-field:hover{border-color:color-mix(in srgb,var(--sidebar-muted) 35%,var(--sidebar-surface))}.c-menu-search-field:focus-within{border-color:color-mix(in srgb,var(--sidebar-accent, var(--sd-primary, #005cbb)) 75%,var(--sidebar-surface));background:var(--sidebar-surface)}.c-menu-search-icon{flex:0 0 18px;width:18px;height:18px;font-size:var(--sd-font-size-18, 18px);pointer-events:none}.c-menu-search-input{flex:1 1 0;width:0;min-width:0;height:100%;margin:0;padding:0;border:0;border-radius:0;outline:none;box-shadow:none;appearance:none;background:transparent;color:var(--sidebar-ink);font:inherit;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-20, 20px)}.c-menu-search-input:focus,.c-menu-search-input:focus-visible{outline:none;box-shadow:none}.c-menu-search-input::placeholder{color:var(--sidebar-muted);opacity:1}.c-menu-search-input::-webkit-search-decoration,.c-menu-search-input::-webkit-search-cancel-button{appearance:none}.c-menu-search-clear{display:grid;flex:0 0 24px;place-items:center;width:24px;min-width:24px;height:24px;margin:0;padding:0;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:var(--sidebar-muted);cursor:pointer}.c-menu-search-clear sd-icon,.c-menu-search-clear mat-icon{width:18px;height:18px;font-size:var(--sd-font-size-18, 18px)}.c-menu-search-clear:hover{background:color-mix(in srgb,var(--sidebar-ink) 7%,transparent);color:var(--sidebar-ink)}.c-menu-search-clear:focus-visible{outline:1px solid var(--sidebar-accent, var(--sd-focus-ring-color, var(--sd-primary)));outline-offset:1px}.c-menu-tree-container{flex:1;min-height:0;padding:10px 8px 14px;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--sidebar-line) transparent;overscroll-behavior:contain}.c-menu-node{position:relative;display:flex;align-items:center;width:100%;min-height:40px;margin:2px 0;padding:0;border-radius:7px;cursor:pointer;color:var(--sidebar-ink);font-size:var(--sd-font-size-13, 13px);line-height:1.4}.c-menu-node-description{display:flex;flex:1;align-items:center;gap:6px;width:100%;min-width:0;min-height:40px;padding:0;border:0;border-radius:inherit;color:inherit;background:transparent;font:inherit;text-align:left;cursor:pointer}.c-menu-node-description-content{display:flex;flex:1;align-items:center;align-self:stretch;gap:9px;min-width:0;padding:8px;color:inherit;font:inherit;font-weight:var(--sd-font-weight-medium, 500);text-decoration:none}.c-menu-node-label{flex:1;min-width:0;white-space:normal;overflow-wrap:anywhere}.c-menu-node-icon{flex:0 0 20px;width:20px;height:20px;font-size:var(--sd-font-size-20, 20px);object-fit:contain;color:var(--sidebar-muted)}.c-menu-node-description-icon-expand,.c-menu-node-description-icon-pin{display:flex;flex:0 0 20px;align-items:center;justify-content:center;width:20px;height:24px;margin-right:6px;padding:0;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:var(--sidebar-muted);font-size:var(--sd-font-size-18, 18px);cursor:pointer}.c-menu-node-description-icon-pin{opacity:0}.c-menu-node-description-icon-pin:focus-visible{opacity:1!important}.c-menu-node.is-ancestor{color:var(--sidebar-accent)}.c-menu-node.is-ancestor .c-menu-node-description-content,.c-menu-node.is-ancestor .c-menu-node-icon,.c-menu-node.is-ancestor .c-menu-node-description-icon-expand{color:inherit}.c-menu-node.is-active{color:var(--sidebar-accent)}.c-menu-node.is-active .c-menu-node-icon{color:inherit}.c-menu-node.is-active:before{content:\"\";position:absolute;left:0;top:9px;bottom:9px;width:3px;border-radius:var(--sd-radius-2, 2px);background:var(--sidebar-accent)}.c-menu-node-group{position:relative;margin:0 0 7px 19px;padding:1px 0 1px 16px;border-left:1px solid var(--sidebar-line)}.c-menu-node-group .c-menu-node{min-height:34px;border-radius:var(--sd-radius-6, 6px)}.c-menu-node-group .c-menu-node-description-content{padding:7px 8px;font-weight:var(--sd-font-weight-regular, 400)}.c-menu-node-group .c-menu-node-description{min-height:34px}.c-menu-node-group .c-menu-node-icon{display:none}.c-menu-node-group .c-menu-node.is-active:before{left:-18px}.c-menu-node-group .c-menu-node.is-active .c-menu-node-description-content,.c-menu-node-group .c-menu-node.is-ancestor .c-menu-node-description-content{font-weight:var(--sd-font-weight-medium, 500)}.c-menu-node-group .c-menu-node-group{margin-left:8px;padding-left:7px}.c-menu-node-group .c-menu-node-group .c-menu-node.is-active:before{left:-9px}.c-footer{position:absolute;bottom:0;left:0;width:56px;height:86px;background:var(--sidebar-rail)}a:focus-visible,button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sidebar-accent, var(--sd-focus-ring-color, var(--sd-primary)));outline-offset:-2px}@media(pointer:coarse){.c-menu-node,.c-menu-node-group .c-menu-node,.c-menu-node-description,.c-menu-node-group .c-menu-node-description{min-height:44px}}@media(prefers-reduced-motion:reduce){.c-menu-group-icon,.c-menu-node,.c-menu-node *{transition:none!important}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: FormsModule }, { 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.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: MatTreeModule }, { kind: "directive", type: i3.MatNestedTreeNode, selector: "mat-nested-tree-node", inputs: ["matNestedTreeNode", "disabled", "tabIndex"], outputs: ["activation", "expandedChange"], exportAs: ["matNestedTreeNode"] }, { kind: "directive", type: i3.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { kind: "component", type: i3.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { kind: "directive", type: i3.MatTreeNodeOutlet, selector: "[matTreeNodeOutlet]" }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i4.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "component", type: LayoutUserComponent$1, selector: "lib-layout-user", inputs: ["isMobileOrTablet", "isMenuLock", "isShowSidebar", "userInfo"], outputs: ["menuClosed", "menuOpened", "toggleMenuLock"] }, { kind: "component", type: SdLayoutContextSwitcher, selector: "sd-layout-context-switcher", inputs: ["configuration", "appearance", "placement", "anchor"] }, { kind: "pipe", type: SdSafeHtmlPipe, name: "sdSafeHtml" }, { kind: "pipe", type: MenuFocusPipe, name: "menuFocus" }, { kind: "pipe", type: HighlightSearchPipe, name: "highLightSearch" }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1566
2535
  }
1567
2536
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdSidebarV1Panel, decorators: [{
1568
2537
  type: Component,
@@ -1578,8 +2547,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
1578
2547
  HighlightSearchPipe,
1579
2548
  LayoutUserComponent$1,
1580
2549
  SdTranslatePipe,
1581
- ], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let _userInfo = userInfo();\n@let _sidebar = sidebar();\n@let _isShowSidebar = isShowSidebar();\n@let _searchText = searchText();\n@let _currentPath = currentPath();\n@let _activeMenuPath = activeMenuPath();\n@let _idMenuGroupActive = idMenuGroupActive();\n@let _pinnedMenuGroup = pinnedMenuGroup();\n\n@if (_userInfo && _sidebar) {\n <div\n class=\"wrapper\"\n [style.--sidebar-accent]=\"_sidebar.brandColor || 'var(--sd-primary, #005cbb)'\"\n [style.height]=\"isMobile() ? '100dvh' : '100%'\">\n <div class=\"c-header\">\n <div class=\"c-logo\">\n <a\n href=\"/layout/home\"\n [attr.aria-label]=\"'core.module.layout.home.tab-name' | sdTranslate\"\n (click)=\"$event.preventDefault(); openHomePage()\">\n @if (logoUrl(); as _logoUrl) {\n <img alt=\"\" [src]=\"_logoUrl\" />\n } @else {\n <sd-icon fontSet=\"material-icons-outlined\" name=\"apps\"></sd-icon>\n }\n </a>\n </div>\n <div class=\"c-title-menu-group\" [class.d-none]=\"!_isShowSidebar\">\n <span>{{ titleMenuGroup() || _sidebar.defaultTitle || 'Back Office' }}</span>\n </div>\n </div>\n <div class=\"c-body\">\n <div class=\"c-menu\">\n <div class=\"c-menu-group\">\n @if (_sidebar?.pin?.enabled && _pinnedMenuGroup.children?.length) {\n <button\n type=\"button\"\n [attr.aria-label]=\"'core.module.layout.sidebar.pinned' | sdTranslate\"\n (mouseenter)=\"onMouseOverMenuGroupNode($event, _pinnedMenuGroup)\"\n (mouseleave)=\"onMouseLeaveMenuGroupNode($event, _pinnedMenuGroup)\"\n (click)=\"expandPinnedGroup()\"\n [matTooltip]=\"'core.module.layout.sidebar.pinned' | sdTranslate\"\n [matTooltipClass]=\"'c-tooltip-menu-group-7a22ab15-0083-4d4c-9c0c-00a30bc8c140'\"\n [matTooltipPosition]=\"'right'\"\n style=\"padding: 0; margin: 0; border: none; background-color: transparent\">\n <sd-icon\n fontSet=\"material-icons-outlined\"\n class=\"c-menu-group-icon\"\n size=\"22px\"\n [ngStyle]=\"{\n color: isPinnedMenuGroupActive()\n ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)'\n : 'var(--sd-text-secondary, #44474f)',\n backgroundColor: isPinnedMenuGroupActive()\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\"\n name=\"push_pin\"></sd-icon>\n </button>\n }\n @for (nodeMenuGroup of menus(); track nodeMenuGroup.id) {\n <button\n type=\"button\"\n [attr.aria-label]=\"nodeMenuGroup.tooltipTitle || nodeMenuGroup.title\"\n (mouseenter)=\"onMouseOverMenuGroupNode($event, nodeMenuGroup)\"\n (mouseleave)=\"onMouseLeaveMenuGroupNode($event, nodeMenuGroup)\"\n (click)=\"expandMenuGroup(nodeMenuGroup)\"\n [matTooltip]=\"nodeMenuGroup.tooltipTitle || nodeMenuGroup.title\"\n [matTooltipClass]=\"'c-tooltip-menu-group-7a22ab15-0083-4d4c-9c0c-00a30bc8c140'\"\n [matTooltipPosition]=\"'right'\"\n style=\"padding: 0; margin: 0; border: none; background-color: transparent\">\n @if (nodeMenuGroup.iconUrl) {\n <span\n class=\"c-menu-group-icon\"\n size=\"22px\"\n [ngStyle]=\"{\n backgroundColor:\n _idMenuGroupActive === nodeMenuGroup?.id\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\">\n <img width=\"24px\" height=\"24px\" [src]=\"nodeMenuGroup.iconUrl\" [alt]=\"nodeMenuGroup.title\" />\n </span>\n } @else {\n <sd-icon\n fontSet=\"material-icons-outlined\"\n class=\"c-menu-group-icon\"\n size=\"22px\"\n [ngStyle]=\"{\n color:\n _idMenuGroupActive === nodeMenuGroup?.id\n ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)'\n : 'var(--sd-text-secondary, #44474f)',\n backgroundColor:\n _idMenuGroupActive === nodeMenuGroup?.id\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\"\n [name]=\"nodeMenuGroup.icon || 'widgets'\"></sd-icon>\n }\n </button>\n }\n </div>\n <div class=\"c-menu-tree\" [class.d-none]=\"!_isShowSidebar\" [attr.inert]=\"!_isShowSidebar ? '' : null\">\n @if (totalMenuInMenusByGroup() > 10) {\n <div class=\"c-menu-tree-search\">\n @let _searchLabel = 'core.module.layout.sidebar.search' | sdTranslate;\n <div class=\"c-menu-search-field\">\n <sd-icon\n class=\"c-menu-search-icon\"\n fontSet=\"material-icons-outlined\"\n name=\"search\"\n size=\"18px\"\n aria-hidden=\"true\"></sd-icon>\n <input\n #menuSearch\n class=\"c-menu-search-input\"\n type=\"search\"\n autocomplete=\"off\"\n [attr.aria-label]=\"_searchLabel\"\n [placeholder]=\"_searchLabel\"\n data-autoId=\"layout-v1-menu-search\"\n [ngModel]=\"_searchText\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"onFilterSearchText($event)\" />\n @if (_searchText) {\n <button\n type=\"button\"\n class=\"c-menu-search-clear\"\n [attr.aria-label]=\"'core.module.layout.sidebar.clear-search' | sdTranslate\"\n (click)=\"onClearSearchText(); menuSearch.focus()\">\n <sd-icon fontSet=\"material-icons-outlined\" name=\"close\" size=\"18px\" aria-hidden=\"true\"></sd-icon>\n </button>\n }\n </div>\n </div>\n }\n <div class=\"c-menu-tree-container\">\n <mat-tree [dataSource]=\"dataSource\" [treeControl]=\"treeControl\" [style.backgroundColor]=\"'transparent'\">\n <mat-nested-tree-node *matTreeNodeDef=\"let node; when: !hasChild\">\n <div\n class=\"c-menu-node\"\n [class.is-active]=\"_currentPath | menuFocus: node : _activeMenuPath\"\n (mouseenter)=\"onMouseOverMenuNode($event, node)\"\n (mouseleave)=\"onMouseLeaveMenuNode($event, node)\"\n [ngStyle]=\"{\n backgroundColor:\n (_currentPath | menuFocus: node : _activeMenuPath)\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\">\n <div class=\"c-menu-node-description\" [class.d-none]=\"!_isShowSidebar\">\n <a\n class=\"c-menu-node-description-content\"\n [href]=\"menuNodeHref(node)\"\n [attr.aria-current]=\"(_currentPath | menuFocus: node : _activeMenuPath) ? 'page' : null\"\n (click)=\"onMenuNodeClick($event, node)\"\n [ngStyle]=\"{\n color:\n (_currentPath | menuFocus: node : _activeMenuPath)\n ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)'\n : 'var(--sd-text, #1a1b1f)',\n }\">\n @if (node.iconUrl) {\n <img class=\"c-menu-node-icon\" [src]=\"node.iconUrl\" alt=\"\" />\n } @else if (node.icon) {\n <sd-icon class=\"c-menu-node-icon\" [name]=\"node.icon\" size=\"20px\" fontSet=\"material-icons-outlined\"></sd-icon>\n }\n <span class=\"c-menu-node-label\" [innerHTML]=\"node.title | highLightSearch: _searchText | sdSafeHtml\"></span>\n </a>\n\n <!-- why: n\u00FAt ghim tr\u01B0\u1EDBc \u0111\u00E2y l\u00E0 <sd-icon fontSet=\"material-icons-outlined\" (click)> \u2014 custom element kh\u00F4ng nh\u1EADn\n focus b\u00E0n ph\u00EDm v\u00E0 kh\u00F4ng c\u00F3 t\u00EAn kh\u1EA3 truy c\u1EADp, n\u00EAn kh\u00F4ng ghim \u0111\u01B0\u1EE3c b\u1EB1ng ph\u00EDm.\n \u0110\u1ED5i sang <button type=\"button\"> + aria-pressed, gi\u1ED1ng pattern \u0111\u00E3 d\u00F9ng \u1EDF\n `shared/menu-tree`. -->\n @if (_sidebar?.pin?.enabled) {\n <button\n type=\"button\"\n class=\"c-menu-node-description-icon-pin\"\n [style.opacity]=\"isPinnedNode(node) || isHoveredNode(node) ? '1' : null\"\n [style.color]=\"\n isPinnedNode(node) || isHoveredNode(node) ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)' : null\n \"\n [attr.aria-pressed]=\"isPinnedNode(node)\"\n [attr.aria-label]=\"\n (isPinnedNode(node) ? 'core.module.layout.menu.unpin' : 'core.module.layout.menu.pin')\n | sdTranslate: { title: node.title }\n \"\n (click)=\"onTogglePin($event, node)\">\n <sd-icon fontSet=\"material-icons-outlined\" size=\"18px\" name=\"push_pin\"></sd-icon>\n </button>\n }\n </div>\n </div>\n </mat-nested-tree-node>\n\n <mat-nested-tree-node\n *matTreeNodeDef=\"let node; when: hasChild\"\n [class]=\"{ expanded: treeControl.isExpanded(node), isfocus: _currentPath | menuFocus: node : _activeMenuPath }\">\n <div\n class=\"c-menu-node\"\n [class.is-ancestor]=\"_currentPath | menuFocus: node : _activeMenuPath\"\n (mouseenter)=\"onMouseOverMenuNode($event, node)\"\n (mouseleave)=\"onMouseLeaveMenuNode($event, node)\">\n <div class=\"d-flex align-items-center\" style=\"gap: 10px; width: 100%\">\n <button\n type=\"button\"\n [class.d-none]=\"!_isShowSidebar\"\n class=\"c-menu-node-description\"\n [attr.aria-expanded]=\"treeControl.isExpanded(node)\"\n (click)=\"onToggleMenuNode(node)\">\n <span class=\"c-menu-node-description-content\">\n @if (node.iconUrl) {\n <img class=\"c-menu-node-icon\" [src]=\"node.iconUrl\" alt=\"\" />\n } @else if (node.icon) {\n <sd-icon class=\"c-menu-node-icon\" [name]=\"node.icon\" size=\"20px\" fontSet=\"material-icons-outlined\"></sd-icon>\n }\n <span class=\"c-menu-node-label\" [innerHTML]=\"node.title | highLightSearch: _searchText | sdSafeHtml\"></span>\n </span>\n <sd-icon\n fontSet=\"material-icons-outlined\"\n aria-hidden=\"true\"\n size=\"18px\"\n class=\"c-menu-node-description-icon-expand\"\n [name]=\"treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'\"></sd-icon>\n </button>\n </div>\n </div>\n <div class=\"c-menu-node-group\" role=\"group\" [class.d-none]=\"!treeControl.isExpanded(node)\">\n <ng-container matTreeNodeOutlet></ng-container>\n </div>\n </mat-nested-tree-node>\n </mat-tree>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"c-footer\">\n <lib-layout-user\n [userInfo]=\"_userInfo\"\n [isMobileOrTablet]=\"isMobile()\"\n (menuOpened)=\"onUserMenuOpened()\"\n (menuClosed)=\"onUserMenuClosed()\"\n [isShowSidebar]=\"_isShowSidebar\"\n (toggleMenuLock)=\"toggleMenuLock($event)\">\n </lib-layout-user>\n </div>\n </div>\n}\n", styles: ["::ng-deep .mat-mdc-tooltip-panel:has(.c-tooltip-menu-group-7a22ab15-0083-4d4c-9c0c-00a30bc8c140){pointer-events:none}:host{display:block;height:100%}.wrapper{--sidebar-surface: var(--sd-white, #fff);--sidebar-rail: color-mix(in srgb, var(--sd-surface-muted, #e7e8ed) 35%, var(--sidebar-surface));--sidebar-line: color-mix(in srgb, var(--sd-border, #c4c6d0) 45%, var(--sidebar-surface));--sidebar-ink: var(--sd-text, #252c38);--sidebar-muted: var(--sd-text-secondary, #6b7280);position:relative;display:flex;flex-direction:column;width:min(304px,100vw);color:var(--sidebar-ink);background:linear-gradient(to right,var(--sidebar-rail) 56px,var(--sidebar-surface) 56px)}.wrapper,.wrapper *{box-sizing:border-box}.wrapper:before{content:\"\";position:absolute;inset:0 auto 0 55px;width:1px;background:var(--sidebar-line);pointer-events:none}.c-header{flex:0 0 auto;display:grid;grid-template-columns:56px minmax(0,1fr);min-height:42px}.c-logo{grid-column:1;display:grid;place-items:center;height:42px}.c-logo a{display:grid;place-items:center;width:38px;height:40px;border-radius:9px;color:var(--sidebar-muted)}.c-logo img{width:30px;height:30px;object-fit:contain}.c-title-menu-group{grid-column:2;display:flex;align-items:center;min-width:0;padding:10px 14px 12px;color:var(--sidebar-ink);font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-bold, 700);line-height:var(--sd-line-height-22, 22px);letter-spacing:-.2px;overflow-wrap:anywhere}.c-body{flex:1;min-height:0;overflow:hidden}.c-menu{display:flex;height:100%}.c-menu-group{display:flex;flex:0 0 56px;flex-direction:column;align-items:center;gap:10px;width:56px;min-height:0;margin-bottom:86px;padding:5px 0 8px;overflow-y:auto;scrollbar-width:none}.c-menu-group>button{flex:0 0 auto;border-radius:9px}.c-menu-group .c-menu-group-icon{display:flex;align-items:center;justify-content:center;width:38px;height:40px;min-height:40px;border-radius:9px;font-size:var(--sd-font-size-22, 22px)}.c-menu-group .c-menu-group-icon img{width:22px;height:22px;object-fit:contain}.c-menu-tree{display:flex;flex:1;flex-direction:column;min-width:0;min-height:0}.c-menu-tree-search{flex:0 0 auto;padding:0 14px 12px;border-bottom:1px solid var(--sidebar-line)}.c-menu-search-field{display:flex;align-items:center;gap:8px;height:36px;padding:0 9px;border:1px solid var(--sidebar-line);border-radius:7px;background:var(--sidebar-rail);color:var(--sidebar-muted)}.c-menu-search-field:hover{border-color:color-mix(in srgb,var(--sidebar-muted) 35%,var(--sidebar-surface))}.c-menu-search-field:focus-within{border-color:color-mix(in srgb,var(--sidebar-accent, var(--sd-primary, #005cbb)) 75%,var(--sidebar-surface));background:var(--sidebar-surface)}.c-menu-search-icon{flex:0 0 18px;width:18px;height:18px;font-size:var(--sd-font-size-18, 18px);pointer-events:none}.c-menu-search-input{flex:1 1 0;width:0;min-width:0;height:100%;margin:0;padding:0;border:0;border-radius:0;outline:none;box-shadow:none;appearance:none;background:transparent;color:var(--sidebar-ink);font:inherit;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-20, 20px)}.c-menu-search-input:focus,.c-menu-search-input:focus-visible{outline:none;box-shadow:none}.c-menu-search-input::placeholder{color:var(--sidebar-muted);opacity:1}.c-menu-search-input::-webkit-search-decoration,.c-menu-search-input::-webkit-search-cancel-button{appearance:none}.c-menu-search-clear{display:grid;flex:0 0 24px;place-items:center;width:24px;min-width:24px;height:24px;margin:0;padding:0;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:var(--sidebar-muted);cursor:pointer}.c-menu-search-clear sd-icon,.c-menu-search-clear mat-icon{width:18px;height:18px;font-size:var(--sd-font-size-18, 18px)}.c-menu-search-clear:hover{background:color-mix(in srgb,var(--sidebar-ink) 7%,transparent);color:var(--sidebar-ink)}.c-menu-search-clear:focus-visible{outline:1px solid var(--sidebar-accent, var(--sd-focus-ring-color, var(--sd-primary)));outline-offset:1px}.c-menu-tree-container{flex:1;min-height:0;padding:10px 8px 14px;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--sidebar-line) transparent;overscroll-behavior:contain}.c-menu-node{position:relative;display:flex;align-items:center;width:100%;min-height:40px;margin:2px 0;padding:0;border-radius:7px;cursor:pointer;color:var(--sidebar-ink);font-size:var(--sd-font-size-13, 13px);line-height:1.4}.c-menu-node-description{display:flex;flex:1;align-items:center;gap:6px;width:100%;min-width:0;min-height:40px;padding:0;border:0;border-radius:inherit;color:inherit;background:transparent;font:inherit;text-align:left;cursor:pointer}.c-menu-node-description-content{display:flex;flex:1;align-items:center;align-self:stretch;gap:9px;min-width:0;padding:8px;color:inherit;font:inherit;font-weight:var(--sd-font-weight-medium, 500);text-decoration:none}.c-menu-node-label{flex:1;min-width:0;white-space:normal;overflow-wrap:anywhere}.c-menu-node-icon{flex:0 0 20px;width:20px;height:20px;font-size:var(--sd-font-size-20, 20px);object-fit:contain;color:var(--sidebar-muted)}.c-menu-node-description-icon-expand,.c-menu-node-description-icon-pin{display:flex;flex:0 0 20px;align-items:center;justify-content:center;width:20px;height:24px;margin-right:6px;padding:0;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:var(--sidebar-muted);font-size:var(--sd-font-size-18, 18px);cursor:pointer}.c-menu-node-description-icon-pin{opacity:0}.c-menu-node-description-icon-pin:focus-visible{opacity:1!important}.c-menu-node.is-ancestor{color:var(--sidebar-accent)}.c-menu-node.is-ancestor .c-menu-node-description-content,.c-menu-node.is-ancestor .c-menu-node-icon,.c-menu-node.is-ancestor .c-menu-node-description-icon-expand{color:inherit}.c-menu-node.is-active{color:var(--sidebar-accent)}.c-menu-node.is-active .c-menu-node-icon{color:inherit}.c-menu-node.is-active:before{content:\"\";position:absolute;left:0;top:9px;bottom:9px;width:3px;border-radius:var(--sd-radius-2, 2px);background:var(--sidebar-accent)}.c-menu-node-group{position:relative;margin:0 0 7px 19px;padding:1px 0 1px 16px;border-left:1px solid var(--sidebar-line)}.c-menu-node-group .c-menu-node{min-height:34px;border-radius:var(--sd-radius-6, 6px)}.c-menu-node-group .c-menu-node-description-content{padding:7px 8px;font-weight:var(--sd-font-weight-regular, 400)}.c-menu-node-group .c-menu-node-description{min-height:34px}.c-menu-node-group .c-menu-node-icon{display:none}.c-menu-node-group .c-menu-node.is-active:before{left:-18px}.c-menu-node-group .c-menu-node.is-active .c-menu-node-description-content,.c-menu-node-group .c-menu-node.is-ancestor .c-menu-node-description-content{font-weight:var(--sd-font-weight-medium, 500)}.c-menu-node-group .c-menu-node-group{margin-left:8px;padding-left:7px}.c-menu-node-group .c-menu-node-group .c-menu-node.is-active:before{left:-9px}.c-footer{position:absolute;bottom:0;left:0;width:56px;height:86px;background:var(--sidebar-rail)}a:focus-visible,button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sidebar-accent, var(--sd-focus-ring-color, var(--sd-primary)));outline-offset:-2px}@media(pointer:coarse){.c-menu-node,.c-menu-node-group .c-menu-node,.c-menu-node-description,.c-menu-node-group .c-menu-node-description{min-height:44px}}@media(prefers-reduced-motion:reduce){.c-menu-group-icon,.c-menu-node,.c-menu-node *{transition:none!important}}\n"] }]
1582
- }], ctorParameters: () => [], propDecorators: { isShowSidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "isShowSidebar", required: true }] }], menus: [{ type: i0.Input, args: [{ isSignal: true, alias: "menus", required: true }] }], userInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "userInfo", required: true }] }], sidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebar", required: true }] }], isMobile: [{ type: i0.Input, args: [{ isSignal: true, alias: "isMobile", required: false }] }], expandSideBar: [{ type: i0.Output, args: ["expandSideBar"] }], popupUserMenuClosed: [{ type: i0.Output, args: ["popupUserMenuClosed"] }], popupUserMenuOpened: [{ type: i0.Output, args: ["popupUserMenuOpened"] }], showSideBar: [{ type: i0.Output, args: ["showSideBar"] }] } });
2550
+ SdLayoutContextSwitcher,
2551
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let _userInfo = userInfo();\n@let _sidebar = sidebar();\n@let _isShowSidebar = isShowSidebar();\n@let _searchText = searchText();\n@let _currentPath = currentPath();\n@let _activeMenuPath = activeMenuPath();\n@let _idMenuGroupActive = idMenuGroupActive();\n@let _pinnedMenuGroup = pinnedMenuGroup();\n\n@if (_userInfo && _sidebar) {\n <div\n class=\"wrapper\"\n [style.--sidebar-accent]=\"_sidebar.brandColor || 'var(--sd-primary, #005cbb)'\"\n [style.height]=\"isMobile() ? '100dvh' : '100%'\">\n <div #headerElement class=\"c-header\">\n <div #logoElement class=\"c-logo\">\n <a\n href=\"/layout/home\"\n [attr.aria-label]=\"'core.module.layout.home.tab-name' | sdTranslate\"\n (click)=\"$event.preventDefault(); openHomePage()\">\n @if (logoUrl(); as _logoUrl) {\n <img alt=\"\" [src]=\"_logoUrl\" />\n } @else {\n <sd-icon fontSet=\"material-icons-outlined\" name=\"apps\"></sd-icon>\n }\n </a>\n </div>\n <!-- Context switcher (D-010): avatar ngay d\u01B0\u1EDBi logo khi thu g\u1ECDn v\u1EC1 rail, d\u00F2ng ph\u1EE5 d\u01B0\u1EDBi ti\u00EAu \u0111\u1EC1 khi m\u1EDF. -->\n @if (_sidebar.context && !_isShowSidebar) {\n <sd-layout-context-switcher class=\"c-rail-context\" appearance=\"rail\" [configuration]=\"_sidebar.context\" [anchor]=\"logoElement\" />\n }\n <div class=\"c-title-menu-group\" [class.d-none]=\"!_isShowSidebar\" [class.c-title-menu-group--context]=\"!!_sidebar.context\">\n <span>{{ titleMenuGroup() || _sidebar.defaultTitle || 'Back Office' }}</span>\n @if (_sidebar.context && _isShowSidebar) {\n <sd-layout-context-switcher\n #headerContextSwitcher\n class=\"c-header-context\"\n appearance=\"header\"\n [configuration]=\"_sidebar.context\"\n [anchor]=\"headerElement\" />\n }\n </div>\n </div>\n <div class=\"c-body\">\n <div class=\"c-menu\">\n <div class=\"c-menu-group\">\n @if (_sidebar?.pin?.enabled && _pinnedMenuGroup.children?.length) {\n <button\n type=\"button\"\n [attr.aria-label]=\"'core.module.layout.sidebar.pinned' | sdTranslate\"\n (mouseenter)=\"onMouseOverMenuGroupNode($event, _pinnedMenuGroup)\"\n (mouseleave)=\"onMouseLeaveMenuGroupNode($event, _pinnedMenuGroup)\"\n (click)=\"expandPinnedGroup()\"\n [matTooltip]=\"'core.module.layout.sidebar.pinned' | sdTranslate\"\n [matTooltipClass]=\"'c-tooltip-menu-group-7a22ab15-0083-4d4c-9c0c-00a30bc8c140'\"\n [matTooltipPosition]=\"'right'\"\n style=\"padding: 0; margin: 0; border: none; background-color: transparent\">\n <sd-icon\n fontSet=\"material-icons-outlined\"\n class=\"c-menu-group-icon\"\n size=\"22px\"\n [ngStyle]=\"{\n color: isPinnedMenuGroupActive()\n ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)'\n : 'var(--sd-text-secondary, #44474f)',\n backgroundColor: isPinnedMenuGroupActive()\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\"\n name=\"push_pin\"></sd-icon>\n </button>\n }\n @for (nodeMenuGroup of menus(); track nodeMenuGroup.id) {\n <button\n type=\"button\"\n [attr.aria-label]=\"nodeMenuGroup.tooltipTitle || nodeMenuGroup.title\"\n (mouseenter)=\"onMouseOverMenuGroupNode($event, nodeMenuGroup)\"\n (mouseleave)=\"onMouseLeaveMenuGroupNode($event, nodeMenuGroup)\"\n (click)=\"expandMenuGroup(nodeMenuGroup)\"\n [matTooltip]=\"nodeMenuGroup.tooltipTitle || nodeMenuGroup.title\"\n [matTooltipClass]=\"'c-tooltip-menu-group-7a22ab15-0083-4d4c-9c0c-00a30bc8c140'\"\n [matTooltipPosition]=\"'right'\"\n style=\"padding: 0; margin: 0; border: none; background-color: transparent\">\n @if (nodeMenuGroup.iconUrl) {\n <span\n class=\"c-menu-group-icon\"\n size=\"22px\"\n [ngStyle]=\"{\n backgroundColor:\n _idMenuGroupActive === nodeMenuGroup?.id\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\">\n <img width=\"24px\" height=\"24px\" [src]=\"nodeMenuGroup.iconUrl\" [alt]=\"nodeMenuGroup.title\" />\n </span>\n } @else {\n <sd-icon\n fontSet=\"material-icons-outlined\"\n class=\"c-menu-group-icon\"\n size=\"22px\"\n [ngStyle]=\"{\n color:\n _idMenuGroupActive === nodeMenuGroup?.id\n ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)'\n : 'var(--sd-text-secondary, #44474f)',\n backgroundColor:\n _idMenuGroupActive === nodeMenuGroup?.id\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\"\n [name]=\"nodeMenuGroup.icon || 'widgets'\"></sd-icon>\n }\n </button>\n }\n </div>\n <div class=\"c-menu-tree\" [class.d-none]=\"!_isShowSidebar\" [attr.inert]=\"!_isShowSidebar ? '' : null\">\n @if (totalMenuInMenusByGroup() > 10) {\n <div class=\"c-menu-tree-search\">\n @let _searchLabel = 'core.module.layout.sidebar.search' | sdTranslate;\n <div class=\"c-menu-search-field\">\n <sd-icon\n class=\"c-menu-search-icon\"\n fontSet=\"material-icons-outlined\"\n name=\"search\"\n size=\"18px\"\n aria-hidden=\"true\"></sd-icon>\n <input\n #menuSearch\n class=\"c-menu-search-input\"\n type=\"search\"\n autocomplete=\"off\"\n [attr.aria-label]=\"_searchLabel\"\n [placeholder]=\"_searchLabel\"\n data-autoId=\"layout-v1-menu-search\"\n [ngModel]=\"_searchText\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"onFilterSearchText($event)\" />\n @if (_searchText) {\n <button\n type=\"button\"\n class=\"c-menu-search-clear\"\n [attr.aria-label]=\"'core.module.layout.sidebar.clear-search' | sdTranslate\"\n (click)=\"onClearSearchText(); menuSearch.focus()\">\n <sd-icon fontSet=\"material-icons-outlined\" name=\"close\" size=\"18px\" aria-hidden=\"true\"></sd-icon>\n </button>\n }\n </div>\n </div>\n }\n <div class=\"c-menu-tree-container\">\n <mat-tree [dataSource]=\"dataSource\" [treeControl]=\"treeControl\" [style.backgroundColor]=\"'transparent'\">\n <mat-nested-tree-node *matTreeNodeDef=\"let node; when: !hasChild\">\n <div\n class=\"c-menu-node\"\n [class.is-active]=\"_currentPath | menuFocus: node : _activeMenuPath\"\n (mouseenter)=\"onMouseOverMenuNode($event, node)\"\n (mouseleave)=\"onMouseLeaveMenuNode($event, node)\"\n [ngStyle]=\"{\n backgroundColor:\n (_currentPath | menuFocus: node : _activeMenuPath)\n ? _sidebar.brandLightColor || 'var(--sd-primary-light, #d7e3ff)'\n : 'transparent',\n }\">\n <div class=\"c-menu-node-description\" [class.d-none]=\"!_isShowSidebar\">\n <a\n class=\"c-menu-node-description-content\"\n [href]=\"menuNodeHref(node)\"\n [attr.aria-current]=\"(_currentPath | menuFocus: node : _activeMenuPath) ? 'page' : null\"\n (click)=\"onMenuNodeClick($event, node)\"\n [ngStyle]=\"{\n color:\n (_currentPath | menuFocus: node : _activeMenuPath)\n ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)'\n : 'var(--sd-text, #1a1b1f)',\n }\">\n @if (node.iconUrl) {\n <img class=\"c-menu-node-icon\" [src]=\"node.iconUrl\" alt=\"\" />\n } @else if (node.icon) {\n <sd-icon class=\"c-menu-node-icon\" [name]=\"node.icon\" size=\"20px\" fontSet=\"material-icons-outlined\"></sd-icon>\n }\n <span class=\"c-menu-node-label\" [innerHTML]=\"node.title | highLightSearch: _searchText | sdSafeHtml\"></span>\n </a>\n\n <!-- why: n\u00FAt ghim tr\u01B0\u1EDBc \u0111\u00E2y l\u00E0 <sd-icon fontSet=\"material-icons-outlined\" (click)> \u2014 custom element kh\u00F4ng nh\u1EADn\n focus b\u00E0n ph\u00EDm v\u00E0 kh\u00F4ng c\u00F3 t\u00EAn kh\u1EA3 truy c\u1EADp, n\u00EAn kh\u00F4ng ghim \u0111\u01B0\u1EE3c b\u1EB1ng ph\u00EDm.\n \u0110\u1ED5i sang <button type=\"button\"> + aria-pressed, gi\u1ED1ng pattern \u0111\u00E3 d\u00F9ng \u1EDF\n `shared/menu-tree`. -->\n @if (_sidebar?.pin?.enabled) {\n <button\n type=\"button\"\n class=\"c-menu-node-description-icon-pin\"\n [style.opacity]=\"isPinnedNode(node) || isHoveredNode(node) ? '1' : null\"\n [style.color]=\"\n isPinnedNode(node) || isHoveredNode(node) ? _sidebar.brandColor || 'var(--sd-primary, #005cbb)' : null\n \"\n [attr.aria-pressed]=\"isPinnedNode(node)\"\n [attr.aria-label]=\"\n (isPinnedNode(node) ? 'core.module.layout.menu.unpin' : 'core.module.layout.menu.pin')\n | sdTranslate: { title: node.title }\n \"\n (click)=\"onTogglePin($event, node)\">\n <sd-icon fontSet=\"material-icons-outlined\" size=\"18px\" name=\"push_pin\"></sd-icon>\n </button>\n }\n </div>\n </div>\n </mat-nested-tree-node>\n\n <mat-nested-tree-node\n *matTreeNodeDef=\"let node; when: hasChild\"\n [class]=\"{ expanded: treeControl.isExpanded(node), isfocus: _currentPath | menuFocus: node : _activeMenuPath }\">\n <div\n class=\"c-menu-node\"\n [class.is-ancestor]=\"_currentPath | menuFocus: node : _activeMenuPath\"\n (mouseenter)=\"onMouseOverMenuNode($event, node)\"\n (mouseleave)=\"onMouseLeaveMenuNode($event, node)\">\n <div class=\"d-flex align-items-center\" style=\"gap: 10px; width: 100%\">\n <button\n type=\"button\"\n [class.d-none]=\"!_isShowSidebar\"\n class=\"c-menu-node-description\"\n [attr.aria-expanded]=\"treeControl.isExpanded(node)\"\n (click)=\"onToggleMenuNode(node)\">\n <span class=\"c-menu-node-description-content\">\n @if (node.iconUrl) {\n <img class=\"c-menu-node-icon\" [src]=\"node.iconUrl\" alt=\"\" />\n } @else if (node.icon) {\n <sd-icon class=\"c-menu-node-icon\" [name]=\"node.icon\" size=\"20px\" fontSet=\"material-icons-outlined\"></sd-icon>\n }\n <span class=\"c-menu-node-label\" [innerHTML]=\"node.title | highLightSearch: _searchText | sdSafeHtml\"></span>\n </span>\n <sd-icon\n fontSet=\"material-icons-outlined\"\n aria-hidden=\"true\"\n size=\"18px\"\n class=\"c-menu-node-description-icon-expand\"\n [name]=\"treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'\"></sd-icon>\n </button>\n </div>\n </div>\n <div class=\"c-menu-node-group\" role=\"group\" [class.d-none]=\"!treeControl.isExpanded(node)\">\n <ng-container matTreeNodeOutlet></ng-container>\n </div>\n </mat-nested-tree-node>\n </mat-tree>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"c-footer\">\n <lib-layout-user\n [userInfo]=\"_userInfo\"\n [isMobileOrTablet]=\"isMobile()\"\n (menuOpened)=\"onUserMenuOpened()\"\n (menuClosed)=\"onUserMenuClosed()\"\n [isShowSidebar]=\"_isShowSidebar\"\n (toggleMenuLock)=\"toggleMenuLock($event)\">\n </lib-layout-user>\n </div>\n </div>\n}\n", styles: ["::ng-deep .mat-mdc-tooltip-panel:has(.c-tooltip-menu-group-7a22ab15-0083-4d4c-9c0c-00a30bc8c140){pointer-events:none}:host{display:block;height:100%}.wrapper{--sidebar-surface: var(--sd-white, #fff);--sidebar-rail: color-mix(in srgb, var(--sd-surface-muted, #e7e8ed) 35%, var(--sidebar-surface));--sidebar-line: color-mix(in srgb, var(--sd-border, #c4c6d0) 45%, var(--sidebar-surface));--sidebar-ink: var(--sd-text, #252c38);--sidebar-muted: var(--sd-text-secondary, #6b7280);position:relative;display:flex;flex-direction:column;width:min(304px,100vw);color:var(--sidebar-ink);background:linear-gradient(to right,var(--sidebar-rail) 56px,var(--sidebar-surface) 56px)}.wrapper,.wrapper *{box-sizing:border-box}.wrapper:before{content:\"\";position:absolute;inset:0 auto 0 55px;width:1px;background:var(--sidebar-line);pointer-events:none}.c-header{flex:0 0 auto;display:grid;grid-template-columns:56px minmax(0,1fr);min-height:42px}.c-logo{grid-column:1;display:grid;place-items:center;height:42px}.c-logo a{display:grid;place-items:center;width:38px;height:40px;border-radius:9px;color:var(--sidebar-muted)}.c-logo img{width:30px;height:30px;object-fit:contain}.c-title-menu-group{grid-column:2;display:flex;align-items:center;min-width:0;padding:10px 14px 12px;color:var(--sidebar-ink);font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-bold, 700);line-height:var(--sd-line-height-22, 22px);letter-spacing:-.2px;overflow-wrap:anywhere}.c-title-menu-group--context{--sd-layout-context-switcher-popover-width: calc(min(304px, 100vw) - 24px) ;flex-direction:column;align-items:stretch;justify-content:center}.c-header-context{font-weight:var(--sd-font-weight-regular, 400);letter-spacing:normal}.c-rail-context{grid-column:1;grid-row:2}.c-rail-context:not(:empty){margin:4px 0 6px}@media(pointer:coarse){.c-rail-context:not(:empty){margin-top:8px}}.c-body{flex:1;min-height:0;overflow:hidden}.c-menu{display:flex;height:100%}.c-menu-group{display:flex;flex:0 0 56px;flex-direction:column;align-items:center;gap:10px;width:56px;min-height:0;margin-bottom:86px;padding:5px 0 8px;overflow-y:auto;scrollbar-width:none}.c-menu-group>button{flex:0 0 auto;border-radius:9px}.c-menu-group .c-menu-group-icon{display:flex;align-items:center;justify-content:center;width:38px;height:40px;min-height:40px;border-radius:9px;font-size:var(--sd-font-size-22, 22px)}.c-menu-group .c-menu-group-icon img{width:22px;height:22px;object-fit:contain}.c-menu-tree{display:flex;flex:1;flex-direction:column;min-width:0;min-height:0}.c-menu-tree-search{flex:0 0 auto;padding:0 14px 12px;border-bottom:1px solid var(--sidebar-line)}.c-menu-search-field{display:flex;align-items:center;gap:8px;height:36px;padding:0 9px;border:1px solid var(--sidebar-line);border-radius:7px;background:var(--sidebar-rail);color:var(--sidebar-muted)}.c-menu-search-field:hover{border-color:color-mix(in srgb,var(--sidebar-muted) 35%,var(--sidebar-surface))}.c-menu-search-field:focus-within{border-color:color-mix(in srgb,var(--sidebar-accent, var(--sd-primary, #005cbb)) 75%,var(--sidebar-surface));background:var(--sidebar-surface)}.c-menu-search-icon{flex:0 0 18px;width:18px;height:18px;font-size:var(--sd-font-size-18, 18px);pointer-events:none}.c-menu-search-input{flex:1 1 0;width:0;min-width:0;height:100%;margin:0;padding:0;border:0;border-radius:0;outline:none;box-shadow:none;appearance:none;background:transparent;color:var(--sidebar-ink);font:inherit;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-20, 20px)}.c-menu-search-input:focus,.c-menu-search-input:focus-visible{outline:none;box-shadow:none}.c-menu-search-input::placeholder{color:var(--sidebar-muted);opacity:1}.c-menu-search-input::-webkit-search-decoration,.c-menu-search-input::-webkit-search-cancel-button{appearance:none}.c-menu-search-clear{display:grid;flex:0 0 24px;place-items:center;width:24px;min-width:24px;height:24px;margin:0;padding:0;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:var(--sidebar-muted);cursor:pointer}.c-menu-search-clear sd-icon,.c-menu-search-clear mat-icon{width:18px;height:18px;font-size:var(--sd-font-size-18, 18px)}.c-menu-search-clear:hover{background:color-mix(in srgb,var(--sidebar-ink) 7%,transparent);color:var(--sidebar-ink)}.c-menu-search-clear:focus-visible{outline:1px solid var(--sidebar-accent, var(--sd-focus-ring-color, var(--sd-primary)));outline-offset:1px}.c-menu-tree-container{flex:1;min-height:0;padding:10px 8px 14px;overflow:auto;scrollbar-width:thin;scrollbar-color:var(--sidebar-line) transparent;overscroll-behavior:contain}.c-menu-node{position:relative;display:flex;align-items:center;width:100%;min-height:40px;margin:2px 0;padding:0;border-radius:7px;cursor:pointer;color:var(--sidebar-ink);font-size:var(--sd-font-size-13, 13px);line-height:1.4}.c-menu-node-description{display:flex;flex:1;align-items:center;gap:6px;width:100%;min-width:0;min-height:40px;padding:0;border:0;border-radius:inherit;color:inherit;background:transparent;font:inherit;text-align:left;cursor:pointer}.c-menu-node-description-content{display:flex;flex:1;align-items:center;align-self:stretch;gap:9px;min-width:0;padding:8px;color:inherit;font:inherit;font-weight:var(--sd-font-weight-medium, 500);text-decoration:none}.c-menu-node-label{flex:1;min-width:0;white-space:normal;overflow-wrap:anywhere}.c-menu-node-icon{flex:0 0 20px;width:20px;height:20px;font-size:var(--sd-font-size-20, 20px);object-fit:contain;color:var(--sidebar-muted)}.c-menu-node-description-icon-expand,.c-menu-node-description-icon-pin{display:flex;flex:0 0 20px;align-items:center;justify-content:center;width:20px;height:24px;margin-right:6px;padding:0;border:0;border-radius:var(--sd-radius-4, 4px);background:transparent;color:var(--sidebar-muted);font-size:var(--sd-font-size-18, 18px);cursor:pointer}.c-menu-node-description-icon-pin{opacity:0}.c-menu-node-description-icon-pin:focus-visible{opacity:1!important}.c-menu-node.is-ancestor{color:var(--sidebar-accent)}.c-menu-node.is-ancestor .c-menu-node-description-content,.c-menu-node.is-ancestor .c-menu-node-icon,.c-menu-node.is-ancestor .c-menu-node-description-icon-expand{color:inherit}.c-menu-node.is-active{color:var(--sidebar-accent)}.c-menu-node.is-active .c-menu-node-icon{color:inherit}.c-menu-node.is-active:before{content:\"\";position:absolute;left:0;top:9px;bottom:9px;width:3px;border-radius:var(--sd-radius-2, 2px);background:var(--sidebar-accent)}.c-menu-node-group{position:relative;margin:0 0 7px 19px;padding:1px 0 1px 16px;border-left:1px solid var(--sidebar-line)}.c-menu-node-group .c-menu-node{min-height:34px;border-radius:var(--sd-radius-6, 6px)}.c-menu-node-group .c-menu-node-description-content{padding:7px 8px;font-weight:var(--sd-font-weight-regular, 400)}.c-menu-node-group .c-menu-node-description{min-height:34px}.c-menu-node-group .c-menu-node-icon{display:none}.c-menu-node-group .c-menu-node.is-active:before{left:-18px}.c-menu-node-group .c-menu-node.is-active .c-menu-node-description-content,.c-menu-node-group .c-menu-node.is-ancestor .c-menu-node-description-content{font-weight:var(--sd-font-weight-medium, 500)}.c-menu-node-group .c-menu-node-group{margin-left:8px;padding-left:7px}.c-menu-node-group .c-menu-node-group .c-menu-node.is-active:before{left:-9px}.c-footer{position:absolute;bottom:0;left:0;width:56px;height:86px;background:var(--sidebar-rail)}a:focus-visible,button:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sidebar-accent, var(--sd-focus-ring-color, var(--sd-primary)));outline-offset:-2px}@media(pointer:coarse){.c-menu-node,.c-menu-node-group .c-menu-node,.c-menu-node-description,.c-menu-node-group .c-menu-node-description{min-height:44px}}@media(prefers-reduced-motion:reduce){.c-menu-group-icon,.c-menu-node,.c-menu-node *{transition:none!important}}\n"] }]
2552
+ }], ctorParameters: () => [], propDecorators: { isShowSidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "isShowSidebar", required: true }] }], menus: [{ type: i0.Input, args: [{ isSignal: true, alias: "menus", required: true }] }], userInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "userInfo", required: true }] }], sidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebar", required: true }] }], isMobile: [{ type: i0.Input, args: [{ isSignal: true, alias: "isMobile", required: false }] }], expandSideBar: [{ type: i0.Output, args: ["expandSideBar"] }], popupUserMenuClosed: [{ type: i0.Output, args: ["popupUserMenuClosed"] }], popupUserMenuOpened: [{ type: i0.Output, args: ["popupUserMenuOpened"] }], showSideBar: [{ type: i0.Output, args: ["showSideBar"] }], headerContextSwitcher: [{ type: i0.ViewChild, args: ['headerContextSwitcher', { isSignal: true }] }] } });
1583
2553
 
1584
2554
  class SdSidebarV1 {
1585
2555
  // ==========================================
@@ -1895,11 +2865,11 @@ class SdSidebarMobileOverlay {
1895
2865
  return null;
1896
2866
  };
1897
2867
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdSidebarMobileOverlay, deps: [], target: i0.ɵɵFactoryTarget.Component });
1898
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdSidebarMobileOverlay, isStandalone: true, selector: "sd-sidebar-mobile-overlay", inputs: { isShowSidebar: { classPropertyName: "isShowSidebar", publicName: "isShowSidebar", isSignal: true, isRequired: false, transformFunction: null }, menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: true, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { showSideBar: "showSideBar", expandSideBar: "expandSideBar", popupUserMenuOpened: "popupUserMenuOpened", popupUserMenuClosed: "popupUserMenuClosed", titleMenuGroupChanged: "titleMenuGroupChanged" }, ngImport: i0, template: "@let _userInfo = userInfo();\n@let _sidebar = sidebar();\n\n@if (_userInfo && _sidebar) {\n <div\n class=\"m-backdrop\"\n [class.m-backdrop--visible]=\"isShowSidebar()\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"onClose()\"\n (keydown.escape)=\"onClose()\">\n </div>\n\n <div class=\"m-wrapper\" [class.m-wrapper--open]=\"isShowSidebar()\">\n <div class=\"m-header\">\n <div class=\"m-title-group\">\n @if (_sidebar.logoUrl) {\n <img class=\"m-logo\" alt=\"logo\" [src]=\"_sidebar.logoUrl\" />\n }\n <span class=\"m-title\">{{ titleMenuGroup() || _sidebar.defaultTitle || 'Back Office' }}</span>\n </div>\n <button class=\"m-close-btn\" (click)=\"onClose()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n </div>\n\n <div class=\"m-user-section\">\n <lib-layout-user\n [userInfo]=\"_userInfo\"\n [isMobileOrTablet]=\"true\"\n (menuOpened)=\"onUserMenuOpened()\"\n (menuClosed)=\"onUserMenuClosed()\">\n </lib-layout-user>\n </div>\n\n <div class=\"m-menu-list\">\n @for (group of menus(); track group.id) {\n <div class=\"m-menu-card\">\n <button class=\"m-card-header\" (click)=\"toggleMobileGroup(group.id)\">\n <div class=\"m-card-header-left\">\n @if (group.iconUrl) {\n <img class=\"m-group-icon\" [src]=\"group.iconUrl\" [alt]=\"group.title\" />\n } @else {\n <sd-icon class=\"m-group-icon\" [name]=\"group.icon || 'widgets'\"></sd-icon>\n }\n <span class=\"m-group-title\">{{ group.title }}</span>\n </div>\n <sd-icon class=\"m-expand-icon\" [name]=\"expandedMobileGroups().has(group.id ?? '') ? 'keyboard_arrow_up' : 'keyboard_arrow_down'\"></sd-icon>\n </button>\n\n @if (expandedMobileGroups().has(group.id ?? '') && hasChildren(group)) {\n <div class=\"m-card-body\">\n @for (child of getChildren(group); track child.id) {\n @if (hasChildren(child)) {\n <div class=\"m-sub-group\">\n <button class=\"m-sub-group-header\" (click)=\"toggleMobileGroup(child.id)\">\n <div class=\"m-item-left\">\n @if (child.iconUrl) {\n <img class=\"m-item-icon-img\" [src]=\"child.iconUrl\" alt=\"icon\" />\n } @else {\n <sd-icon class=\"m-item-icon\" [name]=\"child.icon || 'folder'\"></sd-icon>\n }\n <span class=\"m-item-title\">{{ child.title }}</span>\n </div>\n <sd-icon class=\"m-expand-icon\" [name]=\"expandedMobileGroups().has(child.id ?? '') ? 'keyboard_arrow_up' : 'keyboard_arrow_down'\"></sd-icon>\n </button>\n @if (expandedMobileGroups().has(child.id ?? '')) {\n @for (subChild of getChildren(child); track subChild.id) {\n <button class=\"m-menu-item m-menu-item--indented\"\n (click)=\"navigate({ path: getPath(subChild), queryParams: getQueryParams(subChild) })\">\n <div class=\"m-item-left\">\n @if (subChild.iconUrl) {\n <img class=\"m-item-icon-img\" [src]=\"subChild.iconUrl\" alt=\"icon\" />\n } @else {\n <sd-icon class=\"m-item-icon\" [name]=\"subChild.icon || 'insert_drive_file'\"></sd-icon>\n }\n <span class=\"m-item-title\">{{ subChild.title }}</span>\n </div>\n <sd-icon class=\"m-nav-icon\" name=\"chevron_right\"></sd-icon>\n </button>\n }\n }\n </div>\n } @else {\n <button class=\"m-menu-item\" (click)=\"navigate({ path: getPath(child), queryParams: getQueryParams(child) })\">\n <div class=\"m-item-left\">\n @if (child.iconUrl) {\n <img class=\"m-item-icon-img\" [src]=\"child.iconUrl\" alt=\"icon\" />\n } @else {\n <sd-icon class=\"m-item-icon\" [name]=\"child.icon || 'insert_drive_file'\"></sd-icon>\n }\n <span class=\"m-item-title\">{{ child.title }}</span>\n </div>\n <sd-icon class=\"m-nav-icon\" name=\"chevron_right\"></sd-icon>\n </button>\n }\n }\n </div>\n }\n </div>\n }\n </div>\n </div>\n}\n", styles: [":host{display:block;position:fixed;inset:0;z-index:var(--sd-z-dropdown, 1000);pointer-events:none}.m-backdrop{position:absolute;inset:0;background:#0006;opacity:0;pointer-events:none;transition:opacity var(--sd-duration-slow, .3s) ease;cursor:pointer;outline:none}.m-backdrop--visible{opacity:1;pointer-events:auto}.m-wrapper{display:flex;flex-direction:column;position:absolute;inset:0;background-color:var(--sd-sidebar-mobile-bg, #f2f2f6);padding:16px;box-sizing:border-box;overflow-y:auto;pointer-events:none;padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom));transform:translate(-100%);transition:transform var(--sd-duration-slow, .3s) var(--sd-ease-standard, cubic-bezier(.4, 0, .2, 1))}.m-wrapper--open{transform:translate(0);pointer-events:auto}.m-wrapper .m-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}.m-wrapper .m-header .m-title-group{display:flex;align-items:center;gap:12px}.m-wrapper .m-header .m-title-group .m-logo{width:32px;height:32px;object-fit:contain}.m-wrapper .m-header .m-title-group .m-title{font-size:var(--sd-font-size-18, 18px);font-weight:var(--sd-font-weight-semibold, 600);color:var(--sd-sidebar-mobile-text, #1f1f1f)}.m-wrapper .m-header .m-close-btn{background:transparent;border:none;padding:0;color:var(--sd-sidebar-mobile-text, #1f1f1f);display:flex;align-items:center;justify-content:center;cursor:pointer}.m-wrapper .m-header .m-close-btn sd-icon{font-size:var(--sd-font-size-28, 28px);width:28px;height:28px}.m-wrapper .m-user-section{background-color:var(--sd-sidebar-mobile-card-bg, #ffffff);border-radius:var(--sd-radius-12, 12px);padding:12px 16px;margin-bottom:24px;box-shadow:0 1px 2px #00000005;border:1px solid var(--sd-sidebar-mobile-border, #ebebeb)}.m-wrapper .m-user-section lib-layout-user{display:block;width:100%}.m-wrapper .m-menu-list{display:flex;flex-direction:column;gap:16px}.m-wrapper .m-menu-card{background-color:var(--sd-sidebar-mobile-card-bg, #ffffff);border-radius:var(--sd-radius-12, 12px);border:1px solid var(--sd-sidebar-mobile-border, #ebebeb);overflow:hidden}.m-wrapper .m-menu-card .m-card-header{display:flex;justify-content:space-between;align-items:center;width:100%;padding:16px;cursor:pointer;-webkit-user-select:none;user-select:none;border:none;background:transparent;-webkit-tap-highlight-color:transparent}.m-wrapper .m-menu-card .m-card-header .m-card-header-left{display:flex;align-items:center;gap:16px}.m-wrapper .m-menu-card .m-card-header .m-card-header-left .m-group-icon{font-size:var(--sd-font-size-24, 24px);width:24px;height:24px;color:var(--sd-sidebar-mobile-text, #1f1f1f);object-fit:contain}.m-wrapper .m-menu-card .m-card-header .m-card-header-left .m-group-title{font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600);color:var(--sd-sidebar-mobile-text, #1f1f1f)}.m-wrapper .m-menu-card .m-card-header .m-expand-icon{color:var(--sd-sidebar-mobile-text, #1f1f1f);transition:transform var(--sd-duration-base, .2s) ease}.m-wrapper .m-menu-card .m-card-body{display:flex;flex-direction:column;padding-bottom:8px}.m-wrapper .m-menu-card .m-card-body .m-menu-item{display:flex;justify-content:space-between;align-items:center;width:100%;padding:12px 16px 12px 24px;cursor:pointer;border:none;background:transparent;transition:background-color var(--sd-duration-base, .2s);-webkit-tap-highlight-color:transparent}.m-wrapper .m-menu-card .m-card-body .m-menu-item:active{background-color:var(--sd-sidebar-mobile-item-active-bg, #f5f5f5)}.m-wrapper .m-menu-card .m-card-body .m-menu-item--indented{padding-left:48px}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left{display:flex;align-items:center;gap:12px}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left .m-item-icon{font-size:var(--sd-font-size-20, 20px);width:20px;height:20px;color:var(--sd-sidebar-mobile-icon, #8c8c8c)}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left .m-item-icon-img{width:20px;height:20px;object-fit:contain;opacity:.7}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left .m-item-title{font-size:var(--sd-font-size-15, 15px);color:var(--sd-sidebar-mobile-text-secondary, #333333)}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-nav-icon{color:var(--sd-sidebar-mobile-icon, #8c8c8c);font-size:var(--sd-font-size-20, 20px);width:20px;height:20px}.m-wrapper .m-menu-card .m-card-body .m-sub-group{border-top:1px solid var(--sd-sidebar-mobile-border, #ebebeb)}.m-wrapper .m-menu-card .m-card-body .m-sub-group:first-child{border-top:none}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header{display:flex;justify-content:space-between;align-items:center;width:100%;padding:12px 16px 12px 24px;cursor:pointer;border:none;background:var(--sd-sidebar-mobile-hover-bg, #fafafa);-webkit-tap-highlight-color:transparent}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header:active{background-color:var(--sd-sidebar-mobile-pressed-bg, #f0f0f0)}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left{display:flex;align-items:center;gap:12px}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left .m-item-icon{font-size:var(--sd-font-size-20, 20px);width:20px;height:20px;color:var(--sd-sidebar-mobile-icon, #8c8c8c)}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left .m-item-icon-img{width:20px;height:20px;object-fit:contain;opacity:.7}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left .m-item-title{font-size:var(--sd-font-size-15, 15px);font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-sidebar-mobile-text-secondary, #333333)}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-expand-icon{color:var(--sd-sidebar-mobile-icon, #8c8c8c);font-size:var(--sd-font-size-20, 20px);width:20px;height:20px}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: RouterModule }, { kind: "component", type: LayoutUserComponent, selector: "lib-layout-user", inputs: ["isMobileOrTablet", "isMenuLock", "isShowSidebar", "userInfo"], outputs: ["menuClosed", "menuOpened", "toggleMenuLock"] }] });
2868
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdSidebarMobileOverlay, isStandalone: true, selector: "sd-sidebar-mobile-overlay", inputs: { isShowSidebar: { classPropertyName: "isShowSidebar", publicName: "isShowSidebar", isSignal: true, isRequired: false, transformFunction: null }, menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: true, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { showSideBar: "showSideBar", expandSideBar: "expandSideBar", popupUserMenuOpened: "popupUserMenuOpened", popupUserMenuClosed: "popupUserMenuClosed", titleMenuGroupChanged: "titleMenuGroupChanged" }, ngImport: i0, template: "@let _userInfo = userInfo();\n@let _sidebar = sidebar();\n\n@if (_userInfo && _sidebar) {\n <div\n class=\"m-backdrop\"\n [class.m-backdrop--visible]=\"isShowSidebar()\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"onClose()\"\n (keydown.escape)=\"onClose()\">\n </div>\n\n <div class=\"m-wrapper\" [class.m-wrapper--open]=\"isShowSidebar()\">\n <div #headerElement class=\"m-header\" [class.m-header--context]=\"!!_sidebar.context\">\n <div class=\"m-title-group\">\n @if (_sidebar.logoUrl) {\n <img class=\"m-logo\" alt=\"logo\" [src]=\"_sidebar.logoUrl\" />\n }\n <span class=\"m-title\">{{ titleMenuGroup() || _sidebar.defaultTitle || 'Back Office' }}</span>\n </div>\n <button class=\"m-close-btn\" (click)=\"onClose()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n <!-- Context switcher (D-010): h\u00E0ng ri\u00EAng d\u01B0\u1EDBi ti\u00EAu \u0111\u1EC1, m\u1EDF bottom sheet. -->\n @if (_sidebar.context) {\n <sd-layout-context-switcher class=\"m-header-context\" appearance=\"sheet\" [configuration]=\"_sidebar.context\" [anchor]=\"headerElement\" />\n }\n </div>\n\n <div class=\"m-user-section\">\n <lib-layout-user\n [userInfo]=\"_userInfo\"\n [isMobileOrTablet]=\"true\"\n (menuOpened)=\"onUserMenuOpened()\"\n (menuClosed)=\"onUserMenuClosed()\">\n </lib-layout-user>\n </div>\n\n <div class=\"m-menu-list\">\n @for (group of menus(); track group.id) {\n <div class=\"m-menu-card\">\n <button class=\"m-card-header\" (click)=\"toggleMobileGroup(group.id)\">\n <div class=\"m-card-header-left\">\n @if (group.iconUrl) {\n <img class=\"m-group-icon\" [src]=\"group.iconUrl\" [alt]=\"group.title\" />\n } @else {\n <sd-icon class=\"m-group-icon\" [name]=\"group.icon || 'widgets'\"></sd-icon>\n }\n <span class=\"m-group-title\">{{ group.title }}</span>\n </div>\n <sd-icon class=\"m-expand-icon\" [name]=\"expandedMobileGroups().has(group.id ?? '') ? 'keyboard_arrow_up' : 'keyboard_arrow_down'\"></sd-icon>\n </button>\n\n @if (expandedMobileGroups().has(group.id ?? '') && hasChildren(group)) {\n <div class=\"m-card-body\">\n @for (child of getChildren(group); track child.id) {\n @if (hasChildren(child)) {\n <div class=\"m-sub-group\">\n <button class=\"m-sub-group-header\" (click)=\"toggleMobileGroup(child.id)\">\n <div class=\"m-item-left\">\n @if (child.iconUrl) {\n <img class=\"m-item-icon-img\" [src]=\"child.iconUrl\" alt=\"icon\" />\n } @else {\n <sd-icon class=\"m-item-icon\" [name]=\"child.icon || 'folder'\"></sd-icon>\n }\n <span class=\"m-item-title\">{{ child.title }}</span>\n </div>\n <sd-icon class=\"m-expand-icon\" [name]=\"expandedMobileGroups().has(child.id ?? '') ? 'keyboard_arrow_up' : 'keyboard_arrow_down'\"></sd-icon>\n </button>\n @if (expandedMobileGroups().has(child.id ?? '')) {\n @for (subChild of getChildren(child); track subChild.id) {\n <button class=\"m-menu-item m-menu-item--indented\"\n (click)=\"navigate({ path: getPath(subChild), queryParams: getQueryParams(subChild) })\">\n <div class=\"m-item-left\">\n @if (subChild.iconUrl) {\n <img class=\"m-item-icon-img\" [src]=\"subChild.iconUrl\" alt=\"icon\" />\n } @else {\n <sd-icon class=\"m-item-icon\" [name]=\"subChild.icon || 'insert_drive_file'\"></sd-icon>\n }\n <span class=\"m-item-title\">{{ subChild.title }}</span>\n </div>\n <sd-icon class=\"m-nav-icon\" name=\"chevron_right\"></sd-icon>\n </button>\n }\n }\n </div>\n } @else {\n <button class=\"m-menu-item\" (click)=\"navigate({ path: getPath(child), queryParams: getQueryParams(child) })\">\n <div class=\"m-item-left\">\n @if (child.iconUrl) {\n <img class=\"m-item-icon-img\" [src]=\"child.iconUrl\" alt=\"icon\" />\n } @else {\n <sd-icon class=\"m-item-icon\" [name]=\"child.icon || 'insert_drive_file'\"></sd-icon>\n }\n <span class=\"m-item-title\">{{ child.title }}</span>\n </div>\n <sd-icon class=\"m-nav-icon\" name=\"chevron_right\"></sd-icon>\n </button>\n }\n }\n </div>\n }\n </div>\n }\n </div>\n </div>\n}\n", styles: [":host{display:block;position:fixed;inset:0;z-index:var(--sd-z-dropdown, 1000);pointer-events:none}.m-backdrop{position:absolute;inset:0;background:#0006;opacity:0;pointer-events:none;transition:opacity var(--sd-duration-slow, .3s) ease;cursor:pointer;outline:none}.m-backdrop--visible{opacity:1;pointer-events:auto}.m-wrapper{display:flex;flex-direction:column;position:absolute;inset:0;background-color:var(--sd-sidebar-mobile-bg, #f2f2f6);padding:16px;box-sizing:border-box;overflow-y:auto;pointer-events:none;padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom));transform:translate(-100%);transition:transform var(--sd-duration-slow, .3s) var(--sd-ease-standard, cubic-bezier(.4, 0, .2, 1))}.m-wrapper--open{transform:translate(0);pointer-events:auto}.m-wrapper .m-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}.m-wrapper .m-header .m-title-group{display:flex;align-items:center;gap:12px}.m-wrapper .m-header .m-title-group .m-logo{width:32px;height:32px;object-fit:contain}.m-wrapper .m-header .m-title-group .m-title{font-size:var(--sd-font-size-18, 18px);font-weight:var(--sd-font-weight-semibold, 600);color:var(--sd-sidebar-mobile-text, #1f1f1f)}.m-wrapper .m-header.m-header--context{flex-wrap:wrap}.m-wrapper .m-header .m-header-context{flex:0 0 100%;min-width:0}.m-wrapper .m-header .m-header-context:not(:empty){margin-top:12px}.m-wrapper .m-header .m-close-btn{background:transparent;border:none;padding:0;color:var(--sd-sidebar-mobile-text, #1f1f1f);display:flex;align-items:center;justify-content:center;cursor:pointer}.m-wrapper .m-header .m-close-btn sd-icon{font-size:var(--sd-font-size-28, 28px);width:28px;height:28px}.m-wrapper .m-user-section{background-color:var(--sd-sidebar-mobile-card-bg, #ffffff);border-radius:var(--sd-radius-12, 12px);padding:12px 16px;margin-bottom:24px;box-shadow:0 1px 2px #00000005;border:1px solid var(--sd-sidebar-mobile-border, #ebebeb)}.m-wrapper .m-user-section lib-layout-user{display:block;width:100%}.m-wrapper .m-menu-list{display:flex;flex-direction:column;gap:16px}.m-wrapper .m-menu-card{background-color:var(--sd-sidebar-mobile-card-bg, #ffffff);border-radius:var(--sd-radius-12, 12px);border:1px solid var(--sd-sidebar-mobile-border, #ebebeb);overflow:hidden}.m-wrapper .m-menu-card .m-card-header{display:flex;justify-content:space-between;align-items:center;width:100%;padding:16px;cursor:pointer;-webkit-user-select:none;user-select:none;border:none;background:transparent;-webkit-tap-highlight-color:transparent}.m-wrapper .m-menu-card .m-card-header .m-card-header-left{display:flex;align-items:center;gap:16px}.m-wrapper .m-menu-card .m-card-header .m-card-header-left .m-group-icon{font-size:var(--sd-font-size-24, 24px);width:24px;height:24px;color:var(--sd-sidebar-mobile-text, #1f1f1f);object-fit:contain}.m-wrapper .m-menu-card .m-card-header .m-card-header-left .m-group-title{font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600);color:var(--sd-sidebar-mobile-text, #1f1f1f)}.m-wrapper .m-menu-card .m-card-header .m-expand-icon{color:var(--sd-sidebar-mobile-text, #1f1f1f);transition:transform var(--sd-duration-base, .2s) ease}.m-wrapper .m-menu-card .m-card-body{display:flex;flex-direction:column;padding-bottom:8px}.m-wrapper .m-menu-card .m-card-body .m-menu-item{display:flex;justify-content:space-between;align-items:center;width:100%;padding:12px 16px 12px 24px;cursor:pointer;border:none;background:transparent;transition:background-color var(--sd-duration-base, .2s);-webkit-tap-highlight-color:transparent}.m-wrapper .m-menu-card .m-card-body .m-menu-item:active{background-color:var(--sd-sidebar-mobile-item-active-bg, #f5f5f5)}.m-wrapper .m-menu-card .m-card-body .m-menu-item--indented{padding-left:48px}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left{display:flex;align-items:center;gap:12px}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left .m-item-icon{font-size:var(--sd-font-size-20, 20px);width:20px;height:20px;color:var(--sd-sidebar-mobile-icon, #8c8c8c)}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left .m-item-icon-img{width:20px;height:20px;object-fit:contain;opacity:.7}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left .m-item-title{font-size:var(--sd-font-size-15, 15px);color:var(--sd-sidebar-mobile-text-secondary, #333333)}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-nav-icon{color:var(--sd-sidebar-mobile-icon, #8c8c8c);font-size:var(--sd-font-size-20, 20px);width:20px;height:20px}.m-wrapper .m-menu-card .m-card-body .m-sub-group{border-top:1px solid var(--sd-sidebar-mobile-border, #ebebeb)}.m-wrapper .m-menu-card .m-card-body .m-sub-group:first-child{border-top:none}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header{display:flex;justify-content:space-between;align-items:center;width:100%;padding:12px 16px 12px 24px;cursor:pointer;border:none;background:var(--sd-sidebar-mobile-hover-bg, #fafafa);-webkit-tap-highlight-color:transparent}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header:active{background-color:var(--sd-sidebar-mobile-pressed-bg, #f0f0f0)}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left{display:flex;align-items:center;gap:12px}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left .m-item-icon{font-size:var(--sd-font-size-20, 20px);width:20px;height:20px;color:var(--sd-sidebar-mobile-icon, #8c8c8c)}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left .m-item-icon-img{width:20px;height:20px;object-fit:contain;opacity:.7}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left .m-item-title{font-size:var(--sd-font-size-15, 15px);font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-sidebar-mobile-text-secondary, #333333)}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-expand-icon{color:var(--sd-sidebar-mobile-icon, #8c8c8c);font-size:var(--sd-font-size-20, 20px);width:20px;height:20px}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: RouterModule }, { kind: "component", type: LayoutUserComponent, selector: "lib-layout-user", inputs: ["isMobileOrTablet", "isMenuLock", "isShowSidebar", "userInfo"], outputs: ["menuClosed", "menuOpened", "toggleMenuLock"] }, { kind: "component", type: SdLayoutContextSwitcher, selector: "sd-layout-context-switcher", inputs: ["configuration", "appearance", "placement", "anchor"] }] });
1899
2869
  }
1900
2870
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdSidebarMobileOverlay, decorators: [{
1901
2871
  type: Component,
1902
- args: [{ selector: 'sd-sidebar-mobile-overlay', standalone: true, imports: [SdIcon, CommonModule, RouterModule, LayoutUserComponent], template: "@let _userInfo = userInfo();\n@let _sidebar = sidebar();\n\n@if (_userInfo && _sidebar) {\n <div\n class=\"m-backdrop\"\n [class.m-backdrop--visible]=\"isShowSidebar()\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"onClose()\"\n (keydown.escape)=\"onClose()\">\n </div>\n\n <div class=\"m-wrapper\" [class.m-wrapper--open]=\"isShowSidebar()\">\n <div class=\"m-header\">\n <div class=\"m-title-group\">\n @if (_sidebar.logoUrl) {\n <img class=\"m-logo\" alt=\"logo\" [src]=\"_sidebar.logoUrl\" />\n }\n <span class=\"m-title\">{{ titleMenuGroup() || _sidebar.defaultTitle || 'Back Office' }}</span>\n </div>\n <button class=\"m-close-btn\" (click)=\"onClose()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n </div>\n\n <div class=\"m-user-section\">\n <lib-layout-user\n [userInfo]=\"_userInfo\"\n [isMobileOrTablet]=\"true\"\n (menuOpened)=\"onUserMenuOpened()\"\n (menuClosed)=\"onUserMenuClosed()\">\n </lib-layout-user>\n </div>\n\n <div class=\"m-menu-list\">\n @for (group of menus(); track group.id) {\n <div class=\"m-menu-card\">\n <button class=\"m-card-header\" (click)=\"toggleMobileGroup(group.id)\">\n <div class=\"m-card-header-left\">\n @if (group.iconUrl) {\n <img class=\"m-group-icon\" [src]=\"group.iconUrl\" [alt]=\"group.title\" />\n } @else {\n <sd-icon class=\"m-group-icon\" [name]=\"group.icon || 'widgets'\"></sd-icon>\n }\n <span class=\"m-group-title\">{{ group.title }}</span>\n </div>\n <sd-icon class=\"m-expand-icon\" [name]=\"expandedMobileGroups().has(group.id ?? '') ? 'keyboard_arrow_up' : 'keyboard_arrow_down'\"></sd-icon>\n </button>\n\n @if (expandedMobileGroups().has(group.id ?? '') && hasChildren(group)) {\n <div class=\"m-card-body\">\n @for (child of getChildren(group); track child.id) {\n @if (hasChildren(child)) {\n <div class=\"m-sub-group\">\n <button class=\"m-sub-group-header\" (click)=\"toggleMobileGroup(child.id)\">\n <div class=\"m-item-left\">\n @if (child.iconUrl) {\n <img class=\"m-item-icon-img\" [src]=\"child.iconUrl\" alt=\"icon\" />\n } @else {\n <sd-icon class=\"m-item-icon\" [name]=\"child.icon || 'folder'\"></sd-icon>\n }\n <span class=\"m-item-title\">{{ child.title }}</span>\n </div>\n <sd-icon class=\"m-expand-icon\" [name]=\"expandedMobileGroups().has(child.id ?? '') ? 'keyboard_arrow_up' : 'keyboard_arrow_down'\"></sd-icon>\n </button>\n @if (expandedMobileGroups().has(child.id ?? '')) {\n @for (subChild of getChildren(child); track subChild.id) {\n <button class=\"m-menu-item m-menu-item--indented\"\n (click)=\"navigate({ path: getPath(subChild), queryParams: getQueryParams(subChild) })\">\n <div class=\"m-item-left\">\n @if (subChild.iconUrl) {\n <img class=\"m-item-icon-img\" [src]=\"subChild.iconUrl\" alt=\"icon\" />\n } @else {\n <sd-icon class=\"m-item-icon\" [name]=\"subChild.icon || 'insert_drive_file'\"></sd-icon>\n }\n <span class=\"m-item-title\">{{ subChild.title }}</span>\n </div>\n <sd-icon class=\"m-nav-icon\" name=\"chevron_right\"></sd-icon>\n </button>\n }\n }\n </div>\n } @else {\n <button class=\"m-menu-item\" (click)=\"navigate({ path: getPath(child), queryParams: getQueryParams(child) })\">\n <div class=\"m-item-left\">\n @if (child.iconUrl) {\n <img class=\"m-item-icon-img\" [src]=\"child.iconUrl\" alt=\"icon\" />\n } @else {\n <sd-icon class=\"m-item-icon\" [name]=\"child.icon || 'insert_drive_file'\"></sd-icon>\n }\n <span class=\"m-item-title\">{{ child.title }}</span>\n </div>\n <sd-icon class=\"m-nav-icon\" name=\"chevron_right\"></sd-icon>\n </button>\n }\n }\n </div>\n }\n </div>\n }\n </div>\n </div>\n}\n", styles: [":host{display:block;position:fixed;inset:0;z-index:var(--sd-z-dropdown, 1000);pointer-events:none}.m-backdrop{position:absolute;inset:0;background:#0006;opacity:0;pointer-events:none;transition:opacity var(--sd-duration-slow, .3s) ease;cursor:pointer;outline:none}.m-backdrop--visible{opacity:1;pointer-events:auto}.m-wrapper{display:flex;flex-direction:column;position:absolute;inset:0;background-color:var(--sd-sidebar-mobile-bg, #f2f2f6);padding:16px;box-sizing:border-box;overflow-y:auto;pointer-events:none;padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom));transform:translate(-100%);transition:transform var(--sd-duration-slow, .3s) var(--sd-ease-standard, cubic-bezier(.4, 0, .2, 1))}.m-wrapper--open{transform:translate(0);pointer-events:auto}.m-wrapper .m-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}.m-wrapper .m-header .m-title-group{display:flex;align-items:center;gap:12px}.m-wrapper .m-header .m-title-group .m-logo{width:32px;height:32px;object-fit:contain}.m-wrapper .m-header .m-title-group .m-title{font-size:var(--sd-font-size-18, 18px);font-weight:var(--sd-font-weight-semibold, 600);color:var(--sd-sidebar-mobile-text, #1f1f1f)}.m-wrapper .m-header .m-close-btn{background:transparent;border:none;padding:0;color:var(--sd-sidebar-mobile-text, #1f1f1f);display:flex;align-items:center;justify-content:center;cursor:pointer}.m-wrapper .m-header .m-close-btn sd-icon{font-size:var(--sd-font-size-28, 28px);width:28px;height:28px}.m-wrapper .m-user-section{background-color:var(--sd-sidebar-mobile-card-bg, #ffffff);border-radius:var(--sd-radius-12, 12px);padding:12px 16px;margin-bottom:24px;box-shadow:0 1px 2px #00000005;border:1px solid var(--sd-sidebar-mobile-border, #ebebeb)}.m-wrapper .m-user-section lib-layout-user{display:block;width:100%}.m-wrapper .m-menu-list{display:flex;flex-direction:column;gap:16px}.m-wrapper .m-menu-card{background-color:var(--sd-sidebar-mobile-card-bg, #ffffff);border-radius:var(--sd-radius-12, 12px);border:1px solid var(--sd-sidebar-mobile-border, #ebebeb);overflow:hidden}.m-wrapper .m-menu-card .m-card-header{display:flex;justify-content:space-between;align-items:center;width:100%;padding:16px;cursor:pointer;-webkit-user-select:none;user-select:none;border:none;background:transparent;-webkit-tap-highlight-color:transparent}.m-wrapper .m-menu-card .m-card-header .m-card-header-left{display:flex;align-items:center;gap:16px}.m-wrapper .m-menu-card .m-card-header .m-card-header-left .m-group-icon{font-size:var(--sd-font-size-24, 24px);width:24px;height:24px;color:var(--sd-sidebar-mobile-text, #1f1f1f);object-fit:contain}.m-wrapper .m-menu-card .m-card-header .m-card-header-left .m-group-title{font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600);color:var(--sd-sidebar-mobile-text, #1f1f1f)}.m-wrapper .m-menu-card .m-card-header .m-expand-icon{color:var(--sd-sidebar-mobile-text, #1f1f1f);transition:transform var(--sd-duration-base, .2s) ease}.m-wrapper .m-menu-card .m-card-body{display:flex;flex-direction:column;padding-bottom:8px}.m-wrapper .m-menu-card .m-card-body .m-menu-item{display:flex;justify-content:space-between;align-items:center;width:100%;padding:12px 16px 12px 24px;cursor:pointer;border:none;background:transparent;transition:background-color var(--sd-duration-base, .2s);-webkit-tap-highlight-color:transparent}.m-wrapper .m-menu-card .m-card-body .m-menu-item:active{background-color:var(--sd-sidebar-mobile-item-active-bg, #f5f5f5)}.m-wrapper .m-menu-card .m-card-body .m-menu-item--indented{padding-left:48px}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left{display:flex;align-items:center;gap:12px}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left .m-item-icon{font-size:var(--sd-font-size-20, 20px);width:20px;height:20px;color:var(--sd-sidebar-mobile-icon, #8c8c8c)}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left .m-item-icon-img{width:20px;height:20px;object-fit:contain;opacity:.7}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left .m-item-title{font-size:var(--sd-font-size-15, 15px);color:var(--sd-sidebar-mobile-text-secondary, #333333)}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-nav-icon{color:var(--sd-sidebar-mobile-icon, #8c8c8c);font-size:var(--sd-font-size-20, 20px);width:20px;height:20px}.m-wrapper .m-menu-card .m-card-body .m-sub-group{border-top:1px solid var(--sd-sidebar-mobile-border, #ebebeb)}.m-wrapper .m-menu-card .m-card-body .m-sub-group:first-child{border-top:none}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header{display:flex;justify-content:space-between;align-items:center;width:100%;padding:12px 16px 12px 24px;cursor:pointer;border:none;background:var(--sd-sidebar-mobile-hover-bg, #fafafa);-webkit-tap-highlight-color:transparent}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header:active{background-color:var(--sd-sidebar-mobile-pressed-bg, #f0f0f0)}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left{display:flex;align-items:center;gap:12px}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left .m-item-icon{font-size:var(--sd-font-size-20, 20px);width:20px;height:20px;color:var(--sd-sidebar-mobile-icon, #8c8c8c)}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left .m-item-icon-img{width:20px;height:20px;object-fit:contain;opacity:.7}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left .m-item-title{font-size:var(--sd-font-size-15, 15px);font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-sidebar-mobile-text-secondary, #333333)}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-expand-icon{color:var(--sd-sidebar-mobile-icon, #8c8c8c);font-size:var(--sd-font-size-20, 20px);width:20px;height:20px}\n"] }]
2872
+ args: [{ selector: 'sd-sidebar-mobile-overlay', standalone: true, imports: [SdIcon, CommonModule, RouterModule, LayoutUserComponent, SdLayoutContextSwitcher], template: "@let _userInfo = userInfo();\n@let _sidebar = sidebar();\n\n@if (_userInfo && _sidebar) {\n <div\n class=\"m-backdrop\"\n [class.m-backdrop--visible]=\"isShowSidebar()\"\n role=\"button\"\n tabindex=\"0\"\n (click)=\"onClose()\"\n (keydown.escape)=\"onClose()\">\n </div>\n\n <div class=\"m-wrapper\" [class.m-wrapper--open]=\"isShowSidebar()\">\n <div #headerElement class=\"m-header\" [class.m-header--context]=\"!!_sidebar.context\">\n <div class=\"m-title-group\">\n @if (_sidebar.logoUrl) {\n <img class=\"m-logo\" alt=\"logo\" [src]=\"_sidebar.logoUrl\" />\n }\n <span class=\"m-title\">{{ titleMenuGroup() || _sidebar.defaultTitle || 'Back Office' }}</span>\n </div>\n <button class=\"m-close-btn\" (click)=\"onClose()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n <!-- Context switcher (D-010): h\u00E0ng ri\u00EAng d\u01B0\u1EDBi ti\u00EAu \u0111\u1EC1, m\u1EDF bottom sheet. -->\n @if (_sidebar.context) {\n <sd-layout-context-switcher class=\"m-header-context\" appearance=\"sheet\" [configuration]=\"_sidebar.context\" [anchor]=\"headerElement\" />\n }\n </div>\n\n <div class=\"m-user-section\">\n <lib-layout-user\n [userInfo]=\"_userInfo\"\n [isMobileOrTablet]=\"true\"\n (menuOpened)=\"onUserMenuOpened()\"\n (menuClosed)=\"onUserMenuClosed()\">\n </lib-layout-user>\n </div>\n\n <div class=\"m-menu-list\">\n @for (group of menus(); track group.id) {\n <div class=\"m-menu-card\">\n <button class=\"m-card-header\" (click)=\"toggleMobileGroup(group.id)\">\n <div class=\"m-card-header-left\">\n @if (group.iconUrl) {\n <img class=\"m-group-icon\" [src]=\"group.iconUrl\" [alt]=\"group.title\" />\n } @else {\n <sd-icon class=\"m-group-icon\" [name]=\"group.icon || 'widgets'\"></sd-icon>\n }\n <span class=\"m-group-title\">{{ group.title }}</span>\n </div>\n <sd-icon class=\"m-expand-icon\" [name]=\"expandedMobileGroups().has(group.id ?? '') ? 'keyboard_arrow_up' : 'keyboard_arrow_down'\"></sd-icon>\n </button>\n\n @if (expandedMobileGroups().has(group.id ?? '') && hasChildren(group)) {\n <div class=\"m-card-body\">\n @for (child of getChildren(group); track child.id) {\n @if (hasChildren(child)) {\n <div class=\"m-sub-group\">\n <button class=\"m-sub-group-header\" (click)=\"toggleMobileGroup(child.id)\">\n <div class=\"m-item-left\">\n @if (child.iconUrl) {\n <img class=\"m-item-icon-img\" [src]=\"child.iconUrl\" alt=\"icon\" />\n } @else {\n <sd-icon class=\"m-item-icon\" [name]=\"child.icon || 'folder'\"></sd-icon>\n }\n <span class=\"m-item-title\">{{ child.title }}</span>\n </div>\n <sd-icon class=\"m-expand-icon\" [name]=\"expandedMobileGroups().has(child.id ?? '') ? 'keyboard_arrow_up' : 'keyboard_arrow_down'\"></sd-icon>\n </button>\n @if (expandedMobileGroups().has(child.id ?? '')) {\n @for (subChild of getChildren(child); track subChild.id) {\n <button class=\"m-menu-item m-menu-item--indented\"\n (click)=\"navigate({ path: getPath(subChild), queryParams: getQueryParams(subChild) })\">\n <div class=\"m-item-left\">\n @if (subChild.iconUrl) {\n <img class=\"m-item-icon-img\" [src]=\"subChild.iconUrl\" alt=\"icon\" />\n } @else {\n <sd-icon class=\"m-item-icon\" [name]=\"subChild.icon || 'insert_drive_file'\"></sd-icon>\n }\n <span class=\"m-item-title\">{{ subChild.title }}</span>\n </div>\n <sd-icon class=\"m-nav-icon\" name=\"chevron_right\"></sd-icon>\n </button>\n }\n }\n </div>\n } @else {\n <button class=\"m-menu-item\" (click)=\"navigate({ path: getPath(child), queryParams: getQueryParams(child) })\">\n <div class=\"m-item-left\">\n @if (child.iconUrl) {\n <img class=\"m-item-icon-img\" [src]=\"child.iconUrl\" alt=\"icon\" />\n } @else {\n <sd-icon class=\"m-item-icon\" [name]=\"child.icon || 'insert_drive_file'\"></sd-icon>\n }\n <span class=\"m-item-title\">{{ child.title }}</span>\n </div>\n <sd-icon class=\"m-nav-icon\" name=\"chevron_right\"></sd-icon>\n </button>\n }\n }\n </div>\n }\n </div>\n }\n </div>\n </div>\n}\n", styles: [":host{display:block;position:fixed;inset:0;z-index:var(--sd-z-dropdown, 1000);pointer-events:none}.m-backdrop{position:absolute;inset:0;background:#0006;opacity:0;pointer-events:none;transition:opacity var(--sd-duration-slow, .3s) ease;cursor:pointer;outline:none}.m-backdrop--visible{opacity:1;pointer-events:auto}.m-wrapper{display:flex;flex-direction:column;position:absolute;inset:0;background-color:var(--sd-sidebar-mobile-bg, #f2f2f6);padding:16px;box-sizing:border-box;overflow-y:auto;pointer-events:none;padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom));transform:translate(-100%);transition:transform var(--sd-duration-slow, .3s) var(--sd-ease-standard, cubic-bezier(.4, 0, .2, 1))}.m-wrapper--open{transform:translate(0);pointer-events:auto}.m-wrapper .m-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px}.m-wrapper .m-header .m-title-group{display:flex;align-items:center;gap:12px}.m-wrapper .m-header .m-title-group .m-logo{width:32px;height:32px;object-fit:contain}.m-wrapper .m-header .m-title-group .m-title{font-size:var(--sd-font-size-18, 18px);font-weight:var(--sd-font-weight-semibold, 600);color:var(--sd-sidebar-mobile-text, #1f1f1f)}.m-wrapper .m-header.m-header--context{flex-wrap:wrap}.m-wrapper .m-header .m-header-context{flex:0 0 100%;min-width:0}.m-wrapper .m-header .m-header-context:not(:empty){margin-top:12px}.m-wrapper .m-header .m-close-btn{background:transparent;border:none;padding:0;color:var(--sd-sidebar-mobile-text, #1f1f1f);display:flex;align-items:center;justify-content:center;cursor:pointer}.m-wrapper .m-header .m-close-btn sd-icon{font-size:var(--sd-font-size-28, 28px);width:28px;height:28px}.m-wrapper .m-user-section{background-color:var(--sd-sidebar-mobile-card-bg, #ffffff);border-radius:var(--sd-radius-12, 12px);padding:12px 16px;margin-bottom:24px;box-shadow:0 1px 2px #00000005;border:1px solid var(--sd-sidebar-mobile-border, #ebebeb)}.m-wrapper .m-user-section lib-layout-user{display:block;width:100%}.m-wrapper .m-menu-list{display:flex;flex-direction:column;gap:16px}.m-wrapper .m-menu-card{background-color:var(--sd-sidebar-mobile-card-bg, #ffffff);border-radius:var(--sd-radius-12, 12px);border:1px solid var(--sd-sidebar-mobile-border, #ebebeb);overflow:hidden}.m-wrapper .m-menu-card .m-card-header{display:flex;justify-content:space-between;align-items:center;width:100%;padding:16px;cursor:pointer;-webkit-user-select:none;user-select:none;border:none;background:transparent;-webkit-tap-highlight-color:transparent}.m-wrapper .m-menu-card .m-card-header .m-card-header-left{display:flex;align-items:center;gap:16px}.m-wrapper .m-menu-card .m-card-header .m-card-header-left .m-group-icon{font-size:var(--sd-font-size-24, 24px);width:24px;height:24px;color:var(--sd-sidebar-mobile-text, #1f1f1f);object-fit:contain}.m-wrapper .m-menu-card .m-card-header .m-card-header-left .m-group-title{font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600);color:var(--sd-sidebar-mobile-text, #1f1f1f)}.m-wrapper .m-menu-card .m-card-header .m-expand-icon{color:var(--sd-sidebar-mobile-text, #1f1f1f);transition:transform var(--sd-duration-base, .2s) ease}.m-wrapper .m-menu-card .m-card-body{display:flex;flex-direction:column;padding-bottom:8px}.m-wrapper .m-menu-card .m-card-body .m-menu-item{display:flex;justify-content:space-between;align-items:center;width:100%;padding:12px 16px 12px 24px;cursor:pointer;border:none;background:transparent;transition:background-color var(--sd-duration-base, .2s);-webkit-tap-highlight-color:transparent}.m-wrapper .m-menu-card .m-card-body .m-menu-item:active{background-color:var(--sd-sidebar-mobile-item-active-bg, #f5f5f5)}.m-wrapper .m-menu-card .m-card-body .m-menu-item--indented{padding-left:48px}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left{display:flex;align-items:center;gap:12px}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left .m-item-icon{font-size:var(--sd-font-size-20, 20px);width:20px;height:20px;color:var(--sd-sidebar-mobile-icon, #8c8c8c)}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left .m-item-icon-img{width:20px;height:20px;object-fit:contain;opacity:.7}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-item-left .m-item-title{font-size:var(--sd-font-size-15, 15px);color:var(--sd-sidebar-mobile-text-secondary, #333333)}.m-wrapper .m-menu-card .m-card-body .m-menu-item .m-nav-icon{color:var(--sd-sidebar-mobile-icon, #8c8c8c);font-size:var(--sd-font-size-20, 20px);width:20px;height:20px}.m-wrapper .m-menu-card .m-card-body .m-sub-group{border-top:1px solid var(--sd-sidebar-mobile-border, #ebebeb)}.m-wrapper .m-menu-card .m-card-body .m-sub-group:first-child{border-top:none}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header{display:flex;justify-content:space-between;align-items:center;width:100%;padding:12px 16px 12px 24px;cursor:pointer;border:none;background:var(--sd-sidebar-mobile-hover-bg, #fafafa);-webkit-tap-highlight-color:transparent}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header:active{background-color:var(--sd-sidebar-mobile-pressed-bg, #f0f0f0)}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left{display:flex;align-items:center;gap:12px}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left .m-item-icon{font-size:var(--sd-font-size-20, 20px);width:20px;height:20px;color:var(--sd-sidebar-mobile-icon, #8c8c8c)}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left .m-item-icon-img{width:20px;height:20px;object-fit:contain;opacity:.7}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-item-left .m-item-title{font-size:var(--sd-font-size-15, 15px);font-weight:var(--sd-font-weight-medium, 500);color:var(--sd-sidebar-mobile-text-secondary, #333333)}.m-wrapper .m-menu-card .m-card-body .m-sub-group .m-sub-group-header .m-expand-icon{color:var(--sd-sidebar-mobile-icon, #8c8c8c);font-size:var(--sd-font-size-20, 20px);width:20px;height:20px}\n"] }]
1903
2873
  }], ctorParameters: () => [], propDecorators: { isShowSidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "isShowSidebar", required: false }] }], menus: [{ type: i0.Input, args: [{ isSignal: true, alias: "menus", required: true }] }], userInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "userInfo", required: true }] }], sidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebar", required: true }] }], showSideBar: [{ type: i0.Output, args: ["showSideBar"] }], expandSideBar: [{ type: i0.Output, args: ["expandSideBar"] }], popupUserMenuOpened: [{ type: i0.Output, args: ["popupUserMenuOpened"] }], popupUserMenuClosed: [{ type: i0.Output, args: ["popupUserMenuClosed"] }], titleMenuGroupChanged: [{ type: i0.Output, args: ["titleMenuGroupChanged"] }] } });
1904
2874
 
1905
2875
  class SdSidebarMobileV1 {
@@ -2058,11 +3028,11 @@ class SdLayoutSearchFieldComponent {
2058
3028
  appearance = input('pill', ...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
2059
3029
  sdChange = output();
2060
3030
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdLayoutSearchFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2061
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.17", type: SdLayoutSearchFieldComponent, isStandalone: true, selector: "sd-layout-search-field", inputs: { model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: true, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: true, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sdChange: "sdChange" }, ngImport: i0, template: "<div\n data-layout-search\n class=\"sd-layout-search-field d-flex align-items-center gap-8\"\n [class.sd-layout-search-field--soft-pill]=\"appearance() === 'pill'\"\n [class.sd-layout-search-field--compact]=\"appearance() === 'compact'\">\n <sd-icon class=\"sd-layout-search-field__icon\" name=\"search\"></sd-icon>\n <sd-input\n class=\"sd-layout-search-field__control\"\n size=\"sm\"\n hideInlineError\n [placeholder]=\"placeholder()\"\n [autoId]=\"autoId()\"\n [model]=\"model()\"\n (sdChange)=\"sdChange.emit($event)\">\n </sd-input>\n</div>\n", styles: [":host{display:block;min-width:0}.sd-layout-search-field{min-height:38px;padding:0 12px;border:0;border-radius:9999px;outline:1px solid transparent;outline-offset:1px;background:var(--sd-black100, var(--sd-surface-muted));color:var(--sd-black400, var(--sd-text-muted))}.sd-layout-search-field:focus-within{outline-color:var(--sd-focus-ring-color, var(--sd-primary))}.sd-layout-search-field__icon{flex:0 0 auto;color:var(--sd-black400, var(--sd-text-muted))}.sd-layout-search-field__control{flex:1;min-width:0;--sd-border: transparent;--mdc-outlined-text-field-outline-color: transparent;--mdc-outlined-text-field-hover-outline-color: transparent;--mdc-outlined-text-field-focus-outline-color: transparent;--mdc-outlined-text-field-input-text-placeholder-color: var(--sd-black400, var(--sd-text-muted));--mdc-outlined-text-field-container-shape: 0px}:host ::ng-deep .sd-layout-search-field__control input:focus-visible{outline:0}.sd-layout-search-field--compact{min-height:36px;padding:0 9px;border:1px solid color-mix(in srgb,var(--sd-border, #c4c6d0) 45%,var(--sd-white, #fff));border-radius:7px;background:color-mix(in srgb,var(--sd-surface-muted, #e7e8ed) 35%,var(--sd-white, #fff));color:var(--sd-text-secondary, #6b7280);outline:0;--mat-form-field-container-height: 34px;--mat-form-field-container-vertical-padding: 6px;--mat-form-field-container-text-size: 13px}.sd-layout-search-field--compact:focus-within{border-color:color-mix(in srgb,var(--sd-primary, #005cbb) 75%,var(--sd-white, #fff))}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdInput, selector: "sd-input", inputs: ["autoId", "name", "appearance", "floatLabel", "labelPlacement", "size", "form", "label", "helperText", "placeholder", "type", "mask", "inputmode", "autocomplete", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "minlength", "maxlength", "pattern", "patternErrorMessage", "validator", "inlineError", "hyperlink", "model"], outputs: ["modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3031
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.17", type: SdLayoutSearchFieldComponent, isStandalone: true, selector: "sd-layout-search-field", inputs: { model: { classPropertyName: "model", publicName: "model", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: true, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: true, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { sdChange: "sdChange" }, ngImport: i0, template: "<div\n data-layout-search\n class=\"sd-layout-search-field d-flex align-items-center gap-8\"\n [class.sd-layout-search-field--soft-pill]=\"appearance() === 'pill'\"\n [class.sd-layout-search-field--compact]=\"appearance() === 'compact'\">\n <sd-icon class=\"sd-layout-search-field__icon\" name=\"search\"></sd-icon>\n <sd-input\n class=\"sd-layout-search-field__control\"\n size=\"sm\"\n hideInlineError\n [placeholder]=\"placeholder()\"\n [autoId]=\"autoId()\"\n [model]=\"model()\"\n (sdChange)=\"sdChange.emit($event)\">\n </sd-input>\n</div>\n", styles: [":host{display:block;min-width:0}.sd-layout-search-field{min-height:38px;padding:0 12px;border:0;border-radius:9999px;outline:1px solid transparent;outline-offset:1px;background:var(--sd-black100, var(--sd-surface-muted));color:var(--sd-black400, var(--sd-text-muted))}.sd-layout-search-field:focus-within{outline-color:var(--sd-focus-ring-color, var(--sd-primary))}.sd-layout-search-field__icon{flex:0 0 auto;color:var(--sd-black400, var(--sd-text-muted))}.sd-layout-search-field__control{flex:1;min-width:0;--sd-border: transparent;--mdc-outlined-text-field-outline-color: transparent;--mdc-outlined-text-field-hover-outline-color: transparent;--mdc-outlined-text-field-focus-outline-color: transparent;--mat-form-field-outlined-outline-color: transparent;--mat-form-field-outlined-hover-outline-color: transparent;--mat-form-field-outlined-focus-outline-color: transparent;--mdc-outlined-text-field-input-text-placeholder-color: var(--sd-black400, var(--sd-text-muted));--mdc-outlined-text-field-container-shape: 0px;--mat-form-field-outlined-input-text-placeholder-color: var(--sd-black400, var(--sd-text-muted));--mat-form-field-outlined-container-shape: 0px}:host ::ng-deep .sd-layout-search-field__control input:focus-visible{outline:0}.sd-layout-search-field--compact{min-height:36px;padding:0 9px;border:1px solid color-mix(in srgb,var(--sd-border, #c4c6d0) 45%,var(--sd-white, #fff));border-radius:7px;background:color-mix(in srgb,var(--sd-surface-muted, #e7e8ed) 35%,var(--sd-white, #fff));color:var(--sd-text-secondary, #6b7280);outline:0;--mat-form-field-container-height: 34px;--mat-form-field-container-vertical-padding: 6px;--mat-form-field-container-text-size: 13px}.sd-layout-search-field--compact:focus-within{border-color:color-mix(in srgb,var(--sd-primary, #005cbb) 75%,var(--sd-white, #fff))}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdInput, selector: "sd-input", inputs: ["autoId", "name", "appearance", "floatLabel", "labelPlacement", "size", "operators", "operator", "form", "label", "helperText", "placeholder", "type", "mask", "inputmode", "autocomplete", "hideInlineError", "blurOnEnter", "clearable", "required", "readonly", "disabled", "viewed", "minlength", "maxlength", "pattern", "patternErrorMessage", "validator", "inlineError", "hyperlink", "model"], outputs: ["operatorChange", "modelChange", "sdChange", "sdFocus", "sdBlur", "keyupEnter", "cleared", "sdFocusForceBlur"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2062
3032
  }
2063
3033
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdLayoutSearchFieldComponent, decorators: [{
2064
3034
  type: Component,
2065
- args: [{ selector: 'sd-layout-search-field', standalone: true, imports: [SdIcon, SdInput], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n data-layout-search\n class=\"sd-layout-search-field d-flex align-items-center gap-8\"\n [class.sd-layout-search-field--soft-pill]=\"appearance() === 'pill'\"\n [class.sd-layout-search-field--compact]=\"appearance() === 'compact'\">\n <sd-icon class=\"sd-layout-search-field__icon\" name=\"search\"></sd-icon>\n <sd-input\n class=\"sd-layout-search-field__control\"\n size=\"sm\"\n hideInlineError\n [placeholder]=\"placeholder()\"\n [autoId]=\"autoId()\"\n [model]=\"model()\"\n (sdChange)=\"sdChange.emit($event)\">\n </sd-input>\n</div>\n", styles: [":host{display:block;min-width:0}.sd-layout-search-field{min-height:38px;padding:0 12px;border:0;border-radius:9999px;outline:1px solid transparent;outline-offset:1px;background:var(--sd-black100, var(--sd-surface-muted));color:var(--sd-black400, var(--sd-text-muted))}.sd-layout-search-field:focus-within{outline-color:var(--sd-focus-ring-color, var(--sd-primary))}.sd-layout-search-field__icon{flex:0 0 auto;color:var(--sd-black400, var(--sd-text-muted))}.sd-layout-search-field__control{flex:1;min-width:0;--sd-border: transparent;--mdc-outlined-text-field-outline-color: transparent;--mdc-outlined-text-field-hover-outline-color: transparent;--mdc-outlined-text-field-focus-outline-color: transparent;--mdc-outlined-text-field-input-text-placeholder-color: var(--sd-black400, var(--sd-text-muted));--mdc-outlined-text-field-container-shape: 0px}:host ::ng-deep .sd-layout-search-field__control input:focus-visible{outline:0}.sd-layout-search-field--compact{min-height:36px;padding:0 9px;border:1px solid color-mix(in srgb,var(--sd-border, #c4c6d0) 45%,var(--sd-white, #fff));border-radius:7px;background:color-mix(in srgb,var(--sd-surface-muted, #e7e8ed) 35%,var(--sd-white, #fff));color:var(--sd-text-secondary, #6b7280);outline:0;--mat-form-field-container-height: 34px;--mat-form-field-container-vertical-padding: 6px;--mat-form-field-container-text-size: 13px}.sd-layout-search-field--compact:focus-within{border-color:color-mix(in srgb,var(--sd-primary, #005cbb) 75%,var(--sd-white, #fff))}\n"] }]
3035
+ args: [{ selector: 'sd-layout-search-field', standalone: true, imports: [SdIcon, SdInput], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n data-layout-search\n class=\"sd-layout-search-field d-flex align-items-center gap-8\"\n [class.sd-layout-search-field--soft-pill]=\"appearance() === 'pill'\"\n [class.sd-layout-search-field--compact]=\"appearance() === 'compact'\">\n <sd-icon class=\"sd-layout-search-field__icon\" name=\"search\"></sd-icon>\n <sd-input\n class=\"sd-layout-search-field__control\"\n size=\"sm\"\n hideInlineError\n [placeholder]=\"placeholder()\"\n [autoId]=\"autoId()\"\n [model]=\"model()\"\n (sdChange)=\"sdChange.emit($event)\">\n </sd-input>\n</div>\n", styles: [":host{display:block;min-width:0}.sd-layout-search-field{min-height:38px;padding:0 12px;border:0;border-radius:9999px;outline:1px solid transparent;outline-offset:1px;background:var(--sd-black100, var(--sd-surface-muted));color:var(--sd-black400, var(--sd-text-muted))}.sd-layout-search-field:focus-within{outline-color:var(--sd-focus-ring-color, var(--sd-primary))}.sd-layout-search-field__icon{flex:0 0 auto;color:var(--sd-black400, var(--sd-text-muted))}.sd-layout-search-field__control{flex:1;min-width:0;--sd-border: transparent;--mdc-outlined-text-field-outline-color: transparent;--mdc-outlined-text-field-hover-outline-color: transparent;--mdc-outlined-text-field-focus-outline-color: transparent;--mat-form-field-outlined-outline-color: transparent;--mat-form-field-outlined-hover-outline-color: transparent;--mat-form-field-outlined-focus-outline-color: transparent;--mdc-outlined-text-field-input-text-placeholder-color: var(--sd-black400, var(--sd-text-muted));--mdc-outlined-text-field-container-shape: 0px;--mat-form-field-outlined-input-text-placeholder-color: var(--sd-black400, var(--sd-text-muted));--mat-form-field-outlined-container-shape: 0px}:host ::ng-deep .sd-layout-search-field__control input:focus-visible{outline:0}.sd-layout-search-field--compact{min-height:36px;padding:0 9px;border:1px solid color-mix(in srgb,var(--sd-border, #c4c6d0) 45%,var(--sd-white, #fff));border-radius:7px;background:color-mix(in srgb,var(--sd-surface-muted, #e7e8ed) 35%,var(--sd-white, #fff));color:var(--sd-text-secondary, #6b7280);outline:0;--mat-form-field-container-height: 34px;--mat-form-field-container-vertical-padding: 6px;--mat-form-field-container-text-size: 13px}.sd-layout-search-field--compact:focus-within{border-color:color-mix(in srgb,var(--sd-primary, #005cbb) 75%,var(--sd-white, #fff))}\n"] }]
2066
3036
  }], propDecorators: { model: [{ type: i0.Input, args: [{ isSignal: true, alias: "model", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: true }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: true }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], sdChange: [{ type: i0.Output, args: ["sdChange"] }] } });
2067
3037
 
2068
3038
  class SdSidebarV2 {
@@ -2179,13 +3149,20 @@ class SdSidebarV2 {
2179
3149
  this.#navigationState.patchVersionState(2, { locked: false });
2180
3150
  }
2181
3151
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdSidebarV2, deps: [], target: i0.ɵɵFactoryTarget.Component });
2182
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdSidebarV2, isStandalone: true, selector: "sd-sidebar-v2", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "keydown.escape": "closeFromEscape()" } }, ngImport: i0, template: "<!-- why: `(keydown.escape)` \u0111\u01B0\u1EE3c gom l\u00EAn HOST c\u1EE7a component (xem `host` trong main.component.ts).\n Tr\u01B0\u1EDBc \u0111\u00E2y n\u00F3 n\u1EB1m tr\u00EAn div b\u1ECDc v\u00E0 tr\u00EAn <section> flyout \u2014 c\u1EA3 hai \u0111\u1EC1u KH\u00D4NG focusable n\u00EAn ch\u1EC9\n \"ch\u1EA1y nh\u1EDD\" event n\u1ED5i b\u1ECDt t\u1EEB con, \u0111\u1ED3ng th\u1EDDi khi\u1EBFn markup khai b\u00E1o interaction handler tr\u00EAn\n ph\u1EA7n t\u1EED kh\u00F4ng nh\u1EADn \u0111\u01B0\u1EE3c focus. Host l\u00E0 t\u1ED5 ti\u00EAn c\u1EE7a t\u1EA5t c\u1EA3 n\u00EAn h\u00E0nh vi gi\u1EEF nguy\u00EAn. -->\n<div class=\"sd-sidebar-v2\">\n <aside class=\"sd-sidebar-v2__rail d-flex flex-column align-items-center gap-8 py-12 bg-white border-right border-black200\">\n <button type=\"button\" class=\"sd-sidebar-v2__brand d-flex align-items-center justify-content-center\" [attr.aria-label]=\"'core.module.layout.home.tab-name' | sdTranslate\">\n @if (sidebar().logoUrl) {\n <img class=\"sd-sidebar-v2__logo\" [src]=\"sidebar().logoUrl\" alt=\"\" />\n } @else {\n <sd-icon name=\"apps\"></sd-icon>\n }\n </button>\n\n <nav class=\"d-flex flex-column align-items-center gap-4 flex-1\" [attr.aria-label]=\"'core.module.layout.sidebar.menu-groups' | sdTranslate\">\n @for (item of railItems(); track item.key) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v2__rail-action d-flex flex-column align-items-center justify-content-center gap-4\"\n [attr.data-v2-group-key]=\"item.key\"\n [attr.aria-label]=\"item.title\"\n [attr.aria-expanded]=\"activeGroupKey() === item.key && isFlyoutOpen()\"\n [class.sd-sidebar-v2__rail-action--active]=\"activeGroupKey() === item.key\"\n (click)=\"selectGroup(item.menu)\"\n (mouseenter)=\"previewGroup(item.menu)\"\n (focus)=\"previewGroup(item.menu)\">\n @if (item.menu.iconUrl) {\n <img class=\"sd-sidebar-v2__rail-icon\" [src]=\"item.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"item.menu.icon || 'widgets'\"></sd-icon>\n }\n <span class=\"sd-sidebar-v2__rail-label text-ellipsis\">{{ item.title }}</span>\n </button>\n }\n </nav>\n\n <sd-layout-user-menu [userInfo]=\"userInfo()\" [compact]=\"true\"></sd-layout-user-menu>\n </aside>\n\n @if (isFlyoutOpen()) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v2__backdrop\"\n [attr.aria-label]=\"'core.module.layout.sidebar.close-menu' | sdTranslate\"\n (click)=\"closeFromBackdrop()\"\n (keydown.escape)=\"closeFromEscape()\"></button>\n <section\n class=\"sd-sidebar-v2__flyout d-flex flex-column bg-white border-right border-black200 mat-elevation-z4\"\n role=\"region\"\n [attr.aria-label]=\"activeGroup()?.title || 'Menu'\"\n (mouseleave)=\"leaveFlyout()\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n <span class=\"T16M text-ellipsis\">{{ activeGroup()?.title || sidebar().defaultTitle || 'Menu' }}</span>\n @if (isFlyoutLocked()) {\n <sd-icon name=\"lock\"></sd-icon>\n }\n </header>\n <div class=\"p-12\">\n <sd-layout-search-field\n [placeholder]=\"'core.module.layout.sidebar.search-in-group' | sdTranslate\"\n [autoId]=\"'layout-v2-context-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n <div class=\"flex-1 overflow-auto px-8 pb-12\">\n <sd-layout-menu-tree\n [menus]=\"contextMenus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"onNavigate($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </div>\n </section>\n }\n\n <main class=\"sd-sidebar-v2__content\" data-v2-content data-content-offset=\"rail\">\n <ng-content></ng-content>\n </main>\n</div>\n", styles: [".sd-sidebar-v2{min-height:100vh;background:var(--sd-light)}.sd-sidebar-v2__rail{position:fixed;z-index:var(--sd-z-header, 30);inset:0 auto 0 0;width:72px}.sd-sidebar-v2__brand,.sd-sidebar-v2__rail-action{width:56px;min-height:52px;border:0;border-radius:var(--sd-radius-10, 10px);background:transparent;color:var(--sd-black400);cursor:pointer}.sd-sidebar-v2__rail-action:hover,.sd-sidebar-v2__rail-action--active{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-v2__brand:focus-visible,.sd-sidebar-v2__rail-action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-sidebar-v2__rail-label{width:52px;font-size:var(--sd-font-size-10, 10px);line-height:12px;text-align:center}.sd-sidebar-v2__logo,.sd-sidebar-v2__rail-icon{width:24px;height:24px;object-fit:contain}.sd-sidebar-v2__backdrop{position:fixed;z-index:10;inset:0;border:0;background:transparent}.sd-sidebar-v2__flyout{position:fixed;z-index:var(--sd-z-sidebar, 20);inset:0 auto 0 72px;width:320px}.sd-sidebar-v2__content{min-height:100vh;margin-left:72px}@media(prefers-reduced-motion:reduce){.sd-sidebar-v2__flyout{transition:none}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdLayoutSearchFieldComponent, selector: "sd-layout-search-field", inputs: ["model", "placeholder", "autoId", "appearance"], outputs: ["sdChange"] }, { kind: "component", type: SdLayoutMenuTreeComponent, selector: "sd-layout-menu-tree", inputs: ["menus", "query", "activePath", "pinnedKeys", "showPin", "pinVisibility", "presentation", "collapsible", "collapsedGroupKeys"], outputs: ["collapsedGroupKeysChange", "navigate", "togglePinned"] }, { kind: "component", type: SdLayoutUserMenuComponent, selector: "sd-layout-user-menu", inputs: ["userInfo", "signout", "changePassword", "updateProfile", "setting", "notification", "compact", "presentation"], outputs: ["opened", "closed"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3152
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdSidebarV2, isStandalone: true, selector: "sd-sidebar-v2", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "keydown.escape": "closeFromEscape()" } }, ngImport: i0, template: "<!-- why: `(keydown.escape)` \u0111\u01B0\u1EE3c gom l\u00EAn HOST c\u1EE7a component (xem `host` trong main.component.ts).\n Tr\u01B0\u1EDBc \u0111\u00E2y n\u00F3 n\u1EB1m tr\u00EAn div b\u1ECDc v\u00E0 tr\u00EAn <section> flyout \u2014 c\u1EA3 hai \u0111\u1EC1u KH\u00D4NG focusable n\u00EAn ch\u1EC9\n \"ch\u1EA1y nh\u1EDD\" event n\u1ED5i b\u1ECDt t\u1EEB con, \u0111\u1ED3ng th\u1EDDi khi\u1EBFn markup khai b\u00E1o interaction handler tr\u00EAn\n ph\u1EA7n t\u1EED kh\u00F4ng nh\u1EADn \u0111\u01B0\u1EE3c focus. Host l\u00E0 t\u1ED5 ti\u00EAn c\u1EE7a t\u1EA5t c\u1EA3 n\u00EAn h\u00E0nh vi gi\u1EEF nguy\u00EAn. -->\n<div class=\"sd-sidebar-v2\">\n <aside #railElement class=\"sd-sidebar-v2__rail d-flex flex-column align-items-center gap-8 py-12 bg-white border-right border-black200\">\n <button type=\"button\" class=\"sd-sidebar-v2__brand d-flex align-items-center justify-content-center\" [attr.aria-label]=\"'core.module.layout.home.tab-name' | sdTranslate\">\n @if (sidebar().logoUrl) {\n <img class=\"sd-sidebar-v2__logo\" [src]=\"sidebar().logoUrl\" alt=\"\" />\n } @else {\n <sd-icon name=\"apps\"></sd-icon>\n }\n </button>\n\n <!-- Context switcher (D-010): avatar context ngay d\u01B0\u1EDBi n\u00FAt brand; popover m\u1EDF sang ph\u1EA3i t\u1EEB m\u00E9p rail.\n N\u1EB1m ngo\u00E0i <nav> nh\u00F3m n\u00EAn kh\u00F4ng c\u00F3 mouseenter/focus preview flyout. -->\n @if (sidebar().context; as context) {\n <sd-layout-context-switcher class=\"sd-sidebar-v2__rail-context\" appearance=\"rail\" [configuration]=\"context\" [anchor]=\"railElement\" />\n }\n\n <nav class=\"d-flex flex-column align-items-center gap-4 flex-1\" [attr.aria-label]=\"'core.module.layout.sidebar.menu-groups' | sdTranslate\">\n @for (item of railItems(); track item.key) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v2__rail-action d-flex flex-column align-items-center justify-content-center gap-4\"\n [attr.data-v2-group-key]=\"item.key\"\n [attr.aria-label]=\"item.title\"\n [attr.aria-expanded]=\"activeGroupKey() === item.key && isFlyoutOpen()\"\n [class.sd-sidebar-v2__rail-action--active]=\"activeGroupKey() === item.key\"\n (click)=\"selectGroup(item.menu)\"\n (mouseenter)=\"previewGroup(item.menu)\"\n (focus)=\"previewGroup(item.menu)\">\n @if (item.menu.iconUrl) {\n <img class=\"sd-sidebar-v2__rail-icon\" [src]=\"item.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"item.menu.icon || 'widgets'\"></sd-icon>\n }\n <span class=\"sd-sidebar-v2__rail-label text-ellipsis\">{{ item.title }}</span>\n </button>\n }\n </nav>\n\n <sd-layout-user-menu [userInfo]=\"userInfo()\" [compact]=\"true\"></sd-layout-user-menu>\n </aside>\n\n @if (isFlyoutOpen()) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v2__backdrop\"\n [attr.aria-label]=\"'core.module.layout.sidebar.close-menu' | sdTranslate\"\n (click)=\"closeFromBackdrop()\"\n (keydown.escape)=\"closeFromEscape()\"></button>\n <section\n class=\"sd-sidebar-v2__flyout d-flex flex-column bg-white border-right border-black200 mat-elevation-z4\"\n role=\"region\"\n [attr.aria-label]=\"activeGroup()?.title || 'Menu'\"\n (mouseleave)=\"leaveFlyout()\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n <span class=\"T16M text-ellipsis\">{{ activeGroup()?.title || sidebar().defaultTitle || 'Menu' }}</span>\n @if (isFlyoutLocked()) {\n <sd-icon name=\"lock\"></sd-icon>\n }\n </header>\n <div class=\"p-12\">\n <sd-layout-search-field\n [placeholder]=\"'core.module.layout.sidebar.search-in-group' | sdTranslate\"\n [autoId]=\"'layout-v2-context-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n <div class=\"flex-1 overflow-auto px-8 pb-12\">\n <sd-layout-menu-tree\n [menus]=\"contextMenus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"onNavigate($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </div>\n </section>\n }\n\n <main class=\"sd-sidebar-v2__content\" data-v2-content data-content-offset=\"rail\">\n <ng-content></ng-content>\n </main>\n</div>\n", styles: [".sd-sidebar-v2{min-height:100vh;background:var(--sd-light)}.sd-sidebar-v2__rail{position:fixed;z-index:var(--sd-z-header, 30);inset:0 auto 0 0;width:72px}.sd-sidebar-v2__brand,.sd-sidebar-v2__rail-action{width:56px;min-height:52px;border:0;border-radius:var(--sd-radius-10, 10px);background:transparent;color:var(--sd-black400);cursor:pointer}.sd-sidebar-v2__rail-action:hover,.sd-sidebar-v2__rail-action--active{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-v2__brand:focus-visible,.sd-sidebar-v2__rail-action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-sidebar-v2__rail-context:empty{display:none}.sd-sidebar-v2__rail-label{width:52px;font-size:var(--sd-font-size-10, 10px);line-height:12px;text-align:center}.sd-sidebar-v2__logo,.sd-sidebar-v2__rail-icon{width:24px;height:24px;object-fit:contain}.sd-sidebar-v2__backdrop{position:fixed;z-index:10;inset:0;border:0;background:transparent}.sd-sidebar-v2__flyout{position:fixed;z-index:var(--sd-z-sidebar, 20);inset:0 auto 0 72px;width:320px}.sd-sidebar-v2__content{min-height:100vh;margin-left:72px}@media(prefers-reduced-motion:reduce){.sd-sidebar-v2__flyout{transition:none}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdLayoutSearchFieldComponent, selector: "sd-layout-search-field", inputs: ["model", "placeholder", "autoId", "appearance"], outputs: ["sdChange"] }, { kind: "component", type: SdLayoutMenuTreeComponent, selector: "sd-layout-menu-tree", inputs: ["menus", "query", "activePath", "pinnedKeys", "showPin", "pinVisibility", "presentation", "collapsible", "collapsedGroupKeys"], outputs: ["collapsedGroupKeysChange", "navigate", "togglePinned"] }, { kind: "component", type: SdLayoutUserMenuComponent, selector: "sd-layout-user-menu", inputs: ["userInfo", "signout", "changePassword", "updateProfile", "setting", "notification", "compact", "presentation"], outputs: ["opened", "closed"] }, { kind: "component", type: SdLayoutContextSwitcher, selector: "sd-layout-context-switcher", inputs: ["configuration", "appearance", "placement", "anchor"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2183
3153
  }
2184
3154
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdSidebarV2, decorators: [{
2185
3155
  type: Component,
2186
- args: [{ selector: 'sd-sidebar-v2', standalone: true, imports: [SdIcon, SdLayoutSearchFieldComponent, SdLayoutMenuTreeComponent, SdLayoutUserMenuComponent, SdTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, host: {
3156
+ args: [{ selector: 'sd-sidebar-v2', standalone: true, imports: [
3157
+ SdIcon,
3158
+ SdLayoutSearchFieldComponent,
3159
+ SdLayoutMenuTreeComponent,
3160
+ SdLayoutUserMenuComponent,
3161
+ SdLayoutContextSwitcher,
3162
+ SdTranslatePipe,
3163
+ ], changeDetection: ChangeDetectionStrategy.OnPush, host: {
2187
3164
  '(keydown.escape)': 'closeFromEscape()',
2188
- }, template: "<!-- why: `(keydown.escape)` \u0111\u01B0\u1EE3c gom l\u00EAn HOST c\u1EE7a component (xem `host` trong main.component.ts).\n Tr\u01B0\u1EDBc \u0111\u00E2y n\u00F3 n\u1EB1m tr\u00EAn div b\u1ECDc v\u00E0 tr\u00EAn <section> flyout \u2014 c\u1EA3 hai \u0111\u1EC1u KH\u00D4NG focusable n\u00EAn ch\u1EC9\n \"ch\u1EA1y nh\u1EDD\" event n\u1ED5i b\u1ECDt t\u1EEB con, \u0111\u1ED3ng th\u1EDDi khi\u1EBFn markup khai b\u00E1o interaction handler tr\u00EAn\n ph\u1EA7n t\u1EED kh\u00F4ng nh\u1EADn \u0111\u01B0\u1EE3c focus. Host l\u00E0 t\u1ED5 ti\u00EAn c\u1EE7a t\u1EA5t c\u1EA3 n\u00EAn h\u00E0nh vi gi\u1EEF nguy\u00EAn. -->\n<div class=\"sd-sidebar-v2\">\n <aside class=\"sd-sidebar-v2__rail d-flex flex-column align-items-center gap-8 py-12 bg-white border-right border-black200\">\n <button type=\"button\" class=\"sd-sidebar-v2__brand d-flex align-items-center justify-content-center\" [attr.aria-label]=\"'core.module.layout.home.tab-name' | sdTranslate\">\n @if (sidebar().logoUrl) {\n <img class=\"sd-sidebar-v2__logo\" [src]=\"sidebar().logoUrl\" alt=\"\" />\n } @else {\n <sd-icon name=\"apps\"></sd-icon>\n }\n </button>\n\n <nav class=\"d-flex flex-column align-items-center gap-4 flex-1\" [attr.aria-label]=\"'core.module.layout.sidebar.menu-groups' | sdTranslate\">\n @for (item of railItems(); track item.key) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v2__rail-action d-flex flex-column align-items-center justify-content-center gap-4\"\n [attr.data-v2-group-key]=\"item.key\"\n [attr.aria-label]=\"item.title\"\n [attr.aria-expanded]=\"activeGroupKey() === item.key && isFlyoutOpen()\"\n [class.sd-sidebar-v2__rail-action--active]=\"activeGroupKey() === item.key\"\n (click)=\"selectGroup(item.menu)\"\n (mouseenter)=\"previewGroup(item.menu)\"\n (focus)=\"previewGroup(item.menu)\">\n @if (item.menu.iconUrl) {\n <img class=\"sd-sidebar-v2__rail-icon\" [src]=\"item.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"item.menu.icon || 'widgets'\"></sd-icon>\n }\n <span class=\"sd-sidebar-v2__rail-label text-ellipsis\">{{ item.title }}</span>\n </button>\n }\n </nav>\n\n <sd-layout-user-menu [userInfo]=\"userInfo()\" [compact]=\"true\"></sd-layout-user-menu>\n </aside>\n\n @if (isFlyoutOpen()) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v2__backdrop\"\n [attr.aria-label]=\"'core.module.layout.sidebar.close-menu' | sdTranslate\"\n (click)=\"closeFromBackdrop()\"\n (keydown.escape)=\"closeFromEscape()\"></button>\n <section\n class=\"sd-sidebar-v2__flyout d-flex flex-column bg-white border-right border-black200 mat-elevation-z4\"\n role=\"region\"\n [attr.aria-label]=\"activeGroup()?.title || 'Menu'\"\n (mouseleave)=\"leaveFlyout()\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n <span class=\"T16M text-ellipsis\">{{ activeGroup()?.title || sidebar().defaultTitle || 'Menu' }}</span>\n @if (isFlyoutLocked()) {\n <sd-icon name=\"lock\"></sd-icon>\n }\n </header>\n <div class=\"p-12\">\n <sd-layout-search-field\n [placeholder]=\"'core.module.layout.sidebar.search-in-group' | sdTranslate\"\n [autoId]=\"'layout-v2-context-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n <div class=\"flex-1 overflow-auto px-8 pb-12\">\n <sd-layout-menu-tree\n [menus]=\"contextMenus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"onNavigate($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </div>\n </section>\n }\n\n <main class=\"sd-sidebar-v2__content\" data-v2-content data-content-offset=\"rail\">\n <ng-content></ng-content>\n </main>\n</div>\n", styles: [".sd-sidebar-v2{min-height:100vh;background:var(--sd-light)}.sd-sidebar-v2__rail{position:fixed;z-index:var(--sd-z-header, 30);inset:0 auto 0 0;width:72px}.sd-sidebar-v2__brand,.sd-sidebar-v2__rail-action{width:56px;min-height:52px;border:0;border-radius:var(--sd-radius-10, 10px);background:transparent;color:var(--sd-black400);cursor:pointer}.sd-sidebar-v2__rail-action:hover,.sd-sidebar-v2__rail-action--active{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-v2__brand:focus-visible,.sd-sidebar-v2__rail-action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-sidebar-v2__rail-label{width:52px;font-size:var(--sd-font-size-10, 10px);line-height:12px;text-align:center}.sd-sidebar-v2__logo,.sd-sidebar-v2__rail-icon{width:24px;height:24px;object-fit:contain}.sd-sidebar-v2__backdrop{position:fixed;z-index:10;inset:0;border:0;background:transparent}.sd-sidebar-v2__flyout{position:fixed;z-index:var(--sd-z-sidebar, 20);inset:0 auto 0 72px;width:320px}.sd-sidebar-v2__content{min-height:100vh;margin-left:72px}@media(prefers-reduced-motion:reduce){.sd-sidebar-v2__flyout{transition:none}}\n"] }]
3165
+ }, template: "<!-- why: `(keydown.escape)` \u0111\u01B0\u1EE3c gom l\u00EAn HOST c\u1EE7a component (xem `host` trong main.component.ts).\n Tr\u01B0\u1EDBc \u0111\u00E2y n\u00F3 n\u1EB1m tr\u00EAn div b\u1ECDc v\u00E0 tr\u00EAn <section> flyout \u2014 c\u1EA3 hai \u0111\u1EC1u KH\u00D4NG focusable n\u00EAn ch\u1EC9\n \"ch\u1EA1y nh\u1EDD\" event n\u1ED5i b\u1ECDt t\u1EEB con, \u0111\u1ED3ng th\u1EDDi khi\u1EBFn markup khai b\u00E1o interaction handler tr\u00EAn\n ph\u1EA7n t\u1EED kh\u00F4ng nh\u1EADn \u0111\u01B0\u1EE3c focus. Host l\u00E0 t\u1ED5 ti\u00EAn c\u1EE7a t\u1EA5t c\u1EA3 n\u00EAn h\u00E0nh vi gi\u1EEF nguy\u00EAn. -->\n<div class=\"sd-sidebar-v2\">\n <aside #railElement class=\"sd-sidebar-v2__rail d-flex flex-column align-items-center gap-8 py-12 bg-white border-right border-black200\">\n <button type=\"button\" class=\"sd-sidebar-v2__brand d-flex align-items-center justify-content-center\" [attr.aria-label]=\"'core.module.layout.home.tab-name' | sdTranslate\">\n @if (sidebar().logoUrl) {\n <img class=\"sd-sidebar-v2__logo\" [src]=\"sidebar().logoUrl\" alt=\"\" />\n } @else {\n <sd-icon name=\"apps\"></sd-icon>\n }\n </button>\n\n <!-- Context switcher (D-010): avatar context ngay d\u01B0\u1EDBi n\u00FAt brand; popover m\u1EDF sang ph\u1EA3i t\u1EEB m\u00E9p rail.\n N\u1EB1m ngo\u00E0i <nav> nh\u00F3m n\u00EAn kh\u00F4ng c\u00F3 mouseenter/focus preview flyout. -->\n @if (sidebar().context; as context) {\n <sd-layout-context-switcher class=\"sd-sidebar-v2__rail-context\" appearance=\"rail\" [configuration]=\"context\" [anchor]=\"railElement\" />\n }\n\n <nav class=\"d-flex flex-column align-items-center gap-4 flex-1\" [attr.aria-label]=\"'core.module.layout.sidebar.menu-groups' | sdTranslate\">\n @for (item of railItems(); track item.key) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v2__rail-action d-flex flex-column align-items-center justify-content-center gap-4\"\n [attr.data-v2-group-key]=\"item.key\"\n [attr.aria-label]=\"item.title\"\n [attr.aria-expanded]=\"activeGroupKey() === item.key && isFlyoutOpen()\"\n [class.sd-sidebar-v2__rail-action--active]=\"activeGroupKey() === item.key\"\n (click)=\"selectGroup(item.menu)\"\n (mouseenter)=\"previewGroup(item.menu)\"\n (focus)=\"previewGroup(item.menu)\">\n @if (item.menu.iconUrl) {\n <img class=\"sd-sidebar-v2__rail-icon\" [src]=\"item.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"item.menu.icon || 'widgets'\"></sd-icon>\n }\n <span class=\"sd-sidebar-v2__rail-label text-ellipsis\">{{ item.title }}</span>\n </button>\n }\n </nav>\n\n <sd-layout-user-menu [userInfo]=\"userInfo()\" [compact]=\"true\"></sd-layout-user-menu>\n </aside>\n\n @if (isFlyoutOpen()) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v2__backdrop\"\n [attr.aria-label]=\"'core.module.layout.sidebar.close-menu' | sdTranslate\"\n (click)=\"closeFromBackdrop()\"\n (keydown.escape)=\"closeFromEscape()\"></button>\n <section\n class=\"sd-sidebar-v2__flyout d-flex flex-column bg-white border-right border-black200 mat-elevation-z4\"\n role=\"region\"\n [attr.aria-label]=\"activeGroup()?.title || 'Menu'\"\n (mouseleave)=\"leaveFlyout()\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n <span class=\"T16M text-ellipsis\">{{ activeGroup()?.title || sidebar().defaultTitle || 'Menu' }}</span>\n @if (isFlyoutLocked()) {\n <sd-icon name=\"lock\"></sd-icon>\n }\n </header>\n <div class=\"p-12\">\n <sd-layout-search-field\n [placeholder]=\"'core.module.layout.sidebar.search-in-group' | sdTranslate\"\n [autoId]=\"'layout-v2-context-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n <div class=\"flex-1 overflow-auto px-8 pb-12\">\n <sd-layout-menu-tree\n [menus]=\"contextMenus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"onNavigate($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </div>\n </section>\n }\n\n <main class=\"sd-sidebar-v2__content\" data-v2-content data-content-offset=\"rail\">\n <ng-content></ng-content>\n </main>\n</div>\n", styles: [".sd-sidebar-v2{min-height:100vh;background:var(--sd-light)}.sd-sidebar-v2__rail{position:fixed;z-index:var(--sd-z-header, 30);inset:0 auto 0 0;width:72px}.sd-sidebar-v2__brand,.sd-sidebar-v2__rail-action{width:56px;min-height:52px;border:0;border-radius:var(--sd-radius-10, 10px);background:transparent;color:var(--sd-black400);cursor:pointer}.sd-sidebar-v2__rail-action:hover,.sd-sidebar-v2__rail-action--active{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-v2__brand:focus-visible,.sd-sidebar-v2__rail-action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-sidebar-v2__rail-context:empty{display:none}.sd-sidebar-v2__rail-label{width:52px;font-size:var(--sd-font-size-10, 10px);line-height:12px;text-align:center}.sd-sidebar-v2__logo,.sd-sidebar-v2__rail-icon{width:24px;height:24px;object-fit:contain}.sd-sidebar-v2__backdrop{position:fixed;z-index:10;inset:0;border:0;background:transparent}.sd-sidebar-v2__flyout{position:fixed;z-index:var(--sd-z-sidebar, 20);inset:0 auto 0 72px;width:320px}.sd-sidebar-v2__content{min-height:100vh;margin-left:72px}@media(prefers-reduced-motion:reduce){.sd-sidebar-v2__flyout{transition:none}}\n"] }]
2189
3166
  }], ctorParameters: () => [], propDecorators: { menus: [{ type: i0.Input, args: [{ isSignal: true, alias: "menus", required: false }] }], userInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "userInfo", required: true }] }], sidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebar", required: true }] }] } });
2190
3167
 
2191
3168
  class SdSidebarMobileV2 {
@@ -2193,6 +3170,7 @@ class SdSidebarMobileV2 {
2193
3170
  #i18n = inject(I18nService);
2194
3171
  #document = inject(DOCUMENT);
2195
3172
  #destroyRef = inject(DestroyRef);
3173
+ #injector = inject(Injector);
2196
3174
  #navigationState = inject(SdLayoutNavigationStateService);
2197
3175
  #restoreFocusElement = null;
2198
3176
  #previousBodyOverflow = '';
@@ -2216,6 +3194,16 @@ class SdSidebarMobileV2 {
2216
3194
  const menus = this.menus();
2217
3195
  untracked(() => this.#navigationState.hydrate(menus));
2218
3196
  });
3197
+ // why: switcher chỉ mount trong sheet menu (render khi mở) — đối chiếu context ngay lúc khởi tạo (EXEC-D1, D-021)
3198
+ // để listener nhiều tab chạy từ đầu và lần chạm đầu vào menu không kích reload đối chiếu. Không có `context` thì
3199
+ // không lấy service: app không cấu hình context không tạo service lẫn listener.
3200
+ effect(() => {
3201
+ const context = this.sidebar().context;
3202
+ if (!context)
3203
+ return;
3204
+ const items = context.items;
3205
+ untracked(() => this.#injector.get(SdLayoutContextService).syncItems(items));
3206
+ });
2219
3207
  this.#router.events.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(event => {
2220
3208
  if (!(event instanceof NavigationEnd))
2221
3209
  return;
@@ -2290,17 +3278,26 @@ class SdSidebarMobileV2 {
2290
3278
  this.#document.body.style.overflow = this.#previousBodyOverflow;
2291
3279
  }
2292
3280
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdSidebarMobileV2, deps: [], target: i0.ɵɵFactoryTarget.Component });
2293
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdSidebarMobileV2, isStandalone: true, selector: "sd-sidebar-mobile-v2", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"sd-sidebar-mobile-v2 d-flex flex-column\">\n <main class=\"sd-sidebar-mobile-v2__content flex-1 overflow-auto\">\n <ng-content></ng-content>\n </main>\n\n <nav class=\"sd-sidebar-mobile-v2__bar d-flex align-items-stretch bg-white border-top border-black200\" [attr.aria-label]=\"'core.module.layout.sidebar.primary-nav' | sdTranslate\">\n @for (menu of primaryMenus(); track menu.id || menu.title) {\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__bar-action d-flex flex-column align-items-center justify-content-center gap-4 flex-1\"\n [attr.data-mobile-menu-key]=\"menu.id ? 'id:' + menu.id : null\"\n [attr.aria-label]=\"menu.tooltipTitle || menu.title || 'Menu'\"\n [attr.aria-expanded]=\"sheetGroupKey() === (menu.id ? 'id:' + menu.id : '') && isSheetOpen()\"\n (click)=\"activateMenu(menu, $event.currentTarget)\">\n @if (menu.iconUrl) {\n <img class=\"sd-sidebar-mobile-v2__icon\" [src]=\"menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"menu.icon || 'widgets'\"></sd-icon>\n }\n <span class=\"sd-sidebar-mobile-v2__label text-ellipsis\">{{ menu.tooltipTitle || menu.title }}</span>\n </button>\n }\n @if (overflowMenus().length) {\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__bar-action d-flex flex-column align-items-center justify-content-center gap-4 flex-1\"\n [attr.aria-label]=\"'core.module.layout.sidebar.more-menu' | sdTranslate\"\n [attr.aria-expanded]=\"sheetGroupKey() === 'more' && isSheetOpen()\"\n (click)=\"openMore($event.currentTarget)\">\n <sd-icon name=\"more_horiz\"></sd-icon>\n <span class=\"sd-sidebar-mobile-v2__label\">{{ 'core.module.layout.sidebar.more' | sdTranslate }}</span>\n </button>\n }\n </nav>\n\n @if (isSheetOpen()) {\n <button type=\"button\" class=\"sd-sidebar-mobile-v2__backdrop\" [attr.aria-label]=\"'core.module.layout.sidebar.close-menu' | sdTranslate\" (click)=\"closeSheet()\"></button>\n <section\n data-v2-sheet\n class=\"sd-sidebar-mobile-v2__sheet d-flex flex-column bg-white rounded-top-16 mat-elevation-z8\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"sheetTitle()\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onSheetKeydown($event)\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n <span class=\"T16M text-ellipsis\">{{ sheetTitle() }}</span>\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__close d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"'core.common.close' | sdTranslate\"\n (click)=\"closeSheet()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n </header>\n <div class=\"d-flex flex-column gap-12 p-12 overflow-auto\">\n <sd-layout-user-menu presentation=\"mobile-inline\" [userInfo]=\"userInfo()\"></sd-layout-user-menu>\n <sd-layout-search-field\n [placeholder]=\"'core.module.layout.sidebar.search-in-menu' | sdTranslate\"\n [autoId]=\"'layout-v2-mobile-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n <sd-layout-menu-tree\n [menus]=\"sheetMenus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"onNavigate($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </div>\n </section>\n }\n</div>\n", styles: [":host{display:block}.sd-sidebar-mobile-v2{min-height:100dvh;padding-bottom:calc(64px + env(safe-area-inset-bottom));background:var(--sd-light)}.sd-sidebar-mobile-v2__bar{position:fixed;z-index:var(--sd-z-header, 30);inset:auto 0 0;min-height:64px;padding-bottom:env(safe-area-inset-bottom)}.sd-sidebar-mobile-v2__bar-action,.sd-sidebar-mobile-v2__close{min-width:0;min-height:48px;border:0;background:transparent;color:var(--sd-black400);cursor:pointer}.sd-sidebar-mobile-v2__bar-action:hover,.sd-sidebar-mobile-v2__close:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-mobile-v2__bar-action:focus-visible,.sd-sidebar-mobile-v2__close:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:-2px}.sd-sidebar-mobile-v2__label{max-width:72px;font-size:var(--sd-font-size-11, 11px);line-height:14px}.sd-sidebar-mobile-v2__icon{width:22px;height:22px;object-fit:contain}.sd-sidebar-mobile-v2__backdrop{position:fixed;z-index:var(--sd-z-popover, 40);inset:0;border:0;background:color-mix(in srgb,var(--sd-black) 40%,transparent)}.sd-sidebar-mobile-v2__sheet{position:fixed;z-index:var(--sd-z-drawer-mobile, 50);inset:auto 0 0;max-height:min(78dvh,720px);padding-bottom:env(safe-area-inset-bottom);overflow:hidden}@media(prefers-reduced-motion:reduce){.sd-sidebar-mobile-v2__sheet{transition:none}}\n"], dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1$2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdLayoutSearchFieldComponent, selector: "sd-layout-search-field", inputs: ["model", "placeholder", "autoId", "appearance"], outputs: ["sdChange"] }, { kind: "component", type: SdLayoutMenuTreeComponent, selector: "sd-layout-menu-tree", inputs: ["menus", "query", "activePath", "pinnedKeys", "showPin", "pinVisibility", "presentation", "collapsible", "collapsedGroupKeys"], outputs: ["collapsedGroupKeysChange", "navigate", "togglePinned"] }, { kind: "component", type: SdLayoutUserMenuComponent, selector: "sd-layout-user-menu", inputs: ["userInfo", "signout", "changePassword", "updateProfile", "setting", "notification", "compact", "presentation"], outputs: ["opened", "closed"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3281
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdSidebarMobileV2, isStandalone: true, selector: "sd-sidebar-mobile-v2", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div class=\"sd-sidebar-mobile-v2 d-flex flex-column\">\n <main class=\"sd-sidebar-mobile-v2__content flex-1 overflow-auto\">\n <ng-content></ng-content>\n </main>\n\n <nav class=\"sd-sidebar-mobile-v2__bar d-flex align-items-stretch bg-white border-top border-black200\" [attr.aria-label]=\"'core.module.layout.sidebar.primary-nav' | sdTranslate\">\n @for (menu of primaryMenus(); track menu.id || menu.title) {\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__bar-action d-flex flex-column align-items-center justify-content-center gap-4 flex-1\"\n [attr.data-mobile-menu-key]=\"menu.id ? 'id:' + menu.id : null\"\n [attr.aria-label]=\"menu.tooltipTitle || menu.title || 'Menu'\"\n [attr.aria-expanded]=\"sheetGroupKey() === (menu.id ? 'id:' + menu.id : '') && isSheetOpen()\"\n (click)=\"activateMenu(menu, $event.currentTarget)\">\n @if (menu.iconUrl) {\n <img class=\"sd-sidebar-mobile-v2__icon\" [src]=\"menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"menu.icon || 'widgets'\"></sd-icon>\n }\n <span class=\"sd-sidebar-mobile-v2__label text-ellipsis\">{{ menu.tooltipTitle || menu.title }}</span>\n </button>\n }\n @if (overflowMenus().length) {\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__bar-action d-flex flex-column align-items-center justify-content-center gap-4 flex-1\"\n [attr.aria-label]=\"'core.module.layout.sidebar.more-menu' | sdTranslate\"\n [attr.aria-expanded]=\"sheetGroupKey() === 'more' && isSheetOpen()\"\n (click)=\"openMore($event.currentTarget)\">\n <sd-icon name=\"more_horiz\"></sd-icon>\n <span class=\"sd-sidebar-mobile-v2__label\">{{ 'core.module.layout.sidebar.more' | sdTranslate }}</span>\n </button>\n }\n </nav>\n\n @if (isSheetOpen()) {\n <button type=\"button\" class=\"sd-sidebar-mobile-v2__backdrop\" [attr.aria-label]=\"'core.module.layout.sidebar.close-menu' | sdTranslate\" (click)=\"closeSheet()\"></button>\n <section\n data-v2-sheet\n class=\"sd-sidebar-mobile-v2__sheet d-flex flex-column bg-white rounded-top-16 mat-elevation-z8\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"sheetTitle()\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onSheetKeydown($event)\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n <span class=\"T16M text-ellipsis\">{{ sheetTitle() }}</span>\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__close d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"'core.common.close' | sdTranslate\"\n (click)=\"closeSheet()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n </header>\n <div class=\"d-flex flex-column gap-12 p-12 overflow-auto\">\n <!-- Context switcher (D-027): mobile V2 kh\u00F4ng c\u00F3 drawer n\u00EAn trigger l\u00E0 d\u00F2ng \u0111\u1EA7u c\u1EE7a sheet menu; sheet ch\u1ECDn\n context m\u1EDF trong overlay CDK, ch\u1ED3ng l\u00EAn sheet n\u00E0y v\u00E0 t\u1EF1 gi\u1EEF Esc (kh\u00F4ng \u0111\u00F3ng sheet menu). -->\n @if (sidebar().context; as context) {\n <sd-layout-context-switcher class=\"sd-sidebar-mobile-v2__context\" appearance=\"sheet\" [configuration]=\"context\" />\n }\n <sd-layout-user-menu presentation=\"mobile-inline\" [userInfo]=\"userInfo()\"></sd-layout-user-menu>\n <sd-layout-search-field\n [placeholder]=\"'core.module.layout.sidebar.search-in-menu' | sdTranslate\"\n [autoId]=\"'layout-v2-mobile-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n <sd-layout-menu-tree\n [menus]=\"sheetMenus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"onNavigate($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </div>\n </section>\n }\n</div>\n", styles: [":host{display:block}.sd-sidebar-mobile-v2{min-height:100dvh;padding-bottom:calc(64px + env(safe-area-inset-bottom));background:var(--sd-light)}.sd-sidebar-mobile-v2__bar{position:fixed;z-index:var(--sd-z-header, 30);inset:auto 0 0;min-height:64px;padding-bottom:env(safe-area-inset-bottom)}.sd-sidebar-mobile-v2__bar-action,.sd-sidebar-mobile-v2__close{min-width:0;min-height:48px;border:0;background:transparent;color:var(--sd-black400);cursor:pointer}.sd-sidebar-mobile-v2__bar-action:hover,.sd-sidebar-mobile-v2__close:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-mobile-v2__bar-action:focus-visible,.sd-sidebar-mobile-v2__close:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:-2px}.sd-sidebar-mobile-v2__label{max-width:72px;font-size:var(--sd-font-size-11, 11px);line-height:14px}.sd-sidebar-mobile-v2__icon{width:22px;height:22px;object-fit:contain}.sd-sidebar-mobile-v2__backdrop{position:fixed;z-index:var(--sd-z-popover, 40);inset:0;border:0;background:color-mix(in srgb,var(--sd-black) 40%,transparent)}.sd-sidebar-mobile-v2__sheet{position:fixed;z-index:var(--sd-z-drawer-mobile, 50);inset:auto 0 0;max-height:min(78dvh,720px);padding-bottom:env(safe-area-inset-bottom);overflow:hidden}.sd-sidebar-mobile-v2__context:empty{display:none}@media(prefers-reduced-motion:reduce){.sd-sidebar-mobile-v2__sheet{transition:none}}\n"], dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1$2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdLayoutSearchFieldComponent, selector: "sd-layout-search-field", inputs: ["model", "placeholder", "autoId", "appearance"], outputs: ["sdChange"] }, { kind: "component", type: SdLayoutMenuTreeComponent, selector: "sd-layout-menu-tree", inputs: ["menus", "query", "activePath", "pinnedKeys", "showPin", "pinVisibility", "presentation", "collapsible", "collapsedGroupKeys"], outputs: ["collapsedGroupKeysChange", "navigate", "togglePinned"] }, { kind: "component", type: SdLayoutUserMenuComponent, selector: "sd-layout-user-menu", inputs: ["userInfo", "signout", "changePassword", "updateProfile", "setting", "notification", "compact", "presentation"], outputs: ["opened", "closed"] }, { kind: "component", type: SdLayoutContextSwitcher, selector: "sd-layout-context-switcher", inputs: ["configuration", "appearance", "placement", "anchor"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2294
3282
  }
2295
3283
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdSidebarMobileV2, decorators: [{
2296
3284
  type: Component,
2297
- args: [{ selector: 'sd-sidebar-mobile-v2', standalone: true, imports: [A11yModule, SdIcon, SdLayoutSearchFieldComponent, SdLayoutMenuTreeComponent, SdLayoutUserMenuComponent, SdTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"sd-sidebar-mobile-v2 d-flex flex-column\">\n <main class=\"sd-sidebar-mobile-v2__content flex-1 overflow-auto\">\n <ng-content></ng-content>\n </main>\n\n <nav class=\"sd-sidebar-mobile-v2__bar d-flex align-items-stretch bg-white border-top border-black200\" [attr.aria-label]=\"'core.module.layout.sidebar.primary-nav' | sdTranslate\">\n @for (menu of primaryMenus(); track menu.id || menu.title) {\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__bar-action d-flex flex-column align-items-center justify-content-center gap-4 flex-1\"\n [attr.data-mobile-menu-key]=\"menu.id ? 'id:' + menu.id : null\"\n [attr.aria-label]=\"menu.tooltipTitle || menu.title || 'Menu'\"\n [attr.aria-expanded]=\"sheetGroupKey() === (menu.id ? 'id:' + menu.id : '') && isSheetOpen()\"\n (click)=\"activateMenu(menu, $event.currentTarget)\">\n @if (menu.iconUrl) {\n <img class=\"sd-sidebar-mobile-v2__icon\" [src]=\"menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"menu.icon || 'widgets'\"></sd-icon>\n }\n <span class=\"sd-sidebar-mobile-v2__label text-ellipsis\">{{ menu.tooltipTitle || menu.title }}</span>\n </button>\n }\n @if (overflowMenus().length) {\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__bar-action d-flex flex-column align-items-center justify-content-center gap-4 flex-1\"\n [attr.aria-label]=\"'core.module.layout.sidebar.more-menu' | sdTranslate\"\n [attr.aria-expanded]=\"sheetGroupKey() === 'more' && isSheetOpen()\"\n (click)=\"openMore($event.currentTarget)\">\n <sd-icon name=\"more_horiz\"></sd-icon>\n <span class=\"sd-sidebar-mobile-v2__label\">{{ 'core.module.layout.sidebar.more' | sdTranslate }}</span>\n </button>\n }\n </nav>\n\n @if (isSheetOpen()) {\n <button type=\"button\" class=\"sd-sidebar-mobile-v2__backdrop\" [attr.aria-label]=\"'core.module.layout.sidebar.close-menu' | sdTranslate\" (click)=\"closeSheet()\"></button>\n <section\n data-v2-sheet\n class=\"sd-sidebar-mobile-v2__sheet d-flex flex-column bg-white rounded-top-16 mat-elevation-z8\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"sheetTitle()\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onSheetKeydown($event)\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n <span class=\"T16M text-ellipsis\">{{ sheetTitle() }}</span>\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__close d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"'core.common.close' | sdTranslate\"\n (click)=\"closeSheet()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n </header>\n <div class=\"d-flex flex-column gap-12 p-12 overflow-auto\">\n <sd-layout-user-menu presentation=\"mobile-inline\" [userInfo]=\"userInfo()\"></sd-layout-user-menu>\n <sd-layout-search-field\n [placeholder]=\"'core.module.layout.sidebar.search-in-menu' | sdTranslate\"\n [autoId]=\"'layout-v2-mobile-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n <sd-layout-menu-tree\n [menus]=\"sheetMenus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"onNavigate($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </div>\n </section>\n }\n</div>\n", styles: [":host{display:block}.sd-sidebar-mobile-v2{min-height:100dvh;padding-bottom:calc(64px + env(safe-area-inset-bottom));background:var(--sd-light)}.sd-sidebar-mobile-v2__bar{position:fixed;z-index:var(--sd-z-header, 30);inset:auto 0 0;min-height:64px;padding-bottom:env(safe-area-inset-bottom)}.sd-sidebar-mobile-v2__bar-action,.sd-sidebar-mobile-v2__close{min-width:0;min-height:48px;border:0;background:transparent;color:var(--sd-black400);cursor:pointer}.sd-sidebar-mobile-v2__bar-action:hover,.sd-sidebar-mobile-v2__close:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-mobile-v2__bar-action:focus-visible,.sd-sidebar-mobile-v2__close:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:-2px}.sd-sidebar-mobile-v2__label{max-width:72px;font-size:var(--sd-font-size-11, 11px);line-height:14px}.sd-sidebar-mobile-v2__icon{width:22px;height:22px;object-fit:contain}.sd-sidebar-mobile-v2__backdrop{position:fixed;z-index:var(--sd-z-popover, 40);inset:0;border:0;background:color-mix(in srgb,var(--sd-black) 40%,transparent)}.sd-sidebar-mobile-v2__sheet{position:fixed;z-index:var(--sd-z-drawer-mobile, 50);inset:auto 0 0;max-height:min(78dvh,720px);padding-bottom:env(safe-area-inset-bottom);overflow:hidden}@media(prefers-reduced-motion:reduce){.sd-sidebar-mobile-v2__sheet{transition:none}}\n"] }]
3285
+ args: [{ selector: 'sd-sidebar-mobile-v2', standalone: true, imports: [
3286
+ A11yModule,
3287
+ SdIcon,
3288
+ SdLayoutSearchFieldComponent,
3289
+ SdLayoutMenuTreeComponent,
3290
+ SdLayoutUserMenuComponent,
3291
+ SdLayoutContextSwitcher,
3292
+ SdTranslatePipe,
3293
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"sd-sidebar-mobile-v2 d-flex flex-column\">\n <main class=\"sd-sidebar-mobile-v2__content flex-1 overflow-auto\">\n <ng-content></ng-content>\n </main>\n\n <nav class=\"sd-sidebar-mobile-v2__bar d-flex align-items-stretch bg-white border-top border-black200\" [attr.aria-label]=\"'core.module.layout.sidebar.primary-nav' | sdTranslate\">\n @for (menu of primaryMenus(); track menu.id || menu.title) {\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__bar-action d-flex flex-column align-items-center justify-content-center gap-4 flex-1\"\n [attr.data-mobile-menu-key]=\"menu.id ? 'id:' + menu.id : null\"\n [attr.aria-label]=\"menu.tooltipTitle || menu.title || 'Menu'\"\n [attr.aria-expanded]=\"sheetGroupKey() === (menu.id ? 'id:' + menu.id : '') && isSheetOpen()\"\n (click)=\"activateMenu(menu, $event.currentTarget)\">\n @if (menu.iconUrl) {\n <img class=\"sd-sidebar-mobile-v2__icon\" [src]=\"menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"menu.icon || 'widgets'\"></sd-icon>\n }\n <span class=\"sd-sidebar-mobile-v2__label text-ellipsis\">{{ menu.tooltipTitle || menu.title }}</span>\n </button>\n }\n @if (overflowMenus().length) {\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__bar-action d-flex flex-column align-items-center justify-content-center gap-4 flex-1\"\n [attr.aria-label]=\"'core.module.layout.sidebar.more-menu' | sdTranslate\"\n [attr.aria-expanded]=\"sheetGroupKey() === 'more' && isSheetOpen()\"\n (click)=\"openMore($event.currentTarget)\">\n <sd-icon name=\"more_horiz\"></sd-icon>\n <span class=\"sd-sidebar-mobile-v2__label\">{{ 'core.module.layout.sidebar.more' | sdTranslate }}</span>\n </button>\n }\n </nav>\n\n @if (isSheetOpen()) {\n <button type=\"button\" class=\"sd-sidebar-mobile-v2__backdrop\" [attr.aria-label]=\"'core.module.layout.sidebar.close-menu' | sdTranslate\" (click)=\"closeSheet()\"></button>\n <section\n data-v2-sheet\n class=\"sd-sidebar-mobile-v2__sheet d-flex flex-column bg-white rounded-top-16 mat-elevation-z8\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-label]=\"sheetTitle()\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onSheetKeydown($event)\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n <span class=\"T16M text-ellipsis\">{{ sheetTitle() }}</span>\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v2__close d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"'core.common.close' | sdTranslate\"\n (click)=\"closeSheet()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n </header>\n <div class=\"d-flex flex-column gap-12 p-12 overflow-auto\">\n <!-- Context switcher (D-027): mobile V2 kh\u00F4ng c\u00F3 drawer n\u00EAn trigger l\u00E0 d\u00F2ng \u0111\u1EA7u c\u1EE7a sheet menu; sheet ch\u1ECDn\n context m\u1EDF trong overlay CDK, ch\u1ED3ng l\u00EAn sheet n\u00E0y v\u00E0 t\u1EF1 gi\u1EEF Esc (kh\u00F4ng \u0111\u00F3ng sheet menu). -->\n @if (sidebar().context; as context) {\n <sd-layout-context-switcher class=\"sd-sidebar-mobile-v2__context\" appearance=\"sheet\" [configuration]=\"context\" />\n }\n <sd-layout-user-menu presentation=\"mobile-inline\" [userInfo]=\"userInfo()\"></sd-layout-user-menu>\n <sd-layout-search-field\n [placeholder]=\"'core.module.layout.sidebar.search-in-menu' | sdTranslate\"\n [autoId]=\"'layout-v2-mobile-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n <sd-layout-menu-tree\n [menus]=\"sheetMenus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"onNavigate($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </div>\n </section>\n }\n</div>\n", styles: [":host{display:block}.sd-sidebar-mobile-v2{min-height:100dvh;padding-bottom:calc(64px + env(safe-area-inset-bottom));background:var(--sd-light)}.sd-sidebar-mobile-v2__bar{position:fixed;z-index:var(--sd-z-header, 30);inset:auto 0 0;min-height:64px;padding-bottom:env(safe-area-inset-bottom)}.sd-sidebar-mobile-v2__bar-action,.sd-sidebar-mobile-v2__close{min-width:0;min-height:48px;border:0;background:transparent;color:var(--sd-black400);cursor:pointer}.sd-sidebar-mobile-v2__bar-action:hover,.sd-sidebar-mobile-v2__close:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-mobile-v2__bar-action:focus-visible,.sd-sidebar-mobile-v2__close:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:-2px}.sd-sidebar-mobile-v2__label{max-width:72px;font-size:var(--sd-font-size-11, 11px);line-height:14px}.sd-sidebar-mobile-v2__icon{width:22px;height:22px;object-fit:contain}.sd-sidebar-mobile-v2__backdrop{position:fixed;z-index:var(--sd-z-popover, 40);inset:0;border:0;background:color-mix(in srgb,var(--sd-black) 40%,transparent)}.sd-sidebar-mobile-v2__sheet{position:fixed;z-index:var(--sd-z-drawer-mobile, 50);inset:auto 0 0;max-height:min(78dvh,720px);padding-bottom:env(safe-area-inset-bottom);overflow:hidden}.sd-sidebar-mobile-v2__context:empty{display:none}@media(prefers-reduced-motion:reduce){.sd-sidebar-mobile-v2__sheet{transition:none}}\n"] }]
2298
3294
  }], ctorParameters: () => [], propDecorators: { menus: [{ type: i0.Input, args: [{ isSignal: true, alias: "menus", required: false }] }], userInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "userInfo", required: true }] }], sidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebar", required: true }] }] } });
2299
3295
 
2300
3296
  class SdSidebarV3 {
2301
3297
  #router = inject(Router);
2302
3298
  #destroyRef = inject(DestroyRef);
2303
3299
  #navigationState = inject(SdLayoutNavigationStateService);
3300
+ headerSwitcher = viewChild('headerSwitcher', ...(ngDevMode ? [{ debugName: "headerSwitcher" }] : /* istanbul ignore next */ []));
2304
3301
  #initialized = false;
2305
3302
  menus = input([], ...(ngDevMode ? [{ debugName: "menus" }] : /* istanbul ignore next */ []));
2306
3303
  userInfo = input.required(...(ngDevMode ? [{ debugName: "userInfo" }] : /* istanbul ignore next */ []));
@@ -2315,6 +3312,8 @@ class SdSidebarV3 {
2315
3312
  pinnedMenus = this.#navigationState.pinnedMenus;
2316
3313
  recentMenus = this.#navigationState.recentMenus;
2317
3314
  collapsedItems = computed(() => this.menus().map(menu => ({ menu, key: getMenuStableKey(menu), title: menu.tooltipTitle || menu.title || 'Menu' })), ...(ngDevMode ? [{ debugName: "collapsedItems" }] : /* istanbul ignore next */ []));
3315
+ /** The header Context Switcher popover is open; the whole header then takes the hover background (README CS1). */
3316
+ contextOpen = computed(() => this.headerSwitcher()?.isOpen() ?? false, ...(ngDevMode ? [{ debugName: "contextOpen" }] : /* istanbul ignore next */ []));
2318
3317
  constructor() {
2319
3318
  effect(() => {
2320
3319
  const menus = this.menus();
@@ -2385,17 +3384,25 @@ class SdSidebarV3 {
2385
3384
  this.#navigationState.togglePinned(menu);
2386
3385
  }
2387
3386
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdSidebarV3, deps: [], target: i0.ɵɵFactoryTarget.Component });
2388
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdSidebarV3, isStandalone: true, selector: "sd-sidebar-v3", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@let collapsed = isCollapsed();\n@let configuration = sidebar();\n@let pinned = pinnedMenus();\n@let recent = recentMenus();\n<div class=\"sd-sidebar-v3\" [class.sd-sidebar-v3--collapsed]=\"collapsed\">\n <aside class=\"sd-sidebar-v3__drawer d-flex flex-column\" data-v3-sidebar [attr.data-collapsed]=\"collapsed\">\n <header\n data-v3-header\n class=\"sd-sidebar-v3__header d-flex align-items-center gap-8 p-12\"\n [class.sd-sidebar-v3__header--collapsed]=\"collapsed\"\n [class.justify-content-between]=\"!collapsed\"\n [class.justify-content-center]=\"collapsed\">\n @if (!collapsed) {\n <div data-v3-brand class=\"d-flex align-items-center gap-8 overflow-hidden\">\n @if (configuration.logoUrl) {\n <img class=\"sd-sidebar-v3__logo\" [src]=\"configuration.logoUrl\" alt=\"\" />\n } @else {\n <sd-icon name=\"apps\" fontSet=\"material-icons-outlined\" size=\"20px\"></sd-icon>\n }\n <span class=\"sd-sidebar-v3__title text-ellipsis\">{{ configuration.defaultTitle || 'Back Office' }}</span>\n </div>\n }\n <button\n type=\"button\"\n class=\"sd-sidebar-v3__icon-action d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"collapsed ? 'M\u1EDF r\u1ED9ng sidebar' : 'Thu g\u1ECDn sidebar'\"\n [attr.aria-expanded]=\"!collapsed\"\n (click)=\"toggleCollapsed()\">\n <sd-icon [name]=\"collapsed ? 'chevron_right' : 'chevron_left'\" size=\"20px\"></sd-icon>\n </button>\n </header>\n\n @if (collapsed) {\n <nav class=\"sd-sidebar-v3__navigation d-flex flex-column align-items-center gap-4 p-8 flex-1 overflow-auto\" aria-label=\"Menu thu g\u1ECDn\">\n @for (item of collapsedItems(); track item.key) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v3__collapsed-action d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"item.title\"\n [attr.title]=\"item.title\"\n (click)=\"activateCollapsedMenu(item.menu)\">\n @if (item.menu.iconUrl) {\n <img class=\"sd-sidebar-v3__logo\" [src]=\"item.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"item.menu.icon || 'widgets'\" fontSet=\"material-icons-outlined\" size=\"20px\"></sd-icon>\n }\n </button>\n }\n </nav>\n } @else {\n <div class=\"sd-sidebar-v3__search px-12 pb-12\">\n <sd-layout-search-field\n appearance=\"compact\"\n placeholder=\"T\u00ECm trong t\u1EA5t c\u1EA3 menu\"\n [autoId]=\"'layout-v3-global-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n <div class=\"sd-sidebar-v3__navigation d-flex flex-column gap-16 flex-1 overflow-auto px-8 pb-12\">\n @if (pinned.length) {\n <section data-v3-pinned class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.pinned' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"shortcuts\"\n [menus]=\"pinned\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n @if (recentConfiguration().enabled && recent.length) {\n <section data-v3-recent class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.recent' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"shortcuts\"\n [menus]=\"recent\"\n [activePath]=\"activePath()\"\n [showPin]=\"false\"\n (navigate)=\"navigateMenu($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n <section data-v3-all class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.all-menu' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"hierarchy\"\n [collapsible]=\"true\"\n [(collapsedGroupKeys)]=\"collapsedGroupKeys\"\n [menus]=\"menus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n </div>\n }\n\n <div data-v3-footer class=\"sd-sidebar-v3__footer p-8\">\n <sd-layout-user-menu [userInfo]=\"userInfo()\" [compact]=\"collapsed\"></sd-layout-user-menu>\n </div>\n </aside>\n\n <main class=\"sd-sidebar-v3__content\">\n <ng-content></ng-content>\n </main>\n</div>\n", styles: [".sd-sidebar-v3{--sidebar-surface: var(--sd-white, #fff);--sidebar-line: color-mix(in srgb, var(--sd-border, #c4c6d0) 45%, var(--sidebar-surface));--sidebar-ink: var(--sd-text, #252c38);--sidebar-muted: var(--sd-text-secondary, #6b7280);min-height:100vh;background:var(--sd-light)}.sd-sidebar-v3__drawer{position:fixed;z-index:var(--sd-z-sidebar, 20);inset:0 auto 0 0;width:304px;box-sizing:border-box;background:var(--sidebar-surface);border-right:1px solid var(--sidebar-line);color:var(--sidebar-ink);transition:width .16s ease}.sd-sidebar-v3__header{flex-shrink:0;min-height:64px;box-sizing:border-box}.sd-sidebar-v3__title{font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600);line-height:var(--sd-line-height-22, 22px);letter-spacing:-.2px}.sd-sidebar-v3__search{flex-shrink:0}.sd-sidebar-v3__navigation{min-height:0;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--sidebar-line) transparent}.sd-sidebar-v3__navigation section{flex-shrink:0}.sd-sidebar-v3__section-title{padding:4px 10px;font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-16, 16px);letter-spacing:.3px;color:var(--sidebar-muted)}.sd-sidebar-v3__footer{flex-shrink:0;border-top:1px solid var(--sidebar-line);background:var(--sidebar-surface)}.sd-sidebar-v3--collapsed .sd-sidebar-v3__drawer{width:72px}.sd-sidebar-v3__content{min-height:100vh;margin-left:304px;transition:margin-left .16s ease}.sd-sidebar-v3--collapsed .sd-sidebar-v3__content{margin-left:72px}.sd-sidebar-v3__icon-action,.sd-sidebar-v3__collapsed-action{width:40px;flex-shrink:0;height:40px;border:0;border-radius:7px;background:transparent;color:var(--sidebar-muted);cursor:pointer}@media(pointer:coarse){.sd-sidebar-v3__icon-action,.sd-sidebar-v3__collapsed-action{width:44px;height:44px}}.sd-sidebar-v3__icon-action:hover,.sd-sidebar-v3__collapsed-action:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-v3__icon-action:focus-visible,.sd-sidebar-v3__collapsed-action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-sidebar-v3__logo{width:28px;height:28px;object-fit:contain}@media(prefers-reduced-motion:reduce){.sd-sidebar-v3__drawer,.sd-sidebar-v3__content{transition:none}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdLayoutSearchFieldComponent, selector: "sd-layout-search-field", inputs: ["model", "placeholder", "autoId", "appearance"], outputs: ["sdChange"] }, { kind: "component", type: SdLayoutMenuTreeComponent, selector: "sd-layout-menu-tree", inputs: ["menus", "query", "activePath", "pinnedKeys", "showPin", "pinVisibility", "presentation", "collapsible", "collapsedGroupKeys"], outputs: ["collapsedGroupKeysChange", "navigate", "togglePinned"] }, { kind: "component", type: SdLayoutUserMenuComponent, selector: "sd-layout-user-menu", inputs: ["userInfo", "signout", "changePassword", "updateProfile", "setting", "notification", "compact", "presentation"], outputs: ["opened", "closed"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3387
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdSidebarV3, isStandalone: true, selector: "sd-sidebar-v3", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "headerSwitcher", first: true, predicate: ["headerSwitcher"], descendants: true, isSignal: true }], ngImport: i0, template: "@let collapsed = isCollapsed();\n@let configuration = sidebar();\n@let pinned = pinnedMenus();\n@let recent = recentMenus();\n@let title = configuration.defaultTitle || 'Back Office';\n<div class=\"sd-sidebar-v3\" [class.sd-sidebar-v3--collapsed]=\"collapsed\">\n <aside #asideElement class=\"sd-sidebar-v3__drawer d-flex flex-column\" data-v3-sidebar [attr.data-collapsed]=\"collapsed\">\n <header\n #headerElement\n data-v3-header\n class=\"sd-sidebar-v3__header d-flex align-items-center gap-8 p-12\"\n [class.sd-sidebar-v3__header--collapsed]=\"collapsed\"\n [class.sd-sidebar-v3__header--context-open]=\"!collapsed && contextOpen()\"\n [class.justify-content-between]=\"!collapsed\"\n [class.justify-content-center]=\"collapsed\">\n @if (!collapsed) {\n <!-- why: 12px gi\u1EEFa icon v\u00E0 t\u00EAn (nh\u01B0 V4) \u2014 8px tr\u00F4ng d\u00EDnh v\u00E0o kh\u1ED1i t\u00EAn hai d\u00F2ng khi c\u00F3 context. -->\n <div data-v3-brand class=\"d-flex align-items-center gap-12 overflow-hidden\">\n @if (configuration.logoUrl) {\n <img class=\"sd-sidebar-v3__logo\" [src]=\"configuration.logoUrl\" alt=\"\" />\n } @else {\n <sd-icon name=\"apps\" fontSet=\"material-icons-outlined\" size=\"20px\"></sd-icon>\n }\n @if (configuration.context; as context) {\n <!-- Context switcher (R-008, D-010): d\u00F2ng ph\u1EE5 ngay d\u01B0\u1EDBi t\u00EAn app; popover n\u1EB1m d\u01B0\u1EDBi header, th\u1EE5t 12px m\u1ED7i b\u00EAn. -->\n <div class=\"sd-sidebar-v3__brand-text\">\n <span class=\"sd-sidebar-v3__title text-ellipsis\">{{ title }}</span>\n <sd-layout-context-switcher #headerSwitcher appearance=\"header\" [configuration]=\"context\" [anchor]=\"headerElement\" />\n </div>\n } @else {\n <span class=\"sd-sidebar-v3__title text-ellipsis\">{{ title }}</span>\n }\n </div>\n }\n <button\n type=\"button\"\n class=\"sd-sidebar-v3__icon-action d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"collapsed ? 'M\u1EDF r\u1ED9ng sidebar' : 'Thu g\u1ECDn sidebar'\"\n [attr.aria-expanded]=\"!collapsed\"\n (click)=\"toggleCollapsed()\">\n <sd-icon [name]=\"collapsed ? 'chevron_right' : 'chevron_left'\" size=\"20px\"></sd-icon>\n </button>\n </header>\n\n @if (collapsed) {\n @if (configuration.context; as context) {\n <!-- Rail thu g\u1ECDn (D-010): avatar context \u1EDF \u0111\u1EA7u rail, d\u01B0\u1EDBi n\u00FAt m\u1EDF r\u1ED9ng; popover m\u1EDF sang ph\u1EA3i t\u1EEB m\u00E9p drawer. -->\n <sd-layout-context-switcher\n class=\"sd-sidebar-v3__rail-context\"\n appearance=\"rail\"\n [configuration]=\"context\"\n [anchor]=\"asideElement\" />\n }\n <nav class=\"sd-sidebar-v3__navigation d-flex flex-column align-items-center gap-4 p-8 flex-1 overflow-auto\" aria-label=\"Menu thu g\u1ECDn\">\n @for (item of collapsedItems(); track item.key) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v3__collapsed-action d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"item.title\"\n [attr.title]=\"item.title\"\n (click)=\"activateCollapsedMenu(item.menu)\">\n @if (item.menu.iconUrl) {\n <img class=\"sd-sidebar-v3__logo\" [src]=\"item.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"item.menu.icon || 'widgets'\" fontSet=\"material-icons-outlined\" size=\"20px\"></sd-icon>\n }\n </button>\n }\n </nav>\n } @else {\n <div class=\"sd-sidebar-v3__search px-12 pb-12\">\n <sd-layout-search-field\n appearance=\"compact\"\n placeholder=\"T\u00ECm trong t\u1EA5t c\u1EA3 menu\"\n [autoId]=\"'layout-v3-global-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n <div class=\"sd-sidebar-v3__navigation d-flex flex-column gap-16 flex-1 overflow-auto px-8 pb-12\">\n @if (pinned.length) {\n <section data-v3-pinned class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.pinned' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"shortcuts\"\n [menus]=\"pinned\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n @if (recentConfiguration().enabled && recent.length) {\n <section data-v3-recent class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.recent' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"shortcuts\"\n [menus]=\"recent\"\n [activePath]=\"activePath()\"\n [showPin]=\"false\"\n (navigate)=\"navigateMenu($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n <section data-v3-all class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.all-menu' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"hierarchy\"\n [collapsible]=\"true\"\n [(collapsedGroupKeys)]=\"collapsedGroupKeys\"\n [menus]=\"menus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n </div>\n }\n\n <div data-v3-footer class=\"sd-sidebar-v3__footer p-8\">\n <sd-layout-user-menu [userInfo]=\"userInfo()\" [compact]=\"collapsed\"></sd-layout-user-menu>\n </div>\n </aside>\n\n <main class=\"sd-sidebar-v3__content\">\n <ng-content></ng-content>\n </main>\n</div>\n", styles: [".sd-sidebar-v3{--sidebar-surface: var(--sd-white, #fff);--sidebar-line: color-mix(in srgb, var(--sd-border, #c4c6d0) 45%, var(--sidebar-surface));--sidebar-ink: var(--sd-text, #252c38);--sidebar-muted: var(--sd-text-secondary, #6b7280);min-height:100vh;background:var(--sd-light)}.sd-sidebar-v3__drawer{position:fixed;z-index:var(--sd-z-sidebar, 20);inset:0 auto 0 0;width:304px;box-sizing:border-box;background:var(--sidebar-surface);border-right:1px solid var(--sidebar-line);color:var(--sidebar-ink);transition:width .16s ease}.sd-sidebar-v3__header{flex-shrink:0;min-height:64px;box-sizing:border-box}.sd-sidebar-v3__title{font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600);line-height:var(--sd-line-height-22, 22px);letter-spacing:-.2px}.sd-sidebar-v3__brand-text{--sd-layout-context-switcher-popover-width: 280px ;display:flex;flex-direction:column;min-width:0}.sd-sidebar-v3__header--context-open{border-radius:var(--sd-radius-12, 12px);background:color-mix(in srgb,var(--sd-text) 6%,transparent)}.sd-sidebar-v3__header--context-open ::ng-deep .sd-layout-context-switcher__trigger.sd-layout-context-switcher__trigger--header{background:transparent}.sd-sidebar-v3__rail-context{flex:none}.sd-sidebar-v3__rail-context:not(:empty){margin-bottom:4px}.sd-sidebar-v3__search{flex-shrink:0}.sd-sidebar-v3__navigation{min-height:0;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--sidebar-line) transparent}.sd-sidebar-v3__navigation section{flex-shrink:0}.sd-sidebar-v3__section-title{padding:4px 10px;font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-16, 16px);letter-spacing:.3px;color:var(--sidebar-muted)}.sd-sidebar-v3__footer{flex-shrink:0;border-top:1px solid var(--sidebar-line);background:var(--sidebar-surface)}.sd-sidebar-v3--collapsed .sd-sidebar-v3__drawer{width:72px}.sd-sidebar-v3__content{min-height:100vh;margin-left:304px;transition:margin-left .16s ease}.sd-sidebar-v3--collapsed .sd-sidebar-v3__content{margin-left:72px}.sd-sidebar-v3__icon-action,.sd-sidebar-v3__collapsed-action{width:40px;flex-shrink:0;height:40px;border:0;border-radius:7px;background:transparent;color:var(--sidebar-muted);cursor:pointer}@media(pointer:coarse){.sd-sidebar-v3__icon-action,.sd-sidebar-v3__collapsed-action{width:44px;height:44px}}.sd-sidebar-v3__icon-action:hover,.sd-sidebar-v3__collapsed-action:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-v3__icon-action:focus-visible,.sd-sidebar-v3__collapsed-action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-sidebar-v3__logo{width:28px;height:28px;object-fit:contain}@media(prefers-reduced-motion:reduce){.sd-sidebar-v3__drawer,.sd-sidebar-v3__content{transition:none}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdLayoutContextSwitcher, selector: "sd-layout-context-switcher", inputs: ["configuration", "appearance", "placement", "anchor"] }, { kind: "component", type: SdLayoutSearchFieldComponent, selector: "sd-layout-search-field", inputs: ["model", "placeholder", "autoId", "appearance"], outputs: ["sdChange"] }, { kind: "component", type: SdLayoutMenuTreeComponent, selector: "sd-layout-menu-tree", inputs: ["menus", "query", "activePath", "pinnedKeys", "showPin", "pinVisibility", "presentation", "collapsible", "collapsedGroupKeys"], outputs: ["collapsedGroupKeysChange", "navigate", "togglePinned"] }, { kind: "component", type: SdLayoutUserMenuComponent, selector: "sd-layout-user-menu", inputs: ["userInfo", "signout", "changePassword", "updateProfile", "setting", "notification", "compact", "presentation"], outputs: ["opened", "closed"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2389
3388
  }
2390
3389
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdSidebarV3, decorators: [{
2391
3390
  type: Component,
2392
- args: [{ selector: 'sd-sidebar-v3', standalone: true, imports: [SdIcon, SdLayoutSearchFieldComponent, SdLayoutMenuTreeComponent, SdLayoutUserMenuComponent, SdTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let collapsed = isCollapsed();\n@let configuration = sidebar();\n@let pinned = pinnedMenus();\n@let recent = recentMenus();\n<div class=\"sd-sidebar-v3\" [class.sd-sidebar-v3--collapsed]=\"collapsed\">\n <aside class=\"sd-sidebar-v3__drawer d-flex flex-column\" data-v3-sidebar [attr.data-collapsed]=\"collapsed\">\n <header\n data-v3-header\n class=\"sd-sidebar-v3__header d-flex align-items-center gap-8 p-12\"\n [class.sd-sidebar-v3__header--collapsed]=\"collapsed\"\n [class.justify-content-between]=\"!collapsed\"\n [class.justify-content-center]=\"collapsed\">\n @if (!collapsed) {\n <div data-v3-brand class=\"d-flex align-items-center gap-8 overflow-hidden\">\n @if (configuration.logoUrl) {\n <img class=\"sd-sidebar-v3__logo\" [src]=\"configuration.logoUrl\" alt=\"\" />\n } @else {\n <sd-icon name=\"apps\" fontSet=\"material-icons-outlined\" size=\"20px\"></sd-icon>\n }\n <span class=\"sd-sidebar-v3__title text-ellipsis\">{{ configuration.defaultTitle || 'Back Office' }}</span>\n </div>\n }\n <button\n type=\"button\"\n class=\"sd-sidebar-v3__icon-action d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"collapsed ? 'M\u1EDF r\u1ED9ng sidebar' : 'Thu g\u1ECDn sidebar'\"\n [attr.aria-expanded]=\"!collapsed\"\n (click)=\"toggleCollapsed()\">\n <sd-icon [name]=\"collapsed ? 'chevron_right' : 'chevron_left'\" size=\"20px\"></sd-icon>\n </button>\n </header>\n\n @if (collapsed) {\n <nav class=\"sd-sidebar-v3__navigation d-flex flex-column align-items-center gap-4 p-8 flex-1 overflow-auto\" aria-label=\"Menu thu g\u1ECDn\">\n @for (item of collapsedItems(); track item.key) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v3__collapsed-action d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"item.title\"\n [attr.title]=\"item.title\"\n (click)=\"activateCollapsedMenu(item.menu)\">\n @if (item.menu.iconUrl) {\n <img class=\"sd-sidebar-v3__logo\" [src]=\"item.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"item.menu.icon || 'widgets'\" fontSet=\"material-icons-outlined\" size=\"20px\"></sd-icon>\n }\n </button>\n }\n </nav>\n } @else {\n <div class=\"sd-sidebar-v3__search px-12 pb-12\">\n <sd-layout-search-field\n appearance=\"compact\"\n placeholder=\"T\u00ECm trong t\u1EA5t c\u1EA3 menu\"\n [autoId]=\"'layout-v3-global-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n <div class=\"sd-sidebar-v3__navigation d-flex flex-column gap-16 flex-1 overflow-auto px-8 pb-12\">\n @if (pinned.length) {\n <section data-v3-pinned class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.pinned' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"shortcuts\"\n [menus]=\"pinned\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n @if (recentConfiguration().enabled && recent.length) {\n <section data-v3-recent class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.recent' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"shortcuts\"\n [menus]=\"recent\"\n [activePath]=\"activePath()\"\n [showPin]=\"false\"\n (navigate)=\"navigateMenu($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n <section data-v3-all class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.all-menu' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"hierarchy\"\n [collapsible]=\"true\"\n [(collapsedGroupKeys)]=\"collapsedGroupKeys\"\n [menus]=\"menus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n </div>\n }\n\n <div data-v3-footer class=\"sd-sidebar-v3__footer p-8\">\n <sd-layout-user-menu [userInfo]=\"userInfo()\" [compact]=\"collapsed\"></sd-layout-user-menu>\n </div>\n </aside>\n\n <main class=\"sd-sidebar-v3__content\">\n <ng-content></ng-content>\n </main>\n</div>\n", styles: [".sd-sidebar-v3{--sidebar-surface: var(--sd-white, #fff);--sidebar-line: color-mix(in srgb, var(--sd-border, #c4c6d0) 45%, var(--sidebar-surface));--sidebar-ink: var(--sd-text, #252c38);--sidebar-muted: var(--sd-text-secondary, #6b7280);min-height:100vh;background:var(--sd-light)}.sd-sidebar-v3__drawer{position:fixed;z-index:var(--sd-z-sidebar, 20);inset:0 auto 0 0;width:304px;box-sizing:border-box;background:var(--sidebar-surface);border-right:1px solid var(--sidebar-line);color:var(--sidebar-ink);transition:width .16s ease}.sd-sidebar-v3__header{flex-shrink:0;min-height:64px;box-sizing:border-box}.sd-sidebar-v3__title{font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600);line-height:var(--sd-line-height-22, 22px);letter-spacing:-.2px}.sd-sidebar-v3__search{flex-shrink:0}.sd-sidebar-v3__navigation{min-height:0;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--sidebar-line) transparent}.sd-sidebar-v3__navigation section{flex-shrink:0}.sd-sidebar-v3__section-title{padding:4px 10px;font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-16, 16px);letter-spacing:.3px;color:var(--sidebar-muted)}.sd-sidebar-v3__footer{flex-shrink:0;border-top:1px solid var(--sidebar-line);background:var(--sidebar-surface)}.sd-sidebar-v3--collapsed .sd-sidebar-v3__drawer{width:72px}.sd-sidebar-v3__content{min-height:100vh;margin-left:304px;transition:margin-left .16s ease}.sd-sidebar-v3--collapsed .sd-sidebar-v3__content{margin-left:72px}.sd-sidebar-v3__icon-action,.sd-sidebar-v3__collapsed-action{width:40px;flex-shrink:0;height:40px;border:0;border-radius:7px;background:transparent;color:var(--sidebar-muted);cursor:pointer}@media(pointer:coarse){.sd-sidebar-v3__icon-action,.sd-sidebar-v3__collapsed-action{width:44px;height:44px}}.sd-sidebar-v3__icon-action:hover,.sd-sidebar-v3__collapsed-action:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-v3__icon-action:focus-visible,.sd-sidebar-v3__collapsed-action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-sidebar-v3__logo{width:28px;height:28px;object-fit:contain}@media(prefers-reduced-motion:reduce){.sd-sidebar-v3__drawer,.sd-sidebar-v3__content{transition:none}}\n"] }]
2393
- }], ctorParameters: () => [], propDecorators: { menus: [{ type: i0.Input, args: [{ isSignal: true, alias: "menus", required: false }] }], userInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "userInfo", required: true }] }], sidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebar", required: true }] }] } });
3391
+ args: [{ selector: 'sd-sidebar-v3', standalone: true, imports: [
3392
+ SdIcon,
3393
+ SdLayoutContextSwitcher,
3394
+ SdLayoutSearchFieldComponent,
3395
+ SdLayoutMenuTreeComponent,
3396
+ SdLayoutUserMenuComponent,
3397
+ SdTranslatePipe,
3398
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let collapsed = isCollapsed();\n@let configuration = sidebar();\n@let pinned = pinnedMenus();\n@let recent = recentMenus();\n@let title = configuration.defaultTitle || 'Back Office';\n<div class=\"sd-sidebar-v3\" [class.sd-sidebar-v3--collapsed]=\"collapsed\">\n <aside #asideElement class=\"sd-sidebar-v3__drawer d-flex flex-column\" data-v3-sidebar [attr.data-collapsed]=\"collapsed\">\n <header\n #headerElement\n data-v3-header\n class=\"sd-sidebar-v3__header d-flex align-items-center gap-8 p-12\"\n [class.sd-sidebar-v3__header--collapsed]=\"collapsed\"\n [class.sd-sidebar-v3__header--context-open]=\"!collapsed && contextOpen()\"\n [class.justify-content-between]=\"!collapsed\"\n [class.justify-content-center]=\"collapsed\">\n @if (!collapsed) {\n <!-- why: 12px gi\u1EEFa icon v\u00E0 t\u00EAn (nh\u01B0 V4) \u2014 8px tr\u00F4ng d\u00EDnh v\u00E0o kh\u1ED1i t\u00EAn hai d\u00F2ng khi c\u00F3 context. -->\n <div data-v3-brand class=\"d-flex align-items-center gap-12 overflow-hidden\">\n @if (configuration.logoUrl) {\n <img class=\"sd-sidebar-v3__logo\" [src]=\"configuration.logoUrl\" alt=\"\" />\n } @else {\n <sd-icon name=\"apps\" fontSet=\"material-icons-outlined\" size=\"20px\"></sd-icon>\n }\n @if (configuration.context; as context) {\n <!-- Context switcher (R-008, D-010): d\u00F2ng ph\u1EE5 ngay d\u01B0\u1EDBi t\u00EAn app; popover n\u1EB1m d\u01B0\u1EDBi header, th\u1EE5t 12px m\u1ED7i b\u00EAn. -->\n <div class=\"sd-sidebar-v3__brand-text\">\n <span class=\"sd-sidebar-v3__title text-ellipsis\">{{ title }}</span>\n <sd-layout-context-switcher #headerSwitcher appearance=\"header\" [configuration]=\"context\" [anchor]=\"headerElement\" />\n </div>\n } @else {\n <span class=\"sd-sidebar-v3__title text-ellipsis\">{{ title }}</span>\n }\n </div>\n }\n <button\n type=\"button\"\n class=\"sd-sidebar-v3__icon-action d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"collapsed ? 'M\u1EDF r\u1ED9ng sidebar' : 'Thu g\u1ECDn sidebar'\"\n [attr.aria-expanded]=\"!collapsed\"\n (click)=\"toggleCollapsed()\">\n <sd-icon [name]=\"collapsed ? 'chevron_right' : 'chevron_left'\" size=\"20px\"></sd-icon>\n </button>\n </header>\n\n @if (collapsed) {\n @if (configuration.context; as context) {\n <!-- Rail thu g\u1ECDn (D-010): avatar context \u1EDF \u0111\u1EA7u rail, d\u01B0\u1EDBi n\u00FAt m\u1EDF r\u1ED9ng; popover m\u1EDF sang ph\u1EA3i t\u1EEB m\u00E9p drawer. -->\n <sd-layout-context-switcher\n class=\"sd-sidebar-v3__rail-context\"\n appearance=\"rail\"\n [configuration]=\"context\"\n [anchor]=\"asideElement\" />\n }\n <nav class=\"sd-sidebar-v3__navigation d-flex flex-column align-items-center gap-4 p-8 flex-1 overflow-auto\" aria-label=\"Menu thu g\u1ECDn\">\n @for (item of collapsedItems(); track item.key) {\n <button\n type=\"button\"\n class=\"sd-sidebar-v3__collapsed-action d-flex align-items-center justify-content-center\"\n [attr.aria-label]=\"item.title\"\n [attr.title]=\"item.title\"\n (click)=\"activateCollapsedMenu(item.menu)\">\n @if (item.menu.iconUrl) {\n <img class=\"sd-sidebar-v3__logo\" [src]=\"item.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon [name]=\"item.menu.icon || 'widgets'\" fontSet=\"material-icons-outlined\" size=\"20px\"></sd-icon>\n }\n </button>\n }\n </nav>\n } @else {\n <div class=\"sd-sidebar-v3__search px-12 pb-12\">\n <sd-layout-search-field\n appearance=\"compact\"\n placeholder=\"T\u00ECm trong t\u1EA5t c\u1EA3 menu\"\n [autoId]=\"'layout-v3-global-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n <div class=\"sd-sidebar-v3__navigation d-flex flex-column gap-16 flex-1 overflow-auto px-8 pb-12\">\n @if (pinned.length) {\n <section data-v3-pinned class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.pinned' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"shortcuts\"\n [menus]=\"pinned\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n @if (recentConfiguration().enabled && recent.length) {\n <section data-v3-recent class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.recent' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"shortcuts\"\n [menus]=\"recent\"\n [activePath]=\"activePath()\"\n [showPin]=\"false\"\n (navigate)=\"navigateMenu($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n <section data-v3-all class=\"d-flex flex-column gap-4\">\n <h2 class=\"sd-sidebar-v3__section-title m-0\">{{ 'core.module.layout.sidebar.all-menu' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n presentation=\"hierarchy\"\n [collapsible]=\"true\"\n [(collapsedGroupKeys)]=\"collapsedGroupKeys\"\n [menus]=\"menus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n </div>\n }\n\n <div data-v3-footer class=\"sd-sidebar-v3__footer p-8\">\n <sd-layout-user-menu [userInfo]=\"userInfo()\" [compact]=\"collapsed\"></sd-layout-user-menu>\n </div>\n </aside>\n\n <main class=\"sd-sidebar-v3__content\">\n <ng-content></ng-content>\n </main>\n</div>\n", styles: [".sd-sidebar-v3{--sidebar-surface: var(--sd-white, #fff);--sidebar-line: color-mix(in srgb, var(--sd-border, #c4c6d0) 45%, var(--sidebar-surface));--sidebar-ink: var(--sd-text, #252c38);--sidebar-muted: var(--sd-text-secondary, #6b7280);min-height:100vh;background:var(--sd-light)}.sd-sidebar-v3__drawer{position:fixed;z-index:var(--sd-z-sidebar, 20);inset:0 auto 0 0;width:304px;box-sizing:border-box;background:var(--sidebar-surface);border-right:1px solid var(--sidebar-line);color:var(--sidebar-ink);transition:width .16s ease}.sd-sidebar-v3__header{flex-shrink:0;min-height:64px;box-sizing:border-box}.sd-sidebar-v3__title{font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-semibold, 600);line-height:var(--sd-line-height-22, 22px);letter-spacing:-.2px}.sd-sidebar-v3__brand-text{--sd-layout-context-switcher-popover-width: 280px ;display:flex;flex-direction:column;min-width:0}.sd-sidebar-v3__header--context-open{border-radius:var(--sd-radius-12, 12px);background:color-mix(in srgb,var(--sd-text) 6%,transparent)}.sd-sidebar-v3__header--context-open ::ng-deep .sd-layout-context-switcher__trigger.sd-layout-context-switcher__trigger--header{background:transparent}.sd-sidebar-v3__rail-context{flex:none}.sd-sidebar-v3__rail-context:not(:empty){margin-bottom:4px}.sd-sidebar-v3__search{flex-shrink:0}.sd-sidebar-v3__navigation{min-height:0;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--sidebar-line) transparent}.sd-sidebar-v3__navigation section{flex-shrink:0}.sd-sidebar-v3__section-title{padding:4px 10px;font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-16, 16px);letter-spacing:.3px;color:var(--sidebar-muted)}.sd-sidebar-v3__footer{flex-shrink:0;border-top:1px solid var(--sidebar-line);background:var(--sidebar-surface)}.sd-sidebar-v3--collapsed .sd-sidebar-v3__drawer{width:72px}.sd-sidebar-v3__content{min-height:100vh;margin-left:304px;transition:margin-left .16s ease}.sd-sidebar-v3--collapsed .sd-sidebar-v3__content{margin-left:72px}.sd-sidebar-v3__icon-action,.sd-sidebar-v3__collapsed-action{width:40px;flex-shrink:0;height:40px;border:0;border-radius:7px;background:transparent;color:var(--sidebar-muted);cursor:pointer}@media(pointer:coarse){.sd-sidebar-v3__icon-action,.sd-sidebar-v3__collapsed-action{width:44px;height:44px}}.sd-sidebar-v3__icon-action:hover,.sd-sidebar-v3__collapsed-action:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-v3__icon-action:focus-visible,.sd-sidebar-v3__collapsed-action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-sidebar-v3__logo{width:28px;height:28px;object-fit:contain}@media(prefers-reduced-motion:reduce){.sd-sidebar-v3__drawer,.sd-sidebar-v3__content{transition:none}}\n"] }]
3399
+ }], ctorParameters: () => [], propDecorators: { headerSwitcher: [{ type: i0.ViewChild, args: ['headerSwitcher', { isSignal: true }] }], menus: [{ type: i0.Input, args: [{ isSignal: true, alias: "menus", required: false }] }], userInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "userInfo", required: true }] }], sidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebar", required: true }] }] } });
2394
3400
 
2395
3401
  class SdSidebarMobileV3 {
2396
3402
  #router = inject(Router);
2397
3403
  #document = inject(DOCUMENT);
2398
3404
  #destroyRef = inject(DestroyRef);
3405
+ #injector = inject(Injector);
2399
3406
  #navigationState = inject(SdLayoutNavigationStateService);
2400
3407
  trigger = viewChild('trigger', ...(ngDevMode ? [{ debugName: "trigger" }] : /* istanbul ignore next */ []));
2401
3408
  #restoreFocusElement = null;
@@ -2417,6 +3424,16 @@ class SdSidebarMobileV3 {
2417
3424
  const maximum = resolveSidebarV3Recent(this.sidebar()).maxItems;
2418
3425
  untracked(() => this.#navigationState.hydrate(menus, maximum));
2419
3426
  });
3427
+ // why: switcher chỉ mount khi drawer mở — đối chiếu context ngay lúc khởi tạo (EXEC-D1, D-021) để listener nhiều tab
3428
+ // chạy từ đầu và lần chạm đầu vào menu không kích reload đối chiếu. Không có `context` thì không lấy service: app
3429
+ // không cấu hình context không tạo service lẫn listener.
3430
+ effect(() => {
3431
+ const context = this.sidebar().context;
3432
+ if (!context)
3433
+ return;
3434
+ const items = context.items;
3435
+ untracked(() => this.#injector.get(SdLayoutContextService).syncItems(items));
3436
+ });
2420
3437
  this.#router.events.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(event => {
2421
3438
  if (!(event instanceof NavigationEnd))
2422
3439
  return;
@@ -2487,13 +3504,999 @@ class SdSidebarMobileV3 {
2487
3504
  this.#document.body.style.overflow = this.#previousBodyOverflow;
2488
3505
  }
2489
3506
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdSidebarMobileV3, deps: [], target: i0.ɵɵFactoryTarget.Component });
2490
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdSidebarMobileV3, isStandalone: true, selector: "sd-sidebar-mobile-v3", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"sd-sidebar-mobile-v3 d-flex flex-column\">\n <header\n class=\"sd-sidebar-mobile-v3__topbar d-flex align-items-center justify-content-between gap-8 px-16 bg-white border-bottom border-black200\">\n <div class=\"d-flex align-items-center gap-8 overflow-hidden\">\n @if (sidebar().logoUrl) {\n <img class=\"sd-sidebar-mobile-v3__logo\" [src]=\"sidebar().logoUrl\" alt=\"\" />\n }\n <span class=\"T16M text-ellipsis\">{{ sidebar().defaultTitle || 'Back Office' }}</span>\n </div>\n <button\n #trigger\n type=\"button\"\n data-v3-mobile-trigger\n class=\"sd-sidebar-mobile-v3__icon-action d-flex align-items-center justify-content-center\"\n aria-label=\"M\u1EDF menu\"\n [attr.aria-expanded]=\"isDrawerOpen()\"\n (click)=\"openDrawer($event.currentTarget)\">\n <sd-icon name=\"menu\"></sd-icon>\n </button>\n </header>\n\n <main class=\"flex-1 overflow-auto\">\n <ng-content></ng-content>\n </main>\n\n @if (isDrawerOpen()) {\n <button type=\"button\" class=\"sd-sidebar-mobile-v3__backdrop\" aria-label=\"\u0110\u00F3ng menu\" (click)=\"closeFromBackdrop()\"></button>\n <aside\n class=\"sd-sidebar-mobile-v3__drawer d-flex flex-column bg-white mat-elevation-z8\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Menu ch\u00EDnh\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onDrawerKeydown($event)\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n <span class=\"T18M text-ellipsis\">{{ sidebar().defaultTitle || 'Back Office' }}</span>\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v3__icon-action d-flex align-items-center justify-content-center\"\n aria-label=\"\u0110\u00F3ng menu\"\n (click)=\"closeFromBackdrop()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n </header>\n <div class=\"sd-sidebar-mobile-v3__navigation d-flex flex-column gap-16 flex-1 overflow-auto p-12\">\n <sd-layout-user-menu presentation=\"mobile-inline\" [userInfo]=\"userInfo()\"></sd-layout-user-menu>\n <div class=\"sd-sidebar-mobile-v3__search bg-white\">\n <sd-layout-search-field\n placeholder=\"T\u00ECm trong t\u1EA5t c\u1EA3 menu\"\n [autoId]=\"'layout-v3-mobile-global-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n @if (pinnedMenus().length) {\n <section data-v3-mobile-pinned class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.pinned' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n [menus]=\"pinnedMenus()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n @if (recentConfiguration().enabled && recentMenus().length) {\n <section data-v3-mobile-recent class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.recent' | sdTranslate }}</h2>\n <sd-layout-menu-tree [menus]=\"recentMenus()\" [activePath]=\"activePath()\" [showPin]=\"false\" (navigate)=\"navigateMenu($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n <section class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.all-menu' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n [menus]=\"menus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n </div>\n </aside>\n }\n</div>\n", styles: [":host{display:block}.sd-sidebar-mobile-v3{min-height:100dvh;background:var(--sd-light)}.sd-sidebar-mobile-v3__topbar{min-height:56px}.sd-sidebar-mobile-v3__icon-action{width:40px;height:40px;border:0;border-radius:var(--sd-radius-8, 8px);background:transparent;color:var(--sd-black500);cursor:pointer}.sd-sidebar-mobile-v3__icon-action:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-mobile-v3__icon-action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-sidebar-mobile-v3__logo{width:28px;height:28px;object-fit:contain}.sd-sidebar-mobile-v3__backdrop{position:fixed;z-index:var(--sd-z-popover, 40);inset:0;border:0;background:color-mix(in srgb,var(--sd-black) 40%,transparent)}.sd-sidebar-mobile-v3__drawer{position:fixed;z-index:var(--sd-z-drawer-mobile, 50);inset:0 auto 0 0;width:min(88vw,360px);max-width:100%;padding-bottom:env(safe-area-inset-bottom)}.sd-sidebar-mobile-v3__search{position:sticky;z-index:2;top:-12px;margin:-12px;padding:12px;background:var(--sd-white, #fff)}@media(prefers-reduced-motion:reduce){.sd-sidebar-mobile-v3__drawer{transition:none}}\n"], dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1$2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdLayoutSearchFieldComponent, selector: "sd-layout-search-field", inputs: ["model", "placeholder", "autoId", "appearance"], outputs: ["sdChange"] }, { kind: "component", type: SdLayoutMenuTreeComponent, selector: "sd-layout-menu-tree", inputs: ["menus", "query", "activePath", "pinnedKeys", "showPin", "pinVisibility", "presentation", "collapsible", "collapsedGroupKeys"], outputs: ["collapsedGroupKeysChange", "navigate", "togglePinned"] }, { kind: "component", type: SdLayoutUserMenuComponent, selector: "sd-layout-user-menu", inputs: ["userInfo", "signout", "changePassword", "updateProfile", "setting", "notification", "compact", "presentation"], outputs: ["opened", "closed"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3507
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdSidebarMobileV3, isStandalone: true, selector: "sd-sidebar-mobile-v3", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"sd-sidebar-mobile-v3 d-flex flex-column\">\n <header\n class=\"sd-sidebar-mobile-v3__topbar d-flex align-items-center justify-content-between gap-8 px-16 bg-white border-bottom border-black200\">\n <div class=\"d-flex align-items-center gap-8 overflow-hidden\">\n @if (sidebar().logoUrl) {\n <img class=\"sd-sidebar-mobile-v3__logo\" [src]=\"sidebar().logoUrl\" alt=\"\" />\n }\n <span class=\"T16M text-ellipsis\">{{ sidebar().defaultTitle || 'Back Office' }}</span>\n </div>\n <button\n #trigger\n type=\"button\"\n data-v3-mobile-trigger\n class=\"sd-sidebar-mobile-v3__icon-action d-flex align-items-center justify-content-center\"\n aria-label=\"M\u1EDF menu\"\n [attr.aria-expanded]=\"isDrawerOpen()\"\n (click)=\"openDrawer($event.currentTarget)\">\n <sd-icon name=\"menu\"></sd-icon>\n </button>\n </header>\n\n <main class=\"flex-1 overflow-auto\">\n <ng-content></ng-content>\n </main>\n\n @if (isDrawerOpen()) {\n <button type=\"button\" class=\"sd-sidebar-mobile-v3__backdrop\" aria-label=\"\u0110\u00F3ng menu\" (click)=\"closeFromBackdrop()\"></button>\n <aside\n class=\"sd-sidebar-mobile-v3__drawer d-flex flex-column bg-white mat-elevation-z8\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Menu ch\u00EDnh\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onDrawerKeydown($event)\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n @if (sidebar().context; as context) {\n <!-- Context switcher (R-008, D-027): trigger ngay d\u01B0\u1EDBi t\u00EAn app; sheet ch\u1ECDn context m\u1EDF trong overlay CDK, ch\u1ED3ng l\u00EAn\n drawer v\u00E0 t\u1EF1 gi\u1EEF Esc (kh\u00F4ng \u0111\u00F3ng drawer). -->\n <div class=\"sd-sidebar-mobile-v3__brand\">\n <span class=\"T18M text-ellipsis\">{{ sidebar().defaultTitle || 'Back Office' }}</span>\n <sd-layout-context-switcher appearance=\"sheet\" [configuration]=\"context\" />\n </div>\n } @else {\n <span class=\"T18M text-ellipsis\">{{ sidebar().defaultTitle || 'Back Office' }}</span>\n }\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v3__icon-action d-flex align-items-center justify-content-center\"\n aria-label=\"\u0110\u00F3ng menu\"\n (click)=\"closeFromBackdrop()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n </header>\n <div class=\"sd-sidebar-mobile-v3__navigation d-flex flex-column gap-16 flex-1 overflow-auto p-12\">\n <sd-layout-user-menu presentation=\"mobile-inline\" [userInfo]=\"userInfo()\"></sd-layout-user-menu>\n <div class=\"sd-sidebar-mobile-v3__search bg-white\">\n <sd-layout-search-field\n placeholder=\"T\u00ECm trong t\u1EA5t c\u1EA3 menu\"\n [autoId]=\"'layout-v3-mobile-global-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n @if (pinnedMenus().length) {\n <section data-v3-mobile-pinned class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.pinned' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n [menus]=\"pinnedMenus()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n @if (recentConfiguration().enabled && recentMenus().length) {\n <section data-v3-mobile-recent class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.recent' | sdTranslate }}</h2>\n <sd-layout-menu-tree [menus]=\"recentMenus()\" [activePath]=\"activePath()\" [showPin]=\"false\" (navigate)=\"navigateMenu($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n <section class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.all-menu' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n [menus]=\"menus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n </div>\n </aside>\n }\n</div>\n", styles: [":host{display:block}.sd-sidebar-mobile-v3{min-height:100dvh;background:var(--sd-light)}.sd-sidebar-mobile-v3__topbar{min-height:56px}.sd-sidebar-mobile-v3__icon-action{width:40px;height:40px;border:0;border-radius:var(--sd-radius-8, 8px);background:transparent;color:var(--sd-black500);cursor:pointer}.sd-sidebar-mobile-v3__icon-action:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-mobile-v3__icon-action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-sidebar-mobile-v3__logo{width:28px;height:28px;object-fit:contain}.sd-sidebar-mobile-v3__backdrop{position:fixed;z-index:var(--sd-z-popover, 40);inset:0;border:0;background:color-mix(in srgb,var(--sd-black) 40%,transparent)}.sd-sidebar-mobile-v3__drawer{position:fixed;z-index:var(--sd-z-drawer-mobile, 50);inset:0 auto 0 0;width:min(88vw,360px);max-width:100%;padding-bottom:env(safe-area-inset-bottom)}.sd-sidebar-mobile-v3__brand{display:flex;flex:1 1 auto;flex-direction:column;min-width:0}.sd-sidebar-mobile-v3__search{position:sticky;z-index:2;top:-12px;margin:-12px;padding:12px;background:var(--sd-white, #fff)}@media(prefers-reduced-motion:reduce){.sd-sidebar-mobile-v3__drawer{transition:none}}\n"], dependencies: [{ kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i1$2.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdLayoutContextSwitcher, selector: "sd-layout-context-switcher", inputs: ["configuration", "appearance", "placement", "anchor"] }, { kind: "component", type: SdLayoutSearchFieldComponent, selector: "sd-layout-search-field", inputs: ["model", "placeholder", "autoId", "appearance"], outputs: ["sdChange"] }, { kind: "component", type: SdLayoutMenuTreeComponent, selector: "sd-layout-menu-tree", inputs: ["menus", "query", "activePath", "pinnedKeys", "showPin", "pinVisibility", "presentation", "collapsible", "collapsedGroupKeys"], outputs: ["collapsedGroupKeysChange", "navigate", "togglePinned"] }, { kind: "component", type: SdLayoutUserMenuComponent, selector: "sd-layout-user-menu", inputs: ["userInfo", "signout", "changePassword", "updateProfile", "setting", "notification", "compact", "presentation"], outputs: ["opened", "closed"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2491
3508
  }
2492
3509
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdSidebarMobileV3, decorators: [{
2493
3510
  type: Component,
2494
- args: [{ selector: 'sd-sidebar-mobile-v3', standalone: true, imports: [A11yModule, SdIcon, SdLayoutSearchFieldComponent, SdLayoutMenuTreeComponent, SdLayoutUserMenuComponent, SdTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"sd-sidebar-mobile-v3 d-flex flex-column\">\n <header\n class=\"sd-sidebar-mobile-v3__topbar d-flex align-items-center justify-content-between gap-8 px-16 bg-white border-bottom border-black200\">\n <div class=\"d-flex align-items-center gap-8 overflow-hidden\">\n @if (sidebar().logoUrl) {\n <img class=\"sd-sidebar-mobile-v3__logo\" [src]=\"sidebar().logoUrl\" alt=\"\" />\n }\n <span class=\"T16M text-ellipsis\">{{ sidebar().defaultTitle || 'Back Office' }}</span>\n </div>\n <button\n #trigger\n type=\"button\"\n data-v3-mobile-trigger\n class=\"sd-sidebar-mobile-v3__icon-action d-flex align-items-center justify-content-center\"\n aria-label=\"M\u1EDF menu\"\n [attr.aria-expanded]=\"isDrawerOpen()\"\n (click)=\"openDrawer($event.currentTarget)\">\n <sd-icon name=\"menu\"></sd-icon>\n </button>\n </header>\n\n <main class=\"flex-1 overflow-auto\">\n <ng-content></ng-content>\n </main>\n\n @if (isDrawerOpen()) {\n <button type=\"button\" class=\"sd-sidebar-mobile-v3__backdrop\" aria-label=\"\u0110\u00F3ng menu\" (click)=\"closeFromBackdrop()\"></button>\n <aside\n class=\"sd-sidebar-mobile-v3__drawer d-flex flex-column bg-white mat-elevation-z8\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Menu ch\u00EDnh\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onDrawerKeydown($event)\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n <span class=\"T18M text-ellipsis\">{{ sidebar().defaultTitle || 'Back Office' }}</span>\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v3__icon-action d-flex align-items-center justify-content-center\"\n aria-label=\"\u0110\u00F3ng menu\"\n (click)=\"closeFromBackdrop()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n </header>\n <div class=\"sd-sidebar-mobile-v3__navigation d-flex flex-column gap-16 flex-1 overflow-auto p-12\">\n <sd-layout-user-menu presentation=\"mobile-inline\" [userInfo]=\"userInfo()\"></sd-layout-user-menu>\n <div class=\"sd-sidebar-mobile-v3__search bg-white\">\n <sd-layout-search-field\n placeholder=\"T\u00ECm trong t\u1EA5t c\u1EA3 menu\"\n [autoId]=\"'layout-v3-mobile-global-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n @if (pinnedMenus().length) {\n <section data-v3-mobile-pinned class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.pinned' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n [menus]=\"pinnedMenus()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n @if (recentConfiguration().enabled && recentMenus().length) {\n <section data-v3-mobile-recent class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.recent' | sdTranslate }}</h2>\n <sd-layout-menu-tree [menus]=\"recentMenus()\" [activePath]=\"activePath()\" [showPin]=\"false\" (navigate)=\"navigateMenu($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n <section class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.all-menu' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n [menus]=\"menus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n </div>\n </aside>\n }\n</div>\n", styles: [":host{display:block}.sd-sidebar-mobile-v3{min-height:100dvh;background:var(--sd-light)}.sd-sidebar-mobile-v3__topbar{min-height:56px}.sd-sidebar-mobile-v3__icon-action{width:40px;height:40px;border:0;border-radius:var(--sd-radius-8, 8px);background:transparent;color:var(--sd-black500);cursor:pointer}.sd-sidebar-mobile-v3__icon-action:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-mobile-v3__icon-action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-sidebar-mobile-v3__logo{width:28px;height:28px;object-fit:contain}.sd-sidebar-mobile-v3__backdrop{position:fixed;z-index:var(--sd-z-popover, 40);inset:0;border:0;background:color-mix(in srgb,var(--sd-black) 40%,transparent)}.sd-sidebar-mobile-v3__drawer{position:fixed;z-index:var(--sd-z-drawer-mobile, 50);inset:0 auto 0 0;width:min(88vw,360px);max-width:100%;padding-bottom:env(safe-area-inset-bottom)}.sd-sidebar-mobile-v3__search{position:sticky;z-index:2;top:-12px;margin:-12px;padding:12px;background:var(--sd-white, #fff)}@media(prefers-reduced-motion:reduce){.sd-sidebar-mobile-v3__drawer{transition:none}}\n"] }]
3511
+ args: [{ selector: 'sd-sidebar-mobile-v3', standalone: true, imports: [
3512
+ A11yModule,
3513
+ SdIcon,
3514
+ SdLayoutContextSwitcher,
3515
+ SdLayoutSearchFieldComponent,
3516
+ SdLayoutMenuTreeComponent,
3517
+ SdLayoutUserMenuComponent,
3518
+ SdTranslatePipe,
3519
+ ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"sd-sidebar-mobile-v3 d-flex flex-column\">\n <header\n class=\"sd-sidebar-mobile-v3__topbar d-flex align-items-center justify-content-between gap-8 px-16 bg-white border-bottom border-black200\">\n <div class=\"d-flex align-items-center gap-8 overflow-hidden\">\n @if (sidebar().logoUrl) {\n <img class=\"sd-sidebar-mobile-v3__logo\" [src]=\"sidebar().logoUrl\" alt=\"\" />\n }\n <span class=\"T16M text-ellipsis\">{{ sidebar().defaultTitle || 'Back Office' }}</span>\n </div>\n <button\n #trigger\n type=\"button\"\n data-v3-mobile-trigger\n class=\"sd-sidebar-mobile-v3__icon-action d-flex align-items-center justify-content-center\"\n aria-label=\"M\u1EDF menu\"\n [attr.aria-expanded]=\"isDrawerOpen()\"\n (click)=\"openDrawer($event.currentTarget)\">\n <sd-icon name=\"menu\"></sd-icon>\n </button>\n </header>\n\n <main class=\"flex-1 overflow-auto\">\n <ng-content></ng-content>\n </main>\n\n @if (isDrawerOpen()) {\n <button type=\"button\" class=\"sd-sidebar-mobile-v3__backdrop\" aria-label=\"\u0110\u00F3ng menu\" (click)=\"closeFromBackdrop()\"></button>\n <aside\n class=\"sd-sidebar-mobile-v3__drawer d-flex flex-column bg-white mat-elevation-z8\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Menu ch\u00EDnh\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onDrawerKeydown($event)\">\n <header class=\"d-flex align-items-center justify-content-between gap-8 px-16 py-12 border-bottom border-black200\">\n @if (sidebar().context; as context) {\n <!-- Context switcher (R-008, D-027): trigger ngay d\u01B0\u1EDBi t\u00EAn app; sheet ch\u1ECDn context m\u1EDF trong overlay CDK, ch\u1ED3ng l\u00EAn\n drawer v\u00E0 t\u1EF1 gi\u1EEF Esc (kh\u00F4ng \u0111\u00F3ng drawer). -->\n <div class=\"sd-sidebar-mobile-v3__brand\">\n <span class=\"T18M text-ellipsis\">{{ sidebar().defaultTitle || 'Back Office' }}</span>\n <sd-layout-context-switcher appearance=\"sheet\" [configuration]=\"context\" />\n </div>\n } @else {\n <span class=\"T18M text-ellipsis\">{{ sidebar().defaultTitle || 'Back Office' }}</span>\n }\n <button\n type=\"button\"\n class=\"sd-sidebar-mobile-v3__icon-action d-flex align-items-center justify-content-center\"\n aria-label=\"\u0110\u00F3ng menu\"\n (click)=\"closeFromBackdrop()\">\n <sd-icon name=\"close\"></sd-icon>\n </button>\n </header>\n <div class=\"sd-sidebar-mobile-v3__navigation d-flex flex-column gap-16 flex-1 overflow-auto p-12\">\n <sd-layout-user-menu presentation=\"mobile-inline\" [userInfo]=\"userInfo()\"></sd-layout-user-menu>\n <div class=\"sd-sidebar-mobile-v3__search bg-white\">\n <sd-layout-search-field\n placeholder=\"T\u00ECm trong t\u1EA5t c\u1EA3 menu\"\n [autoId]=\"'layout-v3-mobile-global-search'\"\n [model]=\"searchText()\"\n (sdChange)=\"searchText.set($event)\">\n </sd-layout-search-field>\n </div>\n @if (pinnedMenus().length) {\n <section data-v3-mobile-pinned class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.pinned' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n [menus]=\"pinnedMenus()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n @if (recentConfiguration().enabled && recentMenus().length) {\n <section data-v3-mobile-recent class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.recent' | sdTranslate }}</h2>\n <sd-layout-menu-tree [menus]=\"recentMenus()\" [activePath]=\"activePath()\" [showPin]=\"false\" (navigate)=\"navigateMenu($event)\">\n </sd-layout-menu-tree>\n </section>\n }\n <section class=\"d-flex flex-column gap-4\">\n <h2 class=\"T12M text-black400 px-12 m-0\">{{ 'core.module.layout.sidebar.all-menu' | sdTranslate }}</h2>\n <sd-layout-menu-tree\n [menus]=\"menus()\"\n [query]=\"searchText()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n pinVisibility=\"always\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\">\n </sd-layout-menu-tree>\n </section>\n </div>\n </aside>\n }\n</div>\n", styles: [":host{display:block}.sd-sidebar-mobile-v3{min-height:100dvh;background:var(--sd-light)}.sd-sidebar-mobile-v3__topbar{min-height:56px}.sd-sidebar-mobile-v3__icon-action{width:40px;height:40px;border:0;border-radius:var(--sd-radius-8, 8px);background:transparent;color:var(--sd-black500);cursor:pointer}.sd-sidebar-mobile-v3__icon-action:hover{color:var(--sd-primary);background:var(--sd-primary-light)}.sd-sidebar-mobile-v3__icon-action:focus-visible{outline:var(--sd-focus-ring-width, 2px) solid var(--sd-focus-ring-color, var(--sd-primary));outline-offset:2px}.sd-sidebar-mobile-v3__logo{width:28px;height:28px;object-fit:contain}.sd-sidebar-mobile-v3__backdrop{position:fixed;z-index:var(--sd-z-popover, 40);inset:0;border:0;background:color-mix(in srgb,var(--sd-black) 40%,transparent)}.sd-sidebar-mobile-v3__drawer{position:fixed;z-index:var(--sd-z-drawer-mobile, 50);inset:0 auto 0 0;width:min(88vw,360px);max-width:100%;padding-bottom:env(safe-area-inset-bottom)}.sd-sidebar-mobile-v3__brand{display:flex;flex:1 1 auto;flex-direction:column;min-width:0}.sd-sidebar-mobile-v3__search{position:sticky;z-index:2;top:-12px;margin:-12px;padding:12px;background:var(--sd-white, #fff)}@media(prefers-reduced-motion:reduce){.sd-sidebar-mobile-v3__drawer{transition:none}}\n"] }]
2495
3520
  }], ctorParameters: () => [], propDecorators: { trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], menus: [{ type: i0.Input, args: [{ isSignal: true, alias: "menus", required: false }] }], userInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "userInfo", required: true }] }], sidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebar", required: true }] }] } });
2496
3521
 
3522
+ /**
3523
+ * Accent-insensitive V4 search over `menus` (via `searchAvailableMenuLeaves`, so `comingSoon` items and everything under a
3524
+ * `comingSoon` group are left out) with the parent path of every hit. A blank query returns no rows.
3525
+ * The `results` presentation renders exactly this list, so a parent's keyboard index matches the rendered options.
3526
+ */
3527
+ function buildSidebarV4SearchResults(menus, query) {
3528
+ if (!query?.trim())
3529
+ return [];
3530
+ const paths = collectParentPaths(menus);
3531
+ return searchAvailableMenuLeaves(menus, query).map(menu => ({ key: getMenuStableKey(menu), menu, path: lookupParentPath(paths, menu) }));
3532
+ }
3533
+ const PIN_KEY = 'core.module.layout.menu.pin';
3534
+ const UNPIN_KEY = 'core.module.layout.menu.unpin';
3535
+ const BADGE_PENDING_KEY = 'core.module.layout.sidebar.badge-pending';
3536
+ const RESULT_COUNT_KEY = 'core.module.layout.sidebar.result-count';
3537
+ const NO_MATCH_KEY = 'core.module.layout.sidebar.no-match';
3538
+ const ITEM_RADIUS_VARIABLE = '--sd-sidebar-v4-item-radius';
3539
+ // Mock: panel ở left 58px / top -6px so với ô rail 48px → lệch 10px từ mép phải của nút.
3540
+ const FLYOUT_POSITIONS = [
3541
+ { originX: 'end', originY: 'top', overlayX: 'start', overlayY: 'top', offsetX: 10, offsetY: -6 },
3542
+ { originX: 'end', originY: 'bottom', overlayX: 'start', overlayY: 'bottom', offsetX: 10, offsetY: 6 },
3543
+ ];
3544
+ let nextTreeId = 0;
3545
+ /**
3546
+ * Private menu tree of sidebar V4 (D-014, D-023): imported only by `sd-sidebar-v4` and `sd-sidebar-mobile-v4`, never exported
3547
+ * from a public index. Navigation is the parent's job — the tree only emits.
3548
+ *
3549
+ * Inputs
3550
+ * - `menus`: what to render. `hierarchy`: the full tree; `shortcuts`: the pinned or recent menus; `results`: the full tree
3551
+ * searched with `query` (the rendered options are exactly `results()` / `buildSidebarV4SearchResults(menus, query)`).
3552
+ * - `pathSource`: full tree used for parent paths and the active route when `menus` is a subset (shortcuts); defaults to `menus`.
3553
+ * - `activePath`: current route path; the most exact matching menu is active (`resolveActiveMenuPath`).
3554
+ * - `presentation`: `hierarchy` (sections, groups, branch rails) | `shortcuts` (flat "title · path" rows) | `results` (search).
3555
+ * - `mode`: `expanded` | `collapsed` (72px rail; hierarchy only) | `mobile` (hierarchy with 44px fallbacks, pin always shown).
3556
+ * Row sizes come from `--sd-sidebar-v4-item-height`, `--sd-sidebar-v4-child-height` and `--sd-sidebar-v4-item-radius`
3557
+ * set by the parent (fallbacks 36px / 32px / 999px, or 44px in mobile mode).
3558
+ * - `collapsedGroupKeys` (two-way): stable keys of closed groups — same keys and semantics as the V3 tree.
3559
+ * - `pinnedKeys`, `showPin`: pin toggles on leaf rows (hierarchy) and the unpin toggle on shortcut rows.
3560
+ * - `collapsedGroup`: rail group click opens a flyout (`flyout`) or emits `expandGroup` (`expand`). The flyout closes on
3561
+ * navigation, Escape or a click outside it (that click still reaches its target, e.g. another rail item).
3562
+ * - `query`, `focusedIndex`: search text and the keyboard-selected option of the `results` presentation.
3563
+ *
3564
+ * Outputs: `navigate` (root/leaf rows, never `comingSoon`), `togglePinned`, `expandGroup`.
3565
+ * The host is not a landmark; the parent wraps the tree in its `<nav>`. It always holds a polite live region that announces
3566
+ * the result count (or the no-match message) while the `results` presentation has a query — keep the same tree instance
3567
+ * mounted while switching presentations so the change is announced.
3568
+ * The collapsed rail shows (and announces) only warning/error badges and live status dots; neutral counts stay off the rail.
3569
+ */
3570
+ class SdSidebarV4MenuTree {
3571
+ #i18n = inject(I18nService);
3572
+ #host = inject(ElementRef);
3573
+ #document = inject(DOCUMENT);
3574
+ #id = `sd-sidebar-v4-menu-tree-${nextTreeId++}`;
3575
+ #flyoutKey = signal(null, ...(ngDevMode ? [{ debugName: "#flyoutKey" }] : /* istanbul ignore next */ []));
3576
+ #flyoutTrigger = null;
3577
+ /** Menus to render; see the class description for what each presentation expects. */
3578
+ menus = input([], ...(ngDevMode ? [{ debugName: "menus" }] : /* istanbul ignore next */ []));
3579
+ /** Full menu tree for parent paths and the active route when `menus` is a subset; empty means `menus`. */
3580
+ pathSource = input([], ...(ngDevMode ? [{ debugName: "pathSource" }] : /* istanbul ignore next */ []));
3581
+ /** Current route path without query or fragment. */
3582
+ activePath = input('', ...(ngDevMode ? [{ debugName: "activePath" }] : /* istanbul ignore next */ []));
3583
+ presentation = input('hierarchy', ...(ngDevMode ? [{ debugName: "presentation" }] : /* istanbul ignore next */ []));
3584
+ mode = input('expanded', ...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
3585
+ /** Stable keys of closed groups (default: every group open), shared two-way with the parent. */
3586
+ collapsedGroupKeys = model([], ...(ngDevMode ? [{ debugName: "collapsedGroupKeys" }] : /* istanbul ignore next */ []));
3587
+ pinnedKeys = input([], ...(ngDevMode ? [{ debugName: "pinnedKeys" }] : /* istanbul ignore next */ []));
3588
+ showPin = input(true, ...(ngDevMode ? [{ debugName: "showPin" }] : /* istanbul ignore next */ []));
3589
+ /** What a group click does on the collapsed rail. */
3590
+ collapsedGroup = input('flyout', ...(ngDevMode ? [{ debugName: "collapsedGroup" }] : /* istanbul ignore next */ []));
3591
+ /** Search text of the `results` presentation. */
3592
+ query = input('', ...(ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []));
3593
+ /** Index in `results()` of the keyboard-selected option; -1 for none. */
3594
+ focusedIndex = input(-1, ...(ngDevMode ? [{ debugName: "focusedIndex" }] : /* istanbul ignore next */ []));
3595
+ /** A root or leaf row was activated (never a `comingSoon` item). */
3596
+ navigate = output();
3597
+ togglePinned = output();
3598
+ /** A rail group was clicked with `collapsedGroup: 'expand'`; the parent expands the sidebar and opens that group. */
3599
+ expandGroup = output();
3600
+ /** Id of the results listbox, for the parent's `aria-controls`. */
3601
+ resultsId = `${this.#id}-results`;
3602
+ resultCountId = `${this.#id}-result-count`;
3603
+ flyoutPositions = FLYOUT_POSITIONS;
3604
+ flyoutKey = this.#flyoutKey.asReadonly();
3605
+ flyoutRadius = signal(null, ...(ngDevMode ? [{ debugName: "flyoutRadius" }] : /* istanbul ignore next */ []));
3606
+ #treeSource = computed(() => (this.pathSource().length ? this.pathSource() : this.menus()), ...(ngDevMode ? [{ debugName: "#treeSource" }] : /* istanbul ignore next */ []));
3607
+ #activeMenuPath = computed(() => resolveActiveMenuPath(this.#treeSource(), this.activePath()), ...(ngDevMode ? [{ debugName: "#activeMenuPath" }] : /* istanbul ignore next */ []));
3608
+ isRail = computed(() => this.presentation() === 'hierarchy' && this.mode() === 'collapsed', ...(ngDevMode ? [{ debugName: "isRail" }] : /* istanbul ignore next */ []));
3609
+ /** Rows of the `results` presentation, in render order. */
3610
+ results = computed(() => buildSidebarV4SearchResults(this.menus(), this.query()), ...(ngDevMode ? [{ debugName: "results" }] : /* istanbul ignore next */ []));
3611
+ sections = computed(() => {
3612
+ const context = this.#nodeContext(new Set(this.collapsedGroupKeys()));
3613
+ return groupMenusBySection(this.menus()).map((group, index) => ({
3614
+ key: group.section === null ? `unsectioned-${index}` : `section-${group.section}`,
3615
+ label: group.section,
3616
+ labelId: `${this.#id}-section-${index}`,
3617
+ separated: group.section === null && index > 0,
3618
+ nodes: this.#collectNodes(group.menus, 0, [], context, []),
3619
+ }));
3620
+ }, ...(ngDevMode ? [{ debugName: "sections" }] : /* istanbul ignore next */ []));
3621
+ shortcuts = computed(() => {
3622
+ const paths = collectParentPaths(this.#treeSource());
3623
+ const activeMenuPath = this.#activeMenuPath();
3624
+ const pinnedKeys = new Set(this.pinnedKeys());
3625
+ return this.menus()
3626
+ .filter((menu) => !!menu && 'path' in menu && typeof menu.path === 'string' && !!menu.path)
3627
+ .map(menu => {
3628
+ const key = getMenuStableKey(menu);
3629
+ const title = menu.title ?? menu.tooltipTitle ?? '';
3630
+ const isPinned = pinnedKeys.has(key);
3631
+ return {
3632
+ menu,
3633
+ key,
3634
+ title,
3635
+ path: lookupParentPath(paths, menu),
3636
+ isActive: menu.path === activeMenuPath,
3637
+ disabled: menu.comingSoon === true,
3638
+ isPinned,
3639
+ pinLabel: this.#i18n.t(isPinned ? UNPIN_KEY : PIN_KEY, { title }),
3640
+ };
3641
+ });
3642
+ }, ...(ngDevMode ? [{ debugName: "shortcuts" }] : /* istanbul ignore next */ []));
3643
+ resultRows = computed(() => {
3644
+ const query = this.query();
3645
+ return this.results().map(result => ({ ...result, segments: highlightSegments(result.menu.title ?? '', query) }));
3646
+ }, ...(ngDevMode ? [{ debugName: "resultRows" }] : /* istanbul ignore next */ []));
3647
+ /** Text of the always-mounted polite live region: the result count, or the no-match message, while searching. */
3648
+ liveMessage = computed(() => {
3649
+ const query = this.query().trim();
3650
+ if (this.presentation() !== 'results' || !query)
3651
+ return '';
3652
+ const count = this.results().length;
3653
+ return count ? this.#i18n.t(RESULT_COUNT_KEY, { count }) : this.#i18n.t(NO_MATCH_KEY, { query });
3654
+ }, ...(ngDevMode ? [{ debugName: "liveMessage" }] : /* istanbul ignore next */ []));
3655
+ railGroups = computed(() => {
3656
+ const activeMenuPath = this.#activeMenuPath();
3657
+ return groupMenusBySection(this.menus()).map((group, groupIndex) => ({
3658
+ key: group.section === null ? `unsectioned-${groupIndex}` : `section-${group.section}`,
3659
+ items: group.menus
3660
+ .map((menu, index) => this.#toRailItem(menu, activeMenuPath, `${this.#id}-rail-${groupIndex}-${index}`))
3661
+ .filter((item) => !!item),
3662
+ }));
3663
+ }, ...(ngDevMode ? [{ debugName: "railGroups" }] : /* istanbul ignore next */ []));
3664
+ flyoutNodes = computed(() => {
3665
+ const key = this.#flyoutKey();
3666
+ if (!key)
3667
+ return [];
3668
+ const item = this.railGroups()
3669
+ .flatMap(group => group.items)
3670
+ .find(candidate => candidate.key === key);
3671
+ if (!item || !('children' in item.menu))
3672
+ return [];
3673
+ // why: flyout luôn bày hết các cấp (bỏ qua collapsedGroupKeys); nhóm lồng thành heading thụt lề.
3674
+ return this.#collectNodes(item.menu.children ?? [], 0, [item.menu.title ?? key], this.#nodeContext(null), []);
3675
+ }, ...(ngDevMode ? [{ debugName: "flyoutNodes" }] : /* istanbul ignore next */ []));
3676
+ constructor() {
3677
+ // why: đổi mode/presentation (vd mở rộng rail) hoặc route đổi từ nơi khác khi flyout đang mở thì đóng hẳn, tránh overlay
3678
+ // mồ côi; không trả focus vì người dùng không chủ động đóng.
3679
+ effect(() => {
3680
+ this.mode();
3681
+ this.presentation();
3682
+ this.collapsedGroup();
3683
+ this.activePath();
3684
+ untracked(() => this.closeFlyout(false));
3685
+ });
3686
+ // why: menus đổi làm group đang mở biến mất (hoặc thành comingSoon) thì bỏ key/trigger cũ thay vì giữ state treo.
3687
+ effect(() => {
3688
+ const key = this.#flyoutKey();
3689
+ if (!key)
3690
+ return;
3691
+ const present = this.railGroups().some(group => group.items.some(item => item.key === key && item.isGroup && !item.disabled));
3692
+ if (!present)
3693
+ untracked(() => this.closeFlyout(false));
3694
+ });
3695
+ }
3696
+ /** Id of the result option at `index`, for the parent's `aria-activedescendant`. */
3697
+ resultOptionId(index) {
3698
+ return `${this.#id}-result-${index}`;
3699
+ }
3700
+ /** Closes the collapsed-rail flyout; focus returns to its group button unless `restoreFocus` is false. */
3701
+ closeFlyout(restoreFocus = true) {
3702
+ if (!this.#flyoutKey())
3703
+ return;
3704
+ const trigger = this.#flyoutTrigger;
3705
+ this.#flyoutKey.set(null);
3706
+ this.#flyoutTrigger = null;
3707
+ if (restoreFocus)
3708
+ trigger?.focus();
3709
+ }
3710
+ onNavigate(menu) {
3711
+ if (menu.comingSoon === true || !('path' in menu))
3712
+ return;
3713
+ this.navigate.emit(menu);
3714
+ }
3715
+ onToggleGroup(node) {
3716
+ if (node.disabled)
3717
+ return;
3718
+ this.collapsedGroupKeys.update(keys => (keys.includes(node.key) ? keys.filter(key => key !== node.key) : [...keys, node.key]));
3719
+ }
3720
+ onTogglePinned(event, menu) {
3721
+ event.stopPropagation();
3722
+ this.togglePinned.emit(menu);
3723
+ }
3724
+ onRailGroup(item, trigger) {
3725
+ if (item.disabled)
3726
+ return;
3727
+ if (this.collapsedGroup() === 'expand') {
3728
+ this.expandGroup.emit(item.menu);
3729
+ return;
3730
+ }
3731
+ if (this.#flyoutKey() === item.key) {
3732
+ this.closeFlyout();
3733
+ return;
3734
+ }
3735
+ this.#flyoutTrigger = trigger;
3736
+ this.flyoutRadius.set(this.#readItemRadius());
3737
+ this.#flyoutKey.set(item.key);
3738
+ }
3739
+ onFlyoutNavigate(node) {
3740
+ if (node.disabled || !('path' in node.menu))
3741
+ return;
3742
+ this.navigate.emit(node.menu);
3743
+ this.closeFlyout();
3744
+ }
3745
+ onFlyoutAttach(overlay) {
3746
+ // why: không dùng cdkTrapFocusAutoCapture — nó nhớ phần tử được focus lúc mở (nút group) và focus lại phần tử đó khi
3747
+ // panel bị huỷ, giành focus của chỗ người dùng vừa click (vd ô input). Tự đưa focus vào panel tại đây; closeFlyout là
3748
+ // nơi duy nhất trả focus. (attach) phát sau khi portal đã render panel nên làm được đồng bộ.
3749
+ const panel = overlay.overlayRef?.overlayElement.querySelector('[data-v4-flyout]');
3750
+ if (!panel)
3751
+ return;
3752
+ (panel.querySelector('button') ?? panel).focus({ preventScroll: true });
3753
+ }
3754
+ onFlyoutKeydown(event) {
3755
+ if (event.key !== 'Escape')
3756
+ return;
3757
+ event.preventDefault();
3758
+ // why: Esc chỉ đóng flyout — không tới handler Esc của lớp ngoài (xoá search, đóng drawer mobile).
3759
+ event.stopPropagation();
3760
+ this.closeFlyout();
3761
+ }
3762
+ onFlyoutOutsideClick() {
3763
+ // why: không dùng backdrop nên click vẫn tới đích (vd mở group rail khác); CDK đã loại click lên chính nút group.
3764
+ // Chỉ trả focus về nút group khi click không trao focus cho phần tử khác (vd ô input trong trang).
3765
+ const active = this.#document.activeElement;
3766
+ const focusIsFree = !active || active === this.#document.body || !!active.closest('[data-v4-flyout]');
3767
+ this.closeFlyout(focusIsFree);
3768
+ }
3769
+ onFlyoutDetach(key) {
3770
+ // why: CDK tự detach (vd scroll strategy) thì đồng bộ lại state; không trả focus vì không do người dùng đóng.
3771
+ if (this.#flyoutKey() !== key)
3772
+ return;
3773
+ this.#flyoutKey.set(null);
3774
+ this.#flyoutTrigger = null;
3775
+ }
3776
+ #nodeContext(collapsedKeys) {
3777
+ return { activeMenuPath: this.#activeMenuPath(), collapsedKeys, pinnedKeys: new Set(this.pinnedKeys()), showPin: this.showPin() };
3778
+ }
3779
+ #collectNodes(menus, depth, ancestors, context, nodes) {
3780
+ for (const menu of menus ?? []) {
3781
+ if (!menu || typeof menu !== 'object')
3782
+ continue;
3783
+ const key = getMenuStableKey(menu, ancestors);
3784
+ if (!key)
3785
+ continue;
3786
+ const children = 'children' in menu && Array.isArray(menu.children) ? menu.children : [];
3787
+ const isGroup = children.length > 0;
3788
+ const path = 'path' in menu && typeof menu.path === 'string' ? menu.path : '';
3789
+ const disabled = menu.comingSoon === true;
3790
+ const title = menu.title ?? menu.tooltipTitle ?? '';
3791
+ const isExpanded = isGroup && !disabled && !context.collapsedKeys?.has(key);
3792
+ const holdsActive = isGroup && !!context.activeMenuPath && containsMenuPath(menu, context.activeMenuPath);
3793
+ const pinnable = context.showPin && !isGroup && !disabled && !!path;
3794
+ const isPinned = context.pinnedKeys.has(key);
3795
+ nodes.push({
3796
+ menu,
3797
+ key,
3798
+ title,
3799
+ depth,
3800
+ isGroup,
3801
+ isExpanded,
3802
+ isActive: !isGroup && !!path && path === context.activeMenuPath,
3803
+ showActiveDot: holdsActive && !isExpanded,
3804
+ disabled,
3805
+ trailing: resolveMenuTrailing(menu),
3806
+ paddingLeft: depth ? 32 + (depth - 1) * 16 : 0,
3807
+ branchOffsets: Array.from({ length: depth }, (_, index) => 21 + index * 16),
3808
+ markerLeft: 20 + Math.max(depth - 1, 0) * 16,
3809
+ pinnable,
3810
+ isPinned,
3811
+ pinLabel: pinnable ? this.#i18n.t(isPinned ? UNPIN_KEY : PIN_KEY, { title }) : '',
3812
+ });
3813
+ if (isExpanded)
3814
+ this.#collectNodes(children, depth + 1, [...ancestors, menu.title ?? key], context, nodes);
3815
+ }
3816
+ return nodes;
3817
+ }
3818
+ #toRailItem(menu, activeMenuPath, descriptionId) {
3819
+ if (!menu || typeof menu !== 'object')
3820
+ return null;
3821
+ const key = getMenuStableKey(menu);
3822
+ if (!key)
3823
+ return null;
3824
+ const isGroup = 'children' in menu && Array.isArray(menu.children) && menu.children.length > 0;
3825
+ const trailing = resolveMenuTrailing(menu);
3826
+ const badge = trailing?.kind === 'badge' ? { value: trailing.value, tone: trailing.tone } : null;
3827
+ const liveTone = trailing?.kind === 'status' && trailing.live ? trailing.tone : null;
3828
+ const description = badge
3829
+ ? this.#i18n.t(BADGE_PENDING_KEY, { count: badge.value })
3830
+ : trailing?.kind === 'status' && trailing.live
3831
+ ? trailing.label
3832
+ : '';
3833
+ return {
3834
+ menu,
3835
+ key,
3836
+ title: menu.tooltipTitle || menu.title || '',
3837
+ isGroup,
3838
+ isActive: !!activeMenuPath && containsMenuPath(menu, activeMenuPath),
3839
+ disabled: menu.comingSoon === true,
3840
+ badge,
3841
+ liveTone,
3842
+ descriptionId,
3843
+ description,
3844
+ };
3845
+ }
3846
+ #readItemRadius() {
3847
+ // why: flyout nằm trong overlay container của CDK, ngoài host — không thừa kế được biến radius parent khai trên host.
3848
+ const view = this.#document.defaultView;
3849
+ if (!view)
3850
+ return null;
3851
+ return view.getComputedStyle(this.#host.nativeElement).getPropertyValue(ITEM_RADIUS_VARIABLE).trim() || null;
3852
+ }
3853
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdSidebarV4MenuTree, deps: [], target: i0.ɵɵFactoryTarget.Component });
3854
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdSidebarV4MenuTree, isStandalone: true, selector: "sd-sidebar-v4-menu-tree", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, pathSource: { classPropertyName: "pathSource", publicName: "pathSource", isSignal: true, isRequired: false, transformFunction: null }, activePath: { classPropertyName: "activePath", publicName: "activePath", isSignal: true, isRequired: false, transformFunction: null }, presentation: { classPropertyName: "presentation", publicName: "presentation", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, collapsedGroupKeys: { classPropertyName: "collapsedGroupKeys", publicName: "collapsedGroupKeys", isSignal: true, isRequired: false, transformFunction: null }, pinnedKeys: { classPropertyName: "pinnedKeys", publicName: "pinnedKeys", isSignal: true, isRequired: false, transformFunction: null }, showPin: { classPropertyName: "showPin", publicName: "showPin", isSignal: true, isRequired: false, transformFunction: null }, collapsedGroup: { classPropertyName: "collapsedGroup", publicName: "collapsedGroup", isSignal: true, isRequired: false, transformFunction: null }, query: { classPropertyName: "query", publicName: "query", isSignal: true, isRequired: false, transformFunction: null }, focusedIndex: { classPropertyName: "focusedIndex", publicName: "focusedIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { collapsedGroupKeys: "collapsedGroupKeysChange", navigate: "navigate", togglePinned: "togglePinned", expandGroup: "expandGroup" }, host: { properties: { "class.sd-sidebar-v4-menu-tree--mobile": "mode() === \"mobile\"", "class.sd-sidebar-v4-menu-tree--collapsed": "isRail()" }, classAttribute: "sd-sidebar-v4-menu-tree" }, ngImport: i0, template: "@let _presentation = presentation();\n<div data-v4-live class=\"sd-sidebar-v4-menu-tree__sr-only\" aria-live=\"polite\" aria-atomic=\"true\">{{ liveMessage() }}</div>\n@if (_presentation === 'results') {\n @let _query = query().trim();\n @if (_query) {\n @let _rows = resultRows();\n @let _focused = focusedIndex();\n <div data-v4-result-count class=\"sd-sidebar-v4-menu-tree__section-label\" [id]=\"resultCountId\">\n {{ 'core.module.layout.sidebar.result-count' | sdTranslate: { count: _rows.length } }}\n </div>\n @if (_rows.length) {\n <div data-v4-results class=\"sd-sidebar-v4-menu-tree__results\" role=\"listbox\" [id]=\"resultsId\" [attr.aria-labelledby]=\"resultCountId\">\n @for (row of _rows; track $index; let index = $index) {\n <!-- Options stay unfocusable: the parent's search input drives them via aria-activedescendant (Up/Down/Enter); click is the pointer path. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div\n data-v4-result\n class=\"sd-sidebar-v4-menu-tree__result\"\n role=\"option\"\n [id]=\"resultOptionId(index)\"\n [attr.data-menu-key]=\"row.key\"\n [attr.aria-selected]=\"index === _focused\"\n [class.sd-sidebar-v4-menu-tree__result--focused]=\"index === _focused\"\n (click)=\"onNavigate(row.menu)\">\n <span class=\"sd-sidebar-v4-menu-tree__result-title\">\n @for (segment of row.segments; track $index) {\n <span [class.sd-sidebar-v4-menu-tree__match]=\"segment.match\" [attr.data-v4-match]=\"segment.match ? '' : null\">{{\n segment.text\n }}</span>\n }\n </span>\n @if (row.path) {\n <span data-v4-result-path class=\"sd-sidebar-v4-menu-tree__result-path\">{{ row.path }}</span>\n }\n </div>\n }\n </div>\n } @else {\n <div data-v4-empty class=\"sd-sidebar-v4-menu-tree__empty\">\n {{ 'core.module.layout.sidebar.no-match' | sdTranslate: { query: _query } }}\n </div>\n }\n <div data-v4-search-hint class=\"sd-sidebar-v4-menu-tree__hint\">{{ 'core.module.layout.sidebar.search-hint' | sdTranslate }}</div>\n }\n} @else if (_presentation === 'shortcuts') {\n @for (row of shortcuts(); track row.key) {\n <div\n class=\"sd-sidebar-v4-menu-tree__item sd-sidebar-v4-menu-tree__item--shortcut\"\n [class.sd-sidebar-v4-menu-tree__item--pinnable]=\"showPin()\"\n [attr.data-v4-item]=\"row.key\">\n <button\n type=\"button\"\n data-v4-row=\"shortcut\"\n class=\"sd-sidebar-v4-menu-tree__row sd-sidebar-v4-menu-tree__row--shortcut\"\n [attr.data-menu-key]=\"row.key\"\n [attr.aria-current]=\"row.isActive ? 'page' : null\"\n [attr.aria-disabled]=\"row.disabled || null\"\n [class.sd-sidebar-v4-menu-tree__row--active]=\"row.isActive\"\n [class.sd-sidebar-v4-menu-tree__row--disabled]=\"row.disabled\"\n (click)=\"onNavigate(row.menu)\">\n <span class=\"sd-sidebar-v4-menu-tree__label\">\n {{ row.title }}\n @if (row.path) {\n <span data-v4-shortcut-path class=\"sd-sidebar-v4-menu-tree__shortcut-path\"> \u00B7 {{ row.path }}</span>\n }\n </span>\n @if (row.disabled) {\n <ng-container [ngTemplateOutlet]=\"trailingTemplate\" [ngTemplateOutletContext]=\"{ $implicit: { kind: 'soon' } }\" />\n }\n </button>\n @if (showPin()) {\n <ng-container\n [ngTemplateOutlet]=\"pinTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: row.menu, key: row.key, pinned: row.isPinned, label: row.pinLabel }\" />\n }\n </div>\n }\n} @else if (isRail()) {\n @let _flyoutKey = flyoutKey();\n @let _flyoutMode = collapsedGroup() === 'flyout';\n <div data-v4-rail class=\"sd-sidebar-v4-menu-tree__rail\">\n @for (group of railGroups(); track group.key; let first = $first) {\n @if (!first) {\n <div data-v4-rail-separator class=\"sd-sidebar-v4-menu-tree__rail-separator\" aria-hidden=\"true\"></div>\n }\n @for (item of group.items; track item.key) {\n <div class=\"sd-sidebar-v4-menu-tree__rail-cell\" [attr.data-v4-rail-cell]=\"item.key\">\n @if (item.isGroup) {\n <button\n #railGroupButton\n cdkOverlayOrigin\n #flyoutOrigin=\"cdkOverlayOrigin\"\n type=\"button\"\n class=\"sd-sidebar-v4-menu-tree__rail-item\"\n [attr.data-v4-rail-item]=\"item.key\"\n [attr.title]=\"item.title\"\n [attr.aria-label]=\"item.title\"\n [attr.aria-describedby]=\"item.description ? item.descriptionId : null\"\n [attr.aria-haspopup]=\"_flyoutMode && !item.disabled ? 'dialog' : null\"\n [attr.aria-expanded]=\"_flyoutMode && !item.disabled ? _flyoutKey === item.key : null\"\n [attr.aria-disabled]=\"item.disabled || null\"\n [class.sd-sidebar-v4-menu-tree__rail-item--active]=\"item.isActive\"\n [class.sd-sidebar-v4-menu-tree__rail-item--open]=\"_flyoutKey === item.key\"\n [class.sd-sidebar-v4-menu-tree__rail-item--disabled]=\"item.disabled\"\n (click)=\"onRailGroup(item, railGroupButton)\">\n <ng-container [ngTemplateOutlet]=\"railContent\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n </button>\n <ng-template\n cdkConnectedOverlay\n #flyoutOverlay=\"cdkConnectedOverlay\"\n [cdkConnectedOverlayOrigin]=\"flyoutOrigin\"\n [cdkConnectedOverlayOpen]=\"_flyoutKey === item.key\"\n [cdkConnectedOverlayPositions]=\"flyoutPositions\"\n [cdkConnectedOverlayViewportMargin]=\"8\"\n [cdkConnectedOverlayFlexibleDimensions]=\"false\"\n [cdkConnectedOverlayPush]=\"true\"\n [cdkConnectedOverlayHasBackdrop]=\"false\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n (overlayOutsideClick)=\"onFlyoutOutsideClick()\"\n (overlayKeydown)=\"onFlyoutKeydown($event)\"\n (attach)=\"onFlyoutAttach(flyoutOverlay)\"\n (detach)=\"onFlyoutDetach(item.key)\">\n <div\n data-v4-flyout\n class=\"sd-sidebar-v4-menu-tree__flyout\"\n role=\"dialog\"\n aria-modal=\"true\"\n tabindex=\"-1\"\n [attr.aria-label]=\"item.title\"\n [style.--sd-sidebar-v4-item-radius]=\"flyoutRadius()\"\n cdkTrapFocus>\n <div data-v4-flyout-title class=\"sd-sidebar-v4-menu-tree__flyout-title\">{{ item.title }}</div>\n @for (node of flyoutNodes(); track node.key) {\n @if (node.isGroup) {\n <div\n data-v4-flyout-heading\n class=\"sd-sidebar-v4-menu-tree__flyout-heading\"\n [class.sd-sidebar-v4-menu-tree__flyout-heading--disabled]=\"node.disabled\"\n [style.padding-left.px]=\"12 + node.depth * 16\">\n <span class=\"sd-sidebar-v4-menu-tree__label\">{{ node.title }}</span>\n <ng-container [ngTemplateOutlet]=\"trailingTemplate\" [ngTemplateOutletContext]=\"{ $implicit: node.trailing }\" />\n </div>\n } @else {\n <button\n type=\"button\"\n class=\"sd-sidebar-v4-menu-tree__row sd-sidebar-v4-menu-tree__row--flyout\"\n [attr.data-v4-flyout-item]=\"node.key\"\n [attr.aria-current]=\"node.isActive ? 'page' : null\"\n [attr.aria-disabled]=\"node.disabled || null\"\n [class.sd-sidebar-v4-menu-tree__row--active]=\"node.isActive\"\n [class.sd-sidebar-v4-menu-tree__row--disabled]=\"node.disabled\"\n [style.padding-left.px]=\"12 + node.depth * 16\"\n (click)=\"onFlyoutNavigate(node)\">\n <span class=\"sd-sidebar-v4-menu-tree__label\">{{ node.title }}</span>\n <ng-container [ngTemplateOutlet]=\"trailingTemplate\" [ngTemplateOutletContext]=\"{ $implicit: node.trailing }\" />\n </button>\n }\n }\n </div>\n </ng-template>\n } @else {\n <button\n type=\"button\"\n class=\"sd-sidebar-v4-menu-tree__rail-item\"\n [attr.data-v4-rail-item]=\"item.key\"\n [attr.title]=\"item.title\"\n [attr.aria-label]=\"item.title\"\n [attr.aria-describedby]=\"item.description ? item.descriptionId : null\"\n [attr.aria-current]=\"item.isActive ? 'page' : null\"\n [attr.aria-disabled]=\"item.disabled || null\"\n [class.sd-sidebar-v4-menu-tree__rail-item--active]=\"item.isActive\"\n [class.sd-sidebar-v4-menu-tree__rail-item--disabled]=\"item.disabled\"\n (click)=\"onNavigate(item.menu)\">\n <ng-container [ngTemplateOutlet]=\"railContent\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n </button>\n }\n @if (item.description) {\n <span hidden [id]=\"item.descriptionId\">{{ item.description }}</span>\n }\n </div>\n }\n }\n </div>\n} @else {\n @for (section of sections(); track section.key) {\n <div\n class=\"sd-sidebar-v4-menu-tree__section\"\n [attr.data-v4-section]=\"section.label ?? ''\"\n [attr.role]=\"section.label ? 'group' : null\"\n [attr.aria-labelledby]=\"section.label ? section.labelId : null\"\n [class.sd-sidebar-v4-menu-tree__section--separated]=\"section.separated\">\n @if (section.label) {\n <div data-v4-section-label class=\"sd-sidebar-v4-menu-tree__section-label\" [id]=\"section.labelId\">{{ section.label }}</div>\n }\n @for (node of section.nodes; track node.key) {\n <div\n class=\"sd-sidebar-v4-menu-tree__item\"\n [class.sd-sidebar-v4-menu-tree__item--nested]=\"node.depth > 0\"\n [class.sd-sidebar-v4-menu-tree__item--pinnable]=\"node.pinnable\"\n [attr.data-v4-item]=\"node.key\"\n [style.padding-left.px]=\"node.depth ? node.paddingLeft : null\">\n @for (offset of node.branchOffsets; track offset) {\n <span data-menu-branch class=\"sd-sidebar-v4-menu-tree__branch\" [style.left.px]=\"offset\" aria-hidden=\"true\"></span>\n }\n @if (node.isActive && node.depth > 0) {\n <span data-v4-marker class=\"sd-sidebar-v4-menu-tree__marker\" [style.left.px]=\"node.markerLeft\" aria-hidden=\"true\"></span>\n }\n @if (node.isGroup) {\n <button\n type=\"button\"\n data-v4-row=\"group\"\n class=\"sd-sidebar-v4-menu-tree__row sd-sidebar-v4-menu-tree__row--group\"\n [class.sd-sidebar-v4-menu-tree__row--child]=\"node.depth > 0\"\n [class.sd-sidebar-v4-menu-tree__row--disabled]=\"node.disabled\"\n [attr.data-menu-group]=\"node.key\"\n [attr.aria-expanded]=\"node.disabled ? null : node.isExpanded\"\n [attr.aria-disabled]=\"node.disabled || null\"\n (click)=\"onToggleGroup(node)\">\n @if (node.depth === 0) {\n <ng-container\n [ngTemplateOutlet]=\"menuIcon\"\n [ngTemplateOutletContext]=\"{ $implicit: node.menu, filled: false, group: true }\" />\n }\n <span class=\"sd-sidebar-v4-menu-tree__label\">{{ node.title }}</span>\n <ng-container [ngTemplateOutlet]=\"trailingTemplate\" [ngTemplateOutletContext]=\"{ $implicit: node.trailing }\" />\n @if (node.showActiveDot) {\n <span data-v4-active-dot class=\"sd-sidebar-v4-menu-tree__dot\" aria-hidden=\"true\"></span>\n }\n @if (!node.disabled) {\n <sd-icon\n data-v4-chevron\n class=\"sd-sidebar-v4-menu-tree__chevron\"\n [name]=\"node.isExpanded ? 'expand_less' : 'expand_more'\"\n size=\"20px\"></sd-icon>\n }\n </button>\n } @else {\n <button\n type=\"button\"\n class=\"sd-sidebar-v4-menu-tree__row\"\n [class.sd-sidebar-v4-menu-tree__row--child]=\"node.depth > 0\"\n [class.sd-sidebar-v4-menu-tree__row--active]=\"node.isActive\"\n [class.sd-sidebar-v4-menu-tree__row--disabled]=\"node.disabled\"\n [attr.data-v4-row]=\"node.depth ? 'child' : 'root'\"\n [attr.data-menu-key]=\"node.key\"\n [attr.aria-current]=\"node.isActive ? 'page' : null\"\n [attr.aria-disabled]=\"node.disabled || null\"\n (click)=\"onNavigate(node.menu)\">\n @if (node.depth === 0) {\n <ng-container\n [ngTemplateOutlet]=\"menuIcon\"\n [ngTemplateOutletContext]=\"{ $implicit: node.menu, filled: node.isActive, group: false }\" />\n }\n <span class=\"sd-sidebar-v4-menu-tree__label\">{{ node.title }}</span>\n <ng-container [ngTemplateOutlet]=\"trailingTemplate\" [ngTemplateOutletContext]=\"{ $implicit: node.trailing }\" />\n </button>\n @if (node.pinnable) {\n <ng-container\n [ngTemplateOutlet]=\"pinTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: node.menu, key: node.key, pinned: node.isPinned, label: node.pinLabel }\" />\n }\n }\n </div>\n }\n </div>\n }\n}\n\n<ng-template #menuIcon let-menu let-filled=\"filled\" let-group=\"group\">\n @if (menu.iconUrl) {\n <img data-menu-icon class=\"sd-sidebar-v4-menu-tree__icon-image\" [src]=\"menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon\n data-menu-icon\n class=\"sd-sidebar-v4-menu-tree__icon\"\n [name]=\"menu.icon || (group ? 'folder' : 'chevron_right')\"\n [fontSet]=\"filled ? 'material-icons' : 'material-icons-outlined'\"\n size=\"20px\"></sd-icon>\n }\n</ng-template>\n\n<ng-template #railContent let-item>\n <ng-container\n [ngTemplateOutlet]=\"menuIcon\"\n [ngTemplateOutletContext]=\"{ $implicit: item.menu, filled: item.isActive, group: item.isGroup }\" />\n @if (item.badge) {\n <span\n data-v4-rail-badge\n class=\"sd-sidebar-v4-menu-tree__rail-badge\"\n [class.sd-sidebar-v4-menu-tree__badge--warning]=\"item.badge.tone === 'warning'\"\n [class.sd-sidebar-v4-menu-tree__badge--error]=\"item.badge.tone === 'error'\"\n aria-hidden=\"true\">\n {{ item.badge.value }}\n </span>\n } @else if (item.liveTone) {\n <span data-v4-rail-live class=\"sd-sidebar-v4-menu-tree__rail-live\" [attr.data-tone]=\"item.liveTone\" aria-hidden=\"true\"></span>\n }\n</ng-template>\n\n<ng-template #trailingTemplate let-trailing>\n @switch (trailing?.kind) {\n @case ('soon') {\n <span data-v4-trailing=\"soon\" class=\"sd-sidebar-v4-menu-tree__trailing sd-sidebar-v4-menu-tree__chip\">\n {{ 'core.module.layout.sidebar.coming-soon' | sdTranslate }}\n </span>\n }\n @case ('count') {\n <span data-v4-trailing=\"count\" class=\"sd-sidebar-v4-menu-tree__trailing sd-sidebar-v4-menu-tree__count\">{{ trailing.value }}</span>\n }\n @case ('badge') {\n <span\n data-v4-trailing=\"badge\"\n class=\"sd-sidebar-v4-menu-tree__trailing sd-sidebar-v4-menu-tree__badge\"\n [class.sd-sidebar-v4-menu-tree__badge--warning]=\"trailing.tone === 'warning'\"\n [class.sd-sidebar-v4-menu-tree__badge--error]=\"trailing.tone === 'error'\"\n role=\"img\"\n [attr.aria-label]=\"'core.module.layout.sidebar.badge-pending' | sdTranslate: { count: trailing.value }\">\n {{ trailing.value }}\n </span>\n }\n @case ('status') {\n <span\n data-v4-trailing=\"status\"\n class=\"sd-sidebar-v4-menu-tree__trailing sd-sidebar-v4-menu-tree__status\"\n [attr.data-tone]=\"trailing.tone\">\n <span\n data-v4-status-dot\n class=\"sd-sidebar-v4-menu-tree__status-dot\"\n [class.sd-sidebar-v4-menu-tree__status-dot--live]=\"trailing.live\"\n aria-hidden=\"true\"></span>\n {{ trailing.label }}\n </span>\n }\n }\n</ng-template>\n\n<ng-template #pinTemplate let-menu let-key=\"key\" let-pinned=\"pinned\" let-label=\"label\">\n <button\n type=\"button\"\n class=\"sd-sidebar-v4-menu-tree__pin\"\n [attr.data-pin-key]=\"key\"\n [attr.aria-label]=\"label\"\n [attr.aria-pressed]=\"pinned\"\n (click)=\"onTogglePinned($event, menu)\">\n <sd-icon name=\"push_pin\" [fontSet]=\"pinned ? 'material-icons' : 'material-icons-outlined'\" size=\"18px\"></sd-icon>\n </button>\n</ng-template>\n", styles: [":host{--tree-hover-bg: var(--sd-sidebar-v4-hover-bg, color-mix(in srgb, var(--sd-text) 6%, transparent));--tree-active-bg: var(--sd-sidebar-v4-active-bg, var(--sd-primary-light));--tree-active-ink: var(--sd-sidebar-v4-active-ink, var(--sd-primary));--tree-active-shadow: var(--sd-sidebar-v4-active-shadow, none);--tree-bg: var(--sd-sidebar-v4-bg, color-mix(in srgb, var(--sd-text) 4%, var(--sd-surface)));--tree-line: var(--sd-sidebar-v4-line, color-mix(in srgb, var(--sd-border) 45%, var(--sd-surface)));--tree-branch: color-mix(in srgb, var(--sd-border) 60%, var(--sd-surface));--tree-attention: var(--sd-sidebar-v4-attention, var(--sd-warning));--tree-live: var(--sd-sidebar-v4-live, var(--sd-success));--tree-muted-ink: var(--sd-text-secondary);--tree-disabled-ink: var(--sd-disabled-text, color-mix(in srgb, var(--sd-text) 60%, transparent));--tree-focus-ring: inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary));--tree-radius: var(--sd-sidebar-v4-item-radius, var(--sd-radius-999, 999px));--tree-row-height: var(--sd-sidebar-v4-item-height, 36px);--tree-child-height: var(--sd-sidebar-v4-child-height, 32px);display:block;min-width:0;color:var(--sd-text)}:host(.sd-sidebar-v4-menu-tree--mobile){--tree-row-height: var(--sd-sidebar-v4-item-height, 44px);--tree-child-height: var(--sd-sidebar-v4-child-height, 44px)}:host(.sd-sidebar-v4-menu-tree--mobile) .sd-sidebar-v4-menu-tree__pin{position:static;flex:0 0 44px;align-self:center;width:44px;height:44px;transform:none;opacity:1;pointer-events:auto}:host(.sd-sidebar-v4-menu-tree--mobile) .sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row,:host(.sd-sidebar-v4-menu-tree--mobile) .sd-sidebar-v4-menu-tree__item--pinnable:has(>.sd-sidebar-v4-menu-tree__pin:focus-visible)>.sd-sidebar-v4-menu-tree__row,:host(.sd-sidebar-v4-menu-tree--mobile) .sd-sidebar-v4-menu-tree__item--shortcut.sd-sidebar-v4-menu-tree__item--pinnable>.sd-sidebar-v4-menu-tree__row,:host(.sd-sidebar-v4-menu-tree--mobile) .sd-sidebar-v4-menu-tree__item--shortcut.sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row{padding-right:var(--sd-space-12, 12px)}:host(.sd-sidebar-v4-menu-tree--mobile) .sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row .sd-sidebar-v4-menu-tree__trailing,:host(.sd-sidebar-v4-menu-tree--mobile) .sd-sidebar-v4-menu-tree__item--pinnable:has(>.sd-sidebar-v4-menu-tree__pin:focus-visible)>.sd-sidebar-v4-menu-tree__row .sd-sidebar-v4-menu-tree__trailing{visibility:visible}.sd-sidebar-v4-menu-tree__sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.sd-sidebar-v4-menu-tree__section--separated{margin-top:var(--sd-space-16, 16px)}.sd-sidebar-v4-menu-tree__section-label{padding:14px 12px 4px;color:var(--tree-muted-ink);font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-16, 16px);letter-spacing:.3px}.sd-sidebar-v4-menu-tree__item{position:relative;display:flex;align-items:stretch;min-width:0}.sd-sidebar-v4-menu-tree__row{display:flex;flex:1 1 auto;align-items:center;gap:var(--sd-space-12, 12px);box-sizing:border-box;width:100%;min-width:0;min-height:var(--tree-row-height, 36px);margin:0;padding:0 var(--sd-space-12, 12px);border:0;border-radius:var(--tree-radius, 999px);background:transparent;color:var(--sd-text);font:inherit;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-20, 20px);text-align:left;cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}.sd-sidebar-v4-menu-tree__row:hover{background:var(--tree-hover-bg)}.sd-sidebar-v4-menu-tree__row--group{padding:0 var(--sd-space-8, 8px) 0 var(--sd-space-12, 12px)}.sd-sidebar-v4-menu-tree__row--child{gap:var(--sd-space-8, 8px);min-height:var(--tree-child-height, 32px)}.sd-sidebar-v4-menu-tree__row--active,.sd-sidebar-v4-menu-tree__row--active:hover{background:var(--tree-active-bg);box-shadow:var(--tree-active-shadow);color:var(--tree-active-ink);font-weight:var(--sd-font-weight-medium, 500)}.sd-sidebar-v4-menu-tree__row--disabled,.sd-sidebar-v4-menu-tree__row--disabled:hover{background:transparent;color:var(--tree-disabled-ink);cursor:not-allowed}.sd-sidebar-v4-menu-tree__row:focus-visible{outline:none;box-shadow:var(--tree-focus-ring)}.sd-sidebar-v4-menu-tree__label{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sd-sidebar-v4-menu-tree__icon,.sd-sidebar-v4-menu-tree__icon-image{flex:0 0 20px;width:20px;height:20px;color:var(--tree-muted-ink)}.sd-sidebar-v4-menu-tree__icon-image{object-fit:contain}.sd-sidebar-v4-menu-tree__row--active .sd-sidebar-v4-menu-tree__icon,.sd-sidebar-v4-menu-tree__rail-item--active .sd-sidebar-v4-menu-tree__icon,.sd-sidebar-v4-menu-tree__row--disabled .sd-sidebar-v4-menu-tree__icon,.sd-sidebar-v4-menu-tree__rail-item--disabled .sd-sidebar-v4-menu-tree__icon{color:inherit}.sd-sidebar-v4-menu-tree__row--disabled .sd-sidebar-v4-menu-tree__icon-image,.sd-sidebar-v4-menu-tree__rail-item--disabled .sd-sidebar-v4-menu-tree__icon-image{opacity:.6}.sd-sidebar-v4-menu-tree__chevron{flex:0 0 20px;color:var(--tree-muted-ink)}.sd-sidebar-v4-menu-tree__dot{flex:none;width:6px;height:6px;border-radius:3px;background:var(--sd-primary)}.sd-sidebar-v4-menu-tree__item--nested{min-height:var(--tree-child-height, 32px);animation:sd-sidebar-v4-expand-in .16s ease-out}@keyframes sd-sidebar-v4-expand-in{0%{opacity:0}}.sd-sidebar-v4-menu-tree__branch{position:absolute;top:0;bottom:0;width:1px;background:var(--tree-branch);pointer-events:none}.sd-sidebar-v4-menu-tree__marker{position:absolute;z-index:1;top:7px;bottom:7px;width:3px;border-radius:var(--sd-radius-2, 2px);background:var(--sd-primary);pointer-events:none}.sd-sidebar-v4-menu-tree__trailing{flex:none}.sd-sidebar-v4-menu-tree__count{color:var(--tree-muted-ink);font-size:var(--sd-font-size-12, 12px);font-weight:var(--sd-font-weight-regular, 400);line-height:var(--sd-line-height-16, 16px)}.sd-sidebar-v4-menu-tree__row--active .sd-sidebar-v4-menu-tree__count{color:inherit}.sd-sidebar-v4-menu-tree__badge,.sd-sidebar-v4-menu-tree__rail-badge{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;font-weight:var(--sd-font-weight-medium, 500);line-height:1}.sd-sidebar-v4-menu-tree__badge{min-width:20px;height:20px;padding:0 6px;border-radius:var(--sd-radius-10, 10px);font-size:11.5px}.sd-sidebar-v4-menu-tree__badge--warning{background:var(--tree-attention);color:var(--sd-warning-contrast)}.sd-sidebar-v4-menu-tree__badge--error{background:var(--sd-error);color:var(--sd-error-contrast)}.sd-sidebar-v4-menu-tree__status,.sd-sidebar-v4-menu-tree__rail-live{--tree-tone: var(--tree-live)}.sd-sidebar-v4-menu-tree__status[data-tone=warning],.sd-sidebar-v4-menu-tree__rail-live[data-tone=warning]{--tree-tone: var(--sd-warning)}.sd-sidebar-v4-menu-tree__status[data-tone=error],.sd-sidebar-v4-menu-tree__rail-live[data-tone=error]{--tree-tone: var(--sd-error)}.sd-sidebar-v4-menu-tree__status{display:inline-flex;align-items:center;gap:6px;color:var(--tree-tone);font-size:var(--sd-font-size-12, 12px);font-weight:var(--sd-font-weight-regular, 400);line-height:var(--sd-line-height-16, 16px)}.sd-sidebar-v4-menu-tree__status-dot{flex:none;width:6px;height:6px;border-radius:3px;background:var(--tree-tone)}.sd-sidebar-v4-menu-tree__status-dot--live{box-shadow:0 0 0 3px color-mix(in srgb,var(--tree-tone) 18%,transparent)}.sd-sidebar-v4-menu-tree__chip{padding:0 7px;border:1px solid var(--sd-border);border-radius:var(--sd-radius-999, 999px);color:var(--tree-muted-ink);font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-18, 18px)}.sd-sidebar-v4-menu-tree__pin{position:absolute;top:50%;right:2px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;margin:0;padding:0;border:0;border-radius:var(--tree-radius, 999px);background:transparent;color:var(--tree-muted-ink);cursor:pointer;opacity:0;pointer-events:none;transform:translateY(-50%);transition:opacity var(--sd-duration-fast, .12s) ease,background-color var(--sd-duration-fast, .12s) ease}.sd-sidebar-v4-menu-tree__pin:hover{background:var(--tree-hover-bg)}.sd-sidebar-v4-menu-tree__pin:focus-visible{outline:none;box-shadow:var(--tree-focus-ring)}.sd-sidebar-v4-menu-tree__item:hover>.sd-sidebar-v4-menu-tree__pin,.sd-sidebar-v4-menu-tree__pin:focus-visible,.sd-sidebar-v4-menu-tree__item--shortcut>.sd-sidebar-v4-menu-tree__pin{opacity:1;pointer-events:auto}.sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row,.sd-sidebar-v4-menu-tree__item--pinnable:has(>.sd-sidebar-v4-menu-tree__pin:focus-visible)>.sd-sidebar-v4-menu-tree__row{padding-right:40px}.sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row .sd-sidebar-v4-menu-tree__trailing,.sd-sidebar-v4-menu-tree__item--pinnable:has(>.sd-sidebar-v4-menu-tree__pin:focus-visible)>.sd-sidebar-v4-menu-tree__row .sd-sidebar-v4-menu-tree__trailing{visibility:hidden}.sd-sidebar-v4-menu-tree__row--shortcut{gap:var(--sd-space-8, 8px)}.sd-sidebar-v4-menu-tree__item--shortcut.sd-sidebar-v4-menu-tree__item--pinnable>.sd-sidebar-v4-menu-tree__row,.sd-sidebar-v4-menu-tree__item--shortcut.sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row{padding-right:40px}.sd-sidebar-v4-menu-tree__shortcut-path{color:var(--tree-muted-ink);font-size:var(--sd-font-size-12, 12px);font-weight:var(--sd-font-weight-regular, 400)}.sd-sidebar-v4-menu-tree__results{display:flex;flex-direction:column}.sd-sidebar-v4-menu-tree__result{display:flex;flex-direction:column;justify-content:center;box-sizing:border-box;min-height:var(--tree-row-height, 36px);padding:6px var(--sd-space-12, 12px);border-radius:var(--sd-radius-16, 16px);cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease}.sd-sidebar-v4-menu-tree__result:hover{background:var(--tree-hover-bg)}.sd-sidebar-v4-menu-tree__result--focused,.sd-sidebar-v4-menu-tree__result--focused:hover{background:var(--sd-surface);box-shadow:inset 0 0 0 2px var(--sd-primary)}.sd-sidebar-v4-menu-tree__result-title{color:var(--sd-text);font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px);overflow-wrap:anywhere}.sd-sidebar-v4-menu-tree__match{border-radius:3px;background:var(--sd-primary-light);color:var(--sd-primary-dark);font-weight:var(--sd-font-weight-medium, 500)}.sd-sidebar-v4-menu-tree__result-path{margin-top:1px;color:var(--tree-muted-ink);font-size:11.5px;line-height:var(--sd-line-height-16, 16px);overflow-wrap:anywhere}.sd-sidebar-v4-menu-tree__empty{padding:var(--sd-space-16, 16px) var(--sd-space-12, 12px);color:var(--tree-muted-ink);font-size:var(--sd-font-size-13, 13px);overflow-wrap:anywhere}.sd-sidebar-v4-menu-tree__hint{padding:var(--sd-space-12, 12px) var(--sd-space-12, 12px) 0;color:var(--tree-muted-ink);font-size:11.5px;line-height:var(--sd-line-height-16, 16px)}.sd-sidebar-v4-menu-tree__rail{display:flex;flex-direction:column;align-items:center;gap:var(--sd-space-4, 4px)}.sd-sidebar-v4-menu-tree__rail-cell{position:relative;display:flex}.sd-sidebar-v4-menu-tree__rail-item{position:relative;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:48px;height:36px;margin:0;padding:0;border:0;border-radius:var(--tree-radius, 999px);background:transparent;color:var(--tree-muted-ink);cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}.sd-sidebar-v4-menu-tree__rail-item:hover,.sd-sidebar-v4-menu-tree__rail-item.sd-sidebar-v4-menu-tree__rail-item--open{background:var(--tree-hover-bg)}.sd-sidebar-v4-menu-tree__rail-item--active,.sd-sidebar-v4-menu-tree__rail-item--active:hover{background:var(--tree-active-bg);box-shadow:var(--tree-active-shadow);color:var(--tree-active-ink)}.sd-sidebar-v4-menu-tree__rail-item--disabled,.sd-sidebar-v4-menu-tree__rail-item--disabled:hover{background:transparent;color:var(--tree-disabled-ink);cursor:not-allowed}.sd-sidebar-v4-menu-tree__rail-item:focus-visible{outline:none;box-shadow:var(--tree-focus-ring)}.sd-sidebar-v4-menu-tree__rail-separator{flex:none;width:32px;height:1px;margin:5px 0;background:var(--tree-line)}.sd-sidebar-v4-menu-tree__rail-badge{position:absolute;top:0;right:2px;min-width:16px;height:16px;padding:0 4px;border-radius:var(--sd-radius-8, 8px);font-size:var(--sd-font-size-10, 10px);box-shadow:0 0 0 2px var(--tree-bg);pointer-events:none}.sd-sidebar-v4-menu-tree__rail-live{position:absolute;top:5px;right:9px;width:8px;height:8px;border-radius:var(--sd-radius-4, 4px);background:var(--tree-tone);box-shadow:0 0 0 2px var(--tree-bg);pointer-events:none}.sd-sidebar-v4-menu-tree__flyout{--tree-hover-bg: var(--sd-sidebar-v4-hover-bg, color-mix(in srgb, var(--sd-text) 6%, transparent));--tree-active-bg: var(--sd-sidebar-v4-active-bg, var(--sd-primary-light));--tree-active-ink: var(--sd-sidebar-v4-active-ink, var(--sd-primary));--tree-active-shadow: var(--sd-sidebar-v4-active-shadow, none);--tree-bg: var(--sd-sidebar-v4-bg, color-mix(in srgb, var(--sd-text) 4%, var(--sd-surface)));--tree-line: var(--sd-sidebar-v4-line, color-mix(in srgb, var(--sd-border) 45%, var(--sd-surface)));--tree-branch: color-mix(in srgb, var(--sd-border) 60%, var(--sd-surface));--tree-attention: var(--sd-sidebar-v4-attention, var(--sd-warning));--tree-live: var(--sd-sidebar-v4-live, var(--sd-success));--tree-muted-ink: var(--sd-text-secondary);--tree-disabled-ink: var(--sd-disabled-text, color-mix(in srgb, var(--sd-text) 60%, transparent));--tree-focus-ring: inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary));--tree-radius: var(--sd-sidebar-v4-item-radius, var(--sd-radius-999, 999px));--tree-row-height: var(--sd-sidebar-v4-item-height, 36px);--tree-child-height: var(--sd-sidebar-v4-child-height, 32px);box-sizing:border-box;width:232px;padding:var(--sd-space-8, 8px);border:1px solid var(--tree-line);border-radius:var(--sd-radius-16, 16px);background:var(--sd-surface);color:var(--sd-text);box-shadow:0 6px 24px color-mix(in srgb,var(--sd-text) 14%,transparent);animation:sd-sidebar-v4-flyout-in .14s ease-out}.sd-sidebar-v4-menu-tree__flyout:focus{outline:none}.sd-sidebar-v4-menu-tree__flyout-title{padding:6px var(--sd-space-12, 12px);font-size:var(--sd-font-size-13, 13px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-20, 20px)}.sd-sidebar-v4-menu-tree__flyout-heading{display:flex;align-items:center;gap:var(--sd-space-8, 8px);padding:6px var(--sd-space-12, 12px) 2px;color:var(--tree-muted-ink);font-size:var(--sd-font-size-12, 12px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-16, 16px)}.sd-sidebar-v4-menu-tree__flyout-heading--disabled{color:var(--tree-disabled-ink)}.sd-sidebar-v4-menu-tree__row--flyout{gap:var(--sd-space-8, 8px);height:32px;min-height:32px}@keyframes sd-sidebar-v4-flyout-in{0%{opacity:0;transform:translate(-4px)}}@media(pointer:coarse){.sd-sidebar-v4-menu-tree__row{min-height:max(44px,var(--tree-row-height, 36px))}.sd-sidebar-v4-menu-tree__row--child{min-height:max(44px,var(--tree-child-height, 32px))}.sd-sidebar-v4-menu-tree__result{min-height:max(44px,var(--tree-row-height, 36px))}.sd-sidebar-v4-menu-tree__row--flyout{height:auto;min-height:44px}.sd-sidebar-v4-menu-tree__rail-item{height:44px}.sd-sidebar-v4-menu-tree__pin{position:static;flex:0 0 44px;align-self:center;width:44px;height:44px;transform:none;opacity:1;pointer-events:auto}.sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row,.sd-sidebar-v4-menu-tree__item--pinnable:has(>.sd-sidebar-v4-menu-tree__pin:focus-visible)>.sd-sidebar-v4-menu-tree__row,.sd-sidebar-v4-menu-tree__item--shortcut.sd-sidebar-v4-menu-tree__item--pinnable>.sd-sidebar-v4-menu-tree__row,.sd-sidebar-v4-menu-tree__item--shortcut.sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row{padding-right:var(--sd-space-12, 12px)}.sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row .sd-sidebar-v4-menu-tree__trailing,.sd-sidebar-v4-menu-tree__item--pinnable:has(>.sd-sidebar-v4-menu-tree__pin:focus-visible)>.sd-sidebar-v4-menu-tree__row .sd-sidebar-v4-menu-tree__trailing{visibility:visible}}@media(prefers-reduced-motion:reduce){.sd-sidebar-v4-menu-tree__row,.sd-sidebar-v4-menu-tree__pin,.sd-sidebar-v4-menu-tree__result,.sd-sidebar-v4-menu-tree__rail-item{transition:none}.sd-sidebar-v4-menu-tree__flyout,.sd-sidebar-v4-menu-tree__item--nested{animation:none}}\n"], dependencies: [{ kind: "directive", type: CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
3855
+ }
3856
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdSidebarV4MenuTree, decorators: [{
3857
+ type: Component,
3858
+ args: [{ selector: 'sd-sidebar-v4-menu-tree', standalone: true, imports: [CdkConnectedOverlay, CdkOverlayOrigin, CdkTrapFocus, NgTemplateOutlet, SdIcon, SdTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, host: {
3859
+ class: 'sd-sidebar-v4-menu-tree',
3860
+ '[class.sd-sidebar-v4-menu-tree--mobile]': 'mode() === "mobile"',
3861
+ '[class.sd-sidebar-v4-menu-tree--collapsed]': 'isRail()',
3862
+ }, template: "@let _presentation = presentation();\n<div data-v4-live class=\"sd-sidebar-v4-menu-tree__sr-only\" aria-live=\"polite\" aria-atomic=\"true\">{{ liveMessage() }}</div>\n@if (_presentation === 'results') {\n @let _query = query().trim();\n @if (_query) {\n @let _rows = resultRows();\n @let _focused = focusedIndex();\n <div data-v4-result-count class=\"sd-sidebar-v4-menu-tree__section-label\" [id]=\"resultCountId\">\n {{ 'core.module.layout.sidebar.result-count' | sdTranslate: { count: _rows.length } }}\n </div>\n @if (_rows.length) {\n <div data-v4-results class=\"sd-sidebar-v4-menu-tree__results\" role=\"listbox\" [id]=\"resultsId\" [attr.aria-labelledby]=\"resultCountId\">\n @for (row of _rows; track $index; let index = $index) {\n <!-- Options stay unfocusable: the parent's search input drives them via aria-activedescendant (Up/Down/Enter); click is the pointer path. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div\n data-v4-result\n class=\"sd-sidebar-v4-menu-tree__result\"\n role=\"option\"\n [id]=\"resultOptionId(index)\"\n [attr.data-menu-key]=\"row.key\"\n [attr.aria-selected]=\"index === _focused\"\n [class.sd-sidebar-v4-menu-tree__result--focused]=\"index === _focused\"\n (click)=\"onNavigate(row.menu)\">\n <span class=\"sd-sidebar-v4-menu-tree__result-title\">\n @for (segment of row.segments; track $index) {\n <span [class.sd-sidebar-v4-menu-tree__match]=\"segment.match\" [attr.data-v4-match]=\"segment.match ? '' : null\">{{\n segment.text\n }}</span>\n }\n </span>\n @if (row.path) {\n <span data-v4-result-path class=\"sd-sidebar-v4-menu-tree__result-path\">{{ row.path }}</span>\n }\n </div>\n }\n </div>\n } @else {\n <div data-v4-empty class=\"sd-sidebar-v4-menu-tree__empty\">\n {{ 'core.module.layout.sidebar.no-match' | sdTranslate: { query: _query } }}\n </div>\n }\n <div data-v4-search-hint class=\"sd-sidebar-v4-menu-tree__hint\">{{ 'core.module.layout.sidebar.search-hint' | sdTranslate }}</div>\n }\n} @else if (_presentation === 'shortcuts') {\n @for (row of shortcuts(); track row.key) {\n <div\n class=\"sd-sidebar-v4-menu-tree__item sd-sidebar-v4-menu-tree__item--shortcut\"\n [class.sd-sidebar-v4-menu-tree__item--pinnable]=\"showPin()\"\n [attr.data-v4-item]=\"row.key\">\n <button\n type=\"button\"\n data-v4-row=\"shortcut\"\n class=\"sd-sidebar-v4-menu-tree__row sd-sidebar-v4-menu-tree__row--shortcut\"\n [attr.data-menu-key]=\"row.key\"\n [attr.aria-current]=\"row.isActive ? 'page' : null\"\n [attr.aria-disabled]=\"row.disabled || null\"\n [class.sd-sidebar-v4-menu-tree__row--active]=\"row.isActive\"\n [class.sd-sidebar-v4-menu-tree__row--disabled]=\"row.disabled\"\n (click)=\"onNavigate(row.menu)\">\n <span class=\"sd-sidebar-v4-menu-tree__label\">\n {{ row.title }}\n @if (row.path) {\n <span data-v4-shortcut-path class=\"sd-sidebar-v4-menu-tree__shortcut-path\"> \u00B7 {{ row.path }}</span>\n }\n </span>\n @if (row.disabled) {\n <ng-container [ngTemplateOutlet]=\"trailingTemplate\" [ngTemplateOutletContext]=\"{ $implicit: { kind: 'soon' } }\" />\n }\n </button>\n @if (showPin()) {\n <ng-container\n [ngTemplateOutlet]=\"pinTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: row.menu, key: row.key, pinned: row.isPinned, label: row.pinLabel }\" />\n }\n </div>\n }\n} @else if (isRail()) {\n @let _flyoutKey = flyoutKey();\n @let _flyoutMode = collapsedGroup() === 'flyout';\n <div data-v4-rail class=\"sd-sidebar-v4-menu-tree__rail\">\n @for (group of railGroups(); track group.key; let first = $first) {\n @if (!first) {\n <div data-v4-rail-separator class=\"sd-sidebar-v4-menu-tree__rail-separator\" aria-hidden=\"true\"></div>\n }\n @for (item of group.items; track item.key) {\n <div class=\"sd-sidebar-v4-menu-tree__rail-cell\" [attr.data-v4-rail-cell]=\"item.key\">\n @if (item.isGroup) {\n <button\n #railGroupButton\n cdkOverlayOrigin\n #flyoutOrigin=\"cdkOverlayOrigin\"\n type=\"button\"\n class=\"sd-sidebar-v4-menu-tree__rail-item\"\n [attr.data-v4-rail-item]=\"item.key\"\n [attr.title]=\"item.title\"\n [attr.aria-label]=\"item.title\"\n [attr.aria-describedby]=\"item.description ? item.descriptionId : null\"\n [attr.aria-haspopup]=\"_flyoutMode && !item.disabled ? 'dialog' : null\"\n [attr.aria-expanded]=\"_flyoutMode && !item.disabled ? _flyoutKey === item.key : null\"\n [attr.aria-disabled]=\"item.disabled || null\"\n [class.sd-sidebar-v4-menu-tree__rail-item--active]=\"item.isActive\"\n [class.sd-sidebar-v4-menu-tree__rail-item--open]=\"_flyoutKey === item.key\"\n [class.sd-sidebar-v4-menu-tree__rail-item--disabled]=\"item.disabled\"\n (click)=\"onRailGroup(item, railGroupButton)\">\n <ng-container [ngTemplateOutlet]=\"railContent\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n </button>\n <ng-template\n cdkConnectedOverlay\n #flyoutOverlay=\"cdkConnectedOverlay\"\n [cdkConnectedOverlayOrigin]=\"flyoutOrigin\"\n [cdkConnectedOverlayOpen]=\"_flyoutKey === item.key\"\n [cdkConnectedOverlayPositions]=\"flyoutPositions\"\n [cdkConnectedOverlayViewportMargin]=\"8\"\n [cdkConnectedOverlayFlexibleDimensions]=\"false\"\n [cdkConnectedOverlayPush]=\"true\"\n [cdkConnectedOverlayHasBackdrop]=\"false\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n (overlayOutsideClick)=\"onFlyoutOutsideClick()\"\n (overlayKeydown)=\"onFlyoutKeydown($event)\"\n (attach)=\"onFlyoutAttach(flyoutOverlay)\"\n (detach)=\"onFlyoutDetach(item.key)\">\n <div\n data-v4-flyout\n class=\"sd-sidebar-v4-menu-tree__flyout\"\n role=\"dialog\"\n aria-modal=\"true\"\n tabindex=\"-1\"\n [attr.aria-label]=\"item.title\"\n [style.--sd-sidebar-v4-item-radius]=\"flyoutRadius()\"\n cdkTrapFocus>\n <div data-v4-flyout-title class=\"sd-sidebar-v4-menu-tree__flyout-title\">{{ item.title }}</div>\n @for (node of flyoutNodes(); track node.key) {\n @if (node.isGroup) {\n <div\n data-v4-flyout-heading\n class=\"sd-sidebar-v4-menu-tree__flyout-heading\"\n [class.sd-sidebar-v4-menu-tree__flyout-heading--disabled]=\"node.disabled\"\n [style.padding-left.px]=\"12 + node.depth * 16\">\n <span class=\"sd-sidebar-v4-menu-tree__label\">{{ node.title }}</span>\n <ng-container [ngTemplateOutlet]=\"trailingTemplate\" [ngTemplateOutletContext]=\"{ $implicit: node.trailing }\" />\n </div>\n } @else {\n <button\n type=\"button\"\n class=\"sd-sidebar-v4-menu-tree__row sd-sidebar-v4-menu-tree__row--flyout\"\n [attr.data-v4-flyout-item]=\"node.key\"\n [attr.aria-current]=\"node.isActive ? 'page' : null\"\n [attr.aria-disabled]=\"node.disabled || null\"\n [class.sd-sidebar-v4-menu-tree__row--active]=\"node.isActive\"\n [class.sd-sidebar-v4-menu-tree__row--disabled]=\"node.disabled\"\n [style.padding-left.px]=\"12 + node.depth * 16\"\n (click)=\"onFlyoutNavigate(node)\">\n <span class=\"sd-sidebar-v4-menu-tree__label\">{{ node.title }}</span>\n <ng-container [ngTemplateOutlet]=\"trailingTemplate\" [ngTemplateOutletContext]=\"{ $implicit: node.trailing }\" />\n </button>\n }\n }\n </div>\n </ng-template>\n } @else {\n <button\n type=\"button\"\n class=\"sd-sidebar-v4-menu-tree__rail-item\"\n [attr.data-v4-rail-item]=\"item.key\"\n [attr.title]=\"item.title\"\n [attr.aria-label]=\"item.title\"\n [attr.aria-describedby]=\"item.description ? item.descriptionId : null\"\n [attr.aria-current]=\"item.isActive ? 'page' : null\"\n [attr.aria-disabled]=\"item.disabled || null\"\n [class.sd-sidebar-v4-menu-tree__rail-item--active]=\"item.isActive\"\n [class.sd-sidebar-v4-menu-tree__rail-item--disabled]=\"item.disabled\"\n (click)=\"onNavigate(item.menu)\">\n <ng-container [ngTemplateOutlet]=\"railContent\" [ngTemplateOutletContext]=\"{ $implicit: item }\" />\n </button>\n }\n @if (item.description) {\n <span hidden [id]=\"item.descriptionId\">{{ item.description }}</span>\n }\n </div>\n }\n }\n </div>\n} @else {\n @for (section of sections(); track section.key) {\n <div\n class=\"sd-sidebar-v4-menu-tree__section\"\n [attr.data-v4-section]=\"section.label ?? ''\"\n [attr.role]=\"section.label ? 'group' : null\"\n [attr.aria-labelledby]=\"section.label ? section.labelId : null\"\n [class.sd-sidebar-v4-menu-tree__section--separated]=\"section.separated\">\n @if (section.label) {\n <div data-v4-section-label class=\"sd-sidebar-v4-menu-tree__section-label\" [id]=\"section.labelId\">{{ section.label }}</div>\n }\n @for (node of section.nodes; track node.key) {\n <div\n class=\"sd-sidebar-v4-menu-tree__item\"\n [class.sd-sidebar-v4-menu-tree__item--nested]=\"node.depth > 0\"\n [class.sd-sidebar-v4-menu-tree__item--pinnable]=\"node.pinnable\"\n [attr.data-v4-item]=\"node.key\"\n [style.padding-left.px]=\"node.depth ? node.paddingLeft : null\">\n @for (offset of node.branchOffsets; track offset) {\n <span data-menu-branch class=\"sd-sidebar-v4-menu-tree__branch\" [style.left.px]=\"offset\" aria-hidden=\"true\"></span>\n }\n @if (node.isActive && node.depth > 0) {\n <span data-v4-marker class=\"sd-sidebar-v4-menu-tree__marker\" [style.left.px]=\"node.markerLeft\" aria-hidden=\"true\"></span>\n }\n @if (node.isGroup) {\n <button\n type=\"button\"\n data-v4-row=\"group\"\n class=\"sd-sidebar-v4-menu-tree__row sd-sidebar-v4-menu-tree__row--group\"\n [class.sd-sidebar-v4-menu-tree__row--child]=\"node.depth > 0\"\n [class.sd-sidebar-v4-menu-tree__row--disabled]=\"node.disabled\"\n [attr.data-menu-group]=\"node.key\"\n [attr.aria-expanded]=\"node.disabled ? null : node.isExpanded\"\n [attr.aria-disabled]=\"node.disabled || null\"\n (click)=\"onToggleGroup(node)\">\n @if (node.depth === 0) {\n <ng-container\n [ngTemplateOutlet]=\"menuIcon\"\n [ngTemplateOutletContext]=\"{ $implicit: node.menu, filled: false, group: true }\" />\n }\n <span class=\"sd-sidebar-v4-menu-tree__label\">{{ node.title }}</span>\n <ng-container [ngTemplateOutlet]=\"trailingTemplate\" [ngTemplateOutletContext]=\"{ $implicit: node.trailing }\" />\n @if (node.showActiveDot) {\n <span data-v4-active-dot class=\"sd-sidebar-v4-menu-tree__dot\" aria-hidden=\"true\"></span>\n }\n @if (!node.disabled) {\n <sd-icon\n data-v4-chevron\n class=\"sd-sidebar-v4-menu-tree__chevron\"\n [name]=\"node.isExpanded ? 'expand_less' : 'expand_more'\"\n size=\"20px\"></sd-icon>\n }\n </button>\n } @else {\n <button\n type=\"button\"\n class=\"sd-sidebar-v4-menu-tree__row\"\n [class.sd-sidebar-v4-menu-tree__row--child]=\"node.depth > 0\"\n [class.sd-sidebar-v4-menu-tree__row--active]=\"node.isActive\"\n [class.sd-sidebar-v4-menu-tree__row--disabled]=\"node.disabled\"\n [attr.data-v4-row]=\"node.depth ? 'child' : 'root'\"\n [attr.data-menu-key]=\"node.key\"\n [attr.aria-current]=\"node.isActive ? 'page' : null\"\n [attr.aria-disabled]=\"node.disabled || null\"\n (click)=\"onNavigate(node.menu)\">\n @if (node.depth === 0) {\n <ng-container\n [ngTemplateOutlet]=\"menuIcon\"\n [ngTemplateOutletContext]=\"{ $implicit: node.menu, filled: node.isActive, group: false }\" />\n }\n <span class=\"sd-sidebar-v4-menu-tree__label\">{{ node.title }}</span>\n <ng-container [ngTemplateOutlet]=\"trailingTemplate\" [ngTemplateOutletContext]=\"{ $implicit: node.trailing }\" />\n </button>\n @if (node.pinnable) {\n <ng-container\n [ngTemplateOutlet]=\"pinTemplate\"\n [ngTemplateOutletContext]=\"{ $implicit: node.menu, key: node.key, pinned: node.isPinned, label: node.pinLabel }\" />\n }\n }\n </div>\n }\n </div>\n }\n}\n\n<ng-template #menuIcon let-menu let-filled=\"filled\" let-group=\"group\">\n @if (menu.iconUrl) {\n <img data-menu-icon class=\"sd-sidebar-v4-menu-tree__icon-image\" [src]=\"menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon\n data-menu-icon\n class=\"sd-sidebar-v4-menu-tree__icon\"\n [name]=\"menu.icon || (group ? 'folder' : 'chevron_right')\"\n [fontSet]=\"filled ? 'material-icons' : 'material-icons-outlined'\"\n size=\"20px\"></sd-icon>\n }\n</ng-template>\n\n<ng-template #railContent let-item>\n <ng-container\n [ngTemplateOutlet]=\"menuIcon\"\n [ngTemplateOutletContext]=\"{ $implicit: item.menu, filled: item.isActive, group: item.isGroup }\" />\n @if (item.badge) {\n <span\n data-v4-rail-badge\n class=\"sd-sidebar-v4-menu-tree__rail-badge\"\n [class.sd-sidebar-v4-menu-tree__badge--warning]=\"item.badge.tone === 'warning'\"\n [class.sd-sidebar-v4-menu-tree__badge--error]=\"item.badge.tone === 'error'\"\n aria-hidden=\"true\">\n {{ item.badge.value }}\n </span>\n } @else if (item.liveTone) {\n <span data-v4-rail-live class=\"sd-sidebar-v4-menu-tree__rail-live\" [attr.data-tone]=\"item.liveTone\" aria-hidden=\"true\"></span>\n }\n</ng-template>\n\n<ng-template #trailingTemplate let-trailing>\n @switch (trailing?.kind) {\n @case ('soon') {\n <span data-v4-trailing=\"soon\" class=\"sd-sidebar-v4-menu-tree__trailing sd-sidebar-v4-menu-tree__chip\">\n {{ 'core.module.layout.sidebar.coming-soon' | sdTranslate }}\n </span>\n }\n @case ('count') {\n <span data-v4-trailing=\"count\" class=\"sd-sidebar-v4-menu-tree__trailing sd-sidebar-v4-menu-tree__count\">{{ trailing.value }}</span>\n }\n @case ('badge') {\n <span\n data-v4-trailing=\"badge\"\n class=\"sd-sidebar-v4-menu-tree__trailing sd-sidebar-v4-menu-tree__badge\"\n [class.sd-sidebar-v4-menu-tree__badge--warning]=\"trailing.tone === 'warning'\"\n [class.sd-sidebar-v4-menu-tree__badge--error]=\"trailing.tone === 'error'\"\n role=\"img\"\n [attr.aria-label]=\"'core.module.layout.sidebar.badge-pending' | sdTranslate: { count: trailing.value }\">\n {{ trailing.value }}\n </span>\n }\n @case ('status') {\n <span\n data-v4-trailing=\"status\"\n class=\"sd-sidebar-v4-menu-tree__trailing sd-sidebar-v4-menu-tree__status\"\n [attr.data-tone]=\"trailing.tone\">\n <span\n data-v4-status-dot\n class=\"sd-sidebar-v4-menu-tree__status-dot\"\n [class.sd-sidebar-v4-menu-tree__status-dot--live]=\"trailing.live\"\n aria-hidden=\"true\"></span>\n {{ trailing.label }}\n </span>\n }\n }\n</ng-template>\n\n<ng-template #pinTemplate let-menu let-key=\"key\" let-pinned=\"pinned\" let-label=\"label\">\n <button\n type=\"button\"\n class=\"sd-sidebar-v4-menu-tree__pin\"\n [attr.data-pin-key]=\"key\"\n [attr.aria-label]=\"label\"\n [attr.aria-pressed]=\"pinned\"\n (click)=\"onTogglePinned($event, menu)\">\n <sd-icon name=\"push_pin\" [fontSet]=\"pinned ? 'material-icons' : 'material-icons-outlined'\" size=\"18px\"></sd-icon>\n </button>\n</ng-template>\n", styles: [":host{--tree-hover-bg: var(--sd-sidebar-v4-hover-bg, color-mix(in srgb, var(--sd-text) 6%, transparent));--tree-active-bg: var(--sd-sidebar-v4-active-bg, var(--sd-primary-light));--tree-active-ink: var(--sd-sidebar-v4-active-ink, var(--sd-primary));--tree-active-shadow: var(--sd-sidebar-v4-active-shadow, none);--tree-bg: var(--sd-sidebar-v4-bg, color-mix(in srgb, var(--sd-text) 4%, var(--sd-surface)));--tree-line: var(--sd-sidebar-v4-line, color-mix(in srgb, var(--sd-border) 45%, var(--sd-surface)));--tree-branch: color-mix(in srgb, var(--sd-border) 60%, var(--sd-surface));--tree-attention: var(--sd-sidebar-v4-attention, var(--sd-warning));--tree-live: var(--sd-sidebar-v4-live, var(--sd-success));--tree-muted-ink: var(--sd-text-secondary);--tree-disabled-ink: var(--sd-disabled-text, color-mix(in srgb, var(--sd-text) 60%, transparent));--tree-focus-ring: inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary));--tree-radius: var(--sd-sidebar-v4-item-radius, var(--sd-radius-999, 999px));--tree-row-height: var(--sd-sidebar-v4-item-height, 36px);--tree-child-height: var(--sd-sidebar-v4-child-height, 32px);display:block;min-width:0;color:var(--sd-text)}:host(.sd-sidebar-v4-menu-tree--mobile){--tree-row-height: var(--sd-sidebar-v4-item-height, 44px);--tree-child-height: var(--sd-sidebar-v4-child-height, 44px)}:host(.sd-sidebar-v4-menu-tree--mobile) .sd-sidebar-v4-menu-tree__pin{position:static;flex:0 0 44px;align-self:center;width:44px;height:44px;transform:none;opacity:1;pointer-events:auto}:host(.sd-sidebar-v4-menu-tree--mobile) .sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row,:host(.sd-sidebar-v4-menu-tree--mobile) .sd-sidebar-v4-menu-tree__item--pinnable:has(>.sd-sidebar-v4-menu-tree__pin:focus-visible)>.sd-sidebar-v4-menu-tree__row,:host(.sd-sidebar-v4-menu-tree--mobile) .sd-sidebar-v4-menu-tree__item--shortcut.sd-sidebar-v4-menu-tree__item--pinnable>.sd-sidebar-v4-menu-tree__row,:host(.sd-sidebar-v4-menu-tree--mobile) .sd-sidebar-v4-menu-tree__item--shortcut.sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row{padding-right:var(--sd-space-12, 12px)}:host(.sd-sidebar-v4-menu-tree--mobile) .sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row .sd-sidebar-v4-menu-tree__trailing,:host(.sd-sidebar-v4-menu-tree--mobile) .sd-sidebar-v4-menu-tree__item--pinnable:has(>.sd-sidebar-v4-menu-tree__pin:focus-visible)>.sd-sidebar-v4-menu-tree__row .sd-sidebar-v4-menu-tree__trailing{visibility:visible}.sd-sidebar-v4-menu-tree__sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.sd-sidebar-v4-menu-tree__section--separated{margin-top:var(--sd-space-16, 16px)}.sd-sidebar-v4-menu-tree__section-label{padding:14px 12px 4px;color:var(--tree-muted-ink);font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-16, 16px);letter-spacing:.3px}.sd-sidebar-v4-menu-tree__item{position:relative;display:flex;align-items:stretch;min-width:0}.sd-sidebar-v4-menu-tree__row{display:flex;flex:1 1 auto;align-items:center;gap:var(--sd-space-12, 12px);box-sizing:border-box;width:100%;min-width:0;min-height:var(--tree-row-height, 36px);margin:0;padding:0 var(--sd-space-12, 12px);border:0;border-radius:var(--tree-radius, 999px);background:transparent;color:var(--sd-text);font:inherit;font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-20, 20px);text-align:left;cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}.sd-sidebar-v4-menu-tree__row:hover{background:var(--tree-hover-bg)}.sd-sidebar-v4-menu-tree__row--group{padding:0 var(--sd-space-8, 8px) 0 var(--sd-space-12, 12px)}.sd-sidebar-v4-menu-tree__row--child{gap:var(--sd-space-8, 8px);min-height:var(--tree-child-height, 32px)}.sd-sidebar-v4-menu-tree__row--active,.sd-sidebar-v4-menu-tree__row--active:hover{background:var(--tree-active-bg);box-shadow:var(--tree-active-shadow);color:var(--tree-active-ink);font-weight:var(--sd-font-weight-medium, 500)}.sd-sidebar-v4-menu-tree__row--disabled,.sd-sidebar-v4-menu-tree__row--disabled:hover{background:transparent;color:var(--tree-disabled-ink);cursor:not-allowed}.sd-sidebar-v4-menu-tree__row:focus-visible{outline:none;box-shadow:var(--tree-focus-ring)}.sd-sidebar-v4-menu-tree__label{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sd-sidebar-v4-menu-tree__icon,.sd-sidebar-v4-menu-tree__icon-image{flex:0 0 20px;width:20px;height:20px;color:var(--tree-muted-ink)}.sd-sidebar-v4-menu-tree__icon-image{object-fit:contain}.sd-sidebar-v4-menu-tree__row--active .sd-sidebar-v4-menu-tree__icon,.sd-sidebar-v4-menu-tree__rail-item--active .sd-sidebar-v4-menu-tree__icon,.sd-sidebar-v4-menu-tree__row--disabled .sd-sidebar-v4-menu-tree__icon,.sd-sidebar-v4-menu-tree__rail-item--disabled .sd-sidebar-v4-menu-tree__icon{color:inherit}.sd-sidebar-v4-menu-tree__row--disabled .sd-sidebar-v4-menu-tree__icon-image,.sd-sidebar-v4-menu-tree__rail-item--disabled .sd-sidebar-v4-menu-tree__icon-image{opacity:.6}.sd-sidebar-v4-menu-tree__chevron{flex:0 0 20px;color:var(--tree-muted-ink)}.sd-sidebar-v4-menu-tree__dot{flex:none;width:6px;height:6px;border-radius:3px;background:var(--sd-primary)}.sd-sidebar-v4-menu-tree__item--nested{min-height:var(--tree-child-height, 32px);animation:sd-sidebar-v4-expand-in .16s ease-out}@keyframes sd-sidebar-v4-expand-in{0%{opacity:0}}.sd-sidebar-v4-menu-tree__branch{position:absolute;top:0;bottom:0;width:1px;background:var(--tree-branch);pointer-events:none}.sd-sidebar-v4-menu-tree__marker{position:absolute;z-index:1;top:7px;bottom:7px;width:3px;border-radius:var(--sd-radius-2, 2px);background:var(--sd-primary);pointer-events:none}.sd-sidebar-v4-menu-tree__trailing{flex:none}.sd-sidebar-v4-menu-tree__count{color:var(--tree-muted-ink);font-size:var(--sd-font-size-12, 12px);font-weight:var(--sd-font-weight-regular, 400);line-height:var(--sd-line-height-16, 16px)}.sd-sidebar-v4-menu-tree__row--active .sd-sidebar-v4-menu-tree__count{color:inherit}.sd-sidebar-v4-menu-tree__badge,.sd-sidebar-v4-menu-tree__rail-badge{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;font-weight:var(--sd-font-weight-medium, 500);line-height:1}.sd-sidebar-v4-menu-tree__badge{min-width:20px;height:20px;padding:0 6px;border-radius:var(--sd-radius-10, 10px);font-size:11.5px}.sd-sidebar-v4-menu-tree__badge--warning{background:var(--tree-attention);color:var(--sd-warning-contrast)}.sd-sidebar-v4-menu-tree__badge--error{background:var(--sd-error);color:var(--sd-error-contrast)}.sd-sidebar-v4-menu-tree__status,.sd-sidebar-v4-menu-tree__rail-live{--tree-tone: var(--tree-live)}.sd-sidebar-v4-menu-tree__status[data-tone=warning],.sd-sidebar-v4-menu-tree__rail-live[data-tone=warning]{--tree-tone: var(--sd-warning)}.sd-sidebar-v4-menu-tree__status[data-tone=error],.sd-sidebar-v4-menu-tree__rail-live[data-tone=error]{--tree-tone: var(--sd-error)}.sd-sidebar-v4-menu-tree__status{display:inline-flex;align-items:center;gap:6px;color:var(--tree-tone);font-size:var(--sd-font-size-12, 12px);font-weight:var(--sd-font-weight-regular, 400);line-height:var(--sd-line-height-16, 16px)}.sd-sidebar-v4-menu-tree__status-dot{flex:none;width:6px;height:6px;border-radius:3px;background:var(--tree-tone)}.sd-sidebar-v4-menu-tree__status-dot--live{box-shadow:0 0 0 3px color-mix(in srgb,var(--tree-tone) 18%,transparent)}.sd-sidebar-v4-menu-tree__chip{padding:0 7px;border:1px solid var(--sd-border);border-radius:var(--sd-radius-999, 999px);color:var(--tree-muted-ink);font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-18, 18px)}.sd-sidebar-v4-menu-tree__pin{position:absolute;top:50%;right:2px;display:flex;align-items:center;justify-content:center;width:32px;height:32px;margin:0;padding:0;border:0;border-radius:var(--tree-radius, 999px);background:transparent;color:var(--tree-muted-ink);cursor:pointer;opacity:0;pointer-events:none;transform:translateY(-50%);transition:opacity var(--sd-duration-fast, .12s) ease,background-color var(--sd-duration-fast, .12s) ease}.sd-sidebar-v4-menu-tree__pin:hover{background:var(--tree-hover-bg)}.sd-sidebar-v4-menu-tree__pin:focus-visible{outline:none;box-shadow:var(--tree-focus-ring)}.sd-sidebar-v4-menu-tree__item:hover>.sd-sidebar-v4-menu-tree__pin,.sd-sidebar-v4-menu-tree__pin:focus-visible,.sd-sidebar-v4-menu-tree__item--shortcut>.sd-sidebar-v4-menu-tree__pin{opacity:1;pointer-events:auto}.sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row,.sd-sidebar-v4-menu-tree__item--pinnable:has(>.sd-sidebar-v4-menu-tree__pin:focus-visible)>.sd-sidebar-v4-menu-tree__row{padding-right:40px}.sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row .sd-sidebar-v4-menu-tree__trailing,.sd-sidebar-v4-menu-tree__item--pinnable:has(>.sd-sidebar-v4-menu-tree__pin:focus-visible)>.sd-sidebar-v4-menu-tree__row .sd-sidebar-v4-menu-tree__trailing{visibility:hidden}.sd-sidebar-v4-menu-tree__row--shortcut{gap:var(--sd-space-8, 8px)}.sd-sidebar-v4-menu-tree__item--shortcut.sd-sidebar-v4-menu-tree__item--pinnable>.sd-sidebar-v4-menu-tree__row,.sd-sidebar-v4-menu-tree__item--shortcut.sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row{padding-right:40px}.sd-sidebar-v4-menu-tree__shortcut-path{color:var(--tree-muted-ink);font-size:var(--sd-font-size-12, 12px);font-weight:var(--sd-font-weight-regular, 400)}.sd-sidebar-v4-menu-tree__results{display:flex;flex-direction:column}.sd-sidebar-v4-menu-tree__result{display:flex;flex-direction:column;justify-content:center;box-sizing:border-box;min-height:var(--tree-row-height, 36px);padding:6px var(--sd-space-12, 12px);border-radius:var(--sd-radius-16, 16px);cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease}.sd-sidebar-v4-menu-tree__result:hover{background:var(--tree-hover-bg)}.sd-sidebar-v4-menu-tree__result--focused,.sd-sidebar-v4-menu-tree__result--focused:hover{background:var(--sd-surface);box-shadow:inset 0 0 0 2px var(--sd-primary)}.sd-sidebar-v4-menu-tree__result-title{color:var(--sd-text);font-size:var(--sd-font-size-13, 13px);line-height:var(--sd-line-height-18, 18px);overflow-wrap:anywhere}.sd-sidebar-v4-menu-tree__match{border-radius:3px;background:var(--sd-primary-light);color:var(--sd-primary-dark);font-weight:var(--sd-font-weight-medium, 500)}.sd-sidebar-v4-menu-tree__result-path{margin-top:1px;color:var(--tree-muted-ink);font-size:11.5px;line-height:var(--sd-line-height-16, 16px);overflow-wrap:anywhere}.sd-sidebar-v4-menu-tree__empty{padding:var(--sd-space-16, 16px) var(--sd-space-12, 12px);color:var(--tree-muted-ink);font-size:var(--sd-font-size-13, 13px);overflow-wrap:anywhere}.sd-sidebar-v4-menu-tree__hint{padding:var(--sd-space-12, 12px) var(--sd-space-12, 12px) 0;color:var(--tree-muted-ink);font-size:11.5px;line-height:var(--sd-line-height-16, 16px)}.sd-sidebar-v4-menu-tree__rail{display:flex;flex-direction:column;align-items:center;gap:var(--sd-space-4, 4px)}.sd-sidebar-v4-menu-tree__rail-cell{position:relative;display:flex}.sd-sidebar-v4-menu-tree__rail-item{position:relative;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:48px;height:36px;margin:0;padding:0;border:0;border-radius:var(--tree-radius, 999px);background:transparent;color:var(--tree-muted-ink);cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease,color var(--sd-duration-fast, .12s) ease}.sd-sidebar-v4-menu-tree__rail-item:hover,.sd-sidebar-v4-menu-tree__rail-item.sd-sidebar-v4-menu-tree__rail-item--open{background:var(--tree-hover-bg)}.sd-sidebar-v4-menu-tree__rail-item--active,.sd-sidebar-v4-menu-tree__rail-item--active:hover{background:var(--tree-active-bg);box-shadow:var(--tree-active-shadow);color:var(--tree-active-ink)}.sd-sidebar-v4-menu-tree__rail-item--disabled,.sd-sidebar-v4-menu-tree__rail-item--disabled:hover{background:transparent;color:var(--tree-disabled-ink);cursor:not-allowed}.sd-sidebar-v4-menu-tree__rail-item:focus-visible{outline:none;box-shadow:var(--tree-focus-ring)}.sd-sidebar-v4-menu-tree__rail-separator{flex:none;width:32px;height:1px;margin:5px 0;background:var(--tree-line)}.sd-sidebar-v4-menu-tree__rail-badge{position:absolute;top:0;right:2px;min-width:16px;height:16px;padding:0 4px;border-radius:var(--sd-radius-8, 8px);font-size:var(--sd-font-size-10, 10px);box-shadow:0 0 0 2px var(--tree-bg);pointer-events:none}.sd-sidebar-v4-menu-tree__rail-live{position:absolute;top:5px;right:9px;width:8px;height:8px;border-radius:var(--sd-radius-4, 4px);background:var(--tree-tone);box-shadow:0 0 0 2px var(--tree-bg);pointer-events:none}.sd-sidebar-v4-menu-tree__flyout{--tree-hover-bg: var(--sd-sidebar-v4-hover-bg, color-mix(in srgb, var(--sd-text) 6%, transparent));--tree-active-bg: var(--sd-sidebar-v4-active-bg, var(--sd-primary-light));--tree-active-ink: var(--sd-sidebar-v4-active-ink, var(--sd-primary));--tree-active-shadow: var(--sd-sidebar-v4-active-shadow, none);--tree-bg: var(--sd-sidebar-v4-bg, color-mix(in srgb, var(--sd-text) 4%, var(--sd-surface)));--tree-line: var(--sd-sidebar-v4-line, color-mix(in srgb, var(--sd-border) 45%, var(--sd-surface)));--tree-branch: color-mix(in srgb, var(--sd-border) 60%, var(--sd-surface));--tree-attention: var(--sd-sidebar-v4-attention, var(--sd-warning));--tree-live: var(--sd-sidebar-v4-live, var(--sd-success));--tree-muted-ink: var(--sd-text-secondary);--tree-disabled-ink: var(--sd-disabled-text, color-mix(in srgb, var(--sd-text) 60%, transparent));--tree-focus-ring: inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary));--tree-radius: var(--sd-sidebar-v4-item-radius, var(--sd-radius-999, 999px));--tree-row-height: var(--sd-sidebar-v4-item-height, 36px);--tree-child-height: var(--sd-sidebar-v4-child-height, 32px);box-sizing:border-box;width:232px;padding:var(--sd-space-8, 8px);border:1px solid var(--tree-line);border-radius:var(--sd-radius-16, 16px);background:var(--sd-surface);color:var(--sd-text);box-shadow:0 6px 24px color-mix(in srgb,var(--sd-text) 14%,transparent);animation:sd-sidebar-v4-flyout-in .14s ease-out}.sd-sidebar-v4-menu-tree__flyout:focus{outline:none}.sd-sidebar-v4-menu-tree__flyout-title{padding:6px var(--sd-space-12, 12px);font-size:var(--sd-font-size-13, 13px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-20, 20px)}.sd-sidebar-v4-menu-tree__flyout-heading{display:flex;align-items:center;gap:var(--sd-space-8, 8px);padding:6px var(--sd-space-12, 12px) 2px;color:var(--tree-muted-ink);font-size:var(--sd-font-size-12, 12px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-16, 16px)}.sd-sidebar-v4-menu-tree__flyout-heading--disabled{color:var(--tree-disabled-ink)}.sd-sidebar-v4-menu-tree__row--flyout{gap:var(--sd-space-8, 8px);height:32px;min-height:32px}@keyframes sd-sidebar-v4-flyout-in{0%{opacity:0;transform:translate(-4px)}}@media(pointer:coarse){.sd-sidebar-v4-menu-tree__row{min-height:max(44px,var(--tree-row-height, 36px))}.sd-sidebar-v4-menu-tree__row--child{min-height:max(44px,var(--tree-child-height, 32px))}.sd-sidebar-v4-menu-tree__result{min-height:max(44px,var(--tree-row-height, 36px))}.sd-sidebar-v4-menu-tree__row--flyout{height:auto;min-height:44px}.sd-sidebar-v4-menu-tree__rail-item{height:44px}.sd-sidebar-v4-menu-tree__pin{position:static;flex:0 0 44px;align-self:center;width:44px;height:44px;transform:none;opacity:1;pointer-events:auto}.sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row,.sd-sidebar-v4-menu-tree__item--pinnable:has(>.sd-sidebar-v4-menu-tree__pin:focus-visible)>.sd-sidebar-v4-menu-tree__row,.sd-sidebar-v4-menu-tree__item--shortcut.sd-sidebar-v4-menu-tree__item--pinnable>.sd-sidebar-v4-menu-tree__row,.sd-sidebar-v4-menu-tree__item--shortcut.sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row{padding-right:var(--sd-space-12, 12px)}.sd-sidebar-v4-menu-tree__item--pinnable:hover>.sd-sidebar-v4-menu-tree__row .sd-sidebar-v4-menu-tree__trailing,.sd-sidebar-v4-menu-tree__item--pinnable:has(>.sd-sidebar-v4-menu-tree__pin:focus-visible)>.sd-sidebar-v4-menu-tree__row .sd-sidebar-v4-menu-tree__trailing{visibility:visible}}@media(prefers-reduced-motion:reduce){.sd-sidebar-v4-menu-tree__row,.sd-sidebar-v4-menu-tree__pin,.sd-sidebar-v4-menu-tree__result,.sd-sidebar-v4-menu-tree__rail-item{transition:none}.sd-sidebar-v4-menu-tree__flyout,.sd-sidebar-v4-menu-tree__item--nested{animation:none}}\n"] }]
3863
+ }], ctorParameters: () => [], propDecorators: { menus: [{ type: i0.Input, args: [{ isSignal: true, alias: "menus", required: false }] }], pathSource: [{ type: i0.Input, args: [{ isSignal: true, alias: "pathSource", required: false }] }], activePath: [{ type: i0.Input, args: [{ isSignal: true, alias: "activePath", required: false }] }], presentation: [{ type: i0.Input, args: [{ isSignal: true, alias: "presentation", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], collapsedGroupKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsedGroupKeys", required: false }] }, { type: i0.Output, args: ["collapsedGroupKeysChange"] }], pinnedKeys: [{ type: i0.Input, args: [{ isSignal: true, alias: "pinnedKeys", required: false }] }], showPin: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPin", required: false }] }], collapsedGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsedGroup", required: false }] }], query: [{ type: i0.Input, args: [{ isSignal: true, alias: "query", required: false }] }], focusedIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "focusedIndex", required: false }] }], navigate: [{ type: i0.Output, args: ["navigate"] }], togglePinned: [{ type: i0.Output, args: ["togglePinned"] }], expandGroup: [{ type: i0.Output, args: ["expandGroup"] }] } });
3864
+ /** Parent path of every menu in the tree, keyed by object and by stable key (so equal menus from another array still resolve). */
3865
+ function collectParentPaths(menus) {
3866
+ const paths = new Map();
3867
+ const visit = (items, titles, section) => {
3868
+ for (const menu of items) {
3869
+ if (!menu || typeof menu !== 'object')
3870
+ continue;
3871
+ const path = titles.length ? titles.join(' / ') : section;
3872
+ if (!paths.has(menu))
3873
+ paths.set(menu, path);
3874
+ const key = getMenuStableKey(menu);
3875
+ if (key && !paths.has(key))
3876
+ paths.set(key, path);
3877
+ if ('children' in menu && Array.isArray(menu.children)) {
3878
+ const title = (menu.title ?? menu.tooltipTitle ?? '').trim();
3879
+ visit(menu.children, title ? [...titles, title] : titles, section);
3880
+ }
3881
+ }
3882
+ };
3883
+ for (const menu of menus ?? []) {
3884
+ if (!menu || typeof menu !== 'object')
3885
+ continue;
3886
+ visit([menu], [], typeof menu.section === 'string' ? menu.section.trim() : '');
3887
+ }
3888
+ return paths;
3889
+ }
3890
+ function lookupParentPath(paths, menu) {
3891
+ return paths.get(menu) ?? paths.get(getMenuStableKey(menu)) ?? '';
3892
+ }
3893
+ // Cùng bộ ký tự mà StringUtilities.changeAliasLowerCase thay bằng khoảng trắng.
3894
+ const PUNCTUATION = /[!@%^*()+=<>?/,.:;'"&#[\]~$_`\-{}|\\]/;
3895
+ const COMBINING_MARKS = /[\u0300-\u036f]/g;
3896
+ const D_STROKE = /\u0111/g;
3897
+ const WHITESPACE = /\s/;
3898
+ function foldCharacter(character) {
3899
+ if (PUNCTUATION.test(character))
3900
+ return ' ';
3901
+ return character.toLowerCase().normalize('NFD').replace(COMBINING_MARKS, '').replace(D_STROKE, 'd');
3902
+ }
3903
+ /** Folds like `aliasIncludes` (no case, no accents, punctuation as one space) and maps every folded character to its source index. */
3904
+ function foldText(text) {
3905
+ let folded = '';
3906
+ const sources = [];
3907
+ for (let index = 0; index < text.length; index++) {
3908
+ for (const character of foldCharacter(text[index])) {
3909
+ const isSpace = WHITESPACE.test(character);
3910
+ if (isSpace && (!folded || folded.endsWith(' ')))
3911
+ continue;
3912
+ folded += isSpace ? ' ' : character;
3913
+ sources.push(index);
3914
+ }
3915
+ }
3916
+ return { folded, sources };
3917
+ }
3918
+ /**
3919
+ * Splits `text` around the first accent-insensitive occurrence of `query`. The result is rendered through text
3920
+ * interpolation only, so neither the title nor the query can inject markup.
3921
+ */
3922
+ function highlightSegments(text, query) {
3923
+ const needle = foldText(query ?? '').folded.trim();
3924
+ if (!needle)
3925
+ return [{ text, match: false }];
3926
+ const { folded, sources } = foldText(text);
3927
+ const at = folded.indexOf(needle);
3928
+ if (at < 0)
3929
+ return [{ text, match: false }];
3930
+ const start = sources[at];
3931
+ let end = sources[at + needle.length - 1] + 1;
3932
+ // why: dấu tổ hợp (chuỗi NFD) đứng sau ký tự khớp cuối thuộc về ký tự đó — giữ trong phần highlight.
3933
+ while (end < text.length && !foldCharacter(text[end]))
3934
+ end++;
3935
+ return [
3936
+ { text: text.slice(0, start), match: false },
3937
+ { text: text.slice(start, end), match: true },
3938
+ { text: text.slice(end), match: false },
3939
+ ].filter(segment => !!segment.text);
3940
+ }
3941
+
3942
+ /**
3943
+ * Sidebar V4 desktop shell: a 280px drawer (72px rail when collapsed) with the brand header and Context Switcher,
3944
+ * a pill search (`Ctrl+K` / `⌘K`), Pinned and Recent shortcuts, the V4 menu tree and the account footer.
3945
+ * Routed content is projected into `<main>`.
3946
+ *
3947
+ * Routing, recent/pinned handling and the collapse preference behave like `sd-sidebar-v3`; the collapsed state is
3948
+ * stored in the same version 3 entry (D-004). Options are read only after `normalizeSidebarConfiguration` (INV-012);
3949
+ * `brandColor` / `brandLightColor` are ignored. Size tokens (`--sd-sidebar-v4-width`, `-rail-width`, `-item-height`,
3950
+ * `-child-height`, `-item-radius`) are declared on the host and follow `density`, `itemShape` and the pointer type.
3951
+ */
3952
+ class SdSidebarV4 {
3953
+ #router = inject(Router);
3954
+ #destroyRef = inject(DestroyRef);
3955
+ #changeDetector = inject(ChangeDetectorRef);
3956
+ #navigationState = inject(SdLayoutNavigationStateService);
3957
+ #document = inject(DOCUMENT);
3958
+ #applePlatform = isApplePlatform(this.#document.defaultView?.navigator);
3959
+ /** Requested result index; `focusedResultIndex` clamps it to the current results. */
3960
+ #focusRequest = signal(0, ...(ngDevMode ? [{ debugName: "#focusRequest" }] : /* istanbul ignore next */ []));
3961
+ #initialized = false;
3962
+ searchInput = viewChild('searchInput', ...(ngDevMode ? [{ debugName: "searchInput" }] : /* istanbul ignore next */ []));
3963
+ list = viewChild.required('list');
3964
+ mainTree = viewChild.required('mainTree');
3965
+ headerSwitcher = viewChild('headerSwitcher', ...(ngDevMode ? [{ debugName: "headerSwitcher" }] : /* istanbul ignore next */ []));
3966
+ menus = input([], ...(ngDevMode ? [{ debugName: "menus" }] : /* istanbul ignore next */ []));
3967
+ userInfo = input.required(...(ngDevMode ? [{ debugName: "userInfo" }] : /* istanbul ignore next */ []));
3968
+ sidebar = input.required(...(ngDevMode ? [{ debugName: "sidebar" }] : /* istanbul ignore next */ []));
3969
+ /** `sidebar()` with the V4 defaults filled by `normalizeSidebarConfiguration`, the only place they are resolved (INV-012). */
3970
+ configuration = computed(() => normalizeSidebarConfiguration(this.sidebar()), ...(ngDevMode ? [{ debugName: "configuration" }] : /* istanbul ignore next */ []));
3971
+ isCollapsed = signal(false, ...(ngDevMode ? [{ debugName: "isCollapsed" }] : /* istanbul ignore next */ []));
3972
+ collapsedGroupKeys = signal([], ...(ngDevMode ? [{ debugName: "collapsedGroupKeys" }] : /* istanbul ignore next */ []));
3973
+ searchText = signal('', ...(ngDevMode ? [{ debugName: "searchText" }] : /* istanbul ignore next */ []));
3974
+ activePath = signal(this.#router.url.split(/[?#]/, 1)[0] ?? '', ...(ngDevMode ? [{ debugName: "activePath" }] : /* istanbul ignore next */ []));
3975
+ /** Search results in the order the tree renders its options (accent-insensitive, without `comingSoon` items). */
3976
+ searchResults = computed(() => buildSidebarV4SearchResults(this.menus(), this.searchText()), ...(ngDevMode ? [{ debugName: "searchResults" }] : /* istanbul ignore next */ []));
3977
+ /** Index of the keyboard-selected result: the first one when results appear, -1 when there is none. */
3978
+ focusedResultIndex = computed(() => {
3979
+ const count = this.searchResults().length;
3980
+ return count ? Math.min(Math.max(this.#focusRequest(), 0), count - 1) : -1;
3981
+ }, ...(ngDevMode ? [{ debugName: "focusedResultIndex" }] : /* istanbul ignore next */ []));
3982
+ recentConfiguration = computed(() => this.configuration().recent, ...(ngDevMode ? [{ debugName: "recentConfiguration" }] : /* istanbul ignore next */ []));
3983
+ pinnedKeys = this.#navigationState.pinnedKeys;
3984
+ pinnedMenus = this.#navigationState.pinnedMenus;
3985
+ recentMenus = this.#navigationState.recentMenus;
3986
+ hasQuery = computed(() => !!this.searchText().trim(), ...(ngDevMode ? [{ debugName: "hasQuery" }] : /* istanbul ignore next */ []));
3987
+ title = computed(() => this.configuration().defaultTitle || 'Back Office', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
3988
+ logoInitial = computed(() => Array.from(this.title().trim())[0]?.toLocaleUpperCase() ?? '', ...(ngDevMode ? [{ debugName: "logoInitial" }] : /* istanbul ignore next */ []));
3989
+ /** The hierarchy starts with items that have no section heading. */
3990
+ leadsWithUnsectioned = computed(() => groupMenusBySection(this.menus())[0]?.section === null, ...(ngDevMode ? [{ debugName: "leadsWithUnsectioned" }] : /* istanbul ignore next */ []));
3991
+ shortcutHint = this.#applePlatform ? '⌘K' : 'Ctrl K';
3992
+ shortcutKeys = this.#applePlatform ? 'Meta+K' : 'Control+K';
3993
+ /** The header Context Switcher popover is open; the whole header then takes the hover background (README CS1). */
3994
+ contextOpen = computed(() => this.headerSwitcher()?.isOpen() ?? false, ...(ngDevMode ? [{ debugName: "contextOpen" }] : /* istanbul ignore next */ []));
3995
+ constructor() {
3996
+ effect(() => {
3997
+ const menus = this.menus();
3998
+ const configuration = this.configuration();
3999
+ untracked(() => {
4000
+ this.#navigationState.hydrate(menus, configuration.recent.maxItems);
4001
+ if (this.#initialized)
4002
+ return;
4003
+ const persistedCollapsed = this.#navigationState.versionState(3).collapsed;
4004
+ this.isCollapsed.set(typeof persistedCollapsed === 'boolean' ? persistedCollapsed : configuration.defaultCollapsed);
4005
+ this.#initialized = true;
4006
+ });
4007
+ });
4008
+ this.#router.events.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(event => {
4009
+ if (event instanceof NavigationEnd)
4010
+ this.activePath.set(event.urlAfterRedirects.split(/[?#]/, 1)[0] ?? '');
4011
+ });
4012
+ effect(() => {
4013
+ const menus = this.menus();
4014
+ const activeMenuPath = resolveActiveMenuPath(menus, this.activePath());
4015
+ if (!activeMenuPath)
4016
+ return;
4017
+ const activeGroupKeys = new Set();
4018
+ const visit = (items, ancestors) => {
4019
+ for (const menu of items) {
4020
+ if (!('children' in menu) || !containsMenuPath(menu, activeMenuPath))
4021
+ continue;
4022
+ const key = getMenuStableKey(menu, ancestors);
4023
+ activeGroupKeys.add(key);
4024
+ visit(menu.children ?? [], [...ancestors, menu.title ?? key]);
4025
+ }
4026
+ };
4027
+ visit(menus, []);
4028
+ // why: Chỉ mở nhánh khi route/menu đổi; người dùng vẫn được đóng nhánh đang active.
4029
+ untracked(() => this.collapsedGroupKeys.update(keys => keys.filter(key => !activeGroupKeys.has(key))));
4030
+ });
4031
+ }
4032
+ /** Collapses or expands the drawer and stores the choice in the version 3 entry, like V3 (D-004). */
4033
+ toggleCollapsed() {
4034
+ this.#setCollapsed(!this.isCollapsed());
4035
+ }
4036
+ /** Expands a collapsed drawer, then moves focus to the menu search. */
4037
+ focusSearch() {
4038
+ if (this.isCollapsed()) {
4039
+ this.#setCollapsed(false);
4040
+ // why: ô search chỉ render khi drawer mở rộng — chạy change detection ngay để có phần tử mà focus.
4041
+ this.#changeDetector.detectChanges();
4042
+ }
4043
+ const field = this.searchInput()?.nativeElement;
4044
+ field?.focus();
4045
+ field?.select();
4046
+ }
4047
+ /** Collapsed rail: a leaf navigates; a group expands the drawer and opens that group, like V3. */
4048
+ activateCollapsedMenu(menu) {
4049
+ if ('path' in menu) {
4050
+ this.navigateMenu(menu);
4051
+ return;
4052
+ }
4053
+ const key = getMenuStableKey(menu);
4054
+ this.#setCollapsed(false);
4055
+ this.collapsedGroupKeys.update(keys => keys.filter(current => current !== key));
4056
+ }
4057
+ navigateMenu(menu) {
4058
+ if (!('path' in menu))
4059
+ return;
4060
+ this.#navigationState.recordRecent(menu, this.recentConfiguration());
4061
+ // why: `includes('http')` là substring test — `javascript:fetch(...)//http` lọt qua và chạy như
4062
+ // script trong origin của app. Parse URL thật rồi mới mở, kèm `noopener,noreferrer`.
4063
+ if (sdIsExternalHttpUrl(menu.path)) {
4064
+ sdOpenExternal(menu.path);
4065
+ return;
4066
+ }
4067
+ void this.#router.navigate([menu.path.split('?')[0]], {
4068
+ queryParams: menu.queryParams ?? {},
4069
+ state: { switchTab: true },
4070
+ });
4071
+ }
4072
+ onTogglePinned(menu) {
4073
+ this.#navigationState.togglePinned(menu);
4074
+ }
4075
+ onSearchInput(event) {
4076
+ const value = event.target.value;
4077
+ this.searchText.set(value);
4078
+ this.#focusRequest.set(0);
4079
+ // why: kết quả bắt đầu ở đầu list và kết quả đầu được chọn sẵn — bỏ vị trí cuộn cũ của cây để nó luôn thấy được.
4080
+ if (value.trim())
4081
+ this.list().nativeElement.scrollTop = 0;
4082
+ }
4083
+ clearSearch() {
4084
+ this.#clearQuery();
4085
+ this.searchInput()?.nativeElement.focus();
4086
+ }
4087
+ onSearchKeydown(event) {
4088
+ if (event.isComposing)
4089
+ return;
4090
+ switch (event.key) {
4091
+ case 'ArrowDown':
4092
+ case 'ArrowUp': {
4093
+ const count = this.searchResults().length;
4094
+ if (!count)
4095
+ return;
4096
+ event.preventDefault();
4097
+ const next = Math.min(Math.max(this.focusedResultIndex() + (event.key === 'ArrowDown' ? 1 : -1), 0), count - 1);
4098
+ this.#focusRequest.set(next);
4099
+ this.#revealResult(next);
4100
+ return;
4101
+ }
4102
+ case 'Enter': {
4103
+ const result = this.searchResults()[this.focusedResultIndex()];
4104
+ if (!result)
4105
+ return;
4106
+ event.preventDefault();
4107
+ this.navigateMenu(result.menu);
4108
+ return;
4109
+ }
4110
+ case 'Escape':
4111
+ if (!this.searchText())
4112
+ return;
4113
+ event.preventDefault();
4114
+ this.#clearQuery();
4115
+ }
4116
+ }
4117
+ onDocumentKeydown(event) {
4118
+ // why: phím tắt đã được phần khác xử lý (defaultPrevented) thì nhường; chỉ preventDefault khi V4 thật sự xử lý.
4119
+ if (event.defaultPrevented || !this.#isSearchShortcut(event) || this.#focusIsInOverlay())
4120
+ return;
4121
+ event.preventDefault();
4122
+ this.focusSearch();
4123
+ }
4124
+ /** Focus sits in a modal dialog or a CDK overlay (popover, flyout, menu); the shortcut must not pull it to the drawer behind. */
4125
+ #focusIsInOverlay() {
4126
+ return !!this.#document.activeElement?.closest('[aria-modal="true"], .cdk-overlay-container');
4127
+ }
4128
+ #revealResult(index) {
4129
+ // why: listbox cuộn trong nav — option được chọn phải luôn nằm trong vùng thấy được, nếu không Enter mở một mục người
4130
+ // dùng không thấy (WCAG 2.4.11). Option đã render sẵn nên cuộn ngay, không cần chờ render.
4131
+ this.#document.getElementById(this.mainTree().resultOptionId(index))?.scrollIntoView({ block: 'nearest' });
4132
+ }
4133
+ #isSearchShortcut(event) {
4134
+ // why: bàn phím không phải Latin (vd tiếng Nga) cho `key` khác 'k' — chỉ khi đó mới dựa vào phím vật lý KeyK; bố cục
4135
+ // Latin khác (Colemak, Dvorak) giữ nguyên chữ của nó, không chiếm Ctrl/⌘ + chữ đang nằm ở vị trí KeyK.
4136
+ const key = event.key ?? '';
4137
+ const isK = /^[a-z]$/i.test(key) ? key.toLowerCase() === 'k' : event.code === 'KeyK';
4138
+ if (!isK || event.altKey || event.shiftKey)
4139
+ return false;
4140
+ // why: Ctrl+K trên Mac là phím sửa dòng của ô nhập — chỉ nhận ⌘K ở đó, và Ctrl+K ở nền tảng khác.
4141
+ return this.#applePlatform ? event.metaKey && !event.ctrlKey : event.ctrlKey && !event.metaKey;
4142
+ }
4143
+ #clearQuery() {
4144
+ this.searchText.set('');
4145
+ this.#focusRequest.set(0);
4146
+ // why: cây hiện lại thay cho kết quả — bắt đầu từ đầu list thay vì giữ vị trí cuộn của danh sách kết quả.
4147
+ this.list().nativeElement.scrollTop = 0;
4148
+ }
4149
+ #setCollapsed(collapsed) {
4150
+ this.isCollapsed.set(collapsed);
4151
+ this.#navigationState.patchVersionState(3, { collapsed });
4152
+ }
4153
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdSidebarV4, deps: [], target: i0.ɵɵFactoryTarget.Component });
4154
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdSidebarV4, isStandalone: true, selector: "sd-sidebar-v4", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "document:keydown": "onDocumentKeydown($event)" }, properties: { "class.sd-sidebar-v4--collapsed": "isCollapsed()", "class.sd-sidebar-v4--soft": "configuration().itemShape === \"soft\"", "class.sd-sidebar-v4--comfortable": "configuration().density === \"comfortable\"" }, classAttribute: "sd-sidebar-v4" }, viewQueries: [{ propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }, { propertyName: "list", first: true, predicate: ["list"], descendants: true, isSignal: true }, { propertyName: "mainTree", first: true, predicate: ["mainTree"], descendants: true, isSignal: true }, { propertyName: "headerSwitcher", first: true, predicate: ["headerSwitcher"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _collapsed = isCollapsed();\n@let _configuration = configuration();\n@let _query = searchText();\n@let _hasQuery = hasQuery();\n@let _focused = focusedResultIndex();\n@let _hasResults = _focused >= 0;\n@let _pinned = pinnedMenus();\n@let _recent = recentMenus();\n@let _showShortcuts = !_collapsed && !_hasQuery;\n@let _showPinned = _showShortcuts && _pinned.length > 0;\n@let _showRecent = _showShortcuts && recentConfiguration().enabled && _recent.length > 0;\n@let _toggleLabel = (_collapsed ? 'core.module.layout.sidebar.expand' : 'core.module.layout.sidebar.collapse') | sdTranslate;\n@let _searchLabel = 'core.module.layout.sidebar.v4-search-placeholder' | sdTranslate;\n<aside #asideElement data-v4-sidebar class=\"sd-sidebar-v4__drawer\" [attr.data-collapsed]=\"_collapsed\">\n <header\n #headerElement\n data-v4-header\n class=\"sd-sidebar-v4__header\"\n [class.sd-sidebar-v4__header--context-open]=\"!_collapsed && contextOpen()\">\n <span data-v4-logo class=\"sd-sidebar-v4__logo\" [class.sd-sidebar-v4__logo--image]=\"!!_configuration.logoUrl\" aria-hidden=\"true\">\n @if (_configuration.logoUrl) {\n <img [src]=\"_configuration.logoUrl\" alt=\"\" />\n } @else {\n {{ logoInitial() }}\n }\n </span>\n @if (!_collapsed) {\n <div data-v4-brand class=\"sd-sidebar-v4__brand\">\n <span data-v4-title class=\"sd-sidebar-v4__title\">{{ title() }}</span>\n @if (_configuration.context) {\n <sd-layout-context-switcher\n #headerSwitcher\n appearance=\"header\"\n [configuration]=\"_configuration.context\"\n [anchor]=\"headerElement\" />\n }\n </div>\n } @else if (_configuration.context) {\n <sd-layout-context-switcher\n class=\"sd-sidebar-v4__rail-context\"\n appearance=\"rail\"\n [configuration]=\"_configuration.context\"\n [anchor]=\"asideElement\" />\n }\n <!-- The same button stays mounted in both modes so focus survives a toggle. -->\n <button\n type=\"button\"\n data-v4-toggle\n class=\"sd-sidebar-v4__icon-button\"\n [attr.aria-label]=\"_toggleLabel\"\n [attr.aria-expanded]=\"!_collapsed\"\n [attr.title]=\"_toggleLabel\"\n (click)=\"toggleCollapsed()\">\n <sd-icon [name]=\"_collapsed ? 'menu' : 'menu_open'\" size=\"20px\"></sd-icon>\n </button>\n @if (_collapsed) {\n <button\n type=\"button\"\n data-v4-rail-search\n class=\"sd-sidebar-v4__icon-button\"\n [attr.aria-label]=\"_searchLabel\"\n [attr.title]=\"_searchLabel\"\n (click)=\"focusSearch()\">\n <sd-icon name=\"search\" size=\"20px\"></sd-icon>\n </button>\n }\n </header>\n\n @if (!_collapsed) {\n <div data-v4-search class=\"sd-sidebar-v4__search\">\n <div data-v4-search-field class=\"sd-sidebar-v4__search-field\" [class.sd-sidebar-v4__search-field--filled]=\"!!_query\">\n <sd-icon class=\"sd-sidebar-v4__search-icon\" name=\"search\" size=\"20px\" aria-hidden=\"true\"></sd-icon>\n <input\n #searchInput\n data-v4-search-input\n class=\"sd-sidebar-v4__search-input\"\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n aria-autocomplete=\"list\"\n [attr.aria-label]=\"_searchLabel\"\n [attr.placeholder]=\"_searchLabel\"\n [attr.aria-keyshortcuts]=\"shortcutKeys\"\n [attr.aria-expanded]=\"_hasResults\"\n [attr.aria-controls]=\"_hasResults ? mainTree.resultsId : null\"\n [attr.aria-activedescendant]=\"_hasResults ? mainTree.resultOptionId(_focused) : null\"\n [value]=\"_query\"\n (input)=\"onSearchInput($event)\"\n (keydown)=\"onSearchKeydown($event)\" />\n @if (_query) {\n <button\n type=\"button\"\n data-v4-search-clear\n class=\"sd-sidebar-v4__search-clear\"\n [attr.aria-label]=\"'core.module.layout.sidebar.clear-search' | sdTranslate\"\n (click)=\"clearSearch()\">\n <sd-icon name=\"close\" size=\"18px\"></sd-icon>\n </button>\n } @else {\n <kbd data-v4-search-shortcut class=\"sd-sidebar-v4__search-shortcut\" aria-hidden=\"true\">{{ shortcutHint }}</kbd>\n }\n </div>\n </div>\n }\n\n <nav #list data-v4-nav class=\"sd-sidebar-v4__list\" [attr.aria-label]=\"'core.module.layout.sidebar.primary-nav' | sdTranslate\">\n @if (_showPinned) {\n <section data-v4-pinned class=\"sd-sidebar-v4__shortcuts\">\n <h2 class=\"sd-sidebar-v4__section-label\">{{ 'core.module.layout.sidebar.pinned' | sdTranslate }}</h2>\n <sd-sidebar-v4-menu-tree\n presentation=\"shortcuts\"\n [menus]=\"_pinned\"\n [pathSource]=\"menus()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\" />\n </section>\n }\n @if (_showRecent) {\n <section data-v4-recent class=\"sd-sidebar-v4__shortcuts\">\n <h2 class=\"sd-sidebar-v4__section-label\">{{ 'core.module.layout.sidebar.recent' | sdTranslate }}</h2>\n <sd-sidebar-v4-menu-tree\n presentation=\"shortcuts\"\n [menus]=\"_recent\"\n [pathSource]=\"menus()\"\n [activePath]=\"activePath()\"\n [showPin]=\"false\"\n (navigate)=\"navigateMenu($event)\" />\n </section>\n }\n <!-- One tree instance for hierarchy, results and rail: its live region must stay mounted to announce result counts. -->\n <sd-sidebar-v4-menu-tree\n #mainTree\n data-v4-tree\n [class.sd-sidebar-v4__tree--separated]=\"(_showPinned || _showRecent) && leadsWithUnsectioned()\"\n [menus]=\"menus()\"\n [pathSource]=\"menus()\"\n [activePath]=\"activePath()\"\n [presentation]=\"_hasQuery && !_collapsed ? 'results' : 'hierarchy'\"\n [mode]=\"_collapsed ? 'collapsed' : 'expanded'\"\n [(collapsedGroupKeys)]=\"collapsedGroupKeys\"\n [pinnedKeys]=\"pinnedKeys()\"\n [collapsedGroup]=\"_configuration.collapsedGroup\"\n [query]=\"_query\"\n [focusedIndex]=\"_focused\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\"\n (expandGroup)=\"activateCollapsedMenu($event)\" />\n </nav>\n\n <div data-v4-footer class=\"sd-sidebar-v4__footer\">\n <sd-layout-user-menu [userInfo]=\"userInfo()\" [compact]=\"_collapsed\"></sd-layout-user-menu>\n </div>\n</aside>\n\n<main data-v4-content class=\"sd-sidebar-v4__content\">\n <ng-content></ng-content>\n</main>\n", styles: [":host{--sd-sidebar-v4-width: 280px;--sd-sidebar-v4-rail-width: 72px;--sd-sidebar-v4-item-height: 36px;--sd-sidebar-v4-child-height: 32px;--sd-sidebar-v4-item-radius: 999px;--sd-layout-context-switcher-popover-width: calc(var(--sd-sidebar-v4-width) - 24px);--sidebar-bg: var(--sd-sidebar-v4-bg, color-mix(in srgb, var(--sd-text) 4%, var(--sd-surface)));--sd-layout-context-switcher-dot-ring-color: var(--sidebar-bg);--sidebar-line: var(--sd-sidebar-v4-line, color-mix(in srgb, var(--sd-border) 45%, var(--sd-surface)));--sidebar-hover-bg: var(--sd-sidebar-v4-hover-bg, color-mix(in srgb, var(--sd-text) 6%, transparent));--sidebar-muted-ink: var(--sd-text-secondary);--sidebar-focus-ring: inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary));display:block;min-height:100vh}:host(.sd-sidebar-v4--comfortable){--sd-sidebar-v4-item-height: 40px;--sd-sidebar-v4-child-height: 34px}:host(.sd-sidebar-v4--soft){--sd-sidebar-v4-item-radius: 8px}.sd-sidebar-v4__drawer{position:fixed;z-index:var(--sd-z-sidebar, 20);inset:0 auto 0 0;display:flex;flex-direction:column;box-sizing:border-box;width:var(--sd-sidebar-v4-width);border-right:1px solid var(--sidebar-line);background:var(--sidebar-bg);color:var(--sd-text);transition:width .16s ease}:host(.sd-sidebar-v4--collapsed) .sd-sidebar-v4__drawer{width:var(--sd-sidebar-v4-rail-width)}.sd-sidebar-v4__content{min-height:100vh;margin-left:var(--sd-sidebar-v4-width);transition:margin-left .16s ease}:host(.sd-sidebar-v4--collapsed) .sd-sidebar-v4__content{margin-left:var(--sd-sidebar-v4-rail-width)}.sd-sidebar-v4__header{display:flex;flex:none;align-items:center;gap:var(--sd-space-12, 12px);box-sizing:border-box;height:64px;padding:0 12px 0 16px}.sd-sidebar-v4__header--context-open{border-radius:var(--sd-radius-12, 12px);background:var(--sidebar-hover-bg)}.sd-sidebar-v4__header--context-open ::ng-deep .sd-layout-context-switcher__trigger.sd-layout-context-switcher__trigger--header{background:transparent}:host(.sd-sidebar-v4--collapsed) .sd-sidebar-v4__header{flex-direction:column;gap:0;height:auto;padding:18px 0 6px}.sd-sidebar-v4__logo{display:inline-flex;flex:none;align-items:center;justify-content:center;overflow:hidden;width:28px;height:28px;border-radius:var(--sd-radius-8, 8px);background:var(--sd-primary);color:var(--sd-primary-contrast);font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-bold, 700);line-height:1}.sd-sidebar-v4__logo img{width:100%;height:100%;object-fit:contain}.sd-sidebar-v4__logo--image{background:transparent}:host(.sd-sidebar-v4--collapsed) .sd-sidebar-v4__logo{margin-bottom:18px}.sd-sidebar-v4__rail-context:not(:empty){margin:-6px 0 12px}.sd-sidebar-v4__brand{display:flex;flex:1 1 auto;flex-direction:column;min-width:0}.sd-sidebar-v4__title{overflow:hidden;font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-22, 22px);letter-spacing:-.2px;text-overflow:ellipsis;white-space:nowrap}.sd-sidebar-v4__icon-button,.sd-sidebar-v4__search-clear{display:inline-flex;flex:none;align-items:center;justify-content:center;box-sizing:border-box;margin:0;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sidebar-muted-ink);cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease}.sd-sidebar-v4__icon-button:hover,.sd-sidebar-v4__search-clear:hover{background:var(--sidebar-hover-bg)}.sd-sidebar-v4__icon-button:focus-visible,.sd-sidebar-v4__search-clear:focus-visible{outline:none;box-shadow:var(--sidebar-focus-ring)}.sd-sidebar-v4__icon-button{width:40px;height:40px}.sd-sidebar-v4__search{flex:none;padding:0 12px 6px}.sd-sidebar-v4__search-field{display:flex;align-items:center;gap:var(--sd-space-8, 8px);box-sizing:border-box;height:36px;padding:0 8px 0 12px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-surface);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--sd-border) 50%,var(--sd-surface));color:var(--sidebar-muted-ink)}.sd-sidebar-v4__search-field:focus-within{box-shadow:var(--sidebar-focus-ring)}.sd-sidebar-v4__search-field--filled,.sd-sidebar-v4__search-field--filled:focus-within{box-shadow:inset 0 0 0 2px var(--sd-primary)}.sd-sidebar-v4__search-icon{flex:none}.sd-sidebar-v4__search-input{flex:1 1 auto;min-width:0;height:100%;margin:0;padding:0;border:0;outline:0;background:transparent;color:var(--sd-text);font:inherit;font-size:var(--sd-font-size-13, 13px)}.sd-sidebar-v4__search-input::placeholder{color:var(--sidebar-muted-ink);opacity:1}.sd-sidebar-v4__search-clear{width:28px;height:28px}.sd-sidebar-v4__search-shortcut{flex:none;padding:1px 5px;border:1px solid color-mix(in srgb,var(--sd-border) 70%,var(--sd-surface));border-radius:var(--sd-radius-6, 6px);background:var(--sd-surface);color:var(--sidebar-muted-ink);font-family:Roboto Mono,ui-monospace,monospace;font-size:var(--sd-font-size-11, 11px);line-height:var(--sd-line-height-16, 16px);white-space:nowrap}.sd-sidebar-v4__list{flex:1 1 auto;min-height:0;box-sizing:border-box;padding:0 12px 12px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--sidebar-line) transparent}:host(.sd-sidebar-v4--collapsed) .sd-sidebar-v4__list{padding:0 0 12px}.sd-sidebar-v4__section-label{margin:0;padding:14px 12px 4px;color:var(--sidebar-muted-ink);font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-16, 16px);letter-spacing:.3px}.sd-sidebar-v4__tree--separated{margin-top:var(--sd-space-16, 16px)}.sd-sidebar-v4__footer{flex:none;box-sizing:border-box;padding:12px 8px 12px 16px;border-top:1px solid var(--sidebar-line)}:host(:not(.sd-sidebar-v4--collapsed)) .sd-sidebar-v4__footer ::ng-deep .sd-layout-user-menu__popup{box-sizing:border-box;left:-4px;width:calc(var(--sd-sidebar-v4-width) - 24px)}:host(.sd-sidebar-v4--collapsed) .sd-sidebar-v4__footer{display:flex;justify-content:center;padding:6px 0}@media(pointer:coarse){:host,:host(.sd-sidebar-v4--comfortable){--sd-sidebar-v4-item-height: 44px;--sd-sidebar-v4-child-height: 44px}.sd-sidebar-v4__icon-button,.sd-sidebar-v4__search-clear{width:44px;height:44px}.sd-sidebar-v4__search-field{height:44px;padding-right:0}.sd-sidebar-v4__search-shortcut{display:none}}@media(prefers-reduced-motion:reduce){.sd-sidebar-v4__drawer,.sd-sidebar-v4__content,.sd-sidebar-v4__icon-button,.sd-sidebar-v4__search-clear{transition:none}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdLayoutContextSwitcher, selector: "sd-layout-context-switcher", inputs: ["configuration", "appearance", "placement", "anchor"] }, { kind: "component", type: SdLayoutUserMenuComponent, selector: "sd-layout-user-menu", inputs: ["userInfo", "signout", "changePassword", "updateProfile", "setting", "notification", "compact", "presentation"], outputs: ["opened", "closed"] }, { kind: "component", type: SdSidebarV4MenuTree, selector: "sd-sidebar-v4-menu-tree", inputs: ["menus", "pathSource", "activePath", "presentation", "mode", "collapsedGroupKeys", "pinnedKeys", "showPin", "collapsedGroup", "query", "focusedIndex"], outputs: ["collapsedGroupKeysChange", "navigate", "togglePinned", "expandGroup"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4155
+ }
4156
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdSidebarV4, decorators: [{
4157
+ type: Component,
4158
+ args: [{ selector: 'sd-sidebar-v4', standalone: true, imports: [SdIcon, SdLayoutContextSwitcher, SdLayoutUserMenuComponent, SdSidebarV4MenuTree, SdTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, host: {
4159
+ class: 'sd-sidebar-v4',
4160
+ '[class.sd-sidebar-v4--collapsed]': 'isCollapsed()',
4161
+ '[class.sd-sidebar-v4--soft]': 'configuration().itemShape === "soft"',
4162
+ '[class.sd-sidebar-v4--comfortable]': 'configuration().density === "comfortable"',
4163
+ '(document:keydown)': 'onDocumentKeydown($event)',
4164
+ }, template: "@let _collapsed = isCollapsed();\n@let _configuration = configuration();\n@let _query = searchText();\n@let _hasQuery = hasQuery();\n@let _focused = focusedResultIndex();\n@let _hasResults = _focused >= 0;\n@let _pinned = pinnedMenus();\n@let _recent = recentMenus();\n@let _showShortcuts = !_collapsed && !_hasQuery;\n@let _showPinned = _showShortcuts && _pinned.length > 0;\n@let _showRecent = _showShortcuts && recentConfiguration().enabled && _recent.length > 0;\n@let _toggleLabel = (_collapsed ? 'core.module.layout.sidebar.expand' : 'core.module.layout.sidebar.collapse') | sdTranslate;\n@let _searchLabel = 'core.module.layout.sidebar.v4-search-placeholder' | sdTranslate;\n<aside #asideElement data-v4-sidebar class=\"sd-sidebar-v4__drawer\" [attr.data-collapsed]=\"_collapsed\">\n <header\n #headerElement\n data-v4-header\n class=\"sd-sidebar-v4__header\"\n [class.sd-sidebar-v4__header--context-open]=\"!_collapsed && contextOpen()\">\n <span data-v4-logo class=\"sd-sidebar-v4__logo\" [class.sd-sidebar-v4__logo--image]=\"!!_configuration.logoUrl\" aria-hidden=\"true\">\n @if (_configuration.logoUrl) {\n <img [src]=\"_configuration.logoUrl\" alt=\"\" />\n } @else {\n {{ logoInitial() }}\n }\n </span>\n @if (!_collapsed) {\n <div data-v4-brand class=\"sd-sidebar-v4__brand\">\n <span data-v4-title class=\"sd-sidebar-v4__title\">{{ title() }}</span>\n @if (_configuration.context) {\n <sd-layout-context-switcher\n #headerSwitcher\n appearance=\"header\"\n [configuration]=\"_configuration.context\"\n [anchor]=\"headerElement\" />\n }\n </div>\n } @else if (_configuration.context) {\n <sd-layout-context-switcher\n class=\"sd-sidebar-v4__rail-context\"\n appearance=\"rail\"\n [configuration]=\"_configuration.context\"\n [anchor]=\"asideElement\" />\n }\n <!-- The same button stays mounted in both modes so focus survives a toggle. -->\n <button\n type=\"button\"\n data-v4-toggle\n class=\"sd-sidebar-v4__icon-button\"\n [attr.aria-label]=\"_toggleLabel\"\n [attr.aria-expanded]=\"!_collapsed\"\n [attr.title]=\"_toggleLabel\"\n (click)=\"toggleCollapsed()\">\n <sd-icon [name]=\"_collapsed ? 'menu' : 'menu_open'\" size=\"20px\"></sd-icon>\n </button>\n @if (_collapsed) {\n <button\n type=\"button\"\n data-v4-rail-search\n class=\"sd-sidebar-v4__icon-button\"\n [attr.aria-label]=\"_searchLabel\"\n [attr.title]=\"_searchLabel\"\n (click)=\"focusSearch()\">\n <sd-icon name=\"search\" size=\"20px\"></sd-icon>\n </button>\n }\n </header>\n\n @if (!_collapsed) {\n <div data-v4-search class=\"sd-sidebar-v4__search\">\n <div data-v4-search-field class=\"sd-sidebar-v4__search-field\" [class.sd-sidebar-v4__search-field--filled]=\"!!_query\">\n <sd-icon class=\"sd-sidebar-v4__search-icon\" name=\"search\" size=\"20px\" aria-hidden=\"true\"></sd-icon>\n <input\n #searchInput\n data-v4-search-input\n class=\"sd-sidebar-v4__search-input\"\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n aria-autocomplete=\"list\"\n [attr.aria-label]=\"_searchLabel\"\n [attr.placeholder]=\"_searchLabel\"\n [attr.aria-keyshortcuts]=\"shortcutKeys\"\n [attr.aria-expanded]=\"_hasResults\"\n [attr.aria-controls]=\"_hasResults ? mainTree.resultsId : null\"\n [attr.aria-activedescendant]=\"_hasResults ? mainTree.resultOptionId(_focused) : null\"\n [value]=\"_query\"\n (input)=\"onSearchInput($event)\"\n (keydown)=\"onSearchKeydown($event)\" />\n @if (_query) {\n <button\n type=\"button\"\n data-v4-search-clear\n class=\"sd-sidebar-v4__search-clear\"\n [attr.aria-label]=\"'core.module.layout.sidebar.clear-search' | sdTranslate\"\n (click)=\"clearSearch()\">\n <sd-icon name=\"close\" size=\"18px\"></sd-icon>\n </button>\n } @else {\n <kbd data-v4-search-shortcut class=\"sd-sidebar-v4__search-shortcut\" aria-hidden=\"true\">{{ shortcutHint }}</kbd>\n }\n </div>\n </div>\n }\n\n <nav #list data-v4-nav class=\"sd-sidebar-v4__list\" [attr.aria-label]=\"'core.module.layout.sidebar.primary-nav' | sdTranslate\">\n @if (_showPinned) {\n <section data-v4-pinned class=\"sd-sidebar-v4__shortcuts\">\n <h2 class=\"sd-sidebar-v4__section-label\">{{ 'core.module.layout.sidebar.pinned' | sdTranslate }}</h2>\n <sd-sidebar-v4-menu-tree\n presentation=\"shortcuts\"\n [menus]=\"_pinned\"\n [pathSource]=\"menus()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\" />\n </section>\n }\n @if (_showRecent) {\n <section data-v4-recent class=\"sd-sidebar-v4__shortcuts\">\n <h2 class=\"sd-sidebar-v4__section-label\">{{ 'core.module.layout.sidebar.recent' | sdTranslate }}</h2>\n <sd-sidebar-v4-menu-tree\n presentation=\"shortcuts\"\n [menus]=\"_recent\"\n [pathSource]=\"menus()\"\n [activePath]=\"activePath()\"\n [showPin]=\"false\"\n (navigate)=\"navigateMenu($event)\" />\n </section>\n }\n <!-- One tree instance for hierarchy, results and rail: its live region must stay mounted to announce result counts. -->\n <sd-sidebar-v4-menu-tree\n #mainTree\n data-v4-tree\n [class.sd-sidebar-v4__tree--separated]=\"(_showPinned || _showRecent) && leadsWithUnsectioned()\"\n [menus]=\"menus()\"\n [pathSource]=\"menus()\"\n [activePath]=\"activePath()\"\n [presentation]=\"_hasQuery && !_collapsed ? 'results' : 'hierarchy'\"\n [mode]=\"_collapsed ? 'collapsed' : 'expanded'\"\n [(collapsedGroupKeys)]=\"collapsedGroupKeys\"\n [pinnedKeys]=\"pinnedKeys()\"\n [collapsedGroup]=\"_configuration.collapsedGroup\"\n [query]=\"_query\"\n [focusedIndex]=\"_focused\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\"\n (expandGroup)=\"activateCollapsedMenu($event)\" />\n </nav>\n\n <div data-v4-footer class=\"sd-sidebar-v4__footer\">\n <sd-layout-user-menu [userInfo]=\"userInfo()\" [compact]=\"_collapsed\"></sd-layout-user-menu>\n </div>\n</aside>\n\n<main data-v4-content class=\"sd-sidebar-v4__content\">\n <ng-content></ng-content>\n</main>\n", styles: [":host{--sd-sidebar-v4-width: 280px;--sd-sidebar-v4-rail-width: 72px;--sd-sidebar-v4-item-height: 36px;--sd-sidebar-v4-child-height: 32px;--sd-sidebar-v4-item-radius: 999px;--sd-layout-context-switcher-popover-width: calc(var(--sd-sidebar-v4-width) - 24px);--sidebar-bg: var(--sd-sidebar-v4-bg, color-mix(in srgb, var(--sd-text) 4%, var(--sd-surface)));--sd-layout-context-switcher-dot-ring-color: var(--sidebar-bg);--sidebar-line: var(--sd-sidebar-v4-line, color-mix(in srgb, var(--sd-border) 45%, var(--sd-surface)));--sidebar-hover-bg: var(--sd-sidebar-v4-hover-bg, color-mix(in srgb, var(--sd-text) 6%, transparent));--sidebar-muted-ink: var(--sd-text-secondary);--sidebar-focus-ring: inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary));display:block;min-height:100vh}:host(.sd-sidebar-v4--comfortable){--sd-sidebar-v4-item-height: 40px;--sd-sidebar-v4-child-height: 34px}:host(.sd-sidebar-v4--soft){--sd-sidebar-v4-item-radius: 8px}.sd-sidebar-v4__drawer{position:fixed;z-index:var(--sd-z-sidebar, 20);inset:0 auto 0 0;display:flex;flex-direction:column;box-sizing:border-box;width:var(--sd-sidebar-v4-width);border-right:1px solid var(--sidebar-line);background:var(--sidebar-bg);color:var(--sd-text);transition:width .16s ease}:host(.sd-sidebar-v4--collapsed) .sd-sidebar-v4__drawer{width:var(--sd-sidebar-v4-rail-width)}.sd-sidebar-v4__content{min-height:100vh;margin-left:var(--sd-sidebar-v4-width);transition:margin-left .16s ease}:host(.sd-sidebar-v4--collapsed) .sd-sidebar-v4__content{margin-left:var(--sd-sidebar-v4-rail-width)}.sd-sidebar-v4__header{display:flex;flex:none;align-items:center;gap:var(--sd-space-12, 12px);box-sizing:border-box;height:64px;padding:0 12px 0 16px}.sd-sidebar-v4__header--context-open{border-radius:var(--sd-radius-12, 12px);background:var(--sidebar-hover-bg)}.sd-sidebar-v4__header--context-open ::ng-deep .sd-layout-context-switcher__trigger.sd-layout-context-switcher__trigger--header{background:transparent}:host(.sd-sidebar-v4--collapsed) .sd-sidebar-v4__header{flex-direction:column;gap:0;height:auto;padding:18px 0 6px}.sd-sidebar-v4__logo{display:inline-flex;flex:none;align-items:center;justify-content:center;overflow:hidden;width:28px;height:28px;border-radius:var(--sd-radius-8, 8px);background:var(--sd-primary);color:var(--sd-primary-contrast);font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-bold, 700);line-height:1}.sd-sidebar-v4__logo img{width:100%;height:100%;object-fit:contain}.sd-sidebar-v4__logo--image{background:transparent}:host(.sd-sidebar-v4--collapsed) .sd-sidebar-v4__logo{margin-bottom:18px}.sd-sidebar-v4__rail-context:not(:empty){margin:-6px 0 12px}.sd-sidebar-v4__brand{display:flex;flex:1 1 auto;flex-direction:column;min-width:0}.sd-sidebar-v4__title{overflow:hidden;font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-22, 22px);letter-spacing:-.2px;text-overflow:ellipsis;white-space:nowrap}.sd-sidebar-v4__icon-button,.sd-sidebar-v4__search-clear{display:inline-flex;flex:none;align-items:center;justify-content:center;box-sizing:border-box;margin:0;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sidebar-muted-ink);cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease}.sd-sidebar-v4__icon-button:hover,.sd-sidebar-v4__search-clear:hover{background:var(--sidebar-hover-bg)}.sd-sidebar-v4__icon-button:focus-visible,.sd-sidebar-v4__search-clear:focus-visible{outline:none;box-shadow:var(--sidebar-focus-ring)}.sd-sidebar-v4__icon-button{width:40px;height:40px}.sd-sidebar-v4__search{flex:none;padding:0 12px 6px}.sd-sidebar-v4__search-field{display:flex;align-items:center;gap:var(--sd-space-8, 8px);box-sizing:border-box;height:36px;padding:0 8px 0 12px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-surface);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--sd-border) 50%,var(--sd-surface));color:var(--sidebar-muted-ink)}.sd-sidebar-v4__search-field:focus-within{box-shadow:var(--sidebar-focus-ring)}.sd-sidebar-v4__search-field--filled,.sd-sidebar-v4__search-field--filled:focus-within{box-shadow:inset 0 0 0 2px var(--sd-primary)}.sd-sidebar-v4__search-icon{flex:none}.sd-sidebar-v4__search-input{flex:1 1 auto;min-width:0;height:100%;margin:0;padding:0;border:0;outline:0;background:transparent;color:var(--sd-text);font:inherit;font-size:var(--sd-font-size-13, 13px)}.sd-sidebar-v4__search-input::placeholder{color:var(--sidebar-muted-ink);opacity:1}.sd-sidebar-v4__search-clear{width:28px;height:28px}.sd-sidebar-v4__search-shortcut{flex:none;padding:1px 5px;border:1px solid color-mix(in srgb,var(--sd-border) 70%,var(--sd-surface));border-radius:var(--sd-radius-6, 6px);background:var(--sd-surface);color:var(--sidebar-muted-ink);font-family:Roboto Mono,ui-monospace,monospace;font-size:var(--sd-font-size-11, 11px);line-height:var(--sd-line-height-16, 16px);white-space:nowrap}.sd-sidebar-v4__list{flex:1 1 auto;min-height:0;box-sizing:border-box;padding:0 12px 12px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--sidebar-line) transparent}:host(.sd-sidebar-v4--collapsed) .sd-sidebar-v4__list{padding:0 0 12px}.sd-sidebar-v4__section-label{margin:0;padding:14px 12px 4px;color:var(--sidebar-muted-ink);font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-16, 16px);letter-spacing:.3px}.sd-sidebar-v4__tree--separated{margin-top:var(--sd-space-16, 16px)}.sd-sidebar-v4__footer{flex:none;box-sizing:border-box;padding:12px 8px 12px 16px;border-top:1px solid var(--sidebar-line)}:host(:not(.sd-sidebar-v4--collapsed)) .sd-sidebar-v4__footer ::ng-deep .sd-layout-user-menu__popup{box-sizing:border-box;left:-4px;width:calc(var(--sd-sidebar-v4-width) - 24px)}:host(.sd-sidebar-v4--collapsed) .sd-sidebar-v4__footer{display:flex;justify-content:center;padding:6px 0}@media(pointer:coarse){:host,:host(.sd-sidebar-v4--comfortable){--sd-sidebar-v4-item-height: 44px;--sd-sidebar-v4-child-height: 44px}.sd-sidebar-v4__icon-button,.sd-sidebar-v4__search-clear{width:44px;height:44px}.sd-sidebar-v4__search-field{height:44px;padding-right:0}.sd-sidebar-v4__search-shortcut{display:none}}@media(prefers-reduced-motion:reduce){.sd-sidebar-v4__drawer,.sd-sidebar-v4__content,.sd-sidebar-v4__icon-button,.sd-sidebar-v4__search-clear{transition:none}}\n"] }]
4165
+ }], ctorParameters: () => [], propDecorators: { searchInput: [{ type: i0.ViewChild, args: ['searchInput', { isSignal: true }] }], list: [{ type: i0.ViewChild, args: ['list', { isSignal: true }] }], mainTree: [{ type: i0.ViewChild, args: ['mainTree', { isSignal: true }] }], headerSwitcher: [{ type: i0.ViewChild, args: ['headerSwitcher', { isSignal: true }] }], menus: [{ type: i0.Input, args: [{ isSignal: true, alias: "menus", required: false }] }], userInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "userInfo", required: true }] }], sidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebar", required: true }] }] } });
4166
+ function isApplePlatform(navigator) {
4167
+ const userAgentData = navigator?.userAgentData;
4168
+ return /mac|iphone|ipad|ipod/i.test(userAgentData?.platform || navigator?.platform || '');
4169
+ }
4170
+
4171
+ let nextMobileV4Id = 0;
4172
+ /**
4173
+ * Sidebar V4 mobile shell (README M1–M3): a 56px app bar, a `min(88vw, 360px)` modal drawer that hosts the V4 menu tree in
4174
+ * `mobile` mode (44px rows, combobox search, Pinned/Recent, account footer, Context Switcher bottom sheet) and an opt-in
4175
+ * bottom bar built from `mobile.bottomBar` (at most 4 menu ids plus "More"). Routed content is projected into `<main>`.
4176
+ *
4177
+ * Navigation, pinned and recent behave like `sd-sidebar-v4`. Every way of closing the drawer (backdrop, Escape, menu
4178
+ * selection, including the page already open) clears the search and returns focus to the control that opened it (INV-011).
4179
+ * Options are read only after `normalizeSidebarConfiguration` (INV-012). Mobile has no rail, so the collapse preference is
4180
+ * never read or written. With `context` configured, `context.items` reach `SdLayoutContextService.syncItems()` on init,
4181
+ * before the drawer and its switcher first render; without it the context service is never created.
4182
+ */
4183
+ class SdSidebarMobileV4 {
4184
+ #router = inject(Router);
4185
+ #document = inject(DOCUMENT);
4186
+ #destroyRef = inject(DestroyRef);
4187
+ #injector = inject(Injector);
4188
+ #navigationState = inject(SdLayoutNavigationStateService);
4189
+ #id = `sd-sidebar-mobile-v4-${nextMobileV4Id++}`;
4190
+ /** Requested result index; `focusedResultIndex` clamps it to the current results. */
4191
+ #focusRequest = signal(0, ...(ngDevMode ? [{ debugName: "#focusRequest" }] : /* istanbul ignore next */ []));
4192
+ #restoreFocusElement = null;
4193
+ #previousBodyOverflow = '';
4194
+ trigger = viewChild('trigger', ...(ngDevMode ? [{ debugName: "trigger" }] : /* istanbul ignore next */ []));
4195
+ searchInput = viewChild('searchInput', ...(ngDevMode ? [{ debugName: "searchInput" }] : /* istanbul ignore next */ []));
4196
+ list = viewChild('list', ...(ngDevMode ? [{ debugName: "list" }] : /* istanbul ignore next */ []));
4197
+ mainTree = viewChild('mainTree', ...(ngDevMode ? [{ debugName: "mainTree" }] : /* istanbul ignore next */ []));
4198
+ menus = input([], ...(ngDevMode ? [{ debugName: "menus" }] : /* istanbul ignore next */ []));
4199
+ userInfo = input.required(...(ngDevMode ? [{ debugName: "userInfo" }] : /* istanbul ignore next */ []));
4200
+ sidebar = input.required(...(ngDevMode ? [{ debugName: "sidebar" }] : /* istanbul ignore next */ []));
4201
+ /** `sidebar()` with the V4 defaults filled by `normalizeSidebarConfiguration`, the only place they are resolved (INV-012). */
4202
+ configuration = computed(() => normalizeSidebarConfiguration(this.sidebar()), ...(ngDevMode ? [{ debugName: "configuration" }] : /* istanbul ignore next */ []));
4203
+ isDrawerOpen = signal(false, ...(ngDevMode ? [{ debugName: "isDrawerOpen" }] : /* istanbul ignore next */ []));
4204
+ searchText = signal('', ...(ngDevMode ? [{ debugName: "searchText" }] : /* istanbul ignore next */ []));
4205
+ activePath = signal(this.#router.url.split(/[?#]/, 1)[0] ?? '', ...(ngDevMode ? [{ debugName: "activePath" }] : /* istanbul ignore next */ []));
4206
+ collapsedGroupKeys = signal([], ...(ngDevMode ? [{ debugName: "collapsedGroupKeys" }] : /* istanbul ignore next */ []));
4207
+ /** The drawer was opened from the app-bar search button: its search input takes the initial focus. */
4208
+ focusSearchOnOpen = signal(false, ...(ngDevMode ? [{ debugName: "focusSearchOnOpen" }] : /* istanbul ignore next */ []));
4209
+ /** Search results in the order the tree renders its options (accent-insensitive, without `comingSoon` items). */
4210
+ searchResults = computed(() => buildSidebarV4SearchResults(this.menus(), this.searchText()), ...(ngDevMode ? [{ debugName: "searchResults" }] : /* istanbul ignore next */ []));
4211
+ /** Index of the keyboard-selected result: the first one when results appear, -1 when there is none. */
4212
+ focusedResultIndex = computed(() => {
4213
+ const count = this.searchResults().length;
4214
+ return count ? Math.min(Math.max(this.#focusRequest(), 0), count - 1) : -1;
4215
+ }, ...(ngDevMode ? [{ debugName: "focusedResultIndex" }] : /* istanbul ignore next */ []));
4216
+ recentConfiguration = computed(() => this.configuration().recent, ...(ngDevMode ? [{ debugName: "recentConfiguration" }] : /* istanbul ignore next */ []));
4217
+ pinnedKeys = this.#navigationState.pinnedKeys;
4218
+ pinnedMenus = this.#navigationState.pinnedMenus;
4219
+ recentMenus = this.#navigationState.recentMenus;
4220
+ titleId = `${this.#id}-title`;
4221
+ hasQuery = computed(() => !!this.searchText().trim(), ...(ngDevMode ? [{ debugName: "hasQuery" }] : /* istanbul ignore next */ []));
4222
+ title = computed(() => this.configuration().defaultTitle || 'Back Office', ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
4223
+ logoInitial = computed(() => Array.from(this.title().trim())[0]?.toLocaleUpperCase() ?? '', ...(ngDevMode ? [{ debugName: "logoInitial" }] : /* istanbul ignore next */ []));
4224
+ /** The hierarchy starts with items that have no section heading. */
4225
+ leadsWithUnsectioned = computed(() => groupMenusBySection(this.menus())[0]?.section === null, ...(ngDevMode ? [{ debugName: "leadsWithUnsectioned" }] : /* istanbul ignore next */ []));
4226
+ displayName = computed(() => {
4227
+ const user = this.userInfo();
4228
+ return user.fullName || user.username || user.email || '';
4229
+ }, ...(ngDevMode ? [{ debugName: "displayName" }] : /* istanbul ignore next */ []));
4230
+ /** First letters of the first and last word of the display name, as on the README M1 avatar. */
4231
+ userInitials = computed(() => {
4232
+ const words = this.displayName().trim().split(/\s+/).filter(Boolean);
4233
+ const first = Array.from(words[0] ?? '')[0] ?? '';
4234
+ const last = words.length > 1 ? (Array.from(words[words.length - 1])[0] ?? '') : '';
4235
+ return (first + last).toLocaleUpperCase();
4236
+ }, ...(ngDevMode ? [{ debugName: "userInitials" }] : /* istanbul ignore next */ []));
4237
+ /** Menus of `mobile.bottomBar` that exist in `menus` (looked up by `id` at any depth), in configured order. */
4238
+ destinations = computed(() => {
4239
+ const ids = this.configuration().mobile?.bottomBar ?? [];
4240
+ if (!ids.length)
4241
+ return [];
4242
+ const menus = this.menus();
4243
+ const entries = indexMenusById(menus);
4244
+ const activeMenuPath = resolveActiveMenuPath(menus, this.activePath());
4245
+ return ids
4246
+ .map(id => entries.get(id))
4247
+ .filter((entry) => !!entry)
4248
+ .map((entry, index) => {
4249
+ const { menu, key } = entry;
4250
+ const isGroup = 'children' in menu && Array.isArray(menu.children) && menu.children.length > 0;
4251
+ const path = 'path' in menu && typeof menu.path === 'string' ? menu.path : '';
4252
+ const trailing = resolveMenuTrailing(menu);
4253
+ const live = trailing?.kind === 'status' && trailing.live ? trailing : null;
4254
+ return {
4255
+ menu,
4256
+ key,
4257
+ label: menu.tooltipTitle || menu.title || '',
4258
+ isGroup,
4259
+ isActive: !!activeMenuPath && (isGroup ? containsMenuPath(menu, activeMenuPath) : path === activeMenuPath),
4260
+ disabled: menu.comingSoon === true,
4261
+ expandKeys: [...entry.ancestorKeys, key],
4262
+ badge: trailing?.kind === 'badge' ? { value: trailing.value, tone: trailing.tone } : null,
4263
+ liveTone: live?.tone ?? null,
4264
+ liveLabel: live?.label ?? '',
4265
+ descriptionId: `${this.#id}-destination-${index}`,
4266
+ };
4267
+ });
4268
+ }, ...(ngDevMode ? [{ debugName: "destinations" }] : /* istanbul ignore next */ []));
4269
+ constructor() {
4270
+ effect(() => {
4271
+ const menus = this.menus();
4272
+ const maximum = this.configuration().recent.maxItems;
4273
+ untracked(() => this.#navigationState.hydrate(menus, maximum));
4274
+ });
4275
+ // why: switcher chỉ mount khi drawer mở — đối chiếu context ngay lúc khởi tạo (D-021) để listener nhiều tab chạy từ
4276
+ // đầu và lần chạm đầu vào menu không kích reload đối chiếu. Không có `context` thì không lấy service: app không cấu
4277
+ // hình context không tạo service lẫn listener.
4278
+ effect(() => {
4279
+ const context = this.configuration().context;
4280
+ if (!context)
4281
+ return;
4282
+ const items = context.items;
4283
+ untracked(() => this.#injector.get(SdLayoutContextService).syncItems(items));
4284
+ });
4285
+ this.#router.events.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(event => {
4286
+ if (event instanceof NavigationEnd) {
4287
+ this.activePath.set(event.urlAfterRedirects.split(/[?#]/, 1)[0] ?? '');
4288
+ this.closeFromNavigation();
4289
+ return;
4290
+ }
4291
+ // why: chọn đúng trang đang mở thì router bỏ qua (NavigationSkipped, navigate trả false) — vẫn là một lựa chọn menu
4292
+ // nên đóng drawer. Điều hướng bị guard huỷ (NavigationCancel) giữ drawer mở.
4293
+ if (event instanceof NavigationSkipped)
4294
+ this.closeFromNavigation();
4295
+ });
4296
+ effect(() => {
4297
+ const menus = this.menus();
4298
+ const activeMenuPath = resolveActiveMenuPath(menus, this.activePath());
4299
+ if (!activeMenuPath)
4300
+ return;
4301
+ const activeGroupKeys = new Set();
4302
+ const visit = (items, ancestors) => {
4303
+ for (const menu of items) {
4304
+ if (!('children' in menu) || !containsMenuPath(menu, activeMenuPath))
4305
+ continue;
4306
+ const key = getMenuStableKey(menu, ancestors);
4307
+ activeGroupKeys.add(key);
4308
+ visit(menu.children ?? [], [...ancestors, menu.title ?? key]);
4309
+ }
4310
+ };
4311
+ visit(menus, []);
4312
+ // why: Chỉ mở nhánh khi route/menu đổi; người dùng vẫn được đóng nhánh đang active.
4313
+ untracked(() => this.collapsedGroupKeys.update(keys => keys.filter(key => !activeGroupKeys.has(key))));
4314
+ });
4315
+ // why: chỉ trả lại overflow của body khi chính drawer đang khoá cuộn — không ghi đè giá trị phần khác đặt sau đó.
4316
+ this.#destroyRef.onDestroy(() => {
4317
+ if (this.isDrawerOpen())
4318
+ this.#releaseBodyScroll();
4319
+ });
4320
+ }
4321
+ /** Opens the drawer; focus returns to `trigger` (default: the focused element, else the app-bar menu button) on close. */
4322
+ openDrawer(trigger) {
4323
+ if (this.isDrawerOpen())
4324
+ return;
4325
+ const active = this.#document.activeElement;
4326
+ this.#restoreFocusElement =
4327
+ trigger instanceof HTMLElement
4328
+ ? trigger
4329
+ : active instanceof HTMLElement && active !== this.#document.body
4330
+ ? active
4331
+ : (this.trigger()?.nativeElement ?? null);
4332
+ // why: cdkTrapFocusAutoCapture trả focus về phần tử đang focus lúc mở khi drawer bị huỷ. Safari/iOS không focus nút
4333
+ // khi chạm, nên focus trigger trước để lần trả focus đó trùng trigger thay vì nhảy về phần tử khác trong trang.
4334
+ this.#restoreFocusElement?.focus({ preventScroll: true });
4335
+ this.#previousBodyOverflow = this.#document.body.style.overflow;
4336
+ this.#document.body.style.overflow = 'hidden';
4337
+ this.isDrawerOpen.set(true);
4338
+ }
4339
+ /** Opens the drawer with its search focused; focus returns to `trigger` on close. */
4340
+ openSearch(trigger) {
4341
+ if (this.isDrawerOpen()) {
4342
+ this.#focusSearchField();
4343
+ return;
4344
+ }
4345
+ this.focusSearchOnOpen.set(true);
4346
+ this.openDrawer(trigger);
4347
+ }
4348
+ closeFromBackdrop() {
4349
+ this.#closeDrawer();
4350
+ }
4351
+ closeFromEscape() {
4352
+ this.#closeDrawer();
4353
+ }
4354
+ closeFromNavigation() {
4355
+ this.#closeDrawer();
4356
+ }
4357
+ onDrawerKeydown(event) {
4358
+ // why: Esc đã được lớp trong xử lý (xoá query, đóng popup tài khoản) hoặc đang huỷ gõ IME thì không đóng luôn drawer.
4359
+ if (event.key !== 'Escape' || event.defaultPrevented || event.isComposing)
4360
+ return;
4361
+ event.preventDefault();
4362
+ this.closeFromEscape();
4363
+ }
4364
+ navigateMenu(menu) {
4365
+ if (!('path' in menu))
4366
+ return;
4367
+ this.#navigationState.recordRecent(menu, this.recentConfiguration());
4368
+ // why: `includes('http')` là substring test — `javascript:fetch(...)//http` lọt qua và chạy như
4369
+ // script trong origin của app. Parse URL thật rồi mới mở, kèm `noopener,noreferrer`.
4370
+ if (sdIsExternalHttpUrl(menu.path)) {
4371
+ sdOpenExternal(menu.path);
4372
+ this.closeFromNavigation();
4373
+ return;
4374
+ }
4375
+ void this.#router
4376
+ .navigate([menu.path.split('?')[0]], { queryParams: menu.queryParams ?? {}, state: { switchTab: true } })
4377
+ .then(navigated => {
4378
+ if (navigated)
4379
+ this.closeFromNavigation();
4380
+ });
4381
+ }
4382
+ onTogglePinned(menu) {
4383
+ this.#navigationState.togglePinned(menu);
4384
+ }
4385
+ activateDestination(destination, trigger) {
4386
+ if (destination.disabled)
4387
+ return;
4388
+ if (!destination.isGroup) {
4389
+ this.navigateMenu(destination.menu);
4390
+ return;
4391
+ }
4392
+ // why: group không có route — mở drawer tại đúng group đó (và các group cha) như rail V4 với collapsedGroup 'expand'.
4393
+ const keys = new Set(destination.expandKeys);
4394
+ this.collapsedGroupKeys.update(current => current.filter(key => !keys.has(key)));
4395
+ this.openDrawer(trigger);
4396
+ }
4397
+ onSearchInput(event) {
4398
+ const value = event.target.value;
4399
+ this.searchText.set(value);
4400
+ this.#focusRequest.set(0);
4401
+ // why: kết quả bắt đầu ở đầu list và kết quả đầu được chọn sẵn — bỏ vị trí cuộn cũ của cây để nó luôn thấy được.
4402
+ const list = this.list()?.nativeElement;
4403
+ if (value.trim() && list)
4404
+ list.scrollTop = 0;
4405
+ }
4406
+ clearSearch() {
4407
+ this.#clearQuery();
4408
+ this.searchInput()?.nativeElement.focus();
4409
+ }
4410
+ onSearchKeydown(event) {
4411
+ if (event.isComposing)
4412
+ return;
4413
+ switch (event.key) {
4414
+ case 'ArrowDown':
4415
+ case 'ArrowUp': {
4416
+ const count = this.searchResults().length;
4417
+ if (!count)
4418
+ return;
4419
+ event.preventDefault();
4420
+ const next = Math.min(Math.max(this.focusedResultIndex() + (event.key === 'ArrowDown' ? 1 : -1), 0), count - 1);
4421
+ this.#focusRequest.set(next);
4422
+ this.#revealResult(next);
4423
+ return;
4424
+ }
4425
+ case 'Enter': {
4426
+ const result = this.searchResults()[this.focusedResultIndex()];
4427
+ if (!result)
4428
+ return;
4429
+ event.preventDefault();
4430
+ this.navigateMenu(result.menu);
4431
+ return;
4432
+ }
4433
+ case 'Escape':
4434
+ // why: Esc đầu xoá query như gợi ý "Esc clear" của kết quả; ô đã trống thì để Esc tới drawer và đóng nó.
4435
+ if (!this.searchText())
4436
+ return;
4437
+ event.preventDefault();
4438
+ this.#clearQuery();
4439
+ }
4440
+ }
4441
+ #revealResult(index) {
4442
+ const tree = this.mainTree();
4443
+ // why: listbox cuộn trong nav — option được chọn phải luôn nằm trong vùng thấy được (WCAG 2.4.11).
4444
+ if (tree)
4445
+ this.#document.getElementById(tree.resultOptionId(index))?.scrollIntoView({ block: 'nearest' });
4446
+ }
4447
+ #focusSearchField() {
4448
+ const field = this.searchInput()?.nativeElement;
4449
+ field?.focus();
4450
+ field?.select();
4451
+ }
4452
+ #clearQuery() {
4453
+ this.searchText.set('');
4454
+ this.#focusRequest.set(0);
4455
+ }
4456
+ #closeDrawer() {
4457
+ if (!this.isDrawerOpen())
4458
+ return;
4459
+ this.isDrawerOpen.set(false);
4460
+ this.focusSearchOnOpen.set(false);
4461
+ this.#clearQuery();
4462
+ this.#releaseBodyScroll();
4463
+ (this.#restoreFocusElement ?? this.trigger()?.nativeElement)?.focus();
4464
+ this.#restoreFocusElement = null;
4465
+ }
4466
+ #releaseBodyScroll() {
4467
+ this.#document.body.style.overflow = this.#previousBodyOverflow;
4468
+ }
4469
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdSidebarMobileV4, deps: [], target: i0.ɵɵFactoryTarget.Component });
4470
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdSidebarMobileV4, isStandalone: true, selector: "sd-sidebar-mobile-v4", inputs: { menus: { classPropertyName: "menus", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null }, userInfo: { classPropertyName: "userInfo", publicName: "userInfo", isSignal: true, isRequired: true, transformFunction: null }, sidebar: { classPropertyName: "sidebar", publicName: "sidebar", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class.sd-sidebar-mobile-v4--soft": "configuration().itemShape === \"soft\"", "class.sd-sidebar-mobile-v4--bottom-bar": "destinations().length > 0" }, classAttribute: "sd-sidebar-mobile-v4" }, viewQueries: [{ propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true, isSignal: true }, { propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }, { propertyName: "list", first: true, predicate: ["list"], descendants: true, isSignal: true }, { propertyName: "mainTree", first: true, predicate: ["mainTree"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _open = isDrawerOpen();\n@let _configuration = configuration();\n@let _destinations = destinations();\n@let _searchLabel = 'core.module.layout.sidebar.v4-search-placeholder' | sdTranslate;\n@let _navLabel = 'core.module.layout.sidebar.primary-nav' | sdTranslate;\n<header data-v4m-appbar class=\"sd-sidebar-mobile-v4__appbar\">\n <button\n #trigger\n type=\"button\"\n data-v4m-menu-trigger\n class=\"sd-sidebar-mobile-v4__icon-button sd-sidebar-mobile-v4__icon-button--appbar\"\n aria-haspopup=\"dialog\"\n [attr.aria-label]=\"'core.module.layout.sidebar.open-menu' | sdTranslate\"\n [attr.aria-expanded]=\"_open\"\n (click)=\"openDrawer($event.currentTarget)\">\n <sd-icon name=\"menu\" size=\"24px\"></sd-icon>\n </button>\n <span data-v4m-appbar-title class=\"sd-sidebar-mobile-v4__appbar-title\">{{ title() }}</span>\n <button\n type=\"button\"\n data-v4m-search-trigger\n class=\"sd-sidebar-mobile-v4__icon-button sd-sidebar-mobile-v4__icon-button--appbar\"\n aria-haspopup=\"dialog\"\n [attr.aria-label]=\"_searchLabel\"\n (click)=\"openSearch($event.currentTarget)\">\n <sd-icon name=\"search\" size=\"22px\"></sd-icon>\n </button>\n @let _displayName = displayName();\n <span\n data-v4m-avatar\n class=\"sd-sidebar-mobile-v4__avatar\"\n [attr.role]=\"_displayName ? 'img' : null\"\n [attr.aria-label]=\"_displayName || null\"\n [attr.aria-hidden]=\"_displayName ? null : 'true'\"\n >{{ userInitials() }}</span\n >\n</header>\n\n<main data-v4m-content class=\"sd-sidebar-mobile-v4__content\">\n <ng-content></ng-content>\n</main>\n\n@if (_destinations.length) {\n <nav data-v4m-bottom-bar class=\"sd-sidebar-mobile-v4__bottom-bar\" [attr.aria-label]=\"_navLabel\">\n @for (item of _destinations; track item.key) {\n <button\n #destinationButton\n type=\"button\"\n class=\"sd-sidebar-mobile-v4__destination\"\n [class.sd-sidebar-mobile-v4__destination--active]=\"item.isActive\"\n [class.sd-sidebar-mobile-v4__destination--disabled]=\"item.disabled\"\n [attr.data-v4m-destination]=\"item.key\"\n [attr.aria-current]=\"item.isActive ? (item.isGroup ? 'true' : 'page') : null\"\n [attr.aria-disabled]=\"item.disabled || null\"\n [attr.aria-haspopup]=\"item.isGroup && !item.disabled ? 'dialog' : null\"\n [attr.aria-describedby]=\"item.badge || item.liveTone ? item.descriptionId : null\"\n (click)=\"activateDestination(item, destinationButton)\">\n <span data-v4m-indicator class=\"sd-sidebar-mobile-v4__indicator\">\n @if (item.menu.iconUrl) {\n <img class=\"sd-sidebar-mobile-v4__destination-image\" [src]=\"item.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon\n [name]=\"item.menu.icon || (item.isGroup ? 'folder' : 'chevron_right')\"\n [fontSet]=\"item.isActive ? 'material-icons' : 'material-icons-outlined'\"\n size=\"22px\"></sd-icon>\n }\n @if (item.badge) {\n <span\n data-v4m-badge\n class=\"sd-sidebar-mobile-v4__badge\"\n [class.sd-sidebar-mobile-v4__badge--error]=\"item.badge.tone === 'error'\"\n aria-hidden=\"true\">\n {{ item.badge.value }}\n </span>\n } @else if (item.liveTone) {\n <span data-v4m-live class=\"sd-sidebar-mobile-v4__live\" [attr.data-tone]=\"item.liveTone\" aria-hidden=\"true\"></span>\n }\n </span>\n <span data-v4m-label class=\"sd-sidebar-mobile-v4__label\">{{ item.label }}</span>\n @if (item.badge) {\n <span hidden [id]=\"item.descriptionId\">{{\n 'core.module.layout.sidebar.badge-pending' | sdTranslate: { count: item.badge.value }\n }}</span>\n } @else if (item.liveTone) {\n <span hidden [id]=\"item.descriptionId\">{{ item.liveLabel }}</span>\n }\n </button>\n }\n <button\n type=\"button\"\n data-v4m-more\n class=\"sd-sidebar-mobile-v4__destination\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"_open\"\n (click)=\"openDrawer($event.currentTarget)\">\n <span data-v4m-indicator class=\"sd-sidebar-mobile-v4__indicator\">\n <sd-icon name=\"menu\" size=\"22px\"></sd-icon>\n </span>\n <span data-v4m-label class=\"sd-sidebar-mobile-v4__label\">{{ 'core.module.layout.sidebar.more' | sdTranslate }}</span>\n </button>\n </nav>\n}\n\n@if (_open) {\n @let _query = searchText();\n @let _hasQuery = hasQuery();\n @let _focused = focusedResultIndex();\n @let _hasResults = _focused >= 0;\n @let _pinned = pinnedMenus();\n @let _recent = recentMenus();\n @let _showPinned = !_hasQuery && _pinned.length > 0;\n @let _showRecent = !_hasQuery && recentConfiguration().enabled && _recent.length > 0;\n <button\n type=\"button\"\n data-v4m-backdrop\n class=\"sd-sidebar-mobile-v4__backdrop\"\n [attr.aria-label]=\"'core.module.layout.sidebar.close-menu' | sdTranslate\"\n (click)=\"closeFromBackdrop()\"></button>\n <aside\n data-v4m-drawer\n class=\"sd-sidebar-mobile-v4__drawer\"\n role=\"dialog\"\n aria-modal=\"true\"\n tabindex=\"-1\"\n [attr.aria-labelledby]=\"titleId\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onDrawerKeydown($event)\">\n <header data-v4m-header class=\"sd-sidebar-mobile-v4__header\">\n <span class=\"sd-sidebar-mobile-v4__logo\" [class.sd-sidebar-mobile-v4__logo--image]=\"!!_configuration.logoUrl\" aria-hidden=\"true\">\n @if (_configuration.logoUrl) {\n <img [src]=\"_configuration.logoUrl\" alt=\"\" />\n } @else {\n {{ logoInitial() }}\n }\n </span>\n <div class=\"sd-sidebar-mobile-v4__brand\">\n <span data-v4m-drawer-title class=\"sd-sidebar-mobile-v4__title\" [id]=\"titleId\">{{ title() }}</span>\n @if (_configuration.context) {\n <sd-layout-context-switcher appearance=\"sheet\" [configuration]=\"_configuration.context\" />\n }\n </div>\n <button\n type=\"button\"\n data-v4m-close\n class=\"sd-sidebar-mobile-v4__icon-button\"\n [attr.aria-label]=\"'core.common.close' | sdTranslate\"\n (click)=\"closeFromBackdrop()\">\n <sd-icon name=\"close\" size=\"22px\"></sd-icon>\n </button>\n </header>\n\n <div data-v4m-search class=\"sd-sidebar-mobile-v4__search\">\n <div data-v4m-search-field class=\"sd-sidebar-mobile-v4__search-field\" [class.sd-sidebar-mobile-v4__search-field--filled]=\"!!_query\">\n <sd-icon class=\"sd-sidebar-mobile-v4__search-icon\" name=\"search\" size=\"20px\" aria-hidden=\"true\"></sd-icon>\n <input\n #searchInput\n data-v4m-search-input\n class=\"sd-sidebar-mobile-v4__search-input\"\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n aria-autocomplete=\"list\"\n [attr.cdkFocusInitial]=\"focusSearchOnOpen() ? '' : null\"\n [attr.aria-label]=\"_searchLabel\"\n [attr.placeholder]=\"_searchLabel\"\n [attr.aria-expanded]=\"_hasResults\"\n [attr.aria-controls]=\"_hasResults ? mainTree.resultsId : null\"\n [attr.aria-activedescendant]=\"_hasResults ? mainTree.resultOptionId(_focused) : null\"\n [value]=\"_query\"\n (input)=\"onSearchInput($event)\"\n (keydown)=\"onSearchKeydown($event)\" />\n @if (_query) {\n <button\n type=\"button\"\n data-v4m-search-clear\n class=\"sd-sidebar-mobile-v4__search-clear\"\n [attr.aria-label]=\"'core.module.layout.sidebar.clear-search' | sdTranslate\"\n (click)=\"clearSearch()\">\n <sd-icon name=\"close\" size=\"18px\"></sd-icon>\n </button>\n }\n </div>\n </div>\n\n <nav #list data-v4m-nav class=\"sd-sidebar-mobile-v4__list\" [attr.aria-label]=\"'core.module.layout.sidebar.all-menu' | sdTranslate\">\n @if (_showPinned) {\n <section data-v4m-pinned class=\"sd-sidebar-mobile-v4__shortcuts\">\n <h2 class=\"sd-sidebar-mobile-v4__section-label\">{{ 'core.module.layout.sidebar.pinned' | sdTranslate }}</h2>\n <sd-sidebar-v4-menu-tree\n presentation=\"shortcuts\"\n mode=\"mobile\"\n [menus]=\"_pinned\"\n [pathSource]=\"menus()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\" />\n </section>\n }\n @if (_showRecent) {\n <section data-v4m-recent class=\"sd-sidebar-mobile-v4__shortcuts\">\n <h2 class=\"sd-sidebar-mobile-v4__section-label\">{{ 'core.module.layout.sidebar.recent' | sdTranslate }}</h2>\n <sd-sidebar-v4-menu-tree\n presentation=\"shortcuts\"\n mode=\"mobile\"\n [menus]=\"_recent\"\n [pathSource]=\"menus()\"\n [activePath]=\"activePath()\"\n [showPin]=\"false\"\n (navigate)=\"navigateMenu($event)\" />\n </section>\n }\n <!-- One tree instance for hierarchy and results: its live region must stay mounted to announce result counts. -->\n <sd-sidebar-v4-menu-tree\n #mainTree\n data-v4m-tree\n mode=\"mobile\"\n [class.sd-sidebar-mobile-v4__tree--separated]=\"(_showPinned || _showRecent) && leadsWithUnsectioned()\"\n [menus]=\"menus()\"\n [pathSource]=\"menus()\"\n [activePath]=\"activePath()\"\n [presentation]=\"_hasQuery ? 'results' : 'hierarchy'\"\n [(collapsedGroupKeys)]=\"collapsedGroupKeys\"\n [pinnedKeys]=\"pinnedKeys()\"\n [query]=\"_query\"\n [focusedIndex]=\"_focused\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\" />\n </nav>\n\n <div data-v4m-footer class=\"sd-sidebar-mobile-v4__footer\">\n <sd-layout-user-menu [userInfo]=\"userInfo()\"></sd-layout-user-menu>\n </div>\n </aside>\n}\n", styles: [":host{--sd-sidebar-v4-item-height: 44px;--sd-sidebar-v4-child-height: 44px;--sd-sidebar-v4-item-radius: 999px;--sidebar-drawer-width: min(88vw, 360px);--sidebar-bottom-bar-height: 64px;--sidebar-bg: var(--sd-sidebar-v4-bg, color-mix(in srgb, var(--sd-text) 4%, var(--sd-surface)));--sidebar-line: var(--sd-sidebar-v4-line, color-mix(in srgb, var(--sd-border) 45%, var(--sd-surface)));--sidebar-hover-bg: var(--sd-sidebar-v4-hover-bg, color-mix(in srgb, var(--sd-text) 6%, transparent));--sidebar-muted-ink: var(--sd-text-secondary);--sidebar-focus-ring: inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary));display:block;min-height:100dvh;background:var(--sd-light);color:var(--sd-text)}:host(.sd-sidebar-mobile-v4--soft){--sd-sidebar-v4-item-radius: 8px}.sd-sidebar-mobile-v4__icon-button,.sd-sidebar-mobile-v4__search-clear{display:inline-flex;flex:none;align-items:center;justify-content:center;box-sizing:border-box;margin:0;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sidebar-muted-ink);cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease}.sd-sidebar-mobile-v4__icon-button:focus-visible,.sd-sidebar-mobile-v4__search-clear:focus-visible{outline:none;box-shadow:var(--sidebar-focus-ring)}@media(hover:hover){.sd-sidebar-mobile-v4__icon-button:hover,.sd-sidebar-mobile-v4__search-clear:hover{background:var(--sidebar-hover-bg)}}.sd-sidebar-mobile-v4__icon-button{width:44px;height:44px}.sd-sidebar-mobile-v4__icon-button--appbar{color:var(--sd-text)}.sd-sidebar-mobile-v4__appbar{display:flex;align-items:center;gap:var(--sd-space-4, 4px);box-sizing:border-box;height:56px;padding:0 8px 0 4px;border-bottom:1px solid var(--sidebar-line);background:var(--sd-surface)}.sd-sidebar-mobile-v4__appbar-title{flex:1 1 auto;min-width:0;overflow:hidden;font-size:var(--sd-font-size-18, 18px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-24, 24px);text-overflow:ellipsis;white-space:nowrap}.sd-sidebar-mobile-v4__avatar{display:inline-flex;flex:none;align-items:center;justify-content:center;width:32px;height:32px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-sidebar-v4-avatar-bg, color-mix(in srgb, var(--sd-primary) 14%, var(--sd-surface)));color:var(--sd-sidebar-v4-avatar-ink, var(--sd-primary));font-size:var(--sd-font-size-12, 12px);font-weight:var(--sd-font-weight-medium, 500);line-height:1}:host(.sd-sidebar-mobile-v4--bottom-bar) .sd-sidebar-mobile-v4__content{padding-bottom:calc(var(--sidebar-bottom-bar-height) + 1px + env(safe-area-inset-bottom))}.sd-sidebar-mobile-v4__bottom-bar{position:fixed;z-index:var(--sd-z-sidebar, 20);inset:auto 0 0;display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;padding-bottom:env(safe-area-inset-bottom);border-top:1px solid var(--sidebar-line);background:var(--sd-surface)}.sd-sidebar-mobile-v4__destination{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;box-sizing:border-box;min-width:0;height:var(--sidebar-bottom-bar-height);margin:0;padding:0 2px;border:0;background:transparent;color:var(--sidebar-muted-ink);font:inherit;cursor:pointer}.sd-sidebar-mobile-v4__destination:focus-visible{outline:none}.sd-sidebar-mobile-v4__destination:focus-visible .sd-sidebar-mobile-v4__indicator{box-shadow:var(--sidebar-focus-ring)}.sd-sidebar-mobile-v4__indicator{position:relative;display:flex;flex:none;align-items:center;justify-content:center;width:56px;height:30px;border-radius:var(--sd-radius-999, 999px);transition:background-color var(--sd-duration-fast, .12s) ease}@media(hover:hover){.sd-sidebar-mobile-v4__destination:hover .sd-sidebar-mobile-v4__indicator{background:var(--sidebar-hover-bg)}.sd-sidebar-mobile-v4__destination--disabled:hover .sd-sidebar-mobile-v4__indicator{background:transparent}}.sd-sidebar-mobile-v4__destination--active .sd-sidebar-mobile-v4__indicator,.sd-sidebar-mobile-v4__destination--active:hover .sd-sidebar-mobile-v4__indicator{background:var(--sd-primary-light);color:var(--sd-primary)}.sd-sidebar-mobile-v4__destination--active:focus-visible .sd-sidebar-mobile-v4__indicator{box-shadow:var(--sidebar-focus-ring)}.sd-sidebar-mobile-v4__destination--disabled{color:var(--sd-disabled-text, color-mix(in srgb, var(--sd-text) 60%, transparent));cursor:not-allowed}.sd-sidebar-mobile-v4__destination-image{width:22px;height:22px;object-fit:contain}.sd-sidebar-mobile-v4__destination--disabled .sd-sidebar-mobile-v4__destination-image{opacity:.6}.sd-sidebar-mobile-v4__label{max-width:100%;overflow:hidden;color:var(--sd-text-secondary);font-size:11.5px;font-weight:var(--sd-font-weight-regular, 400);line-height:var(--sd-line-height-16, 16px);text-overflow:ellipsis;white-space:nowrap}.sd-sidebar-mobile-v4__destination--active .sd-sidebar-mobile-v4__label{color:var(--sd-text);font-weight:var(--sd-font-weight-medium, 500)}.sd-sidebar-mobile-v4__destination--disabled .sd-sidebar-mobile-v4__label{color:inherit}.sd-sidebar-mobile-v4__badge{position:absolute;top:-2px;right:8px;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:16px;height:16px;padding:0 4px;border-radius:var(--sd-radius-8, 8px);background:var(--sd-sidebar-v4-attention, var(--sd-warning));box-shadow:0 0 0 2px var(--sd-surface);color:var(--sd-warning-contrast);font-size:var(--sd-font-size-10, 10px);font-weight:var(--sd-font-weight-medium, 500);line-height:1;pointer-events:none}.sd-sidebar-mobile-v4__badge--error{background:var(--sd-error);color:var(--sd-error-contrast)}.sd-sidebar-mobile-v4__live{--live-tone: var(--sd-sidebar-v4-live, var(--sd-success));position:absolute;top:2px;right:14px;width:8px;height:8px;border-radius:var(--sd-radius-4, 4px);background:var(--live-tone);box-shadow:0 0 0 2px var(--sd-surface);pointer-events:none}.sd-sidebar-mobile-v4__live[data-tone=warning]{--live-tone: var(--sd-warning)}.sd-sidebar-mobile-v4__live[data-tone=error]{--live-tone: var(--sd-error)}.sd-sidebar-mobile-v4__backdrop{position:fixed;z-index:var(--sd-z-popover, 40);inset:0;margin:0;padding:0;border:0;background:var(--sd-overlay-backdrop, color-mix(in srgb, var(--sd-text) 40%, transparent))}.sd-sidebar-mobile-v4__drawer{position:fixed;z-index:var(--sd-z-drawer-mobile, 50);inset:0 auto 0 0;display:flex;flex-direction:column;box-sizing:border-box;width:var(--sidebar-drawer-width);max-width:100%;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);border-radius:0 var(--sd-radius-24, 24px) var(--sd-radius-24, 24px) 0;background:var(--sidebar-bg);box-shadow:0 8px 32px color-mix(in srgb,var(--sd-text) 18%,transparent);color:var(--sd-text)}.sd-sidebar-mobile-v4__drawer:focus{outline:none}.sd-sidebar-mobile-v4__header{display:flex;flex:none;align-items:center;gap:var(--sd-space-12, 12px);box-sizing:border-box;min-height:64px;padding:0 12px 0 16px}.sd-sidebar-mobile-v4__logo{display:inline-flex;flex:none;align-items:center;justify-content:center;overflow:hidden;width:28px;height:28px;border-radius:var(--sd-radius-8, 8px);background:var(--sd-primary);color:var(--sd-primary-contrast);font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-bold, 700);line-height:1}.sd-sidebar-mobile-v4__logo img{width:100%;height:100%;object-fit:contain}.sd-sidebar-mobile-v4__logo--image{background:transparent}.sd-sidebar-mobile-v4__brand{display:flex;flex:1 1 auto;flex-direction:column;min-width:0}.sd-sidebar-mobile-v4__title{overflow:hidden;font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-22, 22px);letter-spacing:-.2px;text-overflow:ellipsis;white-space:nowrap}.sd-sidebar-mobile-v4__search{flex:none;padding:0 12px 6px}.sd-sidebar-mobile-v4__search-field{display:flex;align-items:center;gap:var(--sd-space-8, 8px);box-sizing:border-box;height:44px;padding:0 12px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-surface);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--sd-border) 50%,var(--sd-surface));color:var(--sidebar-muted-ink)}.sd-sidebar-mobile-v4__search-field:focus-within{box-shadow:var(--sidebar-focus-ring)}.sd-sidebar-mobile-v4__search-field--filled,.sd-sidebar-mobile-v4__search-field--filled:focus-within{padding-right:0;box-shadow:inset 0 0 0 2px var(--sd-primary)}.sd-sidebar-mobile-v4__search-icon{flex:none}.sd-sidebar-mobile-v4__search-input{flex:1 1 auto;min-width:0;height:100%;margin:0;padding:0;border:0;outline:0;background:transparent;color:var(--sd-text);font:inherit;font-size:var(--sd-font-size-13, 13px)}.sd-sidebar-mobile-v4__search-input::placeholder{color:var(--sidebar-muted-ink);opacity:1}.sd-sidebar-mobile-v4__search-clear{width:44px;height:44px}.sd-sidebar-mobile-v4__list{flex:1 1 auto;min-height:0;box-sizing:border-box;padding:0 12px 12px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--sidebar-line) transparent}.sd-sidebar-mobile-v4__section-label{margin:0;padding:14px 12px 4px;color:var(--sidebar-muted-ink);font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-16, 16px);letter-spacing:.3px}.sd-sidebar-mobile-v4__tree--separated{margin-top:var(--sd-space-16, 16px)}.sd-sidebar-mobile-v4__footer{flex:none;box-sizing:border-box;padding:12px 8px 12px 16px;border-top:1px solid var(--sidebar-line)}.sd-sidebar-mobile-v4__footer ::ng-deep .sd-layout-user-menu__popup{box-sizing:border-box;left:-4px;width:calc(var(--sidebar-drawer-width) - 24px)}@media(pointer:coarse){.sd-sidebar-mobile-v4__search-input{font-size:var(--sd-font-size-16, 16px)}}@media(prefers-reduced-motion:reduce){.sd-sidebar-mobile-v4__icon-button,.sd-sidebar-mobile-v4__search-clear,.sd-sidebar-mobile-v4__indicator{transition:none}}\n"], dependencies: [{ kind: "directive", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdLayoutContextSwitcher, selector: "sd-layout-context-switcher", inputs: ["configuration", "appearance", "placement", "anchor"] }, { kind: "component", type: SdLayoutUserMenuComponent, selector: "sd-layout-user-menu", inputs: ["userInfo", "signout", "changePassword", "updateProfile", "setting", "notification", "compact", "presentation"], outputs: ["opened", "closed"] }, { kind: "component", type: SdSidebarV4MenuTree, selector: "sd-sidebar-v4-menu-tree", inputs: ["menus", "pathSource", "activePath", "presentation", "mode", "collapsedGroupKeys", "pinnedKeys", "showPin", "collapsedGroup", "query", "focusedIndex"], outputs: ["collapsedGroupKeysChange", "navigate", "togglePinned", "expandGroup"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4471
+ }
4472
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdSidebarMobileV4, decorators: [{
4473
+ type: Component,
4474
+ args: [{ selector: 'sd-sidebar-mobile-v4', standalone: true, imports: [CdkTrapFocus, SdIcon, SdLayoutContextSwitcher, SdLayoutUserMenuComponent, SdSidebarV4MenuTree, SdTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, host: {
4475
+ class: 'sd-sidebar-mobile-v4',
4476
+ '[class.sd-sidebar-mobile-v4--soft]': 'configuration().itemShape === "soft"',
4477
+ '[class.sd-sidebar-mobile-v4--bottom-bar]': 'destinations().length > 0',
4478
+ }, template: "@let _open = isDrawerOpen();\n@let _configuration = configuration();\n@let _destinations = destinations();\n@let _searchLabel = 'core.module.layout.sidebar.v4-search-placeholder' | sdTranslate;\n@let _navLabel = 'core.module.layout.sidebar.primary-nav' | sdTranslate;\n<header data-v4m-appbar class=\"sd-sidebar-mobile-v4__appbar\">\n <button\n #trigger\n type=\"button\"\n data-v4m-menu-trigger\n class=\"sd-sidebar-mobile-v4__icon-button sd-sidebar-mobile-v4__icon-button--appbar\"\n aria-haspopup=\"dialog\"\n [attr.aria-label]=\"'core.module.layout.sidebar.open-menu' | sdTranslate\"\n [attr.aria-expanded]=\"_open\"\n (click)=\"openDrawer($event.currentTarget)\">\n <sd-icon name=\"menu\" size=\"24px\"></sd-icon>\n </button>\n <span data-v4m-appbar-title class=\"sd-sidebar-mobile-v4__appbar-title\">{{ title() }}</span>\n <button\n type=\"button\"\n data-v4m-search-trigger\n class=\"sd-sidebar-mobile-v4__icon-button sd-sidebar-mobile-v4__icon-button--appbar\"\n aria-haspopup=\"dialog\"\n [attr.aria-label]=\"_searchLabel\"\n (click)=\"openSearch($event.currentTarget)\">\n <sd-icon name=\"search\" size=\"22px\"></sd-icon>\n </button>\n @let _displayName = displayName();\n <span\n data-v4m-avatar\n class=\"sd-sidebar-mobile-v4__avatar\"\n [attr.role]=\"_displayName ? 'img' : null\"\n [attr.aria-label]=\"_displayName || null\"\n [attr.aria-hidden]=\"_displayName ? null : 'true'\"\n >{{ userInitials() }}</span\n >\n</header>\n\n<main data-v4m-content class=\"sd-sidebar-mobile-v4__content\">\n <ng-content></ng-content>\n</main>\n\n@if (_destinations.length) {\n <nav data-v4m-bottom-bar class=\"sd-sidebar-mobile-v4__bottom-bar\" [attr.aria-label]=\"_navLabel\">\n @for (item of _destinations; track item.key) {\n <button\n #destinationButton\n type=\"button\"\n class=\"sd-sidebar-mobile-v4__destination\"\n [class.sd-sidebar-mobile-v4__destination--active]=\"item.isActive\"\n [class.sd-sidebar-mobile-v4__destination--disabled]=\"item.disabled\"\n [attr.data-v4m-destination]=\"item.key\"\n [attr.aria-current]=\"item.isActive ? (item.isGroup ? 'true' : 'page') : null\"\n [attr.aria-disabled]=\"item.disabled || null\"\n [attr.aria-haspopup]=\"item.isGroup && !item.disabled ? 'dialog' : null\"\n [attr.aria-describedby]=\"item.badge || item.liveTone ? item.descriptionId : null\"\n (click)=\"activateDestination(item, destinationButton)\">\n <span data-v4m-indicator class=\"sd-sidebar-mobile-v4__indicator\">\n @if (item.menu.iconUrl) {\n <img class=\"sd-sidebar-mobile-v4__destination-image\" [src]=\"item.menu.iconUrl\" alt=\"\" />\n } @else {\n <sd-icon\n [name]=\"item.menu.icon || (item.isGroup ? 'folder' : 'chevron_right')\"\n [fontSet]=\"item.isActive ? 'material-icons' : 'material-icons-outlined'\"\n size=\"22px\"></sd-icon>\n }\n @if (item.badge) {\n <span\n data-v4m-badge\n class=\"sd-sidebar-mobile-v4__badge\"\n [class.sd-sidebar-mobile-v4__badge--error]=\"item.badge.tone === 'error'\"\n aria-hidden=\"true\">\n {{ item.badge.value }}\n </span>\n } @else if (item.liveTone) {\n <span data-v4m-live class=\"sd-sidebar-mobile-v4__live\" [attr.data-tone]=\"item.liveTone\" aria-hidden=\"true\"></span>\n }\n </span>\n <span data-v4m-label class=\"sd-sidebar-mobile-v4__label\">{{ item.label }}</span>\n @if (item.badge) {\n <span hidden [id]=\"item.descriptionId\">{{\n 'core.module.layout.sidebar.badge-pending' | sdTranslate: { count: item.badge.value }\n }}</span>\n } @else if (item.liveTone) {\n <span hidden [id]=\"item.descriptionId\">{{ item.liveLabel }}</span>\n }\n </button>\n }\n <button\n type=\"button\"\n data-v4m-more\n class=\"sd-sidebar-mobile-v4__destination\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"_open\"\n (click)=\"openDrawer($event.currentTarget)\">\n <span data-v4m-indicator class=\"sd-sidebar-mobile-v4__indicator\">\n <sd-icon name=\"menu\" size=\"22px\"></sd-icon>\n </span>\n <span data-v4m-label class=\"sd-sidebar-mobile-v4__label\">{{ 'core.module.layout.sidebar.more' | sdTranslate }}</span>\n </button>\n </nav>\n}\n\n@if (_open) {\n @let _query = searchText();\n @let _hasQuery = hasQuery();\n @let _focused = focusedResultIndex();\n @let _hasResults = _focused >= 0;\n @let _pinned = pinnedMenus();\n @let _recent = recentMenus();\n @let _showPinned = !_hasQuery && _pinned.length > 0;\n @let _showRecent = !_hasQuery && recentConfiguration().enabled && _recent.length > 0;\n <button\n type=\"button\"\n data-v4m-backdrop\n class=\"sd-sidebar-mobile-v4__backdrop\"\n [attr.aria-label]=\"'core.module.layout.sidebar.close-menu' | sdTranslate\"\n (click)=\"closeFromBackdrop()\"></button>\n <aside\n data-v4m-drawer\n class=\"sd-sidebar-mobile-v4__drawer\"\n role=\"dialog\"\n aria-modal=\"true\"\n tabindex=\"-1\"\n [attr.aria-labelledby]=\"titleId\"\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n (keydown)=\"onDrawerKeydown($event)\">\n <header data-v4m-header class=\"sd-sidebar-mobile-v4__header\">\n <span class=\"sd-sidebar-mobile-v4__logo\" [class.sd-sidebar-mobile-v4__logo--image]=\"!!_configuration.logoUrl\" aria-hidden=\"true\">\n @if (_configuration.logoUrl) {\n <img [src]=\"_configuration.logoUrl\" alt=\"\" />\n } @else {\n {{ logoInitial() }}\n }\n </span>\n <div class=\"sd-sidebar-mobile-v4__brand\">\n <span data-v4m-drawer-title class=\"sd-sidebar-mobile-v4__title\" [id]=\"titleId\">{{ title() }}</span>\n @if (_configuration.context) {\n <sd-layout-context-switcher appearance=\"sheet\" [configuration]=\"_configuration.context\" />\n }\n </div>\n <button\n type=\"button\"\n data-v4m-close\n class=\"sd-sidebar-mobile-v4__icon-button\"\n [attr.aria-label]=\"'core.common.close' | sdTranslate\"\n (click)=\"closeFromBackdrop()\">\n <sd-icon name=\"close\" size=\"22px\"></sd-icon>\n </button>\n </header>\n\n <div data-v4m-search class=\"sd-sidebar-mobile-v4__search\">\n <div data-v4m-search-field class=\"sd-sidebar-mobile-v4__search-field\" [class.sd-sidebar-mobile-v4__search-field--filled]=\"!!_query\">\n <sd-icon class=\"sd-sidebar-mobile-v4__search-icon\" name=\"search\" size=\"20px\" aria-hidden=\"true\"></sd-icon>\n <input\n #searchInput\n data-v4m-search-input\n class=\"sd-sidebar-mobile-v4__search-input\"\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n aria-autocomplete=\"list\"\n [attr.cdkFocusInitial]=\"focusSearchOnOpen() ? '' : null\"\n [attr.aria-label]=\"_searchLabel\"\n [attr.placeholder]=\"_searchLabel\"\n [attr.aria-expanded]=\"_hasResults\"\n [attr.aria-controls]=\"_hasResults ? mainTree.resultsId : null\"\n [attr.aria-activedescendant]=\"_hasResults ? mainTree.resultOptionId(_focused) : null\"\n [value]=\"_query\"\n (input)=\"onSearchInput($event)\"\n (keydown)=\"onSearchKeydown($event)\" />\n @if (_query) {\n <button\n type=\"button\"\n data-v4m-search-clear\n class=\"sd-sidebar-mobile-v4__search-clear\"\n [attr.aria-label]=\"'core.module.layout.sidebar.clear-search' | sdTranslate\"\n (click)=\"clearSearch()\">\n <sd-icon name=\"close\" size=\"18px\"></sd-icon>\n </button>\n }\n </div>\n </div>\n\n <nav #list data-v4m-nav class=\"sd-sidebar-mobile-v4__list\" [attr.aria-label]=\"'core.module.layout.sidebar.all-menu' | sdTranslate\">\n @if (_showPinned) {\n <section data-v4m-pinned class=\"sd-sidebar-mobile-v4__shortcuts\">\n <h2 class=\"sd-sidebar-mobile-v4__section-label\">{{ 'core.module.layout.sidebar.pinned' | sdTranslate }}</h2>\n <sd-sidebar-v4-menu-tree\n presentation=\"shortcuts\"\n mode=\"mobile\"\n [menus]=\"_pinned\"\n [pathSource]=\"menus()\"\n [activePath]=\"activePath()\"\n [pinnedKeys]=\"pinnedKeys()\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\" />\n </section>\n }\n @if (_showRecent) {\n <section data-v4m-recent class=\"sd-sidebar-mobile-v4__shortcuts\">\n <h2 class=\"sd-sidebar-mobile-v4__section-label\">{{ 'core.module.layout.sidebar.recent' | sdTranslate }}</h2>\n <sd-sidebar-v4-menu-tree\n presentation=\"shortcuts\"\n mode=\"mobile\"\n [menus]=\"_recent\"\n [pathSource]=\"menus()\"\n [activePath]=\"activePath()\"\n [showPin]=\"false\"\n (navigate)=\"navigateMenu($event)\" />\n </section>\n }\n <!-- One tree instance for hierarchy and results: its live region must stay mounted to announce result counts. -->\n <sd-sidebar-v4-menu-tree\n #mainTree\n data-v4m-tree\n mode=\"mobile\"\n [class.sd-sidebar-mobile-v4__tree--separated]=\"(_showPinned || _showRecent) && leadsWithUnsectioned()\"\n [menus]=\"menus()\"\n [pathSource]=\"menus()\"\n [activePath]=\"activePath()\"\n [presentation]=\"_hasQuery ? 'results' : 'hierarchy'\"\n [(collapsedGroupKeys)]=\"collapsedGroupKeys\"\n [pinnedKeys]=\"pinnedKeys()\"\n [query]=\"_query\"\n [focusedIndex]=\"_focused\"\n (navigate)=\"navigateMenu($event)\"\n (togglePinned)=\"onTogglePinned($event)\" />\n </nav>\n\n <div data-v4m-footer class=\"sd-sidebar-mobile-v4__footer\">\n <sd-layout-user-menu [userInfo]=\"userInfo()\"></sd-layout-user-menu>\n </div>\n </aside>\n}\n", styles: [":host{--sd-sidebar-v4-item-height: 44px;--sd-sidebar-v4-child-height: 44px;--sd-sidebar-v4-item-radius: 999px;--sidebar-drawer-width: min(88vw, 360px);--sidebar-bottom-bar-height: 64px;--sidebar-bg: var(--sd-sidebar-v4-bg, color-mix(in srgb, var(--sd-text) 4%, var(--sd-surface)));--sidebar-line: var(--sd-sidebar-v4-line, color-mix(in srgb, var(--sd-border) 45%, var(--sd-surface)));--sidebar-hover-bg: var(--sd-sidebar-v4-hover-bg, color-mix(in srgb, var(--sd-text) 6%, transparent));--sidebar-muted-ink: var(--sd-text-secondary);--sidebar-focus-ring: inset 0 0 0 2px var(--sd-focus-ring-color, var(--sd-primary));display:block;min-height:100dvh;background:var(--sd-light);color:var(--sd-text)}:host(.sd-sidebar-mobile-v4--soft){--sd-sidebar-v4-item-radius: 8px}.sd-sidebar-mobile-v4__icon-button,.sd-sidebar-mobile-v4__search-clear{display:inline-flex;flex:none;align-items:center;justify-content:center;box-sizing:border-box;margin:0;padding:0;border:0;border-radius:var(--sd-radius-999, 999px);background:transparent;color:var(--sidebar-muted-ink);cursor:pointer;transition:background-color var(--sd-duration-fast, .12s) ease}.sd-sidebar-mobile-v4__icon-button:focus-visible,.sd-sidebar-mobile-v4__search-clear:focus-visible{outline:none;box-shadow:var(--sidebar-focus-ring)}@media(hover:hover){.sd-sidebar-mobile-v4__icon-button:hover,.sd-sidebar-mobile-v4__search-clear:hover{background:var(--sidebar-hover-bg)}}.sd-sidebar-mobile-v4__icon-button{width:44px;height:44px}.sd-sidebar-mobile-v4__icon-button--appbar{color:var(--sd-text)}.sd-sidebar-mobile-v4__appbar{display:flex;align-items:center;gap:var(--sd-space-4, 4px);box-sizing:border-box;height:56px;padding:0 8px 0 4px;border-bottom:1px solid var(--sidebar-line);background:var(--sd-surface)}.sd-sidebar-mobile-v4__appbar-title{flex:1 1 auto;min-width:0;overflow:hidden;font-size:var(--sd-font-size-18, 18px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-24, 24px);text-overflow:ellipsis;white-space:nowrap}.sd-sidebar-mobile-v4__avatar{display:inline-flex;flex:none;align-items:center;justify-content:center;width:32px;height:32px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-sidebar-v4-avatar-bg, color-mix(in srgb, var(--sd-primary) 14%, var(--sd-surface)));color:var(--sd-sidebar-v4-avatar-ink, var(--sd-primary));font-size:var(--sd-font-size-12, 12px);font-weight:var(--sd-font-weight-medium, 500);line-height:1}:host(.sd-sidebar-mobile-v4--bottom-bar) .sd-sidebar-mobile-v4__content{padding-bottom:calc(var(--sidebar-bottom-bar-height) + 1px + env(safe-area-inset-bottom))}.sd-sidebar-mobile-v4__bottom-bar{position:fixed;z-index:var(--sd-z-sidebar, 20);inset:auto 0 0;display:grid;grid-auto-columns:minmax(0,1fr);grid-auto-flow:column;padding-bottom:env(safe-area-inset-bottom);border-top:1px solid var(--sidebar-line);background:var(--sd-surface)}.sd-sidebar-mobile-v4__destination{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;box-sizing:border-box;min-width:0;height:var(--sidebar-bottom-bar-height);margin:0;padding:0 2px;border:0;background:transparent;color:var(--sidebar-muted-ink);font:inherit;cursor:pointer}.sd-sidebar-mobile-v4__destination:focus-visible{outline:none}.sd-sidebar-mobile-v4__destination:focus-visible .sd-sidebar-mobile-v4__indicator{box-shadow:var(--sidebar-focus-ring)}.sd-sidebar-mobile-v4__indicator{position:relative;display:flex;flex:none;align-items:center;justify-content:center;width:56px;height:30px;border-radius:var(--sd-radius-999, 999px);transition:background-color var(--sd-duration-fast, .12s) ease}@media(hover:hover){.sd-sidebar-mobile-v4__destination:hover .sd-sidebar-mobile-v4__indicator{background:var(--sidebar-hover-bg)}.sd-sidebar-mobile-v4__destination--disabled:hover .sd-sidebar-mobile-v4__indicator{background:transparent}}.sd-sidebar-mobile-v4__destination--active .sd-sidebar-mobile-v4__indicator,.sd-sidebar-mobile-v4__destination--active:hover .sd-sidebar-mobile-v4__indicator{background:var(--sd-primary-light);color:var(--sd-primary)}.sd-sidebar-mobile-v4__destination--active:focus-visible .sd-sidebar-mobile-v4__indicator{box-shadow:var(--sidebar-focus-ring)}.sd-sidebar-mobile-v4__destination--disabled{color:var(--sd-disabled-text, color-mix(in srgb, var(--sd-text) 60%, transparent));cursor:not-allowed}.sd-sidebar-mobile-v4__destination-image{width:22px;height:22px;object-fit:contain}.sd-sidebar-mobile-v4__destination--disabled .sd-sidebar-mobile-v4__destination-image{opacity:.6}.sd-sidebar-mobile-v4__label{max-width:100%;overflow:hidden;color:var(--sd-text-secondary);font-size:11.5px;font-weight:var(--sd-font-weight-regular, 400);line-height:var(--sd-line-height-16, 16px);text-overflow:ellipsis;white-space:nowrap}.sd-sidebar-mobile-v4__destination--active .sd-sidebar-mobile-v4__label{color:var(--sd-text);font-weight:var(--sd-font-weight-medium, 500)}.sd-sidebar-mobile-v4__destination--disabled .sd-sidebar-mobile-v4__label{color:inherit}.sd-sidebar-mobile-v4__badge{position:absolute;top:-2px;right:8px;display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:16px;height:16px;padding:0 4px;border-radius:var(--sd-radius-8, 8px);background:var(--sd-sidebar-v4-attention, var(--sd-warning));box-shadow:0 0 0 2px var(--sd-surface);color:var(--sd-warning-contrast);font-size:var(--sd-font-size-10, 10px);font-weight:var(--sd-font-weight-medium, 500);line-height:1;pointer-events:none}.sd-sidebar-mobile-v4__badge--error{background:var(--sd-error);color:var(--sd-error-contrast)}.sd-sidebar-mobile-v4__live{--live-tone: var(--sd-sidebar-v4-live, var(--sd-success));position:absolute;top:2px;right:14px;width:8px;height:8px;border-radius:var(--sd-radius-4, 4px);background:var(--live-tone);box-shadow:0 0 0 2px var(--sd-surface);pointer-events:none}.sd-sidebar-mobile-v4__live[data-tone=warning]{--live-tone: var(--sd-warning)}.sd-sidebar-mobile-v4__live[data-tone=error]{--live-tone: var(--sd-error)}.sd-sidebar-mobile-v4__backdrop{position:fixed;z-index:var(--sd-z-popover, 40);inset:0;margin:0;padding:0;border:0;background:var(--sd-overlay-backdrop, color-mix(in srgb, var(--sd-text) 40%, transparent))}.sd-sidebar-mobile-v4__drawer{position:fixed;z-index:var(--sd-z-drawer-mobile, 50);inset:0 auto 0 0;display:flex;flex-direction:column;box-sizing:border-box;width:var(--sidebar-drawer-width);max-width:100%;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);border-radius:0 var(--sd-radius-24, 24px) var(--sd-radius-24, 24px) 0;background:var(--sidebar-bg);box-shadow:0 8px 32px color-mix(in srgb,var(--sd-text) 18%,transparent);color:var(--sd-text)}.sd-sidebar-mobile-v4__drawer:focus{outline:none}.sd-sidebar-mobile-v4__header{display:flex;flex:none;align-items:center;gap:var(--sd-space-12, 12px);box-sizing:border-box;min-height:64px;padding:0 12px 0 16px}.sd-sidebar-mobile-v4__logo{display:inline-flex;flex:none;align-items:center;justify-content:center;overflow:hidden;width:28px;height:28px;border-radius:var(--sd-radius-8, 8px);background:var(--sd-primary);color:var(--sd-primary-contrast);font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-bold, 700);line-height:1}.sd-sidebar-mobile-v4__logo img{width:100%;height:100%;object-fit:contain}.sd-sidebar-mobile-v4__logo--image{background:transparent}.sd-sidebar-mobile-v4__brand{display:flex;flex:1 1 auto;flex-direction:column;min-width:0}.sd-sidebar-mobile-v4__title{overflow:hidden;font-size:var(--sd-font-size-16, 16px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-22, 22px);letter-spacing:-.2px;text-overflow:ellipsis;white-space:nowrap}.sd-sidebar-mobile-v4__search{flex:none;padding:0 12px 6px}.sd-sidebar-mobile-v4__search-field{display:flex;align-items:center;gap:var(--sd-space-8, 8px);box-sizing:border-box;height:44px;padding:0 12px;border-radius:var(--sd-radius-999, 999px);background:var(--sd-surface);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--sd-border) 50%,var(--sd-surface));color:var(--sidebar-muted-ink)}.sd-sidebar-mobile-v4__search-field:focus-within{box-shadow:var(--sidebar-focus-ring)}.sd-sidebar-mobile-v4__search-field--filled,.sd-sidebar-mobile-v4__search-field--filled:focus-within{padding-right:0;box-shadow:inset 0 0 0 2px var(--sd-primary)}.sd-sidebar-mobile-v4__search-icon{flex:none}.sd-sidebar-mobile-v4__search-input{flex:1 1 auto;min-width:0;height:100%;margin:0;padding:0;border:0;outline:0;background:transparent;color:var(--sd-text);font:inherit;font-size:var(--sd-font-size-13, 13px)}.sd-sidebar-mobile-v4__search-input::placeholder{color:var(--sidebar-muted-ink);opacity:1}.sd-sidebar-mobile-v4__search-clear{width:44px;height:44px}.sd-sidebar-mobile-v4__list{flex:1 1 auto;min-height:0;box-sizing:border-box;padding:0 12px 12px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--sidebar-line) transparent}.sd-sidebar-mobile-v4__section-label{margin:0;padding:14px 12px 4px;color:var(--sidebar-muted-ink);font-size:var(--sd-font-size-11, 11px);font-weight:var(--sd-font-weight-medium, 500);line-height:var(--sd-line-height-16, 16px);letter-spacing:.3px}.sd-sidebar-mobile-v4__tree--separated{margin-top:var(--sd-space-16, 16px)}.sd-sidebar-mobile-v4__footer{flex:none;box-sizing:border-box;padding:12px 8px 12px 16px;border-top:1px solid var(--sidebar-line)}.sd-sidebar-mobile-v4__footer ::ng-deep .sd-layout-user-menu__popup{box-sizing:border-box;left:-4px;width:calc(var(--sidebar-drawer-width) - 24px)}@media(pointer:coarse){.sd-sidebar-mobile-v4__search-input{font-size:var(--sd-font-size-16, 16px)}}@media(prefers-reduced-motion:reduce){.sd-sidebar-mobile-v4__icon-button,.sd-sidebar-mobile-v4__search-clear,.sd-sidebar-mobile-v4__indicator{transition:none}}\n"] }]
4479
+ }], ctorParameters: () => [], propDecorators: { trigger: [{ type: i0.ViewChild, args: ['trigger', { isSignal: true }] }], searchInput: [{ type: i0.ViewChild, args: ['searchInput', { isSignal: true }] }], list: [{ type: i0.ViewChild, args: ['list', { isSignal: true }] }], mainTree: [{ type: i0.ViewChild, args: ['mainTree', { isSignal: true }] }], menus: [{ type: i0.Input, args: [{ isSignal: true, alias: "menus", required: false }] }], userInfo: [{ type: i0.Input, args: [{ isSignal: true, alias: "userInfo", required: true }] }], sidebar: [{ type: i0.Input, args: [{ isSignal: true, alias: "sidebar", required: true }] }] } });
4480
+ /** First menu of every `id` in the tree, with the stable keys of its ancestor groups (keys as the V4 tree computes them). */
4481
+ function indexMenusById(menus) {
4482
+ const entries = new Map();
4483
+ const visit = (items, ancestors, ancestorKeys) => {
4484
+ for (const menu of items ?? []) {
4485
+ if (!menu || typeof menu !== 'object')
4486
+ continue;
4487
+ const key = getMenuStableKey(menu, ancestors);
4488
+ const id = typeof menu.id === 'string' ? menu.id.trim() : '';
4489
+ if (id && key && !entries.has(id))
4490
+ entries.set(id, { menu, key, ancestorKeys });
4491
+ if ('children' in menu && Array.isArray(menu.children)) {
4492
+ visit(menu.children, [...ancestors, menu.title ?? key], [...ancestorKeys, key]);
4493
+ }
4494
+ }
4495
+ };
4496
+ visit(menus, [], []);
4497
+ return entries;
4498
+ }
4499
+
2497
4500
  class SdLayoutComponent {
2498
4501
  // ==========================================
2499
4502
  // INJECT SERVICES
@@ -2524,14 +4527,29 @@ class SdLayoutComponent {
2524
4527
  const sidebar = this.sidebar();
2525
4528
  return sidebar?.version === 3 ? sidebar : undefined;
2526
4529
  }, ...(ngDevMode ? [{ debugName: "sidebarV3" }] : /* istanbul ignore next */ []));
4530
+ // why: V4 là cấu hình duy nhất cần chuẩn hoá ở đây (INV-012) — bottomBar/itemShape/density/collapsedGroup có mặc định + sanitize.
4531
+ sidebarV4 = computed(() => {
4532
+ const sidebar = this.sidebar();
4533
+ return sidebar?.version === 4 ? normalizeSidebarConfiguration(sidebar) : undefined;
4534
+ }, ...(ngDevMode ? [{ debugName: "sidebarV4" }] : /* istanbul ignore next */ []));
2527
4535
  mobileBreakpoint = normalizeLayoutMobileBreakpoint(this.#layoutConfiguration?.mobileBreakpoint);
2528
4536
  isMobile = computed(() => this.#responsiveService.isMobile(this.mobileBreakpoint), ...(ngDevMode ? [{ debugName: "isMobile" }] : /* istanbul ignore next */ []));
2529
4537
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdLayoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2530
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdLayoutComponent, isStandalone: true, selector: "sd-layout", inputs: { menusInput: { classPropertyName: "menusInput", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ng-template #projectedContent>\n <ng-content></ng-content>\n</ng-template>\n\n@let _userInfo = userInfo();\n@let _sidebarV1 = sidebarV1();\n@let _sidebarV2 = sidebarV2();\n@let _sidebarV3 = sidebarV3();\n\n@if (_userInfo && _sidebarV1) {\n @if (!isMobile()) {\n <sd-sidebar-v1 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV1\" [isMobile]=\"false\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-v1>\n } @else {\n <sd-sidebar-mobile-v1 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV1\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-mobile-v1>\n }\n}\n\n@if (_userInfo && _sidebarV3) {\n @if (!isMobile()) {\n <sd-sidebar-v3 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV3\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-v3>\n } @else {\n <sd-sidebar-mobile-v3 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV3\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-mobile-v3>\n }\n}\n\n@if (_userInfo && _sidebarV2) {\n @if (!isMobile()) {\n <sd-sidebar-v2 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV2\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-v2>\n } @else {\n <sd-sidebar-mobile-v2 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV2\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-mobile-v2>\n }\n}\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: SdSidebarV1, selector: "sd-sidebar-v1", inputs: ["menus", "userInfo", "sidebar", "isMobile"] }, { kind: "component", type: SdSidebarMobileV1, selector: "sd-sidebar-mobile-v1", inputs: ["menus", "userInfo", "sidebar"] }, { kind: "component", type: SdSidebarV2, selector: "sd-sidebar-v2", inputs: ["menus", "userInfo", "sidebar"] }, { kind: "component", type: SdSidebarMobileV2, selector: "sd-sidebar-mobile-v2", inputs: ["menus", "userInfo", "sidebar"] }, { kind: "component", type: SdSidebarV3, selector: "sd-sidebar-v3", inputs: ["menus", "userInfo", "sidebar"] }, { kind: "component", type: SdSidebarMobileV3, selector: "sd-sidebar-mobile-v3", inputs: ["menus", "userInfo", "sidebar"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
4538
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: SdLayoutComponent, isStandalone: true, selector: "sd-layout", inputs: { menusInput: { classPropertyName: "menusInput", publicName: "menus", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<ng-template #projectedContent>\n <ng-content></ng-content>\n</ng-template>\n\n@let _userInfo = userInfo();\n@let _sidebarV1 = sidebarV1();\n@let _sidebarV2 = sidebarV2();\n@let _sidebarV3 = sidebarV3();\n@let _sidebarV4 = sidebarV4();\n\n@if (_userInfo && _sidebarV1) {\n @if (!isMobile()) {\n <sd-sidebar-v1 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV1\" [isMobile]=\"false\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-v1>\n } @else {\n <sd-sidebar-mobile-v1 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV1\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-mobile-v1>\n }\n}\n\n@if (_userInfo && _sidebarV3) {\n @if (!isMobile()) {\n <sd-sidebar-v3 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV3\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-v3>\n } @else {\n <sd-sidebar-mobile-v3 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV3\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-mobile-v3>\n }\n}\n\n@if (_userInfo && _sidebarV4) {\n @if (!isMobile()) {\n <sd-sidebar-v4 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV4\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-v4>\n } @else {\n <sd-sidebar-mobile-v4 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV4\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-mobile-v4>\n }\n}\n\n@if (_userInfo && _sidebarV2) {\n @if (!isMobile()) {\n <sd-sidebar-v2 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV2\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-v2>\n } @else {\n <sd-sidebar-mobile-v2 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV2\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-mobile-v2>\n }\n}\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: SdSidebarV1, selector: "sd-sidebar-v1", inputs: ["menus", "userInfo", "sidebar", "isMobile"] }, { kind: "component", type: SdSidebarMobileV1, selector: "sd-sidebar-mobile-v1", inputs: ["menus", "userInfo", "sidebar"] }, { kind: "component", type: SdSidebarV2, selector: "sd-sidebar-v2", inputs: ["menus", "userInfo", "sidebar"] }, { kind: "component", type: SdSidebarMobileV2, selector: "sd-sidebar-mobile-v2", inputs: ["menus", "userInfo", "sidebar"] }, { kind: "component", type: SdSidebarV3, selector: "sd-sidebar-v3", inputs: ["menus", "userInfo", "sidebar"] }, { kind: "component", type: SdSidebarMobileV3, selector: "sd-sidebar-mobile-v3", inputs: ["menus", "userInfo", "sidebar"] }, { kind: "component", type: SdSidebarV4, selector: "sd-sidebar-v4", inputs: ["menus", "userInfo", "sidebar"] }, { kind: "component", type: SdSidebarMobileV4, selector: "sd-sidebar-mobile-v4", inputs: ["menus", "userInfo", "sidebar"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2531
4539
  }
2532
4540
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SdLayoutComponent, decorators: [{
2533
4541
  type: Component,
2534
- args: [{ selector: 'sd-layout', imports: [SdSidebarV1, SdSidebarMobileV1, SdSidebarV2, SdSidebarMobileV2, SdSidebarV3, SdSidebarMobileV3, NgTemplateOutlet], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template #projectedContent>\n <ng-content></ng-content>\n</ng-template>\n\n@let _userInfo = userInfo();\n@let _sidebarV1 = sidebarV1();\n@let _sidebarV2 = sidebarV2();\n@let _sidebarV3 = sidebarV3();\n\n@if (_userInfo && _sidebarV1) {\n @if (!isMobile()) {\n <sd-sidebar-v1 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV1\" [isMobile]=\"false\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-v1>\n } @else {\n <sd-sidebar-mobile-v1 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV1\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-mobile-v1>\n }\n}\n\n@if (_userInfo && _sidebarV3) {\n @if (!isMobile()) {\n <sd-sidebar-v3 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV3\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-v3>\n } @else {\n <sd-sidebar-mobile-v3 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV3\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-mobile-v3>\n }\n}\n\n@if (_userInfo && _sidebarV2) {\n @if (!isMobile()) {\n <sd-sidebar-v2 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV2\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-v2>\n } @else {\n <sd-sidebar-mobile-v2 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV2\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-mobile-v2>\n }\n}\n", styles: [":host{display:block}\n"] }]
4542
+ args: [{ selector: 'sd-layout', imports: [
4543
+ SdSidebarV1,
4544
+ SdSidebarMobileV1,
4545
+ SdSidebarV2,
4546
+ SdSidebarMobileV2,
4547
+ SdSidebarV3,
4548
+ SdSidebarMobileV3,
4549
+ SdSidebarV4,
4550
+ SdSidebarMobileV4,
4551
+ NgTemplateOutlet,
4552
+ ], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-template #projectedContent>\n <ng-content></ng-content>\n</ng-template>\n\n@let _userInfo = userInfo();\n@let _sidebarV1 = sidebarV1();\n@let _sidebarV2 = sidebarV2();\n@let _sidebarV3 = sidebarV3();\n@let _sidebarV4 = sidebarV4();\n\n@if (_userInfo && _sidebarV1) {\n @if (!isMobile()) {\n <sd-sidebar-v1 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV1\" [isMobile]=\"false\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-v1>\n } @else {\n <sd-sidebar-mobile-v1 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV1\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-mobile-v1>\n }\n}\n\n@if (_userInfo && _sidebarV3) {\n @if (!isMobile()) {\n <sd-sidebar-v3 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV3\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-v3>\n } @else {\n <sd-sidebar-mobile-v3 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV3\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-mobile-v3>\n }\n}\n\n@if (_userInfo && _sidebarV4) {\n @if (!isMobile()) {\n <sd-sidebar-v4 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV4\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-v4>\n } @else {\n <sd-sidebar-mobile-v4 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV4\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-mobile-v4>\n }\n}\n\n@if (_userInfo && _sidebarV2) {\n @if (!isMobile()) {\n <sd-sidebar-v2 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV2\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-v2>\n } @else {\n <sd-sidebar-mobile-v2 [menus]=\"menus()\" [userInfo]=\"_userInfo\" [sidebar]=\"_sidebarV2\">\n <ng-container [ngTemplateOutlet]=\"projectedContent\"></ng-container>\n </sd-sidebar-mobile-v2>\n }\n}\n", styles: [":host{display:block}\n"] }]
2535
4553
  }], propDecorators: { menusInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "menus", required: false }] }] } });
2536
4554
 
2537
4555
  // End
@@ -2581,7 +4599,7 @@ let HomePageComponent = class HomePageComponent {
2581
4599
  return `${formatted} (${this.#getTimezone()})`;
2582
4600
  }
2583
4601
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: HomePageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2584
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: HomePageComponent, isStandalone: true, selector: "app-home-page", ngImport: i0, template: "@let _userInfo = userInfo();\n<sd-page>\n <div class=\"d-flex flex-column\" headerLeft>\n <div class=\"font-weight-medium fs-20\">\n {{ 'core.module.layout.greeting.hello' | sdTranslate: { name: _userInfo?.fullName ?? _userInfo?.email ?? _userInfo?.username ?? '' } }}\n </div>\n <span class=\"T12R text-secondary\">{{ todayInfo() }}</span>\n </div>\n\n <div class=\"wrapper\">\n <div class=\"bento\">\n <!-- Hero -->\n <div class=\"card hero-card\">\n <div class=\"hero-ring ring-3\"></div>\n <div class=\"hero-ring ring-2\"></div>\n <div class=\"hero-ring ring-1\"></div>\n <div class=\"hero-core\">\n <sd-icon class=\"hero-icon\" name=\"space_dashboard\"></sd-icon>\n </div>\n <div class=\"hero-decoration\">\n <span class=\"dot d1\"></span>\n <span class=\"dot d2\"></span>\n <span class=\"dot d3\"></span>\n </div>\n </div>\n\n <!-- Features -->\n @for (feature of features; track feature.key; let i = $index) {\n <div\n class=\"card feature-card\"\n [class.feature-wide]=\"feature.area === 'audit' || feature.area === 'integ'\"\n [style.gridArea]=\"feature.area\"\n [style.animation-delay.ms]=\"(i + 1) * 80\"\n >\n <div class=\"feature-accent\"></div>\n <div class=\"feature-content\">\n <div class=\"feature-icon-wrap\">\n <sd-icon class=\"feature-icon\" [name]=\"feature.icon\"></sd-icon>\n </div>\n <span class=\"feature-label\">{{ feature.key | sdTranslate }}</span>\n </div>\n </div>\n }\n </div>\n </div>\n</sd-page>\n", styles: [":host{display:contents}.wrapper{display:flex;align-items:center;justify-content:center;padding:32px 24px;height:100%;width:100%;background:radial-gradient(circle at 15% 25%,color-mix(in srgb,var(--sd-primary, #005cbb) 14%,transparent),transparent 55%),radial-gradient(circle at 85% 75%,color-mix(in srgb,var(--sd-primary, #005cbb) 10%,transparent),transparent 55%),linear-gradient(135deg,var(--sd-home-page-gradient-start, #fafbfc) 0%,var(--sd-home-page-gradient-end, #f4f6fa) 100%);overflow:auto}.bento{display:grid;width:100%;max-width:1080px;gap:16px;grid-template-columns:repeat(4,1fr);grid-template-rows:repeat(3,minmax(140px,1fr));grid-template-areas:\"hero hero data report\" \"hero hero users flow\" \"audit audit integ integ\"}.card{position:relative;background:var(--sd-home-page-card-bg, #ffffff);border:1px solid rgba(0,0,0,.06);border-radius:20px;overflow:hidden;opacity:0;transform:translateY(8px);animation:card-in .5s ease-out forwards;transition:transform var(--sd-duration-slow, .3s) ease,box-shadow var(--sd-duration-slow, .3s) ease}.card:hover{transform:translateY(-4px);box-shadow:0 16px 40px color-mix(in srgb,var(--sd-primary, #005cbb) 18%,transparent),0 4px 12px #0000000f}.hero-card{grid-area:hero;display:flex;align-items:center;justify-content:center;background:radial-gradient(circle at 30% 30%,color-mix(in srgb,var(--sd-primary, #005cbb) 18%,white),#fff 60%),var(--sd-home-page-card-bg, #ffffff);border:1px solid color-mix(in srgb,var(--sd-primary, #005cbb) 15%,transparent)}.hero-card .hero-ring{position:absolute;border-radius:50%;border:1px solid color-mix(in srgb,var(--sd-primary, #005cbb) 25%,transparent);animation:hero-pulse 3s ease-in-out infinite;pointer-events:none}.hero-card .hero-ring.ring-1{inset:calc(50% - 70px);animation-delay:0s}.hero-card .hero-ring.ring-2{inset:calc(50% - 105px);animation-delay:.6s}.hero-card .hero-ring.ring-3{inset:calc(50% - 140px);animation-delay:1.2s}.hero-card .hero-core{position:relative;z-index:1;width:140px;height:140px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:radial-gradient(circle,color-mix(in srgb,var(--sd-primary, #005cbb) 22%,white),#fff);box-shadow:0 0 60px color-mix(in srgb,var(--sd-primary, #005cbb) 30%,transparent),0 10px 30px color-mix(in srgb,var(--sd-primary, #005cbb) 20%,transparent)}.hero-card .hero-icon{font-size:72px;width:72px;height:72px;color:var(--sd-primary, #005cbb)}.hero-card .hero-decoration{position:absolute;inset:0;pointer-events:none}.hero-card .hero-decoration .dot{position:absolute;width:8px;height:8px;border-radius:50%;background:color-mix(in srgb,var(--sd-primary, #005cbb) 50%,transparent);animation:dot-float 4s ease-in-out infinite}.hero-card .hero-decoration .d1{top:16%;left:12%;animation-delay:0s}.hero-card .hero-decoration .d2{bottom:20%;right:14%;animation-delay:1s}.hero-card .hero-decoration .d3{top:60%;left:80%;animation-delay:2s;width:5px;height:5px}.feature-card{display:flex;align-items:stretch;cursor:default}.feature-card .feature-accent{position:absolute;top:0;left:0;right:0;height:3px;background:linear-gradient(90deg,color-mix(in srgb,var(--sd-primary, #005cbb) 60%,transparent),var(--sd-primary, #005cbb),color-mix(in srgb,var(--sd-primary, #005cbb) 60%,transparent))}.feature-card .feature-content{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px 16px 18px;gap:10px}.feature-card .feature-icon-wrap{width:56px;height:56px;border-radius:50%;background:color-mix(in srgb,var(--sd-primary, #005cbb) 12%,white);display:flex;align-items:center;justify-content:center}.feature-card .feature-icon{font-size:var(--sd-font-size-28, 28px);width:28px;height:28px;color:var(--sd-primary, #005cbb)}.feature-card .feature-label{font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-medium, 500);text-align:center;color:#000000c7;line-height:var(--sd-line-height-20, 20px)}.feature-card.feature-wide .feature-content{flex-direction:row;justify-content:flex-start;padding:18px 24px;gap:18px}.feature-card.feature-wide .feature-icon-wrap{width:64px;height:64px}.feature-card.feature-wide .feature-icon{font-size:var(--sd-font-size-32, 32px);width:32px;height:32px}.feature-card.feature-wide .feature-label{text-align:left;font-size:var(--sd-font-size-16, 16px)}@keyframes card-in{to{opacity:1;transform:translateY(0)}}@keyframes hero-pulse{0%,to{transform:scale(1);opacity:.7}50%{transform:scale(1.06);opacity:.3}}@keyframes dot-float{0%,to{transform:translateY(0);opacity:.8}50%{transform:translateY(-8px);opacity:.4}}@media(max-width:1024px){.bento{grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(4,minmax(120px,1fr));grid-template-areas:\"hero hero data\" \"hero hero report\" \"users flow audit\" \"integ integ integ\"}.hero-card .hero-core{width:120px;height:120px}.hero-card .hero-icon{font-size:60px;width:60px;height:60px}}@media(max-width:640px){.wrapper{padding:16px 12px}.bento{grid-template-columns:1fr;grid-template-rows:auto;grid-template-areas:\"hero\" \"data\" \"report\" \"users\" \"flow\" \"audit\" \"integ\";gap:12px}.hero-card{min-height:220px}.hero-card .hero-core{width:100px;height:100px}.hero-card .hero-icon{font-size:52px;width:52px;height:52px}}@media(prefers-reduced-motion:reduce){.card{animation:none;opacity:1;transform:none}.hero-card .hero-ring{animation:none;opacity:.4}.hero-card .hero-decoration .dot{animation:none}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdPageComponent, selector: "sd-page", inputs: ["title", "description", "noHeader"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }] });
4602
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: HomePageComponent, isStandalone: true, selector: "app-home-page", ngImport: i0, template: "@let _userInfo = userInfo();\n<sd-page>\n <div class=\"d-flex flex-column\" headerLeft>\n <div class=\"font-weight-medium fs-20\">\n {{ 'core.module.layout.greeting.hello' | sdTranslate: { name: _userInfo?.fullName ?? _userInfo?.email ?? _userInfo?.username ?? '' } }}\n </div>\n <span class=\"T12R text-secondary\">{{ todayInfo() }}</span>\n </div>\n\n <div class=\"wrapper\">\n <div class=\"bento\">\n <!-- Hero -->\n <div class=\"card hero-card\">\n <div class=\"hero-ring ring-3\"></div>\n <div class=\"hero-ring ring-2\"></div>\n <div class=\"hero-ring ring-1\"></div>\n <div class=\"hero-core\">\n <sd-icon class=\"hero-icon\" name=\"space_dashboard\"></sd-icon>\n </div>\n <div class=\"hero-decoration\">\n <span class=\"dot d1\"></span>\n <span class=\"dot d2\"></span>\n <span class=\"dot d3\"></span>\n </div>\n </div>\n\n <!-- Features -->\n @for (feature of features; track feature.key; let i = $index) {\n <div\n class=\"card feature-card\"\n [class.feature-wide]=\"feature.area === 'audit' || feature.area === 'integ'\"\n [style.gridArea]=\"feature.area\"\n [style.animation-delay.ms]=\"(i + 1) * 80\"\n >\n <div class=\"feature-accent\"></div>\n <div class=\"feature-content\">\n <div class=\"feature-icon-wrap\">\n <sd-icon class=\"feature-icon\" [name]=\"feature.icon\"></sd-icon>\n </div>\n <span class=\"feature-label\">{{ feature.key | sdTranslate }}</span>\n </div>\n </div>\n }\n </div>\n </div>\n</sd-page>\n", styles: [":host{display:contents}.wrapper{display:flex;align-items:center;justify-content:center;padding:32px 24px;height:100%;width:100%;background:radial-gradient(circle at 15% 25%,color-mix(in srgb,var(--sd-primary, #005cbb) 14%,transparent),transparent 55%),radial-gradient(circle at 85% 75%,color-mix(in srgb,var(--sd-primary, #005cbb) 10%,transparent),transparent 55%),linear-gradient(135deg,var(--sd-home-page-gradient-start, #fafbfc) 0%,var(--sd-home-page-gradient-end, #f4f6fa) 100%);overflow:auto}.bento{display:grid;width:100%;max-width:1080px;gap:16px;grid-template-columns:repeat(4,1fr);grid-template-rows:repeat(3,minmax(140px,1fr));grid-template-areas:\"hero hero data report\" \"hero hero users flow\" \"audit audit integ integ\"}.card{position:relative;background:var(--sd-home-page-card-bg, #ffffff);border:1px solid rgba(0,0,0,.06);border-radius:20px;overflow:hidden;opacity:0;transform:translateY(8px);animation:card-in .5s ease-out forwards;transition:transform var(--sd-duration-slow, .3s) ease,box-shadow var(--sd-duration-slow, .3s) ease}.card:hover{transform:translateY(-4px);box-shadow:0 16px 40px color-mix(in srgb,var(--sd-primary, #005cbb) 18%,transparent),0 4px 12px #0000000f}.hero-card{grid-area:hero;display:flex;align-items:center;justify-content:center;background:radial-gradient(circle at 30% 30%,color-mix(in srgb,var(--sd-primary, #005cbb) 18%,white),#fff 60%),var(--sd-home-page-card-bg, #ffffff);border:1px solid color-mix(in srgb,var(--sd-primary, #005cbb) 15%,transparent)}.hero-card .hero-ring{position:absolute;border-radius:50%;border:1px solid color-mix(in srgb,var(--sd-primary, #005cbb) 25%,transparent);animation:hero-pulse 3s ease-in-out infinite;pointer-events:none}.hero-card .hero-ring.ring-1{inset:calc(50% - 70px);animation-delay:0s}.hero-card .hero-ring.ring-2{inset:calc(50% - 105px);animation-delay:.6s}.hero-card .hero-ring.ring-3{inset:calc(50% - 140px);animation-delay:1.2s}.hero-card .hero-core{position:relative;z-index:1;width:140px;height:140px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:radial-gradient(circle,color-mix(in srgb,var(--sd-primary, #005cbb) 22%,white),#fff);box-shadow:0 0 60px color-mix(in srgb,var(--sd-primary, #005cbb) 30%,transparent),0 10px 30px color-mix(in srgb,var(--sd-primary, #005cbb) 20%,transparent)}.hero-card .hero-icon{font-size:72px;width:72px;height:72px;color:var(--sd-primary, #005cbb)}.hero-card .hero-decoration{position:absolute;inset:0;pointer-events:none}.hero-card .hero-decoration .dot{position:absolute;width:8px;height:8px;border-radius:50%;background:color-mix(in srgb,var(--sd-primary, #005cbb) 50%,transparent);animation:dot-float 4s ease-in-out infinite}.hero-card .hero-decoration .d1{top:16%;left:12%;animation-delay:0s}.hero-card .hero-decoration .d2{bottom:20%;right:14%;animation-delay:1s}.hero-card .hero-decoration .d3{top:60%;left:80%;animation-delay:2s;width:5px;height:5px}.feature-card{display:flex;align-items:stretch;cursor:default}.feature-card .feature-accent{position:absolute;top:0;left:0;right:0;height:3px;background:linear-gradient(90deg,color-mix(in srgb,var(--sd-primary, #005cbb) 60%,transparent),var(--sd-primary, #005cbb),color-mix(in srgb,var(--sd-primary, #005cbb) 60%,transparent))}.feature-card .feature-content{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px 16px 18px;gap:10px}.feature-card .feature-icon-wrap{width:56px;height:56px;border-radius:50%;background:color-mix(in srgb,var(--sd-primary, #005cbb) 12%,white);display:flex;align-items:center;justify-content:center}.feature-card .feature-icon{font-size:var(--sd-font-size-28, 28px);width:28px;height:28px;color:var(--sd-primary, #005cbb)}.feature-card .feature-label{font-size:var(--sd-font-size-14, 14px);font-weight:var(--sd-font-weight-medium, 500);text-align:center;color:#000000c7;line-height:var(--sd-line-height-20, 20px)}.feature-card.feature-wide .feature-content{flex-direction:row;justify-content:flex-start;padding:18px 24px;gap:18px}.feature-card.feature-wide .feature-icon-wrap{width:64px;height:64px}.feature-card.feature-wide .feature-icon{font-size:var(--sd-font-size-32, 32px);width:32px;height:32px}.feature-card.feature-wide .feature-label{text-align:left;font-size:var(--sd-font-size-16, 16px)}@keyframes card-in{to{opacity:1;transform:translateY(0)}}@keyframes hero-pulse{0%,to{transform:scale(1);opacity:.7}50%{transform:scale(1.06);opacity:.3}}@keyframes dot-float{0%,to{transform:translateY(0);opacity:.8}50%{transform:translateY(-8px);opacity:.4}}@media(max-width:1024px){.bento{grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(4,minmax(120px,1fr));grid-template-areas:\"hero hero data\" \"hero hero report\" \"users flow audit\" \"integ integ integ\"}.hero-card .hero-core{width:120px;height:120px}.hero-card .hero-icon{font-size:60px;width:60px;height:60px}}@media(max-width:640px){.wrapper{padding:16px 12px}.bento{grid-template-columns:1fr;grid-template-rows:auto;grid-template-areas:\"hero\" \"data\" \"report\" \"users\" \"flow\" \"audit\" \"integ\";gap:12px}.hero-card{min-height:220px}.hero-card .hero-core{width:100px;height:100px}.hero-card .hero-icon{font-size:52px;width:52px;height:52px}}@media(prefers-reduced-motion:reduce){.card{animation:none;opacity:1;transform:none}.hero-card .hero-ring{animation:none;opacity:.4}.hero-card .hero-decoration .dot{animation:none}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdPageComponent, selector: "sd-page, sd-page-detail, sd-page-form", inputs: ["title", "description", "noHeader", "backLink", "badges", "width", "aside", "toc"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }] });
2585
4603
  };
2586
4604
  HomePageComponent = __decorate([
2587
4605
  SdTabComponent({
@@ -2698,7 +4716,7 @@ let RootComponent$1 = class RootComponent {
2698
4716
  void this.#router.navigateByUrl(this.#layoutService.homeUrl);
2699
4717
  }
2700
4718
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: RootComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2701
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.17", type: RootComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "@let _userInfo = userInfo();\n<sd-page>\n <div class=\"d-flex flex-column\" headerLeft>\n <div class=\"font-weight-medium fs-20\">{{ 'core.module.layout.greeting.hello' | sdTranslate: { name: _userInfo?.fullName ?? _userInfo?.email ?? _userInfo?.username ?? '' } }}</div>\n <span class=\"T12R text-secondary\">{{ todayInfo() }}</span>\n </div>\n\n <div class=\"h-full d-flex flex-column align-items-center\">\n <div class=\"h-full d-flex flex-column align-items-center justify-content-center text-center wrapper\">\n <img alt=\"not-found\" class=\"sd-image-not-found\" />\n <span class=\"T16M mt-24\">{{ 'core.module.layout.not-found.title' | sdTranslate }}</span>\n <span class=\"T16R text-secondary mt-4\">\n {{ 'core.module.layout.not-found.message' | sdTranslate }}\n </span>\n <sd-button class=\"mt-16\" type=\"fill\" color=\"primary\" (click)=\"reload()\" [title]=\"'core.module.layout.not-found.back' | sdTranslate\" prefixIcon=\"arrow_back\"> </sd-button>\n </div>\n </div>\n</sd-page>\n", styles: [".wrapper{width:300px}\n"], dependencies: [{ kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType"], outputs: ["click"] }, { kind: "component", type: SdPageComponent, selector: "sd-page", inputs: ["title", "description", "noHeader"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }] });
4719
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.17", type: RootComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "@let _userInfo = userInfo();\n<sd-page>\n <div class=\"d-flex flex-column\" headerLeft>\n <div class=\"font-weight-medium fs-20\">{{ 'core.module.layout.greeting.hello' | sdTranslate: { name: _userInfo?.fullName ?? _userInfo?.email ?? _userInfo?.username ?? '' } }}</div>\n <span class=\"T12R text-secondary\">{{ todayInfo() }}</span>\n </div>\n\n <div class=\"h-full d-flex flex-column align-items-center\">\n <div class=\"h-full d-flex flex-column align-items-center justify-content-center text-center wrapper\">\n <img alt=\"not-found\" class=\"sd-image-not-found\" />\n <span class=\"T16M mt-24\">{{ 'core.module.layout.not-found.title' | sdTranslate }}</span>\n <span class=\"T16R text-secondary mt-4\">\n {{ 'core.module.layout.not-found.message' | sdTranslate }}\n </span>\n <sd-button class=\"mt-16\" type=\"fill\" color=\"primary\" (click)=\"reload()\" [title]=\"'core.module.layout.not-found.back' | sdTranslate\" prefixIcon=\"arrow_back\"> </sd-button>\n </div>\n </div>\n</sd-page>\n", styles: [".wrapper{width:300px}\n"], dependencies: [{ kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType", "indicator", "indicatorColor", "indicatorMax", "indicatorLabel"], outputs: ["click"] }, { kind: "component", type: SdPageComponent, selector: "sd-page, sd-page-detail, sd-page-form", inputs: ["title", "description", "noHeader", "backLink", "badges", "width", "aside", "toc"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }] });
2702
4720
  };
2703
4721
  RootComponent$1 = __decorate([
2704
4722
  SdTabComponent({
@@ -2774,7 +4792,7 @@ let RootComponent = class RootComponent {
2774
4792
  void this.#router.navigateByUrl(this.#layoutService.homeUrl);
2775
4793
  }
2776
4794
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: RootComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
2777
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.17", type: RootComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "@let _userInfo = userInfo();\n<sd-page>\n <div class=\"d-flex flex-column\" headerLeft>\n <div class=\"font-weight-medium fs-20\">{{ 'core.module.layout.greeting.hello' | sdTranslate: { name: _userInfo?.fullName ?? _userInfo?.email ?? _userInfo?.username ?? '' } }}</div>\n <span class=\"T12R text-secondary\">{{ todayInfo() }}</span>\n </div>\n <div class=\"h-full d-flex flex-column align-items-center\">\n <div class=\"h-full d-flex flex-column align-items-center justify-content-center text-center wrapper\">\n <img alt=\"forbidden\" class=\"sd-image-forbidden\" />\n <span class=\"T16M mt-24\">{{ 'core.module.layout.forbidden.title' | sdTranslate }}</span>\n <span class=\"T14R text-secondary mt-4\"\n >{{ 'core.module.layout.forbidden.message' | sdTranslate }}</span\n >\n <sd-button class=\"mt-16\" type=\"fill\" color=\"primary\" (click)=\"reload()\" [title]=\"'core.module.layout.forbidden.back-home' | sdTranslate\"> </sd-button>\n </div>\n </div>\n</sd-page>\n", styles: [".wrapper{width:300px}\n"], dependencies: [{ kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType"], outputs: ["click"] }, { kind: "component", type: SdPageComponent, selector: "sd-page", inputs: ["title", "description", "noHeader"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }] });
4795
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.17", type: RootComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "@let _userInfo = userInfo();\n<sd-page>\n <div class=\"d-flex flex-column\" headerLeft>\n <div class=\"font-weight-medium fs-20\">{{ 'core.module.layout.greeting.hello' | sdTranslate: { name: _userInfo?.fullName ?? _userInfo?.email ?? _userInfo?.username ?? '' } }}</div>\n <span class=\"T12R text-secondary\">{{ todayInfo() }}</span>\n </div>\n <div class=\"h-full d-flex flex-column align-items-center\">\n <div class=\"h-full d-flex flex-column align-items-center justify-content-center text-center wrapper\">\n <img alt=\"forbidden\" class=\"sd-image-forbidden\" />\n <span class=\"T16M mt-24\">{{ 'core.module.layout.forbidden.title' | sdTranslate }}</span>\n <span class=\"T14R text-secondary mt-4\"\n >{{ 'core.module.layout.forbidden.message' | sdTranslate }}</span\n >\n <sd-button class=\"mt-16\" type=\"fill\" color=\"primary\" (click)=\"reload()\" [title]=\"'core.module.layout.forbidden.back-home' | sdTranslate\"> </sd-button>\n </div>\n </div>\n</sd-page>\n", styles: [".wrapper{width:300px}\n"], dependencies: [{ kind: "component", type: SdButton, selector: "sd-button", inputs: ["autoId", "type", "color", "size", "fontSet", "title", "width", "tooltip", "prefixIcon", "suffixIcon", "disabled", "openOnHover", "loading", "block", "htmlType", "indicator", "indicatorColor", "indicatorMax", "indicatorLabel"], outputs: ["click"] }, { kind: "component", type: SdPageComponent, selector: "sd-page, sd-page-detail, sd-page-form", inputs: ["title", "description", "noHeader", "backLink", "badges", "width", "aside", "toc"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }] });
2778
4796
  };
2779
4797
  RootComponent = __decorate([
2780
4798
  SdTabComponent({
@@ -2856,5 +4874,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
2856
4874
  * Generated bundle index. Do not edit.
2857
4875
  */
2858
4876
 
2859
- export { DEFAULT_LAYOUT_MOBILE_BREAKPOINT, ForbiddenModule, HighlightSearchPipe, HomeModule, MenuFocusPipe, MenuPipe, NotFoundModule, SD_LAYOUT_CONFIGURATION, SD_LAYOUT_DEMO_FALLBACK, SD_LAYOUT_STORAGE_NAMESPACE, SD_LAYOUT_VIEWPORT, SdLayoutComponent, SdLayoutMenuTreeComponent, SdLayoutModule, SdLayoutNavigationStateService, SdLayoutResponsiveService, SdLayoutService, SdLayoutStorageService, SdLayoutUserMenuComponent, SdPageComponent, SdSidebarMobileOverlay, SdSidebarMobileV1, SdSidebarMobileV2, SdSidebarMobileV3, SdSidebarV2, SdSidebarV3, collectMatchedMenuPaths, containsMenuPath, flattenMenuLeaves, getMenuStableKey, isMenuPathMatch, normalizeLayoutMobileBreakpoint, normalizeMenuPath, normalizeSidebarConfiguration, resolveActiveMenuPath, resolveMenuKeys, resolveSidebarV2Interaction, resolveSidebarV3Recent, resolveTabName, searchMenuLeaves, selectPrimaryMenuGroups };
4877
+ export { DEFAULT_LAYOUT_MOBILE_BREAKPOINT, ForbiddenModule, HighlightSearchPipe, HomeModule, MenuFocusPipe, MenuPipe, NotFoundModule, SD_LAYOUT_CONFIGURATION, SD_LAYOUT_CONTEXT_MARKER_KEY, SD_LAYOUT_CONTEXT_RUNTIME, SD_LAYOUT_DEMO_FALLBACK, SD_LAYOUT_STORAGE_NAMESPACE, SD_LAYOUT_VIEWPORT, SD_PAGE_LIST, SdLayoutComponent, SdLayoutContextService, SdLayoutContextSwitcher, SdLayoutMenuTreeComponent, SdLayoutModule, SdLayoutNavigationStateService, SdLayoutResponsiveService, SdLayoutService, SdLayoutStorageService, SdLayoutUserMenuComponent, SdPageComponent, SdPageList, SdSidebarMobileOverlay, SdSidebarMobileV1, SdSidebarMobileV2, SdSidebarMobileV3, SdSidebarMobileV4, SdSidebarV2, SdSidebarV3, SdSidebarV4, collectMatchedMenuPaths, containsMenuPath, createSdLayoutContextBrowserRuntime, flattenMenuLeaves, getMenuStableKey, groupMenusBySection, isMenuPathMatch, normalizeLayoutMobileBreakpoint, normalizeMenuPath, normalizeSidebarConfiguration, resolveActiveMenuPath, resolveMenuKeys, resolveMenuTrailing, resolveSidebarV2Interaction, resolveSidebarV3Recent, resolveTabName, sdPageFormLeaveGuard, searchAvailableMenuLeaves, searchMenuLeaves, selectPrimaryMenuGroups };
2860
4878
  //# sourceMappingURL=sdcorejs-angular-modules-layout.mjs.map