obi-sdk 0.12.4 → 0.12.5

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 { O as ObiWidget, s as setGlobalContext, t as trackEvent, c as captureException, w as withSentryAsyncHandler, a as withSentryHandler } from "./chunks/obi-widget-870d3568.js";
1
+ import { O as ObiWidget, s as setGlobalContext, t as trackEvent, c as captureException, w as withSentryAsyncHandler, a as withSentryHandler } from "./chunks/obi-widget-d4244993.js";
2
2
  import "./chunks/types-f38a47f6.js";
3
3
  class ConfigLogger {
4
4
  constructor() {
@@ -1,6 +1,6 @@
1
1
  import { S as SDKState } from "./chunks/types-f38a47f6.js";
2
- import { i, n, b as i$1, x } from "./chunks/obi-widget-870d3568.js";
3
- import { A, C, e, f, D, N, d, O, S } from "./chunks/obi-widget-870d3568.js";
2
+ import { i, n, b as i$1, x } from "./chunks/obi-widget-d4244993.js";
3
+ import { A, C, e, f, D, N, d, O, S } from "./chunks/obi-widget-d4244993.js";
4
4
  var __defProp = Object.defineProperty;
5
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
6
  var __decorateClass = (decorators, target, key, kind) => {
@@ -85,14 +85,14 @@ if (!customElements.get("obi-status-widget")) {
85
85
  const statusWidget = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({ __proto__: null, ObiStatusWidget }, Symbol.toStringTag, { value: "Module" }));
86
86
  function defineCustomElements() {
87
87
  Promise.resolve().then(() => statusWidget);
88
- import("./chunks/index-07f9b60c.js");
89
- import("./chunks/obi-widget-870d3568.js").then((n2) => n2.l);
90
- import("./chunks/obi-widget-870d3568.js").then((n2) => n2.m);
91
- import("./chunks/obi-widget-870d3568.js").then((n2) => n2.g);
92
- import("./chunks/obi-widget-870d3568.js").then((n2) => n2.h);
93
- import("./chunks/obi-widget-870d3568.js").then((n2) => n2.o);
94
- import("./chunks/obi-widget-870d3568.js").then((n2) => n2.j);
95
- import("./chunks/obi-widget-870d3568.js").then((n2) => n2.k);
88
+ import("./chunks/index-4cdc2bce.js");
89
+ import("./chunks/obi-widget-d4244993.js").then((n2) => n2.l);
90
+ import("./chunks/obi-widget-d4244993.js").then((n2) => n2.m);
91
+ import("./chunks/obi-widget-d4244993.js").then((n2) => n2.g);
92
+ import("./chunks/obi-widget-d4244993.js").then((n2) => n2.h);
93
+ import("./chunks/obi-widget-d4244993.js").then((n2) => n2.o);
94
+ import("./chunks/obi-widget-d4244993.js").then((n2) => n2.j);
95
+ import("./chunks/obi-widget-d4244993.js").then((n2) => n2.k);
96
96
  }
97
97
  export {
98
98
  A as AudioEqualizer,
@@ -388,7 +388,7 @@
388
388
  .error {
389
389
  color: #ef4444;
390
390
  }
391
- `,GC([np({type:Array})],VC.prototype,"courses",2),GC([np({type:String})],VC.prototype,"selectedCourseId",2),GC([np({type:Boolean})],VC.prototype,"loading",2),GC([np({type:String})],VC.prototype,"error",2),GC([np({type:String})],VC.prototype,"searchTerm",2),customElements.get("obi-course")||customElements.define("obi-course",PC),customElements.get("obi-course-list")||customElements.define("obi-course-list",VC);var JC=Object.defineProperty,XC=Object.getOwnPropertyDescriptor,$C=(A,t,e,i)=>{for(var n,s=i>1?void 0:i?XC(t,e):t,r=A.length-1;r>=0;r--)(n=A[r])&&(s=(i?n(t,e,s):n(s))||s);return i&&s&&JC(t,e,s),s};class YC extends Ap{constructor(){super(...arguments),this.courses=[],this.loading=!0,this.error="",this.apiKey="",this.apiBaseUrl="",this.selectedCourse=null,this.agentName=""}handleClose(){this.onClose&&this.onClose()}handleGetStarted(){this.selectedCourse&&this.dispatchEvent(new CustomEvent("course-select",{detail:this.selectedCourse,bubbles:!0,composed:!0}))}async fetchCourses(){try{this.loading=!0,console.log("[CourseModal] Fetching sessions from API",{apiKey:this.apiKey?"present":"missing"});const A=await fetch(`${this.apiBaseUrl}/sessions?token=${this.apiKey}`,{cache:"no-cache"});if(!A.ok)throw new Error(`HTTP ${A.status}: ${A.statusText}`);const t=await A.json();let e="";const i=t.sessions?.map((A=>(e||(e=A.onboarding_plan.product.agent_name),{id:A.uuid,name:A.onboarding_plan.name,description:A.onboarding_plan.description,duration:A.onboarding_plan.duration,order:A.onboarding_plan.order}))),n=i.filter((A=>!!A.name));this.agentName=e||"Obi",this.courses=[...n],this.error="",console.log("[CourseModal] Sessions fetched successfully",{sessionCount:n.length,sessions:n.map((A=>({id:A.id,name:A.name})))}),this.requestUpdate()}catch(A){console.error("[CourseModal] Fetch error:",A),this.error=`Failed to fetch courses: ${A instanceof Error?A.message:"Unknown error"}`}finally{this.loading=!1,this.requestUpdate()}}handleCourseCardClick(A){const{id:t,name:e,description:i,duration:n}=A.detail;this.selectedCourse={id:t,name:e,description:i,duration:n}}connectedCallback(){super.connectedCallback(),window.obiWidgetConfig?.apiKey&&(this.apiKey=window.obiWidgetConfig.apiKey),this.apiBaseUrl=t,this.apiBaseUrl&&this.apiKey?this.fetchCourses():(this.loading=!1,this.error="API base URL or API key is missing")}render(){return Mg`
391
+ `,GC([np({type:Array})],VC.prototype,"courses",2),GC([np({type:String})],VC.prototype,"selectedCourseId",2),GC([np({type:Boolean})],VC.prototype,"loading",2),GC([np({type:String})],VC.prototype,"error",2),GC([np({type:String})],VC.prototype,"searchTerm",2),customElements.get("obi-course")||customElements.define("obi-course",PC),customElements.get("obi-course-list")||customElements.define("obi-course-list",VC);var JC=Object.defineProperty,XC=Object.getOwnPropertyDescriptor,$C=(A,t,e,i)=>{for(var n,s=i>1?void 0:i?XC(t,e):t,r=A.length-1;r>=0;r--)(n=A[r])&&(s=(i?n(t,e,s):n(s))||s);return i&&s&&JC(t,e,s),s};class YC extends Ap{constructor(){super(...arguments),this.courses=[],this.loading=!0,this.error="",this.apiKey="",this.apiBaseUrl="",this.selectedCourse=null,this.agentName=""}handleClose(){this.onClose&&this.onClose()}handleGetStarted(){this.selectedCourse&&this.dispatchEvent(new CustomEvent("course-select",{detail:this.selectedCourse,bubbles:!0,composed:!0}))}async fetchCourses(){try{this.loading=!0,console.log("[CourseModal] Fetching sessions from API",{apiKey:this.apiKey?"present":"missing"});const A=await fetch(`${this.apiBaseUrl}/api/sessions?token=${this.apiKey}`,{cache:"no-cache"});if(!A.ok)throw new Error(`HTTP ${A.status}: ${A.statusText}`);const t=await A.json();let e="";const i=t.sessions?.map((A=>(e||(e=A.onboarding_plan.product.agent_name),{id:A.uuid,name:A.onboarding_plan.name,description:A.onboarding_plan.description,duration:A.onboarding_plan.duration,order:A.onboarding_plan.order}))),n=i.filter((A=>!!A.name));this.agentName=e||"Obi",this.courses=[...n],this.error="",console.log("[CourseModal] Sessions fetched successfully",{sessionCount:n.length,sessions:n.map((A=>({id:A.id,name:A.name})))}),this.requestUpdate()}catch(A){console.error("[CourseModal] Fetch error:",A),this.error=`Failed to fetch courses: ${A instanceof Error?A.message:"Unknown error"}`}finally{this.loading=!1,this.requestUpdate()}}handleCourseCardClick(A){const{id:t,name:e,description:i,duration:n}=A.detail;this.selectedCourse={id:t,name:e,description:i,duration:n}}connectedCallback(){super.connectedCallback(),window.obiWidgetConfig?.apiKey&&(this.apiKey=window.obiWidgetConfig.apiKey),this.apiBaseUrl=t,this.apiBaseUrl&&this.apiKey?this.fetchCourses():(this.loading=!1,this.error="API base URL or API key is missing")}render(){return Mg`
392
392
  <div class="backdrop"></div>
393
393
  <div class="container">
394
394
  <div class="header">