{"version":3,"sources":["jsdelivr-header.js","/npm/@lrnwebcomponents/simple-toolbar@8.0.2/simple-toolbar.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;;;OCFS,WAAY,KAAM,QAAW,YAC/B,4CACA,sCACA,8CACE,kCAAqC,iCAK9C,MAAM,uBAAyB,SAAU,GACvC,OAAO,cAAc,EAKnB,cAAW,GACT,MAAO,gBACT,CAGA,uBAAW,GACT,MAAO,CACL,GAAG;;;;;UAOP,CAGA,qBAAW,GACT,MAAO,CACL,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA4EP,CAEA,iBAAW,GACT,MAAO,IAAI,KAAK,cAAe,KAAK,aACtC,CAGA,qBAAW,GACT,MAAO,IACF,8BAIH,eAAgB,CACd,KAAM,iBACN,KAAM,QACN,UAAW,kBACX,SAAS,GAKX,aAAc,CACZ,KAAM,eACN,KAAM,OACN,UAAW,gBACX,SAAS,GAKX,UAAW,CACT,KAAM,YACN,KAAM,OACN,UAAW,aACX,SAAS,GAKX,UAAW,CACT,KAAM,YACN,KAAM,QACN,UAAW,YACX,SAAS,GAMX,OAAQ,CACN,KAAM,SACN,KAAM,MACN,UAAW,UAKb,GAAI,CACF,KAAM,KACN,KAAM,OACN,UAAW,KACX,SAAS,GAMX,cAAe,CACb,KAAM,gBACN,UAAW,iBACX,KAAM,QAMR,aAAc,CACZ,KAAM,eACN,UAAW,gBACX,KAAM,QAKR,OAAQ,CACN,KAAM,SACN,KAAM,QACN,UAAW,SACX,SAAS,GAKX,UAAW,CACT,KAAM,YACN,KAAM,OAKR,iBAAkB,CAChB,KAAM,QACN,UAAW,oBACX,SAAS,GAKX,UAAW,CACT,KAAM,YACN,KAAM,SAKR,UAAW,CACT,KAAM,YACN,KAAM,SAGZ,CAGA,MAAA,GACE,OAAO,KAAK,eACd,CAOA,WAAI,GACF,OAAO,KAAK,SACd,CAOA,W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,EAAE,UACN,IAAY,EAAO,SACnB,IAAa,EAAO,WACnB,EAAO,IAAM,EAAO,MAAQ,GAAO,KAC7B,EAAc,EACnB,IAED,CACT,EAEJ,EA6BA,MAAM,sBAAsB,uBAAuB,cACnD,eAAe,OAAO,iBAAkB,sBAC/B,cAAe","file":"/npm/@lrnwebcomponents/simple-toolbar@8.0.2/simple-toolbar.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.37.0.\n * Original file: /npm/@lrnwebcomponents/simple-toolbar@8.0.2/simple-toolbar.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\n * Copyright 2021 The Pennsylvania State University\n * @license Apache-2.0, see License.md for full text.\n */\nimport { LitElement, html, css } from \"lit\";\nimport \"./lib/simple-toolbar-more-button.js\";\nimport \"./lib/simple-toolbar-field.js\";\nimport \"./lib/simple-toolbar-button-group.js\";\nimport { SimpleToolbarGlobalProperties } from \"./lib/simple-toolbar-button.js\";\n/**\n * @customElement\n * @class\n */\nconst SimpleToolbarBehaviors = function (SuperClass) {\n  return class extends SuperClass {\n    /**\n     * Store the tag name to make it easier to obtain directly.\n     * @notice function name must be here for tooling to operate correctly\n     */\n    static get tag() {\n      return \"simple-toolbar\";\n    }\n\n    // render function for styles\n    static get stickyStyles() {\n      return [\n        css`\n          :host([sticky]) {\n            position: sticky;\n            top: 0;\n          }\n        `,\n      ];\n    }\n\n    // render function for styles\n    static get baseStyles() {\n      return [\n        css`\n          :host {\n            position: relative;\n            display: flex;\n            align-items: flex-start;\n            opacity: 1;\n            z-index: 2;\n            margin: 0;\n            justify-content: space-between;\n            background-color: var(--simple-toolbar-bg);\n            font-size: inherit;\n            margin: 0;\n            padding: 0;\n            transition: all 0.5s;\n            transition: z-index 0s;\n          }\n          :host([hidden]) {\n            z-index: -1;\n            visibility: hidden;\n            opacity: 0;\n            height: 0;\n          }\n          :host([disabled]) {\n            opacity: 0.6;\n            pointer-events: none;\n          }\n          :host(:focus-within) {\n            border: 1px solid\n              var(\n                --simple-toolbar-hover-border-color,\n                var(--simple-toolbar-button-hover-border-color)\n              );\n          }\n          #buttons {\n            flex-wrap: wrap;\n            display: flex;\n            justify-content: flex-start;\n            flex: 1 1 auto;\n            overflow-y: visible;\n          }\n          #morebutton {\n            flex: 0 0 auto;\n          }\n          ::slotted(.group) {\n            display: flex;\n            flex-wrap: wrap;\n            justify-content: space-evenly;\n            align-items: stretch;\n            margin: 0;\n            flex: 0 1 auto;\n            overflow-y: visible;\n            border-width: 0px;\n            border-style: solid;\n            padding: var(--simple-toolbar-group-padding, 0 3px);\n            border-color: var(\n              --simple-toolbar-border-color,\n              var(--simple-toolbar-group-border-color, transparent)\n            );\n          }\n          ::slotted(.group:not(:last-child)) {\n            border-right-width: var(\n              --simple-toolbar-group-border-width,\n              var(--simple-toolbar-border-width, 1px)\n            );\n          }\n          ::slotted(*:hover),\n          ::slotted(*:focus-wthin) {\n            z-index: var(--simple-toolbar-focus-z-index, 100);\n            transition: z-index 0s;\n          }\n          :host([collapsed]:not([always-expanded]))\n            ::slotted(*[collapse-hide]) {\n            display: none !important;\n          }\n        `,\n      ];\n    }\n\n    static get styles() {\n      return [...this.baseStyles, ...this.stickyStyles];\n    }\n\n    // properties available to custom element for data binding\n    static get properties() {\n      return {\n        ...SimpleToolbarGlobalProperties,\n        /**\n         * always expanded so more button is unnecessary?\n         */\n        alwaysExpanded: {\n          name: \"alwaysExpanded\",\n          type: Boolean,\n          attribute: \"always-expanded\",\n          reflect: true,\n        },\n        /**\n         * id of element controlled by toolbar\n         */\n        ariaControls: {\n          name: \"ariaControls\",\n          type: String,\n          attribute: \"aria-controls\",\n          reflect: true,\n        },\n        /**\n         * label for the toolbar\n         */\n        ariaLabel: {\n          name: \"ariaLabel\",\n          type: String,\n          attribute: \"aria-label\",\n          reflect: true,\n        },\n        /**\n         * is toolbar collapsed?\n         */\n        collapsed: {\n          name: \"collapsed\",\n          type: Boolean,\n          attribute: \"collapsed\",\n          reflect: true,\n        },\n        /**\n         * Custom configuration of toolbar groups and buttons.\n         * (See default value for example using default configuration.)\n         */\n        config: {\n          name: \"config\",\n          type: Array,\n          attribute: \"config\",\n        },\n        /**\n         * unique id\n         */\n        id: {\n          name: \"id\",\n          type: String,\n          attribute: \"id\",\n          reflect: true,\n        },\n        /**\n         * Optional space-separated list of keyboard shortcuts for editor\n         * to fire this button, see iron-a11y-keys for more info.\n         */\n        moreShortcuts: {\n          name: \"moreShortcuts\",\n          attribute: \"more-shortcuts\",\n          type: Object,\n        },\n        /**\n         * Optional space-sperated list of keyboard shortcuts for editor\n         * to fire this button, see iron-a11y-keys for more info.\n         */\n        shortcutKeys: {\n          name: \"shortcutKeys\",\n          attribute: \"shortcut-keys\",\n          type: Object,\n        },\n        /**\n         * Should toolbar stick to top so that it is always visible?\n         */\n        sticky: {\n          name: \"sticky\",\n          type: Boolean,\n          attribute: \"sticky\",\n          reflect: true,\n        },\n        /**\n         * raw array of buttons\n         */\n        __buttons: {\n          name: \"__buttons\",\n          type: Array,\n        },\n        /**\n         * whether there is no need to collapse\n         */\n        collapseDisabled: {\n          type: Boolean,\n          attribute: \"collapse-disabled\",\n          reflect: true,\n        },\n        /**\n         * whether toolbar has focus\n         */\n        __focused: {\n          name: \"__focused\",\n          type: Boolean,\n        },\n        /**\n         * whether toolbar is hovered\n         */\n        __hovered: {\n          name: \"__hovered\",\n          type: Boolean,\n        },\n      };\n    }\n\n    // render function for template\n    render() {\n      return this.toolbarTemplate;\n    }\n    /**\n     * array of rendered buttons\n     *\n     * @readonly\n     * @memberof SimpleToolbar\n     */\n    get buttons() {\n      return this.__buttons;\n    }\n    /**\n     * does toolbar have focus\n     *\n     * @readonly\n     * @memberof SimpleToolbar\n     */\n    get focused() {\n      return this.__focused;\n    }\n    /**\n     * is mouseover toolbar\n     *\n     * @readonly\n     * @memberof SimpleToolbar\n     */\n    get hovered() {\n      return this.__hovered;\n    }\n\n    /**\n     * more button's template\n     *\n     * @readonly\n     * @memberof SimpleToolbar\n     */\n    get moreButton() {\n      return html` <simple-toolbar-more-button\n        id=\"morebutton\"\n        align-horizontal=\"${this.alignHorizontal}\"\n        align-vertical=\"${this.alignVertical}\"\n        aria-controls=\"buttons\"\n        class=\"button\"\n        @click=\"${(e) => (this.collapsed = !this.collapsed)}\"\n        ?disabled=${this.collapseDisabled}\n        @toggle=\"${(e) => (this.collapsed = !this.collapsed)}\"\n        ?hidden=${this.collapseDisabled}\n        icon=\"${this.icon}\"\n        icon-position=\"${this.iconPosition}\"\n        label=\"${this.label}\"\n        shortcut=\"${this.shortcut}\"\n        ?show-text-label=\"${this.showTextLabel}\"\n        ?toggled=\"${!this.collapsed}\"\n        toggled-icon=\"${this.toggledIcon}\"\n        toggled-label=\"${this.toggledLabel}\"\n        toggled-tooltip=\"${this.toggledTooltip}\"\n        tooltip-direction=\"${this.tooltipDirection}\"\n        part=\"morebutton\"\n      >\n      </simple-toolbar-more-button>`;\n    }\n\n    /**\n     * toolbar element's template\n     *\n     * @readonly\n     * @memberof SimpleToolbar\n     */\n    get toolbarTemplate() {\n      return html`\n        <div\n          id=\"buttons\"\n          class=\"${!this.alwaysExpanded && this.collapsed ? \"collapsed\" : \"\"}\"\n          part=\"buttons\"\n        >\n          <slot></slot>\n        </div>\n        ${this.alwaysExpanded ? \"\" : this.moreButton}\n      `;\n    }\n\n    // life cycle\n    constructor() {\n      super();\n      this.windowControllers = new AbortController();\n      this.collapsed = true;\n      this.collapseDisabled = false;\n      this.config = [];\n      this.__buttons = [];\n      this.__focused = false;\n      this.__hovered = false;\n      this.alignVertical = \"center\";\n      this.alignHorizontal = \"center\";\n      this.icon = \"more-vert\";\n      this.label = \"More Buttons\";\n      this.toggledLabel = \"Less Buttons\";\n      this.iconPosition = \"left\";\n      this.showTextLabel = false;\n      this.shortcut = \"ctrl+shift+;\";\n      this.sticky = false;\n      this.shortcutKeys = {};\n      this._handleResize = this._handleResize.bind(this);\n      this.addEventListener(\"register-button\", this._handleButtonRegister);\n      this.addEventListener(\"deregister-button\", this._handleButtonDeregister);\n      this.addEventListener(\"update-button-registry\", this._handleButtonUpdate);\n      this.addEventListener(\"toggle-toolbar\", this._handleToggleToolbar);\n    }\n    /**\n     * Called every time the element is inserted into the DOM. Useful for\n     * running setup code, such as fetching resources or rendering.\n     * Generally, you should try to delay work until this time.\n     */\n    connectedCallback() {\n      super.connectedCallback();\n      if (this.collapsed) {\n        window.addEventListener(\"resize\", this._handleResize, {\n          signal: this.windowControllers.signal,\n        });\n      }\n      this.addEventListener(\"keypress\", this._handleShortcutKeys);\n    }\n    /**\n     * Called every time the element is removed from the DOM. Useful for\n     * running clean up code (removing event listeners, etc.).\n     */\n    disconnectedCallback() {\n      if (this.collapsed) {\n        this.windowControllers.abort();\n      }\n      this.removeEventListener(\"keypress\", this._handleShortcutKeys);\n      super.disconnectedCallback();\n    }\n    firstUpdated(changedProperties) {\n      this.setAttribute(\"aria-live\", \"polite\");\n      this.setAttribute(\"role\", \"toolbar\");\n      this.onfocus = (e) => (this.__focused = true);\n      this.onblur = (e) => (this.__focused = false);\n      this.onmouseover = (e) => (this.__hovered = true);\n      this.onmouseout = (e) => (this.__hovered = false);\n      this.addEventListener(\"keydown\", this._handleKeydown);\n      if (super.firstUpdated) super.firstUpdated(changedProperties);\n    }\n    updated(changedProperties) {\n      if (super.updated) super.updated(changedProperties);\n      changedProperties.forEach((oldValue, propName) => {\n        if (propName === \"config\") this.updateToolbar();\n        if (propName === \"collapsed\") {\n          if (this.collapsed) {\n            this.resizeToolbar();\n            this.windowControllers = new AbortController();\n            window.addEventListener(\"resize\", this._handleResize, {\n              signal: this.windowControllers.signal,\n            });\n          } else {\n            this.windowControllers.abort();\n          }\n        }\n        if (propName === \"hidden\")\n          this.setAttribute(\"aria-hidden\", this.hidden ? \"true\" : \"false\");\n      });\n      if (!this.currentItem && this.buttons)\n        this.setCurrentItem(this.buttons[0]);\n      this.resizeToolbar();\n    }\n    /**\n     * adds a button to a div\n     *\n     * @param {object} config object containing configuration for a button\n     * @param {object} div element that acts as a button group\n     * @returns {object} button element\n     * @memberof SimpleToolbar\n     */\n    addButton(config, div) {\n      let button = this._renderButton(config);\n      div = div || this;\n      div.appendChild(button);\n      return button;\n    }\n    /**\n     * adds a group of buttons to a parent container\n     *\n     * @param {object} config object containing configuration for a group of buttons\n     * @param {object} container parent node\n     * @returns {object} div element as a button group\n     * @memberof SimpleToolbar\n     */\n    addButtonGroup(config = {}, parent) {\n      if (!config.buttons || config.buttons.length < 1) return;\n      let group = this._renderButtonGroup(config);\n      (parent || this).appendChild(group);\n      this._addConfigItems(config.buttons, group);\n      return group;\n    }\n    /**\n     * empties toolbar and registered buttons\n     *\n     * @returns\n     * @memberof SimpleToolbar\n     */\n    clearToolbar() {\n      this.innerHTML = \"\";\n      this.__buttons = [];\n      this.shortcutKeys = {};\n      this.shortcutKeys[this.shortcut] = this.shadowRoot\n        ? this.shadowRoot.querySelector(\"#morebutton\")\n        : undefined;\n    }\n    /**\n     * removes registered button when moved/removed\n     *\n     * @param {object} button button node\n     * @memberof SimpleToolbar\n     */\n    deregisterButton(button) {\n      this.__buttons = this.__buttons.filter((b) => b !== button);\n      (button.shortcutKeys || \"\")\n        .split(\" \")\n        .forEach((key) => delete this.shortcutKeys[key]);\n      button.removeEventListener(\"blur\", (e) =>\n        this._handleFocusChange(button),\n      );\n      button.removeEventListener(\"focus\", (e) =>\n        this._handleFocusChange(button),\n      );\n    }\n    /**\n     * registers button when appended\n     *\n     * @param {object} button button node\n     * @memberof SimpleToolbar\n     */\n    registerButton(button) {\n      this.__buttons.push(button);\n      this.__buttons = [...new Set(this.__buttons)];\n      (button.shortcutKeys || \"\")\n        .split(\" \")\n        .forEach((key) => (this.shortcutKeys[key] = button));\n      if (button.role !== \"menuitem\") button.isCurrentItem = false;\n      button.addEventListener(\"blur\", (e) => this._handleFocusChange(button));\n      button.addEventListener(\"focus\", (e) => this._handleFocusChange(button));\n      if (!this.currentItem) this.setCurrentItem(button);\n    }\n    /**\n     * resizes toolbar based on element positions\n     *\n     */\n    resizeToolbar() {\n      if (this.alwaysExpanded) return;\n      if (!this.collapsed) return;\n      let items = [...(this.children || [])],\n        shown = true;\n      items.forEach((item) => {\n        if (item.removeAttribute) item.removeAttribute(\"collapse-hide\");\n        if (item.offsetTop && item.offsetTop > 0) {\n          item.setAttribute(\"collapse-hide\", true);\n          shown = false;\n        } else if (!shown) {\n          item.setAttribute(\"collapse-hide\", true);\n        }\n      });\n      this.collapseDisabled = !!shown;\n      if (!this.currentItem) this.setCurrentItem(this.firstItem);\n    }\n    /**\n     * gets first main menu item\n     *\n     * @readonly\n     */\n    get firstItem() {\n      return !this.mainItems ? undefined : this.mainItems[0];\n    }\n    /**\n     * gets next main menu item\n     *\n     * @readonly\n     */\n    get nextItem() {\n      return this.getItem();\n    }\n    /**\n     * gets next main menu item\n     *\n     * @readonly\n     */\n    get previousItem() {\n      return this.getItem(-1);\n    }\n    /**\n     * gets last main menu item\n     *\n     * @readonly\n     */\n    get lastItem() {\n      return !this.buttons\n        ? undefined\n        : this.mainItems[this.mainItems.length - 1];\n    }\n    /**\n     * gets main menu items\n     *\n     * @readonly\n     */\n    get mainItems() {\n      return this.buttons.filter((b) => b.role !== \"menuitem\");\n    }\n    /**\n     * gets button's index in main menu\n     *\n     * @param {object} [item=this.currentItem]\n     * @returns\n     */\n    getItemIndex(item = this.currentItem) {\n      let index = -1;\n      this.mainItems.forEach((b, i) => {\n        if (b === item) index = i;\n      });\n      return index;\n    }\n    /**\n     * gets previous or next item based on offset\n     *\n     * @param {number} [offset=1]\n     * @returns\n     */\n    getItem(offset = 1) {\n      let index = this.getItemIndex(this.currentItem) + offset;\n      return !this.mainItems || index < 0 || this.mainItems.length <= index\n        ? undefined\n        : this.mainItems[index];\n    }\n    /**\n     * sets current item\n     *\n     * @param {object} item\n     */\n    setCurrentItem(item) {\n      if (this.currentItem) this.currentItem.isCurrentItem = false;\n      if (item && item.closest(\"[collapse-hide=true]\")) this.collapsed = false;\n      this.currentItem = item;\n      if (this.currentItem) this.currentItem.isCurrentItem = true;\n    }\n    /**\n     * focuses on an item\n     *\n     * @param {object} item\n     */\n    focusOn(item) {\n      let delay = item && item.closest(\"[collapse-hide=true]\");\n      if (this.currentItem.close) this.currentItem.close(true);\n      this.setCurrentItem(item);\n      if (delay) {\n        setTimeout(() => this.currentItem.focus(), 300);\n      } else {\n        this.currentItem.focus();\n      }\n    }\n    /**\n     * updates registered button, it needed\n     *\n     * @param {object} button button node\n     * @memberof SimpleToolbar\n     */\n    updateButton(button) {\n      if (button) this.deregisterButton(button);\n      if (button) this.registerButton(button);\n    }\n    /**\n     * updates buttons based on change in config\n     */\n    updateToolbar(config = this.config) {\n      if (!this || !this.config || this.config.length == 0) return;\n      this.clearToolbar();\n      if (typeof this.config != typeof []) this.config = JSON.parse(config);\n      this._addConfigItems(this.config);\n      this.resizeToolbar();\n    }\n    /**\n     * loops through config to add items\n     *\n     * @param {array} items\n     */\n    _addConfigItems(items = this.config, parent = this) {\n      (items || []).forEach((config) => {\n        if (\n          config.type === \"button-group\" ||\n          config.type === \"simple-toolbar-button-group\"\n        ) {\n          this.addButtonGroup(config, parent);\n        } else {\n          this.addButton(config, parent);\n        }\n      });\n    }\n    /**\n     * key codes by key\n     *\n     * @readonly\n     */\n    get keyCode() {\n      return {\n        TAB: 9,\n        ENTER: 13,\n        ESC: 27,\n        SPACE: 32,\n        PAGEUP: 33,\n        PAGEDOWN: 34,\n        END: 35,\n        HOME: 36,\n        LEFT: 37,\n        UP: 38,\n        RIGHT: 39,\n        DOWN: 40,\n      };\n    }\n    /**\n     * handles keydown events, as prescribed in\n     * {@link https://www.w3.org/TR/wai-aria-practices/examples/toolbar/toolbar.html}\n     *\n     * @param {event} e\n     * @returns\n     */\n    _handleKeydown(e) {\n      let finished = false;\n      let key = this._shortcutKeysMatch(e);\n      if (key) return;\n      let c;\n      switch (e.keyCode) {\n        case this.keyCode.RIGHT:\n          c = this.nextItem || this.firstItem;\n          while (c && c.disabled) {\n            this.currentItem = c;\n            c = this.nextItem || this.firstItem;\n          }\n          this.focusOn(this.nextItem || this.firstItem);\n          finished = true;\n          break;\n\n        case this.keyCode.LEFT:\n          c = this.previousItem || this.lastItem;\n          while (c && c.disabled) {\n            this.currentItem = c;\n            c = this.previousItem || this.lastItem;\n          }\n          this.focusOn(this.previousItem || this.lastItem);\n          finished = true;\n          break;\n\n        case this.keyCode.HOME:\n          c = this.firstItem;\n          while (c && c.disabled) {\n            this.currentItem = c;\n            c = this.firstItem;\n          }\n          this.focusOn(this.firstItem);\n          finished = true;\n          break;\n\n        case this.keyCode.END:\n          c = this.lastItem;\n          while (c && c.disabled) {\n            this.currentItem = c;\n            c = this.lastItem;\n          }\n          this.focusOn(this.lastItem);\n          finished = true;\n          break;\n\n        case this.keyCode.UP:\n          c = this.previousItem || this.lastItem;\n          while (c && c.disabled) {\n            this.currentItem = c;\n            c = this.previousItem || this.lastItem;\n          }\n          this.focusOn(this.previousItem || this.lastItem);\n          finished = true;\n          break;\n\n        case this.keyCode.DOWN:\n          c = this.nextItem || this.firstItem;\n          while (c && c.disabled) {\n            this.currentItem = c;\n            c = this.nextItem || this.firstItem;\n          }\n          this.focusOn(this.nextItem || this.firstItem);\n          finished = true;\n          break;\n\n        default:\n          break;\n      }\n\n      if (finished) {\n        e.stopPropagation();\n        e.preventDefault();\n      }\n    }\n    /**\n     * handles focus changes and determines if toolbar still has focus;\n     *\n     */\n    _handleFocusChange() {\n      this.__focused = this.contains(document.activeElement);\n    }\n    /**\n     * handles appended button\n     *\n     * @param {event} e\n     */\n    _handleButtonRegister(e) {\n      e.stopPropagation();\n      this.registerButton(e.detail);\n      this.resizeToolbar();\n    }\n    /**\n     * handles moved/removed button\n     *\n     * @param {event} e\n     */\n    _handleButtonDeregister(e) {\n      e.stopPropagation();\n      this.deregisterButton(e.detail);\n      this.resizeToolbar();\n    }\n    /**\n     * handles updated button\n     *\n     * @param {event} e\n     */\n    _handleButtonUpdate(e) {\n      e.stopPropagation();\n      this.updateButton(e.detail);\n    }\n    /**\n     * resizes toolbar on window resize\n     *\n     */\n    _handleResize(e) {\n      this.resizeToolbar();\n    }\n    /**\n     * handles shortcut keys for buttons\n     *\n     * @param {event} e\n     * @event shortcut-key-pressed\n     */\n    _handleShortcutKeys(e) {\n      let key = this._shortcutKeysMatch(e);\n      if (key) {\n        e.preventDefault();\n        this.shortcutKeys[key]._handleShortcutKeys(e, key);\n        this.dispatchEvent(\n          new CustomEvent(\"shortcut-key-pressed\", {\n            bubbles: true,\n            cancelable: true,\n            composed: true,\n            detail: {\n              ...e.detail,\n              button: this,\n              shortcutKey: this,\n            },\n          }),\n        );\n      }\n    }\n    _handleToggleToolbar(e) {\n      this.collapsed =\n        e.detail && typeof e.detail !== typeof undefined\n          ? e.detail\n          : !this.collapsed;\n    }\n    /**\n     * creates a button element based on config object\n     *\n     * @param {object} config configuration object\n     * @returns {object} button node\n     * @memberof SimpleToolbar\n     */\n    _renderButton(config) {\n      let button = document.createElement(config.type);\n      Object.keys(config).forEach((key) => (button[key] = config[key]));\n      button.addEventListener(\"button-command\", this._handleButton);\n      return button;\n    }\n    /**\n     * creates a div element to contain/group buttons based on config object\n     *\n     * @param {object} config object containing configuration for a group of buttons\n     * @returns {object} div element as a button group\n     * @memberof SimpleToolbar\n     */\n    _renderButtonGroup(config) {\n      let type =\n        !!config.type && config.type === \"simpletoolbar-button-group\"\n          ? config.type\n          : \"div\";\n      let group = document.createElement(type);\n      group.setAttribute(\"class\", \"group\");\n      Object.keys(config).forEach((key) => (group[key] = config[key]));\n      return group;\n    }\n    /**\n     * determines if a keyup event matches a shortcut\n     *\n     * @param {*} keyEvt\n     * @returns\n     */\n    _shortcutKeysMatch(keyEvt) {\n      let shortcutKey = false;\n      Object.keys(this.shortcutKeys || {}).forEach((shortcut) => {\n        let keys = (shortcut || \"\").toLowerCase().split(\"+\"),\n          altKey = keys.includes(\"alt\"),\n          ctrlKey = keys.includes(\"ctrl\"),\n          metaKey = keys.includes(\"meta\") || keys.includes(\"cmd\"),\n          shiftKey = keys.includes(\"shift\"),\n          uppercase = keyEvt.shiftKey && keyEvt.code > 65 && keyEvt.code < 91,\n          filter = keys\n            .filter((key) => key.length == 1)\n            .map((key) => (!!uppercase ? key.toUpperCase() : key)),\n          key = filter[0],\n          match =\n            altKey === keyEvt.altKey &&\n            (ctrlKey === keyEvt.ctrlKey ||\n              ((ctrlKey === window.navigator.platform) === \"MacIntel\" &&\n                e.metaKey)) &&\n            metaKey === keyEvt.metaKey &&\n            shiftKey === keyEvt.shiftKey &&\n            (keyEvt.key ? keyEvt.key === key : !key);\n        if (match) shortcutKey = shortcut;\n        return;\n      });\n      return shortcutKey;\n    }\n  };\n};\n\n/**\n * `simple-toolbar`\n * a customizable toolbar\n *\n### Styling\n\n`<simple-toolbar>` provides following custom properties and mixins\nfor styling:\n\nCustom property | Description | Default\n----------------|-------------|----------\n--simple-toolbar-border-color | default border color | transparent\n--simple-toolbar-border-width | default border width | 1px\n--simple-toolbar-group-border-color | border color for button groups | --simple-toolbar-border-color\n--simple-toolbar-group-border-width | border width for button groups | --simple-toolbar-border-width\n--simple-toolbar-group-padding | padding for button groups | 0 3px\n * \n * @customElement\n * @extends SimpleToolbarBehaviors\n * @extends LitElement\n * @lit-html\n * @lit-element\n * @demo demo/index.html\n * @demo demo/grid.html Grid\n * @demo ./demo/buttons.html Buttons\n * @demo ./demo/menu.html Menu\n */\nclass SimpleToolbar extends SimpleToolbarBehaviors(LitElement) {}\ncustomElements.define(\"simple-toolbar\", SimpleToolbar);\nexport { SimpleToolbar, SimpleToolbarBehaviors };\n"]}