mx-ui-components-pkg 0.0.717-alpha.153 → 0.0.717-alpha.155

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { m as et } from "./index-rqdxmOcP.js";
1
+ import { m as et } from "./index-xUlEBTtp.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
@@ -1,4 +1,4 @@
1
- import { m as f } from "./index-rqdxmOcP.js";
1
+ import { m as f } from "./index-xUlEBTtp.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
@@ -1,4 +1,4 @@
1
- import { m as l } from "./index-rqdxmOcP.js";
1
+ import { m as l } from "./index-xUlEBTtp.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
@@ -1,4 +1,4 @@
1
- import { m as s } from "./index-rqdxmOcP.js";
1
+ import { m as s } from "./index-xUlEBTtp.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
@@ -1,4 +1,4 @@
1
- import { m as lt } from "./index-rqdxmOcP.js";
1
+ import { m as lt } from "./index-xUlEBTtp.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
@@ -25909,7 +25909,7 @@ function(i) {
25909
25909
  */
25910
25910
  function(i) {
25911
25911
  function e() {
25912
- return (to.canvg ? Promise.resolve(to.canvg) : import("./index.es-CP5bF7oo.js")).catch(function(t) {
25912
+ return (to.canvg ? Promise.resolve(to.canvg) : import("./index.es-CpZwvd5E.js")).catch(function(t) {
25913
25913
  return Promise.reject(new Error("Could not load canvg: " + t));
25914
25914
  }).then(function(t) {
25915
25915
  return t.default ? t.default : t;
@@ -121512,9 +121512,10 @@ class Xon extends ri {
121512
121512
  }
121513
121513
  // Generate styles for tabs
121514
121514
  getStyles(t, n = 0) {
121515
+ var r, s, o;
121515
121516
  switch (this.props.variant) {
121516
121517
  case "button":
121517
- return `w-full text-sm-font-medium px-3 py-4 transition-all text-center flex gap-2 justify-center ${t ? "bg-primary-600 rounded color-white " + this.props.activeCss : ""}`;
121518
+ return `${(r = this.props) != null && r.tabCss && ((s = this.props) == null ? void 0 : s.tabCss) != "" ? (o = this.props) == null ? void 0 : o.tabCss : "w-full text-sm-font-medium px-3 py-4 transition-all text-center flex gap-2 justify-center"}${t ? "bg-primary-600 rounded color-white " + this.props.activeCss : ""}`;
121518
121519
  case "light":
121519
121520
  return `w-full text-sm-font-medium color-gray-500 px-3 py-4 ${n == 0 ? "" : "border-l-2"} transition-all text-center flex gap-2 justify-center ${t ? "bg-gray-50 color-gray-900" + this.props.activeCss : ""}`;
121520
121521
  case "underline":
@@ -272826,37 +272827,37 @@ Gi({
272826
272827
  id: "freemarker2",
272827
272828
  extensions: [".ftl", ".ftlh", ".ftlx"],
272828
272829
  aliases: ["FreeMarker2", "Apache FreeMarker2"],
272829
- loader: () => import("./freemarker2-D0CI6OZW.js").then((i) => i.TagAutoInterpolationDollar)
272830
+ loader: () => import("./freemarker2-DccFaGo7.js").then((i) => i.TagAutoInterpolationDollar)
272830
272831
  });
272831
272832
  Gi({
272832
272833
  id: "freemarker2.tag-angle.interpolation-dollar",
272833
272834
  aliases: ["FreeMarker2 (Angle/Dollar)", "Apache FreeMarker2 (Angle/Dollar)"],
272834
- loader: () => import("./freemarker2-D0CI6OZW.js").then((i) => i.TagAngleInterpolationDollar)
272835
+ loader: () => import("./freemarker2-DccFaGo7.js").then((i) => i.TagAngleInterpolationDollar)
272835
272836
  });
272836
272837
  Gi({
272837
272838
  id: "freemarker2.tag-bracket.interpolation-dollar",
272838
272839
  aliases: ["FreeMarker2 (Bracket/Dollar)", "Apache FreeMarker2 (Bracket/Dollar)"],
272839
- loader: () => import("./freemarker2-D0CI6OZW.js").then((i) => i.TagBracketInterpolationDollar)
272840
+ loader: () => import("./freemarker2-DccFaGo7.js").then((i) => i.TagBracketInterpolationDollar)
272840
272841
  });
272841
272842
  Gi({
272842
272843
  id: "freemarker2.tag-angle.interpolation-bracket",
272843
272844
  aliases: ["FreeMarker2 (Angle/Bracket)", "Apache FreeMarker2 (Angle/Bracket)"],
272844
- loader: () => import("./freemarker2-D0CI6OZW.js").then((i) => i.TagAngleInterpolationBracket)
272845
+ loader: () => import("./freemarker2-DccFaGo7.js").then((i) => i.TagAngleInterpolationBracket)
272845
272846
  });
272846
272847
  Gi({
272847
272848
  id: "freemarker2.tag-bracket.interpolation-bracket",
272848
272849
  aliases: ["FreeMarker2 (Bracket/Bracket)", "Apache FreeMarker2 (Bracket/Bracket)"],
272849
- loader: () => import("./freemarker2-D0CI6OZW.js").then((i) => i.TagBracketInterpolationBracket)
272850
+ loader: () => import("./freemarker2-DccFaGo7.js").then((i) => i.TagBracketInterpolationBracket)
272850
272851
  });
272851
272852
  Gi({
272852
272853
  id: "freemarker2.tag-auto.interpolation-dollar",
272853
272854
  aliases: ["FreeMarker2 (Auto/Dollar)", "Apache FreeMarker2 (Auto/Dollar)"],
272854
- loader: () => import("./freemarker2-D0CI6OZW.js").then((i) => i.TagAutoInterpolationDollar)
272855
+ loader: () => import("./freemarker2-DccFaGo7.js").then((i) => i.TagAutoInterpolationDollar)
272855
272856
  });
272856
272857
  Gi({
272857
272858
  id: "freemarker2.tag-auto.interpolation-bracket",
272858
272859
  aliases: ["FreeMarker2 (Auto/Bracket)", "Apache FreeMarker2 (Auto/Bracket)"],
272859
- loader: () => import("./freemarker2-D0CI6OZW.js").then((i) => i.TagAutoInterpolationBracket)
272860
+ loader: () => import("./freemarker2-DccFaGo7.js").then((i) => i.TagAutoInterpolationBracket)
272860
272861
  });
272861
272862
  /*!-----------------------------------------------------------------------------
272862
272863
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -272894,7 +272895,7 @@ Gi({
272894
272895
  extensions: [".handlebars", ".hbs"],
272895
272896
  aliases: ["Handlebars", "handlebars", "hbs"],
272896
272897
  mimetypes: ["text/x-handlebars-template"],
272897
- loader: () => import("./handlebars-Cfxwxz6Z.js")
272898
+ loader: () => import("./handlebars-DgnFwKYU.js")
272898
272899
  });
272899
272900
  /*!-----------------------------------------------------------------------------
272900
272901
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -272919,7 +272920,7 @@ Gi({
272919
272920
  extensions: [".html", ".htm", ".shtml", ".xhtml", ".mdoc", ".jsp", ".asp", ".aspx", ".jshtm"],
272920
272921
  aliases: ["HTML", "htm", "html", "xhtml"],
272921
272922
  mimetypes: ["text/html", "text/x-jshtm", "text/template", "text/ng-template"],
272922
- loader: () => import("./html-B2h5hLkS.js")
272923
+ loader: () => import("./html-8f9e7PEI.js")
272923
272924
  });
272924
272925
  /*!-----------------------------------------------------------------------------
272925
272926
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -272960,7 +272961,7 @@ Gi({
272960
272961
  filenames: ["jakefile"],
272961
272962
  aliases: ["JavaScript", "javascript", "js"],
272962
272963
  mimetypes: ["text/javascript"],
272963
- loader: () => import("./javascript-CS37UQlT.js")
272964
+ loader: () => import("./javascript-BpdN_ApH.js")
272964
272965
  });
272965
272966
  /*!-----------------------------------------------------------------------------
272966
272967
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -273035,7 +273036,7 @@ Gi({
273035
273036
  extensions: [".liquid", ".html.liquid"],
273036
273037
  aliases: ["Liquid", "liquid"],
273037
273038
  mimetypes: ["application/liquid"],
273038
- loader: () => import("./liquid-BLgbMpzG.js")
273039
+ loader: () => import("./liquid-C6xLGfXx.js")
273039
273040
  });
273040
273041
  /*!-----------------------------------------------------------------------------
273041
273042
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -273071,7 +273072,7 @@ Gi({
273071
273072
  id: "mdx",
273072
273073
  extensions: [".mdx"],
273073
273074
  aliases: ["MDX", "mdx"],
273074
- loader: () => import("./mdx-BruTGbIs.js")
273075
+ loader: () => import("./mdx-t6gMeVjj.js")
273075
273076
  });
273076
273077
  /*!-----------------------------------------------------------------------------
273077
273078
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -273266,7 +273267,7 @@ Gi({
273266
273267
  extensions: [".py", ".rpy", ".pyw", ".cpy", ".gyp", ".gypi"],
273267
273268
  aliases: ["Python", "py"],
273268
273269
  firstLine: "^#!/.*\\bpython[0-9.-]*\\b",
273269
- loader: () => import("./python-yTu4cEaB.js")
273270
+ loader: () => import("./python-BhktgkVH.js")
273270
273271
  });
273271
273272
  /*!-----------------------------------------------------------------------------
273272
273273
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -273303,7 +273304,7 @@ Gi({
273303
273304
  extensions: [".cshtml"],
273304
273305
  aliases: ["Razor", "razor"],
273305
273306
  mimetypes: ["text/x-cshtml"],
273306
- loader: () => import("./razor-D5XshWj2.js")
273307
+ loader: () => import("./razor-CGXnMQbW.js")
273307
273308
  });
273308
273309
  /*!-----------------------------------------------------------------------------
273309
273310
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -273555,7 +273556,7 @@ Gi({
273555
273556
  extensions: [".ts", ".tsx", ".cts", ".mts"],
273556
273557
  aliases: ["TypeScript", "ts", "typescript"],
273557
273558
  mimetypes: ["text/typescript"],
273558
- loader: () => import("./typescript-0LrIsIFJ.js")
273559
+ loader: () => import("./typescript-5XGgn-Fi.js")
273559
273560
  });
273560
273561
  /*!-----------------------------------------------------------------------------
273561
273562
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -273623,7 +273624,7 @@ Gi({
273623
273624
  firstLine: "(\\<\\?xml.*)|(\\<svg)|(\\<\\!doctype\\s+svg)",
273624
273625
  aliases: ["XML", "xml"],
273625
273626
  mimetypes: ["text/xml", "application/xml", "application/xaml+xml", "application/xml-dtd"],
273626
- loader: () => import("./xml-B_CFAPJd.js")
273627
+ loader: () => import("./xml-B_W65z6b.js")
273627
273628
  });
273628
273629
  /*!-----------------------------------------------------------------------------
273629
273630
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -273636,7 +273637,7 @@ Gi({
273636
273637
  extensions: [".yaml", ".yml"],
273637
273638
  aliases: ["YAML", "yaml", "YML", "yml"],
273638
273639
  mimetypes: ["application/x-yaml", "text/x-yaml"],
273639
- loader: () => import("./yaml-CLKjuWBM.js")
273640
+ loader: () => import("./yaml-ClUmJ9Nr.js")
273640
273641
  });
273641
273642
  /*!-----------------------------------------------------------------------------
273642
273643
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -273739,7 +273740,7 @@ var CFe = class {
273739
273740
  );
273740
273741
  U8.languages.css = { cssDefaults: $It, lessDefaults: jIt, scssDefaults: YIt };
273741
273742
  function xFe() {
273742
- return import("./cssMode-Dd4HqHql.js");
273743
+ return import("./cssMode-COWi1uVC.js");
273743
273744
  }
273744
273745
  U8.languages.onLanguage("less", () => {
273745
273746
  xFe().then((i) => i.setupMode(jIt));
@@ -273845,7 +273846,7 @@ bde.languages.html = {
273845
273846
  registerHTMLLanguageService: Sde
273846
273847
  };
273847
273848
  function nei() {
273848
- return import("./htmlMode-Ut56R0R4.js");
273849
+ return import("./htmlMode-D4J2SYoq.js");
273849
273850
  }
273850
273851
  function Sde(i, e = wde, t = Cde(i)) {
273851
273852
  const n = new XZn(i, e, t);
@@ -273922,7 +273923,7 @@ var cei = class {
273922
273923
  ), hei = () => eLt().then((i) => i.getWorker());
273923
273924
  u$.languages.json = { jsonDefaults: ZIt, getWorker: hei };
273924
273925
  function eLt() {
273925
- return import("./jsonMode-C8oeUbHr.js");
273926
+ return import("./jsonMode-qCOO6fji.js");
273926
273927
  }
273927
273928
  u$.languages.register({
273928
273929
  id: "json",
@@ -274086,7 +274087,7 @@ f6.languages.typescript = {
274086
274087
  getJavaScriptWorker: wei
274087
274088
  };
274088
274089
  function Ede() {
274089
- return import("./tsMode-B-2XkTC_.js");
274090
+ return import("./tsMode-D-0_lY2y.js");
274090
274091
  }
274091
274092
  f6.languages.onLanguage("typescript", () => Ede().then((i) => i.setupTypeScript(lLt)));
274092
274093
  f6.languages.onLanguage("javascript", () => Ede().then((i) => i.setupJavaScript(cLt)));
@@ -1,4 +1,4 @@
1
- import { c as Qe, _ as za, g as Io } from "./index-rqdxmOcP.js";
1
+ import { c as Qe, _ as za, g as Io } from "./index-xUlEBTtp.js";
2
2
  var ht = function(a) {
3
3
  return a && a.Math === Math && a;
4
4
  }, _ = (
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ag as o, aV as e, N as i, aq as t, bl as r, bI as b, au as n, p as u, q as d, bj as C, B as M, Q as m, j as l, l as p, aa as c, be as g, K as h, bh as D, x as y, a6 as A, bA as B, aZ as T, a_ as w, bZ as I, b9 as S, aW as P, aX as F, bB as R, b5 as k, aC as x, b7 as v, aG as H, aE as L, aF as f, bb as E, ba as G, bc as N, bC as O, bE as V, bX as W, C as U, bL as q, V as z, bn as J, ar as K, b3 as X, bR as j, aS as Q, bS as Y, E as Z, ac as $, aT as _, F as aa, bs as sa, bG as oa, b2 as ea, X as ia, Y as ta, Z as ra, $ as ba, a0 as na, a1 as ua, bt as da, a2 as Ca, b8 as Ma, as as ma, I as la, a4 as pa, ai as ca, a3 as ga, bv as ha, af as Da, bi as ya, ah as Aa, ad as Ba, r as Ta, av as wa, aN as Ia, aQ as Sa, aO as Pa, aP as Fa, bd as Ra, n as ka, bH as xa, aU as va, b1 as Ha, ab as La, bU as fa, y as Ea, u as Ga, s as Na, e as Oa, bf as Va, bV as Wa, a$ as Ua, o as qa, az as za, bP as Ja, aK as Ka, aI as Xa, aJ as ja, bN as Qa, c0 as Ya, bY as Za, b$ as $a, bQ as _a, bO as as, b as ss, bD as os, k as es, c1 as is, d as ts, v as rs, b_ as bs, aY as ns, b0 as us, bF as ds, bW as Cs, M as Ms, h as ms, bw as ls, i as ps, bz as cs, by as gs, bx as hs, a9 as Ds, br as ys, G as As, aw as Bs, ay as Ts, ax as ws, A as Is, aD as Ss, bJ as Ps, bK as Fs, bM as Rs, O as ks, P as xs, bm as vs, aj as Hs, ak as Ls, D as fs, f as Es, a7 as Gs, am as Ns, aH as Os, a8 as Vs, bq as Ws, L as Us, R as qs, bk as zs, a5 as Js, z as Ks, at as Xs, bu as js, bp as Qs, bo as Ys, an as Zs, J as $s, S as _s, U as ao, H as so, T as oo, w as eo, ao as io, ap as to, b4 as ro, aA as bo, bT as no, al as uo, ae as Co, b6 as Mo, a9 as mo, W as lo, aR as po, bg as co, aB as go, aM as ho, a as Do, aL as yo } from "./index-rqdxmOcP.js";
1
+ import { ag as o, aV as e, N as i, aq as t, bl as r, bI as b, au as n, p as u, q as d, bj as C, B as M, Q as m, j as l, l as p, aa as c, be as g, K as h, bh as D, x as y, a6 as A, bA as B, aZ as T, a_ as w, bZ as I, b9 as S, aW as P, aX as F, bB as R, b5 as k, aC as x, b7 as v, aG as H, aE as L, aF as f, bb as E, ba as G, bc as N, bC as O, bE as V, bX as W, C as U, bL as q, V as z, bn as J, ar as K, b3 as X, bR as j, aS as Q, bS as Y, E as Z, ac as $, aT as _, F as aa, bs as sa, bG as oa, b2 as ea, X as ia, Y as ta, Z as ra, $ as ba, a0 as na, a1 as ua, bt as da, a2 as Ca, b8 as Ma, as as ma, I as la, a4 as pa, ai as ca, a3 as ga, bv as ha, af as Da, bi as ya, ah as Aa, ad as Ba, r as Ta, av as wa, aN as Ia, aQ as Sa, aO as Pa, aP as Fa, bd as Ra, n as ka, bH as xa, aU as va, b1 as Ha, ab as La, bU as fa, y as Ea, u as Ga, s as Na, e as Oa, bf as Va, bV as Wa, a$ as Ua, o as qa, az as za, bP as Ja, aK as Ka, aI as Xa, aJ as ja, bN as Qa, c0 as Ya, bY as Za, b$ as $a, bQ as _a, bO as as, b as ss, bD as os, k as es, c1 as is, d as ts, v as rs, b_ as bs, aY as ns, b0 as us, bF as ds, bW as Cs, M as Ms, h as ms, bw as ls, i as ps, bz as cs, by as gs, bx as hs, a9 as Ds, br as ys, G as As, aw as Bs, ay as Ts, ax as ws, A as Is, aD as Ss, bJ as Ps, bK as Fs, bM as Rs, O as ks, P as xs, bm as vs, aj as Hs, ak as Ls, D as fs, f as Es, a7 as Gs, am as Ns, aH as Os, a8 as Vs, bq as Ws, L as Us, R as qs, bk as zs, a5 as Js, z as Ks, at as Xs, bu as js, bp as Qs, bo as Ys, an as Zs, J as $s, S as _s, U as ao, H as so, T as oo, w as eo, ao as io, ap as to, b4 as ro, aA as bo, bT as no, al as uo, ae as Co, b6 as Mo, a9 as mo, W as lo, aR as po, bg as co, aB as go, aM as ho, a as Do, aL as yo } from "./index-xUlEBTtp.js";
2
2
  export {
3
3
  o as A,
4
4
  e as Action,
@@ -2055,7 +2055,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),On=mn,yn=vn),xn===void
2055
2055
  </div>
2056
2056
  `}setupClickPlayPause(){this.querySelector(".click-overlay").addEventListener("click",()=>{this.video.paused?(this.video.play(),this.showIcon(this.getPlayIcon())):(this.video.pause(),this.showIcon(this.getPauseIcon()))})}setupKeyboardControls(){window.addEventListener("keydown",Ae=>{const Se=document.fullscreenElement===this.container;switch(["Space","ArrowLeft","ArrowRight"].includes(Ae.code)&&Se&&Ae.preventDefault(),Ae.code){case"Space":this.video.paused?(this.video.play(),this.showIcon(this.getPlayIcon())):(this.video.pause(),this.showIcon(this.getPauseIcon()));break;case"ArrowLeft":this.video.currentTime=Math.max(0,this.video.currentTime-2),this.showIcon(this.getBackwardIcon());break;case"ArrowRight":this.video.currentTime=Math.min(this.video.duration,this.video.currentTime+2),this.showIcon(this.getForwardIcon());break}})}showIcon(Ae){this.feedback.innerHTML=Ae,this.feedback.classList.add("show"),setTimeout(()=>this.feedback.classList.remove("show"),600)}getPlayIcon(){return'<svg viewBox="0 0 24 24"><path d="M8 5v14l11-7z"/></svg>'}getPauseIcon(){return'<svg viewBox="0 0 24 24"><path d="M6 19h4V5H6zm8-14v14h4V5h-4z"/></svg>'}getForwardIcon(){return'<svg viewBox="0 0 24 24"><path d="M4 18l8.5-6L4 6v12zm9.5 0l8.5-6-8.5-6v12z"/></svg>'}getBackwardIcon(){return'<svg viewBox="0 0 24 24"><path d="M20 6l-8.5 6L20 18V6zm-9.5 0L2 12l8.5 6V6z"/></svg>'}}customElements.define("mobius-custom-video",MobiusCustomVideo);class Signal{constructor(_e){In(this,"value");In(this,"listeners",[]);this.value=_e,this.listeners=[]}get(){return this.value}set(_e){this.value=_e,this.listeners.forEach(Ae=>Ae(_e))}setWithoutNotify(_e){this.value=_e}attach(_e){this.listeners.push(_e)}detach(_e){const Ae=this.listeners.indexOf(_e);Ae!==-1&&this.listeners.splice(Ae,1)}}class Store{constructor(){In(this,"_signals",{});In(this,"_router",{});this._signals={}}setQueryParams(_e){this._router.queryParams={...this._router.queryParams,..._e}}getSignal(_e,Ae){return this._signals[_e]?this._signals[_e].get()===void 0&&Ae&&this._signals[_e].set(Ae):this._signals[_e]=new Signal(Ae),this._signals[_e]}garbageCollection(_e,Ae){const Se=this._signals[_e];Se&&Ae.forEach(Ee=>{Se.detach(Ee)})}}const Vf=class Vf extends HTMLElement{constructor(){super()}createMemory(_e){Vf.appStoreReference[_e]=new Store}getMemory(_e){return Vf.appStoreReference[_e]||this.createMemory(_e),Vf.appStoreReference[_e]}};In(Vf,"appStoreReference",{});let MobiusApp=Vf;customElements.define("mobius-app",MobiusApp);class SocketIOService{constructor(_e){In(this,"isMounted");In(this,"store");In(this,"connections");this.isMounted=!1,this.connections=_e,this.store=new Map}listenDefultEvents(_e){_e.on("connect",()=>{console.info(`socket.io connected to ${_e.io.opts.hostname}`)}),_e.on("connect_error",Ae=>{console.info(`socket.io connect_error ${Ae}`)}),_e.on("disconnect",()=>{console.info(`socket.io disconnected from ${_e.io.opts.hostname}`)}),_e.on("ping",()=>{_e.emit("pong")})}mount(){return this.connections&&(this.connections.forEach(_e=>{const Ae=_e.config||{},Se=lookup$5(_e.url,{...Ae}),{onConnect:Ee}=_e;Ee&&Se.emit(Ee.emit,Ee.data),this.store.set(_e.url,Se),this.listenDefultEvents(Se)}),this.isMounted=!0),Promise.resolve()}unmount(){return this.store.forEach(_e=>{_e.disconnect(),_e.removeAllListeners()}),this.store.clear(),this.connections=null,this.isMounted=!1,Promise.resolve()}getName(){return ServicesEnum.SOCKET_IO}isActive(){return this.isMounted}getSocket(_e){return this.store.get(_e)}configureEventsAndListerns(_e,Ae){_e.forEach(Se=>{const Ee=this.getSocket(Se.url);Ee&&Se.events.forEach(xe=>{Ee.on(xe,Te=>{Ae(xe,Te)})})})}}class ServiceManager{constructor(){In(this,"services");this.services=new Map}registerService(_e){const Ae=_e.getName();this.services.set(Ae,_e)}mountService(_e){const Ae=this.services.get(_e);Ae&&Ae.mount()}unmountService(_e){const Ae=this.services.get(_e);Ae&&Ae.unmount()}has(_e){return!!this.services.get(_e)}getService(_e){return this.services.get(_e)}}const Pp=class Pp extends MobiusApp{constructor(){super();In(this,"store");In(this,"provider");In(this,"container",null);In(this,"currentPath",null);In(this,"services",{});In(this,"serviceManager",new ServiceManager);In(this,"watchLevel",0);In(this,"dataSource","API")}static get observedAttributes(){return["provider"]}async connectedCallback(){const Ae=this.getAttribute("services");if(Ae)try{this.services=typeof Ae=="string"?JSON.parse(Ae):Ae}catch(Se){console.log("Invalid JSON in services attributes: ",Se)}this.provider!=="root"?await this.handleRouteChange():(this.mountSocketIOService(),await this.FetchMetadata())}disconnectedCallback(){this.provider==="root"&&this.serviceManager.unmountService(ServicesEnum.SOCKET_IO)}attributeChangedCallback(Ae,Se,Ee){if(!(Se===Ee||Ae!=="provider"))try{this.provider=Ee,this.provider?(this.store=this.getMemory(this.provider),console.log("------------------>",this.store)):console.error("Pass provider to mobius container")}catch(xe){console.error("Unable to parse props",xe)}}async handleRouteChange(){const Ae=window.location.pathname;this.currentPath!==Ae&&(this.currentPath=Ae,await this.fetchAndRenderMetadata(Ae))}findCurrentWatchLevel(Ae){return Ae=="/"?0:Ae.split("/").length-1}async fetchAndRenderMetadata(Ae){var Ee;console.log("Fetching metadata for path:",Ae);let Se;if(this.dataSource=="API")Se=Ae==="/"?"/api/mobius/home":`/api/mobius${Ae}`;else{const{queryParams:xe,componentMetadataUrl:Te}=Pp.router.getJsonOnTheBasisOfPath(Ae,this.watchLevel);(Ee=this.store)==null||Ee.setQueryParams(xe),Se=Te}try{const xe=await fetch(Se);if(!xe.ok)throw new Error(`HTTP error! Status: ${xe.status}`);const Te=await xe.json(),Ie=mountComponents(Te,this);Ie&&(this.innerHTML="",this.appendChild(Ie))}catch(xe){console.error("Fetch Error:",xe),this.renderError(xe.message)}}async FetchMetadata(){console.log("Fetching metadata");const Ae=this.getAttribute("props");if(!Ae){this.renderError("Props attribute is missing or invalid.");return}console.log(Ae,"props in agent card");let Se;try{Se=typeof Ae=="string"?JSON.parse(Ae):Ae}catch(Ie){console.error("Invalid JSON in props attribute:",Ie.message);return}const Ee=Se.method,xe=Se["api-url"],Te=Se.router;Se["auth-token"];try{if(Te&&Te.routingEnabled)this.dataSource="Local",this.watchLevel=Te.watchLevel??0,Pp.router.connectMobiusContainer(Te.watchLevel,this),this.handleRouteChange();else{if(!xe){this.renderError("API URL is missing in props.");return}fetch(xe,{method:Ee,headers:{}}).then(Ie=>{if(!Ie.ok)throw new Error(`HTTP error! Status: ${Ie.status}`);return Ie.json()}).then(Ie=>{const De=this&&mountComponents(Ie,this);this.innerHTML="",De&&this.appendChild(De)})}}catch(Ie){console.error("Fetch Error:",Ie),this.renderError(Ie.message)}}renderError(Ae){console.error("Rendering error:",Ae),this.innerHTML=`
2057
2057
  <div class="text-red-500 font-bold">Error: ${Ae}</div>
2058
- `}mountSocketIOService(){var Ee;if(!this.services)return;const Ae=((Ee=this.services.socketIO)==null?void 0:Ee.connectionDetails)||[];if(!Ae.length||this.serviceManager.has(ServicesEnum.SOCKET_IO))return;const Se=new SocketIOService(Ae);this.serviceManager.registerService(Se),this.serviceManager.mountService(ServicesEnum.SOCKET_IO)}};In(Pp,"router");let MobiusContainer=Pp;customElements.define("mobius-container",MobiusContainer);class MobiusLoop extends BaseComponent{constructor(){super();In(this,"props");In(this,"dataFromParent");In(this,"data",[]);In(this,"dataCopy",[])}connectedCallback(){this.initializeProps(),this.loadData(),this.setupBindings(),this.onLoad()}initializeProps(){this.props=JSON.parse(this.getAttribute("props")||"{}")||{}}async loadData(){if(this.props.API){const Ae=await this.fetchAPI();this.data=this.extractLoopData(Ae)}else this.data=this.props.Data||[];this.dataCopy=[...this.data],this.render()}extractLoopData(Ae){let Se=Ae;return this.props.loopOver&&this.props.loopOver.split(".").forEach(Ee=>{Se=(Se==null?void 0:Se[Ee])||Se}),Se}setupBindings(){const Ae=JSON.parse(this.getAttribute("bindings")||"{}")||{};this.setBindings(Ae,Se=>this.handleSearch(Se))}handleSearch(Ae){var xe,Te,Ie,De,ke;if(!((Te=(xe=this.props)==null?void 0:xe.search)!=null&&Te.searchOver))return;this.innerHTML="";const Se=(De=(Ie=this.props)==null?void 0:Ie.search)==null?void 0:De.searchBoxName;if(!Se){console.warn("searchBoxName is not provided in mobius-loop");return}const Ee=((ke=Ae==null?void 0:Ae[Se])==null?void 0:ke.toLowerCase())||"";this.data=Ee?this.dataCopy.filter(Oe=>String(Oe[this.props.search.searchOver]).toLowerCase().includes(Ee)):[...this.dataCopy],this.render()}setDataFromParent(Ae){this.dataFromParent=Ae}async fetchAPI(){let{apiUrl:Ae,method:Se="GET",bearerToken:Ee,body:xe={},dynamicBody:Te={}}=this.props.API;if(Object.keys(Te).length&&this.dataFromParent&&(xe=resolveDynamicData(Te,this.dataFromParent,xe)),xe=replaceCurlyBraces(xe),Ae.includes("{")){const ke=[...Ae.matchAll(/\{(.*?)\}/g)];switch(this.props.API.dynamicStorageSource){case"localStorage":ke.forEach(Oe=>{let Me=Oe[1],Pe=localStorage.getItem(Me)||"";Ae=Ae.replace(Oe[0],Pe)});break;default:ke.forEach(Oe=>{let Me=Oe[1],Pe=localStorage.getItem(Me)||"";Ae=Ae.replace(Oe[0],Pe)});break}}if(Se!=="GET"&&!Object.keys(xe).length)return;const Ie={"Content-Type":"application/json",Authorization:`Bearer ${Ee}`},De={method:Se,headers:Ie};Se!=="GET"&&Object.keys(xe).length&&(De.body=JSON.stringify(xe));try{return(await fetch(Ae,De)).json()}catch(ke){return console.error("Error fetching API data",ke),[]}}render(){const Ae=this.props.component,Se=this.querySelector("mobius-loop");Array.isArray(this.data)&&this.data.forEach((Ee,xe)=>{var De;const Te=JSON.parse(JSON.stringify(Ae));Te.dynamicProps&&(Te.props=resolveDynamicData(Te.dynamicProps,Ee,Te.props)),(De=Te.propsIndex)!=null&&De[xe]&&(Te.props={...Te.props,...Te.propsIndex[xe]});const Ie=createElementFromMetadata(Te,this);if(this.props.isPiped){const ke=Se.cloneNode(!0);ke.setDataFromParent(Ee),console.log(Ie),Ie==null||Ie.appendChild(ke)}this.appendChild(Ie)}),Se==null||Se.remove()}}customElements.define("mobius-loop",MobiusLoop);class MobiusTab extends BaseComponent{constructor(){super();In(this,"props")}connectedCallback(){this.className=`block ${this.className}`}getTabData(){var Ae,Se,Ee;return this.props=JSON.parse(this.getAttribute("props")),{header:this.props.header,icon:{left:this.props.leftIcon,right:this.props.rightIcon,size:this.props.size},stateHeader:((Ae=this.props)==null?void 0:Ae.stateHeader)||"",iconCss:this.props.iconCss,bindings:((Se=this.meta.props)==null?void 0:Se.tabBindings)||this.meta.bindings,props:((Ee=this.meta.props)==null?void 0:Ee.tabProps)||this.meta.props}}}customElements.define("mobius-tab",MobiusTab);class MobiusTabs extends BaseComponent{constructor(){super();In(this,"Tabs",[]);In(this,"props",{});In(this,"selectedTab",0);In(this,"tabContainer",null);In(this,"findByHeaderOrIndex",Ae=>{var Se,Ee,xe;if(typeof Ae=="number"){const Te=(Se=this.Tabs)==null?void 0:Se[Ae];return{index:Ae,tab:Te}}else if(typeof Ae=="string"){const Te=(Ee=this.Tabs)==null?void 0:Ee.findIndex(De=>De.header===Ae),Ie=Te!==-1?(xe=this.Tabs)==null?void 0:xe[Te]:void 0;return{index:Te,tab:Ie}}else return{index:-1,tab:void 0}})}connectedCallback(){var xe;this.props=JSON.parse(this.getAttribute("props")||"{}");const Ae=JSON.parse(this.getAttribute("bindings")||"{}");this.setBindings(Ae,Te=>{let Ie=this.findByHeaderOrIndex(Te);Ie.tab&&Ie.index!=this.selectedTab&&(this.selectedTab=Ie.index==-1?this.selectedTab:Ie==null?void 0:Ie.index,this.updateActiveTab(Ie==null?void 0:Ie.tab,Ie.index))}),this.initializeTabs();const Se=this.getState()||((xe=this.signal)==null?void 0:xe.get())||0,Ee=this.findByHeaderOrIndex(Se);this.selectedTab=Ee.index==-1?0:Ee==null?void 0:Ee.index,Ee.tab&&this.updateActiveTab(Ee.tab,Ee.index),this.onLoad()}initializeTabs(){this.tabContainer=document.createElement("div"),this.tabContainer.className="flex w-full cursor-pointer "+this.props.tabContainerStyles,this.props.variant=="light"&&(this.tabContainer.className+=" shadow rounded"),Array.from(this.children).forEach((Ae,Se)=>{var Ee,xe;if(Ae.localName==="mobius-tab"){let Te=this.selectedTab===Se;const Ie=(Ee=Ae.getTabData)==null?void 0:Ee.call(Ae);let De={type:"mobius-div",version:"V1",value:"",styles:this.getStyles(Te,Se)+` ${this.props.tabCss??""}`,bindings:Ie==null?void 0:Ie.bindings,props:Ie==null?void 0:Ie.props,children:[]},ke=mountComponents([De],this);ke=ke.querySelector("mobius-div"),ke.textContent=Ie.header??`Tab ${Se+1}`,this.addIcon(Ie.icon,Ie.size??"base",Ie.iconCss,ke),(xe=this.tabContainer)==null||xe.appendChild(ke);const Oe={tabChild:Ae,isActive:Te,tabElement:ke,header:Ie.stateHeader??Ie.header};ke.addEventListener("click",()=>this.updateActiveTab(Oe,Se)),this.Tabs.push(Oe),Te||Ae.classList.add("hidden")}}),this.insertBefore(this.tabContainer,this.firstChild)}addIcon(Ae,Se,Ee,xe){let Te={xs:"w-[16px] h-[16px]",sm:"w-[16px] h-[16px]",base:"w-[20px] h-[20px]",lg:"w-[24px] h-[24px]",xl:"w-[24px] h-[24px]"};const Ie=document.createElement("img");Ae!=null&&Ae.left?(Ie.src=Ae.left,Ie.className=Te[Se??"base"]+` ${Ee}`):Ie.className="none";const De=document.createElement("img");Ae!=null&&Ae.right?(De.src=Ae.right,De.className=Te[Se]):De.className+="none",xe.insertBefore(Ie,xe.firstChild),xe.appendChild(De)}getStyles(Ae,Se=0){switch(this.props.variant){case"button":return`w-full text-sm-font-medium px-3 py-4 transition-all text-center flex gap-2 justify-center ${Ae?"bg-primary-600 rounded color-white "+this.props.activeCss:""}`;case"light":return`w-full text-sm-font-medium color-gray-500 px-3 py-4 ${Se==0?"":"border-l-2"} transition-all text-center flex gap-2 justify-center ${Ae?"bg-gray-50 color-gray-900"+this.props.activeCss:""}`;case"underline":return`w-full text-sm-font-medium border-b-2 pb-2 transition-all text-center flex gap-2 justify-center ${Ae?"color-primary-600 border-primary-600 "+this.props.activeCss:"color-gray-500 border-gray-300"}`;default:return`w-full text-sm-font-medium border-b-2 pb-2 transition-all text-center flex gap-2 justify-center ${Ae?"color-primary-600 border-primary-600 "+this.props.activeCss:"color-gray-500 border-gray-300"}`}}updateActiveTab(Ae,Se){var xe,Te,Ie,De;const Ee=this.Tabs.findIndex(ke=>ke.isActive);this.Tabs[Ee]&&(this.Tabs[Ee].isActive=!1,this.Tabs[Ee].tabChild.classList.add("hidden"),this.Tabs[Ee].tabElement.className=this.getStyles(!1,Ee)+` ${(xe=this.props)==null?void 0:xe.tabCss}`),Ae.isActive=!0,Ae.tabChild.classList.remove("hidden"),Ae.tabElement.className=this.getStyles(!0,Se)+` ${(Te=this.props)==null?void 0:Te.tabCss} ${(Ie=this.props)==null?void 0:Ie.activeCss}`,(De=this.signal)==null||De.set(Se),this.updateState(Se)}}customElements.define("mobius-tabs",MobiusTabs);class ButtonGroupButton extends BaseComponent{constructor(){super();In(this,"buttonValue")}static get observedAttributes(){return["props","bindings"]}attributeChangedCallback(Ae,Se,Ee){var xe;if(Se!==Ee){if(Ae==="props"){const Te=JSON.parse(Ee);Te.span&&(this.style.gridColumn=`span ${Te.span}`),Te.value&&(this.buttonValue=Te.value),Te.style?this.className=`${Te.style}`:this.className="px-4 py-2 w-full border-r border-gray-200 cursor-pointer hover:bg-gray-100 text-center text-sm-font-medium flex gap-2",this.addIcon(Te==null?void 0:Te.icon,Te==null?void 0:Te.size)}else if(Ae==="bindings"){const Te=JSON.parse(Ee);this.setBindings(Te,De=>{this.setSelectedButtonCss(De)});const Ie=((xe=this.signal)==null?void 0:xe.get())||this.getState()||{};this.setSelectedButtonCss(Ie)}}}setSelectedButtonCss(Ae){Ae&&(Ae==this.buttonValue?this.className+=" bg-gray-100 color-primary-600 ":this.className=this.className.replace(" bg-gray-100 color-primary-600 ",""))}addIcon(Ae,Se="base"){let Ee={xs:"w-[16px] h-[16px]",sm:"w-[16px] h-[16px]",base:"w-[20px] h-[20px]",lg:"w-[24px] h-[24px]",xl:"w-[24px] h-[24px]"};const xe=document.createElement("img");Ae?(xe.src=Ae,xe.className=Ee[Se]):xe.className="none",this.insertBefore(xe,this.firstChild)}}customElements.define("mobius-button-group-button",ButtonGroupButton);class ButtonGroup extends BaseComponent{constructor(){super();In(this,"props",{});this.updateLastChildBorder()}static get observedAttributes(){return["props","bindings"]}attributeChangedCallback(Ae,Se,Ee){if(Se!==Ee){if(Ae==="props"){this.props=JSON.parse(Ee);const{grid:xe,noBorder:Te}=this.props;this.style.gridTemplateColumns=`repeat(${xe}, 1fr)`,Te?this.className="rounded-md grid gap-1":this.className="rounded-md border border-gray-200 grid"}else if(Ae==="bindings"){const xe=JSON.parse(Ee);this.setBindings(xe,()=>console.log("Button Group State Updated"))}}}updateLastChildBorder(){const Ae=this.children;Ae.length>0&&Array.from(Ae)[Ae.length-1].classList.remove("border-r")}}customElements.define("mobius-button-group",ButtonGroup);class BadgeElement extends BaseComponent{constructor(){super();In(this,"_value",null);In(this,"defaultValues",{src:"",color:"primary",size:"",rounded:!1,border:!1})}static get observedAttributes(){return["props","bindings","events"]}applyColorStyle(Ae){Ae&&this.classList.add(`bg-${Ae}-100`,`text-${Ae}-800`)}applySizeStyle(Ae){const Se=Ae==="large"?"text-sm":"text-xs";this.classList.add(Se)}applyBorderStyle(Ae,Se,Ee){Se&&(this.classList.add(Ae),Ee&&Ee.trim()&&this.classList.add(`border-${Ee}-400`))}attributeChangedCallback(Ae,Se,Ee){if(Se!==Ee){if(Ae==="props")try{let xe=JSON.parse(Ee||"{}");xe=addMissingDefaults(xe,this.defaultValues);const Te=["inline-flex","items-center","justify-center","px-2.5","py-0.5","gap-1"];this.classList.add(...Te),Object.entries(xe).forEach(([Ie,De])=>{switch(Ie){case"color":this.applyColorStyle(De);break;case"size":this.applySizeStyle(De);break;case"dismissable":De&&this.addDismissListener();break;case"rounded":De&&this.classList.add(Ie);break;case"border":this.applyBorderStyle(Ie,De,xe.color||null);break;default:this.setAttribute(Ie,De);break}})}catch(xe){console.error("Error parsing props:",xe)}else if(Ae==="bindings"){const xe=JSON.parse(Ee||"{}");this.setBindings(xe,()=>console.log("Binded"))}else Se!==Ee&&this.setAttribute(Ae,Ee??"");this.render()}}get value(){return this._value}set value(Ae){this._value!==Ae&&(this._value=Ae,this.render())}render(){var Se;let Ae=(Se=JSON.parse(this.getAttribute("props")))==null?void 0:Se.value;this.value?this.innerHTML=`${this.value}`:Ae&&(this.innerHTML=Ae)}disconnectedCallback(){super.disconnectedCallback();const Ae=this.querySelector(".dismiss");Ae&&Ae.removeEventListener("click",this.dismissBadge.bind(this))}addDismissListener(){const Ae=this.querySelector(".dismiss");Ae&&Ae.addEventListener("click",this.dismissBadge.bind(this))}dismissBadge(){this.dispatchEvent(new CustomEvent("badge-dismissed",{bubbles:!0,composed:!0})),this.remove()}}customElements.define("mobius-badge",BadgeElement);class BadgeGroup extends BaseComponent{constructor(){super();In(this,"align","horizontal");In(this,"gap",1);In(this,"selectedValues",[]);In(this,"selectedItems",{});In(this,"name","");In(this,"styles","");In(this,"badgeProps",{});In(this,"renderChilds",()=>{var Ae;for(;this.firstChild;)this.removeChild(this.firstChild);(Ae=Object.entries(this.selectedItems))==null||Ae.forEach(([Se,Ee])=>{this.buildBadge(Ee,Se)})});In(this,"buildBadge",(Ae,Se,Ee=!0)=>{var Oe,Me,Pe,Be,Fe,$e,Ue,He,Ve,ze,We,qe,Ke,Ge,Ye,Qe,St,Ze,Xe,tn;let xe=[{type:"mobius-badge",props:{...(Oe=this.badgeProps)==null?void 0:Oe.props,APIData:{key:Se,value:Ae},key:Se,value:Ae},bindings:(Me=this.badgeProps)==null?void 0:Me.bindings,styles:(Pe=this.badgeProps)==null?void 0:Pe.styles,children:[{type:"mobius-div",props:{...(Be=this.badgeProps)==null?void 0:Be.props,APIData:{key:Se,value:Ae},key:Se,value:Ae},bindings:{},styles:($e=(Fe=this.badgeProps)==null?void 0:Fe.textContainerProps)==null?void 0:$e.styles,children:[]},{id:"uysafigfvuusdv",name:"Interface",type:"mobius-img",props:{...(Ue=this.badgeProps)==null?void 0:Ue.iconProps,APIData:{key:Se,value:Ae},key:Se,value:Ae},styles:(Ve=(He=this.badgeProps)==null?void 0:He.iconProps)==null?void 0:Ve.styles,value:"",children:[],bindings:(ze=this.badgeProps)==null?void 0:ze.iconBindings}]}];if(Ee){const en=mountComponents(xe,this);let un=en.querySelector("mobius-img");this.appendChild(en),un==null||un.addEventListener("click",mn=>{mn==null||mn.preventDefault(),mn==null||mn.stopImmediatePropagation(),this.badgeDismissed(Ae)})}let Te=new BadgeElement;if((qe=(We=this.badgeProps)==null?void 0:We.styles)!=null&&qe.trim()){const en=this.badgeProps.styles.split(/\s+/).filter(Boolean);en.length>0&&Te.classList.add(...en)}Te.setAttribute("props",JSON.stringify(((Ke=this.badgeProps)==null?void 0:Ke.props)??"{}")),Te.setAttribute("bindings",JSON.stringify(((Ge=this.badgeProps)==null?void 0:Ge.bindings)??"{}")),Te.setAttribute("events",JSON.stringify(((Ye=this.badgeProps)==null?void 0:Ye.events)??"{}"));let Ie=new DivElement;Ie.value=Ae,Ie.setAttribute("props",JSON.stringify((Qe=this.badgeProps)==null?void 0:Qe.textContainerProps));let De=new customImg;const ke=(Ze=(St=this.badgeProps)==null?void 0:St.iconProps)==null?void 0:Ze.styles.split(/\s+/).filter(Boolean);return(Xe=De==null?void 0:De.classList)==null||Xe.add("dismiss"),(ke==null?void 0:ke.length)>0&&De.classList.add(...ke),De.setAttribute("props",JSON.stringify((tn=this.badgeProps)==null?void 0:tn.iconProps)),De.addEventListener("click",en=>{en==null||en.preventDefault(),en==null||en.stopImmediatePropagation(),this.badgeDismissed(Ae)}),Te.appendChild(Ie),Te.appendChild(De),Te});In(this,"badgeDismissed",Ae=>{var xe,Te,Ie,De;let Se=this.findKeyByValue(this.selectedItems,Ae);if(!Se)return;delete this.selectedItems[Se];const Ee=((xe=this.signal)==null?void 0:xe.get())||this.getState();(De=this.signal)==null||De.set({...this.signal.value,[this.name+"state"]:{...(Ie=(Te=this.signal)==null?void 0:Te.value)==null?void 0:Ie[this.name+"state"],selectedItems:{...this.selectedItems}},[this.name]:Object.keys({...this.selectedItems})}),this.updateState({...Ee,[this.name+"state"]:{...Ee==null?void 0:Ee[this.name+"state"],selectedItems:{...this.selectedItems}},[this.name]:Object.keys({...this.selectedItems})})})}static get observedAttributes(){return["props","bindings"]}attributeChangedCallback(Ae,Se,Ee){if(Ee!==Se){if(Ae==="props"&&Ee!==Se){Object.assign(this,JSON.parse(Ee||"{}"));const xe=this.styles.split(/\s+/).filter(Boolean);xe.length>0&&this.classList.add(...xe)}else if(Ae==="bindings"){const xe=JSON.parse(Ee||"{}");this.setBindings(xe,Te=>{var Ie,De,ke;this.selectedValues=Object.values(((Ie=Te==null?void 0:Te[this.name+"state"])==null?void 0:Ie.selectedItems)??{}),this.selectedItems=((De=Te==null?void 0:Te[this.name+"state"])==null?void 0:De.selectedItems)??{},this.classList.toggle("hidden",((ke=this.selectedValues)==null?void 0:ke.length)===0),this.renderChilds()})}}}findKeyByValue(Ae,Se){return Object.keys(Ae).find(Ee=>typeof Ae[Ee]=="string"&&Ae[Ee].toLowerCase()===Se.toLowerCase())}connectedCallback(){this.classList.add("hidden");let Ae;Ae=this.parentElement,this.name=Ae.name??"",this.addListeners()}handleClick(Ae){}addListeners(){}disconnectedCallback(){super.disconnectedCallback()}render(){}}customElements.define("mobius-badge-group",BadgeGroup);class MobiusButton extends BaseComponent{constructor(){super();In(this,"props",{});In(this,"services",{})}static get observedAttributes(){return["props","bindings","services"]}attributeChangedCallback(Ae,Se,Ee){if(Ae==="props")this.props=JSON.parse(Ee);else if(Ae==="bindings"){const xe=JSON.parse(Ee);this.setBindings(xe,()=>{console.log("Button Clicked")})}else Ae==="services"&&(this.services=JSON.parse(Ee))}connectedCallback(){var Ae,Se,Ee,xe,Te;super.connectedCallback(),this.className=" flex content-center item-center "+this.className,this.addStyle((Ae=this.props)==null?void 0:Ae.variant),this.addSize((Se=this.props)==null?void 0:Se.size),this.addIcon((Ee=this.props)==null?void 0:Ee.icon,(xe=this.props)==null?void 0:xe.size,(Te=this.props)==null?void 0:Te.imageStyle),this.onLoad()}addIcon(Ae,Se,Ee){Ae=replaceCurlyBraces(Ae,"state",{},this.meta.props,this);let xe={xs:"w-[16px] h-[16px]",sm:"w-[16px] h-[16px]",base:"w-[20px] h-[20px]",lg:"w-[24px] h-[24px]",xl:"w-[24px] h-[24px]"};this.querySelectorAll("img").forEach(Ie=>Ie.remove());let Te=!1;if(Ae!=null&&Ae.left){Te=!0;const Ie=document.createElement("img");Ie.src=Ae.left,Ie.className=xe[Se??"base"]+` mr-2 ${Ee}`,this.insertBefore(Ie,this.firstChild)}if(Ae!=null&&Ae.right){Te=!0;const Ie=document.createElement("img");Ie.src=Ae.right,Ie.className=xe[Se??"base"]+` ml-2 ${Ee}`,this.appendChild(Ie)}Te||this.classList.add("justify-evenly")}addStyle(Ae){switch(Ae){case"primary":this.className=" color-white cursor-pointer bg-primary-700 hover-bg-primary-800 focus:border[3px] focus:border-primary-200 "+this.className;break;case"gray":this.className=" color-white cursor-pointer bg-gray-800 hover-bg-gray-700 focus:border[3px] focus:border-gray-200 "+this.className;break;case"light":this.className=" color-gray-800 cursor-pointer bg-gray-200 hover-bg-gray-300 focus:border[3px] focus:border-gray-100 "+this.className;break;case"green":this.className=" color-white cursor-pointer bg-green-700 hover-bg-green-800 focus:border[3px] focus:border-green-200 "+this.className;break;case"red":this.className=" color-white cursor-pointer bg-red-700 hover-bg-red-800 focus:border[3px] focus:border-red-200 "+this.className;break;case"outline-primary":this.className=" color-primary-700 cursor-pointer border border-primary-700 hover-bg-primary-800 hover-color-white focus:border[3px] focus:border-primary-200 "+this.className;break;case"outline-green":this.className=" color-green-700 cursor-pointer border border-green-700 hover-bg-green-800 hover:text-white focus:border[3px] focus:border-green-200 "+this.className;break;case"outline-red":this.className=" color-red-700 cursor-pointer border border-red-700 hover-bg-red-800 hover:text-white focus:border[3px] focus:border-red-200 "+this.className;break;case"outline-light":this.className=" color-gray-800 cursor-pointer border border-gray-700 hover-bg-gray-700 hover:text-white focus:border[3px] focus:border-gray-200 "+this.className;break;case"outline-extra-light":this.className=" color-gray-800 cursor-pointer border border-gray-200 hover-bg-gray-300 hover:text-white focus:border[3px] focus:border-gray-200 "+this.className;break;case"outline-extra-light-primary":this.className=" color-gray-800 cursor-pointer border border-gray-200 hover-bg-gray-300 hover-color-primary-600 focus:border[3px] focus:border-gray-200 "+this.className;break;default:this.className=" color-white cursor-pointer bg-primary-700 hover-bg-primary-800 focus:border[3px] border-primary-200 "+this.className}}addSize(Ae){switch(Ae){case"xs":this.className=" px-3 py-2 min-w-[136px] w-fit min-h-[34px] rounded-lg text-xs-font-medium "+this.className;break;case"sm":this.className=" px-3 py-2 min-w-[147px] w-fit min-h-[37px] rounded-lg text-sm-font-medium "+this.className;break;case"base":this.className=" px-5 py-2-5 min-w-[171px] w-fit min-h-[41px] rounded-lg text-sm-font-medium "+this.className;break;case"lg":this.className=" px-5 py-3 min-w-[190px] w-fit min-h-[48px] rounded-lg text-base-font-medium "+this.className;break;case"xl":this.className=" px-6 py-3-5 min-w-[198px] w-fit min-h-[52px] rounded-lg text-base-font-medium "+this.className;break;default:this.className=" px-5 py-2-5 min-w-[171px] w-fit min-h-[41px] rounded-lg text-sm-font-medium "+this.className}}}customElements.define("mobius-button",MobiusButton);const CloseIcon="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.4115%2012L18.6952%206.71628C18.7906%206.62419%2018.8666%206.51404%2018.919%206.39225C18.9713%206.27046%2018.9988%206.13947%2019%206.00692C19.0011%205.87438%2018.9759%205.74293%2018.9257%205.62025C18.8755%205.49756%2018.8013%205.38611%2018.7076%205.29238C18.6139%205.19865%2018.5024%205.12453%2018.3798%205.07434C18.2571%205.02414%2018.1256%204.99889%2017.9931%205.00004C17.8605%205.00119%2017.7295%205.02873%2017.6078%205.08104C17.486%205.13336%2017.3758%205.20941%2017.2837%205.30475L12%2010.5885L6.71628%205.30475C6.528%205.12291%206.27584%205.0223%206.01411%205.02457C5.75237%205.02685%205.502%205.13183%205.31691%205.31691C5.13183%205.502%205.02685%205.75237%205.02457%206.01411C5.0223%206.27584%205.12291%206.528%205.30475%206.71628L10.5885%2012L5.30475%2017.2837C5.20941%2017.3758%205.13336%2017.486%205.08104%2017.6078C5.02873%2017.7295%205.00119%2017.8605%205.00004%2017.9931C4.99889%2018.1256%205.02414%2018.2571%205.07434%2018.3798C5.12453%2018.5024%205.19865%2018.6139%205.29238%2018.7076C5.38611%2018.8013%205.49756%2018.8755%205.62025%2018.9257C5.74293%2018.9759%205.87438%2019.0011%206.00692%2019C6.13947%2018.9988%206.27046%2018.9713%206.39225%2018.919C6.51404%2018.8666%206.62419%2018.7906%206.71628%2018.6952L12%2013.4115L17.2837%2018.6952C17.472%2018.8771%2017.7242%2018.9777%2017.9859%2018.9754C18.2476%2018.9732%2018.498%2018.8682%2018.6831%2018.6831C18.8682%2018.498%2018.9732%2018.2476%2018.9754%2017.9859C18.9777%2017.7242%2018.8771%2017.472%2018.6952%2017.2837L13.4115%2012Z'%20fill='%231F2A37'/%3e%3c/svg%3e";class ToastElement extends BaseComponent{constructor(){super();In(this,"props",{position:"top-right",dismissable:!0,autoHideWithIn:100,showProgressBar:!0,progressBarColor:"#76c7c0",backgroundColor:"white",defaultOpen:!1,toastValue:""});In(this,"timerId",null);In(this,"progressIntervalId",null);In(this,"positions",{"top-left":"absolute top-10 start-10","top-right":"absolute top-10 end-10","bottom-left":"absolute bottom-10 start-10","bottom-right":"absolute bottom-10 end-10",none:""})}static get observedAttributes(){return["props","bindings"]}applyPositionStyles(){this.className+=" "+this.positions[this.props.position]}addCloseIconToToast(){if(this.props.dismissable){let Ae=document.createElement("img");Ae.setAttribute("id","toast-close"),Ae.setAttribute("src",CloseIcon),Ae.className="ms-auto -mx-1.5 -my-1.5 h-5 w-5",Ae.addEventListener("click",this.dismissToast.bind(this)),this.append(Ae)}}addProgressBar(Ae){const Se=document.createElement("div");Se.setAttribute("id","toast-progress-bar"),Se.style.position="absolute",Se.style.bottom="0",Se.style.left="0",Se.style.height="4px",Se.style.width="100%",Se.style.backgroundColor=this.props.progressBarColor,Se.style.transition=`width ${Ae}s linear`,this.append(Se),setTimeout(()=>{Se.style.width="0%"},0),this.progressIntervalId=setTimeout(()=>{Se.remove()},Ae*1e3)}addAutoCloseEvent(){const Ae=this.props.autoHideWithIn;this.props.showProgressBar&&this.addProgressBar(Ae),this.timerId=setTimeout(()=>{this.dismissToast()},Ae*1e3)}attributeChangedCallback(Ae,Se,Ee){if(Se!==Ee){if(Ae==="props")try{this.props={...this.props,...JSON.parse(Ee||"{}")};const xe=["flex","items-center","w-full","max-w-xs","p-4","text-gray-500","gap-4","rounded-lg","shadow",`bg-${this.props.backgroundColor}`];this.classList.add(...xe),this.className+=" "+(this.props.styles??""),this.props.toastValue&&(this.innerText=this.props.toastValue),this.applyPositionStyles(),this.addCloseIconToToast(),this.addAutoCloseEvent()}catch(xe){console.error("Error parsing props:",xe)}if(Ae==="bindings"){const xe=JSON.parse(Ee||"{}");this.setBindings(xe,Te=>{console.log("toast--",Te),this.toggleView(Te)})}else Se!==Ee&&this.setAttribute(Ae,Ee??"")}}disconnectedCallback(){super.disconnectedCallback();const Ae=this.querySelector(".toast-close");Ae&&Ae.removeEventListener("click",this.dismissToast.bind(this)),this.timerId&&clearTimeout(this.timerId),this.progressIntervalId&&clearTimeout(this.progressIntervalId),this.classList.add("hidden")}dismissToast(){this.dispatchEvent(new CustomEvent("toast-dismissed",{bubbles:!0,composed:!0})),this.remove(),this.timerId&&clearTimeout(this.timerId),this.progressIntervalId&&clearTimeout(this.progressIntervalId)}toggleView(Ae=!1){Ae?this.classList.remove("hidden"):this.classList.add("hidden")}}customElements.define("mobius-toast",ToastElement);function t$2(Ce,_e,Ae,Se){return new(Ae||(Ae=Promise))(function(Ee,xe){function Te(ke){try{De(Se.next(ke))}catch(Oe){xe(Oe)}}function Ie(ke){try{De(Se.throw(ke))}catch(Oe){xe(Oe)}}function De(ke){var Oe;ke.done?Ee(ke.value):(Oe=ke.value,Oe instanceof Ae?Oe:new Ae(function(Me){Me(Oe)})).then(Te,Ie)}De((Se=Se.apply(Ce,_e||[])).next())})}typeof SuppressedError=="function"&&SuppressedError;let e$4=class{constructor(){this.listeners={}}on(_e,Ae,Se){if(this.listeners[_e]||(this.listeners[_e]=new Set),this.listeners[_e].add(Ae),Se==null?void 0:Se.once){const Ee=()=>{this.un(_e,Ee),this.un(_e,Ae)};return this.on(_e,Ee),Ee}return()=>this.un(_e,Ae)}un(_e,Ae){var Se;(Se=this.listeners[_e])===null||Se===void 0||Se.delete(Ae)}once(_e,Ae){return this.on(_e,Ae,{once:!0})}unAll(){this.listeners={}}emit(_e,...Ae){this.listeners[_e]&&this.listeners[_e].forEach(Se=>Se(...Ae))}};const i$6={decode:function(Ce,_e){return t$2(this,void 0,void 0,function*(){const Ae=new AudioContext({sampleRate:_e});return Ae.decodeAudioData(Ce).finally(()=>Ae.close())})},createBuffer:function(Ce,_e){return typeof Ce[0]=="number"&&(Ce=[Ce]),function(Ae){const Se=Ae[0];if(Se.some(Ee=>Ee>1||Ee<-1)){const Ee=Se.length;let xe=0;for(let Te=0;Te<Ee;Te++){const Ie=Math.abs(Se[Te]);Ie>xe&&(xe=Ie)}for(const Te of Ae)for(let Ie=0;Ie<Ee;Ie++)Te[Ie]/=xe}}(Ce),{duration:_e,length:Ce[0].length,sampleRate:Ce[0].length/_e,numberOfChannels:Ce.length,getChannelData:Ae=>Ce==null?void 0:Ce[Ae],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function s$2(Ce,_e){const Ae=_e.xmlns?document.createElementNS(_e.xmlns,Ce):document.createElement(Ce);for(const[Se,Ee]of Object.entries(_e))if(Se==="children"&&Ee)for(const[xe,Te]of Object.entries(Ee))Te instanceof Node?Ae.appendChild(Te):typeof Te=="string"?Ae.appendChild(document.createTextNode(Te)):Ae.appendChild(s$2(xe,Te));else Se==="style"?Object.assign(Ae.style,Ee):Se==="textContent"?Ae.textContent=Ee:Ae.setAttribute(Se,Ee.toString());return Ae}function n$1(Ce,_e,Ae){const Se=s$2(Ce,_e||{});return Ae==null||Ae.appendChild(Se),Se}var r$3=Object.freeze({__proto__:null,createElement:n$1,default:n$1});const o$2={fetchBlob:function(Ce,_e,Ae){return t$2(this,void 0,void 0,function*(){const Se=yield fetch(Ce,Ae);if(Se.status>=400)throw new Error(`Failed to fetch ${Ce}: ${Se.status} (${Se.statusText})`);return function(Ee,xe){t$2(this,void 0,void 0,function*(){if(!Ee.body||!Ee.headers)return;const Te=Ee.body.getReader(),Ie=Number(Ee.headers.get("Content-Length"))||0;let De=0;const ke=Me=>t$2(this,void 0,void 0,function*(){De+=(Me==null?void 0:Me.length)||0;const Pe=Math.round(De/Ie*100);xe(Pe)}),Oe=()=>t$2(this,void 0,void 0,function*(){let Me;try{Me=yield Te.read()}catch{return}Me.done||(ke(Me.value),yield Oe())});Oe()})}(Se.clone(),_e),Se.blob()})}};let a$1=class extends e$4{constructor(_e){super(),this.isExternalMedia=!1,_e.media?(this.media=_e.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),_e.mediaControls&&(this.media.controls=!0),_e.autoplay&&(this.media.autoplay=!0),_e.playbackRate!=null&&this.onMediaEvent("canplay",()=>{_e.playbackRate!=null&&(this.media.playbackRate=_e.playbackRate)},{once:!0})}onMediaEvent(_e,Ae,Se){return this.media.addEventListener(_e,Ae,Se),()=>this.media.removeEventListener(_e,Ae,Se)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const _e=this.getSrc();_e.startsWith("blob:")&&URL.revokeObjectURL(_e)}canPlayType(_e){return this.media.canPlayType(_e)!==""}setSrc(_e,Ae){const Se=this.getSrc();if(_e&&Se===_e)return;this.revokeSrc();const Ee=Ae instanceof Blob&&(this.canPlayType(Ae.type)||!_e)?URL.createObjectURL(Ae):_e;if(Se&&this.media.removeAttribute("src"),Ee||_e)try{this.media.src=Ee}catch{this.media.src=_e}}destroy(){this.isExternalMedia||(this.media.pause(),this.media.remove(),this.revokeSrc(),this.media.removeAttribute("src"),this.media.load())}setMediaElement(_e){this.media=_e}play(){return t$2(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(_e){this.media.currentTime=Math.max(0,Math.min(_e,this.getDuration()))}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(_e){this.media.volume=_e}getMuted(){return this.media.muted}setMuted(_e){this.media.muted=_e}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(_e,Ae){Ae!=null&&(this.media.preservesPitch=Ae),this.media.playbackRate=_e}getMediaElement(){return this.media}setSinkId(_e){return this.media.setSinkId(_e)}},h$2=class A_ extends e$4{constructor(_e,Ae){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.unsubscribeOnScroll=[],this.subscriptions=[],this.options=_e;const Se=this.parentFromOptionsContainer(_e.container);this.parent=Se;const[Ee,xe]=this.initHtml();Se.appendChild(Ee),this.container=Ee,this.scrollContainer=xe.querySelector(".scroll"),this.wrapper=xe.querySelector(".wrapper"),this.canvasWrapper=xe.querySelector(".canvases"),this.progressWrapper=xe.querySelector(".progress"),this.cursor=xe.querySelector(".cursor"),Ae&&xe.appendChild(Ae),this.initEvents()}parentFromOptionsContainer(_e){let Ae;if(typeof _e=="string"?Ae=document.querySelector(_e):_e instanceof HTMLElement&&(Ae=_e),!Ae)throw new Error("Container not found");return Ae}initEvents(){const _e=Ae=>{const Se=this.wrapper.getBoundingClientRect(),Ee=Ae.clientX-Se.left,xe=Ae.clientY-Se.top;return[Ee/Se.width,xe/Se.height]};if(this.wrapper.addEventListener("click",Ae=>{const[Se,Ee]=_e(Ae);this.emit("click",Se,Ee)}),this.wrapper.addEventListener("dblclick",Ae=>{const[Se,Ee]=_e(Ae);this.emit("dblclick",Se,Ee)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:Ae,scrollWidth:Se,clientWidth:Ee}=this.scrollContainer,xe=Ae/Se,Te=(Ae+Ee)/Se;this.emit("scroll",xe,Te,Ae,Ae+Ee)}),typeof ResizeObserver=="function"){const Ae=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{Ae().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const _e=this.parent.clientWidth;_e===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=_e,this.reRender())}initDrag(){this.subscriptions.push(function(_e,Ae,Se,Ee,xe=3,Te=0,Ie=100){if(!_e)return()=>{};const De=matchMedia("(pointer: coarse)").matches;let ke=()=>{};const Oe=Me=>{if(Me.button!==Te)return;Me.preventDefault(),Me.stopPropagation();let Pe=Me.clientX,Be=Me.clientY,Fe=!1;const $e=Date.now(),Ue=qe=>{if(qe.preventDefault(),qe.stopPropagation(),De&&Date.now()-$e<Ie)return;const Ke=qe.clientX,Ge=qe.clientY,Ye=Ke-Pe,Qe=Ge-Be;if(Fe||Math.abs(Ye)>xe||Math.abs(Qe)>xe){const St=_e.getBoundingClientRect(),{left:Ze,top:Xe}=St;Fe||(Se==null||Se(Pe-Ze,Be-Xe),Fe=!0),Ae(Ye,Qe,Ke-Ze,Ge-Xe),Pe=Ke,Be=Ge}},He=qe=>{if(Fe){const Ke=qe.clientX,Ge=qe.clientY,Ye=_e.getBoundingClientRect(),{left:Qe,top:St}=Ye;Ee==null||Ee(Ke-Qe,Ge-St)}ke()},Ve=qe=>{qe.relatedTarget&&qe.relatedTarget!==document.documentElement||He(qe)},ze=qe=>{Fe&&(qe.stopPropagation(),qe.preventDefault())},We=qe=>{Fe&&qe.preventDefault()};document.addEventListener("pointermove",Ue),document.addEventListener("pointerup",He),document.addEventListener("pointerout",Ve),document.addEventListener("pointercancel",Ve),document.addEventListener("touchmove",We,{passive:!1}),document.addEventListener("click",ze,{capture:!0}),ke=()=>{document.removeEventListener("pointermove",Ue),document.removeEventListener("pointerup",He),document.removeEventListener("pointerout",Ve),document.removeEventListener("pointercancel",Ve),document.removeEventListener("touchmove",We),setTimeout(()=>{document.removeEventListener("click",ze,{capture:!0})},10)}};return _e.addEventListener("pointerdown",Oe),()=>{ke(),_e.removeEventListener("pointerdown",Oe)}}(this.wrapper,(_e,Ae,Se)=>{this.emit("drag",Math.max(0,Math.min(1,Se/this.wrapper.getBoundingClientRect().width)))},_e=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,_e/this.wrapper.getBoundingClientRect().width)))},_e=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,_e/this.wrapper.getBoundingClientRect().width)))}))}getHeight(_e,Ae){var Se;const Ee=((Se=this.audioData)===null||Se===void 0?void 0:Se.numberOfChannels)||1;if(_e==null)return 128;if(!isNaN(Number(_e)))return Number(_e);if(_e==="auto"){const xe=this.parent.clientHeight||128;return Ae!=null&&Ae.every(Te=>!Te.overlay)?xe/Ee:xe}return 128}initHtml(){const _e=document.createElement("div"),Ae=_e.attachShadow({mode:"open"}),Se=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return Ae.innerHTML=`
2058
+ `}mountSocketIOService(){var Ee;if(!this.services)return;const Ae=((Ee=this.services.socketIO)==null?void 0:Ee.connectionDetails)||[];if(!Ae.length||this.serviceManager.has(ServicesEnum.SOCKET_IO))return;const Se=new SocketIOService(Ae);this.serviceManager.registerService(Se),this.serviceManager.mountService(ServicesEnum.SOCKET_IO)}};In(Pp,"router");let MobiusContainer=Pp;customElements.define("mobius-container",MobiusContainer);class MobiusLoop extends BaseComponent{constructor(){super();In(this,"props");In(this,"dataFromParent");In(this,"data",[]);In(this,"dataCopy",[])}connectedCallback(){this.initializeProps(),this.loadData(),this.setupBindings(),this.onLoad()}initializeProps(){this.props=JSON.parse(this.getAttribute("props")||"{}")||{}}async loadData(){if(this.props.API){const Ae=await this.fetchAPI();this.data=this.extractLoopData(Ae)}else this.data=this.props.Data||[];this.dataCopy=[...this.data],this.render()}extractLoopData(Ae){let Se=Ae;return this.props.loopOver&&this.props.loopOver.split(".").forEach(Ee=>{Se=(Se==null?void 0:Se[Ee])||Se}),Se}setupBindings(){const Ae=JSON.parse(this.getAttribute("bindings")||"{}")||{};this.setBindings(Ae,Se=>this.handleSearch(Se))}handleSearch(Ae){var xe,Te,Ie,De,ke;if(!((Te=(xe=this.props)==null?void 0:xe.search)!=null&&Te.searchOver))return;this.innerHTML="";const Se=(De=(Ie=this.props)==null?void 0:Ie.search)==null?void 0:De.searchBoxName;if(!Se){console.warn("searchBoxName is not provided in mobius-loop");return}const Ee=((ke=Ae==null?void 0:Ae[Se])==null?void 0:ke.toLowerCase())||"";this.data=Ee?this.dataCopy.filter(Oe=>String(Oe[this.props.search.searchOver]).toLowerCase().includes(Ee)):[...this.dataCopy],this.render()}setDataFromParent(Ae){this.dataFromParent=Ae}async fetchAPI(){let{apiUrl:Ae,method:Se="GET",bearerToken:Ee,body:xe={},dynamicBody:Te={}}=this.props.API;if(Object.keys(Te).length&&this.dataFromParent&&(xe=resolveDynamicData(Te,this.dataFromParent,xe)),xe=replaceCurlyBraces(xe),Ae.includes("{")){const ke=[...Ae.matchAll(/\{(.*?)\}/g)];switch(this.props.API.dynamicStorageSource){case"localStorage":ke.forEach(Oe=>{let Me=Oe[1],Pe=localStorage.getItem(Me)||"";Ae=Ae.replace(Oe[0],Pe)});break;default:ke.forEach(Oe=>{let Me=Oe[1],Pe=localStorage.getItem(Me)||"";Ae=Ae.replace(Oe[0],Pe)});break}}if(Se!=="GET"&&!Object.keys(xe).length)return;const Ie={"Content-Type":"application/json",Authorization:`Bearer ${Ee}`},De={method:Se,headers:Ie};Se!=="GET"&&Object.keys(xe).length&&(De.body=JSON.stringify(xe));try{return(await fetch(Ae,De)).json()}catch(ke){return console.error("Error fetching API data",ke),[]}}render(){const Ae=this.props.component,Se=this.querySelector("mobius-loop");Array.isArray(this.data)&&this.data.forEach((Ee,xe)=>{var De;const Te=JSON.parse(JSON.stringify(Ae));Te.dynamicProps&&(Te.props=resolveDynamicData(Te.dynamicProps,Ee,Te.props)),(De=Te.propsIndex)!=null&&De[xe]&&(Te.props={...Te.props,...Te.propsIndex[xe]});const Ie=createElementFromMetadata(Te,this);if(this.props.isPiped){const ke=Se.cloneNode(!0);ke.setDataFromParent(Ee),console.log(Ie),Ie==null||Ie.appendChild(ke)}this.appendChild(Ie)}),Se==null||Se.remove()}}customElements.define("mobius-loop",MobiusLoop);class MobiusTab extends BaseComponent{constructor(){super();In(this,"props")}connectedCallback(){this.className=`block ${this.className}`}getTabData(){var Ae,Se,Ee;return this.props=JSON.parse(this.getAttribute("props")),{header:this.props.header,icon:{left:this.props.leftIcon,right:this.props.rightIcon,size:this.props.size},stateHeader:((Ae=this.props)==null?void 0:Ae.stateHeader)||"",iconCss:this.props.iconCss,bindings:((Se=this.meta.props)==null?void 0:Se.tabBindings)||this.meta.bindings,props:((Ee=this.meta.props)==null?void 0:Ee.tabProps)||this.meta.props}}}customElements.define("mobius-tab",MobiusTab);class MobiusTabs extends BaseComponent{constructor(){super();In(this,"Tabs",[]);In(this,"props",{});In(this,"selectedTab",0);In(this,"tabContainer",null);In(this,"findByHeaderOrIndex",Ae=>{var Se,Ee,xe;if(typeof Ae=="number"){const Te=(Se=this.Tabs)==null?void 0:Se[Ae];return{index:Ae,tab:Te}}else if(typeof Ae=="string"){const Te=(Ee=this.Tabs)==null?void 0:Ee.findIndex(De=>De.header===Ae),Ie=Te!==-1?(xe=this.Tabs)==null?void 0:xe[Te]:void 0;return{index:Te,tab:Ie}}else return{index:-1,tab:void 0}})}connectedCallback(){var xe;this.props=JSON.parse(this.getAttribute("props")||"{}");const Ae=JSON.parse(this.getAttribute("bindings")||"{}");this.setBindings(Ae,Te=>{let Ie=this.findByHeaderOrIndex(Te);Ie.tab&&Ie.index!=this.selectedTab&&(this.selectedTab=Ie.index==-1?this.selectedTab:Ie==null?void 0:Ie.index,this.updateActiveTab(Ie==null?void 0:Ie.tab,Ie.index))}),this.initializeTabs();const Se=this.getState()||((xe=this.signal)==null?void 0:xe.get())||0,Ee=this.findByHeaderOrIndex(Se);this.selectedTab=Ee.index==-1?0:Ee==null?void 0:Ee.index,Ee.tab&&this.updateActiveTab(Ee.tab,Ee.index),this.onLoad()}initializeTabs(){this.tabContainer=document.createElement("div"),this.tabContainer.className="flex w-full cursor-pointer "+this.props.tabContainerStyles,this.props.variant=="light"&&(this.tabContainer.className+=" shadow rounded"),Array.from(this.children).forEach((Ae,Se)=>{var Ee,xe;if(Ae.localName==="mobius-tab"){let Te=this.selectedTab===Se;const Ie=(Ee=Ae.getTabData)==null?void 0:Ee.call(Ae);let De={type:"mobius-div",version:"V1",value:"",styles:this.getStyles(Te,Se)+` ${this.props.tabCss??""}`,bindings:Ie==null?void 0:Ie.bindings,props:Ie==null?void 0:Ie.props,children:[]},ke=mountComponents([De],this);ke=ke.querySelector("mobius-div"),ke.textContent=Ie.header??`Tab ${Se+1}`,this.addIcon(Ie.icon,Ie.size??"base",Ie.iconCss,ke),(xe=this.tabContainer)==null||xe.appendChild(ke);const Oe={tabChild:Ae,isActive:Te,tabElement:ke,header:Ie.stateHeader??Ie.header};ke.addEventListener("click",()=>this.updateActiveTab(Oe,Se)),this.Tabs.push(Oe),Te||Ae.classList.add("hidden")}}),this.insertBefore(this.tabContainer,this.firstChild)}addIcon(Ae,Se,Ee,xe){let Te={xs:"w-[16px] h-[16px]",sm:"w-[16px] h-[16px]",base:"w-[20px] h-[20px]",lg:"w-[24px] h-[24px]",xl:"w-[24px] h-[24px]"};const Ie=document.createElement("img");Ae!=null&&Ae.left?(Ie.src=Ae.left,Ie.className=Te[Se??"base"]+` ${Ee}`):Ie.className="none";const De=document.createElement("img");Ae!=null&&Ae.right?(De.src=Ae.right,De.className=Te[Se]):De.className+="none",xe.insertBefore(Ie,xe.firstChild),xe.appendChild(De)}getStyles(Ae,Se=0){var Ee,xe,Te;switch(this.props.variant){case"button":return`${(Ee=this.props)!=null&&Ee.tabCss&&((xe=this.props)==null?void 0:xe.tabCss)!=""?(Te=this.props)==null?void 0:Te.tabCss:"w-full text-sm-font-medium px-3 py-4 transition-all text-center flex gap-2 justify-center"}${Ae?"bg-primary-600 rounded color-white "+this.props.activeCss:""}`;case"light":return`w-full text-sm-font-medium color-gray-500 px-3 py-4 ${Se==0?"":"border-l-2"} transition-all text-center flex gap-2 justify-center ${Ae?"bg-gray-50 color-gray-900"+this.props.activeCss:""}`;case"underline":return`w-full text-sm-font-medium border-b-2 pb-2 transition-all text-center flex gap-2 justify-center ${Ae?"color-primary-600 border-primary-600 "+this.props.activeCss:"color-gray-500 border-gray-300"}`;default:return`w-full text-sm-font-medium border-b-2 pb-2 transition-all text-center flex gap-2 justify-center ${Ae?"color-primary-600 border-primary-600 "+this.props.activeCss:"color-gray-500 border-gray-300"}`}}updateActiveTab(Ae,Se){var xe,Te,Ie,De;const Ee=this.Tabs.findIndex(ke=>ke.isActive);this.Tabs[Ee]&&(this.Tabs[Ee].isActive=!1,this.Tabs[Ee].tabChild.classList.add("hidden"),this.Tabs[Ee].tabElement.className=this.getStyles(!1,Ee)+` ${(xe=this.props)==null?void 0:xe.tabCss}`),Ae.isActive=!0,Ae.tabChild.classList.remove("hidden"),Ae.tabElement.className=this.getStyles(!0,Se)+` ${(Te=this.props)==null?void 0:Te.tabCss} ${(Ie=this.props)==null?void 0:Ie.activeCss}`,(De=this.signal)==null||De.set(Se),this.updateState(Se)}}customElements.define("mobius-tabs",MobiusTabs);class ButtonGroupButton extends BaseComponent{constructor(){super();In(this,"buttonValue")}static get observedAttributes(){return["props","bindings"]}attributeChangedCallback(Ae,Se,Ee){var xe;if(Se!==Ee){if(Ae==="props"){const Te=JSON.parse(Ee);Te.span&&(this.style.gridColumn=`span ${Te.span}`),Te.value&&(this.buttonValue=Te.value),Te.style?this.className=`${Te.style}`:this.className="px-4 py-2 w-full border-r border-gray-200 cursor-pointer hover:bg-gray-100 text-center text-sm-font-medium flex gap-2",this.addIcon(Te==null?void 0:Te.icon,Te==null?void 0:Te.size)}else if(Ae==="bindings"){const Te=JSON.parse(Ee);this.setBindings(Te,De=>{this.setSelectedButtonCss(De)});const Ie=((xe=this.signal)==null?void 0:xe.get())||this.getState()||{};this.setSelectedButtonCss(Ie)}}}setSelectedButtonCss(Ae){Ae&&(Ae==this.buttonValue?this.className+=" bg-gray-100 color-primary-600 ":this.className=this.className.replace(" bg-gray-100 color-primary-600 ",""))}addIcon(Ae,Se="base"){let Ee={xs:"w-[16px] h-[16px]",sm:"w-[16px] h-[16px]",base:"w-[20px] h-[20px]",lg:"w-[24px] h-[24px]",xl:"w-[24px] h-[24px]"};const xe=document.createElement("img");Ae?(xe.src=Ae,xe.className=Ee[Se]):xe.className="none",this.insertBefore(xe,this.firstChild)}}customElements.define("mobius-button-group-button",ButtonGroupButton);class ButtonGroup extends BaseComponent{constructor(){super();In(this,"props",{});this.updateLastChildBorder()}static get observedAttributes(){return["props","bindings"]}attributeChangedCallback(Ae,Se,Ee){if(Se!==Ee){if(Ae==="props"){this.props=JSON.parse(Ee);const{grid:xe,noBorder:Te}=this.props;this.style.gridTemplateColumns=`repeat(${xe}, 1fr)`,Te?this.className="rounded-md grid gap-1":this.className="rounded-md border border-gray-200 grid"}else if(Ae==="bindings"){const xe=JSON.parse(Ee);this.setBindings(xe,()=>console.log("Button Group State Updated"))}}}updateLastChildBorder(){const Ae=this.children;Ae.length>0&&Array.from(Ae)[Ae.length-1].classList.remove("border-r")}}customElements.define("mobius-button-group",ButtonGroup);class BadgeElement extends BaseComponent{constructor(){super();In(this,"_value",null);In(this,"defaultValues",{src:"",color:"primary",size:"",rounded:!1,border:!1})}static get observedAttributes(){return["props","bindings","events"]}applyColorStyle(Ae){Ae&&this.classList.add(`bg-${Ae}-100`,`text-${Ae}-800`)}applySizeStyle(Ae){const Se=Ae==="large"?"text-sm":"text-xs";this.classList.add(Se)}applyBorderStyle(Ae,Se,Ee){Se&&(this.classList.add(Ae),Ee&&Ee.trim()&&this.classList.add(`border-${Ee}-400`))}attributeChangedCallback(Ae,Se,Ee){if(Se!==Ee){if(Ae==="props")try{let xe=JSON.parse(Ee||"{}");xe=addMissingDefaults(xe,this.defaultValues);const Te=["inline-flex","items-center","justify-center","px-2.5","py-0.5","gap-1"];this.classList.add(...Te),Object.entries(xe).forEach(([Ie,De])=>{switch(Ie){case"color":this.applyColorStyle(De);break;case"size":this.applySizeStyle(De);break;case"dismissable":De&&this.addDismissListener();break;case"rounded":De&&this.classList.add(Ie);break;case"border":this.applyBorderStyle(Ie,De,xe.color||null);break;default:this.setAttribute(Ie,De);break}})}catch(xe){console.error("Error parsing props:",xe)}else if(Ae==="bindings"){const xe=JSON.parse(Ee||"{}");this.setBindings(xe,()=>console.log("Binded"))}else Se!==Ee&&this.setAttribute(Ae,Ee??"");this.render()}}get value(){return this._value}set value(Ae){this._value!==Ae&&(this._value=Ae,this.render())}render(){var Se;let Ae=(Se=JSON.parse(this.getAttribute("props")))==null?void 0:Se.value;this.value?this.innerHTML=`${this.value}`:Ae&&(this.innerHTML=Ae)}disconnectedCallback(){super.disconnectedCallback();const Ae=this.querySelector(".dismiss");Ae&&Ae.removeEventListener("click",this.dismissBadge.bind(this))}addDismissListener(){const Ae=this.querySelector(".dismiss");Ae&&Ae.addEventListener("click",this.dismissBadge.bind(this))}dismissBadge(){this.dispatchEvent(new CustomEvent("badge-dismissed",{bubbles:!0,composed:!0})),this.remove()}}customElements.define("mobius-badge",BadgeElement);class BadgeGroup extends BaseComponent{constructor(){super();In(this,"align","horizontal");In(this,"gap",1);In(this,"selectedValues",[]);In(this,"selectedItems",{});In(this,"name","");In(this,"styles","");In(this,"badgeProps",{});In(this,"renderChilds",()=>{var Ae;for(;this.firstChild;)this.removeChild(this.firstChild);(Ae=Object.entries(this.selectedItems))==null||Ae.forEach(([Se,Ee])=>{this.buildBadge(Ee,Se)})});In(this,"buildBadge",(Ae,Se,Ee=!0)=>{var Oe,Me,Pe,Be,Fe,$e,Ue,He,Ve,ze,We,qe,Ke,Ge,Ye,Qe,St,Ze,Xe,tn;let xe=[{type:"mobius-badge",props:{...(Oe=this.badgeProps)==null?void 0:Oe.props,APIData:{key:Se,value:Ae},key:Se,value:Ae},bindings:(Me=this.badgeProps)==null?void 0:Me.bindings,styles:(Pe=this.badgeProps)==null?void 0:Pe.styles,children:[{type:"mobius-div",props:{...(Be=this.badgeProps)==null?void 0:Be.props,APIData:{key:Se,value:Ae},key:Se,value:Ae},bindings:{},styles:($e=(Fe=this.badgeProps)==null?void 0:Fe.textContainerProps)==null?void 0:$e.styles,children:[]},{id:"uysafigfvuusdv",name:"Interface",type:"mobius-img",props:{...(Ue=this.badgeProps)==null?void 0:Ue.iconProps,APIData:{key:Se,value:Ae},key:Se,value:Ae},styles:(Ve=(He=this.badgeProps)==null?void 0:He.iconProps)==null?void 0:Ve.styles,value:"",children:[],bindings:(ze=this.badgeProps)==null?void 0:ze.iconBindings}]}];if(Ee){const en=mountComponents(xe,this);let un=en.querySelector("mobius-img");this.appendChild(en),un==null||un.addEventListener("click",mn=>{mn==null||mn.preventDefault(),mn==null||mn.stopImmediatePropagation(),this.badgeDismissed(Ae)})}let Te=new BadgeElement;if((qe=(We=this.badgeProps)==null?void 0:We.styles)!=null&&qe.trim()){const en=this.badgeProps.styles.split(/\s+/).filter(Boolean);en.length>0&&Te.classList.add(...en)}Te.setAttribute("props",JSON.stringify(((Ke=this.badgeProps)==null?void 0:Ke.props)??"{}")),Te.setAttribute("bindings",JSON.stringify(((Ge=this.badgeProps)==null?void 0:Ge.bindings)??"{}")),Te.setAttribute("events",JSON.stringify(((Ye=this.badgeProps)==null?void 0:Ye.events)??"{}"));let Ie=new DivElement;Ie.value=Ae,Ie.setAttribute("props",JSON.stringify((Qe=this.badgeProps)==null?void 0:Qe.textContainerProps));let De=new customImg;const ke=(Ze=(St=this.badgeProps)==null?void 0:St.iconProps)==null?void 0:Ze.styles.split(/\s+/).filter(Boolean);return(Xe=De==null?void 0:De.classList)==null||Xe.add("dismiss"),(ke==null?void 0:ke.length)>0&&De.classList.add(...ke),De.setAttribute("props",JSON.stringify((tn=this.badgeProps)==null?void 0:tn.iconProps)),De.addEventListener("click",en=>{en==null||en.preventDefault(),en==null||en.stopImmediatePropagation(),this.badgeDismissed(Ae)}),Te.appendChild(Ie),Te.appendChild(De),Te});In(this,"badgeDismissed",Ae=>{var xe,Te,Ie,De;let Se=this.findKeyByValue(this.selectedItems,Ae);if(!Se)return;delete this.selectedItems[Se];const Ee=((xe=this.signal)==null?void 0:xe.get())||this.getState();(De=this.signal)==null||De.set({...this.signal.value,[this.name+"state"]:{...(Ie=(Te=this.signal)==null?void 0:Te.value)==null?void 0:Ie[this.name+"state"],selectedItems:{...this.selectedItems}},[this.name]:Object.keys({...this.selectedItems})}),this.updateState({...Ee,[this.name+"state"]:{...Ee==null?void 0:Ee[this.name+"state"],selectedItems:{...this.selectedItems}},[this.name]:Object.keys({...this.selectedItems})})})}static get observedAttributes(){return["props","bindings"]}attributeChangedCallback(Ae,Se,Ee){if(Ee!==Se){if(Ae==="props"&&Ee!==Se){Object.assign(this,JSON.parse(Ee||"{}"));const xe=this.styles.split(/\s+/).filter(Boolean);xe.length>0&&this.classList.add(...xe)}else if(Ae==="bindings"){const xe=JSON.parse(Ee||"{}");this.setBindings(xe,Te=>{var Ie,De,ke;this.selectedValues=Object.values(((Ie=Te==null?void 0:Te[this.name+"state"])==null?void 0:Ie.selectedItems)??{}),this.selectedItems=((De=Te==null?void 0:Te[this.name+"state"])==null?void 0:De.selectedItems)??{},this.classList.toggle("hidden",((ke=this.selectedValues)==null?void 0:ke.length)===0),this.renderChilds()})}}}findKeyByValue(Ae,Se){return Object.keys(Ae).find(Ee=>typeof Ae[Ee]=="string"&&Ae[Ee].toLowerCase()===Se.toLowerCase())}connectedCallback(){this.classList.add("hidden");let Ae;Ae=this.parentElement,this.name=Ae.name??"",this.addListeners()}handleClick(Ae){}addListeners(){}disconnectedCallback(){super.disconnectedCallback()}render(){}}customElements.define("mobius-badge-group",BadgeGroup);class MobiusButton extends BaseComponent{constructor(){super();In(this,"props",{});In(this,"services",{})}static get observedAttributes(){return["props","bindings","services"]}attributeChangedCallback(Ae,Se,Ee){if(Ae==="props")this.props=JSON.parse(Ee);else if(Ae==="bindings"){const xe=JSON.parse(Ee);this.setBindings(xe,()=>{console.log("Button Clicked")})}else Ae==="services"&&(this.services=JSON.parse(Ee))}connectedCallback(){var Ae,Se,Ee,xe,Te;super.connectedCallback(),this.className=" flex content-center item-center "+this.className,this.addStyle((Ae=this.props)==null?void 0:Ae.variant),this.addSize((Se=this.props)==null?void 0:Se.size),this.addIcon((Ee=this.props)==null?void 0:Ee.icon,(xe=this.props)==null?void 0:xe.size,(Te=this.props)==null?void 0:Te.imageStyle),this.onLoad()}addIcon(Ae,Se,Ee){Ae=replaceCurlyBraces(Ae,"state",{},this.meta.props,this);let xe={xs:"w-[16px] h-[16px]",sm:"w-[16px] h-[16px]",base:"w-[20px] h-[20px]",lg:"w-[24px] h-[24px]",xl:"w-[24px] h-[24px]"};this.querySelectorAll("img").forEach(Ie=>Ie.remove());let Te=!1;if(Ae!=null&&Ae.left){Te=!0;const Ie=document.createElement("img");Ie.src=Ae.left,Ie.className=xe[Se??"base"]+` mr-2 ${Ee}`,this.insertBefore(Ie,this.firstChild)}if(Ae!=null&&Ae.right){Te=!0;const Ie=document.createElement("img");Ie.src=Ae.right,Ie.className=xe[Se??"base"]+` ml-2 ${Ee}`,this.appendChild(Ie)}Te||this.classList.add("justify-evenly")}addStyle(Ae){switch(Ae){case"primary":this.className=" color-white cursor-pointer bg-primary-700 hover-bg-primary-800 focus:border[3px] focus:border-primary-200 "+this.className;break;case"gray":this.className=" color-white cursor-pointer bg-gray-800 hover-bg-gray-700 focus:border[3px] focus:border-gray-200 "+this.className;break;case"light":this.className=" color-gray-800 cursor-pointer bg-gray-200 hover-bg-gray-300 focus:border[3px] focus:border-gray-100 "+this.className;break;case"green":this.className=" color-white cursor-pointer bg-green-700 hover-bg-green-800 focus:border[3px] focus:border-green-200 "+this.className;break;case"red":this.className=" color-white cursor-pointer bg-red-700 hover-bg-red-800 focus:border[3px] focus:border-red-200 "+this.className;break;case"outline-primary":this.className=" color-primary-700 cursor-pointer border border-primary-700 hover-bg-primary-800 hover-color-white focus:border[3px] focus:border-primary-200 "+this.className;break;case"outline-green":this.className=" color-green-700 cursor-pointer border border-green-700 hover-bg-green-800 hover:text-white focus:border[3px] focus:border-green-200 "+this.className;break;case"outline-red":this.className=" color-red-700 cursor-pointer border border-red-700 hover-bg-red-800 hover:text-white focus:border[3px] focus:border-red-200 "+this.className;break;case"outline-light":this.className=" color-gray-800 cursor-pointer border border-gray-700 hover-bg-gray-700 hover:text-white focus:border[3px] focus:border-gray-200 "+this.className;break;case"outline-extra-light":this.className=" color-gray-800 cursor-pointer border border-gray-200 hover-bg-gray-300 hover:text-white focus:border[3px] focus:border-gray-200 "+this.className;break;case"outline-extra-light-primary":this.className=" color-gray-800 cursor-pointer border border-gray-200 hover-bg-gray-300 hover-color-primary-600 focus:border[3px] focus:border-gray-200 "+this.className;break;default:this.className=" color-white cursor-pointer bg-primary-700 hover-bg-primary-800 focus:border[3px] border-primary-200 "+this.className}}addSize(Ae){switch(Ae){case"xs":this.className=" px-3 py-2 min-w-[136px] w-fit min-h-[34px] rounded-lg text-xs-font-medium "+this.className;break;case"sm":this.className=" px-3 py-2 min-w-[147px] w-fit min-h-[37px] rounded-lg text-sm-font-medium "+this.className;break;case"base":this.className=" px-5 py-2-5 min-w-[171px] w-fit min-h-[41px] rounded-lg text-sm-font-medium "+this.className;break;case"lg":this.className=" px-5 py-3 min-w-[190px] w-fit min-h-[48px] rounded-lg text-base-font-medium "+this.className;break;case"xl":this.className=" px-6 py-3-5 min-w-[198px] w-fit min-h-[52px] rounded-lg text-base-font-medium "+this.className;break;default:this.className=" px-5 py-2-5 min-w-[171px] w-fit min-h-[41px] rounded-lg text-sm-font-medium "+this.className}}}customElements.define("mobius-button",MobiusButton);const CloseIcon="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.4115%2012L18.6952%206.71628C18.7906%206.62419%2018.8666%206.51404%2018.919%206.39225C18.9713%206.27046%2018.9988%206.13947%2019%206.00692C19.0011%205.87438%2018.9759%205.74293%2018.9257%205.62025C18.8755%205.49756%2018.8013%205.38611%2018.7076%205.29238C18.6139%205.19865%2018.5024%205.12453%2018.3798%205.07434C18.2571%205.02414%2018.1256%204.99889%2017.9931%205.00004C17.8605%205.00119%2017.7295%205.02873%2017.6078%205.08104C17.486%205.13336%2017.3758%205.20941%2017.2837%205.30475L12%2010.5885L6.71628%205.30475C6.528%205.12291%206.27584%205.0223%206.01411%205.02457C5.75237%205.02685%205.502%205.13183%205.31691%205.31691C5.13183%205.502%205.02685%205.75237%205.02457%206.01411C5.0223%206.27584%205.12291%206.528%205.30475%206.71628L10.5885%2012L5.30475%2017.2837C5.20941%2017.3758%205.13336%2017.486%205.08104%2017.6078C5.02873%2017.7295%205.00119%2017.8605%205.00004%2017.9931C4.99889%2018.1256%205.02414%2018.2571%205.07434%2018.3798C5.12453%2018.5024%205.19865%2018.6139%205.29238%2018.7076C5.38611%2018.8013%205.49756%2018.8755%205.62025%2018.9257C5.74293%2018.9759%205.87438%2019.0011%206.00692%2019C6.13947%2018.9988%206.27046%2018.9713%206.39225%2018.919C6.51404%2018.8666%206.62419%2018.7906%206.71628%2018.6952L12%2013.4115L17.2837%2018.6952C17.472%2018.8771%2017.7242%2018.9777%2017.9859%2018.9754C18.2476%2018.9732%2018.498%2018.8682%2018.6831%2018.6831C18.8682%2018.498%2018.9732%2018.2476%2018.9754%2017.9859C18.9777%2017.7242%2018.8771%2017.472%2018.6952%2017.2837L13.4115%2012Z'%20fill='%231F2A37'/%3e%3c/svg%3e";class ToastElement extends BaseComponent{constructor(){super();In(this,"props",{position:"top-right",dismissable:!0,autoHideWithIn:100,showProgressBar:!0,progressBarColor:"#76c7c0",backgroundColor:"white",defaultOpen:!1,toastValue:""});In(this,"timerId",null);In(this,"progressIntervalId",null);In(this,"positions",{"top-left":"absolute top-10 start-10","top-right":"absolute top-10 end-10","bottom-left":"absolute bottom-10 start-10","bottom-right":"absolute bottom-10 end-10",none:""})}static get observedAttributes(){return["props","bindings"]}applyPositionStyles(){this.className+=" "+this.positions[this.props.position]}addCloseIconToToast(){if(this.props.dismissable){let Ae=document.createElement("img");Ae.setAttribute("id","toast-close"),Ae.setAttribute("src",CloseIcon),Ae.className="ms-auto -mx-1.5 -my-1.5 h-5 w-5",Ae.addEventListener("click",this.dismissToast.bind(this)),this.append(Ae)}}addProgressBar(Ae){const Se=document.createElement("div");Se.setAttribute("id","toast-progress-bar"),Se.style.position="absolute",Se.style.bottom="0",Se.style.left="0",Se.style.height="4px",Se.style.width="100%",Se.style.backgroundColor=this.props.progressBarColor,Se.style.transition=`width ${Ae}s linear`,this.append(Se),setTimeout(()=>{Se.style.width="0%"},0),this.progressIntervalId=setTimeout(()=>{Se.remove()},Ae*1e3)}addAutoCloseEvent(){const Ae=this.props.autoHideWithIn;this.props.showProgressBar&&this.addProgressBar(Ae),this.timerId=setTimeout(()=>{this.dismissToast()},Ae*1e3)}attributeChangedCallback(Ae,Se,Ee){if(Se!==Ee){if(Ae==="props")try{this.props={...this.props,...JSON.parse(Ee||"{}")};const xe=["flex","items-center","w-full","max-w-xs","p-4","text-gray-500","gap-4","rounded-lg","shadow",`bg-${this.props.backgroundColor}`];this.classList.add(...xe),this.className+=" "+(this.props.styles??""),this.props.toastValue&&(this.innerText=this.props.toastValue),this.applyPositionStyles(),this.addCloseIconToToast(),this.addAutoCloseEvent()}catch(xe){console.error("Error parsing props:",xe)}if(Ae==="bindings"){const xe=JSON.parse(Ee||"{}");this.setBindings(xe,Te=>{console.log("toast--",Te),this.toggleView(Te)})}else Se!==Ee&&this.setAttribute(Ae,Ee??"")}}disconnectedCallback(){super.disconnectedCallback();const Ae=this.querySelector(".toast-close");Ae&&Ae.removeEventListener("click",this.dismissToast.bind(this)),this.timerId&&clearTimeout(this.timerId),this.progressIntervalId&&clearTimeout(this.progressIntervalId),this.classList.add("hidden")}dismissToast(){this.dispatchEvent(new CustomEvent("toast-dismissed",{bubbles:!0,composed:!0})),this.remove(),this.timerId&&clearTimeout(this.timerId),this.progressIntervalId&&clearTimeout(this.progressIntervalId)}toggleView(Ae=!1){Ae?this.classList.remove("hidden"):this.classList.add("hidden")}}customElements.define("mobius-toast",ToastElement);function t$2(Ce,_e,Ae,Se){return new(Ae||(Ae=Promise))(function(Ee,xe){function Te(ke){try{De(Se.next(ke))}catch(Oe){xe(Oe)}}function Ie(ke){try{De(Se.throw(ke))}catch(Oe){xe(Oe)}}function De(ke){var Oe;ke.done?Ee(ke.value):(Oe=ke.value,Oe instanceof Ae?Oe:new Ae(function(Me){Me(Oe)})).then(Te,Ie)}De((Se=Se.apply(Ce,_e||[])).next())})}typeof SuppressedError=="function"&&SuppressedError;let e$4=class{constructor(){this.listeners={}}on(_e,Ae,Se){if(this.listeners[_e]||(this.listeners[_e]=new Set),this.listeners[_e].add(Ae),Se==null?void 0:Se.once){const Ee=()=>{this.un(_e,Ee),this.un(_e,Ae)};return this.on(_e,Ee),Ee}return()=>this.un(_e,Ae)}un(_e,Ae){var Se;(Se=this.listeners[_e])===null||Se===void 0||Se.delete(Ae)}once(_e,Ae){return this.on(_e,Ae,{once:!0})}unAll(){this.listeners={}}emit(_e,...Ae){this.listeners[_e]&&this.listeners[_e].forEach(Se=>Se(...Ae))}};const i$6={decode:function(Ce,_e){return t$2(this,void 0,void 0,function*(){const Ae=new AudioContext({sampleRate:_e});return Ae.decodeAudioData(Ce).finally(()=>Ae.close())})},createBuffer:function(Ce,_e){return typeof Ce[0]=="number"&&(Ce=[Ce]),function(Ae){const Se=Ae[0];if(Se.some(Ee=>Ee>1||Ee<-1)){const Ee=Se.length;let xe=0;for(let Te=0;Te<Ee;Te++){const Ie=Math.abs(Se[Te]);Ie>xe&&(xe=Ie)}for(const Te of Ae)for(let Ie=0;Ie<Ee;Ie++)Te[Ie]/=xe}}(Ce),{duration:_e,length:Ce[0].length,sampleRate:Ce[0].length/_e,numberOfChannels:Ce.length,getChannelData:Ae=>Ce==null?void 0:Ce[Ae],copyFromChannel:AudioBuffer.prototype.copyFromChannel,copyToChannel:AudioBuffer.prototype.copyToChannel}}};function s$2(Ce,_e){const Ae=_e.xmlns?document.createElementNS(_e.xmlns,Ce):document.createElement(Ce);for(const[Se,Ee]of Object.entries(_e))if(Se==="children"&&Ee)for(const[xe,Te]of Object.entries(Ee))Te instanceof Node?Ae.appendChild(Te):typeof Te=="string"?Ae.appendChild(document.createTextNode(Te)):Ae.appendChild(s$2(xe,Te));else Se==="style"?Object.assign(Ae.style,Ee):Se==="textContent"?Ae.textContent=Ee:Ae.setAttribute(Se,Ee.toString());return Ae}function n$1(Ce,_e,Ae){const Se=s$2(Ce,_e||{});return Ae==null||Ae.appendChild(Se),Se}var r$3=Object.freeze({__proto__:null,createElement:n$1,default:n$1});const o$2={fetchBlob:function(Ce,_e,Ae){return t$2(this,void 0,void 0,function*(){const Se=yield fetch(Ce,Ae);if(Se.status>=400)throw new Error(`Failed to fetch ${Ce}: ${Se.status} (${Se.statusText})`);return function(Ee,xe){t$2(this,void 0,void 0,function*(){if(!Ee.body||!Ee.headers)return;const Te=Ee.body.getReader(),Ie=Number(Ee.headers.get("Content-Length"))||0;let De=0;const ke=Me=>t$2(this,void 0,void 0,function*(){De+=(Me==null?void 0:Me.length)||0;const Pe=Math.round(De/Ie*100);xe(Pe)}),Oe=()=>t$2(this,void 0,void 0,function*(){let Me;try{Me=yield Te.read()}catch{return}Me.done||(ke(Me.value),yield Oe())});Oe()})}(Se.clone(),_e),Se.blob()})}};let a$1=class extends e$4{constructor(_e){super(),this.isExternalMedia=!1,_e.media?(this.media=_e.media,this.isExternalMedia=!0):this.media=document.createElement("audio"),_e.mediaControls&&(this.media.controls=!0),_e.autoplay&&(this.media.autoplay=!0),_e.playbackRate!=null&&this.onMediaEvent("canplay",()=>{_e.playbackRate!=null&&(this.media.playbackRate=_e.playbackRate)},{once:!0})}onMediaEvent(_e,Ae,Se){return this.media.addEventListener(_e,Ae,Se),()=>this.media.removeEventListener(_e,Ae,Se)}getSrc(){return this.media.currentSrc||this.media.src||""}revokeSrc(){const _e=this.getSrc();_e.startsWith("blob:")&&URL.revokeObjectURL(_e)}canPlayType(_e){return this.media.canPlayType(_e)!==""}setSrc(_e,Ae){const Se=this.getSrc();if(_e&&Se===_e)return;this.revokeSrc();const Ee=Ae instanceof Blob&&(this.canPlayType(Ae.type)||!_e)?URL.createObjectURL(Ae):_e;if(Se&&this.media.removeAttribute("src"),Ee||_e)try{this.media.src=Ee}catch{this.media.src=_e}}destroy(){this.isExternalMedia||(this.media.pause(),this.media.remove(),this.revokeSrc(),this.media.removeAttribute("src"),this.media.load())}setMediaElement(_e){this.media=_e}play(){return t$2(this,void 0,void 0,function*(){return this.media.play()})}pause(){this.media.pause()}isPlaying(){return!this.media.paused&&!this.media.ended}setTime(_e){this.media.currentTime=Math.max(0,Math.min(_e,this.getDuration()))}getDuration(){return this.media.duration}getCurrentTime(){return this.media.currentTime}getVolume(){return this.media.volume}setVolume(_e){this.media.volume=_e}getMuted(){return this.media.muted}setMuted(_e){this.media.muted=_e}getPlaybackRate(){return this.media.playbackRate}isSeeking(){return this.media.seeking}setPlaybackRate(_e,Ae){Ae!=null&&(this.media.preservesPitch=Ae),this.media.playbackRate=_e}getMediaElement(){return this.media}setSinkId(_e){return this.media.setSinkId(_e)}},h$2=class A_ extends e$4{constructor(_e,Ae){super(),this.timeouts=[],this.isScrollable=!1,this.audioData=null,this.resizeObserver=null,this.lastContainerWidth=0,this.isDragging=!1,this.subscriptions=[],this.unsubscribeOnScroll=[],this.subscriptions=[],this.options=_e;const Se=this.parentFromOptionsContainer(_e.container);this.parent=Se;const[Ee,xe]=this.initHtml();Se.appendChild(Ee),this.container=Ee,this.scrollContainer=xe.querySelector(".scroll"),this.wrapper=xe.querySelector(".wrapper"),this.canvasWrapper=xe.querySelector(".canvases"),this.progressWrapper=xe.querySelector(".progress"),this.cursor=xe.querySelector(".cursor"),Ae&&xe.appendChild(Ae),this.initEvents()}parentFromOptionsContainer(_e){let Ae;if(typeof _e=="string"?Ae=document.querySelector(_e):_e instanceof HTMLElement&&(Ae=_e),!Ae)throw new Error("Container not found");return Ae}initEvents(){const _e=Ae=>{const Se=this.wrapper.getBoundingClientRect(),Ee=Ae.clientX-Se.left,xe=Ae.clientY-Se.top;return[Ee/Se.width,xe/Se.height]};if(this.wrapper.addEventListener("click",Ae=>{const[Se,Ee]=_e(Ae);this.emit("click",Se,Ee)}),this.wrapper.addEventListener("dblclick",Ae=>{const[Se,Ee]=_e(Ae);this.emit("dblclick",Se,Ee)}),this.options.dragToSeek!==!0&&typeof this.options.dragToSeek!="object"||this.initDrag(),this.scrollContainer.addEventListener("scroll",()=>{const{scrollLeft:Ae,scrollWidth:Se,clientWidth:Ee}=this.scrollContainer,xe=Ae/Se,Te=(Ae+Ee)/Se;this.emit("scroll",xe,Te,Ae,Ae+Ee)}),typeof ResizeObserver=="function"){const Ae=this.createDelay(100);this.resizeObserver=new ResizeObserver(()=>{Ae().then(()=>this.onContainerResize()).catch(()=>{})}),this.resizeObserver.observe(this.scrollContainer)}}onContainerResize(){const _e=this.parent.clientWidth;_e===this.lastContainerWidth&&this.options.height!=="auto"||(this.lastContainerWidth=_e,this.reRender())}initDrag(){this.subscriptions.push(function(_e,Ae,Se,Ee,xe=3,Te=0,Ie=100){if(!_e)return()=>{};const De=matchMedia("(pointer: coarse)").matches;let ke=()=>{};const Oe=Me=>{if(Me.button!==Te)return;Me.preventDefault(),Me.stopPropagation();let Pe=Me.clientX,Be=Me.clientY,Fe=!1;const $e=Date.now(),Ue=qe=>{if(qe.preventDefault(),qe.stopPropagation(),De&&Date.now()-$e<Ie)return;const Ke=qe.clientX,Ge=qe.clientY,Ye=Ke-Pe,Qe=Ge-Be;if(Fe||Math.abs(Ye)>xe||Math.abs(Qe)>xe){const St=_e.getBoundingClientRect(),{left:Ze,top:Xe}=St;Fe||(Se==null||Se(Pe-Ze,Be-Xe),Fe=!0),Ae(Ye,Qe,Ke-Ze,Ge-Xe),Pe=Ke,Be=Ge}},He=qe=>{if(Fe){const Ke=qe.clientX,Ge=qe.clientY,Ye=_e.getBoundingClientRect(),{left:Qe,top:St}=Ye;Ee==null||Ee(Ke-Qe,Ge-St)}ke()},Ve=qe=>{qe.relatedTarget&&qe.relatedTarget!==document.documentElement||He(qe)},ze=qe=>{Fe&&(qe.stopPropagation(),qe.preventDefault())},We=qe=>{Fe&&qe.preventDefault()};document.addEventListener("pointermove",Ue),document.addEventListener("pointerup",He),document.addEventListener("pointerout",Ve),document.addEventListener("pointercancel",Ve),document.addEventListener("touchmove",We,{passive:!1}),document.addEventListener("click",ze,{capture:!0}),ke=()=>{document.removeEventListener("pointermove",Ue),document.removeEventListener("pointerup",He),document.removeEventListener("pointerout",Ve),document.removeEventListener("pointercancel",Ve),document.removeEventListener("touchmove",We),setTimeout(()=>{document.removeEventListener("click",ze,{capture:!0})},10)}};return _e.addEventListener("pointerdown",Oe),()=>{ke(),_e.removeEventListener("pointerdown",Oe)}}(this.wrapper,(_e,Ae,Se)=>{this.emit("drag",Math.max(0,Math.min(1,Se/this.wrapper.getBoundingClientRect().width)))},_e=>{this.isDragging=!0,this.emit("dragstart",Math.max(0,Math.min(1,_e/this.wrapper.getBoundingClientRect().width)))},_e=>{this.isDragging=!1,this.emit("dragend",Math.max(0,Math.min(1,_e/this.wrapper.getBoundingClientRect().width)))}))}getHeight(_e,Ae){var Se;const Ee=((Se=this.audioData)===null||Se===void 0?void 0:Se.numberOfChannels)||1;if(_e==null)return 128;if(!isNaN(Number(_e)))return Number(_e);if(_e==="auto"){const xe=this.parent.clientHeight||128;return Ae!=null&&Ae.every(Te=>!Te.overlay)?xe/Ee:xe}return 128}initHtml(){const _e=document.createElement("div"),Ae=_e.attachShadow({mode:"open"}),Se=this.options.cspNonce&&typeof this.options.cspNonce=="string"?this.options.cspNonce.replace(/"/g,""):"";return Ae.innerHTML=`
2059
2059
  <style${Se?` nonce="${Se}"`:""}>
2060
2060
  :host {
2061
2061
  user-select: none;
@@ -1,4 +1,4 @@
1
- import { conf as t, language as e } from "./typescript-0LrIsIFJ.js";
1
+ import { conf as t, language as e } from "./typescript-5XGgn-Fi.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
@@ -1,4 +1,4 @@
1
- import { m as Et } from "./index-rqdxmOcP.js";
1
+ import { m as Et } from "./index-xUlEBTtp.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
@@ -1,4 +1,4 @@
1
- import { m as l } from "./index-rqdxmOcP.js";
1
+ import { m as l } from "./index-xUlEBTtp.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
@@ -1,4 +1,4 @@
1
- import { m as s } from "./index-rqdxmOcP.js";
1
+ import { m as s } from "./index-xUlEBTtp.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
@@ -1,4 +1,4 @@
1
- import { m as o } from "./index-rqdxmOcP.js";
1
+ import { m as o } from "./index-xUlEBTtp.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
@@ -1,4 +1,4 @@
1
- import { m } from "./index-rqdxmOcP.js";
1
+ import { m } from "./index-xUlEBTtp.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
@@ -1,4 +1,4 @@
1
- import { t as O, m as I } from "./index-rqdxmOcP.js";
1
+ import { t as O, m as I } from "./index-xUlEBTtp.js";
2
2
  /*!-----------------------------------------------------------------------------
3
3
  * Copyright (c) Microsoft Corporation. All rights reserved.
4
4
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)