/*!
 * Custom elements for Nanopore-Digital Web applications
 */
import{N as n}from"./index-BM3Om9WE.js";import{t as o,s as e}from"./renderer-DpNDfhNy.js";export{g as getTagPrefix}from"./renderer-DpNDfhNy.js";export{d as nanoDebounce,t as nanoThrottle}from"./throttle-C93FMm2Z.js";export{g as nanoGetTabElements}from"./tabbable-BgopY-vd.js";const a=(n,o=[],t)=>`${n}\n    ${o.length?'<nano-cta group="balanced" slot="footer">'+o.map(((n,o)=>`<button \n                  data-btn="${o}" \n                  class="${n.classes}"\n                  theme="${n.theme||t}"\n                  secondary="${n.secondary?"true":"false"}"\n                >${n.content}</button>`)).join("")+"</nano-cta>":""}\n  `,r=(n,o=[])=>{o.length&&Array.from(n.querySelectorAll('nano-cta[slot="footer"] button')).map((n=>{const t=o.find(((o,t)=>n.dataset.btn===t.toString()));t&&t.handler&&n.addEventListener("click",t.handler)}))};async function c(n,t="tr",e,c,s=[]){const i={theme:"primary",duration:3e3,closable:!0,...c};e=e||"light/circle-info";const m=Object.assign(document.createElement(o("nano-alert")),{...i,open:!1,innerHTML:`\n        <nano-icon name="${e}" slot="icon"></nano-icon>\n        ${a(n,s,i.theme)}\n      `});return r(m,s),document.body.appendChild(m),new Promise((n=>{requestAnimationFrame((async()=>{await m.toast(t),n(m)}))}))}function s(n,t=[],e,c="light/circle-info",s={}){const i={theme:"primary",duration:1/0,closable:!1,...s};c=c||"light/circle-info";const m=Object.assign(document.createElement(o("nano-alert")),{...i,open:!1,innerHTML:`\n        ${c?`<nano-icon name="${c}" slot="icon"></nano-icon>`:""}\n        ${a(n,t,i.theme)}\n      `});return r(m,t),document.body.appendChild(m),new Promise((n=>{setTimeout((async()=>{await m.alert(e),n(m)}),100)}))}function i(n,t=[],e){const a={noUserDismiss:!1,label:"Dialog",...e},r=Object.assign(document.createElement(o("nano-dialog")),{...a,open:!1,innerHTML:`\n      ${n}\n      ${t.length?'<nano-cta group="balanced" slot="footer">'+t.map(((n,o)=>`<button \n                  data-btn="${o}" \n                  class="${n.classes}"\n                  theme="${n.theme}"\n                  secondary="${n.secondary?"true":"false"}"\n                >${n.content}</button>`)).join("")+"</nano-cta>":""}`});return t.length&&Array.from(r.querySelectorAll('nano-cta[slot="footer"] button')).map((n=>{const o=t.find(((o,t)=>n.dataset.btn===t.toString()));o&&o.handler&&n.addEventListener("click",o.handler)})),document.body.appendChild(r),new Promise((n=>{requestAnimationFrame((async()=>{await r.show(),n(r)}))}))}function m(o){if(!window||!document)return;const t=e(o),a=document.querySelector(`script[src$="/${n}.esm.js"]`);return a&&(a["data-opts"]={transformTagName:t}),t}const l=()=>{};export{m as componentPrefix,l as initialize,i as nanoCreateDialog,s as nanoShowAlert,c as nanoShowToast,o as transformTag}