"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var webmapgl_core_js_1 = require("../webmapgl.core.js");
var chunk_3488a752_js_1 = require("./chunk-3488a752.js");
var chunk_c82b670d_js_1 = require("./chunk-c82b670d.js");
var Button = function () { function t() { var t = this; this.inToolbar = !1, this.inItem = !1, this.buttonType = "button", this.disabled = !1, this.routerDirection = "forward", this.strong = !1, this.type = "button", this.onFocus = function () { t.ionFocus.emit(); }, this.onBlur = function () { t.ionBlur.emit(); }; } return t.prototype.componentWillLoad = function () { this.inToolbar = !!this.el.closest("ion-buttons"), this.inItem = !!this.el.closest("ion-item") || !!this.el.closest("ion-item-divider"); }, t.prototype.onClick = function (t) { if ("button" === this.type)
    chunk_c82b670d_js_1.d(this.win, this.href, t, this.routerDirection);
else if (chunk_3488a752_js_1.h(this.el)) {
    var e = this.el.closest("form");
    if (e) {
        t.preventDefault();
        var o = this.win.document.createElement("button");
        o.type = this.type, o.style.display = "none", e.appendChild(o), o.click(), o.remove();
    }
} }, Object.defineProperty(t.prototype, "hasIconOnly", { get: function () { return !!this.el.querySelector('ion-icon[slot="icon-only"]'); }, enumerable: !0, configurable: !0 }), Object.defineProperty(t.prototype, "rippleType", { get: function () { return (void 0 === this.fill || "clear" === this.fill) && this.hasIconOnly && this.inToolbar ? "unbounded" : "bounded"; }, enumerable: !0, configurable: !0 }), t.prototype.hostData = function () { var t, e = this, o = e.buttonType, n = e.disabled, i = e.expand, r = e.hasIconOnly, s = e.shape, l = e.strong, a = this.fill; void 0 === a && (a = this.inToolbar ? "clear" : "solid"); var u = void 0 === this.size && this.inItem ? "small" : this.size; return { "aria-disabled": n ? "true" : null, class: Object.assign({}, chunk_c82b670d_js_1.a(e.color), (t = {}, t["" + this.mode] = !0, t[o] = !0, t[o + "-" + i] = void 0 !== i, t[o + "-" + u] = void 0 !== u, t[o + "-" + s] = void 0 !== s, t[o + "-" + a] = !0, t[o + "-strong"] = l, t["button-has-icon-only"] = r, t["button-disabled"] = n, t["ion-activatable"] = !0, t["ion-focusable"] = !0, t)) }; }, t.prototype.render = function () { var t = void 0 === this.href ? "button" : "a"; return webmapgl_core_js_1.h(t, Object.assign({}, "button" === t ? { type: this.type } : { href: this.href }, { class: "button-native", disabled: this.disabled, onFocus: this.onFocus, onBlur: this.onBlur }), webmapgl_core_js_1.h("span", { class: "button-inner" }, webmapgl_core_js_1.h("slot", { name: "icon-only" }), webmapgl_core_js_1.h("slot", { name: "start" }), webmapgl_core_js_1.h("slot", null), webmapgl_core_js_1.h("slot", { name: "end" })), "md" === this.mode && webmapgl_core_js_1.h("ion-ripple-effect", { type: this.rippleType })); }, Object.defineProperty(t, "is", { get: function () { return "ion-button"; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "encapsulation", { get: function () { return "shadow"; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "properties", { get: function () { return { buttonType: { type: String, attr: "button-type", mutable: !0 }, color: { type: String, attr: "color" }, disabled: { type: Boolean, attr: "disabled", reflectToAttr: !0 }, el: { elementRef: !0 }, expand: { type: String, attr: "expand", reflectToAttr: !0 }, fill: { type: String, attr: "fill", reflectToAttr: !0, mutable: !0 }, href: { type: String, attr: "href" }, mode: { type: String, attr: "mode" }, routerDirection: { type: String, attr: "router-direction" }, shape: { type: String, attr: "shape", reflectToAttr: !0 }, size: { type: String, attr: "size", reflectToAttr: !0 }, strong: { type: Boolean, attr: "strong" }, type: { type: String, attr: "type" }, win: { context: "window" } }; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "events", { get: function () { return [{ name: "ionFocus", method: "ionFocus", bubbles: !0, cancelable: !0, composed: !0 }, { name: "ionBlur", method: "ionBlur", bubbles: !0, cancelable: !0, composed: !0 }]; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "listeners", { get: function () { return [{ name: "click", method: "onClick" }]; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "style", { get: function () { return ".sc-ion-button-ios-h{--overflow:hidden;--ripple-color:currentColor;--border-width:initial;--border-color:initial;--border-style:initial;--color-hover:initial;--box-shadow:none;display:inline-block;width:auto;color:var(--color);font-family:var(--ion-font-family,inherit);text-align:center;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:top;vertical-align:-webkit-baseline-middle;pointer-events:auto;-webkit-font-kerning:none;font-kerning:none}.button-disabled.sc-ion-button-ios-h{--opacity:.5;pointer-events:none}.button-disabled.sc-ion-button-ios-h   .button-native.sc-ion-button-ios{cursor:default;pointer-events:none}.button-solid.sc-ion-button-ios-h{--background:var(--ion-color-primary,#3880ff);--background-focused:var(--ion-color-primary-shade,#3171e0);--background-hover:rgba(var(--ion-color-primary-rgb,56,128,255),0.92);--color:var(--ion-color-primary-contrast,#fff);--color-activated:var(--ion-color-primary-contrast,#fff);--color-focused:var(--ion-color-primary-contrast,#fff)}.button-solid.ion-color.sc-ion-button-ios-h   .button-native.sc-ion-button-ios{background:var(--ion-color-base);color:var(--ion-color-contrast)}.button-solid.ion-color.ion-focused.sc-ion-button-ios-h   .button-native.sc-ion-button-ios{background:var(--ion-color-shade)}.button-outline.sc-ion-button-ios-h{--border-color:var(--ion-color-primary,#3880ff);--background:transparent;--color:var(--ion-color-primary,#3880ff);--color-focused:var(--ion-color-primary,#3880ff)}.button-outline.ion-color.sc-ion-button-ios-h   .button-native.sc-ion-button-ios{border-color:var(--ion-color-base);background:transparent;color:var(--ion-color-base)}.button-outline.ion-focused.ion-color.sc-ion-button-ios-h   .button-native.sc-ion-button-ios{background:rgba(var(--ion-color-base-rgb),.1);color:var(--ion-color-base)}.button-clear.sc-ion-button-ios-h{--border-width:0;--background:transparent;--color:var(--ion-color-primary,#3880ff)}.button-clear.ion-color.sc-ion-button-ios-h   .button-native.sc-ion-button-ios{background:transparent;color:var(--ion-color-base)}.button-clear.ion-focused.ion-color.sc-ion-button-ios-h   .button-native.sc-ion-button-ios{background:rgba(var(--ion-color-base-rgb),.1);color:var(--ion-color-base)}.button-clear.activated.ion-color.sc-ion-button-ios-h   .button-native.sc-ion-button-ios{background:transparent}.button-block.sc-ion-button-ios-h{display:block}.button-block.sc-ion-button-ios-h   .button-native.sc-ion-button-ios{margin-left:0;margin-right:0;display:block;width:100%;clear:both;contain:content}.button-block.sc-ion-button-ios-h   .button-native.sc-ion-button-ios:after{clear:both}.button-full.sc-ion-button-ios-h{display:block}.button-full.sc-ion-button-ios-h   .button-native.sc-ion-button-ios{margin-left:0;margin-right:0;display:block;width:100%;contain:content}.button-full.sc-ion-button-ios-h:not(.button-round)   .button-native.sc-ion-button-ios{border-radius:0;border-right-width:0;border-left-width:0}.button-native.sc-ion-button-ios{border-radius:var(--border-radius);-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;display:block;position:relative;width:100%;height:100%;-webkit-transition:var(--transition);transition:var(--transition);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);outline:none;background:var(--background);line-height:1;-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);contain:layout style;cursor:pointer;opacity:var(--opacity);overflow:var(--overflow);z-index:0;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none;-moz-appearance:none;appearance:none}\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.button-native.sc-ion-button-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.button-native.sc-ion-button-ios::-moz-focus-inner{border:0}.button-inner.sc-ion-button-ios{display:-ms-flexbox;display:flex;-ms-flex-flow:row nowrap;flex-flow:row nowrap;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;width:100%;height:100%}.sc-ion-button-ios-s > ion-icon{font-size:1.4em;pointer-events:none}.sc-ion-button-ios-s > ion-icon[slot=start]{margin-left:-.3em;margin-right:.3em;margin-top:0;margin-bottom:0}\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.sc-ion-button-ios-s > ion-icon[slot=start]{margin-left:unset;margin-right:unset;-webkit-margin-start:-.3em;margin-inline-start:-.3em;-webkit-margin-end:.3em;margin-inline-end:.3em}}.sc-ion-button-ios-s > ion-icon[slot=end]{margin-left:.3em;margin-right:-.2em;margin-top:0;margin-bottom:0}\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.sc-ion-button-ios-s > ion-icon[slot=end]{margin-left:unset;margin-right:unset;-webkit-margin-start:.3em;margin-inline-start:.3em;-webkit-margin-end:-.2em;margin-inline-end:-.2em}}.sc-ion-button-ios-s > ion-icon[slot=icon-only]{font-size:1.8em}ion-ripple-effect.sc-ion-button-ios{color:var(--ripple-color)}.ion-focused.sc-ion-button-ios-h   .button-native.sc-ion-button-ios{background:var(--background-focused);color:var(--color-focused)}.activated.sc-ion-button-ios-h   .button-native.sc-ion-button-ios{background:var(--background-activated);color:var(--color-activated)}\@media (any-hover:hover){.sc-ion-button-ios-h:hover   .button-native.sc-ion-button-ios{background:var(--background-hover);color:var(--color-hover)}}.sc-ion-button-ios-h{--border-radius:10px;--padding-top:0;--padding-bottom:0;--padding-start:1em;--padding-end:1em;--transition:background-color,opacity 100ms linear;margin-left:2px;margin-right:2px;margin-top:4px;margin-bottom:4px;height:2.8em;font-size:16px;font-weight:500;letter-spacing:-.03em}\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.sc-ion-button-ios-h{margin-left:unset;margin-right:unset;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:2px;margin-inline-end:2px}}.button-solid.sc-ion-button-ios-h{--background-activated:var(--ion-color-primary-shade,#3171e0)}.button-solid.activated.sc-ion-button-ios-h{--opacity:1}.button-solid.activated.ion-color.sc-ion-button-ios-h   .button-native.sc-ion-button-ios{background:var(--ion-color-shade)}.button-outline.sc-ion-button-ios-h{--border-radius:10px;--border-width:1px;--border-style:solid;--background-activated:var(--ion-color-primary,#3880ff);--background-focused:rgba(var(--ion-color-primary-rgb,56,128,255),0.1);--color-activated:var(--ion-color-primary-contrast,#fff)}.button-outline.activated.ion-color.sc-ion-button-ios-h   .button-native.sc-ion-button-ios{background:var(--ion-color-base);color:var(--ion-color-contrast)}.button-clear.activated.sc-ion-button-ios-h{--opacity:0.4}.button-clear.sc-ion-button-ios-h{--background-activated:transparent;--background-focused:rgba(var(--ion-color-primary-rgb,56,128,255),0.1);--color-activated:var(--ion-color-primary,#3880ff);--color-focused:var(--ion-color-primary,#3880ff)}.button-large.sc-ion-button-ios-h{--border-radius:12px;--padding-top:0;--padding-start:1em;--padding-end:1em;--padding-bottom:0;height:2.8em;font-size:20px}.button-small.sc-ion-button-ios-h{--border-radius:6px;--padding-top:0;--padding-start:0.9em;--padding-end:0.9em;--padding-bottom:0;height:2.1em;font-size:13px}.button-round.sc-ion-button-ios-h{--border-radius:64px;--padding-top:0;--padding-start:26px;--padding-end:26px;--padding-bottom:0}.button-strong.sc-ion-button-ios-h{font-weight:600}\@media (any-hover:hover){.button-solid.sc-ion-button-ios-h:hover{--opacity:0.8}.button-clear.sc-ion-button-ios-h:hover, .button-outline.sc-ion-button-ios-h:hover{--opacity:0.6}.ion-focused.sc-ion-button-ios-h:hover{--background-hover:var(--background-focused);--color-hover:var(--color-focused)}.activated.sc-ion-button-ios-h:hover{--background-hover:var(--background-activated);--color-hover:var(--color-activated)}}"; }, enumerable: !0, configurable: !0 }), Object.defineProperty(t, "styleMode", { get: function () { return "ios"; }, enumerable: !0, configurable: !0 }), t; }();
exports.IonButton = Button;
