/**
 * Copyright 2018 Pennsylvania State University
 * @license Apache-2.0, see License.md for full text.
 */
import{LitElement as t,html as e,css as i}from"../../../../lit/index.js";class RichTextEditorClipboard extends t{static get styles(){return[i`
        :host {
          display: none !important;
        }
        textarea {
          position: absolute;
          left: -9999px;
          top: 0;
          width: 0px;
          height: 0px;
          overflow: hidden;
        }
      `]}static get properties(){return{__textarea:{type:Object}}}render(){return e`<textarea aria-hidden="true"></textarea>`}setClipboard(){this.__textarea=this.__textarea||this.shadowRoot.querySelector("textarea"),setTimeout((async()=>{this.__textarea.value=await globalThis.navigator.clipboard.readText(),this.__textarea.focus(),this.__textarea.select(),globalThis.document.execCommand("paste")}),1)}get value(){return this.__textarea=this.__textarea||this.shadowRoot.querySelector("textarea"),this.__textarea.value}static get tag(){return"rich-text-editor-clipboard"}constructor(){super(),this.haxUIElement=!0}}customElements.define(RichTextEditorClipboard.tag,RichTextEditorClipboard);export{RichTextEditorClipboard};globalThis.RichTextEditorClipboard=globalThis.RichTextEditorClipboard||{},globalThis.RichTextEditorClipboard.requestAvailability=()=>(globalThis.RichTextEditorClipboard.instance||(globalThis.RichTextEditorClipboard.instance=globalThis.document.createElement("rich-text-editor-clipboard"),globalThis.document.body.appendChild(globalThis.RichTextEditorClipboard.instance)),globalThis.RichTextEditorClipboard.instance);