<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">/*
 *   Copyright (c) 2022 Esri
 *   All rights reserved.

 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at

 *   http://www.apache.org/licenses/LICENSE-2.0

 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */
var __decorate = (this &amp;&amp; this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c &lt; 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" &amp;&amp; typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i &gt;= 0; i--) if (d = decorators[i]) r = (c &lt; 3 ? d(r) : c &gt; 3 ? d(target, key, r) : d(target, key)) || r;
    return c &gt; 3 &amp;&amp; r &amp;&amp; Object.defineProperty(target, key, r), r;
};
var __importDefault = (this &amp;&amp; this.__importDefault) || function (mod) {
    return (mod &amp;&amp; mod.__esModule) ? mod : { "default": mod };
};
define(["require", "exports", "esri/core/accessorSupport/decorators", "esri/widgets/Widget", "esri/widgets/support/widget"], function (require, exports, decorators_1, Widget_1, widget_1) {
    "use strict";
    Widget_1 = __importDefault(Widget_1);
    let FeatureActionBar = class FeatureActionBar extends Widget_1.default {
        constructor(params) {
            super(params);
            this.bundle = null;
            this.appBundle = null;
        }
        render() {
            const clearButton = this.renderClearButton();
            const expandButton = this.renderExpand();
            return ((0, widget_1.tsx)("div", { class: "feature-action-bar", slot: this.isMobile() ? "header-menu-actions" : "menu-actions" },
                clearButton,
                expandButton));
        }
        renderClearButton() {
            const labelText = this?.appBundle?.clear;
            return ((0, widget_1.tsx)("calcite-action", { icon: "erase", bind: this, "text-enabled": "true", active: this?.featureList?.features?.length &gt; 0 ? "true" : "false", scale: "s", label: labelText, title: this.bundle.tools?.clearSelection, text: labelText, appearance: "transparent", onclick: this.clearSelection }));
        }
        renderExpand() {
            const buttonLabel = this._toggle ? this?.bundle.tools.collapse : this.bundle.tools.expand;
            const buttonIcon = this._toggle ? "contract" : "expand";
            return ((0, widget_1.tsx)("calcite-action", { icon: buttonIcon, bind: this, active: this?.featureList?.features?.length &gt; 1 ? "true" : "false", "text-enabled": "true", title: buttonLabel, text: buttonLabel, key: buttonLabel, label: buttonLabel, onclick: this._toggleItems, scale: "s", appearance: "transparent" }));
        }
        _toggleItems() {
            this._toggle = !this._toggle;
            const elements = document.getElementsByClassName("popup-block");
            for (let i = 0; i &lt; elements.length; i++) {
                this._toggle
                    ? elements[i]?.setAttribute("open", "true")
                    : elements[i].removeAttribute("open");
            }
        }
        clearSelection() {
            if (this?.featureList) {
                this.featureList?.clearHighlight();
                this.featureList.features = [];
            }
        }
        isMobile() {
            return window.matchMedia("(max-width: 700px)")?.matches;
        }
    };
    __decorate([
        (0, decorators_1.property)()
    ], FeatureActionBar.prototype, "featureList", void 0);
    __decorate([
        (0, decorators_1.property)(),
        (0, widget_1.messageBundle)("sidebar/app/t9n/common")
    ], FeatureActionBar.prototype, "bundle", void 0);
    __decorate([
        (0, decorators_1.property)(),
        (0, widget_1.messageBundle)("instant/../t9n/common")
    ], FeatureActionBar.prototype, "appBundle", void 0);
    FeatureActionBar = __decorate([
        (0, decorators_1.subclass)("FeatureActionBar")
    ], FeatureActionBar);
    return FeatureActionBar;
});
</pre></body></html>