/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{__decorate as e}from"tslib";import{property as t,subclass as s}from"../../../../core/accessorSupport/decorators.js";import{findMatchingChildren as i}from"./responsiveToolbarUtils.js";const o=o=>{const r=o;let a=class extends r{constructor(){super(...arguments),this.priority=0,this.scale="m",this.slot=void 0,this.lastActiveKey=null,this.layout="horizontal"}destroy(){this.measurementManager?.managedElements.remove(this),this.measurementManager=null}set measurementManager(e){const t=this._get("measurementManager");e!==t&&(t&&t.managedElements.remove(this),this._set("measurementManager",e),e?.managedElements.add(this))}set budgetedLength(e){this.budgetedLength!==e&&(this._set("budgetedLength",e),this.scheduleRender())}get actionChildren(){return this.children?.flatMap(e=>i(e,"calcite-action"))??[]}get activeChildElement(){const e=this.actionChildren.find(e=>!0===e.properties?.active);return e?(this._set("lastActiveKey",e.properties?.key),e):this.lastActiveKey?this.actionChildren.find(e=>e.properties?.key===this.lastActiveKey):void 0}_handleClick(e){e?.dataset&&"dataset"in e&&e.dataset.actionKey&&(this.lastActiveKey=e.dataset.actionKey)}};return e([t()],a.prototype,"priority",void 0),e([t()],a.prototype,"measurementManager",null),e([t()],a.prototype,"budgetedLength",null),e([t()],a.prototype,"actionChildren",null),e([t()],a.prototype,"activeChildElement",null),e([t()],a.prototype,"scale",void 0),e([t()],a.prototype,"slot",void 0),e([t()],a.prototype,"lastActiveKey",void 0),e([t()],a.prototype,"layout",void 0),a=e([s("esri.widgets.Sketch.support.ResponsiveToolbar.ToolbarGroupBase")],a),a};export{o as ToolbarGroupBase};
