@sdcorejs/angular 22.2.13 → 22.2.15

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 (42) hide show
  1. package/assets/STYLE-GUIDE.md +138 -10
  2. package/assets/scss/core/form.scss +18 -2
  3. package/assets/scss/core/utilities/_base.scss +3 -3
  4. package/assets/scss/themes/_presets.scss +52 -0
  5. package/assets/scss/themes/default.scss +39 -11
  6. package/assets/scss/themes/material-theme.scss +2 -2
  7. package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs +1 -1
  8. package/fesm2022/sdcorejs-angular-components-api-contract-builder.mjs.map +1 -1
  9. package/fesm2022/sdcorejs-angular-components-button.mjs +13 -2
  10. package/fesm2022/sdcorejs-angular-components-button.mjs.map +1 -1
  11. package/fesm2022/sdcorejs-angular-components-file-explorer.mjs +2679 -0
  12. package/fesm2022/sdcorejs-angular-components-file-explorer.mjs.map +1 -0
  13. package/fesm2022/sdcorejs-angular-components-form-generic.mjs +3 -3
  14. package/fesm2022/sdcorejs-angular-components-form-generic.mjs.map +1 -1
  15. package/fesm2022/sdcorejs-angular-components-preview.mjs +2 -2
  16. package/fesm2022/sdcorejs-angular-components-preview.mjs.map +1 -1
  17. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs +95 -7
  18. package/fesm2022/sdcorejs-angular-components-side-drawer.mjs.map +1 -1
  19. package/fesm2022/sdcorejs-angular-components-tab-router.mjs +10 -4
  20. package/fesm2022/sdcorejs-angular-components-tab-router.mjs.map +1 -1
  21. package/fesm2022/sdcorejs-angular-components-tab.mjs +56 -3
  22. package/fesm2022/sdcorejs-angular-components-tab.mjs.map +1 -1
  23. package/fesm2022/sdcorejs-angular-components-table.mjs +510 -79
  24. package/fesm2022/sdcorejs-angular-components-table.mjs.map +1 -1
  25. package/fesm2022/sdcorejs-angular-components.mjs +1 -0
  26. package/fesm2022/sdcorejs-angular-components.mjs.map +1 -1
  27. package/fesm2022/sdcorejs-angular-forms-select.mjs +2 -2
  28. package/fesm2022/sdcorejs-angular-forms-select.mjs.map +1 -1
  29. package/fesm2022/sdcorejs-angular-i18n.mjs +430 -0
  30. package/fesm2022/sdcorejs-angular-i18n.mjs.map +1 -1
  31. package/fesm2022/sdcorejs-angular-modules-icon.mjs +6 -0
  32. package/fesm2022/sdcorejs-angular-modules-icon.mjs.map +1 -1
  33. package/fesm2022/sdcorejs-angular-modules-layout.mjs +2 -2
  34. package/fesm2022/sdcorejs-angular-modules-layout.mjs.map +1 -1
  35. package/package.json +5 -1
  36. package/types/sdcorejs-angular-components-button.d.ts +5 -0
  37. package/types/sdcorejs-angular-components-file-explorer.d.ts +500 -0
  38. package/types/sdcorejs-angular-components-side-drawer.d.ts +13 -2
  39. package/types/sdcorejs-angular-components-tab.d.ts +8 -2
  40. package/types/sdcorejs-angular-components-table.d.ts +220 -6
  41. package/types/sdcorejs-angular-components.d.ts +1 -0
  42. package/types/sdcorejs-angular-i18n.d.ts +85 -0
@@ -0,0 +1,2679 @@
1
+ import { NgComponentOutlet, DOCUMENT } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { input, computed, ChangeDetectionStrategy, Component, inject, ElementRef, output, signal, viewChild, effect, untracked, Injector, NgZone, afterNextRender, DestroyRef } from '@angular/core';
4
+ import { SdBreadcrumb } from '@sdcorejs/angular/components/breadcrumb';
5
+ import { SdButton } from '@sdcorejs/angular/components/button';
6
+ import { SdDataState } from '@sdcorejs/angular/components/data-state';
7
+ import { I18nService, SdTranslatePipe } from '@sdcorejs/angular/i18n';
8
+ import { SdIcon } from '@sdcorejs/angular/modules/icon';
9
+ import { SdSideDrawer } from '@sdcorejs/angular/components/side-drawer';
10
+
11
+ // AUTO-GENERATED by scripts/generate-file-explorer-icons.mjs from ./assets/icons. DO NOT EDIT.
12
+ // Run `npm run generate:file-explorer-icons` at the repo root after changing the SVG files or manifest.json.
13
+ /** Icon markup (64 × 64 viewBox), without title / ARIA / fixed size — rendered decoratively. */
14
+ const SD_FILE_EXPLORER_ICON_SVGS = {
15
+ 'file-3d': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#2A8495" opacity=".17"/><g fill="none" stroke="#2A8495" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m32 20 11 6v11l-11 6-11-6V26zm0 12 11-6m-11 6-11-6m11 6v11"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#2A8495"/><g fill="#FFF"><path d="M29.03 47.27Q29.77 47.46 30.15 47.93Q30.53 48.4 30.53 49.13Q30.53 50.21 29.7 50.78Q28.87 51.34 27.28 51.34Q26.72 51.34 26.16 51.25Q25.59 51.16 25.04 50.98V49.53Q25.57 49.79 26.09 49.93Q26.61 50.06 27.11 50.06Q27.86 50.06 28.25 49.8Q28.65 49.54 28.65 49.06Q28.65 48.56 28.25 48.31Q27.84 48.05 27.04 48.05H26.29V46.84H27.08Q27.79 46.84 28.14 46.62Q28.48 46.4 28.48 45.94Q28.48 45.52 28.15 45.29Q27.81 45.06 27.19 45.06Q26.74 45.06 26.27 45.16Q25.81 45.27 25.35 45.47V44.09Q25.91 43.93 26.46 43.86Q27 43.78 27.53 43.78Q28.95 43.78 29.66 44.24Q30.36 44.71 30.36 45.65Q30.36 46.29 30.02 46.7Q29.69 47.1 29.03 47.27Z"/><path d="M34.13 45.33V49.78H34.8Q35.95 49.78 36.56 49.21Q37.17 48.64 37.17 47.55Q37.17 46.46 36.56 45.9Q35.96 45.33 34.8 45.33ZM32.25 43.91H34.23Q35.89 43.91 36.7 44.15Q37.52 44.38 38.1 44.95Q38.61 45.44 38.86 46.09Q39.11 46.73 39.11 47.55Q39.11 48.37 38.86 49.02Q38.61 49.67 38.1 50.16Q37.51 50.73 36.69 50.96Q35.87 51.2 34.23 51.2H32.25Z"/></g></svg>',
16
+ 'file-7z': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#926923" opacity=".17"/><g fill="none" stroke="#926923" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="22" y="23" width="20" height="14" rx="2"/><path d="M24 20h16v3M31 23v9m3-7-2 2 2 2-2 2"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#926923"/><g fill="#FFF"><path d="M25.56 43.91H31.06V44.97L28.22 51.2H26.38L29.08 45.29H25.56Z"/><path d="M32.42 43.91H38.54V45.05L34.63 49.78H38.66V51.2H32.3V50.06L36.21 45.33H32.42Z"/></g></svg>',
17
+ 'file-ai': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#BA622F" opacity=".17"/><g fill="none" stroke="#BA622F" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m32 20 9 9-9 9-9-9zm0 0v18m-4-4 4-4 4 4"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#BA622F"/><g fill="#FFF"><path d="M31.61 49.87H28.67L28.21 51.2H26.32L29.02 43.91H31.26L33.96 51.2H32.07ZM29.14 48.52H31.14L30.14 45.62Z"/><path d="M34.93 43.91H36.81V51.2H34.93Z"/></g></svg>',
18
+ 'file-app': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#5E7186" opacity=".17"/><g fill="none" stroke="#5E7186" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="23" y="22" width="18" height="15" rx="3"/><path d="M28 19v3m8-3v3m-8 15v3m8-3v3m-16-13h3m-3 6h3m18-6h3m-3 6h3"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#5E7186"/><g fill="#FFF"><path d="M26.14 49.87H23.2L22.74 51.2H20.85L23.55 43.91H25.79L28.49 51.2H26.6ZM23.67 48.52H25.67L24.67 45.62Z"/><path d="M29.46 43.91H32.58Q33.97 43.91 34.71 44.53Q35.46 45.15 35.46 46.29Q35.46 47.44 34.71 48.05Q33.97 48.67 32.58 48.67H31.34V51.2H29.46ZM31.34 45.27V47.31H32.38Q32.93 47.31 33.22 47.04Q33.52 46.78 33.52 46.29Q33.52 45.8 33.22 45.54Q32.93 45.27 32.38 45.27Z"/><path d="M36.79 43.91H39.91Q41.3 43.91 42.04 44.53Q42.79 45.15 42.79 46.29Q42.79 47.44 42.04 48.05Q41.3 48.67 39.91 48.67H38.67V51.2H36.79ZM38.67 45.27V47.31H39.71Q40.25 47.31 40.55 47.04Q40.85 46.78 40.85 46.29Q40.85 45.8 40.55 45.54Q40.25 45.27 39.71 45.27Z"/></g></svg>',
19
+ 'file-archive': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#926923" opacity=".17"/><g fill="none" stroke="#926923" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="22" y="23" width="20" height="14" rx="2"/><path d="M24 20h16v3M31 23v9m3-7-2 2 2 2-2 2"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#926923"/><g fill="#FFF"><path d="M25.95 49.87H23.01L22.55 51.2H20.66L23.36 43.91H25.6L28.3 51.2H26.41ZM23.48 48.52H25.48L24.48 45.62Z"/><path d="M31.94 47.14Q32.53 47.14 32.79 46.92Q33.04 46.7 33.04 46.2Q33.04 45.7 32.79 45.49Q32.53 45.27 31.94 45.27H31.15V47.14ZM31.15 48.44V51.2H29.27V43.91H32.14Q33.58 43.91 34.25 44.39Q34.92 44.88 34.92 45.92Q34.92 46.64 34.57 47.11Q34.22 47.57 33.52 47.79Q33.91 47.88 34.21 48.19Q34.52 48.5 34.83 49.13L35.85 51.2H33.85L32.96 49.39Q32.69 48.84 32.42 48.64Q32.14 48.44 31.68 48.44Z"/><path d="M42.75 50.8Q42.23 51.07 41.67 51.2Q41.11 51.34 40.5 51.34Q38.68 51.34 37.61 50.32Q36.55 49.31 36.55 47.56Q36.55 45.81 37.61 44.8Q38.68 43.78 40.5 43.78Q41.11 43.78 41.67 43.91Q42.23 44.05 42.75 44.32V45.83Q42.23 45.47 41.72 45.31Q41.21 45.14 40.65 45.14Q39.64 45.14 39.07 45.78Q38.49 46.43 38.49 47.56Q38.49 48.69 39.07 49.33Q39.64 49.98 40.65 49.98Q41.21 49.98 41.72 49.81Q42.23 49.65 42.75 49.29Z"/></g></svg>',
20
+ 'file-audio': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#B84C89" opacity=".17"/><g fill="none" stroke="#B84C89" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M31 22v12m0-10 10-3v11M26 36c-3 0-4-3-1-4 2-1 6-1 6 1s-2 3-5 3zm10-2c-3 0-4-3-1-4 2-1 6-1 6 1s-2 3-5 3z"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#B84C89"/><g fill="#FFF"><path d="M25.26 49.87H22.32L21.86 51.2H19.97L22.67 43.91H24.91L27.61 51.2H25.72ZM22.79 48.52H24.79L23.79 45.62Z"/><path d="M28.58 43.91H30.46V48.28Q30.46 49.18 30.75 49.57Q31.05 49.96 31.72 49.96Q32.39 49.96 32.69 49.57Q32.98 49.18 32.98 48.28V43.91H34.86V48.28Q34.86 49.83 34.08 50.58Q33.31 51.34 31.72 51.34Q30.13 51.34 29.35 50.58Q28.58 49.83 28.58 48.28Z"/><path d="M38.58 45.33V49.78H39.25Q40.4 49.78 41.01 49.21Q41.62 48.64 41.62 47.55Q41.62 46.46 41.01 45.9Q40.41 45.33 39.25 45.33ZM36.7 43.91H38.68Q40.34 43.91 41.15 44.15Q41.97 44.38 42.55 44.95Q43.06 45.44 43.31 46.09Q43.56 46.73 43.56 47.55Q43.56 48.37 43.31 49.02Q43.06 49.67 42.55 50.16Q41.96 50.73 41.14 50.96Q40.32 51.2 38.68 51.2H36.7Z"/></g></svg>',
21
+ 'file-book': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#A15D63" opacity=".17"/><g fill="none" stroke="#A15D63" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M32 24c-4-3-8-3-12-2v14c4-1 8-1 12 2 4-3 8-3 12-2V22c-4-1-8-1-12 2zm0 0v14"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#A15D63"/><g fill="#FFF"><path d="M21.13 47.27Q21.52 47.27 21.73 47.1Q21.93 46.92 21.93 46.59Q21.93 46.26 21.73 46.08Q21.52 45.91 21.13 45.91H20.22V47.27ZM21.19 50.07Q21.69 50.07 21.94 49.86Q22.19 49.65 22.19 49.23Q22.19 48.81 21.94 48.6Q21.69 48.39 21.19 48.39H20.22V50.07ZM22.73 47.77Q23.26 47.92 23.55 48.34Q23.84 48.76 23.84 49.36Q23.84 50.29 23.22 50.74Q22.59 51.2 21.31 51.2H18.56V44.78H21.05Q22.38 44.78 22.98 45.19Q23.58 45.59 23.58 46.48Q23.58 46.95 23.36 47.28Q23.14 47.61 22.73 47.77Z"/><path d="M28.2 45.87Q27.45 45.87 27.03 46.43Q26.61 46.98 26.61 48Q26.61 49.01 27.03 49.57Q27.45 50.13 28.2 50.13Q28.96 50.13 29.38 49.57Q29.8 49.01 29.8 48Q29.8 46.98 29.38 46.43Q28.96 45.87 28.2 45.87ZM28.2 44.67Q29.75 44.67 30.62 45.55Q31.5 46.44 31.5 48Q31.5 49.55 30.62 50.44Q29.75 51.32 28.2 51.32Q26.66 51.32 25.78 50.44Q24.9 49.55 24.9 48Q24.9 46.44 25.78 45.55Q26.66 44.67 28.2 44.67Z"/><path d="M35.68 45.87Q34.93 45.87 34.51 46.43Q34.09 46.98 34.09 48Q34.09 49.01 34.51 49.57Q34.93 50.13 35.68 50.13Q36.44 50.13 36.86 49.57Q37.28 49.01 37.28 48Q37.28 46.98 36.86 46.43Q36.44 45.87 35.68 45.87ZM35.68 44.67Q37.23 44.67 38.11 45.55Q38.98 46.44 38.98 48Q38.98 49.55 38.11 50.44Q37.23 51.32 35.68 51.32Q34.14 51.32 33.26 50.44Q32.38 49.55 32.38 48Q32.38 46.44 33.26 45.55Q34.14 44.67 35.68 44.67Z"/><path d="M40.23 44.78H41.89V47.13L44.27 44.78H46.19L43.1 47.82L46.51 51.2H44.44L41.89 48.67V51.2H40.23Z"/></g></svg>',
22
+ 'file-code': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#446EAB" opacity=".17"/><g fill="none" stroke="#446EAB" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m28 23-6 6 6 6m8-12 6 6-6 6m-3-15-3 18"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#446EAB"/><g fill="#FFF"><path d="M24.27 50.85Q23.81 51.08 23.32 51.2Q22.82 51.32 22.29 51.32Q20.68 51.32 19.75 50.43Q18.81 49.53 18.81 48Q18.81 46.46 19.75 45.56Q20.68 44.67 22.29 44.67Q22.82 44.67 23.32 44.79Q23.81 44.91 24.27 45.15V46.47Q23.81 46.16 23.36 46.01Q22.91 45.87 22.42 45.87Q21.53 45.87 21.03 46.43Q20.52 47 20.52 48Q20.52 48.99 21.03 49.56Q21.53 50.13 22.42 50.13Q22.91 50.13 23.36 49.98Q23.81 49.83 24.27 49.52Z"/><path d="M28.57 45.87Q27.81 45.87 27.4 46.43Q26.98 46.98 26.98 48Q26.98 49.01 27.4 49.57Q27.81 50.13 28.57 50.13Q29.33 50.13 29.75 49.57Q30.16 49.01 30.16 48Q30.16 46.98 29.75 46.43Q29.33 45.87 28.57 45.87ZM28.57 44.67Q30.12 44.67 30.99 45.55Q31.87 46.44 31.87 48Q31.87 49.55 30.99 50.44Q30.12 51.32 28.57 51.32Q27.03 51.32 26.15 50.44Q25.27 49.55 25.27 48Q25.27 46.44 26.15 45.55Q27.03 44.67 28.57 44.67Z"/><path d="M34.77 46.04V49.95H35.37Q36.38 49.95 36.92 49.45Q37.45 48.94 37.45 47.99Q37.45 47.03 36.92 46.53Q36.38 46.04 35.37 46.04ZM33.12 44.78H34.86Q36.32 44.78 37.04 44.99Q37.76 45.2 38.27 45.7Q38.72 46.13 38.94 46.7Q39.16 47.27 39.16 47.99Q39.16 48.71 38.94 49.28Q38.72 49.85 38.27 50.28Q37.75 50.78 37.03 50.99Q36.31 51.2 34.86 51.2H33.12Z"/><path d="M40.42 44.78H44.89V46.04H42.08V47.23H44.72V48.48H42.08V49.95H44.98V51.2H40.42Z"/></g></svg>',
23
+ 'file-css': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#3973BB" opacity=".17"/><g fill="none" stroke="#3973BB" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m28 23-6 6 6 6m8-12 6 6-6 6m-3-15-3 18"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#3973BB"/><g fill="#FFF"><path d="M27.83 50.8Q27.31 51.07 26.75 51.2Q26.19 51.34 25.58 51.34Q23.76 51.34 22.69 50.32Q21.63 49.31 21.63 47.56Q21.63 45.81 22.69 44.8Q23.76 43.78 25.58 43.78Q26.19 43.78 26.75 43.91Q27.31 44.05 27.83 44.32V45.83Q27.31 45.47 26.8 45.31Q26.29 45.14 25.73 45.14Q24.72 45.14 24.15 45.78Q23.57 46.43 23.57 47.56Q23.57 48.69 24.15 49.33Q24.72 49.98 25.73 49.98Q26.29 49.98 26.8 49.81Q27.31 49.65 27.83 49.29Z"/><path d="M34.46 44.14V45.68Q33.86 45.41 33.29 45.28Q32.72 45.14 32.21 45.14Q31.53 45.14 31.21 45.33Q30.89 45.51 30.89 45.9Q30.89 46.2 31.11 46.36Q31.32 46.52 31.9 46.64L32.7 46.8Q33.91 47.04 34.42 47.54Q34.94 48.04 34.94 48.96Q34.94 50.16 34.22 50.75Q33.51 51.34 32.04 51.34Q31.34 51.34 30.65 51.21Q29.95 51.08 29.25 50.82V49.23Q29.95 49.6 30.6 49.79Q31.25 49.98 31.86 49.98Q32.47 49.98 32.8 49.77Q33.13 49.57 33.13 49.19Q33.13 48.85 32.9 48.66Q32.68 48.48 32.02 48.33L31.29 48.17Q30.2 47.93 29.69 47.42Q29.19 46.91 29.19 46.04Q29.19 44.95 29.89 44.36Q30.59 43.78 31.91 43.78Q32.51 43.78 33.15 43.87Q33.78 43.96 34.46 44.14Z"/><path d="M41.66 44.14V45.68Q41.06 45.41 40.49 45.28Q39.92 45.14 39.41 45.14Q38.74 45.14 38.41 45.33Q38.09 45.51 38.09 45.9Q38.09 46.2 38.31 46.36Q38.53 46.52 39.1 46.64L39.9 46.8Q41.11 47.04 41.63 47.54Q42.14 48.04 42.14 48.96Q42.14 50.16 41.42 50.75Q40.71 51.34 39.24 51.34Q38.55 51.34 37.85 51.21Q37.15 51.08 36.45 50.82V49.23Q37.15 49.6 37.8 49.79Q38.45 49.98 39.06 49.98Q39.67 49.98 40 49.77Q40.33 49.57 40.33 49.19Q40.33 48.85 40.11 48.66Q39.88 48.48 39.22 48.33L38.49 48.17Q37.4 47.93 36.89 47.42Q36.39 46.91 36.39 46.04Q36.39 44.95 37.09 44.36Q37.79 43.78 39.11 43.78Q39.71 43.78 40.35 43.87Q40.98 43.96 41.66 44.14Z"/></g></svg>',
24
+ 'file-csv': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#198360" opacity=".17"/><g fill="none" stroke="#198360" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="22" y="21" width="20" height="15" rx="1.5"/><path d="M22 26h20M22 31h20M29 21v15M36 21v15"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#198360"/><g fill="#FFF"><path d="M27.56 50.8Q27.04 51.07 26.48 51.2Q25.92 51.34 25.31 51.34Q23.49 51.34 22.42 50.32Q21.36 49.31 21.36 47.56Q21.36 45.81 22.42 44.8Q23.49 43.78 25.31 43.78Q25.92 43.78 26.48 43.91Q27.04 44.05 27.56 44.32V45.83Q27.04 45.47 26.53 45.31Q26.02 45.14 25.46 45.14Q24.45 45.14 23.88 45.78Q23.3 46.43 23.3 47.56Q23.3 48.69 23.88 49.33Q24.45 49.98 25.46 49.98Q26.02 49.98 26.53 49.81Q27.04 49.65 27.56 49.29Z"/><path d="M34.19 44.14V45.68Q33.59 45.41 33.02 45.28Q32.45 45.14 31.94 45.14Q31.27 45.14 30.94 45.33Q30.62 45.51 30.62 45.9Q30.62 46.2 30.84 46.36Q31.06 46.52 31.63 46.64L32.43 46.8Q33.64 47.04 34.16 47.54Q34.67 48.04 34.67 48.96Q34.67 50.16 33.95 50.75Q33.24 51.34 31.77 51.34Q31.07 51.34 30.38 51.21Q29.68 51.08 28.98 50.82V49.23Q29.68 49.6 30.33 49.79Q30.98 49.98 31.59 49.98Q32.2 49.98 32.53 49.77Q32.86 49.57 32.86 49.19Q32.86 48.85 32.63 48.66Q32.41 48.48 31.75 48.33L31.02 48.17Q29.93 47.93 29.42 47.42Q28.92 46.91 28.92 46.04Q28.92 44.95 29.62 44.36Q30.32 43.78 31.64 43.78Q32.24 43.78 32.88 43.87Q33.51 43.96 34.19 44.14Z"/><path d="M35.45 43.91H37.34L39.27 49.29L41.2 43.91H43.09L40.39 51.2H38.15Z"/></g></svg>',
25
+ 'file-design': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#805AB9" opacity=".17"/><g fill="none" stroke="#805AB9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m32 21 11 6-11 6-11-6zm-11 11 11 6 11-6"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#805AB9"/><g fill="#FFF"><path d="M23.63 45.33V49.78H24.3Q25.46 49.78 26.06 49.21Q26.67 48.64 26.67 47.55Q26.67 46.46 26.07 45.9Q25.46 45.33 24.3 45.33ZM21.75 43.91H23.73Q25.39 43.91 26.21 44.15Q27.02 44.38 27.6 44.95Q28.11 45.44 28.36 46.09Q28.61 46.73 28.61 47.55Q28.61 48.37 28.36 49.02Q28.11 49.67 27.6 50.16Q27.01 50.73 26.19 50.96Q25.37 51.2 23.73 51.2H21.75Z"/><path d="M30.05 43.91H35.12V45.33H31.93V46.69H34.93V48.11H31.93V49.78H35.23V51.2H30.05Z"/><path d="M41.96 44.14V45.68Q41.36 45.41 40.78 45.28Q40.21 45.14 39.71 45.14Q39.03 45.14 38.71 45.33Q38.39 45.51 38.39 45.9Q38.39 46.2 38.6 46.36Q38.82 46.52 39.39 46.64L40.19 46.8Q41.41 47.04 41.92 47.54Q42.43 48.04 42.43 48.96Q42.43 50.16 41.72 50.75Q41 51.34 39.53 51.34Q38.84 51.34 38.14 51.21Q37.44 51.08 36.75 50.82V49.23Q37.44 49.6 38.1 49.79Q38.75 49.98 39.35 49.98Q39.97 49.98 40.3 49.77Q40.62 49.57 40.62 49.19Q40.62 48.85 40.4 48.66Q40.18 48.48 39.51 48.33L38.79 48.17Q37.69 47.93 37.19 47.42Q36.68 46.91 36.68 46.04Q36.68 44.95 37.39 44.36Q38.09 43.78 39.41 43.78Q40.01 43.78 40.64 43.87Q41.28 43.96 41.96 44.14Z"/></g></svg>',
26
+ 'file-document': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#3477BE" opacity=".17"/><g fill="none" stroke="#3477BE" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M23 21h17M23 26h17M23 31h12M23 36h16"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#3477BE"/><g fill="#FFF"><path d="M22.73 45.33V49.78H23.4Q24.55 49.78 25.16 49.21Q25.77 48.64 25.77 47.55Q25.77 46.46 25.16 45.9Q24.56 45.33 23.4 45.33ZM20.85 43.91H22.83Q24.49 43.91 25.3 44.15Q26.12 44.38 26.7 44.95Q27.21 45.44 27.46 46.09Q27.71 46.73 27.71 47.55Q27.71 48.37 27.46 49.02Q27.21 49.67 26.7 50.16Q26.11 50.73 25.29 50.96Q24.47 51.2 22.83 51.2H20.85Z"/><path d="M32.48 45.14Q31.62 45.14 31.15 45.78Q30.67 46.41 30.67 47.56Q30.67 48.71 31.15 49.34Q31.62 49.98 32.48 49.98Q33.34 49.98 33.82 49.34Q34.29 48.71 34.29 47.56Q34.29 46.41 33.82 45.78Q33.34 45.14 32.48 45.14ZM32.48 43.78Q34.24 43.78 35.23 44.78Q36.23 45.79 36.23 47.56Q36.23 49.33 35.23 50.34Q34.24 51.34 32.48 51.34Q30.73 51.34 29.73 50.34Q28.73 49.33 28.73 47.56Q28.73 45.79 29.73 44.78Q30.73 43.78 32.48 43.78Z"/><path d="M43.43 50.8Q42.91 51.07 42.35 51.2Q41.79 51.34 41.18 51.34Q39.36 51.34 38.29 50.32Q37.23 49.31 37.23 47.56Q37.23 45.81 38.29 44.8Q39.36 43.78 41.18 43.78Q41.79 43.78 42.35 43.91Q42.91 44.05 43.43 44.32V45.83Q42.91 45.47 42.4 45.31Q41.89 45.14 41.33 45.14Q40.33 45.14 39.75 45.78Q39.17 46.43 39.17 47.56Q39.17 48.69 39.75 49.33Q40.33 49.98 41.33 49.98Q41.89 49.98 42.4 49.81Q42.91 49.65 43.43 49.29Z"/></g></svg>',
27
+ 'file-figma': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#805AB9" opacity=".17"/><g fill="none" stroke="#805AB9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="28" cy="24" r="3"/><circle cx="35" cy="24" r="3"/><circle cx="28" cy="31" r="3"/><circle cx="35" cy="31" r="3"/><circle cx="28" cy="38" r="3"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#805AB9"/><g fill="#FFF"><path d="M23.54 43.91H28.61V45.33H25.42V46.69H28.42V48.11H25.42V51.2H23.54Z"/><path d="M30.37 43.91H32.25V51.2H30.37Z"/><path d="M40.64 50.66Q39.94 51 39.18 51.17Q38.43 51.34 37.62 51.34Q35.8 51.34 34.73 50.32Q33.67 49.31 33.67 47.56Q33.67 45.8 34.75 44.79Q35.84 43.78 37.72 43.78Q38.45 43.78 39.12 43.91Q39.78 44.05 40.37 44.32V45.83Q39.76 45.48 39.16 45.31Q38.56 45.14 37.95 45.14Q36.83 45.14 36.22 45.77Q35.61 46.4 35.61 47.56Q35.61 48.72 36.2 49.35Q36.79 49.98 37.86 49.98Q38.16 49.98 38.41 49.94Q38.66 49.91 38.86 49.83V48.41H37.71V47.15H40.64Z"/></g></svg>',
28
+ 'file-font': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#5E7186" opacity=".17"/><g fill="none" stroke="#5E7186" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m24 37 8-16 8 16m-13-6h10"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#5E7186"/><g fill="#FFF"><path d="M19.38 44.78H23.84V46.04H21.03V47.23H23.67V48.48H21.03V51.2H19.38Z"/><path d="M28.32 45.87Q27.56 45.87 27.15 46.43Q26.73 46.98 26.73 48Q26.73 49.01 27.15 49.57Q27.56 50.13 28.32 50.13Q29.08 50.13 29.5 49.57Q29.91 49.01 29.91 48Q29.91 46.98 29.5 46.43Q29.08 45.87 28.32 45.87ZM28.32 44.67Q29.87 44.67 30.74 45.55Q31.62 46.44 31.62 48Q31.62 49.55 30.74 50.44Q29.87 51.32 28.32 51.32Q26.78 51.32 25.9 50.44Q25.02 49.55 25.02 48Q25.02 46.44 25.9 45.55Q26.78 44.67 28.32 44.67Z"/><path d="M32.87 44.78H34.72L37.05 49.18V44.78H38.62V51.2H36.77L34.44 46.8V51.2H32.87Z"/><path d="M39.47 44.78H45.38V46.04H43.26V51.2H41.6V46.04H39.47Z"/></g></svg>',
29
+ 'file-generic': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#61758F" opacity=".17"/><g fill="none" stroke="#61758F" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M23 23h18M23 28h18M23 33h11"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#61758F"/><g fill="#FFF"><path d="M22.36 44.78H26.82V46.04H24.01V47.23H26.65V48.48H24.01V51.2H22.36Z"/><path d="M28.37 44.78H30.02V51.2H28.37Z"/><path d="M31.64 44.78H33.3V49.95H36.2V51.2H31.64Z"/><path d="M37.25 44.78H41.71V46.04H38.9V47.23H41.55V48.48H38.9V49.95H41.81V51.2H37.25Z"/></g></svg>',
30
+ 'file-gif': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#8255AD" opacity=".17"/><g fill="none" stroke="#8255AD" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="21" y="21" width="22" height="16" rx="2"/><circle cx="36" cy="26" r="1.6"/><path d="m23 34 6-6 4 4 3-3 5 5"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#8255AD"/><g fill="#FFF"><path d="M30.09 50.66Q29.39 51 28.63 51.17Q27.87 51.34 27.07 51.34Q25.25 51.34 24.18 50.32Q23.12 49.31 23.12 47.56Q23.12 45.8 24.2 44.79Q25.29 43.78 27.17 43.78Q27.9 43.78 28.56 43.91Q29.23 44.05 29.82 44.32V45.83Q29.21 45.48 28.61 45.31Q28.01 45.14 27.4 45.14Q26.28 45.14 25.67 45.77Q25.06 46.4 25.06 47.56Q25.06 48.72 25.65 49.35Q26.23 49.98 27.31 49.98Q27.61 49.98 27.86 49.94Q28.11 49.91 28.31 49.83V48.41H27.16V47.15H30.09Z"/><path d="M31.75 43.91H33.63V51.2H31.75Z"/><path d="M35.47 43.91H40.54V45.33H37.35V46.69H40.35V48.11H37.35V51.2H35.47Z"/></g></svg>',
31
+ 'file-html': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#B35A32" opacity=".17"/><g fill="none" stroke="#B35A32" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m28 23-6 6 6 6m8-12 6 6-6 6m-3-15-3 18"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#B35A32"/><g fill="#FFF"><path d="M18.94 44.78H20.6V47.23H23.04V44.78H24.69V51.2H23.04V48.48H20.6V51.2H18.94Z"/><path d="M25.54 44.78H31.45V46.04H29.33V51.2H27.67V46.04H25.54Z"/><path d="M32.31 44.78H34.41L35.88 48.22L37.35 44.78H39.45V51.2H37.88V46.51L36.4 49.97H35.36L33.88 46.51V51.2H32.31Z"/><path d="M41.07 44.78H42.72V49.95H45.63V51.2H41.07Z"/></g></svg>',
32
+ 'file-image': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#8255AD" opacity=".17"/><g fill="none" stroke="#8255AD" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="21" y="21" width="22" height="16" rx="2"/><circle cx="36" cy="26" r="1.6"/><path d="m23 34 6-6 4 4 3-3 5 5"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#8255AD"/><g fill="#FFF"><path d="M21.98 43.91H23.86V51.2H21.98Z"/><path d="M25.7 43.91H28.09L29.75 47.81L31.42 43.91H33.81V51.2H32.03V45.87L30.35 49.8H29.16L27.48 45.87V51.2H25.7Z"/><path d="M42.2 50.66Q41.5 51 40.74 51.17Q39.99 51.34 39.18 51.34Q37.36 51.34 36.29 50.32Q35.23 49.31 35.23 47.56Q35.23 45.8 36.31 44.79Q37.4 43.78 39.28 43.78Q40.01 43.78 40.68 43.91Q41.34 44.05 41.93 44.32V45.83Q41.32 45.48 40.72 45.31Q40.12 45.14 39.51 45.14Q38.39 45.14 37.78 45.77Q37.17 46.4 37.17 47.56Q37.17 48.72 37.76 49.35Q38.35 49.98 39.42 49.98Q39.72 49.98 39.97 49.94Q40.22 49.91 40.42 49.83V48.41H39.27V47.15H42.2Z"/></g></svg>',
33
+ 'file-jpg': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#8255AD" opacity=".17"/><g fill="none" stroke="#8255AD" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="21" y="21" width="22" height="16" rx="2"/><circle cx="36" cy="26" r="1.6"/><path d="m23 34 6-6 4 4 3-3 5 5"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#8255AD"/><g fill="#FFF"><path d="M23.29 43.91H25.17V50.49Q25.17 51.85 24.43 52.53Q23.69 53.2 22.19 53.2H21.81V51.78H22.1Q22.69 51.78 22.99 51.45Q23.29 51.13 23.29 50.49Z"/><path d="M27.01 43.91H30.13Q31.52 43.91 32.27 44.53Q33.01 45.15 33.01 46.29Q33.01 47.44 32.27 48.05Q31.52 48.67 30.13 48.67H28.89V51.2H27.01ZM28.89 45.27V47.31H29.93Q30.48 47.31 30.77 47.04Q31.07 46.78 31.07 46.29Q31.07 45.8 30.77 45.54Q30.48 45.27 29.93 45.27Z"/><path d="M40.89 50.66Q40.19 51 39.43 51.17Q38.67 51.34 37.87 51.34Q36.05 51.34 34.98 50.32Q33.92 49.31 33.92 47.56Q33.92 45.8 35 44.79Q36.09 43.78 37.97 43.78Q38.7 43.78 39.37 43.91Q40.03 44.05 40.62 44.32V45.83Q40.01 45.48 39.41 45.31Q38.81 45.14 38.2 45.14Q37.08 45.14 36.47 45.77Q35.86 46.4 35.86 47.56Q35.86 48.72 36.45 49.35Q37.03 49.98 38.11 49.98Q38.41 49.98 38.66 49.94Q38.91 49.91 39.11 49.83V48.41H37.96V47.15H40.89Z"/></g></svg>',
34
+ 'file-js': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#92731D" opacity=".17"/><g fill="none" stroke="#92731D" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m28 23-6 6 6 6m8-12 6 6-6 6m-3-15-3 18"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#92731D"/><g fill="#FFF"><path d="M27.46 43.91H29.34V50.49Q29.34 51.85 28.6 52.53Q27.86 53.2 26.36 53.2H25.98V51.78H26.27Q26.86 51.78 27.16 51.45Q27.46 51.13 27.46 50.49Z"/><path d="M36.25 44.14V45.68Q35.65 45.41 35.08 45.28Q34.51 45.14 34 45.14Q33.33 45.14 33 45.33Q32.68 45.51 32.68 45.9Q32.68 46.2 32.9 46.36Q33.12 46.52 33.69 46.64L34.49 46.8Q35.7 47.04 36.22 47.54Q36.73 48.04 36.73 48.96Q36.73 50.16 36.01 50.75Q35.3 51.34 33.83 51.34Q33.14 51.34 32.44 51.21Q31.74 51.08 31.04 50.82V49.23Q31.74 49.6 32.39 49.79Q33.04 49.98 33.65 49.98Q34.26 49.98 34.59 49.77Q34.92 49.57 34.92 49.19Q34.92 48.85 34.7 48.66Q34.47 48.48 33.81 48.33L33.08 48.17Q31.99 47.93 31.48 47.42Q30.98 46.91 30.98 46.04Q30.98 44.95 31.68 44.36Q32.38 43.78 33.7 43.78Q34.3 43.78 34.94 43.87Q35.57 43.96 36.25 44.14Z"/></g></svg>',
35
+ 'file-json': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#446EAB" opacity=".17"/><g fill="none" stroke="#446EAB" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M27 21c-3 0-3 2-3 4v2c0 2-1 2-3 2 2 0 3 1 3 3v2c0 3 0 4 3 4m10-17c3 0 3 2 3 4v2c0 2 1 2 3 2-2 0-3 1-3 3v2c0 3 0 4-3 4"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#446EAB"/><g fill="#FFF"><path d="M20.58 44.78H22.23V50.58Q22.23 51.78 21.58 52.37Q20.93 52.96 19.61 52.96H19.28V51.71H19.53Q20.05 51.71 20.31 51.42Q20.58 51.14 20.58 50.58Z"/><path d="M28.32 44.99V46.34Q27.79 46.11 27.29 45.99Q26.78 45.87 26.34 45.87Q25.74 45.87 25.46 46.03Q25.18 46.19 25.18 46.54Q25.18 46.8 25.37 46.94Q25.56 47.08 26.06 47.19L26.77 47.33Q27.84 47.54 28.29 47.98Q28.74 48.42 28.74 49.23Q28.74 50.29 28.11 50.81Q27.48 51.32 26.19 51.32Q25.58 51.32 24.96 51.21Q24.35 51.09 23.73 50.86V49.47Q24.35 49.79 24.92 49.96Q25.49 50.13 26.03 50.13Q26.57 50.13 26.86 49.95Q27.14 49.76 27.14 49.43Q27.14 49.13 26.95 48.97Q26.75 48.8 26.17 48.67L25.53 48.53Q24.57 48.33 24.12 47.87Q23.68 47.42 23.68 46.66Q23.68 45.7 24.3 45.18Q24.91 44.67 26.07 44.67Q26.6 44.67 27.16 44.75Q27.72 44.83 28.32 44.99Z"/><path d="M33.12 45.87Q32.37 45.87 31.95 46.43Q31.53 46.98 31.53 48Q31.53 49.01 31.95 49.57Q32.37 50.13 33.12 50.13Q33.88 50.13 34.3 49.57Q34.72 49.01 34.72 48Q34.72 46.98 34.3 46.43Q33.88 45.87 33.12 45.87ZM33.12 44.67Q34.67 44.67 35.54 45.55Q36.42 46.44 36.42 48Q36.42 49.55 35.54 50.44Q34.67 51.32 33.12 51.32Q31.58 51.32 30.7 50.44Q29.82 49.55 29.82 48Q29.82 46.44 30.7 45.55Q31.58 44.67 33.12 44.67Z"/><path d="M37.67 44.78H39.52L41.85 49.18V44.78H43.42V51.2H41.57L39.24 46.8V51.2H37.67Z"/></g></svg>',
36
+ 'file-markdown': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#3477BE" opacity=".17"/><g fill="none" stroke="#3477BE" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 23v12m0-12 5 7 5-7v12m5-11v10m0 0 4-4m-4 4-4-4"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#3477BE"/><g fill="#FFF"><path d="M23.79 43.91H26.18L27.84 47.81L29.51 43.91H31.9V51.2H30.12V45.87L28.45 49.8H27.25L25.57 45.87V51.2H23.79Z"/><path d="M35.62 45.33V49.78H36.3Q37.45 49.78 38.06 49.21Q38.67 48.64 38.67 47.55Q38.67 46.46 38.06 45.9Q37.45 45.33 36.3 45.33ZM33.74 43.91H35.73Q37.39 43.91 38.2 44.15Q39.01 44.38 39.59 44.95Q40.11 45.44 40.35 46.09Q40.6 46.73 40.6 47.55Q40.6 48.37 40.35 49.02Q40.11 49.67 39.59 50.16Q39.01 50.73 38.19 50.96Q37.37 51.2 35.73 51.2H33.74Z"/></g></svg>',
37
+ 'file-mov': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#B74068" opacity=".17"/><g fill="none" stroke="#B74068" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="21" y="21" width="22" height="16" rx="3"/><path d="m29 25 8 4-8 4z"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#B74068"/><g fill="#FFF"><path d="M19.82 43.91H22.21L23.88 47.81L25.54 43.91H27.93V51.2H26.16V45.87L24.48 49.8H23.28L21.6 45.87V51.2H19.82Z"/><path d="M33.1 45.14Q32.24 45.14 31.77 45.78Q31.3 46.41 31.3 47.56Q31.3 48.71 31.77 49.34Q32.24 49.98 33.1 49.98Q33.97 49.98 34.44 49.34Q34.92 48.71 34.92 47.56Q34.92 46.41 34.44 45.78Q33.97 45.14 33.1 45.14ZM33.1 43.78Q34.86 43.78 35.86 44.78Q36.85 45.79 36.85 47.56Q36.85 49.33 35.86 50.34Q34.86 51.34 33.1 51.34Q31.35 51.34 30.35 50.34Q29.35 49.33 29.35 47.56Q29.35 45.79 30.35 44.78Q31.35 43.78 33.1 43.78Z"/><path d="M37.41 43.91H39.29L41.23 49.29L43.16 43.91H45.05L42.35 51.2H40.11Z"/></g></svg>',
38
+ 'file-mp3': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#B84C89" opacity=".17"/><g fill="none" stroke="#B84C89" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M31 22v12m0-10 10-3v11M26 36c-3 0-4-3-1-4 2-1 6-1 6 1s-2 3-5 3zm10-2c-3 0-4-3-1-4 2-1 6-1 6 1s-2 3-5 3z"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#B84C89"/><g fill="#FFF"><path d="M20.8 43.91H23.19L24.85 47.81L26.52 43.91H28.91V51.2H27.13V45.87L25.45 49.8H24.26L22.58 45.87V51.2H20.8Z"/><path d="M30.75 43.91H33.87Q35.26 43.91 36.01 44.53Q36.75 45.15 36.75 46.29Q36.75 47.44 36.01 48.05Q35.26 48.67 33.87 48.67H32.63V51.2H30.75ZM32.63 45.27V47.31H33.67Q34.22 47.31 34.51 47.04Q34.81 46.78 34.81 46.29Q34.81 45.8 34.51 45.54Q34.22 45.27 33.67 45.27Z"/><path d="M41.82 47.27Q42.56 47.46 42.94 47.93Q43.32 48.4 43.32 49.13Q43.32 50.21 42.49 50.78Q41.66 51.34 40.07 51.34Q39.51 51.34 38.95 51.25Q38.38 51.16 37.83 50.98V49.53Q38.36 49.79 38.88 49.93Q39.4 50.06 39.9 50.06Q40.65 50.06 41.05 49.8Q41.44 49.54 41.44 49.06Q41.44 48.56 41.04 48.31Q40.63 48.05 39.83 48.05H39.08V46.84H39.87Q40.58 46.84 40.93 46.62Q41.27 46.4 41.27 45.94Q41.27 45.52 40.94 45.29Q40.6 45.06 39.98 45.06Q39.53 45.06 39.07 45.16Q38.6 45.27 38.14 45.47V44.09Q38.7 43.93 39.25 43.86Q39.79 43.78 40.32 43.78Q41.74 43.78 42.45 44.24Q43.15 44.71 43.15 45.65Q43.15 46.29 42.82 46.7Q42.48 47.1 41.82 47.27Z"/></g></svg>',
39
+ 'file-mp4': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#B74068" opacity=".17"/><g fill="none" stroke="#B74068" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="21" y="21" width="22" height="16" rx="3"/><path d="m29 25 8 4-8 4z"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#B74068"/><g fill="#FFF"><path d="M20.8 43.91H23.19L24.85 47.81L26.52 43.91H28.91V51.2H27.13V45.87L25.45 49.8H24.26L22.58 45.87V51.2H20.8Z"/><path d="M30.75 43.91H33.87Q35.26 43.91 36.01 44.53Q36.75 45.15 36.75 46.29Q36.75 47.44 36.01 48.05Q35.26 48.67 33.87 48.67H32.63V51.2H30.75ZM32.63 45.27V47.31H33.67Q34.22 47.31 34.51 47.04Q34.81 46.78 34.81 46.29Q34.81 45.8 34.51 45.54Q34.22 45.27 33.67 45.27Z"/><path d="M40.84 45.46 38.78 48.51H40.84ZM40.53 43.91H42.62V48.51H43.66V49.87H42.62V51.2H40.84V49.87H37.61V48.26Z"/></g></svg>',
40
+ 'file-pdf': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#C7494A" opacity=".17"/><g fill="none" stroke="#C7494A" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m26 35 6-15 6 15m-10-5h8"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#C7494A"/><g fill="#FFF"><path d="M21.69 43.91H24.81Q26.2 43.91 26.94 44.53Q27.69 45.15 27.69 46.29Q27.69 47.44 26.94 48.05Q26.2 48.67 24.81 48.67H23.57V51.2H21.69ZM23.57 45.27V47.31H24.61Q25.15 47.31 25.45 47.04Q25.75 46.78 25.75 46.29Q25.75 45.8 25.45 45.54Q25.15 45.27 24.61 45.27Z"/><path d="M30.9 45.33V49.78H31.57Q32.72 49.78 33.33 49.21Q33.94 48.64 33.94 47.55Q33.94 46.46 33.33 45.9Q32.73 45.33 31.57 45.33ZM29.02 43.91H31Q32.66 43.91 33.47 44.15Q34.29 44.38 34.87 44.95Q35.38 45.44 35.63 46.09Q35.88 46.73 35.88 47.55Q35.88 48.37 35.63 49.02Q35.38 49.67 34.87 50.16Q34.28 50.73 33.46 50.96Q32.64 51.2 31 51.2H29.02Z"/><path d="M37.32 43.91H42.39V45.33H39.2V46.69H42.2V48.11H39.2V51.2H37.32Z"/></g></svg>',
41
+ 'file-png': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#8255AD" opacity=".17"/><g fill="none" stroke="#8255AD" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="21" y="21" width="22" height="16" rx="2"/><circle cx="36" cy="26" r="1.6"/><path d="m23 34 6-6 4 4 3-3 5 5"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#8255AD"/><g fill="#FFF"><path d="M20.96 43.91H24.08Q25.48 43.91 26.22 44.53Q26.97 45.15 26.97 46.29Q26.97 47.44 26.22 48.05Q25.48 48.67 24.08 48.67H22.84V51.2H20.96ZM22.84 45.27V47.31H23.88Q24.43 47.31 24.73 47.04Q25.03 46.78 25.03 46.29Q25.03 45.8 24.73 45.54Q24.43 45.27 23.88 45.27Z"/><path d="M28.29 43.91H30.39L33.04 48.91V43.91H34.83V51.2H32.73L30.08 46.2V51.2H28.29Z"/><path d="M43.22 50.66Q42.51 51 41.76 51.17Q41 51.34 40.19 51.34Q38.37 51.34 37.31 50.32Q36.24 49.31 36.24 47.56Q36.24 45.8 37.33 44.79Q38.41 43.78 40.3 43.78Q41.02 43.78 41.69 43.91Q42.36 44.05 42.95 44.32V45.83Q42.34 45.48 41.73 45.31Q41.13 45.14 40.53 45.14Q39.4 45.14 38.79 45.77Q38.19 46.4 38.19 47.56Q38.19 48.72 38.77 49.35Q39.36 49.98 40.44 49.98Q40.73 49.98 40.98 49.94Q41.23 49.91 41.43 49.83V48.41H40.29V47.15H43.22Z"/></g></svg>',
42
+ 'file-presentation': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#BA622F" opacity=".17"/><g fill="none" stroke="#BA622F" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="21" y="21" width="22" height="14" rx="2"/><path d="m29 24 7 4-7 4zM32 35v3m-6 0h12"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#BA622F"/><g fill="#FFF"><path d="M22.18 43.91H25.3Q26.69 43.91 27.43 44.53Q28.18 45.15 28.18 46.29Q28.18 47.44 27.43 48.05Q26.69 48.67 25.3 48.67H24.06V51.2H22.18ZM24.06 45.27V47.31H25.1Q25.65 47.31 25.94 47.04Q26.24 46.78 26.24 46.29Q26.24 45.8 25.94 45.54Q25.65 45.27 25.1 45.27Z"/><path d="M29.51 43.91H32.63Q34.02 43.91 34.76 44.53Q35.51 45.15 35.51 46.29Q35.51 47.44 34.76 48.05Q34.02 48.67 32.63 48.67H31.39V51.2H29.51ZM31.39 45.27V47.31H32.43Q32.97 47.31 33.27 47.04Q33.57 46.78 33.57 46.29Q33.57 45.8 33.27 45.54Q32.97 45.27 32.43 45.27Z"/><path d="M35.97 43.91H42.69V45.33H40.27V51.2H38.39V45.33H35.97Z"/></g></svg>',
43
+ 'file-psd': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#805AB9" opacity=".17"/><g fill="none" stroke="#805AB9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m32 21 11 6-11 6-11-6zm-11 11 11 6 11-6"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#805AB9"/><g fill="#FFF"><path d="M21.5 43.91H24.62Q26.01 43.91 26.76 44.53Q27.5 45.15 27.5 46.29Q27.5 47.44 26.76 48.05Q26.01 48.67 24.62 48.67H23.38V51.2H21.5ZM23.38 45.27V47.31H24.42Q24.97 47.31 25.27 47.04Q25.56 46.78 25.56 46.29Q25.56 45.8 25.27 45.54Q24.97 45.27 24.42 45.27Z"/><path d="M33.9 44.14V45.68Q33.3 45.41 32.73 45.28Q32.16 45.14 31.65 45.14Q30.98 45.14 30.66 45.33Q30.33 45.51 30.33 45.9Q30.33 46.2 30.55 46.36Q30.77 46.52 31.34 46.64L32.14 46.8Q33.36 47.04 33.87 47.54Q34.38 48.04 34.38 48.96Q34.38 50.16 33.67 50.75Q32.95 51.34 31.48 51.34Q30.79 51.34 30.09 51.21Q29.39 51.08 28.69 50.82V49.23Q29.39 49.6 30.04 49.79Q30.7 49.98 31.3 49.98Q31.92 49.98 32.24 49.77Q32.57 49.57 32.57 49.19Q32.57 48.85 32.35 48.66Q32.13 48.48 31.46 48.33L30.74 48.17Q29.64 47.93 29.14 47.42Q28.63 46.91 28.63 46.04Q28.63 44.95 29.33 44.36Q30.04 43.78 31.36 43.78Q31.96 43.78 32.59 43.87Q33.23 43.96 33.9 44.14Z"/><path d="M37.91 45.33V49.78H38.59Q39.74 49.78 40.35 49.21Q40.96 48.64 40.96 47.55Q40.96 46.46 40.35 45.9Q39.74 45.33 38.59 45.33ZM36.03 43.91H38.02Q39.68 43.91 40.49 44.15Q41.3 44.38 41.88 44.95Q42.4 45.44 42.64 46.09Q42.89 46.73 42.89 47.55Q42.89 48.37 42.64 49.02Q42.4 49.67 41.88 50.16Q41.3 50.73 40.48 50.96Q39.66 51.2 38.02 51.2H36.03Z"/></g></svg>',
44
+ 'file-python': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#446EAB" opacity=".17"/><g fill="none" stroke="#446EAB" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M27 21c-3 0-3 2-3 4v2c0 2-1 2-3 2 2 0 3 1 3 3v2c0 3 0 4 3 4m10-17c3 0 3 2 3 4v2c0 2 1 2 3 2-2 0-3 1-3 3v2c0 3 0 4-3 4"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#446EAB"/><g fill="#FFF"><path d="M25.63 43.91H28.75Q30.14 43.91 30.89 44.53Q31.63 45.15 31.63 46.29Q31.63 47.44 30.89 48.05Q30.14 48.67 28.75 48.67H27.51V51.2H25.63ZM27.51 45.27V47.31H28.55Q29.1 47.31 29.4 47.04Q29.7 46.78 29.7 46.29Q29.7 45.8 29.4 45.54Q29.1 45.27 28.55 45.27Z"/><path d="M31.95 43.91H34L35.66 46.51L37.32 43.91H39.38L36.6 48.13V51.2H34.72V48.13Z"/></g></svg>',
45
+ 'file-rar': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#926923" opacity=".17"/><g fill="none" stroke="#926923" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="22" y="23" width="20" height="14" rx="2"/><path d="M24 20h16v3M31 23v9m3-7-2 2 2 2-2 2"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#926923"/><g fill="#FFF"><path d="M24.02 47.14Q24.61 47.14 24.87 46.92Q25.12 46.7 25.12 46.2Q25.12 45.7 24.87 45.49Q24.61 45.27 24.02 45.27H23.23V47.14ZM23.23 48.44V51.2H21.35V43.91H24.22Q25.66 43.91 26.33 44.39Q27 44.88 27 45.92Q27 46.64 26.65 47.11Q26.3 47.57 25.6 47.79Q25.99 47.88 26.29 48.19Q26.6 48.5 26.91 49.13L27.93 51.2H25.93L25.04 49.39Q24.77 48.84 24.5 48.64Q24.22 48.44 23.76 48.44Z"/><path d="M33.47 49.87H30.53L30.07 51.2H28.18L30.88 43.91H33.12L35.82 51.2H33.93ZM31 48.52H33L32 45.62Z"/><path d="M39.46 47.14Q40.05 47.14 40.31 46.92Q40.56 46.7 40.56 46.2Q40.56 45.7 40.31 45.49Q40.05 45.27 39.46 45.27H38.67V47.14ZM38.67 48.44V51.2H36.79V43.91H39.66Q41.1 43.91 41.77 44.39Q42.44 44.88 42.44 45.92Q42.44 46.64 42.09 47.11Q41.74 47.57 41.04 47.79Q41.43 47.88 41.73 48.19Q42.04 48.5 42.35 49.13L43.37 51.2H41.37L40.48 49.39Q40.21 48.84 39.93 48.64Q39.66 48.44 39.2 48.44Z"/></g></svg>',
46
+ 'file-spreadsheet': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#198360" opacity=".17"/><g fill="none" stroke="#198360" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="22" y="21" width="20" height="15" rx="1.5"/><path d="M22 26h20M22 31h20M29 21v15M36 21v15"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#198360"/><g fill="#FFF"><path d="M26.34 47.48 28.87 51.2H26.91L25.21 48.71L23.52 51.2H21.55L24.08 47.48L21.65 43.91H23.61L25.21 46.26L26.8 43.91H28.77Z"/><path d="M29.99 43.91H31.87V49.78H35.17V51.2H29.99Z"/><path d="M41.43 44.14V45.68Q40.83 45.41 40.26 45.28Q39.69 45.14 39.18 45.14Q38.51 45.14 38.18 45.33Q37.86 45.51 37.86 45.9Q37.86 46.2 38.08 46.36Q38.3 46.52 38.87 46.64L39.67 46.8Q40.88 47.04 41.4 47.54Q41.91 48.04 41.91 48.96Q41.91 50.16 41.19 50.75Q40.48 51.34 39.01 51.34Q38.32 51.34 37.62 51.21Q36.92 51.08 36.22 50.82V49.23Q36.92 49.6 37.57 49.79Q38.22 49.98 38.83 49.98Q39.44 49.98 39.77 49.77Q40.1 49.57 40.1 49.19Q40.1 48.85 39.88 48.66Q39.65 48.48 38.99 48.33L38.26 48.17Q37.17 47.93 36.66 47.42Q36.16 46.91 36.16 46.04Q36.16 44.95 36.86 44.36Q37.56 43.78 38.88 43.78Q39.48 43.78 40.12 43.87Q40.75 43.96 41.43 44.14Z"/></g></svg>',
47
+ 'file-sql': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#397994" opacity=".17"/><g fill="none" stroke="#397994" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><ellipse cx="32" cy="23" rx="10" ry="3.5"/><path d="M22 23v11c0 5 20 5 20 0V23m-20 6c0 5 20 5 20 0"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#397994"/><g fill="#FFF"><path d="M26.95 44.14V45.68Q26.35 45.41 25.78 45.28Q25.21 45.14 24.7 45.14Q24.03 45.14 23.71 45.33Q23.38 45.51 23.38 45.9Q23.38 46.2 23.6 46.36Q23.82 46.52 24.39 46.64L25.19 46.8Q26.41 47.04 26.92 47.54Q27.43 48.04 27.43 48.96Q27.43 50.16 26.72 50.75Q26 51.34 24.53 51.34Q23.84 51.34 23.14 51.21Q22.44 51.08 21.74 50.82V49.23Q22.44 49.6 23.09 49.79Q23.75 49.98 24.35 49.98Q24.97 49.98 25.29 49.77Q25.62 49.57 25.62 49.19Q25.62 48.85 25.4 48.66Q25.18 48.48 24.51 48.33L23.78 48.17Q22.69 47.93 22.19 47.42Q21.68 46.91 21.68 46.04Q21.68 44.95 22.38 44.36Q23.09 43.78 24.4 43.78Q25.01 43.78 25.64 43.87Q26.27 43.96 26.95 44.14Z"/><path d="M32.61 51.33H32.47Q30.66 51.33 29.66 50.34Q28.66 49.34 28.66 47.56Q28.66 45.79 29.66 44.78Q30.66 43.78 32.41 43.78Q34.19 43.78 35.17 44.77Q36.16 45.77 36.16 47.56Q36.16 48.79 35.64 49.68Q35.11 50.57 34.13 51.02L35.6 52.66H33.8ZM32.41 45.14Q31.55 45.14 31.08 45.78Q30.61 46.41 30.61 47.56Q30.61 48.73 31.07 49.36Q31.53 49.98 32.41 49.98Q33.28 49.98 33.75 49.34Q34.22 48.71 34.22 47.56Q34.22 46.41 33.75 45.78Q33.28 45.14 32.41 45.14Z"/><path d="M37.58 43.91H39.46V49.78H42.76V51.2H37.58Z"/></g></svg>',
48
+ 'file-svg': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#805AB9" opacity=".17"/><g fill="none" stroke="#805AB9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M23 35c4-13 14-13 18 0M24 35h16"/><rect x="20" y="32" width="5" height="5" rx=".8"/><rect x="39" y="32" width="5" height="5" rx=".8"/><circle cx="32" cy="24" r="2"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#805AB9"/><g fill="#FFF"><path d="M26.42 44.14V45.68Q25.82 45.41 25.24 45.28Q24.67 45.14 24.17 45.14Q23.49 45.14 23.17 45.33Q22.85 45.51 22.85 45.9Q22.85 46.2 23.06 46.36Q23.28 46.52 23.85 46.64L24.65 46.8Q25.87 47.04 26.38 47.54Q26.9 48.04 26.9 48.96Q26.9 50.16 26.18 50.75Q25.46 51.34 23.99 51.34Q23.3 51.34 22.6 51.21Q21.9 51.08 21.21 50.82V49.23Q21.9 49.6 22.56 49.79Q23.21 49.98 23.81 49.98Q24.43 49.98 24.76 49.77Q25.08 49.57 25.08 49.19Q25.08 48.85 24.86 48.66Q24.64 48.48 23.98 48.33L23.25 48.17Q22.15 47.93 21.65 47.42Q21.14 46.91 21.14 46.04Q21.14 44.95 21.85 44.36Q22.55 43.78 23.87 43.78Q24.47 43.78 25.1 43.87Q25.74 43.96 26.42 44.14Z"/><path d="M27.68 43.91H29.57L31.5 49.29L33.43 43.91H35.32L32.62 51.2H30.38Z"/><path d="M42.84 50.66Q42.13 51 41.38 51.17Q40.62 51.34 39.81 51.34Q37.99 51.34 36.93 50.32Q35.86 49.31 35.86 47.56Q35.86 45.8 36.95 44.79Q38.03 43.78 39.92 43.78Q40.65 43.78 41.31 43.91Q41.98 44.05 42.57 44.32V45.83Q41.96 45.48 41.36 45.31Q40.75 45.14 40.15 45.14Q39.02 45.14 38.42 45.77Q37.81 46.4 37.81 47.56Q37.81 48.72 38.39 49.35Q38.98 49.98 40.06 49.98Q40.35 49.98 40.6 49.94Q40.85 49.91 41.06 49.83V48.41H39.91V47.15H42.84Z"/></g></svg>',
49
+ 'file-tar': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#926923" opacity=".17"/><g fill="none" stroke="#926923" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="22" y="23" width="20" height="14" rx="2"/><path d="M24 20h16v3M31 23v9m3-7-2 2 2 2-2 2"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#926923"/><g fill="#FFF"><path d="M20.92 43.91H27.64V45.33H25.22V51.2H23.34V45.33H20.92Z"/><path d="M33.03 49.87H30.09L29.63 51.2H27.74L30.44 43.91H32.68L35.38 51.2H33.49ZM30.56 48.52H32.56L31.56 45.62Z"/><path d="M39.02 47.14Q39.61 47.14 39.87 46.92Q40.12 46.7 40.12 46.2Q40.12 45.7 39.87 45.49Q39.61 45.27 39.02 45.27H38.23V47.14ZM38.23 48.44V51.2H36.35V43.91H39.22Q40.66 43.91 41.33 44.39Q42 44.88 42 45.92Q42 46.64 41.65 47.11Q41.3 47.57 40.6 47.79Q40.99 47.88 41.29 48.19Q41.6 48.5 41.91 49.13L42.93 51.2H40.93L40.04 49.39Q39.77 48.84 39.5 48.64Q39.22 48.44 38.76 48.44Z"/></g></svg>',
50
+ 'file-text': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#61758F" opacity=".17"/><g fill="none" stroke="#61758F" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M23 21h17M23 26h17M23 31h12M23 36h16"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#61758F"/><g fill="#FFF"><path d="M21.37 43.91H28.09V45.33H25.67V51.2H23.79V45.33H21.37Z"/><path d="M33.13 47.48 35.65 51.2H33.7L31.99 48.71L30.3 51.2H28.34L30.86 47.48L28.43 43.91H30.4L31.99 46.26L33.58 43.91H35.56Z"/><path d="M35.9 43.91H42.62V45.33H40.21V51.2H38.33V45.33H35.9Z"/></g></svg>',
51
+ 'file-ts': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#446EAB" opacity=".17"/><g fill="none" stroke="#446EAB" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m28 23-6 6 6 6m8-12 6 6-6 6m-3-15-3 18"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#446EAB"/><g fill="#FFF"><path d="M25.04 43.91H31.76V45.33H29.34V51.2H27.46V45.33H25.04Z"/><path d="M37.8 44.14V45.68Q37.2 45.41 36.63 45.28Q36.06 45.14 35.55 45.14Q34.88 45.14 34.55 45.33Q34.23 45.51 34.23 45.9Q34.23 46.2 34.45 46.36Q34.67 46.52 35.24 46.64L36.04 46.8Q37.25 47.04 37.77 47.54Q38.28 48.04 38.28 48.96Q38.28 50.16 37.56 50.75Q36.85 51.34 35.38 51.34Q34.69 51.34 33.99 51.21Q33.29 51.08 32.59 50.82V49.23Q33.29 49.6 33.94 49.79Q34.59 49.98 35.2 49.98Q35.81 49.98 36.14 49.77Q36.47 49.57 36.47 49.19Q36.47 48.85 36.25 48.66Q36.02 48.48 35.36 48.33L34.63 48.17Q33.54 47.93 33.03 47.42Q32.53 46.91 32.53 46.04Q32.53 44.95 33.23 44.36Q33.93 43.78 35.25 43.78Q35.85 43.78 36.49 43.87Q37.12 43.96 37.8 44.14Z"/></g></svg>',
52
+ 'file-video': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#B74068" opacity=".17"/><g fill="none" stroke="#B74068" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="21" y="21" width="22" height="16" rx="3"/><path d="m29 25 8 4-8 4z"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#B74068"/><g fill="#FFF"><path d="M22.17 43.91H24.06L25.99 49.29L27.92 43.91H29.81L27.11 51.2H24.87Z"/><path d="M30.78 43.91H32.66V51.2H30.78Z"/><path d="M36.38 45.33V49.78H37.05Q38.2 49.78 38.81 49.21Q39.42 48.64 39.42 47.55Q39.42 46.46 38.81 45.9Q38.21 45.33 37.05 45.33ZM34.5 43.91H36.48Q38.14 43.91 38.95 44.15Q39.77 44.38 40.35 44.95Q40.86 45.44 41.11 46.09Q41.36 46.73 41.36 47.55Q41.36 48.37 41.11 49.02Q40.86 49.67 40.35 50.16Q39.76 50.73 38.94 50.96Q38.12 51.2 36.48 51.2H34.5Z"/></g></svg>',
53
+ 'file-wav': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#B84C89" opacity=".17"/><g fill="none" stroke="#B84C89" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 30v-4m4 9V22m4 15V21m4 12v-7m4 9V23m4 7v-5"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#B84C89"/><g fill="#FFF"><path d="M19.04 43.91H20.85L22.1 49.21L23.35 43.91H25.17L26.42 49.21L27.68 43.91H29.46L27.74 51.2H25.58L24.25 45.66L22.94 51.2H20.78Z"/><path d="M35.12 49.87H32.18L31.71 51.2H29.82L32.52 43.91H34.77L37.47 51.2H35.58ZM32.65 48.52H34.64L33.65 45.62Z"/><path d="M37.56 43.91H39.45L41.39 49.29L43.32 43.91H45.21L42.51 51.2H40.26Z"/></g></svg>',
54
+ 'file-webp': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#8255AD" opacity=".17"/><g fill="none" stroke="#8255AD" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="21" y="21" width="22" height="16" rx="2"/><circle cx="36" cy="26" r="1.6"/><path d="m23 34 6-6 4 4 3-3 5 5"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#8255AD"/><g fill="#FFF"><path d="M17.82 44.78H19.41L20.52 49.45L21.62 44.78H23.21L24.31 49.45L25.42 44.78H26.99L25.48 51.2H23.57L22.41 46.32L21.26 51.2H19.35Z"/><path d="M28.08 44.78H32.54V46.04H29.73V47.23H32.37V48.48H29.73V49.95H32.64V51.2H28.08Z"/><path d="M36.66 47.27Q37.05 47.27 37.25 47.1Q37.45 46.92 37.45 46.59Q37.45 46.26 37.25 46.08Q37.05 45.91 36.66 45.91H35.74V47.27ZM36.71 50.07Q37.21 50.07 37.46 49.86Q37.71 49.65 37.71 49.23Q37.71 48.81 37.47 48.6Q37.22 48.39 36.71 48.39H35.74V50.07ZM38.25 47.77Q38.78 47.92 39.08 48.34Q39.37 48.76 39.37 49.36Q39.37 50.29 38.74 50.74Q38.11 51.2 36.83 51.2H34.09V44.78H36.57Q37.91 44.78 38.51 45.19Q39.11 45.59 39.11 46.48Q39.11 46.95 38.89 47.28Q38.67 47.61 38.25 47.77Z"/><path d="M40.8 44.78H43.54Q44.77 44.78 45.42 45.33Q46.08 45.87 46.08 46.88Q46.08 47.89 45.42 48.43Q44.77 48.97 43.54 48.97H42.45V51.2H40.8ZM42.45 45.98V47.78H43.37Q43.85 47.78 44.11 47.54Q44.37 47.31 44.37 46.88Q44.37 46.45 44.11 46.22Q43.85 45.98 43.37 45.98Z"/></g></svg>',
55
+ 'file-xml': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#446EAB" opacity=".17"/><g fill="none" stroke="#446EAB" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m28 23-6 6 6 6m8-12 6 6-6 6m-3-15-3 18"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#446EAB"/><g fill="#FFF"><path d="M24.96 47.48 27.49 51.2H25.54L23.83 48.71L22.14 51.2H20.17L22.7 47.48L20.27 43.91H22.23L23.83 46.26L25.42 43.91H27.4Z"/><path d="M28.61 43.91H31L32.66 47.81L34.33 43.91H36.72V51.2H34.94V45.87L33.26 49.8H32.07L30.39 45.87V51.2H28.61Z"/><path d="M38.56 43.91H40.44V49.78H43.74V51.2H38.56Z"/></g></svg>',
56
+ 'file-yaml': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#805AB9" opacity=".17"/><g fill="none" stroke="#805AB9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M27 21c-3 0-3 2-3 4v2c0 2-1 2-3 2 2 0 3 1 3 3v2c0 3 0 4 3 4m10-17c3 0 3 2 3 4v2c0 2 1 2 3 2-2 0-3 1-3 3v2c0 3 0 4-3 4"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#805AB9"/><g fill="#FFF"><path d="M18.14 44.78H19.95L21.41 47.07L22.87 44.78H24.68L22.24 48.5V51.2H20.59V48.5Z"/><path d="M29.3 50.03H26.71L26.3 51.2H24.64L27.02 44.78H28.99L31.37 51.2H29.7ZM27.13 48.84H28.88L28.01 46.29Z"/><path d="M32.22 44.78H34.32L35.78 48.22L37.25 44.78H39.35V51.2H37.79V46.51L36.31 49.97H35.26L33.79 46.51V51.2H32.22Z"/><path d="M40.97 44.78H42.63V49.95H45.53V51.2H40.97Z"/></g></svg>',
57
+ 'file-zip': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M16 4h24l13 13v38a5 5 0 0 1-5 5H16a5 5 0 0 1-5-5V9a5 5 0 0 1 5-5Z" fill="#FDFEFF" stroke="#D3DFEC" stroke-width="1.5"/><path d="M40 4v9a4 4 0 0 0 4 4h9Z" fill="#926923" opacity=".17"/><g fill="none" stroke="#926923" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="22" y="23" width="20" height="14" rx="2"/><path d="M24 20h16v3M31 23v9m3-7-2 2 2 2-2 2"/></g><rect x="16" y="42" width="32" height="14" rx="4" fill="#926923"/><g fill="#FFF"><path d="M23.41 43.91H29.54V45.05L25.63 49.78H29.65V51.2H23.3V50.06L27.21 45.33H23.41Z"/><path d="M31.02 43.91H32.9V51.2H31.02Z"/><path d="M34.74 43.91H37.86Q39.25 43.91 40 44.53Q40.74 45.15 40.74 46.29Q40.74 47.44 40 48.05Q39.25 48.67 37.86 48.67H36.62V51.2H34.74ZM36.62 45.27V47.31H37.66Q38.21 47.31 38.5 47.04Q38.8 46.78 38.8 46.29Q38.8 45.8 38.5 45.54Q38.21 45.27 37.66 45.27Z"/></g></svg>',
58
+ 'folder-closed': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M7 20a5 5 0 0 1 5-5h14l6 6h20a5 5 0 0 1 5 5v26a5 5 0 0 1-5 5H12a5 5 0 0 1-5-5Z" fill="#DFA041" stroke="#B87E28" stroke-width="1.5"/><path d="M8 30a4 4 0 0 1 4-4h40a4 4 0 0 1 4 4v22a4 4 0 0 1-4 4H12a4 4 0 0 1-4-4Z" fill="#F3C36B"/><path d="M12 29h39" stroke="#FFE5A8" stroke-width="1.5" stroke-linecap="round"/></svg>',
59
+ 'folder-open': '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M7 23a5 5 0 0 1 5-5h13l6 6h21a5 5 0 0 1 5 5v23H7Z" fill="#DCA044" stroke="#B87E28" stroke-width="1.5"/><path d="M10 29h40v22H10Z" fill="#FFE2A2"/><path d="M5 35a5 5 0 0 1 5-5h14l5-5h26c4 0 5 2 4 5l-6 22a6 6 0 0 1-6 5H12a6 6 0 0 1-6-5Z" fill="#F3C36B" stroke="#B87E28" stroke-width="1.5"/><path d="M12 34h38" stroke="#FFE7AE" stroke-width="1.5" stroke-linecap="round"/></svg>',
60
+ };
61
+ /** Lower-case extension (including compound ones such as `tar.gz`) → icon. */
62
+ const SD_FILE_EXPLORER_ICON_EXTENSIONS = {
63
+ '7z': 'file-7z',
64
+ aac: 'file-audio',
65
+ ai: 'file-ai',
66
+ aiff: 'file-audio',
67
+ apk: 'file-app',
68
+ apng: 'file-png',
69
+ avi: 'file-video',
70
+ avif: 'file-image',
71
+ azw3: 'file-book',
72
+ blend: 'file-3d',
73
+ bmp: 'file-image',
74
+ bz2: 'file-archive',
75
+ c: 'file-code',
76
+ cjs: 'file-js',
77
+ cpp: 'file-code',
78
+ cs: 'file-code',
79
+ css: 'file-css',
80
+ csv: 'file-csv',
81
+ cts: 'file-ts',
82
+ 'd.ts': 'file-ts',
83
+ db: 'file-sql',
84
+ deb: 'file-app',
85
+ dmg: 'file-app',
86
+ doc: 'file-document',
87
+ docx: 'file-document',
88
+ dwg: 'file-3d',
89
+ dxf: 'file-3d',
90
+ env: 'file-code',
91
+ eps: 'file-design',
92
+ epub: 'file-book',
93
+ exe: 'file-app',
94
+ fbx: 'file-3d',
95
+ fig: 'file-figma',
96
+ flac: 'file-audio',
97
+ gif: 'file-gif',
98
+ gitignore: 'file-code',
99
+ glb: 'file-3d',
100
+ gltf: 'file-3d',
101
+ go: 'file-code',
102
+ gz: 'file-archive',
103
+ h: 'file-code',
104
+ heic: 'file-image',
105
+ heif: 'file-image',
106
+ htm: 'file-html',
107
+ html: 'file-html',
108
+ ico: 'file-image',
109
+ indd: 'file-design',
110
+ ipa: 'file-app',
111
+ ipynb: 'file-python',
112
+ java: 'file-code',
113
+ jpe: 'file-jpg',
114
+ jpeg: 'file-jpg',
115
+ jpg: 'file-jpg',
116
+ js: 'file-js',
117
+ json: 'file-json',
118
+ json5: 'file-json',
119
+ jsonl: 'file-json',
120
+ jsx: 'file-js',
121
+ key: 'file-presentation',
122
+ kt: 'file-code',
123
+ less: 'file-css',
124
+ log: 'file-text',
125
+ m4a: 'file-audio',
126
+ m4v: 'file-mp4',
127
+ markdown: 'file-markdown',
128
+ md: 'file-markdown',
129
+ mjs: 'file-js',
130
+ mkv: 'file-video',
131
+ mobi: 'file-book',
132
+ mov: 'file-mov',
133
+ mp3: 'file-mp3',
134
+ mp4: 'file-mp4',
135
+ mpeg: 'file-video',
136
+ mpg: 'file-video',
137
+ msi: 'file-app',
138
+ mts: 'file-ts',
139
+ numbers: 'file-spreadsheet',
140
+ obj: 'file-3d',
141
+ odp: 'file-presentation',
142
+ ods: 'file-spreadsheet',
143
+ odt: 'file-document',
144
+ ogg: 'file-audio',
145
+ opus: 'file-audio',
146
+ otf: 'file-font',
147
+ pages: 'file-document',
148
+ pdf: 'file-pdf',
149
+ php: 'file-code',
150
+ png: 'file-png',
151
+ ppt: 'file-presentation',
152
+ pptx: 'file-presentation',
153
+ psd: 'file-psd',
154
+ py: 'file-python',
155
+ rar: 'file-rar',
156
+ raw: 'file-image',
157
+ rb: 'file-code',
158
+ rpm: 'file-app',
159
+ rs: 'file-code',
160
+ rtf: 'file-document',
161
+ scss: 'file-css',
162
+ sh: 'file-code',
163
+ sketch: 'file-design',
164
+ sql: 'file-sql',
165
+ sqlite: 'file-sql',
166
+ stl: 'file-3d',
167
+ svelte: 'file-code',
168
+ svg: 'file-svg',
169
+ swift: 'file-code',
170
+ tar: 'file-tar',
171
+ 'tar.bz2': 'file-tar',
172
+ 'tar.gz': 'file-tar',
173
+ 'tar.xz': 'file-tar',
174
+ tgz: 'file-tar',
175
+ tif: 'file-image',
176
+ tiff: 'file-image',
177
+ ts: 'file-ts',
178
+ tsv: 'file-csv',
179
+ tsx: 'file-ts',
180
+ ttf: 'file-font',
181
+ txt: 'file-text',
182
+ vue: 'file-code',
183
+ wav: 'file-wav',
184
+ webm: 'file-video',
185
+ webp: 'file-webp',
186
+ wmv: 'file-video',
187
+ woff: 'file-font',
188
+ woff2: 'file-font',
189
+ xd: 'file-design',
190
+ xls: 'file-spreadsheet',
191
+ xlsx: 'file-spreadsheet',
192
+ xml: 'file-xml',
193
+ xsd: 'file-xml',
194
+ xz: 'file-archive',
195
+ yaml: 'file-yaml',
196
+ yml: 'file-yaml',
197
+ zip: 'file-zip',
198
+ zst: 'file-archive',
199
+ };
200
+ /** Exact MIME type, or a family prefix ending with `/`, → icon. Used when the extension is unknown. */
201
+ const SD_FILE_EXPLORER_ICON_MIME = {
202
+ 'application/epub+zip': 'file-book',
203
+ 'application/json': 'file-json',
204
+ 'application/msword': 'file-document',
205
+ 'application/pdf': 'file-pdf',
206
+ 'application/vnd.ms-excel': 'file-spreadsheet',
207
+ 'application/vnd.ms-powerpoint': 'file-presentation',
208
+ 'application/vnd.openxmlformats-officedocument.presentationml.presentation': 'file-presentation',
209
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'file-spreadsheet',
210
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': 'file-document',
211
+ 'application/x-7z-compressed': 'file-7z',
212
+ 'application/x-rar-compressed': 'file-rar',
213
+ 'application/xml': 'file-xml',
214
+ 'application/zip': 'file-archive',
215
+ 'audio/': 'file-audio',
216
+ 'font/': 'file-font',
217
+ 'image/': 'file-image',
218
+ 'model/': 'file-3d',
219
+ 'text/': 'file-text',
220
+ 'text/css': 'file-css',
221
+ 'text/csv': 'file-csv',
222
+ 'text/html': 'file-html',
223
+ 'text/javascript': 'file-js',
224
+ 'video/': 'file-video',
225
+ };
226
+
227
+ const EXTENSIONS = {
228
+ image: ['png', 'jpg', 'jpeg', 'gif', 'webp', 'svg', 'bmp', 'avif', 'ico', 'heic'],
229
+ pdf: ['pdf'],
230
+ spreadsheet: ['xls', 'xlsx', 'xlsm', 'csv', 'ods', 'numbers'],
231
+ document: ['doc', 'docx', 'odt', 'rtf', 'pages'],
232
+ presentation: ['ppt', 'pptx', 'odp', 'key'],
233
+ video: ['mp4', 'mov', 'avi', 'mkv', 'webm', 'm4v'],
234
+ audio: ['mp3', 'wav', 'ogg', 'flac', 'm4a', 'aac'],
235
+ archive: ['zip', 'rar', '7z', 'tar', 'gz', 'tgz', 'bz2'],
236
+ text: ['txt', 'md', 'json', 'xml', 'log', 'yml', 'yaml', 'html', 'css', 'js', 'ts'],
237
+ };
238
+ const LOCALES = { vi: 'vi-VN', en: 'en-US', ja: 'ja-JP', ko: 'ko-KR', zh: 'zh-CN' };
239
+ /** Maps a Core UI language code to the locale used by `Intl` formatters. */
240
+ function sdFileExplorerLocale(language) {
241
+ return LOCALES[language] ?? 'vi-VN';
242
+ }
243
+ /** Lower-cased extension of a file name, without the dot; empty when there is none. */
244
+ function sdFileExplorerExtension(name) {
245
+ const dot = name.lastIndexOf('.');
246
+ return dot > 0 && dot < name.length - 1 ? name.slice(dot + 1).toLowerCase() : '';
247
+ }
248
+ /** Resolves the visual family of an item from its MIME type, falling back to the extension of its name. */
249
+ function sdFileExplorerFileType(item) {
250
+ if (item.kind === 'folder')
251
+ return 'folder';
252
+ const mime = (item.mimeType ?? '').toLowerCase();
253
+ if (mime) {
254
+ if (mime.startsWith('image/'))
255
+ return 'image';
256
+ if (mime === 'application/pdf')
257
+ return 'pdf';
258
+ if (mime.includes('spreadsheet') || mime.includes('excel') || mime === 'text/csv')
259
+ return 'spreadsheet';
260
+ if (mime.includes('presentation') || mime.includes('powerpoint'))
261
+ return 'presentation';
262
+ if (mime.includes('wordprocessing') || mime.includes('msword') || mime.includes('opendocument.text') || mime === 'application/rtf') {
263
+ return 'document';
264
+ }
265
+ if (mime.startsWith('video/'))
266
+ return 'video';
267
+ if (mime.startsWith('audio/'))
268
+ return 'audio';
269
+ if (/(zip|rar|7z|tar|gzip|compressed)/.test(mime))
270
+ return 'archive';
271
+ if (mime.startsWith('text/') || mime.endsWith('json') || mime.endsWith('xml'))
272
+ return 'text';
273
+ }
274
+ const ext = sdFileExplorerExtension(item.name);
275
+ for (const [type, extensions] of Object.entries(EXTENSIONS)) {
276
+ if (extensions.includes(ext))
277
+ return type;
278
+ }
279
+ return 'other';
280
+ }
281
+ function lookup(map, key) {
282
+ // why: tra bằng hasOwnProperty — tên như "x.constructor" không được trả về hàm của Object.prototype.
283
+ return Object.prototype.hasOwnProperty.call(map, key) ? map[key] : undefined;
284
+ }
285
+ /**
286
+ * Built-in icon for an item. Folders use `folder-open` / `folder-closed`. Files resolve the longest known
287
+ * extension first (`report.tar.gz`, `types.d.ts`), then dot-files (`.env`), then the MIME type (exact match,
288
+ * then family such as `image/`), and finally `file-generic`.
289
+ */
290
+ function sdFileExplorerIconName(item, options = {}) {
291
+ if (item.kind === 'folder')
292
+ return options.open ? 'folder-open' : 'folder-closed';
293
+ const basename = (item.name.split(/[\\/]/).pop() ?? '').toLowerCase();
294
+ const suffixes = basename.split('.').slice(1);
295
+ for (let i = 0; i < suffixes.length; i++) {
296
+ const icon = lookup(SD_FILE_EXPLORER_ICON_EXTENSIONS, suffixes.slice(i).join('.'));
297
+ if (icon)
298
+ return icon;
299
+ }
300
+ const dotfile = basename.startsWith('.') ? lookup(SD_FILE_EXPLORER_ICON_EXTENSIONS, basename.slice(1)) : undefined;
301
+ if (dotfile)
302
+ return dotfile;
303
+ if (basename.startsWith('.env.'))
304
+ return 'file-code';
305
+ const mime = (item.mimeType ?? '').toLowerCase().split(';', 1)[0].trim();
306
+ const exact = mime ? lookup(SD_FILE_EXPLORER_ICON_MIME, mime) : undefined;
307
+ if (exact)
308
+ return exact;
309
+ const family = Object.keys(SD_FILE_EXPLORER_ICON_MIME).find(prefix => prefix.endsWith('/') && mime.startsWith(prefix));
310
+ return (family && SD_FILE_EXPLORER_ICON_MIME[family]) || 'file-generic';
311
+ }
312
+ const ICON_URLS = new Map();
313
+ /** `data:` URL of a built-in icon, encoded once and cached (the SVGs keep their own colours, so `<img>` is enough). */
314
+ function sdFileExplorerIconUrl(name) {
315
+ let url = ICON_URLS.get(name);
316
+ if (!url) {
317
+ const svg = SD_FILE_EXPLORER_ICON_SVGS[name] ?? SD_FILE_EXPLORER_ICON_SVGS['file-generic'];
318
+ url = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(svg)}`;
319
+ ICON_URLS.set(name, url);
320
+ }
321
+ return url;
322
+ }
323
+ /** Preview renderer for a file type. */
324
+ function sdFileExplorerPreviewKind(type) {
325
+ if (type === 'image')
326
+ return 'image';
327
+ if (type === 'pdf')
328
+ return 'pdf';
329
+ return 'none';
330
+ }
331
+ /**
332
+ * Human-readable size: `846 KB`, `2,4 MB` (vi) / `2.4 MB` (en).
333
+ * One decimal below 10 units, none above — the precision users expect from file managers.
334
+ */
335
+ function sdFileExplorerFormatSize(bytes, locale) {
336
+ if (typeof bytes !== 'number' || !Number.isFinite(bytes) || bytes < 0)
337
+ return '';
338
+ if (bytes < 1024)
339
+ return `${bytes} B`;
340
+ const units = ['KB', 'MB', 'GB', 'TB'];
341
+ let value = bytes / 1024;
342
+ let unit = 0;
343
+ while (value >= 1024 && unit < units.length - 1) {
344
+ value /= 1024;
345
+ unit++;
346
+ }
347
+ const digits = value < 10 ? 1 : 0;
348
+ return `${new Intl.NumberFormat(locale, { maximumFractionDigits: digits }).format(value)} ${units[unit]}`;
349
+ }
350
+ /** Parses `SdFileExplorerItem.modifiedAt`; `null` when missing or invalid. */
351
+ function sdFileExplorerParseDate(value) {
352
+ if (value === null || value === undefined || value === '')
353
+ return null;
354
+ const date = value instanceof Date ? value : new Date(value);
355
+ return Number.isNaN(date.getTime()) ? null : date;
356
+ }
357
+ /**
358
+ * Compact modification date: "today" / "yesterday" labels, day + month within the current year,
359
+ * full date otherwise. Order of day and month follows the locale.
360
+ */
361
+ function sdFileExplorerFormatDate(value, now, locale, labels) {
362
+ const date = sdFileExplorerParseDate(value);
363
+ if (!date)
364
+ return '';
365
+ const startOfToday = new Date(now.getFullYear(), now.getMonth(), now.getDate()).getTime();
366
+ const day = new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime();
367
+ // why: so sánh theo mốc 0h local (không trừ 86 400 000 ms) để ngày chuyển giờ DST vẫn đúng "hôm qua".
368
+ if (day === startOfToday)
369
+ return labels.today;
370
+ if (day === new Date(now.getFullYear(), now.getMonth(), now.getDate() - 1).getTime())
371
+ return labels.yesterday;
372
+ const options = date.getFullYear() === now.getFullYear() ? { day: '2-digit', month: '2-digit' } : { day: '2-digit', month: '2-digit', year: 'numeric' };
373
+ // why: lấy THỨ TỰ ngày/tháng theo locale nhưng luôn nối bằng "/" — Chrome format vi-VN ngày+tháng thành "21-09".
374
+ return new Intl.DateTimeFormat(locale, options)
375
+ .formatToParts(date)
376
+ .filter(part => part.type === 'day' || part.type === 'month' || part.type === 'year')
377
+ .map(part => part.value)
378
+ .join('/');
379
+ }
380
+ /** Full date and time, used as tooltip and in the preview metadata. */
381
+ function sdFileExplorerFormatDateTime(value, locale) {
382
+ const date = sdFileExplorerParseDate(value);
383
+ if (!date)
384
+ return '';
385
+ return new Intl.DateTimeFormat(locale, {
386
+ day: '2-digit',
387
+ month: '2-digit',
388
+ year: 'numeric',
389
+ hour: '2-digit',
390
+ minute: '2-digit',
391
+ }).format(date);
392
+ }
393
+ /** Lower-cases and strips Vietnamese accents so "tai lieu" matches "Tài liệu". */
394
+ function sdFileExplorerNormalize(value) {
395
+ return value
396
+ .normalize('NFD')
397
+ .replace(/[\u0300-\u036f]/g, '')
398
+ .replace(/[\u0111\u0110]/g, match => (match === '\u0110' ? 'D' : 'd'))
399
+ .toLowerCase()
400
+ .trim();
401
+ }
402
+ /** Readable reason from whatever a callback threw. */
403
+ function sdFileExplorerErrorMessage(error) {
404
+ if (typeof error === 'string')
405
+ return error;
406
+ if (error && typeof error === 'object' && 'message' in error && typeof error.message === 'string')
407
+ return error.message;
408
+ return '';
409
+ }
410
+ /** `true` for errors produced by an aborted `AbortSignal`. */
411
+ function sdFileExplorerIsAbort(error) {
412
+ return !!error && typeof error === 'object' && 'name' in error && error.name === 'AbortError';
413
+ }
414
+ /**
415
+ * Folders first, then files. Within each group the order returned by the callback is kept, so the
416
+ * consumer (or its API) decides how items are sorted.
417
+ */
418
+ function sdFileExplorerFoldersFirst(items) {
419
+ return [...items.filter(item => item.kind === 'folder'), ...items.filter(item => item.kind !== 'folder')];
420
+ }
421
+ /** Element-safe id fragment for `autoId` / DOM ids. */
422
+ function sdFileExplorerSafeId(value) {
423
+ return value.replace(/[^a-zA-Z0-9_-]/g, '-');
424
+ }
425
+
426
+ /**
427
+ * Built-in file-type icon (folder, PDF, spreadsheet, image, code…), drawn from the embedded SVG set.
428
+ * Decorative: always `aria-hidden` with an empty `alt`, the item name next to it carries the meaning.
429
+ */
430
+ class SdFileExplorerFileIcon {
431
+ /** Icon to draw. */
432
+ icon = input.required(/* @ts-ignore */
433
+ ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
434
+ /** Rendered size in pixels (the SVGs use a 64 × 64 canvas with built-in padding). */
435
+ size = input(32, /* @ts-ignore */
436
+ ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
437
+ src = computed(() => sdFileExplorerIconUrl(this.icon()), /* @ts-ignore */
438
+ ...(ngDevMode ? [{ debugName: "src" }] : /* istanbul ignore next */ []));
439
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdFileExplorerFileIcon, deps: [], target: i0.ɵɵFactoryTarget.Component });
440
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.5", type: SdFileExplorerFileIcon, isStandalone: true, selector: "sd-file-explorer-file-icon", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: true, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "aria-hidden": "true" }, properties: { "attr.data-icon": "icon()", "style.--sd-file-explorer-icon-size": "size() + \"px\"" }, classAttribute: "sd-file-explorer-file-icon" }, ngImport: i0, template: `<img [src]="src()" alt="" draggable="false" />`, isInline: true, styles: [":host{display:inline-flex;flex:none;width:var(--sd-file-explorer-icon-size, 32px);height:var(--sd-file-explorer-icon-size, 32px)}img{display:block;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;user-select:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
441
+ }
442
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdFileExplorerFileIcon, decorators: [{
443
+ type: Component,
444
+ args: [{ selector: 'sd-file-explorer-file-icon', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, host: {
445
+ class: 'sd-file-explorer-file-icon',
446
+ 'aria-hidden': 'true',
447
+ '[attr.data-icon]': 'icon()',
448
+ '[style.--sd-file-explorer-icon-size]': 'size() + "px"',
449
+ }, template: `<img [src]="src()" alt="" draggable="false" />`, styles: [":host{display:inline-flex;flex:none;width:var(--sd-file-explorer-icon-size, 32px);height:var(--sd-file-explorer-icon-size, 32px)}img{display:block;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;user-select:none}\n"] }]
450
+ }], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: true }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
451
+
452
+ /**
453
+ * Folder tree of the explorer (internal). Rendered as a flat `role="tree"` list whose depth is carried by
454
+ * `aria-level`, with a roving tabindex and the WAI-ARIA tree keyboard model.
455
+ */
456
+ class SdFileExplorerFolderTree {
457
+ #host = inject(ElementRef);
458
+ #i18n = inject(I18nService);
459
+ /** Visible nodes in display order. */
460
+ nodes = input.required(/* @ts-ignore */
461
+ ...(ngDevMode ? [{ debugName: "nodes" }] : /* istanbul ignore next */ []));
462
+ /** Accessible name of the tree. */
463
+ label = input('', /* @ts-ignore */
464
+ ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
465
+ /** A node was activated (click, Enter, Space). */
466
+ select = output();
467
+ /** Expand / collapse requested. */
468
+ toggle = output();
469
+ /** Retry loading the children of a node whose listing failed. */
470
+ retry = output();
471
+ focusedKey = signal(null, /* @ts-ignore */
472
+ ...(ngDevMode ? [{ debugName: "focusedKey" }] : /* istanbul ignore next */ []));
473
+ retryLabel = computed(() => this.#i18n.t('core.component.file-explorer.retry'), /* @ts-ignore */
474
+ ...(ngDevMode ? [{ debugName: "retryLabel" }] : /* istanbul ignore next */ []));
475
+ /** Node owning the roving tabindex: the focused node if still visible, else the selected one. */
476
+ activeKey = computed(() => {
477
+ const nodes = this.nodes();
478
+ const focused = this.focusedKey();
479
+ if (focused && nodes.some(node => node.key === focused))
480
+ return focused;
481
+ return nodes.find(node => node.selected)?.key ?? nodes[0]?.key ?? null;
482
+ }, /* @ts-ignore */
483
+ ...(ngDevMode ? [{ debugName: "activeKey" }] : /* istanbul ignore next */ []));
484
+ toggleLabel(node) {
485
+ const key = node.expanded ? 'core.component.file-explorer.collapse' : 'core.component.file-explorer.expand';
486
+ return this.#i18n.t(key, { name: node.name });
487
+ }
488
+ onToggle(event, node) {
489
+ // why: nút toggle nằm trong treeitem — chặn bubble để bấm mũi tên không đồng thời điều hướng vào thư mục.
490
+ event.stopPropagation();
491
+ this.toggle.emit(node);
492
+ }
493
+ onRetry(event, node) {
494
+ event.stopPropagation();
495
+ this.retry.emit(node);
496
+ }
497
+ onKeydown(event, index) {
498
+ const nodes = this.nodes();
499
+ const node = nodes[index];
500
+ if (!node)
501
+ return;
502
+ switch (event.key) {
503
+ case 'ArrowDown':
504
+ this.#focusIndex(Math.min(index + 1, nodes.length - 1));
505
+ break;
506
+ case 'ArrowUp':
507
+ this.#focusIndex(Math.max(index - 1, 0));
508
+ break;
509
+ case 'Home':
510
+ this.#focusIndex(0);
511
+ break;
512
+ case 'End':
513
+ this.#focusIndex(nodes.length - 1);
514
+ break;
515
+ case 'ArrowRight':
516
+ if (node.expandable && !node.expanded)
517
+ this.toggle.emit(node);
518
+ else if (node.expanded || node.level === 1)
519
+ this.#focusIndex(Math.min(index + 1, nodes.length - 1));
520
+ break;
521
+ case 'ArrowLeft':
522
+ if (node.expandable && node.expanded) {
523
+ this.toggle.emit(node);
524
+ }
525
+ else {
526
+ for (let i = index - 1; i >= 0; i--) {
527
+ if (nodes[i].level < node.level) {
528
+ this.#focusIndex(i);
529
+ break;
530
+ }
531
+ }
532
+ }
533
+ break;
534
+ case 'Enter':
535
+ case ' ':
536
+ this.select.emit(node);
537
+ break;
538
+ default:
539
+ return;
540
+ }
541
+ event.preventDefault();
542
+ }
543
+ #focusIndex(index) {
544
+ const node = this.nodes()[index];
545
+ if (!node)
546
+ return;
547
+ this.focusedKey.set(node.key);
548
+ const element = this.#host.nativeElement.querySelectorAll('[role="treeitem"]')[index];
549
+ element?.focus();
550
+ }
551
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdFileExplorerFolderTree, deps: [], target: i0.ɵɵFactoryTarget.Component });
552
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: SdFileExplorerFolderTree, isStandalone: true, selector: "sd-file-explorer-folder-tree", inputs: { nodes: { classPropertyName: "nodes", publicName: "nodes", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { select: "select", toggle: "toggle", retry: "retry" }, host: { classAttribute: "sd-file-explorer-folder-tree" }, ngImport: i0, template: `
553
+ @let _nodes = nodes();
554
+ @let _active = activeKey();
555
+ <ul class="tree" role="tree" [attr.aria-label]="label()">
556
+ @for (node of _nodes; track node.key; let i = $index) {
557
+ <li
558
+ class="node"
559
+ role="treeitem"
560
+ [class.node--selected]="node.selected"
561
+ [attr.aria-level]="node.level"
562
+ [attr.aria-selected]="node.selected"
563
+ [attr.aria-expanded]="node.expandable ? node.expanded : null"
564
+ [attr.aria-busy]="node.status === 'loading' ? true : null"
565
+ [attr.tabindex]="node.key === _active ? 0 : -1"
566
+ [attr.data-autoid]="node.autoId"
567
+ [style.--sd-file-explorer-tree-indent]="(node.level > 1 ? node.level - 2 : 0) * 22 + 'px'"
568
+ (click)="select.emit(node)"
569
+ (keydown)="onKeydown($event, i)"
570
+ (focus)="focusedKey.set(node.key)">
571
+ @if (node.level > 1) {
572
+ <span class="indent"></span>
573
+ @if (node.expandable) {
574
+ <button
575
+ type="button"
576
+ class="toggle"
577
+ tabindex="-1"
578
+ [attr.aria-label]="toggleLabel(node)"
579
+ [attr.data-autoid]="node.autoId ? node.autoId + '-toggle' : null"
580
+ (click)="onToggle($event, node)">
581
+ <sd-icon [name]="node.expanded ? 'expand_more' : 'chevron_right'" size="16px" />
582
+ </button>
583
+ } @else {
584
+ <span class="toggle toggle--placeholder"></span>
585
+ }
586
+ }
587
+ <sd-file-explorer-file-icon [icon]="node.expanded ? 'folder-open' : 'folder-closed'" [size]="28" />
588
+ <span class="label" [title]="node.name">{{ node.name }}</span>
589
+ @if (node.status === 'loading') {
590
+ <span class="spinner" aria-hidden="true"></span>
591
+ } @else if (node.status === 'error') {
592
+ <button
593
+ type="button"
594
+ class="retry"
595
+ tabindex="-1"
596
+ [attr.aria-label]="retryLabel()"
597
+ [title]="retryLabel()"
598
+ (click)="onRetry($event, node)">
599
+ <sd-icon name="refresh" size="16px" />
600
+ </button>
601
+ }
602
+ </li>
603
+ }
604
+ </ul>
605
+ `, isInline: true, styles: [":host{display:block}.tree{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}.node{display:flex;align-items:center;gap:8px;min-height:40px;padding:0 10px;border-radius:8px;color:var(--sd-fe-text);font-size:15px;line-height:20px;cursor:pointer;-webkit-user-select:none;user-select:none;outline:none}.node:hover{background:var(--sd-fe-hover)}.node:focus-visible{box-shadow:inset 0 0 0 2px var(--sd-fe-accent)}.node--selected{background:var(--sd-fe-accent-soft);color:var(--sd-fe-accent);font-weight:600}.node--selected:hover{background:var(--sd-fe-accent-soft)}.indent{flex:none;width:var(--sd-file-explorer-tree-indent, 0);margin-right:-8px}.toggle{flex:none;display:inline-flex;align-items:center;justify-content:center;width:16px;height:24px;margin-right:-1px;padding:0;border:0;border-radius:4px;background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.toggle:hover{color:var(--sd-fe-text)}.label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.retry{flex:none;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--sd-fe-error);cursor:pointer}.retry:hover{background:color-mix(in srgb,var(--sd-fe-error) 10%,transparent)}.spinner{flex:none;width:14px;height:14px;border:2px solid color-mix(in srgb,var(--sd-fe-accent) 25%,transparent);border-top-color:var(--sd-fe-accent);border-radius:50%;animation:sd-file-explorer-tree-spin .8s linear infinite}@keyframes sd-file-explorer-tree-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.spinner{animation-duration:2.4s}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdFileExplorerFileIcon, selector: "sd-file-explorer-file-icon", inputs: ["icon", "size"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
606
+ }
607
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdFileExplorerFolderTree, decorators: [{
608
+ type: Component,
609
+ args: [{ selector: 'sd-file-explorer-folder-tree', standalone: true, imports: [SdIcon, SdFileExplorerFileIcon], changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'sd-file-explorer-folder-tree' }, template: `
610
+ @let _nodes = nodes();
611
+ @let _active = activeKey();
612
+ <ul class="tree" role="tree" [attr.aria-label]="label()">
613
+ @for (node of _nodes; track node.key; let i = $index) {
614
+ <li
615
+ class="node"
616
+ role="treeitem"
617
+ [class.node--selected]="node.selected"
618
+ [attr.aria-level]="node.level"
619
+ [attr.aria-selected]="node.selected"
620
+ [attr.aria-expanded]="node.expandable ? node.expanded : null"
621
+ [attr.aria-busy]="node.status === 'loading' ? true : null"
622
+ [attr.tabindex]="node.key === _active ? 0 : -1"
623
+ [attr.data-autoid]="node.autoId"
624
+ [style.--sd-file-explorer-tree-indent]="(node.level > 1 ? node.level - 2 : 0) * 22 + 'px'"
625
+ (click)="select.emit(node)"
626
+ (keydown)="onKeydown($event, i)"
627
+ (focus)="focusedKey.set(node.key)">
628
+ @if (node.level > 1) {
629
+ <span class="indent"></span>
630
+ @if (node.expandable) {
631
+ <button
632
+ type="button"
633
+ class="toggle"
634
+ tabindex="-1"
635
+ [attr.aria-label]="toggleLabel(node)"
636
+ [attr.data-autoid]="node.autoId ? node.autoId + '-toggle' : null"
637
+ (click)="onToggle($event, node)">
638
+ <sd-icon [name]="node.expanded ? 'expand_more' : 'chevron_right'" size="16px" />
639
+ </button>
640
+ } @else {
641
+ <span class="toggle toggle--placeholder"></span>
642
+ }
643
+ }
644
+ <sd-file-explorer-file-icon [icon]="node.expanded ? 'folder-open' : 'folder-closed'" [size]="28" />
645
+ <span class="label" [title]="node.name">{{ node.name }}</span>
646
+ @if (node.status === 'loading') {
647
+ <span class="spinner" aria-hidden="true"></span>
648
+ } @else if (node.status === 'error') {
649
+ <button
650
+ type="button"
651
+ class="retry"
652
+ tabindex="-1"
653
+ [attr.aria-label]="retryLabel()"
654
+ [title]="retryLabel()"
655
+ (click)="onRetry($event, node)">
656
+ <sd-icon name="refresh" size="16px" />
657
+ </button>
658
+ }
659
+ </li>
660
+ }
661
+ </ul>
662
+ `, styles: [":host{display:block}.tree{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}.node{display:flex;align-items:center;gap:8px;min-height:40px;padding:0 10px;border-radius:8px;color:var(--sd-fe-text);font-size:15px;line-height:20px;cursor:pointer;-webkit-user-select:none;user-select:none;outline:none}.node:hover{background:var(--sd-fe-hover)}.node:focus-visible{box-shadow:inset 0 0 0 2px var(--sd-fe-accent)}.node--selected{background:var(--sd-fe-accent-soft);color:var(--sd-fe-accent);font-weight:600}.node--selected:hover{background:var(--sd-fe-accent-soft)}.indent{flex:none;width:var(--sd-file-explorer-tree-indent, 0);margin-right:-8px}.toggle{flex:none;display:inline-flex;align-items:center;justify-content:center;width:16px;height:24px;margin-right:-1px;padding:0;border:0;border-radius:4px;background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.toggle:hover{color:var(--sd-fe-text)}.label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.retry{flex:none;display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;border-radius:6px;background:transparent;color:var(--sd-fe-error);cursor:pointer}.retry:hover{background:color-mix(in srgb,var(--sd-fe-error) 10%,transparent)}.spinner{flex:none;width:14px;height:14px;border:2px solid color-mix(in srgb,var(--sd-fe-accent) 25%,transparent);border-top-color:var(--sd-fe-accent);border-radius:50%;animation:sd-file-explorer-tree-spin .8s linear infinite}@keyframes sd-file-explorer-tree-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.spinner{animation-duration:2.4s}}\n"] }]
663
+ }], propDecorators: { nodes: [{ type: i0.Input, args: [{ isSignal: true, alias: "nodes", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], select: [{ type: i0.Output, args: ["select"] }], toggle: [{ type: i0.Output, args: ["toggle"] }], retry: [{ type: i0.Output, args: ["retry"] }] } });
664
+
665
+ /**
666
+ * Items of the current folder (or search results) as a list or a grid (internal).
667
+ * Rows and cards are focusable; `Enter` / `Space` activate them like a click.
668
+ */
669
+ class SdFileExplorerItemList {
670
+ /** Items to render, already formatted. */
671
+ items = input.required(/* @ts-ignore */
672
+ ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
673
+ /** `list` or `grid`. */
674
+ view = input('list', /* @ts-ignore */
675
+ ...(ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []));
676
+ /** Show download buttons for files. */
677
+ canDownload = input(false, /* @ts-ignore */
678
+ ...(ngDevMode ? [{ debugName: "canDownload" }] : /* istanbul ignore next */ []));
679
+ /** Show share buttons for files. */
680
+ canShare = input(false, /* @ts-ignore */
681
+ ...(ngDevMode ? [{ debugName: "canShare" }] : /* istanbul ignore next */ []));
682
+ /** Narrow layout: hides the modified column. */
683
+ compact = input(false, /* @ts-ignore */
684
+ ...(ngDevMode ? [{ debugName: "compact" }] : /* istanbul ignore next */ []));
685
+ /** Id of the file currently shown in the preview panel. */
686
+ activeId = input(null, /* @ts-ignore */
687
+ ...(ngDevMode ? [{ debugName: "activeId" }] : /* istanbul ignore next */ []));
688
+ /** Accessible name of the list. */
689
+ label = input('', /* @ts-ignore */
690
+ ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
691
+ /** Row / card activated. */
692
+ activate = output();
693
+ /** Download button pressed. */
694
+ download = output();
695
+ /** Share button pressed. */
696
+ share = output();
697
+ /** Width of the row action column: one 32 px icon button per enabled action. */
698
+ actionsWidth = computed(() => {
699
+ const count = (this.canDownload() ? 1 : 0) + (this.canShare() ? 1 : 0);
700
+ if (!count)
701
+ return null;
702
+ return `${count * 32 + (count - 1) * 2 + (this.compact() ? 4 : 12)}px`;
703
+ }, /* @ts-ignore */
704
+ ...(ngDevMode ? [{ debugName: "actionsWidth" }] : /* istanbul ignore next */ []));
705
+ onKeydown(event, view) {
706
+ if (event.key !== 'Enter' && event.key !== ' ')
707
+ return;
708
+ event.preventDefault();
709
+ this.activate.emit(view);
710
+ }
711
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdFileExplorerItemList, deps: [], target: i0.ɵɵFactoryTarget.Component });
712
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: SdFileExplorerItemList, isStandalone: true, selector: "sd-file-explorer-item-list", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: true, transformFunction: null }, view: { classPropertyName: "view", publicName: "view", isSignal: true, isRequired: false, transformFunction: null }, canDownload: { classPropertyName: "canDownload", publicName: "canDownload", isSignal: true, isRequired: false, transformFunction: null }, canShare: { classPropertyName: "canShare", publicName: "canShare", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, activeId: { classPropertyName: "activeId", publicName: "activeId", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { activate: "activate", download: "download", share: "share" }, host: { properties: { "class.sd-file-explorer-item-list--compact": "compact()", "style.--sd-fe-actions-width": "actionsWidth()" }, classAttribute: "sd-file-explorer-item-list" }, ngImport: i0, template: `
713
+ @let _items = items();
714
+ @let _canDownload = canDownload();
715
+ @let _canShare = canShare();
716
+ @let _hasActions = _canDownload || _canShare;
717
+ @let _compact = compact();
718
+ @let _activeId = activeId();
719
+ @if (view() === 'list') {
720
+ <div class="list" role="table" [attr.aria-label]="label()">
721
+ <div class="list-head" role="rowgroup">
722
+ <div class="row row--head" role="row">
723
+ <span class="cell cell--name" role="columnheader">{{ 'core.component.file-explorer.column.name' | sdTranslate }}</span>
724
+ @if (!_compact) {
725
+ <span class="cell cell--modified" role="columnheader">{{
726
+ 'core.component.file-explorer.column.modified' | sdTranslate
727
+ }}</span>
728
+ }
729
+ <span class="cell cell--size" role="columnheader">{{ 'core.component.file-explorer.column.size' | sdTranslate }}</span>
730
+ @if (_hasActions) {
731
+ <span class="cell cell--action" role="columnheader"></span>
732
+ }
733
+ </div>
734
+ </div>
735
+ <div role="rowgroup">
736
+ @for (view of _items; track view.item.id) {
737
+ <div
738
+ class="row"
739
+ role="row"
740
+ tabindex="0"
741
+ [class.row--active]="view.item.id === _activeId"
742
+ [attr.data-item-id]="view.item.id"
743
+ [attr.data-autoid]="view.autoId"
744
+ (click)="activate.emit(view)"
745
+ (keydown)="onKeydown($event, view)">
746
+ <span class="cell cell--name" role="cell">
747
+ <sd-file-explorer-file-icon [icon]="view.icon" [size]="32" />
748
+ <span class="name" [title]="view.item.name">{{ view.item.name }}</span>
749
+ </span>
750
+ @if (!_compact) {
751
+ <span class="cell cell--modified" role="cell" [title]="view.modifiedTitle">{{ view.modifiedLabel || '—' }}</span>
752
+ }
753
+ <span class="cell cell--size" role="cell">{{ view.sizeLabel || '—' }}</span>
754
+ @if (_hasActions) {
755
+ <!-- why: sd-button already keeps its click from reaching the row; Enter/Space are stopped here so the key does not open the file too. -->
756
+ <span class="cell cell--action" role="cell">
757
+ @if (view.item.kind === 'file') {
758
+ @if (_canShare) {
759
+ <sd-button
760
+ class="row-action row-share"
761
+ type="text"
762
+ color="secondary"
763
+ size="sm"
764
+ prefixIcon="share"
765
+ [tooltip]="view.shareLabel"
766
+ [attr.data-autoid]="view.autoId ? view.autoId + '-share' : null"
767
+ (click)="share.emit(view)"
768
+ (keydown.enter)="$event.stopPropagation()"
769
+ (keydown.space)="$event.stopPropagation()" />
770
+ }
771
+ @if (_canDownload) {
772
+ <sd-button
773
+ class="row-action row-download"
774
+ type="text"
775
+ color="secondary"
776
+ size="sm"
777
+ prefixIcon="file_download"
778
+ [tooltip]="view.downloadLabel"
779
+ [attr.data-autoid]="view.autoId ? view.autoId + '-download' : null"
780
+ (click)="download.emit(view)"
781
+ (keydown.enter)="$event.stopPropagation()"
782
+ (keydown.space)="$event.stopPropagation()" />
783
+ }
784
+ }
785
+ </span>
786
+ }
787
+ </div>
788
+ }
789
+ </div>
790
+ </div>
791
+ } @else {
792
+ <ul class="grid" [attr.aria-label]="label()">
793
+ @for (view of _items; track view.item.id) {
794
+ <li
795
+ class="card"
796
+ tabindex="0"
797
+ [class.card--active]="view.item.id === _activeId"
798
+ [attr.data-item-id]="view.item.id"
799
+ [attr.data-autoid]="view.autoId"
800
+ [attr.aria-label]="view.item.name + ', ' + view.typeLabel"
801
+ (click)="activate.emit(view)"
802
+ (keydown)="onKeydown($event, view)">
803
+ <span class="thumb">
804
+ @if (view.item.thumbnailUrl) {
805
+ <img [src]="view.item.thumbnailUrl" alt="" loading="lazy" />
806
+ } @else {
807
+ <sd-file-explorer-file-icon [icon]="view.icon" [size]="48" />
808
+ }
809
+ </span>
810
+ <span class="card-name" [title]="view.item.name">{{ view.item.name }}</span>
811
+ </li>
812
+ }
813
+ </ul>
814
+ }
815
+ `, isInline: true, styles: [":host{display:block}.list{width:100%}.row{display:grid;grid-template-columns:minmax(0,1fr) 128px 88px var(--sd-fe-actions-width, 44px);align-items:center;min-height:62px;border-bottom:1px solid var(--sd-fe-border);color:var(--sd-fe-text);font-size:15px;cursor:pointer;outline:none;transition:background-color .12s ease}.row:hover{background:var(--sd-fe-hover)}.row:focus-visible{box-shadow:inset 0 0 0 2px var(--sd-fe-accent)}.list:not(:has(.cell--action)) .row{grid-template-columns:minmax(0,1fr) 128px 88px}.row--head{min-height:34px;color:var(--sd-fe-text-secondary);font-size:13px;cursor:default}.row--head:hover{background:transparent}.row--active,.row--active:hover{background:var(--sd-fe-accent-soft)}.cell{min-width:0;padding:0 8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cell--name{display:flex;align-items:center;gap:16px}.row:not(.row--head) .cell--modified,.row:not(.row--head) .cell--size{color:var(--sd-fe-text-secondary);font-size:13px}.cell--action{display:flex;align-items:center;justify-content:flex-end;gap:2px;padding:0 4px 0 0;overflow:visible}.name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host(.sd-file-explorer-item-list--compact) .row{grid-template-columns:minmax(0,1fr) 66px var(--sd-fe-actions-width, 36px);min-height:55px;font-size:14px}:host(.sd-file-explorer-item-list--compact) .list:not(:has(.cell--action)) .row{grid-template-columns:minmax(0,1fr) 66px}:host(.sd-file-explorer-item-list--compact) .row--head{min-height:30px;font-size:12px}:host(.sd-file-explorer-item-list--compact) .cell--name{gap:12px}:host(.sd-file-explorer-item-list--compact) .cell{padding:0 4px}:host(.sd-file-explorer-item-list--compact) .cell--action{padding:0}.grid{list-style:none;margin:0;padding:4px 0 0;display:grid;grid-template-columns:repeat(auto-fill,minmax(248px,1fr));gap:18px 20px}.card{display:flex;flex-direction:column;gap:12px;min-width:0;padding:12px 12px 14px;border:1px solid var(--sd-fe-border);border-radius:12px;background:var(--sd-fe-surface);color:var(--sd-fe-text);cursor:pointer;outline:none;transition:border-color .12s ease,box-shadow .12s ease}.card:hover{border-color:var(--sd-fe-border-strong);box-shadow:0 2px 8px #0f172a0f}.card:focus-visible{box-shadow:0 0 0 2px var(--sd-fe-accent)}.card--active{border-color:var(--sd-fe-accent)}.thumb{display:flex;align-items:center;justify-content:center;height:104px;overflow:hidden;border-radius:8px;background:var(--sd-fe-muted-surface)}.thumb img{width:100%;height:100%;object-fit:cover}.card-name{padding:0 2px;overflow:hidden;font-size:14px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}:host(.sd-file-explorer-item-list--compact) .grid{grid-template-columns:repeat(auto-fill,minmax(148px,1fr));gap:12px}@media(prefers-reduced-motion:reduce){.row,.card{transition:none}}\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: SdFileExplorerFileIcon, selector: "sd-file-explorer-file-icon", inputs: ["icon", "size"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
816
+ }
817
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdFileExplorerItemList, decorators: [{
818
+ type: Component,
819
+ args: [{ selector: 'sd-file-explorer-item-list', standalone: true, imports: [SdButton, SdTranslatePipe, SdFileExplorerFileIcon], changeDetection: ChangeDetectionStrategy.OnPush, host: {
820
+ class: 'sd-file-explorer-item-list',
821
+ '[class.sd-file-explorer-item-list--compact]': 'compact()',
822
+ '[style.--sd-fe-actions-width]': 'actionsWidth()',
823
+ }, template: `
824
+ @let _items = items();
825
+ @let _canDownload = canDownload();
826
+ @let _canShare = canShare();
827
+ @let _hasActions = _canDownload || _canShare;
828
+ @let _compact = compact();
829
+ @let _activeId = activeId();
830
+ @if (view() === 'list') {
831
+ <div class="list" role="table" [attr.aria-label]="label()">
832
+ <div class="list-head" role="rowgroup">
833
+ <div class="row row--head" role="row">
834
+ <span class="cell cell--name" role="columnheader">{{ 'core.component.file-explorer.column.name' | sdTranslate }}</span>
835
+ @if (!_compact) {
836
+ <span class="cell cell--modified" role="columnheader">{{
837
+ 'core.component.file-explorer.column.modified' | sdTranslate
838
+ }}</span>
839
+ }
840
+ <span class="cell cell--size" role="columnheader">{{ 'core.component.file-explorer.column.size' | sdTranslate }}</span>
841
+ @if (_hasActions) {
842
+ <span class="cell cell--action" role="columnheader"></span>
843
+ }
844
+ </div>
845
+ </div>
846
+ <div role="rowgroup">
847
+ @for (view of _items; track view.item.id) {
848
+ <div
849
+ class="row"
850
+ role="row"
851
+ tabindex="0"
852
+ [class.row--active]="view.item.id === _activeId"
853
+ [attr.data-item-id]="view.item.id"
854
+ [attr.data-autoid]="view.autoId"
855
+ (click)="activate.emit(view)"
856
+ (keydown)="onKeydown($event, view)">
857
+ <span class="cell cell--name" role="cell">
858
+ <sd-file-explorer-file-icon [icon]="view.icon" [size]="32" />
859
+ <span class="name" [title]="view.item.name">{{ view.item.name }}</span>
860
+ </span>
861
+ @if (!_compact) {
862
+ <span class="cell cell--modified" role="cell" [title]="view.modifiedTitle">{{ view.modifiedLabel || '—' }}</span>
863
+ }
864
+ <span class="cell cell--size" role="cell">{{ view.sizeLabel || '—' }}</span>
865
+ @if (_hasActions) {
866
+ <!-- why: sd-button already keeps its click from reaching the row; Enter/Space are stopped here so the key does not open the file too. -->
867
+ <span class="cell cell--action" role="cell">
868
+ @if (view.item.kind === 'file') {
869
+ @if (_canShare) {
870
+ <sd-button
871
+ class="row-action row-share"
872
+ type="text"
873
+ color="secondary"
874
+ size="sm"
875
+ prefixIcon="share"
876
+ [tooltip]="view.shareLabel"
877
+ [attr.data-autoid]="view.autoId ? view.autoId + '-share' : null"
878
+ (click)="share.emit(view)"
879
+ (keydown.enter)="$event.stopPropagation()"
880
+ (keydown.space)="$event.stopPropagation()" />
881
+ }
882
+ @if (_canDownload) {
883
+ <sd-button
884
+ class="row-action row-download"
885
+ type="text"
886
+ color="secondary"
887
+ size="sm"
888
+ prefixIcon="file_download"
889
+ [tooltip]="view.downloadLabel"
890
+ [attr.data-autoid]="view.autoId ? view.autoId + '-download' : null"
891
+ (click)="download.emit(view)"
892
+ (keydown.enter)="$event.stopPropagation()"
893
+ (keydown.space)="$event.stopPropagation()" />
894
+ }
895
+ }
896
+ </span>
897
+ }
898
+ </div>
899
+ }
900
+ </div>
901
+ </div>
902
+ } @else {
903
+ <ul class="grid" [attr.aria-label]="label()">
904
+ @for (view of _items; track view.item.id) {
905
+ <li
906
+ class="card"
907
+ tabindex="0"
908
+ [class.card--active]="view.item.id === _activeId"
909
+ [attr.data-item-id]="view.item.id"
910
+ [attr.data-autoid]="view.autoId"
911
+ [attr.aria-label]="view.item.name + ', ' + view.typeLabel"
912
+ (click)="activate.emit(view)"
913
+ (keydown)="onKeydown($event, view)">
914
+ <span class="thumb">
915
+ @if (view.item.thumbnailUrl) {
916
+ <img [src]="view.item.thumbnailUrl" alt="" loading="lazy" />
917
+ } @else {
918
+ <sd-file-explorer-file-icon [icon]="view.icon" [size]="48" />
919
+ }
920
+ </span>
921
+ <span class="card-name" [title]="view.item.name">{{ view.item.name }}</span>
922
+ </li>
923
+ }
924
+ </ul>
925
+ }
926
+ `, styles: [":host{display:block}.list{width:100%}.row{display:grid;grid-template-columns:minmax(0,1fr) 128px 88px var(--sd-fe-actions-width, 44px);align-items:center;min-height:62px;border-bottom:1px solid var(--sd-fe-border);color:var(--sd-fe-text);font-size:15px;cursor:pointer;outline:none;transition:background-color .12s ease}.row:hover{background:var(--sd-fe-hover)}.row:focus-visible{box-shadow:inset 0 0 0 2px var(--sd-fe-accent)}.list:not(:has(.cell--action)) .row{grid-template-columns:minmax(0,1fr) 128px 88px}.row--head{min-height:34px;color:var(--sd-fe-text-secondary);font-size:13px;cursor:default}.row--head:hover{background:transparent}.row--active,.row--active:hover{background:var(--sd-fe-accent-soft)}.cell{min-width:0;padding:0 8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cell--name{display:flex;align-items:center;gap:16px}.row:not(.row--head) .cell--modified,.row:not(.row--head) .cell--size{color:var(--sd-fe-text-secondary);font-size:13px}.cell--action{display:flex;align-items:center;justify-content:flex-end;gap:2px;padding:0 4px 0 0;overflow:visible}.name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host(.sd-file-explorer-item-list--compact) .row{grid-template-columns:minmax(0,1fr) 66px var(--sd-fe-actions-width, 36px);min-height:55px;font-size:14px}:host(.sd-file-explorer-item-list--compact) .list:not(:has(.cell--action)) .row{grid-template-columns:minmax(0,1fr) 66px}:host(.sd-file-explorer-item-list--compact) .row--head{min-height:30px;font-size:12px}:host(.sd-file-explorer-item-list--compact) .cell--name{gap:12px}:host(.sd-file-explorer-item-list--compact) .cell{padding:0 4px}:host(.sd-file-explorer-item-list--compact) .cell--action{padding:0}.grid{list-style:none;margin:0;padding:4px 0 0;display:grid;grid-template-columns:repeat(auto-fill,minmax(248px,1fr));gap:18px 20px}.card{display:flex;flex-direction:column;gap:12px;min-width:0;padding:12px 12px 14px;border:1px solid var(--sd-fe-border);border-radius:12px;background:var(--sd-fe-surface);color:var(--sd-fe-text);cursor:pointer;outline:none;transition:border-color .12s ease,box-shadow .12s ease}.card:hover{border-color:var(--sd-fe-border-strong);box-shadow:0 2px 8px #0f172a0f}.card:focus-visible{box-shadow:0 0 0 2px var(--sd-fe-accent)}.card--active{border-color:var(--sd-fe-accent)}.thumb{display:flex;align-items:center;justify-content:center;height:104px;overflow:hidden;border-radius:8px;background:var(--sd-fe-muted-surface)}.thumb img{width:100%;height:100%;object-fit:cover}.card-name{padding:0 2px;overflow:hidden;font-size:14px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}:host(.sd-file-explorer-item-list--compact) .grid{grid-template-columns:repeat(auto-fill,minmax(148px,1fr));gap:12px}@media(prefers-reduced-motion:reduce){.row,.card{transition:none}}\n"] }]
927
+ }], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: true }] }], view: [{ type: i0.Input, args: [{ isSignal: true, alias: "view", required: false }] }], canDownload: [{ type: i0.Input, args: [{ isSignal: true, alias: "canDownload", required: false }] }], canShare: [{ type: i0.Input, args: [{ isSignal: true, alias: "canShare", required: false }] }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }], activeId: [{ type: i0.Input, args: [{ isSignal: true, alias: "activeId", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], activate: [{ type: i0.Output, args: ["activate"] }], download: [{ type: i0.Output, args: ["download"] }], share: [{ type: i0.Output, args: ["share"] }] } });
928
+
929
+ /**
930
+ * File detail of the explorer (internal): an `<sd-side-drawer>` opened in the explorer's item area (right of the
931
+ * folder tree, below the header) through the drawer's `container` input, with the preview stage and metadata in its
932
+ * body and share / download in its footer.
933
+ *
934
+ * The explorer owns the open file: a non-null `view` opens the drawer, `null` closes it. When the user closes
935
+ * the drawer (close button, `Escape`, backdrop) the panel emits `close`.
936
+ *
937
+ * PDFs render with `<sd-preview-pdf>`, imported on demand so the PDF.js bundle is only fetched the first
938
+ * time a PDF is previewed.
939
+ */
940
+ class SdFileExplorerPreviewPanel {
941
+ /** File shown in the drawer; `null` closes the drawer. */
942
+ view = input(null, /* @ts-ignore */
943
+ ...(ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []));
944
+ /** What the stage renders. */
945
+ state = input.required(/* @ts-ignore */
946
+ ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
947
+ /** Metadata rows (name, type, size, modified). */
948
+ meta = input([], /* @ts-ignore */
949
+ ...(ngDevMode ? [{ debugName: "meta" }] : /* istanbul ignore next */ []));
950
+ /** Show the download button. */
951
+ canDownload = input(false, /* @ts-ignore */
952
+ ...(ngDevMode ? [{ debugName: "canDownload" }] : /* istanbul ignore next */ []));
953
+ /** Show the share button. */
954
+ canShare = input(false, /* @ts-ignore */
955
+ ...(ngDevMode ? [{ debugName: "canShare" }] : /* istanbul ignore next */ []));
956
+ /** Element the drawer opens inside: the explorer's item area, right of the folder tree. */
957
+ container = input(null, /* @ts-ignore */
958
+ ...(ngDevMode ? [{ debugName: "container" }] : /* istanbul ignore next */ []));
959
+ /** E2E scope of the detail content and its buttons. */
960
+ autoId = input(undefined, /* @ts-ignore */
961
+ ...(ngDevMode ? [{ debugName: "autoId" }] : /* istanbul ignore next */ []));
962
+ /** The user closed the drawer (close button, `Escape` or backdrop). */
963
+ close = output();
964
+ /** Download button pressed. */
965
+ download = output();
966
+ /** Share button pressed. */
967
+ share = output();
968
+ /** Retry button of the error state pressed. */
969
+ retry = output();
970
+ /** The `<img>` failed to load. */
971
+ imageError = output();
972
+ drawer = viewChild(SdSideDrawer, /* @ts-ignore */
973
+ ...(ngDevMode ? [{ debugName: "drawer" }] : /* istanbul ignore next */ []));
974
+ drawerTitle = computed(() => this.view()?.item.name ?? '', /* @ts-ignore */
975
+ ...(ngDevMode ? [{ debugName: "drawerTitle" }] : /* istanbul ignore next */ []));
976
+ // why: sd-side-drawer tự thêm tiền tố `components-side-drawer-`; bỏ `components-` của autoId explorer cho khỏi lặp.
977
+ drawerAutoId = computed(() => this.autoId()?.replace(/^components-/, ''), /* @ts-ignore */
978
+ ...(ngDevMode ? [{ debugName: "drawerAutoId" }] : /* istanbul ignore next */ []));
979
+ pdfComponent = signal(null, /* @ts-ignore */
980
+ ...(ngDevMode ? [{ debugName: "pdfComponent" }] : /* istanbul ignore next */ []));
981
+ pdfFailed = signal(false, /* @ts-ignore */
982
+ ...(ngDevMode ? [{ debugName: "pdfFailed" }] : /* istanbul ignore next */ []));
983
+ #pdfRequested = false;
984
+ pdfInputs = computed(() => {
985
+ const state = this.state();
986
+ if (state.status !== 'pdf')
987
+ return {};
988
+ return {
989
+ source: state.source,
990
+ title: this.view()?.item.name ?? '',
991
+ theme: 'light',
992
+ sidebar: 'none',
993
+ sidebarOpen: false,
994
+ // why: toolbar nổi (trang/zoom) tràn ngang trong panel ~350px; header của viewer vẫn giữ tìm kiếm/in/toàn màn hình.
995
+ showToolbar: false,
996
+ downloadable: false,
997
+ initialZoom: 'page-width',
998
+ };
999
+ }, /* @ts-ignore */
1000
+ ...(ngDevMode ? [{ debugName: "pdfInputs" }] : /* istanbul ignore next */ []));
1001
+ constructor() {
1002
+ effect(() => {
1003
+ const drawer = this.drawer();
1004
+ const open = this.view() !== null;
1005
+ if (!drawer)
1006
+ return;
1007
+ untracked(() => {
1008
+ if (open && !drawer.isOpened())
1009
+ drawer.open();
1010
+ else if (!open && drawer.isOpened())
1011
+ drawer.forceClose();
1012
+ });
1013
+ });
1014
+ effect(() => {
1015
+ if (this.state().status !== 'pdf')
1016
+ return;
1017
+ untracked(() => this.#loadPdfViewer());
1018
+ });
1019
+ }
1020
+ onDrawerClosed() {
1021
+ // Explorer tự đóng (view đã là null) thì không báo lại; chỉ báo khi người dùng đóng drawer.
1022
+ if (this.view())
1023
+ this.close.emit();
1024
+ }
1025
+ async #loadPdfViewer() {
1026
+ if (this.#pdfRequested)
1027
+ return;
1028
+ this.#pdfRequested = true;
1029
+ try {
1030
+ // why: import động để PDF.js (+ worker inline ~1.4 MB) tách chunk riêng — consumer không xem PDF thì không tải.
1031
+ const module = await import('@sdcorejs/angular/components/preview');
1032
+ this.pdfComponent.set(module.SdPreviewPdf);
1033
+ }
1034
+ catch {
1035
+ this.#pdfRequested = false;
1036
+ this.pdfFailed.set(true);
1037
+ }
1038
+ }
1039
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdFileExplorerPreviewPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
1040
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: SdFileExplorerPreviewPanel, isStandalone: true, selector: "sd-file-explorer-preview-panel", inputs: { view: { classPropertyName: "view", publicName: "view", isSignal: true, isRequired: false, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: true, transformFunction: null }, meta: { classPropertyName: "meta", publicName: "meta", isSignal: true, isRequired: false, transformFunction: null }, canDownload: { classPropertyName: "canDownload", publicName: "canDownload", isSignal: true, isRequired: false, transformFunction: null }, canShare: { classPropertyName: "canShare", publicName: "canShare", isSignal: true, isRequired: false, transformFunction: null }, container: { classPropertyName: "container", publicName: "container", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { close: "close", download: "download", share: "share", retry: "retry", imageError: "imageError" }, host: { classAttribute: "sd-file-explorer-preview-panel" }, viewQueries: [{ propertyName: "drawer", first: true, predicate: SdSideDrawer, descendants: true, isSignal: true }], ngImport: i0, template: `
1041
+ @let _view = view();
1042
+ @let _state = state();
1043
+ @let _autoId = autoId();
1044
+ @let _canDownload = canDownload();
1045
+ @let _canShare = canShare();
1046
+ <sd-side-drawer width="420px" [container]="container()" [title]="drawerTitle()" [autoId]="drawerAutoId()" (sdClosed)="onDrawerClosed()">
1047
+ @if (_view) {
1048
+ <div class="detail" [attr.data-autoid]="_autoId ?? null">
1049
+ <div class="stage" [class.stage--pdf]="_state.status === 'pdf'" [attr.aria-busy]="_state.status === 'loading' ? true : null">
1050
+ @switch (_state.status) {
1051
+ @case ('image') {
1052
+ <img class="image" [src]="_state.url" [alt]="_view.item.name" (error)="imageError.emit()" />
1053
+ }
1054
+ @case ('pdf') {
1055
+ @let _pdf = pdfComponent();
1056
+ @if (_pdf) {
1057
+ <ng-container *ngComponentOutlet="_pdf; inputs: pdfInputs()" />
1058
+ } @else if (pdfFailed()) {
1059
+ <div class="placeholder placeholder--error">
1060
+ <sd-icon name="error_outline" size="32px" />
1061
+ <p class="placeholder-title">{{ 'core.component.file-explorer.preview.error' | sdTranslate }}</p>
1062
+ </div>
1063
+ } @else {
1064
+ <div class="placeholder">
1065
+ <span class="spinner" aria-hidden="true"></span>
1066
+ <p class="placeholder-hint">{{ 'core.component.file-explorer.preview.loading' | sdTranslate }}</p>
1067
+ </div>
1068
+ }
1069
+ }
1070
+ @case ('loading') {
1071
+ <div class="placeholder">
1072
+ <span class="spinner" aria-hidden="true"></span>
1073
+ <p class="placeholder-hint">{{ 'core.component.file-explorer.preview.loading' | sdTranslate }}</p>
1074
+ </div>
1075
+ }
1076
+ @case ('error') {
1077
+ <div class="placeholder placeholder--error" role="alert">
1078
+ <sd-icon name="error_outline" size="32px" />
1079
+ <p class="placeholder-title">{{ 'core.component.file-explorer.preview.error' | sdTranslate }}</p>
1080
+ @if (_state.message) {
1081
+ <p class="placeholder-hint">{{ _state.message }}</p>
1082
+ }
1083
+ <sd-button
1084
+ class="retry-button"
1085
+ type="outline"
1086
+ color="secondary"
1087
+ size="sm"
1088
+ prefixIcon="refresh"
1089
+ [title]="'core.component.file-explorer.retry' | sdTranslate"
1090
+ [attr.data-autoid]="_autoId ? _autoId + '-retry' : null"
1091
+ (click)="retry.emit()" />
1092
+ </div>
1093
+ }
1094
+ @default {
1095
+ <div class="placeholder">
1096
+ <sd-file-explorer-file-icon [icon]="_view.icon" [size]="64" />
1097
+ <p class="placeholder-title">{{ 'core.component.file-explorer.preview.unavailable' | sdTranslate }}</p>
1098
+ @if (_canDownload) {
1099
+ <p class="placeholder-hint">{{ 'core.component.file-explorer.preview.unavailable-hint' | sdTranslate }}</p>
1100
+ }
1101
+ </div>
1102
+ }
1103
+ }
1104
+ </div>
1105
+
1106
+ <dl class="meta">
1107
+ @for (row of meta(); track row.label) {
1108
+ <div class="meta-row">
1109
+ <dt>{{ row.label }}</dt>
1110
+ <dd [title]="row.value">{{ row.value }}</dd>
1111
+ </div>
1112
+ }
1113
+ </dl>
1114
+ </div>
1115
+ }
1116
+ <!-- why: each @if has a single root element carrying sdFooterRight, so Angular projects it into the drawer right footer slot. -->
1117
+ @if (_view && _canShare) {
1118
+ <sd-button
1119
+ sdFooterRight
1120
+ class="share-button"
1121
+ [type]="_canDownload ? 'outline' : 'fill'"
1122
+ [color]="_canDownload ? 'secondary' : 'primary'"
1123
+ prefixIcon="share"
1124
+ [title]="'core.component.file-explorer.share' | sdTranslate"
1125
+ [attr.data-autoid]="_autoId ? _autoId + '-share' : null"
1126
+ (click)="share.emit()" />
1127
+ }
1128
+ @if (_view && _canDownload) {
1129
+ <sd-button
1130
+ sdFooterRight
1131
+ class="download-button"
1132
+ type="fill"
1133
+ color="primary"
1134
+ prefixIcon="file_download"
1135
+ [title]="'core.component.file-explorer.download' | sdTranslate"
1136
+ [attr.data-autoid]="_autoId ? _autoId + '-download' : null"
1137
+ (click)="download.emit()" />
1138
+ }
1139
+ </sd-side-drawer>
1140
+ `, isInline: true, styles: [":host{display:none}.stage{display:flex;align-items:center;justify-content:center;height:216px;padding:14px;overflow:hidden;border-radius:12px;background:var(--sd-fe-preview-bg)}.stage--pdf{height:380px;padding:0;background:var(--sd-fe-muted-surface)}.stage--pdf>*{width:100%;height:100%;min-height:0}.image{display:block;max-width:100%;max-height:100%;border-radius:6px;object-fit:contain}.placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:16px;text-align:center;color:var(--sd-fe-text-secondary)}.placeholder--error{color:var(--sd-fe-error)}.placeholder--error sd-button{margin-top:4px}.placeholder-title{margin:4px 0 0;color:var(--sd-fe-text);font-size:14px;font-weight:600}.placeholder-hint{margin:0;font-size:13px;line-height:18px;color:var(--sd-fe-text-secondary)}.spinner{width:28px;height:28px;border:3px solid color-mix(in srgb,var(--sd-fe-accent) 20%,transparent);border-top-color:var(--sd-fe-accent);border-radius:50%;animation:sd-file-explorer-preview-spin .8s linear infinite}.meta{margin:20px 0 0;padding:4px 0 0;border-top:1px solid var(--sd-fe-border)}.meta-row{display:grid;grid-template-columns:84px minmax(0,1fr);align-items:baseline;gap:12px;padding:10px 0;font-size:13px;line-height:18px}.meta-row dt{color:var(--sd-fe-text-secondary)}.meta-row dd{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@keyframes sd-file-explorer-preview-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.spinner{animation-duration:2.4s}}\n"], dependencies: [{ kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { 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: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdSideDrawer, selector: "sd-side-drawer", inputs: ["title", "width", "hideClose", "disableBackdropClose", "beforeClose", "container", "drawerClass", "autoId"], outputs: ["sdClosed", "sdCloseError"] }, { kind: "component", type: SdFileExplorerFileIcon, selector: "sd-file-explorer-file-icon", inputs: ["icon", "size"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1141
+ }
1142
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdFileExplorerPreviewPanel, decorators: [{
1143
+ type: Component,
1144
+ args: [{ selector: 'sd-file-explorer-preview-panel', standalone: true, imports: [NgComponentOutlet, SdButton, SdIcon, SdSideDrawer, SdTranslatePipe, SdFileExplorerFileIcon], changeDetection: ChangeDetectionStrategy.OnPush, host: {
1145
+ class: 'sd-file-explorer-preview-panel',
1146
+ }, template: `
1147
+ @let _view = view();
1148
+ @let _state = state();
1149
+ @let _autoId = autoId();
1150
+ @let _canDownload = canDownload();
1151
+ @let _canShare = canShare();
1152
+ <sd-side-drawer width="420px" [container]="container()" [title]="drawerTitle()" [autoId]="drawerAutoId()" (sdClosed)="onDrawerClosed()">
1153
+ @if (_view) {
1154
+ <div class="detail" [attr.data-autoid]="_autoId ?? null">
1155
+ <div class="stage" [class.stage--pdf]="_state.status === 'pdf'" [attr.aria-busy]="_state.status === 'loading' ? true : null">
1156
+ @switch (_state.status) {
1157
+ @case ('image') {
1158
+ <img class="image" [src]="_state.url" [alt]="_view.item.name" (error)="imageError.emit()" />
1159
+ }
1160
+ @case ('pdf') {
1161
+ @let _pdf = pdfComponent();
1162
+ @if (_pdf) {
1163
+ <ng-container *ngComponentOutlet="_pdf; inputs: pdfInputs()" />
1164
+ } @else if (pdfFailed()) {
1165
+ <div class="placeholder placeholder--error">
1166
+ <sd-icon name="error_outline" size="32px" />
1167
+ <p class="placeholder-title">{{ 'core.component.file-explorer.preview.error' | sdTranslate }}</p>
1168
+ </div>
1169
+ } @else {
1170
+ <div class="placeholder">
1171
+ <span class="spinner" aria-hidden="true"></span>
1172
+ <p class="placeholder-hint">{{ 'core.component.file-explorer.preview.loading' | sdTranslate }}</p>
1173
+ </div>
1174
+ }
1175
+ }
1176
+ @case ('loading') {
1177
+ <div class="placeholder">
1178
+ <span class="spinner" aria-hidden="true"></span>
1179
+ <p class="placeholder-hint">{{ 'core.component.file-explorer.preview.loading' | sdTranslate }}</p>
1180
+ </div>
1181
+ }
1182
+ @case ('error') {
1183
+ <div class="placeholder placeholder--error" role="alert">
1184
+ <sd-icon name="error_outline" size="32px" />
1185
+ <p class="placeholder-title">{{ 'core.component.file-explorer.preview.error' | sdTranslate }}</p>
1186
+ @if (_state.message) {
1187
+ <p class="placeholder-hint">{{ _state.message }}</p>
1188
+ }
1189
+ <sd-button
1190
+ class="retry-button"
1191
+ type="outline"
1192
+ color="secondary"
1193
+ size="sm"
1194
+ prefixIcon="refresh"
1195
+ [title]="'core.component.file-explorer.retry' | sdTranslate"
1196
+ [attr.data-autoid]="_autoId ? _autoId + '-retry' : null"
1197
+ (click)="retry.emit()" />
1198
+ </div>
1199
+ }
1200
+ @default {
1201
+ <div class="placeholder">
1202
+ <sd-file-explorer-file-icon [icon]="_view.icon" [size]="64" />
1203
+ <p class="placeholder-title">{{ 'core.component.file-explorer.preview.unavailable' | sdTranslate }}</p>
1204
+ @if (_canDownload) {
1205
+ <p class="placeholder-hint">{{ 'core.component.file-explorer.preview.unavailable-hint' | sdTranslate }}</p>
1206
+ }
1207
+ </div>
1208
+ }
1209
+ }
1210
+ </div>
1211
+
1212
+ <dl class="meta">
1213
+ @for (row of meta(); track row.label) {
1214
+ <div class="meta-row">
1215
+ <dt>{{ row.label }}</dt>
1216
+ <dd [title]="row.value">{{ row.value }}</dd>
1217
+ </div>
1218
+ }
1219
+ </dl>
1220
+ </div>
1221
+ }
1222
+ <!-- why: each @if has a single root element carrying sdFooterRight, so Angular projects it into the drawer right footer slot. -->
1223
+ @if (_view && _canShare) {
1224
+ <sd-button
1225
+ sdFooterRight
1226
+ class="share-button"
1227
+ [type]="_canDownload ? 'outline' : 'fill'"
1228
+ [color]="_canDownload ? 'secondary' : 'primary'"
1229
+ prefixIcon="share"
1230
+ [title]="'core.component.file-explorer.share' | sdTranslate"
1231
+ [attr.data-autoid]="_autoId ? _autoId + '-share' : null"
1232
+ (click)="share.emit()" />
1233
+ }
1234
+ @if (_view && _canDownload) {
1235
+ <sd-button
1236
+ sdFooterRight
1237
+ class="download-button"
1238
+ type="fill"
1239
+ color="primary"
1240
+ prefixIcon="file_download"
1241
+ [title]="'core.component.file-explorer.download' | sdTranslate"
1242
+ [attr.data-autoid]="_autoId ? _autoId + '-download' : null"
1243
+ (click)="download.emit()" />
1244
+ }
1245
+ </sd-side-drawer>
1246
+ `, styles: [":host{display:none}.stage{display:flex;align-items:center;justify-content:center;height:216px;padding:14px;overflow:hidden;border-radius:12px;background:var(--sd-fe-preview-bg)}.stage--pdf{height:380px;padding:0;background:var(--sd-fe-muted-surface)}.stage--pdf>*{width:100%;height:100%;min-height:0}.image{display:block;max-width:100%;max-height:100%;border-radius:6px;object-fit:contain}.placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:16px;text-align:center;color:var(--sd-fe-text-secondary)}.placeholder--error{color:var(--sd-fe-error)}.placeholder--error sd-button{margin-top:4px}.placeholder-title{margin:4px 0 0;color:var(--sd-fe-text);font-size:14px;font-weight:600}.placeholder-hint{margin:0;font-size:13px;line-height:18px;color:var(--sd-fe-text-secondary)}.spinner{width:28px;height:28px;border:3px solid color-mix(in srgb,var(--sd-fe-accent) 20%,transparent);border-top-color:var(--sd-fe-accent);border-radius:50%;animation:sd-file-explorer-preview-spin .8s linear infinite}.meta{margin:20px 0 0;padding:4px 0 0;border-top:1px solid var(--sd-fe-border)}.meta-row{display:grid;grid-template-columns:84px minmax(0,1fr);align-items:baseline;gap:12px;padding:10px 0;font-size:13px;line-height:18px}.meta-row dt{color:var(--sd-fe-text-secondary)}.meta-row dd{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@keyframes sd-file-explorer-preview-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){.spinner{animation-duration:2.4s}}\n"] }]
1247
+ }], ctorParameters: () => [], propDecorators: { view: [{ type: i0.Input, args: [{ isSignal: true, alias: "view", required: false }] }], state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: true }] }], meta: [{ type: i0.Input, args: [{ isSignal: true, alias: "meta", required: false }] }], canDownload: [{ type: i0.Input, args: [{ isSignal: true, alias: "canDownload", required: false }] }], canShare: [{ type: i0.Input, args: [{ isSignal: true, alias: "canShare", required: false }] }], container: [{ type: i0.Input, args: [{ isSignal: true, alias: "container", required: false }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], close: [{ type: i0.Output, args: ["close"] }], download: [{ type: i0.Output, args: ["download"] }], share: [{ type: i0.Output, args: ["share"] }], retry: [{ type: i0.Output, args: ["retry"] }], imageError: [{ type: i0.Output, args: ["imageError"] }], drawer: [{ type: i0.ViewChild, args: [i0.forwardRef(() => SdSideDrawer), { isSignal: true }] }] } });
1248
+
1249
+ let nextTransferPanelId = 0;
1250
+ /**
1251
+ * Transfer queue docked at the bottom of the explorer (internal). Shows one card per upload / download with
1252
+ * its status, a progress bar and the cancel / retry / dismiss actions allowed by its state.
1253
+ */
1254
+ class SdFileExplorerTransferPanel {
1255
+ /** Cards to render, newest last. */
1256
+ transfers = input.required(/* @ts-ignore */
1257
+ ...(ngDevMode ? [{ debugName: "transfers" }] : /* istanbul ignore next */ []));
1258
+ /** Header text ("Transfers · 2 items"). */
1259
+ title = input('', /* @ts-ignore */
1260
+ ...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
1261
+ /** Hide the cards, keep the header. */
1262
+ collapsed = input(false, /* @ts-ignore */
1263
+ ...(ngDevMode ? [{ debugName: "collapsed" }] : /* istanbul ignore next */ []));
1264
+ /** Show the "Clear finished" button. */
1265
+ canClear = input(false, /* @ts-ignore */
1266
+ ...(ngDevMode ? [{ debugName: "canClear" }] : /* istanbul ignore next */ []));
1267
+ /** Narrow layout: "Clear finished" becomes an icon button so the header stays on one line. */
1268
+ compact = input(false, /* @ts-ignore */
1269
+ ...(ngDevMode ? [{ debugName: "compact" }] : /* istanbul ignore next */ []));
1270
+ /** E2E scope of the panel. */
1271
+ autoId = input(undefined, /* @ts-ignore */
1272
+ ...(ngDevMode ? [{ debugName: "autoId" }] : /* istanbul ignore next */ []));
1273
+ toggleCollapsed = output();
1274
+ clear = output();
1275
+ cancel = output();
1276
+ retry = output();
1277
+ dismiss = output();
1278
+ titleId = `sd-file-explorer-transfers-title-${nextTransferPanelId}`;
1279
+ listId = `sd-file-explorer-transfers-list-${nextTransferPanelId++}`;
1280
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdFileExplorerTransferPanel, deps: [], target: i0.ɵɵFactoryTarget.Component });
1281
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: SdFileExplorerTransferPanel, isStandalone: true, selector: "sd-file-explorer-transfer-panel", inputs: { transfers: { classPropertyName: "transfers", publicName: "transfers", isSignal: true, isRequired: true, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, collapsed: { classPropertyName: "collapsed", publicName: "collapsed", isSignal: true, isRequired: false, transformFunction: null }, canClear: { classPropertyName: "canClear", publicName: "canClear", isSignal: true, isRequired: false, transformFunction: null }, compact: { classPropertyName: "compact", publicName: "compact", isSignal: true, isRequired: false, transformFunction: null }, autoId: { classPropertyName: "autoId", publicName: "autoId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { toggleCollapsed: "toggleCollapsed", clear: "clear", cancel: "cancel", retry: "retry", dismiss: "dismiss" }, host: { properties: { "class.sd-file-explorer-transfer-panel--compact": "compact()" }, classAttribute: "sd-file-explorer-transfer-panel" }, ngImport: i0, template: `
1282
+ @let _collapsed = collapsed();
1283
+ @let _autoId = autoId();
1284
+ @let _compact = compact();
1285
+ @let _clearLabel = 'core.component.file-explorer.transfers.clear' | sdTranslate;
1286
+ <section class="panel" [attr.aria-labelledby]="titleId">
1287
+ <header class="head">
1288
+ <svg class="head-icon" viewBox="0 0 24 24" focusable="false" aria-hidden="true" xmlns="http://www.w3.org/2000/svg">
1289
+ <path
1290
+ d="M12 4v16M7.5 8.5 12 4l4.5 4.5M7.5 15.5 12 20l4.5-4.5"
1291
+ fill="none"
1292
+ stroke="currentColor"
1293
+ stroke-width="2"
1294
+ stroke-linecap="round"
1295
+ stroke-linejoin="round" />
1296
+ </svg>
1297
+ <h3 class="title" [id]="titleId" [title]="title()">{{ title() }}</h3>
1298
+ @if (canClear()) {
1299
+ <sd-button
1300
+ class="clear-button"
1301
+ type="text"
1302
+ color="primary"
1303
+ size="sm"
1304
+ [prefixIcon]="_compact ? 'delete_sweep' : undefined"
1305
+ [title]="_compact ? undefined : _clearLabel"
1306
+ [tooltip]="_compact ? _clearLabel : undefined"
1307
+ [attr.data-autoid]="_autoId ? _autoId + '-clear' : null"
1308
+ (click)="clear.emit()" />
1309
+ }
1310
+ <button
1311
+ type="button"
1312
+ class="icon-button"
1313
+ [attr.aria-expanded]="!_collapsed"
1314
+ [attr.aria-controls]="listId"
1315
+ [attr.aria-label]="
1316
+ (_collapsed ? 'core.component.file-explorer.transfers.expand' : 'core.component.file-explorer.transfers.collapse') | sdTranslate
1317
+ "
1318
+ [attr.data-autoid]="_autoId ? _autoId + '-toggle' : null"
1319
+ (click)="toggleCollapsed.emit()">
1320
+ <sd-icon [name]="_collapsed ? 'expand_less' : 'expand_more'" size="22px" />
1321
+ </button>
1322
+ </header>
1323
+ <ul class="cards" [id]="listId" [hidden]="_collapsed" [attr.aria-label]="'core.component.file-explorer.transfers.list' | sdTranslate">
1324
+ @for (view of transfers(); track view.transfer.id) {
1325
+ <li class="card" [class]="'card--' + view.tone" [attr.data-autoid]="view.autoId">
1326
+ <div class="card-row">
1327
+ <sd-icon
1328
+ class="direction"
1329
+ [name]="view.transfer.direction === 'upload' ? 'file_upload' : 'file_download'"
1330
+ size="22px"
1331
+ [ariaLabel]="view.directionLabel" />
1332
+ <span class="name" [title]="view.transfer.name">{{ view.transfer.name }}</span>
1333
+ <span class="status">{{ view.statusLabel }}</span>
1334
+ @if (view.canCancel) {
1335
+ <sd-button
1336
+ class="card-action"
1337
+ type="text"
1338
+ color="secondary"
1339
+ size="sm"
1340
+ prefixIcon="close"
1341
+ [tooltip]="view.cancelLabel"
1342
+ [attr.data-autoid]="view.autoId ? view.autoId + '-cancel' : null"
1343
+ (click)="cancel.emit(view.transfer.id)" />
1344
+ }
1345
+ @if (view.canRetry) {
1346
+ <sd-button
1347
+ class="card-action"
1348
+ type="text"
1349
+ color="secondary"
1350
+ size="sm"
1351
+ prefixIcon="refresh"
1352
+ [tooltip]="view.retryLabel"
1353
+ [attr.data-autoid]="view.autoId ? view.autoId + '-retry' : null"
1354
+ (click)="retry.emit(view.transfer.id)" />
1355
+ }
1356
+ @if (view.canDismiss) {
1357
+ <sd-button
1358
+ class="card-action"
1359
+ type="text"
1360
+ color="secondary"
1361
+ size="sm"
1362
+ prefixIcon="close"
1363
+ [tooltip]="view.dismissLabel"
1364
+ [attr.data-autoid]="view.autoId ? view.autoId + '-dismiss' : null"
1365
+ (click)="dismiss.emit(view.transfer.id)" />
1366
+ }
1367
+ </div>
1368
+ <div
1369
+ class="bar"
1370
+ role="progressbar"
1371
+ aria-valuemin="0"
1372
+ aria-valuemax="100"
1373
+ [class.bar--indeterminate]="view.progress === 'indeterminate'"
1374
+ [attr.aria-valuenow]="view.progress === 'determinate' ? view.percent : view.progress === 'full' ? 100 : null"
1375
+ [attr.aria-label]="view.transfer.name + ': ' + view.statusLabel">
1376
+ <span
1377
+ class="bar-fill"
1378
+ [style.width.%]="view.progress === 'determinate' ? view.percent : view.progress === 'none' ? 0 : 100"></span>
1379
+ </div>
1380
+ @if (view.errorMessage) {
1381
+ <p class="error" [title]="view.errorMessage">{{ view.errorMessage }}</p>
1382
+ }
1383
+ </li>
1384
+ }
1385
+ </ul>
1386
+ </section>
1387
+ `, isInline: true, styles: [":host{display:block}.panel{padding:12px 20px 18px}:host(.sd-file-explorer-transfer-panel--compact) .panel{padding:10px 14px 14px}.head{display:flex;align-items:center;gap:10px;min-height:32px}.head-icon{flex:none;width:22px;height:22px;color:var(--sd-fe-accent)}.title{flex:1;min-width:0;margin:0;overflow:hidden;font-size:16px;font-weight:600;line-height:22px;color:var(--sd-fe-text);text-overflow:ellipsis;white-space:nowrap}.cards{list-style:none;margin:12px 0 0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));gap:12px 20px;max-height:188px;overflow-y:auto}.cards[hidden]{display:none}.card{display:flex;flex-direction:column;gap:11px;min-width:0;padding:12px 14px;border:1px solid var(--sd-fe-border);border-radius:10px;background:var(--sd-fe-surface)}.card-row{display:flex;align-items:center;gap:10px;min-height:22px}.direction{flex:none;color:var(--sd-fe-accent)}.name{flex:1;min-width:0;overflow:hidden;font-size:14px;font-weight:600;color:var(--sd-fe-text);text-overflow:ellipsis;white-space:nowrap}.status{flex:none;font-size:13px;color:var(--sd-fe-text-secondary);font-variant-numeric:tabular-nums}.bar{position:relative;height:6px;overflow:hidden;border-radius:999px;background:var(--sd-fe-track)}.bar-fill{position:absolute;inset:0 auto 0 0;border-radius:inherit;background:var(--sd-fe-accent);transition:width .2s ease}.bar--indeterminate .bar-fill{width:36%!important;animation:sd-file-explorer-indeterminate 1.3s ease-in-out infinite}.card--success .bar-fill{background:var(--sd-fe-success)}.card--error{border-color:color-mix(in srgb,var(--sd-fe-error) 35%,var(--sd-fe-border))}.card--error .bar-fill{background:var(--sd-fe-error)}.card--error .status{color:var(--sd-fe-error);font-weight:600}.card--muted .bar-fill{background:var(--sd-fe-border-strong)}.error{margin:-4px 0 0;overflow:hidden;font-size:12px;color:var(--sd-fe-error);text-overflow:ellipsis;white-space:nowrap}.icon-button{flex:none;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:0;border-radius:999px;background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.icon-button:hover{background:var(--sd-fe-hover-strong);color:var(--sd-fe-text)}.icon-button:focus-visible{outline:2px solid var(--sd-fe-accent);outline-offset:1px}.card-action{flex:none;margin:-5px -6px -5px -2px}.clear-button{flex:none}@keyframes sd-file-explorer-indeterminate{0%{left:-36%}to{left:100%}}@media(prefers-reduced-motion:reduce){.bar--indeterminate .bar-fill{animation-duration:3s}.bar-fill{transition:none}}\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: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1388
+ }
1389
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdFileExplorerTransferPanel, decorators: [{
1390
+ type: Component,
1391
+ args: [{ selector: 'sd-file-explorer-transfer-panel', standalone: true, imports: [SdButton, SdIcon, SdTranslatePipe], changeDetection: ChangeDetectionStrategy.OnPush, host: { class: 'sd-file-explorer-transfer-panel', '[class.sd-file-explorer-transfer-panel--compact]': 'compact()' }, template: `
1392
+ @let _collapsed = collapsed();
1393
+ @let _autoId = autoId();
1394
+ @let _compact = compact();
1395
+ @let _clearLabel = 'core.component.file-explorer.transfers.clear' | sdTranslate;
1396
+ <section class="panel" [attr.aria-labelledby]="titleId">
1397
+ <header class="head">
1398
+ <svg class="head-icon" viewBox="0 0 24 24" focusable="false" aria-hidden="true" xmlns="http://www.w3.org/2000/svg">
1399
+ <path
1400
+ d="M12 4v16M7.5 8.5 12 4l4.5 4.5M7.5 15.5 12 20l4.5-4.5"
1401
+ fill="none"
1402
+ stroke="currentColor"
1403
+ stroke-width="2"
1404
+ stroke-linecap="round"
1405
+ stroke-linejoin="round" />
1406
+ </svg>
1407
+ <h3 class="title" [id]="titleId" [title]="title()">{{ title() }}</h3>
1408
+ @if (canClear()) {
1409
+ <sd-button
1410
+ class="clear-button"
1411
+ type="text"
1412
+ color="primary"
1413
+ size="sm"
1414
+ [prefixIcon]="_compact ? 'delete_sweep' : undefined"
1415
+ [title]="_compact ? undefined : _clearLabel"
1416
+ [tooltip]="_compact ? _clearLabel : undefined"
1417
+ [attr.data-autoid]="_autoId ? _autoId + '-clear' : null"
1418
+ (click)="clear.emit()" />
1419
+ }
1420
+ <button
1421
+ type="button"
1422
+ class="icon-button"
1423
+ [attr.aria-expanded]="!_collapsed"
1424
+ [attr.aria-controls]="listId"
1425
+ [attr.aria-label]="
1426
+ (_collapsed ? 'core.component.file-explorer.transfers.expand' : 'core.component.file-explorer.transfers.collapse') | sdTranslate
1427
+ "
1428
+ [attr.data-autoid]="_autoId ? _autoId + '-toggle' : null"
1429
+ (click)="toggleCollapsed.emit()">
1430
+ <sd-icon [name]="_collapsed ? 'expand_less' : 'expand_more'" size="22px" />
1431
+ </button>
1432
+ </header>
1433
+ <ul class="cards" [id]="listId" [hidden]="_collapsed" [attr.aria-label]="'core.component.file-explorer.transfers.list' | sdTranslate">
1434
+ @for (view of transfers(); track view.transfer.id) {
1435
+ <li class="card" [class]="'card--' + view.tone" [attr.data-autoid]="view.autoId">
1436
+ <div class="card-row">
1437
+ <sd-icon
1438
+ class="direction"
1439
+ [name]="view.transfer.direction === 'upload' ? 'file_upload' : 'file_download'"
1440
+ size="22px"
1441
+ [ariaLabel]="view.directionLabel" />
1442
+ <span class="name" [title]="view.transfer.name">{{ view.transfer.name }}</span>
1443
+ <span class="status">{{ view.statusLabel }}</span>
1444
+ @if (view.canCancel) {
1445
+ <sd-button
1446
+ class="card-action"
1447
+ type="text"
1448
+ color="secondary"
1449
+ size="sm"
1450
+ prefixIcon="close"
1451
+ [tooltip]="view.cancelLabel"
1452
+ [attr.data-autoid]="view.autoId ? view.autoId + '-cancel' : null"
1453
+ (click)="cancel.emit(view.transfer.id)" />
1454
+ }
1455
+ @if (view.canRetry) {
1456
+ <sd-button
1457
+ class="card-action"
1458
+ type="text"
1459
+ color="secondary"
1460
+ size="sm"
1461
+ prefixIcon="refresh"
1462
+ [tooltip]="view.retryLabel"
1463
+ [attr.data-autoid]="view.autoId ? view.autoId + '-retry' : null"
1464
+ (click)="retry.emit(view.transfer.id)" />
1465
+ }
1466
+ @if (view.canDismiss) {
1467
+ <sd-button
1468
+ class="card-action"
1469
+ type="text"
1470
+ color="secondary"
1471
+ size="sm"
1472
+ prefixIcon="close"
1473
+ [tooltip]="view.dismissLabel"
1474
+ [attr.data-autoid]="view.autoId ? view.autoId + '-dismiss' : null"
1475
+ (click)="dismiss.emit(view.transfer.id)" />
1476
+ }
1477
+ </div>
1478
+ <div
1479
+ class="bar"
1480
+ role="progressbar"
1481
+ aria-valuemin="0"
1482
+ aria-valuemax="100"
1483
+ [class.bar--indeterminate]="view.progress === 'indeterminate'"
1484
+ [attr.aria-valuenow]="view.progress === 'determinate' ? view.percent : view.progress === 'full' ? 100 : null"
1485
+ [attr.aria-label]="view.transfer.name + ': ' + view.statusLabel">
1486
+ <span
1487
+ class="bar-fill"
1488
+ [style.width.%]="view.progress === 'determinate' ? view.percent : view.progress === 'none' ? 0 : 100"></span>
1489
+ </div>
1490
+ @if (view.errorMessage) {
1491
+ <p class="error" [title]="view.errorMessage">{{ view.errorMessage }}</p>
1492
+ }
1493
+ </li>
1494
+ }
1495
+ </ul>
1496
+ </section>
1497
+ `, styles: [":host{display:block}.panel{padding:12px 20px 18px}:host(.sd-file-explorer-transfer-panel--compact) .panel{padding:10px 14px 14px}.head{display:flex;align-items:center;gap:10px;min-height:32px}.head-icon{flex:none;width:22px;height:22px;color:var(--sd-fe-accent)}.title{flex:1;min-width:0;margin:0;overflow:hidden;font-size:16px;font-weight:600;line-height:22px;color:var(--sd-fe-text);text-overflow:ellipsis;white-space:nowrap}.cards{list-style:none;margin:12px 0 0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));gap:12px 20px;max-height:188px;overflow-y:auto}.cards[hidden]{display:none}.card{display:flex;flex-direction:column;gap:11px;min-width:0;padding:12px 14px;border:1px solid var(--sd-fe-border);border-radius:10px;background:var(--sd-fe-surface)}.card-row{display:flex;align-items:center;gap:10px;min-height:22px}.direction{flex:none;color:var(--sd-fe-accent)}.name{flex:1;min-width:0;overflow:hidden;font-size:14px;font-weight:600;color:var(--sd-fe-text);text-overflow:ellipsis;white-space:nowrap}.status{flex:none;font-size:13px;color:var(--sd-fe-text-secondary);font-variant-numeric:tabular-nums}.bar{position:relative;height:6px;overflow:hidden;border-radius:999px;background:var(--sd-fe-track)}.bar-fill{position:absolute;inset:0 auto 0 0;border-radius:inherit;background:var(--sd-fe-accent);transition:width .2s ease}.bar--indeterminate .bar-fill{width:36%!important;animation:sd-file-explorer-indeterminate 1.3s ease-in-out infinite}.card--success .bar-fill{background:var(--sd-fe-success)}.card--error{border-color:color-mix(in srgb,var(--sd-fe-error) 35%,var(--sd-fe-border))}.card--error .bar-fill{background:var(--sd-fe-error)}.card--error .status{color:var(--sd-fe-error);font-weight:600}.card--muted .bar-fill{background:var(--sd-fe-border-strong)}.error{margin:-4px 0 0;overflow:hidden;font-size:12px;color:var(--sd-fe-error);text-overflow:ellipsis;white-space:nowrap}.icon-button{flex:none;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border:0;border-radius:999px;background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.icon-button:hover{background:var(--sd-fe-hover-strong);color:var(--sd-fe-text)}.icon-button:focus-visible{outline:2px solid var(--sd-fe-accent);outline-offset:1px}.card-action{flex:none;margin:-5px -6px -5px -2px}.clear-button{flex:none}@keyframes sd-file-explorer-indeterminate{0%{left:-36%}to{left:100%}}@media(prefers-reduced-motion:reduce){.bar--indeterminate .bar-fill{animation-duration:3s}.bar-fill{transition:none}}\n"] }]
1498
+ }], propDecorators: { transfers: [{ type: i0.Input, args: [{ isSignal: true, alias: "transfers", required: true }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], collapsed: [{ type: i0.Input, args: [{ isSignal: true, alias: "collapsed", required: false }] }], canClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "canClear", required: false }] }], compact: [{ type: i0.Input, args: [{ isSignal: true, alias: "compact", required: false }] }], autoId: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoId", required: false }] }], toggleCollapsed: [{ type: i0.Output, args: ["toggleCollapsed"] }], clear: [{ type: i0.Output, args: ["clear"] }], cancel: [{ type: i0.Output, args: ["cancel"] }], retry: [{ type: i0.Output, args: ["retry"] }], dismiss: [{ type: i0.Output, args: ["dismiss"] }] } });
1499
+
1500
+ /** Delay between the last keystroke and the `search` callback. */
1501
+ const SEARCH_DEBOUNCE_MS = 300;
1502
+ /** Uploads running at the same time; extra files wait as `queued`. */
1503
+ const MAX_PARALLEL_UPLOADS = 3;
1504
+ /** Below this host width the explorer switches to the compact (mobile) layout. */
1505
+ const COMPACT_MAX_WIDTH = 720;
1506
+ /** How long a saved download's object URL stays alive before it is revoked. */
1507
+ const DOWNLOAD_URL_TTL_MS = 40_000;
1508
+ const ACTIVE_STATUSES = new Set(['queued', 'preparing', 'transferring']);
1509
+ const FINISHED_STATUSES = new Set(['done', 'error', 'cancelled']);
1510
+ let nextExplorerId = 0;
1511
+ /**
1512
+ * Google-Drive-like file browser: folder tree, breadcrumb, list / grid, search, file detail drawer, uploads with
1513
+ * drag-and-drop, downloads and a transfer queue — all inside one element.
1514
+ *
1515
+ * Storage-agnostic: every read and write goes through the callbacks of `SdFileExplorerOption`.
1516
+ *
1517
+ * @example
1518
+ * ```html
1519
+ * <sd-file-explorer [option]="option" (open)="onOpen($event)" />
1520
+ * ```
1521
+ */
1522
+ class SdFileExplorer {
1523
+ #i18n = inject(I18nService);
1524
+ #host = inject(ElementRef);
1525
+ #document = inject(DOCUMENT);
1526
+ #injector = inject(Injector);
1527
+ #zone = inject(NgZone);
1528
+ /** Data callbacks and display settings. See `SdFileExplorerOption`. */
1529
+ option = input.required(/* @ts-ignore */
1530
+ ...(ngDevMode ? [{ debugName: "option" }] : /* istanbul ignore next */ []));
1531
+ /**
1532
+ * Emitted exactly once each time the user opens a file (click, `Enter` or `Space` on a file in the list,
1533
+ * grid or search results), right before the detail drawer starts loading. Never emitted for folders.
1534
+ */
1535
+ open = output();
1536
+ // ---- State ----
1537
+ #folders = signal(new Map(), /* @ts-ignore */
1538
+ ...(ngDevMode ? [{ debugName: "#folders" }] : /* istanbul ignore next */ []));
1539
+ #currentId = signal(null, /* @ts-ignore */
1540
+ ...(ngDevMode ? [{ debugName: "#currentId" }] : /* istanbul ignore next */ []));
1541
+ #path = signal([], /* @ts-ignore */
1542
+ ...(ngDevMode ? [{ debugName: "#path" }] : /* istanbul ignore next */ []));
1543
+ #expanded = signal(new Set(), /* @ts-ignore */
1544
+ ...(ngDevMode ? [{ debugName: "#expanded" }] : /* istanbul ignore next */ []));
1545
+ #search = signal(null, /* @ts-ignore */
1546
+ ...(ngDevMode ? [{ debugName: "#search" }] : /* istanbul ignore next */ []));
1547
+ #previewItem = signal(null, /* @ts-ignore */
1548
+ ...(ngDevMode ? [{ debugName: "#previewItem" }] : /* istanbul ignore next */ []));
1549
+ #transfers = signal([], /* @ts-ignore */
1550
+ ...(ngDevMode ? [{ debugName: "#transfers" }] : /* istanbul ignore next */ []));
1551
+ #width = signal(0, /* @ts-ignore */
1552
+ ...(ngDevMode ? [{ debugName: "#width" }] : /* istanbul ignore next */ []));
1553
+ view = signal('list', /* @ts-ignore */
1554
+ ...(ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []));
1555
+ keyword = signal('', /* @ts-ignore */
1556
+ ...(ngDevMode ? [{ debugName: "keyword" }] : /* istanbul ignore next */ []));
1557
+ previewState = signal({ status: 'idle' }, /* @ts-ignore */
1558
+ ...(ngDevMode ? [{ debugName: "previewState" }] : /* istanbul ignore next */ []));
1559
+ transfersCollapsed = signal(false, /* @ts-ignore */
1560
+ ...(ngDevMode ? [{ debugName: "transfersCollapsed" }] : /* istanbul ignore next */ []));
1561
+ sidebarOpen = signal(false, /* @ts-ignore */
1562
+ ...(ngDevMode ? [{ debugName: "sidebarOpen" }] : /* istanbul ignore next */ []));
1563
+ dragActive = signal(false, /* @ts-ignore */
1564
+ ...(ngDevMode ? [{ debugName: "dragActive" }] : /* istanbul ignore next */ []));
1565
+ folderDialogOpen = signal(false, /* @ts-ignore */
1566
+ ...(ngDevMode ? [{ debugName: "folderDialogOpen" }] : /* istanbul ignore next */ []));
1567
+ folderName = signal('', /* @ts-ignore */
1568
+ ...(ngDevMode ? [{ debugName: "folderName" }] : /* istanbul ignore next */ []));
1569
+ folderSubmitting = signal(false, /* @ts-ignore */
1570
+ ...(ngDevMode ? [{ debugName: "folderSubmitting" }] : /* istanbul ignore next */ []));
1571
+ folderError = signal('', /* @ts-ignore */
1572
+ ...(ngDevMode ? [{ debugName: "folderError" }] : /* istanbul ignore next */ []));
1573
+ /** File whose share dialog is open. */
1574
+ shareItem = signal(null, /* @ts-ignore */
1575
+ ...(ngDevMode ? [{ debugName: "shareItem" }] : /* istanbul ignore next */ []));
1576
+ shareState = signal({ status: 'loading' }, /* @ts-ignore */
1577
+ ...(ngDevMode ? [{ debugName: "shareState" }] : /* istanbul ignore next */ []));
1578
+ /** Result of the last copy attempt: copied to the clipboard, or selected for a manual Ctrl+C. */
1579
+ // why: kiểu khai báo tường minh bằng alias — union tự suy ra được in vào d.ts theo thứ tự nội bộ của TypeScript,
1580
+ // thứ tự này đổi theo máy build (v22/TS 6 in khác nhau giữa checkout LF và CRLF) làm lệch snapshot release.
1581
+ shareFeedback = signal('', /* @ts-ignore */
1582
+ ...(ngDevMode ? [{ debugName: "shareFeedback" }] : /* istanbul ignore next */ []));
1583
+ /**
1584
+ * Uploads and downloads started in this explorer, oldest first. Read-only; use it for example to warn
1585
+ * before leaving the page while `status` is `queued`, `preparing` or `transferring`.
1586
+ */
1587
+ transfers = this.#transfers.asReadonly();
1588
+ searchInput = viewChild('searchInput', /* @ts-ignore */
1589
+ ...(ngDevMode ? [{ debugName: "searchInput" }] : /* istanbul ignore next */ []));
1590
+ folderInput = viewChild('folderInput', /* @ts-ignore */
1591
+ ...(ngDevMode ? [{ debugName: "folderInput" }] : /* istanbul ignore next */ []));
1592
+ // why: đọc ElementRef của host <sd-button> — focus phải đặt vào <button> bên trong, không phải host.
1593
+ newFolderButton = viewChild('newFolderButton', { ...(ngDevMode ? { debugName: "newFolderButton" } : /* istanbul ignore next */ {}), read: ElementRef });
1594
+ copyButton = viewChild('copyButton', { ...(ngDevMode ? { debugName: "copyButton" } : /* istanbul ignore next */ {}), read: ElementRef });
1595
+ shareInput = viewChild('shareInput', /* @ts-ignore */
1596
+ ...(ngDevMode ? [{ debugName: "shareInput" }] : /* istanbul ignore next */ []));
1597
+ shareDialog = viewChild('shareDialog', /* @ts-ignore */
1598
+ ...(ngDevMode ? [{ debugName: "shareDialog" }] : /* istanbul ignore next */ []));
1599
+ sidebar = viewChild('sidebar', /* @ts-ignore */
1600
+ ...(ngDevMode ? [{ debugName: "sidebar" }] : /* istanbul ignore next */ []));
1601
+ // ---- Non-reactive bookkeeping ----
1602
+ #listControllers = new Map();
1603
+ #jobs = new Map();
1604
+ #uploadQueue = [];
1605
+ #downloadUrls = new Map();
1606
+ #activeUploads = 0;
1607
+ #transferSeq = 0;
1608
+ #searchTimer = null;
1609
+ #searchController = null;
1610
+ #previewController = null;
1611
+ #previewObjectUrl = null;
1612
+ #shareController = null;
1613
+ #shareReturnFocus = null;
1614
+ #dragDepth = 0;
1615
+ #listFn = null;
1616
+ #resizeObserver = null;
1617
+ #destroyed = false;
1618
+ instanceId = `sd-file-explorer-${nextExplorerId++}`;
1619
+ // ---- Derived ----
1620
+ compact = computed(() => {
1621
+ const width = this.#width();
1622
+ return width > 0 && width < COMPACT_MAX_WIDTH;
1623
+ }, /* @ts-ignore */
1624
+ ...(ngDevMode ? [{ debugName: "compact" }] : /* istanbul ignore next */ []));
1625
+ autoId = computed(() => {
1626
+ const scope = this.option().autoId;
1627
+ return scope ? `components-file-explorer-${scope}` : undefined;
1628
+ }, /* @ts-ignore */
1629
+ ...(ngDevMode ? [{ debugName: "autoId" }] : /* istanbul ignore next */ []));
1630
+ locale = computed(() => sdFileExplorerLocale(this.#i18n.language()), /* @ts-ignore */
1631
+ ...(ngDevMode ? [{ debugName: "locale" }] : /* istanbul ignore next */ []));
1632
+ rootLabel = computed(() => this.option().rootLabel || this.#i18n.t('core.component.file-explorer.root'), /* @ts-ignore */
1633
+ ...(ngDevMode ? [{ debugName: "rootLabel" }] : /* istanbul ignore next */ []));
1634
+ canUpload = computed(() => typeof this.option().upload === 'function', /* @ts-ignore */
1635
+ ...(ngDevMode ? [{ debugName: "canUpload" }] : /* istanbul ignore next */ []));
1636
+ canDownload = computed(() => typeof this.option().download === 'function', /* @ts-ignore */
1637
+ ...(ngDevMode ? [{ debugName: "canDownload" }] : /* istanbul ignore next */ []));
1638
+ canCreateFolder = computed(() => typeof this.option().createFolder === 'function', /* @ts-ignore */
1639
+ ...(ngDevMode ? [{ debugName: "canCreateFolder" }] : /* istanbul ignore next */ []));
1640
+ canShare = computed(() => typeof this.option().share === 'function', /* @ts-ignore */
1641
+ ...(ngDevMode ? [{ debugName: "canShare" }] : /* istanbul ignore next */ []));
1642
+ #serverSearch = computed(() => typeof this.option().search === 'function', /* @ts-ignore */
1643
+ ...(ngDevMode ? [{ debugName: "#serverSearch" }] : /* istanbul ignore next */ []));
1644
+ currentName = computed(() => {
1645
+ const path = this.#path();
1646
+ return path.length ? path[path.length - 1].name : this.rootLabel();
1647
+ }, /* @ts-ignore */
1648
+ ...(ngDevMode ? [{ debugName: "currentName" }] : /* istanbul ignore next */ []));
1649
+ #itemById = computed(() => {
1650
+ const map = new Map();
1651
+ for (const state of this.#folders().values()) {
1652
+ for (const item of state.items)
1653
+ map.set(item.id, item);
1654
+ }
1655
+ for (const folder of this.#path())
1656
+ if (!map.has(folder.id))
1657
+ map.set(folder.id, folder);
1658
+ return map;
1659
+ }, /* @ts-ignore */
1660
+ ...(ngDevMode ? [{ debugName: "#itemById" }] : /* istanbul ignore next */ []));
1661
+ #currentFolder = computed(() => this.#folders().get(this.#currentId()), /* @ts-ignore */
1662
+ ...(ngDevMode ? [{ debugName: "#currentFolder" }] : /* istanbul ignore next */ []));
1663
+ #trimmedKeyword = computed(() => this.keyword().trim(), /* @ts-ignore */
1664
+ ...(ngDevMode ? [{ debugName: "#trimmedKeyword" }] : /* istanbul ignore next */ []));
1665
+ searching = computed(() => this.#trimmedKeyword().length > 0, /* @ts-ignore */
1666
+ ...(ngDevMode ? [{ debugName: "searching" }] : /* istanbul ignore next */ []));
1667
+ #visibleItems = computed(() => {
1668
+ const keyword = this.#trimmedKeyword();
1669
+ const items = this.#currentFolder()?.items ?? [];
1670
+ if (!keyword)
1671
+ return items;
1672
+ if (this.#serverSearch()) {
1673
+ const search = this.#search();
1674
+ return search && search.keyword === keyword && search.status === 'loaded' ? search.items : [];
1675
+ }
1676
+ const needle = sdFileExplorerNormalize(keyword);
1677
+ return items.filter(item => sdFileExplorerNormalize(item.name).includes(needle));
1678
+ }, /* @ts-ignore */
1679
+ ...(ngDevMode ? [{ debugName: "#visibleItems" }] : /* istanbul ignore next */ []));
1680
+ itemViews = computed(() => {
1681
+ const format = this.#itemFormatter();
1682
+ return sdFileExplorerFoldersFirst(this.#visibleItems()).map(format);
1683
+ }, /* @ts-ignore */
1684
+ ...(ngDevMode ? [{ debugName: "itemViews" }] : /* istanbul ignore next */ []));
1685
+ // why: như shareFeedback — kiểu tường minh để d.ts ổn định giữa các máy build.
1686
+ contentState = computed(() => {
1687
+ const keyword = this.#trimmedKeyword();
1688
+ if (keyword && this.#serverSearch()) {
1689
+ const search = this.#search();
1690
+ if (!search || search.keyword !== keyword || search.status === 'loading')
1691
+ return 'loading';
1692
+ if (search.status === 'error')
1693
+ return 'error';
1694
+ return search.items.length ? 'items' : 'empty';
1695
+ }
1696
+ const folder = this.#currentFolder();
1697
+ if (!folder || (folder.status === 'loading' && !folder.loaded))
1698
+ return 'loading';
1699
+ if (folder.status === 'error')
1700
+ return 'error';
1701
+ return this.#visibleItems().length ? 'items' : 'empty';
1702
+ }, /* @ts-ignore */
1703
+ ...(ngDevMode ? [{ debugName: "contentState" }] : /* istanbul ignore next */ []));
1704
+ refreshing = computed(() => {
1705
+ const folder = this.#currentFolder();
1706
+ return !!folder && folder.status === 'loading' && folder.loaded && !this.searching();
1707
+ }, /* @ts-ignore */
1708
+ ...(ngDevMode ? [{ debugName: "refreshing" }] : /* istanbul ignore next */ []));
1709
+ errorMessage = computed(() => {
1710
+ const error = this.searching() && this.#serverSearch() ? this.#search()?.error : this.#currentFolder()?.error;
1711
+ return sdFileExplorerErrorMessage(error);
1712
+ }, /* @ts-ignore */
1713
+ ...(ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []));
1714
+ heading = computed(() => this.searching() ? this.#i18n.t('core.component.file-explorer.search-results') : this.currentName(), /* @ts-ignore */
1715
+ ...(ngDevMode ? [{ debugName: "heading" }] : /* istanbul ignore next */ []));
1716
+ itemCountLabel = computed(() => this.#i18n.t('core.component.file-explorer.item-count', { count: this.#visibleItems().length }), /* @ts-ignore */
1717
+ ...(ngDevMode ? [{ debugName: "itemCountLabel" }] : /* istanbul ignore next */ []));
1718
+ emptyTitle = computed(() => this.searching()
1719
+ ? this.#i18n.t('core.component.file-explorer.search-empty', { keyword: this.#trimmedKeyword() })
1720
+ : this.#i18n.t('core.component.file-explorer.empty'), /* @ts-ignore */
1721
+ ...(ngDevMode ? [{ debugName: "emptyTitle" }] : /* istanbul ignore next */ []));
1722
+ emptyMessage = computed(() => !this.searching() && this.canUpload() ? this.#i18n.t('core.component.file-explorer.empty-upload-hint') : '', /* @ts-ignore */
1723
+ ...(ngDevMode ? [{ debugName: "emptyMessage" }] : /* istanbul ignore next */ []));
1724
+ dropTitle = computed(() => this.#i18n.t('core.component.file-explorer.drop-title', { folder: this.currentName() }), /* @ts-ignore */
1725
+ ...(ngDevMode ? [{ debugName: "dropTitle" }] : /* istanbul ignore next */ []));
1726
+ shareTitle = computed(() => this.#i18n.t('core.component.file-explorer.share.title', { name: this.shareItem()?.name ?? '' }), /* @ts-ignore */
1727
+ ...(ngDevMode ? [{ debugName: "shareTitle" }] : /* istanbul ignore next */ []));
1728
+ shareFeedbackLabel = computed(() => {
1729
+ const feedback = this.shareFeedback();
1730
+ if (feedback === 'copied')
1731
+ return this.#i18n.t('core.component.file-explorer.share.copied');
1732
+ if (feedback === 'manual')
1733
+ return this.#i18n.t('core.component.file-explorer.share.copy-manual');
1734
+ return '';
1735
+ }, /* @ts-ignore */
1736
+ ...(ngDevMode ? [{ debugName: "shareFeedbackLabel" }] : /* istanbul ignore next */ []));
1737
+ folderDialogTitle = computed(() => this.#i18n.t('core.component.file-explorer.new-folder-title', { folder: this.currentName() }), /* @ts-ignore */
1738
+ ...(ngDevMode ? [{ debugName: "folderDialogTitle" }] : /* istanbul ignore next */ []));
1739
+ /** Breadcrumb trail plus the folder each entry navigates to. */
1740
+ breadcrumb = computed(() => {
1741
+ const targets = new Map();
1742
+ const items = [];
1743
+ const root = { label: this.rootLabel(), clickable: true };
1744
+ targets.set(root, null);
1745
+ items.push(root);
1746
+ for (const folder of this.#path()) {
1747
+ const entry = { label: folder.name, clickable: true };
1748
+ targets.set(entry, folder);
1749
+ items.push(entry);
1750
+ }
1751
+ return { items, targets };
1752
+ }, /* @ts-ignore */
1753
+ ...(ngDevMode ? [{ debugName: "breadcrumb" }] : /* istanbul ignore next */ []));
1754
+ treeNodes = computed(() => {
1755
+ const folders = this.#folders();
1756
+ const expanded = this.#expanded();
1757
+ const current = this.#currentId();
1758
+ const autoId = this.autoId();
1759
+ const rootState = folders.get(null);
1760
+ const nodes = [
1761
+ {
1762
+ key: 'root',
1763
+ id: null,
1764
+ item: null,
1765
+ name: this.rootLabel(),
1766
+ level: 1,
1767
+ expandable: false,
1768
+ expanded: true,
1769
+ status: rootState?.status === 'error' ? 'error' : rootState?.status === 'loading' && !rootState.loaded ? 'loading' : 'idle',
1770
+ selected: current === null,
1771
+ autoId: autoId ? `${autoId}-tree-root` : undefined,
1772
+ },
1773
+ ];
1774
+ const visit = (parentId, level, ancestors) => {
1775
+ const state = folders.get(parentId);
1776
+ if (!state)
1777
+ return;
1778
+ const children = state.items.filter(item => item.kind === 'folder');
1779
+ for (const folder of children) {
1780
+ // why: dữ liệu consumer có thể lỗi (thư mục là con của chính nó) — chặn vòng lặp vô hạn khi dựng cây.
1781
+ if (ancestors.has(folder.id))
1782
+ continue;
1783
+ const childState = folders.get(folder.id);
1784
+ const isExpanded = expanded.has(folder.id);
1785
+ const hasSubfolders = childState?.loaded ? childState.items.some(item => item.kind === 'folder') : folder.hasChildren !== false;
1786
+ const open = isExpanded && hasSubfolders;
1787
+ let status = 'idle';
1788
+ if (isExpanded && childState?.status === 'error')
1789
+ status = 'error';
1790
+ else if (isExpanded && childState?.status === 'loading' && !childState.loaded)
1791
+ status = 'loading';
1792
+ nodes.push({
1793
+ key: `f:${folder.id}`,
1794
+ id: folder.id,
1795
+ item: folder,
1796
+ name: folder.name,
1797
+ level,
1798
+ expandable: hasSubfolders,
1799
+ expanded: open,
1800
+ status,
1801
+ selected: current === folder.id,
1802
+ autoId: autoId ? `${autoId}-tree-${sdFileExplorerSafeId(folder.id)}` : undefined,
1803
+ });
1804
+ if (open)
1805
+ visit(folder.id, level + 1, new Set([...ancestors, folder.id]));
1806
+ }
1807
+ };
1808
+ visit(null, 2, new Set());
1809
+ return nodes;
1810
+ }, /* @ts-ignore */
1811
+ ...(ngDevMode ? [{ debugName: "treeNodes" }] : /* istanbul ignore next */ []));
1812
+ previewView = computed(() => {
1813
+ const item = this.#previewItem();
1814
+ return item ? this.#itemFormatter()(item) : null;
1815
+ }, /* @ts-ignore */
1816
+ ...(ngDevMode ? [{ debugName: "previewView" }] : /* istanbul ignore next */ []));
1817
+ previewMeta = computed(() => {
1818
+ const view = this.previewView();
1819
+ if (!view)
1820
+ return [];
1821
+ const t = (key) => this.#i18n.t(`core.component.file-explorer.meta.${key}`);
1822
+ const rows = [
1823
+ { label: t('name'), value: view.item.name },
1824
+ { label: t('type'), value: view.typeLabel },
1825
+ ];
1826
+ if (view.sizeLabel)
1827
+ rows.push({ label: t('size'), value: view.sizeLabel });
1828
+ if (view.modifiedLabel)
1829
+ rows.push({ label: t('modified'), value: view.modifiedLabel });
1830
+ return rows;
1831
+ }, /* @ts-ignore */
1832
+ ...(ngDevMode ? [{ debugName: "previewMeta" }] : /* istanbul ignore next */ []));
1833
+ transferViews = computed(() => {
1834
+ const t = (key, params) => this.#i18n.t(`core.component.file-explorer.${key}`, params);
1835
+ const autoId = this.autoId();
1836
+ return this.#transfers().map(transfer => {
1837
+ const known = transfer.percent !== undefined;
1838
+ let statusLabel;
1839
+ let progress;
1840
+ let tone;
1841
+ switch (transfer.status) {
1842
+ case 'queued':
1843
+ statusLabel = t('transfers.status.queued');
1844
+ progress = 'none';
1845
+ tone = 'muted';
1846
+ break;
1847
+ case 'preparing':
1848
+ statusLabel = t('transfers.status.preparing');
1849
+ progress = 'indeterminate';
1850
+ tone = 'active';
1851
+ break;
1852
+ case 'transferring':
1853
+ statusLabel = known
1854
+ ? `${transfer.percent}%`
1855
+ : t(transfer.direction === 'upload' ? 'transfers.status.uploading' : 'transfers.status.downloading');
1856
+ progress = known ? 'determinate' : 'indeterminate';
1857
+ tone = 'active';
1858
+ break;
1859
+ case 'done':
1860
+ statusLabel = t(transfer.handedOff ? 'transfers.status.handed-off' : 'transfers.status.done');
1861
+ progress = 'full';
1862
+ tone = 'success';
1863
+ break;
1864
+ case 'error':
1865
+ statusLabel = t('transfers.status.error');
1866
+ progress = known ? 'determinate' : 'full';
1867
+ tone = 'error';
1868
+ break;
1869
+ default:
1870
+ statusLabel = t('transfers.status.cancelled');
1871
+ progress = known ? 'determinate' : 'none';
1872
+ tone = 'muted';
1873
+ }
1874
+ const name = transfer.name;
1875
+ return {
1876
+ transfer,
1877
+ statusLabel,
1878
+ progress,
1879
+ percent: transfer.percent ?? 0,
1880
+ tone,
1881
+ canCancel: ACTIVE_STATUSES.has(transfer.status),
1882
+ canRetry: transfer.status === 'error' || transfer.status === 'cancelled',
1883
+ canDismiss: FINISHED_STATUSES.has(transfer.status),
1884
+ cancelLabel: t('transfers.cancel', { name }),
1885
+ retryLabel: t('transfers.retry', { name }),
1886
+ dismissLabel: t('transfers.dismiss', { name }),
1887
+ directionLabel: t(`transfers.direction.${transfer.direction}`),
1888
+ errorMessage: transfer.status === 'error' ? sdFileExplorerErrorMessage(transfer.error) : '',
1889
+ autoId: autoId ? `${autoId}-transfer-${transfer.id}` : undefined,
1890
+ };
1891
+ });
1892
+ }, /* @ts-ignore */
1893
+ ...(ngDevMode ? [{ debugName: "transferViews" }] : /* istanbul ignore next */ []));
1894
+ transfersTitle = computed(() => this.#i18n.t('core.component.file-explorer.transfers.title', { count: this.#transfers().length }), /* @ts-ignore */
1895
+ ...(ngDevMode ? [{ debugName: "transfersTitle" }] : /* istanbul ignore next */ []));
1896
+ canClearTransfers = computed(() => this.#transfers().some(transfer => FINISHED_STATUSES.has(transfer.status)), /* @ts-ignore */
1897
+ ...(ngDevMode ? [{ debugName: "canClearTransfers" }] : /* istanbul ignore next */ []));
1898
+ /** Formats items with the current language; rebuilt when the language changes. */
1899
+ #itemFormatter = computed(() => {
1900
+ const locale = this.locale();
1901
+ const autoId = this.autoId();
1902
+ const t = (key, params) => this.#i18n.t(`core.component.file-explorer.${key}`, params);
1903
+ const labels = { today: t('today'), yesterday: t('yesterday') };
1904
+ const now = new Date();
1905
+ return (item) => {
1906
+ const type = sdFileExplorerFileType(item);
1907
+ return {
1908
+ item,
1909
+ type,
1910
+ icon: sdFileExplorerIconName(item),
1911
+ typeLabel: t(`type.${type}`),
1912
+ sizeLabel: item.kind === 'file' ? sdFileExplorerFormatSize(item.size, locale) : '',
1913
+ modifiedLabel: sdFileExplorerFormatDate(item.modifiedAt, now, locale, labels),
1914
+ modifiedTitle: sdFileExplorerFormatDateTime(item.modifiedAt, locale),
1915
+ downloadLabel: t('download-item', { name: item.name }),
1916
+ shareLabel: t('share-item', { name: item.name }),
1917
+ autoId: autoId ? `${autoId}-item-${sdFileExplorerSafeId(item.id)}` : undefined,
1918
+ };
1919
+ };
1920
+ }, /* @ts-ignore */
1921
+ ...(ngDevMode ? [{ debugName: "#itemFormatter" }] : /* istanbul ignore next */ []));
1922
+ constructor() {
1923
+ // why: chỉ reset khi hàm `list` đổi (đổi nguồn lưu trữ). Consumer tạo lại object option với cùng callback
1924
+ // (ví dụ đổi title) không được xoá cache/điều hướng của người dùng.
1925
+ effect(() => {
1926
+ const option = this.option();
1927
+ untracked(() => {
1928
+ if (this.#listFn === option.list)
1929
+ return;
1930
+ const firstRun = this.#listFn === null;
1931
+ this.#listFn = option.list;
1932
+ if (firstRun)
1933
+ this.view.set(option.defaultView ?? 'list');
1934
+ this.#resetNavigation();
1935
+ this.#ensureLoaded(null);
1936
+ });
1937
+ });
1938
+ afterNextRender(() => {
1939
+ const host = this.#host.nativeElement;
1940
+ this.#width.set(host.getBoundingClientRect().width);
1941
+ if (typeof ResizeObserver === 'undefined')
1942
+ return;
1943
+ this.#resizeObserver = new ResizeObserver(entries => {
1944
+ const width = entries[entries.length - 1]?.contentRect.width;
1945
+ if (typeof width === 'number')
1946
+ this.#width.set(width);
1947
+ });
1948
+ this.#resizeObserver.observe(host);
1949
+ });
1950
+ // why: rời khỏi layout compact thì drawer không còn ý nghĩa — đóng để lần thu nhỏ sau không bật lại scrim.
1951
+ effect(() => {
1952
+ if (!this.compact())
1953
+ untracked(() => this.sidebarOpen.set(false));
1954
+ });
1955
+ inject(DestroyRef).onDestroy(() => this.#teardown());
1956
+ }
1957
+ // ---- Public API ----
1958
+ /**
1959
+ * Lists the current folder again and drops the cached children of folders that are neither open in the
1960
+ * tree nor on the current path. Re-runs the active search, if any.
1961
+ */
1962
+ reload() {
1963
+ const keep = new Set([null, this.#currentId(), ...this.#expanded(), ...this.#path().map(folder => folder.id)]);
1964
+ const folders = new Map(this.#folders());
1965
+ for (const key of [...folders.keys()]) {
1966
+ if (!keep.has(key)) {
1967
+ this.#listControllers.get(key)?.abort();
1968
+ this.#listControllers.delete(key);
1969
+ folders.delete(key);
1970
+ }
1971
+ }
1972
+ this.#folders.set(folders);
1973
+ for (const key of folders.keys())
1974
+ this.#load(key);
1975
+ this.#ensureLoaded(this.#currentId());
1976
+ if (this.searching())
1977
+ this.#scheduleSearch(true);
1978
+ }
1979
+ // ---- Navigation ----
1980
+ navigate(folder) {
1981
+ const id = folder?.id ?? null;
1982
+ const path = folder ? this.#buildPath(folder) : [];
1983
+ this.#currentId.set(id);
1984
+ this.#path.set(path);
1985
+ this.#expanded.update(expanded => {
1986
+ const next = new Set(expanded);
1987
+ for (const entry of path)
1988
+ next.add(entry.id);
1989
+ return next;
1990
+ });
1991
+ this.#clearSearch();
1992
+ this.closePreview();
1993
+ if (this.compact())
1994
+ this.sidebarOpen.set(false);
1995
+ this.#ensureLoaded(null);
1996
+ for (const entry of path)
1997
+ this.#ensureLoaded(entry.parentId);
1998
+ this.#ensureLoaded(id);
1999
+ }
2000
+ onBreadcrumb(entry) {
2001
+ const { targets } = this.breadcrumb();
2002
+ if (targets.has(entry))
2003
+ this.navigate(targets.get(entry) ?? null);
2004
+ }
2005
+ onTreeSelect(node) {
2006
+ this.navigate(node.item);
2007
+ }
2008
+ onTreeToggle(node) {
2009
+ if (node.id === null)
2010
+ return;
2011
+ const id = node.id;
2012
+ const expand = !this.#expanded().has(id);
2013
+ this.#expanded.update(expanded => {
2014
+ const next = new Set(expanded);
2015
+ if (expand)
2016
+ next.add(id);
2017
+ else
2018
+ next.delete(id);
2019
+ return next;
2020
+ });
2021
+ if (expand)
2022
+ this.#ensureLoaded(id);
2023
+ }
2024
+ onTreeRetry(node) {
2025
+ this.#load(node.id);
2026
+ }
2027
+ retryContent() {
2028
+ if (this.searching() && this.#serverSearch())
2029
+ this.#scheduleSearch(true);
2030
+ else
2031
+ this.#load(this.#currentId());
2032
+ }
2033
+ toggleSidebar() {
2034
+ const open = !this.sidebarOpen();
2035
+ this.sidebarOpen.set(open);
2036
+ if (open) {
2037
+ afterNextRender(() => this.sidebar()?.nativeElement.querySelector('[tabindex="0"]')?.focus(), {
2038
+ injector: this.#injector,
2039
+ });
2040
+ }
2041
+ }
2042
+ setView(view) {
2043
+ this.view.set(view);
2044
+ }
2045
+ // ---- Items / preview ----
2046
+ onActivate(view) {
2047
+ if (view.item.kind === 'folder')
2048
+ this.navigate(view.item);
2049
+ else
2050
+ this.openFile(view.item);
2051
+ }
2052
+ openFile(item) {
2053
+ this.open.emit({ item, path: this.#path() });
2054
+ this.#previewItem.set(item);
2055
+ void this.#loadPreview(item);
2056
+ }
2057
+ /**
2058
+ * Closes the detail drawer. Focus goes back to the row / card that opened it: `sd-side-drawer` restores the
2059
+ * previously focused element when its focus trap closes.
2060
+ */
2061
+ closePreview() {
2062
+ if (!this.#previewItem())
2063
+ return;
2064
+ this.#releasePreview();
2065
+ this.#previewItem.set(null);
2066
+ this.previewState.set({ status: 'idle' });
2067
+ }
2068
+ retryPreview() {
2069
+ const item = this.#previewItem();
2070
+ if (item)
2071
+ void this.#loadPreview(item);
2072
+ }
2073
+ onPreviewImageError() {
2074
+ this.previewState.set({ status: 'error', message: '' });
2075
+ }
2076
+ downloadItem(item) {
2077
+ const download = this.option().download;
2078
+ if (!download)
2079
+ return;
2080
+ this.#enqueue('download', item.name, item.parentId, args => download({ item, ...args }));
2081
+ this.transfersCollapsed.set(false);
2082
+ }
2083
+ downloadPreview() {
2084
+ const item = this.#previewItem();
2085
+ if (item)
2086
+ this.downloadItem(item);
2087
+ }
2088
+ sharePreview() {
2089
+ const item = this.#previewItem();
2090
+ if (item)
2091
+ this.openShare(item);
2092
+ }
2093
+ // ---- Search ----
2094
+ onKeywordInput(value) {
2095
+ this.keyword.set(value);
2096
+ this.#scheduleSearch(false);
2097
+ }
2098
+ clearSearch() {
2099
+ this.#clearSearch();
2100
+ this.searchInput()?.nativeElement.focus();
2101
+ }
2102
+ // ---- Upload ----
2103
+ onFilesPicked(input) {
2104
+ const files = Array.from(input.files ?? []);
2105
+ // why: reset value để chọn lại đúng file đó lần nữa vẫn bắn sự kiện change.
2106
+ input.value = '';
2107
+ this.uploadFiles(files);
2108
+ }
2109
+ uploadFiles(files) {
2110
+ const upload = this.option().upload;
2111
+ if (!upload || files.length === 0)
2112
+ return;
2113
+ const parentId = this.#currentId();
2114
+ for (const file of files) {
2115
+ this.#enqueue('upload', file.name, parentId, args => upload({ file, parentId, ...args }));
2116
+ }
2117
+ this.transfersCollapsed.set(false);
2118
+ }
2119
+ onDragEnter(event) {
2120
+ if (!this.#acceptsDrag(event))
2121
+ return;
2122
+ event.preventDefault();
2123
+ this.#dragDepth++;
2124
+ this.dragActive.set(true);
2125
+ }
2126
+ onDragOver(event) {
2127
+ if (!this.#acceptsDrag(event))
2128
+ return;
2129
+ event.preventDefault();
2130
+ if (event.dataTransfer)
2131
+ event.dataTransfer.dropEffect = 'copy';
2132
+ }
2133
+ onDragLeave() {
2134
+ if (!this.dragActive())
2135
+ return;
2136
+ // why: dragenter/dragleave bắn cho từng phần tử con — đếm độ sâu để overlay không nhấp nháy khi rê qua con.
2137
+ this.#dragDepth = Math.max(0, this.#dragDepth - 1);
2138
+ if (this.#dragDepth === 0)
2139
+ this.dragActive.set(false);
2140
+ }
2141
+ onDrop(event) {
2142
+ if (!this.#acceptsDrag(event))
2143
+ return;
2144
+ event.preventDefault();
2145
+ this.#dragDepth = 0;
2146
+ this.dragActive.set(false);
2147
+ this.uploadFiles(this.#droppedFiles(event.dataTransfer));
2148
+ }
2149
+ // ---- Transfers ----
2150
+ cancelTransfer(id) {
2151
+ const job = this.#jobs.get(id);
2152
+ const status = this.#statusOf(id);
2153
+ if (!job || !status || !ACTIVE_STATUSES.has(status))
2154
+ return;
2155
+ if (status !== 'queued' && job.attempt) {
2156
+ job.attempt.controller.abort();
2157
+ this.#releaseSlot(job.attempt);
2158
+ }
2159
+ this.#patch(id, { status: 'cancelled' });
2160
+ }
2161
+ retryTransfer(id) {
2162
+ const job = this.#jobs.get(id);
2163
+ const status = this.#statusOf(id);
2164
+ if (!job || (status !== 'error' && status !== 'cancelled'))
2165
+ return;
2166
+ this.#patch(id, { status: 'queued', loaded: undefined, total: undefined, percent: undefined, error: undefined, handedOff: undefined });
2167
+ this.#schedule(job);
2168
+ }
2169
+ dismissTransfer(id) {
2170
+ const status = this.#statusOf(id);
2171
+ if (!status || !FINISHED_STATUSES.has(status))
2172
+ return;
2173
+ this.#jobs.delete(id);
2174
+ this.#transfers.update(list => list.filter(transfer => transfer.id !== id));
2175
+ }
2176
+ clearFinishedTransfers() {
2177
+ const finished = new Set(this.#transfers()
2178
+ .filter(transfer => FINISHED_STATUSES.has(transfer.status))
2179
+ .map(transfer => transfer.id));
2180
+ for (const id of finished)
2181
+ this.#jobs.delete(id);
2182
+ this.#transfers.update(list => list.filter(transfer => !finished.has(transfer.id)));
2183
+ }
2184
+ // ---- New folder ----
2185
+ openFolderDialog() {
2186
+ this.folderName.set('');
2187
+ this.folderError.set('');
2188
+ this.folderDialogOpen.set(true);
2189
+ afterNextRender(() => this.folderInput()?.nativeElement.focus(), { injector: this.#injector });
2190
+ }
2191
+ closeFolderDialog() {
2192
+ if (!this.folderDialogOpen())
2193
+ return;
2194
+ this.folderDialogOpen.set(false);
2195
+ afterNextRender(() => this.newFolderButton()?.nativeElement.querySelector('button')?.focus(), { injector: this.#injector });
2196
+ }
2197
+ // ---- Share ----
2198
+ openShare(item) {
2199
+ if (!this.option().share)
2200
+ return;
2201
+ const active = this.#document.activeElement;
2202
+ this.#shareReturnFocus = active instanceof HTMLElement && this.#host.nativeElement.contains(active) ? active : null;
2203
+ this.shareItem.set(item);
2204
+ void this.#loadShareLink(item);
2205
+ // why: trong lúc tạo link, focus vào chính dialog để trình đọc màn hình đọc tiêu đề; link xong thì chuyển sang nút Sao chép.
2206
+ afterNextRender(() => {
2207
+ if (this.shareState().status !== 'ready')
2208
+ this.shareDialog()?.nativeElement.focus();
2209
+ }, { injector: this.#injector });
2210
+ }
2211
+ retryShare() {
2212
+ const item = this.shareItem();
2213
+ if (item)
2214
+ void this.#loadShareLink(item);
2215
+ }
2216
+ closeShare() {
2217
+ if (!this.shareItem())
2218
+ return;
2219
+ this.#shareController?.abort();
2220
+ this.#shareController = null;
2221
+ this.shareItem.set(null);
2222
+ this.shareFeedback.set('');
2223
+ const target = this.#shareReturnFocus;
2224
+ this.#shareReturnFocus = null;
2225
+ if (target?.isConnected)
2226
+ afterNextRender(() => target.focus({ preventScroll: true }), { injector: this.#injector });
2227
+ }
2228
+ async copyShareLink() {
2229
+ const state = this.shareState();
2230
+ if (state.status !== 'ready')
2231
+ return;
2232
+ const clipboard = this.#document.defaultView?.navigator?.clipboard;
2233
+ try {
2234
+ if (typeof clipboard?.writeText !== 'function')
2235
+ throw new Error('Clipboard API unavailable');
2236
+ await clipboard.writeText(state.url);
2237
+ this.shareFeedback.set('copied');
2238
+ }
2239
+ catch {
2240
+ // why: Clipboard API bị chặn (không phải secure context, thiếu quyền, iframe) → chọn sẵn link rồi thử
2241
+ // execCommand; nếu vẫn không được thì hướng dẫn người dùng tự bấm Ctrl+C.
2242
+ const input = this.shareInput()?.nativeElement;
2243
+ input?.focus();
2244
+ input?.select();
2245
+ this.shareFeedback.set(this.#execCopy() ? 'copied' : 'manual');
2246
+ }
2247
+ }
2248
+ async #loadShareLink(item) {
2249
+ const share = this.option().share;
2250
+ if (!share)
2251
+ return;
2252
+ this.#shareController?.abort();
2253
+ const controller = new AbortController();
2254
+ this.#shareController = controller;
2255
+ this.shareFeedback.set('');
2256
+ this.shareState.set({ status: 'loading' });
2257
+ const fallbackError = () => this.#i18n.t('core.component.file-explorer.share.error');
2258
+ try {
2259
+ const url = await share({ item, signal: controller.signal });
2260
+ if (controller.signal.aborted || this.#destroyed)
2261
+ return;
2262
+ if (typeof url !== 'string' || !url.trim()) {
2263
+ this.shareState.set({ status: 'error', message: fallbackError() });
2264
+ return;
2265
+ }
2266
+ this.shareState.set({ status: 'ready', url: url.trim() });
2267
+ afterNextRender(() => this.copyButton()?.nativeElement.querySelector('button')?.focus(), { injector: this.#injector });
2268
+ }
2269
+ catch (error) {
2270
+ if (controller.signal.aborted || this.#destroyed)
2271
+ return;
2272
+ this.shareState.set({ status: 'error', message: sdFileExplorerErrorMessage(error) || fallbackError() });
2273
+ }
2274
+ finally {
2275
+ if (this.#shareController === controller)
2276
+ this.#shareController = null;
2277
+ }
2278
+ }
2279
+ #execCopy() {
2280
+ try {
2281
+ return this.#document.execCommand('copy');
2282
+ }
2283
+ catch {
2284
+ return false;
2285
+ }
2286
+ }
2287
+ async submitFolder(event) {
2288
+ event.preventDefault();
2289
+ const create = this.option().createFolder;
2290
+ const name = this.folderName().trim();
2291
+ if (!create || !name || this.folderSubmitting())
2292
+ return;
2293
+ const parentId = this.#currentId();
2294
+ this.folderSubmitting.set(true);
2295
+ this.folderError.set('');
2296
+ try {
2297
+ await create({ parentId, name });
2298
+ if (this.#destroyed)
2299
+ return;
2300
+ this.closeFolderDialog();
2301
+ if (parentId !== null)
2302
+ this.#expanded.update(expanded => new Set([...expanded, parentId]));
2303
+ this.#refresh(parentId);
2304
+ }
2305
+ catch (error) {
2306
+ if (this.#destroyed)
2307
+ return;
2308
+ this.folderError.set(sdFileExplorerErrorMessage(error) || this.#i18n.t('core.component.file-explorer.create-folder-error'));
2309
+ }
2310
+ finally {
2311
+ this.folderSubmitting.set(false);
2312
+ }
2313
+ }
2314
+ // ---- Keyboard ----
2315
+ onEscape(event) {
2316
+ if (event.defaultPrevented)
2317
+ return;
2318
+ if (this.folderDialogOpen())
2319
+ this.closeFolderDialog();
2320
+ else if (this.shareItem())
2321
+ this.closeShare();
2322
+ // why: header vẫn dùng được khi drawer chi tiết mở — Esc trong ô tìm kiếm xoá từ khoá trước, chưa đóng drawer.
2323
+ else if (this.keyword() && event.target === this.searchInput()?.nativeElement)
2324
+ this.clearSearch();
2325
+ else if (this.#previewItem())
2326
+ this.closePreview();
2327
+ else if (this.sidebarOpen())
2328
+ this.sidebarOpen.set(false);
2329
+ else if (this.keyword())
2330
+ this.clearSearch();
2331
+ else
2332
+ return;
2333
+ event.preventDefault();
2334
+ }
2335
+ // ---- Internals: folders ----
2336
+ #resetNavigation() {
2337
+ for (const controller of this.#listControllers.values())
2338
+ controller.abort();
2339
+ this.#listControllers.clear();
2340
+ this.#folders.set(new Map());
2341
+ this.#currentId.set(null);
2342
+ this.#path.set([]);
2343
+ this.#expanded.set(new Set());
2344
+ this.#clearSearch();
2345
+ this.closePreview();
2346
+ }
2347
+ #ensureLoaded(parentId) {
2348
+ const state = this.#folders().get(parentId);
2349
+ if (state && state.status !== 'error')
2350
+ return;
2351
+ void this.#load(parentId);
2352
+ }
2353
+ /** Re-lists a folder only if it is cached (someone has seen it); otherwise the next visit lists it anyway. */
2354
+ #refresh(parentId) {
2355
+ if (this.#folders().has(parentId))
2356
+ void this.#load(parentId);
2357
+ }
2358
+ async #load(parentId) {
2359
+ this.#listControllers.get(parentId)?.abort();
2360
+ const controller = new AbortController();
2361
+ this.#listControllers.set(parentId, controller);
2362
+ const previous = this.#folders().get(parentId);
2363
+ this.#setFolder(parentId, { status: 'loading', items: previous?.loaded ? previous.items : [], loaded: !!previous?.loaded });
2364
+ try {
2365
+ const items = await this.option().list({ parentId, signal: controller.signal });
2366
+ if (controller.signal.aborted || this.#destroyed)
2367
+ return;
2368
+ this.#setFolder(parentId, { status: 'loaded', items: Array.isArray(items) ? items : [], loaded: true });
2369
+ }
2370
+ catch (error) {
2371
+ if (controller.signal.aborted || this.#destroyed)
2372
+ return;
2373
+ this.#setFolder(parentId, { status: 'error', items: [], loaded: false, error });
2374
+ }
2375
+ finally {
2376
+ if (this.#listControllers.get(parentId) === controller)
2377
+ this.#listControllers.delete(parentId);
2378
+ }
2379
+ }
2380
+ #setFolder(parentId, state) {
2381
+ this.#folders.update(folders => new Map(folders).set(parentId, state));
2382
+ }
2383
+ #buildPath(folder) {
2384
+ const byId = this.#itemById();
2385
+ const chain = [folder];
2386
+ const seen = new Set([folder.id]);
2387
+ let parentId = folder.parentId;
2388
+ while (parentId !== null) {
2389
+ const parent = byId.get(parentId);
2390
+ if (!parent || seen.has(parent.id)) {
2391
+ // why: chuỗi cha bị đứt (kết quả search nằm sâu, cha chưa từng được list) — nối vào đường dẫn hiện tại
2392
+ // để breadcrumb vẫn quay về được thư mục đang xem.
2393
+ const current = this.#path().filter(entry => !seen.has(entry.id));
2394
+ return [...current, folder];
2395
+ }
2396
+ chain.push(parent);
2397
+ seen.add(parent.id);
2398
+ parentId = parent.parentId;
2399
+ }
2400
+ return chain.reverse();
2401
+ }
2402
+ // ---- Internals: search ----
2403
+ #scheduleSearch(immediate) {
2404
+ if (this.#searchTimer)
2405
+ clearTimeout(this.#searchTimer);
2406
+ this.#searchTimer = null;
2407
+ this.#searchController?.abort();
2408
+ this.#searchController = null;
2409
+ const keyword = this.#trimmedKeyword();
2410
+ const search = this.option().search;
2411
+ if (!keyword || !search) {
2412
+ this.#search.set(null);
2413
+ return;
2414
+ }
2415
+ const parentId = this.#currentId();
2416
+ this.#search.set({ keyword, parentId, status: 'loading', items: [] });
2417
+ if (immediate)
2418
+ void this.#runSearch(keyword, parentId);
2419
+ else
2420
+ this.#searchTimer = setTimeout(() => void this.#runSearch(keyword, parentId), SEARCH_DEBOUNCE_MS);
2421
+ }
2422
+ async #runSearch(keyword, parentId) {
2423
+ this.#searchTimer = null;
2424
+ const search = this.option().search;
2425
+ if (!search)
2426
+ return;
2427
+ const controller = new AbortController();
2428
+ this.#searchController = controller;
2429
+ try {
2430
+ const items = await search({ parentId, keyword, signal: controller.signal });
2431
+ if (controller.signal.aborted || this.#destroyed)
2432
+ return;
2433
+ this.#search.set({ keyword, parentId, status: 'loaded', items: Array.isArray(items) ? items : [] });
2434
+ }
2435
+ catch (error) {
2436
+ if (controller.signal.aborted || this.#destroyed)
2437
+ return;
2438
+ this.#search.set({ keyword, parentId, status: 'error', items: [], error });
2439
+ }
2440
+ finally {
2441
+ if (this.#searchController === controller)
2442
+ this.#searchController = null;
2443
+ }
2444
+ }
2445
+ #clearSearch() {
2446
+ this.keyword.set('');
2447
+ this.#scheduleSearch(false);
2448
+ }
2449
+ // ---- Internals: preview ----
2450
+ async #loadPreview(item) {
2451
+ this.#releasePreview();
2452
+ const kind = sdFileExplorerPreviewKind(sdFileExplorerFileType(item));
2453
+ const fallback = () => kind === 'image' && item.thumbnailUrl ? { status: 'image', url: item.thumbnailUrl } : { status: 'unavailable' };
2454
+ const preview = this.option().preview;
2455
+ // why: định dạng không có renderer thì KHÔNG gọi callback — tránh tải cả file chỉ để hiện fallback.
2456
+ if (kind === 'none' || !preview) {
2457
+ this.previewState.set(kind === 'none' ? { status: 'unavailable' } : fallback());
2458
+ return;
2459
+ }
2460
+ const controller = new AbortController();
2461
+ this.#previewController = controller;
2462
+ this.previewState.set({ status: 'loading' });
2463
+ try {
2464
+ const source = await preview({ item, signal: controller.signal });
2465
+ if (controller.signal.aborted || this.#destroyed)
2466
+ return;
2467
+ if (source === null || source === undefined || source === '') {
2468
+ this.previewState.set(fallback());
2469
+ }
2470
+ else if (kind === 'pdf') {
2471
+ this.previewState.set({ status: 'pdf', source });
2472
+ }
2473
+ else if (typeof source === 'string') {
2474
+ this.previewState.set({ status: 'image', url: source });
2475
+ }
2476
+ else {
2477
+ const url = this.#createObjectUrl(source);
2478
+ this.#previewObjectUrl = url;
2479
+ this.previewState.set(url ? { status: 'image', url } : { status: 'unavailable' });
2480
+ }
2481
+ }
2482
+ catch (error) {
2483
+ if (controller.signal.aborted || this.#destroyed)
2484
+ return;
2485
+ this.previewState.set({ status: 'error', message: sdFileExplorerErrorMessage(error) });
2486
+ }
2487
+ finally {
2488
+ if (this.#previewController === controller)
2489
+ this.#previewController = null;
2490
+ }
2491
+ }
2492
+ #releasePreview() {
2493
+ this.#previewController?.abort();
2494
+ this.#previewController = null;
2495
+ if (this.#previewObjectUrl)
2496
+ this.#revokeObjectUrl(this.#previewObjectUrl);
2497
+ this.#previewObjectUrl = null;
2498
+ }
2499
+ // ---- Internals: transfers ----
2500
+ #enqueue(direction, name, parentId, run) {
2501
+ const id = `t${++this.#transferSeq}`;
2502
+ const job = { id, direction, name, parentId, run, attempt: null };
2503
+ this.#jobs.set(id, job);
2504
+ this.#transfers.update(list => [...list, { id, direction, name, status: 'queued' }]);
2505
+ this.#schedule(job);
2506
+ }
2507
+ #schedule(job) {
2508
+ if (job.direction === 'upload') {
2509
+ this.#uploadQueue.push(job.id);
2510
+ this.#pumpUploads();
2511
+ }
2512
+ else {
2513
+ void this.#start(job, false);
2514
+ }
2515
+ }
2516
+ #pumpUploads() {
2517
+ while (this.#activeUploads < MAX_PARALLEL_UPLOADS && this.#uploadQueue.length > 0) {
2518
+ const job = this.#jobs.get(this.#uploadQueue.shift());
2519
+ if (!job || this.#statusOf(job.id) !== 'queued')
2520
+ continue;
2521
+ this.#activeUploads++;
2522
+ void this.#start(job, true);
2523
+ }
2524
+ }
2525
+ #releaseSlot(attempt) {
2526
+ if (!attempt.holdsSlot)
2527
+ return;
2528
+ attempt.holdsSlot = false;
2529
+ this.#activeUploads = Math.max(0, this.#activeUploads - 1);
2530
+ if (!this.#destroyed)
2531
+ this.#pumpUploads();
2532
+ }
2533
+ async #start(job, holdsSlot) {
2534
+ const attempt = { controller: new AbortController(), holdsSlot };
2535
+ job.attempt = attempt;
2536
+ const { signal } = attempt.controller;
2537
+ const current = () => job.attempt === attempt && !signal.aborted && !this.#destroyed;
2538
+ this.#patch(job.id, { status: 'preparing' });
2539
+ const progress = (loaded, total) => {
2540
+ if (!current())
2541
+ return;
2542
+ const safeLoaded = Number.isFinite(loaded) && loaded > 0 ? loaded : 0;
2543
+ const safeTotal = typeof total === 'number' && Number.isFinite(total) && total > 0 ? total : undefined;
2544
+ const percent = safeTotal ? Math.min(100, Math.round((safeLoaded / safeTotal) * 100)) : undefined;
2545
+ this.#patch(job.id, { status: 'transferring', loaded: safeLoaded, total: safeTotal, percent });
2546
+ };
2547
+ try {
2548
+ const result = await job.run({ progress, signal });
2549
+ if (!current())
2550
+ return;
2551
+ const known = this.#transfers().find(transfer => transfer.id === job.id)?.total !== undefined;
2552
+ if (job.direction === 'download') {
2553
+ const blob = this.#isBlob(result) ? result : null;
2554
+ if (blob)
2555
+ this.#saveBlob(blob, job.name);
2556
+ this.#patch(job.id, { status: 'done', handedOff: !blob, percent: known ? 100 : undefined });
2557
+ }
2558
+ else {
2559
+ this.#patch(job.id, { status: 'done', percent: known ? 100 : undefined });
2560
+ this.#refresh(job.parentId);
2561
+ }
2562
+ }
2563
+ catch (error) {
2564
+ if (!current())
2565
+ return;
2566
+ this.#patch(job.id, { status: 'error', error });
2567
+ }
2568
+ finally {
2569
+ this.#releaseSlot(attempt);
2570
+ }
2571
+ }
2572
+ #statusOf(id) {
2573
+ return this.#transfers().find(transfer => transfer.id === id)?.status;
2574
+ }
2575
+ #patch(id, changes) {
2576
+ this.#transfers.update(list => list.map(transfer => (transfer.id === id ? { ...transfer, ...changes } : transfer)));
2577
+ }
2578
+ #saveBlob(blob, name) {
2579
+ const url = this.#createObjectUrl(blob);
2580
+ const body = this.#document.body;
2581
+ if (!url || !body)
2582
+ return;
2583
+ const anchor = this.#document.createElement('a');
2584
+ anchor.href = url;
2585
+ anchor.download = name;
2586
+ anchor.rel = 'noopener';
2587
+ anchor.hidden = true;
2588
+ body.appendChild(anchor);
2589
+ anchor.click();
2590
+ anchor.remove();
2591
+ // why: thu hồi URL ngay sau click có thể cắt ngang việc trình duyệt đọc blob (Firefox/Safari) — giữ một lúc rồi mới revoke.
2592
+ // Timer chạy ngoài zone để 40 giây chờ không giữ ứng dụng ở trạng thái "chưa ổn định" (whenStable, SSR, e2e).
2593
+ const timer = this.#zone.runOutsideAngular(() => setTimeout(() => {
2594
+ this.#downloadUrls.delete(url);
2595
+ this.#revokeObjectUrl(url);
2596
+ }, DOWNLOAD_URL_TTL_MS));
2597
+ this.#downloadUrls.set(url, timer);
2598
+ }
2599
+ // ---- Internals: DOM helpers ----
2600
+ #acceptsDrag(event) {
2601
+ const types = event.dataTransfer?.types;
2602
+ return this.canUpload() && !!types && Array.from(types).includes('Files');
2603
+ }
2604
+ #droppedFiles(transfer) {
2605
+ if (!transfer)
2606
+ return [];
2607
+ const items = transfer.items ? Array.from(transfer.items) : [];
2608
+ if (items.length > 0 && typeof items[0].webkitGetAsEntry === 'function') {
2609
+ // why: thả một thư mục cho ra File rỗng không đọc được — bỏ qua thư mục thay vì tạo transfer chắc chắn lỗi.
2610
+ return items
2611
+ .filter(item => item.kind === 'file' && !item.webkitGetAsEntry()?.isDirectory)
2612
+ .map(item => item.getAsFile())
2613
+ .filter((file) => !!file);
2614
+ }
2615
+ return Array.from(transfer.files ?? []);
2616
+ }
2617
+ #isBlob(value) {
2618
+ return typeof Blob !== 'undefined' && value instanceof Blob;
2619
+ }
2620
+ #createObjectUrl(blob) {
2621
+ const urlApi = this.#document.defaultView?.URL;
2622
+ return typeof urlApi?.createObjectURL === 'function' ? urlApi.createObjectURL(blob) : null;
2623
+ }
2624
+ #revokeObjectUrl(url) {
2625
+ this.#document.defaultView?.URL?.revokeObjectURL?.(url);
2626
+ }
2627
+ #teardown() {
2628
+ this.#destroyed = true;
2629
+ this.#resizeObserver?.disconnect();
2630
+ for (const controller of this.#listControllers.values())
2631
+ controller.abort();
2632
+ this.#listControllers.clear();
2633
+ if (this.#searchTimer)
2634
+ clearTimeout(this.#searchTimer);
2635
+ this.#searchController?.abort();
2636
+ this.#releasePreview();
2637
+ for (const job of this.#jobs.values())
2638
+ job.attempt?.controller.abort();
2639
+ for (const [url, timer] of this.#downloadUrls) {
2640
+ clearTimeout(timer);
2641
+ this.#revokeObjectUrl(url);
2642
+ }
2643
+ this.#downloadUrls.clear();
2644
+ this.#shareController?.abort();
2645
+ }
2646
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdFileExplorer, deps: [], target: i0.ɵɵFactoryTarget.Component });
2647
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: SdFileExplorer, isStandalone: true, selector: "sd-file-explorer", inputs: { option: { classPropertyName: "option", publicName: "option", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { open: "open" }, host: { listeners: { "dragenter": "onDragEnter($event)", "dragover": "onDragOver($event)", "dragleave": "onDragLeave()", "drop": "onDrop($event)", "keydown.escape": "onEscape($event)" }, properties: { "class.sd-file-explorer--compact": "compact()", "class.sd-file-explorer--dragging": "dragActive()", "attr.data-autoid": "autoId()" }, classAttribute: "sd-file-explorer" }, viewQueries: [{ propertyName: "searchInput", first: true, predicate: ["searchInput"], descendants: true, isSignal: true }, { propertyName: "folderInput", first: true, predicate: ["folderInput"], descendants: true, isSignal: true }, { propertyName: "newFolderButton", first: true, predicate: ["newFolderButton"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "copyButton", first: true, predicate: ["copyButton"], descendants: true, read: ElementRef, isSignal: true }, { propertyName: "shareInput", first: true, predicate: ["shareInput"], descendants: true, isSignal: true }, { propertyName: "shareDialog", first: true, predicate: ["shareDialog"], descendants: true, isSignal: true }, { propertyName: "sidebar", first: true, predicate: ["sidebar"], descendants: true, isSignal: true }], ngImport: i0, template: "@let _option = option();\n@let _compact = compact();\n@let _autoId = autoId();\n@let _canUpload = canUpload();\n@let _canDownload = canDownload();\n@let _view = view();\n@let _state = contentState();\n@let _keyword = keyword();\n@let _sidebarOpen = sidebarOpen();\n@let _preview = previewView();\n@let _transfers = transferViews();\n@let _heading = heading();\n@let _searching = searching();\n@let _collapsed = transfersCollapsed();\n@let _dialogOpen = folderDialogOpen();\n@let _shareItem = shareItem();\n@let _canShare = canShare();\n@let _modalOpen = _dialogOpen || !!_shareItem;\n\n<header class=\"header\" [attr.inert]=\"_modalOpen ? '' : null\">\n @if (_option.title) {\n <div class=\"brand\">\n <span class=\"brand-icon\" aria-hidden=\"true\">\n <sd-icon name=\"folder\" size=\"20px\" />\n </span>\n <div class=\"brand-text\">\n <h2 class=\"brand-title\" [title]=\"_option.title\">{{ _option.title }}</h2>\n @if (_option.description) {\n <p class=\"brand-description\">{{ _option.description }}</p>\n }\n </div>\n </div>\n }\n\n <div class=\"search\" role=\"search\">\n <sd-icon class=\"search-icon\" name=\"search\" size=\"20px\" />\n <input\n #searchInput\n type=\"search\"\n class=\"search-input\"\n autocomplete=\"off\"\n [value]=\"_keyword\"\n [placeholder]=\"'core.component.file-explorer.search-placeholder' | sdTranslate\"\n [attr.aria-label]=\"'core.component.file-explorer.search-placeholder' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-search' : null\"\n (input)=\"onKeywordInput(searchInput.value)\" />\n @if (_keyword) {\n <button\n type=\"button\"\n class=\"search-clear\"\n [attr.aria-label]=\"'core.component.file-explorer.search-clear' | sdTranslate\"\n [title]=\"'core.component.file-explorer.search-clear' | sdTranslate\"\n (click)=\"clearSearch()\">\n <sd-icon name=\"close\" size=\"18px\" />\n </button>\n }\n </div>\n\n @if (_canUpload) {\n <sd-button\n class=\"upload-button\"\n type=\"fill\"\n color=\"primary\"\n size=\"md\"\n prefixIcon=\"file_upload\"\n [title]=\"_compact ? undefined : ('core.component.file-explorer.upload' | sdTranslate)\"\n [tooltip]=\"_compact ? ('core.component.file-explorer.upload' | sdTranslate) : undefined\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-upload' : null\"\n (click)=\"fileInput.click()\" />\n <input\n #fileInput\n type=\"file\"\n class=\"file-input\"\n multiple\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-file-input' : null\"\n (change)=\"onFilesPicked(fileInput)\" />\n }\n</header>\n\n<!-- why: dialog ph\u1EE7 c\u1EA3 explorer n\u00EAn l\u00E0m inert c\u1EA3 v\u00F9ng n\u00E0y, k\u1EC3 c\u1EA3 drawer chi ti\u1EBFt \u0111ang n\u1EB1m trong .main. -->\n<div class=\"body\" [attr.inert]=\"_modalOpen ? '' : null\">\n @if (_compact && _sidebarOpen) {\n <div class=\"scrim scrim--sidebar\" aria-hidden=\"true\" (click)=\"sidebarOpen.set(false)\"></div>\n }\n <aside\n #sidebar\n class=\"sidebar\"\n [class.sidebar--open]=\"_sidebarOpen\"\n [id]=\"instanceId + '-sidebar'\"\n [attr.aria-label]=\"'core.component.file-explorer.folders' | sdTranslate\"\n [attr.inert]=\"_compact && !_sidebarOpen ? '' : null\">\n <p class=\"sidebar-label\">{{ 'core.component.file-explorer.folders' | sdTranslate }}</p>\n <div class=\"sidebar-tree\">\n <sd-file-explorer-folder-tree\n [nodes]=\"treeNodes()\"\n [label]=\"'core.component.file-explorer.tree-label' | sdTranslate\"\n (select)=\"onTreeSelect($event)\"\n (toggle)=\"onTreeToggle($event)\"\n (retry)=\"onTreeRetry($event)\" />\n </div>\n @if (canCreateFolder()) {\n <div class=\"sidebar-footer\">\n <sd-button\n #newFolderButton\n class=\"new-folder-button\"\n type=\"outline\"\n color=\"secondary\"\n size=\"md\"\n prefixIcon=\"add\"\n block\n [title]=\"'core.component.file-explorer.new-folder' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-new-folder' : null\"\n (click)=\"openFolderDialog()\" />\n </div>\n }\n </aside>\n\n <!-- why: .main l\u00E0 [container] c\u1EE7a drawer chi ti\u1EBFt \u2014 backdrop ch\u1EC9 ph\u1EE7 v\u00F9ng b\u00EAn ph\u1EA3i, c\u00E2y th\u01B0 m\u1EE5c v\u1EABn d\u00F9ng \u0111\u01B0\u1EE3c.\n Drawer n\u1EB1m TRONG ph\u1EA7n t\u1EED n\u00E0y n\u00EAn inert \u0111\u1EB7t tr\u00EAn t\u1EEBng kh\u1ED1i con, kh\u00F4ng \u0111\u1EB7t tr\u00EAn .main. -->\n <section #mainRegion class=\"main\" [attr.aria-label]=\"_heading\">\n @if (refreshing()) {\n <div class=\"refresh-bar\" aria-hidden=\"true\"></div>\n }\n <div class=\"toolbar\" [attr.inert]=\"_preview ? '' : null\">\n @if (_compact) {\n <button\n type=\"button\"\n class=\"icon-button\"\n [attr.aria-expanded]=\"_sidebarOpen\"\n [attr.aria-controls]=\"instanceId + '-sidebar'\"\n [attr.aria-label]=\"\n (_sidebarOpen ? 'core.component.file-explorer.close-folders' : 'core.component.file-explorer.open-folders') | sdTranslate\n \"\n [attr.data-autoid]=\"_autoId ? _autoId + '-menu' : null\"\n (click)=\"toggleSidebar()\">\n <sd-icon name=\"menu\" size=\"24px\" />\n </button>\n }\n <sd-breadcrumb\n class=\"breadcrumb\"\n [items]=\"breadcrumb().items\"\n [maxItems]=\"_compact ? 3 : 5\"\n [ariaLabel]=\"'core.component.file-explorer.breadcrumb' | sdTranslate\"\n (sdItemActivate)=\"onBreadcrumb($event)\" />\n <div class=\"view-toggle\" role=\"group\" [attr.aria-label]=\"'core.component.file-explorer.view' | sdTranslate\">\n <button\n type=\"button\"\n class=\"icon-button icon-button--toggle\"\n [class.icon-button--active]=\"_view === 'list'\"\n [attr.aria-pressed]=\"_view === 'list'\"\n [attr.aria-label]=\"'core.component.file-explorer.view-list' | sdTranslate\"\n [title]=\"'core.component.file-explorer.view-list' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-view-list' : null\"\n (click)=\"setView('list')\">\n <sd-icon name=\"format_list_bulleted\" size=\"24px\" />\n </button>\n <button\n type=\"button\"\n class=\"icon-button icon-button--toggle\"\n [class.icon-button--active]=\"_view === 'grid'\"\n [attr.aria-pressed]=\"_view === 'grid'\"\n [attr.aria-label]=\"'core.component.file-explorer.view-grid' | sdTranslate\"\n [title]=\"'core.component.file-explorer.view-grid' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-view-grid' : null\"\n (click)=\"setView('grid')\">\n <sd-icon name=\"grid_view\" size=\"24px\" />\n </button>\n </div>\n </div>\n\n <div class=\"heading-row\" [attr.inert]=\"_preview ? '' : null\">\n <h3 class=\"heading\" [title]=\"_heading\">{{ _heading }}</h3>\n @if (_state === 'items') {\n <span class=\"count\">{{ itemCountLabel() }}</span>\n }\n </div>\n\n <div class=\"scroller\" [attr.inert]=\"_preview ? '' : null\">\n @switch (_state) {\n @case ('loading') {\n <sd-data-state\n state=\"loading\"\n compact\n [title]=\"(_searching ? 'core.component.file-explorer.search-loading' : 'core.component.file-explorer.loading') | sdTranslate\" />\n }\n @case ('error') {\n <sd-data-state\n state=\"error\"\n retryable\n [title]=\"(_searching ? 'core.component.file-explorer.search-error' : 'core.component.file-explorer.load-error') | sdTranslate\"\n [message]=\"errorMessage()\"\n [retryLabel]=\"'core.component.file-explorer.retry' | sdTranslate\"\n (sdRetry)=\"retryContent()\" />\n }\n @case ('empty') {\n <sd-data-state\n state=\"empty\"\n [icon]=\"_searching ? 'search_off' : 'folder_open'\"\n [title]=\"emptyTitle()\"\n [message]=\"emptyMessage()\" />\n }\n @default {\n <sd-file-explorer-item-list\n [items]=\"itemViews()\"\n [view]=\"_view\"\n [canDownload]=\"_canDownload\"\n [canShare]=\"_canShare\"\n [compact]=\"_compact\"\n [activeId]=\"_preview ? _preview.item.id : null\"\n [label]=\"_heading\"\n (activate)=\"onActivate($event)\"\n (download)=\"downloadItem($event.item)\"\n (share)=\"openShare($event.item)\" />\n }\n }\n </div>\n </section>\n</div>\n\n@if (_transfers.length) {\n <sd-file-explorer-transfer-panel\n class=\"transfers\"\n [attr.inert]=\"_modalOpen ? '' : null\"\n [transfers]=\"_transfers\"\n [title]=\"transfersTitle()\"\n [collapsed]=\"_collapsed\"\n [canClear]=\"canClearTransfers()\"\n [compact]=\"_compact\"\n [autoId]=\"_autoId ? _autoId + '-transfers' : undefined\"\n (toggleCollapsed)=\"transfersCollapsed.set(!_collapsed)\"\n (clear)=\"clearFinishedTransfers()\"\n (cancel)=\"cancelTransfer($event)\"\n (retry)=\"retryTransfer($event)\"\n (dismiss)=\"dismissTransfer($event)\" />\n}\n\n<!-- why: chi ti\u1EBFt file l\u00E0 sd-side-drawer th\u1EADt, m\u1EDF g\u1ECDn trong v\u00F9ng danh s\u00E1ch b\u00EAn ph\u1EA3i nh\u1EDD [container]:\n header (t\u00ECm ki\u1EBFm, t\u1EA3i l\u00EAn), c\u00E2y th\u01B0 m\u1EE5c v\u00E0 h\u00E0ng ch\u1EDD truy\u1EC1n t\u1EA3i v\u1EABn d\u00F9ng \u0111\u01B0\u1EE3c khi drawer m\u1EDF. -->\n<sd-file-explorer-preview-panel\n [view]=\"_preview\"\n [state]=\"previewState()\"\n [meta]=\"previewMeta()\"\n [canDownload]=\"_canDownload\"\n [canShare]=\"_canShare\"\n [container]=\"mainRegion\"\n [autoId]=\"_autoId ? _autoId + '-preview' : undefined\"\n (close)=\"closePreview()\"\n (download)=\"downloadPreview()\"\n (share)=\"sharePreview()\"\n (retry)=\"retryPreview()\"\n (imageError)=\"onPreviewImageError()\" />\n\n@if (dragActive()) {\n <div class=\"drop-overlay\" aria-hidden=\"true\">\n <div class=\"drop-card\">\n <sd-icon name=\"file_upload\" size=\"40px\" />\n <p class=\"drop-title\">{{ dropTitle() }}</p>\n </div>\n </div>\n}\n\n@if (_dialogOpen) {\n @let _folderName = folderName();\n @let _folderError = folderError();\n <div class=\"dialog-backdrop\" aria-hidden=\"true\" (click)=\"closeFolderDialog()\"></div>\n <form\n class=\"dialog\"\n role=\"dialog\"\n aria-modal=\"true\"\n novalidate\n [attr.aria-labelledby]=\"instanceId + '-folder-title'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-folder-dialog' : null\"\n (submit)=\"submitFolder($event)\">\n <h3 class=\"dialog-title\" [id]=\"instanceId + '-folder-title'\">{{ folderDialogTitle() }}</h3>\n <label class=\"field-label\" [for]=\"instanceId + '-folder-name'\">{{\n 'core.component.file-explorer.new-folder-name' | sdTranslate\n }}</label>\n <input\n #folderInput\n class=\"field-input\"\n autocomplete=\"off\"\n maxlength=\"255\"\n [id]=\"instanceId + '-folder-name'\"\n [value]=\"_folderName\"\n [attr.aria-invalid]=\"_folderError ? true : null\"\n [attr.aria-describedby]=\"_folderError ? instanceId + '-folder-error' : null\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-folder-name' : null\"\n (input)=\"folderName.set(folderInput.value)\" />\n @if (_folderError) {\n <p class=\"field-error\" role=\"alert\" [id]=\"instanceId + '-folder-error'\">{{ _folderError }}</p>\n }\n <div class=\"dialog-actions\">\n <sd-button\n class=\"cancel-button\"\n type=\"text\"\n color=\"secondary\"\n size=\"md\"\n [title]=\"'core.component.file-explorer.cancel' | sdTranslate\"\n (click)=\"closeFolderDialog()\" />\n <sd-button\n class=\"submit-button\"\n type=\"fill\"\n color=\"primary\"\n size=\"md\"\n htmlType=\"submit\"\n [title]=\"'core.component.file-explorer.create' | sdTranslate\"\n [disabled]=\"!_folderName.trim()\"\n [loading]=\"folderSubmitting()\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-folder-submit' : null\" />\n </div>\n </form>\n}\n\n@if (_shareItem) {\n @let _shareState = shareState();\n <div class=\"dialog-backdrop\" aria-hidden=\"true\" (click)=\"closeShare()\"></div>\n <div\n #shareDialog\n class=\"dialog\"\n role=\"dialog\"\n aria-modal=\"true\"\n tabindex=\"-1\"\n [attr.aria-labelledby]=\"instanceId + '-share-title'\"\n [attr.aria-busy]=\"_shareState.status === 'loading' ? true : null\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-share-dialog' : null\">\n <h3 class=\"dialog-title\" [id]=\"instanceId + '-share-title'\" [title]=\"_shareItem.name\">{{ shareTitle() }}</h3>\n @switch (_shareState.status) {\n @case ('loading') {\n <p class=\"share-status\" role=\"status\">\n <span class=\"spinner\" aria-hidden=\"true\"></span>\n {{ 'core.component.file-explorer.share.loading' | sdTranslate }}\n </p>\n }\n @case ('error') {\n <p class=\"field-error\" role=\"alert\">{{ _shareState.message }}</p>\n }\n @case ('ready') {\n <label class=\"field-label\" [for]=\"instanceId + '-share-link'\">{{ 'core.component.file-explorer.share.link' | sdTranslate }}</label>\n <input\n #shareInput\n class=\"field-input\"\n readonly\n [id]=\"instanceId + '-share-link'\"\n [value]=\"_shareState.url\"\n [attr.aria-describedby]=\"instanceId + '-share-feedback'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-share-link' : null\"\n (focus)=\"shareInput.select()\" />\n <p class=\"share-feedback\" role=\"status\" aria-live=\"polite\" [id]=\"instanceId + '-share-feedback'\">{{ shareFeedbackLabel() }}</p>\n }\n }\n <div class=\"dialog-actions\">\n <sd-button\n class=\"close-button\"\n type=\"text\"\n color=\"secondary\"\n size=\"md\"\n [title]=\"'core.component.file-explorer.close' | sdTranslate\"\n (click)=\"closeShare()\" />\n @if (_shareState.status === 'error') {\n <sd-button\n class=\"retry-button\"\n type=\"outline\"\n color=\"primary\"\n size=\"md\"\n prefixIcon=\"refresh\"\n [title]=\"'core.component.file-explorer.retry' | sdTranslate\"\n (click)=\"retryShare()\" />\n } @else {\n <sd-button\n #copyButton\n class=\"copy-button\"\n type=\"fill\"\n color=\"primary\"\n size=\"md\"\n prefixIcon=\"content_copy\"\n [title]=\"\n (shareFeedback() === 'copied' ? 'core.component.file-explorer.share.copied' : 'core.component.file-explorer.share.copy')\n | sdTranslate\n \"\n [disabled]=\"_shareState.status !== 'ready'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-share-copy' : null\"\n (click)=\"copyShareLink()\" />\n }\n </div>\n </div>\n}\n", styles: [":host{--sd-fe-accent: var(--sd-file-explorer-accent, var(--sd-primary, #005cbb));--sd-fe-accent-strong: var(--sd-file-explorer-accent-strong, color-mix(in srgb, var(--sd-fe-accent) 84%, #000000));--sd-fe-accent-contrast: var(--sd-file-explorer-accent-contrast, var(--sd-primary-contrast, #ffffff));--sd-fe-accent-soft: var(--sd-file-explorer-accent-soft, color-mix(in srgb, var(--sd-fe-accent) 10%, #ffffff));--sd-fe-surface: var(--sd-file-explorer-surface, #ffffff);--sd-fe-sidebar-bg: var(--sd-file-explorer-sidebar-bg, color-mix(in srgb, var(--sd-surface-muted, #e7e8ed) 26%, var(--sd-fe-surface)));--sd-fe-muted-surface: var( --sd-file-explorer-muted-surface, color-mix(in srgb, var(--sd-surface-muted, #e7e8ed) 50%, var(--sd-fe-surface)) );--sd-fe-preview-bg: var(--sd-file-explorer-preview-bg, color-mix(in srgb, var(--sd-fe-accent) 9%, #ffffff));--sd-fe-border: var(--sd-file-explorer-border, color-mix(in srgb, var(--sd-border, #c4c6d0) 55%, #ffffff));--sd-fe-border-strong: var(--sd-file-explorer-border-strong, var(--sd-border, #c4c6d0));--sd-fe-text: var(--sd-file-explorer-text, var(--sd-text, #1a1b1f));--sd-fe-text-secondary: var(--sd-file-explorer-text-secondary, color-mix(in srgb, var(--sd-text-secondary, #44474f) 84%, #ffffff));--sd-fe-hover: color-mix(in srgb, var(--sd-fe-text) 4%, transparent);--sd-fe-hover-strong: color-mix(in srgb, var(--sd-fe-text) 8%, transparent);--sd-fe-track: color-mix(in srgb, var(--sd-fe-text) 7%, var(--sd-fe-surface));--sd-fe-success: var(--sd-file-explorer-success, var(--sd-success, #2e7d32));--sd-fe-error: var(--sd-file-explorer-error, var(--sd-error, #ba1a1a));--sd-fe-radius: var(--sd-file-explorer-radius, 16px);--sd-fe-scrim: var(--sd-file-explorer-scrim, rgba(0, 0, 0, .4));--sd-side-drawer-contained-z-index: 9;position:relative;display:flex;flex-direction:column;height:100%;min-height:480px;overflow:hidden;border:1px solid var(--sd-fe-border);border-radius:var(--sd-fe-radius);background:var(--sd-fe-surface);color:var(--sd-fe-text);font-size:14px;line-height:20px}.header{display:grid;grid-template-columns:fit-content(320px) minmax(0,1fr) auto;align-items:center;gap:12px 20px;padding:16px 20px;border-bottom:1px solid var(--sd-fe-border)}.brand{grid-column:1;display:flex;align-items:center;gap:10px;min-width:0}.brand-icon{flex:none;display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:color-mix(in srgb,var(--sd-fe-accent) 14%,#ffffff);color:var(--sd-fe-accent)}.brand-text{min-width:0}.brand-title{margin:0;overflow:hidden;font-size:16px;font-weight:600;line-height:22px;text-overflow:ellipsis;white-space:nowrap}.brand-description{margin:0;overflow:hidden;font-size:12px;line-height:16px;color:var(--sd-fe-text-secondary);text-overflow:ellipsis;white-space:nowrap}.search{grid-column:2;justify-self:center;display:flex;align-items:center;gap:8px;width:100%;max-width:520px;height:36px;padding:0 6px 0 12px;border:1px solid var(--sd-fe-border);border-radius:999px;background:var(--sd-fe-muted-surface);transition:border-color .12s ease,box-shadow .12s ease}.search:focus-within{border-color:var(--sd-fe-accent);background:var(--sd-fe-surface);box-shadow:0 0 0 3px var(--sd-fe-accent-soft)}.search-icon{flex:none;color:var(--sd-fe-text-secondary)}.search-input{flex:1;min-width:0;height:100%;padding:0;border:0;outline:none;background:transparent;color:var(--sd-fe-text);font:inherit;font-size:14px}.search-input::placeholder{color:var(--sd-fe-text-secondary)}.search-input::-webkit-search-cancel-button{display:none}.search-clear{flex:none;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;border:0;border-radius:999px;background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.search-clear:hover{background:var(--sd-fe-hover-strong)}.upload-button{grid-column:3;justify-self:end}.file-input{display:none}.body{position:relative;flex:1;min-height:0;display:grid;grid-template-columns:238px minmax(0,1fr)}.sidebar{display:flex;flex-direction:column;min-height:0;padding:22px 14px 32px 12px;border-right:1px solid var(--sd-fe-border);background:var(--sd-fe-sidebar-bg)}.sidebar-label{margin:0 0 6px 10px;font-size:12px;font-weight:700;line-height:16px;letter-spacing:.04em;text-transform:uppercase;color:var(--sd-fe-text-secondary)}.sidebar-tree{flex:1;min-height:0;margin:0 -4px;padding:2px 4px;overflow-y:auto}.sidebar-footer{margin:12px 4px 0;padding-top:18px;border-top:1px solid var(--sd-fe-border)}.new-folder-button{display:block}.main{position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;padding-top:14px}.refresh-bar{position:absolute;top:0;left:0;right:0;height:2px;overflow:hidden;background:var(--sd-fe-accent-soft)}.refresh-bar:after{content:\"\";position:absolute;top:0;bottom:0;width:30%;background:var(--sd-fe-accent);animation:sd-file-explorer-refresh 1.2s ease-in-out infinite}.toolbar{display:flex;align-items:center;gap:12px;min-height:40px;padding:0 32px}.breadcrumb{flex:1;min-width:0;margin-left:-4px;font-size:15px;font-weight:600}.view-toggle{flex:none;display:flex;gap:2px;padding:2px;border:1px solid var(--sd-fe-border);border-radius:999px;background:var(--sd-fe-surface)}.icon-button{flex:none;display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:0;border-radius:999px;background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.icon-button:hover{background:var(--sd-fe-hover-strong);color:var(--sd-fe-text)}.icon-button:focus-visible{outline:2px solid var(--sd-fe-accent);outline-offset:1px}.icon-button--toggle{width:40px;height:32px}.icon-button--active,.icon-button--active:hover{background:var(--sd-fe-accent-soft);color:var(--sd-fe-accent)}.heading-row{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-top:10px;padding:0 32px}.heading{min-width:0;margin:0;overflow:hidden;font-size:18px;font-weight:700;line-height:26px;text-overflow:ellipsis;white-space:nowrap}.count{flex:none;padding-bottom:12px;font-size:13px;color:var(--sd-fe-text-secondary)}.scroller{flex:1;min-height:0;padding:8px 28px 16px;overflow-y:auto}.scrim{position:absolute;inset:0;background:var(--sd-fe-scrim);animation:sd-file-explorer-fade .18s ease}.transfers{flex:none;border-top:1px solid var(--sd-fe-border);background:var(--sd-fe-surface)}.drop-overlay{position:absolute;inset:0;z-index:10;display:flex;align-items:center;justify-content:center;padding:16px;border:2px dashed var(--sd-fe-accent);border-radius:var(--sd-fe-radius);background:color-mix(in srgb,var(--sd-fe-accent) 8%,rgba(255,255,255,.86));pointer-events:none}.drop-card{display:flex;flex-direction:column;align-items:center;gap:10px;color:var(--sd-fe-accent);text-align:center}.drop-title{margin:0;font-size:16px;font-weight:600}.dialog-backdrop{position:absolute;inset:0;z-index:20;background:var(--sd-fe-scrim)}.dialog{position:absolute;top:50%;left:50%;z-index:21;display:flex;flex-direction:column;gap:8px;width:min(400px,100% - 32px);padding:20px;border-radius:14px;background:var(--sd-fe-surface);box-shadow:0 18px 48px #0f172a2e;transform:translate(-50%,-50%)}.dialog:focus{outline:none}.dialog-title{margin:0 0 8px;font-size:17px;font-weight:600;line-height:24px}.field-label{font-size:13px;color:var(--sd-fe-text-secondary)}.field-input{height:40px;padding:0 12px;border:1px solid var(--sd-fe-border-strong);border-radius:8px;background:var(--sd-fe-surface);color:var(--sd-fe-text);font:inherit;font-size:15px;outline:none}.field-input:focus{border-color:var(--sd-fe-accent);box-shadow:0 0 0 3px var(--sd-fe-accent-soft)}.field-input[aria-invalid=true]{border-color:var(--sd-fe-error)}.field-error{margin:0;font-size:13px;color:var(--sd-fe-error)}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}.share-status{display:flex;align-items:center;gap:10px;margin:4px 0;font-size:14px;color:var(--sd-fe-text-secondary)}.share-feedback{min-height:18px;margin:0;font-size:13px;line-height:18px;color:var(--sd-fe-success)}.spinner{flex:none;width:18px;height:18px;border:2px solid color-mix(in srgb,var(--sd-fe-accent) 20%,transparent);border-top-color:var(--sd-fe-accent);border-radius:50%;animation:sd-file-explorer-spin .8s linear infinite}:host(.sd-file-explorer--compact) .header{grid-template-columns:minmax(0,1fr) auto;gap:10px 12px;padding:12px 14px}:host(.sd-file-explorer--compact) .brand{grid-row:1;gap:10px}:host(.sd-file-explorer--compact) .upload-button{grid-column:2;grid-row:1}:host(.sd-file-explorer--compact) .search{grid-column:1/-1;grid-row:2;max-width:none}:host(.sd-file-explorer--compact) .header:not(:has(.brand)) .search{grid-column:1;grid-row:1}:host(.sd-file-explorer--compact) .body{grid-template-columns:minmax(0,1fr)}:host(.sd-file-explorer--compact) .sidebar{position:absolute;top:0;bottom:0;left:0;z-index:5;width:min(300px,86%);border-right:1px solid var(--sd-fe-border);box-shadow:12px 0 32px #0f172a1f;visibility:hidden;transform:translate(-100%);transition:transform .2s ease,visibility .2s}:host(.sd-file-explorer--compact) .sidebar--open{visibility:visible;transform:none}:host(.sd-file-explorer--compact) .scrim--sidebar{z-index:4}:host(.sd-file-explorer--compact) .main{padding-top:8px}:host(.sd-file-explorer--compact) .toolbar{gap:6px;min-height:36px;padding:0 12px 0 10px}:host(.sd-file-explorer--compact) .breadcrumb{margin-left:0}:host(.sd-file-explorer--compact) .icon-button--toggle{width:36px}:host(.sd-file-explorer--compact) .heading-row{margin-top:13px;padding:0 14px}:host(.sd-file-explorer--compact) .count{padding-bottom:8px}:host(.sd-file-explorer--compact) .scroller{padding:0 12px 12px}@keyframes sd-file-explorer-spin{to{transform:rotate(360deg)}}@keyframes sd-file-explorer-fade{0%{opacity:0}}@keyframes sd-file-explorer-refresh{0%{left:-30%}to{left:100%}}@media(prefers-reduced-motion:reduce){.scrim{animation:none}.search,:host(.sd-file-explorer--compact) .sidebar{transition:none}}\n"], dependencies: [{ kind: "component", type: SdIcon, selector: "sd-icon", inputs: ["name", "fontIcon", "color", "set", "fontSet", "size", "strokeWidth", "absoluteStrokeWidth", "ariaLabel"] }, { kind: "component", type: SdBreadcrumb, selector: "sd-breadcrumb", inputs: ["items", "maxItems", "ariaLabel", "separator"], outputs: ["sdItemActivate"] }, { 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: SdDataState, selector: "sd-data-state", inputs: ["state", "title", "message", "icon", "fontSet", "retryable", "retryLabel", "actionLabel", "compact", "fullPage"], outputs: ["sdRetry", "sdAction"] }, { kind: "component", type: SdFileExplorerFolderTree, selector: "sd-file-explorer-folder-tree", inputs: ["nodes", "label"], outputs: ["select", "toggle", "retry"] }, { kind: "component", type: SdFileExplorerItemList, selector: "sd-file-explorer-item-list", inputs: ["items", "view", "canDownload", "canShare", "compact", "activeId", "label"], outputs: ["activate", "download", "share"] }, { kind: "component", type: SdFileExplorerPreviewPanel, selector: "sd-file-explorer-preview-panel", inputs: ["view", "state", "meta", "canDownload", "canShare", "container", "autoId"], outputs: ["close", "download", "share", "retry", "imageError"] }, { kind: "component", type: SdFileExplorerTransferPanel, selector: "sd-file-explorer-transfer-panel", inputs: ["transfers", "title", "collapsed", "canClear", "compact", "autoId"], outputs: ["toggleCollapsed", "clear", "cancel", "retry", "dismiss"] }, { kind: "pipe", type: SdTranslatePipe, name: "sdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
2648
+ }
2649
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: SdFileExplorer, decorators: [{
2650
+ type: Component,
2651
+ args: [{ selector: 'sd-file-explorer', standalone: true, imports: [
2652
+ SdIcon,
2653
+ SdTranslatePipe,
2654
+ SdBreadcrumb,
2655
+ SdButton,
2656
+ SdDataState,
2657
+ SdFileExplorerFolderTree,
2658
+ SdFileExplorerItemList,
2659
+ SdFileExplorerPreviewPanel,
2660
+ SdFileExplorerTransferPanel,
2661
+ ], changeDetection: ChangeDetectionStrategy.OnPush, host: {
2662
+ class: 'sd-file-explorer',
2663
+ '[class.sd-file-explorer--compact]': 'compact()',
2664
+ '[class.sd-file-explorer--dragging]': 'dragActive()',
2665
+ '[attr.data-autoid]': 'autoId()',
2666
+ '(dragenter)': 'onDragEnter($event)',
2667
+ '(dragover)': 'onDragOver($event)',
2668
+ '(dragleave)': 'onDragLeave()',
2669
+ '(drop)': 'onDrop($event)',
2670
+ '(keydown.escape)': 'onEscape($event)',
2671
+ }, template: "@let _option = option();\n@let _compact = compact();\n@let _autoId = autoId();\n@let _canUpload = canUpload();\n@let _canDownload = canDownload();\n@let _view = view();\n@let _state = contentState();\n@let _keyword = keyword();\n@let _sidebarOpen = sidebarOpen();\n@let _preview = previewView();\n@let _transfers = transferViews();\n@let _heading = heading();\n@let _searching = searching();\n@let _collapsed = transfersCollapsed();\n@let _dialogOpen = folderDialogOpen();\n@let _shareItem = shareItem();\n@let _canShare = canShare();\n@let _modalOpen = _dialogOpen || !!_shareItem;\n\n<header class=\"header\" [attr.inert]=\"_modalOpen ? '' : null\">\n @if (_option.title) {\n <div class=\"brand\">\n <span class=\"brand-icon\" aria-hidden=\"true\">\n <sd-icon name=\"folder\" size=\"20px\" />\n </span>\n <div class=\"brand-text\">\n <h2 class=\"brand-title\" [title]=\"_option.title\">{{ _option.title }}</h2>\n @if (_option.description) {\n <p class=\"brand-description\">{{ _option.description }}</p>\n }\n </div>\n </div>\n }\n\n <div class=\"search\" role=\"search\">\n <sd-icon class=\"search-icon\" name=\"search\" size=\"20px\" />\n <input\n #searchInput\n type=\"search\"\n class=\"search-input\"\n autocomplete=\"off\"\n [value]=\"_keyword\"\n [placeholder]=\"'core.component.file-explorer.search-placeholder' | sdTranslate\"\n [attr.aria-label]=\"'core.component.file-explorer.search-placeholder' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-search' : null\"\n (input)=\"onKeywordInput(searchInput.value)\" />\n @if (_keyword) {\n <button\n type=\"button\"\n class=\"search-clear\"\n [attr.aria-label]=\"'core.component.file-explorer.search-clear' | sdTranslate\"\n [title]=\"'core.component.file-explorer.search-clear' | sdTranslate\"\n (click)=\"clearSearch()\">\n <sd-icon name=\"close\" size=\"18px\" />\n </button>\n }\n </div>\n\n @if (_canUpload) {\n <sd-button\n class=\"upload-button\"\n type=\"fill\"\n color=\"primary\"\n size=\"md\"\n prefixIcon=\"file_upload\"\n [title]=\"_compact ? undefined : ('core.component.file-explorer.upload' | sdTranslate)\"\n [tooltip]=\"_compact ? ('core.component.file-explorer.upload' | sdTranslate) : undefined\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-upload' : null\"\n (click)=\"fileInput.click()\" />\n <input\n #fileInput\n type=\"file\"\n class=\"file-input\"\n multiple\n tabindex=\"-1\"\n aria-hidden=\"true\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-file-input' : null\"\n (change)=\"onFilesPicked(fileInput)\" />\n }\n</header>\n\n<!-- why: dialog ph\u1EE7 c\u1EA3 explorer n\u00EAn l\u00E0m inert c\u1EA3 v\u00F9ng n\u00E0y, k\u1EC3 c\u1EA3 drawer chi ti\u1EBFt \u0111ang n\u1EB1m trong .main. -->\n<div class=\"body\" [attr.inert]=\"_modalOpen ? '' : null\">\n @if (_compact && _sidebarOpen) {\n <div class=\"scrim scrim--sidebar\" aria-hidden=\"true\" (click)=\"sidebarOpen.set(false)\"></div>\n }\n <aside\n #sidebar\n class=\"sidebar\"\n [class.sidebar--open]=\"_sidebarOpen\"\n [id]=\"instanceId + '-sidebar'\"\n [attr.aria-label]=\"'core.component.file-explorer.folders' | sdTranslate\"\n [attr.inert]=\"_compact && !_sidebarOpen ? '' : null\">\n <p class=\"sidebar-label\">{{ 'core.component.file-explorer.folders' | sdTranslate }}</p>\n <div class=\"sidebar-tree\">\n <sd-file-explorer-folder-tree\n [nodes]=\"treeNodes()\"\n [label]=\"'core.component.file-explorer.tree-label' | sdTranslate\"\n (select)=\"onTreeSelect($event)\"\n (toggle)=\"onTreeToggle($event)\"\n (retry)=\"onTreeRetry($event)\" />\n </div>\n @if (canCreateFolder()) {\n <div class=\"sidebar-footer\">\n <sd-button\n #newFolderButton\n class=\"new-folder-button\"\n type=\"outline\"\n color=\"secondary\"\n size=\"md\"\n prefixIcon=\"add\"\n block\n [title]=\"'core.component.file-explorer.new-folder' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-new-folder' : null\"\n (click)=\"openFolderDialog()\" />\n </div>\n }\n </aside>\n\n <!-- why: .main l\u00E0 [container] c\u1EE7a drawer chi ti\u1EBFt \u2014 backdrop ch\u1EC9 ph\u1EE7 v\u00F9ng b\u00EAn ph\u1EA3i, c\u00E2y th\u01B0 m\u1EE5c v\u1EABn d\u00F9ng \u0111\u01B0\u1EE3c.\n Drawer n\u1EB1m TRONG ph\u1EA7n t\u1EED n\u00E0y n\u00EAn inert \u0111\u1EB7t tr\u00EAn t\u1EEBng kh\u1ED1i con, kh\u00F4ng \u0111\u1EB7t tr\u00EAn .main. -->\n <section #mainRegion class=\"main\" [attr.aria-label]=\"_heading\">\n @if (refreshing()) {\n <div class=\"refresh-bar\" aria-hidden=\"true\"></div>\n }\n <div class=\"toolbar\" [attr.inert]=\"_preview ? '' : null\">\n @if (_compact) {\n <button\n type=\"button\"\n class=\"icon-button\"\n [attr.aria-expanded]=\"_sidebarOpen\"\n [attr.aria-controls]=\"instanceId + '-sidebar'\"\n [attr.aria-label]=\"\n (_sidebarOpen ? 'core.component.file-explorer.close-folders' : 'core.component.file-explorer.open-folders') | sdTranslate\n \"\n [attr.data-autoid]=\"_autoId ? _autoId + '-menu' : null\"\n (click)=\"toggleSidebar()\">\n <sd-icon name=\"menu\" size=\"24px\" />\n </button>\n }\n <sd-breadcrumb\n class=\"breadcrumb\"\n [items]=\"breadcrumb().items\"\n [maxItems]=\"_compact ? 3 : 5\"\n [ariaLabel]=\"'core.component.file-explorer.breadcrumb' | sdTranslate\"\n (sdItemActivate)=\"onBreadcrumb($event)\" />\n <div class=\"view-toggle\" role=\"group\" [attr.aria-label]=\"'core.component.file-explorer.view' | sdTranslate\">\n <button\n type=\"button\"\n class=\"icon-button icon-button--toggle\"\n [class.icon-button--active]=\"_view === 'list'\"\n [attr.aria-pressed]=\"_view === 'list'\"\n [attr.aria-label]=\"'core.component.file-explorer.view-list' | sdTranslate\"\n [title]=\"'core.component.file-explorer.view-list' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-view-list' : null\"\n (click)=\"setView('list')\">\n <sd-icon name=\"format_list_bulleted\" size=\"24px\" />\n </button>\n <button\n type=\"button\"\n class=\"icon-button icon-button--toggle\"\n [class.icon-button--active]=\"_view === 'grid'\"\n [attr.aria-pressed]=\"_view === 'grid'\"\n [attr.aria-label]=\"'core.component.file-explorer.view-grid' | sdTranslate\"\n [title]=\"'core.component.file-explorer.view-grid' | sdTranslate\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-view-grid' : null\"\n (click)=\"setView('grid')\">\n <sd-icon name=\"grid_view\" size=\"24px\" />\n </button>\n </div>\n </div>\n\n <div class=\"heading-row\" [attr.inert]=\"_preview ? '' : null\">\n <h3 class=\"heading\" [title]=\"_heading\">{{ _heading }}</h3>\n @if (_state === 'items') {\n <span class=\"count\">{{ itemCountLabel() }}</span>\n }\n </div>\n\n <div class=\"scroller\" [attr.inert]=\"_preview ? '' : null\">\n @switch (_state) {\n @case ('loading') {\n <sd-data-state\n state=\"loading\"\n compact\n [title]=\"(_searching ? 'core.component.file-explorer.search-loading' : 'core.component.file-explorer.loading') | sdTranslate\" />\n }\n @case ('error') {\n <sd-data-state\n state=\"error\"\n retryable\n [title]=\"(_searching ? 'core.component.file-explorer.search-error' : 'core.component.file-explorer.load-error') | sdTranslate\"\n [message]=\"errorMessage()\"\n [retryLabel]=\"'core.component.file-explorer.retry' | sdTranslate\"\n (sdRetry)=\"retryContent()\" />\n }\n @case ('empty') {\n <sd-data-state\n state=\"empty\"\n [icon]=\"_searching ? 'search_off' : 'folder_open'\"\n [title]=\"emptyTitle()\"\n [message]=\"emptyMessage()\" />\n }\n @default {\n <sd-file-explorer-item-list\n [items]=\"itemViews()\"\n [view]=\"_view\"\n [canDownload]=\"_canDownload\"\n [canShare]=\"_canShare\"\n [compact]=\"_compact\"\n [activeId]=\"_preview ? _preview.item.id : null\"\n [label]=\"_heading\"\n (activate)=\"onActivate($event)\"\n (download)=\"downloadItem($event.item)\"\n (share)=\"openShare($event.item)\" />\n }\n }\n </div>\n </section>\n</div>\n\n@if (_transfers.length) {\n <sd-file-explorer-transfer-panel\n class=\"transfers\"\n [attr.inert]=\"_modalOpen ? '' : null\"\n [transfers]=\"_transfers\"\n [title]=\"transfersTitle()\"\n [collapsed]=\"_collapsed\"\n [canClear]=\"canClearTransfers()\"\n [compact]=\"_compact\"\n [autoId]=\"_autoId ? _autoId + '-transfers' : undefined\"\n (toggleCollapsed)=\"transfersCollapsed.set(!_collapsed)\"\n (clear)=\"clearFinishedTransfers()\"\n (cancel)=\"cancelTransfer($event)\"\n (retry)=\"retryTransfer($event)\"\n (dismiss)=\"dismissTransfer($event)\" />\n}\n\n<!-- why: chi ti\u1EBFt file l\u00E0 sd-side-drawer th\u1EADt, m\u1EDF g\u1ECDn trong v\u00F9ng danh s\u00E1ch b\u00EAn ph\u1EA3i nh\u1EDD [container]:\n header (t\u00ECm ki\u1EBFm, t\u1EA3i l\u00EAn), c\u00E2y th\u01B0 m\u1EE5c v\u00E0 h\u00E0ng ch\u1EDD truy\u1EC1n t\u1EA3i v\u1EABn d\u00F9ng \u0111\u01B0\u1EE3c khi drawer m\u1EDF. -->\n<sd-file-explorer-preview-panel\n [view]=\"_preview\"\n [state]=\"previewState()\"\n [meta]=\"previewMeta()\"\n [canDownload]=\"_canDownload\"\n [canShare]=\"_canShare\"\n [container]=\"mainRegion\"\n [autoId]=\"_autoId ? _autoId + '-preview' : undefined\"\n (close)=\"closePreview()\"\n (download)=\"downloadPreview()\"\n (share)=\"sharePreview()\"\n (retry)=\"retryPreview()\"\n (imageError)=\"onPreviewImageError()\" />\n\n@if (dragActive()) {\n <div class=\"drop-overlay\" aria-hidden=\"true\">\n <div class=\"drop-card\">\n <sd-icon name=\"file_upload\" size=\"40px\" />\n <p class=\"drop-title\">{{ dropTitle() }}</p>\n </div>\n </div>\n}\n\n@if (_dialogOpen) {\n @let _folderName = folderName();\n @let _folderError = folderError();\n <div class=\"dialog-backdrop\" aria-hidden=\"true\" (click)=\"closeFolderDialog()\"></div>\n <form\n class=\"dialog\"\n role=\"dialog\"\n aria-modal=\"true\"\n novalidate\n [attr.aria-labelledby]=\"instanceId + '-folder-title'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-folder-dialog' : null\"\n (submit)=\"submitFolder($event)\">\n <h3 class=\"dialog-title\" [id]=\"instanceId + '-folder-title'\">{{ folderDialogTitle() }}</h3>\n <label class=\"field-label\" [for]=\"instanceId + '-folder-name'\">{{\n 'core.component.file-explorer.new-folder-name' | sdTranslate\n }}</label>\n <input\n #folderInput\n class=\"field-input\"\n autocomplete=\"off\"\n maxlength=\"255\"\n [id]=\"instanceId + '-folder-name'\"\n [value]=\"_folderName\"\n [attr.aria-invalid]=\"_folderError ? true : null\"\n [attr.aria-describedby]=\"_folderError ? instanceId + '-folder-error' : null\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-folder-name' : null\"\n (input)=\"folderName.set(folderInput.value)\" />\n @if (_folderError) {\n <p class=\"field-error\" role=\"alert\" [id]=\"instanceId + '-folder-error'\">{{ _folderError }}</p>\n }\n <div class=\"dialog-actions\">\n <sd-button\n class=\"cancel-button\"\n type=\"text\"\n color=\"secondary\"\n size=\"md\"\n [title]=\"'core.component.file-explorer.cancel' | sdTranslate\"\n (click)=\"closeFolderDialog()\" />\n <sd-button\n class=\"submit-button\"\n type=\"fill\"\n color=\"primary\"\n size=\"md\"\n htmlType=\"submit\"\n [title]=\"'core.component.file-explorer.create' | sdTranslate\"\n [disabled]=\"!_folderName.trim()\"\n [loading]=\"folderSubmitting()\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-folder-submit' : null\" />\n </div>\n </form>\n}\n\n@if (_shareItem) {\n @let _shareState = shareState();\n <div class=\"dialog-backdrop\" aria-hidden=\"true\" (click)=\"closeShare()\"></div>\n <div\n #shareDialog\n class=\"dialog\"\n role=\"dialog\"\n aria-modal=\"true\"\n tabindex=\"-1\"\n [attr.aria-labelledby]=\"instanceId + '-share-title'\"\n [attr.aria-busy]=\"_shareState.status === 'loading' ? true : null\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-share-dialog' : null\">\n <h3 class=\"dialog-title\" [id]=\"instanceId + '-share-title'\" [title]=\"_shareItem.name\">{{ shareTitle() }}</h3>\n @switch (_shareState.status) {\n @case ('loading') {\n <p class=\"share-status\" role=\"status\">\n <span class=\"spinner\" aria-hidden=\"true\"></span>\n {{ 'core.component.file-explorer.share.loading' | sdTranslate }}\n </p>\n }\n @case ('error') {\n <p class=\"field-error\" role=\"alert\">{{ _shareState.message }}</p>\n }\n @case ('ready') {\n <label class=\"field-label\" [for]=\"instanceId + '-share-link'\">{{ 'core.component.file-explorer.share.link' | sdTranslate }}</label>\n <input\n #shareInput\n class=\"field-input\"\n readonly\n [id]=\"instanceId + '-share-link'\"\n [value]=\"_shareState.url\"\n [attr.aria-describedby]=\"instanceId + '-share-feedback'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-share-link' : null\"\n (focus)=\"shareInput.select()\" />\n <p class=\"share-feedback\" role=\"status\" aria-live=\"polite\" [id]=\"instanceId + '-share-feedback'\">{{ shareFeedbackLabel() }}</p>\n }\n }\n <div class=\"dialog-actions\">\n <sd-button\n class=\"close-button\"\n type=\"text\"\n color=\"secondary\"\n size=\"md\"\n [title]=\"'core.component.file-explorer.close' | sdTranslate\"\n (click)=\"closeShare()\" />\n @if (_shareState.status === 'error') {\n <sd-button\n class=\"retry-button\"\n type=\"outline\"\n color=\"primary\"\n size=\"md\"\n prefixIcon=\"refresh\"\n [title]=\"'core.component.file-explorer.retry' | sdTranslate\"\n (click)=\"retryShare()\" />\n } @else {\n <sd-button\n #copyButton\n class=\"copy-button\"\n type=\"fill\"\n color=\"primary\"\n size=\"md\"\n prefixIcon=\"content_copy\"\n [title]=\"\n (shareFeedback() === 'copied' ? 'core.component.file-explorer.share.copied' : 'core.component.file-explorer.share.copy')\n | sdTranslate\n \"\n [disabled]=\"_shareState.status !== 'ready'\"\n [attr.data-autoid]=\"_autoId ? _autoId + '-share-copy' : null\"\n (click)=\"copyShareLink()\" />\n }\n </div>\n </div>\n}\n", styles: [":host{--sd-fe-accent: var(--sd-file-explorer-accent, var(--sd-primary, #005cbb));--sd-fe-accent-strong: var(--sd-file-explorer-accent-strong, color-mix(in srgb, var(--sd-fe-accent) 84%, #000000));--sd-fe-accent-contrast: var(--sd-file-explorer-accent-contrast, var(--sd-primary-contrast, #ffffff));--sd-fe-accent-soft: var(--sd-file-explorer-accent-soft, color-mix(in srgb, var(--sd-fe-accent) 10%, #ffffff));--sd-fe-surface: var(--sd-file-explorer-surface, #ffffff);--sd-fe-sidebar-bg: var(--sd-file-explorer-sidebar-bg, color-mix(in srgb, var(--sd-surface-muted, #e7e8ed) 26%, var(--sd-fe-surface)));--sd-fe-muted-surface: var( --sd-file-explorer-muted-surface, color-mix(in srgb, var(--sd-surface-muted, #e7e8ed) 50%, var(--sd-fe-surface)) );--sd-fe-preview-bg: var(--sd-file-explorer-preview-bg, color-mix(in srgb, var(--sd-fe-accent) 9%, #ffffff));--sd-fe-border: var(--sd-file-explorer-border, color-mix(in srgb, var(--sd-border, #c4c6d0) 55%, #ffffff));--sd-fe-border-strong: var(--sd-file-explorer-border-strong, var(--sd-border, #c4c6d0));--sd-fe-text: var(--sd-file-explorer-text, var(--sd-text, #1a1b1f));--sd-fe-text-secondary: var(--sd-file-explorer-text-secondary, color-mix(in srgb, var(--sd-text-secondary, #44474f) 84%, #ffffff));--sd-fe-hover: color-mix(in srgb, var(--sd-fe-text) 4%, transparent);--sd-fe-hover-strong: color-mix(in srgb, var(--sd-fe-text) 8%, transparent);--sd-fe-track: color-mix(in srgb, var(--sd-fe-text) 7%, var(--sd-fe-surface));--sd-fe-success: var(--sd-file-explorer-success, var(--sd-success, #2e7d32));--sd-fe-error: var(--sd-file-explorer-error, var(--sd-error, #ba1a1a));--sd-fe-radius: var(--sd-file-explorer-radius, 16px);--sd-fe-scrim: var(--sd-file-explorer-scrim, rgba(0, 0, 0, .4));--sd-side-drawer-contained-z-index: 9;position:relative;display:flex;flex-direction:column;height:100%;min-height:480px;overflow:hidden;border:1px solid var(--sd-fe-border);border-radius:var(--sd-fe-radius);background:var(--sd-fe-surface);color:var(--sd-fe-text);font-size:14px;line-height:20px}.header{display:grid;grid-template-columns:fit-content(320px) minmax(0,1fr) auto;align-items:center;gap:12px 20px;padding:16px 20px;border-bottom:1px solid var(--sd-fe-border)}.brand{grid-column:1;display:flex;align-items:center;gap:10px;min-width:0}.brand-icon{flex:none;display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:color-mix(in srgb,var(--sd-fe-accent) 14%,#ffffff);color:var(--sd-fe-accent)}.brand-text{min-width:0}.brand-title{margin:0;overflow:hidden;font-size:16px;font-weight:600;line-height:22px;text-overflow:ellipsis;white-space:nowrap}.brand-description{margin:0;overflow:hidden;font-size:12px;line-height:16px;color:var(--sd-fe-text-secondary);text-overflow:ellipsis;white-space:nowrap}.search{grid-column:2;justify-self:center;display:flex;align-items:center;gap:8px;width:100%;max-width:520px;height:36px;padding:0 6px 0 12px;border:1px solid var(--sd-fe-border);border-radius:999px;background:var(--sd-fe-muted-surface);transition:border-color .12s ease,box-shadow .12s ease}.search:focus-within{border-color:var(--sd-fe-accent);background:var(--sd-fe-surface);box-shadow:0 0 0 3px var(--sd-fe-accent-soft)}.search-icon{flex:none;color:var(--sd-fe-text-secondary)}.search-input{flex:1;min-width:0;height:100%;padding:0;border:0;outline:none;background:transparent;color:var(--sd-fe-text);font:inherit;font-size:14px}.search-input::placeholder{color:var(--sd-fe-text-secondary)}.search-input::-webkit-search-cancel-button{display:none}.search-clear{flex:none;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;padding:0;border:0;border-radius:999px;background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.search-clear:hover{background:var(--sd-fe-hover-strong)}.upload-button{grid-column:3;justify-self:end}.file-input{display:none}.body{position:relative;flex:1;min-height:0;display:grid;grid-template-columns:238px minmax(0,1fr)}.sidebar{display:flex;flex-direction:column;min-height:0;padding:22px 14px 32px 12px;border-right:1px solid var(--sd-fe-border);background:var(--sd-fe-sidebar-bg)}.sidebar-label{margin:0 0 6px 10px;font-size:12px;font-weight:700;line-height:16px;letter-spacing:.04em;text-transform:uppercase;color:var(--sd-fe-text-secondary)}.sidebar-tree{flex:1;min-height:0;margin:0 -4px;padding:2px 4px;overflow-y:auto}.sidebar-footer{margin:12px 4px 0;padding-top:18px;border-top:1px solid var(--sd-fe-border)}.new-folder-button{display:block}.main{position:relative;display:flex;flex-direction:column;min-width:0;min-height:0;padding-top:14px}.refresh-bar{position:absolute;top:0;left:0;right:0;height:2px;overflow:hidden;background:var(--sd-fe-accent-soft)}.refresh-bar:after{content:\"\";position:absolute;top:0;bottom:0;width:30%;background:var(--sd-fe-accent);animation:sd-file-explorer-refresh 1.2s ease-in-out infinite}.toolbar{display:flex;align-items:center;gap:12px;min-height:40px;padding:0 32px}.breadcrumb{flex:1;min-width:0;margin-left:-4px;font-size:15px;font-weight:600}.view-toggle{flex:none;display:flex;gap:2px;padding:2px;border:1px solid var(--sd-fe-border);border-radius:999px;background:var(--sd-fe-surface)}.icon-button{flex:none;display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:0;border-radius:999px;background:transparent;color:var(--sd-fe-text-secondary);cursor:pointer}.icon-button:hover{background:var(--sd-fe-hover-strong);color:var(--sd-fe-text)}.icon-button:focus-visible{outline:2px solid var(--sd-fe-accent);outline-offset:1px}.icon-button--toggle{width:40px;height:32px}.icon-button--active,.icon-button--active:hover{background:var(--sd-fe-accent-soft);color:var(--sd-fe-accent)}.heading-row{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-top:10px;padding:0 32px}.heading{min-width:0;margin:0;overflow:hidden;font-size:18px;font-weight:700;line-height:26px;text-overflow:ellipsis;white-space:nowrap}.count{flex:none;padding-bottom:12px;font-size:13px;color:var(--sd-fe-text-secondary)}.scroller{flex:1;min-height:0;padding:8px 28px 16px;overflow-y:auto}.scrim{position:absolute;inset:0;background:var(--sd-fe-scrim);animation:sd-file-explorer-fade .18s ease}.transfers{flex:none;border-top:1px solid var(--sd-fe-border);background:var(--sd-fe-surface)}.drop-overlay{position:absolute;inset:0;z-index:10;display:flex;align-items:center;justify-content:center;padding:16px;border:2px dashed var(--sd-fe-accent);border-radius:var(--sd-fe-radius);background:color-mix(in srgb,var(--sd-fe-accent) 8%,rgba(255,255,255,.86));pointer-events:none}.drop-card{display:flex;flex-direction:column;align-items:center;gap:10px;color:var(--sd-fe-accent);text-align:center}.drop-title{margin:0;font-size:16px;font-weight:600}.dialog-backdrop{position:absolute;inset:0;z-index:20;background:var(--sd-fe-scrim)}.dialog{position:absolute;top:50%;left:50%;z-index:21;display:flex;flex-direction:column;gap:8px;width:min(400px,100% - 32px);padding:20px;border-radius:14px;background:var(--sd-fe-surface);box-shadow:0 18px 48px #0f172a2e;transform:translate(-50%,-50%)}.dialog:focus{outline:none}.dialog-title{margin:0 0 8px;font-size:17px;font-weight:600;line-height:24px}.field-label{font-size:13px;color:var(--sd-fe-text-secondary)}.field-input{height:40px;padding:0 12px;border:1px solid var(--sd-fe-border-strong);border-radius:8px;background:var(--sd-fe-surface);color:var(--sd-fe-text);font:inherit;font-size:15px;outline:none}.field-input:focus{border-color:var(--sd-fe-accent);box-shadow:0 0 0 3px var(--sd-fe-accent-soft)}.field-input[aria-invalid=true]{border-color:var(--sd-fe-error)}.field-error{margin:0;font-size:13px;color:var(--sd-fe-error)}.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}.share-status{display:flex;align-items:center;gap:10px;margin:4px 0;font-size:14px;color:var(--sd-fe-text-secondary)}.share-feedback{min-height:18px;margin:0;font-size:13px;line-height:18px;color:var(--sd-fe-success)}.spinner{flex:none;width:18px;height:18px;border:2px solid color-mix(in srgb,var(--sd-fe-accent) 20%,transparent);border-top-color:var(--sd-fe-accent);border-radius:50%;animation:sd-file-explorer-spin .8s linear infinite}:host(.sd-file-explorer--compact) .header{grid-template-columns:minmax(0,1fr) auto;gap:10px 12px;padding:12px 14px}:host(.sd-file-explorer--compact) .brand{grid-row:1;gap:10px}:host(.sd-file-explorer--compact) .upload-button{grid-column:2;grid-row:1}:host(.sd-file-explorer--compact) .search{grid-column:1/-1;grid-row:2;max-width:none}:host(.sd-file-explorer--compact) .header:not(:has(.brand)) .search{grid-column:1;grid-row:1}:host(.sd-file-explorer--compact) .body{grid-template-columns:minmax(0,1fr)}:host(.sd-file-explorer--compact) .sidebar{position:absolute;top:0;bottom:0;left:0;z-index:5;width:min(300px,86%);border-right:1px solid var(--sd-fe-border);box-shadow:12px 0 32px #0f172a1f;visibility:hidden;transform:translate(-100%);transition:transform .2s ease,visibility .2s}:host(.sd-file-explorer--compact) .sidebar--open{visibility:visible;transform:none}:host(.sd-file-explorer--compact) .scrim--sidebar{z-index:4}:host(.sd-file-explorer--compact) .main{padding-top:8px}:host(.sd-file-explorer--compact) .toolbar{gap:6px;min-height:36px;padding:0 12px 0 10px}:host(.sd-file-explorer--compact) .breadcrumb{margin-left:0}:host(.sd-file-explorer--compact) .icon-button--toggle{width:36px}:host(.sd-file-explorer--compact) .heading-row{margin-top:13px;padding:0 14px}:host(.sd-file-explorer--compact) .count{padding-bottom:8px}:host(.sd-file-explorer--compact) .scroller{padding:0 12px 12px}@keyframes sd-file-explorer-spin{to{transform:rotate(360deg)}}@keyframes sd-file-explorer-fade{0%{opacity:0}}@keyframes sd-file-explorer-refresh{0%{left:-30%}to{left:100%}}@media(prefers-reduced-motion:reduce){.scrim{animation:none}.search,:host(.sd-file-explorer--compact) .sidebar{transition:none}}\n"] }]
2672
+ }], ctorParameters: () => [], propDecorators: { option: [{ type: i0.Input, args: [{ isSignal: true, alias: "option", required: true }] }], open: [{ type: i0.Output, args: ["open"] }], searchInput: [{ type: i0.ViewChild, args: ['searchInput', { isSignal: true }] }], folderInput: [{ type: i0.ViewChild, args: ['folderInput', { isSignal: true }] }], newFolderButton: [{ type: i0.ViewChild, args: ['newFolderButton', { ...{ read: ElementRef }, isSignal: true }] }], copyButton: [{ type: i0.ViewChild, args: ['copyButton', { ...{ read: ElementRef }, isSignal: true }] }], shareInput: [{ type: i0.ViewChild, args: ['shareInput', { isSignal: true }] }], shareDialog: [{ type: i0.ViewChild, args: ['shareDialog', { isSignal: true }] }], sidebar: [{ type: i0.ViewChild, args: ['sidebar', { isSignal: true }] }] } });
2673
+
2674
+ /**
2675
+ * Generated bundle index. Do not edit.
2676
+ */
2677
+
2678
+ export { SdFileExplorer };
2679
+ //# sourceMappingURL=sdcorejs-angular-components-file-explorer.mjs.map