UNPKG

@nent/core

Version:

Functional elements to add routing, data-binding, dynamic HTML, declarative actions, audio, video, and so much more. Supercharge static HTML files into web apps without script or builds.

4 lines 1.28 kB
/*! * NENT 2022 */ import{r as t,h as s,a as i,H as a}from"./index-916ca544.js";import{A as e}from"./service-9338e502.js";import{f as n}from"./logging-5a93c8af.js";import{a as r,c as o}from"./interfaces-13ff7aec.js";import{s as c,o as h}from"./state-627a24e0.js";import"./index-f7016b94.js";import"./state-27a8a5bc.js";import"./index-4bfabbbd.js";const u=class{constructor(s){t(this,s),this.valid=!0,this.topic=r,this.actionService=new e(this,"n-audio-action-music")}get childScript(){return this.el.querySelector("script")}get childInputs(){return this.el.querySelectorAll("input,select,textarea")}getData(){return{type:o.music,trackId:this.trackId,value:this.value}}async getAction(){const t=await this.actionService.getAction();return null==t?null:(Object.assign(t.data,this.getData()),t)}async sendAction(t){c.hasAudioComponent?(Object.assign(t,this.getData()),this.actionService.sendAction(t)):this.dispose=h("hasAudioComponent",(async s=>{var i;s&&(this.actionService.sendAction(t),n(c.debug,`n-audio-action-music: load-action sent for ${this.trackId}`)),null===(i=this.dispose)||void 0===i||i.call(this)}))}render(){return s(a,null)}disconnectedCallback(){var t;null===(t=this.dispose)||void 0===t||t.call(this)}get el(){return i(this)}};export{u as n_audio_action_music}