@whitenight_5/web-assistant 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,56 @@
1
+ (function(e){typeof define==`function`&&define.amd?define([],e):e()})(function(){var e=`web-assistant-shadow-host`,t=`__web_assistant_core_loaded`,n=document.currentScript?.src??``,r=n?n.replace(/\/[^/]+\.js$/,`/`):``,i=`
2
+ #${e} {
3
+ all: initial;
4
+ }
5
+ #${e} * {
6
+ box-sizing: border-box;
7
+ }
8
+ .fab-button {
9
+ position: fixed;
10
+ bottom: 24px;
11
+ right: 24px;
12
+ z-index: 2147483647;
13
+ width: 56px;
14
+ height: 56px;
15
+ border-radius: 50%;
16
+ border: none;
17
+ background: #FF641E;
18
+ color: white;
19
+ cursor: pointer;
20
+ display: flex;
21
+ align-items: center;
22
+ justify-content: center;
23
+ box-shadow: 0 4px 16px rgba(255, 100, 30, 0.3);
24
+ transition: transform 0.2s ease, opacity 0.2s ease;
25
+ font-size: 24px;
26
+ line-height: 1;
27
+ }
28
+ .fab-button:hover {
29
+ transform: scale(1.05);
30
+ }
31
+ .fab-button:active {
32
+ transform: scale(0.95);
33
+ }
34
+ .fab-loading {
35
+ position: fixed;
36
+ bottom: 24px;
37
+ right: 24px;
38
+ z-index: 2147483647;
39
+ width: 56px;
40
+ height: 56px;
41
+ display: flex;
42
+ align-items: center;
43
+ justify-content: center;
44
+ }
45
+ .fab-spinner {
46
+ width: 24px;
47
+ height: 24px;
48
+ border: 3px solid rgba(255, 100, 30, 0.2);
49
+ border-top-color: #FF641E;
50
+ border-radius: 50%;
51
+ animation: fab-spin 0.8s linear infinite;
52
+ }
53
+ @keyframes fab-spin {
54
+ to { transform: rotate(360deg); }
55
+ }
56
+ `,a=`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m14.5 6.5-11 11"/><path d="m14.5 6.5 3-3"/><path d="m17.5 3.5 3 3"/><path d="M9.5 14.5 3 21"/><path d="M17.5 14.5 21 11"/><path d="M14.5 17.5 11 21"/></svg>`,o=()=>{if(document.getElementById(e))return;let n=document.createElement(`div`);n.id=e,document.body.appendChild(n);let o=n.attachShadow({mode:`open`}),s=document.createElement(`style`);s.textContent=i,o.appendChild(s);let c=document.createElement(`div`);c.id=`confirm-portal`,c.style.cssText=`position:absolute;z-index:50;`;let l=document.createElement(`div`);l.id=`web-assistant-mount`,l.style.cssText=`position:fixed;bottom:96px;right:10px;z-index:9999999;display:none;`;let u=document.createElement(`div`),d=document.createElement(`button`);d.className=`fab-button`,d.innerHTML=a,d.setAttribute(`aria-label`,`Open AI Assistant`),o.appendChild(d),d.addEventListener(`click`,()=>{if(globalThis[t])return;globalThis[t]=!0;let e=document.createElement(`div`);e.className=`fab-loading`,e.innerHTML=`<div class="fab-spinner"></div>`,o.replaceChild(e,d);let i=r+`web-assistant-core.umd.css`,a=document.createElement(`link`);a.rel=`stylesheet`,a.href=i,o.appendChild(a);let s=r+`web-assistant-core.umd.js`,u=document.createElement(`script`);u.src=s,u.onload=()=>{l.style.display=``;let e=new CustomEvent(`web-assistant-core-ready`,{detail:{shadowRoot:o,mountPoint:l,portalTarget:c,host:n}});document.dispatchEvent(e)},document.body.appendChild(u)}),l.appendChild(c),l.appendChild(u),o.appendChild(l)};document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,o,{once:!0}):o()});