import{LitElement as e,html as t,css as o}from"../../../lit/index.js";import"../../simple-modal/lib/simple-modal-template.js";import"./hax-view-source.js";import{HaxComponentStyles as i}from"./hax-ui-styles.js";import{I18NMixin as a}from"../../i18n-manager/lib/I18NMixin.js";class HaxExportDialog extends(a(e)){static get styles(){return[...i,o`
        :host {
          display: none;
          --simple-modal-resize: both;
          --simple-modal-height: 100vh;
        }
      `]}connectedCallback(){super.connectedCallback(),globalThis.addEventListener("simple-modal-show",this.modalToggle.bind(this),{signal:this.windowControllers.signal})}disconnectedCallback(){this.windowControllers.abort(),super.disconnectedCallback()}modalToggle(e){"hax-export"==e.detail.id&&e.detail.elements.custom.openSource()}render(){return t`
      <simple-modal-template
        modal-id="hax-export"
        mode="hax-ui"
        id="dialog"
        .title="${this.t.viewPageSource}"
      >
        <hax-view-source slot="custom"></hax-view-source>
      </simple-modal-template>
    `}static get tag(){return"hax-export-dialog"}constructor(){super(),this.windowControllers=new AbortController,this.t={viewPageSource:"View Page Source"},this.registerLocalization({context:this,namespace:"hax"})}}customElements.define(HaxExportDialog.tag,HaxExportDialog);export{HaxExportDialog};