/*!
 * (C) Ionic http://ionicframework.com - MIT License
 */
'use strict';

var index = require('./index-D6Wc6v08.js');
var ionicGlobal = require('./ionic-global-DpRwOXLK.js');

const backdropIonicCss = ":host{right:0;left:0;top:0;bottom:0;display:block;position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0);contain:strict;cursor:pointer;opacity:0.01;-ms-touch-action:none;touch-action:none}:host(.backdrop-hide){background:transparent}:host(.backdrop-no-tappable){cursor:auto}:host{background-color:rgba(var(--token-primitives-base-black-rgb, 17, 17, 17), 0.7);z-index:2}";

const backdropIosCss = ":host{right:0;left:0;top:0;bottom:0;display:block;position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0);contain:strict;cursor:pointer;opacity:0.01;-ms-touch-action:none;touch-action:none}:host(.backdrop-hide){background:transparent}:host(.backdrop-no-tappable){cursor:auto}:host{z-index:2}:host{background-color:var(--ion-backdrop-color, #000)}";

const backdropMdCss = ":host{right:0;left:0;top:0;bottom:0;display:block;position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0);contain:strict;cursor:pointer;opacity:0.01;-ms-touch-action:none;touch-action:none}:host(.backdrop-hide){background:transparent}:host(.backdrop-no-tappable){cursor:auto}:host{z-index:2}:host{background-color:var(--ion-backdrop-color, #000)}";

const Backdrop = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        this.ionBackdropTap = index.createEvent(this, "ionBackdropTap", 7);
        /**
         * If `true`, the backdrop will be visible.
         */
        this.visible = true;
        /**
         * If `true`, the backdrop will can be clicked and will emit the `ionBackdropTap` event.
         */
        this.tappable = true;
        /**
         * If `true`, the backdrop will stop propagation on tap.
         */
        this.stopPropagation = true;
    }
    onMouseDown(ev) {
        this.emitTap(ev);
    }
    emitTap(ev) {
        if (this.stopPropagation) {
            ev.preventDefault();
            ev.stopPropagation();
        }
        if (this.tappable) {
            this.ionBackdropTap.emit();
        }
    }
    render() {
        const theme = ionicGlobal.getIonTheme(this);
        return (index.h(index.Host, { key: '730d0808e1043510fda404686d9883d83c0f31a4', "aria-hidden": "true", class: {
                [theme]: true,
                'backdrop-hide': !this.visible,
                'backdrop-no-tappable': !this.tappable,
            } }));
    }
};
Backdrop.style = {
    ionic: backdropIonicCss,
    ios: backdropIosCss,
    md: backdropMdCss
};

exports.ion_backdrop = Backdrop;
