'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var _commonjsHelpers = require('../../../../../../../../_virtual/_commonjsHelpers.js');
require('../../../../../../../../_virtual/mixin.js');
var mixin = require('../../utils/mixin.js');

'use strict';

const Mixin = mixin.mixin;

class LocationInfoOpenElementStackMixin extends Mixin {
    constructor(stack, opts) {
        super(stack);

        this.onItemPop = opts.onItemPop;
    }

    _getOverriddenMethods(mxn, orig) {
        return {
            pop() {
                mxn.onItemPop(this.current);
                orig.pop.call(this);
            },

            popAllUpToHtmlElement() {
                for (let i = this.stackTop; i > 0; i--) {
                    mxn.onItemPop(this.items[i]);
                }

                orig.popAllUpToHtmlElement.call(this);
            },

            remove(element) {
                mxn.onItemPop(this.current);
                orig.remove.call(this, element);
            }
        };
    }
}

var openElementStackMixin = LocationInfoOpenElementStackMixin;

var openElementStackMixin_default = /*@__PURE__*/_commonjsHelpers.getDefaultExportFromCjs(openElementStackMixin);

exports.default = openElementStackMixin_default;
exports.openElementStackMixin = openElementStackMixin;
//# sourceMappingURL=open-element-stack-mixin.js.map
