@oicl/openbridge-webcomponents-full-bundle 2.0.0-next.170 → 2.0.0-next.171

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 (78) hide show
  1. package/bundle/openbridge-webcomponents.bundle.js +870 -441
  2. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  3. package/custom-elements.json +1110 -383
  4. package/dist/ar/poi/poi-aton.d.ts +1 -0
  5. package/dist/ar/poi/poi-aton.d.ts.map +1 -1
  6. package/dist/ar/poi/poi-aton.js +1 -0
  7. package/dist/ar/poi/poi-aton.js.map +1 -1
  8. package/dist/ar/poi/poi-base.d.ts +39 -5
  9. package/dist/ar/poi/poi-base.d.ts.map +1 -1
  10. package/dist/ar/poi/poi-base.js +108 -37
  11. package/dist/ar/poi/poi-base.js.map +1 -1
  12. package/dist/ar/poi/poi-data.d.ts +1 -0
  13. package/dist/ar/poi/poi-data.d.ts.map +1 -1
  14. package/dist/ar/poi/poi-data.js +1 -0
  15. package/dist/ar/poi/poi-data.js.map +1 -1
  16. package/dist/ar/poi/poi-vessel.d.ts +1 -0
  17. package/dist/ar/poi/poi-vessel.d.ts.map +1 -1
  18. package/dist/ar/poi/poi-vessel.js +1 -0
  19. package/dist/ar/poi/poi-vessel.js.map +1 -1
  20. package/dist/ar/poi/poi.d.ts +4 -12
  21. package/dist/ar/poi/poi.d.ts.map +1 -1
  22. package/dist/ar/poi/poi.js +6 -72
  23. package/dist/ar/poi/poi.js.map +1 -1
  24. package/dist/ar/poi-button/poi-button.d.ts +6 -2
  25. package/dist/ar/poi-button/poi-button.d.ts.map +1 -1
  26. package/dist/ar/poi-button/poi-button.js +10 -1
  27. package/dist/ar/poi-button/poi-button.js.map +1 -1
  28. package/dist/ar/poi-card/poi-card.d.ts +12 -1
  29. package/dist/ar/poi-card/poi-card.d.ts.map +1 -1
  30. package/dist/ar/poi-card/poi-card.js +4 -1
  31. package/dist/ar/poi-card/poi-card.js.map +1 -1
  32. package/dist/ar/poi-controller/poi-controller.d.ts +45 -1
  33. package/dist/ar/poi-controller/poi-controller.d.ts.map +1 -1
  34. package/dist/ar/poi-controller/poi-controller.js +72 -14
  35. package/dist/ar/poi-controller/poi-controller.js.map +1 -1
  36. package/dist/ar/poi-group/poi-group.d.ts +28 -5
  37. package/dist/ar/poi-group/poi-group.d.ts.map +1 -1
  38. package/dist/ar/poi-group/poi-group.js +50 -7
  39. package/dist/ar/poi-group/poi-group.js.map +1 -1
  40. package/dist/ar/poi-layer/poi-layer.css.js +69 -18
  41. package/dist/ar/poi-layer/poi-layer.css.js.map +1 -1
  42. package/dist/ar/poi-layer/poi-layer.d.ts +64 -5
  43. package/dist/ar/poi-layer/poi-layer.d.ts.map +1 -1
  44. package/dist/ar/poi-layer/poi-layer.js +173 -39
  45. package/dist/ar/poi-layer/poi-layer.js.map +1 -1
  46. package/dist/ar/poi-layer-stack/poi-layer-stack.d.ts +82 -7
  47. package/dist/ar/poi-layer-stack/poi-layer-stack.d.ts.map +1 -1
  48. package/dist/ar/poi-layer-stack/poi-layer-stack.js +172 -100
  49. package/dist/ar/poi-layer-stack/poi-layer-stack.js.map +1 -1
  50. package/dist/ar/poi-projection/poi-projection.d.ts +88 -0
  51. package/dist/ar/poi-projection/poi-projection.d.ts.map +1 -0
  52. package/dist/ar/poi-projection/poi-projection.js +90 -0
  53. package/dist/ar/poi-projection/poi-projection.js.map +1 -0
  54. package/docs/MigrationGuide.mdx +61 -5
  55. package/docs/migration-guide/a11y-labels.md +8 -0
  56. package/docs/migration-guide/api-automation.md +1 -0
  57. package/package.json +2 -2
  58. package/src/ar/_test-utils.ts +18 -6
  59. package/src/ar/poi/poi-aton.ts +2 -0
  60. package/src/ar/poi/poi-base.ts +159 -70
  61. package/src/ar/poi/poi-data.ts +2 -0
  62. package/src/ar/poi/poi-dom-ownership.spec.ts +393 -0
  63. package/src/ar/poi/poi-vessel.ts +2 -0
  64. package/src/ar/poi/poi.ts +12 -113
  65. package/src/ar/poi-button/poi-button.ts +25 -3
  66. package/src/ar/poi-card/poi-card.ts +16 -2
  67. package/src/ar/poi-controller/poi-controller.spec.ts +54 -0
  68. package/src/ar/poi-controller/poi-controller.stories.ts +76 -24
  69. package/src/ar/poi-controller/poi-controller.ts +111 -41
  70. package/src/ar/poi-group/poi-group.stories.ts +18 -5
  71. package/src/ar/poi-group/poi-group.ts +87 -12
  72. package/src/ar/poi-layer/poi-layer.css +69 -18
  73. package/src/ar/poi-layer/poi-layer.stories.ts +30 -16
  74. package/src/ar/poi-layer/poi-layer.ts +289 -64
  75. package/src/ar/poi-layer-stack/poi-layer-stack.stories.ts +56 -23
  76. package/src/ar/poi-layer-stack/poi-layer-stack.ts +342 -247
  77. package/src/ar/poi-projection/poi-projection.stories.ts +100 -0
  78. package/src/ar/poi-projection/poi-projection.ts +147 -0
@@ -495,7 +495,7 @@
495
495
  {
496
496
  "kind": "variable",
497
497
  "name": "ObcPoiButton",
498
- "default": "class ObcPoiButton extends LitElement { constructor(..._args) { super(..._args); this.relativeDirection = 0; this.selected = false; this.layout = \"anchored\"; this.hasHeader = false; this.state = \"enabled\"; this.value = \"unchecked\"; this.overlapOpaque = false; this.type = \"button\"; this.inExpandedGroup = false; this.data = []; this.hasRelation = false; this.headerContent = \"\"; this.handleHeaderSlotChange = () => { this.syncSlottedHeaderState(); }; } connectedCallback() { super.connectedCallback(); this.setupHeaderContentObserver(); } disconnectedCallback() { super.disconnectedCallback(); this.headerContentObserver?.disconnect(); this.headerContentObserver = void 0; } setupHeaderContentObserver() { this.headerContentObserver?.disconnect(); this.headerContentObserver = new MutationObserver((mutations) => { for (const mutation of mutations) { if (mutation.type === \"childList\") { this.requestUpdate(); return; } if (mutation.type === \"attributes\" && mutation.target instanceof HTMLElement && mutation.target.getAttribute(\"slot\") === \"header\") { this.requestUpdate(); return; } } }); this.headerContentObserver.observe(this, { childList: true, subtree: true, attributes: true, attributeFilter: [\"slot\"] }); } get hasData() { return this.data.length > 0; } get alertClassSuffix() { if (this.state === \"enabled\") return \"none\"; return this.state; } get resolvedHeaderState() { switch (this.state) { case \"caution\": return ObcPoiHeaderState.Caution; case \"warning\": return ObcPoiHeaderState.Warning; case \"alarm\": return ObcPoiHeaderState.Alarm; case \"level-critical\": return ObcPoiHeaderState.LevelCritical; case \"level-high\": return ObcPoiHeaderState.LevelHigh; case \"level-medium\": return ObcPoiHeaderState.LevelMedium; case \"level-low\": return ObcPoiHeaderState.LevelLow; case \"level-diagnostic\": return ObcPoiHeaderState.LevelDiagnostic; default: return ObcPoiHeaderState.Selected; } } get hasHeaderContent() { return this.querySelector(\"[slot=\\\"header\\\"]\") !== null; } get hasGeneratedHeaderContent() { return this.headerContent.trim().length > 0; } syncSlottedHeaderState() { const headerSlot = this.renderRoot.querySelector(\"slot[name=\\\"header\\\"]\"); if (!headerSlot) return; const state = this.resolvedHeaderState; const assigned = headerSlot.assignedElements({ flatten: true }); const headers = /* @__PURE__ */ new Set(); for (const element of assigned) { if (element.matches(\"obc-poi-header\")) headers.add(element); for (const nested of element.querySelectorAll(\"obc-poi-header\")) headers.add(nested); } for (const header of headers) { header.state = state; header.setAttribute(\"state\", state); } } updated(_changedProperties) { this.syncSlottedHeaderState(); } renderHeader() { if (!this.hasHeader || !this.hasHeaderContent && !this.hasGeneratedHeaderContent) return nothing; return html` <div class=\"id-label\"> ${this.hasHeaderContent ? html`<slot name=\"header\" @slotchange=${this.handleHeaderSlotChange} ></slot>` : html`<obc-poi-header .content=${this.headerContent} .state=${this.resolvedHeaderState} .type=${ObcPoiHeaderType.Id} ></obc-poi-header>`} </div> `; } get poiObjectType() { return this.type === \"enhanced\" ? ObcPoiObjectType.Large : ObcPoiObjectType.Regular; } get poiObjectState() { if (this.value === \"overlapped\") return ObcPoiObjectState.Overlapped; if (this.hasData) { if (this.value === \"activated\") return ObcPoiObjectState.Activated; if (this.value === \"checked\") return ObcPoiObjectState.StaticChecked; return ObcPoiObjectState.StaticUnchecked; } if (this.value === \"activated\") return ObcPoiObjectState.Activated; if (this.value === \"checked\") return ObcPoiObjectState.Checked; return ObcPoiObjectState.Unchecked; } render() { if (this.hasData) return this.renderWithData(); return this.renderButton(); } renderPoiObject() { return html` <obc-poi-object class=\"poi-object\" .type=${this.poiObjectType} .objectStyle=${ObcPoiObjectStyle.Regular} .state=${this.poiObjectState} .interactive=${false} > <span class=\"icon\" style=\"transform: rotate(${this.relativeDirection}deg);\" > <slot></slot> </span> </obc-poi-object> `; } renderButton() { return html` <button type=\"button\" class=${classMap({ wrapper: true, selected: this.selected, [`alert-${this.alertClassSuffix}`]: true, [`type-${this.type}`]: true, [`value-${this.value}`]: true, [`layout-${this.layout}`]: true, \"overlap-opaque\": this.overlapOpaque, expanded: this.inExpandedGroup })} > ${this.renderHeader()} <div class=\"button-wrapper\"> ${this.renderSelectionFrame()} ${this.renderPoiObject()} <div class=\"alert-ring\"></div> </div> </button> `; } renderWithData() { return html` <button type=\"button\" class=${classMap({ wrapper: true, \"has-data\": true, selected: this.selected, \"has-header\": this.hasHeader && (this.hasHeaderContent || this.hasGeneratedHeaderContent), [`alert-${this.alertClassSuffix}`]: true, [`type-${this.type}`]: true, [`value-${this.value}`]: true, [`layout-${this.layout}`]: true, \"overlap-opaque\": this.overlapOpaque, expanded: this.inExpandedGroup })} > <div class=\"visible-wrapper\"></div> ${this.renderHeader()} <div class=\"data-wrapper\"> ${this.data.map((item) => html`<div class=\"data\"> <div class=\"value\">${item.value}</div> <div class=\"label\">${item.label}</div> <div class=\"unit\">${item.unit}</div> </div>`)} </div> <div class=\"button-wrapper\"> ${this.renderSelectionFrame()} ${this.renderPoiObject()} </div> ${this.hasRelation ? html`<div class=\"relation-wrapper\" part=\"relation-wrapper\"> <slot name=\"relation\" class=\"relation\" part=\"relation\"></slot> </div>` : nothing} <div class=\"alert-ring\"></div> </button> `; } get selectionFrameType() { return this.type === \"enhanced\" ? ObcPoiSelectionFrameType.Enhanced : ObcPoiSelectionFrameType.Button; } get selectionFrameState() { return this.state === \"enabled\" ? ObcPoiSelectionFrameState.Regular : ObcPoiSelectionFrameState.Alert; } renderSelectionFrame() { if (!this.selected || this.layout === \"inline\") return nothing; return html` <obc-poi-selection-frame class=\"selection-frame\" .type=${this.selectionFrameType} .state=${this.selectionFrameState} ></obc-poi-selection-frame> `; } static { this.styles = unsafeCSS(poi_button_default); } }"
498
+ "default": "class ObcPoiButton extends LitElement { constructor(..._args) { super(..._args); this.relativeDirection = 0; this.selected = false; this.layout = \"anchored\"; this.hasHeader = false; this.state = \"enabled\"; this.value = \"unchecked\"; this.overlapOpaque = false; this.type = \"button\"; this.inExpandedGroup = false; this.data = []; this.hasRelation = false; this.headerContent = \"\"; this.handleLightSlotChange = () => { this.requestUpdate(); this.syncSlottedHeaderState(); }; this.handleHeaderSlotChange = () => { this.syncSlottedHeaderState(); }; } connectedCallback() { super.connectedCallback(); this.addEventListener(\"slotchange\", this.handleLightSlotChange); this.setupHeaderContentObserver(); } disconnectedCallback() { super.disconnectedCallback(); this.removeEventListener(\"slotchange\", this.handleLightSlotChange); this.headerContentObserver?.disconnect(); this.headerContentObserver = void 0; } setupHeaderContentObserver() { this.headerContentObserver?.disconnect(); this.headerContentObserver = new MutationObserver((mutations) => { for (const mutation of mutations) { if (mutation.type === \"childList\") { this.requestUpdate(); return; } if (mutation.type === \"attributes\" && mutation.target instanceof HTMLElement && mutation.target.getAttribute(\"slot\") === \"header\") { this.requestUpdate(); return; } } }); this.headerContentObserver.observe(this, { childList: true, subtree: true, attributes: true, attributeFilter: [\"slot\"] }); } get hasData() { return this.data.length > 0; } get alertClassSuffix() { if (this.state === \"enabled\") return \"none\"; return this.state; } get resolvedHeaderState() { switch (this.state) { case \"caution\": return ObcPoiHeaderState.Caution; case \"warning\": return ObcPoiHeaderState.Warning; case \"alarm\": return ObcPoiHeaderState.Alarm; case \"level-critical\": return ObcPoiHeaderState.LevelCritical; case \"level-high\": return ObcPoiHeaderState.LevelHigh; case \"level-medium\": return ObcPoiHeaderState.LevelMedium; case \"level-low\": return ObcPoiHeaderState.LevelLow; case \"level-diagnostic\": return ObcPoiHeaderState.LevelDiagnostic; default: return ObcPoiHeaderState.Selected; } } get hasHeaderContent() { for (const child of this.querySelectorAll(\"[slot=\\\"header\\\"]\")) if (child instanceof HTMLSlotElement) { if (child.assignedElements({ flatten: true }).length > 0) return true; } else return true; return false; } get hasGeneratedHeaderContent() { return this.headerContent.trim().length > 0; } syncSlottedHeaderState() { const headerSlot = this.renderRoot.querySelector(\"slot[name=\\\"header\\\"]\"); if (!headerSlot) return; const state = this.resolvedHeaderState; const assigned = headerSlot.assignedElements({ flatten: true }); const headers = /* @__PURE__ */ new Set(); for (const element of assigned) { if (element.matches(\"obc-poi-header\")) headers.add(element); for (const nested of element.querySelectorAll(\"obc-poi-header\")) headers.add(nested); } for (const header of headers) { header.state = state; header.setAttribute(\"state\", state); } } updated(_changedProperties) { this.syncSlottedHeaderState(); } renderHeader() { if (!this.hasHeader || !this.hasHeaderContent && !this.hasGeneratedHeaderContent) return nothing; return html` <div class=\"id-label\"> ${this.hasHeaderContent ? html`<slot name=\"header\" @slotchange=${this.handleHeaderSlotChange} ></slot>` : html`<obc-poi-header .content=${this.headerContent} .state=${this.resolvedHeaderState} .type=${ObcPoiHeaderType.Id} ></obc-poi-header>`} </div> `; } get poiObjectType() { return this.type === \"enhanced\" ? ObcPoiObjectType.Large : ObcPoiObjectType.Regular; } get poiObjectState() { if (this.value === \"overlapped\") return ObcPoiObjectState.Overlapped; if (this.hasData) { if (this.value === \"activated\") return ObcPoiObjectState.Activated; if (this.value === \"checked\") return ObcPoiObjectState.StaticChecked; return ObcPoiObjectState.StaticUnchecked; } if (this.value === \"activated\") return ObcPoiObjectState.Activated; if (this.value === \"checked\") return ObcPoiObjectState.Checked; return ObcPoiObjectState.Unchecked; } render() { if (this.hasData) return this.renderWithData(); return this.renderButton(); } renderPoiObject() { return html` <obc-poi-object class=\"poi-object\" .type=${this.poiObjectType} .objectStyle=${ObcPoiObjectStyle.Regular} .state=${this.poiObjectState} .interactive=${false} > <span class=\"icon\" style=\"transform: rotate(${this.relativeDirection}deg);\" > <slot></slot> </span> </obc-poi-object> `; } renderButton() { return html` <button type=\"button\" class=${classMap({ wrapper: true, selected: this.selected, [`alert-${this.alertClassSuffix}`]: true, [`type-${this.type}`]: true, [`value-${this.value}`]: true, [`layout-${this.layout}`]: true, \"overlap-opaque\": this.overlapOpaque, expanded: this.inExpandedGroup })} > ${this.renderHeader()} <div class=\"button-wrapper\"> ${this.renderSelectionFrame()} ${this.renderPoiObject()} <div class=\"alert-ring\"></div> </div> </button> `; } renderWithData() { return html` <button type=\"button\" class=${classMap({ wrapper: true, \"has-data\": true, selected: this.selected, \"has-header\": this.hasHeader && (this.hasHeaderContent || this.hasGeneratedHeaderContent), [`alert-${this.alertClassSuffix}`]: true, [`type-${this.type}`]: true, [`value-${this.value}`]: true, [`layout-${this.layout}`]: true, \"overlap-opaque\": this.overlapOpaque, expanded: this.inExpandedGroup })} > <div class=\"visible-wrapper\"></div> ${this.renderHeader()} <div class=\"data-wrapper\"> ${this.data.map((item) => html`<div class=\"data\"> <div class=\"value\">${item.value}</div> <div class=\"label\">${item.label}</div> <div class=\"unit\">${item.unit}</div> </div>`)} </div> <div class=\"button-wrapper\"> ${this.renderSelectionFrame()} ${this.renderPoiObject()} </div> ${this.hasRelation ? html`<div class=\"relation-wrapper\" part=\"relation-wrapper\"> <slot name=\"relation\" class=\"relation\" part=\"relation\"></slot> </div>` : nothing} <div class=\"alert-ring\"></div> </button> `; } get selectionFrameType() { return this.type === \"enhanced\" ? ObcPoiSelectionFrameType.Enhanced : ObcPoiSelectionFrameType.Button; } get selectionFrameState() { return this.state === \"enabled\" ? ObcPoiSelectionFrameState.Regular : ObcPoiSelectionFrameState.Alert; } renderSelectionFrame() { if (!this.selected || this.layout === \"inline\") return nothing; return html` <obc-poi-selection-frame class=\"selection-frame\" .type=${this.selectionFrameType} .state=${this.selectionFrameState} ></obc-poi-selection-frame> `; } static { this.styles = unsafeCSS(poi_button_default); } }"
499
499
  }
500
500
  ],
501
501
  "exports": [
@@ -590,7 +590,7 @@
590
590
  {
591
591
  "kind": "variable",
592
592
  "name": "ObcPoiCard",
593
- "default": "class ObcPoiCard extends LitElement { constructor(..._args) { super(..._args); this.pointerDirection = \"none\"; this.fixedSize = false; this.showHeader = true; this.headerVariant = ObcPoiCardHeaderVariant.Condensed; this.index = \"1\"; this.cardTitle = \"\"; this.description = \"\"; this.source = \"\"; this.timestamp = \"\"; this.hasLeadingIcon = false; this.hasCloseButton = false; this.interactive = false; this.hasAlert = false; } handleCardClick() { if (!this.interactive) return; this.dispatchEvent(new CustomEvent(\"card-click\", { detail: { index: this.index }, bubbles: true, composed: true })); } handleKeyDown(e) { if (!this.interactive) return; if (e.target !== e.currentTarget) return; if (e.key === \" \") e.preventDefault(); else if (e.key === \"Enter\" && !e.repeat) { e.preventDefault(); this.handleCardClick(); } } handleKeyUp(e) { if (!this.interactive) return; if (e.target !== e.currentTarget) return; if (e.key === \" \") { e.preventDefault(); this.handleCardClick(); } } renderPointerSvg(direction) { const paths = { top: \"M6 0L12 6H0L6 0Z\", bottom: \"M6 6L0 0H12L6 6Z\", left: \"M0 6L6 0V12L0 6Z\", right: \"M6 6L0 0V12L6 6Z\" }; const isVertical = direction === \"top\" || direction === \"bottom\"; const width = isVertical ? 12 : 6; const height = isVertical ? 6 : 12; return html` <svg width=\"${width}\" height=\"${height}\" viewBox=\"0 0 ${width} ${height}\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" > <path d=\"${paths[direction]}\" fill=\"var(--overlay-border-outline-color)\" /> </svg> `; } renderTopPointer() { if (this.pointerDirection !== \"top\") return nothing; return html` <div class=\"pointer-container top\">${this.renderPointerSvg(\"top\")}</div> `; } renderBottomPointer() { if (this.pointerDirection !== \"bottom\") return nothing; return html` <div class=\"pointer-container bottom\"> ${this.renderPointerSvg(\"bottom\")} </div> `; } renderLeftPointer() { if (this.pointerDirection !== \"left\") return nothing; return html` <div class=\"pointer-container left\">${this.renderPointerSvg(\"left\")}</div> `; } renderRightPointer() { if (this.pointerDirection !== \"right\") return nothing; return html` <div class=\"pointer-container right\"> ${this.renderPointerSvg(\"right\")} </div> `; } renderHeader() { if (!this.showHeader) return nothing; return html` <obc-poi-card-header variant=${this.headerVariant} index=${this.index} cardTitle=${this.cardTitle} description=${this.description} source=${this.source} timestamp=${this.timestamp} ?hasLeadingIcon=${this.hasLeadingIcon} ?hasCloseButton=${this.hasCloseButton} > <slot name=\"leading-icon\" slot=\"leading-icon\"></slot> <slot name=\"poi-icon\" slot=\"poi-icon\"></slot> </obc-poi-card-header> `; } renderAlertLayer() { if (!this.interactive || !this.hasAlert) return nothing; return html` <div class=\"alert-layer\"> <div class=\"ring-outer\"></div> <div class=\"ring-middle alert\"></div> <div class=\"ring-inner\"></div> </div> `; } render() { return html` <div class=${classMap({ wrapper: true, \"hug-content\": !this.fixedSize, \"fixed-size\": this.fixedSize, interactive: this.interactive })} > ${this.renderTopPointer()} <div class=\"center\"> ${this.renderLeftPointer()} <div class=\"content-box\" role=${this.interactive ? \"button\" : nothing} tabindex=${this.interactive ? \"0\" : nothing} aria-disabled=${this.interactive ? \"false\" : nothing} @click=${this.handleCardClick} @keydown=${this.handleKeyDown} @keyup=${this.handleKeyUp} > ${this.renderHeader()} <div class=\"content\"> <slot></slot> </div> ${this.renderAlertLayer()} </div> ${this.renderRightPointer()} </div> ${this.renderBottomPointer()} </div> `; } static { this.styles = unsafeCSS(poi_card_default); } }"
593
+ "default": "class ObcPoiCard extends LitElement { constructor(..._args) { super(..._args); this.pointerDirection = \"none\"; this.fixedSize = false; this.showHeader = true; this.headerVariant = ObcPoiCardHeaderVariant.Condensed; this.index = \"1\"; this.cardTitle = \"\"; this.description = \"\"; this.source = \"\"; this.timestamp = \"\"; this.hasLeadingIcon = false; this.hasCloseButton = false; this.interactive = false; this.hasAlert = false; } handleCardClick() { if (!this.interactive) return; this.dispatchEvent(new CustomEvent(\"card-click\", { detail: { index: this.index }, bubbles: true, composed: true })); } handleKeyDown(e) { if (!this.interactive) return; if (e.target !== e.currentTarget) return; if (e.key === \" \") e.preventDefault(); else if (e.key === \"Enter\" && !e.repeat) { e.preventDefault(); this.handleCardClick(); } } handleKeyUp(e) { if (!this.interactive) return; if (e.target !== e.currentTarget) return; if (e.key === \" \") { e.preventDefault(); this.handleCardClick(); } } renderPointerSvg(direction) { const paths = { top: \"M6 0L12 6H0L6 0Z\", bottom: \"M6 6L0 0H12L6 6Z\", left: \"M0 6L6 0V12L0 6Z\", right: \"M6 6L0 0V12L6 6Z\" }; const isVertical = direction === \"top\" || direction === \"bottom\"; const width = isVertical ? 12 : 6; const height = isVertical ? 6 : 12; return html` <svg width=\"${width}\" height=\"${height}\" viewBox=\"0 0 ${width} ${height}\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" > <path d=\"${paths[direction]}\" fill=\"var(--overlay-border-outline-color)\" /> </svg> `; } renderTopPointer() { if (this.pointerDirection !== \"top\") return nothing; return html` <div class=\"pointer-container top\">${this.renderPointerSvg(\"top\")}</div> `; } renderBottomPointer() { if (this.pointerDirection !== \"bottom\") return nothing; return html` <div class=\"pointer-container bottom\"> ${this.renderPointerSvg(\"bottom\")} </div> `; } renderLeftPointer() { if (this.pointerDirection !== \"left\") return nothing; return html` <div class=\"pointer-container left\">${this.renderPointerSvg(\"left\")}</div> `; } renderRightPointer() { if (this.pointerDirection !== \"right\") return nothing; return html` <div class=\"pointer-container right\"> ${this.renderPointerSvg(\"right\")} </div> `; } renderHeader() { if (!this.showHeader) return nothing; return html` <obc-poi-card-header part=\"header\" variant=${this.headerVariant} index=${this.index} cardTitle=${this.cardTitle} description=${this.description} source=${this.source} timestamp=${this.timestamp} ?hasLeadingIcon=${this.hasLeadingIcon} ?hasCloseButton=${this.hasCloseButton} > <slot name=\"leading-icon\" slot=\"leading-icon\"></slot> <slot name=\"poi-icon\" slot=\"poi-icon\"></slot> </obc-poi-card-header> `; } renderAlertLayer() { if (!this.interactive || !this.hasAlert) return nothing; return html` <div class=\"alert-layer\"> <div class=\"ring-outer\"></div> <div class=\"ring-middle alert\"></div> <div class=\"ring-inner\"></div> </div> `; } render() { return html` <div part=\"wrapper\" class=${classMap({ wrapper: true, \"hug-content\": !this.fixedSize, \"fixed-size\": this.fixedSize, interactive: this.interactive })} > ${this.renderTopPointer()} <div class=\"center\"> ${this.renderLeftPointer()} <div part=\"content-box\" class=\"content-box\" role=${this.interactive ? \"button\" : nothing} tabindex=${this.interactive ? \"0\" : nothing} aria-disabled=${this.interactive ? \"false\" : nothing} @click=${this.handleCardClick} @keydown=${this.handleKeyDown} @keyup=${this.handleKeyUp} > ${this.renderHeader()} <div part=\"content\" class=\"content\"> <slot></slot> </div> ${this.renderAlertLayer()} </div> ${this.renderRightPointer()} </div> ${this.renderBottomPointer()} </div> `; } static { this.styles = unsafeCSS(poi_card_default); } }"
594
594
  }
595
595
  ],
596
596
  "exports": [
@@ -627,7 +627,7 @@
627
627
  {
628
628
  "kind": "variable",
629
629
  "name": "ObcPoiController",
630
- "default": "class ObcPoiController extends LitElement { constructor(..._args) { super(..._args); this.fit = \"contain\"; this.frames = null; this.detections = null; this.frameIndex = null; this.confidenceMin = null; this.classFilter = null; this.keyFn = null; this.mediaWidth = 0; this.mediaHeight = 0; this.renderWidth = 0; this.renderHeight = 0; this.syncRaf = 0; this.handleMediaSlotChange = () => this.setupMediaObservers(); this.handleStackSlotChange = () => { this.currentLayer = null; this.setupLayerObserver(); this.scheduleSync(); }; this.controllerTargets = /* @__PURE__ */ new Map(); this.currentMedia = null; this.currentLayer = null; this.mediaHandlers = { loadedmetadata: () => { if (this.currentMedia) this.updateMediaMetrics(this.currentMedia); }, timeupdate: () => this.requestUpdate(), seeked: () => this.requestUpdate(), load: () => { if (this.currentMedia) this.updateMediaMetrics(this.currentMedia); } }; } firstUpdated() { this.setupMediaObservers(); (this.shadowRoot?.querySelector(\"slot[name=\\\"media\\\"]\"))?.addEventListener(\"slotchange\", this.handleMediaSlotChange); (this.shadowRoot?.querySelector(\"slot[name=\\\"stack\\\"]\"))?.addEventListener(\"slotchange\", this.handleStackSlotChange); } updated(changed) { if (changed.has(\"detections\") || changed.has(\"frames\") || changed.has(\"frameIndex\") || changed.has(\"fit\") || changed.has(\"confidenceMin\") || changed.has(\"classFilter\") || changed.has(\"mediaWidth\") || changed.has(\"mediaHeight\") || changed.has(\"renderWidth\") || changed.has(\"renderHeight\")) this.scheduleSync(); } scheduleSync() { if (this.syncRaf) return; this.syncRaf = requestAnimationFrame(() => { this.syncRaf = 0; this.syncTargetsToCustomStack(); }); } disconnectedCallback() { super.disconnectedCallback(); if (this.syncRaf) { cancelAnimationFrame(this.syncRaf); this.syncRaf = 0; } this.resizeObserver?.disconnect(); this.resizeObserver = void 0; this.layerResizeObserver?.disconnect(); this.layerResizeObserver = void 0; this.currentLayer = null; this.detachMediaListeners(); this.controllerTargets.clear(); (this.shadowRoot?.querySelector(\"slot[name=\\\"media\\\"]\"))?.removeEventListener(\"slotchange\", this.handleMediaSlotChange); (this.shadowRoot?.querySelector(\"slot[name=\\\"stack\\\"]\"))?.removeEventListener(\"slotchange\", this.handleStackSlotChange); } setupLayerObserver() { const layer = this.resolveTargetLayer(); if (layer === this.currentLayer) return; this.layerResizeObserver?.disconnect(); this.layerResizeObserver = void 0; this.currentLayer = layer; if (!layer) return; this.layerResizeObserver = new ResizeObserver(() => { this.scheduleSync(); }); this.layerResizeObserver.observe(layer); } resolveTargetLayer() { const stack = this.getStackElement(); if (!stack) return null; const explicitLayer = stack.querySelector(\"obc-poi-layer[data-controller-layer=\\\"background\\\"]\"); if (explicitLayer) return explicitLayer; const layers = Array.from(stack.querySelectorAll(\"obc-poi-layer\")); const isSelectedLayer = (candidate) => candidate.isSelected === true; return layers.find((candidate) => !isSelectedLayer(candidate)) ?? layers[layers.length - 1] ?? null; } setupMediaObservers() { this.resizeObserver?.disconnect(); this.resizeObserver = void 0; const media = this.getMediaElement(); if (!media) return; if (this.currentMedia && this.currentMedia !== media) this.detachMediaListeners(); this.currentMedia = media; this.updateMediaMetrics(media); if (media instanceof HTMLVideoElement) { media.addEventListener(\"loadedmetadata\", this.mediaHandlers.loadedmetadata); media.addEventListener(\"timeupdate\", this.mediaHandlers.timeupdate); media.addEventListener(\"seeked\", this.mediaHandlers.seeked); } else if (media instanceof HTMLImageElement) { if (!media.complete) media.addEventListener(\"load\", this.mediaHandlers.load); } this.resizeObserver = new ResizeObserver(() => { this.updateMediaMetrics(media); }); this.resizeObserver.observe(media); } detachMediaListeners() { if (!this.currentMedia) return; if (this.currentMedia instanceof HTMLVideoElement) { this.currentMedia.removeEventListener(\"loadedmetadata\", this.mediaHandlers.loadedmetadata); this.currentMedia.removeEventListener(\"timeupdate\", this.mediaHandlers.timeupdate); this.currentMedia.removeEventListener(\"seeked\", this.mediaHandlers.seeked); } else if (this.currentMedia instanceof HTMLImageElement) this.currentMedia.removeEventListener(\"load\", this.mediaHandlers.load); this.currentMedia = null; } getMediaElement() { const el = this.mediaElements?.[0]; if (el instanceof HTMLVideoElement || el instanceof HTMLImageElement) return el; return null; } getStackElement() { const el = this.stackElements?.[0]; if (el instanceof HTMLElement) return el; return null; } updateMediaMetrics(media) { const rect = media.getBoundingClientRect(); this.renderWidth = rect.width; this.renderHeight = rect.height; if (media instanceof HTMLVideoElement) { this.mediaWidth = media.videoWidth || this.mediaWidth; this.mediaHeight = media.videoHeight || this.mediaHeight; } else { this.mediaWidth = media.naturalWidth || this.mediaWidth; this.mediaHeight = media.naturalHeight || this.mediaHeight; } } getActiveDetections() { if (Array.isArray(this.detections)) return this.filterDetections(this.detections); if (!Array.isArray(this.frames) || this.frames.length === 0) return []; const frame = this.pickFrame(); if (!frame) return []; return this.filterDetections(frame.detections ?? []); } filterDetections(detections) { let filtered = detections; if (this.confidenceMin !== null && this.confidenceMin !== void 0) filtered = filtered.filter((det) => det.confidence === void 0 || det.confidence >= this.confidenceMin); if (Array.isArray(this.classFilter) && this.classFilter.length > 0) filtered = filtered.filter((det) => det.class !== void 0 && this.classFilter.includes(det.class)); return filtered; } pickFrame() { const frames = this.frames ?? []; if (frames.length === 0) return null; const media = this.getMediaElement(); if (this.frameIndex !== null && this.frameIndex !== void 0) return frames[this.frameIndex] ?? frames[frames.length - 1] ?? null; if (media instanceof HTMLVideoElement) { const time = media.currentTime; let best = frames[0] ?? null; let bestDelta = Number.POSITIVE_INFINITY; for (const frame of frames) { if (typeof frame.timestamp !== \"number\") continue; const delta = Math.abs(frame.timestamp - time); if (delta < bestDelta) { best = frame; bestDelta = delta; } } return best; } return frames[0] ?? null; } mapDetection(det) { if (!Number.isFinite(this.mediaWidth) || !Number.isFinite(this.mediaHeight) || !Number.isFinite(this.renderWidth) || !Number.isFinite(this.renderHeight) || this.mediaWidth === 0 || this.mediaHeight === 0 || this.renderWidth === 0 || this.renderHeight === 0) return null; const scale = this.fit === \"cover\" ? Math.max(this.renderWidth / this.mediaWidth, this.renderHeight / this.mediaHeight) : Math.min(this.renderWidth / this.mediaWidth, this.renderHeight / this.mediaHeight); const contentWidth = this.mediaWidth * scale; const contentHeight = this.mediaHeight * scale; const offsetX = (this.renderWidth - contentWidth) / 2; const offsetY = (this.renderHeight - contentHeight) / 2; return { x: offsetX + det.x * scale, y: offsetY + det.y * scale, scale }; } syncTargetsToCustomStack() { const clearTargets = () => { if (this.controllerTargets.size === 0) return; this.controllerTargets.forEach((target) => target.remove()); this.controllerTargets.clear(); }; if (!this.currentLayer || !this.currentLayer.isConnected) this.setupLayerObserver(); const layer = this.currentLayer; if (!layer) { clearTargets(); return; } const controllerRect = this.getBoundingClientRect(); const layerBottomInController = layer.getBoundingClientRect().bottom - controllerRect.top; const active = this.getActiveDetections(); const activeKeys = /* @__PURE__ */ new Set(); active.forEach((det, index) => { const mapped = this.mapDetection(det); if (!mapped) return; const key = det.id ?? (this.keyFn ? this.keyFn(det, index) : `index:${index}`); activeKeys.add(key); let target = this.controllerTargets.get(key); if (!target) { target = document.createElement(\"obc-poi-data\"); target.dataset.controller = \"1\"; target.dataset.detectionIndex = String(index); target.fixedTarget = false; this.controllerTargets.set(key, target); } if (!target.isConnected || target.parentElement === null) layer.appendChild(target); target.dataset.detectionIndex = String(index); target.x = mapped.x; target.y = Math.max(0, mapped.y - layerBottomInController); const boxWidth = typeof det.box_width === \"number\" && Number.isFinite(det.box_width) ? det.box_width * mapped.scale : null; const boxHeight = typeof det.box_height === \"number\" && Number.isFinite(det.box_height) ? det.box_height * mapped.scale : null; target.boxWidth = boxWidth; target.boxHeight = boxHeight; target.buttonType = resolvePoiButtonTypeFromBoxSize(boxWidth, boxHeight); const heading = det.heading ?? det.direction; if (typeof heading === \"number\" && Number.isFinite(heading)) target.relativeDirection = heading; }); Array.from(this.controllerTargets.entries()).forEach(([key, target]) => { if (!activeKeys.has(key)) { target.remove(); this.controllerTargets.delete(key); } }); } render() { return html` <div class=\"wrapper\"> <div class=\"media\"> <slot name=\"media\"></slot> </div> <div class=\"overlay\"> <slot name=\"stack\"></slot> </div> </div> `; } static { this.styles = unsafeCSS(poi_controller_default); } }"
630
+ "default": "class ObcPoiController extends LitElement { constructor(..._args) { super(..._args); this.fit = \"contain\"; this.frames = null; this.detections = null; this.frameIndex = null; this.confidenceMin = null; this.classFilter = null; this.keyFn = null; this.xFilterCutoffHz = null; this.yFilterCutoffHz = null; this.mediaWidth = 0; this.mediaHeight = 0; this.renderWidth = 0; this.renderHeight = 0; this.syncRaf = 0; this.handleMediaSlotChange = () => this.setupMediaObservers(); this.handleStackSlotChange = () => { this.currentLayer = null; this.setupLayerObserver(); this.scheduleSync(); }; this.controllerTargets = /* @__PURE__ */ new Map(); this.currentMedia = null; this.currentLayer = null; this.mediaHandlers = { loadedmetadata: () => { if (this.currentMedia) this.updateMediaMetrics(this.currentMedia); }, timeupdate: () => this.requestUpdate(), seeked: () => this.requestUpdate(), load: () => { if (this.currentMedia) this.updateMediaMetrics(this.currentMedia); } }; } firstUpdated() { this.setupMediaObservers(); (this.shadowRoot?.querySelector(\"slot[name=\\\"media\\\"]\"))?.addEventListener(\"slotchange\", this.handleMediaSlotChange); (this.shadowRoot?.querySelector(\"slot[name=\\\"stack\\\"]\"))?.addEventListener(\"slotchange\", this.handleStackSlotChange); } updated(changed) { if (changed.has(\"detections\") || changed.has(\"frames\") || changed.has(\"frameIndex\") || changed.has(\"fit\") || changed.has(\"confidenceMin\") || changed.has(\"classFilter\") || changed.has(\"mediaWidth\") || changed.has(\"mediaHeight\") || changed.has(\"renderWidth\") || changed.has(\"renderHeight\")) this.scheduleSync(); } scheduleSync() { if (this.syncRaf) return; this.syncRaf = requestAnimationFrame(() => { this.syncRaf = 0; this.syncTargetsToCustomStack(); }); } disconnectedCallback() { super.disconnectedCallback(); if (this.syncRaf) { cancelAnimationFrame(this.syncRaf); this.syncRaf = 0; } this.resizeObserver?.disconnect(); this.resizeObserver = void 0; this.layerResizeObserver?.disconnect(); this.layerResizeObserver = void 0; this.currentLayer = null; this.detachMediaListeners(); this.controllerTargets.clear(); (this.shadowRoot?.querySelector(\"slot[name=\\\"media\\\"]\"))?.removeEventListener(\"slotchange\", this.handleMediaSlotChange); (this.shadowRoot?.querySelector(\"slot[name=\\\"stack\\\"]\"))?.removeEventListener(\"slotchange\", this.handleStackSlotChange); } setupLayerObserver() { const layer = this.resolveTargetLayer(); if (layer === this.currentLayer) return; this.layerResizeObserver?.disconnect(); this.layerResizeObserver = void 0; this.currentLayer = layer; if (!layer) return; this.layerResizeObserver = new ResizeObserver(() => { this.scheduleSync(); }); this.layerResizeObserver.observe(layer); } resolveTargetLayer() { const stack = this.getStackElement(); if (!stack) return null; const explicitLayer = stack.querySelector(`obc-poi-layer[${POI_CONTROLLER_LAYER_ATTR}=\"${POI_CONTROLLER_BACKGROUND_LAYER}\"]`); if (explicitLayer) return explicitLayer; const layers = Array.from(stack.querySelectorAll(\"obc-poi-layer\")); const isSelectedLayer = (candidate) => candidate.isSelected === true; return layers.find((candidate) => !isSelectedLayer(candidate)) ?? layers[layers.length - 1] ?? null; } setupMediaObservers() { this.resizeObserver?.disconnect(); this.resizeObserver = void 0; const media = this.getMediaElement(); if (!media) return; if (this.currentMedia && this.currentMedia !== media) this.detachMediaListeners(); this.currentMedia = media; this.updateMediaMetrics(media); if (media instanceof HTMLVideoElement) { media.addEventListener(\"loadedmetadata\", this.mediaHandlers.loadedmetadata); media.addEventListener(\"timeupdate\", this.mediaHandlers.timeupdate); media.addEventListener(\"seeked\", this.mediaHandlers.seeked); } else if (media instanceof HTMLImageElement) { if (!media.complete) media.addEventListener(\"load\", this.mediaHandlers.load); } this.resizeObserver = new ResizeObserver(() => { this.updateMediaMetrics(media); }); this.resizeObserver.observe(media); } detachMediaListeners() { if (!this.currentMedia) return; if (this.currentMedia instanceof HTMLVideoElement) { this.currentMedia.removeEventListener(\"loadedmetadata\", this.mediaHandlers.loadedmetadata); this.currentMedia.removeEventListener(\"timeupdate\", this.mediaHandlers.timeupdate); this.currentMedia.removeEventListener(\"seeked\", this.mediaHandlers.seeked); } else if (this.currentMedia instanceof HTMLImageElement) this.currentMedia.removeEventListener(\"load\", this.mediaHandlers.load); this.currentMedia = null; } getMediaElement() { const el = this.mediaElements?.[0]; if (el instanceof HTMLVideoElement || el instanceof HTMLImageElement) return el; return null; } getStackElement() { const el = this.stackElements?.[0]; if (el instanceof HTMLElement) return el; return null; } updateMediaMetrics(media) { const rect = media.getBoundingClientRect(); this.renderWidth = rect.width; this.renderHeight = rect.height; if (media instanceof HTMLVideoElement) { this.mediaWidth = media.videoWidth || this.mediaWidth; this.mediaHeight = media.videoHeight || this.mediaHeight; } else { this.mediaWidth = media.naturalWidth || this.mediaWidth; this.mediaHeight = media.naturalHeight || this.mediaHeight; } } getActiveDetections() { if (Array.isArray(this.detections)) return this.filterDetections(this.detections); if (!Array.isArray(this.frames) || this.frames.length === 0) return []; const frame = this.pickFrame(); if (!frame) return []; return this.filterDetections(frame.detections ?? []); } filterDetections(detections) { let filtered = detections; if (this.confidenceMin !== null && this.confidenceMin !== void 0) filtered = filtered.filter((det) => det.confidence === void 0 || det.confidence >= this.confidenceMin); if (Array.isArray(this.classFilter) && this.classFilter.length > 0) filtered = filtered.filter((det) => det.class !== void 0 && this.classFilter.includes(det.class)); return filtered; } pickFrame() { const frames = this.frames ?? []; if (frames.length === 0) return null; const media = this.getMediaElement(); if (this.frameIndex !== null && this.frameIndex !== void 0) return frames[this.frameIndex] ?? frames[frames.length - 1] ?? null; if (media instanceof HTMLVideoElement) { const time = media.currentTime; let best = frames[0] ?? null; let bestDelta = Number.POSITIVE_INFINITY; for (const frame of frames) { if (typeof frame.timestamp !== \"number\") continue; const delta = Math.abs(frame.timestamp - time); if (delta < bestDelta) { best = frame; bestDelta = delta; } } return best; } return frames[0] ?? null; } computeCurrentProjection() { return computeMediaProjection({ mediaWidth: this.mediaWidth, mediaHeight: this.mediaHeight, renderWidth: this.renderWidth, renderHeight: this.renderHeight, fit: this.fit === \"cover\" ? MediaFit.Cover : MediaFit.Contain }); } mapDetection(det, projection = this.computeCurrentProjection()) { if (!projection) return null; const point = projectPoint(projection, det.x, det.y); return { x: point.x, y: point.y, scale: projection.scale }; } syncTargetsToCustomStack() { const clearTargets = () => { if (this.controllerTargets.size === 0) return; this.controllerTargets.forEach((target) => target.remove()); this.controllerTargets.clear(); }; if (!this.currentLayer || !this.currentLayer.isConnected) this.setupLayerObserver(); const layer = this.currentLayer; if (!layer) { clearTargets(); return; } const controllerRect = this.getBoundingClientRect(); const layerBottomInController = layer.getBoundingClientRect().bottom - controllerRect.top; const active = this.getActiveDetections(); const activeKeys = /* @__PURE__ */ new Set(); const projection = this.computeCurrentProjection(); active.forEach((det, index) => { const mapped = this.mapDetection(det, projection); if (!mapped) return; const key = det.id ?? (this.keyFn ? this.keyFn(det, index) : `index:${index}`); activeKeys.add(key); const tag = DETECTION_VARIANT_TAGS[det.variant ?? \"data\"]; let target = this.controllerTargets.get(key); if (target && target.tagName.toLowerCase() !== tag) { target.remove(); this.controllerTargets.delete(key); target = void 0; } if (!target) { target = document.createElement(tag); target.dataset.controller = \"1\"; target.dataset.detectionIndex = String(index); target.fixedTarget = false; this.controllerTargets.set(key, target); } const iconTag = det.icon?.toLowerCase() ?? null; const currentIcon = target.firstElementChild; if (iconTag) { if (currentIcon?.tagName.toLowerCase() !== iconTag) { currentIcon?.remove(); target.appendChild(document.createElement(iconTag)); } } else if (currentIcon) currentIcon.remove(); if (!target.isConnected || target.parentElement === null) layer.appendChild(target); target.dataset.detectionIndex = String(index); target.x = mapped.x; target.y = Math.max(0, mapped.y - layerBottomInController); const boxWidth = typeof det.box_width === \"number\" && Number.isFinite(det.box_width) ? det.box_width * mapped.scale : null; const boxHeight = typeof det.box_height === \"number\" && Number.isFinite(det.box_height) ? det.box_height * mapped.scale : null; target.boxWidth = boxWidth; target.boxHeight = boxHeight; target.buttonType = resolvePoiButtonTypeFromBoxSize(boxWidth, boxHeight); const heading = det.heading ?? det.direction; if (typeof heading === \"number\" && Number.isFinite(heading)) target.relativeDirection = heading; target.state = det.state ?? ObcPoiState.Enabled; target.data = det.data ?? []; target.xFilterCutoffHz = this.xFilterCutoffHz ?? 16; target.yFilterCutoffHz = this.yFilterCutoffHz ?? 16; }); Array.from(this.controllerTargets.entries()).forEach(([key, target]) => { if (!activeKeys.has(key)) { target.remove(); this.controllerTargets.delete(key); } }); } render() { return html` <div class=\"wrapper\"> <div class=\"media\"> <slot name=\"media\"></slot> </div> <div class=\"overlay\"> <slot name=\"stack\"></slot> </div> </div> `; } static { this.styles = unsafeCSS(poi_controller_default); } }"
631
631
  }
632
632
  ],
633
633
  "exports": [
@@ -639,6 +639,30 @@
639
639
  "module": "dist/ar/poi-controller/poi-controller.js"
640
640
  }
641
641
  },
642
+ {
643
+ "kind": "js",
644
+ "name": "POI_CONTROLLER_BACKGROUND_LAYER",
645
+ "declaration": {
646
+ "name": "POI_CONTROLLER_BACKGROUND_LAYER",
647
+ "module": "dist/ar/poi-controller/poi-controller.js"
648
+ }
649
+ },
650
+ {
651
+ "kind": "js",
652
+ "name": "POI_CONTROLLER_LAYER_ATTR",
653
+ "declaration": {
654
+ "name": "POI_CONTROLLER_LAYER_ATTR",
655
+ "module": "dist/ar/poi-controller/poi-controller.js"
656
+ }
657
+ },
658
+ {
659
+ "kind": "js",
660
+ "name": "PoiDetectionVariant",
661
+ "declaration": {
662
+ "name": "PoiDetectionVariant",
663
+ "module": "dist/ar/poi-controller/poi-controller.js"
664
+ }
665
+ },
642
666
  {
643
667
  "kind": "js",
644
668
  "name": "PoiFitMode",
@@ -656,7 +680,7 @@
656
680
  {
657
681
  "kind": "variable",
658
682
  "name": "ObcPoiGroup",
659
- "default": "class ObcPoiGroup extends LitElement { constructor() { super(); this.expand = false; this.collapsing = false; this.positionVertical = \"0px\"; this.internalSwapping = false; this.wrapperOffsetX = \"0px\"; this.wrapperWidth = \"48px\"; this.wrapperVisible = false; this.wrapperHeight = \"48px\"; this.wrapperHasValues = false; this.topOffsetAnimationManager = new AnimationManager(); this.topOffsetProgress = 0; this.slotChangeRaf = 0; this.topOffsetTargets = /* @__PURE__ */ new Map(); this.lockedExpandedCenter = null; this.collapseDeltas = /* @__PURE__ */ new Map(); this.topOffsetAnimationTarget = null; this.pendingReleasedTarget = null; this.onSlotChange = () => { if (this.slotChangeRaf) cancelAnimationFrame(this.slotChangeRaf); this.slotChangeRaf = requestAnimationFrame(() => { this.slotChangeRaf = 0; this.updatePosition(); if (!this.expand) { this.ensureFrontChildOnTop(); this.syncFrontChild(); } }); }; this.topOffsetDelayTimeout = null; this.expandedLoopRunning = false; this.lastAppliedOffsets = /* @__PURE__ */ new Map(); this.lastTargetOrder = []; this.boundUpdatePosition = this.updatePosition.bind(this); } firstUpdated(_changedProperties) { super.firstUpdated(_changedProperties); this.updatePosition(); this.syncFrontChild(); (this.shadowRoot?.querySelector(\"slot\"))?.addEventListener(\"slotchange\", this.onSlotChange); if (!this.expand) this.wrapperVisible = true; } connectedCallback() { super.connectedCallback(); window.addEventListener(\"resize\", this.boundUpdatePosition); } disconnectedCallback() { (this.shadowRoot?.querySelector(\"slot\"))?.removeEventListener(\"slotchange\", this.onSlotChange); window.removeEventListener(\"resize\", this.boundUpdatePosition); this.stopExpandedObserver(); if (this.slotChangeRaf) { cancelAnimationFrame(this.slotChangeRaf); this.slotChangeRaf = 0; } this.topOffsetAnimationManager.cancel(); if (this.topOffsetDelayTimeout) { clearTimeout(this.topOffsetDelayTimeout); this.topOffsetDelayTimeout = null; } this.resolvePendingRelease(false); super.disconnectedCallback(); } updated(changedProperties) { super.updated(changedProperties); if (changedProperties.has(\"expand\")) { if (this.collapsing && this.expand) { this.expand = false; return; } this.setExpandedChildren(this.expand); } } willUpdate(changedProperties) { super.willUpdate(changedProperties); if (changedProperties.has(\"expand\") && !this.expand && this.topOffsetProgress > 0) this.wrapperVisible = false; } onBackdropClick(event) { event.stopPropagation(); this.expand = false; } render() { return html` ${this.expand ? html`<div @click=${this.onBackdropClick} class=\"backdrop\"></div>` : null} <slot></slot> ${!this.expand && this.wrapperVisible ? html`<button @click=${this.onClick} class=${classMap({ wrapper: true, \"with-values\": this.wrapperHasValues })} style=\"left: 0; top: ${this.positionVertical}; width: ${this.wrapperWidth}; height: ${this.wrapperHeight}; --obc-poi-group-wrapper-x: ${this.wrapperOffsetX};\" > <div class=\"visible-wrapper\"></div> </button>` : null} `; } updatePosition() { if (this.expand || this.collapsing) return; let left = Number.MAX_VALUE; let right = -Number.MAX_VALUE; let maxHeight = 0; let hasValueTargets = false; this._children.forEach((element) => { if (isPoi(element)) { const anchorRect = this.getTargetButtonRect(element, PoiDataVisualRectPreference.Anchor); const sizeRect = this.getTargetButtonRect(element, PoiDataVisualRectPreference.Group); left = Math.min(left, anchorRect.left); right = Math.max(right, anchorRect.right); maxHeight = Math.max(maxHeight, sizeRect.height || 0); if (Array.isArray(element.data) && element.data.length > 0) hasValueTargets = true; return; } const boundingBox = element.getBoundingClientRect(); left = Math.min(left, boundingBox.left); right = Math.max(right, boundingBox.right); maxHeight = Math.max(maxHeight, boundingBox.height || 0); }); if (left !== Number.MAX_VALUE && right !== -Number.MAX_VALUE) { const rootDim = this.getBoundingClientRect(); const targetLeftPx = left - rootDim.left; const targetRightPx = right - rootDim.left; const targetWidth = Math.max(0, targetRightPx - targetLeftPx); this.wrapperOffsetX = `${targetLeftPx}px`; this.wrapperWidth = `${targetWidth}px`; const normalizedHeight = Number.isFinite(maxHeight) ? Math.max(48, Math.round(maxHeight)) : 48; this.wrapperHeight = `${normalizedHeight}px`; this.wrapperHasValues = hasValueTargets; } else { this.wrapperOffsetX = \"0px\"; this.wrapperWidth = \"48px\"; this.wrapperHeight = \"48px\"; this.wrapperHasValues = false; } } ensureFrontChildOnTop() { const frontChild = this.getFrontChild(); if (frontChild && this.lastElementChild !== frontChild) this.appendChild(frontChild); } onClick() { if (this.expand) return; if (this.hasAttribute(\"data-exiting\")) return; if (!this._children.some((child) => isPoi(child))) return; this.expand = true; } releaseTarget(target) { if (target.parentElement !== this) return Promise.resolve(false); if (this.pendingReleasedTarget) { if (this.pendingReleasedTarget.target === target) return this.pendingReleasedTarget.promise; return Promise.resolve(false); } if (!this.expand && !this.collapsing) { this.releaseTargetToParent(target); return Promise.resolve(true); } let resolveRelease; const promise = new Promise((resolve) => { resolveRelease = resolve; }); this.pendingReleasedTarget = { target, promise, resolve: resolveRelease }; this.expand = false; return promise; } setExpandedChildren(expand) { this.dispatchEvent(new CustomEvent(\"expand\", { detail: { expand: this.expand }, bubbles: true, composed: true })); const frontChild = this.getFrontChild(); if (expand) this.calculateTopOffsetTargets(); if (!expand) { if (this.topOffsetProgress > 0) this.wrapperVisible = false; this.lockedExpandedCenter = null; } if (!expand && frontChild) this.appendChild(frontChild); this.animateTopOffset(expand ? 1 : 0); } calculateTopOffsetTargets(preserveCenter = false) { this.topOffsetTargets.clear(); const targets = this._children.filter((child) => isPoi(child)); if (targets.length === 0) return; const positions = targets.map((child) => { const rect = this.getTargetButtonRect(child); const currentLeft = this.getCurrentLeft(child); return { child, currentLeft, centerX: currentLeft + rect.width / 2, width: rect.width }; }); positions.sort((a, b) => a.currentLeft - b.currentLeft); const computedCenter = (positions[0].centerX + positions[positions.length - 1].centerX) / 2; const groupCenter = preserveCenter && this.lockedExpandedCenter !== null ? this.lockedExpandedCenter : computedCenter; if (!preserveCenter) this.lockedExpandedCenter = groupCenter; const spacing = this.getExpandedSpacing(); const startX = groupCenter - (positions.length - 1) * spacing / 2; positions.forEach((pos, index) => { const expandedOffset = startX + index * spacing - pos.centerX; const originalLeft = pos.currentLeft; this.topOffsetTargets.set(pos.child, { originalX: pos.centerX, expandedOffset, currentExpandedOffset: expandedOffset, originalLeft }); }); } refreshExpandedLayout(preserveCenter = false) { if (!this.expand) return; this.calculateTopOffsetTargets(preserveCenter); this.applyTopOffsetState(this.topOffsetProgress, this.getFrontChild()); this.scheduleExpandedOffsets(); } animateTopOffset(targetProgress) { const normalizedTarget = targetProgress === 1 ? 1 : 0; const hasPendingOrRunningAnimation = this.topOffsetAnimationManager.isRunning() || this.topOffsetDelayTimeout !== null; if (hasPendingOrRunningAnimation && this.topOffsetAnimationTarget === normalizedTarget) return; if (!hasPendingOrRunningAnimation && Math.abs(this.topOffsetProgress - normalizedTarget) < .001) return; this.topOffsetAnimationTarget = normalizedTarget; this.topOffsetAnimationManager.cancel(); if (this.topOffsetDelayTimeout) { clearTimeout(this.topOffsetDelayTimeout); this.topOffsetDelayTimeout = null; } if (targetProgress === 0 && this.topOffsetProgress > 0) this.collapsing = true; else this.collapsing = false; const frontChild = this.getFrontChild(); if (targetProgress === 0 && this.topOffsetProgress > 0) { this.collapseDeltas.clear(); this.topOffsetTargets.forEach((config, child) => { const delta = this.getCurrentLeft(child) - config.originalLeft; this.collapseDeltas.set(child, delta); }); const delayMs = getCssVarAsNumber(this, TOP_OFFSET_ANIMATION_DELAY_MS_VAR, 0); if (delayMs > 0) this.topOffsetDelayTimeout = setTimeout(() => { this.topOffsetDelayTimeout = null; this.runTopOffsetAnimation(targetProgress, frontChild); }, delayMs); else this.runTopOffsetAnimation(targetProgress, frontChild); } else { if (targetProgress === 1) this.collapseDeltas.clear(); this.runTopOffsetAnimation(targetProgress, frontChild); } } runTopOffsetAnimation(targetProgress, frontChild) { const duration = getCssVarAsNumber(this, TOP_OFFSET_ANIMATION_MS_VAR, 100); this.topOffsetAnimationManager.start(targetProgress, this.topOffsetProgress, { duration, onUpdate: (progress) => { this.topOffsetProgress = progress; if (targetProgress === 1) this.updateExpandedOffsets(true); this.applyTopOffsetState(progress, frontChild); }, onComplete: () => { this.topOffsetAnimationTarget = null; if (targetProgress === 0) { this.collapsing = false; this.releasePendingTarget(); this.dispatchEvent(new CustomEvent(\"collapse-finished\", { bubbles: true, composed: true })); this.updatePosition(); this.wrapperVisible = true; this.stopExpandedObserver(); this.collapseDeltas.clear(); this.lastTargetOrder = []; this.lastAppliedOffsets.clear(); } if (targetProgress === 1) { this.startExpandedObserver(); this.scheduleExpandedOffsets(); } }, onError: (error) => { console.error(\"[poi-group] Error in top offset animation:\", error); this.topOffsetAnimationTarget = null; this.collapsing = false; this.resolvePendingRelease(false); } }); } applyTopOffsetState(progress, frontChild) { const eased = easeInOutQuad(progress); const frontHeight = frontChild ? this.getTargetButtonRect(frontChild).height : null; const visualExpanded = this.collapsing ? false : progress > .5; const touchAreaExpanded = progress > .5; this.topOffsetTargets.forEach((config, child) => { if (child.parentElement !== this) { this.topOffsetTargets.delete(child); this.collapseDeltas.delete(child); this.lastAppliedOffsets.delete(child); return; } const isCollapsing = this.collapseDeltas.size > 0; let delta; if (isCollapsing) delta = this.collapseDeltas.get(child) ?? 0; else delta = this.getCurrentLeft(child) - config.originalLeft; const buttonOffsetX = (config.currentExpandedOffset - delta) * eased; child.setRuntimeHorizontalOffsets?.(buttonOffsetX, child.targetOffsetX); if (!child.setRuntimeHorizontalOffsets) child.buttonOffsetX = buttonOffsetX; if (child !== frontChild) { const isOverlap = !visualExpanded; const nextValue = this.resolveTargetValue(child, isOverlap); child.value = nextValue; if (nextValue === ObcPoiValue.Overlapped) applyPoiVisualState(child, true, getVisualTargetSize(this, child.buttonType === ObcPoiButtonType.Enhanced, true)); else clearPoiVisualState(child); this.setOverlappedDataHeight(child, nextValue === ObcPoiValue.Overlapped, frontHeight); } else { child.value = this.resolveTargetValue(child, false); clearPoiVisualState(child); this.setOverlappedDataHeight(child, false, frontHeight); } if (touchAreaExpanded) { const touchTarget = `${getTouchTargetSize(this)}px`; child.style.width = touchTarget; child.style.minWidth = touchTarget; child.style.height = touchTarget; } else { child.style.width = \"unset\"; child.style.minWidth = \"unset\"; child.style.height = \"unset\"; } }); } getFrontChild() { const targets = this._children.filter((child) => isPoi(child)); if (targets.length === 0) return null; let front = null; let maxHeight = Number.NEGATIVE_INFINITY; const frontByAttr = targets.find((child) => child.hasAttribute(\"data-front\")); const epsilon = .001; for (const child of targets) { const yValue = typeof child.y === \"number\" && Number.isFinite(child.y) ? child.y : Number.parseFloat(child.getAttribute(\"y\") ?? \"\"); if (Number.isNaN(yValue)) continue; if (yValue > maxHeight + epsilon) { maxHeight = yValue; front = child; continue; } if (Math.abs(yValue - maxHeight) <= epsilon && frontByAttr && child === frontByAttr) front = child; } return front ?? targets[0] ?? null; } syncFrontChild() { const front = this.getFrontChild(); const frontHeight = front ? this.getTargetButtonRect(front).height : null; this._children.forEach((child) => { if (!isPoi(child)) return; const isOverlap = !this.expand && (!front || child !== front); const nextValue = this.resolveTargetValue(child, isOverlap); child.value = nextValue; if (nextValue === ObcPoiValue.Overlapped) applyPoiVisualState(child, true, getVisualTargetSize(this, child.buttonType === ObcPoiButtonType.Enhanced, true)); else clearPoiVisualState(child); if (front && child === front) child.setAttribute(\"data-front\", \"true\"); else child.removeAttribute(\"data-front\"); this.setOverlappedDataHeight(child, nextValue === ObcPoiValue.Overlapped, frontHeight); }); } startExpandedObserver() { if (this.expandedLoopRunning) return; this.expandedLoopRunning = true; this.runExpandedLoop(); } runExpandedLoop() { if (!this.expandedLoopRunning || !this.expand) { this.expandedLoopRunning = false; return; } try { this.updateExpandedOffsets(); requestAnimationFrame(() => this.runExpandedLoop()); } catch (error) { console.error(\"[poi-group] Error in expanded loop:\", error); this.expandedLoopRunning = false; } } stopExpandedObserver() { this.expandedLoopRunning = false; this.lastAppliedOffsets.clear(); this.lastTargetOrder = []; } scheduleExpandedOffsets() { if (!this.expand) return; this.updateExpandedOffsets(); } updateExpandedOffsets(snap = false) { if (!this.expand) return; const targets = this._children.filter((child) => isPoi(child)); const sortedByCurrentPosition = [...targets].map((child) => { return { child, currentLeft: this.getCurrentLeft(child) }; }).sort((a, b) => a.currentLeft - b.currentLeft).map((item) => item.child); const orderedTargets = this.internalSwapping ? sortedByCurrentPosition : this.lastTargetOrder.length > 0 ? this.lastTargetOrder : sortedByCurrentPosition; const orderChanged = this.lastTargetOrder.length !== orderedTargets.length || orderedTargets.some((child, index) => this.lastTargetOrder[index] !== child); if (this.internalSwapping && orderChanged && this.lastTargetOrder.length > 0) { const spacing = this.getExpandedSpacing(); const totalWidth = (orderedTargets.length - 1) * spacing; const groupCenter = this.lockedExpandedCenter ?? (() => { const positions = orderedTargets.map((child) => { return this.getCurrentLeft(child); }); return (Math.min(...positions) + Math.max(...positions)) / 2; })(); if (this.lockedExpandedCenter === null) this.lockedExpandedCenter = groupCenter; const startX = groupCenter - totalWidth / 2; orderedTargets.forEach((child, index) => { const config = this.topOffsetTargets.get(child); if (!config) return; config.expandedOffset = startX + index * spacing - config.originalX; }); } this.lastTargetOrder = orderedTargets; targets.forEach((child) => { if (child.parentElement !== this) { this.topOffsetTargets.delete(child); this.lastAppliedOffsets.delete(child); return; } const config = this.topOffsetTargets.get(child); if (!config) return; const delta = this.getCurrentLeft(child) - config.originalLeft; if (snap) config.currentExpandedOffset = config.expandedOffset; else config.currentExpandedOffset = frameLerp(config.currentExpandedOffset, config.expandedOffset, .1); const buttonOffsetX = config.currentExpandedOffset - delta; const last = this.lastAppliedOffsets.get(child); if (last && last.buttonOffsetX === buttonOffsetX) return; this.lastAppliedOffsets.set(child, { buttonOffsetX }); child.setRuntimeHorizontalOffsets?.(buttonOffsetX, child.targetOffsetX); if (!child.setRuntimeHorizontalOffsets) child.buttonOffsetX = buttonOffsetX; }); } getCurrentLeft(element) { return getEffectivePoiX(element) + (typeof element.targetOffsetX === \"number\" && Number.isFinite(element.targetOffsetX) ? element.targetOffsetX : 0); } getTargetButtonRect(target, preference = PoiDataVisualRectPreference.Group) { return target.getVisualRect(preference); } getExpandedSpacing() { const baseSpacing = getCssVarAsNumber(this, POI_GROUP_SPACING_VAR, 50); return this.wrapperHasValues ? baseSpacing + 2 : baseSpacing; } setOverlappedDataHeight(target, overlap, frontHeight) { const dataLength = Array.isArray(target.data) ? target.data.length : 0; if (!overlap || dataLength === 0 || frontHeight === null || !Number.isFinite(frontHeight)) { target.style.removeProperty(\"--obc-poi-group-overlap-height\"); target.style.removeProperty(\"--obc-poi-group-overlap-shift\"); return; } const adjustedHeight = Math.max(0, frontHeight * .95); const shift = Math.max(0, frontHeight - adjustedHeight); target.style.setProperty(\"--obc-poi-group-overlap-height\", `${adjustedHeight}px`); target.style.setProperty(\"--obc-poi-group-overlap-shift\", `${shift}px`); } resolveTargetValue(target, overlap) { if (overlap) return ObcPoiValue.Overlapped; if (target.selected) return ObcPoiValue.Checked; return ObcPoiValue.Unchecked; } releasePendingTarget() { const pending = this.pendingReleasedTarget; if (!pending) return; const released = this.releaseTargetToParent(pending.target); this.resolvePendingRelease(released); } resolvePendingRelease(released) { const pending = this.pendingReleasedTarget; if (!pending) return; this.pendingReleasedTarget = null; pending.resolve(released); } releaseTargetToParent(target) { if (target.parentElement !== this) return false; target.setRuntimeHorizontalOffsets?.(0, 0); if (!target.setRuntimeHorizontalOffsets) { target.buttonOffsetX = 0; target.targetOffsetX = 0; } target.removeAttribute(\"data-grouped\"); target.removeAttribute(\"data-joined-expanded\"); target.removeAttribute(\"data-pregrouped\"); target.removeAttribute(\"data-behind\"); target.removeAttribute(\"data-front\"); target.removeAttribute(\"data-front-exit\"); target.removeAttribute(\"data-exiting\"); target.removeAttribute(\"data-exit-lock\"); target.style.removeProperty(\"position\"); target.style.removeProperty(\"width\"); target.style.removeProperty(\"min-width\"); target.style.removeProperty(\"height\"); target.style.removeProperty(\"transform\"); target.style.removeProperty(\"--obc-poi-group-overlap-height\"); target.style.removeProperty(\"--obc-poi-group-overlap-shift\"); clearPoiVisualState(target); const parent = this.parentElement; if (!parent) return false; parent.insertBefore(target, this); this.updatePosition(); parent.requestGroupingUpdate?.(); this.dispatchEvent(new CustomEvent(\"obc-poi-group-target-released\", { detail: { target }, bubbles: true, composed: true })); return true; } static { this.styles = unsafeCSS(poi_group_default); } }"
683
+ "default": "class ObcPoiGroup extends LitElement { constructor() { super(); this.expand = false; this.collapsing = false; this.positionVertical = \"0px\"; this.internalSwapping = false; this.wrapperOffsetX = \"0px\"; this.wrapperWidth = \"48px\"; this.wrapperVisible = false; this.wrapperHeight = \"48px\"; this.wrapperHasValues = false; this.topOffsetAnimationManager = new AnimationManager(); this.topOffsetProgress = 0; this.slotChangeRaf = 0; this.topOffsetTargets = /* @__PURE__ */ new Map(); this.lockedExpandedCenter = null; this.collapseDeltas = /* @__PURE__ */ new Map(); this.topOffsetAnimationTarget = null; this.pendingReleasedTarget = null; this.onSlotChange = () => { if (this.slotChangeRaf) cancelAnimationFrame(this.slotChangeRaf); this.slotChangeRaf = requestAnimationFrame(() => { this.slotChangeRaf = 0; this.updatePosition(); if (!this.expand) { this.ensureFrontChildOnTop(); this.syncFrontChild(); } }); }; this.topOffsetDelayTimeout = null; this.expandedLoopRunning = false; this.lastAppliedOffsets = /* @__PURE__ */ new Map(); this.lastTargetOrder = []; this.boundUpdatePosition = this.updatePosition.bind(this); } firstUpdated(_changedProperties) { super.firstUpdated(_changedProperties); this.updatePosition(); this.syncFrontChild(); (this.shadowRoot?.querySelector(\"slot\"))?.addEventListener(\"slotchange\", this.onSlotChange); if (!this.expand) this.wrapperVisible = true; } connectedCallback() { super.connectedCallback(); window.addEventListener(\"resize\", this.boundUpdatePosition); } disconnectedCallback() { (this.shadowRoot?.querySelector(\"slot\"))?.removeEventListener(\"slotchange\", this.onSlotChange); window.removeEventListener(\"resize\", this.boundUpdatePosition); this.stopExpandedObserver(); if (this.slotChangeRaf) { cancelAnimationFrame(this.slotChangeRaf); this.slotChangeRaf = 0; } this.topOffsetAnimationManager.cancel(); if (this.topOffsetDelayTimeout) { clearTimeout(this.topOffsetDelayTimeout); this.topOffsetDelayTimeout = null; } this.resolvePendingRelease(false); super.disconnectedCallback(); } updated(changedProperties) { super.updated(changedProperties); if (changedProperties.has(\"expand\")) { if (this.collapsing && this.expand) { this.expand = false; return; } this.setExpandedChildren(this.expand); } } willUpdate(changedProperties) { super.willUpdate(changedProperties); if (changedProperties.has(\"expand\") && !this.expand && this.topOffsetProgress > 0) this.wrapperVisible = false; } onBackdropClick(event) { event.stopPropagation(); this.expand = false; } render() { return html` ${this.expand ? html`<div @click=${this.onBackdropClick} class=\"backdrop\"></div>` : null} <slot></slot> ${!this.expand && this.wrapperVisible ? html`<button @click=${this.onClick} class=${classMap({ wrapper: true, \"with-values\": this.wrapperHasValues })} style=\"left: 0; top: ${this.positionVertical}; width: ${this.wrapperWidth}; height: ${this.wrapperHeight}; --obc-poi-group-wrapper-x: ${this.wrapperOffsetX};\" > <div class=\"visible-wrapper\"></div> </button>` : null} `; } updatePosition() { if (this.expand || this.collapsing) return; let left = Number.MAX_VALUE; let right = -Number.MAX_VALUE; let maxHeight = 0; let hasValueTargets = false; this._children.forEach((element) => { if (isPoi(element)) { const anchorRect = this.getTargetButtonRect(element, PoiDataVisualRectPreference.Anchor); const sizeRect = this.getTargetButtonRect(element, PoiDataVisualRectPreference.Group); left = Math.min(left, anchorRect.left); right = Math.max(right, anchorRect.right); maxHeight = Math.max(maxHeight, sizeRect.height || 0); if (Array.isArray(element.data) && element.data.length > 0) hasValueTargets = true; return; } const boundingBox = element.getBoundingClientRect(); left = Math.min(left, boundingBox.left); right = Math.max(right, boundingBox.right); maxHeight = Math.max(maxHeight, boundingBox.height || 0); }); if (left !== Number.MAX_VALUE && right !== -Number.MAX_VALUE) { const rootDim = this.getBoundingClientRect(); const targetLeftPx = left - rootDim.left; const targetRightPx = right - rootDim.left; const targetWidth = Math.max(0, targetRightPx - targetLeftPx); this.wrapperOffsetX = `${targetLeftPx}px`; this.wrapperWidth = `${targetWidth}px`; const normalizedHeight = Number.isFinite(maxHeight) ? Math.max(48, Math.round(maxHeight)) : 48; this.wrapperHeight = `${normalizedHeight}px`; this.wrapperHasValues = hasValueTargets; } else { this.wrapperOffsetX = \"0px\"; this.wrapperWidth = \"48px\"; this.wrapperHeight = \"48px\"; this.wrapperHasValues = false; } } /** * Membership check that works for both light-DOM children (manual groups) * and slot-assigned members (layer-created auto groups, where the member * stays in the consumer's light DOM and is assigned into this group's * member slot). */ isMember(child) { return child.parentElement === this || child.assignedSlot?.parentElement === this; } getMemberSlot() { return this.querySelector(\":scope > slot.auto-group-members\"); } /** * Paint the front child on top. For light-DOM members this reorders the * children; for slot-assigned members it re-assigns the member slot, which * changes flattened-tree order without touching the consumer's DOM. */ bringChildToFront(frontChild) { const memberSlot = this.getMemberSlot(); if (memberSlot && frontChild.assignedSlot === memberSlot) { const members = memberSlot.assignedElements(); if (members[members.length - 1] === frontChild) return; memberSlot.assign(...members.filter((el) => el !== frontChild), frontChild); return; } if (frontChild.parentElement === this) this.appendChild(frontChild); } ensureFrontChildOnTop() { const frontChild = this.getFrontChild(); if (frontChild && this.lastElementChild !== frontChild) this.bringChildToFront(frontChild); } onClick() { if (this.expand) return; if (this.hasAttribute(\"data-exiting\")) return; if (!this._children.some((child) => isPoi(child))) return; this.expand = true; } releaseTarget(target) { if (!this.isMember(target)) return Promise.resolve(false); if (this.pendingReleasedTarget) { if (this.pendingReleasedTarget.target === target) return this.pendingReleasedTarget.promise; return Promise.resolve(false); } if (!this.expand && !this.collapsing) { this.releaseTargetToParent(target); return Promise.resolve(true); } let resolveRelease; const promise = new Promise((resolve) => { resolveRelease = resolve; }); this.pendingReleasedTarget = { target, promise, resolve: resolveRelease }; this.expand = false; return promise; } setExpandedChildren(expand) { this.dispatchEvent(new CustomEvent(\"expand\", { detail: { expand: this.expand }, bubbles: true, composed: true })); const frontChild = this.getFrontChild(); if (expand) this.calculateTopOffsetTargets(); if (!expand) { if (this.topOffsetProgress > 0) this.wrapperVisible = false; this.lockedExpandedCenter = null; } if (!expand && frontChild) this.bringChildToFront(frontChild); this.animateTopOffset(expand ? 1 : 0); } calculateTopOffsetTargets(preserveCenter = false) { this.topOffsetTargets.clear(); const targets = this._children.filter((child) => isPoi(child)); if (targets.length === 0) return; const positions = targets.map((child) => { const rect = this.getTargetButtonRect(child); const currentLeft = this.getCurrentLeft(child); return { child, currentLeft, centerX: currentLeft + rect.width / 2, width: rect.width }; }); positions.sort((a, b) => a.currentLeft - b.currentLeft); const computedCenter = (positions[0].centerX + positions[positions.length - 1].centerX) / 2; const groupCenter = preserveCenter && this.lockedExpandedCenter !== null ? this.lockedExpandedCenter : computedCenter; if (!preserveCenter) this.lockedExpandedCenter = groupCenter; const spacing = this.getExpandedSpacing(); const startX = groupCenter - (positions.length - 1) * spacing / 2; positions.forEach((pos, index) => { const expandedOffset = startX + index * spacing - pos.centerX; const originalLeft = pos.currentLeft; this.topOffsetTargets.set(pos.child, { originalX: pos.centerX, expandedOffset, currentExpandedOffset: expandedOffset, originalLeft }); }); } refreshExpandedLayout(preserveCenter = false) { if (!this.expand) return; this.calculateTopOffsetTargets(preserveCenter); this.applyTopOffsetState(this.topOffsetProgress, this.getFrontChild()); this.scheduleExpandedOffsets(); } animateTopOffset(targetProgress) { const normalizedTarget = targetProgress === 1 ? 1 : 0; const hasPendingOrRunningAnimation = this.topOffsetAnimationManager.isRunning() || this.topOffsetDelayTimeout !== null; if (hasPendingOrRunningAnimation && this.topOffsetAnimationTarget === normalizedTarget) return; if (!hasPendingOrRunningAnimation && Math.abs(this.topOffsetProgress - normalizedTarget) < .001) return; this.topOffsetAnimationTarget = normalizedTarget; this.topOffsetAnimationManager.cancel(); if (this.topOffsetDelayTimeout) { clearTimeout(this.topOffsetDelayTimeout); this.topOffsetDelayTimeout = null; } if (targetProgress === 0 && this.topOffsetProgress > 0) this.collapsing = true; else this.collapsing = false; const frontChild = this.getFrontChild(); if (targetProgress === 0 && this.topOffsetProgress > 0) { this.collapseDeltas.clear(); this.topOffsetTargets.forEach((config, child) => { const delta = this.getCurrentLeft(child) - config.originalLeft; this.collapseDeltas.set(child, delta); }); const delayMs = getCssVarAsNumber(this, TOP_OFFSET_ANIMATION_DELAY_MS_VAR, 0); if (delayMs > 0) this.topOffsetDelayTimeout = setTimeout(() => { this.topOffsetDelayTimeout = null; this.runTopOffsetAnimation(targetProgress, frontChild); }, delayMs); else this.runTopOffsetAnimation(targetProgress, frontChild); } else { if (targetProgress === 1) this.collapseDeltas.clear(); this.runTopOffsetAnimation(targetProgress, frontChild); } } runTopOffsetAnimation(targetProgress, frontChild) { const duration = getCssVarAsNumber(this, TOP_OFFSET_ANIMATION_MS_VAR, 100); this.topOffsetAnimationManager.start(targetProgress, this.topOffsetProgress, { duration, onUpdate: (progress) => { this.topOffsetProgress = progress; if (targetProgress === 1) this.updateExpandedOffsets(true); this.applyTopOffsetState(progress, frontChild); }, onComplete: () => { this.topOffsetAnimationTarget = null; if (targetProgress === 0) { this.collapsing = false; this.releasePendingTarget(); this.dispatchEvent(new CustomEvent(\"collapse-finished\", { bubbles: true, composed: true })); this.updatePosition(); this.wrapperVisible = true; this.stopExpandedObserver(); this.collapseDeltas.clear(); this.lastTargetOrder = []; this.lastAppliedOffsets.clear(); } if (targetProgress === 1) { this.startExpandedObserver(); this.scheduleExpandedOffsets(); } }, onError: (error) => { console.error(\"[poi-group] Error in top offset animation:\", error); this.topOffsetAnimationTarget = null; this.collapsing = false; this.resolvePendingRelease(false); } }); } applyTopOffsetState(progress, frontChild) { const eased = easeInOutQuad(progress); const frontHeight = frontChild ? this.getTargetButtonRect(frontChild).height : null; const visualExpanded = this.collapsing ? false : progress > .5; const touchAreaExpanded = progress > .5; this.topOffsetTargets.forEach((config, child) => { if (!this.isMember(child)) { this.topOffsetTargets.delete(child); this.collapseDeltas.delete(child); this.lastAppliedOffsets.delete(child); return; } const isCollapsing = this.collapseDeltas.size > 0; let delta; if (isCollapsing) delta = this.collapseDeltas.get(child) ?? 0; else delta = this.getCurrentLeft(child) - config.originalLeft; const buttonOffsetX = (config.currentExpandedOffset - delta) * eased; child.setRuntimeHorizontalOffsets?.(buttonOffsetX, child.targetOffsetX); if (!child.setRuntimeHorizontalOffsets) child.buttonOffsetX = buttonOffsetX; if (child !== frontChild) { const isOverlap = !visualExpanded; const nextValue = this.resolveTargetValue(child, isOverlap); child.value = nextValue; if (nextValue === ObcPoiValue.Overlapped) applyPoiVisualState(child, true, getVisualTargetSize(this, child.buttonType === ObcPoiButtonType.Enhanced, true)); else clearPoiVisualState(child); this.setOverlappedDataHeight(child, nextValue === ObcPoiValue.Overlapped, frontHeight); } else { child.value = this.resolveTargetValue(child, false); clearPoiVisualState(child); this.setOverlappedDataHeight(child, false, frontHeight); } if (touchAreaExpanded) { const touchTarget = `${getTouchTargetSize(this)}px`; child.style.width = touchTarget; child.style.minWidth = touchTarget; child.style.height = touchTarget; } else { child.style.width = \"unset\"; child.style.minWidth = \"unset\"; child.style.height = \"unset\"; } }); } getFrontChild() { const targets = this._children.filter((child) => isPoi(child)); if (targets.length === 0) return null; let front = null; let maxHeight = Number.NEGATIVE_INFINITY; const frontByAttr = targets.find((child) => child.hasAttribute(\"data-front\")); const epsilon = .001; for (const child of targets) { const yValue = typeof child.y === \"number\" && Number.isFinite(child.y) ? child.y : Number.parseFloat(child.getAttribute(\"y\") ?? \"\"); if (Number.isNaN(yValue)) continue; if (yValue > maxHeight + epsilon) { maxHeight = yValue; front = child; continue; } if (Math.abs(yValue - maxHeight) <= epsilon && frontByAttr && child === frontByAttr) front = child; } return front ?? targets[0] ?? null; } syncFrontChild() { const front = this.getFrontChild(); const frontHeight = front ? this.getTargetButtonRect(front).height : null; this._children.forEach((child) => { if (!isPoi(child)) return; const isOverlap = !this.expand && (!front || child !== front); const nextValue = this.resolveTargetValue(child, isOverlap); child.value = nextValue; if (nextValue === ObcPoiValue.Overlapped) applyPoiVisualState(child, true, getVisualTargetSize(this, child.buttonType === ObcPoiButtonType.Enhanced, true)); else clearPoiVisualState(child); if (front && child === front) child.setAttribute(\"data-front\", \"true\"); else child.removeAttribute(\"data-front\"); this.setOverlappedDataHeight(child, nextValue === ObcPoiValue.Overlapped, frontHeight); }); } startExpandedObserver() { if (this.expandedLoopRunning) return; this.expandedLoopRunning = true; this.runExpandedLoop(); } runExpandedLoop() { if (!this.expandedLoopRunning || !this.expand) { this.expandedLoopRunning = false; return; } try { this.updateExpandedOffsets(); requestAnimationFrame(() => this.runExpandedLoop()); } catch (error) { console.error(\"[poi-group] Error in expanded loop:\", error); this.expandedLoopRunning = false; } } stopExpandedObserver() { this.expandedLoopRunning = false; this.lastAppliedOffsets.clear(); this.lastTargetOrder = []; } scheduleExpandedOffsets() { if (!this.expand) return; this.updateExpandedOffsets(); } updateExpandedOffsets(snap = false) { if (!this.expand) return; const targets = this._children.filter((child) => isPoi(child)); const sortedByCurrentPosition = [...targets].map((child) => { return { child, currentLeft: this.getCurrentLeft(child) }; }).sort((a, b) => a.currentLeft - b.currentLeft).map((item) => item.child); const orderedTargets = this.internalSwapping ? sortedByCurrentPosition : this.lastTargetOrder.length > 0 ? this.lastTargetOrder : sortedByCurrentPosition; const orderChanged = this.lastTargetOrder.length !== orderedTargets.length || orderedTargets.some((child, index) => this.lastTargetOrder[index] !== child); if (this.internalSwapping && orderChanged && this.lastTargetOrder.length > 0) { const spacing = this.getExpandedSpacing(); const totalWidth = (orderedTargets.length - 1) * spacing; const groupCenter = this.lockedExpandedCenter ?? (() => { const positions = orderedTargets.map((child) => { return this.getCurrentLeft(child); }); return (Math.min(...positions) + Math.max(...positions)) / 2; })(); if (this.lockedExpandedCenter === null) this.lockedExpandedCenter = groupCenter; const startX = groupCenter - totalWidth / 2; orderedTargets.forEach((child, index) => { const config = this.topOffsetTargets.get(child); if (!config) return; config.expandedOffset = startX + index * spacing - config.originalX; }); } this.lastTargetOrder = orderedTargets; targets.forEach((child) => { if (!this.isMember(child)) { this.topOffsetTargets.delete(child); this.lastAppliedOffsets.delete(child); return; } const config = this.topOffsetTargets.get(child); if (!config) return; const delta = this.getCurrentLeft(child) - config.originalLeft; if (snap) config.currentExpandedOffset = config.expandedOffset; else config.currentExpandedOffset = frameLerp(config.currentExpandedOffset, config.expandedOffset, .1); const buttonOffsetX = config.currentExpandedOffset - delta; const last = this.lastAppliedOffsets.get(child); if (last && last.buttonOffsetX === buttonOffsetX) return; this.lastAppliedOffsets.set(child, { buttonOffsetX }); child.setRuntimeHorizontalOffsets?.(buttonOffsetX, child.targetOffsetX); if (!child.setRuntimeHorizontalOffsets) child.buttonOffsetX = buttonOffsetX; }); } getCurrentLeft(element) { return getEffectivePoiX(element) + (typeof element.targetOffsetX === \"number\" && Number.isFinite(element.targetOffsetX) ? element.targetOffsetX : 0); } getTargetButtonRect(target, preference = PoiDataVisualRectPreference.Group) { return target.getVisualRect(preference); } getExpandedSpacing() { const baseSpacing = getCssVarAsNumber(this, POI_GROUP_SPACING_VAR, 50); return this.wrapperHasValues ? baseSpacing + 2 : baseSpacing; } setOverlappedDataHeight(target, overlap, frontHeight) { const dataLength = Array.isArray(target.data) ? target.data.length : 0; if (!overlap || dataLength === 0 || frontHeight === null || !Number.isFinite(frontHeight)) { target.style.removeProperty(\"--obc-poi-group-overlap-height\"); target.style.removeProperty(\"--obc-poi-group-overlap-shift\"); return; } const adjustedHeight = Math.max(0, frontHeight * .95); const shift = Math.max(0, frontHeight - adjustedHeight); target.style.setProperty(\"--obc-poi-group-overlap-height\", `${adjustedHeight}px`); target.style.setProperty(\"--obc-poi-group-overlap-shift\", `${shift}px`); } resolveTargetValue(target, overlap) { if (overlap) return ObcPoiValue.Overlapped; if (target.selected) return ObcPoiValue.Checked; return ObcPoiValue.Unchecked; } releasePendingTarget() { const pending = this.pendingReleasedTarget; if (!pending) return; const released = this.releaseTargetToParent(pending.target); this.resolvePendingRelease(released); } resolvePendingRelease(released) { const pending = this.pendingReleasedTarget; if (!pending) return; this.pendingReleasedTarget = null; pending.resolve(released); } releaseTargetToParent(target) { if (!this.isMember(target)) return false; target.setRuntimeHorizontalOffsets?.(0, 0); if (!target.setRuntimeHorizontalOffsets) { target.buttonOffsetX = 0; target.targetOffsetX = 0; } target.removeAttribute(\"data-grouped\"); target.removeAttribute(\"data-joined-expanded\"); target.removeAttribute(\"data-pregrouped\"); target.removeAttribute(\"data-behind\"); target.removeAttribute(\"data-front\"); target.removeAttribute(\"data-front-exit\"); target.removeAttribute(\"data-exiting\"); target.removeAttribute(\"data-exit-lock\"); target.style.removeProperty(\"position\"); target.style.removeProperty(\"width\"); target.style.removeProperty(\"min-width\"); target.style.removeProperty(\"height\"); target.style.removeProperty(\"transform\"); target.style.removeProperty(\"--obc-poi-group-overlap-height\"); target.style.removeProperty(\"--obc-poi-group-overlap-shift\"); clearPoiVisualState(target); const memberSlot = this.getMemberSlot(); if (memberSlot && target.assignedSlot === memberSlot) { memberSlot.assign(...memberSlot.assignedElements().filter((el) => el !== target)); const root = this.getRootNode(); (root instanceof ShadowRoot ? root.host : null)?.releaseAssignedTarget?.(target); this.updatePosition(); this.dispatchEvent(new CustomEvent(\"obc-poi-group-target-released\", { detail: { target }, bubbles: true, composed: true })); return true; } const parent = this.parentElement; if (!parent) return false; parent.insertBefore(target, this); this.updatePosition(); parent.requestGroupingUpdate?.(); this.dispatchEvent(new CustomEvent(\"obc-poi-group-target-released\", { detail: { target }, bubbles: true, composed: true })); return true; } static { this.styles = unsafeCSS(poi_group_default); } }"
660
684
  }
661
685
  ],
662
686
  "exports": [
@@ -677,7 +701,7 @@
677
701
  {
678
702
  "kind": "variable",
679
703
  "name": "ObcPoiLayerStack",
680
- "default": "class ObcPoiLayerStack extends LitElement { static { _ObcPoiLayerStack = this; } constructor(..._args) { super(..._args); this.selectionMode = \"none\"; this.handleStackClick = (event) => this.onStackClick(event); this.handleSlotChange = () => this.schedulePlacement(); this.handleTargetLayoutChange = () => this.schedulePlacement(); this.handleLayerSelectionChanged = () => this.schedulePlacement(); this.selectionMap = /* @__PURE__ */ new Map(); this.selectionCounter = 0; this.placementRaf = 0; } static { this.STACK_JUMP_DURATION_MS = 100; } static { this.STACK_RETURNING_ATTR = \"data-stack-returning\"; } connectedCallback() { super.connectedCallback(); this.addEventListener(\"click\", this.handleStackClick); this.addEventListener(\"obc-poi-data-layout-change\", this.handleTargetLayoutChange); this.addEventListener(\"layer-selection-changed\", this.handleLayerSelectionChanged); } firstUpdated() { (this.shadowRoot?.querySelector(\"slot\"))?.addEventListener(\"slotchange\", this.handleSlotChange); this.setupMutationObserver(); this.schedulePlacement(); requestAnimationFrame(() => { this.schedulePlacement(); requestAnimationFrame(() => this.schedulePlacement()); }); } disconnectedCallback() { super.disconnectedCallback(); this.removeEventListener(\"click\", this.handleStackClick); this.removeEventListener(\"obc-poi-data-layout-change\", this.handleTargetLayoutChange); this.removeEventListener(\"layer-selection-changed\", this.handleLayerSelectionChanged); (this.shadowRoot?.querySelector(\"slot\"))?.removeEventListener(\"slotchange\", this.handleSlotChange); this.mutationObserver?.disconnect(); this.mutationObserver = void 0; if (this.placementRaf) { cancelAnimationFrame(this.placementRaf); this.placementRaf = 0; } this.selectionMap.forEach((_, target) => { this.clearTargetProjectionStyles(target); this.requestPoiRender(target); }); this.selectionMap.clear(); this.selectionCounter = 0; } onStackClick(event) { if (this.selectionMode === \"none\") return; const target = this.getPoiTargetFromEvent(event); if (!target) return; if (target.hasAttribute(_ObcPoiLayerStack.STACK_RETURNING_ATTR)) return; this.cleanupSelection(); const originLayer = this.getTargetLayer(target); if (!originLayer) return; const selectedLayer = this.getLayer(\"selected\") ?? this.getLayer(\"top\"); if (!selectedLayer) return; const existing = this.selectionMap.get(target); if (existing) { this.resetSelectionForTarget(target, existing); return; } if (this.selectionMode === \"single\") { this.clearOtherTopSelections(target); this.clearSelectionMapExcept(target); } const trackedOriginLayer = originLayer === selectedLayer ? this.inferBootstrapOriginLayer(target, selectedLayer) : originLayer; this.trackSelectionTarget(target, trackedOriginLayer, true); const record = this.selectionMap.get(target); if (!record) return; this.activateTrackedTarget(target, record, selectedLayer); this.schedulePlacement(); } getPoiTargetFromEvent(event) { const path = event.composedPath?.() ?? []; for (const item of path) if (item instanceof HTMLElement && isPoi(item)) return item; const direct = event.target instanceof HTMLElement ? event.target : null; if (!direct) return null; const closest = direct.closest(`[${POI_ATTR}]`); if (closest && isPoi(closest)) return closest; return null; } getTargetLayer(target) { return target.closest(\"obc-poi-layer\"); } getLayerTargets(layer) { return Array.from(layer.querySelectorAll(`[${POI_ATTR}]`)).filter((el) => isPoi(el)); } getAllLayers() { return Array.from(this.querySelectorAll(\"obc-poi-layer\")); } isLayerSelected(layer) { return layer.isSelected === true; } cleanupSelection() { this.selectionMap.forEach((_, target) => { if (!target.isConnected) this.selectionMap.delete(target); }); } getLayer(kind) { const layers = this.getAllLayers(); switch (kind) { case \"top\": return layers[layers.length - 1] ?? null; case \"secondTop\": return layers.length >= 2 ? layers[layers.length - 2] ?? null : null; case \"selected\": return layers.find((layer) => this.isLayerSelected(layer)) ?? null; case \"default\": { const nonSelected = layers.filter((layer) => !this.isLayerSelected(layer)); return nonSelected[nonSelected.length - 1] ?? null; } } } clearOtherTopSelections(target) { const topLayer = this.getLayer(\"top\"); const activeLayer = this.getLayer(\"selected\") ?? topLayer; if (!activeLayer) return; this.getLayerTargets(activeLayer).forEach((other) => { if (other === target) return; const record = this.selectionMap.get(other); this.resetSelectionForTarget(other, record); }); } getTargetTagName(target) { return target.tagName.toLowerCase(); } inferBootstrapOriginLayer(target, selectedLayer) { const targetTagName = this.getTargetTagName(target); const typedOrigin = this.getAllLayers().filter((layer) => layer !== selectedLayer).find((layer) => this.getLayerTargets(layer).some((candidate) => this.getTargetTagName(candidate) === targetTagName)); if (typedOrigin) return typedOrigin; return this.getLayer(\"default\") ?? selectedLayer; } collectPoiHeaders(target) { const headers = /* @__PURE__ */ new Set(); const visit = (node) => { if (node instanceof Element && node.matches(\"obc-poi-header\")) headers.add(node); const children = node instanceof ShadowRoot || node instanceof Element ? Array.from(node.children) : []; for (const child of children) { if (child.matches(\"obc-poi-header\")) headers.add(child); if (child.shadowRoot) visit(child.shadowRoot); visit(child); } }; visit(target); if (target.shadowRoot) visit(target.shadowRoot); return Array.from(headers); } setTargetSelectedId(target) { if (target.hasHeader === void 0) return; if (this.collectPoiHeaders(target).some((header) => !header.hasAttribute(\"data-stack-header\"))) { target.hasHeader = true; return; } let selectedId = target.getAttribute(\"data-stack-selection-id\"); if (!selectedId) { selectedId = String(++this.selectionCounter); target.setAttribute(\"data-stack-selection-id\", selectedId); } if (\"headerContent\" in target) target.headerContent = selectedId; target.hasHeader = true; } clearTargetSelectedId(target) { this.collectPoiHeaders(target).filter((header) => header.hasAttribute(\"data-stack-header\")).forEach((header) => header.remove()); if (target.hasHeader !== void 0) target.hasHeader = false; if (\"headerContent\" in target) target.headerContent = \"\"; } async waitForPoiRender(target) { await target.updateComplete; await new Promise((resolve) => requestAnimationFrame(() => resolve())); } requestPoiRender(target) { target.requestUpdate?.(); } refreshTargetProjectionLayout(target, trackDurationMs = 0) { target.refreshProjectionLayout?.(trackDurationMs); } getTargetButtonProjectionOffset(target) { const raw = target.style.getPropertyValue(\"--obc-poi-button-projection-y\"); const parsed = Number.parseFloat(raw); return Number.isFinite(parsed) ? parsed : 0; } getLayerProjectionOffset(originLayer, destinationLayer) { if (!destinationLayer || destinationLayer === originLayer) return 0; const originRect = originLayer.getBoundingClientRect(); return destinationLayer.getBoundingClientRect().bottom - originRect.bottom; } getTargetProjectionOffset(originLayer, selectedLayer) { if (!selectedLayer || selectedLayer === originLayer) return 0; const originRect = originLayer.getBoundingClientRect(); const selectedRect = selectedLayer.getBoundingClientRect(); return originRect.bottom - selectedRect.bottom; } detachTargetFromCurrentGroup(target) { const currentLayer = this.getTargetLayer(target); const sourceGroup = target.parentElement?.tagName.toLowerCase() === \"obc-poi-group\" ? target.parentElement : null; if (!sourceGroup) return currentLayer; target.setRuntimeHorizontalOffsets?.(0, 0); if (!target.setRuntimeHorizontalOffsets) { target.buttonOffsetX = 0; target.targetOffsetX = 0; } clearTargetGroupingStyles(target); if (sourceGroup.expand) { sourceGroup.collapsing = true; sourceGroup.expand = false; } sourceGroup.removeAttribute(\"data-visible\"); return currentLayer; } applySelectedTargetProjectionState(target) { target.style.setProperty(\"--obc-poi-forced-target-transition-duration\", \"0ms\"); target.style.setProperty(\"--obc-poi-layer-inactive-opacity\", \"1\"); target.style.setProperty(\"z-index\", \"3\"); } clearTargetProjectionStyles(target) { target.style.removeProperty(\"--obc-poi-button-projection-y\"); target.style.removeProperty(\"--obc-poi-target-projection-y\"); target.style.removeProperty(\"--obc-poi-forced-target-transition-duration\"); target.style.removeProperty(\"--obc-poi-layer-inactive-opacity\"); target.style.removeProperty(\"z-index\"); } /** * Find the button and line elements inside the POI's shadow DOM. */ getAnimationElements(target) { const poiShadow = (target.shadowRoot?.querySelector(\"obc-poi\"))?.shadowRoot; let button = null; const buttonSlot = poiShadow?.querySelector(\"slot[name=\\\"button\\\"]\"); if (buttonSlot) button = buttonSlot.assignedElements({ flatten: true })[0] ?? null; const line = poiShadow?.querySelector(\".line\"); return { button, line }; } /** * Animate a layer jump using Web Animations API. * fill:'forwards' overrides ALL CSS/Lit styles during animation. * After cancel(), Lit's final-state styles take over. */ async animateLayerJump(target, beforeButtonRect, beforeLineRect) { const { button, line } = this.getAnimationElements(target); const afterButtonRect = button?.getBoundingClientRect(); const afterLineRect = line?.getBoundingClientRect(); const duration = _ObcPoiLayerStack.STACK_JUMP_DURATION_MS; const easing = \"ease-out\"; const animations = []; if (button && beforeButtonRect && afterButtonRect) { const deltaY = beforeButtonRect.top - afterButtonRect.top; if (Math.abs(deltaY) >= .5) { const finalTransform = getComputedStyle(button).transform; const startTransform = finalTransform === \"none\" ? `translateY(${deltaY}px)` : `${finalTransform} translateY(${deltaY}px)`; animations.push(button.animate([{ transform: startTransform }, { transform: finalTransform }], { duration, easing, fill: \"forwards\" })); } } if (line && button && beforeButtonRect && afterButtonRect) { const buttonDeltaY = beforeButtonRect.top - afterButtonRect.top; const beforeH = beforeLineRect?.height ?? 0; const afterH = afterLineRect?.height ?? (beforeH || 1); const scaleRatio = afterH > 0 ? beforeH / afterH : 1; if (Math.abs(buttonDeltaY) >= .5 || Math.abs(scaleRatio - 1) > .01) animations.push(line.animate([{ transform: `translateX(-50%) translateY(${buttonDeltaY}px) scaleY(${scaleRatio})`, transformOrigin: \"top center\" }, { transform: \"translateX(-50%) translateY(0px) scaleY(1)\", transformOrigin: \"top center\" }], { duration, easing, fill: \"forwards\" })); } if (animations.length > 0) { await Promise.all(animations.map((a) => a.finished)); animations.forEach((a) => a.cancel()); } } async moveTargetIntoSelectedLayer(target, _originLayer, selectedLayer, animate = true) { const { button, line } = this.getAnimationElements(target); const beforeButtonRect = button?.getBoundingClientRect() ?? null; const beforeLineRect = line?.getBoundingClientRect() ?? null; if (this.getTargetLayer(target) !== selectedLayer) selectedLayer.appendChild(target); this.requestPoiRender(target); this.refreshTargetProjectionLayout(target); await this.waitForPoiRender(target); if (!animate) return; await this.animateLayerJump(target, beforeButtonRect, beforeLineRect); } async moveTrackedTargetToSelectedLayer(target, record, selectedLayer, animateProjection) { const currentLayer = this.detachTargetFromCurrentGroup(target) ?? this.getTargetLayer(target) ?? record.originLayer; clearTargetGroupingAttributes(target); await this.moveTargetIntoSelectedLayer(target, record.originLayer, selectedLayer, animateProjection); if (currentLayer !== selectedLayer) currentLayer.requestGroupingUpdate(); selectedLayer.requestGroupingUpdate(); } async syncTargetProjection(target, originLayer, selectedLayer, animate = true) { const nextProjectionOffset = this.getLayerProjectionOffset(originLayer, selectedLayer); const currentProjectionOffset = this.getTargetButtonProjectionOffset(target); if (Math.abs(nextProjectionOffset - currentProjectionOffset) < .5) { if (Math.abs(nextProjectionOffset) < .5) target.style.removeProperty(\"--obc-poi-button-projection-y\"); else target.style.setProperty(\"--obc-poi-button-projection-y\", `${nextProjectionOffset}px`); this.requestPoiRender(target); this.refreshTargetProjectionLayout(target); return; } if (Math.abs(nextProjectionOffset) < .5) target.style.removeProperty(\"--obc-poi-button-projection-y\"); else target.style.setProperty(\"--obc-poi-button-projection-y\", `${nextProjectionOffset}px`); this.requestPoiRender(target); if (animate) { this.refreshTargetProjectionLayout(target, _ObcPoiLayerStack.STACK_JUMP_DURATION_MS); await this.waitForPoiRender(target); return; } this.refreshTargetProjectionLayout(target); } async animateTargetReturnToOrigin(target, record) { target.setAttribute(_ObcPoiLayerStack.STACK_RETURNING_ATTR, \"true\"); try { const currentLayer = this.detachTargetFromCurrentGroup(target) ?? this.getTargetLayer(target); clearTargetGroupingAttributes(target); const { button: beforeBtn, line: beforeLine } = this.getAnimationElements(target); const beforeButtonRect = beforeBtn?.getBoundingClientRect() ?? null; const beforeLineRect = beforeLine?.getBoundingClientRect() ?? null; target.style.removeProperty(\"--obc-poi-target-projection-y\"); target.style.removeProperty(\"--obc-poi-button-projection-y\"); if (target.parentElement !== record.originLayer) record.originLayer.appendChild(target); this.requestPoiRender(target); this.refreshTargetProjectionLayout(target); await this.waitForPoiRender(target); await this.animateLayerJump(target, beforeButtonRect, beforeLineRect); this.setSelectedTargetInteractivity(target, false); clearTargetGroupingAttributes(target); this.clearTargetSelectedId(target); this.clearTargetProjectionStyles(target); this.requestPoiRender(target); if (currentLayer && currentLayer !== record.originLayer) currentLayer.requestGroupingUpdate(); record.originLayer.requestGroupingUpdate(); this.schedulePlacement(); } finally { target.removeAttribute(_ObcPoiLayerStack.STACK_RETURNING_ATTR); } } setSelectedTargetInteractivity(target, selected) { const isInAutoGroup = target.hasAttribute(\"data-grouped\") || target.closest(\"obc-poi-group\") !== null; target.selected = selected; if (selected) { target.style.setProperty(\"--obc-poi-overlap-pointer-events\", \"auto\"); if (!isInAutoGroup && target.value !== ObcPoiValue.Overlapped) { target.value = ObcPoiValue.Checked; target.removeAttribute(\"data-behind\"); target.setAttribute(\"data-front\", \"true\"); } } else { target.value = ObcPoiValue.Unchecked; target.style.removeProperty(\"--obc-poi-overlap-pointer-events\"); target.removeAttribute(\"data-front\"); } } trackSelectionTarget(target, originLayer, keepInSelectedLayer = true) { this.selectionMap.set(target, { originLayer, previousAnimatePosition: target.animatePosition ?? false, keepInSelectedLayer }); target.removeAttribute(\"data-stack-selected\"); } activateTrackedTarget(target, record, selectedLayer, animateProjection = true) { if (record.keepInSelectedLayer) { target.removeAttribute(\"data-stack-selected\"); if (this.getTargetLayer(target) !== selectedLayer) this.moveTrackedTargetToSelectedLayer(target, record, selectedLayer, animateProjection); else { const targetProjectionOffset = this.getTargetProjectionOffset(record.originLayer, selectedLayer); if (Math.abs(targetProjectionOffset) < .5) target.style.removeProperty(\"--obc-poi-target-projection-y\"); else target.style.setProperty(\"--obc-poi-target-projection-y\", `${targetProjectionOffset}px`); target.style.removeProperty(\"--obc-poi-button-projection-y\"); this.requestPoiRender(target); this.refreshTargetProjectionLayout(target); } } else { clearTargetGroupingAttributes(target); target.setAttribute(\"data-stack-selected\", \"true\"); this.syncTargetProjection(target, record.originLayer, selectedLayer, animateProjection); } this.setSelectedTargetInteractivity(target, true); this.setTargetSelectedId(target); this.applySelectedTargetProjectionState(target); } seedSelectedLayerSelections(selectedLayer) { const seededTargets = /* @__PURE__ */ new Set(); if (this.selectionMode === \"none\") return seededTargets; const selectedTargets = this.getLayerTargets(selectedLayer); for (const target of selectedTargets) { if (target.hasAttribute(_ObcPoiLayerStack.STACK_RETURNING_ATTR)) continue; if (this.selectionMap.has(target)) continue; if (this.selectionMode === \"single\" && this.selectionMap.size > 0) break; const originLayer = this.inferBootstrapOriginLayer(target, selectedLayer); this.selectionMap.set(target, { originLayer, previousAnimatePosition: target.animatePosition ?? false, keepInSelectedLayer: true }); target.removeAttribute(\"data-stack-selected\"); seededTargets.add(target); } return seededTargets; } resetSelectionForTarget(target, record) { target.removeAttribute(\"data-stack-selected\"); if (record) { this.selectionMap.delete(target); this.animateTargetReturnToOrigin(target, record); return; } this.setSelectedTargetInteractivity(target, false); clearTargetGroupingAttributes(target); this.clearTargetSelectedId(target); this.clearTargetProjectionStyles(target); } clearSelectionMapExcept(target) { Array.from(this.selectionMap.entries()).forEach(([other, record]) => { if (other === target) return; this.resetSelectionForTarget(other, record); }); } setupMutationObserver() { this.mutationObserver?.disconnect(); this.mutationObserver = new MutationObserver((mutations) => { for (const mutation of mutations) { if (mutation.type === \"attributes\" && mutation.target instanceof HTMLElement) { if (mutation.attributeName === \"data-poi-target\") { this.schedulePlacement(); return; } } for (const node of Array.from(mutation.addedNodes)) { if (!(node instanceof HTMLElement)) continue; if (isPoi(node) || node.querySelector?.(`[data-poi-target]`)) { this.schedulePlacement(); return; } } } }); this.mutationObserver.observe(this, { childList: true, subtree: true, attributes: true, attributeFilter: [POI_ATTR] }); } schedulePlacement() { if (this.placementRaf) return; this.placementRaf = requestAnimationFrame(() => { this.placementRaf = 0; this.updateLayerOrders(); this.syncSelectedLayerTargets(); }); } updateLayerInactiveState(selectedLayer) { this.getAllLayers().forEach((layer) => { if (selectedLayer && layer !== selectedLayer) layer.setAttribute(\"data-stack-inactive\", \"true\"); else layer.removeAttribute(\"data-stack-inactive\"); }); } updateLayerOrders() { this.getAllLayers().forEach((layer, index) => { layer.style.order = String(index); }); const selectedLayer = this.getLayer(\"selected\"); this.updateLayerInactiveState(selectedLayer); } syncSelectedLayerTargets() { const selectedLayer = this.getLayer(\"selected\"); if (!selectedLayer) { this.selectionMap.forEach((record, target) => { this.resetSelectionForTarget(target, record); }); return; } const seededTargets = this.seedSelectedLayerSelections(selectedLayer); this.selectionMap.forEach((record, target) => { if (!target.isConnected) { this.selectionMap.delete(target); return; } if (target.hasAttribute(_ObcPoiLayerStack.STACK_RETURNING_ATTR)) return; if (!record.keepInSelectedLayer && !target.hasAttribute(\"data-stack-selected\")) target.setAttribute(\"data-stack-selected\", \"true\"); this.activateTrackedTarget(target, record, selectedLayer, !seededTargets.has(target)); }); } render() { return html` <div class=\"wrapper\"> <slot></slot> </div> `; } static { this.styles = unsafeCSS(poi_layer_stack_default); } }"
704
+ "default": "class ObcPoiLayerStack extends LitElement { static { _ObcPoiLayerStack = this; } constructor(..._args) { super(..._args); this.selectionMode = \"none\"; this.handleStackClick = (event) => this.onStackClick(event); this.handleSlotChange = () => this.schedulePlacement(); this.handleTargetLayoutChange = () => this.schedulePlacement(); this.handleLayerSelectionChanged = () => this.schedulePlacement(); this.selectionMap = /* @__PURE__ */ new Map(); this.displacedTargets = /* @__PURE__ */ new Map(); this.selectionCounter = 0; this.placementRaf = 0; } static { this.STACK_JUMP_DURATION_MS = 100; } static { this.STACK_RETURNING_ATTR = \"data-stack-returning\"; } connectedCallback() { super.connectedCallback(); this.addEventListener(\"click\", this.handleStackClick); this.addEventListener(\"obc-poi-data-layout-change\", this.handleTargetLayoutChange); this.addEventListener(\"layer-selection-changed\", this.handleLayerSelectionChanged); } firstUpdated() { (this.shadowRoot?.querySelector(\"slot\"))?.addEventListener(\"slotchange\", this.handleSlotChange); this.setupMutationObserver(); this.schedulePlacement(); requestAnimationFrame(() => { this.schedulePlacement(); requestAnimationFrame(() => this.schedulePlacement()); }); } disconnectedCallback() { super.disconnectedCallback(); this.removeEventListener(\"click\", this.handleStackClick); this.removeEventListener(\"obc-poi-data-layout-change\", this.handleTargetLayoutChange); this.removeEventListener(\"layer-selection-changed\", this.handleLayerSelectionChanged); (this.shadowRoot?.querySelector(\"slot\"))?.removeEventListener(\"slotchange\", this.handleSlotChange); this.mutationObserver?.disconnect(); this.mutationObserver = void 0; if (this.placementRaf) { cancelAnimationFrame(this.placementRaf); this.placementRaf = 0; } this.selectionMap.forEach((_, target) => { this.clearTargetProjectionStyles(target); this.requestPoiRender(target); }); this.selectionMap.clear(); this.displacedTargets.forEach((_, target) => { this.clearTargetProjectionStyles(target); this.requestPoiRender(target); }); this.displacedTargets.clear(); this.selectionCounter = 0; } onStackClick(event) { if (this.selectionMode === \"none\") return; const target = this.getPoiTargetFromEvent(event); if (!target) return; if (target.hasAttribute(_ObcPoiLayerStack.STACK_RETURNING_ATTR)) return; this.cleanupSelection(); const existing = this.selectionMap.get(target); if (existing) { this.resetSelectionForTarget(target, existing); return; } this.performSelection(target); } /** Currently selected POI targets. */ get selectedTargets() { this.cleanupSelection(); return Array.from(this.selectionMap.keys()); } /** * Programmatically select a target, following the same flow as a user * click. `options.selectionId` presets the badge id shown in the * stack-managed header; without it the id auto-increments. Returns * `false` when selection is disabled, the target is mid-transition or * already selected, or no layer can host the selection. */ selectTarget(target, options) { if (this.selectionMode === \"none\") return false; if (target.hasAttribute(_ObcPoiLayerStack.STACK_RETURNING_ATTR)) return false; this.cleanupSelection(); if (this.selectionMap.has(target)) return false; return this.performSelection(target, options?.selectionId); } /** * Programmatically deselect a target. Returns `false` when it is not * selected. */ deselectTarget(target) { const record = this.selectionMap.get(target); if (!record) return false; this.resetSelectionForTarget(target, record); return true; } /** Deselect all targets. */ clearSelection() { Array.from(this.selectionMap.entries()).forEach(([target, record]) => { this.resetSelectionForTarget(target, record); }); } performSelection(target, selectionId) { const homeLayer = this.getTargetLayer(target); if (!homeLayer) return false; const selectedLayer = this.getLayer(\"selected\") ?? this.getLayer(\"top\"); if (!selectedLayer) return false; if (this.selectionMode === \"single\") { this.clearOtherTopSelections(target); this.clearSelectionMapExcept(target); } const displaced = this.displacedTargets.get(target); this.displacedTargets.delete(target); const originLayer = displaced?.originLayer ?? (homeLayer === selectedLayer ? this.inferBootstrapOriginLayer(target, selectedLayer) : homeLayer); if (selectionId) target.setAttribute(\"data-stack-selection-id\", selectionId); const record = { homeLayer, originLayer }; this.selectionMap.set(target, record); this.activateTrackedTarget(target, record, selectedLayer); this.schedulePlacement(); this.dispatchSelectionChange(target, null); return true; } dispatchSelectionChange(added, removed) { this.dispatchEvent(new CustomEvent(\"selection-change\", { detail: { selected: this.selectedTargets, added, removed }, bubbles: true, composed: true })); } getPoiTargetFromEvent(event) { const path = event.composedPath?.() ?? []; for (const item of path) if (item instanceof HTMLElement && isPoi(item)) return item; const direct = event.target instanceof HTMLElement ? event.target : null; if (!direct) return null; const closest = direct.closest(`[${POI_ATTR}]`); if (closest && isPoi(closest)) return closest; return null; } getTargetLayer(target) { return target.closest(\"obc-poi-layer\"); } getLayerTargets(layer) { return Array.from(layer.querySelectorAll(`[${POI_ATTR}]`)).filter((el) => isPoi(el)); } getAllLayers() { return Array.from(this.querySelectorAll(\"obc-poi-layer\")); } isLayerSelected(layer) { return layer.isSelected === true; } cleanupSelection() { this.selectionMap.forEach((_, target) => { if (!target.isConnected) this.selectionMap.delete(target); }); this.displacedTargets.forEach((_, target) => { if (!target.isConnected) this.displacedTargets.delete(target); }); } getLayer(kind) { const layers = this.getAllLayers(); switch (kind) { case \"top\": return layers[layers.length - 1] ?? null; case \"secondTop\": return layers.length >= 2 ? layers[layers.length - 2] ?? null : null; case \"selected\": return layers.find((layer) => this.isLayerSelected(layer)) ?? null; case \"default\": { const nonSelected = layers.filter((layer) => !this.isLayerSelected(layer)); return nonSelected[nonSelected.length - 1] ?? null; } } } clearOtherTopSelections(target) { const topLayer = this.getLayer(\"top\"); const activeLayer = this.getLayer(\"selected\") ?? topLayer; if (!activeLayer) return; this.getLayerTargets(activeLayer).forEach((other) => { if (other === target) return; if (this.displacedTargets.has(other)) return; const record = this.selectionMap.get(other); this.resetSelectionForTarget(other, record); }); } getTargetTagName(target) { return target.tagName.toLowerCase(); } inferBootstrapOriginLayer(target, selectedLayer) { const targetTagName = this.getTargetTagName(target); const typedOrigin = this.getAllLayers().filter((layer) => layer !== selectedLayer).find((layer) => this.getLayerTargets(layer).some((candidate) => this.getTargetTagName(candidate) === targetTagName)); if (typedOrigin) return typedOrigin; return this.getLayer(\"default\") ?? selectedLayer; } collectPoiHeaders(target) { const headers = /* @__PURE__ */ new Set(); const visit = (node) => { if (node instanceof Element && node.matches(\"obc-poi-header\")) headers.add(node); const children = node instanceof ShadowRoot || node instanceof Element ? Array.from(node.children) : []; for (const child of children) { if (child.matches(\"obc-poi-header\")) headers.add(child); if (child.shadowRoot) visit(child.shadowRoot); visit(child); } }; visit(target); if (target.shadowRoot) visit(target.shadowRoot); return Array.from(headers); } setTargetSelectedId(target) { if (target.hasHeader === void 0) return; if (this.collectPoiHeaders(target).some((header) => !header.hasAttribute(\"data-stack-header\"))) { target.hasHeader = true; return; } let selectedId = target.getAttribute(\"data-stack-selection-id\"); if (!selectedId) { selectedId = String(++this.selectionCounter); target.setAttribute(\"data-stack-selection-id\", selectedId); } if (\"headerContent\" in target) target.headerContent = selectedId; target.hasHeader = true; } clearTargetSelectedId(target) { this.collectPoiHeaders(target).filter((header) => header.hasAttribute(\"data-stack-header\")).forEach((header) => header.remove()); if (target.hasHeader !== void 0) target.hasHeader = false; if (\"headerContent\" in target) target.headerContent = \"\"; } async waitForPoiRender(target) { await target.updateComplete; await new Promise((resolve) => requestAnimationFrame(() => resolve())); } requestPoiRender(target) { target.requestUpdate?.(); } refreshTargetProjectionLayout(target, trackDurationMs = 0) { target.refreshProjectionLayout?.(trackDurationMs); } getInlineVarPx(target, name) { const raw = target.style.getPropertyValue(name); const parsed = Number.parseFloat(raw); return Number.isFinite(parsed) ? parsed : 0; } /** Pixel delta between two layers' bottom edges (`to.bottom - from.bottom`). */ layerBottomDelta(from, to) { if (from === to) return 0; return to.getBoundingClientRect().bottom - from.getBoundingClientRect().bottom; } setProjectionVar(target, name, valuePx) { if (Math.abs(valuePx) < .5) target.style.removeProperty(name); else target.style.setProperty(name, `${valuePx}px`); } /** * Render the target at the given projection offsets without touching its * DOM position. When `animate` is set and an offset actually changes, the * jump is FLIP-animated via the Web Animations API. */ async applyTargetProjection(target, buttonOffsetPx, targetOffsetPx, animate) { const currentButton = this.getInlineVarPx(target, \"--obc-poi-button-projection-y\"); const currentTarget = this.getInlineVarPx(target, \"--obc-poi-target-projection-y\"); if (!(Math.abs(buttonOffsetPx - currentButton) >= .5 || Math.abs(targetOffsetPx - currentTarget) >= .5)) { this.setProjectionVar(target, \"--obc-poi-button-projection-y\", buttonOffsetPx); this.setProjectionVar(target, \"--obc-poi-target-projection-y\", targetOffsetPx); this.requestPoiRender(target); this.refreshTargetProjectionLayout(target); return; } const { button, line } = this.getAnimationElements(target); const beforeButtonRect = animate ? button?.getBoundingClientRect() ?? null : null; const beforeLineRect = animate ? line?.getBoundingClientRect() ?? null : null; this.setProjectionVar(target, \"--obc-poi-button-projection-y\", buttonOffsetPx); this.setProjectionVar(target, \"--obc-poi-target-projection-y\", targetOffsetPx); this.requestPoiRender(target); this.refreshTargetProjectionLayout(target); if (!animate) return; await this.waitForPoiRender(target); await this.animateLayerJump(target, beforeButtonRect, beforeLineRect); } /** * The group a target currently belongs to — a light-DOM parent for * consumer-managed groups, or the shadow group whose member slot the * target is assigned to for layer-created auto groups. */ getContainingGroup(target) { if (target.parentElement?.tagName.toLowerCase() === \"obc-poi-group\") return target.parentElement; const slotParent = target.assignedSlot?.parentElement; if (slotParent?.tagName.toLowerCase() === \"obc-poi-group\") return slotParent; return null; } detachTargetFromCurrentGroup(target) { const currentLayer = this.getTargetLayer(target); const sourceGroup = this.getContainingGroup(target); if (!sourceGroup) return currentLayer; target.setRuntimeHorizontalOffsets?.(0, 0); if (!target.setRuntimeHorizontalOffsets) { target.buttonOffsetX = 0; target.targetOffsetX = 0; } clearTargetGroupingStyles(target); if (sourceGroup.expand) { sourceGroup.collapsing = true; sourceGroup.expand = false; } sourceGroup.removeAttribute(\"data-visible\"); return currentLayer; } applySelectedTargetProjectionState(target) { target.style.setProperty(\"--obc-poi-forced-target-transition-duration\", \"0ms\"); target.style.setProperty(\"--obc-poi-layer-inactive-opacity\", \"1\"); target.style.setProperty(\"z-index\", \"3\"); } clearTargetProjectionStyles(target) { target.style.removeProperty(\"--obc-poi-button-projection-y\"); target.style.removeProperty(\"--obc-poi-target-projection-y\"); target.style.removeProperty(\"--obc-poi-forced-target-transition-duration\"); target.style.removeProperty(\"--obc-poi-layer-inactive-opacity\"); target.style.removeProperty(\"z-index\"); } /** * Find the button and line elements inside the POI's shadow DOM. */ getAnimationElements(target) { const poiShadow = (target.shadowRoot?.querySelector(\"obc-poi\"))?.shadowRoot; let button = null; const buttonSlot = poiShadow?.querySelector(\"slot[name=\\\"button\\\"]\"); if (buttonSlot) button = buttonSlot.assignedElements({ flatten: true })[0] ?? null; const line = poiShadow?.querySelector(\".line\"); return { button, line }; } /** * Animate a layer jump using Web Animations API. * fill:'forwards' overrides ALL CSS/Lit styles during animation. * After cancel(), Lit's final-state styles take over. */ async animateLayerJump(target, beforeButtonRect, beforeLineRect) { const { button, line } = this.getAnimationElements(target); const afterButtonRect = button?.getBoundingClientRect(); const afterLineRect = line?.getBoundingClientRect(); const duration = _ObcPoiLayerStack.STACK_JUMP_DURATION_MS; const easing = \"ease-out\"; const animations = []; if (button && beforeButtonRect && afterButtonRect) { const deltaY = beforeButtonRect.top - afterButtonRect.top; if (Math.abs(deltaY) >= .5) { const finalTransform = getComputedStyle(button).transform; const startTransform = finalTransform === \"none\" ? `translateY(${deltaY}px)` : `${finalTransform} translateY(${deltaY}px)`; animations.push(button.animate([{ transform: startTransform }, { transform: finalTransform }], { duration, easing, fill: \"forwards\" })); } } if (line && button && beforeButtonRect && afterButtonRect) { const buttonDeltaY = beforeButtonRect.top - afterButtonRect.top; const beforeH = beforeLineRect?.height ?? 0; const afterH = afterLineRect?.height ?? (beforeH || 1); const scaleRatio = afterH > 0 ? beforeH / afterH : 1; if (Math.abs(buttonDeltaY) >= .5 || Math.abs(scaleRatio - 1) > .01) animations.push(line.animate([{ transform: `translateX(-50%) translateY(${buttonDeltaY}px) scaleY(${scaleRatio})`, transformOrigin: \"top center\" }, { transform: \"translateX(-50%) translateY(0px) scaleY(1)\", transformOrigin: \"top center\" }], { duration, easing, fill: \"forwards\" })); } if (animations.length > 0) { await Promise.all(animations.map((a) => a.finished)); animations.forEach((a) => a.cancel()); } } async animateTargetReturnToOrigin(target, record) { target.setAttribute(_ObcPoiLayerStack.STACK_RETURNING_ATTR, \"true\"); try { const sourceGroupLayer = this.detachTargetFromCurrentGroup(target); clearTargetGroupingAttributes(target); const originOffset = this.layerBottomDelta(record.homeLayer, record.originLayer); await this.applyTargetProjection(target, originOffset, originOffset, true); this.setSelectedTargetInteractivity(target, false); clearTargetGroupingAttributes(target); this.clearTargetSelectedId(target); if (record.homeLayer === record.originLayer) this.clearTargetProjectionStyles(target); else { target.style.removeProperty(\"--obc-poi-forced-target-transition-duration\"); target.style.removeProperty(\"--obc-poi-layer-inactive-opacity\"); target.style.removeProperty(\"z-index\"); this.displacedTargets.set(target, record); } this.requestPoiRender(target); if (sourceGroupLayer && sourceGroupLayer !== record.homeLayer) sourceGroupLayer.requestGroupingUpdate(); record.homeLayer.requestGroupingUpdate(); this.schedulePlacement(); } finally { target.removeAttribute(_ObcPoiLayerStack.STACK_RETURNING_ATTR); target.removeAttribute(\"data-stack-selected\"); } } setSelectedTargetInteractivity(target, selected) { const isInAutoGroup = target.hasAttribute(\"data-grouped\") || this.getContainingGroup(target) !== null; target.selected = selected; if (selected) { target.style.setProperty(\"--obc-poi-overlap-pointer-events\", \"auto\"); if (!isInAutoGroup && target.value !== ObcPoiValue.Overlapped) { target.value = ObcPoiValue.Checked; target.removeAttribute(\"data-behind\"); target.setAttribute(\"data-front\", \"true\"); } } else { target.value = ObcPoiValue.Unchecked; target.style.removeProperty(\"--obc-poi-overlap-pointer-events\"); target.removeAttribute(\"data-front\"); } } activateTrackedTarget(target, record, selectedLayer, animateProjection = true) { if (record.homeLayer !== selectedLayer) { const sourceGroupLayer = this.detachTargetFromCurrentGroup(target); clearTargetGroupingAttributes(target); const firstActivation = !target.hasAttribute(\"data-stack-selected\"); target.setAttribute(\"data-stack-selected\", \"true\"); const buttonOffset = this.layerBottomDelta(record.homeLayer, selectedLayer); const targetOffset = this.layerBottomDelta(record.homeLayer, record.originLayer); this.applyTargetProjection(target, buttonOffset, targetOffset, animateProjection); if (firstActivation) { if (sourceGroupLayer && sourceGroupLayer !== record.homeLayer) sourceGroupLayer.requestGroupingUpdate(); record.homeLayer.requestGroupingUpdate(); } } else { const targetOffset = this.layerBottomDelta(selectedLayer, record.originLayer); this.applyTargetProjection(target, 0, targetOffset, animateProjection); } this.setSelectedTargetInteractivity(target, true); this.setTargetSelectedId(target); this.applySelectedTargetProjectionState(target); } seedSelectedLayerSelections(selectedLayer) { const seededTargets = /* @__PURE__ */ new Set(); if (this.selectionMode === \"none\") return seededTargets; const selectedTargets = this.getLayerTargets(selectedLayer); for (const target of selectedTargets) { if (target.hasAttribute(_ObcPoiLayerStack.STACK_RETURNING_ATTR)) continue; if (this.selectionMap.has(target)) continue; if (this.displacedTargets.has(target)) continue; if (this.selectionMode === \"single\" && this.selectionMap.size > 0) break; const originLayer = this.inferBootstrapOriginLayer(target, selectedLayer); this.selectionMap.set(target, { homeLayer: selectedLayer, originLayer }); seededTargets.add(target); this.dispatchSelectionChange(target, null); } return seededTargets; } resetSelectionForTarget(target, record) { if (record) { this.selectionMap.delete(target); this.animateTargetReturnToOrigin(target, record); this.dispatchSelectionChange(null, target); return; } target.removeAttribute(\"data-stack-selected\"); this.setSelectedTargetInteractivity(target, false); clearTargetGroupingAttributes(target); this.clearTargetSelectedId(target); this.clearTargetProjectionStyles(target); } clearSelectionMapExcept(target) { Array.from(this.selectionMap.entries()).forEach(([other, record]) => { if (other === target) return; this.resetSelectionForTarget(other, record); }); } setupMutationObserver() { this.mutationObserver?.disconnect(); this.mutationObserver = new MutationObserver((mutations) => { for (const mutation of mutations) { if (mutation.type === \"attributes\" && mutation.target instanceof HTMLElement) { if (mutation.attributeName === \"data-poi-target\") { this.schedulePlacement(); return; } } for (const node of Array.from(mutation.addedNodes)) { if (!(node instanceof HTMLElement)) continue; if (isPoi(node) || node.querySelector?.(`[data-poi-target]`)) { this.schedulePlacement(); return; } } } }); this.mutationObserver.observe(this, { childList: true, subtree: true, attributes: true, attributeFilter: [POI_ATTR] }); } schedulePlacement() { if (this.placementRaf) return; this.placementRaf = requestAnimationFrame(() => { this.placementRaf = 0; this.updateLayerOrders(); this.syncSelectedLayerTargets(); }); } updateLayerInactiveState(selectedLayer) { this.getAllLayers().forEach((layer) => { if (selectedLayer && layer !== selectedLayer) layer.setAttribute(\"data-stack-inactive\", \"true\"); else layer.removeAttribute(\"data-stack-inactive\"); }); } updateLayerOrders() { this.getAllLayers().forEach((layer, index) => { layer.style.order = String(index); }); const selectedLayer = this.getLayer(\"selected\"); this.updateLayerInactiveState(selectedLayer); } syncSelectedLayerTargets() { const selectedLayer = this.getLayer(\"selected\"); if (!selectedLayer) { this.selectionMap.forEach((record, target) => { this.resetSelectionForTarget(target, record); }); this.refreshDisplacedTargets(); return; } const seededTargets = this.seedSelectedLayerSelections(selectedLayer); this.selectionMap.forEach((record, target) => { if (!target.isConnected) { this.selectionMap.delete(target); return; } if (target.hasAttribute(_ObcPoiLayerStack.STACK_RETURNING_ATTR)) return; this.activateTrackedTarget(target, record, selectedLayer, !seededTargets.has(target)); }); this.refreshDisplacedTargets(); } /** * Keep deselected targets that render outside their DOM layer (targets * authored in the selected layer whose logical origin is another layer) * projected at up-to-date offsets across layer resizes. */ refreshDisplacedTargets() { this.displacedTargets.forEach((record, target) => { if (!target.isConnected) { this.displacedTargets.delete(target); return; } if (target.hasAttribute(_ObcPoiLayerStack.STACK_RETURNING_ATTR)) return; const originOffset = this.layerBottomDelta(record.homeLayer, record.originLayer); this.applyTargetProjection(target, originOffset, originOffset, false); }); } render() { return html` <div class=\"wrapper\"> <slot></slot> </div> `; } static { this.styles = unsafeCSS(poi_layer_stack_default); } }"
681
705
  }
682
706
  ],
683
707
  "exports": [
@@ -706,7 +730,7 @@
706
730
  {
707
731
  "kind": "variable",
708
732
  "name": "ObcPoiLayer",
709
- "default": "class ObcPoiLayer extends LitElement { static { _ObcPoiLayer = this; } constructor(..._args) { super(..._args); this.label = \"\"; this.debug = false; this.overlapMode = \"grouping\"; this.isSelected = false; this.joinWhileExpanded = false; this.internalSwapping = false; this.lastHeight = 0; this.isGrouping = false; this.targetObservers = /* @__PURE__ */ new Map(); this.targetSizeElements = /* @__PURE__ */ new Map(); this.groupingRaf = 0; this.heightRaf = 0; this.groupRemovalTimers = /* @__PURE__ */ new WeakMap(); this.exitLockTimers = /* @__PURE__ */ new Map(); this.autoGroupCollapseTimeout = 0; this.crossingModeRaf = 0; this.cachedCrossingTargets = []; this.crossingTargetsDirty = false; this.crossingOrder = []; this.crossingLastEffectiveX = /* @__PURE__ */ new Map(); this.previousPositions = /* @__PURE__ */ new Map(); this.lastOffsets = /* @__PURE__ */ new Map(); this.handleSlotChange = () => { this.updateTargetObservers(); this.scheduleGrouping(); this.scheduleLayerHeightUpdate(); }; this.handleCollapseFinished = () => { this.scheduleGrouping(); }; this.handlePoiDataLayoutChange = () => { this.scheduleGrouping(); this.scheduleLayerHeightUpdate(); }; this.handleGroupExpand = (event) => { const group = event.target; if (!group?.tagName?.toLowerCase().includes(\"group\")) return; if (group.hasAttribute(\"data-exiting\")) return; const targets = this.getAllTargets(); const groupedTargets = new Set(this.getGroupTargets(group)); if (groupedTargets.size === 0) return; if (event.detail.expand) targets.forEach((target) => { if (!groupedTargets.has(target)) { const nextValue = this.resolveTargetValue(target, true); target.value = nextValue; if (nextValue === ObcPoiValue.Overlapped) this.applyStandaloneVisualState(target, true); else this.clearStandaloneVisualState(target); } }); }; this.buttonOffsetXResetRaf = /* @__PURE__ */ new Map(); } static { this.GROUP_LAYER_HOOK_ATTR = \"data-in-poi-layer\"; } connectedCallback() { super.connectedCallback(); if (!this.hasUpdated) return; this.setupResizeObserver(); this.setupTargetResizeObserver(); this.setupLayerMutationObserver(); this.updateTargetObservers(); this.scheduleGrouping(); this.scheduleLayerHeightUpdate(); this.addLayerEventListeners(); (this.shadowRoot?.querySelector(\"slot\"))?.addEventListener(\"slotchange\", this.handleSlotChange); } firstUpdated() { this.crossingTargetsDirty = true; this.setupResizeObserver(); this.setupTargetResizeObserver(); this.setupLayerMutationObserver(); this.updateTargetObservers(); this.scheduleGrouping(); this.scheduleLayerHeightUpdate(); (this.shadowRoot?.querySelector(\"slot\"))?.addEventListener(\"slotchange\", this.handleSlotChange); requestAnimationFrame(() => { this.updateTargetObservers(); this.scheduleLayerHeightUpdate(); }); this.addLayerEventListeners(); } disconnectedCallback() { super.disconnectedCallback(); this.removeLayerEventListeners(); (this.shadowRoot?.querySelector(\"slot\"))?.removeEventListener(\"slotchange\", this.handleSlotChange); this.resizeObserver?.disconnect(); this.targetResizeObserver?.disconnect(); this.layerMutationObserver?.disconnect(); this.targetObservers.forEach((observer) => observer.disconnect()); this.targetObservers.clear(); this.targetSizeElements.clear(); if (this.groupingRaf) { cancelAnimationFrame(this.groupingRaf); this.groupingRaf = 0; } if (this.crossingModeRaf) { cancelAnimationFrame(this.crossingModeRaf); this.crossingModeRaf = 0; } this.previousPositions.clear(); if (this.heightRaf) { cancelAnimationFrame(this.heightRaf); this.heightRaf = 0; } this.exitLockTimers.forEach((timerId) => window.clearTimeout(timerId)); this.exitLockTimers.clear(); if (this.autoGroupCollapseTimeout) { window.clearTimeout(this.autoGroupCollapseTimeout); this.autoGroupCollapseTimeout = 0; } this.buttonOffsetXResetRaf.forEach((rafId) => cancelAnimationFrame(rafId)); this.buttonOffsetXResetRaf.clear(); this.lastOffsets.clear(); this.crossingLastEffectiveX.clear(); } addLayerEventListeners() { this.addEventListener(\"obc-poi-data-layout-change\", this.handlePoiDataLayoutChange); this.addEventListener(\"expand\", this.handleGroupExpand); this.addEventListener(\"collapse-finished\", this.handleCollapseFinished); } removeLayerEventListeners() { this.removeEventListener(\"obc-poi-data-layout-change\", this.handlePoiDataLayoutChange); this.removeEventListener(\"expand\", this.handleGroupExpand); this.removeEventListener(\"collapse-finished\", this.handleCollapseFinished); } setupResizeObserver() { if (typeof ResizeObserver === \"undefined\") return; this.resizeObserver = new ResizeObserver((entries) => { for (const entry of entries) this.updateLayerHeight(entry.contentRect.height); }); if (this.wrapper) { this.resizeObserver.observe(this.wrapper); this.updateLayerHeight(this.wrapper.getBoundingClientRect().height); } } setupTargetResizeObserver() { if (typeof ResizeObserver === \"undefined\") return; if (this.targetResizeObserver) return; this.targetResizeObserver = new ResizeObserver(() => this.scheduleLayerHeightUpdate()); } scheduleLayerHeightUpdate() { if (this.heightRaf) return; this.heightRaf = requestAnimationFrame(() => { this.heightRaf = 0; this.syncLayerHeight(); }); } syncLayerHeight() { if (!this.isConnected) return; const minHeight = this.getLayerMinHeight(); const heightFloor = this.getLayerHeightFloor(minHeight); const targets = this.getAllTargets(); if (targets.length === 0) { const nextHeight = heightFloor; this.style.setProperty(\"--obc-poi-layer-height\", `${nextHeight}px`); this.updateLayerHeight(nextHeight); return; } const rects = /* @__PURE__ */ new Map(); targets.forEach((target) => rects.set(target, this.getTargetRect(target))); let maxHeight = 0; rects.forEach((rect) => { const height = rect?.height ?? 0; if (Number.isFinite(height)) maxHeight = Math.max(maxHeight, height); }); const nextHeight = Math.max(maxHeight, heightFloor); if (nextHeight <= 0) { this.style.setProperty(\"--obc-poi-layer-height\", \"0px\"); this.updateLayerHeight(0); return; } const roundedHeight = Math.round(nextHeight); this.style.setProperty(\"--obc-poi-layer-height\", `${roundedHeight}px`); this.updateLayerHeight(roundedHeight); } getLayerMinHeight() { const minHeightRaw = getComputedStyle(this).minHeight; const minHeight = Number.parseFloat(minHeightRaw); return Number.isFinite(minHeight) ? minHeight : 0; } getLayerHeightFloor(minHeight) { if (!this.hasAttribute(\"data-stack-inactive\")) return minHeight; return Math.max(minHeight, this.lastHeight); } updateLayerHeight(nextHeight) { const roundedHeight = Math.round(nextHeight); if (roundedHeight === this.lastHeight) return; this.lastHeight = roundedHeight; this.dispatchEvent(new CustomEvent(\"layer-resize\", { detail: { height: roundedHeight, label: this.label }, bubbles: true, composed: true })); } updateTargetObservers() { const targets = this.getAllTargets(); const targetSet = new Set(targets); this.targetObservers.forEach((observer, target) => { if (!targetSet.has(target)) { observer.disconnect(); this.targetObservers.delete(target); } }); targets.forEach((target) => { if (this.targetObservers.has(target)) return; const observer = new MutationObserver(() => { this.scheduleGrouping(); this.scheduleLayerHeightUpdate(); }); observer.observe(target, { attributes: true, attributeFilter: [ \"style\", \"y\", \"button-y\" ] }); this.targetObservers.set(target, observer); }); this.updateTargetSizeObservers(targets, targetSet); } updateTargetSizeObservers(targets, targetSet) { if (!this.targetResizeObserver) return; this.targetSizeElements.forEach((element, target) => { if (!targetSet.has(target) || !element.isConnected) { this.targetResizeObserver?.unobserve(element); this.targetSizeElements.delete(target); } }); targets.forEach((target) => { const sizeElement = this.getTargetSizeElement(target); if (!sizeElement) return; const existing = this.targetSizeElements.get(target); if (existing === sizeElement) return; if (existing) this.targetResizeObserver?.unobserve(existing); this.targetResizeObserver?.observe(sizeElement); this.targetSizeElements.set(target, sizeElement); }); } getTargetSizeElement(target) { return target.getVisualElement(PoiDataVisualRectPreference.Size); } isPoiLayerRelevantNode(node) { if (isPoi(node) || node.tagName.toLowerCase() === \"obc-poi-group\") return true; return !!node.querySelector(`[${POI_ATTR}], obc-poi-group`); } setupLayerMutationObserver() { this.layerMutationObserver?.disconnect(); this.layerMutationObserver = new MutationObserver((mutations) => { for (const mutation of mutations) { if (mutation.type !== \"childList\") continue; const nodes = [...mutation.addedNodes, ...mutation.removedNodes]; for (const node of nodes) { if (!(node instanceof HTMLElement)) continue; if (this.isPoiLayerRelevantNode(node)) { this.updateTargetObservers(); this.scheduleGrouping(); this.scheduleLayerHeightUpdate(); this.crossingTargetsDirty = true; return; } } } }); this.layerMutationObserver.observe(this, { childList: true, subtree: true }); } requestGroupingUpdate() { this.scheduleGrouping(); this.scheduleLayerHeightUpdate(); } scheduleGrouping() { if (this.overlapMode === \"crossing\") { this.scheduleCrossingMode(); return; } if (this.groupingRaf) return; this.groupingRaf = requestAnimationFrame(() => { this.groupingRaf = 0; this.updateGrouping(); }); } scheduleCrossingMode() { if (this.crossingModeRaf) return; this.crossingModeRaf = requestAnimationFrame(() => { try { this.crossingModeRaf = 0; const shouldContinue = this.updateCrossingMode(); if (this.overlapMode === \"crossing\" && this.isConnected && shouldContinue) this.scheduleCrossingMode(); } catch (error) { console.error(\"[poi-layer] Error in crossing mode:\", error); this.crossingModeRaf = 0; } }); } updateCrossingMode() { if (this.crossingTargetsDirty) { this.cachedCrossingTargets = this.getAllTargets(); this.crossingTargetsDirty = false; } const targets = this.cachedCrossingTargets; const buttonWidth = getTouchTargetSize(this); const minGap = getCssVarAsNumber(this, POI_CROSSING_MIN_GAP_VAR, buttonWidth + 4); const next = updateCrossingModeState({ targets, buttonWidth, minGap, previousPositions: this.previousPositions, lastOffsets: this.lastOffsets, crossingOrder: this.crossingOrder, crossingLastEffectiveX: this.crossingLastEffectiveX }); this.previousPositions = next.previousPositions; this.crossingOrder = next.crossingOrder; return next.shouldContinue; } toggleGroupLayerHook(group, hasTargets) { if (hasTargets) group.setAttribute(_ObcPoiLayer.GROUP_LAYER_HOOK_ATTR, \"\"); else group.removeAttribute(_ObcPoiLayer.GROUP_LAYER_HOOK_ATTR); } updateGrouping() { if (this.isGrouping) return; this.isGrouping = true; try { const manualGroups = Array.from(this.querySelectorAll(\"obc-poi-group\")).filter((group) => !group.hasAttribute(\"data-auto-group\")); const manualGroupedTargets = /* @__PURE__ */ new Set(); manualGroups.forEach((group) => { const groupTargets = this.getGroupTargets(group); this.toggleGroupLayerHook(group, groupTargets.length > 0); groupTargets.forEach((target) => manualGroupedTargets.add(target)); }); if (manualGroups.length > 0) { if (manualGroups.some((group) => group.expand === true || group.collapsing === true)) return; } const targets = this.getAllTargets().filter((target) => !manualGroupedTargets.has(target) && !target.hasAttribute(\"data-stack-returning\")); const layerRect = this.getBoundingClientRect(); const enterRaw = getComputedStyle(this).getPropertyValue(\"--obc-poi-layer-overlap-enter\"); const exitRaw = getComputedStyle(this).getPropertyValue(\"--obc-poi-layer-overlap-exit\"); const preRaw = getComputedStyle(this).getPropertyValue(\"--obc-poi-layer-overlap-pre\"); const behindRaw = getComputedStyle(this).getPropertyValue(\"--obc-poi-layer-overlap-behind\"); const enterThreshold = Number.parseFloat(enterRaw) || 0; const exitThreshold = Number.parseFloat(exitRaw) || Math.max(enterThreshold + 8, 8); const preThreshold = Number.parseFloat(preRaw) || enterThreshold; const behindThreshold = Number.parseFloat(behindRaw) || enterThreshold; const currentGroupByTarget = /* @__PURE__ */ new Map(); targets.forEach((target) => { const parent = target.parentElement; if (parent?.tagName.toLowerCase() === \"obc-poi-group\") currentGroupByTarget.set(target, parent); }); const rects = /* @__PURE__ */ new Map(); targets.forEach((target) => { rects.set(target, this.getTargetRectForGrouping(target, layerRect)); }); const { adjacency, behindAdjacency, preGrouped } = buildAdjacencyMaps(targets, rects, { enterThreshold, exitThreshold, preThreshold, behindThreshold }, currentGroupByTarget); const clusters = buildClusters(targets, adjacency); const behindClusters = buildClusters(targets, behindAdjacency); const existingGroups = Array.from(this.querySelectorAll(\"obc-poi-group[data-auto-group]\")); const frontTargets = /* @__PURE__ */ new Set(); clusters.forEach((cluster) => { const front = this.getFrontTarget(cluster, rects); if (front) frontTargets.add(front); }); const behindTargets = /* @__PURE__ */ new Set(); behindClusters.forEach((cluster) => { const behind = this.getShortestTarget(cluster, rects); if (behind) behindTargets.add(behind); }); const expandedAutoGroup = existingGroups.find((group) => group.expand === true || group.collapsing === true); if (expandedAutoGroup) { if (this.joinWhileExpanded) this.tryJoinExpandedGroup(expandedAutoGroup, targets, rects, enterThreshold); return; } const remainingClusters = [...clusters]; const keptGroups = []; existingGroups.forEach((group) => { const children = Array.from(group.children).filter((child) => isPoi(child)); const matchIndex = remainingClusters.findIndex((cluster) => cluster.length === children.length && cluster.every((target) => children.includes(target))); if (matchIndex >= 0) { keptGroups.push(group); group.removeAttribute(\"data-exiting\"); group.setAttribute(\"data-visible\", \"true\"); remainingClusters.splice(matchIndex, 1); } else { const front = this.getFrontTarget(children, rects); children.forEach((child) => { if (front && child === front) { child.setAttribute(\"data-front\", \"true\"); child.setAttribute(\"data-front-exit\", \"true\"); } else child.removeAttribute(\"data-front\"); }); children.forEach((child) => { if (!front || child !== front) { child.setAttribute(\"data-exiting\", \"true\"); this.startExitLock(child); } else { child.removeAttribute(\"data-exiting\"); child.removeAttribute(\"data-exit-lock\"); } child.removeAttribute(\"data-grouped\"); this.resetTarget(child); }); group.removeAttribute(\"data-visible\"); group.setAttribute(\"data-exiting\", \"true\"); children.forEach((child) => this.appendChild(child)); children.forEach((child) => { if (!front || child !== front) child.getBoundingClientRect(); }); const exitDelay = getCssVarAsNumber(this, EXIT_DELAY_MS_VAR, 140); window.setTimeout(() => { children.forEach((child) => { if (!front || child !== front) child.removeAttribute(\"data-exiting\"); }); }, exitDelay); requestAnimationFrame(() => { this.scheduleGroupRemoval(group); }); } }); remainingClusters.forEach((cluster) => { const group = document.createElement(\"obc-poi-group\"); group.setAttribute(\"data-auto-group\", \"true\"); group.setAttribute(\"data-position-mode\", \"bottom\"); group.setAttribute(\"data-visible\", \"true\"); group.internalSwapping = !!this.internalSwapping; group.setAttribute(\"positionVertical\", `${this.getGroupPositionVertical(cluster, rects, layerRect, group)}px`); cluster.forEach((target) => { target.removeAttribute(\"data-grouped\"); group.appendChild(target); }); this.appendChild(group); requestAnimationFrame(() => { cluster.forEach((target) => target.setAttribute(\"data-grouped\", \"true\")); }); keptGroups.push(group); }); const groupedTargets = /* @__PURE__ */ new Set(); keptGroups.forEach((group) => { Array.from(group.children).forEach((child) => { if (isPoi(child)) groupedTargets.add(child); }); }); targets.forEach((target) => { if (!groupedTargets.has(target)) { const exitLocked = target.hasAttribute(\"data-exit-lock\"); target.removeAttribute(\"data-grouped\"); target.removeAttribute(\"data-joined-expanded\"); if (target.hasAttribute(\"data-front-exit\")) { target.setAttribute(\"data-front\", \"true\"); target.removeAttribute(\"data-pregrouped\"); } else if (frontTargets.has(target)) { target.setAttribute(\"data-front\", \"true\"); target.removeAttribute(\"data-pregrouped\"); } else if (preGrouped.has(target) && !exitLocked) { target.removeAttribute(\"data-front\"); target.setAttribute(\"data-pregrouped\", \"true\"); } else { target.removeAttribute(\"data-front\"); target.removeAttribute(\"data-pregrouped\"); } if (!exitLocked && behindTargets.has(target) && !frontTargets.has(target)) target.setAttribute(\"data-behind\", \"true\"); else target.removeAttribute(\"data-behind\"); if (exitLocked) { target.removeAttribute(\"data-pregrouped\"); target.removeAttribute(\"data-behind\"); } const isOverlapState = target.hasAttribute(\"data-behind\"); const nextValue = this.resolveTargetValue(target, isOverlapState); target.value = nextValue; if (nextValue === ObcPoiValue.Overlapped) this.applyStandaloneVisualState(target, true); else this.clearStandaloneVisualState(target); this.resetTarget(target); } else { target.removeAttribute(\"data-behind\"); this.clearStandaloneVisualState(target); } }); this.refreshGroupPositions(layerRect, rects); requestAnimationFrame(() => { targets.forEach((target) => target.removeAttribute(\"data-front-exit\")); }); this.scheduleLayerHeightUpdate(); } finally { this.isGrouping = false; } } tryJoinExpandedGroup(group, targets, rects, enterThreshold) { const groupTargets = this.getGroupTargets(group); if (groupTargets.length === 0) return; const groupTargetSet = new Set(groupTargets); const candidates = targets.filter((target) => !groupTargetSet.has(target) && target.parentElement?.tagName.toLowerCase() !== \"obc-poi-group\"); if (candidates.length === 0) return; const useButtonRects = group.expand === true || group.collapsing === true; const groupCenters = groupTargets.map((target) => useButtonRects ? this.getTargetRect(target) : rects.get(target)).filter((rect) => !!rect).map((rect) => rect.left + rect.width / 2); if (groupCenters.length === 0) return; const groupCenter = (Math.min(...groupCenters) + Math.max(...groupCenters)) / 2; let bestCandidate = null; let bestGap = Number.POSITIVE_INFINITY; for (const candidate of candidates) { const candidateRect = useButtonRects ? this.getTargetRect(candidate) : rects.get(candidate); if (!candidateRect) continue; for (const member of groupTargets) { const memberRect = useButtonRects ? this.getTargetRect(member) : rects.get(member); if (!memberRect) continue; if (Math.min(candidateRect.bottom, memberRect.bottom) - Math.max(candidateRect.top, memberRect.top) <= 0) continue; const gap = Math.max(0, Math.max(candidateRect.left, memberRect.left) - Math.min(candidateRect.right, memberRect.right)); if (gap <= enterThreshold && gap < bestGap) { bestGap = gap; bestCandidate = candidate; } } } if (!bestCandidate) return; bestCandidate.setAttribute(\"data-joined-expanded\", \"true\"); const candidateRect = rects.get(bestCandidate); if ((candidateRect?.left !== void 0 ? candidateRect.left + candidateRect.width / 2 : 0) < groupCenter) group.insertBefore(bestCandidate, groupTargets[0] ?? null); else group.appendChild(bestCandidate); bestCandidate.setAttribute(\"data-grouped\", \"true\"); bestCandidate.removeAttribute(\"data-behind\"); bestCandidate.removeAttribute(\"data-pregrouped\"); bestCandidate.value = this.resolveTargetValue(bestCandidate, false); this.clearStandaloneVisualState(bestCandidate); const touchRaw = getComputedStyle(group).getPropertyValue(\"--maneuvering-components-poi-button-touch-target\"); const touchSize = Number.parseFloat(touchRaw) || 0; if (touchSize > 0) { const touchTarget = `${touchSize}px`; bestCandidate.style.width = touchTarget; bestCandidate.style.minWidth = touchTarget; bestCandidate.style.height = touchTarget; } group.refreshExpandedLayout?.(true); } applyStandaloneVisualState(target, overlap) { const isEnhanced = target.buttonType === ObcPoiButtonType.Enhanced; const size = getVisualTargetSize(this, isEnhanced, overlap); applyPoiVisualState(target, overlap, size); } resolveTargetValue(target, overlap) { if (overlap) return ObcPoiValue.Overlapped; if (target.selected) return ObcPoiValue.Checked; return ObcPoiValue.Unchecked; } clearStandaloneVisualState(target) { clearPoiVisualState(target); } refreshGroupPositions(layerRect, rects) { Array.from(this.querySelectorAll(\"obc-poi-group\")).forEach((group) => { const children = Array.from(group.children).filter((child) => isPoi(child)); this.toggleGroupLayerHook(group, children.length > 0); const hasPositionAttr = group.hasAttribute(\"positionvertical\") || group.hasAttribute(\"positionVertical\"); if (!group.hasAttribute(\"data-auto-group\") && !group.hasAttribute(\"data-position-mode\")) group.setAttribute(\"data-position-mode\", \"bottom\"); const shouldSetPosition = group.hasAttribute(\"data-auto-group\") || !hasPositionAttr; if (group.hasAttribute(\"data-auto-group\")) group.internalSwapping = !!this.internalSwapping; if (children.length > 0 && shouldSetPosition) { const layerBounds = layerRect ?? this.getBoundingClientRect(); const rectMap = rects ?? new Map(children.map((child) => [child, this.getTargetRectForGrouping(child, layerBounds)])); group.setAttribute(\"positionVertical\", `${this.getGroupPositionVertical(children, rectMap, layerBounds, group)}px`); } group.updatePosition?.(); }); } getGroupPositionVertical(targets, rects, layerRect, group) { let maxBottom = Number.NEGATIVE_INFINITY; targets.forEach((target) => { const rect = rects.get(target) ?? target.getBoundingClientRect(); maxBottom = Math.max(maxBottom, rect.bottom); }); const baseBottom = maxBottom - layerRect.top; const isAutoGroup = group?.hasAttribute(\"data-auto-group\") ?? false; const offsetRaw = getComputedStyle(this).getPropertyValue(\"--obc-poi-layer-auto-group-offset-y\"); let offset = Number.parseFloat(offsetRaw) || 0; if (isAutoGroup && this.closest(\"obc-poi-layer-stack\")) offset = 0; return Math.round(baseBottom + offset); } resetTarget(target) { if (typeof target.targetOffsetX === \"number\") { target.setRuntimeHorizontalOffsets?.(target.buttonOffsetX, 0); if (!target.setRuntimeHorizontalOffsets) target.targetOffsetX = 0; } this.animateButtonOffsetXToZero(target); target.style.removeProperty(\"--obc-poi-target-offset-x\"); target.style.removeProperty(\"position\"); target.style.removeProperty(\"width\"); target.style.removeProperty(\"min-width\"); target.style.removeProperty(\"height\"); target.style.removeProperty(\"transform\"); target.style.removeProperty(\"--obc-poi-group-overlap-height\"); target.style.removeProperty(\"--obc-poi-group-overlap-shift\"); } animateButtonOffsetXToZero(target) { const start = target.buttonOffsetX; if (!Number.isFinite(start) || Math.abs(start) < .5) { target.setRuntimeHorizontalOffsets?.(0, target.targetOffsetX); if (!target.setRuntimeHorizontalOffsets) target.buttonOffsetX = 0; return; } const existing = this.buttonOffsetXResetRaf.get(target); if (existing) cancelAnimationFrame(existing); const duration = 100; const startTime = performance.now(); const step = (now) => { try { if (!target.isConnected) { this.buttonOffsetXResetRaf.delete(target); return; } const t = Math.min((now - startTime) / duration, 1); const eased = easeInOutQuad(t); const nextButtonOffsetX = start + (0 - start) * eased; target.setRuntimeHorizontalOffsets?.(nextButtonOffsetX, target.targetOffsetX); if (!target.setRuntimeHorizontalOffsets) target.buttonOffsetX = nextButtonOffsetX; if (t < 1) this.buttonOffsetXResetRaf.set(target, requestAnimationFrame(step)); else this.buttonOffsetXResetRaf.delete(target); } catch (error) { console.error(\"[poi-layer] Error in button offset reset:\", error); this.buttonOffsetXResetRaf.delete(target); } }; this.buttonOffsetXResetRaf.set(target, requestAnimationFrame(step)); } scheduleGroupRemoval(group) { const existing = this.groupRemovalTimers.get(group); if (existing) window.clearTimeout(existing); group.setAttribute(\"data-exiting\", \"true\"); const removalDelay = getCssVarAsNumber(this, GROUP_REMOVAL_DELAY_MS_VAR, 250); const timeoutId = window.setTimeout(() => { group.remove(); this.groupRemovalTimers.delete(group); }, removalDelay); this.groupRemovalTimers.set(group, timeoutId); } startExitLock(target) { target.setAttribute(\"data-exit-lock\", \"true\"); const existing = this.exitLockTimers.get(target); if (existing) window.clearTimeout(existing); const lockDuration = getCssVarAsNumber(this, EXIT_LOCK_DURATION_MS_VAR, 500); const timeoutId = window.setTimeout(() => { target.removeAttribute(\"data-exit-lock\"); this.exitLockTimers.delete(target); }, lockDuration); this.exitLockTimers.set(target, timeoutId); } getFrontTarget(targets, rects) { if (targets.length === 0) return null; let front = targets[0]; let maxHeight = this.getTargetHeight(front, rects); targets.forEach((target) => { const height = this.getTargetHeight(target, rects); if (height > maxHeight) { maxHeight = height; front = target; } }); return front; } getTargetRect(target) { if (isPoi(target)) return target.getVisualRect(PoiDataVisualRectPreference.Largest); return target.getBoundingClientRect(); } getTargetRectForGrouping(target, layerRect) { const rect = this.getTargetRect(target); const leftValue = getEffectivePoiX(target); if (!Number.isFinite(leftValue)) return rect; const width = rect.width || 0; const height = rect.height || 0; const left = layerRect.left + leftValue - width / 2; const top = layerRect.bottom - height; return new DOMRect(left, top, width, height); } getTargetHeight(target, rects) { const targetY = Number.isFinite(target.y ?? NaN) ? target.y ?? 0 : null; const yAttr = target.getAttribute(\"y\"); const yValue = Number.parseFloat(yAttr ?? \"\"); const attrTargetY = !Number.isNaN(yValue) ? yValue : null; const buttonY = typeof target.buttonY === \"number\" && Number.isFinite(target.buttonY) ? target.buttonY : null; const buttonYAttr = target.getAttribute(\"button-y\"); const buttonYValue = Number.parseFloat(buttonYAttr ?? \"\"); const logicalHeight = Math.max(targetY ?? 0, attrTargetY ?? 0, buttonY ?? 0, (!Number.isNaN(buttonYValue) ? buttonYValue : null) ?? 0); if (logicalHeight > 0) return logicalHeight; return (rects?.get(target) ?? this.getTargetRect(target)).height; } getShortestTarget(targets, rects) { if (targets.length === 0) return null; let shortest = targets[0]; let minHeight = this.getTargetHeight(shortest, rects); targets.forEach((target) => { const height = this.getTargetHeight(target, rects); if (height < minHeight) { minHeight = height; shortest = target; } }); return shortest; } getAllTargets() { return Array.from(this.querySelectorAll(`[${POI_ATTR}]`)).filter((node) => isPoi(node) && !node.hasAttribute(\"data-stack-selected\")); } getGroupTargets(group) { return Array.from(group.querySelectorAll(`[${POI_ATTR}]`)).filter((node) => isPoi(node)); } updated(changedProperties) { if (changedProperties.has(\"isSelected\")) this.dispatchEvent(new Event(\"layer-selection-changed\", { bubbles: true })); } render() { return html` <div class=\"wrapper${this.debug ? \" debug\" : \"\"}\"> ${this.debug ? html`<span class=\"debug-label\">${this.label || \"Layer\"}</span>` : nothing} <slot></slot> </div> `; } static { this.styles = unsafeCSS(poi_layer_default); } }"
733
+ "default": "class ObcPoiLayer extends LitElement { static { _ObcPoiLayer = this; } constructor(..._args) { super(..._args); this.label = \"\"; this.debug = false; this.overlapMode = \"grouping\"; this.isSelected = false; this.joinWhileExpanded = false; this.internalSwapping = false; this.lastHeight = 0; this.isGrouping = false; this.lastGroupingSignature = \"\"; this.groupingIds = /* @__PURE__ */ new WeakMap(); this.nextGroupingId = 1; this.targetObservers = /* @__PURE__ */ new Map(); this.targetSizeElements = /* @__PURE__ */ new Map(); this.groupingRaf = 0; this.heightRaf = 0; this.groupRemovalTimers = /* @__PURE__ */ new WeakMap(); this.exitLockTimers = /* @__PURE__ */ new Map(); this.autoGroupCollapseTimeout = 0; this.crossingModeRaf = 0; this.cachedCrossingTargets = []; this.crossingTargetsDirty = false; this.crossingOrder = []; this.crossingLastEffectiveX = /* @__PURE__ */ new Map(); this.previousPositions = /* @__PURE__ */ new Map(); this.lastOffsets = /* @__PURE__ */ new Map(); this.handleSlotChange = () => { this.updateTargetObservers(); this.scheduleGrouping(); this.scheduleLayerHeightUpdate(); }; this.handleCollapseFinished = () => { this.scheduleGrouping(); }; this.handlePoiDataLayoutChange = () => { this.scheduleGrouping(); this.scheduleLayerHeightUpdate(); }; this.handleGroupExpand = (event) => { const group = event.target; if (!group?.tagName?.toLowerCase().includes(\"group\")) return; if (group.hasAttribute(\"data-exiting\")) return; const targets = this.getAllTargets(); const groupedTargets = new Set(this.getGroupTargets(group)); if (groupedTargets.size === 0) return; if (event.detail.expand) targets.forEach((target) => { if (!groupedTargets.has(target)) { const nextValue = this.resolveTargetValue(target, true); target.value = nextValue; if (nextValue === ObcPoiValue.Overlapped) this.applyStandaloneVisualState(target, true); else this.clearStandaloneVisualState(target); } }); }; this.buttonOffsetXResetRaf = /* @__PURE__ */ new Map(); } static { this.shadowRootOptions = { ...LitElement.shadowRootOptions, slotAssignment: \"manual\" }; } static { this.GROUP_LAYER_HOOK_ATTR = \"data-in-poi-layer\"; } connectedCallback() { super.connectedCallback(); if (!this.hasUpdated) return; this.setupResizeObserver(); this.setupTargetResizeObserver(); this.setupLayerMutationObserver(); this.updateTargetObservers(); this.scheduleGrouping(); this.scheduleLayerHeightUpdate(); this.addLayerEventListeners(); (this.shadowRoot?.querySelector(\"slot\"))?.addEventListener(\"slotchange\", this.handleSlotChange); } firstUpdated() { this.crossingTargetsDirty = true; this.setupResizeObserver(); this.setupTargetResizeObserver(); this.setupLayerMutationObserver(); this.updateTargetObservers(); this.scheduleGrouping(); this.scheduleLayerHeightUpdate(); (this.shadowRoot?.querySelector(\"slot\"))?.addEventListener(\"slotchange\", this.handleSlotChange); requestAnimationFrame(() => { this.updateTargetObservers(); this.scheduleLayerHeightUpdate(); }); this.addLayerEventListeners(); } disconnectedCallback() { super.disconnectedCallback(); this.removeLayerEventListeners(); (this.shadowRoot?.querySelector(\"slot\"))?.removeEventListener(\"slotchange\", this.handleSlotChange); this.resizeObserver?.disconnect(); this.targetResizeObserver?.disconnect(); this.layerMutationObserver?.disconnect(); this.targetObservers.forEach((observer) => observer.disconnect()); this.targetObservers.clear(); this.targetSizeElements.clear(); if (this.groupingRaf) { cancelAnimationFrame(this.groupingRaf); this.groupingRaf = 0; } if (this.crossingModeRaf) { cancelAnimationFrame(this.crossingModeRaf); this.crossingModeRaf = 0; } this.previousPositions.clear(); if (this.heightRaf) { cancelAnimationFrame(this.heightRaf); this.heightRaf = 0; } this.exitLockTimers.forEach((timerId) => window.clearTimeout(timerId)); this.exitLockTimers.clear(); if (this.autoGroupCollapseTimeout) { window.clearTimeout(this.autoGroupCollapseTimeout); this.autoGroupCollapseTimeout = 0; } this.buttonOffsetXResetRaf.forEach((rafId) => cancelAnimationFrame(rafId)); this.buttonOffsetXResetRaf.clear(); this.lastOffsets.clear(); this.crossingLastEffectiveX.clear(); } addLayerEventListeners() { this.addEventListener(\"obc-poi-data-layout-change\", this.handlePoiDataLayoutChange); this.addEventListener(\"expand\", this.handleGroupExpand); this.addEventListener(\"collapse-finished\", this.handleCollapseFinished); } removeLayerEventListeners() { this.removeEventListener(\"obc-poi-data-layout-change\", this.handlePoiDataLayoutChange); this.removeEventListener(\"expand\", this.handleGroupExpand); this.removeEventListener(\"collapse-finished\", this.handleCollapseFinished); } setupResizeObserver() { if (typeof ResizeObserver === \"undefined\") return; this.resizeObserver = new ResizeObserver((entries) => { for (const entry of entries) this.updateLayerHeight(entry.contentRect.height); }); if (this.wrapper) { this.resizeObserver.observe(this.wrapper); this.updateLayerHeight(this.wrapper.getBoundingClientRect().height); } } setupTargetResizeObserver() { if (typeof ResizeObserver === \"undefined\") return; if (this.targetResizeObserver) return; this.targetResizeObserver = new ResizeObserver(() => this.scheduleLayerHeightUpdate()); } scheduleLayerHeightUpdate() { if (this.heightRaf) return; this.heightRaf = requestAnimationFrame(() => { this.heightRaf = 0; this.syncLayerHeight(); }); } syncLayerHeight() { if (!this.isConnected) return; const minHeight = this.getLayerMinHeight(); const heightFloor = this.getLayerHeightFloor(minHeight); const targets = this.getAllTargets(); if (targets.length === 0) { const nextHeight = heightFloor; this.style.setProperty(\"--obc-poi-layer-height\", `${nextHeight}px`); this.updateLayerHeight(nextHeight); return; } const rects = /* @__PURE__ */ new Map(); targets.forEach((target) => rects.set(target, this.getTargetRect(target))); let maxHeight = 0; rects.forEach((rect) => { const height = rect?.height ?? 0; if (Number.isFinite(height)) maxHeight = Math.max(maxHeight, height); }); const nextHeight = Math.max(maxHeight, heightFloor); if (nextHeight <= 0) { this.style.setProperty(\"--obc-poi-layer-height\", \"0px\"); this.updateLayerHeight(0); return; } const roundedHeight = Math.round(nextHeight); this.style.setProperty(\"--obc-poi-layer-height\", `${roundedHeight}px`); this.updateLayerHeight(roundedHeight); } getLayerMinHeight() { const minHeightRaw = getComputedStyle(this).minHeight; const minHeight = Number.parseFloat(minHeightRaw); return Number.isFinite(minHeight) ? minHeight : 0; } getLayerHeightFloor(minHeight) { if (!this.hasAttribute(\"data-stack-inactive\")) return minHeight; return Math.max(minHeight, this.lastHeight); } updateLayerHeight(nextHeight) { const roundedHeight = Math.round(nextHeight); if (roundedHeight === this.lastHeight) return; this.lastHeight = roundedHeight; this.dispatchEvent(new CustomEvent(\"layer-resize\", { detail: { height: roundedHeight, label: this.label }, bubbles: true, composed: true })); } updateTargetObservers() { const targets = this.getAllTargets(); const targetSet = new Set(targets); this.targetObservers.forEach((observer, target) => { if (!targetSet.has(target)) { observer.disconnect(); this.targetObservers.delete(target); } }); targets.forEach((target) => { if (this.targetObservers.has(target)) return; const observer = new MutationObserver(() => { this.scheduleGrouping(); this.scheduleLayerHeightUpdate(); }); observer.observe(target, { attributes: true, attributeFilter: [ \"style\", \"y\", \"button-y\" ] }); this.targetObservers.set(target, observer); }); this.updateTargetSizeObservers(targets, targetSet); } updateTargetSizeObservers(targets, targetSet) { if (!this.targetResizeObserver) return; this.targetSizeElements.forEach((element, target) => { if (!targetSet.has(target) || !element.isConnected) { this.targetResizeObserver?.unobserve(element); this.targetSizeElements.delete(target); } }); targets.forEach((target) => { const sizeElement = this.getTargetSizeElement(target); if (!sizeElement) return; const existing = this.targetSizeElements.get(target); if (existing === sizeElement) return; if (existing) this.targetResizeObserver?.unobserve(existing); this.targetResizeObserver?.observe(sizeElement); this.targetSizeElements.set(target, sizeElement); }); } getTargetSizeElement(target) { return target.getVisualElement(PoiDataVisualRectPreference.Size); } isPoiLayerRelevantNode(node) { if (isPoi(node) || node.tagName.toLowerCase() === \"obc-poi-group\") return true; return !!node.querySelector(`[${POI_ATTR}], obc-poi-group`); } setupLayerMutationObserver() { this.layerMutationObserver?.disconnect(); this.layerMutationObserver = new MutationObserver((mutations) => { let childListChanged = false; let relevant = false; for (const mutation of mutations) { if (mutation.type !== \"childList\") continue; childListChanged = true; const nodes = [...mutation.addedNodes, ...mutation.removedNodes]; for (const node of nodes) if (node instanceof HTMLElement && this.isPoiLayerRelevantNode(node)) { relevant = true; break; } if (relevant) break; } if (childListChanged) this.syncSlotAssignments(); if (relevant) { this.updateTargetObservers(); this.scheduleGrouping(); this.scheduleLayerHeightUpdate(); this.crossingTargetsDirty = true; } }); this.layerMutationObserver.observe(this, { childList: true, subtree: true }); } requestGroupingUpdate() { this.scheduleGrouping(); this.scheduleLayerHeightUpdate(); } getMainSlot() { return this.shadowRoot?.querySelector(\"slot.main\") ?? null; } /** * Assign every light-DOM child that is not currently placed in an * auto-group member slot to the main slot. With `slotAssignment: 'manual'` * nothing renders unless explicitly assigned, so this runs after render, * on child-list mutations, and after every grouping change. */ syncSlotAssignments() { const mainSlot = this.getMainSlot(); if (!mainSlot) return; const groupAssigned = /* @__PURE__ */ new Set(); this.getAutoGroups().forEach((group) => { this.getAutoGroupMemberSlot(group)?.assignedNodes().forEach((node) => groupAssigned.add(node)); }); const mainNodes = Array.from(this.childNodes).filter((node) => !groupAssigned.has(node) && (node instanceof Element || node instanceof Text)); mainSlot.assign(...mainNodes); } /** * Called by an auto-created `obc-poi-group` after it removed a target from * its member slot, so the target immediately re-renders through the main * slot instead of disappearing until the next grouping pass. * @internal */ releaseAssignedTarget(_target) { this.syncSlotAssignments(); this.requestGroupingUpdate(); } /** * The auto-created `obc-poi-group` elements currently managed by this * layer. Auto groups are shadow-internal chrome (they never appear in the * consumer's light DOM); use this accessor — typically after a * `grouping-change` event — to reach them, e.g. to expand a group * programmatically. */ get autoGroups() { return this.getAutoGroups(); } getAutoGroups() { return Array.from(this.shadowRoot?.querySelectorAll(\"obc-poi-group[data-auto-group]\") ?? []); } getAutoGroupMemberSlot(group) { return group.querySelector(\":scope > slot.auto-group-members\"); } /** The auto group a target is currently assigned into, if any. */ getAutoGroupOf(target) { const slot = target.assignedSlot; if (slot?.classList.contains(\"auto-group-members\")) return slot.parentElement; return null; } /** * Members of a group in either mode: slot-assigned (shadow auto groups) or * light-DOM children (consumer-managed manual groups). */ getGroupMembers(group) { if (group instanceof HTMLElement) { const slot = this.getAutoGroupMemberSlot(group); if (slot) return slot.assignedElements().filter((el) => isPoi(el)); } return Array.from(group.querySelectorAll(`[${POI_ATTR}]`)).filter((node) => isPoi(node)); } scheduleGrouping() { if (this.overlapMode === \"crossing\") { this.scheduleCrossingMode(); return; } if (this.groupingRaf) return; this.groupingRaf = requestAnimationFrame(() => { this.groupingRaf = 0; this.updateGrouping(); }); } scheduleCrossingMode() { if (this.crossingModeRaf) return; this.crossingModeRaf = requestAnimationFrame(() => { try { this.crossingModeRaf = 0; const shouldContinue = this.updateCrossingMode(); if (this.overlapMode === \"crossing\" && this.isConnected && shouldContinue) this.scheduleCrossingMode(); } catch (error) { console.error(\"[poi-layer] Error in crossing mode:\", error); this.crossingModeRaf = 0; } }); } updateCrossingMode() { if (this.crossingTargetsDirty) { this.cachedCrossingTargets = this.getAllTargets(); this.crossingTargetsDirty = false; } const targets = this.cachedCrossingTargets; const buttonWidth = getTouchTargetSize(this); const minGap = getCssVarAsNumber(this, POI_CROSSING_MIN_GAP_VAR, buttonWidth + 4); const next = updateCrossingModeState({ targets, buttonWidth, minGap, previousPositions: this.previousPositions, lastOffsets: this.lastOffsets, crossingOrder: this.crossingOrder, crossingLastEffectiveX: this.crossingLastEffectiveX }); this.previousPositions = next.previousPositions; this.crossingOrder = next.crossingOrder; return next.shouldContinue; } getGroupingId(target) { let id = this.groupingIds.get(target); if (id === void 0) { id = this.nextGroupingId++; this.groupingIds.set(target, id); } return id; } notifyGroupingChange(clusters, frontTargets, behindTargets, preGrouped) { const idsOf = (targets) => Array.from(targets, (target) => this.getGroupingId(target)).sort((a, b) => a - b); const signature = JSON.stringify({ clusters: clusters.map((cluster) => idsOf(cluster)).sort(), front: idsOf(frontTargets), behind: idsOf(behindTargets), pre: idsOf(preGrouped) }); if (signature === this.lastGroupingSignature) return; this.lastGroupingSignature = signature; this.dispatchEvent(new CustomEvent(\"grouping-change\", { detail: { clusters: clusters.map((cluster) => [...cluster]), front: [...frontTargets], behind: [...behindTargets], pregrouped: [...preGrouped] }, bubbles: true, composed: true })); } toggleGroupLayerHook(group, hasTargets) { if (hasTargets) group.setAttribute(_ObcPoiLayer.GROUP_LAYER_HOOK_ATTR, \"\"); else group.removeAttribute(_ObcPoiLayer.GROUP_LAYER_HOOK_ATTR); } updateGrouping() { if (this.isGrouping) return; this.isGrouping = true; try { const manualGroups = Array.from(this.querySelectorAll(\"obc-poi-group\")).filter((group) => !group.hasAttribute(\"data-auto-group\")); const manualGroupedTargets = /* @__PURE__ */ new Set(); manualGroups.forEach((group) => { const groupTargets = this.getGroupTargets(group); this.toggleGroupLayerHook(group, groupTargets.length > 0); groupTargets.forEach((target) => manualGroupedTargets.add(target)); }); if (manualGroups.length > 0) { if (manualGroups.some((group) => group.expand === true || group.collapsing === true)) return; } const targets = this.getAllTargets().filter((target) => !manualGroupedTargets.has(target) && !target.hasAttribute(\"data-stack-returning\")); const layerRect = this.getBoundingClientRect(); const enterRaw = getComputedStyle(this).getPropertyValue(\"--obc-poi-layer-overlap-enter\"); const exitRaw = getComputedStyle(this).getPropertyValue(\"--obc-poi-layer-overlap-exit\"); const preRaw = getComputedStyle(this).getPropertyValue(\"--obc-poi-layer-overlap-pre\"); const behindRaw = getComputedStyle(this).getPropertyValue(\"--obc-poi-layer-overlap-behind\"); const parseThreshold = (raw, fallback) => { const value = Number.parseFloat(raw); return Number.isFinite(value) ? value : fallback; }; const enterThreshold = parseThreshold(enterRaw, 10); const exitThreshold = Math.max(parseThreshold(exitRaw, enterThreshold + 8), enterThreshold); const preThreshold = parseThreshold(preRaw, Math.max(enterThreshold, 16)); const behindThreshold = parseThreshold(behindRaw, enterThreshold); const currentGroupByTarget = /* @__PURE__ */ new Map(); targets.forEach((target) => { const group = this.getAutoGroupOf(target); if (group) currentGroupByTarget.set(target, group); }); const rects = /* @__PURE__ */ new Map(); targets.forEach((target) => { rects.set(target, this.getTargetRectForGrouping(target, layerRect)); }); const { adjacency, behindAdjacency, preGrouped } = buildAdjacencyMaps(targets, rects, { enterThreshold, exitThreshold, preThreshold, behindThreshold }, currentGroupByTarget); const clusters = buildClusters(targets, adjacency); const behindClusters = buildClusters(targets, behindAdjacency); const existingGroups = this.getAutoGroups().filter((group) => !group.hasAttribute(\"data-exiting\")); const frontTargets = /* @__PURE__ */ new Set(); clusters.forEach((cluster) => { const front = this.getFrontTarget(cluster, rects); if (front) frontTargets.add(front); }); const behindTargets = /* @__PURE__ */ new Set(); behindClusters.forEach((cluster) => { const behind = this.getShortestTarget(cluster, rects); if (behind) behindTargets.add(behind); }); const expandedAutoGroup = existingGroups.find((group) => group.expand === true || group.collapsing === true); if (expandedAutoGroup) { const joined = this.joinWhileExpanded ? this.tryJoinExpandedGroup(expandedAutoGroup, targets, rects, enterThreshold) : null; if (joined) { const liveClusters = existingGroups.map((group) => this.getGroupMembers(group)); const liveFront = /* @__PURE__ */ new Set(); liveClusters.forEach((cluster) => { const front = this.getFrontTarget(cluster, rects); if (front) liveFront.add(front); }); behindTargets.delete(joined); preGrouped.delete(joined); this.notifyGroupingChange(liveClusters, liveFront, behindTargets, preGrouped); } return; } const remainingClusters = [...clusters]; const keptGroups = []; existingGroups.forEach((group) => { const children = this.getGroupMembers(group); const matchIndex = remainingClusters.findIndex((cluster) => cluster.length === children.length && cluster.every((target) => children.includes(target))); if (matchIndex >= 0) { keptGroups.push(group); group.removeAttribute(\"data-exiting\"); group.setAttribute(\"data-visible\", \"true\"); remainingClusters.splice(matchIndex, 1); } else { const front = this.getFrontTarget(children, rects); children.forEach((child) => { if (front && child === front) { child.setAttribute(\"data-front\", \"true\"); child.setAttribute(\"data-front-exit\", \"true\"); } else child.removeAttribute(\"data-front\"); }); children.forEach((child) => { if (!front || child !== front) { child.setAttribute(\"data-exiting\", \"true\"); this.startExitLock(child); } else { child.removeAttribute(\"data-exiting\"); child.removeAttribute(\"data-exit-lock\"); } child.removeAttribute(\"data-grouped\"); this.resetTarget(child); }); group.removeAttribute(\"data-visible\"); group.setAttribute(\"data-exiting\", \"true\"); this.getAutoGroupMemberSlot(group)?.assign(); this.syncSlotAssignments(); children.forEach((child) => { if (!front || child !== front) child.getBoundingClientRect(); }); const exitDelay = getCssVarAsNumber(this, EXIT_DELAY_MS_VAR, 140); window.setTimeout(() => { children.forEach((child) => { if (!front || child !== front) child.removeAttribute(\"data-exiting\"); }); }, exitDelay); requestAnimationFrame(() => { this.scheduleGroupRemoval(group); }); } }); remainingClusters.forEach((cluster) => { const group = document.createElement(\"obc-poi-group\"); group.setAttribute(\"data-auto-group\", \"true\"); group.setAttribute(\"data-position-mode\", \"bottom\"); group.setAttribute(\"data-visible\", \"true\"); group.internalSwapping = !!this.internalSwapping; group.setAttribute(\"position-vertical\", `${this.getGroupPositionVertical(cluster, rects, layerRect, group)}px`); const memberSlot = document.createElement(\"slot\"); memberSlot.className = \"auto-group-members\"; group.appendChild(memberSlot); cluster.forEach((target) => { target.removeAttribute(\"data-grouped\"); }); this.wrapper?.appendChild(group); memberSlot.assign(...cluster); this.syncSlotAssignments(); requestAnimationFrame(() => { cluster.forEach((target) => target.setAttribute(\"data-grouped\", \"true\")); }); keptGroups.push(group); }); const groupedTargets = /* @__PURE__ */ new Set(); keptGroups.forEach((group) => { this.getGroupMembers(group).forEach((child) => { groupedTargets.add(child); }); }); targets.forEach((target) => { if (!groupedTargets.has(target)) { const exitLocked = target.hasAttribute(\"data-exit-lock\"); target.removeAttribute(\"data-grouped\"); target.removeAttribute(\"data-joined-expanded\"); if (target.hasAttribute(\"data-front-exit\")) { target.setAttribute(\"data-front\", \"true\"); target.removeAttribute(\"data-pregrouped\"); } else if (frontTargets.has(target)) { target.setAttribute(\"data-front\", \"true\"); target.removeAttribute(\"data-pregrouped\"); } else if (preGrouped.has(target) && !exitLocked) { target.removeAttribute(\"data-front\"); target.setAttribute(\"data-pregrouped\", \"true\"); } else { target.removeAttribute(\"data-front\"); target.removeAttribute(\"data-pregrouped\"); } if (!exitLocked && behindTargets.has(target) && !frontTargets.has(target)) target.setAttribute(\"data-behind\", \"true\"); else target.removeAttribute(\"data-behind\"); if (exitLocked) { target.removeAttribute(\"data-pregrouped\"); target.removeAttribute(\"data-behind\"); } const isOverlapState = target.hasAttribute(\"data-behind\"); const nextValue = this.resolveTargetValue(target, isOverlapState); target.value = nextValue; if (nextValue === ObcPoiValue.Overlapped) this.applyStandaloneVisualState(target, true); else this.clearStandaloneVisualState(target); this.resetTarget(target); } else { target.removeAttribute(\"data-behind\"); this.clearStandaloneVisualState(target); } }); this.refreshGroupPositions(layerRect, rects); this.notifyGroupingChange(clusters, frontTargets, behindTargets, preGrouped); requestAnimationFrame(() => { targets.forEach((target) => target.removeAttribute(\"data-front-exit\")); }); this.scheduleLayerHeightUpdate(); } finally { this.isGrouping = false; } } tryJoinExpandedGroup(group, targets, rects, enterThreshold) { const groupTargets = this.getGroupTargets(group); if (groupTargets.length === 0) return null; const groupTargetSet = new Set(groupTargets); const candidates = targets.filter((target) => !groupTargetSet.has(target) && target.parentElement?.tagName.toLowerCase() !== \"obc-poi-group\" && this.getAutoGroupOf(target) === null); if (candidates.length === 0) return null; const useButtonRects = group.expand === true || group.collapsing === true; const groupCenters = groupTargets.map((target) => useButtonRects ? this.getTargetRect(target) : rects.get(target)).filter((rect) => !!rect).map((rect) => rect.left + rect.width / 2); if (groupCenters.length === 0) return null; const groupCenter = (Math.min(...groupCenters) + Math.max(...groupCenters)) / 2; let bestCandidate = null; let bestGap = Number.POSITIVE_INFINITY; for (const candidate of candidates) { const candidateRect = useButtonRects ? this.getTargetRect(candidate) : rects.get(candidate); if (!candidateRect) continue; for (const member of groupTargets) { const memberRect = useButtonRects ? this.getTargetRect(member) : rects.get(member); if (!memberRect) continue; if (Math.min(candidateRect.bottom, memberRect.bottom) - Math.max(candidateRect.top, memberRect.top) <= 0) continue; const gap = Math.max(0, Math.max(candidateRect.left, memberRect.left) - Math.min(candidateRect.right, memberRect.right)); if (gap <= enterThreshold && gap < bestGap) { bestGap = gap; bestCandidate = candidate; } } } if (!bestCandidate) return null; bestCandidate.setAttribute(\"data-joined-expanded\", \"true\"); const candidateRect = rects.get(bestCandidate); const insertBefore = (candidateRect?.left !== void 0 ? candidateRect.left + candidateRect.width / 2 : 0) < groupCenter; const memberSlot = group instanceof HTMLElement ? this.getAutoGroupMemberSlot(group) : null; if (memberSlot) { const members = memberSlot.assignedElements().filter((el) => el !== bestCandidate); memberSlot.assign(...insertBefore ? [bestCandidate, ...members] : [...members, bestCandidate]); this.syncSlotAssignments(); } else if (insertBefore) group.insertBefore(bestCandidate, groupTargets[0] ?? null); else group.appendChild(bestCandidate); bestCandidate.setAttribute(\"data-grouped\", \"true\"); bestCandidate.removeAttribute(\"data-behind\"); bestCandidate.removeAttribute(\"data-pregrouped\"); bestCandidate.value = this.resolveTargetValue(bestCandidate, false); this.clearStandaloneVisualState(bestCandidate); const touchRaw = getComputedStyle(group).getPropertyValue(\"--maneuvering-components-poi-button-touch-target\"); const touchSize = Number.parseFloat(touchRaw) || 0; if (touchSize > 0) { const touchTarget = `${touchSize}px`; bestCandidate.style.width = touchTarget; bestCandidate.style.minWidth = touchTarget; bestCandidate.style.height = touchTarget; } group.refreshExpandedLayout?.(true); return bestCandidate; } applyStandaloneVisualState(target, overlap) { const isEnhanced = target.buttonType === ObcPoiButtonType.Enhanced; const size = getVisualTargetSize(this, isEnhanced, overlap); applyPoiVisualState(target, overlap, size); } resolveTargetValue(target, overlap) { if (overlap) return ObcPoiValue.Overlapped; if (target.selected) return ObcPoiValue.Checked; return ObcPoiValue.Unchecked; } clearStandaloneVisualState(target) { clearPoiVisualState(target); } refreshGroupPositions(layerRect, rects) { [...Array.from(this.querySelectorAll(\"obc-poi-group\")), ...this.getAutoGroups()].forEach((group) => { const children = this.getGroupMembers(group); this.toggleGroupLayerHook(group, children.length > 0); const hasPositionAttr = group.hasAttribute(\"position-vertical\"); if (!group.hasAttribute(\"data-auto-group\") && !group.hasAttribute(\"data-position-mode\")) group.setAttribute(\"data-position-mode\", \"bottom\"); const shouldSetPosition = group.hasAttribute(\"data-auto-group\") || !hasPositionAttr; if (group.hasAttribute(\"data-auto-group\")) group.internalSwapping = !!this.internalSwapping; if (children.length > 0 && shouldSetPosition) { const layerBounds = layerRect ?? this.getBoundingClientRect(); const rectMap = rects ?? new Map(children.map((child) => [child, this.getTargetRectForGrouping(child, layerBounds)])); group.setAttribute(\"position-vertical\", `${this.getGroupPositionVertical(children, rectMap, layerBounds, group)}px`); } group.updatePosition?.(); }); } getGroupPositionVertical(targets, rects, layerRect, group) { let maxBottom = Number.NEGATIVE_INFINITY; targets.forEach((target) => { const rect = rects.get(target) ?? target.getBoundingClientRect(); maxBottom = Math.max(maxBottom, rect.bottom); }); const baseBottom = maxBottom - layerRect.top; const isAutoGroup = group?.hasAttribute(\"data-auto-group\") ?? false; const offsetRaw = getComputedStyle(this).getPropertyValue(\"--obc-poi-layer-auto-group-offset-y\"); let offset = Number.parseFloat(offsetRaw) || 0; if (isAutoGroup && this.closest(\"obc-poi-layer-stack\")) offset = 0; return Math.round(baseBottom + offset); } resetTarget(target) { if (typeof target.targetOffsetX === \"number\") { target.setRuntimeHorizontalOffsets?.(target.buttonOffsetX, 0); if (!target.setRuntimeHorizontalOffsets) target.targetOffsetX = 0; } this.animateButtonOffsetXToZero(target); target.style.removeProperty(\"--obc-poi-target-offset-x\"); target.style.removeProperty(\"position\"); target.style.removeProperty(\"width\"); target.style.removeProperty(\"min-width\"); target.style.removeProperty(\"height\"); target.style.removeProperty(\"transform\"); target.style.removeProperty(\"--obc-poi-group-overlap-height\"); target.style.removeProperty(\"--obc-poi-group-overlap-shift\"); } animateButtonOffsetXToZero(target) { const start = target.buttonOffsetX; if (!Number.isFinite(start) || Math.abs(start) < .5) { target.setRuntimeHorizontalOffsets?.(0, target.targetOffsetX); if (!target.setRuntimeHorizontalOffsets) target.buttonOffsetX = 0; return; } const existing = this.buttonOffsetXResetRaf.get(target); if (existing) cancelAnimationFrame(existing); const duration = 100; const startTime = performance.now(); const step = (now) => { try { if (!target.isConnected) { this.buttonOffsetXResetRaf.delete(target); return; } const t = Math.min((now - startTime) / duration, 1); const eased = easeInOutQuad(t); const nextButtonOffsetX = start + (0 - start) * eased; target.setRuntimeHorizontalOffsets?.(nextButtonOffsetX, target.targetOffsetX); if (!target.setRuntimeHorizontalOffsets) target.buttonOffsetX = nextButtonOffsetX; if (t < 1) this.buttonOffsetXResetRaf.set(target, requestAnimationFrame(step)); else this.buttonOffsetXResetRaf.delete(target); } catch (error) { console.error(\"[poi-layer] Error in button offset reset:\", error); this.buttonOffsetXResetRaf.delete(target); } }; this.buttonOffsetXResetRaf.set(target, requestAnimationFrame(step)); } scheduleGroupRemoval(group) { const existing = this.groupRemovalTimers.get(group); if (existing) window.clearTimeout(existing); group.setAttribute(\"data-exiting\", \"true\"); const removalDelay = getCssVarAsNumber(this, GROUP_REMOVAL_DELAY_MS_VAR, 250); const timeoutId = window.setTimeout(() => { group.remove(); this.groupRemovalTimers.delete(group); }, removalDelay); this.groupRemovalTimers.set(group, timeoutId); } startExitLock(target) { target.setAttribute(\"data-exit-lock\", \"true\"); const existing = this.exitLockTimers.get(target); if (existing) window.clearTimeout(existing); const lockDuration = getCssVarAsNumber(this, EXIT_LOCK_DURATION_MS_VAR, 500); const timeoutId = window.setTimeout(() => { target.removeAttribute(\"data-exit-lock\"); this.exitLockTimers.delete(target); }, lockDuration); this.exitLockTimers.set(target, timeoutId); } getFrontTarget(targets, rects) { if (targets.length === 0) return null; let front = targets[0]; let maxHeight = this.getTargetHeight(front, rects); targets.forEach((target) => { const height = this.getTargetHeight(target, rects); if (height > maxHeight) { maxHeight = height; front = target; } }); return front; } getTargetRect(target) { if (isPoi(target)) return target.getVisualRect(PoiDataVisualRectPreference.Largest); return target.getBoundingClientRect(); } getTargetRectForGrouping(target, layerRect) { const rect = this.getTargetRect(target); const leftValue = getEffectivePoiX(target); if (!Number.isFinite(leftValue)) return rect; const width = rect.width || 0; const height = rect.height || 0; const left = layerRect.left + leftValue - width / 2; const top = layerRect.bottom - height; return new DOMRect(left, top, width, height); } getTargetHeight(target, rects) { const targetY = Number.isFinite(target.y ?? NaN) ? target.y ?? 0 : null; const yAttr = target.getAttribute(\"y\"); const yValue = Number.parseFloat(yAttr ?? \"\"); const attrTargetY = !Number.isNaN(yValue) ? yValue : null; const buttonY = typeof target.buttonY === \"number\" && Number.isFinite(target.buttonY) ? target.buttonY : null; const buttonYAttr = target.getAttribute(\"button-y\"); const buttonYValue = Number.parseFloat(buttonYAttr ?? \"\"); const logicalHeight = Math.max(targetY ?? 0, attrTargetY ?? 0, buttonY ?? 0, (!Number.isNaN(buttonYValue) ? buttonYValue : null) ?? 0); if (logicalHeight > 0) return logicalHeight; return (rects?.get(target) ?? this.getTargetRect(target)).height; } getShortestTarget(targets, rects) { if (targets.length === 0) return null; let shortest = targets[0]; let minHeight = this.getTargetHeight(shortest, rects); targets.forEach((target) => { const height = this.getTargetHeight(target, rects); if (height < minHeight) { minHeight = height; shortest = target; } }); return shortest; } getAllTargets() { return Array.from(this.querySelectorAll(`[${POI_ATTR}]`)).filter((node) => isPoi(node) && !node.hasAttribute(\"data-stack-selected\")); } getGroupTargets(group) { return this.getGroupMembers(group); } render() { return html` <div class=\"wrapper${this.debug ? \" debug\" : \"\"}\"> ${this.debug ? html`<span class=\"debug-label\">${this.label || \"Layer\"}</span>` : nothing} <slot class=\"main\"></slot> </div> `; } updated(changedProperties) { if (changedProperties.has(\"isSelected\")) this.dispatchEvent(new Event(\"layer-selection-changed\", { bubbles: true })); this.syncSlotAssignments(); } static { this.styles = unsafeCSS(poi_layer_default); } }"
710
734
  }
711
735
  ],
712
736
  "exports": [
@@ -951,7 +975,7 @@
951
975
  {
952
976
  "kind": "variable",
953
977
  "name": "ObcPoiAton",
954
- "default": "class ObcPoiAton extends PoiBase { constructor(..._args) { super(..._args); this.atonType = ObcPoiObjectAtonType.AtoN; this.atonStyle = ObcPoiObjectAtonStyle.Regular; this.atonState = null; this.atonInteractive = false; } getVisualNodes() { return this.queryVisualNodes(\"obc-poi\", \"obc-poi-button-aton\"); } renderButtonSlot() { return html` <obc-poi-button-aton slot=\"button\" .relativeDirection=${this.relativeDirection} .selected=${this.selected} .hasHeader=${this.hasHeader} .headerContent=${this.headerContent} .state=${this.resolvedPoiState} .value=${this.value} .overlapOpaque=${this.overlapOpaque} .type=${this.buttonType} .data=${this.data} .atonType=${this.atonType} .atonStyle=${this.atonStyle} .atonState=${this.atonState} .atonInteractive=${this.atonInteractive} > <slot><obi-beacon-general-east></obi-beacon-general-east></slot> </obc-poi-button-aton> `; } static { this.styles = PoiBase.styles; } }"
978
+ "default": "class ObcPoiAton extends PoiBase { constructor(..._args) { super(..._args); this.atonType = ObcPoiObjectAtonType.AtoN; this.atonStyle = ObcPoiObjectAtonStyle.Regular; this.atonState = null; this.atonInteractive = false; } getVisualNodes() { return this.queryVisualNodes(\"obc-poi\", \"obc-poi-button-aton\"); } renderButtonSlot() { return html` <obc-poi-button-aton slot=\"button\" .relativeDirection=${this.relativeDirection} .selected=${this.selected} .hasHeader=${this.hasHeader} .headerContent=${this.headerContent} .state=${this.resolvedPoiState} .value=${this.value} .overlapOpaque=${this.overlapOpaque} .type=${this.buttonType} .data=${this.data} .atonType=${this.atonType} .atonStyle=${this.atonStyle} .atonState=${this.atonState} .atonInteractive=${this.atonInteractive} > <slot><obi-beacon-general-east></obi-beacon-general-east></slot> <slot name=\"header\" slot=\"header\"></slot> </obc-poi-button-aton> `; } static { this.styles = PoiBase.styles; } }"
955
979
  }
956
980
  ],
957
981
  "exports": [
@@ -996,7 +1020,7 @@
996
1020
  {
997
1021
  "kind": "variable",
998
1022
  "name": "ObcPoiData",
999
- "default": "class ObcPoiData extends PoiBase { constructor(..._args) { super(..._args); this.dataStyle = ObcPoiObjectStyle.Regular; this.dataState = null; this.dataInteractive = false; } getVisualNodes() { return this.queryVisualNodes(\"obc-poi\", \"obc-poi-button-data\"); } renderButtonSlot() { return html` <obc-poi-button-data slot=\"button\" .relativeDirection=${this.relativeDirection} .selected=${this.selected} .hasHeader=${this.hasHeader} .headerContent=${this.headerContent} .state=${this.resolvedPoiState} .value=${this.value} .overlapOpaque=${this.overlapOpaque} .type=${this.buttonType} .data=${this.data} .dataStyle=${this.dataStyle} .dataState=${this.dataState} .dataInteractive=${this.dataInteractive} > <slot ><obi-vessel-generic-default-filled></obi-vessel-generic-default-filled ></slot> </obc-poi-button-data> `; } static { this.styles = PoiBase.styles; } }"
1023
+ "default": "class ObcPoiData extends PoiBase { constructor(..._args) { super(..._args); this.dataStyle = ObcPoiObjectStyle.Regular; this.dataState = null; this.dataInteractive = false; } getVisualNodes() { return this.queryVisualNodes(\"obc-poi\", \"obc-poi-button-data\"); } renderButtonSlot() { return html` <obc-poi-button-data slot=\"button\" .relativeDirection=${this.relativeDirection} .selected=${this.selected} .hasHeader=${this.hasHeader} .headerContent=${this.headerContent} .state=${this.resolvedPoiState} .value=${this.value} .overlapOpaque=${this.overlapOpaque} .type=${this.buttonType} .data=${this.data} .dataStyle=${this.dataStyle} .dataState=${this.dataState} .dataInteractive=${this.dataInteractive} > <slot ><obi-vessel-generic-default-filled></obi-vessel-generic-default-filled ></slot> <slot name=\"header\" slot=\"header\"></slot> </obc-poi-button-data> `; } static { this.styles = PoiBase.styles; } }"
1000
1024
  }
1001
1025
  ],
1002
1026
  "exports": [
@@ -1049,7 +1073,7 @@
1049
1073
  {
1050
1074
  "kind": "variable",
1051
1075
  "name": "ObcPoiVessel",
1052
- "default": "class ObcPoiVessel extends PoiBase { constructor(..._args) { super(..._args); this.vesselType = ObcPoiObjectVesselType.Regular; this.vesselStyle = ObcPoiObjectVesselStyle.Regular; this.vesselState = null; this.vesselInteractive = false; } getVisualNodes() { return this.queryVisualNodes(\"obc-poi\", \"obc-poi-button-vessel\"); } renderButtonSlot() { return html` <obc-poi-button-vessel slot=\"button\" .relativeDirection=${this.relativeDirection} .selected=${this.selected} .hasHeader=${this.hasHeader} .headerContent=${this.headerContent} .state=${this.resolvedPoiState} .value=${this.value} .overlapOpaque=${this.overlapOpaque} .type=${this.buttonType} .data=${this.data} .vesselType=${this.vesselType} .vesselStyle=${this.vesselStyle} .vesselState=${this.vesselState} .vesselInteractive=${this.vesselInteractive} > <slot ><obi-vessel-generic-default-filled></obi-vessel-generic-default-filled ></slot> <slot name=\"turn-indicator\" slot=\"turn-indicator\"></slot> <slot name=\"speed-indicator\" slot=\"speed-indicator\"></slot> </obc-poi-button-vessel> `; } static { this.styles = PoiBase.styles; } }"
1076
+ "default": "class ObcPoiVessel extends PoiBase { constructor(..._args) { super(..._args); this.vesselType = ObcPoiObjectVesselType.Regular; this.vesselStyle = ObcPoiObjectVesselStyle.Regular; this.vesselState = null; this.vesselInteractive = false; } getVisualNodes() { return this.queryVisualNodes(\"obc-poi\", \"obc-poi-button-vessel\"); } renderButtonSlot() { return html` <obc-poi-button-vessel slot=\"button\" .relativeDirection=${this.relativeDirection} .selected=${this.selected} .hasHeader=${this.hasHeader} .headerContent=${this.headerContent} .state=${this.resolvedPoiState} .value=${this.value} .overlapOpaque=${this.overlapOpaque} .type=${this.buttonType} .data=${this.data} .vesselType=${this.vesselType} .vesselStyle=${this.vesselStyle} .vesselState=${this.vesselState} .vesselInteractive=${this.vesselInteractive} > <slot ><obi-vessel-generic-default-filled></obi-vessel-generic-default-filled ></slot> <slot name=\"turn-indicator\" slot=\"turn-indicator\"></slot> <slot name=\"speed-indicator\" slot=\"speed-indicator\"></slot> <slot name=\"header\" slot=\"header\"></slot> </obc-poi-button-vessel> `; } static { this.styles = PoiBase.styles; } }"
1053
1077
  }
1054
1078
  ],
1055
1079
  "exports": [
@@ -1106,10 +1130,18 @@
1106
1130
  {
1107
1131
  "kind": "variable",
1108
1132
  "name": "ObcPoi",
1109
- "default": "class ObcPoi extends LitElement { constructor(..._args) { super(..._args); this.type = \"line\"; this.value = \"unchecked\"; this.state = \"enabled\"; this.selected = false; this.buttonType = ObcPoiButtonType.Button; this.overlapOpaque = false; this.data = []; this.hasHeader = false; this.headerContent = \"\"; this.hasPointer = false; this.pointerType = null; this.pointerState = null; this.relativeDirection = 0; this.x = 0; this.y = DEFAULT_LINE_LENGTH_PX; this.buttonY = 0; this.fixedTarget = false; this.buttonOffsetX = 0; this.targetOffsetX = 0; this.boxWidth = null; this.boxHeight = null; this.outsideAngle = 315; this.animatePosition = false; this.slottedButton = null; } connectedCallback() { super.connectedCallback(); this.setupHeaderObserver(); } disconnectedCallback() { super.disconnectedCallback(); this.headerObserver?.disconnect(); this.headerObserver = void 0; } setupHeaderObserver() { this.headerObserver?.disconnect(); this.headerObserver = new MutationObserver((mutations) => { for (const mutation of mutations) { if (mutation.type === \"childList\") { this.syncFallbackButtonHeaderContent(); this.syncAttachedHeaderState(); return; } if (mutation.type === \"attributes\" && mutation.target instanceof HTMLElement && mutation.target.getAttribute(\"slot\") === \"header\") { this.syncFallbackButtonHeaderContent(); this.syncAttachedHeaderState(); return; } } }); this.headerObserver.observe(this, { childList: true, attributes: true, attributeFilter: [\"slot\"] }); } updatePosition() { this.style.removeProperty(\"top\"); if (this.fixedTarget) { this.style.removeProperty(\"--obc-poi-button-y\"); if (Number.isFinite(this.resolvedButtonY)) this.style.setProperty(\"--obc-poi-y\", `${this.resolvedButtonY - this.resolvedTargetY}px`); else this.style.removeProperty(\"--obc-poi-y\"); } else if (Number.isFinite(this.resolvedButtonY)) { this.style.setProperty(\"--obc-poi-y\", `${this.resolvedButtonY}px`); this.style.setProperty(\"--obc-poi-button-y\", \"0px\"); } else { this.style.removeProperty(\"--obc-poi-y\"); this.style.removeProperty(\"--obc-poi-button-y\"); } } get isCheckedLike() { return this.value === \"checked\" || this.value === \"activated\"; } get buttonVisualState() { switch (this.value) { case \"unchecked\": return PoiButtonVisualState.Unchecked; case \"checked\": return PoiButtonVisualState.Checked; case \"activated\": return PoiButtonVisualState.Activated; case \"overlapped\": return PoiButtonVisualState.Overlapped; default: return PoiButtonVisualState.Unchecked; } } get buttonState() { switch (this.state) { case \"caution\": return ObcPoiButtonState.Caution; case \"warning\": return ObcPoiButtonState.Warning; case \"alarm\": return ObcPoiButtonState.Alarm; default: return ObcPoiButtonState.Enabled; } } get resolvedHeaderState() { switch (this.buttonState) { case ObcPoiButtonState.Caution: return ObcPoiHeaderState.Caution; case ObcPoiButtonState.Warning: return ObcPoiHeaderState.Warning; case ObcPoiButtonState.Alarm: return ObcPoiHeaderState.Alarm; case ObcPoiButtonState.Enabled: default: return this.selected ? ObcPoiHeaderState.Selected : ObcPoiHeaderState.Enabled; } } get lineStyle() { if (this.state === \"alarm\") return POIStyle.Alarm; if (this.state === \"warning\") return POIStyle.Warning; if (this.state === \"caution\") return POIStyle.Caution; if (this.selected) return POIStyle.Selected; return POIStyle.Regular; } get pointerSelected() { return this.isCheckedLike; } /** Public `y` normalized as the target Y input. */ get resolvedTargetY() { return Number.isFinite(this.y) ? this.y : 0; } /** Public `buttonY` normalized as the button Y input. */ get resolvedButtonY() { return typeof this.buttonY === \"number\" && Number.isFinite(this.buttonY) ? this.buttonY : 0; } get buttonProjectionY() { const raw = getComputedStyle(this).getPropertyValue(\"--obc-poi-button-projection-y\"); const parsed = Number.parseFloat(raw); return Number.isFinite(parsed) ? parsed : 0; } get targetProjectionY() { const raw = getComputedStyle(this).getPropertyValue(\"--obc-poi-target-projection-y\"); const parsed = Number.parseFloat(raw); return Number.isFinite(parsed) ? parsed : 0; } get lineOffset() { if (this.type === \"point\" || this.type === \"outside\") return 0; const lineOffset = (Number.isFinite(this.targetOffsetX) ? this.targetOffsetX : 0) - (Number.isFinite(this.buttonOffsetX) ? this.buttonOffsetX : 0); return Number.isFinite(lineOffset) ? lineOffset : 0; } get hasInlinePointer() { if (this.isCheckedLike && this.type !== \"outside\") return true; if (!this.hasPointer) return false; return this.type === \"line\" || this.type === \"offset\" || this.type === \"point\"; } get resolvedPointerType() { if (this.isCheckedLike || this.state === \"enabled\") return ObcPoiPointerType.Point; return this.pointerType ?? ObcPoiPointerType.Point; } get resolvedPointerState() { if (this.isCheckedLike && this.type !== \"outside\") return ObcPoiPointerState.Selected; if (this.pointerState) return this.pointerState; return ObcPoiPointerState.Regular; } get pointerBoxWidthExtra() { if (this.boxWidth === null) return null; const width = Number(this.boxWidth); if (!Number.isFinite(width)) return null; return Math.max(0, width - POINTER_BOX_BASE_SIZE_PX); } get pointerBoxHeightExtra() { if (this.boxHeight === null) return null; const height = Number(this.boxHeight); if (!Number.isFinite(height)) return null; return Math.max(0, height - POINTER_BOX_BASE_SIZE_PX); } renderLine() { if (this.type === \"outside\") return nothing; if (this.type === \"point\" && (this.isCheckedLike || this.state === \"alarm\")) return nothing; const fallbackTargetDelta = this.type === \"point\" ? 0 : Math.max(0, Math.abs(this.targetAnchorY + this.targetProjectionY - this.buttonProjectionY)); return html` <obc-poi-line class=\"line\" style=\"--obc-poi-line-projection-y: ${this.buttonProjectionY}px;\" .poiStyle=${this.lineStyle} .height=${fallbackTargetDelta} .offset=${this.lineOffset} .hasPointer=${false} .animatePosition=${this.animatePosition} ></obc-poi-line> `; } renderInlinePointer() { if (!this.hasInlinePointer) return nothing; return html` <obc-poi-pointer class=\"pointer\" style=\"--obc-poi-pointer-x: ${this.lineOffset}px; --obc-poi-pointer-y: ${this.targetAnchorY + this.targetProjectionY}px;\" .type=${this.resolvedPointerType} .state=${this.resolvedPointerState} .boxWidth=${this.pointerBoxWidthExtra} .boxHeight=${this.pointerBoxHeightExtra} ></obc-poi-pointer> `; } renderOutsideArrow() { if (this.type !== \"outside\" || !this.hasPointer) return nothing; const touchTarget = this.buttonType === ObcPoiButtonType.Enhanced ? 64 : 48; const radius = touchTarget / Math.SQRT2; const baseCenterYOffset = -touchTarget / 2; const angle = degToRad(this.outsideAngle); const xOffset = Math.cos(angle) * radius; const yOffset = baseCenterYOffset + Math.sin(angle) * radius; const value = this.pointerSelected ? \"checked\" : \"unchecked\"; return html`<div class=\"outside-arrow\" style=\"--obc-poi-outside-arrow-x: ${xOffset}px; --obc-poi-outside-arrow-y: ${yOffset}px; --obc-poi-outside-arrow-angle: ${this.outsideAngle}deg;\" > ${poiArrow(value)} </div>`; } get targetAnchorY() { const targetDelta = this.resolvedTargetY - this.resolvedButtonY; return this.type === \"point\" ? Math.max(POINT_POINTER_OFFSET_PX, targetDelta) : targetDelta; } handleButtonSlotChange(e) { const assigned = e.target.assignedElements({ flatten: false }); this.slottedButton = assigned.length > 0 ? assigned[0] : null; this.syncFallbackButtonHeaderContent(); this.syncSlottedButtonProps(); } syncFallbackButtonHeaderContent() { if (this.slottedButton) return; const button = this.renderRoot.querySelector(\"obc-poi-button.poi-button\"); if (!button) return; for (const child of Array.from(this.children)) { if (!(child instanceof HTMLElement) || child.getAttribute(\"slot\") !== \"header\") continue; if (child.parentElement !== button) button.appendChild(child); this.applyHeaderState(child); } } applyHeaderState(root) { const headers = [...root instanceof Element && root.matches(\"obc-poi-header\") ? [root] : [], ...root.querySelectorAll(\"obc-poi-header\")]; for (const header of headers) { header.state = this.resolvedHeaderState; header.setAttribute(\"state\", this.resolvedHeaderState); } } syncAttachedHeaderState() { this.applyHeaderState(this.renderRoot); } syncSlottedButtonProps() { const btn = this.slottedButton; if (!btn) return; const props = btn; props.layout = \"inline\"; props.relativeDirection = this.relativeDirection; props.selected = this.selected; props.hasHeader = this.hasHeader; props.headerContent = this.headerContent; props.state = this.buttonState; props.value = this.buttonVisualState; props.overlapOpaque = this.overlapOpaque; props.type = this.buttonType; props.data = this.data; } renderPoiButton() { return html` <slot name=\"button\" @slotchange=${this.handleButtonSlotChange}> <obc-poi-button layout=\"inline\" class=\"poi-button\" .relativeDirection=${this.relativeDirection} .selected=${this.selected} .hasHeader=${this.hasHeader} .headerContent=${this.headerContent} .state=${this.buttonState} .value=${this.buttonVisualState} .overlapOpaque=${this.overlapOpaque} .type=${this.buttonType} .data=${this.data} > <slot></slot> </obc-poi-button> </slot> `; } refreshProjectionLayout(_trackDurationMs = 0) { this.requestUpdate(); } render() { const classes = { wrapper: true, [`type-${this.type}`]: true, [`button-${this.buttonType}`]: true, [`value-${this.value}`]: true, [`state-${this.state}`]: true, \"has-data\": this.data.length > 0, \"no-motion\": !this.animatePosition }; const wrapperStyle = this.buttonOffsetX !== 0 ? { \"--obc-poi-target-top-offset-x\": `${this.buttonOffsetX}px` } : {}; return html` <div class=${classMap(classes)} style=${styleMap(wrapperStyle)}> ${this.renderPoiButton()} ${this.renderLine()} ${this.renderInlinePointer()} ${this.renderOutsideArrow()} </div> `; } firstUpdated(_changedProperties) { this.syncFallbackButtonHeaderContent(); this.syncAttachedHeaderState(); } updated(changedProperties) { super.updated(changedProperties); if (changedProperties.has(\"x\")) { this.style.removeProperty(\"left\"); this.style.setProperty(\"--obc-poi-x\", `${this.x}px`); } if (changedProperties.has(\"buttonY\") || changedProperties.has(\"y\") || changedProperties.has(\"fixedTarget\")) this.updatePosition(); this.syncFallbackButtonHeaderContent(); this.syncSlottedButtonProps(); this.syncAttachedHeaderState(); } static { this.styles = unsafeCSS(poi_default); } }"
1133
+ "default": "class ObcPoi extends LitElement { constructor(..._args) { super(..._args); this.type = \"line\"; this.value = \"unchecked\"; this.state = \"enabled\"; this.selected = false; this.buttonType = ObcPoiButtonType.Button; this.overlapOpaque = false; this.data = []; this.hasHeader = false; this.headerContent = \"\"; this.hasPointer = false; this.pointerType = null; this.pointerState = null; this.relativeDirection = 0; this.x = 0; this.y = 192; this.buttonY = 0; this.fixedTarget = false; this.buttonOffsetX = 0; this.targetOffsetX = 0; this.boxWidth = null; this.boxHeight = null; this.outsideAngle = 315; this.animatePosition = false; this.slottedButton = null; } updatePosition() { this.style.removeProperty(\"top\"); if (this.fixedTarget) { this.style.removeProperty(\"--obc-poi-button-y\"); if (Number.isFinite(this.resolvedButtonY)) this.style.setProperty(\"--obc-poi-y\", `${this.resolvedButtonY - this.resolvedTargetY}px`); else this.style.removeProperty(\"--obc-poi-y\"); } else if (Number.isFinite(this.resolvedButtonY)) { this.style.setProperty(\"--obc-poi-y\", `${this.resolvedButtonY}px`); this.style.setProperty(\"--obc-poi-button-y\", \"0px\"); } else { this.style.removeProperty(\"--obc-poi-y\"); this.style.removeProperty(\"--obc-poi-button-y\"); } } get isCheckedLike() { return this.value === \"checked\" || this.value === \"activated\"; } get buttonVisualState() { switch (this.value) { case \"unchecked\": return PoiButtonVisualState.Unchecked; case \"checked\": return PoiButtonVisualState.Checked; case \"activated\": return PoiButtonVisualState.Activated; case \"overlapped\": return PoiButtonVisualState.Overlapped; default: return PoiButtonVisualState.Unchecked; } } get buttonState() { switch (this.state) { case \"caution\": return ObcPoiButtonState.Caution; case \"warning\": return ObcPoiButtonState.Warning; case \"alarm\": return ObcPoiButtonState.Alarm; default: return ObcPoiButtonState.Enabled; } } get lineStyle() { if (this.state === \"alarm\") return POIStyle.Alarm; if (this.state === \"warning\") return POIStyle.Warning; if (this.state === \"caution\") return POIStyle.Caution; if (this.selected) return POIStyle.Selected; return POIStyle.Regular; } get pointerSelected() { return this.isCheckedLike; } /** Public `y` normalized as the target Y input. */ get resolvedTargetY() { return Number.isFinite(this.y) ? this.y : 0; } /** Public `buttonY` normalized as the button Y input. */ get resolvedButtonY() { return typeof this.buttonY === \"number\" && Number.isFinite(this.buttonY) ? this.buttonY : 0; } get buttonProjectionY() { const raw = getComputedStyle(this).getPropertyValue(\"--obc-poi-button-projection-y\"); const parsed = Number.parseFloat(raw); return Number.isFinite(parsed) ? parsed : 0; } get targetProjectionY() { const raw = getComputedStyle(this).getPropertyValue(\"--obc-poi-target-projection-y\"); const parsed = Number.parseFloat(raw); return Number.isFinite(parsed) ? parsed : 0; } get lineOffset() { if (this.type === \"point\" || this.type === \"outside\") return 0; const lineOffset = (Number.isFinite(this.targetOffsetX) ? this.targetOffsetX : 0) - (Number.isFinite(this.buttonOffsetX) ? this.buttonOffsetX : 0); return Number.isFinite(lineOffset) ? lineOffset : 0; } get hasInlinePointer() { if (this.isCheckedLike && this.type !== \"outside\") return true; if (!this.hasPointer) return false; return this.type === \"line\" || this.type === \"offset\" || this.type === \"point\"; } get resolvedPointerType() { if (this.isCheckedLike || this.state === \"enabled\") return ObcPoiPointerType.Point; return this.pointerType ?? ObcPoiPointerType.Point; } get resolvedPointerState() { if (this.isCheckedLike && this.type !== \"outside\") return ObcPoiPointerState.Selected; if (this.pointerState) return this.pointerState; return ObcPoiPointerState.Regular; } get pointerBoxWidthExtra() { if (this.boxWidth === null) return null; const width = Number(this.boxWidth); if (!Number.isFinite(width)) return null; return Math.max(0, width - POINTER_BOX_BASE_SIZE_PX); } get pointerBoxHeightExtra() { if (this.boxHeight === null) return null; const height = Number(this.boxHeight); if (!Number.isFinite(height)) return null; return Math.max(0, height - POINTER_BOX_BASE_SIZE_PX); } renderLine() { if (this.type === \"outside\") return nothing; if (this.type === \"point\" && (this.isCheckedLike || this.state === \"alarm\")) return nothing; const fallbackTargetDelta = this.type === \"point\" ? 0 : Math.max(0, Math.abs(this.targetAnchorY + this.targetProjectionY - this.buttonProjectionY)); return html` <obc-poi-line class=\"line\" style=\"--obc-poi-line-projection-y: ${this.buttonProjectionY}px;\" .poiStyle=${this.lineStyle} .height=${fallbackTargetDelta} .offset=${this.lineOffset} .hasPointer=${false} .animatePosition=${this.animatePosition} ></obc-poi-line> `; } renderInlinePointer() { if (!this.hasInlinePointer) return nothing; return html` <obc-poi-pointer class=\"pointer\" style=\"--obc-poi-pointer-x: ${this.lineOffset}px; --obc-poi-pointer-y: ${this.targetAnchorY + this.targetProjectionY}px;\" .type=${this.resolvedPointerType} .state=${this.resolvedPointerState} .boxWidth=${this.pointerBoxWidthExtra} .boxHeight=${this.pointerBoxHeightExtra} ></obc-poi-pointer> `; } renderOutsideArrow() { if (this.type !== \"outside\" || !this.hasPointer) return nothing; const touchTarget = this.buttonType === ObcPoiButtonType.Enhanced ? 64 : 48; const radius = touchTarget / Math.SQRT2; const baseCenterYOffset = -touchTarget / 2; const angle = degToRad(this.outsideAngle); const xOffset = Math.cos(angle) * radius; const yOffset = baseCenterYOffset + Math.sin(angle) * radius; const value = this.pointerSelected ? \"checked\" : \"unchecked\"; return html`<div class=\"outside-arrow\" style=\"--obc-poi-outside-arrow-x: ${xOffset}px; --obc-poi-outside-arrow-y: ${yOffset}px; --obc-poi-outside-arrow-angle: ${this.outsideAngle}deg;\" > ${poiArrow(value)} </div>`; } get targetAnchorY() { const targetDelta = this.resolvedTargetY - this.resolvedButtonY; return this.type === \"point\" ? Math.max(POINT_POINTER_OFFSET_PX, targetDelta) : targetDelta; } handleButtonSlotChange(e) { if (e.target !== e.currentTarget) return; const assigned = e.currentTarget.assignedElements({ flatten: false }); this.slottedButton = assigned.length > 0 ? assigned[0] : null; this.syncSlottedButtonProps(); } syncSlottedButtonProps() { const btn = this.slottedButton; if (!btn) return; const props = btn; props.layout = \"inline\"; props.relativeDirection = this.relativeDirection; props.selected = this.selected; props.hasHeader = this.hasHeader; props.headerContent = this.headerContent; props.state = this.buttonState; props.value = this.buttonVisualState; props.overlapOpaque = this.overlapOpaque; props.type = this.buttonType; props.data = this.data; } renderPoiButton() { return html` <slot name=\"button\" @slotchange=${this.handleButtonSlotChange}> <obc-poi-button layout=\"inline\" class=\"poi-button\" .relativeDirection=${this.relativeDirection} .selected=${this.selected} .hasHeader=${this.hasHeader} .headerContent=${this.headerContent} .state=${this.buttonState} .value=${this.buttonVisualState} .overlapOpaque=${this.overlapOpaque} .type=${this.buttonType} .data=${this.data} > <slot></slot> <slot name=\"header\" slot=\"header\"></slot> </obc-poi-button> </slot> `; } refreshProjectionLayout(_trackDurationMs = 0) { this.requestUpdate(); } render() { const classes = { wrapper: true, [`type-${this.type}`]: true, [`button-${this.buttonType}`]: true, [`value-${this.value}`]: true, [`state-${this.state}`]: true, \"has-data\": this.data.length > 0, \"no-motion\": !this.animatePosition }; const wrapperStyle = this.buttonOffsetX !== 0 ? { \"--obc-poi-target-top-offset-x\": `${this.buttonOffsetX}px` } : {}; return html` <div class=${classMap(classes)} style=${styleMap(wrapperStyle)}> ${this.renderPoiButton()} ${this.renderLine()} ${this.renderInlinePointer()} ${this.renderOutsideArrow()} </div> `; } updated(changedProperties) { super.updated(changedProperties); if (changedProperties.has(\"x\")) { this.style.removeProperty(\"left\"); this.style.setProperty(\"--obc-poi-x\", `${this.x}px`); } if (changedProperties.has(\"buttonY\") || changedProperties.has(\"y\") || changedProperties.has(\"fixedTarget\")) this.updatePosition(); this.syncSlottedButtonProps(); } static { this.styles = unsafeCSS(poi_default); } }"
1110
1134
  }
1111
1135
  ],
1112
1136
  "exports": [
1137
+ {
1138
+ "kind": "js",
1139
+ "name": "DEFAULT_LINE_LENGTH_PX",
1140
+ "declaration": {
1141
+ "name": "DEFAULT_LINE_LENGTH_PX",
1142
+ "module": "dist/ar/poi/poi.js"
1143
+ }
1144
+ },
1113
1145
  {
1114
1146
  "kind": "js",
1115
1147
  "name": "ObcPoi",
@@ -11595,6 +11627,7 @@
11595
11627
  "text": "boolean"
11596
11628
  },
11597
11629
  "default": "false",
11630
+ "description": "Expanded-group presentation state, applied by the owning group composition while the button is shown inside an expanded `obc-poi-group` and during its collapse animations. Consumers should not set it directly.",
11598
11631
  "inheritedFrom": {
11599
11632
  "name": "ObcPoiButton",
11600
11633
  "module": "src/ar/poi-button/poi-button.ts"
@@ -11648,6 +11681,15 @@
11648
11681
  "module": "src/ar/poi-button/poi-button.ts"
11649
11682
  }
11650
11683
  },
11684
+ {
11685
+ "kind": "field",
11686
+ "name": "handleLightSlotChange",
11687
+ "privacy": "private",
11688
+ "inheritedFrom": {
11689
+ "name": "ObcPoiButton",
11690
+ "module": "src/ar/poi-button/poi-button.ts"
11691
+ }
11692
+ },
11651
11693
  {
11652
11694
  "kind": "method",
11653
11695
  "name": "setupHeaderContentObserver",
@@ -12085,6 +12127,7 @@
12085
12127
  "text": "boolean"
12086
12128
  },
12087
12129
  "default": "false",
12130
+ "description": "Expanded-group presentation state, applied by the owning group composition while the button is shown inside an expanded `obc-poi-group` and during its collapse animations. Consumers should not set it directly.",
12088
12131
  "inheritedFrom": {
12089
12132
  "name": "ObcPoiButton",
12090
12133
  "module": "src/ar/poi-button/poi-button.ts"
@@ -12138,6 +12181,15 @@
12138
12181
  "module": "src/ar/poi-button/poi-button.ts"
12139
12182
  }
12140
12183
  },
12184
+ {
12185
+ "kind": "field",
12186
+ "name": "handleLightSlotChange",
12187
+ "privacy": "private",
12188
+ "inheritedFrom": {
12189
+ "name": "ObcPoiButton",
12190
+ "module": "src/ar/poi-button/poi-button.ts"
12191
+ }
12192
+ },
12141
12193
  {
12142
12194
  "kind": "method",
12143
12195
  "name": "setupHeaderContentObserver",
@@ -12591,6 +12643,7 @@
12591
12643
  "text": "boolean"
12592
12644
  },
12593
12645
  "default": "false",
12646
+ "description": "Expanded-group presentation state, applied by the owning group composition while the button is shown inside an expanded `obc-poi-group` and during its collapse animations. Consumers should not set it directly.",
12594
12647
  "inheritedFrom": {
12595
12648
  "name": "ObcPoiButton",
12596
12649
  "module": "src/ar/poi-button/poi-button.ts"
@@ -12644,6 +12697,15 @@
12644
12697
  "module": "src/ar/poi-button/poi-button.ts"
12645
12698
  }
12646
12699
  },
12700
+ {
12701
+ "kind": "field",
12702
+ "name": "handleLightSlotChange",
12703
+ "privacy": "private",
12704
+ "inheritedFrom": {
12705
+ "name": "ObcPoiButton",
12706
+ "module": "src/ar/poi-button/poi-button.ts"
12707
+ }
12708
+ },
12647
12709
  {
12648
12710
  "kind": "method",
12649
12711
  "name": "setupHeaderContentObserver",
@@ -12915,7 +12977,7 @@
12915
12977
  "declarations": [
12916
12978
  {
12917
12979
  "kind": "class",
12918
- "description": "`<obc-poi-button>` - Marker button component that renders an icon target with optional header and data rows.\n\n## Overview\nUse this component when you need a button-style marker that can show stateful framing and optional metric rows.\nKeywords/synonyms: marker button, target button, icon target, POI button.\n\n## Features/Variants\n- `type` (default `button`): `button` or `enhanced` size.\n- `layout` (default `anchored`): `anchored` or `inline`.\n- `value` (default `unchecked`): `unchecked`, `checked`, `activated`, `overlapped`.\n- `overlapOpaque` (default `false`): controls overlapped opacity mode (`false` = translucent, `true` = opaque).\n- `state` (default `enabled`): `enabled`, `caution`, `warning`, `alarm`, `level-critical`, `level-high`, `level-medium`, `level-low`, `level-diagnostic`.\n- `selected` (default `false`): shows selection frame in anchored layout.\n- `relativeDirection` (default `0`): rotates default-slot icon content in degrees.\n- `data` (default `[]`): when non-empty, renders value/label/unit rows.\n- `hasHeader` + `header` slot: renders a header area and syncs slotted `obc-poi-header` state.\n- `hasRelation` (default `false`): enables optional relation content in data mode.\n- `inExpandedGroup` (default `false`): applies `expanded` CSS class.\n- TODO(designer): Confirm intended UX semantics for `inExpandedGroup` beyond styling.\n\n## Usage Guidelines\n- Use `layout=\"anchored\"` for standalone marker buttons.\n- Use `layout=\"inline\"` when this component is embedded in a larger marker composition.\n- Provide `data` for metric display variants.\n- Enable `hasRelation` only when relation slot content is provided.\n\n## Slots/Content\n- Default slot: Icon/content rendered inside `obc-poi-object`.\n- `header`: Optional header content rendered above the marker body.\n- `relation`: Optional relation icon/content rendered when `hasRelation` is true in data mode.\n\n## Events\nThis component emits no custom events. A standard `click` bubbles from the\ninternal `<button>` (`onClick` in the framework wrappers).\n\n## Best Practices\n- Keep `value`, `state`, and `selected` synchronized to avoid conflicting visual states.\n- Prefer enum values for `type`, `layout`, `state`, and `value`.\n\n## Example\n```html\n<obc-poi-button type=\"button\" layout=\"anchored\" value=\"checked\" selected>\n <obi-placeholder></obi-placeholder>\n <obc-poi-header slot=\"header\" content=\"1\"></obc-poi-header>\n</obc-poi-button>\n```",
12980
+ "description": "`<obc-poi-button>` - Marker button component that renders an icon target with optional header and data rows.\n\n## Overview\nUse this component when you need a button-style marker that can show stateful framing and optional metric rows.\nKeywords/synonyms: marker button, target button, icon target, POI button.\n\n## Features/Variants\n- `type` (default `button`): `button` or `enhanced` size.\n- `layout` (default `anchored`): `anchored` or `inline`.\n- `value` (default `unchecked`): `unchecked`, `checked`, `activated`, `overlapped`.\n- `overlapOpaque` (default `false`): controls overlapped opacity mode (`false` = translucent, `true` = opaque).\n- `state` (default `enabled`): `enabled`, `caution`, `warning`, `alarm`, `level-critical`, `level-high`, `level-medium`, `level-low`, `level-diagnostic`.\n- `selected` (default `false`): shows selection frame in anchored layout.\n- `relativeDirection` (default `0`): rotates default-slot icon content in degrees.\n- `data` (default `[]`): when non-empty, renders value/label/unit rows.\n- `hasHeader` + `header` slot: renders a header area and syncs slotted `obc-poi-header` state.\n- `hasRelation` (default `false`): enables optional relation content in data mode.\n- `inExpandedGroup` (default `false`): expanded-group presentation state, applied by the owning group composition during expand/collapse orchestration; consumers should not set it directly.\n\n## Usage Guidelines\n- Use `layout=\"anchored\"` for standalone marker buttons.\n- Use `layout=\"inline\"` when this component is embedded in a larger marker composition.\n- Provide `data` for metric display variants.\n- Enable `hasRelation` only when relation slot content is provided.\n\n## Slots/Content\n- Default slot: Icon/content rendered inside `obc-poi-object`.\n- `header`: Optional header content rendered above the marker body.\n- `relation`: Optional relation icon/content rendered when `hasRelation` is true in data mode.\n\n## Events\nThis component emits no custom events. A standard `click` bubbles from the\ninternal `<button>` (`onClick` in the framework wrappers).\n\n## Best Practices\n- Keep `value`, `state`, and `selected` synchronized to avoid conflicting visual states.\n- Prefer enum values for `type`, `layout`, `state`, and `value`.\n\n## Example\n```html\n<obc-poi-button type=\"button\" layout=\"anchored\" value=\"checked\" selected>\n <obi-placeholder></obi-placeholder>\n <obc-poi-header slot=\"header\" content=\"1\"></obc-poi-header>\n</obc-poi-button>\n```",
12919
12981
  "name": "ObcPoiButton",
12920
12982
  "slots": [
12921
12983
  {
@@ -12995,7 +13057,8 @@
12995
13057
  "type": {
12996
13058
  "text": "boolean"
12997
13059
  },
12998
- "default": "false"
13060
+ "default": "false",
13061
+ "description": "Expanded-group presentation state, applied by the owning group composition while the button is shown inside an expanded `obc-poi-group` and during its collapse animations. Consumers should not set it directly."
12999
13062
  },
13000
13063
  {
13001
13064
  "kind": "field",
@@ -13029,6 +13092,11 @@
13029
13092
  },
13030
13093
  "privacy": "private"
13031
13094
  },
13095
+ {
13096
+ "kind": "field",
13097
+ "name": "handleLightSlotChange",
13098
+ "privacy": "private"
13099
+ },
13032
13100
  {
13033
13101
  "kind": "method",
13034
13102
  "name": "setupHeaderContentObserver",
@@ -13383,8 +13451,26 @@
13383
13451
  "declarations": [
13384
13452
  {
13385
13453
  "kind": "class",
13386
- "description": "`<obc-poi-card>` - Content card container with optional pointer arrow, header variants, and interactive click handling.\n\n## Overview\nUse this component to wrap contextual marker details in a card with optional directional anchoring.\nKeywords/synonyms: detail card, marker card, anchored card, popover card.\n\n## Features/Variants\n- `pointerDirection` (default `none`): `none`, `top`, `bottom`, `left`, `right`.\n- `fixedSize` (default `false`): toggles fixed `256x256` sizing instead of content-based sizing.\n- Header options:\n - `showHeader` controls whether the header area is visible.\n - `headerVariant` controls header layout (`tag`, `condensed`, `regular`, `detailed`).\n - `index`, `cardTitle`, `description`, `source`, `timestamp` are forwarded to `obc-poi-card-header`.\n - `hasLeadingIcon` and `hasCloseButton` gate header affordances.\n- `interactive` (default `false`): enables keyboard activation and `card-click` dispatch.\n- `hasAlert` (default `false`): shows alert ring layer when `interactive` is enabled.\n\n## Usage Guidelines\n- Use `pointerDirection` when the card should visually point to an anchor target.\n- Keep `interactive` off for read-only cards.\n- Use the header slots only when the selected `headerVariant` renders them.\n\n## Slots/Content\n- Default slot: Main card body content.\n- `leading-icon`: Optional icon used by the regular header variant.\n- `poi-icon`: Optional icon used by the detailed header variant.\n\n## Events\n- `card-click`: Fired when the card surface is activated in interactive mode.\n\n## Best Practices\n- Keep `index` stable so event payloads remain predictable.\n- Pair `hasAlert` with meaningful alert state in surrounding UI logic.\n\n## Example\n```html\n<obc-poi-card pointerDirection=\"bottom\" index=\"1\" cardTitle=\"Target\" interactive>\n <obi-placeholder slot=\"leading-icon\"></obi-placeholder>\n <div>Custom card content</div>\n</obc-poi-card>\n```",
13454
+ "description": "`<obc-poi-card>` - Content card container with optional pointer arrow, header variants, and interactive click handling.\n\n## Overview\nUse this component to wrap contextual marker details in a card with optional directional anchoring.\nKeywords/synonyms: detail card, marker card, anchored card, popover card.\n\n## Features/Variants\n- `pointerDirection` (default `none`): `none`, `top`, `bottom`, `left`, `right`.\n- `fixedSize` (default `false`): toggles fixed `256x256` sizing instead of content-based sizing.\n- Header options:\n - `showHeader` controls whether the header area is visible.\n - `headerVariant` controls header layout (`tag`, `condensed`, `regular`, `detailed`).\n - `index`, `cardTitle`, `description`, `source`, `timestamp` are forwarded to `obc-poi-card-header`.\n - `hasLeadingIcon` and `hasCloseButton` gate header affordances.\n- `interactive` (default `false`): enables keyboard activation and `card-click` dispatch.\n- `hasAlert` (default `false`): shows alert ring layer when `interactive` is enabled.\n\n## Usage Guidelines\n- Use `pointerDirection` when the card should visually point to an anchor target.\n- Keep `interactive` off for read-only cards.\n- Use the header slots only when the selected `headerVariant` renders them.\n\n## Slots/Content\n- Default slot: Main card body content.\n- `leading-icon`: Optional icon used by the regular header variant.\n- `poi-icon`: Optional icon used by the detailed header variant.\n\n## Events\n- `card-click`: Fired when the card surface is activated in interactive mode.\n- `close-click`: Fired when the header close button is pressed (`hasCloseButton` with the detailed header variant).\n\n## CSS Parts\n- `wrapper`: Outer layout wrapper holding the pointer arrows and the card surface.\n- `content-box`: Card surface with background, border, and rounded corners.\n- `header`: The `obc-poi-card-header` element, rendered when `showHeader` is true.\n- `content`: Body area wrapping the default slot.\n\n## Best Practices\n- Keep `index` stable so event payloads remain predictable.\n- Pair `hasAlert` with meaningful alert state in surrounding UI logic.\n\n## Example\n```html\n<obc-poi-card pointerDirection=\"bottom\" index=\"1\" cardTitle=\"Target\" interactive>\n <obi-placeholder slot=\"leading-icon\"></obi-placeholder>\n <div>Custom card content</div>\n</obc-poi-card>\n```",
13387
13455
  "name": "ObcPoiCard",
13456
+ "cssParts": [
13457
+ {
13458
+ "description": "Outer layout wrapper holding the pointer arrows and the card surface.",
13459
+ "name": "wrapper"
13460
+ },
13461
+ {
13462
+ "description": "Card surface with background, border, and rounded corners.",
13463
+ "name": "content-box"
13464
+ },
13465
+ {
13466
+ "description": "The `obc-poi-card-header` element, rendered when `showHeader` is true.",
13467
+ "name": "header"
13468
+ },
13469
+ {
13470
+ "description": "Body area wrapping the default slot.",
13471
+ "name": "content"
13472
+ }
13473
+ ],
13388
13474
  "slots": [
13389
13475
  {
13390
13476
  "description": "Main card body content.",
@@ -13606,7 +13692,7 @@
13606
13692
  "type": {
13607
13693
  "text": "CustomEvent<void>"
13608
13694
  },
13609
- "description": "Passed on from the header when its close button is pressed (`hasCloseButton`).",
13695
+ "description": "Passed on from the header when its close button is pressed (`hasCloseButton` with the detailed header variant).",
13610
13696
  "name": "close-click"
13611
13697
  }
13612
13698
  ],
@@ -13642,7 +13728,7 @@
13642
13728
  "declarations": [
13643
13729
  {
13644
13730
  "kind": "class",
13645
- "description": "`<obc-poi-controller>` — Maps detection data onto POI markers over a video or image.\n\nTakes detection coordinates in media pixel space (e.g. x,y in a 1920x1080 frame),\nprojects them to screen space using the media's rendered size and fit mode, and\ncreates/updates `obc-poi-data` targets inside a layer stack.\n\n## Quick Start\n\nThe media slot accepts a `<video>` (live stream, HLS, file) or `<img>` element.\n\n```html\n<obc-poi-controller fit=\"cover\">\n <video slot=\"media\" src=\"stream.mp4\" autoplay muted></video>\n <obc-poi-layer-stack slot=\"stack\" selection-mode=\"multi\">\n <obc-poi-layer is-selected></obc-poi-layer>\n <obc-poi-layer data-controller-layer=\"background\"></obc-poi-layer>\n </obc-poi-layer-stack>\n</obc-poi-controller>\n```\n\nThen set detections from your data source (WebSocket, API, etc.):\n\n```js\nconst controller = document.querySelector('obc-poi-controller');\ncontroller.detections = [\n { id: 'track-1', x: 400, y: 800, box_width: 50, box_height: 40, heading: -15 },\n { id: 'track-2', x: 900, y: 750, box_width: 35, box_height: 30, heading: 45 },\n];\n```\n\n## Framework Usage\n\n**Lit:**\n```html\n<obc-poi-controller .detections=${detections} fit=\"cover\">\n```\n\n**Vue:**\n```html\n<obc-poi-controller :detections=\"detections\" fit=\"cover\">\n```\n\n**Svelte:**\n```html\n<obc-poi-controller detections={detections} fit=\"cover\">\n```\n\n**React 18** (needs ref for array props):\n```tsx\nconst ref = useRef(null);\nuseEffect(() => { ref.current.detections = detections; }, [detections]);\n<obc-poi-controller ref={ref} fit=\"cover\">\n```\n\n**React 19+** (native custom element support):\n```tsx\n<obc-poi-controller detections={detections} fit=\"cover\">\n```\n\n## Coordinate Model\n\nDetection `x` and `y` are in **media pixel space** (e.g. 0-1920 for a 1920x1080 video).\nThe controller projects them to screen space using the `fit` mode (`contain` or `cover`)\nand the media element's rendered dimensions.\n\nThe Y coordinate maps to the line length from the layer's top edge down to the\ndetection point. The button sits at the top of the layer; the line extends downward.\n\n## Detection Data\n\nEach detection can include:\n- `x`, `y` (required) — position in media pixel space\n- `id` — stable identity key (prevents marker churn when array order changes)\n- `box_width`, `box_height` — bounding box size; determines button type (regular vs enhanced)\n- `heading` or `direction` — rotation angle for the icon arrow (degrees)\n- `confidence` — filtered by `confidenceMin`\n- `class` — filtered by `classFilter`\n\n## Layer Setup\n\nThe stack needs at least two layers:\n1. A **selected layer** (`is-selected`) — targets jump here when clicked\n2. A **background layer** (`data-controller-layer=\"background\"`) — where the controller places targets\n\nIf no `data-controller-layer=\"background\"` is set, the controller uses the first non-selected layer.\n\n## Selection\n\nClicking a target moves it to the selected layer with a FLIP animation.\nThe controller does not interfere with selected targets — it only manages\ntargets in the background layer. The layer-stack owns selection state.\n\n## CSS Custom Properties\n\n- `--obc-poi-controller-stack-top` (default `15%`) — vertical position of the stack\n- `--obc-poi-controller-stack-height` (default `50%`) — height of the stack\n- `--obc-poi-controller-stack-gap` (default `8px`) — gap between layers",
13731
+ "description": "`<obc-poi-controller>` — Maps detection data onto POI markers over a video or image.\n\nTakes detection coordinates in media pixel space (e.g. x,y in a 1920x1080 frame),\nprojects them to screen space using the media's rendered size and fit mode, and\ncreates/updates POI targets inside a layer stack (`obc-poi-data` by default;\n`obc-poi-vessel`/`obc-poi-aton` via each detection's `variant`, with optional\nper-detection `icon`, `state`, and `data`).\n\n## Quick Start\n\nThe media slot accepts a `<video>` (live stream, HLS, file) or `<img>` element.\n\n```html\n<obc-poi-controller fit=\"cover\">\n <video slot=\"media\" src=\"stream.mp4\" autoplay muted></video>\n <obc-poi-layer-stack slot=\"stack\" selection-mode=\"multi\">\n <obc-poi-layer is-selected></obc-poi-layer>\n <obc-poi-layer data-controller-layer=\"background\"></obc-poi-layer>\n </obc-poi-layer-stack>\n</obc-poi-controller>\n```\n\nThen set detections from your data source (WebSocket, API, etc.):\n\n```js\nconst controller = document.querySelector('obc-poi-controller');\ncontroller.detections = [\n { id: 'track-1', x: 400, y: 800, box_width: 50, box_height: 40, heading: -15 },\n { id: 'track-2', x: 900, y: 750, box_width: 35, box_height: 30, heading: 45 },\n];\n```\n\n## Framework Usage\n\n**Lit:**\n```html\n<obc-poi-controller .detections=${detections} fit=\"cover\">\n```\n\n**Vue:**\n```html\n<obc-poi-controller :detections=\"detections\" fit=\"cover\">\n```\n\n**Svelte:**\n```html\n<obc-poi-controller detections={detections} fit=\"cover\">\n```\n\n**React 18** (needs ref for array props):\n```tsx\nconst ref = useRef(null);\nuseEffect(() => { ref.current.detections = detections; }, [detections]);\n<obc-poi-controller ref={ref} fit=\"cover\">\n```\n\n**React 19+** (native custom element support):\n```tsx\n<obc-poi-controller detections={detections} fit=\"cover\">\n```\n\n## Framework Notes\n\nBoth paths are safe for declarative renderers (React, Vue, Lit): the\n`detections` API creates and owns the resulting `obc-poi-data` elements,\nand manually slotted POI children are never moved, re-parented, or\nmodified structurally by the library — selection is rendered by CSS\nprojection and auto-grouping happens inside the layer's shadow root via\nslot assignment. Frameworks can manage POI children as ordinary\nframework-owned elements.\n\n## Coordinate Model\n\nDetection `x` and `y` are in **media pixel space** (e.g. 0-1920 for a 1920x1080 video).\nThe controller projects them to screen space using the `fit` mode (`contain` or `cover`)\nand the media element's rendered dimensions.\n\nThe Y coordinate maps to the line length from the layer's top edge down to the\ndetection point. The button sits at the top of the layer; the line extends downward.\n\n## Detection Data\n\nEach detection can include:\n- `x`, `y` (required) — position in media pixel space\n- `id` — stable identity key (prevents marker churn when array order changes)\n- `box_width`, `box_height` — bounding box size; determines button type (regular vs enhanced)\n- `heading` or `direction` — rotation angle for the icon arrow (degrees)\n- `confidence` — filtered by `confidenceMin`\n- `class` — filtered by `classFilter`\n\n## Layer Setup\n\nThe stack needs at least two layers:\n1. A **selected layer** (`is-selected`) — targets jump here when clicked\n2. A **background layer** (`data-controller-layer=\"background\"`) — where the controller places targets\n\nIf no `data-controller-layer=\"background\"` is set, the controller uses the first non-selected layer.\n\n## Selection\n\nClicking a target moves it to the selected layer with a FLIP animation.\nThe controller does not interfere with selected targets — it only manages\ntargets in the background layer. The layer-stack owns selection state.\n\n## CSS Custom Properties\n\n- `--obc-poi-controller-stack-top` (default `15%`) — vertical position of the stack\n- `--obc-poi-controller-stack-height` (default `50%`) — height of the stack\n- `--obc-poi-controller-stack-gap` (default `8px`) — gap between layers",
13646
13732
  "name": "ObcPoiController",
13647
13733
  "slots": [
13648
13734
  {
@@ -13710,6 +13796,24 @@
13710
13796
  },
13711
13797
  "default": "null"
13712
13798
  },
13799
+ {
13800
+ "kind": "field",
13801
+ "name": "xFilterCutoffHz",
13802
+ "type": {
13803
+ "text": "number | null"
13804
+ },
13805
+ "default": "null",
13806
+ "description": "Forwarded to every controller-owned target's `xFilterCutoffHz`; `null` leaves the targets on their default."
13807
+ },
13808
+ {
13809
+ "kind": "field",
13810
+ "name": "yFilterCutoffHz",
13811
+ "type": {
13812
+ "text": "number | null"
13813
+ },
13814
+ "default": "null",
13815
+ "description": "Forwarded to every controller-owned target's `yFilterCutoffHz`; `null` leaves the targets on their default."
13816
+ },
13713
13817
  {
13714
13818
  "kind": "field",
13715
13819
  "name": "mediaWidth",
@@ -13801,7 +13905,7 @@
13801
13905
  "kind": "field",
13802
13906
  "name": "controllerTargets",
13803
13907
  "privacy": "private",
13804
- "default": "new Map<string, ObcPoiData>()"
13908
+ "default": "new Map<string, PoiBase>()"
13805
13909
  },
13806
13910
  {
13807
13911
  "kind": "field",
@@ -13942,6 +14046,16 @@
13942
14046
  }
13943
14047
  }
13944
14048
  },
14049
+ {
14050
+ "kind": "method",
14051
+ "name": "computeCurrentProjection",
14052
+ "privacy": "private",
14053
+ "return": {
14054
+ "type": {
14055
+ "text": "MediaProjection | null"
14056
+ }
14057
+ }
14058
+ },
13945
14059
  {
13946
14060
  "kind": "method",
13947
14061
  "name": "mapDetection",
@@ -13957,6 +14071,13 @@
13957
14071
  "type": {
13958
14072
  "text": "PoiDetection"
13959
14073
  }
14074
+ },
14075
+ {
14076
+ "name": "projection",
14077
+ "default": "this.computeCurrentProjection()",
14078
+ "type": {
14079
+ "text": "MediaProjection | null"
14080
+ }
13960
14081
  }
13961
14082
  ]
13962
14083
  },
@@ -13983,6 +14104,22 @@
13983
14104
  }
13984
14105
  ],
13985
14106
  "exports": [
14107
+ {
14108
+ "kind": "js",
14109
+ "name": "POI_CONTROLLER_LAYER_ATTR",
14110
+ "declaration": {
14111
+ "name": "POI_CONTROLLER_LAYER_ATTR",
14112
+ "module": "src/ar/poi-controller/poi-controller.ts"
14113
+ }
14114
+ },
14115
+ {
14116
+ "kind": "js",
14117
+ "name": "POI_CONTROLLER_BACKGROUND_LAYER",
14118
+ "declaration": {
14119
+ "name": "POI_CONTROLLER_BACKGROUND_LAYER",
14120
+ "module": "src/ar/poi-controller/poi-controller.ts"
14121
+ }
14122
+ },
13986
14123
  {
13987
14124
  "kind": "js",
13988
14125
  "name": "ObcPoiController",
@@ -13999,7 +14136,7 @@
13999
14136
  "declarations": [
14000
14137
  {
14001
14138
  "kind": "class",
14002
- "description": "`<obc-poi-group>` - A POI cluster component that collapses overlapping targets into one trigger and expands them into a spread list.\n\nThis component wraps multiple `obc-poi-data` elements and manages their collapsed/expanded presentation as a single interactive unit.\nUse it when nearby targets should be presented as one grouped control until the user expands the group.\n\n### Features\n- Expand/collapse state: Controlled by `expand`; collapse animation state is exposed through `collapsing`.\n- Automatic wrapper sizing: Computes collapsed wrapper width/height from slotted target button bounds.\n- Front-target handling: Keeps one front target visually prioritized while collapsing other targets into overlap state.\n- Backdrop interaction: Shows a backdrop while expanded and collapses on backdrop click.\n- Dynamic ordering: `internalSwapping` enables reordering while expanded based on current horizontal positions.\n- Vertical placement: `positionVertical` sets the wrapper/group top offset used for collapsed positioning.\n\n### Usage Guidelines\n- Slot only `obc-poi-data` items that should behave as one grouped target set.\n- Control expand/collapse via the `expand` property, or let the built-in wrapper button toggle expansion.\n- Use the `expand` event detail to synchronize nearby standalone targets (for example, set outside targets to overlapped while this group is open).\n- Treat `collapsing` as component-managed runtime state unless you have a specific orchestration need.\n- **TODO(designer):** Confirm whether external consumers should set `collapsing` directly, or if it should remain fully internal.\n\n### Slots\n| Slot | Renders When... | Purpose |\n| --- | --- | --- |\n| default | Always | Contains grouped `obc-poi-data` targets managed by this component. |\n\n### Events\n- `expand` - Fired when expand state changes. Detail: `{ expand: boolean }`.\n- `collapse-finished` - Fired when the collapse animation has fully completed.\n\n### Best Practices\n- Keep grouped targets positioned consistently so wrapper bounds and front-target selection remain stable.\n- Prefer one `obc-poi-group` per overlap cluster rather than nesting groups.\n- Use `internalSwapping` only when live target crossing should reorder expanded items.\n\n### Example\n```html\n<obc-poi-group positionVertical=\"240px\">\n <obc-poi-data x=\"300\" button-y=\"240\" y=\"240\"></obc-poi-data>\n <obc-poi-data x=\"320\" button-y=\"240\" y=\"240\"></obc-poi-data>\n <obc-poi-data x=\"340\" button-y=\"240\" y=\"240\"></obc-poi-data>\n</obc-poi-group>\n```",
14139
+ "description": "`<obc-poi-group>` - A POI cluster component that collapses overlapping targets into one trigger and expands them into a spread list.\n\nThis component wraps multiple `obc-poi-data` elements and manages their collapsed/expanded presentation as a single interactive unit.\nUse it when nearby targets should be presented as one grouped control until the user expands the group.\n\n### Features\n- Expand/collapse state: Controlled by `expand`; collapse animation state is exposed through `collapsing`.\n- Automatic wrapper sizing: Computes collapsed wrapper width/height from slotted target button bounds.\n- Front-target handling: Keeps one front target visually prioritized while collapsing other targets into overlap state.\n- Backdrop interaction: Shows a backdrop while expanded and collapses on backdrop click.\n- Dynamic ordering: `internalSwapping` enables reordering while expanded based on current horizontal positions.\n- Vertical placement: `positionVertical` (attribute `position-vertical`) sets the wrapper/group top offset used for collapsed positioning.\n\n### Usage Guidelines\n- Slot only `obc-poi-data` items that should behave as one grouped target set.\n- Control expand/collapse via the `expand` property, or let the built-in wrapper button toggle expansion.\n- Use the `expand` event detail to synchronize nearby standalone targets (for example, set outside targets to overlapped while this group is open).\n- Treat `collapsing` as orchestration state: it is set by the group itself and by coordinating containers such as `obc-poi-layer-stack` during collapse animations. Do not set it directly.\n- `internalSwapping` is usually set via `obc-poi-layer`'s `internal-swapping` attribute, which forwards it to auto-created groups; set it directly only on manually managed groups.\n\n### Slots\n| Slot | Renders When... | Purpose |\n| --- | --- | --- |\n| default | Always | Contains grouped `obc-poi-data` targets managed by this component. |\n\n### Events\n- `expand` - Fired when expand state changes. Detail: `{ expand: boolean }`.\n- `collapse-finished` - Fired when the collapse animation has fully completed.\n- `obc-poi-group-target-released` - Fired after `releaseTarget()` returns a target to the group's parent context: re-parented for consumer-managed groups, re-assigned to the layer's main slot for layer-created auto groups. Detail: `{ target: Poi }`.\n\n### Best Practices\n- Keep grouped targets positioned consistently so wrapper bounds and front-target selection remain stable.\n- Prefer one `obc-poi-group` per overlap cluster rather than nesting groups.\n- Use `internalSwapping` only when live target crossing should reorder expanded items.\n\n### Example\n```html\n<obc-poi-group position-vertical=\"240px\">\n <obc-poi-data x=\"300\" button-y=\"240\" y=\"240\"></obc-poi-data>\n <obc-poi-data x=\"320\" button-y=\"240\" y=\"240\"></obc-poi-data>\n <obc-poi-data x=\"340\" button-y=\"240\" y=\"240\"></obc-poi-data>\n</obc-poi-group>\n```",
14003
14140
  "name": "ObcPoiGroup",
14004
14141
  "slots": [
14005
14142
  {
@@ -14022,7 +14159,8 @@
14022
14159
  "type": {
14023
14160
  "text": "boolean"
14024
14161
  },
14025
- "default": "false"
14162
+ "default": "false",
14163
+ "description": "Collapse-animation state. Set by the group itself and by coordinating containers such as `obc-poi-layer-stack` during collapse orchestration; do not set it directly."
14026
14164
  },
14027
14165
  {
14028
14166
  "kind": "field",
@@ -14038,7 +14176,8 @@
14038
14176
  "type": {
14039
14177
  "text": "boolean"
14040
14178
  },
14041
- "default": "false"
14179
+ "default": "false",
14180
+ "description": "Reorders expanded targets when their horizontal positions cross. Usually set via `obc-poi-layer`'s `internal-swapping` attribute, which forwards it to auto-created groups; set it directly only on manually managed groups."
14042
14181
  },
14043
14182
  {
14044
14183
  "kind": "field",
@@ -14240,6 +14379,49 @@
14240
14379
  "name": "onSlotChange",
14241
14380
  "privacy": "private"
14242
14381
  },
14382
+ {
14383
+ "kind": "method",
14384
+ "name": "isMember",
14385
+ "privacy": "private",
14386
+ "return": {
14387
+ "type": {
14388
+ "text": "boolean"
14389
+ }
14390
+ },
14391
+ "parameters": [
14392
+ {
14393
+ "name": "child",
14394
+ "type": {
14395
+ "text": "HTMLElement"
14396
+ }
14397
+ }
14398
+ ],
14399
+ "description": "Membership check that works for both light-DOM children (manual groups)\nand slot-assigned members (layer-created auto groups, where the member\nstays in the consumer's light DOM and is assigned into this group's\nmember slot)."
14400
+ },
14401
+ {
14402
+ "kind": "method",
14403
+ "name": "getMemberSlot",
14404
+ "privacy": "private",
14405
+ "return": {
14406
+ "type": {
14407
+ "text": "HTMLSlotElement | null"
14408
+ }
14409
+ }
14410
+ },
14411
+ {
14412
+ "kind": "method",
14413
+ "name": "bringChildToFront",
14414
+ "privacy": "private",
14415
+ "parameters": [
14416
+ {
14417
+ "name": "frontChild",
14418
+ "type": {
14419
+ "text": "Poi"
14420
+ }
14421
+ }
14422
+ ],
14423
+ "description": "Paint the front child on top. For light-DOM members this reorders the\nchildren; for slot-assigned members it re-assigns the member slot, which\nchanges flattened-tree order without touching the consumer's DOM."
14424
+ },
14243
14425
  {
14244
14426
  "kind": "method",
14245
14427
  "name": "ensureFrontChildOnTop",
@@ -14615,7 +14797,7 @@
14615
14797
  "type": {
14616
14798
  "text": "CustomEvent<{target: Poi}>"
14617
14799
  },
14618
- "description": "Fired after a target leaves the group and has been re-inserted before it in the parent. Bubbles and is composed."
14800
+ "description": "Fired after `releaseTarget()` returns a target to the group's parent context (re-parented for consumer-managed groups, re-assigned for auto groups) — immediately when the group is collapsed, or once the collapse animation completes. Bubbles and is composed."
14619
14801
  }
14620
14802
  ],
14621
14803
  "superclass": {
@@ -14642,7 +14824,7 @@
14642
14824
  "declarations": [
14643
14825
  {
14644
14826
  "kind": "class",
14645
- "description": "`<obc-poi-layer-stack>` coordinates multiple POI layers and manages\nselection behavior across stacked layers.\n\nUse `selection-mode` to control whether targets can be selected across the\nstack (`none`, `single`, or `multi`).\n\n### Slots\n- Default slot for `obc-poi-layer` elements that participate in the stack.\n\n### Example\n```html\n<obc-poi-layer-stack selection-mode=\"single\">\n <obc-poi-layer label=\"Radar\" .isSelected=${true}></obc-poi-layer>\n <obc-poi-layer label=\"AIS\"></obc-poi-layer>\n</obc-poi-layer-stack>\n```",
14827
+ "description": "`<obc-poi-layer-stack>` coordinates multiple POI layers and manages\nselection behavior across stacked layers.\n\nUse `selection-mode` to control whether targets can be selected across the\nstack (`none`, `single`, or `multi`).\n\n### Required Setup\n1. Place the stack in `obc-poi-controller`'s `slot=\"stack\"`, or manage the\n stack's height and media geometry yourself.\n2. Give exactly one child `obc-poi-layer` the `is-selected` attribute — the\n stack projects selected targets' buttons into it and resets all\n selection state if no selected layer exists.\n3. Mark the background/default layer with\n `data-controller-layer=\"background\"` when the stack is used inside\n `obc-poi-controller`.\n4. Set `--obc-poi-layer-min-height` on layers that can start empty, so they\n do not collapse to 0px height.\n\n### DOM Ownership\nThe stack never moves, creates, or removes consumer-owned DOM. Selection is\nrendered by projecting the target's button into the selected layer via CSS\ncustom properties (`--obc-poi-button-projection-y` /\n`--obc-poi-target-projection-y`); the target element stays where the\nconsumer put it. Declarative renderers (React, Vue, Lit) can manage POI\nchildren as ordinary framework-owned elements.\n\n### Selection API\nSelection state is fully reachable without DOM inspection:\n- `selectedTargets` — the currently selected POI targets.\n- `selectTarget(target, {selectionId?})` — select programmatically;\n `selectionId` presets the stack-managed badge id.\n- `deselectTarget(target)` / `clearSelection()` — deselect one/all.\n- `selection-change` event — fired on every selection mutation\n (user click, programmatic call, or bootstrap seeding) with\n `{selected, added, removed}` in `detail`.\n\n### Slots\n- Default slot for `obc-poi-layer` elements that participate in the stack.\n\n### Example\n```html\n<obc-poi-layer-stack selection-mode=\"single\">\n <obc-poi-layer label=\"Radar\" .isSelected=${true}></obc-poi-layer>\n <obc-poi-layer label=\"AIS\"></obc-poi-layer>\n</obc-poi-layer-stack>\n```",
14646
14828
  "name": "ObcPoiLayerStack",
14647
14829
  "slots": [
14648
14830
  {
@@ -14704,7 +14886,14 @@
14704
14886
  "kind": "field",
14705
14887
  "name": "selectionMap",
14706
14888
  "privacy": "private",
14707
- "default": "new Map< Poi, { originLayer: ObcPoiLayer; previousAnimatePosition: boolean; keepInSelectedLayer: boolean; } >()"
14889
+ "default": "new Map<Poi, SelectionRecord>()"
14890
+ },
14891
+ {
14892
+ "kind": "field",
14893
+ "name": "displacedTargets",
14894
+ "privacy": "private",
14895
+ "default": "new Map<Poi, SelectionRecord>()",
14896
+ "description": "Deselected targets that live in one layer but render in another (targets\nauthored inside the selected layer whose logical origin is a different\nlayer). Their projections are refreshed on every placement pass so layer\nresizes do not leave stale pixel offsets."
14708
14897
  },
14709
14898
  {
14710
14899
  "kind": "field",
@@ -14749,6 +14938,112 @@
14749
14938
  }
14750
14939
  ]
14751
14940
  },
14941
+ {
14942
+ "kind": "field",
14943
+ "name": "selectedTargets",
14944
+ "type": {
14945
+ "text": "Poi[]"
14946
+ },
14947
+ "description": "Currently selected POI targets.",
14948
+ "readonly": true
14949
+ },
14950
+ {
14951
+ "kind": "method",
14952
+ "name": "selectTarget",
14953
+ "return": {
14954
+ "type": {
14955
+ "text": "boolean"
14956
+ }
14957
+ },
14958
+ "parameters": [
14959
+ {
14960
+ "name": "target",
14961
+ "type": {
14962
+ "text": "Poi"
14963
+ }
14964
+ },
14965
+ {
14966
+ "name": "options",
14967
+ "optional": true,
14968
+ "type": {
14969
+ "text": "{selectionId?: string}"
14970
+ }
14971
+ }
14972
+ ],
14973
+ "description": "Programmatically select a target, following the same flow as a user\nclick. `options.selectionId` presets the badge id shown in the\nstack-managed header; without it the id auto-increments. Returns\n`false` when selection is disabled, the target is mid-transition or\nalready selected, or no layer can host the selection."
14974
+ },
14975
+ {
14976
+ "kind": "method",
14977
+ "name": "deselectTarget",
14978
+ "return": {
14979
+ "type": {
14980
+ "text": "boolean"
14981
+ }
14982
+ },
14983
+ "parameters": [
14984
+ {
14985
+ "name": "target",
14986
+ "type": {
14987
+ "text": "Poi"
14988
+ }
14989
+ }
14990
+ ],
14991
+ "description": "Programmatically deselect a target. Returns `false` when it is not\nselected."
14992
+ },
14993
+ {
14994
+ "kind": "method",
14995
+ "name": "clearSelection",
14996
+ "return": {
14997
+ "type": {
14998
+ "text": "void"
14999
+ }
15000
+ },
15001
+ "description": "Deselect all targets."
15002
+ },
15003
+ {
15004
+ "kind": "method",
15005
+ "name": "performSelection",
15006
+ "privacy": "private",
15007
+ "return": {
15008
+ "type": {
15009
+ "text": "boolean"
15010
+ }
15011
+ },
15012
+ "parameters": [
15013
+ {
15014
+ "name": "target",
15015
+ "type": {
15016
+ "text": "Poi"
15017
+ }
15018
+ },
15019
+ {
15020
+ "name": "selectionId",
15021
+ "optional": true,
15022
+ "type": {
15023
+ "text": "string"
15024
+ }
15025
+ }
15026
+ ]
15027
+ },
15028
+ {
15029
+ "kind": "method",
15030
+ "name": "dispatchSelectionChange",
15031
+ "privacy": "private",
15032
+ "parameters": [
15033
+ {
15034
+ "name": "added",
15035
+ "type": {
15036
+ "text": "Poi | null"
15037
+ }
15038
+ },
15039
+ {
15040
+ "name": "removed",
15041
+ "type": {
15042
+ "text": "Poi | null"
15043
+ }
15044
+ }
15045
+ ]
15046
+ },
14752
15047
  {
14753
15048
  "kind": "method",
14754
15049
  "name": "getPoiTargetFromEvent",
@@ -14998,7 +15293,7 @@
14998
15293
  },
14999
15294
  {
15000
15295
  "kind": "method",
15001
- "name": "getTargetButtonProjectionOffset",
15296
+ "name": "getInlineVarPx",
15002
15297
  "privacy": "private",
15003
15298
  "return": {
15004
15299
  "type": {
@@ -15011,12 +15306,18 @@
15011
15306
  "type": {
15012
15307
  "text": "Poi"
15013
15308
  }
15309
+ },
15310
+ {
15311
+ "name": "name",
15312
+ "type": {
15313
+ "text": "string"
15314
+ }
15014
15315
  }
15015
15316
  ]
15016
15317
  },
15017
15318
  {
15018
15319
  "kind": "method",
15019
- "name": "getLayerProjectionOffset",
15320
+ "name": "layerBottomDelta",
15020
15321
  "privacy": "private",
15021
15322
  "return": {
15022
15323
  "type": {
@@ -15025,43 +15326,96 @@
15025
15326
  },
15026
15327
  "parameters": [
15027
15328
  {
15028
- "name": "originLayer",
15329
+ "name": "from",
15029
15330
  "type": {
15030
15331
  "text": "ObcPoiLayer"
15031
15332
  }
15032
15333
  },
15033
15334
  {
15034
- "name": "destinationLayer",
15335
+ "name": "to",
15035
15336
  "type": {
15036
- "text": "ObcPoiLayer | null"
15337
+ "text": "ObcPoiLayer"
15037
15338
  }
15038
15339
  }
15039
- ]
15340
+ ],
15341
+ "description": "Pixel delta between two layers' bottom edges (`to.bottom - from.bottom`)."
15040
15342
  },
15041
15343
  {
15042
15344
  "kind": "method",
15043
- "name": "getTargetProjectionOffset",
15345
+ "name": "setProjectionVar",
15044
15346
  "privacy": "private",
15045
- "return": {
15046
- "type": {
15047
- "text": "number"
15048
- }
15049
- },
15050
15347
  "parameters": [
15051
15348
  {
15052
- "name": "originLayer",
15349
+ "name": "target",
15053
15350
  "type": {
15054
- "text": "ObcPoiLayer"
15351
+ "text": "Poi"
15055
15352
  }
15056
15353
  },
15057
15354
  {
15058
- "name": "selectedLayer",
15355
+ "name": "name",
15059
15356
  "type": {
15060
- "text": "ObcPoiLayer | null"
15357
+ "text": "string"
15358
+ }
15359
+ },
15360
+ {
15361
+ "name": "valuePx",
15362
+ "type": {
15363
+ "text": "number"
15061
15364
  }
15062
15365
  }
15063
15366
  ]
15064
15367
  },
15368
+ {
15369
+ "kind": "method",
15370
+ "name": "applyTargetProjection",
15371
+ "privacy": "private",
15372
+ "parameters": [
15373
+ {
15374
+ "name": "target",
15375
+ "type": {
15376
+ "text": "Poi"
15377
+ }
15378
+ },
15379
+ {
15380
+ "name": "buttonOffsetPx",
15381
+ "type": {
15382
+ "text": "number"
15383
+ }
15384
+ },
15385
+ {
15386
+ "name": "targetOffsetPx",
15387
+ "type": {
15388
+ "text": "number"
15389
+ }
15390
+ },
15391
+ {
15392
+ "name": "animate",
15393
+ "type": {
15394
+ "text": "boolean"
15395
+ }
15396
+ }
15397
+ ],
15398
+ "description": "Render the target at the given projection offsets without touching its\nDOM position. When `animate` is set and an offset actually changes, the\njump is FLIP-animated via the Web Animations API."
15399
+ },
15400
+ {
15401
+ "kind": "method",
15402
+ "name": "getContainingGroup",
15403
+ "privacy": "private",
15404
+ "return": {
15405
+ "type": {
15406
+ "text": "ObcPoiGroup | null"
15407
+ }
15408
+ },
15409
+ "parameters": [
15410
+ {
15411
+ "name": "target",
15412
+ "type": {
15413
+ "text": "Poi"
15414
+ }
15415
+ }
15416
+ ],
15417
+ "description": "The group a target currently belongs to — a light-DOM parent for\nconsumer-managed groups, or the shadow group whose member slot the\ntarget is assigned to for layer-created auto groups."
15418
+ },
15065
15419
  {
15066
15420
  "kind": "method",
15067
15421
  "name": "detachTargetFromCurrentGroup",
@@ -15156,95 +15510,6 @@
15156
15510
  ],
15157
15511
  "description": "Animate a layer jump using Web Animations API.\nfill:'forwards' overrides ALL CSS/Lit styles during animation.\nAfter cancel(), Lit's final-state styles take over."
15158
15512
  },
15159
- {
15160
- "kind": "method",
15161
- "name": "moveTargetIntoSelectedLayer",
15162
- "privacy": "private",
15163
- "parameters": [
15164
- {
15165
- "name": "target",
15166
- "type": {
15167
- "text": "Poi"
15168
- }
15169
- },
15170
- {
15171
- "name": "_originLayer",
15172
- "type": {
15173
- "text": "ObcPoiLayer"
15174
- }
15175
- },
15176
- {
15177
- "name": "selectedLayer",
15178
- "type": {
15179
- "text": "ObcPoiLayer"
15180
- }
15181
- },
15182
- {
15183
- "name": "animate",
15184
- "default": "true"
15185
- }
15186
- ]
15187
- },
15188
- {
15189
- "kind": "method",
15190
- "name": "moveTrackedTargetToSelectedLayer",
15191
- "privacy": "private",
15192
- "parameters": [
15193
- {
15194
- "name": "target",
15195
- "type": {
15196
- "text": "Poi"
15197
- }
15198
- },
15199
- {
15200
- "name": "record",
15201
- "type": {
15202
- "text": "{\n originLayer: ObcPoiLayer;\n previousAnimatePosition: boolean;\n keepInSelectedLayer: boolean;\n }"
15203
- }
15204
- },
15205
- {
15206
- "name": "selectedLayer",
15207
- "type": {
15208
- "text": "ObcPoiLayer"
15209
- }
15210
- },
15211
- {
15212
- "name": "animateProjection",
15213
- "type": {
15214
- "text": "boolean"
15215
- }
15216
- }
15217
- ]
15218
- },
15219
- {
15220
- "kind": "method",
15221
- "name": "syncTargetProjection",
15222
- "privacy": "private",
15223
- "parameters": [
15224
- {
15225
- "name": "target",
15226
- "type": {
15227
- "text": "Poi"
15228
- }
15229
- },
15230
- {
15231
- "name": "originLayer",
15232
- "type": {
15233
- "text": "ObcPoiLayer"
15234
- }
15235
- },
15236
- {
15237
- "name": "selectedLayer",
15238
- "type": {
15239
- "text": "ObcPoiLayer | null"
15240
- }
15241
- },
15242
- {
15243
- "name": "animate",
15244
- "default": "true"
15245
- }
15246
- ]
15247
- },
15248
15513
  {
15249
15514
  "kind": "method",
15250
15515
  "name": "animateTargetReturnToOrigin",
@@ -15259,7 +15524,7 @@
15259
15524
  {
15260
15525
  "name": "record",
15261
15526
  "type": {
15262
- "text": "{\n originLayer: ObcPoiLayer;\n previousAnimatePosition: boolean;\n keepInSelectedLayer: boolean;\n }"
15527
+ "text": "SelectionRecord"
15263
15528
  }
15264
15529
  }
15265
15530
  ]
@@ -15283,29 +15548,6 @@
15283
15548
  }
15284
15549
  ]
15285
15550
  },
15286
- {
15287
- "kind": "method",
15288
- "name": "trackSelectionTarget",
15289
- "privacy": "private",
15290
- "parameters": [
15291
- {
15292
- "name": "target",
15293
- "type": {
15294
- "text": "Poi"
15295
- }
15296
- },
15297
- {
15298
- "name": "originLayer",
15299
- "type": {
15300
- "text": "ObcPoiLayer"
15301
- }
15302
- },
15303
- {
15304
- "name": "keepInSelectedLayer",
15305
- "default": "true"
15306
- }
15307
- ]
15308
- },
15309
15551
  {
15310
15552
  "kind": "method",
15311
15553
  "name": "activateTrackedTarget",
@@ -15320,7 +15562,7 @@
15320
15562
  {
15321
15563
  "name": "record",
15322
15564
  "type": {
15323
- "text": "{\n originLayer: ObcPoiLayer;\n previousAnimatePosition: boolean;\n keepInSelectedLayer: boolean;\n }"
15565
+ "text": "SelectionRecord"
15324
15566
  }
15325
15567
  },
15326
15568
  {
@@ -15368,7 +15610,7 @@
15368
15610
  "name": "record",
15369
15611
  "optional": true,
15370
15612
  "type": {
15371
- "text": "{\n originLayer: ObcPoiLayer;\n previousAnimatePosition: boolean;\n keepInSelectedLayer: boolean;\n }"
15613
+ "text": "SelectionRecord"
15372
15614
  }
15373
15615
  }
15374
15616
  ]
@@ -15419,6 +15661,12 @@
15419
15661
  "name": "syncSelectedLayerTargets",
15420
15662
  "privacy": "private"
15421
15663
  },
15664
+ {
15665
+ "kind": "method",
15666
+ "name": "refreshDisplacedTargets",
15667
+ "privacy": "private",
15668
+ "description": "Keep deselected targets that render outside their DOM layer (targets\nauthored in the selected layer whose logical origin is another layer)\nprojected at up-to-date offsets across layer resizes."
15669
+ },
15422
15670
  {
15423
15671
  "kind": "method",
15424
15672
  "name": "render"
@@ -15429,6 +15677,15 @@
15429
15677
  "static": true
15430
15678
  }
15431
15679
  ],
15680
+ "events": [
15681
+ {
15682
+ "name": "selection-change",
15683
+ "type": {
15684
+ "text": "CustomEvent<{selected: Poi[]; added: Poi | null; removed: Poi | null}>"
15685
+ },
15686
+ "description": "Fired whenever the selection set changes (user click, programmatic call, or bootstrap seeding). Bubbles and is composed."
15687
+ }
15688
+ ],
15432
15689
  "superclass": {
15433
15690
  "name": "LitElement",
15434
15691
  "package": "lit"
@@ -15453,7 +15710,7 @@
15453
15710
  "declarations": [
15454
15711
  {
15455
15712
  "kind": "class",
15456
- "description": "`<obc-poi-layer>` - A POI layout container that resolves overlapping targets by grouping or crossing strategies.\n\nThis component watches slotted POI targets, applies overlap state/visual rules, and coordinates automatic `obc-poi-group` creation when needed.\nUse it as the main layer container when you want centralized overlap behavior plus layer height updates for parent layout systems.\n\n### Features\n- Overlap strategies: `overlapMode=\"grouping\"` builds overlap clusters; `overlapMode=\"crossing\"` continuously adjusts horizontal offsets to reduce crossings.\n- Auto-group lifecycle: Creates/removes auto groups and preserves front/behind/pre-group states during transitions.\n- Manual group support: Respects existing `obc-poi-group` elements and can optionally join nearby targets while a group is expanded (`joinWhileExpanded`).\n- Dynamic observation: Reacts to slot changes, target style/position mutations, and target size changes to recompute grouping and layer height.\n- Layer diagnostics: `debug` shows a label overlay using `label`.\n- Selection flag: `isSelected` reflects to attribute but has no direct runtime layout logic in this class.\n- Group ordering option: `internalSwapping` is forwarded to groups to allow expanded ordering updates based on movement.\n\n### Usage Guidelines\n- Place `obc-poi-data` targets (and optional `obc-poi-group`) in the default slot.\n- Choose `overlapMode` based on behavior:\n - `grouping`: best when overlaps should collapse into expandable clusters.\n - `crossing`: best when targets stay independent but should separate horizontally.\n- Listen for `layer-resize` to keep parent containers in sync with computed layer height.\n- Enable `joinWhileExpanded` only when targets should be able to join an already expanded auto-group.\n- **TODO(designer):** Confirm intended user-visible behavior for `isSelected`, since it currently reflects an attribute but is not consumed by the layer logic here.\n\n### Slots\n| Slot | Renders When... | Purpose |\n| --- | --- | --- |\n| default | Always | Hosts POI targets (`obc-poi-data*`) and optional manual `obc-poi-group` elements. |\n\n### Events\n- `layer-resize` - Fired when computed layer height changes. Detail: `{ height: number, label: string }`.\n\n### Best Practices\n- Keep POI targets as direct descendants when possible to reduce grouping ambiguity.\n- Use stable `x`/`y` updates for animated scenarios so grouping and crossing calculations remain predictable.\n- Avoid adding non-POI interactive wrappers inside the layer unless needed, as layer observers track POI-related descendants.\n\n### Example\n```html\n<obc-poi-layer label=\"Targets\" overlapMode=\"grouping\" debug>\n <obc-poi-data x=\"180\" y=\"110\"></obc-poi-data>\n <obc-poi-data x=\"205\" y=\"90\"></obc-poi-data>\n <obc-poi-data x=\"230\" y=\"100\"></obc-poi-data>\n</obc-poi-layer>\n```",
15713
+ "description": "`<obc-poi-layer>` - A POI layout container that resolves overlapping targets by grouping or crossing strategies.\n\nThis component watches slotted POI targets, applies overlap state/visual rules, and coordinates automatic `obc-poi-group` creation when needed.\nUse it as the main layer container when you want centralized overlap behavior plus layer height updates for parent layout systems.\n\n### Features\n- Overlap strategies: `overlapMode=\"grouping\"` builds overlap clusters; `overlapMode=\"crossing\"` continuously adjusts horizontal offsets to reduce crossings.\n- Auto-group lifecycle: Creates/removes auto groups as shadow-internal chrome — the consumer's light DOM is never modified; members are placed via manual slot assignment. Reach the group elements through the `autoGroups` accessor.\n- Manual group support: Respects existing `obc-poi-group` elements and can optionally join nearby targets while a group is expanded (`joinWhileExpanded`).\n- Dynamic observation: Reacts to slot changes, target style/position mutations, and target size changes to recompute grouping and layer height.\n- Layer diagnostics: `debug` shows a label overlay using `label`.\n- Selection flag: `isSelected` reflects to attribute but has no direct runtime layout logic in this class.\n- Group ordering option: `internalSwapping` is forwarded to groups to allow expanded ordering updates based on movement.\n\n### Usage Guidelines\n- Place `obc-poi-data` targets (and optional `obc-poi-group`) in the default slot.\n- Choose `overlapMode` based on behavior:\n - `grouping`: best when overlaps should collapse into expandable clusters.\n - `crossing`: best when targets stay independent but should separate horizontally.\n- Handle `layer-resize` only when using the layer standalone; inside `obc-poi-layer-stack` / `obc-poi-controller` the container handles height syncing. Example: `layer.addEventListener('layer-resize', (e) => { host.style.height = e.detail.height + 'px'; })`.\n- After imperatively adding, removing, or moving POI children outside the layer's own observers, call the public `requestGroupingUpdate()` method to force a recompute; it is the supported hook for imperative DOM mutations.\n- Set `--obc-poi-layer-min-height` when the layer starts empty, otherwise the layer collapses to 0px height until targets exist.\n- Enable `joinWhileExpanded` only when targets should be able to join an already expanded auto-group.\n- **TODO(designer):** Confirm intended user-visible behavior for `isSelected`, since it has no runtime layout logic in this class — it only reflects the attribute and notifies containers via `layer-selection-changed` (consumed by `obc-poi-layer-stack` to pick the selected layer).\n\n### Slots\n| Slot | Renders When... | Purpose |\n| --- | --- | --- |\n| default | Always | Hosts POI targets (`obc-poi-data*`) and optional manual `obc-poi-group` elements. |\n\n### Events\n- `layer-resize` - Fired when computed layer height changes. Detail: `{ height: number, label: string }`.\n- `grouping-change` - Fired when grouping membership or front/behind/pre-group state changes. Detail: `{ clusters: Poi[][], front: Poi[], behind: Poi[], pregrouped: Poi[] }`. Subscribe to this instead of observing the layer's internal `data-*` attributes.\n\n### CSS Custom Properties\n| Property | Default | Purpose |\n| --- | --- | --- |\n| `--obc-poi-layer-overlap-enter` | `10px` | Max horizontal gap at which ungrouped targets start grouping. |\n| `--obc-poi-layer-overlap-exit` | `18px` | Gap at which grouped targets leave their group. Clamped to at least the enter threshold; keep it larger than enter so jittery positions do not oscillate in and out of groups. |\n| `--obc-poi-layer-overlap-pre` | `16px` | Gap at which targets get the pre-grouped visual state. |\n| `--obc-poi-layer-overlap-behind` | `10px` | Gap at which the shortest target gets the behind visual state. |\n| `--obc-poi-layer-exit-delay-ms` | `140` | Delay before exiting targets lose their exit visual state. |\n| `--obc-poi-layer-group-removal-delay-ms` | `250` | Delay before a dissolved auto-group element is removed. |\n| `--obc-poi-layer-exit-lock-duration-ms` | `500` | Duration a target is locked out of pre-group/behind states after leaving a group. |\n\n### Best Practices\n- Keep POI targets as direct descendants when possible to reduce grouping ambiguity.\n- Targets may update `x`/`y` every animation frame; grouping stays stable as long as the horizontal gap between targets does not oscillate across the enter/exit band faster than the group lifecycle delays (~0.5s). Smooth noisy input coordinates or widen the enter/exit band to compensate.\n- Avoid adding non-POI interactive wrappers inside the layer unless needed, as layer observers track POI-related descendants.\n\n### Example\n```html\n<obc-poi-layer label=\"Targets\" overlapMode=\"grouping\" debug>\n <obc-poi-data x=\"180\" y=\"110\"></obc-poi-data>\n <obc-poi-data x=\"205\" y=\"90\"></obc-poi-data>\n <obc-poi-data x=\"230\" y=\"100\"></obc-poi-data>\n</obc-poi-layer>\n```",
15457
15714
  "name": "ObcPoiLayer",
15458
15715
  "slots": [
15459
15716
  {
@@ -15462,6 +15719,16 @@
15462
15719
  }
15463
15720
  ],
15464
15721
  "members": [
15722
+ {
15723
+ "kind": "field",
15724
+ "name": "shadowRootOptions",
15725
+ "type": {
15726
+ "text": "ShadowRootInit"
15727
+ },
15728
+ "static": true,
15729
+ "default": "{ ...LitElement.shadowRootOptions, slotAssignment: 'manual', }",
15730
+ "description": "Manual slot assignment lets the layer place consumer-owned targets into\nshadow-internal auto-group chrome (and back) without ever re-parenting\nthem: grouping only changes which internal slot a target is assigned to."
15731
+ },
15465
15732
  {
15466
15733
  "kind": "field",
15467
15734
  "name": "label",
@@ -15551,6 +15818,30 @@
15551
15818
  "privacy": "private",
15552
15819
  "default": "false"
15553
15820
  },
15821
+ {
15822
+ "kind": "field",
15823
+ "name": "lastGroupingSignature",
15824
+ "type": {
15825
+ "text": "string"
15826
+ },
15827
+ "privacy": "private",
15828
+ "default": "''"
15829
+ },
15830
+ {
15831
+ "kind": "field",
15832
+ "name": "groupingIds",
15833
+ "privacy": "private",
15834
+ "default": "new WeakMap<Poi, number>()"
15835
+ },
15836
+ {
15837
+ "kind": "field",
15838
+ "name": "nextGroupingId",
15839
+ "type": {
15840
+ "text": "number"
15841
+ },
15842
+ "privacy": "private",
15843
+ "default": "1"
15844
+ },
15554
15845
  {
15555
15846
  "kind": "field",
15556
15847
  "name": "targetObservers",
@@ -15840,6 +16131,98 @@
15840
16131
  "name": "requestGroupingUpdate",
15841
16132
  "privacy": "public"
15842
16133
  },
16134
+ {
16135
+ "kind": "method",
16136
+ "name": "getMainSlot",
16137
+ "privacy": "private",
16138
+ "return": {
16139
+ "type": {
16140
+ "text": "HTMLSlotElement | null"
16141
+ }
16142
+ }
16143
+ },
16144
+ {
16145
+ "kind": "method",
16146
+ "name": "syncSlotAssignments",
16147
+ "privacy": "private",
16148
+ "description": "Assign every light-DOM child that is not currently placed in an\nauto-group member slot to the main slot. With `slotAssignment: 'manual'`\nnothing renders unless explicitly assigned, so this runs after render,\non child-list mutations, and after every grouping change."
16149
+ },
16150
+ {
16151
+ "kind": "field",
16152
+ "name": "autoGroups",
16153
+ "type": {
16154
+ "text": "HTMLElement[]"
16155
+ },
16156
+ "privacy": "public",
16157
+ "description": "The auto-created `obc-poi-group` elements currently managed by this\nlayer. Auto groups are shadow-internal chrome (they never appear in the\nconsumer's light DOM); use this accessor — typically after a\n`grouping-change` event — to reach them, e.g. to expand a group\nprogrammatically.",
16158
+ "readonly": true
16159
+ },
16160
+ {
16161
+ "kind": "method",
16162
+ "name": "getAutoGroups",
16163
+ "privacy": "private",
16164
+ "return": {
16165
+ "type": {
16166
+ "text": "PoiButtonGroupElement[]"
16167
+ }
16168
+ }
16169
+ },
16170
+ {
16171
+ "kind": "method",
16172
+ "name": "getAutoGroupMemberSlot",
16173
+ "privacy": "private",
16174
+ "return": {
16175
+ "type": {
16176
+ "text": "HTMLSlotElement | null"
16177
+ }
16178
+ },
16179
+ "parameters": [
16180
+ {
16181
+ "name": "group",
16182
+ "type": {
16183
+ "text": "HTMLElement"
16184
+ }
16185
+ }
16186
+ ]
16187
+ },
16188
+ {
16189
+ "kind": "method",
16190
+ "name": "getAutoGroupOf",
16191
+ "privacy": "private",
16192
+ "return": {
16193
+ "type": {
16194
+ "text": "HTMLElement | null"
16195
+ }
16196
+ },
16197
+ "parameters": [
16198
+ {
16199
+ "name": "target",
16200
+ "type": {
16201
+ "text": "Poi"
16202
+ }
16203
+ }
16204
+ ],
16205
+ "description": "The auto group a target is currently assigned into, if any."
16206
+ },
16207
+ {
16208
+ "kind": "method",
16209
+ "name": "getGroupMembers",
16210
+ "privacy": "private",
16211
+ "return": {
16212
+ "type": {
16213
+ "text": "Poi[]"
16214
+ }
16215
+ },
16216
+ "parameters": [
16217
+ {
16218
+ "name": "group",
16219
+ "type": {
16220
+ "text": "ParentNode"
16221
+ }
16222
+ }
16223
+ ],
16224
+ "description": "Members of a group in either mode: slot-assigned (shadow auto groups) or\nlight-DOM children (consumer-managed manual groups)."
16225
+ },
15843
16226
  {
15844
16227
  "kind": "method",
15845
16228
  "name": "scheduleGrouping",
@@ -15860,6 +16243,55 @@
15860
16243
  }
15861
16244
  }
15862
16245
  },
16246
+ {
16247
+ "kind": "method",
16248
+ "name": "getGroupingId",
16249
+ "privacy": "private",
16250
+ "return": {
16251
+ "type": {
16252
+ "text": "number"
16253
+ }
16254
+ },
16255
+ "parameters": [
16256
+ {
16257
+ "name": "target",
16258
+ "type": {
16259
+ "text": "Poi"
16260
+ }
16261
+ }
16262
+ ]
16263
+ },
16264
+ {
16265
+ "kind": "method",
16266
+ "name": "notifyGroupingChange",
16267
+ "privacy": "private",
16268
+ "parameters": [
16269
+ {
16270
+ "name": "clusters",
16271
+ "type": {
16272
+ "text": "Poi[][]"
16273
+ }
16274
+ },
16275
+ {
16276
+ "name": "frontTargets",
16277
+ "type": {
16278
+ "text": "Set<Poi>"
16279
+ }
16280
+ },
16281
+ {
16282
+ "name": "behindTargets",
16283
+ "type": {
16284
+ "text": "Set<Poi>"
16285
+ }
16286
+ },
16287
+ {
16288
+ "name": "preGrouped",
16289
+ "type": {
16290
+ "text": "Set<Poi>"
16291
+ }
16292
+ }
16293
+ ]
16294
+ },
15863
16295
  {
15864
16296
  "kind": "method",
15865
16297
  "name": "toggleGroupLayerHook",
@@ -15888,6 +16320,11 @@
15888
16320
  "kind": "method",
15889
16321
  "name": "tryJoinExpandedGroup",
15890
16322
  "privacy": "private",
16323
+ "return": {
16324
+ "type": {
16325
+ "text": "Poi | null"
16326
+ }
16327
+ },
15891
16328
  "parameters": [
15892
16329
  {
15893
16330
  "name": "group",
@@ -16217,6 +16654,10 @@
16217
16654
  }
16218
16655
  ]
16219
16656
  },
16657
+ {
16658
+ "kind": "method",
16659
+ "name": "render"
16660
+ },
16220
16661
  {
16221
16662
  "kind": "method",
16222
16663
  "name": "updated",
@@ -16235,10 +16676,6 @@
16235
16676
  }
16236
16677
  ]
16237
16678
  },
16238
- {
16239
- "kind": "method",
16240
- "name": "render"
16241
- },
16242
16679
  {
16243
16680
  "kind": "field",
16244
16681
  "name": "styles",
@@ -16253,6 +16690,13 @@
16253
16690
  },
16254
16691
  "description": "Fired when the layer height changes."
16255
16692
  },
16693
+ {
16694
+ "name": "grouping-change",
16695
+ "type": {
16696
+ "text": "CustomEvent<{clusters:Poi[][],front:Poi[],behind:Poi[],pregrouped:Poi[]}>"
16697
+ },
16698
+ "description": "Fired when grouping membership or overlap state changes. Bubbles and is composed."
16699
+ },
16256
16700
  {
16257
16701
  "name": "layer-selection-changed",
16258
16702
  "type": {
@@ -16922,7 +17366,7 @@
16922
17366
  "declarations": [
16923
17367
  {
16924
17368
  "kind": "class",
16925
- "description": "`<obc-poi-aton>` - AtoN marker variant with layout positioning and layer integration.\n\nExtends `PoiBase` to provide the \"aton\" variant of the POI system.\nRenders `<obc-poi>` with a slotted `<obc-poi-button-aton>`.",
17369
+ "description": "`<obc-poi-aton>` - AtoN marker variant with layout positioning and layer integration.\n\nExtends `PoiBase` to provide the \"aton\" variant of the POI system.\nRenders `<obc-poi>` with a slotted `<obc-poi-button-aton>`.\nSee the \"Coordinate Model\" section in `PoiBase` (poi-base.ts) for how `x`, `y`, and `buttonY` position the marker.",
16926
17370
  "name": "ObcPoiAton",
16927
17371
  "slots": [
16928
17372
  {
@@ -17210,10 +17654,7 @@
17210
17654
  {
17211
17655
  "kind": "field",
17212
17656
  "name": "y",
17213
- "type": {
17214
- "text": "number"
17215
- },
17216
- "default": "192",
17657
+ "default": "DEFAULT_LINE_LENGTH_PX",
17217
17658
  "inheritedFrom": {
17218
17659
  "name": "PoiBase",
17219
17660
  "module": "src/ar/poi/poi-base.ts"
@@ -17231,6 +17672,32 @@
17231
17672
  "module": "src/ar/poi/poi-base.ts"
17232
17673
  }
17233
17674
  },
17675
+ {
17676
+ "kind": "field",
17677
+ "name": "xFilterCutoffHz",
17678
+ "default": "16",
17679
+ "description": "Cutoff frequency (Hz) of the built-in low-pass filter applied to `x`. Lower values smooth noisy input more aggressively; `0` or a negative value disables filtering so `x` is applied directly.",
17680
+ "type": {
17681
+ "text": "number"
17682
+ },
17683
+ "inheritedFrom": {
17684
+ "name": "PoiBase",
17685
+ "module": "src/ar/poi/poi-base.ts"
17686
+ }
17687
+ },
17688
+ {
17689
+ "kind": "field",
17690
+ "name": "yFilterCutoffHz",
17691
+ "default": "16",
17692
+ "description": "Cutoff frequency (Hz) of the built-in low-pass filter applied to `y`. Lower values smooth noisy input more aggressively; `0` or a negative value disables filtering so `y` is applied directly.",
17693
+ "type": {
17694
+ "text": "number"
17695
+ },
17696
+ "inheritedFrom": {
17697
+ "name": "PoiBase",
17698
+ "module": "src/ar/poi/poi-base.ts"
17699
+ }
17700
+ },
17234
17701
  {
17235
17702
  "kind": "field",
17236
17703
  "name": "fixedTarget",
@@ -17372,28 +17839,154 @@
17372
17839
  "text": "number"
17373
17840
  },
17374
17841
  "privacy": "private",
17375
- "default": "0",
17842
+ "default": "0",
17843
+ "inheritedFrom": {
17844
+ "name": "PoiBase",
17845
+ "module": "src/ar/poi/poi-base.ts"
17846
+ }
17847
+ },
17848
+ {
17849
+ "kind": "field",
17850
+ "name": "xMovingHintTimeout",
17851
+ "type": {
17852
+ "text": "number | null"
17853
+ },
17854
+ "privacy": "private",
17855
+ "default": "null",
17856
+ "inheritedFrom": {
17857
+ "name": "PoiBase",
17858
+ "module": "src/ar/poi/poi-base.ts"
17859
+ }
17860
+ },
17861
+ {
17862
+ "kind": "field",
17863
+ "name": "resolvedXFilterCutoffHz",
17864
+ "type": {
17865
+ "text": "number"
17866
+ },
17867
+ "privacy": "private",
17868
+ "readonly": true,
17869
+ "inheritedFrom": {
17870
+ "name": "PoiBase",
17871
+ "module": "src/ar/poi/poi-base.ts"
17872
+ }
17873
+ },
17874
+ {
17875
+ "kind": "field",
17876
+ "name": "filteredY",
17877
+ "type": {
17878
+ "text": "number"
17879
+ },
17880
+ "privacy": "private",
17881
+ "default": "0",
17882
+ "inheritedFrom": {
17883
+ "name": "PoiBase",
17884
+ "module": "src/ar/poi/poi-base.ts"
17885
+ }
17886
+ },
17887
+ {
17888
+ "kind": "field",
17889
+ "name": "yFilterTarget",
17890
+ "type": {
17891
+ "text": "number"
17892
+ },
17893
+ "privacy": "private",
17894
+ "default": "0",
17895
+ "inheritedFrom": {
17896
+ "name": "PoiBase",
17897
+ "module": "src/ar/poi/poi-base.ts"
17898
+ }
17899
+ },
17900
+ {
17901
+ "kind": "field",
17902
+ "name": "yFilterInitialized",
17903
+ "type": {
17904
+ "text": "boolean"
17905
+ },
17906
+ "privacy": "private",
17907
+ "default": "false",
17908
+ "inheritedFrom": {
17909
+ "name": "PoiBase",
17910
+ "module": "src/ar/poi/poi-base.ts"
17911
+ }
17912
+ },
17913
+ {
17914
+ "kind": "field",
17915
+ "name": "lastYFilterTimestampMs",
17916
+ "type": {
17917
+ "text": "number"
17918
+ },
17919
+ "privacy": "private",
17920
+ "default": "0",
17921
+ "inheritedFrom": {
17922
+ "name": "PoiBase",
17923
+ "module": "src/ar/poi/poi-base.ts"
17924
+ }
17925
+ },
17926
+ {
17927
+ "kind": "field",
17928
+ "name": "yFilterRaf",
17929
+ "type": {
17930
+ "text": "number"
17931
+ },
17932
+ "privacy": "private",
17933
+ "default": "0",
17934
+ "inheritedFrom": {
17935
+ "name": "PoiBase",
17936
+ "module": "src/ar/poi/poi-base.ts"
17937
+ }
17938
+ },
17939
+ {
17940
+ "kind": "field",
17941
+ "name": "resolvedYFilterCutoffHz",
17942
+ "type": {
17943
+ "text": "number"
17944
+ },
17945
+ "privacy": "private",
17946
+ "readonly": true,
17947
+ "inheritedFrom": {
17948
+ "name": "PoiBase",
17949
+ "module": "src/ar/poi/poi-base.ts"
17950
+ }
17951
+ },
17952
+ {
17953
+ "kind": "method",
17954
+ "name": "dispatchLayoutChange",
17955
+ "privacy": "private",
17956
+ "inheritedFrom": {
17957
+ "name": "PoiBase",
17958
+ "module": "src/ar/poi/poi-base.ts"
17959
+ }
17960
+ },
17961
+ {
17962
+ "kind": "field",
17963
+ "name": "stepXFilter",
17964
+ "privacy": "private",
17376
17965
  "inheritedFrom": {
17377
17966
  "name": "PoiBase",
17378
17967
  "module": "src/ar/poi/poi-base.ts"
17379
17968
  }
17380
17969
  },
17381
17970
  {
17382
- "kind": "field",
17383
- "name": "xMovingHintTimeout",
17384
- "type": {
17385
- "text": "number | null"
17386
- },
17971
+ "kind": "method",
17972
+ "name": "syncXFilterTarget",
17387
17973
  "privacy": "private",
17388
- "default": "null",
17974
+ "parameters": [
17975
+ {
17976
+ "name": "nextX",
17977
+ "type": {
17978
+ "text": "number"
17979
+ }
17980
+ }
17981
+ ],
17389
17982
  "inheritedFrom": {
17390
17983
  "name": "PoiBase",
17391
17984
  "module": "src/ar/poi/poi-base.ts"
17392
17985
  }
17393
17986
  },
17394
17987
  {
17395
- "kind": "method",
17396
- "name": "dispatchLayoutChange",
17988
+ "kind": "field",
17989
+ "name": "stepYFilter",
17397
17990
  "privacy": "private",
17398
17991
  "inheritedFrom": {
17399
17992
  "name": "PoiBase",
@@ -17401,8 +17994,8 @@
17401
17994
  }
17402
17995
  },
17403
17996
  {
17404
- "kind": "field",
17405
- "name": "stepXFilter",
17997
+ "kind": "method",
17998
+ "name": "applyFilteredY",
17406
17999
  "privacy": "private",
17407
18000
  "inheritedFrom": {
17408
18001
  "name": "PoiBase",
@@ -17411,11 +18004,11 @@
17411
18004
  },
17412
18005
  {
17413
18006
  "kind": "method",
17414
- "name": "syncXFilterTarget",
18007
+ "name": "syncYFilterTarget",
17415
18008
  "privacy": "private",
17416
18009
  "parameters": [
17417
18010
  {
17418
- "name": "nextX",
18011
+ "name": "nextY",
17419
18012
  "type": {
17420
18013
  "text": "number"
17421
18014
  }
@@ -17670,7 +18263,7 @@
17670
18263
  "text": "number"
17671
18264
  },
17672
18265
  "privacy": "protected",
17673
- "description": "Public `y` normalized as the target Y input.",
18266
+ "description": "Public `y` normalized as the target Y input, after the y filter.",
17674
18267
  "readonly": true,
17675
18268
  "inheritedFrom": {
17676
18269
  "name": "PoiBase",
@@ -17705,49 +18298,11 @@
17705
18298
  "module": "src/ar/poi/poi-base.ts"
17706
18299
  }
17707
18300
  },
17708
- {
17709
- "kind": "field",
17710
- "name": "resolvedHeaderState",
17711
- "type": {
17712
- "text": "ObcPoiHeaderState"
17713
- },
17714
- "privacy": "protected",
17715
- "readonly": true,
17716
- "inheritedFrom": {
17717
- "name": "PoiBase",
17718
- "module": "src/ar/poi/poi-base.ts"
17719
- }
17720
- },
17721
18301
  {
17722
18302
  "kind": "method",
17723
18303
  "name": "syncHeaderContent",
17724
18304
  "privacy": "private",
17725
- "inheritedFrom": {
17726
- "name": "PoiBase",
17727
- "module": "src/ar/poi/poi-base.ts"
17728
- }
17729
- },
17730
- {
17731
- "kind": "method",
17732
- "name": "applyHeaderState",
17733
- "privacy": "private",
17734
- "parameters": [
17735
- {
17736
- "name": "root",
17737
- "type": {
17738
- "text": "ParentNode"
17739
- }
17740
- }
17741
- ],
17742
- "inheritedFrom": {
17743
- "name": "PoiBase",
17744
- "module": "src/ar/poi/poi-base.ts"
17745
- }
17746
- },
17747
- {
17748
- "kind": "method",
17749
- "name": "syncHeaderState",
17750
- "privacy": "private",
18305
+ "description": "Auto-enable `hasHeader` when the consumer slots header content directly\n(outside a stack, which manages `hasHeader` itself). Header elements stay\nin the consumer's light DOM and reach the inner button through the\n`<slot name=\"header\">` forwarding chain; their `state` is synced by\n`obc-poi-button`.",
17751
18306
  "inheritedFrom": {
17752
18307
  "name": "PoiBase",
17753
18308
  "module": "src/ar/poi/poi-base.ts"
@@ -17822,7 +18377,7 @@
17822
18377
  "declarations": [
17823
18378
  {
17824
18379
  "kind": "class",
17825
- "description": "`<obc-poi-data>` - Data-oriented marker variant with layout positioning and layer integration.\n\nExtends `PoiBase` to provide the \"data\" variant of the POI system.\nRenders `<obc-poi>` with a slotted `<obc-poi-button-data>`.",
18380
+ "description": "`<obc-poi-data>` - Data-oriented marker variant with layout positioning and layer integration.\n\nExtends `PoiBase` to provide the \"data\" variant of the POI system.\nRenders `<obc-poi>` with a slotted `<obc-poi-button-data>`.\nSee the \"Coordinate Model\" section in `PoiBase` (poi-base.ts) for how `x`, `y`, and `buttonY` position the marker.",
17826
18381
  "name": "ObcPoiData",
17827
18382
  "slots": [
17828
18383
  {
@@ -18103,10 +18658,7 @@
18103
18658
  {
18104
18659
  "kind": "field",
18105
18660
  "name": "y",
18106
- "type": {
18107
- "text": "number"
18108
- },
18109
- "default": "192",
18661
+ "default": "DEFAULT_LINE_LENGTH_PX",
18110
18662
  "inheritedFrom": {
18111
18663
  "name": "PoiBase",
18112
18664
  "module": "src/ar/poi/poi-base.ts"
@@ -18124,6 +18676,32 @@
18124
18676
  "module": "src/ar/poi/poi-base.ts"
18125
18677
  }
18126
18678
  },
18679
+ {
18680
+ "kind": "field",
18681
+ "name": "xFilterCutoffHz",
18682
+ "default": "16",
18683
+ "description": "Cutoff frequency (Hz) of the built-in low-pass filter applied to `x`. Lower values smooth noisy input more aggressively; `0` or a negative value disables filtering so `x` is applied directly.",
18684
+ "type": {
18685
+ "text": "number"
18686
+ },
18687
+ "inheritedFrom": {
18688
+ "name": "PoiBase",
18689
+ "module": "src/ar/poi/poi-base.ts"
18690
+ }
18691
+ },
18692
+ {
18693
+ "kind": "field",
18694
+ "name": "yFilterCutoffHz",
18695
+ "default": "16",
18696
+ "description": "Cutoff frequency (Hz) of the built-in low-pass filter applied to `y`. Lower values smooth noisy input more aggressively; `0` or a negative value disables filtering so `y` is applied directly.",
18697
+ "type": {
18698
+ "text": "number"
18699
+ },
18700
+ "inheritedFrom": {
18701
+ "name": "PoiBase",
18702
+ "module": "src/ar/poi/poi-base.ts"
18703
+ }
18704
+ },
18127
18705
  {
18128
18706
  "kind": "field",
18129
18707
  "name": "fixedTarget",
@@ -18284,6 +18862,97 @@
18284
18862
  "module": "src/ar/poi/poi-base.ts"
18285
18863
  }
18286
18864
  },
18865
+ {
18866
+ "kind": "field",
18867
+ "name": "resolvedXFilterCutoffHz",
18868
+ "type": {
18869
+ "text": "number"
18870
+ },
18871
+ "privacy": "private",
18872
+ "readonly": true,
18873
+ "inheritedFrom": {
18874
+ "name": "PoiBase",
18875
+ "module": "src/ar/poi/poi-base.ts"
18876
+ }
18877
+ },
18878
+ {
18879
+ "kind": "field",
18880
+ "name": "filteredY",
18881
+ "type": {
18882
+ "text": "number"
18883
+ },
18884
+ "privacy": "private",
18885
+ "default": "0",
18886
+ "inheritedFrom": {
18887
+ "name": "PoiBase",
18888
+ "module": "src/ar/poi/poi-base.ts"
18889
+ }
18890
+ },
18891
+ {
18892
+ "kind": "field",
18893
+ "name": "yFilterTarget",
18894
+ "type": {
18895
+ "text": "number"
18896
+ },
18897
+ "privacy": "private",
18898
+ "default": "0",
18899
+ "inheritedFrom": {
18900
+ "name": "PoiBase",
18901
+ "module": "src/ar/poi/poi-base.ts"
18902
+ }
18903
+ },
18904
+ {
18905
+ "kind": "field",
18906
+ "name": "yFilterInitialized",
18907
+ "type": {
18908
+ "text": "boolean"
18909
+ },
18910
+ "privacy": "private",
18911
+ "default": "false",
18912
+ "inheritedFrom": {
18913
+ "name": "PoiBase",
18914
+ "module": "src/ar/poi/poi-base.ts"
18915
+ }
18916
+ },
18917
+ {
18918
+ "kind": "field",
18919
+ "name": "lastYFilterTimestampMs",
18920
+ "type": {
18921
+ "text": "number"
18922
+ },
18923
+ "privacy": "private",
18924
+ "default": "0",
18925
+ "inheritedFrom": {
18926
+ "name": "PoiBase",
18927
+ "module": "src/ar/poi/poi-base.ts"
18928
+ }
18929
+ },
18930
+ {
18931
+ "kind": "field",
18932
+ "name": "yFilterRaf",
18933
+ "type": {
18934
+ "text": "number"
18935
+ },
18936
+ "privacy": "private",
18937
+ "default": "0",
18938
+ "inheritedFrom": {
18939
+ "name": "PoiBase",
18940
+ "module": "src/ar/poi/poi-base.ts"
18941
+ }
18942
+ },
18943
+ {
18944
+ "kind": "field",
18945
+ "name": "resolvedYFilterCutoffHz",
18946
+ "type": {
18947
+ "text": "number"
18948
+ },
18949
+ "privacy": "private",
18950
+ "readonly": true,
18951
+ "inheritedFrom": {
18952
+ "name": "PoiBase",
18953
+ "module": "src/ar/poi/poi-base.ts"
18954
+ }
18955
+ },
18287
18956
  {
18288
18957
  "kind": "method",
18289
18958
  "name": "dispatchLayoutChange",
@@ -18319,6 +18988,41 @@
18319
18988
  "module": "src/ar/poi/poi-base.ts"
18320
18989
  }
18321
18990
  },
18991
+ {
18992
+ "kind": "field",
18993
+ "name": "stepYFilter",
18994
+ "privacy": "private",
18995
+ "inheritedFrom": {
18996
+ "name": "PoiBase",
18997
+ "module": "src/ar/poi/poi-base.ts"
18998
+ }
18999
+ },
19000
+ {
19001
+ "kind": "method",
19002
+ "name": "applyFilteredY",
19003
+ "privacy": "private",
19004
+ "inheritedFrom": {
19005
+ "name": "PoiBase",
19006
+ "module": "src/ar/poi/poi-base.ts"
19007
+ }
19008
+ },
19009
+ {
19010
+ "kind": "method",
19011
+ "name": "syncYFilterTarget",
19012
+ "privacy": "private",
19013
+ "parameters": [
19014
+ {
19015
+ "name": "nextY",
19016
+ "type": {
19017
+ "text": "number"
19018
+ }
19019
+ }
19020
+ ],
19021
+ "inheritedFrom": {
19022
+ "name": "PoiBase",
19023
+ "module": "src/ar/poi/poi-base.ts"
19024
+ }
19025
+ },
18322
19026
  {
18323
19027
  "kind": "method",
18324
19028
  "name": "markXMoving",
@@ -18563,7 +19267,7 @@
18563
19267
  "text": "number"
18564
19268
  },
18565
19269
  "privacy": "protected",
18566
- "description": "Public `y` normalized as the target Y input.",
19270
+ "description": "Public `y` normalized as the target Y input, after the y filter.",
18567
19271
  "readonly": true,
18568
19272
  "inheritedFrom": {
18569
19273
  "name": "PoiBase",
@@ -18578,60 +19282,21 @@
18578
19282
  },
18579
19283
  "privacy": "protected",
18580
19284
  "description": "Public `buttonY` normalized as the button Y input.",
18581
- "readonly": true,
18582
- "inheritedFrom": {
18583
- "name": "PoiBase",
18584
- "module": "src/ar/poi/poi-base.ts"
18585
- }
18586
- },
18587
- {
18588
- "kind": "field",
18589
- "name": "effectiveLocalButtonY",
18590
- "type": {
18591
- "text": "number"
18592
- },
18593
- "privacy": "protected",
18594
- "description": "Computed effective local button Y offset.",
18595
- "readonly": true,
18596
- "inheritedFrom": {
18597
- "name": "PoiBase",
18598
- "module": "src/ar/poi/poi-base.ts"
18599
- }
18600
- },
18601
- {
18602
- "kind": "field",
18603
- "name": "resolvedHeaderState",
18604
- "type": {
18605
- "text": "ObcPoiHeaderState"
18606
- },
18607
- "privacy": "protected",
18608
- "readonly": true,
18609
- "inheritedFrom": {
18610
- "name": "PoiBase",
18611
- "module": "src/ar/poi/poi-base.ts"
18612
- }
18613
- },
18614
- {
18615
- "kind": "method",
18616
- "name": "syncHeaderContent",
18617
- "privacy": "private",
18618
- "inheritedFrom": {
18619
- "name": "PoiBase",
18620
- "module": "src/ar/poi/poi-base.ts"
18621
- }
18622
- },
18623
- {
18624
- "kind": "method",
18625
- "name": "applyHeaderState",
18626
- "privacy": "private",
18627
- "parameters": [
18628
- {
18629
- "name": "root",
18630
- "type": {
18631
- "text": "ParentNode"
18632
- }
18633
- }
18634
- ],
19285
+ "readonly": true,
19286
+ "inheritedFrom": {
19287
+ "name": "PoiBase",
19288
+ "module": "src/ar/poi/poi-base.ts"
19289
+ }
19290
+ },
19291
+ {
19292
+ "kind": "field",
19293
+ "name": "effectiveLocalButtonY",
19294
+ "type": {
19295
+ "text": "number"
19296
+ },
19297
+ "privacy": "protected",
19298
+ "description": "Computed effective local button Y offset.",
19299
+ "readonly": true,
18635
19300
  "inheritedFrom": {
18636
19301
  "name": "PoiBase",
18637
19302
  "module": "src/ar/poi/poi-base.ts"
@@ -18639,8 +19304,9 @@
18639
19304
  },
18640
19305
  {
18641
19306
  "kind": "method",
18642
- "name": "syncHeaderState",
19307
+ "name": "syncHeaderContent",
18643
19308
  "privacy": "private",
19309
+ "description": "Auto-enable `hasHeader` when the consumer slots header content directly\n(outside a stack, which manages `hasHeader` itself). Header elements stay\nin the consumer's light DOM and reach the inner button through the\n`<slot name=\"header\">` forwarding chain; their `state` is synced by\n`obc-poi-button`.",
18644
19310
  "inheritedFrom": {
18645
19311
  "name": "PoiBase",
18646
19312
  "module": "src/ar/poi/poi-base.ts"
@@ -18723,7 +19389,7 @@
18723
19389
  "declarations": [
18724
19390
  {
18725
19391
  "kind": "class",
18726
- "description": "`<obc-poi-vessel>` - Vessel marker variant with layout positioning and layer integration.\n\nExtends `PoiBase` to provide the \"vessel\" variant of the POI system.\nRenders `<obc-poi>` with a slotted `<obc-poi-button-vessel>`.",
19392
+ "description": "`<obc-poi-vessel>` - Vessel marker variant with layout positioning and layer integration.\n\nExtends `PoiBase` to provide the \"vessel\" variant of the POI system.\nRenders `<obc-poi>` with a slotted `<obc-poi-button-vessel>`.\nSee the \"Coordinate Model\" section in `PoiBase` (poi-base.ts) for how `x`, `y`, and `buttonY` position the marker.",
18727
19393
  "name": "ObcPoiVessel",
18728
19394
  "slots": [
18729
19395
  {
@@ -19019,10 +19685,7 @@
19019
19685
  {
19020
19686
  "kind": "field",
19021
19687
  "name": "y",
19022
- "type": {
19023
- "text": "number"
19024
- },
19025
- "default": "192",
19688
+ "default": "DEFAULT_LINE_LENGTH_PX",
19026
19689
  "inheritedFrom": {
19027
19690
  "name": "PoiBase",
19028
19691
  "module": "src/ar/poi/poi-base.ts"
@@ -19040,6 +19703,32 @@
19040
19703
  "module": "src/ar/poi/poi-base.ts"
19041
19704
  }
19042
19705
  },
19706
+ {
19707
+ "kind": "field",
19708
+ "name": "xFilterCutoffHz",
19709
+ "default": "16",
19710
+ "description": "Cutoff frequency (Hz) of the built-in low-pass filter applied to `x`. Lower values smooth noisy input more aggressively; `0` or a negative value disables filtering so `x` is applied directly.",
19711
+ "type": {
19712
+ "text": "number"
19713
+ },
19714
+ "inheritedFrom": {
19715
+ "name": "PoiBase",
19716
+ "module": "src/ar/poi/poi-base.ts"
19717
+ }
19718
+ },
19719
+ {
19720
+ "kind": "field",
19721
+ "name": "yFilterCutoffHz",
19722
+ "default": "16",
19723
+ "description": "Cutoff frequency (Hz) of the built-in low-pass filter applied to `y`. Lower values smooth noisy input more aggressively; `0` or a negative value disables filtering so `y` is applied directly.",
19724
+ "type": {
19725
+ "text": "number"
19726
+ },
19727
+ "inheritedFrom": {
19728
+ "name": "PoiBase",
19729
+ "module": "src/ar/poi/poi-base.ts"
19730
+ }
19731
+ },
19043
19732
  {
19044
19733
  "kind": "field",
19045
19734
  "name": "fixedTarget",
@@ -19200,6 +19889,97 @@
19200
19889
  "module": "src/ar/poi/poi-base.ts"
19201
19890
  }
19202
19891
  },
19892
+ {
19893
+ "kind": "field",
19894
+ "name": "resolvedXFilterCutoffHz",
19895
+ "type": {
19896
+ "text": "number"
19897
+ },
19898
+ "privacy": "private",
19899
+ "readonly": true,
19900
+ "inheritedFrom": {
19901
+ "name": "PoiBase",
19902
+ "module": "src/ar/poi/poi-base.ts"
19903
+ }
19904
+ },
19905
+ {
19906
+ "kind": "field",
19907
+ "name": "filteredY",
19908
+ "type": {
19909
+ "text": "number"
19910
+ },
19911
+ "privacy": "private",
19912
+ "default": "0",
19913
+ "inheritedFrom": {
19914
+ "name": "PoiBase",
19915
+ "module": "src/ar/poi/poi-base.ts"
19916
+ }
19917
+ },
19918
+ {
19919
+ "kind": "field",
19920
+ "name": "yFilterTarget",
19921
+ "type": {
19922
+ "text": "number"
19923
+ },
19924
+ "privacy": "private",
19925
+ "default": "0",
19926
+ "inheritedFrom": {
19927
+ "name": "PoiBase",
19928
+ "module": "src/ar/poi/poi-base.ts"
19929
+ }
19930
+ },
19931
+ {
19932
+ "kind": "field",
19933
+ "name": "yFilterInitialized",
19934
+ "type": {
19935
+ "text": "boolean"
19936
+ },
19937
+ "privacy": "private",
19938
+ "default": "false",
19939
+ "inheritedFrom": {
19940
+ "name": "PoiBase",
19941
+ "module": "src/ar/poi/poi-base.ts"
19942
+ }
19943
+ },
19944
+ {
19945
+ "kind": "field",
19946
+ "name": "lastYFilterTimestampMs",
19947
+ "type": {
19948
+ "text": "number"
19949
+ },
19950
+ "privacy": "private",
19951
+ "default": "0",
19952
+ "inheritedFrom": {
19953
+ "name": "PoiBase",
19954
+ "module": "src/ar/poi/poi-base.ts"
19955
+ }
19956
+ },
19957
+ {
19958
+ "kind": "field",
19959
+ "name": "yFilterRaf",
19960
+ "type": {
19961
+ "text": "number"
19962
+ },
19963
+ "privacy": "private",
19964
+ "default": "0",
19965
+ "inheritedFrom": {
19966
+ "name": "PoiBase",
19967
+ "module": "src/ar/poi/poi-base.ts"
19968
+ }
19969
+ },
19970
+ {
19971
+ "kind": "field",
19972
+ "name": "resolvedYFilterCutoffHz",
19973
+ "type": {
19974
+ "text": "number"
19975
+ },
19976
+ "privacy": "private",
19977
+ "readonly": true,
19978
+ "inheritedFrom": {
19979
+ "name": "PoiBase",
19980
+ "module": "src/ar/poi/poi-base.ts"
19981
+ }
19982
+ },
19203
19983
  {
19204
19984
  "kind": "method",
19205
19985
  "name": "dispatchLayoutChange",
@@ -19235,6 +20015,41 @@
19235
20015
  "module": "src/ar/poi/poi-base.ts"
19236
20016
  }
19237
20017
  },
20018
+ {
20019
+ "kind": "field",
20020
+ "name": "stepYFilter",
20021
+ "privacy": "private",
20022
+ "inheritedFrom": {
20023
+ "name": "PoiBase",
20024
+ "module": "src/ar/poi/poi-base.ts"
20025
+ }
20026
+ },
20027
+ {
20028
+ "kind": "method",
20029
+ "name": "applyFilteredY",
20030
+ "privacy": "private",
20031
+ "inheritedFrom": {
20032
+ "name": "PoiBase",
20033
+ "module": "src/ar/poi/poi-base.ts"
20034
+ }
20035
+ },
20036
+ {
20037
+ "kind": "method",
20038
+ "name": "syncYFilterTarget",
20039
+ "privacy": "private",
20040
+ "parameters": [
20041
+ {
20042
+ "name": "nextY",
20043
+ "type": {
20044
+ "text": "number"
20045
+ }
20046
+ }
20047
+ ],
20048
+ "inheritedFrom": {
20049
+ "name": "PoiBase",
20050
+ "module": "src/ar/poi/poi-base.ts"
20051
+ }
20052
+ },
19238
20053
  {
19239
20054
  "kind": "method",
19240
20055
  "name": "markXMoving",
@@ -19479,7 +20294,7 @@
19479
20294
  "text": "number"
19480
20295
  },
19481
20296
  "privacy": "protected",
19482
- "description": "Public `y` normalized as the target Y input.",
20297
+ "description": "Public `y` normalized as the target Y input, after the y filter.",
19483
20298
  "readonly": true,
19484
20299
  "inheritedFrom": {
19485
20300
  "name": "PoiBase",
@@ -19514,49 +20329,11 @@
19514
20329
  "module": "src/ar/poi/poi-base.ts"
19515
20330
  }
19516
20331
  },
19517
- {
19518
- "kind": "field",
19519
- "name": "resolvedHeaderState",
19520
- "type": {
19521
- "text": "ObcPoiHeaderState"
19522
- },
19523
- "privacy": "protected",
19524
- "readonly": true,
19525
- "inheritedFrom": {
19526
- "name": "PoiBase",
19527
- "module": "src/ar/poi/poi-base.ts"
19528
- }
19529
- },
19530
20332
  {
19531
20333
  "kind": "method",
19532
20334
  "name": "syncHeaderContent",
19533
20335
  "privacy": "private",
19534
- "inheritedFrom": {
19535
- "name": "PoiBase",
19536
- "module": "src/ar/poi/poi-base.ts"
19537
- }
19538
- },
19539
- {
19540
- "kind": "method",
19541
- "name": "applyHeaderState",
19542
- "privacy": "private",
19543
- "parameters": [
19544
- {
19545
- "name": "root",
19546
- "type": {
19547
- "text": "ParentNode"
19548
- }
19549
- }
19550
- ],
19551
- "inheritedFrom": {
19552
- "name": "PoiBase",
19553
- "module": "src/ar/poi/poi-base.ts"
19554
- }
19555
- },
19556
- {
19557
- "kind": "method",
19558
- "name": "syncHeaderState",
19559
- "privacy": "private",
20336
+ "description": "Auto-enable `hasHeader` when the consumer slots header content directly\n(outside a stack, which manages `hasHeader` itself). Header elements stay\nin the consumer's light DOM and reach the inner button through the\n`<slot name=\"header\">` forwarding chain; their `state` is synced by\n`obc-poi-button`.",
19560
20337
  "inheritedFrom": {
19561
20338
  "name": "PoiBase",
19562
20339
  "module": "src/ar/poi/poi-base.ts"
@@ -19631,7 +20408,7 @@
19631
20408
  "declarations": [
19632
20409
  {
19633
20410
  "kind": "class",
19634
- "description": "`<obc-poi>` - Composite marker component that renders a target button with connector and pointer visuals.\n\n## Overview\nCombines `obc-poi-button`, `obc-poi-line`, and optional pointer visuals to display\ninteractive marker/callout targets in line, offset, point, or outside modes.\nKeywords: marker, callout, pin, label, target, pointer.\n\n## Features/Variants\n\nConfiguration defaults and behavior:\n- `type` (default: `line`):\n - `line`: renders a vertical connector line from button to target.\n - `offset`: renders a bent connector using `targetOffsetX - buttonOffsetX`.\n - `point`: suppresses long connector behavior (line can collapse/skip based on state).\n - `outside`: suppresses connector line; outside arrow is rendered when `hasPointer` is true.\n- `value` (default: `unchecked`):\n - `unchecked`: default visual state.\n - `checked`: selected-like visual and pointer behavior.\n - `activated`: activated button visual state with selected-like pointer behavior.\n - `overlapped`: compact overlap visual state.\n- `overlapOpaque` (default: `false`): controls overlapped opacity mode (`false` = translucent, `true` = opaque).\n- `state` (default: `enabled`):\n - `enabled`: neutral alert ring and regular line style.\n - `caution`/`warning`/`alarm`: applies alert-specific button/line styling.\n - In `enabled`, pointer type resolution defaults to point.\n- `selected` (default: `false`): enables selected emphasis semantics (for example selected line style when not in alert state).\n- `hasPointer` (default: `false`):\n - For `line`/`offset`/`point`, pointer visuals are shown when `hasPointer` is true.\n - Checked-like values also force inline pointer visuals for non-`outside` types.\n - For `outside`, `hasPointer` controls outside-arrow visibility.\n- `pointerType` (default: `null`, enum `point | button | camera`):\n - Used when not in checked-like state and not `enabled`.\n - Otherwise resolves to `point` for consistent selected/enabled behavior.\n- `pointerState` (default: `null`, enum `regular | selected | active | uncertain`):\n - Checked-like non-`outside` values resolve to `selected`.\n - Otherwise falls back to provided `pointerState` or `regular`.\n\nMotion and layout notes:\n- `animatePosition` (default: `false`): when true, enables short position transition timing for line/pointer movement.\n- `x` (default: `0`): host horizontal position; sets `--obc-poi-x` as `${x}px`.\n- `y` (default: `96`): absolute local target Y; non-finite values fall back to `0` in geometry calculations.\n- `buttonY` (default: `0`): when `fixedTarget=false`, anchors the button at its local Y while the target is derived below it from `y`; when `fixedTarget=true`, preserves the legacy host-anchor behavior.\n- `buttonOffsetX`/`targetOffsetX` (defaults: `0`/`0`): define connector bend delta via `targetOffsetX - buttonOffsetX`.\n- `boxWidth`/`boxHeight` (defaults: `null`/`null`): optional pointer frame size extras; invalid/non-finite values are ignored.\n- `outsideAngle` (default: `315`): controls outside-arrow direction in `outside` mode.\n\n## Usage Guidelines\n\n- Use `type=\"line\"` or `type=\"offset\"` when the button should connect to a remote target.\n- Use `type=\"point\"` for near-target placements where connector emphasis should be minimal.\n- Use `type=\"outside\"` with `hasPointer` for off-screen or directional guidance.\n- Keep `value`, `state`, and `selected` aligned with domain state so visual semantics stay consistent.\n- Provide finite numbers for layout props (`x`, `y`, `buttonY`, offsets) for predictable placement.\n\n## Slots/Content\n\n- Default slot: Main icon/content rendered inside `obc-poi-button`.\n- `button`: Optional custom button element replacing the default `obc-poi-button`.\n- `header`: Optional header content. Relocated into the inner `obc-poi-button` at runtime by a `MutationObserver` (there is no `<slot name=\"header\">` element).\n\n## Events\n\nThis component does not emit custom events.\n\n## Best Practices\n\n- Pass finite numeric values for layout properties to avoid fallback-to-zero behavior.\n- Enable `animatePosition` only for intentional motion transitions and moving targets.\n- Prefer enum values for `type`, `value`, `state`, `pointerType`, and `pointerState`.\n\n## Example\n\n```html\n<obc-poi type=\"line\" value=\"unchecked\" state=\"enabled\">\n <obi-placeholder></obi-placeholder>\n</obc-poi>\n```",
20411
+ "description": "`<obc-poi>` - Composite marker component that renders a target button with connector and pointer visuals.\n\n## Overview\nCombines `obc-poi-button`, `obc-poi-line`, and optional pointer visuals to display\ninteractive marker/callout targets in line, offset, point, or outside modes.\nKeywords: marker, callout, pin, label, target, pointer.\n\n## Features/Variants\n\nConfiguration defaults and behavior:\n- `type` (default: `line`):\n - `line`: renders a vertical connector line from button to target.\n - `offset`: renders a bent connector using `targetOffsetX - buttonOffsetX`.\n - `point`: suppresses long connector behavior (line can collapse/skip based on state).\n - `outside`: suppresses connector line; outside arrow is rendered when `hasPointer` is true.\n- `value` (default: `unchecked`):\n - `unchecked`: default visual state.\n - `checked`: selected-like visual and pointer behavior.\n - `activated`: activated button visual state with selected-like pointer behavior.\n - `overlapped`: compact overlap visual state.\n- `overlapOpaque` (default: `false`): controls overlapped opacity mode (`false` = translucent, `true` = opaque).\n- `state` (default: `enabled`):\n - `enabled`: neutral alert ring and regular line style.\n - `caution`/`warning`/`alarm`: applies alert-specific button/line styling.\n - In `enabled`, pointer type resolution defaults to point.\n- `selected` (default: `false`): enables selected emphasis semantics (for example selected line style when not in alert state).\n- `hasPointer` (default: `false`):\n - For `line`/`offset`/`point`, pointer visuals are shown when `hasPointer` is true.\n - Checked-like values also force inline pointer visuals for non-`outside` types.\n - For `outside`, `hasPointer` controls outside-arrow visibility.\n- `pointerType` (default: `null`, enum `point | button | camera`):\n - Used when not in checked-like state and not `enabled`.\n - Otherwise resolves to `point` for consistent selected/enabled behavior.\n- `pointerState` (default: `null`, enum `regular | selected | active | uncertain`):\n - Checked-like non-`outside` values resolve to `selected`.\n - Otherwise falls back to provided `pointerState` or `regular`.\n\nMotion and layout notes:\n- `animatePosition` (default: `false`): when true, enables short position transition timing for line/pointer movement.\n- `x` (default: `0`): host horizontal position; sets `--obc-poi-x` as `${x}px`.\n- `y` (default: `192`): absolute local target Y; non-finite values fall back to `0` in geometry calculations. The default is shared with the top-level POI variants (`DEFAULT_LINE_LENGTH_PX`).\n- `buttonY` (default: `0`): when `fixedTarget=false`, anchors the button at its local Y while the target is derived below it from `y`; when `fixedTarget=true`, preserves the legacy host-anchor behavior.\n- `buttonOffsetX`/`targetOffsetX` (defaults: `0`/`0`): define connector bend delta via `targetOffsetX - buttonOffsetX`.\n- `boxWidth`/`boxHeight` (defaults: `null`/`null`): optional pointer frame size extras; invalid/non-finite values are ignored.\n- `outsideAngle` (default: `315`): controls outside-arrow direction in `outside` mode.\n\n## Usage Guidelines\n\n- Use `type=\"line\"` or `type=\"offset\"` when the button should connect to a remote target.\n- Use `type=\"point\"` for near-target placements where connector emphasis should be minimal.\n- Use `type=\"outside\"` with `hasPointer` for off-screen or directional guidance.\n- Keep `value`, `state`, and `selected` aligned with domain state so visual semantics stay consistent.\n- Provide finite numbers for layout props (`x`, `y`, `buttonY`, offsets) for predictable placement.\n\n## Slots/Content\n\n- Default slot: Main icon/content rendered inside `obc-poi-button`.\n- `button`: Optional custom button element replacing the default `obc-poi-button`.\n- `header`: Optional header content, forwarded into the default `obc-poi-button` through a `<slot name=\"header\">` chain. Content stays in the consumer's light DOM. When a custom `button` is slotted, place header content directly inside it instead.\n\n## Events\n\nThis component does not emit custom events.\n\n## Best Practices\n\n- Pass finite numeric values for layout properties to avoid fallback-to-zero behavior.\n- Enable `animatePosition` only for intentional motion transitions and moving targets.\n- Prefer enum values for `type`, `value`, `state`, `pointerType`, and `pointerState`.\n\n## Example\n\n```html\n<obc-poi type=\"line\" value=\"unchecked\" state=\"enabled\">\n <obi-placeholder></obi-placeholder>\n</obc-poi>\n```",
19635
20412
  "name": "ObcPoi",
19636
20413
  "slots": [
19637
20414
  {
@@ -19643,7 +20420,7 @@
19643
20420
  "name": "button"
19644
20421
  },
19645
20422
  {
19646
- "description": "Optional header content, relocated into the inner `obc-poi-button` at runtime.",
20423
+ "description": "Optional header content, forwarded into the default `obc-poi-button` via a `<slot name=\"header\">` chain.",
19647
20424
  "name": "header"
19648
20425
  }
19649
20426
  ],
@@ -19756,7 +20533,7 @@
19756
20533
  {
19757
20534
  "kind": "field",
19758
20535
  "name": "y",
19759
- "default": "96",
20536
+ "default": "192",
19760
20537
  "type": {
19761
20538
  "text": "number"
19762
20539
  }
@@ -19825,19 +20602,6 @@
19825
20602
  },
19826
20603
  "default": "false"
19827
20604
  },
19828
- {
19829
- "kind": "field",
19830
- "name": "headerObserver",
19831
- "type": {
19832
- "text": "MutationObserver | undefined"
19833
- },
19834
- "privacy": "private"
19835
- },
19836
- {
19837
- "kind": "method",
19838
- "name": "setupHeaderObserver",
19839
- "privacy": "private"
19840
- },
19841
20605
  {
19842
20606
  "kind": "method",
19843
20607
  "name": "updatePosition",
@@ -19870,15 +20634,6 @@
19870
20634
  "privacy": "protected",
19871
20635
  "readonly": true
19872
20636
  },
19873
- {
19874
- "kind": "field",
19875
- "name": "resolvedHeaderState",
19876
- "type": {
19877
- "text": "ObcPoiHeaderState"
19878
- },
19879
- "privacy": "private",
19880
- "readonly": true
19881
- },
19882
20637
  {
19883
20638
  "kind": "field",
19884
20639
  "name": "lineStyle",
@@ -20035,29 +20790,6 @@
20035
20790
  }
20036
20791
  ]
20037
20792
  },
20038
- {
20039
- "kind": "method",
20040
- "name": "syncFallbackButtonHeaderContent",
20041
- "privacy": "private"
20042
- },
20043
- {
20044
- "kind": "method",
20045
- "name": "applyHeaderState",
20046
- "privacy": "private",
20047
- "parameters": [
20048
- {
20049
- "name": "root",
20050
- "type": {
20051
- "text": "ParentNode"
20052
- }
20053
- }
20054
- ]
20055
- },
20056
- {
20057
- "kind": "method",
20058
- "name": "syncAttachedHeaderState",
20059
- "privacy": "private"
20060
- },
20061
20793
  {
20062
20794
  "kind": "method",
20063
20795
  "name": "syncSlottedButtonProps",
@@ -20083,19 +20815,6 @@
20083
20815
  "kind": "method",
20084
20816
  "name": "render"
20085
20817
  },
20086
- {
20087
- "kind": "method",
20088
- "name": "firstUpdated",
20089
- "privacy": "protected",
20090
- "parameters": [
20091
- {
20092
- "name": "_changedProperties",
20093
- "type": {
20094
- "text": "Map<string, unknown>"
20095
- }
20096
- }
20097
- ]
20098
- },
20099
20818
  {
20100
20819
  "kind": "method",
20101
20820
  "name": "updated",
@@ -20139,6 +20858,14 @@
20139
20858
  "module": "src/ar/poi/poi.ts"
20140
20859
  }
20141
20860
  },
20861
+ {
20862
+ "kind": "js",
20863
+ "name": "DEFAULT_LINE_LENGTH_PX",
20864
+ "declaration": {
20865
+ "name": "DEFAULT_LINE_LENGTH_PX",
20866
+ "module": "src/ar/poi/poi.ts"
20867
+ }
20868
+ },
20142
20869
  {
20143
20870
  "kind": "js",
20144
20871
  "name": "ObcPoi",