/**
 * Copyright 2019 The Pennsylvania State University
 * @license Apache-2.0, see License.md for full text.
 */
import{LitElement as e}from"../../../../../lit/index.js";import{store as t}from"../../core/haxcms-site-store.js";import{autorun as i,toJS as s}from"../../../../../mobx/dist/mobx.esm.js";class SiteQueryMenuSlice extends e{static get tag(){return"site-query-menu-slice"}constructor(){super(),this.__disposer=[],this.start=0,this.end=1e3,this.dynamicMethodology="active",this.fixedId=!1,this.noDynamicLevel=!1}static get properties(){return{start:{type:Number},end:{type:Number},parent:{type:String},dynamicMethodology:{type:String,attribute:"dynamic-methodology"},fixedId:{type:Boolean,attribute:"fixed-id"},noDynamicLevel:{type:Boolean,attribute:"no-dynamic-level"},result:{type:Array},_routerManifest:{type:Object}}}updated(e){e.forEach(((e,t)=>{["start","end","parent","dynamicMethodology","_routerManifest","noDynamicLevel"].includes(t)&&(this.result=this._computeItems(this.start,this.end,this.parent,this.dynamicMethodology,this._routerManifest,this.noDynamicLevel),this.dispatchEvent(new CustomEvent("result-changed",{detail:this.result})))}))}_computeItems(e,i,s,r,o,n){if(o)return t.computeItems(e,i,s,r,o,n)}firstUpdated(e){i((e=>{this._routerManifest=Object.assign({},s(t.routerManifest)),this.__disposer.push(e)})),this.fixedId||i((e=>{this.parent=s(t.activeId),this.__disposer.push(e)}))}disconnectedCallback(){for(var e in this.__disposer)this.__disposer[e].dispose();super.disconnectedCallback()}}customElements.define(SiteQueryMenuSlice.tag,SiteQueryMenuSlice);export{SiteQueryMenuSlice};