@boomi/embedkit-cdn 1.1.12 → 1.1.13

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.
package/embedkit-cdn.js CHANGED
@@ -37666,22 +37666,33 @@ const mM = (t) => {
37666
37666
  const e = Et.parse(t);
37667
37667
  return QD.sanitize(e, { USE_PROFILES: { html: !0 }, ADD_ATTR: ["target", "rel"] });
37668
37668
  }, gM = ({ m: t, getMsgText: e, isBoomiDirect: o = !1 }) => {
37669
- var E, h;
37670
- const r = (t == null ? void 0 : t.role) === "user", w = ((E = t == null ? void 0 : t.content) == null ? void 0 : E.data) ?? (t == null ? void 0 : t.content);
37671
- let m = w;
37672
- if (typeof w == "string") {
37673
- const p = w.trim();
37669
+ var h;
37670
+ const r = (t == null ? void 0 : t.role) === "user", w = (() => {
37671
+ const p = t == null ? void 0 : t.content;
37672
+ if (typeof p == "string") {
37673
+ const a = p.trim();
37674
+ if (a.startsWith("{") || a.startsWith("["))
37675
+ try {
37676
+ return JSON.parse(a);
37677
+ } catch {
37678
+ }
37679
+ }
37680
+ return p;
37681
+ })(), m = (w == null ? void 0 : w.data) ?? w;
37682
+ let g = m;
37683
+ if (typeof m == "string") {
37684
+ const p = m.trim();
37674
37685
  if (p.startsWith("{") || p.startsWith("["))
37675
37686
  try {
37676
- m = JSON.parse(p);
37687
+ g = JSON.parse(p);
37677
37688
  } catch {
37678
- m = w;
37689
+ g = m;
37679
37690
  }
37680
37691
  }
37681
37692
  if (r)
37682
37693
  return /* @__PURE__ */ G.jsx("div", { className: "w-full flex justify-end px-2", children: /* @__PURE__ */ G.jsx("div", { className: "w-full flex justify-end", children: /* @__PURE__ */ G.jsx("div", { className: "boomi-agent-bubble from-user", children: /* @__PURE__ */ G.jsx("div", { className: "boomi-agent-bubble-text", children: e(t) }) }) }) });
37683
- if (o && ((h = t == null ? void 0 : t.metadata) == null ? void 0 : h.event) === "application_auth_required" && m && typeof m == "object") {
37684
- const p = m, a = typeof p.authorization_url == "string" ? p.authorization_url : "", c = typeof p.application_name == "string" ? p.application_name : "application", d = typeof p.sign_in_message == "string" ? p.sign_in_message : "Authorization required";
37694
+ if (o && ((h = t == null ? void 0 : t.metadata) == null ? void 0 : h.event) === "application_auth_required" && g && typeof g == "object") {
37695
+ const p = g, a = typeof p.authorization_url == "string" ? p.authorization_url : "", c = typeof p.application_name == "string" ? p.application_name : "application", d = typeof p.sign_in_message == "string" ? p.sign_in_message : "Authorization required";
37685
37696
  return /* @__PURE__ */ G.jsx("div", { className: "w-full", children: /* @__PURE__ */ G.jsx("div", { className: "w-full max-w-[1024px] px-4 md:px-6", children: /* @__PURE__ */ G.jsxs("div", { className: "rounded-xl border border-[var(--boomi-card-border)] bg-[var(--boomi-card-bg)] shadow-[var(--boomi-card-shadow)] p-4 md:p-5", children: [
37686
37697
  /* @__PURE__ */ G.jsx("div", { className: "text-sm uppercase tracking-wide text-[var(--boomi-muted)]", children: "Authorization required" }),
37687
37698
  /* @__PURE__ */ G.jsx("div", { className: "mt-1 text-base font-semibold text-[var(--boomi-page-fg-color)]", children: c }),
@@ -37702,7 +37713,7 @@ const mM = (t) => {
37702
37713
  ] }) }) });
37703
37714
  }
37704
37715
  if ((t == null ? void 0 : t.type) === "error") {
37705
- const p = m && typeof m == "object" ? m : {}, a = typeof p.title == "string" && p.title.trim() ? p.title : "Agent error", c = typeof p.message == "string" && p.message || typeof p.data == "string" && p.data || void 0, d = p.raw ?? p, u = {
37716
+ const p = g && typeof g == "object" ? g : {}, a = typeof p.title == "string" && p.title.trim() ? p.title : "Agent error", c = typeof p.message == "string" && p.message || typeof p.data == "string" && p.data || void 0, d = p.raw ?? p, u = {
37706
37717
  ...p,
37707
37718
  title: a,
37708
37719
  message: c,
@@ -37719,10 +37730,10 @@ const mM = (t) => {
37719
37730
  }
37720
37731
  ) });
37721
37732
  }
37722
- if (m && typeof m == "object") {
37723
- const p = m, a = p.success === !1 && typeof p.error == "string" && p.error.trim() || p.success === !1 && typeof p.message == "string" && p.message.trim() || "";
37733
+ if (g && typeof g == "object") {
37734
+ const p = g, a = p.success === !1 && typeof p.error == "string" && p.error.trim() || p.success === !1 && typeof p.message == "string" && p.message.trim() || "";
37724
37735
  if (a) {
37725
- const c = { title: "Agent error", message: a, raw: m };
37736
+ const c = { title: "Agent error", message: a, raw: g };
37726
37737
  return /* @__PURE__ */ G.jsx("div", { className: "w-full", children: /* @__PURE__ */ G.jsx(
37727
37738
  bp,
37728
37739
  {
@@ -37736,26 +37747,26 @@ const mM = (t) => {
37736
37747
  }
37737
37748
  }
37738
37749
  if ((t == null ? void 0 : t.type) === "text") {
37739
- if (m && typeof m == "object" && typeof m.html == "string")
37750
+ if (g && typeof g == "object" && typeof g.html == "string")
37740
37751
  return /* @__PURE__ */ G.jsx("div", { className: "w-full", children: /* @__PURE__ */ G.jsx("div", { className: "w-full max-w-[1024px] px-4 md:px-6 leading-7 text-[var(--boomi-page-fg-color)]", children: /* @__PURE__ */ G.jsx(
37741
37752
  Pf,
37742
37753
  {
37743
- title: m.title,
37744
- value: m.html,
37754
+ title: g.title,
37755
+ value: g.html,
37745
37756
  treatStringAsHTML: !0
37746
37757
  }
37747
37758
  ) }) });
37748
- const p = typeof m == "string" ? m : m != null ? String(m) : "";
37759
+ const p = typeof g == "string" ? g : g != null ? String(g) : "";
37749
37760
  return /* @__PURE__ */ G.jsx("div", { className: "w-full", children: /* @__PURE__ */ G.jsx("div", { className: "w-full max-w-[1024px] px-4 md:px-6 leading-7 text-[var(--boomi-page-fg-color)]", children: /* @__PURE__ */ G.jsx(Pf, { value: mM(p), treatStringAsHTML: !0 }) }) });
37750
37761
  }
37751
- return m && typeof m == "object" && typeof m.html == "string" ? /* @__PURE__ */ G.jsx("div", { className: "w-full", children: /* @__PURE__ */ G.jsx("div", { className: "w-full max-w-[1024px] px-4 md:px-6 leading-7 text-[var(--boomi-page-fg-color)]", children: /* @__PURE__ */ G.jsx(
37762
+ return g && typeof g == "object" && typeof g.html == "string" ? /* @__PURE__ */ G.jsx("div", { className: "w-full", children: /* @__PURE__ */ G.jsx("div", { className: "w-full max-w-[1024px] px-4 md:px-6 leading-7 text-[var(--boomi-page-fg-color)]", children: /* @__PURE__ */ G.jsx(
37752
37763
  Pf,
37753
37764
  {
37754
- title: m.title,
37755
- value: m.html,
37765
+ title: g.title,
37766
+ value: g.html,
37756
37767
  treatStringAsHTML: !0
37757
37768
  }
37758
- ) }) }) : /* @__PURE__ */ G.jsx("div", { className: "w-full", children: /* @__PURE__ */ G.jsx("div", { className: "w-full max-w-[1024px] px-4 md:px-6 leading-7 text-[var(--boomi-page-fg-color)]", children: /* @__PURE__ */ G.jsx(hM, { value: m ?? (t == null ? void 0 : t.content), language: "json", title: "Data" }) }) });
37769
+ ) }) }) : /* @__PURE__ */ G.jsx("div", { className: "w-full", children: /* @__PURE__ */ G.jsx("div", { className: "w-full max-w-[1024px] px-4 md:px-6 leading-7 text-[var(--boomi-page-fg-color)]", children: /* @__PURE__ */ G.jsx(hM, { value: g ?? (t == null ? void 0 : t.content), language: "json", title: "Data" }) }) });
37759
37770
  };
37760
37771
  /**
37761
37772
  * @file message.ts
@@ -1808,7 +1808,7 @@ guard ^\\s*
1808
1808
  var \${1/.*\\/(.)/\\u$1/} = require("\${1}").\${1/.*\\/(.)/\\u$1/};
1809
1809
  $0
1810
1810
  `}),ace.define("ace/snippets/javascript",["require","exports","module","ace/snippets/javascript.snippets"],function(o,r,w){r.snippetText=o("./javascript.snippets"),r.scope="javascript"}),(function(){ace.require(["ace/snippets/javascript"],function(o){t&&(t.exports=o)})})()})(Mh)),Mh.exports}fI();var pI=Ps();const xT=Es(pI);xT.config.set("basePath","https://cdn.jsdelivr.net/npm/ace-builds@1.4.3/src-noconflict/"),xT.config.setModuleUrl("ace/mode/javascript_worker","https://cdn.jsdelivr.net/npm/ace-builds@1.4.3/src-noconflict/worker-javascript.js");function mI(t,e){if(typeof t=="string"){if((e??"").toLowerCase().includes("json"))try{return JSON.stringify(JSON.parse(t),null,2)}catch{}return t}try{return JSON.stringify(t,null,2)}catch{return String(t??"")}}function LT(t,e){const o=(t??"").toLowerCase(),r={javascript:"javascript",typescript:"typescript",json:"json",json5:"json",xml:"xml",yaml:"yaml",yml:"yaml",html:"html",css:"css",scss:"scss",less:"less",jsx:"jsx",tsx:"tsx",markdown:"markdown",md:"markdown",sql:"sql",mysql:"mysql",postgresql:"pgsql",pgsql:"pgsql","pl/sql":"sql",powershell:"powershell",shell:"sh",sh:"sh",python:"python",java:"java","c#":"csharp",csharp:"csharp","c++":"c_cpp",cpp:"c_cpp",go:"golang",ruby:"ruby",php:"php",rust:"rust",scala:"scala",clojure:"clojure",ocaml:"ocaml",lua:"lua",toml:"toml",ini:"ini",proto:"protobuf","protocol buffers":"protobuf",latex:"latex",tex:"latex",svg:"svg",hcl:"hcl",makefile:"makefile"};return r[o]?r[o]:o.includes("json")?"json":o.includes("sql")?"sql":o.includes("yaml")?"yaml":o.includes("xml")?"xml":o.includes("md")||o.includes("markdown")?"markdown":e??"text"}async function gI(t){try{await import(`ace-builds/src-min-noconflict/mode-${t}.js`)}catch{}try{await import(`ace-builds/src-min-noconflict/worker-${t}.js`)}catch{}}const bI=({value:t,language:e,title:o="Data",collapsed:r=!1,minHeight:w=200,maxHeight:m=640})=>{var A;const{boomiConfig:g}=fn(),[E,h]=Q.useState(!r),p=Q.useMemo(()=>mI(t,e),[t,e]),a=Q.useMemo(()=>Math.max(3,p.split(`
1811
- `).length),[p]),c=Math.max(w,Math.min(m,a*18+48)),d=(A=g==null?void 0:g.theme)!=null&&A.darkModeTheme?"tomorrow_night_bright":"chrome",u=typeof t=="object"&&t!==null?"json":LT(e),s=LT(e,u);Q.useEffect(()=>{gI(s)},[s]);const f=Q.useRef(null),b=async()=>{await navigator.clipboard.writeText(p)},y=()=>{const R=new Blob([p],{type:"text/plain;charset=utf-8"}),N=URL.createObjectURL(R);f.current&&(f.current.href=N,f.current.download=`${(e??s).toLowerCase()||"data"}.txt`,f.current.click(),setTimeout(()=>URL.revokeObjectURL(N),1500))};return G.jsxs("div",{className:"rounded-lg border border-[var(--boomi-card-border)] bg-[var(--boomi-card-bg)]",children:[G.jsxs("div",{className:"flex items-center justify-between px-2 py-1 border-b border-[var(--boomi-card-border)]",children:[G.jsx("span",{className:"text-xs opacity-80",children:o}),G.jsxs("div",{className:"flex items-center gap-2",children:[G.jsx("button",{className:"text-xs opacity-75 hover:opacity-100",onClick:b,children:"Copy"}),G.jsx("button",{className:"text-xs opacity-75 hover:opacity-100",onClick:y,children:"Download"}),G.jsx("a",{ref:f,className:"hidden"}),G.jsx("button",{className:"text-xs opacity-75 hover:opacity-100",onClick:()=>h(R=>!R),children:E?"Collapse":"Expand"})]})]}),E&&G.jsx("div",{className:"relative",style:{height:c},children:G.jsx(sI,{mode:s,theme:d,width:"100%",height:"100%",value:p,showPrintMargin:!0,showGutter:!0,highlightActiveLine:!1,setOptions:{tabSize:2,useWorker:!0,showLineNumbers:!0,wrap:!0},editorProps:{$blockScrolling:!0}})})]})};function CT(t){if(typeof t=="string")return{message:t};if(!t||typeof t!="object")return{message:String(t)};const e={},o=t;new Set([...Object.keys(o),"name","message","code","status","requestId","stack","cause"]).forEach(m=>{try{const g=o[m];e[m]=g}catch{e[m]="[unavailable]"}});const w=m=>{!m||typeof m!="object"||Array.isArray(m)||Object.keys(m).forEach(g=>{e[g]===void 0&&(e[g]=m[g])})};return e.data&&w(e.data),e.response&&typeof e.response=="object"&&e.response.data&&w(e.response.data),e.cause&&typeof e.cause=="object"&&(e.cause.data&&w(e.cause.data),e.cause.response&&e.cause.response.data&&w(e.cause.response.data)),e}function NT(t,e=2){const o=new WeakSet;return JSON.stringify(t,(r,w)=>{if(typeof w=="object"&&w!==null){if(o.has(w))return"[Circular]";o.add(w)}return w instanceof Error?{name:w.name,message:w.message,stack:w.stack,...CT(w)}:w},e)}function $h(t){try{navigator.clipboard.writeText(t)}catch{}}const RT=({variant:t="error",children:e,title:o})=>{const r=t==="error"?"boomi-chip boomi-chip--error":t==="warning"?"boomi-chip boomi-chip--warning":t==="success"?"boomi-chip boomi-chip--success":"boomi-chip";return G.jsx("span",{className:r,title:o,children:e})},Uh=({error:t,title:e,defaultOpen:o=!0,actions:r,showRawToggle:w=!0,showStackToggle:m=!0,compact:g=!1,ariaLabel:E})=>{const[h,p]=Q.useState(o),[a,c]=Q.useState(!1),[d,u]=Q.useState(!1),s=Q.useMemo(()=>CT(t),[t]),f=typeof s.reason=="string"&&s.reason.trim()||typeof s.errorDescription=="string"&&s.errorDescription.trim()||void 0,b=typeof s.message=="string"&&s.message.trim()||f||typeof s.error=="string"&&s.error.trim()||typeof s.title=="string"&&s.title.trim()||"An unexpected error occurred.",y=(s==null?void 0:s.code)??(s==null?void 0:s.status),A=(s==null?void 0:s.requestId)??(s==null?void 0:s.traceId)??(s==null?void 0:s.correlationId);s!=null&&s.name||s!=null&&s.title;const R=typeof(s==null?void 0:s.stack)=="string"?s.stack:void 0,N=Array.isArray(s==null?void 0:s.issues)?s.issues:[],S=N.length>0,T=e||(s==null?void 0:s.title)||"Something went wrong",k=g?"py-2 px-2":"py-2.5 px-3",M=g?"p-2":"p-3";return G.jsxs("section",{className:"boomi-card rounded-lg","aria-label":E??"Error block",role:"alert",children:[G.jsxs("div",{className:`flex items-center justify-between border-b border-[var(--boomi-card-border)] ${k}`,style:{background:"var(--boomi-notice-bg)",color:"var(--boomi-notice-fg)"},children:[G.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[G.jsx(dd,{className:"boomi-notice__icon","aria-hidden":!0}),G.jsx("div",{className:"flex flex-col gap-0.5 min-w-0",children:G.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[G.jsx("h3",{className:"boomi-update-title m-0 truncate",children:T}),y!=null&&G.jsx(RT,{variant:"error",title:"Error code / status",children:String(y)}),A&&G.jsx(RT,{variant:"warning",title:"Request ID",children:String(A)})]})})]}),G.jsxs("div",{className:"flex items-center gap-2",children:[G.jsxs("button",{type:"button",className:"boomi-btn-secondary px-2 py-1 rounded inline-flex items-center gap-1",onClick:()=>$h(b),"aria-label":"Copy error message",title:"Copy error message",children:[G.jsx(Qx,{}),G.jsx("span",{className:"text-xs font-semibold",children:"Copy"})]}),w&&G.jsx("button",{type:"button",className:"boomi-btn-secondary px-2 py-1 rounded text-xs font-semibold",onClick:()=>c(I=>!I),"aria-pressed":a,"aria-label":"Toggle raw payload",title:"Toggle raw payload",children:"Raw"}),m&&R&&G.jsx("button",{type:"button",className:"boomi-btn-secondary px-2 py-1 rounded text-xs font-semibold",onClick:()=>u(I=>!I),"aria-pressed":d,"aria-label":"Toggle stack trace",title:"Toggle stack trace",children:"Stack"}),r,G.jsxs("button",{type:"button",className:"boomi-btn-secondary px-2 py-1 rounded inline-flex items-center gap-1",onClick:()=>p(I=>!I),"aria-expanded":h,"aria-controls":"error-block-body",title:h?"Collapse":"Expand",children:[h?G.jsx(nL,{}):G.jsx(Xx,{}),G.jsx("span",{className:"text-xs font-semibold",children:h?"Hide":"Show"})]})]})]}),h&&G.jsxs("div",{id:"error-block-body",className:`boomi-update-content ${M}`,children:[G.jsx("div",{className:"boomi-notice boomi-connector-inner mb-3",style:{background:"var(--boomi-update-content-bg)"},children:G.jsx("div",{className:"boomi-notice__text break-words",children:b})}),G.jsxs("div",{className:"grid gap-2 sm:grid-cols-2 mb-2",children:[y!=null&&G.jsxs("div",{className:"boomi-kv-row",children:[G.jsx("div",{className:"boomi-kv-key",children:"Status / Code"}),G.jsx("div",{className:"boomi-kv-val",children:String(y)})]}),A&&G.jsxs("div",{className:"boomi-kv-row",children:[G.jsx("div",{className:"boomi-kv-key",children:"Request ID"}),G.jsx("div",{className:"boomi-kv-val break-words",children:String(A)})]}),f&&f!==b&&G.jsxs("div",{className:"boomi-kv-row sm:col-span-2",children:[G.jsx("div",{className:"boomi-kv-key",children:"Reason"}),G.jsx("div",{className:"boomi-kv-val break-words",children:f})]})]}),S&&G.jsxs("div",{className:"mt-2",children:[G.jsx("div",{className:"boomi-connector-inner mb-1",children:G.jsx("div",{className:"boomi-connector-heading",children:"Details"})}),G.jsx("ul",{className:"list-disc pl-5 text-[13px] space-y-1",children:N.map((I,$)=>{const B=(I==null?void 0:I.message)||(I==null?void 0:I.detail)||(I==null?void 0:I.error)||JSON.stringify(I),D=Array.isArray(I==null?void 0:I.path)&&I.path.length?` (${I.path.join(".")})`:"";return G.jsxs("li",{className:"break-words",children:[B,D]},$)})})]}),d&&R&&G.jsxs("div",{className:"mt-3",children:[G.jsx("div",{className:"boomi-connector-inner mb-1",children:G.jsx("div",{className:"boomi-connector-heading",children:"Stack Trace"})}),G.jsx("pre",{className:"m-0 p-2 text-[13px] leading-6 whitespace-pre-wrap break-words border rounded",style:{borderColor:"var(--boomi-card-border)",background:"var(--boomi-update-content-bg)"},children:R}),G.jsx("div",{className:"flex justify-end mt-1",children:G.jsx("button",{type:"button",className:"boomi-btn-secondary px-2 py-1 rounded text-xs font-semibold",onClick:()=>$h(R),"aria-label":"Copy stack trace",children:"Copy Stack"})})]}),a&&G.jsxs("div",{className:"mt-3",children:[G.jsx("div",{className:"boomi-connector-inner mb-1",children:G.jsx("div",{className:"boomi-connector-heading",children:"Raw Payload"})}),G.jsx("pre",{className:"m-0 p-2 text-[13px] leading-6 whitespace-pre overflow-auto boomi-scroll border rounded",style:{borderColor:"var(--boomi-card-border)",background:"var(--boomi-update-content-bg)",maxHeight:260},children:NT(s,2)}),G.jsx("div",{className:"flex justify-end mt-1",children:G.jsx("button",{type:"button",className:"boomi-btn-secondary px-2 py-1 rounded text-xs font-semibold",onClick:()=>$h(NT(s,2)),"aria-label":"Copy raw payload",children:"Copy Raw"})})]})]})]})};function vI(t,e=2){const o=new WeakSet;return JSON.stringify(t,(r,w)=>{if(typeof w=="object"&&w!==null){if(o.has(w))return"[Circular]";o.add(w)}return w},e)}function EI(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}const Hh=({value:t,title:e,treatStringAsHTML:o=!1})=>{const{display:r}=Q.useMemo(()=>typeof t=="string"?{display:t}:{display:vI(t,2)},[t]);return G.jsxs("div",{className:"w-full",children:[e?G.jsx("div",{className:"text-xl font-semibold mb-2",children:e}):null,typeof t=="string"&&o?G.jsx("div",{className:"agent-prose",style:{color:"var(--boomi-page-fg-color)",background:"transparent"},dangerouslySetInnerHTML:{__html:r}}):typeof t=="string"?G.jsx("div",{className:"agent-prose whitespace-pre-wrap",style:{color:"var(--boomi-page-fg-color)"},dangerouslySetInnerHTML:{__html:EI(r)}}):G.jsx("pre",{className:"m-0 text-sm whitespace-pre-wrap break-words",children:r})]})};Et.setOptions({breaks:!0,gfm:!0});const wI=t=>{const e=Et.parse(t);return qO.sanitize(e,{USE_PROFILES:{html:!0},ADD_ATTR:["target","rel"]})},yI=({m:t,getMsgText:e,isBoomiDirect:o=!1})=>{var E,h;const r=(t==null?void 0:t.role)==="user",w=((E=t==null?void 0:t.content)==null?void 0:E.data)??(t==null?void 0:t.content);let m=w;if(typeof w=="string"){const p=w.trim();if(p.startsWith("{")||p.startsWith("["))try{m=JSON.parse(p)}catch{m=w}}if(r)return G.jsx("div",{className:"w-full flex justify-end px-2",children:G.jsx("div",{className:"w-full flex justify-end",children:G.jsx("div",{className:"boomi-agent-bubble from-user",children:G.jsx("div",{className:"boomi-agent-bubble-text",children:e(t)})})})});if(o&&((h=t==null?void 0:t.metadata)==null?void 0:h.event)==="application_auth_required"&&m&&typeof m=="object"){const p=m,a=typeof p.authorization_url=="string"?p.authorization_url:"",c=typeof p.application_name=="string"?p.application_name:"application",d=typeof p.sign_in_message=="string"?p.sign_in_message:"Authorization required";return G.jsx("div",{className:"w-full",children:G.jsx("div",{className:"w-full max-w-[1024px] px-4 md:px-6",children:G.jsxs("div",{className:"rounded-xl border border-[var(--boomi-card-border)] bg-[var(--boomi-card-bg)] shadow-[var(--boomi-card-shadow)] p-4 md:p-5",children:[G.jsx("div",{className:"text-sm uppercase tracking-wide text-[var(--boomi-muted)]",children:"Authorization required"}),G.jsx("div",{className:"mt-1 text-base font-semibold text-[var(--boomi-page-fg-color)]",children:c}),G.jsx("div",{className:"mt-2 text-sm text-[var(--boomi-page-fg-color)]",children:d}),a?G.jsx("div",{className:"mt-4",children:G.jsxs("a",{href:a,target:"_blank",rel:"noreferrer",className:"inline-flex items-center justify-center rounded-lg boomi-btn-primary px-4 py-2 text-sm font-semibold",children:["Authorize ",c]})}):null]})})})}if((t==null?void 0:t.type)==="error"){const p=m&&typeof m=="object"?m:{},a=typeof p.title=="string"&&p.title.trim()?p.title:"Agent error",c=typeof p.message=="string"&&p.message||typeof p.data=="string"&&p.data||void 0,d=p.raw??p,u={...p,title:a,message:c,raw:d??p};return G.jsx("div",{className:"w-full",children:G.jsx(Uh,{error:u,title:a,defaultOpen:!0,showStackToggle:!0,showRawToggle:!0})})}if(m&&typeof m=="object"){const p=m,a=p.success===!1&&typeof p.error=="string"&&p.error.trim()||p.success===!1&&typeof p.message=="string"&&p.message.trim()||"";if(a){const c={title:"Agent error",message:a,raw:m};return G.jsx("div",{className:"w-full",children:G.jsx(Uh,{error:c,title:"Agent error",defaultOpen:!0,showStackToggle:!1,showRawToggle:!1})})}}if((t==null?void 0:t.type)==="text"){if(m&&typeof m=="object"&&typeof m.html=="string")return G.jsx("div",{className:"w-full",children:G.jsx("div",{className:"w-full max-w-[1024px] px-4 md:px-6 leading-7 text-[var(--boomi-page-fg-color)]",children:G.jsx(Hh,{title:m.title,value:m.html,treatStringAsHTML:!0})})});const p=typeof m=="string"?m:m!=null?String(m):"";return G.jsx("div",{className:"w-full",children:G.jsx("div",{className:"w-full max-w-[1024px] px-4 md:px-6 leading-7 text-[var(--boomi-page-fg-color)]",children:G.jsx(Hh,{value:wI(p),treatStringAsHTML:!0})})})}return m&&typeof m=="object"&&typeof m.html=="string"?G.jsx("div",{className:"w-full",children:G.jsx("div",{className:"w-full max-w-[1024px] px-4 md:px-6 leading-7 text-[var(--boomi-page-fg-color)]",children:G.jsx(Hh,{title:m.title,value:m.html,treatStringAsHTML:!0})})}):G.jsx("div",{className:"w-full",children:G.jsx("div",{className:"w-full max-w-[1024px] px-4 md:px-6 leading-7 text-[var(--boomi-page-fg-color)]",children:G.jsx(bI,{value:m??(t==null?void 0:t.content),language:"json",title:"Data"})})})};/**
1811
+ `).length),[p]),c=Math.max(w,Math.min(m,a*18+48)),d=(A=g==null?void 0:g.theme)!=null&&A.darkModeTheme?"tomorrow_night_bright":"chrome",u=typeof t=="object"&&t!==null?"json":LT(e),s=LT(e,u);Q.useEffect(()=>{gI(s)},[s]);const f=Q.useRef(null),b=async()=>{await navigator.clipboard.writeText(p)},y=()=>{const R=new Blob([p],{type:"text/plain;charset=utf-8"}),N=URL.createObjectURL(R);f.current&&(f.current.href=N,f.current.download=`${(e??s).toLowerCase()||"data"}.txt`,f.current.click(),setTimeout(()=>URL.revokeObjectURL(N),1500))};return G.jsxs("div",{className:"rounded-lg border border-[var(--boomi-card-border)] bg-[var(--boomi-card-bg)]",children:[G.jsxs("div",{className:"flex items-center justify-between px-2 py-1 border-b border-[var(--boomi-card-border)]",children:[G.jsx("span",{className:"text-xs opacity-80",children:o}),G.jsxs("div",{className:"flex items-center gap-2",children:[G.jsx("button",{className:"text-xs opacity-75 hover:opacity-100",onClick:b,children:"Copy"}),G.jsx("button",{className:"text-xs opacity-75 hover:opacity-100",onClick:y,children:"Download"}),G.jsx("a",{ref:f,className:"hidden"}),G.jsx("button",{className:"text-xs opacity-75 hover:opacity-100",onClick:()=>h(R=>!R),children:E?"Collapse":"Expand"})]})]}),E&&G.jsx("div",{className:"relative",style:{height:c},children:G.jsx(sI,{mode:s,theme:d,width:"100%",height:"100%",value:p,showPrintMargin:!0,showGutter:!0,highlightActiveLine:!1,setOptions:{tabSize:2,useWorker:!0,showLineNumbers:!0,wrap:!0},editorProps:{$blockScrolling:!0}})})]})};function CT(t){if(typeof t=="string")return{message:t};if(!t||typeof t!="object")return{message:String(t)};const e={},o=t;new Set([...Object.keys(o),"name","message","code","status","requestId","stack","cause"]).forEach(m=>{try{const g=o[m];e[m]=g}catch{e[m]="[unavailable]"}});const w=m=>{!m||typeof m!="object"||Array.isArray(m)||Object.keys(m).forEach(g=>{e[g]===void 0&&(e[g]=m[g])})};return e.data&&w(e.data),e.response&&typeof e.response=="object"&&e.response.data&&w(e.response.data),e.cause&&typeof e.cause=="object"&&(e.cause.data&&w(e.cause.data),e.cause.response&&e.cause.response.data&&w(e.cause.response.data)),e}function NT(t,e=2){const o=new WeakSet;return JSON.stringify(t,(r,w)=>{if(typeof w=="object"&&w!==null){if(o.has(w))return"[Circular]";o.add(w)}return w instanceof Error?{name:w.name,message:w.message,stack:w.stack,...CT(w)}:w},e)}function $h(t){try{navigator.clipboard.writeText(t)}catch{}}const RT=({variant:t="error",children:e,title:o})=>{const r=t==="error"?"boomi-chip boomi-chip--error":t==="warning"?"boomi-chip boomi-chip--warning":t==="success"?"boomi-chip boomi-chip--success":"boomi-chip";return G.jsx("span",{className:r,title:o,children:e})},Uh=({error:t,title:e,defaultOpen:o=!0,actions:r,showRawToggle:w=!0,showStackToggle:m=!0,compact:g=!1,ariaLabel:E})=>{const[h,p]=Q.useState(o),[a,c]=Q.useState(!1),[d,u]=Q.useState(!1),s=Q.useMemo(()=>CT(t),[t]),f=typeof s.reason=="string"&&s.reason.trim()||typeof s.errorDescription=="string"&&s.errorDescription.trim()||void 0,b=typeof s.message=="string"&&s.message.trim()||f||typeof s.error=="string"&&s.error.trim()||typeof s.title=="string"&&s.title.trim()||"An unexpected error occurred.",y=(s==null?void 0:s.code)??(s==null?void 0:s.status),A=(s==null?void 0:s.requestId)??(s==null?void 0:s.traceId)??(s==null?void 0:s.correlationId);s!=null&&s.name||s!=null&&s.title;const R=typeof(s==null?void 0:s.stack)=="string"?s.stack:void 0,N=Array.isArray(s==null?void 0:s.issues)?s.issues:[],S=N.length>0,T=e||(s==null?void 0:s.title)||"Something went wrong",k=g?"py-2 px-2":"py-2.5 px-3",M=g?"p-2":"p-3";return G.jsxs("section",{className:"boomi-card rounded-lg","aria-label":E??"Error block",role:"alert",children:[G.jsxs("div",{className:`flex items-center justify-between border-b border-[var(--boomi-card-border)] ${k}`,style:{background:"var(--boomi-notice-bg)",color:"var(--boomi-notice-fg)"},children:[G.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[G.jsx(dd,{className:"boomi-notice__icon","aria-hidden":!0}),G.jsx("div",{className:"flex flex-col gap-0.5 min-w-0",children:G.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[G.jsx("h3",{className:"boomi-update-title m-0 truncate",children:T}),y!=null&&G.jsx(RT,{variant:"error",title:"Error code / status",children:String(y)}),A&&G.jsx(RT,{variant:"warning",title:"Request ID",children:String(A)})]})})]}),G.jsxs("div",{className:"flex items-center gap-2",children:[G.jsxs("button",{type:"button",className:"boomi-btn-secondary px-2 py-1 rounded inline-flex items-center gap-1",onClick:()=>$h(b),"aria-label":"Copy error message",title:"Copy error message",children:[G.jsx(Qx,{}),G.jsx("span",{className:"text-xs font-semibold",children:"Copy"})]}),w&&G.jsx("button",{type:"button",className:"boomi-btn-secondary px-2 py-1 rounded text-xs font-semibold",onClick:()=>c(I=>!I),"aria-pressed":a,"aria-label":"Toggle raw payload",title:"Toggle raw payload",children:"Raw"}),m&&R&&G.jsx("button",{type:"button",className:"boomi-btn-secondary px-2 py-1 rounded text-xs font-semibold",onClick:()=>u(I=>!I),"aria-pressed":d,"aria-label":"Toggle stack trace",title:"Toggle stack trace",children:"Stack"}),r,G.jsxs("button",{type:"button",className:"boomi-btn-secondary px-2 py-1 rounded inline-flex items-center gap-1",onClick:()=>p(I=>!I),"aria-expanded":h,"aria-controls":"error-block-body",title:h?"Collapse":"Expand",children:[h?G.jsx(nL,{}):G.jsx(Xx,{}),G.jsx("span",{className:"text-xs font-semibold",children:h?"Hide":"Show"})]})]})]}),h&&G.jsxs("div",{id:"error-block-body",className:`boomi-update-content ${M}`,children:[G.jsx("div",{className:"boomi-notice boomi-connector-inner mb-3",style:{background:"var(--boomi-update-content-bg)"},children:G.jsx("div",{className:"boomi-notice__text break-words",children:b})}),G.jsxs("div",{className:"grid gap-2 sm:grid-cols-2 mb-2",children:[y!=null&&G.jsxs("div",{className:"boomi-kv-row",children:[G.jsx("div",{className:"boomi-kv-key",children:"Status / Code"}),G.jsx("div",{className:"boomi-kv-val",children:String(y)})]}),A&&G.jsxs("div",{className:"boomi-kv-row",children:[G.jsx("div",{className:"boomi-kv-key",children:"Request ID"}),G.jsx("div",{className:"boomi-kv-val break-words",children:String(A)})]}),f&&f!==b&&G.jsxs("div",{className:"boomi-kv-row sm:col-span-2",children:[G.jsx("div",{className:"boomi-kv-key",children:"Reason"}),G.jsx("div",{className:"boomi-kv-val break-words",children:f})]})]}),S&&G.jsxs("div",{className:"mt-2",children:[G.jsx("div",{className:"boomi-connector-inner mb-1",children:G.jsx("div",{className:"boomi-connector-heading",children:"Details"})}),G.jsx("ul",{className:"list-disc pl-5 text-[13px] space-y-1",children:N.map((I,$)=>{const B=(I==null?void 0:I.message)||(I==null?void 0:I.detail)||(I==null?void 0:I.error)||JSON.stringify(I),D=Array.isArray(I==null?void 0:I.path)&&I.path.length?` (${I.path.join(".")})`:"";return G.jsxs("li",{className:"break-words",children:[B,D]},$)})})]}),d&&R&&G.jsxs("div",{className:"mt-3",children:[G.jsx("div",{className:"boomi-connector-inner mb-1",children:G.jsx("div",{className:"boomi-connector-heading",children:"Stack Trace"})}),G.jsx("pre",{className:"m-0 p-2 text-[13px] leading-6 whitespace-pre-wrap break-words border rounded",style:{borderColor:"var(--boomi-card-border)",background:"var(--boomi-update-content-bg)"},children:R}),G.jsx("div",{className:"flex justify-end mt-1",children:G.jsx("button",{type:"button",className:"boomi-btn-secondary px-2 py-1 rounded text-xs font-semibold",onClick:()=>$h(R),"aria-label":"Copy stack trace",children:"Copy Stack"})})]}),a&&G.jsxs("div",{className:"mt-3",children:[G.jsx("div",{className:"boomi-connector-inner mb-1",children:G.jsx("div",{className:"boomi-connector-heading",children:"Raw Payload"})}),G.jsx("pre",{className:"m-0 p-2 text-[13px] leading-6 whitespace-pre overflow-auto boomi-scroll border rounded",style:{borderColor:"var(--boomi-card-border)",background:"var(--boomi-update-content-bg)",maxHeight:260},children:NT(s,2)}),G.jsx("div",{className:"flex justify-end mt-1",children:G.jsx("button",{type:"button",className:"boomi-btn-secondary px-2 py-1 rounded text-xs font-semibold",onClick:()=>$h(NT(s,2)),"aria-label":"Copy raw payload",children:"Copy Raw"})})]})]})]})};function vI(t,e=2){const o=new WeakSet;return JSON.stringify(t,(r,w)=>{if(typeof w=="object"&&w!==null){if(o.has(w))return"[Circular]";o.add(w)}return w},e)}function EI(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}const Hh=({value:t,title:e,treatStringAsHTML:o=!1})=>{const{display:r}=Q.useMemo(()=>typeof t=="string"?{display:t}:{display:vI(t,2)},[t]);return G.jsxs("div",{className:"w-full",children:[e?G.jsx("div",{className:"text-xl font-semibold mb-2",children:e}):null,typeof t=="string"&&o?G.jsx("div",{className:"agent-prose",style:{color:"var(--boomi-page-fg-color)",background:"transparent"},dangerouslySetInnerHTML:{__html:r}}):typeof t=="string"?G.jsx("div",{className:"agent-prose whitespace-pre-wrap",style:{color:"var(--boomi-page-fg-color)"},dangerouslySetInnerHTML:{__html:EI(r)}}):G.jsx("pre",{className:"m-0 text-sm whitespace-pre-wrap break-words",children:r})]})};Et.setOptions({breaks:!0,gfm:!0});const wI=t=>{const e=Et.parse(t);return qO.sanitize(e,{USE_PROFILES:{html:!0},ADD_ATTR:["target","rel"]})},yI=({m:t,getMsgText:e,isBoomiDirect:o=!1})=>{var h;const r=(t==null?void 0:t.role)==="user",w=(()=>{const p=t==null?void 0:t.content;if(typeof p=="string"){const a=p.trim();if(a.startsWith("{")||a.startsWith("["))try{return JSON.parse(a)}catch{}}return p})(),m=(w==null?void 0:w.data)??w;let g=m;if(typeof m=="string"){const p=m.trim();if(p.startsWith("{")||p.startsWith("["))try{g=JSON.parse(p)}catch{g=m}}if(r)return G.jsx("div",{className:"w-full flex justify-end px-2",children:G.jsx("div",{className:"w-full flex justify-end",children:G.jsx("div",{className:"boomi-agent-bubble from-user",children:G.jsx("div",{className:"boomi-agent-bubble-text",children:e(t)})})})});if(o&&((h=t==null?void 0:t.metadata)==null?void 0:h.event)==="application_auth_required"&&g&&typeof g=="object"){const p=g,a=typeof p.authorization_url=="string"?p.authorization_url:"",c=typeof p.application_name=="string"?p.application_name:"application",d=typeof p.sign_in_message=="string"?p.sign_in_message:"Authorization required";return G.jsx("div",{className:"w-full",children:G.jsx("div",{className:"w-full max-w-[1024px] px-4 md:px-6",children:G.jsxs("div",{className:"rounded-xl border border-[var(--boomi-card-border)] bg-[var(--boomi-card-bg)] shadow-[var(--boomi-card-shadow)] p-4 md:p-5",children:[G.jsx("div",{className:"text-sm uppercase tracking-wide text-[var(--boomi-muted)]",children:"Authorization required"}),G.jsx("div",{className:"mt-1 text-base font-semibold text-[var(--boomi-page-fg-color)]",children:c}),G.jsx("div",{className:"mt-2 text-sm text-[var(--boomi-page-fg-color)]",children:d}),a?G.jsx("div",{className:"mt-4",children:G.jsxs("a",{href:a,target:"_blank",rel:"noreferrer",className:"inline-flex items-center justify-center rounded-lg boomi-btn-primary px-4 py-2 text-sm font-semibold",children:["Authorize ",c]})}):null]})})})}if((t==null?void 0:t.type)==="error"){const p=g&&typeof g=="object"?g:{},a=typeof p.title=="string"&&p.title.trim()?p.title:"Agent error",c=typeof p.message=="string"&&p.message||typeof p.data=="string"&&p.data||void 0,d=p.raw??p,u={...p,title:a,message:c,raw:d??p};return G.jsx("div",{className:"w-full",children:G.jsx(Uh,{error:u,title:a,defaultOpen:!0,showStackToggle:!0,showRawToggle:!0})})}if(g&&typeof g=="object"){const p=g,a=p.success===!1&&typeof p.error=="string"&&p.error.trim()||p.success===!1&&typeof p.message=="string"&&p.message.trim()||"";if(a){const c={title:"Agent error",message:a,raw:g};return G.jsx("div",{className:"w-full",children:G.jsx(Uh,{error:c,title:"Agent error",defaultOpen:!0,showStackToggle:!1,showRawToggle:!1})})}}if((t==null?void 0:t.type)==="text"){if(g&&typeof g=="object"&&typeof g.html=="string")return G.jsx("div",{className:"w-full",children:G.jsx("div",{className:"w-full max-w-[1024px] px-4 md:px-6 leading-7 text-[var(--boomi-page-fg-color)]",children:G.jsx(Hh,{title:g.title,value:g.html,treatStringAsHTML:!0})})});const p=typeof g=="string"?g:g!=null?String(g):"";return G.jsx("div",{className:"w-full",children:G.jsx("div",{className:"w-full max-w-[1024px] px-4 md:px-6 leading-7 text-[var(--boomi-page-fg-color)]",children:G.jsx(Hh,{value:wI(p),treatStringAsHTML:!0})})})}return g&&typeof g=="object"&&typeof g.html=="string"?G.jsx("div",{className:"w-full",children:G.jsx("div",{className:"w-full max-w-[1024px] px-4 md:px-6 leading-7 text-[var(--boomi-page-fg-color)]",children:G.jsx(Hh,{title:g.title,value:g.html,treatStringAsHTML:!0})})}):G.jsx("div",{className:"w-full",children:G.jsx("div",{className:"w-full max-w-[1024px] px-4 md:px-6 leading-7 text-[var(--boomi-page-fg-color)]",children:G.jsx(bI,{value:g??(t==null?void 0:t.content),language:"json",title:"Data"})})})};/**
1812
1812
  * @file message.ts
1813
1813
  * @module agent/utils/message
1814
1814
  * @license BSD-2-Clause
@@ -1808,7 +1808,7 @@ guard ^\\s*
1808
1808
  var \${1/.*\\/(.)/\\u$1/} = require("\${1}").\${1/.*\\/(.)/\\u$1/};
1809
1809
  $0
1810
1810
  `}),ace.define("ace/snippets/javascript",["require","exports","module","ace/snippets/javascript.snippets"],function(o,r,w){r.snippetText=o("./javascript.snippets"),r.scope="javascript"}),(function(){ace.require(["ace/snippets/javascript"],function(o){t&&(t.exports=o)})})()})(Mh)),Mh.exports}fI();var pI=Ps();const xT=Es(pI);xT.config.set("basePath","https://cdn.jsdelivr.net/npm/ace-builds@1.4.3/src-noconflict/"),xT.config.setModuleUrl("ace/mode/javascript_worker","https://cdn.jsdelivr.net/npm/ace-builds@1.4.3/src-noconflict/worker-javascript.js");function mI(t,e){if(typeof t=="string"){if((e??"").toLowerCase().includes("json"))try{return JSON.stringify(JSON.parse(t),null,2)}catch{}return t}try{return JSON.stringify(t,null,2)}catch{return String(t??"")}}function LT(t,e){const o=(t??"").toLowerCase(),r={javascript:"javascript",typescript:"typescript",json:"json",json5:"json",xml:"xml",yaml:"yaml",yml:"yaml",html:"html",css:"css",scss:"scss",less:"less",jsx:"jsx",tsx:"tsx",markdown:"markdown",md:"markdown",sql:"sql",mysql:"mysql",postgresql:"pgsql",pgsql:"pgsql","pl/sql":"sql",powershell:"powershell",shell:"sh",sh:"sh",python:"python",java:"java","c#":"csharp",csharp:"csharp","c++":"c_cpp",cpp:"c_cpp",go:"golang",ruby:"ruby",php:"php",rust:"rust",scala:"scala",clojure:"clojure",ocaml:"ocaml",lua:"lua",toml:"toml",ini:"ini",proto:"protobuf","protocol buffers":"protobuf",latex:"latex",tex:"latex",svg:"svg",hcl:"hcl",makefile:"makefile"};return r[o]?r[o]:o.includes("json")?"json":o.includes("sql")?"sql":o.includes("yaml")?"yaml":o.includes("xml")?"xml":o.includes("md")||o.includes("markdown")?"markdown":e??"text"}async function gI(t){try{await import(`ace-builds/src-min-noconflict/mode-${t}.js`)}catch{}try{await import(`ace-builds/src-min-noconflict/worker-${t}.js`)}catch{}}const bI=({value:t,language:e,title:o="Data",collapsed:r=!1,minHeight:w=200,maxHeight:m=640})=>{var A;const{boomiConfig:g}=fn(),[E,h]=Q.useState(!r),p=Q.useMemo(()=>mI(t,e),[t,e]),a=Q.useMemo(()=>Math.max(3,p.split(`
1811
- `).length),[p]),c=Math.max(w,Math.min(m,a*18+48)),d=(A=g==null?void 0:g.theme)!=null&&A.darkModeTheme?"tomorrow_night_bright":"chrome",u=typeof t=="object"&&t!==null?"json":LT(e),s=LT(e,u);Q.useEffect(()=>{gI(s)},[s]);const f=Q.useRef(null),b=async()=>{await navigator.clipboard.writeText(p)},y=()=>{const R=new Blob([p],{type:"text/plain;charset=utf-8"}),N=URL.createObjectURL(R);f.current&&(f.current.href=N,f.current.download=`${(e??s).toLowerCase()||"data"}.txt`,f.current.click(),setTimeout(()=>URL.revokeObjectURL(N),1500))};return G.jsxs("div",{className:"rounded-lg border border-[var(--boomi-card-border)] bg-[var(--boomi-card-bg)]",children:[G.jsxs("div",{className:"flex items-center justify-between px-2 py-1 border-b border-[var(--boomi-card-border)]",children:[G.jsx("span",{className:"text-xs opacity-80",children:o}),G.jsxs("div",{className:"flex items-center gap-2",children:[G.jsx("button",{className:"text-xs opacity-75 hover:opacity-100",onClick:b,children:"Copy"}),G.jsx("button",{className:"text-xs opacity-75 hover:opacity-100",onClick:y,children:"Download"}),G.jsx("a",{ref:f,className:"hidden"}),G.jsx("button",{className:"text-xs opacity-75 hover:opacity-100",onClick:()=>h(R=>!R),children:E?"Collapse":"Expand"})]})]}),E&&G.jsx("div",{className:"relative",style:{height:c},children:G.jsx(sI,{mode:s,theme:d,width:"100%",height:"100%",value:p,showPrintMargin:!0,showGutter:!0,highlightActiveLine:!1,setOptions:{tabSize:2,useWorker:!0,showLineNumbers:!0,wrap:!0},editorProps:{$blockScrolling:!0}})})]})};function CT(t){if(typeof t=="string")return{message:t};if(!t||typeof t!="object")return{message:String(t)};const e={},o=t;new Set([...Object.keys(o),"name","message","code","status","requestId","stack","cause"]).forEach(m=>{try{const g=o[m];e[m]=g}catch{e[m]="[unavailable]"}});const w=m=>{!m||typeof m!="object"||Array.isArray(m)||Object.keys(m).forEach(g=>{e[g]===void 0&&(e[g]=m[g])})};return e.data&&w(e.data),e.response&&typeof e.response=="object"&&e.response.data&&w(e.response.data),e.cause&&typeof e.cause=="object"&&(e.cause.data&&w(e.cause.data),e.cause.response&&e.cause.response.data&&w(e.cause.response.data)),e}function NT(t,e=2){const o=new WeakSet;return JSON.stringify(t,(r,w)=>{if(typeof w=="object"&&w!==null){if(o.has(w))return"[Circular]";o.add(w)}return w instanceof Error?{name:w.name,message:w.message,stack:w.stack,...CT(w)}:w},e)}function $h(t){try{navigator.clipboard.writeText(t)}catch{}}const RT=({variant:t="error",children:e,title:o})=>{const r=t==="error"?"boomi-chip boomi-chip--error":t==="warning"?"boomi-chip boomi-chip--warning":t==="success"?"boomi-chip boomi-chip--success":"boomi-chip";return G.jsx("span",{className:r,title:o,children:e})},Uh=({error:t,title:e,defaultOpen:o=!0,actions:r,showRawToggle:w=!0,showStackToggle:m=!0,compact:g=!1,ariaLabel:E})=>{const[h,p]=Q.useState(o),[a,c]=Q.useState(!1),[d,u]=Q.useState(!1),s=Q.useMemo(()=>CT(t),[t]),f=typeof s.reason=="string"&&s.reason.trim()||typeof s.errorDescription=="string"&&s.errorDescription.trim()||void 0,b=typeof s.message=="string"&&s.message.trim()||f||typeof s.error=="string"&&s.error.trim()||typeof s.title=="string"&&s.title.trim()||"An unexpected error occurred.",y=(s==null?void 0:s.code)??(s==null?void 0:s.status),A=(s==null?void 0:s.requestId)??(s==null?void 0:s.traceId)??(s==null?void 0:s.correlationId);s!=null&&s.name||s!=null&&s.title;const R=typeof(s==null?void 0:s.stack)=="string"?s.stack:void 0,N=Array.isArray(s==null?void 0:s.issues)?s.issues:[],S=N.length>0,T=e||(s==null?void 0:s.title)||"Something went wrong",k=g?"py-2 px-2":"py-2.5 px-3",M=g?"p-2":"p-3";return G.jsxs("section",{className:"boomi-card rounded-lg","aria-label":E??"Error block",role:"alert",children:[G.jsxs("div",{className:`flex items-center justify-between border-b border-[var(--boomi-card-border)] ${k}`,style:{background:"var(--boomi-notice-bg)",color:"var(--boomi-notice-fg)"},children:[G.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[G.jsx(dd,{className:"boomi-notice__icon","aria-hidden":!0}),G.jsx("div",{className:"flex flex-col gap-0.5 min-w-0",children:G.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[G.jsx("h3",{className:"boomi-update-title m-0 truncate",children:T}),y!=null&&G.jsx(RT,{variant:"error",title:"Error code / status",children:String(y)}),A&&G.jsx(RT,{variant:"warning",title:"Request ID",children:String(A)})]})})]}),G.jsxs("div",{className:"flex items-center gap-2",children:[G.jsxs("button",{type:"button",className:"boomi-btn-secondary px-2 py-1 rounded inline-flex items-center gap-1",onClick:()=>$h(b),"aria-label":"Copy error message",title:"Copy error message",children:[G.jsx(Qx,{}),G.jsx("span",{className:"text-xs font-semibold",children:"Copy"})]}),w&&G.jsx("button",{type:"button",className:"boomi-btn-secondary px-2 py-1 rounded text-xs font-semibold",onClick:()=>c(I=>!I),"aria-pressed":a,"aria-label":"Toggle raw payload",title:"Toggle raw payload",children:"Raw"}),m&&R&&G.jsx("button",{type:"button",className:"boomi-btn-secondary px-2 py-1 rounded text-xs font-semibold",onClick:()=>u(I=>!I),"aria-pressed":d,"aria-label":"Toggle stack trace",title:"Toggle stack trace",children:"Stack"}),r,G.jsxs("button",{type:"button",className:"boomi-btn-secondary px-2 py-1 rounded inline-flex items-center gap-1",onClick:()=>p(I=>!I),"aria-expanded":h,"aria-controls":"error-block-body",title:h?"Collapse":"Expand",children:[h?G.jsx(nL,{}):G.jsx(Xx,{}),G.jsx("span",{className:"text-xs font-semibold",children:h?"Hide":"Show"})]})]})]}),h&&G.jsxs("div",{id:"error-block-body",className:`boomi-update-content ${M}`,children:[G.jsx("div",{className:"boomi-notice boomi-connector-inner mb-3",style:{background:"var(--boomi-update-content-bg)"},children:G.jsx("div",{className:"boomi-notice__text break-words",children:b})}),G.jsxs("div",{className:"grid gap-2 sm:grid-cols-2 mb-2",children:[y!=null&&G.jsxs("div",{className:"boomi-kv-row",children:[G.jsx("div",{className:"boomi-kv-key",children:"Status / Code"}),G.jsx("div",{className:"boomi-kv-val",children:String(y)})]}),A&&G.jsxs("div",{className:"boomi-kv-row",children:[G.jsx("div",{className:"boomi-kv-key",children:"Request ID"}),G.jsx("div",{className:"boomi-kv-val break-words",children:String(A)})]}),f&&f!==b&&G.jsxs("div",{className:"boomi-kv-row sm:col-span-2",children:[G.jsx("div",{className:"boomi-kv-key",children:"Reason"}),G.jsx("div",{className:"boomi-kv-val break-words",children:f})]})]}),S&&G.jsxs("div",{className:"mt-2",children:[G.jsx("div",{className:"boomi-connector-inner mb-1",children:G.jsx("div",{className:"boomi-connector-heading",children:"Details"})}),G.jsx("ul",{className:"list-disc pl-5 text-[13px] space-y-1",children:N.map((I,$)=>{const B=(I==null?void 0:I.message)||(I==null?void 0:I.detail)||(I==null?void 0:I.error)||JSON.stringify(I),D=Array.isArray(I==null?void 0:I.path)&&I.path.length?` (${I.path.join(".")})`:"";return G.jsxs("li",{className:"break-words",children:[B,D]},$)})})]}),d&&R&&G.jsxs("div",{className:"mt-3",children:[G.jsx("div",{className:"boomi-connector-inner mb-1",children:G.jsx("div",{className:"boomi-connector-heading",children:"Stack Trace"})}),G.jsx("pre",{className:"m-0 p-2 text-[13px] leading-6 whitespace-pre-wrap break-words border rounded",style:{borderColor:"var(--boomi-card-border)",background:"var(--boomi-update-content-bg)"},children:R}),G.jsx("div",{className:"flex justify-end mt-1",children:G.jsx("button",{type:"button",className:"boomi-btn-secondary px-2 py-1 rounded text-xs font-semibold",onClick:()=>$h(R),"aria-label":"Copy stack trace",children:"Copy Stack"})})]}),a&&G.jsxs("div",{className:"mt-3",children:[G.jsx("div",{className:"boomi-connector-inner mb-1",children:G.jsx("div",{className:"boomi-connector-heading",children:"Raw Payload"})}),G.jsx("pre",{className:"m-0 p-2 text-[13px] leading-6 whitespace-pre overflow-auto boomi-scroll border rounded",style:{borderColor:"var(--boomi-card-border)",background:"var(--boomi-update-content-bg)",maxHeight:260},children:NT(s,2)}),G.jsx("div",{className:"flex justify-end mt-1",children:G.jsx("button",{type:"button",className:"boomi-btn-secondary px-2 py-1 rounded text-xs font-semibold",onClick:()=>$h(NT(s,2)),"aria-label":"Copy raw payload",children:"Copy Raw"})})]})]})]})};function vI(t,e=2){const o=new WeakSet;return JSON.stringify(t,(r,w)=>{if(typeof w=="object"&&w!==null){if(o.has(w))return"[Circular]";o.add(w)}return w},e)}function EI(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}const Hh=({value:t,title:e,treatStringAsHTML:o=!1})=>{const{display:r}=Q.useMemo(()=>typeof t=="string"?{display:t}:{display:vI(t,2)},[t]);return G.jsxs("div",{className:"w-full",children:[e?G.jsx("div",{className:"text-xl font-semibold mb-2",children:e}):null,typeof t=="string"&&o?G.jsx("div",{className:"agent-prose",style:{color:"var(--boomi-page-fg-color)",background:"transparent"},dangerouslySetInnerHTML:{__html:r}}):typeof t=="string"?G.jsx("div",{className:"agent-prose whitespace-pre-wrap",style:{color:"var(--boomi-page-fg-color)"},dangerouslySetInnerHTML:{__html:EI(r)}}):G.jsx("pre",{className:"m-0 text-sm whitespace-pre-wrap break-words",children:r})]})};Et.setOptions({breaks:!0,gfm:!0});const wI=t=>{const e=Et.parse(t);return qO.sanitize(e,{USE_PROFILES:{html:!0},ADD_ATTR:["target","rel"]})},yI=({m:t,getMsgText:e,isBoomiDirect:o=!1})=>{var E,h;const r=(t==null?void 0:t.role)==="user",w=((E=t==null?void 0:t.content)==null?void 0:E.data)??(t==null?void 0:t.content);let m=w;if(typeof w=="string"){const p=w.trim();if(p.startsWith("{")||p.startsWith("["))try{m=JSON.parse(p)}catch{m=w}}if(r)return G.jsx("div",{className:"w-full flex justify-end px-2",children:G.jsx("div",{className:"w-full flex justify-end",children:G.jsx("div",{className:"boomi-agent-bubble from-user",children:G.jsx("div",{className:"boomi-agent-bubble-text",children:e(t)})})})});if(o&&((h=t==null?void 0:t.metadata)==null?void 0:h.event)==="application_auth_required"&&m&&typeof m=="object"){const p=m,a=typeof p.authorization_url=="string"?p.authorization_url:"",c=typeof p.application_name=="string"?p.application_name:"application",d=typeof p.sign_in_message=="string"?p.sign_in_message:"Authorization required";return G.jsx("div",{className:"w-full",children:G.jsx("div",{className:"w-full max-w-[1024px] px-4 md:px-6",children:G.jsxs("div",{className:"rounded-xl border border-[var(--boomi-card-border)] bg-[var(--boomi-card-bg)] shadow-[var(--boomi-card-shadow)] p-4 md:p-5",children:[G.jsx("div",{className:"text-sm uppercase tracking-wide text-[var(--boomi-muted)]",children:"Authorization required"}),G.jsx("div",{className:"mt-1 text-base font-semibold text-[var(--boomi-page-fg-color)]",children:c}),G.jsx("div",{className:"mt-2 text-sm text-[var(--boomi-page-fg-color)]",children:d}),a?G.jsx("div",{className:"mt-4",children:G.jsxs("a",{href:a,target:"_blank",rel:"noreferrer",className:"inline-flex items-center justify-center rounded-lg boomi-btn-primary px-4 py-2 text-sm font-semibold",children:["Authorize ",c]})}):null]})})})}if((t==null?void 0:t.type)==="error"){const p=m&&typeof m=="object"?m:{},a=typeof p.title=="string"&&p.title.trim()?p.title:"Agent error",c=typeof p.message=="string"&&p.message||typeof p.data=="string"&&p.data||void 0,d=p.raw??p,u={...p,title:a,message:c,raw:d??p};return G.jsx("div",{className:"w-full",children:G.jsx(Uh,{error:u,title:a,defaultOpen:!0,showStackToggle:!0,showRawToggle:!0})})}if(m&&typeof m=="object"){const p=m,a=p.success===!1&&typeof p.error=="string"&&p.error.trim()||p.success===!1&&typeof p.message=="string"&&p.message.trim()||"";if(a){const c={title:"Agent error",message:a,raw:m};return G.jsx("div",{className:"w-full",children:G.jsx(Uh,{error:c,title:"Agent error",defaultOpen:!0,showStackToggle:!1,showRawToggle:!1})})}}if((t==null?void 0:t.type)==="text"){if(m&&typeof m=="object"&&typeof m.html=="string")return G.jsx("div",{className:"w-full",children:G.jsx("div",{className:"w-full max-w-[1024px] px-4 md:px-6 leading-7 text-[var(--boomi-page-fg-color)]",children:G.jsx(Hh,{title:m.title,value:m.html,treatStringAsHTML:!0})})});const p=typeof m=="string"?m:m!=null?String(m):"";return G.jsx("div",{className:"w-full",children:G.jsx("div",{className:"w-full max-w-[1024px] px-4 md:px-6 leading-7 text-[var(--boomi-page-fg-color)]",children:G.jsx(Hh,{value:wI(p),treatStringAsHTML:!0})})})}return m&&typeof m=="object"&&typeof m.html=="string"?G.jsx("div",{className:"w-full",children:G.jsx("div",{className:"w-full max-w-[1024px] px-4 md:px-6 leading-7 text-[var(--boomi-page-fg-color)]",children:G.jsx(Hh,{title:m.title,value:m.html,treatStringAsHTML:!0})})}):G.jsx("div",{className:"w-full",children:G.jsx("div",{className:"w-full max-w-[1024px] px-4 md:px-6 leading-7 text-[var(--boomi-page-fg-color)]",children:G.jsx(bI,{value:m??(t==null?void 0:t.content),language:"json",title:"Data"})})})};/**
1811
+ `).length),[p]),c=Math.max(w,Math.min(m,a*18+48)),d=(A=g==null?void 0:g.theme)!=null&&A.darkModeTheme?"tomorrow_night_bright":"chrome",u=typeof t=="object"&&t!==null?"json":LT(e),s=LT(e,u);Q.useEffect(()=>{gI(s)},[s]);const f=Q.useRef(null),b=async()=>{await navigator.clipboard.writeText(p)},y=()=>{const R=new Blob([p],{type:"text/plain;charset=utf-8"}),N=URL.createObjectURL(R);f.current&&(f.current.href=N,f.current.download=`${(e??s).toLowerCase()||"data"}.txt`,f.current.click(),setTimeout(()=>URL.revokeObjectURL(N),1500))};return G.jsxs("div",{className:"rounded-lg border border-[var(--boomi-card-border)] bg-[var(--boomi-card-bg)]",children:[G.jsxs("div",{className:"flex items-center justify-between px-2 py-1 border-b border-[var(--boomi-card-border)]",children:[G.jsx("span",{className:"text-xs opacity-80",children:o}),G.jsxs("div",{className:"flex items-center gap-2",children:[G.jsx("button",{className:"text-xs opacity-75 hover:opacity-100",onClick:b,children:"Copy"}),G.jsx("button",{className:"text-xs opacity-75 hover:opacity-100",onClick:y,children:"Download"}),G.jsx("a",{ref:f,className:"hidden"}),G.jsx("button",{className:"text-xs opacity-75 hover:opacity-100",onClick:()=>h(R=>!R),children:E?"Collapse":"Expand"})]})]}),E&&G.jsx("div",{className:"relative",style:{height:c},children:G.jsx(sI,{mode:s,theme:d,width:"100%",height:"100%",value:p,showPrintMargin:!0,showGutter:!0,highlightActiveLine:!1,setOptions:{tabSize:2,useWorker:!0,showLineNumbers:!0,wrap:!0},editorProps:{$blockScrolling:!0}})})]})};function CT(t){if(typeof t=="string")return{message:t};if(!t||typeof t!="object")return{message:String(t)};const e={},o=t;new Set([...Object.keys(o),"name","message","code","status","requestId","stack","cause"]).forEach(m=>{try{const g=o[m];e[m]=g}catch{e[m]="[unavailable]"}});const w=m=>{!m||typeof m!="object"||Array.isArray(m)||Object.keys(m).forEach(g=>{e[g]===void 0&&(e[g]=m[g])})};return e.data&&w(e.data),e.response&&typeof e.response=="object"&&e.response.data&&w(e.response.data),e.cause&&typeof e.cause=="object"&&(e.cause.data&&w(e.cause.data),e.cause.response&&e.cause.response.data&&w(e.cause.response.data)),e}function NT(t,e=2){const o=new WeakSet;return JSON.stringify(t,(r,w)=>{if(typeof w=="object"&&w!==null){if(o.has(w))return"[Circular]";o.add(w)}return w instanceof Error?{name:w.name,message:w.message,stack:w.stack,...CT(w)}:w},e)}function $h(t){try{navigator.clipboard.writeText(t)}catch{}}const RT=({variant:t="error",children:e,title:o})=>{const r=t==="error"?"boomi-chip boomi-chip--error":t==="warning"?"boomi-chip boomi-chip--warning":t==="success"?"boomi-chip boomi-chip--success":"boomi-chip";return G.jsx("span",{className:r,title:o,children:e})},Uh=({error:t,title:e,defaultOpen:o=!0,actions:r,showRawToggle:w=!0,showStackToggle:m=!0,compact:g=!1,ariaLabel:E})=>{const[h,p]=Q.useState(o),[a,c]=Q.useState(!1),[d,u]=Q.useState(!1),s=Q.useMemo(()=>CT(t),[t]),f=typeof s.reason=="string"&&s.reason.trim()||typeof s.errorDescription=="string"&&s.errorDescription.trim()||void 0,b=typeof s.message=="string"&&s.message.trim()||f||typeof s.error=="string"&&s.error.trim()||typeof s.title=="string"&&s.title.trim()||"An unexpected error occurred.",y=(s==null?void 0:s.code)??(s==null?void 0:s.status),A=(s==null?void 0:s.requestId)??(s==null?void 0:s.traceId)??(s==null?void 0:s.correlationId);s!=null&&s.name||s!=null&&s.title;const R=typeof(s==null?void 0:s.stack)=="string"?s.stack:void 0,N=Array.isArray(s==null?void 0:s.issues)?s.issues:[],S=N.length>0,T=e||(s==null?void 0:s.title)||"Something went wrong",k=g?"py-2 px-2":"py-2.5 px-3",M=g?"p-2":"p-3";return G.jsxs("section",{className:"boomi-card rounded-lg","aria-label":E??"Error block",role:"alert",children:[G.jsxs("div",{className:`flex items-center justify-between border-b border-[var(--boomi-card-border)] ${k}`,style:{background:"var(--boomi-notice-bg)",color:"var(--boomi-notice-fg)"},children:[G.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[G.jsx(dd,{className:"boomi-notice__icon","aria-hidden":!0}),G.jsx("div",{className:"flex flex-col gap-0.5 min-w-0",children:G.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[G.jsx("h3",{className:"boomi-update-title m-0 truncate",children:T}),y!=null&&G.jsx(RT,{variant:"error",title:"Error code / status",children:String(y)}),A&&G.jsx(RT,{variant:"warning",title:"Request ID",children:String(A)})]})})]}),G.jsxs("div",{className:"flex items-center gap-2",children:[G.jsxs("button",{type:"button",className:"boomi-btn-secondary px-2 py-1 rounded inline-flex items-center gap-1",onClick:()=>$h(b),"aria-label":"Copy error message",title:"Copy error message",children:[G.jsx(Qx,{}),G.jsx("span",{className:"text-xs font-semibold",children:"Copy"})]}),w&&G.jsx("button",{type:"button",className:"boomi-btn-secondary px-2 py-1 rounded text-xs font-semibold",onClick:()=>c(I=>!I),"aria-pressed":a,"aria-label":"Toggle raw payload",title:"Toggle raw payload",children:"Raw"}),m&&R&&G.jsx("button",{type:"button",className:"boomi-btn-secondary px-2 py-1 rounded text-xs font-semibold",onClick:()=>u(I=>!I),"aria-pressed":d,"aria-label":"Toggle stack trace",title:"Toggle stack trace",children:"Stack"}),r,G.jsxs("button",{type:"button",className:"boomi-btn-secondary px-2 py-1 rounded inline-flex items-center gap-1",onClick:()=>p(I=>!I),"aria-expanded":h,"aria-controls":"error-block-body",title:h?"Collapse":"Expand",children:[h?G.jsx(nL,{}):G.jsx(Xx,{}),G.jsx("span",{className:"text-xs font-semibold",children:h?"Hide":"Show"})]})]})]}),h&&G.jsxs("div",{id:"error-block-body",className:`boomi-update-content ${M}`,children:[G.jsx("div",{className:"boomi-notice boomi-connector-inner mb-3",style:{background:"var(--boomi-update-content-bg)"},children:G.jsx("div",{className:"boomi-notice__text break-words",children:b})}),G.jsxs("div",{className:"grid gap-2 sm:grid-cols-2 mb-2",children:[y!=null&&G.jsxs("div",{className:"boomi-kv-row",children:[G.jsx("div",{className:"boomi-kv-key",children:"Status / Code"}),G.jsx("div",{className:"boomi-kv-val",children:String(y)})]}),A&&G.jsxs("div",{className:"boomi-kv-row",children:[G.jsx("div",{className:"boomi-kv-key",children:"Request ID"}),G.jsx("div",{className:"boomi-kv-val break-words",children:String(A)})]}),f&&f!==b&&G.jsxs("div",{className:"boomi-kv-row sm:col-span-2",children:[G.jsx("div",{className:"boomi-kv-key",children:"Reason"}),G.jsx("div",{className:"boomi-kv-val break-words",children:f})]})]}),S&&G.jsxs("div",{className:"mt-2",children:[G.jsx("div",{className:"boomi-connector-inner mb-1",children:G.jsx("div",{className:"boomi-connector-heading",children:"Details"})}),G.jsx("ul",{className:"list-disc pl-5 text-[13px] space-y-1",children:N.map((I,$)=>{const B=(I==null?void 0:I.message)||(I==null?void 0:I.detail)||(I==null?void 0:I.error)||JSON.stringify(I),D=Array.isArray(I==null?void 0:I.path)&&I.path.length?` (${I.path.join(".")})`:"";return G.jsxs("li",{className:"break-words",children:[B,D]},$)})})]}),d&&R&&G.jsxs("div",{className:"mt-3",children:[G.jsx("div",{className:"boomi-connector-inner mb-1",children:G.jsx("div",{className:"boomi-connector-heading",children:"Stack Trace"})}),G.jsx("pre",{className:"m-0 p-2 text-[13px] leading-6 whitespace-pre-wrap break-words border rounded",style:{borderColor:"var(--boomi-card-border)",background:"var(--boomi-update-content-bg)"},children:R}),G.jsx("div",{className:"flex justify-end mt-1",children:G.jsx("button",{type:"button",className:"boomi-btn-secondary px-2 py-1 rounded text-xs font-semibold",onClick:()=>$h(R),"aria-label":"Copy stack trace",children:"Copy Stack"})})]}),a&&G.jsxs("div",{className:"mt-3",children:[G.jsx("div",{className:"boomi-connector-inner mb-1",children:G.jsx("div",{className:"boomi-connector-heading",children:"Raw Payload"})}),G.jsx("pre",{className:"m-0 p-2 text-[13px] leading-6 whitespace-pre overflow-auto boomi-scroll border rounded",style:{borderColor:"var(--boomi-card-border)",background:"var(--boomi-update-content-bg)",maxHeight:260},children:NT(s,2)}),G.jsx("div",{className:"flex justify-end mt-1",children:G.jsx("button",{type:"button",className:"boomi-btn-secondary px-2 py-1 rounded text-xs font-semibold",onClick:()=>$h(NT(s,2)),"aria-label":"Copy raw payload",children:"Copy Raw"})})]})]})]})};function vI(t,e=2){const o=new WeakSet;return JSON.stringify(t,(r,w)=>{if(typeof w=="object"&&w!==null){if(o.has(w))return"[Circular]";o.add(w)}return w},e)}function EI(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}const Hh=({value:t,title:e,treatStringAsHTML:o=!1})=>{const{display:r}=Q.useMemo(()=>typeof t=="string"?{display:t}:{display:vI(t,2)},[t]);return G.jsxs("div",{className:"w-full",children:[e?G.jsx("div",{className:"text-xl font-semibold mb-2",children:e}):null,typeof t=="string"&&o?G.jsx("div",{className:"agent-prose",style:{color:"var(--boomi-page-fg-color)",background:"transparent"},dangerouslySetInnerHTML:{__html:r}}):typeof t=="string"?G.jsx("div",{className:"agent-prose whitespace-pre-wrap",style:{color:"var(--boomi-page-fg-color)"},dangerouslySetInnerHTML:{__html:EI(r)}}):G.jsx("pre",{className:"m-0 text-sm whitespace-pre-wrap break-words",children:r})]})};Et.setOptions({breaks:!0,gfm:!0});const wI=t=>{const e=Et.parse(t);return qO.sanitize(e,{USE_PROFILES:{html:!0},ADD_ATTR:["target","rel"]})},yI=({m:t,getMsgText:e,isBoomiDirect:o=!1})=>{var h;const r=(t==null?void 0:t.role)==="user",w=(()=>{const p=t==null?void 0:t.content;if(typeof p=="string"){const a=p.trim();if(a.startsWith("{")||a.startsWith("["))try{return JSON.parse(a)}catch{}}return p})(),m=(w==null?void 0:w.data)??w;let g=m;if(typeof m=="string"){const p=m.trim();if(p.startsWith("{")||p.startsWith("["))try{g=JSON.parse(p)}catch{g=m}}if(r)return G.jsx("div",{className:"w-full flex justify-end px-2",children:G.jsx("div",{className:"w-full flex justify-end",children:G.jsx("div",{className:"boomi-agent-bubble from-user",children:G.jsx("div",{className:"boomi-agent-bubble-text",children:e(t)})})})});if(o&&((h=t==null?void 0:t.metadata)==null?void 0:h.event)==="application_auth_required"&&g&&typeof g=="object"){const p=g,a=typeof p.authorization_url=="string"?p.authorization_url:"",c=typeof p.application_name=="string"?p.application_name:"application",d=typeof p.sign_in_message=="string"?p.sign_in_message:"Authorization required";return G.jsx("div",{className:"w-full",children:G.jsx("div",{className:"w-full max-w-[1024px] px-4 md:px-6",children:G.jsxs("div",{className:"rounded-xl border border-[var(--boomi-card-border)] bg-[var(--boomi-card-bg)] shadow-[var(--boomi-card-shadow)] p-4 md:p-5",children:[G.jsx("div",{className:"text-sm uppercase tracking-wide text-[var(--boomi-muted)]",children:"Authorization required"}),G.jsx("div",{className:"mt-1 text-base font-semibold text-[var(--boomi-page-fg-color)]",children:c}),G.jsx("div",{className:"mt-2 text-sm text-[var(--boomi-page-fg-color)]",children:d}),a?G.jsx("div",{className:"mt-4",children:G.jsxs("a",{href:a,target:"_blank",rel:"noreferrer",className:"inline-flex items-center justify-center rounded-lg boomi-btn-primary px-4 py-2 text-sm font-semibold",children:["Authorize ",c]})}):null]})})})}if((t==null?void 0:t.type)==="error"){const p=g&&typeof g=="object"?g:{},a=typeof p.title=="string"&&p.title.trim()?p.title:"Agent error",c=typeof p.message=="string"&&p.message||typeof p.data=="string"&&p.data||void 0,d=p.raw??p,u={...p,title:a,message:c,raw:d??p};return G.jsx("div",{className:"w-full",children:G.jsx(Uh,{error:u,title:a,defaultOpen:!0,showStackToggle:!0,showRawToggle:!0})})}if(g&&typeof g=="object"){const p=g,a=p.success===!1&&typeof p.error=="string"&&p.error.trim()||p.success===!1&&typeof p.message=="string"&&p.message.trim()||"";if(a){const c={title:"Agent error",message:a,raw:g};return G.jsx("div",{className:"w-full",children:G.jsx(Uh,{error:c,title:"Agent error",defaultOpen:!0,showStackToggle:!1,showRawToggle:!1})})}}if((t==null?void 0:t.type)==="text"){if(g&&typeof g=="object"&&typeof g.html=="string")return G.jsx("div",{className:"w-full",children:G.jsx("div",{className:"w-full max-w-[1024px] px-4 md:px-6 leading-7 text-[var(--boomi-page-fg-color)]",children:G.jsx(Hh,{title:g.title,value:g.html,treatStringAsHTML:!0})})});const p=typeof g=="string"?g:g!=null?String(g):"";return G.jsx("div",{className:"w-full",children:G.jsx("div",{className:"w-full max-w-[1024px] px-4 md:px-6 leading-7 text-[var(--boomi-page-fg-color)]",children:G.jsx(Hh,{value:wI(p),treatStringAsHTML:!0})})})}return g&&typeof g=="object"&&typeof g.html=="string"?G.jsx("div",{className:"w-full",children:G.jsx("div",{className:"w-full max-w-[1024px] px-4 md:px-6 leading-7 text-[var(--boomi-page-fg-color)]",children:G.jsx(Hh,{title:g.title,value:g.html,treatStringAsHTML:!0})})}):G.jsx("div",{className:"w-full",children:G.jsx("div",{className:"w-full max-w-[1024px] px-4 md:px-6 leading-7 text-[var(--boomi-page-fg-color)]",children:G.jsx(bI,{value:g??(t==null?void 0:t.content),language:"json",title:"Data"})})})};/**
1812
1812
  * @file message.ts
1813
1813
  * @module agent/utils/message
1814
1814
  * @license BSD-2-Clause
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boomi/embedkit-cdn",
3
- "version": "1.1.12",
3
+ "version": "1.1.13",
4
4
  "description": "Pre-built UMD bundle and CSS for Boomi EmbedKit — drop-in script tag distribution via jsDelivr and unpkg",
5
5
  "files": [
6
6
  "embedkit-cdn.js",