@ds-mo/ui 12.8.0 → 12.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/dist/.build-stamp +1 -1
  2. package/dist/agent-patterns.json +1 -1
  3. package/dist/agent.json +21 -6
  4. package/dist/angular/ds-card-overview.d.ts +1 -1
  5. package/dist/angular/ds-card-overview.js +3 -3
  6. package/dist/components/ds-agent-activity.js +1 -1
  7. package/dist/components/ds-agent-response.js +1 -1
  8. package/dist/components/ds-agent-source-list.js +1 -1
  9. package/dist/components/ds-agent-tool-call.js +1 -1
  10. package/dist/components/ds-attachment-list.js +1 -1
  11. package/dist/components/ds-badge.js +1 -1
  12. package/dist/components/ds-bar-nav.js +1 -1
  13. package/dist/components/ds-bar-title.js +1 -1
  14. package/dist/components/ds-bar-workflow.js +1 -1
  15. package/dist/components/ds-breadcrumb.js +1 -1
  16. package/dist/components/ds-button-filled.js +1 -1
  17. package/dist/components/ds-button-unfilled.js +1 -1
  18. package/dist/components/ds-card-data-viz-bar.js +1 -1
  19. package/dist/components/ds-card-data-viz-donut.js +1 -1
  20. package/dist/components/ds-card-data-viz-line.js +1 -1
  21. package/dist/components/ds-card-overview.js +1 -1
  22. package/dist/components/ds-card-overview.js.map +1 -1
  23. package/dist/components/ds-card-setting.js +1 -1
  24. package/dist/components/ds-card-shell-data-viz.js +1 -1
  25. package/dist/components/ds-chart-bar.js +1 -1
  26. package/dist/components/ds-chart-donut.js +1 -1
  27. package/dist/components/ds-chart-legend.js +1 -1
  28. package/dist/components/ds-chart-line.js +1 -1
  29. package/dist/components/ds-checkbox.js +1 -1
  30. package/dist/components/ds-chip.js +1 -1
  31. package/dist/components/ds-code-block.js +1 -1
  32. package/dist/components/ds-conversation-list-item.js +1 -1
  33. package/dist/components/ds-conversation-list-section.js +1 -1
  34. package/dist/components/ds-empty-state.js +1 -1
  35. package/dist/components/ds-field.js +1 -1
  36. package/dist/components/ds-input.js +1 -1
  37. package/dist/components/ds-markdown.js +1 -1
  38. package/dist/components/ds-menu.js +1 -1
  39. package/dist/components/ds-message-composer.js +1 -1
  40. package/dist/components/ds-message-scroller.js +1 -1
  41. package/dist/components/ds-message.js +1 -1
  42. package/dist/components/ds-mobile-bar-nav.js +1 -1
  43. package/dist/components/ds-mobile-header.js +1 -1
  44. package/dist/components/ds-mobile-section-switcher.js +1 -1
  45. package/dist/components/ds-mobile-sheet-nav.js +1 -1
  46. package/dist/components/ds-modal.js +1 -1
  47. package/dist/components/ds-panel-nav.js +1 -1
  48. package/dist/components/ds-panel-sub-nav.js +1 -1
  49. package/dist/components/ds-panel-tool-header.js +1 -1
  50. package/dist/components/ds-panel-tool-search.js +1 -1
  51. package/dist/components/ds-panel-tools.js +1 -1
  52. package/dist/components/ds-radio.js +1 -1
  53. package/dist/components/ds-select-multi.js +1 -1
  54. package/dist/components/ds-select-multi.js.map +1 -1
  55. package/dist/components/ds-select.js +1 -1
  56. package/dist/components/ds-select.js.map +1 -1
  57. package/dist/components/ds-shell-app.js +1 -1
  58. package/dist/components/ds-shell-app.js.map +1 -1
  59. package/dist/components/ds-shell-gradient-picker.js +1 -1
  60. package/dist/components/ds-shell-gradient-swatch.js +1 -1
  61. package/dist/components/ds-shell-page.js +1 -1
  62. package/dist/components/ds-shell-tools.js +1 -1
  63. package/dist/components/ds-slider.js +1 -1
  64. package/dist/components/ds-swatch-picker.js +1 -1
  65. package/dist/components/ds-tab-group.js +1 -1
  66. package/dist/components/ds-tag.js +1 -1
  67. package/dist/components/ds-text.js +1 -1
  68. package/dist/components/ds-toast.js +1 -1
  69. package/dist/components/ds-tooltip-data-viz.js +1 -1
  70. package/dist/components/ds-tooltip.js +1 -1
  71. package/dist/components/ds-typing-indicator.js +1 -1
  72. package/dist/components/{p-huw1oRbt.js → p-8GK7B7K4.js} +2 -2
  73. package/dist/components/{p-DzM3SzPz.js → p-B5tMlca-.js} +2 -2
  74. package/dist/components/{p-D0e77tkd.js → p-B88n0pO3.js} +2 -2
  75. package/dist/components/p-BBxcMVqk.js +2 -0
  76. package/dist/components/p-BBxcMVqk.js.map +1 -0
  77. package/dist/components/{p-BlHzmszE.js → p-BDKtu6Wb.js} +2 -2
  78. package/dist/components/{p-DhLmoCe_.js → p-BOCfICln.js} +2 -2
  79. package/dist/components/{p-CNgPwd11.js → p-BhV5e6vF.js} +2 -2
  80. package/dist/components/{p-ukB-dPOK.js → p-C8HU4W8q.js} +2 -2
  81. package/dist/components/{p-D9u1_OEZ.js → p-CChcuL04.js} +2 -2
  82. package/dist/components/{p-CsX3ICz7.js → p-CCzG5xDD.js} +2 -2
  83. package/dist/components/{p-B6vE3ujd.js → p-CGVXbXv9.js} +2 -2
  84. package/dist/components/p-CGVXbXv9.js.map +1 -0
  85. package/dist/components/{p-BFRMwl93.js → p-CIiBpjCn.js} +2 -2
  86. package/dist/components/{p-DB9XJm2c.js → p-CgEYdMee.js} +2 -2
  87. package/dist/components/{p-CPwpgUWT.js → p-Cr3tEx7o.js} +2 -2
  88. package/dist/components/p-Cr3tEx7o.js.map +1 -0
  89. package/dist/components/{p-Vdufoj7G.js → p-Cuih680v.js} +2 -2
  90. package/dist/components/{p-BXaieghV.js → p-Cuqxh-Tq.js} +2 -2
  91. package/dist/components/{p-Utr23NC-.js → p-DCvA3Dc9.js} +2 -2
  92. package/dist/components/{p-G3qIxpQj.js → p-DLZm_-sU.js} +2 -2
  93. package/dist/components/{p-38PfdMkF.js → p-DRnIuCiT.js} +2 -2
  94. package/dist/components/p-DjKkSqrG.js +2 -0
  95. package/dist/components/p-DjKkSqrG.js.map +1 -0
  96. package/dist/components/{p-DIFUsoM-.js → p-DlscFn2m.js} +2 -2
  97. package/dist/components/{p-CNjOyUQu.js → p-DxkEC0hR.js} +2 -2
  98. package/dist/components/{p-CU2673IJ.js → p-XMZCaXs7.js} +2 -2
  99. package/dist/components/{p-69lHhJiX.js → p-YR1XeuZf.js} +2 -2
  100. package/dist/components/{p-DmAHufd5.js → p-dyUp3Adm.js} +2 -2
  101. package/dist/components/{p-B6NvVdeO.js → p-nkYN0Bub.js} +2 -2
  102. package/dist/docs/components.json +95 -3
  103. package/dist/mcp-data/registry/card-overview.json +54 -11
  104. package/dist/mcp-data/registry/menu.json +1 -1
  105. package/dist/mcp-data/registry/registry.json +20 -5
  106. package/dist/mcp-data/registry/select-multi.json +1 -1
  107. package/dist/mcp-data/registry/select.json +1 -1
  108. package/dist/mcp-data/registry/text.json +2 -2
  109. package/dist/types/components/CardOverview/CardOverview.d.ts +8 -3
  110. package/dist/types/components/CardOverview/card-overview-types.d.ts +2 -0
  111. package/dist/types/components/CardOverview/index.d.ts +1 -1
  112. package/dist/types/components/Menu/Menu.d.ts +0 -1
  113. package/dist/types/components.d.ts +28 -6
  114. package/dist/types/utils/anchored-position-controller.d.ts +9 -0
  115. package/package.json +1 -1
  116. package/dist/components/p-B6vE3ujd.js.map +0 -1
  117. package/dist/components/p-By_s1wNN.js +0 -2
  118. package/dist/components/p-By_s1wNN.js.map +0 -1
  119. package/dist/components/p-CPwpgUWT.js.map +0 -1
  120. package/dist/components/p-D1bNvIpb.js +0 -2
  121. package/dist/components/p-D1bNvIpb.js.map +0 -1
  122. /package/dist/components/{p-huw1oRbt.js.map → p-8GK7B7K4.js.map} +0 -0
  123. /package/dist/components/{p-DzM3SzPz.js.map → p-B5tMlca-.js.map} +0 -0
  124. /package/dist/components/{p-D0e77tkd.js.map → p-B88n0pO3.js.map} +0 -0
  125. /package/dist/components/{p-BlHzmszE.js.map → p-BDKtu6Wb.js.map} +0 -0
  126. /package/dist/components/{p-DhLmoCe_.js.map → p-BOCfICln.js.map} +0 -0
  127. /package/dist/components/{p-CNgPwd11.js.map → p-BhV5e6vF.js.map} +0 -0
  128. /package/dist/components/{p-ukB-dPOK.js.map → p-C8HU4W8q.js.map} +0 -0
  129. /package/dist/components/{p-D9u1_OEZ.js.map → p-CChcuL04.js.map} +0 -0
  130. /package/dist/components/{p-CsX3ICz7.js.map → p-CCzG5xDD.js.map} +0 -0
  131. /package/dist/components/{p-BFRMwl93.js.map → p-CIiBpjCn.js.map} +0 -0
  132. /package/dist/components/{p-DB9XJm2c.js.map → p-CgEYdMee.js.map} +0 -0
  133. /package/dist/components/{p-Vdufoj7G.js.map → p-Cuih680v.js.map} +0 -0
  134. /package/dist/components/{p-BXaieghV.js.map → p-Cuqxh-Tq.js.map} +0 -0
  135. /package/dist/components/{p-Utr23NC-.js.map → p-DCvA3Dc9.js.map} +0 -0
  136. /package/dist/components/{p-G3qIxpQj.js.map → p-DLZm_-sU.js.map} +0 -0
  137. /package/dist/components/{p-38PfdMkF.js.map → p-DRnIuCiT.js.map} +0 -0
  138. /package/dist/components/{p-DIFUsoM-.js.map → p-DlscFn2m.js.map} +0 -0
  139. /package/dist/components/{p-CNjOyUQu.js.map → p-DxkEC0hR.js.map} +0 -0
  140. /package/dist/components/{p-CU2673IJ.js.map → p-XMZCaXs7.js.map} +0 -0
  141. /package/dist/components/{p-69lHhJiX.js.map → p-YR1XeuZf.js.map} +0 -0
  142. /package/dist/components/{p-DmAHufd5.js.map → p-dyUp3Adm.js.map} +0 -0
  143. /package/dist/components/{p-B6NvVdeO.js.map → p-nkYN0Bub.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"names":["textVariantClass","variant","replace","textDisplayClass","element","textCss","Text","__stencil_proxyCustomElement","HTMLElement","constructor","registerHost","this","emphasis","color","italic","shimmer","lineTruncation","fontFeature","as","render","Tag","isCustomColor","c","startsWith","truncationLines","Number","cls","wrap","decoration","align","style","undefined","extraProps","for","textId","h","Host","key","class"],"sources":["src/wc/components/Text/text-utils.ts","src/wc/components/Text/Text.css?tag=ds-text&encapsulation=scoped","src/wc/components/Text/Text.tsx"],"sourcesContent":["import type { TextElement, TextVariant } from './text-types';\n\n/** `text-body-medium` → `ds-text--body-medium` */\nexport function textVariantClass(variant: TextVariant): string {\n return `ds-text--${variant.replace(/^text-/, '')}`;\n}\n\n/** Inline semantics get a measurable inline box; paragraphs/headings get a block box. */\nexport function textDisplayClass(element: TextElement): string {\n return element === 'span' || element === 'label'\n ? 'ds-text--inline-box'\n : 'ds-text--block-box';\n}\n","@import '../../utils/typography.css';\n@import '../../utils/shimmer.css';\n\n:host {\n box-sizing: border-box;\n max-width: 100%;\n min-width: 0;\n margin: 0;\n padding: 0;\n border: 0;\n font-family: var(--typography-font-family);\n}\n\n:host(:where(.ds-text--inline-box)) {\n display: inline-block;\n}\n\n:host(:where(.ds-text--block-box)) {\n display: block;\n width: 100%;\n}\n\n/*\n * The host is the measurable typography box. The semantic inner element fills\n * it and inherits every text metric without adding margins, padding, or its own\n * line-height strut. One rendered line therefore measures exactly one token\n * line-height; N lines measure N × that token.\n */\n.ds-text__element {\n display: block;\n box-sizing: border-box;\n width: 100%;\n min-width: 0;\n margin: 0;\n padding: 0;\n border: 0;\n font: inherit;\n line-height: inherit;\n letter-spacing: inherit;\n color: inherit;\n text-transform: inherit;\n text-align: inherit;\n text-decoration: inherit;\n font-style: inherit;\n font-variant-numeric: inherit;\n font-feature-settings: inherit;\n -webkit-user-select: inherit;\n user-select: inherit;\n white-space: inherit;\n text-wrap: inherit;\n overflow-wrap: inherit;\n word-break: inherit;\n /* Consumer truncation on the host (PanelNav, ChartLegend, …) must reach the\n text node — overflow/text-overflow are not inherited by default. */\n overflow: inherit;\n text-overflow: inherit;\n}\n\n/* ── Truncation ─────────────────────────────────────────────────────────── */\n\n:host(.ds-text--truncate-1) {\n overflow: hidden;\n}\n\n:host(.ds-text--truncate-1) .ds-text__element {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n:host(.ds-text--truncate-2),\n:host(.ds-text--truncate-3),\n:host(.ds-text--truncate-4),\n:host(.ds-text--truncate-5) {\n overflow: hidden;\n}\n\n:host(.ds-text--truncate-2) .ds-text__element,\n:host(.ds-text--truncate-3) .ds-text__element,\n:host(.ds-text--truncate-4) .ds-text__element,\n:host(.ds-text--truncate-5) .ds-text__element {\n display: -webkit-box;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n word-break: break-word;\n}\n\n:host(.ds-text--truncate-2) .ds-text__element { -webkit-line-clamp: 2; }\n:host(.ds-text--truncate-3) .ds-text__element { -webkit-line-clamp: 3; }\n:host(.ds-text--truncate-4) .ds-text__element { -webkit-line-clamp: 4; }\n:host(.ds-text--truncate-5) .ds-text__element { -webkit-line-clamp: 5; }\n\n/* ── Wrap ───────────────────────────────────────────────────────────────── */\n\n:host(.ds-text--nowrap),\n:host(.ds-text--nowrap) .ds-text__element {\n white-space: nowrap;\n word-break: normal;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: 0;\n}\n\n:host(.ds-text--balance),\n:host(.ds-text--balance) .ds-text__element { text-wrap: balance; }\n\n:host(.ds-text--pretty),\n:host(.ds-text--pretty) .ds-text__element { text-wrap: pretty; }\n\n/* ── Color ──────────────────────────────────────────────────────────────── */\n\n:host(.ds-text--color-primary) { color: var(--color-foreground-primary); }\n:host(.ds-text--color-secondary) { color: var(--color-foreground-secondary); }\n:host(.ds-text--color-tertiary) { color: var(--color-foreground-tertiary); }\n:host(.ds-text--color-quaternary) { color: var(--color-foreground-quaternary); }\n:host(.ds-text--color-brand) { color: var(--color-foreground-bold-brand); }\n:host(.ds-text--color-negative) { color: var(--color-foreground-bold-negative); }\n:host(.ds-text--color-positive) { color: var(--color-foreground-bold-positive); }\n:host(.ds-text--color-warning) { color: var(--color-foreground-bold-warning); }\n:host(.ds-text--color-caution) { color: var(--color-foreground-bold-caution); }\n:host(.ds-text--color-ai) { color: var(--color-foreground-bold-ai); }\n:host(.ds-text--color-on-strong) { color: var(--color-foreground-on-strong-background-primary); }\n:host(.ds-text--color-on-bold) { color: var(--color-foreground-on-bold-background-primary); }\n:host(.ds-text--color-inherit) { color: inherit; }\n\n/* ── Decorations ─────────────────────────────────────────────────────────── */\n\n:host(.ds-text--decoration-underline) {\n text-decoration: underline;\n text-decoration-color: var(--color-foreground-tertiary);\n text-underline-offset: 2px;\n text-decoration-thickness: 1px;\n}\n\n:host(.ds-text--decoration-dotted-underline) {\n text-decoration: underline dotted;\n text-decoration-color: var(--color-foreground-tertiary);\n text-underline-offset: 2px;\n text-decoration-thickness: 1px;\n}\n\n/* ── Style ──────────────────────────────────────────────────────────────── */\n\n:host(.ds-text--italic) { font-style: italic; }\n\n:host(.ds-text--font-feature-tabular-nums) {\n font-variant-numeric: tabular-nums;\n font-feature-settings: 'tnum';\n}\n\n/* ── Align ──────────────────────────────────────────────────────────────── */\n\n:host(.ds-text--align-left) { text-align: left; }\n:host(.ds-text--align-center) { text-align: center; }\n:host(.ds-text--align-right) { text-align: right; }\n","import { Component, Prop, h, Host } from '@stencil/core';\nimport { textDisplayClass, textVariantClass } from './text-utils';\nimport type {\n TextAlign,\n TextColor,\n TextDecoration,\n TextElement,\n TextFontFeature,\n TextVariant,\n LineTruncation,\n TextWrap,\n} from './text-types';\n\n@Component({\n tag: 'ds-text',\n styleUrl: 'Text.css',\n scoped: true,\n})\nexport class Text {\n @Prop() variant: TextVariant = 'text-body-medium';\n /**\n * Heavier weight + tighter letter-spacing for the variant.\n * `false` (default): one step below emphasis (display semibold, title/body\n * medium, caption medium).\n * `true`: display bold, title/caption semibold, body medium.\n */\n @Prop() emphasis: boolean = false;\n /**\n * Semantic foreground color token or CSS variable. `tertiary` and the\n * still-fainter `quaternary` are restricted to genuinely inactive/disabled\n * UI content or purely decorative content; prefer the owning control's\n * inactive state whenever one exists.\n */\n @Prop() color: TextColor = 'inherit';\n /** Link underline or dotted hidden-interaction affordance; does not add semantics. */\n @Prop() decoration: TextDecoration | undefined;\n @Prop() italic: boolean = false;\n /** Animate the visible glyphs with the shared loading shimmer treatment. */\n @Prop() shimmer: boolean = false;\n @Prop() align: TextAlign | undefined;\n @Prop() lineTruncation: LineTruncation = 'none';\n @Prop() wrap: TextWrap | undefined;\n @Prop() fontFeature: TextFontFeature = 'normal';\n @Prop() as: TextElement = 'p';\n /** Maps to `for` attribute on <label> elements. */\n @Prop() for: string | undefined;\n /** Forwarded to the inner element (e.g. aria-labelledby targets). */\n @Prop() textId: string | undefined;\n\n render() {\n // Polymorphic element: TSX treats a variable tag as a component, so a\n // dynamic intrinsic element name must be cast to `any` to render.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const Tag = this.as as any;\n const isCustomColor = (c: TextColor) => typeof c === 'string' && c.startsWith('var(--');\n const truncationLines = Number(this.lineTruncation);\n\n const cls: Record<string, boolean> = {\n 'ds-text': true,\n [textDisplayClass(this.as)]: true,\n [textVariantClass(this.variant)]: true,\n 'ds-text--emphasis': this.emphasis,\n 'ds-text--regular': !this.emphasis,\n 'ds-text--nowrap': this.wrap === 'nowrap',\n 'ds-text--balance': this.wrap === 'balance',\n 'ds-text--pretty': this.wrap === 'pretty',\n 'ds-text--truncate-1': truncationLines === 1 && this.wrap !== 'nowrap',\n 'ds-text--truncate-2': truncationLines === 2 && this.wrap !== 'nowrap',\n 'ds-text--truncate-3': truncationLines === 3 && this.wrap !== 'nowrap',\n 'ds-text--truncate-4': truncationLines === 4 && this.wrap !== 'nowrap',\n 'ds-text--truncate-5': truncationLines === 5 && this.wrap !== 'nowrap',\n 'ds-text--color-primary': this.color === 'primary',\n 'ds-text--color-secondary': this.color === 'secondary',\n 'ds-text--color-tertiary': this.color === 'tertiary',\n 'ds-text--color-quaternary': this.color === 'quaternary',\n 'ds-text--color-brand': this.color === 'brand',\n 'ds-text--color-negative': this.color === 'negative',\n 'ds-text--color-positive': this.color === 'positive',\n 'ds-text--color-warning': this.color === 'warning',\n 'ds-text--color-caution': this.color === 'caution',\n 'ds-text--color-ai': this.color === 'ai',\n 'ds-text--color-on-strong': this.color === 'on-strong',\n 'ds-text--color-on-bold': this.color === 'on-bold',\n 'ds-text--color-inherit': this.color === 'inherit',\n 'ds-text--decoration-underline': this.decoration === 'underline',\n 'ds-text--decoration-dotted-underline': this.decoration === 'dotted-underline',\n 'ds-text--italic': this.italic,\n 'ds-text--align-left': this.align === 'left',\n 'ds-text--align-center': this.align === 'center',\n 'ds-text--align-right': this.align === 'right',\n 'ds-text--font-feature-tabular-nums': this.fontFeature === 'tabular-nums',\n };\n\n const style = this.color && isCustomColor(this.color)\n ? { color: this.color as string }\n : undefined;\n\n const extraProps: Record<string, string> = {};\n if (this.as === 'label' && this.for) extraProps['for'] = this.for;\n if (this.textId) extraProps['id'] = this.textId;\n\n return (\n <Host class={cls} style={style}>\n <Tag\n class={{\n 'ds-text__element': true,\n 'ds-shimmer-text': this.shimmer,\n }}\n {...extraProps}\n >\n <slot />\n </Tag>\n </Host>\n );\n }\n}\n"],"mappings":"2DAGM,SAAUA,EAAiBC,GAC/B,MAAO,YAAYA,EAAQC,QAAQ,SAAU,KAC/C,CAGM,SAAUC,EAAiBC,GAC/B,OAAOA,IAAY,QAAUA,IAAY,QACrC,sBACA,oBACN,CCZA,MAAMC,EAAU,IAAM,u3V,MCkBTC,EAAIC,EAAA,MAAAD,UAAAE,EALjB,WAAAC,CAAAC,G,4CAMUC,KAAAV,QAAuB,mBAOvBU,KAAAC,SAAoB,MAOpBD,KAAAE,MAAmB,UAGnBF,KAAAG,OAAkB,MAElBH,KAAAI,QAAmB,MAEnBJ,KAAAK,eAAiC,OAEjCL,KAAAM,YAA+B,SAC/BN,KAAAO,GAAkB,GAwE3B,CAlEC,MAAAC,GAIE,MAAMC,EAAMT,KAAKO,GACjB,MAAMG,EAAiBC,UAAwBA,IAAM,UAAYA,EAAEC,WAAW,UAC9E,MAAMC,EAAkBC,OAAOd,KAAKK,gBAEpC,MAAMU,EAA+B,CACnC,UAAW,KACX,CAACvB,EAAiBQ,KAAKO,KAAM,KAC7B,CAAClB,EAAiBW,KAAKV,UAAW,KAClC,oBAAqBU,KAAKC,SAC1B,oBAAqBD,KAAKC,SAC1B,kBAAmBD,KAAKgB,OAAS,SACjC,mBAAoBhB,KAAKgB,OAAS,UAClC,kBAAmBhB,KAAKgB,OAAS,SACjC,sBAAuBH,IAAoB,GAAKb,KAAKgB,OAAS,SAC9D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 +0,0 @@
1
- import{A as t}from"./p-By_s1wNN.js";import{c as i,r as s}from"./p-DhKvqh5G.js";import{r as e}from"./p-BJMRBHKW.js";import{r as n}from"./p-B6Vuayt6.js";import{T as h}from"./p-BBePKRHC.js";function r(t,i){return i.length>0?i:[{options:t}]}function o(t){return t.flatMap((t=>t.options))}function a(t){return t.length>0&&t.every((t=>Boolean(t.icon)))}function u(t){return t.some((t=>Boolean(t.subtext?.trim())))}function c(t,i){const s=i.trim().toLocaleLowerCase();if(!s)return t;return t.map((t=>{const i=t.header?.toLocaleLowerCase().includes(s);return{...t,options:i?t.options:t.options.filter((t=>`${t.label} ${t.subtext??""}`.toLocaleLowerCase().includes(s)))}})).filter((t=>t.options.length>0))}function f(t){return t.map(((t,i)=>({option:t,index:i}))).filter((({option:t})=>!t.isInactive)).map((({index:t})=>t))}function l(t,i,s){const e=f(t);if(!e.length)return-1;const n=e.indexOf(i);const h=n>=0?n:s===1?-1:0;return e[(h+s+e.length)%e.length]}function d(t,i,s){const e=i.toLocaleLowerCase();if(!e)return-1;for(let i=1;i<=t.length;i+=1){const n=(Math.max(s,-1)+i)%t.length;const h=t[n];if(!h.isInactive&&h.label.toLocaleLowerCase().startsWith(e))return n}return-1}function p(t){return{"ds-interaction-fill--on-faint":t==="faint","ds-interaction-fill--on-medium":t==="medium","ds-interaction-fill--on-bold":t==="bold","ds-interaction-fill--on-strong":t==="strong","ds-interaction-fill--on-translucent":t==="translucent","ds-interaction-fill--on-inverted":t==="inverted","ds-interaction-fill--on-media":t==="media","ds-interaction-fill--on-always-dark":t==="always-dark"}}class m{constructor(n){this.state=n;this.triggerEl=null;this.popupEl=null;this.searchEl=null;this.typeahead="";this.typeaheadTimer=null;this.outsideHandler=null;this.setTriggerElement=t=>{this.triggerEl=t};this.setPopupElement=t=>{this.popupEl=t};this.setSearchElement=t=>{this.searchEl=t};this.handleTriggerKeyDown=t=>{if(!this.state.open){if(["ArrowDown","ArrowUp","Enter"," "].includes(t.key)){t.preventDefault();this.openPopup(true,t.key==="ArrowUp"?"last":"first")}else if(this.isTypeaheadKey(t)){t.preventDefault();this.openPopup(true);if(this.state.searchable)this.state.searchTerm=t.key;else this.handleTypeahead(t.key)}return}this.handleListKeyDown(t)};this.handleListKeyDown=t=>{switch(t.key){case"ArrowDown":t.preventDefault();this.state.focusRingVisible=true;this.state.activeIndex=l(this.state.options,this.state.activeIndex,1);break;case"ArrowUp":t.preventDefault();this.state.focusRingVisible=true;this.state.activeIndex=l(this.state.options,this.state.activeIndex,-1);break;case"Home":t.preventDefault();this.state.focusRingVisible=true;this.state.activeIndex=f(this.state.options)[0]??-1;break;case"End":{t.preventDefault();this.state.focusRingVisible=true;const i=f(this.state.options);this.state.activeIndex=i[i.length-1]??-1;break}case"Enter":case" ":{if(t.key===" "&&this.state.searchable&&t.target===this.searchEl)break;t.preventDefault();const i=this.state.options[this.state.activeIndex];if(i)this.state.selectOption(i);break}case"Escape":t.preventDefault();this.closePopup(true);break;case"Tab":this.closePopup();break;default:if(!this.state.searchable&&this.isTypeaheadKey(t)){this.handleTypeahead(t.key)}}};this.position=new t({getAnchor:()=>this.triggerEl,getPopup:()=>this.popupEl,measure:(t,n)=>{if(!this.state.open||!n.isConnected||!this.state.host.contains(n))return null;const r=e(h.space050,h.space050);n.style.minWidth=`${i(t.offsetWidth,r)}px`;return{anchorRect:t.getBoundingClientRect(),popupWidth:n.offsetWidth,popupHeight:n.offsetHeight,side:"bottom",align:"start",sideOffsetPx:r,alignOffsetPx:s({align:"start",alignOffsetPx:0,sectionInsetPx:r}),viewportPadPx:r,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight}},apply:({x:t,y:i})=>{this.state.position={x:t,y:i};this.state.positionReady=true}})}get activeOptionId(){return!this.state.isLoading&&this.state.activeIndex>=0?`${this.state.generatedId}-option-${this.state.activeIndex}`:undefined}connect(){if(this.state.open)this.openChanged(true)}disconnect(){this.cancelPositionRetry();this.unbindPopupListeners();if(this.typeaheadTimer)clearTimeout(this.typeaheadTimer)}setFocus(){this.triggerEl?.focus()}optionsChanged(){if(!this.state.open)return;const t=f(this.state.options);if(!t.includes(this.state.activeIndex))this.state.activeIndex=t[0]??-1;requestAnimationFrame((()=>this.updatePosition()))}loadingChanged(){if(this.state.open)requestAnimationFrame((()=>this.updatePosition()))}openChanged(t){if(t){this.bindPopupListeners();this.schedulePositionUpdate((()=>{this.scrollActiveOptionIntoView();if(this.state.searchable)this.searchEl?.focus()}));return}this.cancelPositionRetry();this.unbindPopupListeners();this.state.searchTerm="";this.state.positionReady=false}searchChanged(){this.state.activeIndex=f(this.state.options)[0]??-1;requestAnimationFrame((()=>{this.updatePosition();this.scrollActiveOptionIntoView()}))}activeIndexChanged(){requestAnimationFrame((()=>this.scrollActiveOptionIntoView()))}openPopup(t,i){if(this.state.isDisabled||!this.state.options.length&&!this.state.isLoading)return;const s=f(this.state.options);this.state.activeIndex=i==="last"?s[s.length-1]??-1:this.state.preferredIndex>=0?this.state.preferredIndex:s[0]??-1;this.state.focusRingVisible=t;this.state.open=true}closePopup(t=false){if(!this.state.open)return;this.state.open=false;if(t)requestAnimationFrame((()=>this.triggerEl?.focus()))}focusSearchOrTrigger(){requestAnimationFrame((()=>this.state.searchable?this.searchEl?.focus():this.triggerEl?.focus()))}isTypeaheadKey(t){return t.key.length===1&&!t.metaKey&&!t.ctrlKey&&!t.altKey}handleTypeahead(t){if(this.typeaheadTimer)clearTimeout(this.typeaheadTimer);this.state.focusRingVisible=true;const i=t.toLocaleLowerCase();const s=this.typeahead.length>0&&[...this.typeahead].every((t=>t===i));this.typeahead=s?i:`${this.typeahead}${i}`;const e=d(this.state.options,this.typeahead,this.state.activeIndex);if(e>=0)this.state.activeIndex=e;const r=n(h.animationDurationMedium1,h.animationDurationMedium1);this.typeaheadTimer=setTimeout((()=>{this.typeahead="";this.typeaheadTimer=null}),r)}scrollActiveOptionIntoView(){if(!this.state.open||!this.activeOptionId)return;this.state.host.querySelector(`#${this.activeOptionId}`)?.scrollIntoView({block:"nearest",inline:"nearest"})}bindPopupListeners(){this.unbindPopupListeners();this.outsideHandler=t=>{if(this.state.host.contains(t.target))return;this.closePopup()};document.addEventListener("mousedown",this.outsideHandler,true);this.position.observe()}unbindPopupListeners(){if(this.outsideHandler){document.removeEventListener("mousedown",this.outsideHandler,true);this.outsideHandler=null}this.position.unobserve()}cancelPositionRetry(){this.position.cancel()}schedulePositionUpdate(t){if(!this.state.open)return;this.state.positionReady=false;this.position.schedule(t)}updatePosition(){return this.position.update()}}export{m as S,c as a,u as b,a as c,p as d,f as e,o as f,r};
2
- //# sourceMappingURL=p-D1bNvIpb.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["resolveChoiceSections","options","sections","length","flattenChoiceSections","flatMap","section","choiceListUsesIcons","every","option","Boolean","icon","choiceListUsesSubtext","some","subtext","trim","filterChoiceSections","searchTerm","normalized","toLocaleLowerCase","map","sectionMatches","header","includes","filter","label","enabledChoiceIndexes","index","isInactive","moveChoiceIndex","currentIndex","direction","enabled","currentEnabledIndex","indexOf","start","findChoiceTypeaheadMatch","query","offset","Math","max","startsWith","choiceBackgroundClassMap","background","SelectController","constructor","state","this","triggerEl","popupEl","searchEl","typeahead","typeaheadTimer","outsideHandler","setTriggerElement","element","setPopupElement","setSearchElement","handleTriggerKeyDown","event","open","key","preventDefault","openPopup","isTypeaheadKey","searchable","handleTypeahead","handleListKeyDown","focusRingVisible","activeIndex","target","selectOption","closePopup","position","AnchoredPositionController","getAnchor","getPopup","measure","trigger","popup","isConnected","host","contains","sectionPadding","resolveCssLengthPx","TOKEN_DEFAULTS","space050","style","minWidth","choicePopupMinWidth","offsetWidth","anchorRect","getBoundingClientRect","popupWidth","popupHeight","offsetHeight","side","align","sideOffsetPx","alignOffsetPx","resolveChoicePopupAlignOffset","sectionInsetPx","viewportPadPx","viewportWidth","window","innerWidth","viewportHeight","innerHeight","apply","x","y","positionReady","activeOptionId","isLoading","generatedId","undefined","connect","openChanged","disconnect","cancelPositionRetry","unbindPopupListeners","clearTimeout","setFocus","focus","optionsChanged","requestAnimationFrame","updatePosition","loadingChanged","bindPopupListeners","schedulePositionUpdate","scrollActiveOptionIntoView","searchChanged","activeIndexChanged","focusVisible","edge","isDisabled","preferredIndex","restoreFocus","focusSearchOrTrigger","metaKey","ctrlKey","altKey","repeatedCharacter","character","match","resetMs","resolveCssTimeMs","animationDurationMedium1","setTimeout","querySelector","scrollIntoView","block","inline","document","addEventListener","observe","removeEventListener","unobserve","cancel","onReady","schedule","update"],"sources":["src/wc/utils/choice-list.ts","src/wc/utils/select-controller.ts"],"sourcesContent":["export interface ChoiceOption {\n label: string;\n value: string;\n subtext?: string;\n /** Rendered only when every option in the complete list supplies an icon. */\n icon?: string;\n isInactive?: boolean;\n}\n\nexport interface ChoiceSection {\n header?: string;\n options: ChoiceOption[];\n divider?: boolean;\n}\n\nexport type ChoiceBackground =\n | 'faint'\n | 'medium'\n | 'bold'\n | 'strong'\n | 'translucent'\n | 'inverted'\n | 'media'\n | 'always-dark';\n\nexport function resolveChoiceSections(\n options: ChoiceOption[],\n sections: ChoiceSection[],\n): ChoiceSection[] {\n return sections.length > 0 ? sections : [{ options }];\n}\n\nexport function flattenChoiceSections(sections: ChoiceSection[]): ChoiceOption[] {\n return sections.flatMap(section => section.options);\n}\n\n/** A choice list has one stable row layout: every option has an icon, or none do. */\nexport function choiceListUsesIcons(options: ChoiceOption[]): boolean {\n return options.length > 0 && options.every(option => Boolean(option.icon));\n}\n\n/** Once one option needs supporting text, every row keeps the same two-line structure. */\nexport function choiceListUsesSubtext(options: ChoiceOption[]): boolean {\n return options.some(option => Boolean(option.subtext?.trim()));\n}\n\nexport function filterChoiceSections(\n sections: ChoiceSection[],\n searchTerm: string,\n): ChoiceSection[] {\n const normalized = searchTerm.trim().toLocaleLowerCase();\n if (!normalized) return sections;\n\n return sections\n .map(section => {\n const sectionMatches = section.header?.toLocaleLowerCase().includes(normalized);\n return {\n ...section,\n options: sectionMatches\n ? section.options\n : section.options.filter(option =>\n `${option.label} ${option.subtext ?? ''}`.toLocaleLowerCase().includes(normalized),\n ),\n };\n })\n .filter(section => section.options.length > 0);\n}\n\nexport function enabledChoiceIndexes(options: ChoiceOption[]): number[] {\n return options\n .map((option, index) => ({ option, index }))\n .filter(({ option }) => !option.isInactive)\n .map(({ index }) => index);\n}\n\nexport function moveChoiceIndex(\n options: ChoiceOption[],\n currentIndex: number,\n direction: 1 | -1,\n): number {\n const enabled = enabledChoiceIndexes(options);\n if (!enabled.length) return -1;\n\n const currentEnabledIndex = enabled.indexOf(currentIndex);\n const start = currentEnabledIndex >= 0 ? currentEnabledIndex : direction === 1 ? -1 : 0;\n return enabled[(start + direction + enabled.length) % enabled.length];\n}\n\nexport function findChoiceTypeaheadMatch(\n options: ChoiceOption[],\n query: string,\n currentIndex: number,\n): number {\n const normalized = query.toLocaleLowerCase();\n if (!normalized) return -1;\n\n for (let offset = 1; offset <= options.length; offset += 1) {\n const index = (Math.max(currentIndex, -1) + offset) % options.length;\n const option = options[index];\n if (!option.isInactive && option.label.toLocaleLowerCase().startsWith(normalized)) return index;\n }\n return -1;\n}\n\nexport function choiceBackgroundClassMap(\n background: ChoiceBackground | undefined,\n): Record<string, boolean> {\n return {\n 'ds-interaction-fill--on-faint': background === 'faint',\n 'ds-interaction-fill--on-medium': background === 'medium',\n 'ds-interaction-fill--on-bold': background === 'bold',\n 'ds-interaction-fill--on-strong': background === 'strong',\n 'ds-interaction-fill--on-translucent': background === 'translucent',\n 'ds-interaction-fill--on-inverted': background === 'inverted',\n 'ds-interaction-fill--on-media': background === 'media',\n 'ds-interaction-fill--on-always-dark': background === 'always-dark',\n };\n}\n","import { AnchoredPositionController } from './anchored-position-controller';\nimport {\n enabledChoiceIndexes,\n findChoiceTypeaheadMatch,\n moveChoiceIndex,\n type ChoiceOption,\n} from './choice-list';\nimport {\n choicePopupMinWidth,\n resolveChoicePopupAlignOffset,\n} from './choice-popup-alignment';\nimport { resolveCssLengthPx } from './resolve-css-length-px';\nimport { resolveCssTimeMs } from './resolve-css-time-ms';\nimport { TOKEN_DEFAULTS } from './token-defaults';\n\ntype PopupPosition = { x: number; y: number };\n\nexport interface SelectControllerState<T extends ChoiceOption> {\n readonly host: HTMLElement;\n readonly generatedId: string;\n readonly options: T[];\n readonly searchable: boolean;\n readonly isLoading: boolean;\n readonly isDisabled: boolean;\n readonly preferredIndex: number;\n open: boolean;\n activeIndex: number;\n searchTerm: string;\n focusRingVisible: boolean;\n position: PopupPosition;\n positionReady: boolean;\n selectOption(option: T): void;\n}\n\n/**\n * Shared Select/SelectMulti interaction controller.\n *\n * Decorated Stencil state and scalar/array selection remain in each component;\n * this controller owns only popup lifecycle, focus, positioning, typeahead,\n * and listbox keyboard traversal. Anchored placement is delegated to\n * `AnchoredPositionController`; only the choice-cell measurement stays here.\n */\nexport class SelectController<T extends ChoiceOption> {\n private triggerEl: HTMLButtonElement | null = null;\n private popupEl: HTMLDivElement | null = null;\n private searchEl: HTMLInputElement | null = null;\n private typeahead = '';\n private typeaheadTimer: ReturnType<typeof setTimeout> | null = null;\n private outsideHandler: ((event: MouseEvent) => void) | null = null;\n private readonly position: AnchoredPositionController;\n\n constructor(private readonly state: SelectControllerState<T>) {\n this.position = new AnchoredPositionController({\n getAnchor: () => this.triggerEl,\n getPopup: () => this.popupEl,\n measure: (trigger, popup) => {\n if (\n !this.state.open ||\n !popup.isConnected ||\n !this.state.host.contains(popup)\n ) return null;\n\n const sectionPadding = resolveCssLengthPx(TOKEN_DEFAULTS.space050, TOKEN_DEFAULTS.space050);\n popup.style.minWidth = `${choicePopupMinWidth(trigger.offsetWidth, sectionPadding)}px`;\n\n return {\n anchorRect: trigger.getBoundingClientRect(),\n popupWidth: popup.offsetWidth,\n popupHeight: popup.offsetHeight,\n side: 'bottom',\n align: 'start',\n sideOffsetPx: sectionPadding,\n alignOffsetPx: resolveChoicePopupAlignOffset({\n align: 'start',\n alignOffsetPx: 0,\n sectionInsetPx: sectionPadding,\n }),\n viewportPadPx: sectionPadding,\n viewportWidth: window.innerWidth,\n viewportHeight: window.innerHeight,\n };\n },\n apply: ({ x, y }) => {\n this.state.position = { x, y };\n this.state.positionReady = true;\n },\n });\n }\n\n get activeOptionId(): string | undefined {\n return !this.state.isLoading && this.state.activeIndex >= 0\n ? `${this.state.generatedId}-option-${this.state.activeIndex}`\n : undefined;\n }\n\n setTriggerElement = (element: HTMLButtonElement | null) => {\n this.triggerEl = element;\n };\n\n setPopupElement = (element: HTMLDivElement | null) => {\n this.popupEl = element;\n };\n\n setSearchElement = (element: HTMLInputElement | null) => {\n this.searchEl = element;\n };\n\n connect() {\n if (this.state.open) this.openChanged(true);\n }\n\n disconnect() {\n this.cancelPositionRetry();\n this.unbindPopupListeners();\n if (this.typeaheadTimer) clearTimeout(this.typeaheadTimer);\n }\n\n setFocus() {\n this.triggerEl?.focus();\n }\n\n optionsChanged() {\n if (!this.state.open) return;\n const enabled = enabledChoiceIndexes(this.state.options);\n if (!enabled.includes(this.state.activeIndex)) this.state.activeIndex = enabled[0] ?? -1;\n requestAnimationFrame(() => this.updatePosition());\n }\n\n loadingChanged() {\n if (this.state.open) requestAnimationFrame(() => this.updatePosition());\n }\n\n openChanged(open: boolean) {\n if (open) {\n this.bindPopupListeners();\n this.schedulePositionUpdate(() => {\n this.scrollActiveOptionIntoView();\n if (this.state.searchable) this.searchEl?.focus();\n });\n return;\n }\n this.cancelPositionRetry();\n this.unbindPopupListeners();\n this.state.searchTerm = '';\n this.state.positionReady = false;\n }\n\n searchChanged() {\n this.state.activeIndex = enabledChoiceIndexes(this.state.options)[0] ?? -1;\n requestAnimationFrame(() => {\n this.updatePosition();\n this.scrollActiveOptionIntoView();\n });\n }\n\n activeIndexChanged() {\n requestAnimationFrame(() => this.scrollActiveOptionIntoView());\n }\n\n openPopup(focusVisible: boolean, edge?: 'first' | 'last') {\n if (this.state.isDisabled || (!this.state.options.length && !this.state.isLoading)) return;\n const enabled = enabledChoiceIndexes(this.state.options);\n this.state.activeIndex =\n edge === 'last'\n ? (enabled[enabled.length - 1] ?? -1)\n : this.state.preferredIndex >= 0\n ? this.state.preferredIndex\n : (enabled[0] ?? -1);\n this.state.focusRingVisible = focusVisible;\n this.state.open = true;\n }\n\n closePopup(restoreFocus = false) {\n if (!this.state.open) return;\n this.state.open = false;\n if (restoreFocus) requestAnimationFrame(() => this.triggerEl?.focus());\n }\n\n focusSearchOrTrigger() {\n requestAnimationFrame(() =>\n this.state.searchable ? this.searchEl?.focus() : this.triggerEl?.focus()\n );\n }\n\n handleTriggerKeyDown = (event: KeyboardEvent) => {\n if (!this.state.open) {\n if (['ArrowDown', 'ArrowUp', 'Enter', ' '].includes(event.key)) {\n event.preventDefault();\n this.openPopup(true, event.key === 'ArrowUp' ? 'last' : 'first');\n } else if (this.isTypeaheadKey(event)) {\n event.preventDefault();\n this.openPopup(true);\n if (this.state.searchable) this.state.searchTerm = event.key;\n else this.handleTypeahead(event.key);\n }\n return;\n }\n this.handleListKeyDown(event);\n };\n\n handleListKeyDown = (event: KeyboardEvent) => {\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n this.state.focusRingVisible = true;\n this.state.activeIndex = moveChoiceIndex(\n this.state.options,\n this.state.activeIndex,\n 1,\n );\n break;\n case 'ArrowUp':\n event.preventDefault();\n this.state.focusRingVisible = true;\n this.state.activeIndex = moveChoiceIndex(\n this.state.options,\n this.state.activeIndex,\n -1,\n );\n break;\n case 'Home':\n event.preventDefault();\n this.state.focusRingVisible = true;\n this.state.activeIndex = enabledChoiceIndexes(this.state.options)[0] ?? -1;\n break;\n case 'End': {\n event.preventDefault();\n this.state.focusRingVisible = true;\n const enabled = enabledChoiceIndexes(this.state.options);\n this.state.activeIndex = enabled[enabled.length - 1] ?? -1;\n break;\n }\n case 'Enter':\n case ' ': {\n if (event.key === ' ' && this.state.searchable && event.target === this.searchEl) break;\n event.preventDefault();\n const option = this.state.options[this.state.activeIndex];\n if (option) this.state.selectOption(option);\n break;\n }\n case 'Escape':\n event.preventDefault();\n this.closePopup(true);\n break;\n case 'Tab':\n this.closePopup();\n break;\n default:\n if (!this.state.searchable && this.isTypeaheadKey(event)) {\n this.handleTypeahead(event.key);\n }\n }\n };\n\n private isTypeaheadKey(event: KeyboardEvent) {\n return event.key.length === 1 && !event.metaKey && !event.ctrlKey && !event.altKey;\n }\n\n private handleTypeahead(key: string) {\n if (this.typeaheadTimer) clearTimeout(this.typeaheadTimer);\n this.state.focusRingVisible = true;\n const normalized = key.toLocaleLowerCase();\n const repeatedCharacter =\n this.typeahead.length > 0 &&\n [...this.typeahead].every(character => character === normalized);\n this.typeahead = repeatedCharacter ? normalized : `${this.typeahead}${normalized}`;\n const match = findChoiceTypeaheadMatch(\n this.state.options,\n this.typeahead,\n this.state.activeIndex,\n );\n if (match >= 0) this.state.activeIndex = match;\n const resetMs = resolveCssTimeMs(\n TOKEN_DEFAULTS.animationDurationMedium1,\n TOKEN_DEFAULTS.animationDurationMedium1,\n );\n this.typeaheadTimer = setTimeout(() => {\n this.typeahead = '';\n this.typeaheadTimer = null;\n }, resetMs);\n }\n\n private scrollActiveOptionIntoView() {\n if (!this.state.open || !this.activeOptionId) return;\n this.state.host\n .querySelector<HTMLElement>(`#${this.activeOptionId}`)\n ?.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n }\n\n private bindPopupListeners() {\n this.unbindPopupListeners();\n this.outsideHandler = event => {\n if (this.state.host.contains(event.target as Node)) return;\n this.closePopup();\n };\n document.addEventListener('mousedown', this.outsideHandler, true);\n this.position.observe();\n }\n\n private unbindPopupListeners() {\n if (this.outsideHandler) {\n document.removeEventListener('mousedown', this.outsideHandler, true);\n this.outsideHandler = null;\n }\n this.position.unobserve();\n }\n\n private cancelPositionRetry() {\n this.position.cancel();\n }\n\n private schedulePositionUpdate(onReady?: () => void) {\n if (!this.state.open) return;\n this.state.positionReady = false;\n this.position.schedule(onReady);\n }\n\n private updatePosition(): boolean {\n return this.position.update();\n }\n}\n"],"mappings":"2LAyBM,SAAUA,EACdC,EACAC,GAEA,OAAOA,EAASC,O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