text: define(["exports","require","../hax-body/lib/hax-store.js"],(function(e,t,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HAX=void 0,t=babelHelpers.interopRequireWildcard(t);
  /**
     * Copyright 2019 The Pennsylvania State University
     * @license Apache-2.0, see License.md for full text.
     */
  class HAX extends HTMLElement{get html(){return"\n<style>\n:host {\n  display: block;\n  font-size: var(--haxcms-base-styles-body-font-size, 16px);\n  font-family: var(--haxcms-base-styles-body-font-family, 'Noto Serif', serif);\n  line-height: var(--haxcms-base-styles-body-line-height, 1.8);\n  letter-spacing: var(--haxcms-base-styles-body-letter-spacing, .5px);\n}\n\n:host([hidden]) {\n  display: none;\n}\n\nhax-body {\n  font-size: var(--haxcms-base-styles-body-font-size, 16px);\n  font-family: var(--haxcms-base-styles-body-font-family, 'Noto Serif', serif);\n  line-height: var(--haxcms-base-styles-body-line-height, 1.8);\n  letter-spacing: var(--haxcms-base-styles-body-letter-spacing, .5px);\n}\n\nh1 {\n  font-size: var(--hax-base-styles-h1-font-size, 2.5em);\n  line-height: var(--hax-base-styles-h1-line-height, 2.5em);\n}\n\nh2 {\n  font-size: var(--hax-base-styles-h2-font-size, 2em);\n}\n\nh3 {\n  font-size: var(--hax-base-styles-h3-font-size, 1.75em);\n}\n\nh4 {\n  font-size: var(--hax-base-styles-h4-font-size, 1.5em);\n}\n\nh5 {\n  font-size: var(--hax-base-styles-h5-font-size, 1.25em);  \n}\n\nh6 {\n  font-size: var(--hax-base-styles-h6-font-size, 1.25em);\n}\n\np {\n  min-height: var(--hax-base-styles-p-min-height, 43px);\n  font-size: var(--hax-base-styles-p-font-size, 24px);\n  line-height: var(--hax-base-styles-p-line-height, 1.8);\n  letter-spacing: var(--hax-base-styles-p-letter-spacing, .5px);\n}\n\na,\na:-webkit-any-link {\n  color: var(--hax-base-styles-a-color, #2196f3);\n  font-size: var(--hax-base-styles-a-font-size, 24px);\n  font-weight: var(--hax-base-styles-a-font-weight, normal);\n}\n\na:visited {\n  color: var(--hax-base-styles-a-color-visited, #2196f3);\n}\n\na:active,\na:focus,\na:hover {\n  color: var(--hax-base-styles-a-color-active, #2196f3);\n  font-weight: var(--hax-base-styles-a-font-weight-active, normal);\n}\n\nol,\nul\nol li,\nul li {\n  line-height: var(--hax-base-styles-list-line-height, 1.8);\n  font-size: var(--hax-base-styles-list-font-size, 24px);\n  max-width: var(--hax-base-styles-list-max-width, 28em);\n}\n\nul ul,\nul ol,\nol ul,\nol ol {\n  padding-bottom: unset;\n}\n\nul,\nol {\n  padding-left: var(--hax-base-styles-list-padding-left, 1em);\n  margin-left: var(--hax-base-styles-list-margin-left, 1em);\n}\n        </style>\n<hax-body>\n    <slot></slot>\n</hax-body>"}static get properties(){return{...super.properties}}static get tag(){return"h-a-x"}constructor(e=!1){super(),this.tag=HAX.tag,this.template=document.createElement("template"),this.attachShadow({mode:"open"}),e||this.render(),window.addEventListener("hax-store-ready",this.storeReady.bind(this)),window.addEventListener("hax-store-app-store-loaded",this.appStoreReady.bind(this)),new Promise((e,n)=>t.default(["./lib/h-a-x-dependencies.js"],e,n))}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this.__HAXApplied||window.__HAXApplied||(window.__HAXApplied=this.__HAXApplied=this.applyHAX())}storeReady(e){e.detail&&setTimeout(()=>{try{let e={...JSON.parse(this.getAttribute("app-store"))};"object"==typeof e&&(window.HaxStore.instance.appStore=e)}catch(e){console.log(e)}"hide-panel-ops"===this.hidePanelOps&&(this.hidePanelOps=!0),window.HaxStore.instance.haxTray.hidePanelOps=this.hidePanelOps,window.HaxStore.instance.haxTray.offsetMargin=this.offsetMargin,window.HaxStore.instance.haxTray.elementAlign=this.elementAlign},0)}appStoreReady(e){if(e.detail&&this.shadowRoot.querySelector("slot")){const e=this.shadowRoot.querySelector("slot").assignedNodes();let t="";for(let n in e)void 0!==e[n].outerHTML&&(t+=e[n].outerHTML);window.HaxStore.instance.activeHaxBody.importContent(t)}}render(){this.__rendered||(this.__rendered=!0,this.shadowRoot.innerHTML=null,this.template.innerHTML=this.html,this.shadowRoot.appendChild(this.template.content.cloneNode(!0)))}applyHAX(){window.HaxStore.requestAvailability();let e=document.createElement("hax-tray");return e.hidePanelOps=this.hidePanelOps,e.elementAlign=this.elementAlign,document.body.appendChild(e),document.body.appendChild(document.createElement("hax-app-picker")),document.body.appendChild(document.createElement("hax-preferences-dialog")),document.body.appendChild(document.createElement("hax-export-dialog")),document.body.appendChild(document.createElement("hax-autoloader")),!0}disconnectedCallback(){window.removeEventListener("hax-store-ready",this.storeReady.bind(this)),window.removeEventListener("hax-store-ready",this.appStoreReady.bind(this)),super.disconnectedCallback&&super.disconnectedCallback()}static get observedAttributes(){return["element-align","offset-margin","app-store","hide-panel-ops"]}get elementAlign(){return this.getAttribute("element-align")}set elementAlign(e){this.__rendered&&(this.setAttribute("element-align",e),window.HaxStore.instance.haxTray.elementAlign=e)}get offsetMargin(){return this.getAttribute("offset-margin")}set offsetMargin(e){this.setAttribute("offset-margin",e),this.__rendered&&(window.HaxStore.instance.haxTray.offsetMargin=e)}get hidePanelOps(){return this.getAttribute("hide-panel-ops")}set hidePanelOps(e){e&&(this.setAttribute("hide-panel-ops","hide-panel-ops"),this.__rendered&&(window.HaxStore.instance.haxTray.hidePanelOps=e))}get appStore(){return this.getAttribute("app-store")}set appStore(e){console.log(e),this.setAttribute("app-store",e),this.__rendered&&(window.HaxStore.instance.appStore={...JSON.parse(this.getAttribute("app-store"))})}attributeChangedCallback(e,t,n){}}e.HAX=HAX,window.customElements.define("h-a-x",HAX)}));