arcy.js 0.0.2 → 0.1.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/README.md +94 -3
- package/dist/arcy.chat.ab181cf5a84b.js +1258 -0
- package/dist/arcy.flow.fef131718e42.js +3 -0
- package/dist/arcy.legacy.ab4e9266b657.js +567 -0
- package/dist/arcy.loader.js +2 -0
- package/dist/arcy.modern.60faeffc62a2.js +567 -0
- package/dist/arcy.picker.c598a581d964.js +59 -0
- package/dist/design-mode.cjs +135 -0
- package/dist/design-mode.d.cts +197 -0
- package/dist/design-mode.d.ts +197 -0
- package/dist/design-mode.js +127 -0
- package/dist/fonts/dm-sans-latin-ext.woff2 +0 -0
- package/dist/fonts/dm-sans-latin.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-latin-ext.woff2 +0 -0
- package/dist/fonts/ibm-plex-sans-latin.woff2 +0 -0
- package/dist/fonts/inter-latin-ext.woff2 +0 -0
- package/dist/fonts/inter-latin.woff2 +0 -0
- package/dist/fonts/lato-latin-ext.woff2 +0 -0
- package/dist/fonts/lato-latin.woff2 +0 -0
- package/dist/fonts/manrope-latin-ext.woff2 +0 -0
- package/dist/fonts/manrope-latin.woff2 +0 -0
- package/dist/fonts/montserrat-latin-ext.woff2 +0 -0
- package/dist/fonts/montserrat-latin.woff2 +0 -0
- package/dist/fonts/nunito-latin-ext.woff2 +0 -0
- package/dist/fonts/nunito-latin.woff2 +0 -0
- package/dist/fonts/open-sans-latin-ext.woff2 +0 -0
- package/dist/fonts/open-sans-latin.woff2 +0 -0
- package/dist/fonts/playfair-display-latin-ext.woff2 +0 -0
- package/dist/fonts/playfair-display-latin.woff2 +0 -0
- package/dist/fonts/poppins-latin-ext.woff2 +0 -0
- package/dist/fonts/poppins-latin.woff2 +0 -0
- package/dist/fonts/roboto-latin-ext.woff2 +0 -0
- package/dist/fonts/roboto-latin.woff2 +0 -0
- package/dist/fonts/source-sans-3-latin-ext.woff2 +0 -0
- package/dist/fonts/source-sans-3-latin.woff2 +0 -0
- package/dist/fonts/work-sans-latin-ext.woff2 +0 -0
- package/dist/fonts/work-sans-latin.woff2 +0 -0
- package/dist/index.cjs +5114 -0
- package/dist/index.d.cts +133 -0
- package/dist/index.d.ts +133 -0
- package/dist/index.js +5109 -0
- package/dist/snippet.cjs +46 -0
- package/dist/snippet.d.cts +39 -0
- package/dist/snippet.d.ts +39 -0
- package/dist/snippet.js +43 -0
- package/package.json +69 -5
- package/index.js +0 -5
|
@@ -0,0 +1,567 @@
|
|
|
1
|
+
(function(){'use strict';/* arcy.js — https://arcyai.com */
|
|
2
|
+
var vr=Object.defineProperty,Sr=Object.defineProperties;var Tr=Object.getOwnPropertyDescriptors;var Qt=Object.getOwnPropertySymbols;var Er=Object.prototype.hasOwnProperty,xr=Object.prototype.propertyIsEnumerable;var Zt=(e,t,n)=>t in e?vr(e,t,{enumerable:true,configurable:true,writable:true,value:n}):e[t]=n,U=(e,t)=>{for(var n in t||(t={}))Er.call(t,n)&&Zt(e,n,t[n]);if(Qt)for(var n of Qt(t))xr.call(t,n)&&Zt(e,n,t[n]);return e},se=(e,t)=>Sr(e,Tr(t));var D=(e,t,n)=>new Promise((r,i)=>{var s=a=>{try{u(n.next(a));}catch(c){i(c);}},o=a=>{try{u(n.throw(a));}catch(c){i(c);}},u=a=>a.done?r(a.value):Promise.resolve(a.value).then(s,o);u((n=n.apply(e,t)).next());});function w(e){typeof console!="undefined"&&console.warn&&console.warn(`[arcy] ${e}`);}function en(){let e=new Map;function t(r,i){if(typeof i!="function")return w(`on("${r}") needs a function. Ignoring.`),()=>{};let s=e.get(r);return s||(s=new Set,e.set(r,s)),s.add(i),()=>{s.delete(i);}}function n(r){let i=e.get(r);if(i)for(let s of [...i])try{s();}catch(o){w(`A "${r}" handler threw. ${String(o)}`);}}return {on:t,emit:n}}function mt(e){if(e.parentElement!==null)return e.parentElement;let t=e.parentNode;return t!==null&&"host"in t?t.host:null}var tn=[/[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g,/\b\d{3}-\d{2}-\d{4}\b/g,/\b\d(?:[ -]?\d){12,18}\b/g],Ar="[masked]";function ht(e){return tn.some(t=>(t.lastIndex=0,t.test(e)))}var gt=4096,kr=100,Ir=64;function Ge(e){if(!e)return;let t=e.slice(0,gt);if(e.length>gt){let r=t.search(/\s\S*$/);t=r===-1?t.slice(0,gt-kr):t.slice(0,r);}let n=t.replace(/\s+/g," ").trim();if(n){for(let r of tn)n=n.replace(r,Ar);return n.slice(0,80)}}function nn(e){return !(e.length===0||e.length>64||e.includes(":")||e.startsWith("radix-")||/^\d+$/.test(e)||/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e))}var _r=["data-testid","data-test","data-cy","id","name","aria-label"],Cr=["data-testid","data-test","data-cy"],Pr=64;function Rr(e){for(let t of Cr){let n=e.getAttribute(t);if(n===null)continue;let r=n.trim();if(!(r===""||r.length>Pr)&&!ht(r))return r}}var Lr=new Set(["navigation","main","banner","contentinfo","search","form","region","dialog"]);function Mr(e){let t=mt(e);for(;t!==null;){let n=t.tagName.toLowerCase();if(n==="body"||n==="html")return;for(let i of _r){let s=t.getAttribute(i);if(s===null||i==="id"&&!nn(s))continue;let o=Ge(s);if(o!==void 0)return {tag:n,attr:i,value:o}}let r=t.getAttribute("role");if(r!==null&&Lr.has(r))return {tag:n,attr:"role",value:r};t=mt(t);}}function Or(e){let t=0,n=e.previousElementSibling;for(;n!==null;)n.tagName===e.tagName&&(t+=1),n=n.previousElementSibling;return t}function rn(e){let t={tag:e.tagName.toLowerCase(),siblingIndex:Or(e)},n=Ge(e.textContent);n!==void 0&&(t.text=n);let r=Ge(e.getAttribute("aria-label"));r!==void 0&&(t.ariaLabel=r);let i=Ge(e.getAttribute("placeholder"));i!==void 0&&(t.placeholder=i);let s=e.getAttribute("id");s!==null&&nn(s)&&!ht(s)&&(t.id=s);let o=e.getAttribute("role");if(o!==null){let c=o.trim();c!==""&&c.length<=Ir&&!ht(c)&&(t.role=c);}let u=Rr(e);u!==void 0&&(t.testId=u);let a=Mr(e);return a!==void 0&&(t.ancestorTag=a.tag,t.ancestorAttr=a.attr,t.ancestorValue=a.value),t}var on="arcy.picker.c598a581d964.js",an="arcy.chat.ab181cf5a84b.js",sn="arcy.flow.fef131718e42.js";var Dr=/^(?:\d+|[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|[0-9a-f]{12,})$/i,Nr=/^[^@\s/]+@[^@\s/]+\.[^@\s/]+$/;function Fr(e){if(e.indexOf("%")===-1)return e;try{return decodeURIComponent(e)}catch(t){return e}}function ln(e){return e.length===0?false:Dr.test(e)?true:Nr.test(Fr(e))}function He(e){let n=e.split("/").map(r=>ln(r)?":id":r).join("/");for(;n.length>1&&n.charAt(n.length-1)==="/";)n=n.slice(0,-1);return n.length===0?"/":n}function Br(e){if(e.length===0)return "";let t=[];for(let n of e.split("&")){if(n.length===0)continue;let r=n.indexOf("="),i=r===-1?n:n.slice(0,r);if(i.length===0)continue;let s=ln(i)?":id":i;t.indexOf(s)===-1&&t.push(s);}return t.length===0?"":(t.sort(),`?${t.join("&")}`)}function Hr(e,t){var n;try{let r=new URL(e,t!=null?t:void 0);return {path:r.pathname,query:r.search.slice(1)}}catch(r){let i=(n=e.split("#")[0])!=null?n:"";if(!i.startsWith("/"))return null;let s=i.indexOf("?");return s===-1?{path:i,query:""}:{path:i.slice(0,s),query:i.slice(s+1)}}}function cn(e,t){if(typeof e!="string"||e.length===0)return null;let n=Hr(e,t);if(n===null)return null;let r=He(n.path);if(!r)return null;if(r.length>=2048)return r.slice(0,2048);let i=Br(n.query);return i.length===0||r.length+i.length>2048?r:r+i}var yt="__arcyPicker";var Ve=2,un="arcy:design-mode:ready",dn="arcy:design-mode:pick",fn="arcy:design-mode:exit",pn="arcy:design-mode:screenshot";var hn="arcy-widget",mn="data-arcy",bt="2147483000",Vr=[["position","fixed"],["inset","0"],["z-index",bt],["pointer-events","none"],["background","transparent"],["border","0"],["box-shadow","none"],["outline","0"]],Ur=[["margin","0"],["padding","0"]],gn="data-arcy-style",Ue=new Map;function Wr(e=hn){let t=Ue.get(e);return t!==void 0&&t.host.isConnected}function Xe(e={}){var i,s,o;if(typeof document=="undefined")return null;let t=(i=e.id)!=null?i:hn,n=e.container;if(Wr(t))return w("This ARCY surface is already on this page. Ignoring the second mount."),null;Ue.delete(t);let r=(s=n!=null?n:document.body)!=null?s:document.documentElement;if(!r)return w("The page has no <body> to mount into yet. The widget will not render."),null;if(!n){let u=document.querySelectorAll(`[${mn}]`);for(let a=0;a<u.length;a+=1)if(((o=u[a])==null?void 0:o.id)===t)return w("Another copy of ARCY is already on this page. Ignoring this one."),null}try{let u=document.createElement("div");u.id=t,u.setAttribute(mn,"");for(let[p,y]of Vr)u.style.setProperty(p,y,"important");for(let[p,y]of Ur)u.style.setProperty(p,y);let a=u,c=!1;try{u.attachShadow&&(a=u.attachShadow({mode:"closed"}),c=!0);}catch(p){}r.appendChild(u),Kr(u);let T={host:u,root:a,isolated:c,destroy(){try{u.parentNode&&u.parentNode.removeChild(u);}catch(p){}Ue.get(t)===T&&Ue.delete(t);}};return Ue.set(t,T),T}catch(u){return w(`The widget could not mount. ${String(u)}`),null}}var $r=["pointerdown","pointerup","pointercancel","mousedown","mouseup","click","dblclick","auxclick","contextmenu","touchstart","touchend","touchcancel","focusin","focusout","keydown","keyup","keypress","beforeinput","input","change","compositionstart","compositionupdate","compositionend","cut","copy","paste"];function Kr(e){let t=n=>{try{n.stopPropagation();}catch(r){}};for(let n of $r)try{e.addEventListener(n,t);}catch(r){}try{e.addEventListener("mousedown",n=>{n.defaultPrevented||wt(e.ownerDocument,e);});}catch(n){}}function wt(e,t){try{let n=e.activeElement;if(!n||n===t||t.contains(n)||n===e.body||n===e.documentElement)return;let r=n.blur;typeof r=="function"&&r.call(n);}catch(n){}}function yn(e,t){var n;if(!e.isolated)return false;try{let r=e.root.querySelector(`[${gn}]`);if(r)return r.textContent=`${(n=r.textContent)!=null?n:""}
|
|
3
|
+
${t}`,!0;let i=e.host.ownerDocument.createElement("style");return i.setAttribute(gn,""),i.textContent=t,e.root.appendChild(i),!0}catch(r){return w(`The widget could not apply its styles. ${String(r)}`),false}}var zr="arcy-picker-notice",Gr=[["left","50%"],["bottom","24px"]],Xr=[["transform","translateX(-50%)"],["box-sizing","border-box"],["max-width","min(520px, calc(100vw - 32px))"],["padding","14px 16px"],["border-radius","12px"],["background","#101828"],["color","#ffffff"],["font",'13px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'],["box-shadow","0 8px 24px rgba(16, 24, 40, 0.28)"]],Yr=[["font-weight","600"],["margin-bottom","4px"]],jr=[["color","#d0d5dd"]],qr=[["appearance","none"],["margin-top","10px"],["border","1px solid rgba(255, 255, 255, 0.25)"],["border-radius","999px"],["background","transparent"],["color","#ffffff"],["font","inherit"],["padding","4px 12px"],["cursor","pointer"]];function Ye(e,t){for(let[n,r]of t)e.style.setProperty(n,r);}var bn=false;function je(e){if(bn)return;let t=null;try{if(t=Xe({id:zr}),!t)return;bn=!0;let n=t.host.ownerDocument,r=n.createElement("div");r.style.setProperty("position","absolute","important"),r.style.setProperty("pointer-events","auto","important");for(let[a,c]of Gr)r.style.setProperty(a,c,"important");Ye(r,Xr);let i=n.createElement("div");Ye(i,Yr),i.textContent="ARCY element picker did not start";let s=n.createElement("div");Ye(s,jr),s.textContent=e;let o=n.createElement("button");o.type="button",Ye(o,qr),o.textContent="Dismiss";let u=t;o.addEventListener("click",()=>{try{u.destroy();}catch(a){}}),r.append(i,s,o),t.root.appendChild(r);}catch(n){try{t==null||t.destroy();}catch(r){}}}function he(e){w(e),je(e);}var vt="arcy_picker",Jr="/api/v1/sdk/tagging/verify",Qr="https://cdn.arcyai.com";var Zr=15e3,eo=1e4;function to(e,t){var n;return (n=St(e))!=null?n:St(t)}function St(e){if(!e)return null;try{let t=new URLSearchParams(e.charAt(0)==="#"?e.slice(1):e).get(vt);return t&&t.length>0?t:null}catch(t){return null}}function no(e){try{let t=new URL(e.location.href),n=t.searchParams.has(vt),r=St(t.hash)!==null;if(!n&&!r)return;n&&t.searchParams.delete(vt),r&&(t.hash=""),e.history.replaceState(e.history.state,"",t.toString());}catch(t){}}function ro(e){return D(this,null,function*(){let{apiBase:t,token:n,nonce:r,fetchImpl:i,timeoutMs:s=eo,setTimeoutImpl:o=(c,T)=>setTimeout(c,T)}=e;if(!i)return null;let u=()=>D(null,null,function*(){try{let c=yield i(`${t}${Jr}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify({token:r}),credentials:"omit"});if(!c.ok)return null;let T=yield c.json();if((T==null?void 0:T.ok)!==!0)return null;let p=oo(T.returnOrigin);return p?{returnOrigin:p,screenshotsEnabled:T.elementScreenshotsEnabled!==!1}:(he("This ARCY server has not been told where its dashboard lives, so a pick would have nowhere to go. Set FRONTEND_DASHBOARD_URL and try again."),null)}catch(c){return null}}),a=new Promise(c=>{try{o(()=>c(null),s);}catch(T){}});return Promise.race([u(),a])})}function oo(e){if(typeof e!="string"||e.length===0)return null;try{let{origin:t}=new URL(e);return t&&t!=="null"?t:null}catch(t){return null}}function io(e,t,n,r){return new Promise(i=>{let s=false,o=null,u=g=>{s||(s=true,o&&(o.onload=null,o.onerror=null),i(g));},a=false,c=g=>{a||(a=true,he(g));},T=()=>{let g;try{g=e[yt];}catch(b){return c("The element picker registration could not be read. Design mode is off."),null}if(!g)return null;if(typeof g.mount!="function")return c("The element picker registered something unusable. Design mode is off."),null;let E;try{E=g.contract;}catch(b){E=void 0;}return E!==2?(c(`The element picker on the CDN speaks contract ${typeof E=="number"?E:"unknown"}, this arcy.js speaks ${2}. Update arcy.js to use design mode.`),null):g},p=g=>{try{let E=T();!E&&!a&&g(),u(E);}catch(E){u(null);}},y=false;try{y=e[yt]!==void 0;}catch(g){y=true;}if(y){p(()=>{});return}try{let g=e.document;o=g.createElement("script"),o.async=!0,o.src=`${t}/${on}`;let E=o.src;o.onload=()=>p(()=>he("The element picker loaded but did not register. Design mode is off.")),o.onerror=()=>{try{he(`Failed to load ${E}. Design mode is off. If this page sets a Content-Security-Policy, it must allow scripts from ${t}.`);}catch(b){}u(null);},(g.head||g.documentElement).appendChild(o);}catch(g){he(`The element picker could not load. ${String(g)}`),u(null);return}try{r(()=>{s||he("The element picker did not load in time. Design mode is off."),u(null);},n);}catch(g){}})}function ao(e){try{let t=e.location.pathname;return typeof t!="string"||!t.startsWith("/")?"/":He(t)}catch(t){return "/"}}function so(e){try{let t=e.opener;return !!t&&!t.closed}catch(t){return false}}function qe(e,t,n){try{let r=e.opener;if(!r||r.closed){w("The ARCY dashboard window is gone, so that pick could not be sent.");return}r.postMessage(n,t);}catch(r){w(`That pick could not be sent to the ARCY dashboard. ${String(r)}`);}}function vn(e){return D(this,null,function*(){try{let{win:t,token:n,apiBase:r,fetchImpl:i,onVerified:s,cdnBase:o=Qr,loadTimeoutMs:u=Zr,setTimeoutImpl:a=(b,F)=>setTimeout(b,F)}=e,c=to(t.location.search,t.location.hash);if(!c)return "no_nonce";if(no(t),!so(t))return he("This page was not opened by the ARCY dashboard, so a picked element would have nowhere to go. If you did start it from the flow builder, this site is severing the link back: a Cross-Origin-Opener-Policy header on this page (helmet sets one by default) does exactly that. Serve this page with Cross-Origin-Opener-Policy: unsafe-none while you author."),"no_opener";let T=yield ro({apiBase:r,token:n,nonce:c,fetchImpl:i,setTimeoutImpl:a});if(!T)return he("The design-mode link is invalid, expired, or could not be verified. It is single-use and short-lived, so a reload spends it. Check that this page carries the same environment Token as the flow you are editing, then open the picker again from the dashboard."),"rejected";try{s();}catch(b){}let p=yield io(t,o,u,a);if(!p)return "load_failed";let{returnOrigin:y,screenshotsEnabled:g}=T;return p.mount({screenshotsEnabled:g,onPick:(b,F)=>{qe(t,y,{type:dn,protocol:Ve,target:b,route:ao(t),matchCount:F});},onScreenshot:b=>{qe(t,y,{type:pn,protocol:Ve,screenshot:b});},onExit:()=>{qe(t,y,{type:fn,protocol:Ve});}})?(qe(t,y,{type:un,protocol:Ve}),"active"):(he("The element picker could not start. Design mode is off."),"mount_failed")}catch(t){return he(`Design mode could not start. ${String(t)}`),"load_failed"}})}var Tt={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function oe(e){return e?{getItem(t){try{return e.getItem(t)}catch(n){return null}},setItem(t,n){try{e.setItem(t,n);}catch(r){}},removeItem(t){try{e.removeItem(t);}catch(n){}}}:Tt}function ye(){try{let e=globalThis.localStorage;return oe(e)}catch(e){return Tt}}function Le(){try{let e=globalThis.sessionStorage;return oe(e)}catch(e){return Tt}}function ie(e,t){let n=e.getItem(t);if(!n)return null;try{let r=JSON.parse(n);return !r||typeof r!="object"||Array.isArray(r)?null:r}catch(r){return null}}function Z(e,t,n){try{e.setItem(t,JSON.stringify(n));}catch(r){}}var lo="arcy.preview.";function Je(e,t=Le()){try{return oe(t).getItem(lo+e)!==null}catch(n){return false}}var Et="arcy_preview",co=1,uo="/api/v1/sdk/flows/preview/verify",fo=1e4;function po(e,t){var n;return (n=xt(e))!=null?n:xt(t)}function xt(e){if(!e)return null;try{let t=new URLSearchParams(e.charAt(0)==="#"?e.slice(1):e).get(Et);return t&&t.length>0?t:null}catch(t){return null}}function mo(e){try{let t=new URL(e.location.href),n=t.searchParams.has(Et),r=xt(t.hash)!==null;if(!n&&!r)return;n&&t.searchParams.delete(Et),r&&(t.hash=""),e.history.replaceState(e.history.state,"",t.toString());}catch(t){}}function Sn(e,t){try{let n=po(e.location.search,e.location.hash);return n?(mo(e),{kind:"nonce",nonce:n}):Je(t)?{kind:"pending"}:null}catch(n){return null}}function Tn(e){return D(this,null,function*(){let{apiBase:t,token:n,nonce:r,sessionToken:i,userTraits:s,fetchImpl:o,timeoutMs:u=fo,setTimeoutImpl:a=(b,F)=>setTimeout(b,F)}=e;if(!o)return null;let c=b=>{w(b);try{je(b);}catch(F){}return null},T=()=>D(null,null,function*(){try{let b=yield o(`${t}${uo}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(U(U({token:r},i?{sessionToken:i}:{}),s&&Object.keys(s).length>0?{userTraits:s}:{})),credentials:"omit"});if(!b.ok)return c("ARCY could not verify this preview link. Close this tab and press Preview in the dashboard again.");let F=yield b.json();return (F==null?void 0:F.ok)!==!0||F.flow===void 0||F.flow===null?c("ARCY could not verify this preview link. Close this tab and press Preview in the dashboard again."):F.protocol!==co?c("This page runs an older version of arcy.js than the dashboard expects. The preview cannot run until the script updates."):F.flow}catch(b){return c("ARCY could not reach its server to start this preview. Check the connection and press Preview again.")}}),p=false,y,g=new Promise(b=>{try{y=a(()=>{p||(p=!0,b(c("ARCY took too long to verify this preview link. Close this tab and press Preview in the dashboard again.")));},u);}catch(F){}}),E=yield Promise.race([T().then(b=>(p=true,b)),g]);try{y!==void 0&&clearTimeout(y);}catch(b){}return E})}var We="https://api.arcyai.com",go="/api/v1/sdk/session/init";var ho=["ON","REQUIRE_CONSENT","OFF"];function yo(e){if(!e||typeof e!="object"||Array.isArray(e))return null;let t=e,n=t.behavioralTelemetry,r=t.effectiveCustomization,i=t.widget,s=t.identity,o=s&&typeof s=="object"&&!Array.isArray(s)?s.accepted:void 0;return {sessionToken:typeof t.sessionToken=="string"?t.sessionToken:null,behavioralTelemetry:typeof n=="string"&&ho.indexOf(n)!==-1?n:null,customization:r&&typeof r=="object"&&!Array.isArray(r)?r:null,widget:i&&typeof i=="object"&&!Array.isArray(i)?i:null,identityAccepted:typeof o=="boolean"?o:null}}function En(e){let{token:t,apiBase:n=We,setTimeoutImpl:r=(A,x)=>setTimeout(A,x),now:i=()=>Date.now(),retryDelayMs:s=2e3,attemptTimeoutMs:o=5e3,failureCooldownMs:u=3e4}=e,a=e.fetchImpl!==void 0?e.fetchImpl:typeof fetch!="undefined"?fetch.bind(globalThis):null,c=`${n}${go}`,T=null,p=null,y=null,g=null,E=0;function b(A){let x={publicKey:t,sessionId:A.sessionId};return A.visitorId!==void 0&&(x.visitorId=A.visitorId),A.userId!==void 0&&(x.userId=A.userId),A.userHash!==void 0&&(x.userHash=A.userHash),A.userTraits!==void 0&&(x.userTraits=A.userTraits),A.uiLanguage!==void 0&&(x.uiLanguage=A.uiLanguage),A.contentLocale!==void 0&&(x.contentLocale=A.contentLocale),A.viewerLocale!==void 0&&(x.viewerLocale=A.viewerLocale),A.route!==void 0&&(x.route=A.route),JSON.stringify(x)}function F(A){return D(this,null,function*(){if(!a)return {ok:false,reason:"unusable"};let x;try{x=yield a(c,{method:"POST",headers:{"Content-Type":"application/json"},body:A,credentials:"omit"});}catch(R){return null}if(x.status>=500)return null;if(!x.ok)return {ok:false,reason:"rejected"};let M;try{M=yield x.json();}catch(R){return {ok:false,reason:"unusable"}}let C=yo(M);return C?{ok:true,config:C}:{ok:false,reason:"unusable"}})}function k(A){return new Promise(x=>{try{r(()=>x(),A);}catch(M){x();}})}function K(A){return Promise.race([F(A),k(o).then(()=>null)])}function G(A){return D(this,null,function*(){let x=yield K(A);if(x)return x;yield k(s);let M=yield K(A);return M!=null?M:{ok:false,reason:"network"}})}return {sync(A){return D(this,null,function*(){let x=b(A);if(g&&x===p)return g;if(!g&&x===p&&T)return {ok:true,config:T};if(y&&y.json===x&&i()-y.at<u)return {ok:false,reason:"network"};p=x;let M=++E,C=G(x).then(R=>(M===E&&(R.ok?(T=R.config,y=null):(y={json:x,at:i()},p===x&&(p=null))),g===C&&(g=null),R));return g=C,C})},config:()=>T}}var At="__arcyChat";var xn=["image/png","image/jpeg","image/webp"],kt="--_arcy-font-key",An="arcy-chat-policy",Qe={historyTitle:"Recent chats",historyEmpty:"No conversations yet.",newChat:"New chat",flowsTitle:"What I can do",flowsEmpty:"Nothing to run yet.",collapse:"Collapse",back:"Back",closeSheet:"Close",settingsTitle:"Settings",dockChat:"Dock to the corner",dockChatHint:"Shrink ARCY to a button in the bottom-right corner.",language:"Language",openChat:"Open chat",moveBar:"Move the chat bar",send:"Send",flowRunning:"Running",flowStep:"Step {step} of {total}",flowStop:"Stop",flowFailed:"Sorry, I could not finish that for you this time. You can ask me here and I will help you do it.",attachMenu:"Add",attachImage:"Attach an image",removeImage:"Remove image",imageTooLarge:"That image is too large. Each image must be under 5 MB.",imageWrongType:"That file type is not supported. Use PNG, JPEG or WEBP.",imageTooMany:"You can attach up to 3 images.",imageFailed:"That image could not be uploaded. Please try again.",likeAnswer:"Good answer",dislikeAnswer:"Bad answer",answering:"Answering",aiDisclaimer:"{app} is AI and can make mistakes",consentNotice:"Your messages are processed to answer your question.",consentWithPolicy:"{policy}",disclaimerJoin:" \xB7 ",privacyPolicy:"Privacy Policy",poweredBy:"Powered by ARCY",genericError:"Something went wrong. Please try again.",userCapReached:"You've reached today's limit for questions. Please try again tomorrow.",imageConversation:"Image",searchedSourcesLabel:"Searched {count} sources",sourcesLabel:"Sources:",flowOfferHint:"You can do this in one click with the Quick Flow below.",fillConfirm:"Confirm",fillYes:"Yes",fillNo:"No",fillRequired:"This field needs an answer.",fillInvalidNumber:"Please enter a number.",fillNumberTooSmall:"Please enter {min} or more.",fillNumberTooLarge:"Please enter {max} or less.",fillInvalidEmail:"Please enter a valid email address.",fillInvalidUrl:"Please enter a valid link.",fillInvalidDate:"Please enter a valid date.",fillInvalidTime:"Please enter a valid time.",fillDateTooEarly:"Please pick {min} or later.",fillDateTooLate:"Please pick {max} or earlier.",fillTooLong:"Please keep it under {max} characters.",fillInvalidOption:"Please pick one of the options.",fillInvalid:"That does not look right. Please try again."};var bo="https://cdn.arcyai.com";var wo=15e3;function vo(e,t,n,r){return new Promise(i=>{let s=false,o=null,u=g=>{s||(s=true,o&&(o.onload=null,o.onerror=null),i(g));},a=false,c=g=>{a||(a=true,w(g));},T=()=>{let g;try{g=e[At];}catch(b){return c("The chat panel registration could not be read. The panel will not open."),null}if(!g)return null;if(typeof g.mount!="function")return c("The chat panel registered something unusable. The panel will not open."),null;let E;try{E=g.contract;}catch(b){E=void 0;}return E!==4?(c(`The chat panel on the CDN speaks contract ${typeof E=="number"?E:"unknown"}, this arcy.js speaks ${4}. Update arcy.js to open the chat panel.`),null):g},p=g=>{try{let E=T();!E&&!a&&g(),u(E);}catch(E){u(null);}},y=false;try{y=e[At]!==void 0;}catch(g){y=true;}if(y){p(()=>{});return}try{let g=e.document;o=g.createElement("script"),o.async=!0,o.src=`${t}/${an}`;let E=o.src;o.onload=()=>p(()=>w("The chat panel loaded but did not register. The panel will not open.")),o.onerror=()=>{try{w(`Failed to load ${E}. The chat panel will not open. If this page sets a Content-Security-Policy, it must allow scripts from ${t}.`);}catch(b){}u(null);},(g.head||g.documentElement).appendChild(o);}catch(g){w(`The chat panel could not load. ${String(g)}`),u(null);return}try{r(()=>{s||w("The chat panel did not load in time."),u(null);},n);}catch(g){}})}function In(e){let{root:t,host:n,win:r=typeof window!="undefined"?window:void 0,cdnBase:i=bo,loadTimeoutMs:s=wo,setTimeoutImpl:o=(S,O)=>setTimeout(S,O),onRequestClose:u,bar:a,apiBase:c,getSessionToken:T,getSessionId:p,getRoute:y,getMaxHeightPercent:g,onStartFlow:E,publicKey:b,getConversationId:F,setConversationId:k,touchConversation:K,getVisitorId:G,onOrgCapExceeded:H,onStopFlow:A,track:x,getWidget:M,onSelectLocale:C}=e,R=t!==n,I=null,W=null,N=false,z=false;function J(){return D(this,null,function*(){if(!(I||N))return W||(W=D(null,null,function*(){if(r)try{let S=yield vo(r,i,s,o);if(!S||N)return;let O={root:t,host:n,isolated:R,onRequestClose:u,bar:a,apiBase:c,getSessionToken:T,getSessionId:p,getRoute:y,getMaxHeightPercent:g,onStartFlow:E,publicKey:b,getConversationId:F,setConversationId:k,touchConversation:K,getVisitorId:G,onOrgCapExceeded:H,onStopFlow:A,track:x,getWidget:M,onSelectLocale:C};I=S.mount(O),I||w("The chat panel could not start.");}catch(S){w(`The chat panel could not load. ${String(S)}`);}finally{W=null;}}),W)})}return {open(){return D(this,null,function*(){if(!N&&(z=true,yield J(),!(!z||N)))try{I==null||I.open();}catch(S){w(`The chat panel could not open. ${String(S)}`);}})},close(){z=false;try{I==null||I.close();}catch(S){w(`The chat panel could not close. ${String(S)}`);}},destroy(){N=true,z=false;let S=I;I=null;try{S==null||S.destroy();}catch(O){w(`The chat panel could not be removed. ${String(O)}`);}},reposition(){var S;try{(S=I==null?void 0:I.reposition)==null||S.call(I);}catch(O){w(`The chat panel could not move. ${String(O)}`);}},refreshChrome(){var S;try{(S=I==null?void 0:I.refreshChrome)==null||S.call(I);}catch(O){w(`The chat panel could not apply its texts. ${String(O)}`);}},promptFill(S){return D(this,null,function*(){if(N||(yield J(),N||!(I!=null&&I.promptFill)))return null;try{return yield I.promptFill(S)}catch(O){return w(`The flow's question could not be shown. ${String(O)}`),null}})},cancelFill(){var S;try{(S=I==null?void 0:I.cancelFill)==null||S.call(I);}catch(O){w(`The flow's question could not be withdrawn. ${String(O)}`);}},showFlowFailure(){return D(this,null,function*(){if(!N&&(z=true,yield J(),!(!z||N||!(I!=null&&I.showFlowFailure))))try{I.showFlowFailure();}catch(S){w(`The flow's failure notice could not be shown. ${String(S)}`);}})}}}var It="__arcyFlow";var So="arcy.flow.";function To(e){return typeof e.flowId=="string"&&e.flowId.length>0&&typeof e.currentStepCvid=="string"&&e.currentStepCvid.length>0&&typeof e.flowSessionId=="string"&&e.flowSessionId.length>0&&typeof e.startedAt=="number"}function _n(e,{store:t=ye()}={}){let n=oe(t),r=So+e;return {read(){let i=ie(n,r);return !i||!To(i)?null:{flowId:i.flowId,currentStepCvid:i.currentStepCvid,flowSessionId:i.flowSessionId,startedAt:i.startedAt}},save(i){Z(n,r,i);},clear(){n.removeItem(r);}}}var Eo="https://cdn.arcyai.com";var xo=15e3;function Ao(e,t,n,r){return new Promise(i=>{let s=false,o=null,u=g=>{s||(s=true,o&&(o.onload=null,o.onerror=null),i(g));},a=false,c=g=>{a||(a=true,w(g));},T=()=>{let g;try{g=e[It];}catch(b){return c("The flow engine registration could not be read. The flow will not start."),null}if(!g)return null;if(typeof g.mount!="function")return c("The flow engine registered something unusable. The flow will not start."),null;let E;try{E=g.contract;}catch(b){E=void 0;}return E!==2?(c(`The flow engine on the CDN speaks contract ${typeof E=="number"?E:"unknown"}, this arcy.js speaks ${2}. Update arcy.js to run flows.`),null):g},p=g=>{try{let E=T();!E&&!a&&g(),u(E);}catch(E){u(null);}},y=false;try{y=e[It]!==void 0;}catch(g){y=true;}if(y){p(()=>{});return}try{let g=e.document;o=g.createElement("script"),o.async=!0,o.src=`${t}/${sn}`;let E=o.src;o.onload=()=>p(()=>w("The flow engine loaded but did not register. The flow will not start.")),o.onerror=()=>{try{w(`Failed to load ${E}. The flow will not start. If this page sets a Content-Security-Policy, it must allow scripts from ${t}.`);}catch(b){}u(null);},(g.head||g.documentElement).appendChild(o);}catch(g){w(`The flow engine could not load. ${String(g)}`),u(null);return}try{r(()=>{s||w("The flow engine did not load in time."),u(null);},n);}catch(g){}})}function Pn(e){let{win:t=typeof window!="undefined"?window:void 0,cdnBase:n=Eo,loadTimeoutMs:r=xo,setTimeoutImpl:i=(p,y)=>setTimeout(p,y),context:s}=e,o=null,u=null,a=false;function c(){return D(this,null,function*(){if(!(o||a))return u||(u=D(null,null,function*(){if(t)try{let p=yield Ao(t,n,r,i);if(!p||a)return;o=p.mount(se(U({},s),{doc:t.document,win:t})),o||w("The flow engine could not start.");}catch(p){w(`The flow engine could not load. ${String(p)}`);}finally{u=null;}}),u)})}return {start(p){return D(this,null,function*(){if(!a&&(yield c(),!a))try{yield o==null?void 0:o.start(p);}catch(y){w(`The flow could not start. ${String(y)}`);}})},resume(){return D(this,null,function*(){if(a||!_n(s.token).read()||(yield c(),a||!o))return false;try{return yield o.resume()}catch(y){return w(`The flow could not resume. ${String(y)}`),false}})},startPreview(p){return D(this,null,function*(){var y;if(!a&&(yield c(),!a))try{yield (y=o==null?void 0:o.startPreview)==null?void 0:y.call(o,p);}catch(g){w(`The preview could not start. ${String(g)}`);}})},resumePreview(){return D(this,null,function*(){if(a||!Je(s.token)||(yield c(),a||!(o!=null&&o.resumePreview)))return false;try{return yield o.resumePreview()}catch(p){return w(`The preview could not resume. ${String(p)}`),false}})},stop(){var p;if(!a)try{(p=o==null?void 0:o.stop)==null||p.call(o);}catch(y){w(`The flow could not be stopped. ${String(y)}`);}},destroy(){a=true;let p=o;o=null;try{p==null||p.destroy();}catch(y){w(`The flow engine could not be removed. ${String(y)}`);}}}}function _t(e){let t=e.dataTransfer;if(!t)return false;let n=t.types;if(!n)return false;for(let r=0;r<n.length;r+=1)if(n[r]==="Files")return true;return false}function Rn(e){var n;let t=e.dataTransfer;return Array.from((n=t==null?void 0:t.files)!=null?n:[])}var Ln=`
|
|
4
|
+
[data-tip] {
|
|
5
|
+
position: relative;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
[data-tip]::after {
|
|
9
|
+
content: attr(data-tip);
|
|
10
|
+
position: absolute;
|
|
11
|
+
left: 50%;
|
|
12
|
+
bottom: calc(100% + 6px);
|
|
13
|
+
transform: translateX(-50%);
|
|
14
|
+
z-index: 2;
|
|
15
|
+
padding: 4px 8px;
|
|
16
|
+
border-radius: 6px;
|
|
17
|
+
background: var(--_arcy-main-text, #101828);
|
|
18
|
+
color: var(--_arcy-main-bg, #ffffff);
|
|
19
|
+
font-size: 11px;
|
|
20
|
+
line-height: 1.3;
|
|
21
|
+
white-space: nowrap;
|
|
22
|
+
pointer-events: none;
|
|
23
|
+
opacity: 0;
|
|
24
|
+
visibility: hidden;
|
|
25
|
+
transition: opacity 120ms ease;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
[data-tip][data-tip-placement="below"]::after {
|
|
29
|
+
bottom: auto;
|
|
30
|
+
top: calc(100% + 6px);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* Alignment, for a control near an edge the panel clips (D895). Centring a
|
|
34
|
+
bubble on the leftmost header icon puts half of it outside the panel, and
|
|
35
|
+
the panel clips its overflow, so the half outside is simply gone. No
|
|
36
|
+
z-index can fix that: the bubble is not behind anything, it is cut off.
|
|
37
|
+
These pin the bubble to the control's own edge instead. */
|
|
38
|
+
[data-tip][data-tip-align="start"]::after {
|
|
39
|
+
left: 0;
|
|
40
|
+
transform: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
[data-tip][data-tip-align="end"]::after {
|
|
44
|
+
left: auto;
|
|
45
|
+
right: 0;
|
|
46
|
+
transform: none;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
[data-tip]:hover::after,
|
|
50
|
+
[data-tip]:focus-visible::after {
|
|
51
|
+
opacity: 1;
|
|
52
|
+
visibility: visible;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/* A coarse pointer has no hover: the tooltip would latch open on tap and
|
|
56
|
+
sit over the thing the visitor just pressed. */
|
|
57
|
+
@media (hover: none) {
|
|
58
|
+
[data-tip]::after {
|
|
59
|
+
display: none;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
@media (prefers-reduced-motion: reduce) {
|
|
64
|
+
[data-tip]::after {
|
|
65
|
+
transition: none;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
`;var Mn=Ln+`
|
|
69
|
+
.arcy-bar-wrap {
|
|
70
|
+
gap: 6px;
|
|
71
|
+
font: 14px/1.4 var(--_arcy-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
|
|
72
|
+
/* Only ever animates from a concrete pixel value: bar.ts's render()
|
|
73
|
+
freezes the wrap's current width before writing the target so this has
|
|
74
|
+
two real numbers to interpolate between, never the "max-content"
|
|
75
|
+
keyword most engines cannot transition. */
|
|
76
|
+
transition: width 220ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
77
|
+
/* Above the panel, always (.arcy-chat-panel's own z-index in chat.ts):
|
|
78
|
+
both are position: absolute siblings inside the same shared root with
|
|
79
|
+
nothing else to order them, so without this the panel simply painted
|
|
80
|
+
over the bar whenever they overlapped, because the panel is always the
|
|
81
|
+
later of the two to mount (it loads lazily, on first open()) and DOM
|
|
82
|
+
order was the only tiebreaker. This is its own stacking context, so the
|
|
83
|
+
bar's own menu and tooltips (z-index 2 inside it, tooltip.ts) stay
|
|
84
|
+
above the panel too, not just the bar's own box. */
|
|
85
|
+
z-index: 2;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* The corner launcher the widget becomes when a visitor docks it from the
|
|
89
|
+
panel's Settings sheet. Its size and placement are written inline from
|
|
90
|
+
bar.ts, for the reason at the top of this file: docked, this button is the
|
|
91
|
+
only way back into the widget, so losing this sheet has to leave it plain
|
|
92
|
+
rather than unfindable.
|
|
93
|
+
|
|
94
|
+
It is the WELCOME MARK: same size token, same brand colours, same
|
|
95
|
+
overflow-hidden circle an upload is inset into. The welcome screen's own
|
|
96
|
+
rule, in chat.ts, is its twin, and the two are meant to be
|
|
97
|
+
indistinguishable, because docked this button is that mark. */
|
|
98
|
+
.arcy-bar-dock {
|
|
99
|
+
overflow: hidden;
|
|
100
|
+
appearance: none;
|
|
101
|
+
border: 0;
|
|
102
|
+
/* box-sizing: border-box comes from bar.ts's SURVIVAL_STYLE. calc() against
|
|
103
|
+
the size token itself, NOT a percentage: a percentage padding resolves
|
|
104
|
+
against the containing block's width, not this button's own, and would
|
|
105
|
+
inflate a 34px button to match the page instead of insetting the icon. */
|
|
106
|
+
padding: calc(var(--_arcy-chat-welcome-icon-size, 34px) * 0.15);
|
|
107
|
+
cursor: pointer;
|
|
108
|
+
border-radius: 999px;
|
|
109
|
+
background: var(--_arcy-brand-bg, #101828);
|
|
110
|
+
color: var(--_arcy-brand-text, #ffffff);
|
|
111
|
+
-webkit-tap-highlight-color: transparent;
|
|
112
|
+
/* Its own stacking context, above the panel, same as the bar's wrap. */
|
|
113
|
+
z-index: 2;
|
|
114
|
+
transition: transform 160ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.arcy-bar-dock:hover {
|
|
118
|
+
transform: scale(1.06);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.arcy-bar-dock:focus-visible {
|
|
122
|
+
outline: 2px solid currentColor;
|
|
123
|
+
outline-offset: 3px;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.arcy-bar {
|
|
127
|
+
position: relative;
|
|
128
|
+
display: flex;
|
|
129
|
+
align-items: center;
|
|
130
|
+
box-sizing: border-box;
|
|
131
|
+
width: 100%;
|
|
132
|
+
min-height: 52px;
|
|
133
|
+
padding: 0 8px 0 8px;
|
|
134
|
+
border-radius: var(--arcy-bar-radius, 16px);
|
|
135
|
+
background: var(--_arcy-main-bg, #ffffff);
|
|
136
|
+
color: var(--_arcy-main-text, #101828);
|
|
137
|
+
/* The shared base.border (D832): one value, this edge and the panel's. */
|
|
138
|
+
border: var(--_arcy-border-width, 0px) solid
|
|
139
|
+
var(--_arcy-border-color, color-mix(in srgb, var(--_arcy-main-text, #101828) 15%, transparent));
|
|
140
|
+
/* The focus ring rides in front of the operator's own shadow rather than
|
|
141
|
+
replacing it (D908), so a focused bar keeps whatever depth they chose. */
|
|
142
|
+
box-shadow: var(--_arcy-bar-focus-ring, 0 0 #0000),
|
|
143
|
+
var(--arcy-bar-shadow, 0 8px 24px rgba(16, 24, 40, 0.28));
|
|
144
|
+
transition: box-shadow 160ms ease, background 160ms ease,
|
|
145
|
+
border-color 160ms ease;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* Flow mode's status surface reads left to right (dot, name, step, stop),
|
|
149
|
+
so the left edge sits closer to the composer's usual text inset while the
|
|
150
|
+
right stays flush with the stop control (D930/D979). */
|
|
151
|
+
.arcy-bar[data-mode="flow"] {
|
|
152
|
+
padding: 0 8px 0 16px;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/* Glassiness (\xA75.4): a blur behind the bar plus an alpha on
|
|
156
|
+
main.background. Only where the browser can blur; elsewhere the bar stays
|
|
157
|
+
opaque, never transparent. With no glass set the alpha is 0% and this is
|
|
158
|
+
a no-op. */
|
|
159
|
+
@supports (backdrop-filter: blur(1px)) {
|
|
160
|
+
.arcy-bar {
|
|
161
|
+
background: color-mix(in srgb, var(--_arcy-main-bg, #ffffff) calc(100% - var(--_arcy-glass-alpha, 0%)), transparent);
|
|
162
|
+
backdrop-filter: blur(var(--_arcy-glass-blur, 0px));
|
|
163
|
+
-webkit-backdrop-filter: blur(var(--_arcy-glass-blur, 0px));
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.arcy-bar-form {
|
|
168
|
+
display: flex;
|
|
169
|
+
align-items: center;
|
|
170
|
+
gap: 6px;
|
|
171
|
+
flex: 1 1 auto;
|
|
172
|
+
min-width: 0;
|
|
173
|
+
margin: 0;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.arcy-bar-input {
|
|
177
|
+
flex: 1 1 auto;
|
|
178
|
+
min-width: 0;
|
|
179
|
+
appearance: none;
|
|
180
|
+
border: 0;
|
|
181
|
+
background: transparent;
|
|
182
|
+
color: inherit;
|
|
183
|
+
font: inherit;
|
|
184
|
+
padding: 12px 0;
|
|
185
|
+
outline: none;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/* Collapsed, the whole pill is the target (ADR 0103): the input inside it is
|
|
189
|
+
a few pixels wide, and a visitor aiming for it is a visitor who misses. */
|
|
190
|
+
.arcy-bar[data-collapsed="true"] {
|
|
191
|
+
cursor: pointer;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.arcy-bar[data-collapsed="true"] .arcy-bar-input {
|
|
195
|
+
/* No cursor override here, unlike the pill above: this is a real,
|
|
196
|
+
focusable input, not a decoration, and hovering directly over it
|
|
197
|
+
should give the same text-caret cue any input gives. The surrounding
|
|
198
|
+
pill's own pointer cursor still covers the rest of the target. */
|
|
199
|
+
/* Takes the row's spare width, exactly as it does open (ADR 0149): the
|
|
200
|
+
pill is bar.collapsedWidth wide now rather than as wide as its own
|
|
201
|
+
text, and an input that kept sizing itself to the placeholder would
|
|
202
|
+
leave the operator's extra pixels stranded behind the send control. */
|
|
203
|
+
padding-right: 8px;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/* The left slot. As a mark it is not a control, so it takes no hover, no
|
|
207
|
+
pointer and no tab stop; as the menu's plus it is an icon button. */
|
|
208
|
+
.arcy-bar-grip {
|
|
209
|
+
/* Outside the composer's own controls: what it moves is the whole bar, so
|
|
210
|
+
it takes neither the left slot's hover treatment nor its padding
|
|
211
|
+
(ADR 0111). Rendered on BOTH widths of the bar, resting and expanded,
|
|
212
|
+
and only when the operator has allowed it: the data-grip rule below is
|
|
213
|
+
driven by that setting alone. The handle used to vanish the moment the panel
|
|
214
|
+
opened even though dragging the open bar already worked underneath,
|
|
215
|
+
which is a control that is functional but invisible. */
|
|
216
|
+
display: none;
|
|
217
|
+
align-items: center;
|
|
218
|
+
justify-content: center;
|
|
219
|
+
flex: 0 0 auto;
|
|
220
|
+
padding: 0 2px 0 4px;
|
|
221
|
+
margin-right: -2px;
|
|
222
|
+
border: 0;
|
|
223
|
+
background: transparent;
|
|
224
|
+
/* Matches the leading icon's own resting contrast (see .arcy-bar-leading
|
|
225
|
+
below). The previous, much lower value read as barely-there against
|
|
226
|
+
either theme, which made the handle hard to spot rather than subtle. */
|
|
227
|
+
color: color-mix(in srgb, var(--_arcy-main-text, #101828) 65%, transparent);
|
|
228
|
+
cursor: grab;
|
|
229
|
+
touch-action: none;
|
|
230
|
+
-webkit-tap-highlight-color: transparent;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.arcy-bar[data-grip="true"] .arcy-bar-grip {
|
|
234
|
+
display: flex;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.arcy-bar-grip:active {
|
|
238
|
+
cursor: grabbing;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.arcy-bar-grip:hover {
|
|
242
|
+
color: var(--_arcy-main-text, #101828);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.arcy-bar-leading {
|
|
246
|
+
appearance: none;
|
|
247
|
+
border: 0;
|
|
248
|
+
padding: 8px;
|
|
249
|
+
border-radius: 999px;
|
|
250
|
+
background: transparent;
|
|
251
|
+
color: color-mix(in srgb, var(--_arcy-main-text, #101828) 65%, transparent);
|
|
252
|
+
font: inherit;
|
|
253
|
+
display: flex;
|
|
254
|
+
align-items: center;
|
|
255
|
+
justify-content: center;
|
|
256
|
+
flex: 0 0 auto;
|
|
257
|
+
-webkit-tap-highlight-color: transparent;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.arcy-bar-leading[data-role="menu"] {
|
|
261
|
+
cursor: pointer;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.arcy-bar-leading[data-role="menu"]:hover {
|
|
265
|
+
background: color-mix(in srgb, var(--_arcy-main-text, #101828) 8%, transparent);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.arcy-bar-leading[data-role="mark"] {
|
|
269
|
+
cursor: inherit;
|
|
270
|
+
color: var(--_arcy-brand-bg, #101828);
|
|
271
|
+
opacity: 1;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.arcy-bar-menu {
|
|
275
|
+
position: absolute;
|
|
276
|
+
left: 0;
|
|
277
|
+
bottom: calc(100% + 8px);
|
|
278
|
+
z-index: 1;
|
|
279
|
+
display: flex;
|
|
280
|
+
flex-direction: column;
|
|
281
|
+
gap: 2px;
|
|
282
|
+
min-width: 200px;
|
|
283
|
+
padding: 6px;
|
|
284
|
+
border-radius: 12px;
|
|
285
|
+
background: var(--_arcy-main-bg, #ffffff);
|
|
286
|
+
color: var(--_arcy-main-text, #101828);
|
|
287
|
+
border: 1px solid
|
|
288
|
+
color-mix(in srgb, var(--_arcy-main-text, #101828) 12%, transparent);
|
|
289
|
+
box-shadow: 0 12px 32px rgba(16, 24, 40, 0.18);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/* The menu is a surface the visitor sees, so it wears base.glassiness like
|
|
293
|
+
the bar and the panel do (D832's one-value rule, one layer out). It gets
|
|
294
|
+
its own @supports block rather than joining the bar's above, because this
|
|
295
|
+
sheet declares the menu's opaque background AFTER that block: sharing it
|
|
296
|
+
would put the two rules at equal specificity with the opaque one last,
|
|
297
|
+
and the menu stayed white on a glassy bar.
|
|
298
|
+
|
|
299
|
+
Note this sheet is a template literal. No backticks in these comments. */
|
|
300
|
+
@supports (backdrop-filter: blur(1px)) {
|
|
301
|
+
.arcy-bar-menu {
|
|
302
|
+
background: color-mix(in srgb, var(--_arcy-main-bg, #ffffff) calc(100% - var(--_arcy-glass-alpha, 0%)), transparent);
|
|
303
|
+
backdrop-filter: blur(var(--_arcy-glass-blur, 0px));
|
|
304
|
+
-webkit-backdrop-filter: blur(var(--_arcy-glass-blur, 0px));
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.arcy-bar-menu-item {
|
|
309
|
+
appearance: none;
|
|
310
|
+
border: 0;
|
|
311
|
+
cursor: pointer;
|
|
312
|
+
font: inherit;
|
|
313
|
+
text-align: left;
|
|
314
|
+
display: flex;
|
|
315
|
+
align-items: center;
|
|
316
|
+
gap: 10px;
|
|
317
|
+
padding: 8px 10px;
|
|
318
|
+
border-radius: 8px;
|
|
319
|
+
background: transparent;
|
|
320
|
+
color: inherit;
|
|
321
|
+
-webkit-tap-highlight-color: transparent;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.arcy-bar-menu-item:hover {
|
|
325
|
+
background: color-mix(in srgb, var(--_arcy-main-text, #101828) 8%, transparent);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.arcy-bar-input::placeholder {
|
|
329
|
+
color: color-mix(in srgb, var(--_arcy-main-text, #101828) 55%, transparent);
|
|
330
|
+
/* Opera and older Firefox dim placeholders by default, which on a light
|
|
331
|
+
bar reads as a disabled input. */
|
|
332
|
+
opacity: 1;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.arcy-bar-input:disabled {
|
|
336
|
+
opacity: 0.6;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.arcy-bar-icon,
|
|
340
|
+
.arcy-bar-send,
|
|
341
|
+
.arcy-bar-stop {
|
|
342
|
+
appearance: none;
|
|
343
|
+
border: 0;
|
|
344
|
+
cursor: pointer;
|
|
345
|
+
font: inherit;
|
|
346
|
+
-webkit-tap-highlight-color: transparent;
|
|
347
|
+
display: flex;
|
|
348
|
+
align-items: center;
|
|
349
|
+
justify-content: center;
|
|
350
|
+
flex: 0 0 auto;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.arcy-bar-icon {
|
|
354
|
+
padding: 8px;
|
|
355
|
+
border-radius: 999px;
|
|
356
|
+
background: transparent;
|
|
357
|
+
color: color-mix(in srgb, var(--_arcy-main-text, #101828) 65%, transparent);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.arcy-bar-icon:hover {
|
|
361
|
+
background: color-mix(in srgb, var(--_arcy-main-text, #101828) 8%, transparent);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
.arcy-bar-send {
|
|
365
|
+
padding: 10px;
|
|
366
|
+
border-radius: 999px;
|
|
367
|
+
background: var(--_arcy-brand-bg, #101828);
|
|
368
|
+
color: var(--_arcy-brand-text, #ffffff);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/* The send control answers the pointer whatever colour the operator chose
|
|
372
|
+
(D888). The hover token defaults to the base colour, so a background swap
|
|
373
|
+
alone is invisible on every theme that did not set one; a lift and a
|
|
374
|
+
contact shadow read on any colour, including white on white. */
|
|
375
|
+
.arcy-bar-send {
|
|
376
|
+
transition: background 120ms ease, transform 120ms ease, box-shadow 120ms ease;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.arcy-bar-send:hover {
|
|
380
|
+
background: var(--_arcy-brand-bg-hover, var(--_arcy-brand-bg, #101828));
|
|
381
|
+
transform: translateY(-1px);
|
|
382
|
+
box-shadow: 0 2px 8px rgba(16, 24, 40, 0.18);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.arcy-bar-send:active {
|
|
386
|
+
background: var(--_arcy-brand-bg-active, var(--_arcy-brand-bg, #101828));
|
|
387
|
+
transform: translateY(0);
|
|
388
|
+
box-shadow: none;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
@media (prefers-reduced-motion: reduce) {
|
|
392
|
+
.arcy-bar-send {
|
|
393
|
+
transition: background 120ms ease;
|
|
394
|
+
}
|
|
395
|
+
.arcy-bar-send:hover,
|
|
396
|
+
.arcy-bar-send:active {
|
|
397
|
+
transform: none;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
.arcy-bar-send:disabled,
|
|
402
|
+
.arcy-bar-icon:disabled {
|
|
403
|
+
cursor: default;
|
|
404
|
+
opacity: 0.6;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/* The input takes NO ring of its own (D887). It fills a bar that already
|
|
408
|
+
looks like an input, so a rectangle drawn around the text reads as a
|
|
409
|
+
browser artefact rather than as focus, and it was the first thing a
|
|
410
|
+
visitor saw on clicking. The bar carries the state instead.
|
|
411
|
+
|
|
412
|
+
The border goes brand (D908). base.border.width defaults to 0, so a
|
|
413
|
+
colour change alone would be invisible on most themes; the 1px ring is
|
|
414
|
+
what actually paints the edge there, and on a theme that HAS a border the
|
|
415
|
+
two land on the same line. */
|
|
416
|
+
.arcy-bar:focus-within {
|
|
417
|
+
outline: none;
|
|
418
|
+
border-color: var(--_arcy-brand-bg, #101828);
|
|
419
|
+
--_arcy-bar-focus-ring: 0 0 0 1px var(--_arcy-brand-bg, #101828);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/* A control inside the bar still says which control it is: the bar's ring
|
|
423
|
+
says "the widget has focus", this one says "and it is this button". */
|
|
424
|
+
.arcy-bar-icon:focus-visible,
|
|
425
|
+
.arcy-bar-send:focus-visible,
|
|
426
|
+
.arcy-bar-stop:focus-visible,
|
|
427
|
+
.arcy-bar-leading:focus-visible,
|
|
428
|
+
.arcy-bar-menu-item:focus-visible {
|
|
429
|
+
outline: 2px solid var(--_arcy-main-text, #101828);
|
|
430
|
+
outline-offset: 1px;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/* The attachment count, so a visitor can see what is about to be sent
|
|
434
|
+
without the bar owning the upload. */
|
|
435
|
+
.arcy-bar-badge {
|
|
436
|
+
display: flex;
|
|
437
|
+
align-items: center;
|
|
438
|
+
justify-content: center;
|
|
439
|
+
flex: 0 0 auto;
|
|
440
|
+
min-width: 20px;
|
|
441
|
+
height: 20px;
|
|
442
|
+
padding: 0 6px;
|
|
443
|
+
border-radius: 999px;
|
|
444
|
+
font-size: 12px;
|
|
445
|
+
background: var(--_arcy-brand-bg, #101828);
|
|
446
|
+
color: var(--_arcy-brand-text, #ffffff);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
/* \u2500\u2500 Flow-running mode \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
450
|
+
|
|
451
|
+
.arcy-bar-status {
|
|
452
|
+
display: flex;
|
|
453
|
+
align-items: center;
|
|
454
|
+
gap: 10px;
|
|
455
|
+
flex: 1 1 auto;
|
|
456
|
+
min-width: 0;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
.arcy-bar-dot {
|
|
460
|
+
flex: 0 0 auto;
|
|
461
|
+
width: 8px;
|
|
462
|
+
height: 8px;
|
|
463
|
+
border-radius: 999px;
|
|
464
|
+
background: var(--_arcy-brand-bg, #101828);
|
|
465
|
+
animation: arcy-bar-pulse 1.4s ease-in-out infinite;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
@keyframes arcy-bar-pulse {
|
|
469
|
+
0%, 100% { opacity: 1; }
|
|
470
|
+
50% { opacity: 0.35; }
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
.arcy-bar-flow-name {
|
|
474
|
+
flex: 1 1 auto;
|
|
475
|
+
min-width: 0;
|
|
476
|
+
overflow: hidden;
|
|
477
|
+
text-overflow: ellipsis;
|
|
478
|
+
white-space: nowrap;
|
|
479
|
+
font-size: 13px;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
.arcy-bar-flow-step {
|
|
483
|
+
flex: 0 0 auto;
|
|
484
|
+
font-size: 12px;
|
|
485
|
+
font-variant-numeric: tabular-nums;
|
|
486
|
+
color: color-mix(in srgb, var(--_arcy-main-text, #101828) 60%, transparent);
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
.arcy-bar-stop {
|
|
490
|
+
gap: 6px;
|
|
491
|
+
padding: 6px 12px;
|
|
492
|
+
border-radius: 999px;
|
|
493
|
+
font-size: 12px;
|
|
494
|
+
background: color-mix(in srgb, var(--_arcy-main-text, #101828) 8%, transparent);
|
|
495
|
+
color: inherit;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
.arcy-bar-stop:hover {
|
|
499
|
+
background: color-mix(in srgb, var(--_arcy-main-text, #101828) 14%, transparent);
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
/* ADR 0169: the combined input rendering. The status row sits on a slim top
|
|
503
|
+
row and the composer stays live beneath it, so a fill question can be
|
|
504
|
+
answered without losing sight of the run. */
|
|
505
|
+
.arcy-bar[data-mode="input"] {
|
|
506
|
+
flex-direction: column;
|
|
507
|
+
align-items: stretch;
|
|
508
|
+
padding: 6px 8px 0 8px;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
.arcy-bar[data-mode="input"] .arcy-bar-status {
|
|
512
|
+
flex: 0 0 auto;
|
|
513
|
+
padding: 2px 8px 4px 8px;
|
|
514
|
+
border-bottom: 1px solid
|
|
515
|
+
color-mix(in srgb, var(--_arcy-main-text, #101828) 8%, transparent);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
.arcy-bar[data-mode="input"] .arcy-bar-form {
|
|
519
|
+
padding-left: 8px;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
/* D1296: the done state. The run is over, so the dot stops pulsing and the
|
|
523
|
+
check mark takes the counter's place. */
|
|
524
|
+
.arcy-bar[data-phase="done"] .arcy-bar-dot {
|
|
525
|
+
animation: none;
|
|
526
|
+
opacity: 1;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
.arcy-bar[data-phase="done"] .arcy-bar-flow-step {
|
|
530
|
+
color: var(--_arcy-main-text, #101828);
|
|
531
|
+
font-size: 14px;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
/* The AI disclosure. Under the bar, and only while the panel is open: a
|
|
535
|
+
quiet page stays quiet. */
|
|
536
|
+
.arcy-bar-disclaimer {
|
|
537
|
+
font-size: 10.5px;
|
|
538
|
+
text-align: center;
|
|
539
|
+
color: color-mix(in srgb, var(--_arcy-main-text, #101828) 55%, transparent);
|
|
540
|
+
/* The wrap is centred on the bar, so this must not be able to widen it. */
|
|
541
|
+
max-width: 100%;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
/* The privacy-policy link inline in the bar disclosure (D979/D981-followup).
|
|
545
|
+
Underlined so it reads as clickable against text that otherwise is not. */
|
|
546
|
+
.arcy-chat-policy {
|
|
547
|
+
color: inherit;
|
|
548
|
+
text-decoration: underline;
|
|
549
|
+
text-underline-offset: 2px;
|
|
550
|
+
cursor: pointer;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
.arcy-chat-policy:hover {
|
|
554
|
+
color: var(--_arcy-main-text, #101828);
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
@media (prefers-reduced-motion: reduce) {
|
|
558
|
+
.arcy-bar,
|
|
559
|
+
.arcy-bar-wrap,
|
|
560
|
+
.arcy-bar-dock,
|
|
561
|
+
.arcy-bar-dot {
|
|
562
|
+
transition: none;
|
|
563
|
+
animation: none;
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
`;var Ae=e=>typeof e=="number"&&Number.isFinite(e)&&e>0?e:0;function On(e){var n;let t=(n=e==null?void 0:e.document)==null?void 0:n.documentElement;return {width:Ae(t==null?void 0:t.clientWidth)||Ae(e==null?void 0:e.innerWidth),height:Ae(t==null?void 0:t.clientHeight)||Ae(e==null?void 0:e.innerHeight)}}function ko(e){let t=e==null?void 0:e.visualViewport;if(!t)return 0;let n=On(e).height,r=Ae(t.height);if(!n||!r)return 0;let i=typeof t.offsetTop=="number"&&Number.isFinite(t.offsetTop)?t.offsetTop:0,s=n-(r+i);return !Number.isFinite(s)||s<24?0:Math.min(s,n)}function Ze(e){let t=On(e);return se(U({},t),{isMobile:t.width>0&&t.width<640,keyboardOffset:ko(e)})}var Io=560;function Dn(e,t){let n=Ae(t.width);if(!n)return Io;if(n<640)return Math.max(0,n-24);let r=Math.round(e/100*n);return Math.min(r,n-32)}function Nn(e){return e.x===0&&e.y===0?"none":`translate(${e.x}px, ${e.y}px)`}function Ct(e,t,n){let r=Ae(n);if(!r)return e;let i=Math.max(0,(r-Ae(t))/2);return Math.min(i,Math.max(-i,e))}var Co=1e4,Fn=52,et=24,tt=18,nt=30,rt=280,Bn="var(--_arcy-chat-welcome-icon-size, 34px)",Hn="53%",Po=24,Vn="http://www.w3.org/2000/svg",Un=[["box-sizing","border-box"],["margin","0"],["display","flex"]],Wn=[["position","absolute"],["pointer-events","auto"]],Ro=260,Lo=300,Mo=150,Oo=3e3;function ve(e,t,n,r=2){let i=e.createElementNS(Vn,"svg");i.setAttribute("viewBox","0 0 24 24"),i.setAttribute("aria-hidden","true"),i.setAttribute("width",String(n)),i.setAttribute("height",String(n));let s=e.createElementNS(Vn,"path");return s.setAttribute("d",t),s.setAttribute("fill","none"),s.setAttribute("stroke","currentColor"),s.setAttribute("stroke-width",String(r)),s.setAttribute("stroke-linecap","round"),s.setAttribute("stroke-linejoin","round"),i.appendChild(s),i}function $n(e,t,n){let r=e.createElement("img");return r.src=t,r.alt="",r.setAttribute("aria-hidden","true"),r.width=n,r.height=n,r.style.setProperty("width",`${n}px`),r.style.setProperty("height",`${n}px`),r.style.setProperty("object-fit","contain"),r}var Do="M5 3H19A2 2 0 0 1 21 5V19A2 2 0 0 1 19 21H5A2 2 0 0 1 3 19V5A2 2 0 0 1 5 3ZM7 9a2 2 0 1 0 4 0a2 2 0 1 0-4 0M21 15l-3.086-3.086a2 2 0 0 0-2.828 0L6 21",$e={x:0,y:0},No="M12 5v14M5 12h14",Fo="M8 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0M8 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0M8 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0M14 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0M14 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0M14 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",Kn="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.594zM20 2v4M22 4h-4M4 20m-2 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0",zn="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z",Bo="M12 19V5M5 12l7-7 7 7",Ho="M6 6h12v12H6z";function Y(e,t){return (...n)=>{try{t(...n);}catch(r){w(`${e} failed. ${String(r)}`);}}}var Vo={send:"Send",attachMenu:"Add",attachImage:"Attach an image",flowStop:"Stop",openChat:"Open chat",moveBar:"Move the chat bar",flowStep:"Step {step} of {total}"};function Gn(e={}){var Ut,Wt,$t,Kt,zt,Gt,Xt,Yt,jt,qt;let t=U(U({},Vo),(Ut=e.labels)!=null?Ut:{}),n={widthPercent:($t=(Wt=e.geometry)==null?void 0:Wt.widthPercent)!=null?$t:nt,bottomOffset:(zt=(Kt=e.geometry)==null?void 0:Kt.bottomOffset)!=null?zt:et,collapsedWidth:(Xt=(Gt=e.geometry)==null?void 0:Gt.collapsedWidth)!=null?Xt:rt},r=null,i=false,s=null,o=null,u=null,a=null,c=null,T=null,p=(Yt=e.iconUrl)!=null?Yt:null,y=(jt=e.iconSize)!=null?jt:tt,g=(qt=e.welcomeIconUrl)!=null?qt:null,E=null,b=null,F=false,k=null,K=null,G=false,H={x:0,y:0},A=null,x=null,M=null,C=null,R=null,I=null,W=null,N=null,z=null,J=null,ne="idle",S=null,O=false,B=false,ue=0,ae=false,q=false,$={width:0,height:0,isMobile:false,keyboardOffset:0};function be(){return !S&&ne!=="open"}function Se(l){var V,xe;let f=(V=s==null?void 0:s.offsetWidth)!=null?V:0,P=(xe=s==null?void 0:s.offsetHeight)!=null?xe:0;if(!$.width||!$.height)return l;let _=n.bottomOffset+$.keyboardOffset,Q=Math.max(0,$.height-P-_);return {x:Ct(l.x,f,$.width),y:Math.min(_,Math.max(-Q,l.y))}}function Ie(l){var ge,Jt;if(!F||$.isMobile)return;l.preventDefault(),l.stopPropagation();let f=l.clientX,P=l.clientY,_=H,Q=b,V=(Jt=(ge=b==null?void 0:b.ownerDocument)==null?void 0:ge.defaultView)!=null?Jt:typeof window!="undefined"?window:null,xe=Ce=>{var Be;Ce.pointerId===l.pointerId&&(H=Se({x:_.x+(Ce.clientX-f),y:_.y+(Ce.clientY-P)}),pe(),(Be=e.onGeometryChange)==null||Be.call(e));},re=Ce=>{var Be;if(Ce.pointerId===l.pointerId){V==null||V.removeEventListener("pointermove",xe,true),V==null||V.removeEventListener("pointerup",re,true),V==null||V.removeEventListener("pointercancel",re,true);try{Q==null||Q.releasePointerCapture(Ce.pointerId);}catch(Li){}(Be=e.onPositionChange)==null||Be.call(e,H);}};try{Q==null||Q.setPointerCapture(l.pointerId);}catch(Ce){}V==null||V.addEventListener("pointermove",xe,true),V==null||V.addEventListener("pointerup",re,true),V==null||V.addEventListener("pointercancel",re,true);}function it(){s==null||s.style.setProperty("display",G?"none":"flex","important"),k&&(k.style.setProperty("display",G?"flex":"none","important"),G&&(k.style.setProperty("bottom",`${n.bottomOffset+$.keyboardOffset}px`,"important"),k.style.setProperty("right",`${Po}px`,"important")));}function pe(){if(it(),!s)return;let l=be(),f=Dn(n.widthPercent,$),P=n.bottomOffset+$.keyboardOffset;s.style.setProperty("bottom",`${P}px`,"important"),s.style.setProperty("left","50%","important"),s.style.setProperty("translate","-50%","important");let _=F&&!$.isMobile?Se(H):$e;H=_;let Q=S?$e:{x:Ct(_.x,l?n.collapsedWidth:f,$.width),y:_.y};s.style.setProperty("transform",Nn(Q)),o==null||o.setAttribute("data-grip",F&&!$.isMobile&&!S?"true":"false"),s.style.setProperty("width",l?`${n.collapsedWidth}px`:`${f}px`);let V=`calc(100% - ${24}px)`;s.style.setProperty("max-width",$.isMobile?V:"none"),s.setAttribute("data-mobile",$.isMobile?"":"false");}function de(){if(!c||!T)return;let l=c.ownerDocument,f=!be()&&B,P=f?ve(l,No,18):p?$n(l,p,y):ve(l,Kn,y);c.replaceChild(P,T),T=P,c.setAttribute("aria-label",t.attachMenu),f?c.setAttribute("data-tip",t.attachMenu):c.removeAttribute("data-tip"),c.setAttribute("aria-haspopup",f?"menu":"false"),c.setAttribute("data-role",f?"menu":"mark"),c.disabled=!f,c.setAttribute("aria-hidden",f?"false":"true"),c.tabIndex=f?0:-1,f||le();}function te(l){ae=l,A&&A.style.setProperty("display",l?"flex":"none"),c==null||c.setAttribute("aria-expanded",l?"true":"false"),l&&(x==null||x.focus());}function le(){if(!ae)return;let l=A==null?void 0:A.getRootNode(),f=!!(l&&"activeElement"in l&&l.activeElement&&(A!=null&&A.contains(l.activeElement)));te(false),f&&(c==null||c.focus());}function Pe(){if(!k||!K)return;let l=k.ownerDocument,f=g&&g!==E?g:null,P;if(f){let _=l.createElement("img");_.src=f,_.alt="",_.setAttribute("aria-hidden","true"),_.style.setProperty("width","100%"),_.style.setProperty("height","100%"),_.style.setProperty("object-fit","contain"),_.style.setProperty("display","block"),_.addEventListener("error",()=>{E=f,Pe();},{once:true}),P=_;}else {let _=ve(l,zn,18);_.setAttribute("width",Hn),_.setAttribute("height",Hn),P=_;}k.replaceChild(P,K),K=P;}function we(){if(!o||!u||!R)return;let l=S?O?"input":"flow":ne,f=(S==null?void 0:S.phase)==="done";o.setAttribute("data-mode",l),o.setAttribute("data-phase",S?f?"done":"running":"none"),o.setAttribute("data-collapsed",be()?"true":"false"),de(),pe(),u.style.setProperty("display",l==="flow"?"none":"flex"),R.style.setProperty("display",l==="flow"||l==="input"?"flex":"none"),C==null||C.style.setProperty("display","flex"),o.setAttribute("aria-expanded",l==="open"?"true":"false"),S&&I&&W&&(I.textContent=S.name,W.textContent=f?"\u2713":t.flowStep.replace("{step}",String(S.step)).replace("{total}",String(S.total)),N==null||N.style.setProperty("display",f?"none":"flex")),z&&z.style.setProperty("display",l==="open"&&z.textContent?"block":"none");}function De(){$=Ze(typeof window!="undefined"?window:null),pe(),Y("onGeometryChange",()=>{var l;return (l=e.onGeometryChange)==null?void 0:l.call(e)})();}function Ne(l){var P;l.preventDefault();let f=(P=a==null?void 0:a.value.trim())!=null?P:"";if(!f&&ue===0){Re();return}a&&(a.value=""),Y("onSubmit",()=>{var _;return (_=e.onSubmit)==null?void 0:_.call(e,f)})();}function at(){Re();}function Re(){S||ne==="open"||q||(q=true,Y("onActivate",()=>{var l;return (l=e.onActivate)==null?void 0:l.call(e)})());}function st(l){if(!(S||ne==="open")&&!(A&&l.target instanceof Node&&A.contains(l.target))){Re();try{a==null||a.focus();}catch(f){}}}function Fe(){q=false;}function _e(l){l.preventDefault(),l.stopPropagation(),!(be()||!B)&&te(!ae);}function lt(){try{M==null||M.click();}catch(l){}}function ct(l){var f;l.preventDefault(),l.stopPropagation(),le(),lt(),(f=e.onAttach)==null||f.call(e);}function ut(){var P;let l=M==null?void 0:M.files,f=l?Array.from(l):[];M&&(M.value=""),!(!B||f.length===0)&&((P=e.onFiles)==null||P.call(e,f));}function dt(l){l.key==="Escape"&&ae&&le();}function ft(l){if(!ae)return;let f=l.target;f instanceof Node&&((c==null?void 0:c.contains(f))===true||(A==null?void 0:A.contains(f))===true)||le();}function pt(l){let f=typeof l.composedPath=="function"?l.composedPath():[],P=l.target,_=r==null?void 0:r.host,Q=!!(_&&(f.some(V=>V===_)||f.length===0&&P instanceof Node&&_.contains(P)));ae&&!Q&&le(),!(S||ne!=="open")&&(!_||Q||Y("onDismiss",()=>{var V;return (V=e.onDismiss)==null?void 0:V.call(e)})());}function fe(l){_t(l)&&l.preventDefault();}function Te(l){var P;if(!_t(l)||(l.preventDefault(),!B))return;let f=Rn(l);f.length!==0&&((P=e.onFiles)==null||P.call(e,f));}let me=Y("resize",De),d=Y("submit",Ne),h=Y("focus",at),v=Y("barClick",st),m=Y("pointerdown",Fe),L=Y("attachMenu",_e),X=Y("attach",ct),ee=Y("picked",ut),Ee=Y("stop",()=>{var l;return (l=e.onStop)==null?void 0:l.call(e)}),j=Y("menuKey",dt),Dt=Y("menuDismiss",pt),Nt=Y("menuDismissInside",ft),Ft=Y("dragover",fe),Bt=Y("drop",Te),Ht=Y("undock",()=>{var l;return (l=e.onUndock)==null?void 0:l.call(e)});function Vt(l){if(!i){i=true;try{l.style.setProperty("opacity","1");}catch(f){}}}function yr(l,f){if(i)return;if(!f||typeof f.setTimeout!="function"){i=true;return}try{l.style.setProperty("opacity","0"),l.style.setProperty("transition",`opacity ${Ro}ms ease`);}catch(_){i=true;return}let P=_=>{try{f.setTimeout(()=>Vt(l),_);}catch(Q){Vt(l);}};if(l.ownerDocument.readyState==="complete"){P(Mo);return}try{f.addEventListener("load",()=>P(Lo),{once:!0});}catch(_){}P(Oo);}function br(){var Q,V,xe;if(r!=null&&r.host.isConnected){w("The chat bar is already mounted. Ignoring the second mount.");return}r=null;let l=Xe({container:e.container});if(!l)return;r=l,yr(l.host,l.host.ownerDocument.defaultView),yn(r,Mn);let f=r.host.ownerDocument;s=f.createElement("div"),s.className="arcy-bar-wrap";for(let[re,ge]of Un)s.style.setProperty(re,ge);for(let[re,ge]of Wn)s.style.setProperty(re,ge,"important");s.style.setProperty("flex-direction","column"),s.style.setProperty("align-items","center"),o=f.createElement("div"),o.className="arcy-bar",o.setAttribute("role","group"),o.setAttribute("aria-label",t.openChat),u=f.createElement("form"),u.className="arcy-bar-form",a=f.createElement("input"),a.type="text",a.className="arcy-bar-input",a.maxLength=Co,a.setAttribute("aria-label",t.openChat),a.autocomplete="off",J=f.createElement("span"),J.className="arcy-bar-badge",J.style.setProperty("display","none"),b=f.createElement("button"),b.type="button",b.className="arcy-bar-grip",b.setAttribute("aria-label",t.moveBar),b.setAttribute("data-tip",t.moveBar),b.appendChild(ve(f,Fo,16)),b.addEventListener("pointerdown",Ie),b.addEventListener("click",re=>re.stopPropagation()),c=f.createElement("button"),c.type="button",c.className="arcy-bar-leading",T=p?$n(f,p,y):ve(f,Kn,y),c.appendChild(T),A=f.createElement("div"),A.className="arcy-bar-menu",A.setAttribute("role","menu"),A.style.setProperty("display","none"),x=f.createElement("button"),x.type="button",x.className="arcy-bar-menu-item",x.setAttribute("role","menuitem"),x.appendChild(ve(f,Do,16)),x.appendChild(f.createTextNode(t.attachImage)),A.appendChild(x),M=f.createElement("input"),M.type="file",M.accept=xn.join(","),M.multiple=true,M.tabIndex=-1,M.setAttribute("aria-hidden","true"),M.style.setProperty("display","none"),o.appendChild(M),C=f.createElement("button"),C.type="submit",C.className="arcy-bar-send",C.setAttribute("aria-label",t.send),C.appendChild(ve(f,Bo,18)),u.appendChild(b),u.appendChild(c),u.appendChild(a),u.appendChild(J),u.appendChild(C),R=f.createElement("div"),R.className="arcy-bar-status",R.style.setProperty("display","none");let P=f.createElement("span");P.className="arcy-bar-dot",P.setAttribute("aria-hidden","true"),I=f.createElement("span"),I.className="arcy-bar-flow-name",W=f.createElement("span"),W.className="arcy-bar-flow-step",N=f.createElement("button"),N.type="button",N.className="arcy-bar-stop",N.appendChild(ve(f,Ho,15,2)),N.appendChild(f.createTextNode(t.flowStop)),R.appendChild(P),R.appendChild(I),R.appendChild(W),R.appendChild(N),o.appendChild(u),o.appendChild(R),o.appendChild(A),z=f.createElement("div"),z.className="arcy-bar-disclaimer",z.style.setProperty("display","none"),s.appendChild(o),s.appendChild(z),k=f.createElement("button"),k.type="button",k.className="arcy-bar-dock",k.setAttribute("aria-label",t.openChat),k.setAttribute("data-tip",t.openChat),k.setAttribute("data-tip-placement","above"),k.setAttribute("data-tip-align","end");for(let[re,ge]of Un)k.style.setProperty(re,ge);for(let[re,ge]of Wn)k.style.setProperty(re,ge,"important");k.style.setProperty("align-items","center"),k.style.setProperty("justify-content","center"),k.style.setProperty("width",Bn),k.style.setProperty("height",Bn),K=ve(f,zn,18),k.appendChild(K),Pe(),k.addEventListener("click",Ht),u.addEventListener("submit",d),a.addEventListener("focus",h),o.addEventListener("click",v),o.addEventListener("pointerdown",m,true),c.addEventListener("click",L),x.addEventListener("click",X),M.addEventListener("change",ee),N.addEventListener("click",Ee),o.addEventListener("dragover",Ft),o.addEventListener("drop",Bt),f.addEventListener("pointerdown",Dt,true),r.root.addEventListener("pointerdown",Nt,true),f.addEventListener("keydown",j,true);let _=f.defaultView;_==null||_.addEventListener("resize",me),_==null||_.addEventListener("orientationchange",me),(Q=_==null?void 0:_.visualViewport)==null||Q.addEventListener("resize",me),(V=_==null?void 0:_.visualViewport)==null||V.addEventListener("scroll",me),r.root.appendChild(s),r.root.appendChild(k),$=Ze(_!=null?_:null),G=((xe=e.readDocked)==null?void 0:xe.call(e))===true,pe(),we();}function wr(){var P,_;if(!r)return;let l=r.host.ownerDocument.defaultView;l==null||l.removeEventListener("resize",me),l==null||l.removeEventListener("orientationchange",me),(P=l==null?void 0:l.visualViewport)==null||P.removeEventListener("resize",me),(_=l==null?void 0:l.visualViewport)==null||_.removeEventListener("scroll",me),u==null||u.removeEventListener("submit",d),a==null||a.removeEventListener("focus",h),o==null||o.removeEventListener("click",v),o==null||o.removeEventListener("pointerdown",m,true),c==null||c.removeEventListener("click",L),x==null||x.removeEventListener("click",X),M==null||M.removeEventListener("change",ee),N==null||N.removeEventListener("click",Ee),o==null||o.removeEventListener("dragover",Ft),o==null||o.removeEventListener("drop",Bt),k==null||k.removeEventListener("click",Ht);let f=r.host.ownerDocument;f.removeEventListener("pointerdown",Dt,true),r.root.removeEventListener("pointerdown",Nt,true),f.removeEventListener("keydown",j,true),r.destroy(),r=null,s=o=u=R=I=W=z=null,a=null,x=C=N=null,M=null,c=null,T=null,k=null,K=null,A=null,J=null,ae=false,S=null,ne="idle";}return {mount:br,unmount:wr,isMounted:()=>r!==null&&r.host.isConnected,getElement:()=>o,getRoot:()=>{var l;return (l=r==null?void 0:r.root)!=null?l:null},getHost:()=>{var l;return (l=r==null?void 0:r.host)!=null?l:null},setMode(l){ne!==l&&(ne=l,q=false,we());},getMode:()=>S?"flow":ne,setGeometry(l){var f,P,_;n={widthPercent:(f=l.widthPercent)!=null?f:n.widthPercent,bottomOffset:(P=l.bottomOffset)!=null?P:n.bottomOffset,collapsedWidth:(_=l.collapsedWidth)!=null?_:n.collapsedWidth},pe();},getMetrics:()=>se(U({},n),{offset:S||!F||$.isMobile?$e:H,height:(s==null?void 0:s.offsetHeight)||(o==null?void 0:o.offsetHeight)||Fn,keyboardOffset:$.keyboardOffset,isMobile:$.isMobile,viewportHeight:$.height,viewportWidth:$.width}),getHeight:()=>(s==null?void 0:s.offsetHeight)||(o==null?void 0:o.offsetHeight)||Fn,setLabels(l){t=U(U({},t),l);try{if(C==null||C.setAttribute("aria-label",t.send),x){let f=x.lastChild;f&&(f.textContent=t.attachImage);}if(o==null||o.setAttribute("aria-label",t.openChat),a==null||a.setAttribute("aria-label",t.openChat),k&&(k.setAttribute("aria-label",t.openChat),k.setAttribute("data-tip",t.openChat)),b&&(b.setAttribute("aria-label",t.moveBar),b.setAttribute("data-tip",t.moveBar)),N){let f=N.lastChild;f&&(f.textContent=t.flowStop);}}catch(f){}we();},setPlaceholder(l){try{a&&(a.placeholder=l!=null?l:"");}catch(f){}},setDisabled(l){try{a&&(a.disabled=l),C&&(C.disabled=l),x&&(x.disabled=l),l&&le();}catch(f){}},setAttachEnabled(l){B!==l&&(B=l,we());},setDraggable(l){var f,P,_;F!==l&&(F=l,H=l&&(P=(f=e.readPosition)==null?void 0:f.call(e))!=null?P:$e,pe(),(_=e.onGeometryChange)==null||_.call(e));},setIcon(l){p!==l&&(p=l,de());},setIconSize(l){y!==l&&(y=l,de());},setWelcomeIcon(l){g!==l&&(g=l,E=null,Pe());},setDocked(l){G!==l&&(G=l,Y("onDockedChange",()=>{var f;return (f=e.onDockedChange)==null?void 0:f.call(e,l)})(),l&&le(),pe(),Y("onGeometryChange",()=>{var f;return (f=e.onGeometryChange)==null?void 0:f.call(e)})());},isDocked:()=>G,setFlow(l){S=l,l||(O=false),we();},setAwaitingInput(l){O!==l&&(O=l,we(),Y("onGeometryChange",()=>{var f;return (f=e.onGeometryChange)==null?void 0:f.call(e)})());},setDisclaimer(l){try{if(z&&(z.textContent="",l!=null))if(typeof l=="string")z.textContent=l;else {let f=z.ownerDocument;z.appendChild(f.createTextNode(l.before));let P=f.createElement("a");P.className=An,P.href=l.linkHref,P.target="_blank",P.rel="noopener noreferrer",P.textContent=l.linkLabel,z.appendChild(P),l.after&&z.appendChild(f.createTextNode(l.after));}}catch(f){}we();},setAttachmentCount(l){ue=l;try{if(!J)return;let f=B&&l>0;J.textContent=f?String(l):"",J.style.setProperty("display",f?"flex":"none");}catch(f){}},focusInput(){try{r&&wt(r.host.ownerDocument,r.host),a==null||a.focus();}catch(l){}},reposition:()=>{$=Ze(typeof window!="undefined"?window:null),pe();},readValue:()=>{var l;return (l=a==null?void 0:a.value)!=null?l:""},clearValue(){try{a&&(a.value="");}catch(l){}}}}var Uo=/^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,Wo=/^[a-z0-9-]{1,32}$/,Xn={none:"none",soft:"0 0 2px rgba(16, 24, 40, 0.04), 0 0 8px rgba(16, 24, 40, 0.06)",medium:"0 0 4px rgba(16, 24, 40, 0.05), 0 0 20px rgba(16, 24, 40, 0.10)",strong:"0 0 8px rgba(16, 24, 40, 0.07), 0 0 36px rgba(16, 24, 40, 0.16)",bold:"0 0 12px rgba(16, 24, 40, 0.10), 0 0 48px rgba(16, 24, 40, 0.22)"},$o=20,Ko=50,zo=30,Go=80,Xo=0,Yo=120,jo=14,qo=28,Jo=180,Qo=480,Zo=2147483647,ot={vars:{},widthPercent:null,bottomOffset:null,collapsedWidth:null,barIconSize:null,maxHeightPercent:null,zIndex:null};function ce(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:null}function ke(e,t,n){return typeof e!="number"||!Number.isFinite(e)?null:Math.min(n,Math.max(t,e))}function Ke(e,t,n){if(t)for(let[r,i]of n){let s=t[r];typeof s=="string"&&Uo.test(s)&&(e[i]=s);}}function Me(e,t,n,r,i){let s=ke(n,r,i);s!==null&&(e[t]=`${s}px`);}function Yn(e,t,n){typeof n=="string"&&n in Xn&&(e[t]=Xn[n]);}function Pt(e){let t=ce(e);if(!t)return ot;let n={},r=ce(t.base);Ke(n,ce(r==null?void 0:r.brand),[["text","--_arcy-brand-text"],["background","--_arcy-brand-bg"],["hover","--_arcy-brand-bg-hover"],["active","--_arcy-brand-bg-active"]]),Ke(n,ce(r==null?void 0:r.main),[["text","--_arcy-main-text"],["background","--_arcy-main-bg"]]);let i=ce(r==null?void 0:r.border);Me(n,"--_arcy-border-width",i==null?void 0:i.width,0,8),Ke(n,i,[["color","--_arcy-border-color"]]);let s=ke(r==null?void 0:r.glassiness,0,100);s!==null&&s>0&&(n["--_arcy-glass-blur"]=`${Math.round(s/5)}px`,n["--_arcy-glass-alpha"]=`${Math.round(s/2)}%`);let o=r==null?void 0:r.fontFamily;typeof o=="string"&&Wo.test(o)&&o!=="system"&&(n[kt]=o);let u=ke(r==null?void 0:r.zIndex,0,Zo);Me(n,"--arcy-bar-radius",r==null?void 0:r.borderRadius,0,32),Me(n,"--_arcy-chat-radius",r==null?void 0:r.borderRadius,0,32),Yn(n,"--arcy-bar-shadow",r==null?void 0:r.shadow),Yn(n,"--_arcy-chat-shadow",r==null?void 0:r.shadow);let a=ce(t.bar),c=ce(t.chat);Me(n,"--_arcy-chat-logo-size",c==null?void 0:c.logoSize,16,48),Me(n,"--_arcy-chat-welcome-icon-size",c==null?void 0:c.welcomeIconSize,16,72),Ke(n,ce(c==null?void 0:c.assistantBubble),[["background","--_arcy-assistant-bg"],["text","--_arcy-assistant-text"]]);let T=ce(c==null?void 0:c.scrollbar);return Me(n,"--_arcy-scroll-width",T==null?void 0:T.width,2,16),Ke(n,T,[["track","--_arcy-scroll-track"],["thumb","--_arcy-scroll-thumb"],["thumbHover","--_arcy-scroll-thumb-hover"]]),{vars:n,widthPercent:ke(c==null?void 0:c.width,$o,Ko),bottomOffset:ke(a==null?void 0:a.bottomOffset,Xo,Yo),collapsedWidth:ke(a==null?void 0:a.collapsedWidth,Jo,Qo),barIconSize:ke(a==null?void 0:a.iconSize,jo,qo),maxHeightPercent:ke(c==null?void 0:c.maxHeight,zo,Go),zIndex:u!==null?Math.round(u):null}}var ei=["--_arcy-brand-text","--_arcy-brand-bg","--_arcy-brand-bg-hover","--_arcy-brand-bg-active","--_arcy-main-text","--_arcy-main-bg","--_arcy-border-width","--_arcy-border-color","--_arcy-glass-blur","--_arcy-glass-alpha",kt,"--arcy-bar-radius","--arcy-bar-shadow","--_arcy-chat-radius","--_arcy-chat-logo-size","--_arcy-chat-welcome-icon-size","--_arcy-chat-shadow","--_arcy-assistant-bg","--_arcy-assistant-text","--_arcy-scroll-width","--_arcy-scroll-track","--_arcy-scroll-thumb","--_arcy-scroll-thumb-hover"];function jn(e,t){try{for(let n of ei){let r=t.vars[n];r===void 0?e.style.removeProperty(n):e.style.setProperty(n,r);}e.style.setProperty("z-index",t.zIndex===null?bt:String(t.zIndex),"important");}catch(n){w(`The widget could not apply its theme. ${String(n)}`);}}var ti="arcy.tokens.",ni=4096,ri=100,oi=2048;function ze(e){let t=ce(e);if(!t)return null;let n=typeof t.name=="string"?t.name.slice(0,ri):"",r=t.logoUrl,i=typeof r=="string"&&r.length<=oi&&/^https:\/\//i.test(r)?r:null;return {name:n,logoUrl:i}}function qn(e,t=ye()){let n=oe(t),r=ti+e;return {read(){let i=ce(ie(n,r));return {tokens:Pt(i==null?void 0:i.t),identity:ze(i==null?void 0:i.w)}},remember(i,s){let o=ce(i),u=ze(s);if(!o&&!u){n.removeItem(r);return}try{let a={t:o!=null?o:void 0,w:u!=null?u:void 0};if(JSON.stringify(a).length>ni)return;Z(n,r,a);}catch(a){}}}}var ii="arcy.shell.",Jn=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/,ai=/^[a-z]{2}-[A-Z]{2}$/;function si(e){if(!e||typeof e!="object")return null;let{x:t,y:n}=e;return typeof t!="number"||typeof n!="number"||!Number.isFinite(t)||!Number.isFinite(n)?null:{x:t,y:n}}function li(e){var i,s,o;let t=typeof globalThis!="undefined"?globalThis.crypto:void 0;if(!e&&t&&typeof t.randomUUID=="function")try{let u=t.randomUUID();if(Jn.test(u))return u}catch(u){}let n=new Uint8Array(16);if(e)e(n);else if(t&&typeof t.getRandomValues=="function")t.getRandomValues(n);else for(let u=0;u<n.length;u++)n[u]=Math.floor(Math.random()*256);n[6]=((i=n[6])!=null?i:0)&15|64,n[8]=((s=n[8])!=null?s:0)&63|128;let r="";for(let u=0;u<n.length;u++)r+=((o=n[u])!=null?o:0).toString(16).padStart(2,"0");return `${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}function Qn(e,{store:t=ye(),fill:n}={}){let r=oe(t),i=ii+e;function s(){var a;return (a=ie(r,i))!=null?a:{}}function o(a){Z(r,i,U(U({},s()),a));}function u(){let a=s(),c=a.anonymousId;return {anonymousId:typeof c=="string"&&Jn.test(c)?c:null,position:si(a.position),docked:a.docked===true,locale:typeof a.locale=="string"&&ai.test(a.locale)?a.locale:null}}return {read:u,anonymousId(){let a=u().anonymousId;return a||(o({anonymousId:li(n)}),u().anonymousId)},rememberPosition(a){o({position:a});},rememberDocked(a){o({docked:a});},rememberLocale(a){o({locale:a});},forgetAnonymousId(){let a=s();a.anonymousId!==void 0&&(delete a.anonymousId,Object.keys(a).length===0?r.removeItem(i):Z(r,i,a));}}}var ci="arcy.visit.",Zn="first";function er(e,t=Le()){let n=oe(t),r=ci+e;return {markFirstVisit(){n.setItem(r,Zn);},isFirstVisit(){return n.getItem(r)===Zn}}}var tr="0123456789ABCDEFGHJKMNPQRSTVWXYZ";var Rt=e=>{let t=typeof globalThis!="undefined"?globalThis.crypto:void 0;if(t&&typeof t.getRandomValues=="function"){t.getRandomValues(e);return}for(let n=0;n<e.length;n++)e[n]=Math.floor(Math.random()*256);};function Oe(e,t=Rt){var o,u;let n="",r=Math.floor(e);for(let a=0;a<10;a++)n=((o=tr[r%32])!=null?o:"0")+n,r=Math.floor(r/32);let i=new Uint8Array(16);t(i);let s="";for(let a=0;a<16;a++)s+=tr[((u=i[a])!=null?u:0)%32];return n+s}var ui="arcy.chat.",di=1440*60*1e3;function nr(e,{store:t=ye(),fill:n=Rt,now:r=Date.now}={}){let i=oe(t),s=ui+e;function o(){var a;return (a=ie(i,s))!=null?a:{}}function u(){let a=Oe(r(),n);return Z(i,s,{id:a,lastActiveAt:r()}),a}return {id(){let a=o(),c=typeof a.id=="string"?a.id:null,T=typeof a.lastActiveAt=="number"?a.lastActiveAt:null;return c&&T!==null&&r()-T<di?c:u()},touch(){let a=o();typeof a.id=="string"&&Z(i,s,se(U({},a),{lastActiveAt:r()}));},reset(){u();},adopt(a){return typeof a!="string"||a.length===0?this.id():(Z(i,s,{id:a,lastActiveAt:r()}),a)},startNew(){return u()}}}var fi=["ON","REQUIRE_CONSENT","OFF"];function rr(e,t){function n(){let i=ie(e,t);if(!i)return {};let s=typeof i.state=="string"&&fi.indexOf(i.state)!==-1?i.state:void 0,o=typeof i.consent=="boolean"?i.consent:void 0;return {state:s,consent:o}}function r(i){if(i.state===void 0&&i.consent===void 0){e.removeItem(t);return}Z(e,t,i);}return {state:()=>{var i;return (i=n().state)!=null?i:null},consent:()=>{var i;return (i=n().consent)!=null?i:null},setState(i){r(se(U({},n()),{state:i}));},setConsent(i){let s=n();r({state:s.state,consent:i?true:void 0});},clearState(){r({state:void 0,consent:n().consent});},shouldCapture(){let{state:i,consent:s}=n();return i===void 0||i==="OFF"?false:i==="REQUIRE_CONSENT"?s===true:true}}}var pi=/iPhone|iPod|Android.*Mobile|Windows Phone|BlackBerry|Opera Mini|IEMobile/i,mi=/iPad|Tablet|PlayBook|Silk|Kindle/i;function or(e){var n;let t=(n=e==null?void 0:e.userAgent)!=null?n:"";return mi.test(t)||(e==null?void 0:e.platform)==="MacIntel"&&typeof e.maxTouchPoints=="number"&&e.maxTouchPoints>1?"tablet":pi.test(t)?"mobile":/Android/i.test(t)?"tablet":"desktop"}var gi=["INPUT","TEXTAREA","SELECT"];function ir(e,t){var o,u,a;let n=((o=e.tagName)!=null?o:"").toUpperCase(),r={tag:n.toLowerCase()},i=e.getAttribute("role");i&&(r.role=i.slice(0,64));let s=e.getAttribute("type");if(s&&(r.type=s.slice(0,32)),gi.indexOf(n)===-1){let c=((u=e.textContent)!=null?u:"").replace(/\s+/g," ").trim();c&&(r.text=c.slice(0,100));}else {let c=(a=e.getAttribute("aria-label"))!=null?a:e.getAttribute("name");c&&(r.label=c.slice(0,100));}if(t){let c=t(e);c&&Object.keys(c).length>0&&(r.fingerprint=c);}return r}function ar(e){var i,s;let t={},n=(i=e.getAttribute("name"))!=null?i:e.getAttribute("id");n&&(t.form=n.slice(0,100));let r=(s=e.elements)==null?void 0:s.length;return typeof r=="number"&&(t.fieldCount=r),t}function sr(e,t,n,r,i){let s={id:e,name:t,occurredAt:n,sessionId:r.sessionId};return r.userId&&(s.userId=r.userId),r.visitorId&&(s.visitorId=r.visitorId),r.route&&(s.route=r.route),r.localeCode&&(s.localeCode=r.localeCode),r.deviceClass&&(s.deviceClass=r.deviceClass),r.flowSessionId&&(s.flowSessionId=r.flowSessionId),i&&Object.keys(i).length>0&&(s.payload=i),s}var hi=["A","BUTTON","INPUT","SELECT","TEXTAREA","SUMMARY","OPTION","LABEL"],yi=["button","link","checkbox","radio","switch","tab","menuitem","menuitemcheckbox","menuitemradio","option","combobox","textbox","searchbox","slider","spinbutton","treeitem"];function bi(e,t){var s;let n=((s=e.tagName)!=null?s:"").toUpperCase();if(hi.indexOf(n)!==-1)return true;let r=e.getAttribute("role");if(r&&yi.indexOf(r.toLowerCase())!==-1||e.getAttribute("onclick")!==null)return true;let i=e.getAttribute("tabindex");return i!==null&&Number(i)>=0||e.getAttribute("contenteditable")==="true"?true:t?t(e)==="pointer":false}function lr(e,t){let n=e;for(let r=0;n&&r<6;r++){if(bi(n,t))return n;n=n.parentElement;}return null}var wi=1800*1e3,vi=60*1e3;function cr({store:e,key:t,now:n,fill:r,windowMs:i=wi}){function s(){let o=n(),u=ie(e,t);if(u&&typeof u.id=="string"&&u.id.length>0&&typeof u.seen=="number"&&o-u.seen<i)return o-u.seen>=vi&&Z(e,t,{id:u.id,seen:o}),u.id;let c=Oe(o,r);return Z(e,t,{id:c,seen:o}),c}return {touch:s,peek:()=>ie(e,t),clear(){e.removeItem(t);}}}var Si="https://api.arcyai.com",Ti="/api/v1/sdk/telemetry";function Ei(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r<128?t+=1:r<2048?t+=2:r>=55296&&r<=56319?(t+=4,n++):t+=3;}return t}function xi(e){let t=[],n=[],r=13;for(let i of e){let s=Ei(JSON.stringify(i))+1;(n.length>=100||n.length>0&&r+s>65536)&&(t.push(n),n=[],r=13),n.push(i),r+=s;}return n.length>0&&t.push(n),t}function ur(e){let{token:t,apiBase:n=Si,fetchImpl:r,sendBeacon:i,setTimeoutImpl:s=(C,R)=>setTimeout(C,R),clearTimeoutImpl:o=C=>clearTimeout(C),sessionStore:u,stopKey:a,onTelemetryOff:c}=e,T=`${n}${Ti}`,p=[],y=null,g=b(),E=Promise.resolve();function b(){return !u||!a?null:u.getItem(a)==="tracked_events_cap"?"tracked_events_cap":null}function F(C){g=C,p=[],k(),C==="tracked_events_cap"?u&&a&&u.setItem(a,C):c&&c();}function k(){y!==null&&(o(y),y=null);}function K(){y===null&&(y=s(()=>{y=null,M(false);},5e3));}function G(C){if(g===null){if(p.push(C),p.length>1e3&&p.splice(0,p.length-1e3),p.length>=20){M(false);return}K();}}function H(C){return D(this,null,function*(){try{let R=yield C.json();if(R&&typeof R=="object"){let I=R.code;if(typeof I=="string")return I}}catch(R){}return null})}function A(C){return D(this,null,function*(){if(!r)return C;let R;try{R=yield r(T,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify({events:C}),credentials:"omit"});}catch(I){return C}return R.status===403?(yield H(R))==="telemetry_off"?(F("telemetry_off"),[]):[]:R.status===429?(yield H(R))==="tracked_events_cap"?(F("tracked_events_cap"),[]):C:R.status>=500?C:[]})}function x(C){let R=JSON.stringify({events:C}),I=`${T}?token=${encodeURIComponent(t)}`;if(i&&typeof Blob!="undefined")try{if(i(I,new Blob([R],{type:"application/json"})))return !0}catch(W){}if(r)try{return r(T,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:R,keepalive:!0,credentials:"omit"}).catch(()=>{}),!0}catch(W){return false}return false}function M(C=false){return D(this,null,function*(){if(k(),g!==null||p.length===0){yield E;return}let R=p;p=[];let I=xi(R);if(C){for(let W of I)x(W);return}E=E.then(()=>D(null,null,function*(){let W=[];for(let N of I){if(g!==null)return;W.push(...yield A(N));}W.length>0&&g===null&&(p=W.concat(p),p.length>1e3&&p.splice(0,p.length-1e3),K());})),yield E;})}return {enqueue:G,flush:M,stopped:()=>g,discard(){p=[],k();},dispose(){k();}}}var dr="arcy:routechange",Ai="arcy.session.",ki="arcy.telemetry.",Ii="arcy.telemetry.stop.";function fr(e){return e.isTrusted===false}function Lt(e){var W,N,z,J,ne;let{token:t,apiBase:n,describeElement:r,getUserId:i,getVisitorId:s,getFlowSessionId:o,now:u=()=>Date.now(),fill:a}=e,c=e.win!==void 0?e.win:typeof window!="undefined"?window:null,T=e.doc!==void 0?e.doc:typeof document!="undefined"?document:null,p=(W=e.localStore)!=null?W:ye(),y=rr(p,ki+t),g=cr({store:p,key:Ai+t,now:u,fill:a}),E=ur({token:t,apiBase:n,fetchImpl:e.fetchImpl!==void 0?e.fetchImpl:typeof fetch!="undefined"?fetch.bind(globalThis):null,sendBeacon:(N=c==null?void 0:c.navigator)!=null&&N.sendBeacon&&typeof c.navigator.sendBeacon=="function"?c.navigator.sendBeacon.bind(c.navigator):null,setTimeoutImpl:e.setTimeoutImpl,clearTimeoutImpl:e.clearTimeoutImpl,sessionStore:(z=e.sessionStore)!=null?z:Le(),stopKey:Ii+t,onTelemetryOff:()=>y.clearState()}),b=or(c==null?void 0:c.navigator),F=(ne=(J=c==null?void 0:c.navigator)==null?void 0:J.language)!=null?ne:void 0,k=false,K=false,G=null,H=false;function A(){var S,O;return (O=cn((S=c==null?void 0:c.location)==null?void 0:S.href))!=null?O:void 0}function x(S,O,B){var $,be,Se,Ie;if(K||!y.shouldCapture()||E.stopped()!==null)return false;let ue=u(),ae=g.touch(),q=sr(Oe(ue,a),S,ue,{sessionId:ae,userId:($=i==null?void 0:i())!=null?$:void 0,visitorId:(be=s==null?void 0:s())!=null?be:void 0,route:A(),localeCode:F,deviceClass:b,flowSessionId:(Ie=(Se=B==null?void 0:B.flowSessionId)!=null?Se:o==null?void 0:o())!=null?Ie:void 0},O);return B!=null&&B.flowId&&(q.flowId=B.flowId),B!=null&&B.flowVersion&&(q.flowVersion=B.flowVersion),B!=null&&B.stepCvid&&(q.stepCvid=B.stepCvid),E.enqueue(q),true}let M=S=>{try{let O=S;if(fr(O))return;let B=c!=null&&c.getComputedStyle?ae=>{var q;try{return (q=c.getComputedStyle(ae).cursor)!=null?q:null}catch($){return null}}:void 0,ue=lr(O.target,B);if(!ue)return;x("interaction_click",ir(ue,r));}catch(O){}},C=S=>{try{let O=S;if(fr(O)||!O.target||typeof O.target.getAttribute!="function")return;x("form_submit",ar(O.target));}catch(O){}},R=()=>{var S;try{let O=(S=A())!=null?S:null;if(O===G)return;let B=G;G=O,x("navigation",B?{from:B}:void 0);}catch(O){}},I=()=>{try{E.flush(!0);}catch(S){}};return {start(){var S;k||K||(k=true,G=(S=A())!=null?S:null,T==null||T.addEventListener("click",M,true),T==null||T.addEventListener("submit",C,true),c==null||c.addEventListener(dr,R),c==null||c.addEventListener("popstate",R),c==null||c.addEventListener("pagehide",I),T==null||T.addEventListener("visibilitychange",I),H=!x("navigation")&&y.state()===null);},stop(S){K=true,k&&(k=false,T==null||T.removeEventListener("click",M,true),T==null||T.removeEventListener("submit",C,true),c==null||c.removeEventListener(dr,R),c==null||c.removeEventListener("popstate",R),c==null||c.removeEventListener("pagehide",I),T==null||T.removeEventListener("visibilitychange",I),S!=null&&S.discard?E.discard():E.flush(false),E.dispose());},setTelemetryState(S){y.setState(S),H&&(H=false,x("navigation"));},setTelemetryConsent(S){y.setConsent(S),S||E.discard();},track(S,O,B){x(S,O,B);},flush:()=>E.flush(false),sessionId:()=>g.touch(),resetSession:()=>g.clear(),stopped:()=>E.stopped(),state:()=>y.state()}}var pr="0.1.0";var _i=["telemetry","locale","defaultOpen","contentLocale"];function mr(){return {userId:null,isAnonymous:false,attributes:{}}}function Ci(e,t){return e==null?{ok:true,hash:void 0}:typeof e!="string"||e.length===0?(w(`${t}() was given a userHash that is not a string. Ignoring it.`),{ok:false}):{ok:true,hash:e}}function Mt(e,t){if(e===void 0)return {};if(typeof e!="object"||e===null||Array.isArray(e))return w(`${t}() attributes must be an object. Ignoring the call.`),null;let n={};for(let[r,i]of Object.entries(e)){if(i===null){n[r]=null;continue}let s=typeof i;if(s==="string"||s==="number"||s==="boolean"){n[r]=i;continue}if(Array.isArray(i)&&i.every(o=>typeof o=="string")){n[r]=i;continue}w(`${t}() dropped "${r}": an attribute must be a string, number, boolean, null, or an array of strings.`);}return n}function gr(){return Pi().api}function Pi(e={}){let t=en(),n=null,r={},i=mr(),s=false,o=null,u=null,a=null,c=false,T=null,p=null,y=null,g=0,E,b=null,F=null,k=null,K=null,G=null,H=ot,A=null,x=null,M=null,C=null,R=null,I=false,W=false;function N(d){return n===null?(w(`${d}() was called before init(). Ignoring.`),false):true}function z(d,h){return D(this,null,function*(){if(typeof d!="string"||d.length===0){w("init() needs an environment token. Ignoring the call.");return}if(n!==null){w("init() has already been called. Ignoring the second call.");return}if(n=d,r={},h!==void 0)if(typeof h!="object"||h===null)w("init() options must be an object. Continuing without them.");else for(let[v,m]of Object.entries(h)){if(!_i.includes(v)){w(`init() ignored unknown option "${v}". Only telemetry, locale, defaultOpen, and contentLocale can be set in code; everything else is configured in the dashboard.`);continue}r[v]=m;}J(d),ne(d),S(d),yield _e(),t.emit("ready"),r.defaultOpen&&fe();})}function J(d){try{b=Qn(d);let h=b.read().anonymousId!==null;K=b.anonymousId(),F=er(d),h||F.markFirstVisit();}catch(h){b=null,K=null,w(`The ARCY session could not be started. ${String(h)}`);}try{k=nr(d);}catch(h){k=null,w(`The ARCY session could not be started. ${String(h)}`);}try{G=qn(d);let h=G.read();H=h.tokens,A=h.identity;}catch(h){G=null,H=ot,w(`The ARCY session could not be started. ${String(h)}`);}try{p=Lt({token:d,apiBase:e.apiBase,fetchImpl:e.fetchImpl,describeElement:h=>rn(h),getUserId:()=>i.isAnonymous?null:i.userId,getVisitorId:()=>K}),r.telemetry!==void 0&&p.setTelemetryConsent(r.telemetry===!0),p.start();}catch(h){w(`Telemetry could not start. ${String(h)}`);}try{y=En({token:d,apiBase:e.apiBase,fetchImpl:e.fetchImpl,setTimeoutImpl:e.setTimeoutImpl});}catch(h){w(`The ARCY session could not be started. ${String(h)}`);}ue();}function ne(d){var h;if(typeof window!="undefined")try{vn({win:window,token:d,apiBase:(h=e.apiBase)!=null?h:We,fetchImpl:e.fetchImpl!==void 0?e.fetchImpl:typeof fetch!="undefined"?fetch.bind(globalThis):null,setTimeoutImpl:e.setTimeoutImpl,onVerified:()=>p==null?void 0:p.stop({discard:!0})});}catch(v){w(`Design mode could not start. ${String(v)}`);}}function S(d){if(typeof window!="undefined")try{let h=Sn(window,d);if(!h)return;p==null||p.stop({discard:!0}),c=!0,T=h;}catch(h){w(`The preview could not start. ${String(h)}`);}}function O(d){var h,v,m;return Tn({apiBase:(h=e.apiBase)!=null?h:We,token:n!=null?n:"",nonce:d,sessionToken:(m=(v=y==null?void 0:y.config())==null?void 0:v.sessionToken)!=null?m:null,userTraits:i.attributes,fetchImpl:e.fetchImpl!==void 0?e.fetchImpl:typeof fetch!="undefined"?fetch.bind(globalThis):null,setTimeoutImpl:e.setTimeoutImpl})}function B(){W=false,o==null||o.unmount(),o=null,u==null||u.destroy(),u=null,a==null||a.destroy(),a=null,x=null,M=null,C=null,Te();}function ue(){try{o||be(),ae(),Se(),u==null||u.refreshChrome(),W&&(W=!1,fe());}catch(d){w(`The chat bar could not render. ${String(d)}`);}}function ae(){var d,h,v,m;try{let L=o==null?void 0:o.getHost();if(!o||!L)return;jn(L,H),o.setGeometry({widthPercent:(d=H.widthPercent)!=null?d:nt,bottomOffset:(h=H.bottomOffset)!=null?h:et,collapsedWidth:(v=H.collapsedWidth)!=null?v:rt}),o.setIconSize((m=H.barIconSize)!=null?m:tt);}catch(L){w(`The widget could not apply its theme. ${String(L)}`);}}function q(){var ee,Ee;let d=(ee=y==null?void 0:y.config())==null?void 0:ee.widget,h=(Ee=ze(d))!=null?Ee:A;if(!h)return null;let v=j=>typeof j=="string"?j:"",m=d!=null&&d.chrome&&typeof d.chrome=="object"&&!Array.isArray(d.chrome)?U(U({},Qe),d.chrome):Qe,L=d==null?void 0:d.welcomeIconUrl,X=d==null?void 0:d.chatBarIconUrl;return {name:h.name,logoUrl:h.logoUrl,welcomeIconUrl:typeof L=="string"&&/^https:\/\//i.test(L)?L:null,chatBarIconUrl:typeof X=="string"&&/^https:\/\//i.test(X)?X:null,welcomeMessage:v(d==null?void 0:d.welcomeMessage),inputPlaceholder:v(d==null?void 0:d.inputPlaceholder),welcomeHeadline:v(d==null?void 0:d.welcomeHeadline),allowImageUpload:(d==null?void 0:d.allowImageUpload)===true,barDraggable:(d==null?void 0:d.barDraggable)===true,privacyPolicyUrl:typeof(d==null?void 0:d.privacyPolicyUrl)=="string"&&/^https:\/\//i.test(d.privacyPolicyUrl)?d.privacyPolicyUrl:null,chrome:m,locales:$(d==null?void 0:d.locales),activeLocale:typeof(d==null?void 0:d.activeLocale)=="string"?d.activeLocale:""}}function $(d){if(!Array.isArray(d))return [];let h=[];for(let v of d){if(!v||typeof v!="object")continue;let{code:m,label:L}=v;typeof m!="string"||m.length===0||typeof L!="string"||L.length===0||h.push({code:m,label:L});}return h}function be(){var d,h,v,m,L,X,ee,Ee;try{o=Gn({geometry:{widthPercent:(d=H.widthPercent)!=null?d:nt,bottomOffset:(h=H.bottomOffset)!=null?h:et,collapsedWidth:(v=H.collapsedWidth)!=null?v:rt},labels:Ie(),iconUrl:(L=(m=q())==null?void 0:m.chatBarIconUrl)!=null?L:null,welcomeIconUrl:(ee=(X=q())==null?void 0:X.welcomeIconUrl)!=null?ee:null,iconSize:(Ee=H.barIconSize)!=null?Ee:tt,onActivate:()=>fe(),onSubmit:j=>{if(I||fe(),x){x(j);return}R=j;},onAttach:()=>{fe();},onFiles:j=>{if(fe(),M){M(j);return}C=j;},onDismiss:()=>{Te();},onStop:()=>{a==null||a.stop(),De();},onGeometryChange:()=>u==null?void 0:u.reposition(),readPosition:()=>{var j;return (j=b==null?void 0:b.read().position)!=null?j:null},onPositionChange:j=>b==null?void 0:b.rememberPosition(j),readDocked:()=>(b==null?void 0:b.read().docked)===!0,onDockedChange:j=>b==null?void 0:b.rememberDocked(j),onUndock:()=>fe()}),o.mount(),at();}catch(j){w(`The chat bar could not render. ${String(j)}`);}}function Se(){var d,h,v;try{if(!o)return;let m=q();o.setLabels(Ie()),o.getMode()!=="flow"&&o.setPlaceholder((d=m==null?void 0:m.inputPlaceholder)!=null?d:null),o.setAttachEnabled((m==null?void 0:m.allowImageUpload)===!0),o.setDraggable((m==null?void 0:m.barDraggable)===!0),o.setIcon((h=m==null?void 0:m.chatBarIconUrl)!=null?h:null),o.setWelcomeIcon((v=m==null?void 0:m.welcomeIconUrl)!=null?v:null);}catch(m){w(`The widget could not apply its texts. ${String(m)}`);}}function Ie(){var h,v;let d=(v=(h=q())==null?void 0:h.chrome)!=null?v:Qe;return {send:d.send,attachMenu:d.attachMenu,attachImage:d.attachImage,flowStop:d.flowStop,openChat:d.openChat,moveBar:d.moveBar,flowStep:d.flowStep}}let it=600,pe=4e3,de=null,te=[],le=null;function Pe(d){let h=d.phase==="done"?pe:it;try{de=setTimeout(()=>{for(de=null;te.length>0;){let v=te.shift();if(Ne(v),v!==null){Pe(v);return}}},h);}catch(v){}}function we(d){if(d===null){let h=(le==null?void 0:le.phase)==="done"||te.some(v=>(v==null?void 0:v.phase)==="done");if(de!==null&&h){te[te.length-1]!==null&&te.push(null);return}De();return}if(de!==null){let h=te[te.length-1];if(d.phase!=="done"&&h!==void 0&&h!==null&&h.phase!=="done"){te[te.length-1]=d;return}te.push(d);return}Ne(d),Pe(d);}function De(){if(de!==null){try{clearTimeout(de);}catch(d){}de=null;}te=[],Ne(null);}function Ne(d){var h,v;le=d;try{if(d&&(o==null||o.setDocked(!1)),o==null||o.setFlow(d),d){Te();return}o==null||o.setPlaceholder((v=(h=q())==null?void 0:h.inputPlaceholder)!=null?v:null);}catch(m){w(`The flow status could not be shown. ${String(m)}`);}}function at(){try{let d=o==null?void 0:o.getRoot(),h=o==null?void 0:o.getHost(),v=o;if(!d||!h||!v)return;u=In({root:d,host:h,onRequestClose:()=>Te(),bar:{onSubmit:m=>{if(x=m,R!==null){let L=R;R=null,m(L);}},onFiles:m=>{if(M=m,C!==null){let L=C;C=null,m(L);}},setPlaceholder:m=>v.setPlaceholder(m),setDisabled:m=>v.setDisabled(m),setMode:m=>v.setMode(m),setFlow:m=>v.setFlow(m),setAwaitingInput:m=>v.setAwaitingInput(m),setDisclaimer:m=>v.setDisclaimer(m),setAttachEnabled:m=>v.setAttachEnabled(m),setAttachmentCount:m=>v.setAttachmentCount(m),focusInput:()=>v.focusInput(),getMetrics:()=>v.getMetrics(),dock:()=>v.setDocked(!0)},apiBase:e.apiBase,getSessionToken:()=>{var m,L;return (L=(m=y==null?void 0:y.config())==null?void 0:m.sessionToken)!=null?L:null},getSessionId:()=>p==null?void 0:p.sessionId(),getRoute:()=>typeof window!="undefined"?window.location.pathname:"",getMaxHeightPercent:()=>{var m;return (m=H.maxHeightPercent)!=null?m:void 0},onStartFlow:m=>{Fe(),a==null||a.start(m);},onStopFlow:()=>{a==null||a.stop(),De();},publicKey:n!=null?n:void 0,getConversationId:()=>{var m;return (m=k==null?void 0:k.id())!=null?m:null},setConversationId:m=>{var L,X;return m===null?(L=k==null?void 0:k.startNew())!=null?L:null:(X=k==null?void 0:k.adopt(m))!=null?X:null},touchConversation:()=>k==null?void 0:k.touch(),getVisitorId:()=>K,onOrgCapExceeded:()=>B(),track:(m,L,X)=>{p==null||p.track(m,X,L);},getWidget:()=>q(),onSelectLocale:m=>{Re(m);}});}catch(d){w(`The chat panel could not be prepared. ${String(d)}`);}}function Re(d){return D(this,null,function*(){try{if(typeof d!="string"||d.length===0||(b==null?void 0:b.read().locale)===d)return;b==null||b.rememberLocale(d),yield _e(),Se(),u==null||u.refreshChrome();}catch(h){w(`The widget could not change its language. ${String(h)}`);}})}function st(){var v,m;if(!n)return null;let d=(v=y==null?void 0:y.config())==null?void 0:v.sessionToken;if(!d)return null;let h=F;return se(U({apiBase:(m=e.apiBase)!=null?m:We,token:n,sessionToken:d,sessionId:p==null?void 0:p.sessionId(),getTrait:L=>{let X=i.attributes[L];if(!(X==null||Array.isArray(X)))return X}},h?{isFirstVisit:()=>h.isFirstVisit()}:{}),{promptFill:L=>{var ee;return o==null||o.setDocked(false),I=true,((ee=u==null?void 0:u.promptFill(L))!=null?ee:Promise.resolve(null)).finally(()=>{I=false;})},cancelFill:()=>{I=false,u==null||u.cancelFill();},onFailure:()=>{s||fe(),u==null||u.showFlowFailure();},track:(L,X,ee)=>{p==null||p.track(L,ee,X);},onStatus:L=>we(L),getBottomOcclusion:()=>{let L=o==null?void 0:o.getMetrics();return L?L.bottomOffset+L.keyboardOffset+L.height:0}})}function Fe(){if(!a)try{let d=st();if(!d)return;a=Pn({context:d});}catch(d){w(`The flow engine could not be prepared. ${String(d)}`);}}function _e(){return D(this,null,function*(){var d,h;try{yield ct();}catch(v){w(`The ARCY session could not be started. ${String(v)}`);}try{let v=y==null?void 0:y.config();if(v){let m=((d=v.customization)!=null?d:{}).tokens;G==null||G.remember(m,v.widget),H=Pt(m),A=(h=ze(v.widget))!=null?h:A;}}catch(v){w(`The widget could not read its theme. ${String(v)}`);}if(c||(Fe(),a&&(c=true,a.resume())),T){let v=T;T=null,D(null,null,function*(){if(Fe(),!a)return;if(v.kind==="pending"){yield a.resumePreview();return}let m=yield O(v.nonce);m&&(yield a.startPreview(m));}).catch(m=>w(`The preview could not run. ${String(m)}`));}ue();})}function lt(){if(E!==void 0)return E;try{let d=typeof window!="undefined"?window.location.pathname:null;return typeof d!="string"||!d.startsWith("/")?void 0:(E=He(d),E)}catch(d){return}}function ct(){return D(this,null,function*(){var v,m;if(!y||!p)return;let d=++g,h=yield y.sync({sessionId:p.sessionId(),route:lt(),visitorId:K!=null?K:void 0,userId:i.isAnonymous?void 0:(v=i.userId)!=null?v:void 0,userHash:i.isAnonymous?void 0:i.userHash,userTraits:Object.keys(i.attributes).length?i.attributes:void 0,uiLanguage:r.locale==="en"||r.locale==="tr"?r.locale:void 0,contentLocale:typeof r.contentLocale=="string"?r.contentLocale:void 0,viewerLocale:(m=b==null?void 0:b.read().locale)!=null?m:void 0});if(!h.ok){w("The ARCY session could not be started. The widget will keep working, and telemetry stays off until configuration arrives.");return}d===g&&(h.config.identityAccepted===false&&w("This environment enforces identity verification and no valid userHash was supplied, so this user was not identified and none of their attributes were stored. Pass a signed userHash: arcy.identify(userId, attributes, { userHash }). See Settings > Identity verification in the ARCY dashboard."),h.config.behavioralTelemetry&&p.setTelemetryState(h.config.behavioralTelemetry));})}function ut(d,h,v){return D(this,null,function*(){var ee;if(!N("identify"))return;if(typeof d!="string"||d.length===0){w("identify() needs a user id. Ignoring the call.");return}let m=Mt(h,"identify");if(m===null)return;let L=Ci((v!=null?v:{}).userHash,"identify");if(!L.ok)return;let X=i.userId===d&&!i.isAnonymous;i={userId:d,isAnonymous:false,attributes:X?U(U({},i.attributes),m):m,userHash:X?(ee=L.hash)!=null?ee:i.userHash:L.hash},yield _e();})}function dt(d){return D(this,null,function*(){if(!N("identifyAnonymous"))return;let h=Mt(d,"identifyAnonymous");h!==null&&(i={userId:null,isAnonymous:true,attributes:h},yield _e());})}function ft(d){return D(this,null,function*(){if(!N("updateUser"))return;if(!i.userId&&!i.isAnonymous){w("updateUser() was called before identify() or identifyAnonymous(). Ignoring the call.");return}let h=Mt(d,"updateUser");h!==null&&(i=se(U({},i),{attributes:U(U({},i.attributes),h)}),yield _e());})}function pt(){var d;i=mr(),b==null||b.forgetAnonymousId(),K=(d=b==null?void 0:b.anonymousId())!=null?d:null,p==null||p.resetSession(),k==null||k.reset(),Te();}function fe(){if(N("open")){if(!o){W=true;return}s||(o==null||o.setDocked(false),s=true,o==null||o.setMode("open"),u==null||u.open(),t.emit("open"));}}function Te(){s&&(s=false,o==null||o.setMode("idle"),u==null||u.close(),t.emit("close"));}function me(d,h){return t.on(d,h)}return {api:{init:z,identify:ut,identifyAnonymous:dt,updateUser:ft,reset:pt,open:fe,close:Te,on:me,VERSION:pr},getToken:()=>n,getOptions:()=>r,getIdentity:()=>i,isOpen:()=>s,getBar:()=>o,getChatController:()=>u,getFlowController:()=>a,getTelemetry:()=>p,getConfig:()=>{var d;return (d=y==null?void 0:y.config())!=null?d:null},selectLocale:Re,getShellState:()=>b,getTokens:()=>H}}var Ri=gr(),Ot=Ri;function hr(e,t){let n=e.q;for(;n.length>0;){let r=n.shift();if(!r)break;let i=t[r.method];if(typeof i!="function"){r.resolve();continue}try{let s=i(...r.args);s&&typeof s.then=="function"?s.then(()=>r.resolve(),()=>r.resolve()):r.resolve();}catch(s){r.resolve();}}}if(typeof window!="undefined"){let e=window.arcy;window.arcy=Ot,e&&Array.isArray(e.q)&&hr(e,Ot);}
|
|
567
|
+
})();
|