@runtypelabs/persona 4.7.0 → 4.8.0
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/dist/animations/glyph-cycle.cjs +2 -2
- package/dist/animations/glyph-cycle.d.cts +1 -1
- package/dist/animations/glyph-cycle.d.ts +1 -1
- package/dist/animations/glyph-cycle.js +2 -2
- package/dist/animations/{types-CSmiKRVa.d.cts → types-BsZtXPKK.d.cts} +43 -3
- package/dist/animations/{types-CSmiKRVa.d.ts → types-BsZtXPKK.d.ts} +43 -3
- package/dist/animations/wipe.cjs +2 -2
- package/dist/animations/wipe.d.cts +1 -1
- package/dist/animations/wipe.d.ts +1 -1
- package/dist/chunk-5EIIHQLQ.js +1 -0
- package/dist/codegen.cjs +12 -12
- package/dist/codegen.js +14 -14
- package/dist/index.cjs +91 -68
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +877 -172
- package/dist/index.d.ts +877 -172
- package/dist/index.global.js +81 -57
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +91 -68
- package/dist/index.js.map +1 -1
- package/dist/install.global.js +1 -1
- package/dist/install.global.js.map +1 -1
- package/dist/launcher.global.js +3 -2
- package/dist/launcher.global.js.map +1 -1
- package/dist/markdown-parsers.js +24 -24
- package/dist/plugin-kit.cjs +1 -1
- package/dist/plugin-kit.js +1 -1
- package/dist/runtype-tts-entry-UJAEF7NZ.js +1 -0
- package/dist/runtype-tts.js +1 -1
- package/dist/session-reconnect-JKIJBHS5.js +1 -0
- package/dist/smart-dom-reader.cjs +17 -17
- package/dist/smart-dom-reader.d.cts +753 -15
- package/dist/smart-dom-reader.d.ts +753 -15
- package/dist/smart-dom-reader.js +17 -17
- package/dist/testing.cjs +3 -3
- package/dist/testing.js +3 -3
- package/dist/theme-editor-preview.cjs +81 -58
- package/dist/theme-editor-preview.d.cts +761 -15
- package/dist/theme-editor-preview.d.ts +761 -15
- package/dist/theme-editor-preview.js +81 -58
- package/dist/theme-editor.cjs +6 -6
- package/dist/theme-editor.d.cts +753 -15
- package/dist/theme-editor.d.ts +753 -15
- package/dist/theme-editor.js +10 -10
- package/dist/theme-reference.cjs +1 -1
- package/dist/theme-reference.d.cts +74 -0
- package/dist/theme-reference.d.ts +74 -0
- package/dist/theme-reference.js +1 -1
- package/dist/voice-worklet-player.cjs +2 -2
- package/dist/voice-worklet-player.js +2 -2
- package/dist/webmcp-polyfill.js +2 -2
- package/dist/widget.css +1 -1
- package/package.json +2 -3
- package/src/artifacts-session.test.ts +178 -0
- package/src/client.test.ts +186 -1
- package/src/client.ts +92 -9
- package/src/components/artifact-card.test.ts +333 -0
- package/src/components/artifact-card.ts +75 -28
- package/src/components/artifact-inline.test.ts +1328 -0
- package/src/components/artifact-inline.ts +920 -0
- package/src/components/artifact-pane.test.ts +1042 -0
- package/src/components/artifact-pane.ts +440 -131
- package/src/components/artifact-preview.test.ts +1155 -0
- package/src/components/artifact-preview.ts +994 -0
- package/src/components/pill-composer-builder.test.ts +6 -2
- package/src/components/pill-composer-builder.ts +6 -6
- package/src/components/reasoning-bubble.ts +1 -13
- package/src/components/registry.ts +38 -3
- package/src/components/tool-bubble.ts +1 -13
- package/src/defaults.ts +1 -0
- package/src/generated/runtype-openapi-contract.ts +55 -3
- package/src/index-core.ts +20 -1
- package/src/index.ts +8 -0
- package/src/markdown-parsers-loader.test.ts +158 -0
- package/src/markdown-parsers-loader.ts +74 -9
- package/src/runtime/host-layout.test.ts +163 -0
- package/src/runtime/host-layout.ts +110 -7
- package/src/runtime/init.ts +18 -61
- package/src/session.ts +76 -22
- package/src/styles/widget.css +773 -26
- package/src/theme-editor/preview.ts +2 -0
- package/src/theme-editor/sections.test.ts +26 -1
- package/src/theme-editor/sections.ts +10 -2
- package/src/theme-reference.ts +2 -2
- package/src/tool-call-display-defaults.test.ts +1 -0
- package/src/types/theme.ts +77 -0
- package/src/types.ts +516 -17
- package/src/ui.artifact-pane-gating.test.ts +636 -0
- package/src/ui.component-directive.test.ts +104 -0
- package/src/ui.composer-bar.test.ts +60 -2
- package/src/ui.detached-panel.test.ts +1049 -0
- package/src/ui.tool-display.test.ts +51 -0
- package/src/ui.ts +698 -109
- package/src/utils/artifact-custom-actions.ts +128 -0
- package/src/utils/artifact-display.test.ts +42 -0
- package/src/utils/artifact-display.ts +84 -0
- package/src/utils/artifact-file.test.ts +116 -0
- package/src/utils/artifact-file.ts +117 -0
- package/src/utils/artifact-gate.test.ts +112 -5
- package/src/utils/artifact-gate.ts +39 -14
- package/src/utils/artifact-loading-status.ts +55 -0
- package/src/utils/artifact-status-label.ts +190 -0
- package/src/utils/buttons.ts +7 -1
- package/src/utils/code-highlight.test.ts +186 -0
- package/src/utils/code-highlight.ts +400 -0
- package/src/utils/icons.ts +2 -0
- package/src/utils/roving-tablist.test.ts +152 -0
- package/src/utils/roving-tablist.ts +111 -0
- package/src/utils/spinner.ts +45 -0
- package/src/utils/theme.test.ts +48 -0
- package/src/utils/theme.ts +7 -0
- package/src/utils/tokens.ts +91 -0
- package/src/utils/tool-loading-animation.test.ts +32 -0
- package/src/utils/tool-loading-animation.ts +24 -0
- package/dist/chunk-DFBSCFYN.js +0 -1
- package/dist/runtype-tts-entry-HFUV2UF7.js +0 -1
- package/dist/session-reconnect-U77QFUR7.js +0 -1
package/dist/install.global.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var SiteAgentInstaller=(()=>{var L=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var
|
|
1
|
+
"use strict";var SiteAgentInstaller=(()=>{var L=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var J=Object.prototype.hasOwnProperty;var Q=(c,s,m,r)=>{if(s&&typeof s=="object"||typeof s=="function")for(let i of H(s))!J.call(c,i)&&i!==m&&L(c,i,{get:()=>s[i],enumerable:!(r=O(s,i))||r.enumerable});return c};var N=c=>Q(L({},"__esModule",{value:!0}),c);var K={};(function(){"use strict";if(window.__siteAgentInstallerLoaded)return;window.__siteAgentInstallerLoaded=!0;let s=(()=>{let t=document.currentScript;if(!t)return{};let e={},n=t.getAttribute("data-config");if(n)try{let w=n.replace(/[\r\n]+\s*/g,""),h=JSON.parse(w);if(h.config){let{__proto__:z,constructor:G,prototype:V,...D}=h;Object.assign(e,D)}else e.config=h}catch(w){console.error("Failed to parse data-config JSON:",w)}let o=t.getAttribute("data-runtype-token");o&&(e.clientToken=o);let a=t.getAttribute("data-flow-id");a&&(e.flowId=a);let l=t.getAttribute("data-agent-id");l&&(e.agentId=l);let u=t.getAttribute("data-api-url");u&&(e.apiUrl=u);let I=t.getAttribute("data-preview-param");return I&&(e.previewQueryParam=I),e})(),r={...window.siteAgentConfig||{},...s},i=(t,e)=>{try{t?.(e)}catch(n){console.error("[Persona] lifecycle callback threw:",n)}},d=(t,e)=>{try{window.dispatchEvent(new CustomEvent(t,{detail:e}))}catch{}},f=(t,e)=>{console.error("Failed to install AgentWidget:",e),i(r.onError,{phase:t,error:e}),d("persona:error",{phase:t,error:e})},y=t=>{let e=t.launcher??{};return e.enabled===!1?!1:(e.mountMode??"floating")==="floating"};if(i(r.onScriptLoad,{version:r.version||"latest"}),d("persona:script-load",{version:r.version||"latest"}),!(()=>{if(!r.previewQueryParam)return!0;let e=new URLSearchParams(window.location.search).get(r.previewQueryParam);return e!==null&&e!==""&&e.toLowerCase()!=="false"&&e!=="0"})())return;let U=r.version||"latest",P=r.cdn||"jsdelivr",E=r.autoInit!==!1,j=()=>{if(r.cssUrl&&r.jsUrl){let o=r.jsUrl.replace(/index\.global\.js($|\?)/,"launcher.global.js$1");return{cssUrl:r.cssUrl,jsUrl:r.jsUrl,launcherUrl:o!==r.jsUrl?o:null}}let e=`/npm/@runtypelabs/persona@${U}/dist`,n=P==="unpkg"?"https://unpkg.com":"https://cdn.jsdelivr.net";return{cssUrl:`${n}${e}/widget.css`,jsUrl:`${n}${e}/index.global.js`,launcherUrl:`${n}${e}/launcher.global.js`}},{cssUrl:b,jsUrl:g,launcherUrl:p}=j(),T=()=>!!document.head.querySelector("link[data-persona]")||!!document.head.querySelector('link[href*="widget.css"]'),k=()=>!!window.AgentWidget,W=t=>{let e=!1,n=()=>{e||(e=!0,t())},o=()=>{typeof requestIdleCallback<"u"?requestIdleCallback(()=>{requestAnimationFrame(()=>{requestAnimationFrame(n)})},{timeout:3e3}):setTimeout(n,300)};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",o):o()},A=()=>new Promise((t,e)=>{if(T()){t();return}let n=document.createElement("link");n.rel="stylesheet",n.href=b,n.setAttribute("data-persona","true"),n.onload=()=>t(),n.onerror=()=>e(new Error(`Failed to load CSS from ${b}`)),document.head.appendChild(n)}),C=()=>new Promise((t,e)=>{if(k()){t();return}let n=document.createElement("script");n.src=g,n.async=!0,n.onload=()=>t(),n.onerror=()=>e(new Error(`Failed to load JS from ${g}`)),document.head.appendChild(n)}),$=()=>!!window.AgentWidgetLauncher,F=()=>new Promise((t,e)=>{if($()||!p){t();return}let n=document.createElement("script");n.src=p,n.async=!0,n.onload=()=>t(),n.onerror=()=>e(new Error(`Failed to load launcher from ${p}`)),document.head.appendChild(n)}),M=()=>{let t=()=>{if(!k()){let n=document.createElement("link");n.rel="prefetch",n.as="script",n.href=g,document.head.appendChild(n)}let e=g.replace(/index\.global\.js($|\?)/,"markdown-parsers.js$1");if(e!==g){let n=document.createElement("link");n.rel="prefetch",n.as="script",n.href=e,document.head.appendChild(n)}};typeof requestIdleCallback<"u"?requestIdleCallback(t,{timeout:4e3}):setTimeout(t,1200)},v=()=>{let t=r.target||"body",e={...r.config};r.apiUrl&&!e.apiUrl&&(e.apiUrl=r.apiUrl),r.clientToken&&!e.clientToken&&(e.clientToken=r.clientToken),r.flowId&&!e.flowId&&(e.flowId=r.flowId),r.agentId&&!e.agentId&&(e.agentId=r.agentId);let n=!!(e.apiUrl||e.clientToken);return{target:t,widgetConfig:e,hasApiConfig:n}},S=(t=!1)=>{if(!window.AgentWidget||!window.AgentWidget.initAgentWidget){console.warn("AgentWidget not available. Make sure the script loaded successfully.");return}let{target:e,widgetConfig:n,hasApiConfig:o}=v();if(!(!o&&Object.keys(n).length===0)){!n.postprocessMessage&&window.AgentWidget.markdownPostprocessor&&(n.postprocessMessage=({text:a})=>window.AgentWidget.markdownPostprocessor(a));try{let a=window.AgentWidget.initAgentWidget({target:e,config:n,useShadowDom:r.useShadowDom??!1,windowKey:r.windowKey});return t&&a&&typeof a.open=="function"&&a.open(),!t&&y(n)&&(i(r.onLauncherShown,{deferred:!1}),d("persona:launcher-shown",{deferred:!1})),i(r.onChatReady,a),d("persona:chat-ready",a),a}catch(a){f("init",a)}}},_=t=>{let e=t.persistState;if(!e)return!1;let n=typeof e=="object"?e:null;if(n&&n.persist?.openState===!1)return!1;let o=n&&n.keyPrefix||"persona-",a=n&&n.storage||"session";try{return(a==="local"?window.localStorage:window.sessionStorage).getItem(`${o}widget-open`)==="true"}catch{return!1}},x=t=>!(!p||!y(t)||(t.launcher??{}).autoExpand===!0||typeof t.onStateLoaded=="function"||_(t)),q=(t,e)=>{let n="idle",o,a=()=>{n==="idle"&&(n="loading",C().then(()=>{S(!0),o?.destroy(),n="done"}).catch(u=>{n="idle",console.error("Failed to load AgentWidget on open:",u),i(r.onError,{phase:"bundle",error:u}),d("persona:error",{phase:"bundle",error:u})}))},l=window.AgentWidgetLauncher.mount({target:t,config:e,onOpen:a});o=l,i(r.onLauncherShown,{deferred:!0,element:l.element}),d("persona:launcher-shown",{deferred:!0,element:l.element}),M()};W(async()=>{try{let t=E&&(r.config||r.apiUrl||r.clientToken);if(t){let{target:e,widgetConfig:n}=v();if(x(n))try{if(await Promise.all([A(),F()]),window.AgentWidgetLauncher&&window.AgentWidgetLauncher.mount){q(e,n);return}}catch(o){console.warn("Deferred launcher failed; falling back to eager load.",o)}}try{await A()}catch(e){return f("css",e)}try{await C()}catch(e){return f("bundle",e)}t&&setTimeout(()=>S(!1),0)}catch(t){f("init",t)}})})();return N(K);})();
|
|
2
2
|
//# sourceMappingURL=install.global.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/install.ts"],"sourcesContent":["/**\n * Standalone installer script for easy script tag installation\n * This script automatically loads CSS and JS, then initializes the widget\n * if configuration is provided via window.siteAgentConfig\n */\n\nexport {};\n\ninterface SiteAgentInstallConfig {\n version?: string;\n cdn?: \"unpkg\" | \"jsdelivr\";\n cssUrl?: string;\n jsUrl?: string;\n target?: string | HTMLElement;\n config?: any;\n autoInit?: boolean;\n // Client token mode options (can also be set via data attributes)\n clientToken?: string;\n flowId?: string;\n agentId?: string;\n apiUrl?: string;\n // Optional query param key that gates widget installation in preview mode\n previewQueryParam?: string;\n // Shadow DOM option (defaults to false for better CSS compatibility)\n useShadowDom?: boolean;\n // Expose the widget handle on window[windowKey] for programmatic access\n windowKey?: string;\n /**\n * Fired as soon as the installer script executes, before it loads or gates\n * anything. For diagnostics / load-timing baselines (\"did my embed run\").\n */\n onScriptLoad?: (info: { version: string }) => void;\n /**\n * Fired when the floating launcher is painted on the page: at page-load time.\n * Deferred installs: the critical launcher mounts. Eager floating installs:\n * the full widget's launcher mounts. Use this for \"widget appeared\" analytics.\n * Does NOT fire for inline / docked / composer-bar installs (no floating\n * launcher): use `onChatReady` there.\n */\n onLauncherShown?: (info: { deferred: boolean; element?: HTMLElement }) => void;\n /**\n * Fired when the full widget is initialized and its controller API is\n * callable. Deferred installs: after the user first opens the panel. Eager\n * installs: on page load.\n */\n onChatReady?: (handle: any) => void;\n /**\n * Fired when a load step fails (stylesheet, full bundle, or init), so you can\n * detect ad-blocked / timed-out installs instead of failing silently.\n */\n onError?: (info: { phase: \"css\" | \"bundle\" | \"init\"; error: unknown }) => void;\n}\n\ndeclare global {\n interface Window {\n siteAgentConfig?: SiteAgentInstallConfig;\n AgentWidget?: any;\n AgentWidgetLauncher?: any;\n }\n}\n\n(function() {\n \"use strict\";\n\n // Prevent double installation\n if ((window as any).__siteAgentInstallerLoaded) {\n return;\n }\n (window as any).__siteAgentInstallerLoaded = true;\n\n /**\n * Read configuration from data attributes on the current script tag.\n * Supports: data-config (JSON), data-runtype-token, data-flow-id, data-agent-id, data-api-url\n */\n const getConfigFromScript = (): Partial<SiteAgentInstallConfig> => {\n // Try to get the current script element\n const script = document.currentScript as HTMLScriptElement | null;\n if (!script) return {};\n\n const scriptConfig: Partial<SiteAgentInstallConfig> = {};\n\n // Full config from data-config attribute (JSON string)\n const configJson = script.getAttribute('data-config');\n if (configJson) {\n try {\n // HTML attributes preserve literal newlines/tabs which are invalid\n // control characters inside JSON string literals: strip them.\n const normalizedJson = configJson.replace(/[\\r\\n]+\\s*/g, '');\n const parsedConfig = JSON.parse(normalizedJson);\n // If it has nested 'config' property, use it; otherwise treat as widget config\n if (parsedConfig.config) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { __proto__: _a, constructor: _b, prototype: _c, ...safeConfig } = parsedConfig;\n Object.assign(scriptConfig, safeConfig);\n } else {\n // Treat the entire object as widget config\n scriptConfig.config = parsedConfig;\n }\n } catch (e) {\n console.error(\"Failed to parse data-config JSON:\", e);\n }\n }\n\n // Client token from data attribute (primary method for client token mode)\n const token = script.getAttribute('data-runtype-token');\n if (token) {\n scriptConfig.clientToken = token;\n }\n\n // Optional flow ID\n const flowId = script.getAttribute('data-flow-id');\n if (flowId) {\n scriptConfig.flowId = flowId;\n }\n\n // Optional agent ID\n const agentId = script.getAttribute('data-agent-id');\n if (agentId) {\n scriptConfig.agentId = agentId;\n }\n\n // Optional API URL override\n const apiUrl = script.getAttribute('data-api-url');\n if (apiUrl) {\n scriptConfig.apiUrl = apiUrl;\n }\n\n // Optional preview query param gate\n const previewQueryParam = script.getAttribute('data-preview-param');\n if (previewQueryParam) {\n scriptConfig.previewQueryParam = previewQueryParam;\n }\n\n return scriptConfig;\n };\n\n // Get config from script attributes (must be called synchronously during script execution)\n const scriptConfig = getConfigFromScript();\n\n // Merge script attributes with window config (script attributes take precedence)\n const windowConfig: SiteAgentInstallConfig = window.siteAgentConfig || {};\n const config: SiteAgentInstallConfig = { ...windowConfig, ...scriptConfig };\n\n // --- Lifecycle helpers -----------------------------------------------------\n // A throwing user callback must never break the installer.\n const safeCall = <T>(fn: ((arg: T) => void) | undefined, arg: T): void => {\n try {\n fn?.(arg);\n } catch (e) {\n console.error(\"[Persona] lifecycle callback threw:\", e);\n }\n };\n const dispatchLifecycle = (name: string, detail: unknown): void => {\n try {\n window.dispatchEvent(new CustomEvent(name, { detail }));\n } catch {\n /* CustomEvent unsupported: ignore */\n }\n };\n const fail = (phase: \"css\" | \"bundle\" | \"init\", error: unknown): void => {\n console.error(\"Failed to install AgentWidget:\", error);\n safeCall(config.onError, { phase, error });\n dispatchLifecycle(\"persona:error\", { phase, error });\n };\n // True when the config renders a standard floating launcher button: the only\n // case that paints a clickable launcher at load. Shared by the deferral gate\n // and the eager-path `onLauncherShown` so the event name stays honest.\n const hasFloatingLauncher = (widgetConfig: any): boolean => {\n const launcher = widgetConfig.launcher ?? {};\n if (launcher.enabled === false) return false; // inline embed\n return (launcher.mountMode ?? \"floating\") === \"floating\"; // not docked / composer-bar\n };\n\n // Earliest signal: the installer has executed. Fire before any loading or\n // preview-gating so it's a reliable \"did my embed run\" beacon for diagnostics.\n safeCall(config.onScriptLoad, { version: config.version || \"latest\" });\n dispatchLifecycle(\"persona:script-load\", { version: config.version || \"latest\" });\n\n const isPreviewModeEnabled = (): boolean => {\n if (!config.previewQueryParam) {\n return true;\n }\n\n const params = new URLSearchParams(window.location.search);\n const value = params.get(config.previewQueryParam);\n return value !== null && value !== \"\" && value.toLowerCase() !== \"false\" && value !== \"0\";\n };\n\n if (!isPreviewModeEnabled()) {\n return;\n }\n \n const version = config.version || \"latest\";\n const cdn = config.cdn || \"jsdelivr\";\n const autoInit = config.autoInit !== false; // Default to true\n\n // Determine CDN base URL\n const getCdnBase = () => {\n // For a custom URL override, derive the sibling launcher URL when the\n // override mirrors the dist layout (…/index.global.js → …/launcher.global.js)\n // so self-hosted deployments still get the optimization. A non-standard\n // jsUrl yields null → eager-load fallback.\n if (config.cssUrl && config.jsUrl) {\n const derivedLauncherUrl = config.jsUrl.replace(/index\\.global\\.js($|\\?)/, \"launcher.global.js$1\");\n return {\n cssUrl: config.cssUrl,\n jsUrl: config.jsUrl,\n launcherUrl: (derivedLauncherUrl !== config.jsUrl ? derivedLauncherUrl : null) as string | null,\n };\n }\n\n const packageName = \"@runtypelabs/persona\";\n const basePath = `/npm/${packageName}@${version}/dist`;\n const host = cdn === \"unpkg\" ? \"https://unpkg.com\" : \"https://cdn.jsdelivr.net\";\n\n return {\n cssUrl: `${host}${basePath}/widget.css`,\n jsUrl: `${host}${basePath}/index.global.js`,\n launcherUrl: `${host}${basePath}/launcher.global.js` as string | null,\n };\n };\n\n const { cssUrl, jsUrl, launcherUrl } = getCdnBase();\n\n // Check if CSS is already loaded\n const isCssLoaded = () => {\n return !!document.head.querySelector('link[data-persona]') ||\n !!document.head.querySelector(`link[href*=\"widget.css\"]`);\n };\n\n // Check if JS is already loaded\n const isJsLoaded = () => {\n return !!(window as any).AgentWidget;\n };\n\n /**\n * Wait for framework hydration to complete (Next.js, Nuxt, etc.)\n * This prevents the framework from removing dynamically added CSS during reconciliation.\n * Uses requestIdleCallback + double requestAnimationFrame for reliable detection.\n */\n const waitForHydration = (callback: () => void): void => {\n let executed = false;\n \n const execute = () => {\n if (executed) return;\n executed = true;\n callback();\n };\n\n const afterDom = () => {\n // Strategy 1: Use requestIdleCallback if available (best for detecting idle after hydration)\n if (typeof requestIdleCallback !== 'undefined') {\n requestIdleCallback(() => {\n // Double requestAnimationFrame ensures at least one full paint cycle completed\n requestAnimationFrame(() => {\n requestAnimationFrame(execute);\n });\n }, { timeout: 3000 }); // Max wait 3 seconds, then proceed anyway\n } else {\n // Strategy 2: Fallback for Safari (no requestIdleCallback)\n // 300ms is typically enough for hydration on most pages\n setTimeout(execute, 300);\n }\n };\n\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', afterDom);\n } else {\n // DOM already ready, but still wait for potential hydration\n afterDom();\n }\n };\n\n // Load CSS\n const loadCSS = (): Promise<void> => {\n return new Promise((resolve, reject) => {\n if (isCssLoaded()) {\n resolve();\n return;\n }\n\n const link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = cssUrl;\n link.setAttribute(\"data-persona\", \"true\");\n \n link.onload = () => resolve();\n link.onerror = () => reject(new Error(`Failed to load CSS from ${cssUrl}`));\n document.head.appendChild(link);\n });\n };\n\n // Load JS\n const loadJS = (): Promise<void> => {\n return new Promise((resolve, reject) => {\n if (isJsLoaded()) {\n resolve();\n return;\n }\n\n const script = document.createElement(\"script\");\n script.src = jsUrl;\n script.async = true;\n script.onload = () => resolve();\n script.onerror = () => reject(new Error(`Failed to load JS from ${jsUrl}`));\n document.head.appendChild(script);\n });\n };\n\n // Load the tiny launcher-only critical bundle (launcher.global.js)\n const isLauncherLoaded = () => !!window.AgentWidgetLauncher;\n\n const loadLauncher = (): Promise<void> => {\n return new Promise((resolve, reject) => {\n if (isLauncherLoaded() || !launcherUrl) {\n resolve();\n return;\n }\n\n const script = document.createElement(\"script\");\n script.src = launcherUrl;\n script.async = true;\n script.onload = () => resolve();\n script.onerror = () => reject(new Error(`Failed to load launcher from ${launcherUrl}`));\n document.head.appendChild(script);\n });\n };\n\n // Warm the full bundle in the background (download-only, not executed) so the\n // first open is quick. Runs at idle so it never competes with the launcher.\n const prefetchFullBundle = (): void => {\n const addPrefetch = () => {\n if (!isJsLoaded()) {\n const link = document.createElement(\"link\");\n link.rel = \"prefetch\";\n link.as = \"script\";\n link.href = jsUrl;\n document.head.appendChild(link);\n }\n\n // Also prefetch the markdown parsers chunk\n const markdownUrl = jsUrl.replace(/index\\.global\\.js($|\\?)/, \"markdown-parsers.js$1\");\n if (markdownUrl !== jsUrl) {\n const link2 = document.createElement(\"link\");\n link2.rel = \"prefetch\";\n link2.as = \"script\";\n link2.href = markdownUrl;\n document.head.appendChild(link2);\n }\n };\n if (typeof requestIdleCallback !== \"undefined\") {\n requestIdleCallback(addPrefetch, { timeout: 4000 });\n } else {\n setTimeout(addPrefetch, 1200);\n }\n };\n\n // Merge top-level installer options into the widget config. Shared by the\n // eager init path and the deferred-launcher path.\n const buildWidgetInit = (): { target: string | HTMLElement; widgetConfig: any; hasApiConfig: boolean } => {\n const target = config.target || \"body\";\n const widgetConfig: any = { ...config.config };\n\n if (config.apiUrl && !widgetConfig.apiUrl) widgetConfig.apiUrl = config.apiUrl;\n if (config.clientToken && !widgetConfig.clientToken) widgetConfig.clientToken = config.clientToken;\n if (config.flowId && !widgetConfig.flowId) widgetConfig.flowId = config.flowId;\n if (config.agentId && !widgetConfig.agentId) widgetConfig.agentId = config.agentId;\n\n const hasApiConfig = !!(widgetConfig.apiUrl || widgetConfig.clientToken);\n return { target, widgetConfig, hasApiConfig };\n };\n\n // Initialize the full widget. When `openAfter` is true (the deferred-launcher\n // handoff), open the panel immediately via the public controller API so the\n // user's click on the critical launcher carries through.\n const initWidget = (openAfter = false): any => {\n if (!window.AgentWidget || !window.AgentWidget.initAgentWidget) {\n console.warn(\"AgentWidget not available. Make sure the script loaded successfully.\");\n return;\n }\n\n const { target, widgetConfig, hasApiConfig } = buildWidgetInit();\n\n // Only initialize if we have either apiUrl OR clientToken (or other config)\n if (!hasApiConfig && Object.keys(widgetConfig).length === 0) {\n return;\n }\n\n // Auto-apply markdown postprocessor if not explicitly set and available\n if (!widgetConfig.postprocessMessage && window.AgentWidget.markdownPostprocessor) {\n widgetConfig.postprocessMessage = ({ text }: { text: string }) =>\n window.AgentWidget.markdownPostprocessor(text);\n }\n\n try {\n const handle = window.AgentWidget.initAgentWidget({\n target,\n config: widgetConfig,\n // Explicitly disable shadow DOM for better CSS compatibility with host page\n useShadowDom: config.useShadowDom ?? false,\n windowKey: config.windowKey\n });\n\n // Handoff from the critical launcher: the user already clicked, so open\n // the panel via the existing public controller method.\n if (openAfter && handle && typeof handle.open === \"function\") {\n handle.open();\n }\n\n // Eager floating installs paint their launcher at load time too: emit the\n // same page-load \"appeared\" signal as the deferred path. The deferred\n // handoff (openAfter) already fired it at launcher mount, and non-floating\n // modes have no launcher, so guard on both.\n if (!openAfter && hasFloatingLauncher(widgetConfig)) {\n safeCall(config.onLauncherShown, { deferred: false });\n dispatchLifecycle(\"persona:launcher-shown\", { deferred: false });\n }\n\n // The full widget is initialized and its controller API is callable.\n safeCall(config.onChatReady, handle);\n dispatchLifecycle(\"persona:chat-ready\", handle);\n return handle;\n } catch (error) {\n fail(\"init\", error);\n }\n };\n\n // A persisted \"open\" state reopens the panel on reload with no click\n // (ui.ts:7513). The installer can't see that from config, so it reads the very\n // same storage key the widget writes. Mirrors normalizePersistStateConfig\n // (ui.ts:213): openState persistence defaults on, storage to sessionStorage,\n // key prefix to \"persona-\".\n const hasPersistedOpenState = (widgetConfig: any): boolean => {\n const persistState = widgetConfig.persistState;\n if (!persistState) return false; // persistence off → nothing to restore\n const asObject = typeof persistState === \"object\" ? persistState : null;\n if (asObject && asObject.persist?.openState === false) return false; // open-state persistence opted out\n const keyPrefix = (asObject && asObject.keyPrefix) || \"persona-\";\n const storageType = (asObject && asObject.storage) || \"session\";\n try {\n const storage = storageType === \"local\" ? window.localStorage : window.sessionStorage;\n return storage.getItem(`${keyPrefix}widget-open`) === \"true\";\n } catch {\n return false; // storage blocked (private mode) → the widget can't restore either\n }\n };\n\n // The deferred-launcher optimization only applies to the common floating case\n // that paints a collapsed launcher and waits for a click. Anything that starts\n // open or renders differently eager-loads the full bundle exactly as before: // including the two open triggers config alone can't express: a host\n // onStateLoaded hook that may request open, and a restored \"was open\" state.\n const shouldDeferPanel = (widgetConfig: any): boolean => {\n if (!launcherUrl) return false; // custom bundle URL override: can't derive launcher URL\n if (!hasFloatingLauncher(widgetConfig)) return false; // inline / docked / composer-bar\n const launcher = widgetConfig.launcher ?? {};\n if (launcher.autoExpand === true) return false; // starts open\n if (typeof widgetConfig.onStateLoaded === \"function\") return false; // hook may request open\n if (hasPersistedOpenState(widgetConfig)) return false; // restored \"was open\"\n return true;\n };\n\n // Render the real launcher from the tiny critical bundle; load + mount the\n // full widget on first click, then remove the critical launcher.\n const mountDeferredLauncher = (target: string | HTMLElement, widgetConfig: any): void => {\n let phase: \"idle\" | \"loading\" | \"done\" = \"idle\";\n let launcherHandle: { destroy: () => void } | undefined;\n\n const onOpen = () => {\n if (phase !== \"idle\") return; // already loading or handed off\n phase = \"loading\";\n loadJS()\n .then(() => {\n initWidget(true); // mount the full widget + open the panel\n launcherHandle?.destroy(); // remove the critical launcher (same component → invisible)\n phase = \"done\";\n })\n .catch((error) => {\n phase = \"idle\"; // allow the click to be retried\n console.error(\"Failed to load AgentWidget on open:\", error);\n safeCall(config.onError, { phase: \"bundle\", error });\n dispatchLifecycle(\"persona:error\", { phase: \"bundle\", error });\n });\n };\n\n const mounted = window.AgentWidgetLauncher.mount({ target, config: widgetConfig, onOpen });\n launcherHandle = mounted;\n\n // The real launcher is now painted at page-load time: emit the page-load\n // \"appeared\" signal (distinct from `onChatReady`, which waits for first open).\n safeCall(config.onLauncherShown, { deferred: true, element: mounted.element });\n dispatchLifecycle(\"persona:launcher-shown\", { deferred: true, element: mounted.element });\n\n // Warm the full bundle so the first open is quick.\n prefetchFullBundle();\n };\n\n // Main installation flow (called after hydration completes)\n const install = async () => {\n try {\n // Auto-init if we have config OR apiUrl OR clientToken\n const shouldAutoInit = autoInit && (\n config.config ||\n config.apiUrl ||\n config.clientToken\n );\n\n // Fast path: render the real launcher from the ~13 KB critical bundle and\n // defer the full widget until first open. Only for the common floating\n // case; everything else falls through to the eager path below.\n if (shouldAutoInit) {\n const { target, widgetConfig } = buildWidgetInit();\n if (shouldDeferPanel(widgetConfig)) {\n try {\n // CSS + launcher in parallel so the launcher paints correctly styled.\n await Promise.all([loadCSS(), loadLauncher()]);\n if (window.AgentWidgetLauncher && window.AgentWidgetLauncher.mount) {\n mountDeferredLauncher(target, widgetConfig);\n return;\n }\n } catch (error) {\n console.warn(\"Deferred launcher failed; falling back to eager load.\", error);\n }\n // Fall through to the eager path on any failure.\n }\n }\n\n // Eager path (unchanged behavior): load the full bundle, then init.\n try {\n await loadCSS();\n } catch (error) {\n return fail(\"css\", error);\n }\n try {\n await loadJS();\n } catch (error) {\n return fail(\"bundle\", error);\n }\n if (shouldAutoInit) {\n // Wait a tick to ensure AgentWidget is fully initialized\n setTimeout(() => initWidget(false), 0);\n }\n } catch (error) {\n // Safety net for anything unexpected before the eager loads above.\n fail(\"init\", error);\n }\n };\n\n // Start installation after hydration completes\n // This prevents Next.js/Nuxt/etc. from removing dynamically added CSS\n waitForHydration(install);\n})();\n\n"],"mappings":"4YAAA,IAAAA,EAAA,IA6DC,UAAW,CACV,aAGA,GAAK,OAAe,2BAClB,OAED,OAAe,2BAA6B,GAqE7C,IAAMC,GA/DsB,IAAuC,CAEjE,IAAMC,EAAS,SAAS,cACxB,GAAI,CAACA,EAAQ,MAAO,CAAC,EAErB,IAAMD,EAAgD,CAAC,EAGjDE,EAAaD,EAAO,aAAa,aAAa,EACpD,GAAIC,EACF,GAAI,CAGF,IAAMC,EAAiBD,EAAW,QAAQ,cAAe,EAAE,EACrDE,EAAe,KAAK,MAAMD,CAAc,EAE9C,GAAIC,EAAa,OAAQ,CAEvB,GAAM,CAAE,UAAWC,EAAI,YAAaC,EAAI,UAAWC,EAAI,GAAGC,CAAW,EAAIJ,EACzE,OAAO,OAAOJ,EAAcQ,CAAU,CACxC,MAEER,EAAa,OAASI,CAE1B,OAASK,EAAG,CACV,QAAQ,MAAM,oCAAqCA,CAAC,CACtD,CAIF,IAAMC,EAAQT,EAAO,aAAa,oBAAoB,EAClDS,IACFV,EAAa,YAAcU,GAI7B,IAAMC,EAASV,EAAO,aAAa,cAAc,EAC7CU,IACFX,EAAa,OAASW,GAIxB,IAAMC,EAAUX,EAAO,aAAa,eAAe,EAC/CW,IACFZ,EAAa,QAAUY,GAIzB,IAAMC,EAASZ,EAAO,aAAa,cAAc,EAC7CY,IACFb,EAAa,OAASa,GAIxB,IAAMC,EAAoBb,E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O,QAAS,CAAE,MAAO,SAAU,MAAAS,CAAM,CAAC,EACnDL,EAAkB,gBAAiB,CAAE,MAAO,SAAU,MAAAK,CAAM,CAAC,CAC/D,CAAC,EACL,EAEMiD,EAAU,OAAO,oBAAoB,MAAM,CAAE,OAAAf,EAAQ,OAAQhC,EAAc,OAAA8C,CAAO,CAAC,EACzFD,EAAiBE,EAIjBzD,EAASD,EAAO,gBAAiB,CAAE,SAAU,GAAM,QAAS0D,EAAQ,OAAQ,CAAC,EAC7EtD,EAAkB,yBAA0B,CAAE,SAAU,GAAM,QAASsD,EAAQ,OAAQ,CAAC,EAGxFpB,EAAmB,CACrB,EAuDAZ,EApDgB,SAAY,CAC1B,GAAI,CAEF,IAAMiC,EAAiB3C,IACrBhB,EAAO,QACPA,EAAO,QACPA,EAAO,aAMT,GAAI2D,EAAgB,CAClB,GAAM,CAAE,OAAAhB,EAAQ,aAAAhC,CAAa,EAAI+B,EAAgB,EACjD,GAAIY,EAAiB3C,CAAY,EAC/B,GAAI,CAGF,GADA,MAAM,QAAQ,IAAI,CAACoB,EAAQ,EAAGM,EAAa,CAAC,CAAC,EACzC,OAAO,qBAAuB,OAAO,oBAAoB,MAAO,CAClEkB,EAAsBZ,EAAQhC,CAAY,EAC1C,MACF,CACF,OAASF,EAAO,CACd,QAAQ,KAAK,wDAAyDA,CAAK,CAC7E,CAGJ,CAGA,GAAI,CACF,MAAMsB,EAAQ,CAChB,OAAStB,EAAO,CACd,OAAOF,EAAK,MAAOE,CAAK,CAC1B,CACA,GAAI,CACF,MAAM0B,EAAO,CACf,OAAS1B,EAAO,CACd,OAAOF,EAAK,SAAUE,CAAK,CAC7B,CACIkD,GAEF,WAAW,IAAMd,EAAW,EAAK,EAAG,CAAC,CAEzC,OAASpC,EAAO,CAEdF,EAAK,OAAQE,CAAK,CACpB,CACF,CAIwB,CAC1B,GAAG","names":["install_exports","scriptConfig","script","configJson","normalizedJson","parsedConfig","_a","_b","_c","safeConfig","e","token","flowId","agentId","apiUrl","previewQueryParam","config","safeCall","fn","arg","dispatchLifecycle","name","detail","fail","phase","error","hasFloatingLauncher","widgetConfig","launcher","value","version","cdn","autoInit","getCdnBase","derivedLauncherUrl","basePath","host","cssUrl","jsUrl","launcherUrl","isCssLoaded","isJsLoaded","waitForHydration","callback","executed","execute","afterDom","loadCSS","resolve","reject","link","loadJS","isLauncherLoaded","loadLauncher","prefetchFullBundle","addPrefetch","markdownUrl","link2","buildWidgetInit","target","hasApiConfig","initWidget","openAfter","text","handle","hasPersistedOpenState","persistState","asObject","keyPrefix","storageType","shouldDeferPanel","mountDeferredLauncher","launcherHandle","onOpen","mounted","shouldAutoInit"]}
|
|
1
|
+
{"version":3,"sources":["../src/install.ts"],"sourcesContent":["/**\n * Standalone installer script for easy script tag installation\n * This script automatically loads CSS and JS, then initializes the widget\n * if configuration is provided via window.siteAgentConfig\n */\n\nexport {};\n\ninterface SiteAgentInstallConfig {\n version?: string;\n cdn?: \"unpkg\" | \"jsdelivr\";\n cssUrl?: string;\n jsUrl?: string;\n target?: string | HTMLElement;\n config?: any;\n autoInit?: boolean;\n // Client token mode options (can also be set via data attributes)\n clientToken?: string;\n flowId?: string;\n agentId?: string;\n apiUrl?: string;\n // Optional query param key that gates widget installation in preview mode\n previewQueryParam?: string;\n // Shadow DOM option (defaults to false for better CSS compatibility)\n useShadowDom?: boolean;\n // Expose the widget handle on window[windowKey] for programmatic access\n windowKey?: string;\n /**\n * Fired as soon as the installer script executes, before it loads or gates\n * anything. For diagnostics / load-timing baselines (\"did my embed run\").\n */\n onScriptLoad?: (info: { version: string }) => void;\n /**\n * Fired when the floating launcher is painted on the page: at page-load time.\n * Deferred installs: the critical launcher mounts. Eager floating installs:\n * the full widget's launcher mounts. Use this for \"widget appeared\" analytics.\n * Does NOT fire for inline / docked / composer-bar installs (no floating\n * launcher): use `onChatReady` there.\n */\n onLauncherShown?: (info: { deferred: boolean; element?: HTMLElement }) => void;\n /**\n * Fired when the full widget is initialized and its controller API is\n * callable. Deferred installs: after the user first opens the panel. Eager\n * installs: on page load.\n */\n onChatReady?: (handle: any) => void;\n /**\n * Fired when a load step fails (stylesheet, full bundle, or init), so you can\n * detect ad-blocked / timed-out installs instead of failing silently.\n */\n onError?: (info: { phase: \"css\" | \"bundle\" | \"init\"; error: unknown }) => void;\n}\n\ndeclare global {\n interface Window {\n siteAgentConfig?: SiteAgentInstallConfig;\n AgentWidget?: any;\n AgentWidgetLauncher?: any;\n }\n}\n\n(function() {\n \"use strict\";\n\n // Prevent double installation\n if ((window as any).__siteAgentInstallerLoaded) {\n return;\n }\n (window as any).__siteAgentInstallerLoaded = true;\n\n /**\n * Read configuration from data attributes on the current script tag.\n * Supports: data-config (JSON), data-runtype-token, data-flow-id, data-agent-id, data-api-url\n */\n const getConfigFromScript = (): Partial<SiteAgentInstallConfig> => {\n // Try to get the current script element\n const script = document.currentScript as HTMLScriptElement | null;\n if (!script) return {};\n\n const scriptConfig: Partial<SiteAgentInstallConfig> = {};\n\n // Full config from data-config attribute (JSON string)\n const configJson = script.getAttribute('data-config');\n if (configJson) {\n try {\n // HTML attributes preserve literal newlines/tabs which are invalid\n // control characters inside JSON string literals: strip them.\n const normalizedJson = configJson.replace(/[\\r\\n]+\\s*/g, '');\n const parsedConfig = JSON.parse(normalizedJson);\n // If it has nested 'config' property, use it; otherwise treat as widget config\n if (parsedConfig.config) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { __proto__: _a, constructor: _b, prototype: _c, ...safeConfig } = parsedConfig;\n Object.assign(scriptConfig, safeConfig);\n } else {\n // Treat the entire object as widget config\n scriptConfig.config = parsedConfig;\n }\n } catch (e) {\n console.error(\"Failed to parse data-config JSON:\", e);\n }\n }\n\n // Client token from data attribute (primary method for client token mode)\n const token = script.getAttribute('data-runtype-token');\n if (token) {\n scriptConfig.clientToken = token;\n }\n\n // Optional flow ID\n const flowId = script.getAttribute('data-flow-id');\n if (flowId) {\n scriptConfig.flowId = flowId;\n }\n\n // Optional agent ID\n const agentId = script.getAttribute('data-agent-id');\n if (agentId) {\n scriptConfig.agentId = agentId;\n }\n\n // Optional API URL override\n const apiUrl = script.getAttribute('data-api-url');\n if (apiUrl) {\n scriptConfig.apiUrl = apiUrl;\n }\n\n // Optional preview query param gate\n const previewQueryParam = script.getAttribute('data-preview-param');\n if (previewQueryParam) {\n scriptConfig.previewQueryParam = previewQueryParam;\n }\n\n return scriptConfig;\n };\n\n // Get config from script attributes (must be called synchronously during script execution)\n const scriptConfig = getConfigFromScript();\n\n // Merge script attributes with window config (script attributes take precedence)\n const windowConfig: SiteAgentInstallConfig = window.siteAgentConfig || {};\n const config: SiteAgentInstallConfig = { ...windowConfig, ...scriptConfig };\n\n // --- Lifecycle helpers -----------------------------------------------------\n // A throwing user callback must never break the installer.\n const safeCall = <T>(fn: ((arg: T) => void) | undefined, arg: T): void => {\n try {\n fn?.(arg);\n } catch (e) {\n console.error(\"[Persona] lifecycle callback threw:\", e);\n }\n };\n const dispatchLifecycle = (name: string, detail: unknown): void => {\n try {\n window.dispatchEvent(new CustomEvent(name, { detail }));\n } catch {\n /* CustomEvent unsupported: ignore */\n }\n };\n const fail = (phase: \"css\" | \"bundle\" | \"init\", error: unknown): void => {\n console.error(\"Failed to install AgentWidget:\", error);\n safeCall(config.onError, { phase, error });\n dispatchLifecycle(\"persona:error\", { phase, error });\n };\n // True when the config renders a standard floating launcher button: the only\n // case that paints a clickable launcher at load. Shared by the deferral gate\n // and the eager-path `onLauncherShown` so the event name stays honest.\n const hasFloatingLauncher = (widgetConfig: any): boolean => {\n const launcher = widgetConfig.launcher ?? {};\n if (launcher.enabled === false) return false; // inline embed\n return (launcher.mountMode ?? \"floating\") === \"floating\"; // not docked / composer-bar\n };\n\n // Earliest signal: the installer has executed. Fire before any loading or\n // preview-gating so it's a reliable \"did my embed run\" beacon for diagnostics.\n safeCall(config.onScriptLoad, { version: config.version || \"latest\" });\n dispatchLifecycle(\"persona:script-load\", { version: config.version || \"latest\" });\n\n const isPreviewModeEnabled = (): boolean => {\n if (!config.previewQueryParam) {\n return true;\n }\n\n const params = new URLSearchParams(window.location.search);\n const value = params.get(config.previewQueryParam);\n return value !== null && value !== \"\" && value.toLowerCase() !== \"false\" && value !== \"0\";\n };\n\n if (!isPreviewModeEnabled()) {\n return;\n }\n \n const version = config.version || \"latest\";\n const cdn = config.cdn || \"jsdelivr\";\n const autoInit = config.autoInit !== false; // Default to true\n\n // Determine CDN base URL\n const getCdnBase = () => {\n // For a custom URL override, derive the sibling launcher URL when the\n // override mirrors the dist layout (…/index.global.js → …/launcher.global.js)\n // so self-hosted deployments still get the optimization. A non-standard\n // jsUrl yields null → eager-load fallback.\n if (config.cssUrl && config.jsUrl) {\n const derivedLauncherUrl = config.jsUrl.replace(/index\\.global\\.js($|\\?)/, \"launcher.global.js$1\");\n return {\n cssUrl: config.cssUrl,\n jsUrl: config.jsUrl,\n launcherUrl: (derivedLauncherUrl !== config.jsUrl ? derivedLauncherUrl : null) as string | null,\n };\n }\n\n const packageName = \"@runtypelabs/persona\";\n const basePath = `/npm/${packageName}@${version}/dist`;\n const host = cdn === \"unpkg\" ? \"https://unpkg.com\" : \"https://cdn.jsdelivr.net\";\n\n return {\n cssUrl: `${host}${basePath}/widget.css`,\n jsUrl: `${host}${basePath}/index.global.js`,\n launcherUrl: `${host}${basePath}/launcher.global.js` as string | null,\n };\n };\n\n const { cssUrl, jsUrl, launcherUrl } = getCdnBase();\n\n // Check if CSS is already loaded\n const isCssLoaded = () => {\n return !!document.head.querySelector('link[data-persona]') ||\n !!document.head.querySelector(`link[href*=\"widget.css\"]`);\n };\n\n // Check if JS is already loaded\n const isJsLoaded = () => {\n return !!(window as any).AgentWidget;\n };\n\n /**\n * Wait for framework hydration to complete (Next.js, Nuxt, etc.)\n * This prevents the framework from removing dynamically added CSS during reconciliation.\n * Uses requestIdleCallback + double requestAnimationFrame for reliable detection.\n */\n const waitForHydration = (callback: () => void): void => {\n let executed = false;\n \n const execute = () => {\n if (executed) return;\n executed = true;\n callback();\n };\n\n const afterDom = () => {\n // Strategy 1: Use requestIdleCallback if available (best for detecting idle after hydration)\n if (typeof requestIdleCallback !== 'undefined') {\n requestIdleCallback(() => {\n // Double requestAnimationFrame ensures at least one full paint cycle completed\n requestAnimationFrame(() => {\n requestAnimationFrame(execute);\n });\n }, { timeout: 3000 }); // Max wait 3 seconds, then proceed anyway\n } else {\n // Strategy 2: Fallback for Safari (no requestIdleCallback)\n // 300ms is typically enough for hydration on most pages\n setTimeout(execute, 300);\n }\n };\n\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', afterDom);\n } else {\n // DOM already ready, but still wait for potential hydration\n afterDom();\n }\n };\n\n // Load CSS\n const loadCSS = (): Promise<void> => {\n return new Promise((resolve, reject) => {\n if (isCssLoaded()) {\n resolve();\n return;\n }\n\n const link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = cssUrl;\n link.setAttribute(\"data-persona\", \"true\");\n \n link.onload = () => resolve();\n link.onerror = () => reject(new Error(`Failed to load CSS from ${cssUrl}`));\n document.head.appendChild(link);\n });\n };\n\n // Load JS\n const loadJS = (): Promise<void> => {\n return new Promise((resolve, reject) => {\n if (isJsLoaded()) {\n resolve();\n return;\n }\n\n const script = document.createElement(\"script\");\n script.src = jsUrl;\n script.async = true;\n script.onload = () => resolve();\n script.onerror = () => reject(new Error(`Failed to load JS from ${jsUrl}`));\n document.head.appendChild(script);\n });\n };\n\n // Load the tiny launcher-only critical bundle (launcher.global.js)\n const isLauncherLoaded = () => !!window.AgentWidgetLauncher;\n\n const loadLauncher = (): Promise<void> => {\n return new Promise((resolve, reject) => {\n if (isLauncherLoaded() || !launcherUrl) {\n resolve();\n return;\n }\n\n const script = document.createElement(\"script\");\n script.src = launcherUrl;\n script.async = true;\n script.onload = () => resolve();\n script.onerror = () => reject(new Error(`Failed to load launcher from ${launcherUrl}`));\n document.head.appendChild(script);\n });\n };\n\n // Warm the full bundle in the background (download-only, not executed) so the\n // first open is quick. Runs at idle so it never competes with the launcher.\n const prefetchFullBundle = (): void => {\n const addPrefetch = () => {\n if (!isJsLoaded()) {\n const link = document.createElement(\"link\");\n link.rel = \"prefetch\";\n link.as = \"script\";\n link.href = jsUrl;\n document.head.appendChild(link);\n }\n\n // Also prefetch the markdown parsers chunk\n const markdownUrl = jsUrl.replace(/index\\.global\\.js($|\\?)/, \"markdown-parsers.js$1\");\n if (markdownUrl !== jsUrl) {\n const link2 = document.createElement(\"link\");\n link2.rel = \"prefetch\";\n link2.as = \"script\";\n link2.href = markdownUrl;\n document.head.appendChild(link2);\n }\n };\n if (typeof requestIdleCallback !== \"undefined\") {\n requestIdleCallback(addPrefetch, { timeout: 4000 });\n } else {\n setTimeout(addPrefetch, 1200);\n }\n };\n\n // Merge top-level installer options into the widget config. Shared by the\n // eager init path and the deferred-launcher path.\n const buildWidgetInit = (): { target: string | HTMLElement; widgetConfig: any; hasApiConfig: boolean } => {\n const target = config.target || \"body\";\n const widgetConfig: any = { ...config.config };\n\n if (config.apiUrl && !widgetConfig.apiUrl) widgetConfig.apiUrl = config.apiUrl;\n if (config.clientToken && !widgetConfig.clientToken) widgetConfig.clientToken = config.clientToken;\n if (config.flowId && !widgetConfig.flowId) widgetConfig.flowId = config.flowId;\n if (config.agentId && !widgetConfig.agentId) widgetConfig.agentId = config.agentId;\n\n const hasApiConfig = !!(widgetConfig.apiUrl || widgetConfig.clientToken);\n return { target, widgetConfig, hasApiConfig };\n };\n\n // Initialize the full widget. When `openAfter` is true (the deferred-launcher\n // handoff), open the panel immediately via the public controller API so the\n // user's click on the critical launcher carries through.\n const initWidget = (openAfter = false): any => {\n if (!window.AgentWidget || !window.AgentWidget.initAgentWidget) {\n console.warn(\"AgentWidget not available. Make sure the script loaded successfully.\");\n return;\n }\n\n const { target, widgetConfig, hasApiConfig } = buildWidgetInit();\n\n // Only initialize if we have either apiUrl OR clientToken (or other config)\n if (!hasApiConfig && Object.keys(widgetConfig).length === 0) {\n return;\n }\n\n // Auto-apply markdown postprocessor if not explicitly set and available\n if (!widgetConfig.postprocessMessage && window.AgentWidget.markdownPostprocessor) {\n widgetConfig.postprocessMessage = ({ text }: { text: string }) =>\n window.AgentWidget.markdownPostprocessor(text);\n }\n\n try {\n const handle = window.AgentWidget.initAgentWidget({\n target,\n config: widgetConfig,\n // Explicitly disable shadow DOM for better CSS compatibility with host page\n useShadowDom: config.useShadowDom ?? false,\n windowKey: config.windowKey\n });\n\n // Handoff from the critical launcher: the user already clicked, so open\n // the panel via the existing public controller method.\n if (openAfter && handle && typeof handle.open === \"function\") {\n handle.open();\n }\n\n // Eager floating installs paint their launcher at load time too: emit the\n // same page-load \"appeared\" signal as the deferred path. The deferred\n // handoff (openAfter) already fired it at launcher mount, and non-floating\n // modes have no launcher, so guard on both.\n if (!openAfter && hasFloatingLauncher(widgetConfig)) {\n safeCall(config.onLauncherShown, { deferred: false });\n dispatchLifecycle(\"persona:launcher-shown\", { deferred: false });\n }\n\n // The full widget is initialized and its controller API is callable.\n safeCall(config.onChatReady, handle);\n dispatchLifecycle(\"persona:chat-ready\", handle);\n return handle;\n } catch (error) {\n fail(\"init\", error);\n }\n };\n\n // A persisted \"open\" state reopens the panel on reload with no click\n // (ui.ts:7513). The installer can't see that from config, so it reads the very\n // same storage key the widget writes. Mirrors normalizePersistStateConfig\n // (ui.ts:213): openState persistence defaults on, storage to sessionStorage,\n // key prefix to \"persona-\".\n const hasPersistedOpenState = (widgetConfig: any): boolean => {\n const persistState = widgetConfig.persistState;\n if (!persistState) return false; // persistence off → nothing to restore\n const asObject = typeof persistState === \"object\" ? persistState : null;\n if (asObject && asObject.persist?.openState === false) return false; // open-state persistence opted out\n const keyPrefix = (asObject && asObject.keyPrefix) || \"persona-\";\n const storageType = (asObject && asObject.storage) || \"session\";\n try {\n const storage = storageType === \"local\" ? window.localStorage : window.sessionStorage;\n return storage.getItem(`${keyPrefix}widget-open`) === \"true\";\n } catch {\n return false; // storage blocked (private mode) → the widget can't restore either\n }\n };\n\n // The deferred-launcher optimization only applies to the common floating case\n // that paints a collapsed launcher and waits for a click. Anything that starts\n // open or renders differently eager-loads the full bundle exactly as before: // including the two open triggers config alone can't express: a host\n // onStateLoaded hook that may request open, and a restored \"was open\" state.\n const shouldDeferPanel = (widgetConfig: any): boolean => {\n if (!launcherUrl) return false; // custom bundle URL override: can't derive launcher URL\n if (!hasFloatingLauncher(widgetConfig)) return false; // inline / docked / composer-bar\n const launcher = widgetConfig.launcher ?? {};\n if (launcher.autoExpand === true) return false; // starts open\n if (typeof widgetConfig.onStateLoaded === \"function\") return false; // hook may request open\n if (hasPersistedOpenState(widgetConfig)) return false; // restored \"was open\"\n return true;\n };\n\n // Render the real launcher from the tiny critical bundle; load + mount the\n // full widget on first click, then remove the critical launcher.\n const mountDeferredLauncher = (target: string | HTMLElement, widgetConfig: any): void => {\n let phase: \"idle\" | \"loading\" | \"done\" = \"idle\";\n let launcherHandle: { destroy: () => void } | undefined;\n\n const onOpen = () => {\n if (phase !== \"idle\") return; // already loading or handed off\n phase = \"loading\";\n loadJS()\n .then(() => {\n initWidget(true); // mount the full widget + open the panel\n launcherHandle?.destroy(); // remove the critical launcher (same component → invisible)\n phase = \"done\";\n })\n .catch((error) => {\n phase = \"idle\"; // allow the click to be retried\n console.error(\"Failed to load AgentWidget on open:\", error);\n safeCall(config.onError, { phase: \"bundle\", error });\n dispatchLifecycle(\"persona:error\", { phase: \"bundle\", error });\n });\n };\n\n const mounted = window.AgentWidgetLauncher.mount({ target, config: widgetConfig, onOpen });\n launcherHandle = mounted;\n\n // The real launcher is now painted at page-load time: emit the page-load\n // \"appeared\" signal (distinct from `onChatReady`, which waits for first open).\n safeCall(config.onLauncherShown, { deferred: true, element: mounted.element });\n dispatchLifecycle(\"persona:launcher-shown\", { deferred: true, element: mounted.element });\n\n // Warm the full bundle so the first open is quick.\n prefetchFullBundle();\n };\n\n // Main installation flow (called after hydration completes)\n const install = async () => {\n try {\n // Auto-init if we have config OR apiUrl OR clientToken\n const shouldAutoInit = autoInit && (\n config.config ||\n config.apiUrl ||\n config.clientToken\n );\n\n // Fast path: render the real launcher from the ~13 KB critical bundle and\n // defer the full widget until first open. Only for the common floating\n // case; everything else falls through to the eager path below.\n if (shouldAutoInit) {\n const { target, widgetConfig } = buildWidgetInit();\n if (shouldDeferPanel(widgetConfig)) {\n try {\n // CSS + launcher in parallel so the launcher paints correctly styled.\n await Promise.all([loadCSS(), loadLauncher()]);\n if (window.AgentWidgetLauncher && window.AgentWidgetLauncher.mount) {\n mountDeferredLauncher(target, widgetConfig);\n return;\n }\n } catch (error) {\n console.warn(\"Deferred launcher failed; falling back to eager load.\", error);\n }\n // Fall through to the eager path on any failure.\n }\n }\n\n // Eager path (unchanged behavior): load the full bundle, then init.\n try {\n await loadCSS();\n } catch (error) {\n return fail(\"css\", error);\n }\n try {\n await loadJS();\n } catch (error) {\n return fail(\"bundle\", error);\n }\n if (shouldAutoInit) {\n // Wait a tick to ensure AgentWidget is fully initialized\n setTimeout(() => initWidget(false), 0);\n }\n } catch (error) {\n // Safety net for anything unexpected before the eager loads above.\n fail(\"init\", error);\n }\n };\n\n // Start installation after hydration completes\n // This prevents Next.js/Nuxt/etc. from removing dynamically added CSS\n waitForHydration(install);\n})();\n\n"],"mappings":"4YAAA,IAAAA,EAAA,IA6DC,UAAW,CACV,aAGA,GAAK,OAAe,2BAClB,OAED,OAAe,2BAA6B,GAqE7C,IAAMC,GA/DsB,IAAuC,CAEjE,IAAMC,EAAS,SAAS,cACxB,GAAI,CAACA,EAAQ,MAAO,CAAC,EAErB,IAAMD,EAAgD,CAAC,EAGjDE,EAAaD,EAAO,aAAa,aAAa,EACpD,GAAIC,EACF,GAAI,CAGF,IAAMC,EAAiBD,EAAW,QAAQ,cAAe,EAAE,EACrDE,EAAe,KAAK,MAAMD,CAAc,EAE9C,GAAIC,EAAa,OAAQ,CAEvB,GAAM,CAAE,UAAWC,EAAI,YAAaC,EAAI,UAAWC,EAAI,GAAGC,CAAW,EAAIJ,EACzE,OAAO,OAAOJ,EAAcQ,CA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zC,OAASpC,EAAO,CAEdF,EAAK,OAAQE,CAAK,CACpB,CACF,CAIwB,CAC1B,GAAG","names":["install_exports","scriptConfig","script","configJson","normalizedJson","parsedConfig","_a","_b","_c","safeConfig","e","token","flowId","agentId","apiUrl","previewQueryParam","config","safeCall","fn","arg","dispatchLifecycle","name","detail","fail","phase","error","hasFloatingLauncher","widgetConfig","launcher","value","version","cdn","autoInit","getCdnBase","derivedLauncherUrl","basePath","host","cssUrl","jsUrl","launcherUrl","isCssLoaded","isJsLoaded","waitForHydration","callback","executed","execute","afterDom","loadCSS","resolve","reject","link","loadJS","isLauncherLoaded","loadLauncher","prefetchFullBundle","addPrefetch","markdownUrl","link2","buildWidgetInit","target","hasApiConfig","initWidget","openAfter","text","handle","hasPersistedOpenState","persistState","asObject","keyPrefix","storageType","shouldDeferPanel","mountDeferredLauncher","launcherHandle","onOpen","mounted","shouldAutoInit"]}
|
package/dist/launcher.global.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var AgentWidgetLauncher=(()=>{var Y=Object.defineProperty;var ar=Object.getOwnPropertyDescriptor;var or=Object.getOwnPropertyNames;var tr=Object.prototype.hasOwnProperty;var rr=(a,o)=>{for(var e in o)Y(a,e,{get:o[e],enumerable:!0})},sr=(a,o,e,l)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of or(o))!tr.call(a,r)&&r!==e&&Y(a,r,{get:()=>o[r],enumerable:!(l=ar(o,r))||l.enumerable});return a};var lr=a=>sr(Y({},"__esModule",{value:!0}),a);var Mr={};rr(Mr,{CRITICAL_LAUNCHER_ATTR:()=>$t,mount:()=>kr});var Gt=(a,o)=>{let e=document.createElement(a);return o&&(e.className=o),e};var E={"bottom-right":"persona-bottom-6 persona-right-6","bottom-left":"persona-bottom-6 persona-left-6","top-right":"persona-top-6 persona-right-6","top-left":"persona-top-6 persona-left-6"};var Nt=a=>{var o,e;return((e=(o=a==null?void 0:a.launcher)==null?void 0:o.mountMode)!=null?e:"floating")==="docked"};var $=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2"}]];var ee=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]];var ae=[["path",{d:"m12 19-7-7 7-7"}],["path",{d:"M19 12H5"}]];var oe=[["path",{d:"M5 12h14"}],["path",{d:"m12 5 7 7-7 7"}]];var te=[["path",{d:"M7 7h10v10"}],["path",{d:"M7 17 17 7"}]];var re=[["path",{d:"m5 12 7-7 7 7"}],["path",{d:"M12 19V5"}]];var se=[["circle",{cx:"12",cy:"12",r:"4"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8"}]];var le=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M4.929 4.929 19.07 19.071"}]];var fe=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326"}]];var de=[["path",{d:"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z"}]];var pe=[["path",{d:"M12 8V4H8"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2"}],["path",{d:"M2 14h2"}],["path",{d:"M20 14h2"}],["path",{d:"M15 13v2"}],["path",{d:"M9 13v2"}]];var ne=[["path",{d:"M12 10h.01"}],["path",{d:"M12 14h.01"}],["path",{d:"M12 6h.01"}],["path",{d:"M16 10h.01"}],["path",{d:"M16 14h.01"}],["path",{d:"M16 6h.01"}],["path",{d:"M8 10h.01"}],["path",{d:"M8 14h.01"}],["path",{d:"M8 6h.01"}],["path",{d:"M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3"}],["rect",{x:"4",y:"2",width:"16",height:"20",rx:"2"}]];var ue=[["path",{d:"M8 2v4"}],["path",{d:"M16 2v4"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}],["path",{d:"M3 10h18"}],["path",{d:"M8 14h.01"}],["path",{d:"M12 14h.01"}],["path",{d:"M16 14h.01"}],["path",{d:"M8 18h.01"}],["path",{d:"M12 18h.01"}],["path",{d:"M16 18h.01"}]];var ie=[["path",{d:"M8 2v4"}],["path",{d:"M16 2v4"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}],["path",{d:"M3 10h18"}]];var me=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z"}],["circle",{cx:"12",cy:"13",r:"3"}]];var ce=[["path",{d:"M20 6 9 17l-5-5"}]];var xe=[["path",{d:"m6 9 6 6 6-6"}]];var he=[["path",{d:"m15 18-6-6 6-6"}]];var ge=[["path",{d:"m9 18 6-6-6-6"}]];var Ce=[["path",{d:"m18 15-6-6-6 6"}]];var I=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m9 12 2 2 4-4"}]];var W=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m15 9-6 6"}],["path",{d:"m9 9 6 6"}]];var be=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4"}],["path",{d:"M21 14H11"}],["path",{d:"m15 10-4 4 4 4"}]];var ye=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}]];var Se=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 6v6l4 2"}]];var we=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]];var ke=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10"}]];var Me=[["line",{x1:"12",x2:"12",y1:"2",y2:"22"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"}]];var Ae=[["path",{d:"M12 15V3"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["path",{d:"m7 10 5 5 5-5"}]];var V=[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"12",cy:"5",r:"1"}],["circle",{cx:"12",cy:"19",r:"1"}]];var z=[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"19",cy:"12",r:"1"}],["circle",{cx:"5",cy:"12",r:"1"}]];var ve=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}],["path",{d:"m2 2 20 20"}]];var Te=[["path",{d:"M15 3h6v6"}],["path",{d:"M10 14 21 3"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}]];var Pe=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}],["circle",{cx:"12",cy:"12",r:"3"}]];var Be=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}],["path",{d:"M10 12.5 8 15l2 2.5"}],["path",{d:"m14 12.5 2 2.5-2 2.5"}]];var Le=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}],["path",{d:"M8 13h2"}],["path",{d:"M14 13h2"}],["path",{d:"M8 17h2"}],["path",{d:"M14 17h2"}]];var Re=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}],["path",{d:"M10 9H8"}],["path",{d:"M16 13H8"}],["path",{d:"M16 17H8"}]];var Fe=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}]];var De=[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1"}]];var He=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M7 3v18"}],["path",{d:"M3 7.5h4"}],["path",{d:"M3 12h18"}],["path",{d:"M3 16.5h4"}],["path",{d:"M17 3v18"}],["path",{d:"M17 7.5h4"}],["path",{d:"M17 16.5h4"}]];var qe=[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528"}]];var Ue=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"}]];var Oe=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"}]];var G=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z"}]];var Ee=[["path",{d:"M12 7v14"}],["path",{d:"M20 11v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8"}],["path",{d:"M7.5 7a1 1 0 0 1 0-5A4.8 8 0 0 1 12 7a4.8 8 0 0 1 4.5-5 1 1 0 0 1 0 5"}],["rect",{x:"3",y:"7",width:"18",height:"4",rx:"1"}]];var Ie=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"}],["path",{d:"M2 12h20"}]];var We=[["line",{x1:"4",x2:"20",y1:"9",y2:"9"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21"}]];var Ve=[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3"}]];var ze=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5"}]];var Ge=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}],["path",{d:"M3 3v5h5"}],["path",{d:"M12 7v5l4 2"}]];var N=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}]];var Ne=[["path",{d:"M16 5h6"}],["path",{d:"M19 2v6"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"}],["circle",{cx:"9",cy:"9",r:"2"}]];var Xe=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}],["circle",{cx:"9",cy:"9",r:"2"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"}]];var Ke=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4"}],["path",{d:"M12 8h.01"}]];var _e=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4"}],["path",{d:"m21 2-9.6 9.6"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5"}]];var Ze=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}]];var X=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56"}]];var je=[["path",{d:"M12 2v4"}],["path",{d:"m16.2 7.8 2.9-2.9"}],["path",{d:"M18 12h4"}],["path",{d:"m16.2 16.2 2.9 2.9"}],["path",{d:"M12 18v4"}],["path",{d:"m4.9 19.1 2.9-2.9"}],["path",{d:"M2 12h4"}],["path",{d:"m4.9 4.9 2.9 2.9"}]];var Qe=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4"}]];var Je=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}]];var Ye=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0"}],["circle",{cx:"12",cy:"10",r:"3"}]];var $e=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3"}]];var ea=[["path",{d:"M4 5h16"}],["path",{d:"M4 12h16"}],["path",{d:"M4 19h16"}]];var aa=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719"}]];var oa=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"}]];var ta=[["path",{d:"M12 19v3"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3"}]];var ra=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3"}]];var sa=[["path",{d:"M5 12h14"}]];var la=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21"}]];var fa=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"}]];var da=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z"}],["path",{d:"M12 22V12"}],["polyline",{points:"3.29 7 12 12 20.71 7"}],["path",{d:"m7.5 4.27 9 5.15"}]];var pa=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551"}]];var na=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1"}]];var ua=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}],["path",{d:"m15 5 4 4"}]];var ia=[["line",{x1:"19",x2:"5",y1:"5",y2:"19"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5"}]];var ma=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384"}]];var ca=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"}]];var xa=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];var ha=[["path",{d:"M12 17V7"}],["path",{d:"M16 8h-6a2 2 0 0 0 0 4h4a2 2 0 0 1 0 4H8"}],["path",{d:"M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z"}]];var ga=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}],["path",{d:"M21 3v5h-5"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}],["path",{d:"M8 16H3v5"}]];var Ca=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"}],["path",{d:"M21 3v5h-5"}]];var ba=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7"}]];var ya=[["path",{d:"m21 21-4.34-4.34"}],["circle",{cx:"11",cy:"11",r:"8"}]];var Sa=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z"}],["path",{d:"m21.854 2.147-10.94 10.939"}]];var wa=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915"}],["circle",{cx:"12",cy:"12",r:"3"}]];var ka=[["path",{d:"M12 2v13"}],["path",{d:"m16 6-4-4-4 4"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}]];var Ma=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}],["path",{d:"M12 8v4"}],["path",{d:"M12 16h.01"}]];var Aa=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}],["path",{d:"m9 12 2 2 4-4"}]];var K=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}],["path",{d:"m14.5 9.5-5 5"}],["path",{d:"m9.5 9.5 5 5"}]];var va=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}]];var Ta=[["path",{d:"M16 10a4 4 0 0 1-8 0"}],["path",{d:"M3.103 6.034h17.794"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z"}]];var Pa=[["circle",{cx:"8",cy:"21",r:"1"}],["circle",{cx:"19",cy:"21",r:"1"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12"}]];var Ba=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2"}],["path",{d:"M12 18h.01"}]];var _=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z"}],["path",{d:"M20 2v4"}],["path",{d:"M22 4h-4"}],["circle",{cx:"4",cy:"20",r:"2"}]];var La=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}]];var Ra=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z"}]];var Fa=[["path",{d:"M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5"}],["path",{d:"M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244"}],["path",{d:"M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05"}]];var Da=[["circle",{cx:"12",cy:"12",r:"4"}],["path",{d:"M12 2v2"}],["path",{d:"M12 20v2"}],["path",{d:"m4.93 4.93 1.41 1.41"}],["path",{d:"m17.66 17.66 1.41 1.41"}],["path",{d:"M2 12h2"}],["path",{d:"M20 12h2"}],["path",{d:"m6.34 17.66-1.41 1.41"}],["path",{d:"m19.07 4.93-1.41 1.41"}]];var Ha=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor"}]];var qa=[["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z"}],["path",{d:"M17 14V2"}]];var Ua=[["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z"}],["path",{d:"M7 10v12"}]];var Oa=[["line",{x1:"10",x2:"14",y1:"2",y2:"2"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11"}],["circle",{cx:"12",cy:"14",r:"8"}]];var Ea=[["path",{d:"M10 11v6"}],["path",{d:"M14 11v6"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]];var Ia=[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]];var Z=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}],["path",{d:"M12 9v4"}],["path",{d:"M12 17h.01"}]];var Wa=[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2"}],["path",{d:"M15 18H9"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14"}],["circle",{cx:"17",cy:"18",r:"2"}],["circle",{cx:"7",cy:"18",r:"2"}]];var Va=[["path",{d:"M12 3v12"}],["path",{d:"m17 8-5-5-5 5"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}]];var za=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}],["circle",{cx:"12",cy:"7",r:"4"}]];var Ga=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z"}],["path",{d:"M16 9a5 5 0 0 1 0 6"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728"}]];var Na=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15"}]];var Xa=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4"}]];var Ka=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];var _a=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"}]];var fr={activity:$,"arrow-down":ee,"arrow-up":re,"arrow-up-right":te,bot:pe,"chevron-down":xe,"chevron-up":Ce,"chevron-right":ge,"chevron-left":he,check:ce,clipboard:ye,"clipboard-copy":be,copy:we,file:Fe,"file-code":Be,"file-spreadsheet":Le,"file-text":Re,"image-plus":Ne,loader:je,"loader-circle":X,mic:ta,paperclip:pa,"refresh-cw":ga,search:ya,send:Sa,"shield-alert":Ma,"shield-check":Aa,"shield-x":K,square:La,"thumbs-down":qa,"thumbs-up":Ua,upload:Va,"volume-2":Ga,x:Ka,user:za,mail:Je,phone:ma,calendar:ie,clock:Se,building:ne,"map-pin":Ye,lock:Qe,key:_e,"credit-card":ke,"at-sign":se,hash:We,globe:Ie,link:Ze,"circle-check":I,"circle-x":W,"triangle-alert":Z,info:Ke,ban:le,shield:va,"arrow-left":ae,"arrow-right":oe,"external-link":Te,ellipsis:z,"ellipsis-vertical":V,menu:ea,house:N,plus:xa,minus:sa,pencil:ua,trash:Ia,"trash-2":Ea,save:ba,download:Ae,share:ka,funnel:G,settings:wa,"rotate-cw":Ca,maximize:$e,minimize:ra,"shopping-cart":Pa,"shopping-bag":Ta,package:da,truck:Wa,tag:Ha,gift:Ee,receipt:ha,wallet:Xa,store:Fa,"dollar-sign":Me,percent:ia,play:ca,pause:na,"volume-x":Na,camera:me,image:Xe,film:He,headphones:Ve,"message-circle":aa,"message-square":oa,bell:fe,heart:ze,star:Ra,eye:Pe,"eye-off":ve,bookmark:de,"calendar-days":ue,history:Ge,timer:Oa,folder:Oe,"folder-open":Ue,files:De,sparkles:_,zap:_a,sun:Da,moon:fa,flag:qe,monitor:la,smartphone:Ba},Za=(a,o=24,e="currentColor",l=2)=>{let r=fr[a];return r?dr(r,o,e,l):(console.warn(`Lucide icon "${a}" is not in the Persona registry. Add it to packages/widget/src/utils/icons.ts (see docs/icon-registry-shortlist.md).`),null)};function dr(a,o,e,l){if(!Array.isArray(a))return null;let r=document.createElementNS("http://www.w3.org/2000/svg","svg");return r.setAttribute("width",String(o)),r.setAttribute("height",String(o)),r.setAttribute("viewBox","0 0 24 24"),r.setAttribute("fill","none"),r.setAttribute("stroke",e),r.setAttribute("stroke-width",String(l)),r.setAttribute("stroke-linecap","round"),r.setAttribute("stroke-linejoin","round"),r.setAttribute("aria-hidden","true"),a.forEach(d=>{if(!Array.isArray(d)||d.length<2)return;let s=d[0],u=d[1];if(!u)return;let x=document.createElementNS("http://www.w3.org/2000/svg",s);Object.entries(u).forEach(([h,i])=>{h!=="stroke"&&x.setAttribute(h,String(i))}),r.appendChild(x)}),r}var ja=1e5,Gd=ja+1;var Xt=(a,o)=>{let e=Gt("button");e.type="button",e.innerHTML=`
|
|
1
|
+
"use strict";var AgentWidgetLauncher=(()=>{var V=Object.defineProperty;var ro=Object.getOwnPropertyDescriptor;var to=Object.getOwnPropertyNames;var so=Object.prototype.hasOwnProperty;var lo=(o,r)=>{for(var e in r)V(o,e,{get:r[e],enumerable:!0})},fo=(o,r,e,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(let t of to(r))!so.call(o,t)&&t!==e&&V(o,t,{get:()=>r[t],enumerable:!(l=ro(r,t))||l.enumerable});return o};var no=o=>fo(V({},"__esModule",{value:!0}),o);var Ao={};lo(Ao,{CRITICAL_LAUNCHER_ATTR:()=>ao,mount:()=>vo});var za=(o,r)=>{let e=document.createElement(o);return r&&(e.className=r),e};var M={"bottom-right":"persona-bottom-6 persona-right-6","bottom-left":"persona-bottom-6 persona-left-6","top-right":"persona-top-6 persona-right-6","top-left":"persona-top-6 persona-left-6"};var Ga=o=>(o?.launcher?.mountMode??"floating")==="docked";var z=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2"}]];var G=[["path",{d:"M12 5v14"}],["path",{d:"m19 12-7 7-7-7"}]];var N=[["path",{d:"m12 19-7-7 7-7"}],["path",{d:"M19 12H5"}]];var X=[["path",{d:"M5 12h14"}],["path",{d:"m12 5 7 7-7 7"}]];var _=[["path",{d:"M7 7h10v10"}],["path",{d:"M7 17 17 7"}]];var K=[["path",{d:"m5 12 7-7 7 7"}],["path",{d:"M12 19V5"}]];var Z=[["circle",{cx:"12",cy:"12",r:"4"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8"}]];var j=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M4.929 4.929 19.07 19.071"}]];var Q=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326"}]];var J=[["path",{d:"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z"}]];var Y=[["path",{d:"M12 8V4H8"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2"}],["path",{d:"M2 14h2"}],["path",{d:"M20 14h2"}],["path",{d:"M15 13v2"}],["path",{d:"M9 13v2"}]];var $=[["path",{d:"M12 10h.01"}],["path",{d:"M12 14h.01"}],["path",{d:"M12 6h.01"}],["path",{d:"M16 10h.01"}],["path",{d:"M16 14h.01"}],["path",{d:"M16 6h.01"}],["path",{d:"M8 10h.01"}],["path",{d:"M8 14h.01"}],["path",{d:"M8 6h.01"}],["path",{d:"M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3"}],["rect",{x:"4",y:"2",width:"16",height:"20",rx:"2"}]];var ee=[["path",{d:"M8 2v4"}],["path",{d:"M16 2v4"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}],["path",{d:"M3 10h18"}],["path",{d:"M8 14h.01"}],["path",{d:"M12 14h.01"}],["path",{d:"M16 14h.01"}],["path",{d:"M8 18h.01"}],["path",{d:"M12 18h.01"}],["path",{d:"M16 18h.01"}]];var ae=[["path",{d:"M8 2v4"}],["path",{d:"M16 2v4"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2"}],["path",{d:"M3 10h18"}]];var oe=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z"}],["circle",{cx:"12",cy:"13",r:"3"}]];var re=[["path",{d:"M20 6 9 17l-5-5"}]];var te=[["path",{d:"m6 9 6 6 6-6"}]];var se=[["path",{d:"m15 18-6-6 6-6"}]];var le=[["path",{d:"m9 18 6-6-6-6"}]];var fe=[["path",{d:"m18 15-6-6-6 6"}]];var v=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m9 12 2 2 4-4"}]];var A=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m15 9-6 6"}],["path",{d:"m9 9 6 6"}]];var de=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1"}],["path",{d:"M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v4"}],["path",{d:"M21 14H11"}],["path",{d:"m15 10-4 4 4 4"}]];var ne=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"}]];var pe=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 6v6l4 2"}]];var T=[["path",{d:"m18 16 4-4-4-4"}],["path",{d:"m6 8-4 4 4 4"}],["path",{d:"m14.5 4-5 16"}]];var ue=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"}]];var ie=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10"}]];var me=[["line",{x1:"12",x2:"12",y1:"2",y2:"22"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"}]];var ce=[["path",{d:"M12 15V3"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}],["path",{d:"m7 10 5 5 5-5"}]];var B=[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"12",cy:"5",r:"1"}],["circle",{cx:"12",cy:"19",r:"1"}]];var P=[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"19",cy:"12",r:"1"}],["circle",{cx:"5",cy:"12",r:"1"}]];var xe=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}],["path",{d:"m2 2 20 20"}]];var he=[["path",{d:"M15 3h6v6"}],["path",{d:"M10 14 21 3"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}]];var ge=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}],["circle",{cx:"12",cy:"12",r:"3"}]];var Ce=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}],["path",{d:"M10 12.5 8 15l2 2.5"}],["path",{d:"m14 12.5 2 2.5-2 2.5"}]];var be=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}],["path",{d:"M8 13h2"}],["path",{d:"M14 13h2"}],["path",{d:"M8 17h2"}],["path",{d:"M14 17h2"}]];var ye=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}],["path",{d:"M10 9H8"}],["path",{d:"M16 13H8"}],["path",{d:"M16 17H8"}]];var Se=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}]];var ke=[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1"}]];var we=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M7 3v18"}],["path",{d:"M3 7.5h4"}],["path",{d:"M3 12h18"}],["path",{d:"M3 16.5h4"}],["path",{d:"M17 3v18"}],["path",{d:"M17 7.5h4"}],["path",{d:"M17 16.5h4"}]];var Me=[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528"}]];var ve=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"}]];var Ae=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"}]];var L=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z"}]];var Te=[["path",{d:"M12 7v14"}],["path",{d:"M20 11v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8"}],["path",{d:"M7.5 7a1 1 0 0 1 0-5A4.8 8 0 0 1 12 7a4.8 8 0 0 1 4.5-5 1 1 0 0 1 0 5"}],["rect",{x:"3",y:"7",width:"18",height:"4",rx:"1"}]];var Be=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"}],["path",{d:"M2 12h20"}]];var Pe=[["line",{x1:"4",x2:"20",y1:"9",y2:"9"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21"}]];var Le=[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3"}]];var Re=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5"}]];var Fe=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}],["path",{d:"M3 3v5h5"}],["path",{d:"M12 7v5l4 2"}]];var R=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}]];var De=[["path",{d:"M16 5h6"}],["path",{d:"M19 2v6"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"}],["circle",{cx:"9",cy:"9",r:"2"}]];var He=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}],["circle",{cx:"9",cy:"9",r:"2"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"}]];var qe=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4"}],["path",{d:"M12 8h.01"}]];var Ue=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4"}],["path",{d:"m21 2-9.6 9.6"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5"}]];var Oe=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}]];var F=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56"}]];var Ee=[["path",{d:"M12 2v4"}],["path",{d:"m16.2 7.8 2.9-2.9"}],["path",{d:"M18 12h4"}],["path",{d:"m16.2 16.2 2.9 2.9"}],["path",{d:"M12 18v4"}],["path",{d:"m4.9 19.1 2.9-2.9"}],["path",{d:"M2 12h4"}],["path",{d:"m4.9 4.9 2.9 2.9"}]];var Ie=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4"}]];var We=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}]];var Ve=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0"}],["circle",{cx:"12",cy:"10",r:"3"}]];var ze=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3"}]];var Ge=[["path",{d:"M4 5h16"}],["path",{d:"M4 12h16"}],["path",{d:"M4 19h16"}]];var Ne=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719"}]];var Xe=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z"}]];var _e=[["path",{d:"M12 19v3"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3"}]];var Ke=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3"}]];var Ze=[["path",{d:"M5 12h14"}]];var je=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21"}]];var Qe=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"}]];var Je=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z"}],["path",{d:"M12 22V12"}],["polyline",{points:"3.29 7 12 12 20.71 7"}],["path",{d:"m7.5 4.27 9 5.15"}]];var Ye=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551"}]];var $e=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1"}]];var ea=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}],["path",{d:"m15 5 4 4"}]];var aa=[["line",{x1:"19",x2:"5",y1:"5",y2:"19"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5"}]];var oa=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384"}]];var ra=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"}]];var ta=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];var sa=[["path",{d:"M12 17V7"}],["path",{d:"M16 8h-6a2 2 0 0 0 0 4h4a2 2 0 0 1 0 4H8"}],["path",{d:"M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z"}]];var la=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}],["path",{d:"M21 3v5h-5"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}],["path",{d:"M8 16H3v5"}]];var fa=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"}],["path",{d:"M21 3v5h-5"}]];var da=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7"}]];var na=[["path",{d:"m21 21-4.34-4.34"}],["circle",{cx:"11",cy:"11",r:"8"}]];var pa=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z"}],["path",{d:"m21.854 2.147-10.94 10.939"}]];var ua=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915"}],["circle",{cx:"12",cy:"12",r:"3"}]];var ia=[["path",{d:"M12 2v13"}],["path",{d:"m16 6-4-4-4 4"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}]];var ma=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}],["path",{d:"M12 8v4"}],["path",{d:"M12 16h.01"}]];var ca=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}],["path",{d:"m9 12 2 2 4-4"}]];var D=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}],["path",{d:"m14.5 9.5-5 5"}],["path",{d:"m9.5 9.5 5 5"}]];var xa=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z"}]];var ha=[["path",{d:"M16 10a4 4 0 0 1-8 0"}],["path",{d:"M3.103 6.034h17.794"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z"}]];var ga=[["circle",{cx:"8",cy:"21",r:"1"}],["circle",{cx:"19",cy:"21",r:"1"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12"}]];var Ca=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2"}],["path",{d:"M12 18h.01"}]];var H=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z"}],["path",{d:"M20 2v4"}],["path",{d:"M22 4h-4"}],["circle",{cx:"4",cy:"20",r:"2"}]];var ba=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}]];var ya=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z"}]];var Sa=[["path",{d:"M15 21v-5a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v5"}],["path",{d:"M17.774 10.31a1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.451 0 1.12 1.12 0 0 0-1.548 0 2.5 2.5 0 0 1-3.452 0 1.12 1.12 0 0 0-1.549 0 2.5 2.5 0 0 1-3.77-3.248l2.889-4.184A2 2 0 0 1 7 2h10a2 2 0 0 1 1.653.873l2.895 4.192a2.5 2.5 0 0 1-3.774 3.244"}],["path",{d:"M4 10.95V19a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8.05"}]];var ka=[["circle",{cx:"12",cy:"12",r:"4"}],["path",{d:"M12 2v2"}],["path",{d:"M12 20v2"}],["path",{d:"m4.93 4.93 1.41 1.41"}],["path",{d:"m17.66 17.66 1.41 1.41"}],["path",{d:"M2 12h2"}],["path",{d:"M20 12h2"}],["path",{d:"m6.34 17.66-1.41 1.41"}],["path",{d:"m19.07 4.93-1.41 1.41"}]];var wa=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor"}]];var Ma=[["path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z"}],["path",{d:"M17 14V2"}]];var va=[["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z"}],["path",{d:"M7 10v12"}]];var Aa=[["line",{x1:"10",x2:"14",y1:"2",y2:"2"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11"}],["circle",{cx:"12",cy:"14",r:"8"}]];var Ta=[["path",{d:"M10 11v6"}],["path",{d:"M14 11v6"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]];var Ba=[["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]];var q=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}],["path",{d:"M12 9v4"}],["path",{d:"M12 17h.01"}]];var Pa=[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2"}],["path",{d:"M15 18H9"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14"}],["circle",{cx:"17",cy:"18",r:"2"}],["circle",{cx:"7",cy:"18",r:"2"}]];var La=[["path",{d:"M12 3v12"}],["path",{d:"m17 8-5-5-5 5"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}]];var Ra=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}],["circle",{cx:"12",cy:"7",r:"4"}]];var Fa=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z"}],["path",{d:"M16 9a5 5 0 0 1 0 6"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728"}]];var Da=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15"}]];var Ha=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4"}]];var qa=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];var Ua=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"}]];var po={activity:z,"arrow-down":G,"arrow-up":K,"arrow-up-right":_,bot:Y,"chevron-down":te,"chevron-up":fe,"chevron-right":le,"chevron-left":se,check:re,clipboard:ne,"clipboard-copy":de,"code-xml":T,copy:ue,file:Se,"file-code":Ce,"file-spreadsheet":be,"file-text":ye,"image-plus":De,loader:Ee,"loader-circle":F,mic:_e,paperclip:Ye,"refresh-cw":la,search:na,send:pa,"shield-alert":ma,"shield-check":ca,"shield-x":D,square:ba,"thumbs-down":Ma,"thumbs-up":va,upload:La,"volume-2":Fa,x:qa,user:Ra,mail:We,phone:oa,calendar:ae,clock:pe,building:$,"map-pin":Ve,lock:Ie,key:Ue,"credit-card":ie,"at-sign":Z,hash:Pe,globe:Be,link:Oe,"circle-check":v,"circle-x":A,"triangle-alert":q,info:qe,ban:j,shield:xa,"arrow-left":N,"arrow-right":X,"external-link":he,ellipsis:P,"ellipsis-vertical":B,menu:Ge,house:R,plus:ta,minus:Ze,pencil:ea,trash:Ba,"trash-2":Ta,save:da,download:ce,share:ia,funnel:L,settings:ua,"rotate-cw":fa,maximize:ze,minimize:Ke,"shopping-cart":ga,"shopping-bag":ha,package:Je,truck:Pa,tag:wa,gift:Te,receipt:sa,wallet:Ha,store:Sa,"dollar-sign":me,percent:aa,play:ra,pause:$e,"volume-x":Da,camera:oe,image:He,film:we,headphones:Le,"message-circle":Ne,"message-square":Xe,bell:Q,heart:Re,star:ya,eye:ge,"eye-off":xe,bookmark:J,"calendar-days":ee,history:Fe,timer:Aa,folder:Ae,"folder-open":ve,files:ke,sparkles:H,zap:Ua,sun:ka,moon:Qe,flag:Me,monitor:je,smartphone:Ca},Oa=(o,r=24,e="currentColor",l=2)=>{let t=po[o];return t?uo(t,r,e,l):(console.warn(`Lucide icon "${o}" is not in the Persona registry. Add it to packages/widget/src/utils/icons.ts (see docs/icon-registry-shortlist.md).`),null)};function uo(o,r,e,l){if(!Array.isArray(o))return null;let t=document.createElementNS("http://www.w3.org/2000/svg","svg");return t.setAttribute("width",String(r)),t.setAttribute("height",String(r)),t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("fill","none"),t.setAttribute("stroke",e),t.setAttribute("stroke-width",String(l)),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-linejoin","round"),t.setAttribute("aria-hidden","true"),o.forEach(d=>{if(!Array.isArray(d)||d.length<2)return;let s=d[0],i=d[1];if(!i)return;let c=document.createElementNS("http://www.w3.org/2000/svg",s);Object.entries(i).forEach(([g,h])=>{g!=="stroke"&&c.setAttribute(g,String(h))}),t.appendChild(c)}),t}var Ea=1e5,_l=Ea+1;var Na=(o,r)=>{let e=za("button");e.type="button",e.innerHTML=`
|
|
2
2
|
<span class="persona-inline-flex persona-items-center persona-justify-center persona-rounded-full persona-bg-persona-primary persona-text-white" data-role="launcher-icon">\u{1F4AC}</span>
|
|
3
3
|
<img data-role="launcher-image" class="persona-rounded-full persona-object-cover" alt="" style="display:none" />
|
|
4
4
|
<span class="persona-flex persona-min-w-0 persona-flex-1 persona-flex-col persona-items-start persona-text-left">
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<span class="persona-block persona-w-full persona-truncate persona-text-xs persona-text-persona-muted" data-role="launcher-subtitle"></span>
|
|
7
7
|
</span>
|
|
8
8
|
<span class="persona-ml-2 persona-grid persona-place-items-center persona-rounded-full persona-bg-persona-primary persona-text-persona-call-to-action" data-role="launcher-call-to-action-icon">\u2197</span>
|
|
9
|
-
`,e.addEventListener("click",o);let l=d=>{var k,M,A,v,T,P,B,L,R,F,D,H,q;let s=(k=d.launcher)!=null?k:{},u=Nt(d),x=e.querySelector("[data-role='launcher-title']");if(x){let m=(M=s.title)!=null?M:"Chat Assistant";x.textContent=m,x.setAttribute("title",m)}let h=e.querySelector("[data-role='launcher-subtitle']");if(h){let m=(A=s.subtitle)!=null?A:"Here to help you get answers fast";h.textContent=m,h.setAttribute("title",m)}let i=e.querySelector(".persona-flex-col");i&&(s.textHidden||u?i.style.display="none":i.style.display="");let f=e.querySelector("[data-role='launcher-icon']");if(f)if(s.agentIconHidden)f.style.display="none";else{let m=(v=s.agentIconSize)!=null?v:"40px";if(f.style.height=m,f.style.width=m,s.agentIconBackgroundColor?(f.style.backgroundColor=s.agentIconBackgroundColor,f.classList.remove("persona-bg-persona-primary")):(f.style.backgroundColor="",f.classList.add("persona-bg-persona-primary")),f.innerHTML="",s.agentIconName){let S=parseFloat(m)||24,C=Za(s.agentIconName,S*.6,"var(--persona-text-inverse, #ffffff)",2);C?(f.appendChild(C),f.style.display=""):(f.textContent=(T=s.agentIconText)!=null?T:"\u{1F4AC}",f.style.display="")}else s.iconUrl?f.style.display="none":(f.textContent=(P=s.agentIconText)!=null?P:"\u{1F4AC}",f.style.display="")}let n=e.querySelector("[data-role='launcher-image']");if(n){let m=(B=s.agentIconSize)!=null?B:"40px";n.style.height=m,n.style.width=m,s.iconUrl&&!s.agentIconName&&!s.agentIconHidden?(n.src=s.iconUrl,n.style.display="block"):n.style.display="none"}let p=e.querySelector("[data-role='launcher-call-to-action-icon']");if(p){let m=(L=s.callToActionIconSize)!=null?L:"32px";p.style.height=m,p.style.width=m,s.callToActionIconBackgroundColor?(p.style.backgroundColor=s.callToActionIconBackgroundColor,p.classList.remove("persona-bg-persona-primary")):(p.style.backgroundColor="",p.classList.add("persona-bg-persona-primary")),s.callToActionIconColor?(p.style.color=s.callToActionIconColor,p.classList.remove("persona-text-persona-call-to-action")):(p.style.color="",p.classList.add("persona-text-persona-call-to-action"));let S=0;if(s.callToActionIconPadding?(p.style.boxSizing="border-box",p.style.padding=s.callToActionIconPadding,S=(parseFloat(s.callToActionIconPadding)||0)*2):(p.style.boxSizing="",p.style.padding=""),s.callToActionIconHidden)p.style.display="none";else if(p.style.display=u?"none":"",p.innerHTML="",s.callToActionIconName){let C=parseFloat(m)||24,O=Math.max(C-S,8),U=Za(s.callToActionIconName,O,"currentColor",2);U?p.appendChild(U):p.textContent=(R=s.callToActionIconText)!=null?R:"\u2197"}else p.textContent=(F=s.callToActionIconText)!=null?F:"\u2197"}let c=s.position&&E[s.position]?E[s.position]:E["bottom-right"],b="persona-fixed persona-flex persona-items-center persona-gap-3 persona-rounded-launcher persona-bg-persona-surface persona-py-2.5 persona-pl-3 persona-pr-3 persona-transition hover:persona-translate-y-[-2px] persona-cursor-pointer",y="persona-relative persona-mt-4 persona-mb-4 persona-mx-auto persona-flex persona-items-center persona-justify-center persona-rounded-launcher persona-bg-persona-surface persona-transition hover:persona-translate-y-[-2px] persona-cursor-pointer";e.className=u?y:`${b} ${c}`,u||(e.style.zIndex=String((D=s.zIndex)!=null?D:ja));let g="1px solid var(--persona-border, #e5e7eb)",w="var(--persona-launcher-shadow, 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1))";e.style.border=(H=s.border)!=null?H:g,e.style.boxShadow=s.shadow!==void 0?s.shadow.trim()===""?"none":s.shadow:w,u?(e.style.width="0",e.style.minWidth="0",e.style.maxWidth="0",e.style.padding="0",e.style.overflow="hidden",e.style.border="none",e.style.boxShadow="none"):(e.style.width="",e.style.minWidth="",e.style.maxWidth=(q=s.collapsedMaxWidth)!=null?q:"",e.style.justifyContent="",e.style.padding="",e.style.overflow="")},r=()=>{e.removeEventListener("click",o),e.remove()};return a&&l(a),{element:e,update:l,destroy:r}};var Kt=a=>typeof a=="object"&&a!==null&&!Array.isArray(a);function j(a,o){if(!a)return o;if(!o)return a;let e={...a};for(let[l,r]of Object.entries(o)){let d=e[l];Kt(d)&&Kt(r)?e[l]=j(d,r):e[l]=r}return e}var Qa="min(440px, calc(100vw - 24px))",_t="440px",Ja={enabled:!0,mountMode:"floating",dock:{side:"right",width:"420px"},title:"Chat Assistant",subtitle:"Here to help you get answers fast",agentIconText:"\u{1F4AC}",agentIconName:"bot",headerIconName:"bot",position:"bottom-right",width:Qa,heightOffset:0,autoExpand:!1,callToActionIconHidden:!1,agentIconSize:"40px",headerIconSize:"40px",closeButtonSize:"32px",closeButtonPaddingX:"0px",closeButtonPaddingY:"0px",callToActionIconName:"arrow-up-right",callToActionIconText:"",callToActionIconSize:"32px",callToActionIconPadding:"5px",callToActionIconColor:void 0,callToActionIconBackgroundColor:void 0,closeButtonBackgroundColor:"transparent",clearChat:{backgroundColor:"transparent",borderColor:"transparent",enabled:!0,placement:"inline",iconName:"refresh-cw",size:"32px",showTooltip:!0,tooltipText:"Clear chat",paddingX:"0px",paddingY:"0px"},headerIconHidden:!1,border:void 0,shadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)"};var pr={colors:{primary:{50:"#ffffff",100:"#f5f5f5",200:"#d4d4d4",300:"#a3a3a3",400:"#737373",500:"#171717",600:"#0f0f0f",700:"#0a0a0a",800:"#050505",900:"#030303",950:"#000000"},secondary:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},accent:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},success:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},warning:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},error:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},info:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"}},spacing:{0:"0px",1:"0.25rem",2:"0.5rem",3:"0.75rem",4:"1rem",5:"1.25rem",6:"1.5rem",8:"2rem",10:"2.5rem",12:"3rem",16:"4rem",20:"5rem",24:"6rem",32:"8rem",40:"10rem",48:"12rem",56:"14rem",64:"16rem"},typography:{fontFamily:{sans:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',serif:'Georgia, Cambria, "Times New Roman", Times, serif',mono:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},fontSize:{xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem"},fontWeight:{normal:"400",medium:"500",semibold:"600",bold:"700"},lineHeight:{tight:"1.25",normal:"1.5",relaxed:"1.625"}},shadows:{none:"none",sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)"},borders:{none:"none",sm:"1px solid",md:"2px solid",lg:"4px solid"},radius:{none:"0px",sm:"0.125rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem",full:"9999px"}},nr={colors:{primary:"palette.colors.primary.500",secondary:"palette.colors.secondary.500",accent:"palette.colors.primary.600",surface:"palette.colors.gray.50",background:"palette.colors.gray.50",container:"palette.colors.gray.50",text:"palette.colors.gray.900",textMuted:"palette.colors.gray.500",textInverse:"palette.colors.gray.50",border:"palette.colors.gray.200",divider:"palette.colors.gray.200",interactive:{default:"palette.colors.primary.600",hover:"palette.colors.primary.700",focus:"palette.colors.primary.600",active:"palette.colors.primary.600",disabled:"palette.colors.gray.300"},feedback:{success:"palette.colors.success.500",warning:"palette.colors.warning.500",error:"palette.colors.error.500",info:"palette.colors.info.500"}},spacing:{xs:"palette.spacing.1",sm:"palette.spacing.2",md:"palette.spacing.4",lg:"palette.spacing.6",xl:"palette.spacing.8","2xl":"palette.spacing.10"},typography:{fontFamily:"palette.typography.fontFamily.sans",fontSize:"palette.typography.fontSize.base",fontWeight:"palette.typography.fontWeight.normal",lineHeight:"palette.typography.lineHeight.normal"}},ur={button:{primary:{background:"palette.colors.primary.500",foreground:"palette.colors.primary.50",borderRadius:"palette.radius.lg",padding:"semantic.spacing.md"},secondary:{background:"semantic.colors.surface",foreground:"semantic.colors.secondary",borderRadius:"palette.radius.lg",padding:"semantic.spacing.md"},ghost:{background:"transparent",foreground:"semantic.colors.text",borderRadius:"palette.radius.md",padding:"semantic.spacing.sm"}},input:{background:"palette.colors.gray.50",placeholder:"palette.colors.gray.400",borderRadius:"palette.radius.lg",padding:"semantic.spacing.md",focus:{border:"palette.colors.gray.400",ring:"palette.colors.gray.400"}},launcher:{background:"palette.colors.primary.500",foreground:"palette.colors.primary.50",border:"palette.colors.gray.200",size:"60px",iconSize:"28px",borderRadius:"palette.radius.full",shadow:"palette.shadows.lg"},panel:{width:Qa,maxWidth:_t,height:"600px",maxHeight:"calc(100vh - 80px)",borderRadius:"palette.radius.xl",shadow:"palette.shadows.xl"},header:{background:"palette.colors.primary.500",border:"palette.colors.primary.600",borderRadius:"palette.radius.xl palette.radius.xl 0 0",padding:"semantic.spacing.md",iconBackground:"palette.colors.primary.600",iconForeground:"palette.colors.primary.50",titleForeground:"palette.colors.primary.50",subtitleForeground:"palette.colors.primary.200",actionIconForeground:"palette.colors.primary.200"},message:{user:{background:"palette.colors.primary.500",text:"palette.colors.primary.50",borderRadius:"palette.radius.lg",shadow:"palette.shadows.sm"},assistant:{background:"palette.colors.gray.50",text:"palette.colors.gray.900",borderRadius:"palette.radius.lg",border:"palette.colors.gray.200",shadow:"palette.shadows.sm"},border:"semantic.colors.border"},introCard:{background:"semantic.colors.surface",borderRadius:"palette.radius.2xl",padding:"semantic.spacing.lg",shadow:"0 5px 15px rgba(15, 23, 42, 0.08)"},toolBubble:{shadow:"palette.shadows.sm"},reasoningBubble:{shadow:"palette.shadows.sm"},composer:{shadow:"palette.shadows.none"},markdown:{inlineCode:{background:"palette.colors.gray.50",foreground:"palette.colors.gray.900"},link:{foreground:"palette.colors.primary.600"},prose:{fontFamily:"inherit"},codeBlock:{background:"semantic.colors.container",borderColor:"semantic.colors.border",textColor:"inherit"},table:{headerBackground:"semantic.colors.container",borderColor:"semantic.colors.border"},hr:{color:"semantic.colors.divider"},blockquote:{borderColor:"palette.colors.gray.900",background:"transparent",textColor:"palette.colors.gray.500"}},collapsibleWidget:{container:"palette.colors.gray.50",surface:"semantic.colors.surface",border:"semantic.colors.border"},voice:{recording:{indicator:"palette.colors.error.500",background:"palette.colors.error.50",border:"palette.colors.error.200"},processing:{icon:"palette.colors.primary.500",background:"palette.colors.primary.50"},speaking:{icon:"palette.colors.success.500"}},approval:{requested:{background:"semantic.colors.surface",border:"semantic.colors.border",text:"palette.colors.gray.900",shadow:"0 1px 2px 0 rgba(11, 11, 11, 0.06), 0 2px 8px 0 rgba(11, 11, 11, 0.04)"},approve:{background:"semantic.colors.primary",foreground:"semantic.colors.textInverse",borderRadius:"palette.radius.md",padding:"semantic.spacing.sm"},deny:{background:"semantic.colors.container",foreground:"semantic.colors.text",borderRadius:"palette.radius.md",padding:"semantic.spacing.sm"}},attachment:{image:{background:"palette.colors.gray.100",border:"palette.colors.gray.200"}},scrollToBottom:{background:"components.button.primary.background",foreground:"components.button.primary.foreground",border:"semantic.colors.primary",size:"40px",borderRadius:"palette.radius.full",shadow:"palette.shadows.sm",padding:"0.5rem 0.875rem",gap:"0.5rem",fontSize:"0.875rem",iconSize:"14px"},artifact:{pane:{background:"semantic.colors.container",toolbarBackground:"semantic.colors.container"}}};function Ya(a,o){if(!o.startsWith("palette.")&&!o.startsWith("semantic.")&&!o.startsWith("components."))return o;let e=o.split("."),l=a;for(let r of e){if(l==null)return;l=l[r]}return typeof l=="string"&&(l.startsWith("palette.")||l.startsWith("semantic.")||l.startsWith("components."))?Ya(a,l):l}function Zt(a){let o={};function e(l,r){for(let[d,s]of Object.entries(l)){let u=`${r}.${d}`;if(typeof s=="string"){let x=Ya(a,s);x!==void 0&&(o[u]={path:u,value:x,type:r.includes("color")?"color":r.includes("spacing")?"spacing":r.includes("typography")?"typography":r.includes("shadow")?"shadow":r.includes("border")?"border":"color"})}else typeof s=="object"&&s!==null&&e(s,u)}}return e(a.palette,"palette"),e(a.semantic,"semantic"),e(a.components,"components"),o}function ir(a){let o=[],e=[];return a.palette||o.push({path:"palette",message:"Theme must include a palette",severity:"error"}),a.semantic||e.push({path:"semantic",message:"No semantic tokens defined - defaults will be used",severity:"warning"}),a.components||e.push({path:"components",message:"No component tokens defined - defaults will be used",severity:"warning"}),{valid:o.length===0,errors:o,warnings:e}}function jt(a,o){let e={...a};for(let[l,r]of Object.entries(o)){let d=e[l];d&&typeof d=="object"&&!Array.isArray(d)&&r&&typeof r=="object"&&!Array.isArray(r)?e[l]=jt(d,r):e[l]=r}return e}function mr(a,o){return o?jt(a,o):a}function Q(a,o={}){var r,d,s,u,x,h,i,f,n,p,c,b,y;let e={palette:pr,semantic:nr,components:ur},l={palette:{...e.palette,...a==null?void 0:a.palette,colors:{...e.palette.colors,...(r=a==null?void 0:a.palette)==null?void 0:r.colors},spacing:{...e.palette.spacing,...(d=a==null?void 0:a.palette)==null?void 0:d.spacing},typography:{...e.palette.typography,...(s=a==null?void 0:a.palette)==null?void 0:s.typography},shadows:{...e.palette.shadows,...(u=a==null?void 0:a.palette)==null?void 0:u.shadows},borders:{...e.palette.borders,...(x=a==null?void 0:a.palette)==null?void 0:x.borders},radius:{...e.palette.radius,...(h=a==null?void 0:a.palette)==null?void 0:h.radius}},semantic:{...e.semantic,...a==null?void 0:a.semantic,colors:{...e.semantic.colors,...(i=a==null?void 0:a.semantic)==null?void 0:i.colors,interactive:{...e.semantic.colors.interactive,...(n=(f=a==null?void 0:a.semantic)==null?void 0:f.colors)==null?void 0:n.interactive},feedback:{...e.semantic.colors.feedback,...(c=(p=a==null?void 0:a.semantic)==null?void 0:p.colors)==null?void 0:c.feedback}},spacing:{...e.semantic.spacing,...(b=a==null?void 0:a.semantic)==null?void 0:b.spacing},typography:{...e.semantic.typography,...(y=a==null?void 0:a.semantic)==null?void 0:y.typography}},components:mr(e.components,a==null?void 0:a.components)};if(o.validate!==!1){let g=ir(l);if(!g.valid)throw new Error(`Theme validation failed: ${g.errors.map(w=>w.message).join(", ")}`)}if(o.plugins)for(let g of o.plugins)l=g.transform(l);return l}function Qt(a){var b,y,g,w,k,M,A,v,T,P,B,L,R,F,D,H,q,m,S,C,O,U,eo,ao,oo,to,ro,so,lo,fo,po,no,uo,io,mo,co,xo,ho,go,Co,bo,yo,So,wo,ko,Mo,Ao,vo,To,Po,Bo,Lo,Ro,Fo,Do,Ho,qo,Uo,Oo,Eo,Io,Wo,Vo,zo,Go,No,Xo,Ko,_o,Zo,jo,Qo,Jo,Yo,$o,et,at,ot,tt,rt,st,lt,ft,dt,pt,nt,ut,it,mt,ct,xt,ht,gt,Ct,bt,yt,St,wt,kt,Mt,At,vt,Tt,Pt,Bt,Lt,Rt,Ft,Dt,Ht,qt,Ut,Ot,Et,It,Wt,Vt,zt;let o=Zt(a),e={};for(let[t,J]of Object.entries(o)){let er=t.replace(/\./g,"-");e[`--persona-${er}`]=J.value}e["--persona-primary"]=(b=e["--persona-semantic-colors-primary"])!=null?b:e["--persona-palette-colors-primary-500"],e["--persona-secondary"]=(y=e["--persona-semantic-colors-secondary"])!=null?y:e["--persona-palette-colors-secondary-500"],e["--persona-accent"]=(g=e["--persona-semantic-colors-accent"])!=null?g:e["--persona-palette-colors-accent-500"],e["--persona-surface"]=(w=e["--persona-semantic-colors-surface"])!=null?w:e["--persona-palette-colors-gray-50"],e["--persona-background"]=(k=e["--persona-semantic-colors-background"])!=null?k:e["--persona-palette-colors-gray-50"],e["--persona-container"]=(M=e["--persona-semantic-colors-container"])!=null?M:e["--persona-palette-colors-gray-100"],e["--persona-text"]=(A=e["--persona-semantic-colors-text"])!=null?A:e["--persona-palette-colors-gray-900"],e["--persona-text-muted"]=(v=e["--persona-semantic-colors-text-muted"])!=null?v:e["--persona-palette-colors-gray-500"],e["--persona-text-inverse"]=(T=e["--persona-semantic-colors-text-inverse"])!=null?T:e["--persona-palette-colors-gray-50"],e["--persona-border"]=(P=e["--persona-semantic-colors-border"])!=null?P:e["--persona-palette-colors-gray-200"],e["--persona-divider"]=(B=e["--persona-semantic-colors-divider"])!=null?B:e["--persona-palette-colors-gray-200"],e["--persona-muted"]=e["--persona-text-muted"],e["--persona-voice-recording-indicator"]=(L=e["--persona-components-voice-recording-indicator"])!=null?L:e["--persona-palette-colors-error-500"],e["--persona-voice-recording-bg"]=(R=e["--persona-components-voice-recording-background"])!=null?R:e["--persona-palette-colors-error-50"],e["--persona-voice-processing-icon"]=(F=e["--persona-components-voice-processing-icon"])!=null?F:e["--persona-palette-colors-primary-500"],e["--persona-voice-speaking-icon"]=(D=e["--persona-components-voice-speaking-icon"])!=null?D:e["--persona-palette-colors-success-500"],e["--persona-approval-bg"]=(H=e["--persona-components-approval-requested-background"])!=null?H:e["--persona-surface"],e["--persona-approval-border"]=(q=e["--persona-components-approval-requested-border"])!=null?q:e["--persona-border"],e["--persona-approval-text"]=(m=e["--persona-components-approval-requested-text"])!=null?m:e["--persona-palette-colors-gray-900"],e["--persona-approval-shadow"]=(S=e["--persona-components-approval-requested-shadow"])!=null?S:"0 1px 2px 0 rgba(11, 11, 11, 0.06), 0 2px 8px 0 rgba(11, 11, 11, 0.04)",e["--persona-approval-approve-bg"]=(C=e["--persona-components-approval-approve-background"])!=null?C:e["--persona-button-primary-bg"],e["--persona-approval-deny-bg"]=(O=e["--persona-components-approval-deny-background"])!=null?O:e["--persona-container"],e["--persona-attachment-image-bg"]=(U=e["--persona-components-attachment-image-background"])!=null?U:e["--persona-palette-colors-gray-100"],e["--persona-attachment-image-border"]=(eo=e["--persona-components-attachment-image-border"])!=null?eo:e["--persona-palette-colors-gray-200"],e["--persona-font-family"]=(ao=e["--persona-semantic-typography-fontFamily"])!=null?ao:e["--persona-palette-typography-fontFamily-sans"],e["--persona-font-size"]=(oo=e["--persona-semantic-typography-fontSize"])!=null?oo:e["--persona-palette-typography-fontSize-base"],e["--persona-font-weight"]=(to=e["--persona-semantic-typography-fontWeight"])!=null?to:e["--persona-palette-typography-fontWeight-normal"],e["--persona-line-height"]=(ro=e["--persona-semantic-typography-lineHeight"])!=null?ro:e["--persona-palette-typography-lineHeight-normal"],e["--persona-input-font-family"]=e["--persona-font-family"],e["--persona-input-font-weight"]=e["--persona-font-weight"],e["--persona-radius-sm"]=(so=e["--persona-palette-radius-sm"])!=null?so:"0.125rem",e["--persona-radius-md"]=(lo=e["--persona-palette-radius-md"])!=null?lo:"0.375rem",e["--persona-radius-lg"]=(fo=e["--persona-palette-radius-lg"])!=null?fo:"0.5rem",e["--persona-radius-xl"]=(po=e["--persona-palette-radius-xl"])!=null?po:"0.75rem",e["--persona-radius-full"]=(no=e["--persona-palette-radius-full"])!=null?no:"9999px",e["--persona-launcher-radius"]=(io=(uo=e["--persona-components-launcher-borderRadius"])!=null?uo:e["--persona-palette-radius-full"])!=null?io:"9999px",e["--persona-launcher-bg"]=(mo=e["--persona-components-launcher-background"])!=null?mo:e["--persona-primary"],e["--persona-launcher-fg"]=(co=e["--persona-components-launcher-foreground"])!=null?co:e["--persona-text-inverse"],e["--persona-launcher-border"]=(xo=e["--persona-components-launcher-border"])!=null?xo:e["--persona-border"],e["--persona-button-primary-bg"]=(ho=e["--persona-components-button-primary-background"])!=null?ho:e["--persona-primary"],e["--persona-button-primary-fg"]=(go=e["--persona-components-button-primary-foreground"])!=null?go:e["--persona-text-inverse"],e["--persona-button-radius"]=(bo=(Co=e["--persona-components-button-primary-borderRadius"])!=null?Co:e["--persona-palette-radius-full"])!=null?bo:"9999px",e["--persona-panel-radius"]=(So=(yo=e["--persona-components-panel-borderRadius"])!=null?yo:e["--persona-radius-xl"])!=null?So:"0.75rem",e["--persona-panel-border"]=(wo=e["--persona-components-panel-border"])!=null?wo:`1px solid ${e["--persona-border"]}`,e["--persona-panel-shadow"]=(Mo=(ko=e["--persona-components-panel-shadow"])!=null?ko:e["--persona-palette-shadows-xl"])!=null?Mo:"0 25px 50px -12px rgba(0, 0, 0, 0.25)",e["--persona-launcher-shadow"]=(Ao=e["--persona-components-launcher-shadow"])!=null?Ao:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",e["--persona-input-radius"]=(To=(vo=e["--persona-components-input-borderRadius"])!=null?vo:e["--persona-radius-lg"])!=null?To:"0.5rem",e["--persona-message-user-radius"]=(Bo=(Po=e["--persona-components-message-user-borderRadius"])!=null?Po:e["--persona-radius-lg"])!=null?Bo:"0.5rem",e["--persona-message-assistant-radius"]=(Ro=(Lo=e["--persona-components-message-assistant-borderRadius"])!=null?Lo:e["--persona-radius-lg"])!=null?Ro:"0.5rem",e["--persona-header-bg"]=(Fo=e["--persona-components-header-background"])!=null?Fo:e["--persona-surface"],e["--persona-header-border"]=(Do=e["--persona-components-header-border"])!=null?Do:e["--persona-divider"],e["--persona-header-icon-bg"]=(Ho=e["--persona-components-header-iconBackground"])!=null?Ho:e["--persona-primary"],e["--persona-header-icon-fg"]=(qo=e["--persona-components-header-iconForeground"])!=null?qo:e["--persona-text-inverse"],e["--persona-header-title-fg"]=(Uo=e["--persona-components-header-titleForeground"])!=null?Uo:e["--persona-primary"],e["--persona-header-subtitle-fg"]=(Oo=e["--persona-components-header-subtitleForeground"])!=null?Oo:e["--persona-text-muted"],e["--persona-header-action-icon-fg"]=(Eo=e["--persona-components-header-actionIconForeground"])!=null?Eo:e["--persona-muted"];let l=(Io=a.components)==null?void 0:Io.header;l!=null&&l.shadow&&(e["--persona-header-shadow"]=l.shadow),l!=null&&l.borderBottom&&(e["--persona-header-border-bottom"]=l.borderBottom);let r=(Wo=a.components)==null?void 0:Wo.introCard;e["--persona-intro-card-bg"]=(Vo=e["--persona-components-introCard-background"])!=null?Vo:e["--persona-surface"],e["--persona-intro-card-radius"]=(zo=e["--persona-components-introCard-borderRadius"])!=null?zo:"1rem",e["--persona-intro-card-padding"]=(Go=e["--persona-components-introCard-padding"])!=null?Go:"1.5rem",e["--persona-intro-card-shadow"]=(Xo=(No=r==null?void 0:r.shadow)!=null?No:e["--persona-components-introCard-shadow"])!=null?Xo:"0 5px 15px rgba(15, 23, 42, 0.08)",e["--persona-input-background"]=(Ko=e["--persona-components-input-background"])!=null?Ko:e["--persona-surface"],e["--persona-input-placeholder"]=(_o=e["--persona-components-input-placeholder"])!=null?_o:e["--persona-text-muted"],e["--persona-message-user-bg"]=(Zo=e["--persona-components-message-user-background"])!=null?Zo:e["--persona-accent"],e["--persona-message-user-text"]=(jo=e["--persona-components-message-user-text"])!=null?jo:e["--persona-text-inverse"],e["--persona-message-user-shadow"]=(Qo=e["--persona-components-message-user-shadow"])!=null?Qo:"0 5px 15px rgba(15, 23, 42, 0.08)",e["--persona-message-assistant-bg"]=(Jo=e["--persona-components-message-assistant-background"])!=null?Jo:e["--persona-surface"],e["--persona-message-assistant-text"]=(Yo=e["--persona-components-message-assistant-text"])!=null?Yo:e["--persona-text"],e["--persona-message-assistant-border"]=($o=e["--persona-components-message-assistant-border"])!=null?$o:e["--persona-border"],e["--persona-message-assistant-shadow"]=(et=e["--persona-components-message-assistant-shadow"])!=null?et:"0 1px 2px 0 rgb(0 0 0 / 0.05)",e["--persona-scroll-to-bottom-bg"]=(ot=(at=e["--persona-components-scrollToBottom-background"])!=null?at:e["--persona-button-primary-bg"])!=null?ot:e["--persona-accent"],e["--persona-scroll-to-bottom-fg"]=(rt=(tt=e["--persona-components-scrollToBottom-foreground"])!=null?tt:e["--persona-button-primary-fg"])!=null?rt:e["--persona-text-inverse"],e["--persona-scroll-to-bottom-border"]=(st=e["--persona-components-scrollToBottom-border"])!=null?st:e["--persona-primary"],e["--persona-scroll-to-bottom-size"]=(lt=e["--persona-components-scrollToBottom-size"])!=null?lt:"40px",e["--persona-scroll-to-bottom-radius"]=(pt=(dt=(ft=e["--persona-components-scrollToBottom-borderRadius"])!=null?ft:e["--persona-button-radius"])!=null?dt:e["--persona-radius-full"])!=null?pt:"9999px",e["--persona-scroll-to-bottom-shadow"]=(ut=(nt=e["--persona-components-scrollToBottom-shadow"])!=null?nt:e["--persona-palette-shadows-sm"])!=null?ut:"0 1px 2px 0 rgb(0 0 0 / 0.05)",e["--persona-scroll-to-bottom-padding"]=(it=e["--persona-components-scrollToBottom-padding"])!=null?it:"0.5rem 0.875rem",e["--persona-scroll-to-bottom-gap"]=(mt=e["--persona-components-scrollToBottom-gap"])!=null?mt:"0.5rem",e["--persona-scroll-to-bottom-font-size"]=(xt=(ct=e["--persona-components-scrollToBottom-fontSize"])!=null?ct:e["--persona-palette-typography-fontSize-sm"])!=null?xt:"0.875rem",e["--persona-scroll-to-bottom-icon-size"]=(ht=e["--persona-components-scrollToBottom-iconSize"])!=null?ht:"14px",e["--persona-tool-bubble-shadow"]=(gt=e["--persona-components-toolBubble-shadow"])!=null?gt:"0 5px 15px rgba(15, 23, 42, 0.08)",e["--persona-reasoning-bubble-shadow"]=(Ct=e["--persona-components-reasoningBubble-shadow"])!=null?Ct:"0 5px 15px rgba(15, 23, 42, 0.08)",e["--persona-composer-shadow"]=(bt=e["--persona-components-composer-shadow"])!=null?bt:"none",e["--persona-md-inline-code-bg"]=(yt=e["--persona-components-markdown-inlineCode-background"])!=null?yt:e["--persona-container"],e["--persona-md-inline-code-color"]=(St=e["--persona-components-markdown-inlineCode-foreground"])!=null?St:e["--persona-text"],e["--persona-md-link-color"]=(kt=(wt=e["--persona-components-markdown-link-foreground"])!=null?wt:e["--persona-accent"])!=null?kt:"#0f0f0f";let d=e["--persona-components-markdown-heading-h1-fontSize"];d&&(e["--persona-md-h1-size"]=d);let s=e["--persona-components-markdown-heading-h1-fontWeight"];s&&(e["--persona-md-h1-weight"]=s);let u=e["--persona-components-markdown-heading-h2-fontSize"];u&&(e["--persona-md-h2-size"]=u);let x=e["--persona-components-markdown-heading-h2-fontWeight"];x&&(e["--persona-md-h2-weight"]=x);let h=e["--persona-components-markdown-prose-fontFamily"];h&&h!=="inherit"&&(e["--persona-md-prose-font-family"]=h),e["--persona-md-code-block-bg"]=(Mt=e["--persona-components-markdown-codeBlock-background"])!=null?Mt:e["--persona-container"],e["--persona-md-code-block-border-color"]=(At=e["--persona-components-markdown-codeBlock-borderColor"])!=null?At:e["--persona-border"],e["--persona-md-code-block-text-color"]=(vt=e["--persona-components-markdown-codeBlock-textColor"])!=null?vt:"inherit",e["--persona-md-table-header-bg"]=(Tt=e["--persona-components-markdown-table-headerBackground"])!=null?Tt:e["--persona-container"],e["--persona-md-table-border-color"]=(Pt=e["--persona-components-markdown-table-borderColor"])!=null?Pt:e["--persona-border"],e["--persona-md-hr-color"]=(Bt=e["--persona-components-markdown-hr-color"])!=null?Bt:e["--persona-divider"],e["--persona-md-blockquote-border-color"]=(Lt=e["--persona-components-markdown-blockquote-borderColor"])!=null?Lt:e["--persona-palette-colors-gray-900"],e["--persona-md-blockquote-bg"]=(Rt=e["--persona-components-markdown-blockquote-background"])!=null?Rt:"transparent",e["--persona-md-blockquote-text-color"]=(Ft=e["--persona-components-markdown-blockquote-textColor"])!=null?Ft:e["--persona-palette-colors-gray-500"],e["--cw-container"]=(Dt=e["--persona-components-collapsibleWidget-container"])!=null?Dt:e["--persona-surface"],e["--cw-surface"]=(Ht=e["--persona-components-collapsibleWidget-surface"])!=null?Ht:e["--persona-surface"],e["--cw-border"]=(qt=e["--persona-components-collapsibleWidget-border"])!=null?qt:e["--persona-border"],e["--persona-message-border"]=(Ut=e["--persona-components-message-border"])!=null?Ut:e["--persona-border"];let i=a.components,f=i==null?void 0:i.iconButton;f&&(f.background&&(e["--persona-icon-btn-bg"]=f.background),f.border&&(e["--persona-icon-btn-border"]=f.border),f.color&&(e["--persona-icon-btn-color"]=f.color),f.padding&&(e["--persona-icon-btn-padding"]=f.padding),f.borderRadius&&(e["--persona-icon-btn-radius"]=f.borderRadius),f.hoverBackground&&(e["--persona-icon-btn-hover-bg"]=f.hoverBackground),f.hoverColor&&(e["--persona-icon-btn-hover-color"]=f.hoverColor),f.activeBackground&&(e["--persona-icon-btn-active-bg"]=f.activeBackground),f.activeBorder&&(e["--persona-icon-btn-active-border"]=f.activeBorder));let n=i==null?void 0:i.labelButton;n&&(n.background&&(e["--persona-label-btn-bg"]=n.background),n.border&&(e["--persona-label-btn-border"]=n.border),n.color&&(e["--persona-label-btn-color"]=n.color),n.padding&&(e["--persona-label-btn-padding"]=n.padding),n.borderRadius&&(e["--persona-label-btn-radius"]=n.borderRadius),n.hoverBackground&&(e["--persona-label-btn-hover-bg"]=n.hoverBackground),n.fontSize&&(e["--persona-label-btn-font-size"]=n.fontSize),n.gap&&(e["--persona-label-btn-gap"]=n.gap));let p=i==null?void 0:i.toggleGroup;p&&(p.gap&&(e["--persona-toggle-group-gap"]=p.gap),p.borderRadius&&(e["--persona-toggle-group-radius"]=p.borderRadius));let c=i==null?void 0:i.artifact;if(c!=null&&c.toolbar){let t=c.toolbar;t.iconHoverColor&&(e["--persona-artifact-toolbar-icon-hover-color"]=t.iconHoverColor),t.iconHoverBackground&&(e["--persona-artifact-toolbar-icon-hover-bg"]=t.iconHoverBackground),t.iconPadding&&(e["--persona-artifact-toolbar-icon-padding"]=t.iconPadding),t.iconBorderRadius&&(e["--persona-artifact-toolbar-icon-radius"]=t.iconBorderRadius),t.iconBorder&&(e["--persona-artifact-toolbar-icon-border"]=t.iconBorder),t.toggleGroupGap&&(e["--persona-artifact-toolbar-toggle-group-gap"]=t.toggleGroupGap),t.toggleBorderRadius&&(e["--persona-artifact-toolbar-toggle-radius"]=t.toggleBorderRadius),t.copyBackground&&(e["--persona-artifact-toolbar-copy-bg"]=t.copyBackground),t.copyBorder&&(e["--persona-artifact-toolbar-copy-border"]=t.copyBorder),t.copyColor&&(e["--persona-artifact-toolbar-copy-color"]=t.copyColor),t.copyBorderRadius&&(e["--persona-artifact-toolbar-copy-radius"]=t.copyBorderRadius),t.copyPadding&&(e["--persona-artifact-toolbar-copy-padding"]=t.copyPadding),t.copyMenuBackground&&(e["--persona-artifact-toolbar-copy-menu-bg"]=t.copyMenuBackground,e["--persona-dropdown-bg"]=(Ot=e["--persona-dropdown-bg"])!=null?Ot:t.copyMenuBackground),t.copyMenuBorder&&(e["--persona-artifact-toolbar-copy-menu-border"]=t.copyMenuBorder,e["--persona-dropdown-border"]=(Et=e["--persona-dropdown-border"])!=null?Et:t.copyMenuBorder),t.copyMenuShadow&&(e["--persona-artifact-toolbar-copy-menu-shadow"]=t.copyMenuShadow,e["--persona-dropdown-shadow"]=(It=e["--persona-dropdown-shadow"])!=null?It:t.copyMenuShadow),t.copyMenuBorderRadius&&(e["--persona-artifact-toolbar-copy-menu-radius"]=t.copyMenuBorderRadius,e["--persona-dropdown-radius"]=(Wt=e["--persona-dropdown-radius"])!=null?Wt:t.copyMenuBorderRadius),t.copyMenuItemHoverBackground&&(e["--persona-artifact-toolbar-copy-menu-item-hover-bg"]=t.copyMenuItemHoverBackground,e["--persona-dropdown-item-hover-bg"]=(Vt=e["--persona-dropdown-item-hover-bg"])!=null?Vt:t.copyMenuItemHoverBackground),t.iconBackground&&(e["--persona-artifact-toolbar-icon-bg"]=t.iconBackground),t.toolbarBorder&&(e["--persona-artifact-toolbar-border"]=t.toolbarBorder)}if(c!=null&&c.tab){let t=c.tab;t.background&&(e["--persona-artifact-tab-bg"]=t.background),t.activeBackground&&(e["--persona-artifact-tab-active-bg"]=t.activeBackground),t.activeBorder&&(e["--persona-artifact-tab-active-border"]=t.activeBorder),t.borderRadius&&(e["--persona-artifact-tab-radius"]=t.borderRadius),t.textColor&&(e["--persona-artifact-tab-color"]=t.textColor),t.hoverBackground&&(e["--persona-artifact-tab-hover-bg"]=t.hoverBackground),t.listBackground&&(e["--persona-artifact-tab-list-bg"]=t.listBackground),t.listBorderColor&&(e["--persona-artifact-tab-list-border-color"]=t.listBorderColor),t.listPadding&&(e["--persona-artifact-tab-list-padding"]=t.listPadding)}if(c!=null&&c.pane){let t=c.pane;if(t.toolbarBackground){let J=(zt=Ya(a,t.toolbarBackground))!=null?zt:t.toolbarBackground;e["--persona-artifact-toolbar-bg"]=J}}return e}var cr={colors:{primary:{50:"#ffffff",100:"#f5f5f5",200:"#d4d4d4",300:"#a3a3a3",400:"#737373",500:"#171717",600:"#0f0f0f",700:"#0a0a0a",800:"#050505",900:"#030303",950:"#000000"},secondary:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},accent:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},success:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},warning:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},error:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"}}},Jt=a=>{if(!(!a||typeof a!="object"||Array.isArray(a)))return a},xr=()=>{var a;return typeof document!="undefined"&&document.documentElement.classList.contains("dark")||typeof window!="undefined"&&((a=window.matchMedia)!=null&&a.call(window,"(prefers-color-scheme: dark)").matches)?"dark":"light"},hr=a=>{var e;let o=(e=a==null?void 0:a.colorScheme)!=null?e:"light";return o==="light"?"light":o==="dark"?"dark":xr()},gr=a=>hr(a),Cr=a=>Q(a),br=a=>{var e;let o=Q(void 0,{validate:!1});return Q({...a,palette:{...o.palette,colors:{...cr.colors,...(e=a==null?void 0:a.palette)==null?void 0:e.colors}}},{validate:!1})},yr=a=>{let o=gr(a),e=Jt(a==null?void 0:a.theme),l=Jt(a==null?void 0:a.darkTheme);return o==="dark"?br(j(e!=null?e:{},l!=null?l:{})):Cr(e)},Sr=a=>Qt(a),$a=(a,o)=>{let e=yr(o),l=Sr(e);for(let[r,d]of Object.entries(l))a.style.setProperty(r,d)};var $t="data-persona-launcher-critical",wr=a=>{if(a instanceof HTMLElement)return a;if(typeof a=="string"){let o=document.querySelector(a);if(o)return o}return document.body},Yt=a=>{var o;return{...a,launcher:{...Ja,...a==null?void 0:a.launcher,dock:{...Ja.dock,...(o=a==null?void 0:a.launcher)==null?void 0:o.dock}}}},kr=a=>{if(typeof window=="undefined"||typeof document=="undefined")throw new Error("AgentWidgetLauncher can only be mounted in a browser environment");let{onOpen:o}=a,e=wr(a.target),l=Yt(a.config),r=document.createElement("div");r.setAttribute("data-persona-root","true"),r.setAttribute($t,"true"),$a(r,l);let d=Xt(l,o);return r.appendChild(d.element),e.appendChild(r),{root:r,element:d.element,update:s=>{let u=Yt(s);$a(r,u),d.update(u)},destroy:()=>{d.destroy(),r.remove()}}};return lr(Mr);})();
|
|
9
|
+
`,e.addEventListener("click",r);let l=d=>{let s=d.launcher??{},i=Ga(d),c=e.querySelector("[data-role='launcher-title']");if(c){let m=s.title??"Chat Assistant";c.textContent=m,c.setAttribute("title",m)}let g=e.querySelector("[data-role='launcher-subtitle']");if(g){let m=s.subtitle??"Here to help you get answers fast";g.textContent=m,g.setAttribute("title",m)}let h=e.querySelector(".persona-flex-col");h&&(s.textHidden||i?h.style.display="none":h.style.display="");let f=e.querySelector("[data-role='launcher-icon']");if(f)if(s.agentIconHidden)f.style.display="none";else{let m=s.agentIconSize??"40px";if(f.style.height=m,f.style.width=m,s.agentIconBackgroundColor?(f.style.backgroundColor=s.agentIconBackgroundColor,f.classList.remove("persona-bg-persona-primary")):(f.style.backgroundColor="",f.classList.add("persona-bg-persona-primary")),f.innerHTML="",s.agentIconName){let S=parseFloat(m)||24,b=Oa(s.agentIconName,S*.6,"var(--persona-text-inverse, #ffffff)",2);b?(f.appendChild(b),f.style.display=""):(f.textContent=s.agentIconText??"\u{1F4AC}",f.style.display="")}else s.iconUrl?f.style.display="none":(f.textContent=s.agentIconText??"\u{1F4AC}",f.style.display="")}let p=e.querySelector("[data-role='launcher-image']");if(p){let m=s.agentIconSize??"40px";p.style.height=m,p.style.width=m,s.iconUrl&&!s.agentIconName&&!s.agentIconHidden?(p.src=s.iconUrl,p.style.display="block"):p.style.display="none"}let n=e.querySelector("[data-role='launcher-call-to-action-icon']");if(n){let m=s.callToActionIconSize??"32px";n.style.height=m,n.style.width=m,s.callToActionIconBackgroundColor?(n.style.backgroundColor=s.callToActionIconBackgroundColor,n.classList.remove("persona-bg-persona-primary")):(n.style.backgroundColor="",n.classList.add("persona-bg-persona-primary")),s.callToActionIconColor?(n.style.color=s.callToActionIconColor,n.classList.remove("persona-text-persona-call-to-action")):(n.style.color="",n.classList.add("persona-text-persona-call-to-action"));let S=0;if(s.callToActionIconPadding?(n.style.boxSizing="border-box",n.style.padding=s.callToActionIconPadding,S=(parseFloat(s.callToActionIconPadding)||0)*2):(n.style.boxSizing="",n.style.padding=""),s.callToActionIconHidden)n.style.display="none";else if(n.style.display=i?"none":"",n.innerHTML="",s.callToActionIconName){let b=parseFloat(m)||24,k=Math.max(b-S,8),w=Oa(s.callToActionIconName,k,"currentColor",2);w?n.appendChild(w):n.textContent=s.callToActionIconText??"\u2197"}else n.textContent=s.callToActionIconText??"\u2197"}let x=s.position&&M[s.position]?M[s.position]:M["bottom-right"],u="persona-fixed persona-flex persona-items-center persona-gap-3 persona-rounded-launcher persona-bg-persona-surface persona-py-2.5 persona-pl-3 persona-pr-3 persona-transition hover:persona-translate-y-[-2px] persona-cursor-pointer",E="persona-relative persona-mt-4 persona-mb-4 persona-mx-auto persona-flex persona-items-center persona-justify-center persona-rounded-launcher persona-bg-persona-surface persona-transition hover:persona-translate-y-[-2px] persona-cursor-pointer";e.className=i?E:`${u} ${x}`,i||(e.style.zIndex=String(s.zIndex??Ea));let y="1px solid var(--persona-border, #e5e7eb)",I="var(--persona-launcher-shadow, 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1))";e.style.border=s.border??y,e.style.boxShadow=s.shadow!==void 0?s.shadow.trim()===""?"none":s.shadow:I,i?(e.style.width="0",e.style.minWidth="0",e.style.maxWidth="0",e.style.padding="0",e.style.overflow="hidden",e.style.border="none",e.style.boxShadow="none"):(e.style.width="",e.style.minWidth="",e.style.maxWidth=s.collapsedMaxWidth??"",e.style.justifyContent="",e.style.padding="",e.style.overflow="")},t=()=>{e.removeEventListener("click",r),e.remove()};return o&&l(o),{element:e,update:l,destroy:t}};var Xa=o=>typeof o=="object"&&o!==null&&!Array.isArray(o);function U(o,r){if(!o)return r;if(!r)return o;let e={...o};for(let[l,t]of Object.entries(r)){let d=e[l];Xa(d)&&Xa(t)?e[l]=U(d,t):e[l]=t}return e}var Ia="min(440px, calc(100vw - 24px))",_a="440px",Wa={enabled:!0,mountMode:"floating",dock:{side:"right",width:"420px"},title:"Chat Assistant",subtitle:"Here to help you get answers fast",agentIconText:"\u{1F4AC}",agentIconName:"bot",headerIconName:"bot",position:"bottom-right",width:Ia,heightOffset:0,autoExpand:!1,callToActionIconHidden:!1,agentIconSize:"40px",headerIconSize:"40px",closeButtonSize:"32px",closeButtonPaddingX:"0px",closeButtonPaddingY:"0px",callToActionIconName:"arrow-up-right",callToActionIconText:"",callToActionIconSize:"32px",callToActionIconPadding:"5px",callToActionIconColor:void 0,callToActionIconBackgroundColor:void 0,closeButtonBackgroundColor:"transparent",clearChat:{backgroundColor:"transparent",borderColor:"transparent",enabled:!0,placement:"inline",iconName:"refresh-cw",size:"32px",showTooltip:!0,tooltipText:"Clear chat",paddingX:"0px",paddingY:"0px"},headerIconHidden:!1,border:void 0,shadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)"};var Ka="16px",Za="transparent",io={colors:{primary:{50:"#ffffff",100:"#f5f5f5",200:"#d4d4d4",300:"#a3a3a3",400:"#737373",500:"#171717",600:"#0f0f0f",700:"#0a0a0a",800:"#050505",900:"#030303",950:"#000000"},secondary:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},accent:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},success:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},warning:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},error:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"},info:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"}},spacing:{0:"0px",1:"0.25rem",2:"0.5rem",3:"0.75rem",4:"1rem",5:"1.25rem",6:"1.5rem",8:"2rem",10:"2.5rem",12:"3rem",16:"4rem",20:"5rem",24:"6rem",32:"8rem",40:"10rem",48:"12rem",56:"14rem",64:"16rem"},typography:{fontFamily:{sans:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',serif:'Georgia, Cambria, "Times New Roman", Times, serif',mono:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},fontSize:{xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem","2xl":"1.5rem","3xl":"1.875rem","4xl":"2.25rem"},fontWeight:{normal:"400",medium:"500",semibold:"600",bold:"700"},lineHeight:{tight:"1.25",normal:"1.5",relaxed:"1.625"}},shadows:{none:"none",sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)"},borders:{none:"none",sm:"1px solid",md:"2px solid",lg:"4px solid"},radius:{none:"0px",sm:"0.125rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem",full:"9999px"}},mo={colors:{primary:"palette.colors.primary.500",secondary:"palette.colors.secondary.500",accent:"palette.colors.primary.600",surface:"palette.colors.gray.50",background:"palette.colors.gray.50",container:"palette.colors.gray.50",text:"palette.colors.gray.900",textMuted:"palette.colors.gray.500",textInverse:"palette.colors.gray.50",border:"palette.colors.gray.200",divider:"palette.colors.gray.200",interactive:{default:"palette.colors.primary.600",hover:"palette.colors.primary.700",focus:"palette.colors.primary.600",active:"palette.colors.primary.600",disabled:"palette.colors.gray.300"},feedback:{success:"palette.colors.success.500",warning:"palette.colors.warning.500",error:"palette.colors.error.500",info:"palette.colors.info.500"}},spacing:{xs:"palette.spacing.1",sm:"palette.spacing.2",md:"palette.spacing.4",lg:"palette.spacing.6",xl:"palette.spacing.8","2xl":"palette.spacing.10"},typography:{fontFamily:"palette.typography.fontFamily.sans",fontSize:"palette.typography.fontSize.base",fontWeight:"palette.typography.fontWeight.normal",lineHeight:"palette.typography.lineHeight.normal"}},co={button:{primary:{background:"palette.colors.primary.500",foreground:"palette.colors.primary.50",borderRadius:"palette.radius.lg",padding:"semantic.spacing.md"},secondary:{background:"semantic.colors.surface",foreground:"semantic.colors.secondary",borderRadius:"palette.radius.lg",padding:"semantic.spacing.md"},ghost:{background:"transparent",foreground:"semantic.colors.text",borderRadius:"palette.radius.md",padding:"semantic.spacing.sm"}},input:{background:"palette.colors.gray.50",placeholder:"palette.colors.gray.400",borderRadius:"palette.radius.lg",padding:"semantic.spacing.md",focus:{border:"palette.colors.gray.400",ring:"palette.colors.gray.400"}},launcher:{background:"palette.colors.primary.500",foreground:"palette.colors.primary.50",border:"palette.colors.gray.200",size:"60px",iconSize:"28px",borderRadius:"palette.radius.full",shadow:"palette.shadows.lg"},panel:{width:Ia,maxWidth:_a,height:"600px",maxHeight:"calc(100vh - 80px)",borderRadius:"palette.radius.xl",shadow:"palette.shadows.xl",inset:Ka,canvasBackground:Za},header:{background:"palette.colors.primary.500",border:"palette.colors.primary.600",borderRadius:"palette.radius.xl palette.radius.xl 0 0",padding:"semantic.spacing.md",iconBackground:"palette.colors.primary.600",iconForeground:"palette.colors.primary.50",titleForeground:"palette.colors.primary.50",subtitleForeground:"palette.colors.primary.200",actionIconForeground:"palette.colors.primary.200"},message:{user:{background:"palette.colors.primary.500",text:"palette.colors.primary.50",borderRadius:"palette.radius.lg",shadow:"palette.shadows.sm"},assistant:{background:"palette.colors.gray.50",text:"palette.colors.gray.900",borderRadius:"palette.radius.lg",border:"palette.colors.gray.200",shadow:"palette.shadows.sm"},border:"semantic.colors.border"},introCard:{background:"semantic.colors.surface",borderRadius:"palette.radius.2xl",padding:"semantic.spacing.lg",shadow:"0 5px 15px rgba(15, 23, 42, 0.08)"},toolBubble:{shadow:"palette.shadows.sm"},reasoningBubble:{shadow:"palette.shadows.sm"},composer:{shadow:"palette.shadows.none"},markdown:{inlineCode:{background:"palette.colors.gray.50",foreground:"palette.colors.gray.900"},link:{foreground:"palette.colors.primary.600"},prose:{fontFamily:"inherit"},codeBlock:{background:"semantic.colors.container",borderColor:"semantic.colors.border",textColor:"inherit"},table:{headerBackground:"semantic.colors.container",borderColor:"semantic.colors.border"},hr:{color:"semantic.colors.divider"},blockquote:{borderColor:"palette.colors.gray.900",background:"transparent",textColor:"palette.colors.gray.500"}},collapsibleWidget:{container:"palette.colors.gray.50",surface:"semantic.colors.surface",border:"semantic.colors.border"},voice:{recording:{indicator:"palette.colors.error.500",background:"palette.colors.error.50",border:"palette.colors.error.200"},processing:{icon:"palette.colors.primary.500",background:"palette.colors.primary.50"},speaking:{icon:"palette.colors.success.500"}},approval:{requested:{background:"semantic.colors.surface",border:"semantic.colors.border",text:"palette.colors.gray.900",shadow:"0 1px 2px 0 rgba(11, 11, 11, 0.06), 0 2px 8px 0 rgba(11, 11, 11, 0.04)"},approve:{background:"semantic.colors.primary",foreground:"semantic.colors.textInverse",borderRadius:"palette.radius.md",padding:"semantic.spacing.sm"},deny:{background:"semantic.colors.container",foreground:"semantic.colors.text",borderRadius:"palette.radius.md",padding:"semantic.spacing.sm"}},attachment:{image:{background:"palette.colors.gray.100",border:"palette.colors.gray.200"}},scrollToBottom:{background:"components.button.primary.background",foreground:"components.button.primary.foreground",border:"semantic.colors.primary",size:"40px",borderRadius:"palette.radius.full",shadow:"palette.shadows.sm",padding:"0.5rem 0.875rem",gap:"0.5rem",fontSize:"0.875rem",iconSize:"14px"},artifact:{pane:{background:"semantic.colors.container",toolbarBackground:"semantic.colors.container"}}};function C(o,r){if(!r.startsWith("palette.")&&!r.startsWith("semantic.")&&!r.startsWith("components."))return r;let e=r.split("."),l=o;for(let t of e){if(l==null)return;l=l[t]}return typeof l=="string"&&(l.startsWith("palette.")||l.startsWith("semantic.")||l.startsWith("components."))?C(o,l):l}function ja(o){let r={};function e(l,t){for(let[d,s]of Object.entries(l)){let i=`${t}.${d}`;if(typeof s=="string"){let c=C(o,s);c!==void 0&&(r[i]={path:i,value:c,type:t.includes("color")?"color":t.includes("spacing")?"spacing":t.includes("typography")?"typography":t.includes("shadow")?"shadow":t.includes("border")?"border":"color"})}else typeof s=="object"&&s!==null&&e(s,i)}}return e(o.palette,"palette"),e(o.semantic,"semantic"),e(o.components,"components"),r}function xo(o){let r=[],e=[];return o.palette||r.push({path:"palette",message:"Theme must include a palette",severity:"error"}),o.semantic||e.push({path:"semantic",message:"No semantic tokens defined - defaults will be used",severity:"warning"}),o.components||e.push({path:"components",message:"No component tokens defined - defaults will be used",severity:"warning"}),{valid:r.length===0,errors:r,warnings:e}}function Qa(o,r){let e={...o};for(let[l,t]of Object.entries(r)){let d=e[l];d&&typeof d=="object"&&!Array.isArray(d)&&t&&typeof t=="object"&&!Array.isArray(t)?e[l]=Qa(d,t):e[l]=t}return e}function ho(o,r){return r?Qa(o,r):o}function O(o,r={}){let e={palette:io,semantic:mo,components:co},l={palette:{...e.palette,...o?.palette,colors:{...e.palette.colors,...o?.palette?.colors},spacing:{...e.palette.spacing,...o?.palette?.spacing},typography:{...e.palette.typography,...o?.palette?.typography},shadows:{...e.palette.shadows,...o?.palette?.shadows},borders:{...e.palette.borders,...o?.palette?.borders},radius:{...e.palette.radius,...o?.palette?.radius}},semantic:{...e.semantic,...o?.semantic,colors:{...e.semantic.colors,...o?.semantic?.colors,interactive:{...e.semantic.colors.interactive,...o?.semantic?.colors?.interactive},feedback:{...e.semantic.colors.feedback,...o?.semantic?.colors?.feedback}},spacing:{...e.semantic.spacing,...o?.semantic?.spacing},typography:{...e.semantic.typography,...o?.semantic?.typography}},components:ho(e.components,o?.components)};if(r.validate!==!1){let t=xo(l);if(!t.valid)throw new Error(`Theme validation failed: ${t.errors.map(d=>d.message).join(", ")}`)}if(r.plugins)for(let t of r.plugins)l=t.transform(l);return l}function Ja(o){let r=ja(o),e={};for(let[a,W]of Object.entries(r)){let oo=a.replace(/\./g,"-");e[`--persona-${oo}`]=W.value}e["--persona-primary"]=e["--persona-semantic-colors-primary"]??e["--persona-palette-colors-primary-500"],e["--persona-secondary"]=e["--persona-semantic-colors-secondary"]??e["--persona-palette-colors-secondary-500"],e["--persona-accent"]=e["--persona-semantic-colors-accent"]??e["--persona-palette-colors-accent-500"],e["--persona-surface"]=e["--persona-semantic-colors-surface"]??e["--persona-palette-colors-gray-50"],e["--persona-background"]=e["--persona-semantic-colors-background"]??e["--persona-palette-colors-gray-50"],e["--persona-container"]=e["--persona-semantic-colors-container"]??e["--persona-palette-colors-gray-100"],e["--persona-text"]=e["--persona-semantic-colors-text"]??e["--persona-palette-colors-gray-900"],e["--persona-text-muted"]=e["--persona-semantic-colors-text-muted"]??e["--persona-palette-colors-gray-500"],e["--persona-text-inverse"]=e["--persona-semantic-colors-text-inverse"]??e["--persona-palette-colors-gray-50"],e["--persona-border"]=e["--persona-semantic-colors-border"]??e["--persona-palette-colors-gray-200"],e["--persona-divider"]=e["--persona-semantic-colors-divider"]??e["--persona-palette-colors-gray-200"],e["--persona-muted"]=e["--persona-text-muted"],e["--persona-voice-recording-indicator"]=e["--persona-components-voice-recording-indicator"]??e["--persona-palette-colors-error-500"],e["--persona-voice-recording-bg"]=e["--persona-components-voice-recording-background"]??e["--persona-palette-colors-error-50"],e["--persona-voice-processing-icon"]=e["--persona-components-voice-processing-icon"]??e["--persona-palette-colors-primary-500"],e["--persona-voice-speaking-icon"]=e["--persona-components-voice-speaking-icon"]??e["--persona-palette-colors-success-500"],e["--persona-approval-bg"]=e["--persona-components-approval-requested-background"]??e["--persona-surface"],e["--persona-approval-border"]=e["--persona-components-approval-requested-border"]??e["--persona-border"],e["--persona-approval-text"]=e["--persona-components-approval-requested-text"]??e["--persona-palette-colors-gray-900"],e["--persona-approval-shadow"]=e["--persona-components-approval-requested-shadow"]??"0 1px 2px 0 rgba(11, 11, 11, 0.06), 0 2px 8px 0 rgba(11, 11, 11, 0.04)",e["--persona-approval-approve-bg"]=e["--persona-components-approval-approve-background"]??e["--persona-button-primary-bg"],e["--persona-approval-deny-bg"]=e["--persona-components-approval-deny-background"]??e["--persona-container"],e["--persona-attachment-image-bg"]=e["--persona-components-attachment-image-background"]??e["--persona-palette-colors-gray-100"],e["--persona-attachment-image-border"]=e["--persona-components-attachment-image-border"]??e["--persona-palette-colors-gray-200"],e["--persona-font-family"]=e["--persona-semantic-typography-fontFamily"]??e["--persona-palette-typography-fontFamily-sans"],e["--persona-font-size"]=e["--persona-semantic-typography-fontSize"]??e["--persona-palette-typography-fontSize-base"],e["--persona-font-weight"]=e["--persona-semantic-typography-fontWeight"]??e["--persona-palette-typography-fontWeight-normal"],e["--persona-line-height"]=e["--persona-semantic-typography-lineHeight"]??e["--persona-palette-typography-lineHeight-normal"],e["--persona-input-font-family"]=e["--persona-font-family"],e["--persona-input-font-weight"]=e["--persona-font-weight"],e["--persona-radius-sm"]=e["--persona-palette-radius-sm"]??"0.125rem",e["--persona-radius-md"]=e["--persona-palette-radius-md"]??"0.375rem",e["--persona-radius-lg"]=e["--persona-palette-radius-lg"]??"0.5rem",e["--persona-radius-xl"]=e["--persona-palette-radius-xl"]??"0.75rem",e["--persona-radius-full"]=e["--persona-palette-radius-full"]??"9999px",e["--persona-launcher-radius"]=e["--persona-components-launcher-borderRadius"]??e["--persona-palette-radius-full"]??"9999px",e["--persona-launcher-bg"]=e["--persona-components-launcher-background"]??e["--persona-primary"],e["--persona-launcher-fg"]=e["--persona-components-launcher-foreground"]??e["--persona-text-inverse"],e["--persona-launcher-border"]=e["--persona-components-launcher-border"]??e["--persona-border"],e["--persona-button-primary-bg"]=e["--persona-components-button-primary-background"]??e["--persona-primary"],e["--persona-button-primary-fg"]=e["--persona-components-button-primary-foreground"]??e["--persona-text-inverse"],e["--persona-button-radius"]=e["--persona-components-button-primary-borderRadius"]??e["--persona-palette-radius-full"]??"9999px",e["--persona-panel-radius"]=e["--persona-components-panel-borderRadius"]??e["--persona-radius-xl"]??"0.75rem",e["--persona-panel-border"]=e["--persona-components-panel-border"]??`1px solid ${e["--persona-border"]}`,e["--persona-panel-shadow"]=e["--persona-components-panel-shadow"]??e["--persona-palette-shadows-xl"]??"0 25px 50px -12px rgba(0, 0, 0, 0.25)",e["--persona-panel-inset"]=e["--persona-components-panel-inset"]??Ka,e["--persona-panel-canvas-bg"]=e["--persona-components-panel-canvasBackground"]??Za,e["--persona-launcher-shadow"]=e["--persona-components-launcher-shadow"]??"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1)",e["--persona-input-radius"]=e["--persona-components-input-borderRadius"]??e["--persona-radius-lg"]??"0.5rem",e["--persona-message-user-radius"]=e["--persona-components-message-user-borderRadius"]??e["--persona-radius-lg"]??"0.5rem",e["--persona-message-assistant-radius"]=e["--persona-components-message-assistant-borderRadius"]??e["--persona-radius-lg"]??"0.5rem",e["--persona-header-bg"]=e["--persona-components-header-background"]??e["--persona-surface"],e["--persona-header-border"]=e["--persona-components-header-border"]??e["--persona-divider"],e["--persona-header-icon-bg"]=e["--persona-components-header-iconBackground"]??e["--persona-primary"],e["--persona-header-icon-fg"]=e["--persona-components-header-iconForeground"]??e["--persona-text-inverse"],e["--persona-header-title-fg"]=e["--persona-components-header-titleForeground"]??e["--persona-primary"],e["--persona-header-subtitle-fg"]=e["--persona-components-header-subtitleForeground"]??e["--persona-text-muted"],e["--persona-header-action-icon-fg"]=e["--persona-components-header-actionIconForeground"]??e["--persona-muted"];let l=o.components?.header;l?.shadow&&(e["--persona-header-shadow"]=l.shadow),l?.borderBottom&&(e["--persona-header-border-bottom"]=l.borderBottom);let t=o.components?.introCard;e["--persona-intro-card-bg"]=e["--persona-components-introCard-background"]??e["--persona-surface"],e["--persona-intro-card-radius"]=e["--persona-components-introCard-borderRadius"]??"1rem",e["--persona-intro-card-padding"]=e["--persona-components-introCard-padding"]??"1.5rem",e["--persona-intro-card-shadow"]=t?.shadow??e["--persona-components-introCard-shadow"]??"0 5px 15px rgba(15, 23, 42, 0.08)",e["--persona-input-background"]=e["--persona-components-input-background"]??e["--persona-surface"],e["--persona-input-placeholder"]=e["--persona-components-input-placeholder"]??e["--persona-text-muted"],e["--persona-message-user-bg"]=e["--persona-components-message-user-background"]??e["--persona-accent"],e["--persona-message-user-text"]=e["--persona-components-message-user-text"]??e["--persona-text-inverse"],e["--persona-message-user-shadow"]=e["--persona-components-message-user-shadow"]??"0 5px 15px rgba(15, 23, 42, 0.08)",e["--persona-message-assistant-bg"]=e["--persona-components-message-assistant-background"]??e["--persona-surface"],e["--persona-message-assistant-text"]=e["--persona-components-message-assistant-text"]??e["--persona-text"],e["--persona-message-assistant-border"]=e["--persona-components-message-assistant-border"]??e["--persona-border"],e["--persona-message-assistant-shadow"]=e["--persona-components-message-assistant-shadow"]??"0 1px 2px 0 rgb(0 0 0 / 0.05)",e["--persona-scroll-to-bottom-bg"]=e["--persona-components-scrollToBottom-background"]??e["--persona-button-primary-bg"]??e["--persona-accent"],e["--persona-scroll-to-bottom-fg"]=e["--persona-components-scrollToBottom-foreground"]??e["--persona-button-primary-fg"]??e["--persona-text-inverse"],e["--persona-scroll-to-bottom-border"]=e["--persona-components-scrollToBottom-border"]??e["--persona-primary"],e["--persona-scroll-to-bottom-size"]=e["--persona-components-scrollToBottom-size"]??"40px",e["--persona-scroll-to-bottom-radius"]=e["--persona-components-scrollToBottom-borderRadius"]??e["--persona-button-radius"]??e["--persona-radius-full"]??"9999px",e["--persona-scroll-to-bottom-shadow"]=e["--persona-components-scrollToBottom-shadow"]??e["--persona-palette-shadows-sm"]??"0 1px 2px 0 rgb(0 0 0 / 0.05)",e["--persona-scroll-to-bottom-padding"]=e["--persona-components-scrollToBottom-padding"]??"0.5rem 0.875rem",e["--persona-scroll-to-bottom-gap"]=e["--persona-components-scrollToBottom-gap"]??"0.5rem",e["--persona-scroll-to-bottom-font-size"]=e["--persona-components-scrollToBottom-fontSize"]??e["--persona-palette-typography-fontSize-sm"]??"0.875rem",e["--persona-scroll-to-bottom-icon-size"]=e["--persona-components-scrollToBottom-iconSize"]??"14px",e["--persona-tool-bubble-shadow"]=e["--persona-components-toolBubble-shadow"]??"0 5px 15px rgba(15, 23, 42, 0.08)",e["--persona-reasoning-bubble-shadow"]=e["--persona-components-reasoningBubble-shadow"]??"0 5px 15px rgba(15, 23, 42, 0.08)",e["--persona-composer-shadow"]=e["--persona-components-composer-shadow"]??"none",e["--persona-md-inline-code-bg"]=e["--persona-components-markdown-inlineCode-background"]??e["--persona-container"],e["--persona-md-inline-code-color"]=e["--persona-components-markdown-inlineCode-foreground"]??e["--persona-text"],e["--persona-md-link-color"]=e["--persona-components-markdown-link-foreground"]??e["--persona-accent"]??"#0f0f0f";let d=e["--persona-components-markdown-heading-h1-fontSize"];d&&(e["--persona-md-h1-size"]=d);let s=e["--persona-components-markdown-heading-h1-fontWeight"];s&&(e["--persona-md-h1-weight"]=s);let i=e["--persona-components-markdown-heading-h2-fontSize"];i&&(e["--persona-md-h2-size"]=i);let c=e["--persona-components-markdown-heading-h2-fontWeight"];c&&(e["--persona-md-h2-weight"]=c);let g=e["--persona-components-markdown-prose-fontFamily"];g&&g!=="inherit"&&(e["--persona-md-prose-font-family"]=g),e["--persona-md-code-block-bg"]=e["--persona-components-markdown-codeBlock-background"]??e["--persona-container"],e["--persona-md-code-block-border-color"]=e["--persona-components-markdown-codeBlock-borderColor"]??e["--persona-border"],e["--persona-md-code-block-text-color"]=e["--persona-components-markdown-codeBlock-textColor"]??"inherit",e["--persona-md-table-header-bg"]=e["--persona-components-markdown-table-headerBackground"]??e["--persona-container"],e["--persona-md-table-border-color"]=e["--persona-components-markdown-table-borderColor"]??e["--persona-border"],e["--persona-md-hr-color"]=e["--persona-components-markdown-hr-color"]??e["--persona-divider"],e["--persona-md-blockquote-border-color"]=e["--persona-components-markdown-blockquote-borderColor"]??e["--persona-palette-colors-gray-900"],e["--persona-md-blockquote-bg"]=e["--persona-components-markdown-blockquote-background"]??"transparent",e["--persona-md-blockquote-text-color"]=e["--persona-components-markdown-blockquote-textColor"]??e["--persona-palette-colors-gray-500"],e["--cw-container"]=e["--persona-components-collapsibleWidget-container"]??e["--persona-surface"],e["--cw-surface"]=e["--persona-components-collapsibleWidget-surface"]??e["--persona-surface"],e["--cw-border"]=e["--persona-components-collapsibleWidget-border"]??e["--persona-border"],e["--persona-message-border"]=e["--persona-components-message-border"]??e["--persona-border"];let h=o.components,f=h?.iconButton;f&&(f.background&&(e["--persona-icon-btn-bg"]=f.background),f.border&&(e["--persona-icon-btn-border"]=f.border),f.color&&(e["--persona-icon-btn-color"]=f.color),f.padding&&(e["--persona-icon-btn-padding"]=f.padding),f.borderRadius&&(e["--persona-icon-btn-radius"]=f.borderRadius),f.hoverBackground&&(e["--persona-icon-btn-hover-bg"]=f.hoverBackground),f.hoverColor&&(e["--persona-icon-btn-hover-color"]=f.hoverColor),f.activeBackground&&(e["--persona-icon-btn-active-bg"]=f.activeBackground),f.activeBorder&&(e["--persona-icon-btn-active-border"]=f.activeBorder));let p=h?.labelButton;p&&(p.background&&(e["--persona-label-btn-bg"]=p.background),p.border&&(e["--persona-label-btn-border"]=p.border),p.color&&(e["--persona-label-btn-color"]=p.color),p.padding&&(e["--persona-label-btn-padding"]=p.padding),p.borderRadius&&(e["--persona-label-btn-radius"]=p.borderRadius),p.hoverBackground&&(e["--persona-label-btn-hover-bg"]=p.hoverBackground),p.fontSize&&(e["--persona-label-btn-font-size"]=p.fontSize),p.gap&&(e["--persona-label-btn-gap"]=p.gap));let n=h?.toggleGroup;n&&(n.gap&&(e["--persona-toggle-group-gap"]=n.gap),n.borderRadius&&(e["--persona-toggle-group-radius"]=n.borderRadius));let x=h?.artifact;if(x?.toolbar){let a=x.toolbar;a.iconHoverColor&&(e["--persona-artifact-toolbar-icon-hover-color"]=a.iconHoverColor),a.iconHoverBackground&&(e["--persona-artifact-toolbar-icon-hover-bg"]=a.iconHoverBackground),a.iconPadding&&(e["--persona-artifact-toolbar-icon-padding"]=a.iconPadding),a.iconBorderRadius&&(e["--persona-artifact-toolbar-icon-radius"]=a.iconBorderRadius),a.iconBorder&&(e["--persona-artifact-toolbar-icon-border"]=a.iconBorder),a.toggleGroupGap&&(e["--persona-artifact-toolbar-toggle-group-gap"]=a.toggleGroupGap),a.toggleBorderRadius&&(e["--persona-artifact-toolbar-toggle-radius"]=a.toggleBorderRadius),a.toggleGroupPadding&&(e["--persona-artifact-toolbar-toggle-group-padding"]=a.toggleGroupPadding),a.toggleGroupBorder&&(e["--persona-artifact-toolbar-toggle-group-border"]=a.toggleGroupBorder),a.toggleGroupBorderRadius&&(e["--persona-artifact-toolbar-toggle-group-radius"]=a.toggleGroupBorderRadius),a.toggleGroupBackground&&(e["--persona-artifact-toolbar-toggle-group-bg"]=C(o,a.toggleGroupBackground)??a.toggleGroupBackground),a.copyBackground&&(e["--persona-artifact-toolbar-copy-bg"]=a.copyBackground),a.copyBorder&&(e["--persona-artifact-toolbar-copy-border"]=a.copyBorder),a.copyColor&&(e["--persona-artifact-toolbar-copy-color"]=a.copyColor),a.copyBorderRadius&&(e["--persona-artifact-toolbar-copy-radius"]=a.copyBorderRadius),a.copyPadding&&(e["--persona-artifact-toolbar-copy-padding"]=a.copyPadding),a.copyMenuBackground&&(e["--persona-artifact-toolbar-copy-menu-bg"]=a.copyMenuBackground,e["--persona-dropdown-bg"]=e["--persona-dropdown-bg"]??a.copyMenuBackground),a.copyMenuBorder&&(e["--persona-artifact-toolbar-copy-menu-border"]=a.copyMenuBorder,e["--persona-dropdown-border"]=e["--persona-dropdown-border"]??a.copyMenuBorder),a.copyMenuShadow&&(e["--persona-artifact-toolbar-copy-menu-shadow"]=a.copyMenuShadow,e["--persona-dropdown-shadow"]=e["--persona-dropdown-shadow"]??a.copyMenuShadow),a.copyMenuBorderRadius&&(e["--persona-artifact-toolbar-copy-menu-radius"]=a.copyMenuBorderRadius,e["--persona-dropdown-radius"]=e["--persona-dropdown-radius"]??a.copyMenuBorderRadius),a.copyMenuItemHoverBackground&&(e["--persona-artifact-toolbar-copy-menu-item-hover-bg"]=a.copyMenuItemHoverBackground,e["--persona-dropdown-item-hover-bg"]=e["--persona-dropdown-item-hover-bg"]??a.copyMenuItemHoverBackground),a.iconBackground&&(e["--persona-artifact-toolbar-icon-bg"]=a.iconBackground),a.toolbarBorder&&(e["--persona-artifact-toolbar-border"]=a.toolbarBorder)}if(x?.tab){let a=x.tab;a.background&&(e["--persona-artifact-tab-bg"]=a.background),a.activeBackground&&(e["--persona-artifact-tab-active-bg"]=a.activeBackground),a.activeBorder&&(e["--persona-artifact-tab-active-border"]=a.activeBorder),a.borderRadius&&(e["--persona-artifact-tab-radius"]=a.borderRadius),a.textColor&&(e["--persona-artifact-tab-color"]=a.textColor),a.hoverBackground&&(e["--persona-artifact-tab-hover-bg"]=a.hoverBackground),a.listBackground&&(e["--persona-artifact-tab-list-bg"]=a.listBackground),a.listBorderColor&&(e["--persona-artifact-tab-list-border-color"]=a.listBorderColor),a.listPadding&&(e["--persona-artifact-tab-list-padding"]=a.listPadding)}if(x?.pane){let a=x.pane;if(a.toolbarBackground){let W=C(o,a.toolbarBackground)??a.toolbarBackground;e["--persona-artifact-toolbar-bg"]=W}}if(x?.card){let a=x.card;a.background&&(e["--persona-artifact-card-bg"]=a.background),a.border&&(e["--persona-artifact-card-border"]=a.border),a.borderRadius&&(e["--persona-artifact-card-radius"]=a.borderRadius),a.hoverBackground&&(e["--persona-artifact-card-hover-bg"]=a.hoverBackground),a.hoverBorderColor&&(e["--persona-artifact-card-hover-border"]=a.hoverBorderColor)}if(x?.inline){let a=x.inline;a.background&&(e["--persona-artifact-inline-bg"]=C(o,a.background)??a.background),a.border&&(e["--persona-artifact-inline-border"]=a.border),a.borderRadius&&(e["--persona-artifact-inline-radius"]=a.borderRadius),a.chromeBackground&&(e["--persona-artifact-inline-chrome-bg"]=C(o,a.chromeBackground)??a.chromeBackground),a.chromeBorder&&(e["--persona-artifact-inline-chrome-border"]=C(o,a.chromeBorder)??a.chromeBorder),a.titleColor&&(e["--persona-artifact-inline-title-color"]=C(o,a.titleColor)??a.titleColor),a.mutedColor&&(e["--persona-artifact-inline-muted-color"]=C(o,a.mutedColor)??a.mutedColor),a.frameHeight&&(e["--persona-artifact-inline-frame-height"]=a.frameHeight)}let u=h?.code;u&&(u.keywordColor&&(e["--persona-code-keyword-color"]=u.keywordColor),u.stringColor&&(e["--persona-code-string-color"]=u.stringColor),u.commentColor&&(e["--persona-code-comment-color"]=u.commentColor),u.numberColor&&(e["--persona-code-number-color"]=u.numberColor),u.tagColor&&(e["--persona-code-tag-color"]=u.tagColor),u.attrColor&&(e["--persona-code-attr-color"]=u.attrColor),u.propertyColor&&(e["--persona-code-property-color"]=u.propertyColor),u.lineNumberColor&&(e["--persona-code-line-number-color"]=u.lineNumberColor),u.gutterBorderColor&&(e["--persona-code-gutter-border-color"]=u.gutterBorderColor),u.background&&(e["--persona-code-bg"]=C(o,u.background)??u.background));let E=e["--persona-surface"],y=e["--persona-container"],I=e["--persona-palette-colors-gray-100"]??"#f3f4f6",m=e["--persona-palette-colors-gray-200"]??"#e5e7eb",S=e["--persona-palette-colors-gray-300"]??"#d1d5db",b=!y||y===E,k=b?I:y,w=b?m:y;return e["--persona-icon-btn-hover-bg"]=e["--persona-icon-btn-hover-bg"]??k,e["--persona-icon-btn-active-bg"]=e["--persona-icon-btn-active-bg"]??w,b&&(e["--persona-icon-btn-active-border"]=e["--persona-icon-btn-active-border"]??S),e["--persona-label-btn-hover-bg"]=e["--persona-label-btn-hover-bg"]??k,e["--persona-artifact-tab-hover-bg"]=e["--persona-artifact-tab-hover-bg"]??k,e["--persona-artifact-card-hover-bg"]=e["--persona-artifact-card-hover-bg"]??k,e}var go={colors:{primary:{50:"#ffffff",100:"#f5f5f5",200:"#d4d4d4",300:"#a3a3a3",400:"#737373",500:"#171717",600:"#0f0f0f",700:"#0a0a0a",800:"#050505",900:"#030303",950:"#000000"},secondary:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},accent:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},success:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d"},warning:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12"},error:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d"}}},Ya=o=>{if(!(!o||typeof o!="object"||Array.isArray(o)))return o},Co=()=>typeof document<"u"&&document.documentElement.classList.contains("dark")||typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light",bo=o=>{let r=o?.colorScheme??"light";return r==="light"?"light":r==="dark"?"dark":Co()},$a=o=>bo(o),yo=o=>O(o),So=o=>{let r=O(void 0,{validate:!1});return O({...o,palette:{...r.palette,colors:{...go.colors,...o?.palette?.colors}}},{validate:!1})},ko=o=>{let r=$a(o),e=Ya(o?.theme),l=Ya(o?.darkTheme);return r==="dark"?So(U(e??{},l??{})):yo(e)},wo=o=>Ja(o),Va=(o,r)=>{let e=ko(r),l=wo(e);for(let[t,d]of Object.entries(l))o.style.setProperty(t,d);o.setAttribute("data-persona-color-scheme",$a(r))};var ao="data-persona-launcher-critical",Mo=o=>{if(o instanceof HTMLElement)return o;if(typeof o=="string"){let r=document.querySelector(o);if(r)return r}return document.body},eo=o=>({...o,launcher:{...Wa,...o?.launcher,dock:{...Wa.dock,...o?.launcher?.dock}}}),vo=o=>{if(typeof window>"u"||typeof document>"u")throw new Error("AgentWidgetLauncher can only be mounted in a browser environment");let{onOpen:r}=o,e=Mo(o.target),l=eo(o.config),t=document.createElement("div");t.setAttribute("data-persona-root","true"),t.setAttribute(ao,"true"),Va(t,l);let d=Na(l,r);return t.appendChild(d.element),e.appendChild(t),{root:t,element:d.element,update:s=>{let i=eo(s);Va(t,i),d.update(i)},destroy:()=>{d.destroy(),t.remove()}}};return no(Ao);})();
|
|
10
10
|
/*! Bundled license information:
|
|
11
11
|
|
|
12
12
|
lucide/dist/esm/icons/activity.mjs:
|
|
@@ -34,6 +34,7 @@ lucide/dist/esm/icons/circle-x.mjs:
|
|
|
34
34
|
lucide/dist/esm/icons/clipboard-copy.mjs:
|
|
35
35
|
lucide/dist/esm/icons/clipboard.mjs:
|
|
36
36
|
lucide/dist/esm/icons/clock.mjs:
|
|
37
|
+
lucide/dist/esm/icons/code-xml.mjs:
|
|
37
38
|
lucide/dist/esm/icons/copy.mjs:
|
|
38
39
|
lucide/dist/esm/icons/credit-card.mjs:
|
|
39
40
|
lucide/dist/esm/icons/dollar-sign.mjs:
|