@espejo/browser 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chat.cjs +435 -353
- package/dist/chat.d.cts +24 -1
- package/dist/chat.d.ts +24 -1
- package/dist/chat.js +432 -350
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/dist/chat.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import{b as
|
|
2
|
-
${
|
|
3
|
-
`))
|
|
4
|
-
`))}catch{return}if(
|
|
5
|
-
`)+(
|
|
1
|
+
import{b as at,e as Hi,f as Ni}from"./chunk-54OEDPVD.js";import{A as Ze,B as rn,C as Li,D as an,G as Si,H as It,I as Mi,b as Ci,r as Ti,s as we,t as Ai,v as rt,z as _t}from"./chunk-MJUVVQNB.js";var ht="https://app.espejo.dev",Io=["home","support","tickets","guides"],qo=25,Go=1500,Do=5,Ri=/^[\x21-\x7e]+$/;function ft(e,i){let t=typeof e=="string"?e.trim():"",o=typeof i=="string"?i.trim():"";return Ri.test(t)&&Ri.test(o)?{email:t,hash:o}:null}var sn=e=>e?{[rn.email]:e.email,[rn.hash]:e.hash}:{},me=class extends Error{constructor(t,o,s){super(o);this.code=t;this.retryAfter=s}};function cn(e){let i=(e.baseUrl||ht).replace(/\/+$/,""),t=`espejo:chat:${e.key}`,o=e.storage===void 0?Vo():e.storage,s=e.fetch??((v,x)=>globalThis.fetch(v,x)),r=e.agent??ln(e.allow),c=v=>{try{e.onEvent?.(v)}catch{}},p=e.identity?ft(e.identity.email,e.identity.hash):null,l=`${t}:who`,f=v=>p?Fo(`${v}
|
|
2
|
+
${p.hash.toLowerCase()}`):null,g=Uo(o,t)??"";try{let v=o?.getItem(l);g&&v&&v!==f(g)&&(g="")}catch{}g=g?I(g):U();let b=null,m=[],h=!1,M=0,C=0;function U(){return I(Qo())}function I(v){try{o?.setItem(t,v);let x=f(v);x?o?.setItem(l,x):o?.removeItem(l)}catch{}return v}let j=new WeakMap,B=r.on("action",v=>j.set(v.action,v)),F=e.onConfirm?r.on("action_confirm",e.onConfirm):()=>{},_="",R=()=>{try{let v=r.getContext();return _=v.page,{page:v.page.slice(0,we.page),url:v.url.slice(0,we.url),recent:v.recent.slice(-we.recentItems).map(x=>x.slice(0,we.itemChars)),errors:v.errors.slice(-we.errorItems).map(x=>x.slice(0,we.itemChars))}}catch{return{page:"",url:typeof location<"u"?Ci(location.href).slice(0,we.url):"",recent:[],errors:[]}}},$=async(v,x)=>{let A=Bo(),N=await s(`${i}${Ti}`,{method:"POST",headers:{"content-type":"application/json","x-espejo-key":e.key,accept:"text/event-stream",...sn(p)},credentials:"omit",body:JSON.stringify(A?{...v,session_id:A}:v),signal:x});if(N.ok)return N;throw await $o(N)},K=async(v,x)=>{let A={...v.input??{},type:v.name};x({type:"tool_start",call:v,...zo(A,_)});let N;try{N=await r.act(A)}catch{N={ok:!1,error:"action_failed"}}let D=j.get(A);x({type:"tool",call:v,label:D?.label??v.name,...D?.target!==void 0?{target:D.target}:{},...D?.value!==void 0?{value:D.value}:{},...D?.destination!==void 0?{destination:D.destination}:{},result:N});let q={id:v.id,ok:N.ok};return N.error&&(q.error=N.error.slice(0,we.toolError)),N.snapshot&&(_=N.snapshot,q.snapshot=N.snapshot.slice(0,we.toolSnapshot)),q},de=async(v,x)=>{let A=oe=>{x.aborted||c(oe)},N={conversation_id:g,message:v,context:R()},D=!1,q=!1;for(let oe=0;oe<qo;oe++){let J;try{J=await $(N,x)}catch(pe){if(pe instanceof me&&(pe.code==="conversation_expired"||pe.code==="identity_changed")&&!D){D=!0,g=U(),N={conversation_id:g,message:v,context:R()},oe--;continue}if(pe instanceof me&&pe.code==="conversation_busy"&&!q){if(q=!0,await jo(Go,x),x.aborted)return!1;oe--;continue}throw pe}let{calls:Ae,awaiting:X}=await Oo(J,A);if(x.aborted)return!1;if(!X||!Ae.length)return c({type:"done",conversationId:g}),!0;let Le=[];for(let pe of Ae)if(Le.push(await K(pe,A)),x.aborted)return!1;N={conversation_id:g,tool_results:Le,context:R()}}return c({type:"error",code:"iteration_limit",message:"Too many actions in a row."}),!1},ne=async(v,x)=>{try{return await de(v,x)}catch(A){return x.aborted||(A instanceof me?c({type:"error",code:A.code,message:A.message,...A.retryAfter?{retryAfter:A.retryAfter}:{}}):A instanceof gt?c({type:"error",code:A.code,message:A.message}):c({type:"error",code:"network",message:"Could not reach the support agent."})),!1}},V=v=>typeof v=="string"?v.trim().slice(0,we.message):"",ie=()=>{m.length||(h=!1),c({type:"queue",queue:m.map(v=>({...v})),paused:h})},ve=()=>{!m.length||h||(h=!0,ie())},Te=async(v,x)=>{let A=new AbortController;b=A;try{for(;;){if(x!==void 0&&c({type:"dequeued",id:x,message:v}),!await ne(v,A.signal)){A.signal.aborted||ve();return}if(A.signal.aborted)return;let N=h?void 0:m.shift();if(!N)return;let D=C;if(ie(),C!==D)return;if(A.signal.aborted){m.unshift(N),ie();return}({id:x,text:v}=N)}}finally{b===A&&(b=null)}},be=()=>{b?.abort(),b=null},ge=v=>{let x=m.find(A=>A.id===v);return x&&(m=m.filter(A=>A!==x)),x},tt=()=>{be(),C++,m.length&&(m=[],ie()),g=U()};return{async send(v){let x=V(v);x&&(be(),ve(),await Te(x))},enqueue(v){let x=V(v);if(!x||m.length>=Do)return!1;let A=++M;return b||h?(m.push({id:A,text:x}),ie()):Te(x,A),!0},removeQueued(v){ge(v)&&ie()},editQueued(v,x){let A=m.find(D=>D.id===v);if(!A)return;let N=V(x);N?A.text=N:ge(v),ie()},async sendQueuedNow(v){let x=ge(v);x&&(be(),h=!1,ie(),await Te(x.text,x.id))},clearQueue(){C++,m.length&&(m=[],ie())},async resumeQueue(){if(!h)return;h=!1;let v=b?void 0:m.shift();ie(),v&&await Te(v.text,v.id)},reset:tt,abort(){be(),ve()},identify(v){let x=v?ft(v.email,v.hash):null;x?.email===p?.email&&x?.hash===p?.hash||(p=x,tt())},async getConfig(){try{let v=await s(`${i}${Ai}?key=${encodeURIComponent(e.key)}`,{headers:{"x-espejo-key":e.key},credentials:"omit"});if(v.status===404)return{enabled:!1,allowed_actions:[],theme:"auto",name:null,icon:null,sections:[]};if(!v.ok)return null;let x=await v.json(),A=x.enabled===!0,N=Array.isArray(x.sections)?Io.filter(D=>x.sections.includes(D)&&(D!=="support"||A)).sort((D,q)=>x.sections.indexOf(D)-x.sections.indexOf(q)):A?["support"]:[];return{enabled:A,allowed_actions:Array.isArray(x.allowed_actions)?rt.filter(D=>x.allowed_actions.includes(D)):[],theme:x.theme==="light"||x.theme==="dark"?x.theme:"auto",name:typeof x.name=="string"&&x.name?x.name:null,icon:typeof x.icon=="string"&&x.icon?x.icon:null,sections:N}}catch{return null}},destroy(){be(),C++,m=[],h=!1,F(),B()},get conversationId(){return g},get busy(){return b!==null},get queue(){return m.map(v=>({...v}))},get paused(){return h}}}var gt=class extends Error{constructor(t,o){super(o);this.code=t}};async function Oo(e,i){let t=[],o=null,s=f=>{let g="message",b=[];for(let h of f.split(`
|
|
3
|
+
`))h.startsWith("event:")?g=h.slice(6).trim():h.startsWith("data:")&&b.push(h.slice(5).replace(/^ /,""));if(!b.length)return;let m;try{m=JSON.parse(b.join(`
|
|
4
|
+
`))}catch{return}if(g==="text"&&typeof m.delta=="string")i({type:"text",delta:m.delta});else if(g==="tool_call"&&typeof m.id=="string"&&typeof m.name=="string"){let h=m.input&&typeof m.input=="object"?m.input:{};t.push({id:m.id,name:m.name,input:h})}else if(g==="done")o={awaiting:m.awaiting_tools===!0};else if(g==="error"){let h=typeof m.code=="string"?m.code:"internal";throw new gt(h,typeof m.message=="string"?m.message:h)}},r="",c=f=>{r+=f;let g=r.endsWith("\r");r=(g?r.slice(0,-1):r).replace(/\r\n?/g,`
|
|
5
|
+
`)+(g?"\r":"");let b;for(;(b=r.indexOf(`
|
|
6
6
|
|
|
7
|
-
`))>=0;){let
|
|
8
|
-
`),r.trim()&&
|
|
7
|
+
`))>=0;){let m=r.slice(0,b);r=r.slice(b+2),s(m)}},p=e.body?.getReader();if(p){let f=new TextDecoder;for(;;){let{done:g,value:b}=await p.read();if(g)break;c(f.decode(b,{stream:!0}))}c(f.decode())}else c(await e.text());r=r.replace(/\r/g,`
|
|
8
|
+
`),r.trim()&&s(r);let l=o;if(!l)throw new gt("network","The connection closed before the answer finished.");return{calls:t,awaiting:l.awaiting}}async function $o(e){let i={};try{i=await e.json()}catch{}let t=typeof i.message=="string"?i.message:`HTTP ${e.status}`,o=i.code;if(e.status===404)return new me("no_agent",t);if(e.status===403||e.status===401)return new me("forbidden",t);if(e.status===409){let s=o==="conversation_limit"||o==="conversation_expired"||o==="conversation_busy"||o==="identity_changed";return new me(s?o:"conflict",t)}if(e.status===429){if(o==="daily_cap")return new me("daily_cap",t);let s=Number(i.retry_after??e.headers.get("retry-after"));return new me("rate_limited",t,Number.isFinite(s)&&s>0?s:void 0)}return e.status>=500?new me("unavailable",t):new me("bad_request",t)}function zo(e,i){let t=String(e.type);if(t==="navigate"){let l=typeof e.url=="string"?e.url:"",f=l;try{f=new URL(l,location.href).href}catch{}return{label:`navigate to ${f||"?"}`,...f?{destination:f}:{}}}let o=typeof e.ref=="string"?e.ref:"",s=/^e\d+$/.test(o)?new RegExp(`"([^"\\n]*)" ref=${o}(?!\\d)`).exec(i):null,r=s?.[1]||void 0,c=t==="fill"&&typeof e.value=="string"?e.value:void 0,p=`${t} ${s?.[1]?`"${s[1]}"`:o||"?"}`;return c!==void 0&&(p+=` with "${c}"`),{label:p,...r?{target:r}:{},...c!==void 0?{value:c}:{}}}function ln(e){let t=Ni({snapshot:()=>{let o=globalThis.espejo;return o&&typeof o.snapshot=="function"?o.snapshot():null}});return t.policy({allow:e??[...rt]}),t}function Bo(){let i=globalThis.espejo?.lastReportId;return typeof i=="string"&&/^[0-9a-f]{32}$/.test(i)?i:null}function Fo(e){let i=3735928559,t=1103547991;for(let o=0;o<e.length;o++){let s=e.charCodeAt(o);i=Math.imul(i^s,2654435761),t=Math.imul(t^s,1597334677)}return i=Math.imul(i^i>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),t=Math.imul(t^t>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),(4294967296*(2097151&t)+(i>>>0)).toString(36)}function jo(e,i){return new Promise(t=>{let o=setTimeout(t,e);i.addEventListener("abort",()=>{clearTimeout(o),t()},{once:!0})})}function Vo(){try{return typeof sessionStorage<"u"?sessionStorage:null}catch{return null}}function Uo(e,i){try{let t=e?.getItem(i);return t&&Wo.test(t)?t:null}catch{return null}}var Wo=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Qo(){let e=globalThis.crypto;if(e&&typeof e.randomUUID=="function")return e.randomUUID();let i=new Uint8Array(16);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(i);else for(let o=0;o<16;o++)i[o]=Math.floor(Math.random()*256);i[6]=i[6]&15|64,i[8]=i[8]&63|128;let t=Array.from(i,o=>o.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function Xe(e){if(typeof e!="string"||!/^https:\/\//i.test(e.trim()))return null;try{let i=new URL(e.trim());return i.protocol==="https:"?i.href:null}catch{return null}}var st=e=>typeof e=="string"&&e?e:null;function dn(e){let i=e,t=st(i?.id),o=st(i?.title);return!t||!o?null:{id:t,title:o,description:st(i.description),url:Xe(i.url)}}function pn(e){let i=e;return{slug:st(i?.slug)??"",title:st(i?.title)??""}}function Pi(e){let i=(e.baseUrl||ht).replace(/\/+$/,""),t=e.fetch??((l,f)=>globalThis.fetch(l,f)),o=null,s=null,r=new Map,c=async(l,f)=>{try{let g=await t(`${i}${l}`,{headers:{"x-espejo-key":e.key},credentials:"omit",signal:f});if(g.status===404)return 404;if(!g.ok)return null;let b=await g.json();return b&&typeof b=="object"?b:null}catch{return null}},p=async()=>{let l=await c(_t.list);if(l===404)return{status:"hidden"};if(!l||!Array.isArray(l.collections))return o=null,{status:"error"};let f=l.collections.flatMap(b=>{let m=pn(b),h=b.articles,M=Array.isArray(h)?h.map(dn).filter(C=>!!C):[];return m.title&&M.length?[{...m,articles:M}]:[]}),g=Array.isArray(l.popular)?l.popular.filter(b=>typeof b=="string").slice(0,Ze.popular):[];return s={render:l.render==="link"?"link":"native",collections:f,popular:g},{status:"ready",data:s}};return{list(){return o??=p()},peek:()=>s,async search(l,f){let g=await c(`${_t.search}?q=${encodeURIComponent(l.slice(0,Ze.query))}`,f);return!g||g===404||!Array.isArray(g.results)||f.aborted?null:g.results.slice(0,Ze.results).flatMap(b=>{let m=dn(b),h=b;return m?[{...m,collection:pn(h.collection),snippet:st(h.snippet)??""}]:[]})},async article(l){let f=r.get(l);if(f)return{status:"ready",data:f};let g=await c(_t.article(l)),b=g===404?null:g,m=dn(b);if(!m||typeof b.markdown!="string")return{status:"error"};let h={...m,collection:pn(b.collection),markdown:b.markdown};return r.set(l,h),{status:"ready",data:h}}}}var Gi=/^\s{0,3}(`{3,}|~{3,})/,Di=/^\s{0,3}(#{1,6})\s+(.*?)(?:\s+#+)?\s*$/,Oi=/^\s{0,3}([-*_])(?:\s*\1){2,}\s*$/,un=/^\s{0,3}>\s?(.*)$/,mt=/^(\s*)(?:([-*+])|(\d{1,9})[.)])\s+(.*)$/,Ko=/^\s*\|?\s*:?-{3,}:?\s*(?:\|\s*:?-{3,}:?\s*)*\|?\s*$/,Yo=4,$i=e=>Gi.test(e)||Di.test(e)||Oi.test(e)||un.test(e)||mt.test(e),_i=e=>e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(i=>i.trim());function Jo(e){let i=[],t=e.replace(/\r\n?/g,`
|
|
9
9
|
`).split(`
|
|
10
|
-
`),o=0;for(;o<t.length;){let
|
|
11
|
-
`)});continue}let
|
|
12
|
-
`)});continue}if(a.includes("|")&&fo.test(t[o+1]??"")){let l=si(a),g=[];for(o+=2;o<t.length&&t[o].includes("|")&&t[o].trim();o++)g.push(si(t[o]));i.push({kind:"table",head:l,rows:g});continue}if(ht.test(a)){let l=mo(t,o);o=l.next,i.push({kind:"list",list:l.list});continue}let d=[];for(;o<t.length&&t[o].trim()&&!(d.length&&fi(t[o]));)d.push(t[o++]);i.push({kind:"p",lines:d})}return i}function mo(e,i){let t=ht.exec(e[i]),o={ordered:!t[2],start:t[3]?Number(t[3]):1,items:[]},a=i,r=null;for(;a<e.length;){let s=e[a],d=ht.exec(s);if(d&&d[1].length<2&&!d[2]!==o.ordered)break;if(d){let l=o.items[o.items.length-1];d[1].length>=2&&l?(l.sub??={ordered:!d[2],start:d[3]?Number(d[3]):1,items:[]},l.sub.items.push(r={text:d[4],sub:null})):o.items.push(r={text:d[4],sub:null}),a++}else if(s.trim())if(!fi(s)&&r)r.text+=` ${s.trim()}`,a++;else break;else{let l=a;for(;l<e.length&&!e[l].trim();)l++;if(l<e.length&&ht.test(e[l]))a=l;else break}}return{list:o,next:a}}var vo=/\\([\\`*_[\]()#+\-.!|>])|`([^`\n]+)`|\[!\[([^[\]\n]*)\]\(([^()\s]*)(?:\s+"[^"\n]*")?\)\]\(([^()\s]*)(?:\s+"[^"\n]*")?\)|!\[([^[\]\n]*)\]\(([^()\s]*)(?:\s+"[^"\n]*")?\)|\[([^[\]\n]+)\]\(([^()\s]*)(?:\s+"[^"\n]*")?\)|\*\*(?=\S)((?:[^*]|\*(?!\*))*?\S)\*\*|__(?=\S)((?:[^_]|_(?!_))*?\S)__|\*(?=[^\s*])([^*\n]*?[^\s*])\*|_(?=[^\s_])([^_\n]*?[^\s_])_/;function ci(e,i,t,o){let a=Ve(o);if(!a){(t||o)&&i.appendChild(e.createTextNode(t||o));return}let r=e.createElement("img");r.alt=t,r.referrerPolicy="no-referrer",r.loading="lazy",r.decoding="async",r.src=a,i.appendChild(r)}function li(e,i,t){let o=e.createElement("a");return o.href=t,o.target="_blank",o.rel="noopener noreferrer",i.appendChild(o)}function He(e,i,t){let o=r=>{r&&i.appendChild(e.createTextNode(r))},a=t;for(let r;r=vo.exec(a);){let s=r.index,d=a[s+r[0].length]??"";if(r[0][0]==="_"&&(/\w/.test(a[s-1]??"")||/\w/.test(d))){o(a.slice(0,s+1)),a=a.slice(s+1);continue}if(o(a.slice(0,s)),r[1]!==void 0)o(r[1]);else if(r[2]!==void 0)i.appendChild(e.createElement("code")).textContent=r[2];else if(r[5]!==void 0){let l=Ve(r[5]);ci(e,l?li(e,i,l):i,r[3],r[4])}else if(r[7]!==void 0)ci(e,i,r[6],r[7]);else if(r[8]!==void 0){let l=Ve(r[9]);l?He(e,li(e,i,l),r[8]):(He(e,i,r[8]),r[9]&&r[9]!==r[8]&&o(` (${r[9]})`))}else r[10]!==void 0||r[11]!==void 0?He(e,i.appendChild(e.createElement("strong")),r[10]??r[11]):He(e,i.appendChild(e.createElement("em")),r[12]??r[13]);a=a.slice(s+r[0].length)}o(a)}function hi(e,i){let t=e.createElement(i.ordered?"ol":"ul");i.ordered&&i.start!==1&&t.setAttribute("start",String(i.start));for(let o of i.items){let a=t.appendChild(e.createElement("li"));He(e,a,o.text),o.sub&&a.appendChild(hi(e,o.sub))}return t}function gi(e,i,t){let o=e.createDocumentFragment();for(let a of go(i))if(a.kind==="code")o.appendChild(e.createElement("pre")).appendChild(e.createElement("code")).textContent=a.text;else if(a.kind==="h")He(e,o.appendChild(e.createElement(`h${a.level}`)),a.text);else if(a.kind==="hr")o.appendChild(e.createElement("hr"));else if(a.kind==="quote"){let r=o.appendChild(e.createElement("blockquote"));t<ho?r.appendChild(gi(e,a.src,t+1)):r.textContent=a.src}else if(a.kind==="list")o.appendChild(hi(e,a.list));else if(a.kind==="table"){let r=o.appendChild(e.createElement("div"));r.className="ec-table";let s=r.appendChild(e.createElement("table")),d=s.appendChild(e.createElement("thead")).appendChild(e.createElement("tr"));for(let g of a.head)He(e,d.appendChild(e.createElement("th")),g);let l=s.appendChild(e.createElement("tbody"));for(let g of a.rows){let f=l.appendChild(e.createElement("tr"));a.head.forEach((x,v)=>He(e,f.appendChild(e.createElement("td")),g[v]??""))}}else{let r=o.appendChild(e.createElement("p"));a.lines.forEach((s,d)=>{d&&r.appendChild(/( {2,}|\\)$/.test(a.lines[d-1])?e.createElement("br"):e.createTextNode(" ")),He(e,r,s.trim().replace(/\\$/,""))})}return o}function mi(e,i,t){i.replaceChildren(gi(e,t,0))}var bo={chat:"M21 12a8 8 0 0 1-11.6 7.1L4 20l1-4.6A8 8 0 1 1 21 12z",sparkles:"M11 3l1.9 5.1L18 10l-5.1 1.9L11 17l-1.9-5.1L4 10l5.1-1.9zM19 15l.9 2.1L22 18l-2.1.9L19 21l-.9-2.1L16 18l2.1-.9z",headset:"M4 15v-3a8 8 0 0 1 16 0v3M4 14h3v6H5a1 1 0 0 1-1-1zM20 14h-3v6h2a1 1 0 0 0 1-1z",bot:"M6 9h12a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2zM12 9V5M12 4h.01M9.5 14h.01M14.5 14h.01",help:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM9.6 9.2a2.5 2.5 0 1 1 3.4 2.3c-.6.3-1 .8-1 1.5v.5M12 17h.01",close:"M6 6l12 12M18 6L6 18",restart:"M4 12a8 8 0 1 0 2.4-5.7L4 8.6M4 4v4.6h4.6",sliders:"M4 7h9M17 7h3M4 17h3M11 17h9M15 5v4M9 15v4",up:"M12 19V5M6 11l6-6 6 6",check:"M5 12.5l4.5 4.5L19 7.5",chevron:"M9 6l6 6-6 6",minus:"M7 12h10",highlight:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",scroll_to:"M12 4v16M8 8l4-4 4 4M8 16l4 4 4-4",click:"M6 3l13 7-5.5 1.8L11.7 17z",fill:"M4 20h4L19 9l-4-4L4 16zM13 7l4 4",navigate:"M5 12h14M13 6l6 6-6 6",home:"M4 10.5L12 4l8 6.5V19a1 1 0 0 1-1 1h-4.5v-5.5h-5V20H5a1 1 0 0 1-1-1z",book:"M5 19.5V5.5A2.5 2.5 0 0 1 7.5 3H19v14H7.5A2.5 2.5 0 0 0 5 19.5zM5 19.5A2.5 2.5 0 0 0 7.5 22H19v-5",search:"M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14zM20 20l-4-4",back:"M15 6l-6 6 6 6",ticket:"M3 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2zM14 5v2M14 11v2M14 17v2",video:"M4 6h10a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2zM16 10.5l6-3.5v10l-6-3.5"};function te(e,i,t=16){let o="http://www.w3.org/2000/svg",a=e.createElementNS(o,"svg");for(let[r,s]of Object.entries({width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"}))a.setAttribute(r,String(s));return a.appendChild(e.createElementNS(o,"path")).setAttribute("d",bo[i]),a}function vi(e){return e==="chat"||e==="sparkles"||e==="headset"||e==="bot"||e==="help"}function w(e,i,t="",o){let a=e.createElement(i);return t&&(a.className=t),o!==void 0&&(a.textContent=o),a}function ne(e,i,t){let o=w(e,"button",i,t);return o.type="button",o}function Ce(e,i,t,o){let a=te(e,i,t);return o&&a.setAttribute("class",o),a}function Mt(e,i,t,o){let a=ne(e,"ec-row"),r=a.appendChild(w(e,"span","ec-row-main"));return o&&r.appendChild(w(e,"span","ec-row-aside",o)),r.appendChild(w(e,"span","ec-row-title",i)),t&&r.appendChild(w(e,"span","ec-row-sub",t)),a.appendChild(Ce(e,"chevron",14,"ec-chev")),a}function ie(e,i,t){let o=w(e,"div","ec-note");return o.appendChild(w(e,"p","",i)),t&&o.appendChild(ne(e,"ec-btn",t.label)).addEventListener("click",t.run),o}function bi(e){let{doc:i,TEXT:t,root:o}=e,a=new Map,r="",s=ne(i,"ec-back");s.append(Ce(i,"back",14),i.createTextNode(t.tabGuides)),s.setAttribute("aria-label",t.backToGuides),s.addEventListener("click",e.back);let d=w(i,"p","ec-kicker"),l=w(i,"h2","ec-h"),g=w(i,"div","ec-doc"),f=w(i,"div","ec-vote");f.setAttribute("aria-live","polite"),o.append(s,d,l,g,f);let x=(m,A)=>{let C=a.get(m);if(C===void 0){let O=ne(i,"ec-btn",t.voteYes),B=ne(i,"ec-btn",t.voteNo),H=I=>()=>{a.set(m,I),x(m,!0)};O.addEventListener("click",H(!0)),B.addEventListener("click",H(!1));let N=w(i,"div","ec-actions");N.append(O,B),f.replaceChildren(w(i,"p","",t.voteQuestion),N);return}let W=!C&&e.hasSupport(),P=w(i,"p","",C?t.voteThanks:W?t.voteSorryAssist:t.voteSorry);P.tabIndex=-1,f.replaceChildren(P);let z=P;W&&(z=f.appendChild(ne(i,"ec-btn",t.askTitle)),z.setAttribute("data-primary",""),z.addEventListener("click",e.openSupport)),A&&z.focus()},v=m=>{f.replaceChildren(),g.replaceChildren(ie(i,t.articleLoading)),e.source.article(m).then(A=>{if(r!==m)return;if(A.status!=="ready"){g.replaceChildren(ie(i,t.articleError,{label:t.retry,run:()=>v(m)}));return}let{data:C}=A;C.collection.title&&(d.textContent=C.collection.title),d.hidden=!d.textContent,l.textContent=C.title,mi(i,g,C.markdown);let W=Ve(C.url);if(W){let P=g.appendChild(w(i,"p")).appendChild(w(i,"a","",t.openFullPage));P.href=W,P.target="_blank",P.rel="noopener noreferrer",P.appendChild(w(i,"span","ec-sr",` ${t.newTab}`))}x(m,!1)})};return{show(m,A){r=m.id,d.textContent=A,d.hidden=!A,l.textContent=m.title,o.scrollTop=0,v(m.id),s.focus()}}}var xo=300,yo=2;function tn(e,i,t,o,a,r,s){let d=Mt(e,o.title,a,s);return d.setAttribute("data-guide",o.id),t.peek()?.render==="link"&&o.url&&d.appendChild(w(e,"span","ec-sr",i.newTab)),d.addEventListener("click",r),d}var xi=e=>e.normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase();function yi(e){let{doc:i,TEXT:t,root:o}=e,a=w(i,"label","ec-search");a.appendChild(Ce(i,"search",16));let r=a.appendChild(w(i,"input"));r.type="search",r.placeholder=t.searchGuides,r.setAttribute("aria-label",t.searchGuides),r.maxLength=je.query,r.autocomplete="off";let s=w(i,"div","ec-stack");o.append(w(i,"h2","ec-h",t.tabGuides),a,s);let d=null,l="",g=null,f,x=null,v=(P,z,O,B)=>tn(i,t,e.source,P,O,()=>e.openGuide(P,z),B),m=()=>{if(!d)return;if(d.status!=="ready"){d.status==="error"&&s.replaceChildren(ie(i,t.guidesError,{label:t.retry,run:A}));return}let{collections:P}=d.data;if(!l){s.replaceChildren(...P.length?P.map(N=>{let I=w(i,"section","ec-box"),K=I.appendChild(w(i,"div","ec-box-head")),oe=N.articles.length;K.append(w(i,"h3","ec-box-title",N.title),w(i,"span","ec-muted",oe===1?t.guidesCountOne:t.guidesCount.replace("{n}",String(oe))));let Ee=I.appendChild(w(i,"div","ec-list"));for(let de of N.articles)Ee.appendChild(v(de,N.title,de.description));return I}):[ie(i,t.guidesEmpty)]);return}let z=xi(l).split(/\s+/).filter(Boolean),O=new Map((g??[]).map(N=>[N.id,N])),B=P.flatMap(N=>N.articles.filter(I=>{let K=xi(`${I.title} ${I.description??""}`);return z.every(oe=>K.includes(oe))}).map(I=>{let K=O.get(I.id);return O.delete(I.id),v(I,N.title,K?K.snippet||K.description:I.description,N.title)}));for(let N of O.values())B.push(v(N,N.collection.title,N.snippet||N.description,N.collection.title));if(B.length){let N=w(i,"div","ec-list");N.append(...B),s.replaceChildren(N);return}let H=ie(i,t.guidesNoMatch);e.hasSupport()&&H.appendChild(ne(i,"ec-btn",t.askInstead)).addEventListener("click",e.openSupport),s.replaceChildren(H)};function A(){if(d?.status==="ready")return m();s.replaceChildren(ie(i,t.guidesLoading)),e.source.list().then(P=>{d=P,P.status==="hidden"?e.onHidden():m()})}let C=async P=>{x?.abort();let z=x=new AbortController,O=await e.source.search(P,z.signal);z.signal.aborted||P!==l||!O||(g=O,m())},W=()=>{if(l=r.value.trim().slice(0,je.query),g=null,x?.abort(),clearTimeout(f),m(),l.length>=yo){let P=l;f=setTimeout(()=>{C(P)},xo)}};return r.addEventListener("input",W),{show(P){A(),P&&r.focus()},focusGuide(P){let z=Array.from(s.querySelectorAll("[data-guide]")).find(O=>O.getAttribute("data-guide")===P);return z?.focus(),!!z},destroy(){clearTimeout(f),x?.abort()}}}var ki=["all","open","resolved"];function ko(e,i,t){let[o,a]=t.status==="you"?[i.statusYou,"accent"]:t.status==="resolved"?[i.statusResolved,"good"]:[i.statusTeam,"warn"],r=w(e,"span","ec-pill",o);return r.setAttribute("data-tone",a),r}function nn(e,i,t,o){let a=w(e,o,"ec-ticket");o==="button"&&(a.type="button");let r=a.appendChild(w(e,"span","ec-tmeta"));r.append(w(e,"span","ec-mono",t.key),ko(e,i,t));let s=Date.parse(t.updated_at);return s&&r.append(w(e,"span","ec-muted",on(i,s))),a.append(w(e,"span","ec-row-title",t.title)),t.last_message&&a.append(w(e,"span","ec-row-sub",t.last_message.excerpt)),t.has_recording&&a.appendChild(w(e,"span","ec-tfoot")).append(Ce(e,"video",14),w(e,"span","",i.recordingAttached)),a}function wi(e){let{doc:i,TEXT:t,root:o}=e,a=w(i,"div","ec-box-head"),r=ne(i,"ec-btn",t.reportProblem);r.addEventListener("click",e.report),a.append(w(i,"h2","ec-h",t.tabTickets),r);let s=w(i,"div","ec-filters");s.setAttribute("role","group"),s.setAttribute("aria-label",t.ticketsFilter);let d=w(i,"div","ec-stack");o.append(a,s,d);let l="all",g=0,f={all:t.filterAll,open:t.filterOpen,resolved:t.filterResolved},x=ki.map(A=>{let C=s.appendChild(ne(i,"ec-filter",f[A]));return C.addEventListener("click",()=>{l=A,m()}),C}),v=A=>{if(A.status==="hidden"||A.status==="denied")return e.onGone(A.status);if(A.status==="error"){d.replaceChildren(ie(i,t.ticketsError,{label:t.retry,run:m}));return}let{tickets:C}=A.data;d.replaceChildren(...C.length?C.map(W=>nn(i,t,W,"article")):[ie(i,t.ticketsEmpty)])};function m(){ki.forEach((C,W)=>x[W].setAttribute("aria-pressed",String(C===l)));let A=++g;d.replaceChildren(ie(i,t.ticketsLoading)),e.source.list(l).then(C=>{A===g&&v(C)})}return{show(A){r.hidden=!e.canReport(),m(),A&&(r.hidden?x[0]:r).focus()},reset(){g++,d.replaceChildren()}}}function on(e,i){let t=Math.floor((Date.now()-i)/6e4);if(t<1)return e.agoNow;if(t<60)return e.agoMinutes.replace("{n}",String(t));let o=Math.floor(t/60);return o<24?e.agoHours.replace("{n}",String(o)):e.agoDays.replace("{n}",String(Math.floor(o/24)))}function Ci(e){let{doc:i,TEXT:t}=e,o=w(i,"h2","ec-hello");o.append(w(i,"span","",t.hello),w(i,"span","",t.helpPrompt));let a=[o];if(e.support){let r=w(i,"section","ec-box"),s=ne(i,"ec-fake");if(s.append(w(i,"span","",t.placeholder),Ce(i,"up",14,"ec-fake-go")),s.setAttribute("aria-label",t.askTitle),s.addEventListener("click",e.openSupport),r.append(w(i,"h3","ec-box-title",t.askTitle),w(i,"p","ec-box-sub",t.askHint),s),a.push(r),e.last){let d=w(i,"section","ec-box"),l=Mt(i,e.last.text,on(t,e.last.at));l.addEventListener("click",e.openSupport),d.append(w(i,"h3","ec-box-title",t.continueTitle),l),a.push(d)}}if(e.tickets){let r=w(i,"div","ec-stack");a.push(r),e.tickets.list("all").then(s=>{if(!r.isConnected)return;if(s.status==="hidden"||s.status==="denied")return e.onTicketsGone(s.status);let d=s.status==="ready"&&s.data.tickets.find(g=>g.status!=="resolved");if(!d)return r.remove();let l=nn(i,t,d,"button");l.addEventListener("click",e.openTickets),r.className="ec-box",r.append(w(i,"h3","ec-box-title",t.openTicket),l)})}if(e.guides){let r=w(i,"section","ec-box"),s=ne(i,"ec-fake");s.append(Ce(i,"search",16),w(i,"span","",t.searchGuides)),s.addEventListener("click",e.searchGuides);let d=w(i,"div","ec-stack");r.append(s,d),a.push(r);let l=()=>{d.replaceChildren(ie(i,t.guidesLoading)),e.source.list().then(g=>{if(!d.isConnected)return;if(g.status==="hidden")return e.onHidden();if(g.status==="error"){d.replaceChildren(ie(i,t.guidesError,{label:t.retry,run:l}));return}let f=g.data.popular.flatMap(v=>{for(let m of g.data.collections){let A=m.articles.find(C=>C.id===v);if(A)return[tn(i,t,e.source,A,A.description,()=>e.openGuide(A,m.title))]}return[]});if(d.replaceChildren(),!f.length)return;let x=w(i,"div","ec-list");x.append(...f),d.append(w(i,"h3","ec-box-title",t.popularGuides),x)})};e.root.replaceChildren(...a),l()}else e.root.replaceChildren(...a)}var wo=/^\s*(`{3,})/,Co=/^\s*(`{3,})\s*$/,Eo=/^\s*[-*+]\s+(.*)$/,To=/^\s*(\d{1,9})[.)]\s+(.*)$/,Ao=/^\s*#{1,6}\s+(.*)$/;function So(e){let i=[],t=e.replace(/\r\n?/g,`
|
|
10
|
+
`),o=0;for(;o<t.length;){let s=t[o];if(!s.trim()){o++;continue}let r=Gi.exec(s);if(r){let l=r[1],f=[];for(;++o<t.length&&!new RegExp(`^\\s{0,3}${l[0]==="`"?"`":"~"}{${l.length},}\\s*$`).test(t[o]);)f.push(t[o]);o++,i.push({kind:"code",text:f.join(`
|
|
11
|
+
`)});continue}let c=Di.exec(s);if(c){i.push({kind:"h",level:Math.min(c[1].length,4),text:c[2]}),o++;continue}if(Oi.test(s)){i.push({kind:"hr"}),o++;continue}if(un.test(s)){let l=[];for(let f;o<t.length&&(f=un.exec(t[o]));o++)l.push(f[1]);i.push({kind:"quote",src:l.join(`
|
|
12
|
+
`)});continue}if(s.includes("|")&&Ko.test(t[o+1]??"")){let l=_i(s),f=[];for(o+=2;o<t.length&&t[o].includes("|")&&t[o].trim();o++)f.push(_i(t[o]));i.push({kind:"table",head:l,rows:f});continue}if(mt.test(s)){let l=Zo(t,o);o=l.next,i.push({kind:"list",list:l.list});continue}let p=[];for(;o<t.length&&t[o].trim()&&!(p.length&&$i(t[o]));)p.push(t[o++]);i.push({kind:"p",lines:p})}return i}function Zo(e,i){let t=mt.exec(e[i]),o={ordered:!t[2],start:t[3]?Number(t[3]):1,items:[]},s=i,r=null;for(;s<e.length;){let c=e[s],p=mt.exec(c);if(p&&p[1].length<2&&!p[2]!==o.ordered)break;if(p){let l=o.items[o.items.length-1];p[1].length>=2&&l?(l.sub??={ordered:!p[2],start:p[3]?Number(p[3]):1,items:[]},l.sub.items.push(r={text:p[4],sub:null})):o.items.push(r={text:p[4],sub:null}),s++}else if(c.trim())if(!$i(c)&&r)r.text+=` ${c.trim()}`,s++;else break;else{let l=s;for(;l<e.length&&!e[l].trim();)l++;if(l<e.length&&mt.test(e[l]))s=l;else break}}return{list:o,next:s}}var Xo=/\\([\\`*_[\]()#+\-.!|>])|`([^`\n]+)`|\[!\[([^[\]\n]*)\]\(([^()\s]*)(?:\s+"[^"\n]*")?\)\]\(([^()\s]*)(?:\s+"[^"\n]*")?\)|!\[([^[\]\n]*)\]\(([^()\s]*)(?:\s+"[^"\n]*")?\)|\[([^[\]\n]+)\]\(([^()\s]*)(?:\s+"[^"\n]*")?\)|\*\*(?=\S)((?:[^*]|\*(?!\*))*?\S)\*\*|__(?=\S)((?:[^_]|_(?!_))*?\S)__|\*(?=[^\s*])([^*\n]*?[^\s*])\*|_(?=[^\s_])([^_\n]*?[^\s_])_/;function Ii(e,i,t,o){let s=Xe(o);if(!s){(t||o)&&i.appendChild(e.createTextNode(t||o));return}let r=e.createElement("img");r.alt=t,r.referrerPolicy="no-referrer",r.loading="lazy",r.decoding="async",r.src=s,i.appendChild(r)}function qi(e,i,t){let o=e.createElement("a");return o.href=t,o.target="_blank",o.rel="noopener noreferrer",i.appendChild(o)}function Ge(e,i,t){let o=r=>{r&&i.appendChild(e.createTextNode(r))},s=t;for(let r;r=Xo.exec(s);){let c=r.index,p=s[c+r[0].length]??"";if(r[0][0]==="_"&&(/\w/.test(s[c-1]??"")||/\w/.test(p))){o(s.slice(0,c+1)),s=s.slice(c+1);continue}if(o(s.slice(0,c)),r[1]!==void 0)o(r[1]);else if(r[2]!==void 0)i.appendChild(e.createElement("code")).textContent=r[2];else if(r[5]!==void 0){let l=Xe(r[5]);Ii(e,l?qi(e,i,l):i,r[3],r[4])}else if(r[7]!==void 0)Ii(e,i,r[6],r[7]);else if(r[8]!==void 0){let l=Xe(r[9]);l?Ge(e,qi(e,i,l),r[8]):(Ge(e,i,r[8]),r[9]&&r[9]!==r[8]&&o(` (${r[9]})`))}else r[10]!==void 0||r[11]!==void 0?Ge(e,i.appendChild(e.createElement("strong")),r[10]??r[11]):Ge(e,i.appendChild(e.createElement("em")),r[12]??r[13]);s=s.slice(c+r[0].length)}o(s)}function zi(e,i){let t=e.createElement(i.ordered?"ol":"ul");i.ordered&&i.start!==1&&t.setAttribute("start",String(i.start));for(let o of i.items){let s=t.appendChild(e.createElement("li"));Ge(e,s,o.text),o.sub&&s.appendChild(zi(e,o.sub))}return t}function Bi(e,i,t){let o=e.createDocumentFragment();for(let s of Jo(i))if(s.kind==="code")o.appendChild(e.createElement("pre")).appendChild(e.createElement("code")).textContent=s.text;else if(s.kind==="h")Ge(e,o.appendChild(e.createElement(`h${s.level}`)),s.text);else if(s.kind==="hr")o.appendChild(e.createElement("hr"));else if(s.kind==="quote"){let r=o.appendChild(e.createElement("blockquote"));t<Yo?r.appendChild(Bi(e,s.src,t+1)):r.textContent=s.src}else if(s.kind==="list")o.appendChild(zi(e,s.list));else if(s.kind==="table"){let r=o.appendChild(e.createElement("div"));r.className="ec-table";let c=r.appendChild(e.createElement("table")),p=c.appendChild(e.createElement("thead")).appendChild(e.createElement("tr"));for(let f of s.head)Ge(e,p.appendChild(e.createElement("th")),f);let l=c.appendChild(e.createElement("tbody"));for(let f of s.rows){let g=l.appendChild(e.createElement("tr"));s.head.forEach((b,m)=>Ge(e,g.appendChild(e.createElement("td")),f[m]??""))}}else{let r=o.appendChild(e.createElement("p"));s.lines.forEach((c,p)=>{p&&r.appendChild(/( {2,}|\\)$/.test(s.lines[p-1])?e.createElement("br"):e.createTextNode(" ")),Ge(e,r,c.trim().replace(/\\$/,""))})}return o}function Fi(e,i,t){i.replaceChildren(Bi(e,t,0))}var er={chat:"M21 12a8 8 0 0 1-11.6 7.1L4 20l1-4.6A8 8 0 1 1 21 12z",sparkles:"M11 3l1.9 5.1L18 10l-5.1 1.9L11 17l-1.9-5.1L4 10l5.1-1.9zM19 15l.9 2.1L22 18l-2.1.9L19 21l-.9-2.1L16 18l2.1-.9z",headset:"M4 15v-3a8 8 0 0 1 16 0v3M4 14h3v6H5a1 1 0 0 1-1-1zM20 14h-3v6h2a1 1 0 0 0 1-1z",bot:"M6 9h12a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2zM12 9V5M12 4h.01M9.5 14h.01M14.5 14h.01",help:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM9.6 9.2a2.5 2.5 0 1 1 3.4 2.3c-.6.3-1 .8-1 1.5v.5M12 17h.01",close:"M6 6l12 12M18 6L6 18",restart:"M4 12a8 8 0 1 0 2.4-5.7L4 8.6M4 4v4.6h4.6",sliders:"M4 7h9M17 7h3M4 17h3M11 17h9M15 5v4M9 15v4",up:"M12 19V5M6 11l6-6 6 6",check:"M5 12.5l4.5 4.5L19 7.5",chevron:"M9 6l6 6-6 6",minus:"M7 12h10",highlight:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",scroll_to:"M12 4v16M8 8l4-4 4 4M8 16l4 4 4-4",click:"M6 3l13 7-5.5 1.8L11.7 17z",fill:"M4 20h4L19 9l-4-4L4 16zM13 7l4 4",navigate:"M5 12h14M13 6l6 6-6 6",home:"M4 10.5L12 4l8 6.5V19a1 1 0 0 1-1 1h-4.5v-5.5h-5V20H5a1 1 0 0 1-1-1z",book:"M5 19.5V5.5A2.5 2.5 0 0 1 7.5 3H19v14H7.5A2.5 2.5 0 0 0 5 19.5zM5 19.5A2.5 2.5 0 0 0 7.5 22H19v-5",search:"M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14zM20 20l-4-4",back:"M15 6l-6 6 6 6",ticket:"M3 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2zM14 5v2M14 11v2M14 17v2",video:"M4 6h10a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2zM16 10.5l6-3.5v10l-6-3.5",expand:"M14 4h6v6M20 4l-7 7M10 20H4v-6M4 20l7-7",collapse:"M4 14h6v6M10 14l-7 7M20 10h-6V4M14 10l7-7",dock:"M6 4.5h12A2.5 2.5 0 0 1 20.5 7v10a2.5 2.5 0 0 1-2.5 2.5H6A2.5 2.5 0 0 1 3.5 17V7A2.5 2.5 0 0 1 6 4.5zM14.5 4.5v15",more:"M5.5 12h.01M12 12h.01M18.5 12h.01",copy:"M11.5 9h6a2.5 2.5 0 0 1 2.5 2.5v6a2.5 2.5 0 0 1-2.5 2.5h-6A2.5 2.5 0 0 1 9 17.5v-6A2.5 2.5 0 0 1 11.5 9zM5 15V6a2 2 0 0 1 2-2h9",thumb:"M7 11v9H4.5a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1zM7 11l4-7.5a2 2 0 0 1 2.2 2.3L12.6 10h5.6a2 2 0 0 1 2 2.4l-1.3 6A2 2 0 0 1 16.9 20H7",alert:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 8v5M12 16.5v.01"};function Q(e,i,t=16){let o="http://www.w3.org/2000/svg",s=e.createElementNS(o,"svg");for(let[r,c]of Object.entries({width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"}))s.setAttribute(r,String(c));return s.appendChild(e.createElementNS(o,"path")).setAttribute("d",er[i]),s}function ji(e){return e==="chat"||e==="sparkles"||e==="headset"||e==="bot"||e==="help"}function E(e,i,t="",o){let s=e.createElement(i);return t&&(s.className=t),o!==void 0&&(s.textContent=o),s}function ae(e,i,t){let o=E(e,"button",i,t);return o.type="button",o}function Re(e,i,t,o){let s=Q(e,i,t);return o&&s.setAttribute("class",o),s}function qt(e,i,t,o){let s=ae(e,"ec-row"),r=s.appendChild(E(e,"span","ec-row-main"));return o&&r.appendChild(E(e,"span","ec-row-aside",o)),r.appendChild(E(e,"span","ec-row-title",i)),t&&r.appendChild(E(e,"span","ec-row-sub",t)),s.appendChild(Re(e,"chevron",14,"ec-chev")),s}function je(e,i){let t=E(e,"div","ec-skels");t.setAttribute("role","status"),t.setAttribute("aria-label",i),t.setAttribute("aria-busy","true");for(let o of[40,88,64])t.appendChild(E(e,"i","ec-skel")).style.width=`${o}%`;return t}function Ee(e,i,t){let o=E(e,"div","ec-note");return o.appendChild(E(e,"p","",i)),t&&o.appendChild(ae(e,"ec-btn",t.label)).addEventListener("click",t.run),o}function Vi(e){let{doc:i,TEXT:t,root:o}=e,s=new Map,r="",c=ae(i,"ec-back");c.append(Re(i,"back",14),i.createTextNode(t.tabGuides)),c.setAttribute("aria-label",t.backToGuides),c.addEventListener("click",e.back);let p=E(i,"p","ec-kicker"),l=E(i,"h2","ec-h"),f=E(i,"div","ec-doc"),g=E(i,"div","ec-vote");g.setAttribute("aria-live","polite"),o.append(c,p,l,f,g);let b=(h,M)=>{let C=s.get(h);if(C===void 0){let B=ae(i,"ec-btn",t.voteYes),F=ae(i,"ec-btn",t.voteNo),_=$=>()=>{s.set(h,$),b(h,!0)};B.addEventListener("click",_(!0)),F.addEventListener("click",_(!1));let R=E(i,"div","ec-actions");R.append(B,F),g.replaceChildren(E(i,"p","",t.voteQuestion),R);return}let U=!C&&e.hasSupport(),I=E(i,"p","",C?t.voteThanks:U?t.voteSorryAssist:t.voteSorry);I.tabIndex=-1,g.replaceChildren(I);let j=I;U&&(j=g.appendChild(ae(i,"ec-btn",t.askTitle)),j.setAttribute("data-primary",""),j.addEventListener("click",e.openSupport)),M&&j.focus()},m=h=>{g.replaceChildren(),f.replaceChildren(je(i,t.articleLoading)),e.source.article(h).then(M=>{if(r!==h)return;if(M.status!=="ready"){f.replaceChildren(Ee(i,t.articleError,{label:t.retry,run:()=>m(h)}));return}let{data:C}=M;C.collection.title&&(p.textContent=C.collection.title),p.hidden=!p.textContent,l.textContent=C.title,Fi(i,f,C.markdown);let U=Xe(C.url);if(U){let I=f.appendChild(E(i,"p")).appendChild(E(i,"a","",t.openFullPage));I.href=U,I.target="_blank",I.rel="noopener noreferrer",I.appendChild(E(i,"span","ec-sr",` ${t.newTab}`))}b(h,!1)})};return{show(h,M){r=h.id,p.textContent=M,p.hidden=!M,l.textContent=h.title,o.scrollTop=0,m(h.id),c.focus()}}}var tr=300,nr=2;function fn(e,i,t,o,s,r,c){let p=qt(e,o.title,s,c);return p.setAttribute("data-guide",o.id),t.peek()?.render==="link"&&o.url&&p.appendChild(E(e,"span","ec-sr",i.newTab)),p.addEventListener("click",r),p}var Ui=e=>e.normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase();function Wi(e){let{doc:i,TEXT:t,root:o}=e,s=E(i,"label","ec-search");s.appendChild(Re(i,"search",16));let r=s.appendChild(E(i,"input"));r.type="search",r.placeholder=t.searchGuides,r.setAttribute("aria-label",t.searchGuides),r.maxLength=Ze.query,r.autocomplete="off";let c=E(i,"div","ec-stack");o.append(E(i,"h2","ec-h",t.tabGuides),s,c);let p=null,l="",f=null,g,b=null,m=(I,j,B,F)=>fn(i,t,e.source,I,B,()=>e.openGuide(I,j),F),h=()=>{if(!p)return;if(p.status!=="ready"){p.status==="error"&&c.replaceChildren(Ee(i,t.guidesError,{label:t.retry,run:M}));return}let{collections:I}=p.data;if(!l){c.replaceChildren(...I.length?I.map(R=>{let $=E(i,"section","ec-box"),K=$.appendChild(E(i,"div","ec-box-head")),de=R.articles.length;K.append(E(i,"h3","ec-box-title",R.title),E(i,"span","ec-muted",de===1?t.guidesCountOne:t.guidesCount.replace("{n}",String(de))));let ne=$.appendChild(E(i,"div","ec-list"));for(let V of R.articles)ne.appendChild(m(V,R.title,V.description));return $}):[Ee(i,t.guidesEmpty)]);return}let j=Ui(l).split(/\s+/).filter(Boolean),B=new Map((f??[]).map(R=>[R.id,R])),F=I.flatMap(R=>R.articles.filter($=>{let K=Ui(`${$.title} ${$.description??""}`);return j.every(de=>K.includes(de))}).map($=>{let K=B.get($.id);return B.delete($.id),m($,R.title,K?K.snippet||K.description:$.description,R.title)}));for(let R of B.values())F.push(m(R,R.collection.title,R.snippet||R.description,R.collection.title));if(F.length){let R=E(i,"div","ec-list");R.append(...F),c.replaceChildren(R);return}let _=Ee(i,t.guidesNoMatch);e.hasSupport()&&_.appendChild(ae(i,"ec-btn",t.askInstead)).addEventListener("click",e.openSupport),c.replaceChildren(_)};function M(){if(p?.status==="ready")return h();c.replaceChildren(je(i,t.guidesLoading)),e.source.list().then(I=>{p=I,I.status==="hidden"?e.onHidden():h()})}let C=async I=>{b?.abort();let j=b=new AbortController,B=await e.source.search(I,j.signal);j.signal.aborted||I!==l||!B||(f=B,h())},U=()=>{if(l=r.value.trim().slice(0,Ze.query),f=null,b?.abort(),clearTimeout(g),h(),l.length>=nr){let I=l;g=setTimeout(()=>{C(I)},tr)}};return r.addEventListener("input",U),{show(I){M(),I&&r.focus()},focusGuide(I){let j=Array.from(c.querySelectorAll("[data-guide]")).find(B=>B.getAttribute("data-guide")===I);return j?.focus(),!!j},destroy(){clearTimeout(g),b?.abort()}}}var Qi=["all","open","resolved"];function ir(e,i,t){let[o,s]=t.status==="you"?[i.statusYou,"accent"]:t.status==="resolved"?[i.statusResolved,"good"]:[i.statusTeam,"warn"],r=E(e,"span","ec-pill",o);return r.setAttribute("data-tone",s),r}function gn(e,i,t,o){let s=E(e,o,"ec-ticket");o==="button"&&(s.type="button");let r=s.appendChild(E(e,"span","ec-tmeta"));r.append(E(e,"span","ec-mono",t.key),ir(e,i,t));let c=Date.parse(t.updated_at);return c&&r.append(E(e,"span","ec-muted",hn(i,c))),s.append(E(e,"span","ec-row-title",t.title)),t.last_message&&s.append(E(e,"span","ec-row-sub",t.last_message.excerpt)),t.has_recording&&s.appendChild(E(e,"span","ec-tfoot")).append(Re(e,"video",14),E(e,"span","",i.recordingAttached)),s}function Ki(e){let{doc:i,TEXT:t,root:o}=e,s=E(i,"div","ec-box-head"),r=ae(i,"ec-btn",t.reportProblem);r.addEventListener("click",e.report),s.append(E(i,"h2","ec-h",t.tabTickets),r);let c=E(i,"div","ec-filters");c.setAttribute("role","group"),c.setAttribute("aria-label",t.ticketsFilter);let p=E(i,"div","ec-stack");o.append(s,c,p);let l="all",f=0,g={all:t.filterAll,open:t.filterOpen,resolved:t.filterResolved},b=Qi.map(M=>{let C=c.appendChild(ae(i,"ec-filter",g[M]));return C.addEventListener("click",()=>{l=M,h()}),C}),m=M=>{if(M.status==="hidden"||M.status==="denied")return e.onGone(M.status);if(M.status==="error"){p.replaceChildren(Ee(i,t.ticketsError,{label:t.retry,run:h}));return}let{tickets:C}=M.data;p.replaceChildren(...C.length?C.map(U=>gn(i,t,U,"article")):[Ee(i,t.ticketsEmpty)])};function h(){Qi.forEach((C,U)=>b[U].setAttribute("aria-pressed",String(C===l)));let M=++f;p.replaceChildren(je(i,t.ticketsLoading)),e.source.list(l).then(C=>{M===f&&m(C)})}return{show(M){r.hidden=!e.canReport(),h(),M&&(r.hidden?b[0]:r).focus()},reset(){f++,p.replaceChildren()}}}function hn(e,i){let t=Math.floor((Date.now()-i)/6e4);if(t<1)return e.agoNow;if(t<60)return e.agoMinutes.replace("{n}",String(t));let o=Math.floor(t/60);return o<24?e.agoHours.replace("{n}",String(o)):e.agoDays.replace("{n}",String(Math.floor(o/24)))}function Yi(e){let{doc:i,TEXT:t}=e,o=E(i,"h2","ec-hello");o.append(E(i,"span","",e.name?t.helloNamed.replace("{name}",()=>e.name):t.hello),E(i,"span","",t.helpPrompt));let s=[o];if(e.support){let r=E(i,"section","ec-box"),c=ae(i,"ec-fake");if(c.append(E(i,"span","",t.placeholder),Re(i,"up",14,"ec-fake-go")),c.setAttribute("aria-label",t.askTitle),c.addEventListener("click",e.openSupport),r.append(E(i,"h3","ec-box-title",t.askTitle),E(i,"p","ec-box-sub",t.askHint),c),s.push(r),e.last){let p=E(i,"section","ec-box"),l=qt(i,e.last.text,hn(t,e.last.at));l.addEventListener("click",e.openSupport),p.append(E(i,"h3","ec-box-title",t.continueTitle),l),s.push(p)}}if(e.tickets){let r=E(i,"div","ec-stack");s.push(r),e.tickets.list("all").then(c=>{if(!r.isConnected)return;if(c.status==="hidden"||c.status==="denied")return e.onTicketsGone(c.status);let p=c.status==="ready"&&c.data.tickets.find(f=>f.status!=="resolved");if(!p)return r.remove();let l=gn(i,t,p,"button");l.addEventListener("click",e.openTickets),r.className="ec-box",r.append(E(i,"h3","ec-box-title",t.openTicket),l)})}if(e.guides){let r=E(i,"section","ec-box"),c=ae(i,"ec-fake");c.append(Re(i,"search",16),E(i,"span","",t.searchGuides)),c.addEventListener("click",e.searchGuides);let p=E(i,"div","ec-stack");r.append(c,p),s.push(r);let l=()=>{p.replaceChildren(je(i,t.guidesLoading)),e.source.list().then(f=>{if(!p.isConnected)return;if(f.status==="hidden")return e.onHidden();if(f.status==="error"){p.replaceChildren(Ee(i,t.guidesError,{label:t.retry,run:l}));return}let g=f.data.popular.flatMap(m=>{for(let h of f.data.collections){let M=h.articles.find(C=>C.id===m);if(M)return[fn(i,t,e.source,M,M.description,()=>e.openGuide(M,h.title))]}return[]});if(p.replaceChildren(),!g.length)return;let b=E(i,"div","ec-list");b.append(...g),p.append(E(i,"h3","ec-box-title",t.popularGuides),b)})};e.root.replaceChildren(...s),l()}else e.root.replaceChildren(...s)}var or=/^\s*(`{3,})/,rr=/^\s*(`{3,})\s*$/,ar=/^\s*[-*+]\s+(.*)$/,sr=/^\s*(\d{1,9})[.)]\s+(.*)$/,cr=/^\s*#{1,6}\s+(.*)$/;function lr(e){let i=[],t=e.replace(/\r\n?/g,`
|
|
13
13
|
`).split(`
|
|
14
|
-
`),o;for(let
|
|
15
|
-
`),o.appendChild(r)}else if(a.kind==="h"){let r=e.createElement("p");nt(e,r.appendChild(e.createElement("strong")),a.text),o.appendChild(r)}else if(a.kind==="p"){let r=e.createElement("p");a.lines.forEach((s,d)=>{d&&r.appendChild(e.createElement("br")),nt(e,r,s)}),o.appendChild(r)}else{let r=e.createElement(a.kind);a.kind==="ol"&&a.start!==1&&r.setAttribute("start",String(a.start));for(let s of a.items)nt(e,r.appendChild(e.createElement("li")),s);o.appendChild(r)}i.replaceChildren(o)}var Ei={open:"Open support chat",title:"Support",close:"Close chat",newChat:"New conversation",greeting:"Hi! How can I help you?",inputLabel:"Your message",placeholder:"Type your question\u2026",send:"Send",thinking:"Thinking\u2026",confirmTitle:"The assistant wants to:",allow:"Allow once",allowAlways:"Always allow",decline:"Decline",allowed:"Allowed",declined:"Declined",confirmHighlight:"Highlight {target}",confirmScroll:"Scroll to {target}",confirmClick:"Click {target}",confirmClickLink:"Click {target}, which goes to {destination}",confirmFill:"Type into {target}:",confirmNavigate:"Go to {destination}",emptyValue:"(empty)",didHighlight:"Highlighted {target}",didScroll:"Scrolled to {target}",didClick:"Clicked {target}",didFill:"Filled in {target}",didNavigate:"Went to {destination}",actionFailed:"Could not complete the action on {target}",errorNoAgent:"Support chat is not available on this site.",errorDailyCap:"The assistant reached its message limit for today. Please try again tomorrow.",errorRateLimited:"Too many messages. Wait a moment and try again.",errorConversationLimit:"This conversation got too long.",errorBusy:"Another answer is still in progress. Wait a moment and try again.",startOver:"Start over",errorNetwork:"Could not reach the assistant. Check your connection and try again.",errorGeneric:"Something went wrong. Please try again.",stop:"Stop",presenceNotice:"The assistant is using this page",presenceNoticeNamed:"{name} is using this page",online:"Online",options:"What the assistant can do",optionsTitle:"What the assistant can do on this page",optionsHint:'Turning an action off lasts for this conversation. "Ask me first" is saved in this browser for this site.',optionsEmpty:"Here the assistant only answers questions.",optionsUnavailable:"We could not load these options right now. Try again later.",anElement:"an element on the page",askFirst:"Ask me first",suggestions:"Suggestions",running:"In progress",done:"Done",failed:"Failed",actionsCount:"{n} actions",detailTarget:"Element",detailDestination:"Goes to",detailValue:"Text",nameHighlight:"Point things out",descHighlight:"Outlines a button or field on the page.",nameScroll:"Scroll the page",descScroll:"Brings a part of the page into view.",nameClick:"Click",descClick:"Presses buttons, links and tabs.",nameFill:"Fill in fields",descFill:"Types into form fields. Never passwords.",nameNavigate:"Open pages",descNavigate:"Goes to another page of this site.",whyNotAllowed:"This action is turned off.",whyPrivate:"That part of the page is private.",whyDisabled:"It is disabled right now.",whyGone:"It is no longer on the page.",whyOtherSite:"It leads to another site.",whyDeclined:"You declined it.",whyNotFillable:"It does not accept text.",whyInvalidValue:"That option is not in the list.",whyGeneric:"The page did not respond as expected.",queueTitle:"{n} queued",queuePaused:"Paused",queueResume:"Resume",queueClear:"Clear",queueSendNow:"Send now",queueEdit:"Edit",queueRemove:"Remove",queueFull:"The queue is full. Wait for the assistant to finish.",tabs:"Sections",tabHome:"Home",tabSupport:"Support",tabGuides:"Guides",hello:"Hi.",helpPrompt:"How can we help?",askTitle:"Ask the assistant",askHint:"Answers in seconds \xB7 can point at things on this page",continueTitle:"Continue",agoNow:"just now",agoMinutes:"{n} min ago",agoHours:"{n} h ago",agoDays:"{n} d ago",searchGuides:"Search guides",popularGuides:"Popular guides",guidesCount:"{n} articles",guidesCountOne:"1 article",guidesLoading:"Loading guides\u2026",guidesError:"We could not load the guides.",guidesEmpty:"There are no guides yet.",guidesNoMatch:"No guide matches that yet.",askInstead:"Ask the assistant instead",retry:"Try again",backToGuides:"Back to guides",newTab:"(opens in a new tab)",openFullPage:"Open the full page",articleLoading:"Loading\u2026",articleError:"We could not load this guide.",voteQuestion:"Did this answer your question?",voteYes:"Yes",voteNo:"Not really",voteThanks:"Thanks for letting us know.",voteSorry:"Sorry about that.",voteSorryAssist:"Sorry about that. The assistant can take it from here.",tabTickets:"Tickets",reportProblem:"Report a problem",ticketsFilter:"Show tickets",filterAll:"All",filterOpen:"Open",filterResolved:"Resolved",statusTeam:"With our team",statusYou:"Waiting on you",statusResolved:"Resolved",recordingAttached:"Recording attached",ticketsLoading:"Loading tickets\u2026",ticketsError:"We could not load your tickets.",ticketsEmpty:"Nothing matches that filter.",openTicket:"Your open ticket",ticketsWaiting:"{n} waiting on you"},Mo={open:"Abrir el chat de soporte",title:"Soporte",close:"Cerrar el chat",newChat:"Nueva conversaci\xF3n",greeting:"\xA1Hola! \xBFEn qu\xE9 te puedo ayudar?",inputLabel:"Tu mensaje",placeholder:"Escribe tu pregunta\u2026",send:"Enviar",thinking:"Pensando\u2026",confirmTitle:"El asistente quiere:",allow:"Permitir una vez",allowAlways:"Permitir siempre",decline:"Rechazar",allowed:"Permitido",declined:"Rechazado",confirmHighlight:"Se\xF1alar {target}",confirmScroll:"Llevar la vista a {target}",confirmClick:"Hacer clic en {target}",confirmClickLink:"Hacer clic en {target}, que lleva a {destination}",confirmFill:"Escribir en {target}:",confirmNavigate:"Ir a {destination}",emptyValue:"(vac\xEDo)",didHighlight:"Se\xF1al\xF3 {target}",didScroll:"Llev\xF3 la vista a {target}",didClick:"Hizo clic en {target}",didFill:"Complet\xF3 {target}",didNavigate:"Fue a {destination}",actionFailed:"No se pudo completar la acci\xF3n en {target}",errorNoAgent:"El chat de soporte no est\xE1 disponible en este sitio.",errorDailyCap:"El asistente lleg\xF3 a su l\xEDmite de mensajes de hoy. Vuelve a intentarlo ma\xF1ana.",errorRateLimited:"Demasiados mensajes. Espera un momento y vuelve a intentarlo.",errorConversationLimit:"Esta conversaci\xF3n se hizo demasiado larga.",errorBusy:"Otra respuesta est\xE1 en curso. Espera un momento y vuelve a intentarlo.",startOver:"Empezar de nuevo",errorNetwork:"No se pudo contactar al asistente. Revisa tu conexi\xF3n y vuelve a intentarlo.",errorGeneric:"Algo sali\xF3 mal. Vuelve a intentarlo.",stop:"Detener",presenceNotice:"El asistente est\xE1 usando esta p\xE1gina",presenceNoticeNamed:"{name} est\xE1 usando esta p\xE1gina",online:"En l\xEDnea",options:"Lo que puede hacer el asistente",optionsTitle:"Lo que el asistente puede hacer en esta p\xE1gina",optionsHint:"Apagar una acci\xF3n vale para esta conversaci\xF3n. \xABPreguntarme antes\xBB se guarda en este navegador para este sitio.",optionsEmpty:"Aqu\xED el asistente s\xF3lo responde preguntas.",optionsUnavailable:"No pudimos cargar las opciones ahora. Vuelve a intentarlo m\xE1s tarde.",anElement:"un elemento de la p\xE1gina",askFirst:"Preguntarme antes",suggestions:"Sugerencias",running:"En curso",done:"Hecho",failed:"Error",actionsCount:"{n} acciones",detailTarget:"Elemento",detailDestination:"Lleva a",detailValue:"Texto",nameHighlight:"Se\xF1alar",descHighlight:"Marca un bot\xF3n o un campo de la p\xE1gina.",nameScroll:"Mover la vista",descScroll:"Lleva la vista a una parte de la p\xE1gina.",nameClick:"Hacer clic",descClick:"Presiona botones, enlaces y pesta\xF1as.",nameFill:"Completar campos",descFill:"Escribe en campos de formularios. Nunca contrase\xF1as.",nameNavigate:"Abrir p\xE1ginas",descNavigate:"Va a otra p\xE1gina de este sitio.",whyNotAllowed:"Esta acci\xF3n est\xE1 desactivada.",whyPrivate:"Esa parte de la p\xE1gina es privada.",whyDisabled:"Est\xE1 deshabilitado en este momento.",whyGone:"Ya no est\xE1 en la p\xE1gina.",whyOtherSite:"Lleva a otro sitio.",whyDeclined:"La rechazaste.",whyNotFillable:"No acepta texto.",whyInvalidValue:"Esa opci\xF3n no est\xE1 en la lista.",whyGeneric:"La p\xE1gina no respondi\xF3 como se esperaba.",queueTitle:"{n} en cola",queuePaused:"En pausa",queueResume:"Reanudar",queueClear:"Vaciar",queueSendNow:"Enviar ahora",queueEdit:"Editar",queueRemove:"Quitar",queueFull:"La cola est\xE1 llena. Espera a que el asistente termine.",tabs:"Secciones",tabHome:"Inicio",tabSupport:"Soporte",tabGuides:"Gu\xEDas",hello:"Hola.",helpPrompt:"\xBFEn qu\xE9 te podemos ayudar?",askTitle:"Preg\xFAntale al asistente",askHint:"Responde en segundos \xB7 puede se\xF1alar cosas en esta p\xE1gina",continueTitle:"Continuar",agoNow:"reci\xE9n",agoMinutes:"hace {n} min",agoHours:"hace {n} h",agoDays:"hace {n} d",searchGuides:"Buscar en las gu\xEDas",popularGuides:"Gu\xEDas populares",guidesCount:"{n} art\xEDculos",guidesCountOne:"1 art\xEDculo",guidesLoading:"Cargando las gu\xEDas\u2026",guidesError:"No pudimos cargar las gu\xEDas.",guidesEmpty:"Todav\xEDa no hay gu\xEDas.",guidesNoMatch:"Todav\xEDa ninguna gu\xEDa coincide con eso.",askInstead:"Mejor preg\xFAntale al asistente",retry:"Reintentar",backToGuides:"Volver a las gu\xEDas",newTab:"(se abre en una pesta\xF1a nueva)",openFullPage:"Abrir la p\xE1gina completa",articleLoading:"Cargando\u2026",articleError:"No pudimos cargar esta gu\xEDa.",voteQuestion:"\xBFEsto respondi\xF3 tu pregunta?",voteYes:"S\xED",voteNo:"No del todo",voteThanks:"Gracias por contarnos.",voteSorry:"Lo sentimos.",voteSorryAssist:"Lo sentimos. El asistente puede seguir desde aqu\xED.",tabTickets:"Tickets",reportProblem:"Reportar un problema",ticketsFilter:"Mostrar tickets",filterAll:"Todos",filterOpen:"Abiertos",filterResolved:"Resueltos",statusTeam:"Con nuestro equipo",statusYou:"Esperando tu respuesta",statusResolved:"Resuelto",recordingAttached:"Grabaci\xF3n adjunta",ticketsLoading:"Cargando tickets\u2026",ticketsError:"No pudimos cargar tus tickets.",ticketsEmpty:"Nada coincide con ese filtro.",openTicket:"Tu ticket abierto",ticketsWaiting:"{n} esperan tu respuesta"},Ho={open:"Abrir o chat de suporte",title:"Suporte",close:"Fechar o chat",newChat:"Nova conversa",greeting:"Ol\xE1! Como posso ajudar?",inputLabel:"Sua mensagem",placeholder:"Digite sua pergunta\u2026",send:"Enviar",thinking:"Pensando\u2026",confirmTitle:"O assistente quer:",allow:"Permitir uma vez",allowAlways:"Permitir sempre",decline:"Recusar",allowed:"Permitido",declined:"Recusado",confirmHighlight:"Destacar {target}",confirmScroll:"Rolar at\xE9 {target}",confirmClick:"Clicar em {target}",confirmClickLink:"Clicar em {target}, que leva para {destination}",confirmFill:"Digitar em {target}:",confirmNavigate:"Ir para {destination}",emptyValue:"(vazio)",didHighlight:"Destacou {target}",didScroll:"Rolou at\xE9 {target}",didClick:"Clicou em {target}",didFill:"Preencheu {target}",didNavigate:"Foi para {destination}",actionFailed:"N\xE3o foi poss\xEDvel concluir a a\xE7\xE3o em {target}",errorNoAgent:"O chat de suporte n\xE3o est\xE1 dispon\xEDvel neste site.",errorDailyCap:"O assistente atingiu o limite de mensagens de hoje. Tente novamente amanh\xE3.",errorRateLimited:"Mensagens demais. Aguarde um momento e tente novamente.",errorConversationLimit:"Esta conversa ficou longa demais.",errorBusy:"Outra resposta est\xE1 em andamento. Aguarde um momento e tente novamente.",startOver:"Come\xE7ar de novo",errorNetwork:"N\xE3o foi poss\xEDvel falar com o assistente. Verifique sua conex\xE3o e tente novamente.",errorGeneric:"Algo deu errado. Tente novamente.",stop:"Parar",presenceNotice:"O assistente est\xE1 usando esta p\xE1gina",presenceNoticeNamed:"{name} est\xE1 usando esta p\xE1gina",online:"Online",options:"O que o assistente pode fazer",optionsTitle:"O que o assistente pode fazer nesta p\xE1gina",optionsHint:"Desligar uma a\xE7\xE3o vale para esta conversa. \xABPerguntar antes\xBB fica salvo neste navegador para este site.",optionsEmpty:"Aqui o assistente s\xF3 responde perguntas.",optionsUnavailable:"N\xE3o conseguimos carregar as op\xE7\xF5es agora. Tente novamente mais tarde.",anElement:"um elemento da p\xE1gina",askFirst:"Perguntar antes",suggestions:"Sugest\xF5es",running:"Em andamento",done:"Feito",failed:"Erro",actionsCount:"{n} a\xE7\xF5es",detailTarget:"Elemento",detailDestination:"Leva para",detailValue:"Texto",nameHighlight:"Destacar",descHighlight:"Marca um bot\xE3o ou campo da p\xE1gina.",nameScroll:"Rolar a p\xE1gina",descScroll:"Leva a vista at\xE9 uma parte da p\xE1gina.",nameClick:"Clicar",descClick:"Aperta bot\xF5es, links e abas.",nameFill:"Preencher campos",descFill:"Digita em campos de formul\xE1rios. Nunca senhas.",nameNavigate:"Abrir p\xE1ginas",descNavigate:"Vai para outra p\xE1gina deste site.",whyNotAllowed:"Esta a\xE7\xE3o est\xE1 desativada.",whyPrivate:"Essa parte da p\xE1gina \xE9 privada.",whyDisabled:"Est\xE1 desabilitado no momento.",whyGone:"N\xE3o est\xE1 mais na p\xE1gina.",whyOtherSite:"Leva para outro site.",whyDeclined:"Voc\xEA recusou.",whyNotFillable:"N\xE3o aceita texto.",whyInvalidValue:"Essa op\xE7\xE3o n\xE3o est\xE1 na lista.",whyGeneric:"A p\xE1gina n\xE3o respondeu como esperado.",queueTitle:"{n} na fila",queuePaused:"Em pausa",queueResume:"Retomar",queueClear:"Limpar",queueSendNow:"Enviar agora",queueEdit:"Editar",queueRemove:"Remover",queueFull:"A fila est\xE1 cheia. Aguarde o assistente terminar.",tabs:"Se\xE7\xF5es",tabHome:"In\xEDcio",tabSupport:"Suporte",tabGuides:"Guias",hello:"Ol\xE1.",helpPrompt:"Como podemos ajudar?",askTitle:"Pergunte ao assistente",askHint:"Responde em segundos \xB7 pode apontar coisas nesta p\xE1gina",continueTitle:"Continuar",agoNow:"agora mesmo",agoMinutes:"h\xE1 {n} min",agoHours:"h\xE1 {n} h",agoDays:"h\xE1 {n} d",searchGuides:"Buscar nos guias",popularGuides:"Guias populares",guidesCount:"{n} artigos",guidesCountOne:"1 artigo",guidesLoading:"Carregando os guias\u2026",guidesError:"N\xE3o conseguimos carregar os guias.",guidesEmpty:"Ainda n\xE3o h\xE1 guias.",guidesNoMatch:"Nenhum guia corresponde a isso ainda.",askInstead:"Pergunte ao assistente",retry:"Tentar novamente",backToGuides:"Voltar aos guias",newTab:"(abre em uma nova aba)",openFullPage:"Abrir a p\xE1gina completa",articleLoading:"Carregando\u2026",articleError:"N\xE3o conseguimos carregar este guia.",voteQuestion:"Isso respondeu \xE0 sua pergunta?",voteYes:"Sim",voteNo:"N\xE3o muito",voteThanks:"Obrigado por nos contar.",voteSorry:"Sentimos muito.",voteSorryAssist:"Sentimos muito. O assistente pode continuar daqui.",tabTickets:"Tickets",reportProblem:"Relatar um problema",ticketsFilter:"Mostrar tickets",filterAll:"Todos",filterOpen:"Abertos",filterResolved:"Resolvidos",statusTeam:"Com nossa equipe",statusYou:"Aguardando voc\xEA",statusResolved:"Resolvido",recordingAttached:"Grava\xE7\xE3o anexada",ticketsLoading:"Carregando tickets\u2026",ticketsError:"N\xE3o conseguimos carregar seus tickets.",ticketsEmpty:"Nada corresponde a esse filtro.",openTicket:"Seu ticket aberto",ticketsWaiting:"{n} aguardando voc\xEA"};function gt(e){let i=(e??"").toLowerCase().slice(0,2);return i==="es"?Mo:i==="pt"?Ho:Ei}function Ht(e,i,t){let o=t.target?`\xAB${t.target}\xBB`:e.anElement,a=t.destination??"?",r;return i==="failed"?r=t.type==="navigate"?e.actionFailed.replace("{target}","{destination}"):e.actionFailed:i==="confirm"?r=t.type==="click"?t.destination?e.confirmClickLink:e.confirmClick:t.type==="fill"?e.confirmFill:t.type==="navigate"?e.confirmNavigate:t.type==="scroll_to"?e.confirmScroll:e.confirmHighlight:r=t.type==="click"?e.didClick:t.type==="fill"?e.didFill:t.type==="navigate"?e.didNavigate:t.type==="scroll_to"?e.didScroll:e.didHighlight,r.replace(/\{(target|destination)\}/g,(s,d)=>d==="target"?o:a)}function an(e,i){switch(i){case"not_allowed":case"unknown_action":return e.whyNotAllowed;case"forbidden":case"blocked":return e.whyPrivate;case"disabled":return e.whyDisabled;case"stale_ref":return e.whyGone;case"cross_origin":return e.whyOtherSite;case"declined":case"confirmation_required":return e.whyDeclined;case"not_fillable":case"readonly":return e.whyNotFillable;case"invalid_value":return e.whyInvalidValue;default:return e.whyGeneric}}function mt(e,i){return i===""?e.emptyValue:i.replace(/\r\n?|\n/g,`\u23CE
|
|
16
|
-
`)}var
|
|
14
|
+
`),o;for(let s=0;s<t.length;s++){let r=t[s],c=or.exec(r);if(c){let g=[],b=m=>(rr.exec(m)?.[1]?.length??0)>=c[1].length;for(;++s<t.length&&!b(t[s]);)g.push(t[s]);i.push({kind:"code",lines:g}),o=void 0;continue}if(!r.trim()){o=void 0;continue}let p=ar.exec(r),l=p?null:sr.exec(r);if(p||l){let g=p?"ul":"ol",b=p?p[1]:l[2];o&&o.kind===g?o.items.push(b):i.push(o={kind:g,items:[b],start:l?Number(l[1]):1});continue}let f=cr.exec(r);if(f){i.push({kind:"h",text:f[1]}),o=void 0;continue}o&&(o.kind==="ul"||o.kind==="ol")?o.items[o.items.length-1]+=` ${r.trim()}`:o&&o.kind==="p"?o.lines.push(r):i.push(o={kind:"p",lines:[r]})}return i}var dr=/`([^`\n]+)`|\*\*(?=\S)([\s\S]*?\S)\*\*|\*(?=[^\s*])([^*\n]*?[^\s*])\*|\[([^\]\n]+)\]\(([^()\s]+)\)/;function ct(e,i,t){let o=t;for(;;){let s=dr.exec(o);if(!s)break;if(s.index>0&&i.appendChild(e.createTextNode(o.slice(0,s.index))),s[1]!==void 0){let r=e.createElement("code");r.textContent=s[1],i.appendChild(r)}else if(s[2]!==void 0)ct(e,i.appendChild(e.createElement("strong")),s[2]);else if(s[3]!==void 0)ct(e,i.appendChild(e.createElement("em")),s[3]);else{let r=s[4],c=s[5];ct(e,i,r),c!==r&&i.appendChild(e.createTextNode(` (${c})`))}o=o.slice(s.index+s[0].length)}o&&i.appendChild(e.createTextNode(o))}function mn(e,i,t){let o=e.createDocumentFragment();for(let s of lr(t))if(s.kind==="code"){let r=e.createElement("pre");r.appendChild(e.createElement("code")).textContent=s.lines.join(`
|
|
15
|
+
`),o.appendChild(r)}else if(s.kind==="h"){let r=e.createElement("p");ct(e,r.appendChild(e.createElement("strong")),s.text),o.appendChild(r)}else if(s.kind==="p"){let r=e.createElement("p");s.lines.forEach((c,p)=>{p&&r.appendChild(e.createElement("br")),ct(e,r,c)}),o.appendChild(r)}else{let r=e.createElement(s.kind);s.kind==="ol"&&s.start!==1&&r.setAttribute("start",String(s.start));for(let c of s.items)ct(e,r.appendChild(e.createElement("li")),c);o.appendChild(r)}i.replaceChildren(o)}var Ji={open:"Open support chat",title:"Support",close:"Close chat",newChat:"New conversation",greeting:"Hi! How can I help you?",inputLabel:"Your message",placeholder:"Type your question\u2026",send:"Send",thinking:"Thinking\u2026",confirmTitle:"The assistant wants to:",allow:"Allow once",allowAlways:"Always allow",decline:"Decline",allowed:"Allowed",declined:"Declined",confirmHighlight:"Highlight {target}",confirmScroll:"Scroll to {target}",confirmClick:"Click {target}",confirmClickLink:"Click {target}, which goes to {destination}",confirmFill:"Type into {target}:",confirmNavigate:"Go to {destination}",emptyValue:"(empty)",didHighlight:"Highlighted {target}",didScroll:"Scrolled to {target}",didClick:"Clicked {target}",didFill:"Filled in {target}",didNavigate:"Went to {destination}",actionFailed:"Could not complete the action on {target}",errorNoAgent:"Support chat is not available on this site.",errorDailyCap:"The assistant reached its message limit for today. Please try again tomorrow.",errorRateLimited:"Too many messages. Wait a moment and try again.",errorConversationLimit:"This conversation got too long.",errorBusy:"Another answer is still in progress. Wait a moment and try again.",startOver:"Start over",errorNetwork:"Could not reach the assistant. Check your connection and try again.",errorGeneric:"Something went wrong. Please try again.",stop:"Stop",presenceNotice:"The assistant is using this page",presenceNoticeNamed:"{name} is using this page",online:"Online",options:"What the assistant can do",optionsTitle:"What the assistant can do on this page",optionsHint:'Turning an action off lasts for this conversation. "Ask me first" is saved in this browser for this site.',optionsEmpty:"Here the assistant only answers questions.",optionsUnavailable:"We could not load these options right now. Try again later.",anElement:"an element on the page",askFirst:"Ask me first",suggestions:"Suggestions",running:"In progress",done:"Done",failed:"Failed",actionsCount:"{n} actions",detailTarget:"Element",detailDestination:"Goes to",detailValue:"Text",nameHighlight:"Point things out",descHighlight:"Outlines a button or field on the page.",nameScroll:"Scroll the page",descScroll:"Brings a part of the page into view.",nameClick:"Click",descClick:"Presses buttons, links and tabs.",nameFill:"Fill in fields",descFill:"Types into form fields. Never passwords.",nameNavigate:"Open pages",descNavigate:"Goes to another page of this site.",whyNotAllowed:"This action is turned off.",whyPrivate:"That part of the page is private.",whyDisabled:"It is disabled right now.",whyGone:"It is no longer on the page.",whyOtherSite:"It leads to another site.",whyDeclined:"You declined it.",whyNotFillable:"It does not accept text.",whyInvalidValue:"That option is not in the list.",whyGeneric:"The page did not respond as expected.",queueTitle:"{n} queued",queuePaused:"Paused",queueResume:"Resume",queueClear:"Clear",queueSendNow:"Send now",queueEdit:"Edit",queueRemove:"Remove",queueFull:"The queue is full. Wait for the assistant to finish.",tabs:"Sections",tabHome:"Home",tabSupport:"Support",tabGuides:"Guides",hello:"Hi.",helpPrompt:"How can we help?",askTitle:"Ask the assistant",askHint:"Answers in seconds \xB7 can point at things on this page",continueTitle:"Continue",agoNow:"just now",agoMinutes:"{n} min ago",agoHours:"{n} h ago",agoDays:"{n} d ago",searchGuides:"Search guides",popularGuides:"Popular guides",guidesCount:"{n} articles",guidesCountOne:"1 article",guidesLoading:"Loading guides\u2026",guidesError:"We could not load the guides.",guidesEmpty:"There are no guides yet.",guidesNoMatch:"No guide matches that yet.",askInstead:"Ask the assistant instead",retry:"Try again",backToGuides:"Back to guides",newTab:"(opens in a new tab)",openFullPage:"Open the full page",articleLoading:"Loading\u2026",articleError:"We could not load this guide.",voteQuestion:"Did this answer your question?",voteYes:"Yes",voteNo:"Not really",voteThanks:"Thanks for letting us know.",voteSorry:"Sorry about that.",voteSorryAssist:"Sorry about that. The assistant can take it from here.",tabTickets:"Tickets",reportProblem:"Report a problem",ticketsFilter:"Show tickets",filterAll:"All",filterOpen:"Open",filterResolved:"Resolved",statusTeam:"With our team",statusYou:"Waiting on you",statusResolved:"Resolved",recordingAttached:"Recording attached",ticketsLoading:"Loading tickets\u2026",ticketsError:"We could not load your tickets.",ticketsEmpty:"Nothing matches that filter.",openTicket:"Your open ticket",ticketsWaiting:"{n} waiting on you",minimize:"Minimize",expand:"Expand",collapse:"Collapse",dock:"Pin to the side",undock:"Float the panel",more:"More",copy:"Copy",copied:"Copied",copyCode:"Copy code",regenerate:"Regenerate response",regenerateShort:"Regenerate",goodResponse:"Good response",badResponse:"Bad response",notSent:"Not sent",resend:"Retry",stopped:"Stopped",jumpLatest:"Jump to latest",hintSend:"Enter to send",hintQueue:"Enter adds it to the queue",hintNewline:"Shift+Enter for a new line",helloNamed:"Hi {name}.",errorUnavailable:"The assistant is unavailable right now. Try again in a few minutes."},pr={open:"Abrir el chat de soporte",title:"Soporte",close:"Cerrar el chat",newChat:"Nueva conversaci\xF3n",greeting:"\xA1Hola! \xBFEn qu\xE9 te puedo ayudar?",inputLabel:"Tu mensaje",placeholder:"Escribe tu pregunta\u2026",send:"Enviar",thinking:"Pensando\u2026",confirmTitle:"El asistente quiere:",allow:"Permitir una vez",allowAlways:"Permitir siempre",decline:"Rechazar",allowed:"Permitido",declined:"Rechazado",confirmHighlight:"Se\xF1alar {target}",confirmScroll:"Llevar la vista a {target}",confirmClick:"Hacer clic en {target}",confirmClickLink:"Hacer clic en {target}, que lleva a {destination}",confirmFill:"Escribir en {target}:",confirmNavigate:"Ir a {destination}",emptyValue:"(vac\xEDo)",didHighlight:"Se\xF1al\xF3 {target}",didScroll:"Llev\xF3 la vista a {target}",didClick:"Hizo clic en {target}",didFill:"Complet\xF3 {target}",didNavigate:"Fue a {destination}",actionFailed:"No se pudo completar la acci\xF3n en {target}",errorNoAgent:"El chat de soporte no est\xE1 disponible en este sitio.",errorDailyCap:"El asistente lleg\xF3 a su l\xEDmite de mensajes de hoy. Vuelve a intentarlo ma\xF1ana.",errorRateLimited:"Demasiados mensajes. Espera un momento y vuelve a intentarlo.",errorConversationLimit:"Esta conversaci\xF3n se hizo demasiado larga.",errorBusy:"Otra respuesta est\xE1 en curso. Espera un momento y vuelve a intentarlo.",startOver:"Empezar de nuevo",errorNetwork:"No se pudo contactar al asistente. Revisa tu conexi\xF3n y vuelve a intentarlo.",errorGeneric:"Algo sali\xF3 mal. Vuelve a intentarlo.",stop:"Detener",presenceNotice:"El asistente est\xE1 usando esta p\xE1gina",presenceNoticeNamed:"{name} est\xE1 usando esta p\xE1gina",online:"En l\xEDnea",options:"Lo que puede hacer el asistente",optionsTitle:"Lo que el asistente puede hacer en esta p\xE1gina",optionsHint:"Apagar una acci\xF3n vale para esta conversaci\xF3n. \xABPreguntarme antes\xBB se guarda en este navegador para este sitio.",optionsEmpty:"Aqu\xED el asistente s\xF3lo responde preguntas.",optionsUnavailable:"No pudimos cargar las opciones ahora. Vuelve a intentarlo m\xE1s tarde.",anElement:"un elemento de la p\xE1gina",askFirst:"Preguntarme antes",suggestions:"Sugerencias",running:"En curso",done:"Hecho",failed:"Error",actionsCount:"{n} acciones",detailTarget:"Elemento",detailDestination:"Lleva a",detailValue:"Texto",nameHighlight:"Se\xF1alar",descHighlight:"Marca un bot\xF3n o un campo de la p\xE1gina.",nameScroll:"Mover la vista",descScroll:"Lleva la vista a una parte de la p\xE1gina.",nameClick:"Hacer clic",descClick:"Presiona botones, enlaces y pesta\xF1as.",nameFill:"Completar campos",descFill:"Escribe en campos de formularios. Nunca contrase\xF1as.",nameNavigate:"Abrir p\xE1ginas",descNavigate:"Va a otra p\xE1gina de este sitio.",whyNotAllowed:"Esta acci\xF3n est\xE1 desactivada.",whyPrivate:"Esa parte de la p\xE1gina es privada.",whyDisabled:"Est\xE1 deshabilitado en este momento.",whyGone:"Ya no est\xE1 en la p\xE1gina.",whyOtherSite:"Lleva a otro sitio.",whyDeclined:"La rechazaste.",whyNotFillable:"No acepta texto.",whyInvalidValue:"Esa opci\xF3n no est\xE1 en la lista.",whyGeneric:"La p\xE1gina no respondi\xF3 como se esperaba.",queueTitle:"{n} en cola",queuePaused:"En pausa",queueResume:"Reanudar",queueClear:"Vaciar",queueSendNow:"Enviar ahora",queueEdit:"Editar",queueRemove:"Quitar",queueFull:"La cola est\xE1 llena. Espera a que el asistente termine.",tabs:"Secciones",tabHome:"Inicio",tabSupport:"Soporte",tabGuides:"Gu\xEDas",hello:"Hola.",helpPrompt:"\xBFEn qu\xE9 te podemos ayudar?",askTitle:"Preg\xFAntale al asistente",askHint:"Responde en segundos \xB7 puede se\xF1alar cosas en esta p\xE1gina",continueTitle:"Continuar",agoNow:"reci\xE9n",agoMinutes:"hace {n} min",agoHours:"hace {n} h",agoDays:"hace {n} d",searchGuides:"Buscar en las gu\xEDas",popularGuides:"Gu\xEDas populares",guidesCount:"{n} art\xEDculos",guidesCountOne:"1 art\xEDculo",guidesLoading:"Cargando las gu\xEDas\u2026",guidesError:"No pudimos cargar las gu\xEDas.",guidesEmpty:"Todav\xEDa no hay gu\xEDas.",guidesNoMatch:"Todav\xEDa ninguna gu\xEDa coincide con eso.",askInstead:"Mejor preg\xFAntale al asistente",retry:"Reintentar",backToGuides:"Volver a las gu\xEDas",newTab:"(se abre en una pesta\xF1a nueva)",openFullPage:"Abrir la p\xE1gina completa",articleLoading:"Cargando\u2026",articleError:"No pudimos cargar esta gu\xEDa.",voteQuestion:"\xBFEsto respondi\xF3 tu pregunta?",voteYes:"S\xED",voteNo:"No del todo",voteThanks:"Gracias por contarnos.",voteSorry:"Lo sentimos.",voteSorryAssist:"Lo sentimos. El asistente puede seguir desde aqu\xED.",tabTickets:"Tickets",reportProblem:"Reportar un problema",ticketsFilter:"Mostrar tickets",filterAll:"Todos",filterOpen:"Abiertos",filterResolved:"Resueltos",statusTeam:"Con nuestro equipo",statusYou:"Esperando tu respuesta",statusResolved:"Resuelto",recordingAttached:"Grabaci\xF3n adjunta",ticketsLoading:"Cargando tickets\u2026",ticketsError:"No pudimos cargar tus tickets.",ticketsEmpty:"Nada coincide con ese filtro.",openTicket:"Tu ticket abierto",ticketsWaiting:"{n} esperan tu respuesta",minimize:"Minimizar",expand:"Ampliar",collapse:"Reducir",dock:"Fijar al costado",undock:"Volver a flotante",more:"M\xE1s",copy:"Copiar",copied:"Copiado",copyCode:"Copiar c\xF3digo",regenerate:"Regenerar la respuesta",regenerateShort:"Regenerar",goodResponse:"Buena respuesta",badResponse:"Mala respuesta",notSent:"No se envi\xF3",resend:"Reintentar",stopped:"Detenido",jumpLatest:"Ir a lo \xFAltimo",hintSend:"Enter para enviar",hintQueue:"Enter lo agrega a la cola",hintNewline:"Shift+Enter para una l\xEDnea nueva",helloNamed:"Hola, {name}.",errorUnavailable:"El asistente no est\xE1 disponible en este momento. Vuelve a intentarlo en unos minutos."},ur={open:"Abrir o chat de suporte",title:"Suporte",close:"Fechar o chat",newChat:"Nova conversa",greeting:"Ol\xE1! Como posso ajudar?",inputLabel:"Sua mensagem",placeholder:"Digite sua pergunta\u2026",send:"Enviar",thinking:"Pensando\u2026",confirmTitle:"O assistente quer:",allow:"Permitir uma vez",allowAlways:"Permitir sempre",decline:"Recusar",allowed:"Permitido",declined:"Recusado",confirmHighlight:"Destacar {target}",confirmScroll:"Rolar at\xE9 {target}",confirmClick:"Clicar em {target}",confirmClickLink:"Clicar em {target}, que leva para {destination}",confirmFill:"Digitar em {target}:",confirmNavigate:"Ir para {destination}",emptyValue:"(vazio)",didHighlight:"Destacou {target}",didScroll:"Rolou at\xE9 {target}",didClick:"Clicou em {target}",didFill:"Preencheu {target}",didNavigate:"Foi para {destination}",actionFailed:"N\xE3o foi poss\xEDvel concluir a a\xE7\xE3o em {target}",errorNoAgent:"O chat de suporte n\xE3o est\xE1 dispon\xEDvel neste site.",errorDailyCap:"O assistente atingiu o limite de mensagens de hoje. Tente novamente amanh\xE3.",errorRateLimited:"Mensagens demais. Aguarde um momento e tente novamente.",errorConversationLimit:"Esta conversa ficou longa demais.",errorBusy:"Outra resposta est\xE1 em andamento. Aguarde um momento e tente novamente.",startOver:"Come\xE7ar de novo",errorNetwork:"N\xE3o foi poss\xEDvel falar com o assistente. Verifique sua conex\xE3o e tente novamente.",errorGeneric:"Algo deu errado. Tente novamente.",stop:"Parar",presenceNotice:"O assistente est\xE1 usando esta p\xE1gina",presenceNoticeNamed:"{name} est\xE1 usando esta p\xE1gina",online:"Online",options:"O que o assistente pode fazer",optionsTitle:"O que o assistente pode fazer nesta p\xE1gina",optionsHint:"Desligar uma a\xE7\xE3o vale para esta conversa. \xABPerguntar antes\xBB fica salvo neste navegador para este site.",optionsEmpty:"Aqui o assistente s\xF3 responde perguntas.",optionsUnavailable:"N\xE3o conseguimos carregar as op\xE7\xF5es agora. Tente novamente mais tarde.",anElement:"um elemento da p\xE1gina",askFirst:"Perguntar antes",suggestions:"Sugest\xF5es",running:"Em andamento",done:"Feito",failed:"Erro",actionsCount:"{n} a\xE7\xF5es",detailTarget:"Elemento",detailDestination:"Leva para",detailValue:"Texto",nameHighlight:"Destacar",descHighlight:"Marca um bot\xE3o ou campo da p\xE1gina.",nameScroll:"Rolar a p\xE1gina",descScroll:"Leva a vista at\xE9 uma parte da p\xE1gina.",nameClick:"Clicar",descClick:"Aperta bot\xF5es, links e abas.",nameFill:"Preencher campos",descFill:"Digita em campos de formul\xE1rios. Nunca senhas.",nameNavigate:"Abrir p\xE1ginas",descNavigate:"Vai para outra p\xE1gina deste site.",whyNotAllowed:"Esta a\xE7\xE3o est\xE1 desativada.",whyPrivate:"Essa parte da p\xE1gina \xE9 privada.",whyDisabled:"Est\xE1 desabilitado no momento.",whyGone:"N\xE3o est\xE1 mais na p\xE1gina.",whyOtherSite:"Leva para outro site.",whyDeclined:"Voc\xEA recusou.",whyNotFillable:"N\xE3o aceita texto.",whyInvalidValue:"Essa op\xE7\xE3o n\xE3o est\xE1 na lista.",whyGeneric:"A p\xE1gina n\xE3o respondeu como esperado.",queueTitle:"{n} na fila",queuePaused:"Em pausa",queueResume:"Retomar",queueClear:"Limpar",queueSendNow:"Enviar agora",queueEdit:"Editar",queueRemove:"Remover",queueFull:"A fila est\xE1 cheia. Aguarde o assistente terminar.",tabs:"Se\xE7\xF5es",tabHome:"In\xEDcio",tabSupport:"Suporte",tabGuides:"Guias",hello:"Ol\xE1.",helpPrompt:"Como podemos ajudar?",askTitle:"Pergunte ao assistente",askHint:"Responde em segundos \xB7 pode apontar coisas nesta p\xE1gina",continueTitle:"Continuar",agoNow:"agora mesmo",agoMinutes:"h\xE1 {n} min",agoHours:"h\xE1 {n} h",agoDays:"h\xE1 {n} d",searchGuides:"Buscar nos guias",popularGuides:"Guias populares",guidesCount:"{n} artigos",guidesCountOne:"1 artigo",guidesLoading:"Carregando os guias\u2026",guidesError:"N\xE3o conseguimos carregar os guias.",guidesEmpty:"Ainda n\xE3o h\xE1 guias.",guidesNoMatch:"Nenhum guia corresponde a isso ainda.",askInstead:"Pergunte ao assistente",retry:"Tentar novamente",backToGuides:"Voltar aos guias",newTab:"(abre em uma nova aba)",openFullPage:"Abrir a p\xE1gina completa",articleLoading:"Carregando\u2026",articleError:"N\xE3o conseguimos carregar este guia.",voteQuestion:"Isso respondeu \xE0 sua pergunta?",voteYes:"Sim",voteNo:"N\xE3o muito",voteThanks:"Obrigado por nos contar.",voteSorry:"Sentimos muito.",voteSorryAssist:"Sentimos muito. O assistente pode continuar daqui.",tabTickets:"Tickets",reportProblem:"Relatar um problema",ticketsFilter:"Mostrar tickets",filterAll:"Todos",filterOpen:"Abertos",filterResolved:"Resolvidos",statusTeam:"Com nossa equipe",statusYou:"Aguardando voc\xEA",statusResolved:"Resolvido",recordingAttached:"Grava\xE7\xE3o anexada",ticketsLoading:"Carregando tickets\u2026",ticketsError:"N\xE3o conseguimos carregar seus tickets.",ticketsEmpty:"Nada corresponde a esse filtro.",openTicket:"Seu ticket aberto",ticketsWaiting:"{n} aguardando voc\xEA",minimize:"Minimizar",expand:"Expandir",collapse:"Recolher",dock:"Fixar na lateral",undock:"Voltar a flutuar",more:"Mais",copy:"Copiar",copied:"Copiado",copyCode:"Copiar c\xF3digo",regenerate:"Gerar a resposta de novo",regenerateShort:"Gerar de novo",goodResponse:"Boa resposta",badResponse:"Resposta ruim",notSent:"N\xE3o enviada",resend:"Tentar de novo",stopped:"Interrompida",jumpLatest:"Ir para o fim",hintSend:"Enter para enviar",hintQueue:"Enter coloca na fila",hintNewline:"Shift+Enter para uma nova linha",helloNamed:"Ol\xE1, {name}.",errorUnavailable:"O assistente est\xE1 indispon\xEDvel no momento. Tente novamente em alguns minutos."};function vt(e){let i=(e??"").toLowerCase().slice(0,2);return i==="es"?pr:i==="pt"?ur:Ji}function Gt(e,i,t){let o=t.target?`\xAB${t.target}\xBB`:e.anElement,s=t.destination??"?",r;return i==="failed"?r=t.type==="navigate"?e.actionFailed.replace("{target}","{destination}"):e.actionFailed:i==="confirm"?r=t.type==="click"?t.destination?e.confirmClickLink:e.confirmClick:t.type==="fill"?e.confirmFill:t.type==="navigate"?e.confirmNavigate:t.type==="scroll_to"?e.confirmScroll:e.confirmHighlight:r=t.type==="click"?e.didClick:t.type==="fill"?e.didFill:t.type==="navigate"?e.didNavigate:t.type==="scroll_to"?e.didScroll:e.didHighlight,r.replace(/\{(target|destination)\}/g,(c,p)=>p==="target"?o:s)}function vn(e,i){switch(i){case"not_allowed":case"unknown_action":return e.whyNotAllowed;case"forbidden":case"blocked":return e.whyPrivate;case"disabled":return e.whyDisabled;case"stale_ref":return e.whyGone;case"cross_origin":return e.whyOtherSite;case"declined":case"confirmation_required":return e.whyDeclined;case"not_fillable":case"readonly":return e.whyNotFillable;case"invalid_value":return e.whyInvalidValue;default:return e.whyGeneric}}function bt(e,i){return i===""?e.emptyValue:i.replace(/\r\n?|\n/g,`\u23CE
|
|
16
|
+
`)}var Xi=["data-theme","data-mode","data-color-scheme"];function Zi(e){if(!e)return null;let i=e.classList.contains("dark");if(i!==e.classList.contains("light"))return i?"dark":"light";for(let t of Xi){let o=e.getAttribute(t)?.trim().toLowerCase();if(o==="dark"||o==="light")return o}return null}function fr(e){return e=e.toLowerCase(),{light:/\blight\b/.test(e),dark:/\bdark\b/.test(e)}}var Ce=(e,i)=>!e||e==="none"?0:e.endsWith("%")?parseFloat(e)*i/100:parseFloat(e),et=e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4,Dt=(e,i,t)=>.2126*e+.7152*i+.0722*t;function gr(e){let i=/^\s*(rgba?|hsla?|oklab|oklch|lab|lch|color)\(([^)]*)\)\s*$/i.exec(e);if(!i)return null;let t=i[1].toLowerCase(),[o,s]=i[2].split("/"),r=o.split(/[\s,]+/).filter(Boolean),c=s?.trim()??(t==="color"?void 0:r[3]),p=c===void 0?1:Ce(c,1),l;if(t.startsWith("rgb"))l=Dt(et(Ce(r[0],255)/255),et(Ce(r[1],255)/255),et(Ce(r[2],255)/255));else if(t.startsWith("hsl")){let f=parseFloat(r[0])||0,g=Ce(r[1],100)/100,b=Ce(r[2],100)/100,m=g*Math.min(b,1-b),h=M=>{let C=(M+f/30)%12;return et(b-m*Math.max(-1,Math.min(C-3,9-C,1)))};l=Dt(h(0),h(8),h(4))}else if(t.startsWith("ok"))l=Ce(r[0],1)**3;else if(t!=="color"){let f=Ce(r[0],100);l=f>8?((f+16)/116)**3:f/903.3}else{let f=r.shift(),[g,b,m]=[Ce(r[0],1),Ce(r[1],1),Ce(r[2],1)];f?.startsWith("xyz")?l=b:f==="srgb-linear"?l=Dt(g,b,m):l=Dt(et(g),et(b),et(m))}return Number.isNaN(l)||Number.isNaN(p)?null:[l,p]}function hr(e,i,t,o){let s=e.defaultView;if(!s)return null;let r=null;try{r=e.elementsFromPoint(t,o).find(p=>!i.contains(p))??null}catch{}let c=[];for(let p=r??e.body??e.documentElement;p;p=p.parentElement)c.push(p);c.push(e.body);for(let p of c){let l=p&&gr(s.getComputedStyle(p).backgroundColor);if(l&&l[1]>.5)return l[0]}return null}function Ot(e,i,t,o){let s=e.documentElement,r=Zi(s)??Zi(e.body);if(r)return r;let c=e.defaultView,p=[];try{for(let g of[s,e.body])g&&c&&p.push(c.getComputedStyle(g).colorScheme??"")}catch{}p.push(e.querySelector('meta[name="color-scheme"]')?.getAttribute("content")??"");let l=!1;for(let g of p){let b=fr(g);if(b.dark!==b.light)return b.dark?"dark":"light";l||=b.dark}let f=hr(e,i,t,o);return f!==null?f<.179?"dark":"light":l&&c?.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}function eo(e,i){let t=e.defaultView,o=null,s=()=>{o===null&&(o=setTimeout(()=>{o=null,i()},60))};i();let r=typeof MutationObserver=="function"?new MutationObserver(s):null,c=["class","style",...Xi];r?.observe(e.documentElement,{attributes:!0,attributeFilter:c}),e.body&&r?.observe(e.body,{attributes:!0,attributeFilter:c});let p=t?.matchMedia?.("(prefers-color-scheme: dark)");return p?.addEventListener?.("change",s),()=>{r?.disconnect(),p?.removeEventListener?.("change",s),o!==null&&clearTimeout(o)}}var $t="data-espejo-presence",mr=/\b(hidden|clip|auto|scroll|overlay)\b/,vr=600,br=160,xr=.55,yr=140,kr=600,wr=260,lt=260,Er=4e3,Cr=`
|
|
17
17
|
:host {
|
|
18
18
|
all: initial !important;
|
|
19
19
|
position: fixed !important;
|
|
@@ -62,7 +62,7 @@ ${d.hash.toLowerCase()}`):null,f=lo(o,t)??"";try{let p=o?.getItem(l);f&&p&&p!==g
|
|
|
62
62
|
inset: 0;
|
|
63
63
|
overflow: hidden;
|
|
64
64
|
opacity: 0;
|
|
65
|
-
transition: opacity ${
|
|
65
|
+
transition: opacity ${lt}ms var(--p-ease);
|
|
66
66
|
box-shadow: inset 0 0 18px var(--c1);
|
|
67
67
|
--p-depth: 64px;
|
|
68
68
|
}
|
|
@@ -102,7 +102,7 @@ ${d.hash.toLowerCase()}`):null,f=lo(o,t)??"";try{let p=o?.getItem(l);f&&p&&p!==g
|
|
|
102
102
|
opacity: 0;
|
|
103
103
|
visibility: hidden;
|
|
104
104
|
transform: translate(-50%, -8px);
|
|
105
|
-
transition: opacity ${
|
|
105
|
+
transition: opacity ${lt}ms var(--p-ease), transform ${lt}ms var(--p-ease), visibility 0s ${lt}ms;
|
|
106
106
|
}
|
|
107
107
|
.ep-root[data-on] .ep-bar {
|
|
108
108
|
opacity: 1;
|
|
@@ -140,7 +140,7 @@ ${d.hash.toLowerCase()}`):null,f=lo(o,t)??"";try{let p=o?.getItem(l);f&&p&&p!==g
|
|
|
140
140
|
left: 0;
|
|
141
141
|
top: 0;
|
|
142
142
|
opacity: 0;
|
|
143
|
-
transition: opacity ${
|
|
143
|
+
transition: opacity ${lt}ms var(--p-ease);
|
|
144
144
|
will-change: transform;
|
|
145
145
|
}
|
|
146
146
|
.ep-root[data-on] .ep-cursor[data-shown] { opacity: 1; }
|
|
@@ -201,107 +201,64 @@ ${d.hash.toLowerCase()}`):null,f=lo(o,t)??"";try{let p=o?.getItem(l);f&&p&&p!==g
|
|
|
201
201
|
@media (prefers-reduced-motion: reduce) {
|
|
202
202
|
*, *::before, *::after { animation: none !important; transition: none !important; }
|
|
203
203
|
}
|
|
204
|
-
`,
|
|
204
|
+
`,Tr="M3 3l7.2 17.4 2.6-7.2 7.2-2.6z";function Ar(e,i={}){return bn(e,i)}function bn(e,i){let t=i.doc??(typeof document<"u"?document:null);if(!t||!e||typeof e.presence!="function")return null;try{return Lr(t,e,i)}catch{return null}}function Lr(e,i,t){let o={...vt(t.lang),...t.text},s=e.defaultView,r="http://www.w3.org/2000/svg",c=e.createElement("div");c.setAttribute($t,""),c.setAttribute(at,""),c.setAttribute("style","position: fixed; inset: 0; z-index: 2147483647; pointer-events: none; display: block");let p=c.attachShadow({mode:"closed"}),l=(y,L,k)=>{let H=e.createElement(y);return H.className=L,k.appendChild(H),H},f=e.createElement("style");f.textContent=Cr,p.appendChild(f);let g=l("div","ep-root",p),b=l("div","ep-frame",g);b.setAttribute("aria-hidden","true");for(let y=0;y<4;y++){let L=l("b","",b);for(let k=0;k<3;k++)l("i","",L).style.cssText=`left:${k*35-5}%;--c:var(--c${(y+k)%4});--s:${7+(y*3+k*5)%7}s;--w:-${(y*5+k*3)%9}s`}let m=l("div","ep-bar",g);m.setAttribute("role","status"),m.setAttribute("aria-live","polite"),l("span","ep-dot",m).setAttribute("aria-hidden","true");let h=l("span","ep-text",m),M=l("button","ep-stop",m);M.type="button",M.textContent=o.stop;let C=l("div","ep-cursor",g);C.setAttribute("aria-hidden","true");let U=e.createElementNS(r,"svg");for(let[y,L]of Object.entries({class:"ep-arrow",width:24,height:24,viewBox:"0 0 24 24"}))U.setAttribute(y,String(L));let I=U.appendChild(e.createElementNS(r,"path"));for(let[y,L]of Object.entries({d:Tr,fill:"#1f2124",stroke:"#ffffff","stroke-width":1.6,"stroke-linejoin":"round"}))I.setAttribute(y,String(L));C.appendChild(U);let j=l("span","ep-name",C),B=!1,F=!1,_=!1,R=null,$=null,K=null,de=0,ne=0,V=new Map,ie=new WeakMap,ve=()=>{try{return s?.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}catch{return!1}},Te=()=>s?.innerWidth||e.documentElement.clientWidth||0,be=()=>s?.innerHeight||e.documentElement.clientHeight||0,ge=()=>{let y=c.offsetWidth,L=y?c.getBoundingClientRect().width/y:1;return L>0&&Number.isFinite(L)?L:1},tt=()=>t.themeOf?t.themeOf():t.theme==="light"||t.theme==="dark"?t.theme:Ot(e,c,Te()/2,24),v=new Error("stopped"),x=y=>{if(F||_||y.epoch!==ne)throw v;return!y.dead&&y.seq===de},A=(y,L)=>new Promise((k,H)=>{let O=()=>{clearTimeout(P),V.delete(z)},z=()=>{O(),H(v)},P=setTimeout(()=>{O(),k()},y);V.set(z,{run:L,release:()=>(O(),k())})}),N=y=>{for(let[L,k]of[...V])(!y||k.run===y)&&L()},D=y=>{for(let L of[...V.values()])L.run!==y&&L.release()},q=y=>{!K||y&&K.run!==y||(K.node.remove(),K=null)},oe=(y,L,k)=>{let H=ge();C.style.transition=k>0?`transform ${k}ms cubic-bezier(0.23, 1, 0.32, 1), opacity ${lt}ms`:"none",C.style.transform=`translate3d(${Math.round(y/H)}px, ${Math.round(L/H)}px, 0)`,R={x:y,y:L}},J=()=>{if(F||($!==null&&clearTimeout($),$=null,B))return;B=!0,c.setAttribute("data-theme",tt());let y=((t.nameOf?t.nameOf():t.name)??"").trim().slice(0,60);j.textContent=y,j.hidden=!y,h.textContent=y?o.presenceNoticeNamed.replace(/\{name\}/g,()=>y):o.presenceNotice,g.setAttribute("data-on",""),c.isConnected||(e.body??e.documentElement).appendChild(c)},Ae=()=>{_=!1,J()},X=()=>{ne++,N(),$!==null&&clearTimeout($),$=null,q(),B&&(B=!1,R=null,h.textContent="",g.removeAttribute("data-on"),C.removeAttribute("data-shown"),C.removeAttribute("data-press"),e.activeElement===c&&M.blur())},Le=()=>{let y=B;if(_=!0,X(),y)try{t.onStop?.()}catch{}},pe=y=>{let L=y.getBoundingClientRect(),k=Math.max(L.left,0),H=Math.max(L.top,0),O=Math.min(L.right,Te()),z=Math.min(L.bottom,be());for(let P=y.parentElement;P&&P!==e.body&&P!==e.documentElement;P=P.parentElement){let Z=s?.getComputedStyle(P);if(!Z)break;if(mr.test(`${Z.overflowX} ${Z.overflowY} ${Z.overflow}`)){let re=P.getBoundingClientRect();k=Math.max(k,re.left),H=Math.max(H,re.top),O=Math.min(O,re.right),z=Math.min(z,re.bottom)}if(Z.position==="fixed")break}return O-k>=1&&z-H>=1?new DOMRect(k,H,O-k,z-H):null},ue=(y,L,k)=>{let H=[];try{H=e.elementsFromPoint(L,k)}catch{}let O=H.find(z=>!z.closest(`[${at}]`));return!H.length||!!O&&(O===y||y.contains(O))},ee=(y,L)=>{let k=pe(y);if(!k)return null;let H=L?[Math.min(16,k.width/2)/k.width,.5,.85]:[.5,.25,.75];for(let O of[.5,.25,.75])for(let z of H){let P=k.left+k.width*z,Z=k.top+k.height*O;if(ue(y,P,Z))return{x:P,y:Z}}return null},Ve=async(y,L,k,H)=>{let O=ee(y,L);if(!O){if(y.scrollIntoView({block:"center",inline:"nearest",behavior:k?"auto":"smooth"}),!k){let z=y.getBoundingClientRect(),P=0;for(let Z=0;Z<kr&&P<2&&x(H);Z+=50){await A(50,H);let re=y.getBoundingClientRect();P=re.top===z.top&&re.left===z.left?P+1:0,z=re}}if(!x(H))return null;O=ee(y,L)}return O?{...O,r:y.getBoundingClientRect()}:null},Se=(y,L)=>{let k=ge(),H=l("span","ep-ripple",g);H.setAttribute("aria-hidden","true"),H.style.left=`${y/k}px`,H.style.top=`${L/k}px`,setTimeout(()=>H.remove(),600)},se=(y,L,k,H)=>{q();let O=ge(),z=Math.max(12,Math.min(20,y.height*.6)),P=l("span","ep-caret",g);P.setAttribute("aria-hidden","true"),P.style.left=`${Math.round((L+2)/O)}px`,P.style.top=`${Math.round((k-z/2)/O)}px`,P.style.height=`${Math.round(z/O)}px`,K={node:P,run:H}},Me=async(y,L)=>{if(F)return;if(_)throw v;let k={seq:++de,epoch:ne,dead:!1};if(ie.set(y,k),D(k),J(),q(),!L)return;let H=ve(),O=y.type==="fill",z=await Ve(L,O,H,k);if(!x(k))return;if(!z){C.removeAttribute("data-shown");return}let P=Te(),Z=be(),re=(he,yt)=>Math.max(4,Math.min(yt-4,he)),fe=re(z.x,P),xe=re(z.y,Z),ye=R;ye||(ye=t.origin?.()??{x:P-40,y:Z-40},oe(ye.x,ye.y,0),C.getBoundingClientRect()),C.setAttribute("data-shown","");let _e=Math.hypot(fe-ye.x,xe-ye.y),De=H||_e<1?0:Math.round(Math.min(vr,Math.max(br,_e*xr)));oe(fe,xe,De),De&&await A(De,k),x(k)&&(y.type==="click"?H||(C.setAttribute("data-press",""),Se(fe,xe),await A(yr,k).finally(()=>C.removeAttribute("data-press"))):O&&(se(z.r,fe,xe,k),await A(wr,k),x(k)||q(k)),x(k))},Pe=y=>{let L=ie.get(y);L&&(L.dead=!0,N(L),q(L));let k=t.idleMs??Er;B&&k>0&&($!==null&&clearTimeout($),$=setTimeout(X,k))},xt=i.presence({before:Me,after:Pe}),He=It(m);return M.addEventListener("click",Le),{start:Ae,end:X,stop:Le,destroy(){F||(X(),F=!0,xt(),He(),M.removeEventListener("click",Le),c.remove())},get active(){return B}}}var to=Mi+`
|
|
205
205
|
:host {
|
|
206
206
|
all: initial !important;
|
|
207
207
|
position: fixed !important;
|
|
208
208
|
z-index: 2147483647 !important;
|
|
209
209
|
display: block !important;
|
|
210
|
-
--c-page: #
|
|
210
|
+
--c-page: #f6f6f4;
|
|
211
211
|
--c-surface: #ffffff;
|
|
212
|
-
--c-inset: #
|
|
213
|
-
--c-field: #
|
|
214
|
-
--c-
|
|
215
|
-
--c-
|
|
216
|
-
--c-
|
|
217
|
-
--c-
|
|
218
|
-
--c-
|
|
219
|
-
--c-
|
|
220
|
-
--c-accent: #
|
|
221
|
-
--c-accent-
|
|
222
|
-
--c-accent
|
|
223
|
-
--c-green: #
|
|
224
|
-
--c-green-tint: #
|
|
225
|
-
--c-
|
|
226
|
-
--c-red: #
|
|
227
|
-
--c-
|
|
228
|
-
--c-
|
|
229
|
-
--c-
|
|
230
|
-
--c-
|
|
231
|
-
--c-on-ink: #
|
|
232
|
-
--c-
|
|
233
|
-
--c-overlay: 0 0 0 1px var(--c-
|
|
212
|
+
--c-inset: #f7f7f5;
|
|
213
|
+
--c-field: #f3f3f0;
|
|
214
|
+
--c-ink: #1a1a19;
|
|
215
|
+
--c-ink2: #5e5d57;
|
|
216
|
+
--c-ink3: #8b8a83;
|
|
217
|
+
--c-line: #efeeeb;
|
|
218
|
+
--c-line2: #e6e5e1;
|
|
219
|
+
--c-accent: #4c5fd5;
|
|
220
|
+
--c-accent-tint: #eef0fe;
|
|
221
|
+
--c-accent-line: #d5dafb;
|
|
222
|
+
--c-on-accent: #ffffff;
|
|
223
|
+
--c-green: #2e7d5b;
|
|
224
|
+
--c-green-tint: #e8f4ee;
|
|
225
|
+
--c-red: #c0392b;
|
|
226
|
+
--c-red-tint: #fbeae7;
|
|
227
|
+
--c-warn: #b4661c;
|
|
228
|
+
--c-warn-tint: #fbf0e4;
|
|
229
|
+
--c-skel: #ecebe7;
|
|
230
|
+
--c-skel-hi: #f7f7f5;
|
|
231
|
+
--c-on-ink: #f6f6f4;
|
|
232
|
+
--c-shadow: 0 1px 2px rgba(24, 24, 22, 0.05), 0 8px 24px -12px rgba(24, 24, 22, 0.14);
|
|
233
|
+
--c-overlay: 0 0 0 1px var(--c-line2), 0 2px 6px rgba(24, 24, 22, 0.06), 0 24px 60px -18px rgba(24, 24, 22, 0.28);
|
|
234
234
|
--c-ease: cubic-bezier(0.23, 1, 0.32, 1);
|
|
235
235
|
--c-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
236
236
|
}
|
|
237
|
-
@supports (color: oklch(0 0 0)) {
|
|
238
|
-
:host {
|
|
239
|
-
--c-page: oklch(0.985 0.001 286);
|
|
240
|
-
--c-surface: oklch(1 0 0);
|
|
241
|
-
--c-inset: oklch(0.979 0.002 248);
|
|
242
|
-
--c-field: oklch(0.961 0.001 286);
|
|
243
|
-
--c-hover: oklch(0.97 0.002 248);
|
|
244
|
-
--c-ink: oklch(0.247 0.006 258);
|
|
245
|
-
--c-ink2: oklch(0.506 0.01 264);
|
|
246
|
-
--c-ink3: oklch(0.695 0.009 264);
|
|
247
|
-
--c-line: oklch(0.946 0.003 264);
|
|
248
|
-
--c-line2: oklch(0.912 0.005 258);
|
|
249
|
-
--c-accent: oklch(0.626 0.205 255);
|
|
250
|
-
--c-accent-tint: oklch(0.96 0.019 253);
|
|
251
|
-
--c-accent-ink: oklch(0.5 0.18 255);
|
|
252
|
-
--c-green: oklch(0.603 0.155 151);
|
|
253
|
-
--c-green-tint: oklch(0.958 0.017 159);
|
|
254
|
-
--c-green-ink: oklch(0.46 0.13 151);
|
|
255
|
-
--c-red: oklch(0.621 0.192 23);
|
|
256
|
-
--c-red-tint: oklch(0.956 0.017 17);
|
|
257
|
-
--c-red-ink: oklch(0.5 0.18 23);
|
|
258
|
-
--c-warn-tint: oklch(0.967 0.025 80);
|
|
259
|
-
--c-warn-ink: oklch(0.5 0.12 65);
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
237
|
:host([data-theme="dark"]) {
|
|
263
|
-
--c-page: #
|
|
264
|
-
--c-surface: #
|
|
265
|
-
--c-inset: #
|
|
266
|
-
--c-field: #
|
|
267
|
-
--c-
|
|
268
|
-
--c-
|
|
269
|
-
--c-
|
|
270
|
-
--c-
|
|
271
|
-
--c-
|
|
272
|
-
--c-
|
|
273
|
-
--c-accent: #
|
|
274
|
-
--c-accent-
|
|
275
|
-
--c-accent
|
|
276
|
-
--c-green: #
|
|
277
|
-
--c-green-tint:
|
|
278
|
-
--c-
|
|
279
|
-
--c-red: #
|
|
280
|
-
--c-
|
|
281
|
-
--c-
|
|
282
|
-
--c-
|
|
283
|
-
--c-
|
|
284
|
-
--c-on-ink: #
|
|
285
|
-
--c-
|
|
286
|
-
--c-overlay: 0 0 0 1px rgba(
|
|
287
|
-
}
|
|
288
|
-
@supports (color: oklch(0 0 0)) {
|
|
289
|
-
:host([data-theme="dark"]) {
|
|
290
|
-
--c-page: oklch(0.209 0.004 264);
|
|
291
|
-
--c-surface: oklch(0.26 0.006 271);
|
|
292
|
-
--c-inset: oklch(0.243 0.006 271);
|
|
293
|
-
--c-field: oklch(0.293 0.006 271);
|
|
294
|
-
--c-hover: oklch(0.289 0.006 271);
|
|
295
|
-
--c-ink: oklch(0.964 0.002 248);
|
|
296
|
-
--c-ink2: oklch(0.731 0.008 261);
|
|
297
|
-
--c-ink3: oklch(0.541 0.01 264);
|
|
298
|
-
--c-line: oklch(0.308 0.006 258);
|
|
299
|
-
--c-line2: oklch(0.356 0.007 264);
|
|
300
|
-
--c-accent: oklch(0.68 0.173 253);
|
|
301
|
-
--c-accent-tint: oklch(0.68 0.173 253 / 0.15);
|
|
302
|
-
--c-accent-ink: oklch(0.78 0.12 253);
|
|
303
|
-
--c-hair: oklch(1 0 0 / 0.11);
|
|
304
|
-
}
|
|
238
|
+
--c-page: #101114;
|
|
239
|
+
--c-surface: #181a1e;
|
|
240
|
+
--c-inset: #14161a;
|
|
241
|
+
--c-field: #1d2025;
|
|
242
|
+
--c-ink: #f1f1ef;
|
|
243
|
+
--c-ink2: #a9a9a4;
|
|
244
|
+
--c-ink3: #7c7c77;
|
|
245
|
+
--c-line: #23262c;
|
|
246
|
+
--c-line2: #2a2d34;
|
|
247
|
+
--c-accent: #8e9bff;
|
|
248
|
+
--c-accent-tint: #1e2334;
|
|
249
|
+
--c-accent-line: #2e3550;
|
|
250
|
+
--c-on-accent: #14161c;
|
|
251
|
+
--c-green: #6fd09e;
|
|
252
|
+
--c-green-tint: #16251e;
|
|
253
|
+
--c-red: #f08c7d;
|
|
254
|
+
--c-red-tint: #2a1917;
|
|
255
|
+
--c-warn: #e0a468;
|
|
256
|
+
--c-warn-tint: #2a2016;
|
|
257
|
+
--c-skel: #23262c;
|
|
258
|
+
--c-skel-hi: #2c3037;
|
|
259
|
+
--c-on-ink: #101114;
|
|
260
|
+
--c-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 30px -14px rgba(0, 0, 0, 0.7);
|
|
261
|
+
--c-overlay: 0 0 0 1px var(--c-line2), 0 2px 8px rgba(0, 0, 0, 0.55), 0 30px 70px -20px rgba(0, 0, 0, 0.85);
|
|
305
262
|
}
|
|
306
263
|
|
|
307
264
|
@keyframes ec-shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }
|
|
@@ -313,9 +270,9 @@ ${d.hash.toLowerCase()}`):null,f=lo(o,t)??"";try{let p=o?.getItem(l);f&&p&&p!==g
|
|
|
313
270
|
@keyframes ec-pulse { 0%, 100% { opacity: 0.35; transform: scale(0.8); } 50% { opacity: 1; transform: none; } }
|
|
314
271
|
|
|
315
272
|
.ec-root {
|
|
316
|
-
font-family:
|
|
317
|
-
font-size:
|
|
318
|
-
line-height: 1.
|
|
273
|
+
font-family: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
|
|
274
|
+
font-size: 14px;
|
|
275
|
+
line-height: 1.45;
|
|
319
276
|
color: var(--c-ink);
|
|
320
277
|
position: relative;
|
|
321
278
|
-webkit-font-smoothing: antialiased;
|
|
@@ -359,12 +316,12 @@ svg { display: block; flex: none; }
|
|
|
359
316
|
position: absolute;
|
|
360
317
|
width: 380px;
|
|
361
318
|
max-width: calc(100vw - 32px);
|
|
362
|
-
height:
|
|
319
|
+
height: 600px;
|
|
363
320
|
max-height: calc(100vh - 100px);
|
|
364
321
|
display: flex;
|
|
365
322
|
flex-direction: column;
|
|
366
323
|
background: var(--c-surface);
|
|
367
|
-
border-radius:
|
|
324
|
+
border-radius: 22px;
|
|
368
325
|
box-shadow: var(--c-overlay);
|
|
369
326
|
overflow: hidden;
|
|
370
327
|
transition: opacity 0.18s var(--c-ease), transform 0.26s var(--c-ease), display 0.26s allow-discrete;
|
|
@@ -379,57 +336,92 @@ svg { display: block; flex: none; }
|
|
|
379
336
|
:host([data-corner="bottom-left"]) .ec-panel { transform-origin: bottom left; }
|
|
380
337
|
:host([data-corner="top-right"]) .ec-panel { transform-origin: top right; }
|
|
381
338
|
:host([data-corner="top-left"]) .ec-panel { transform-origin: top left; }
|
|
339
|
+
.ec-root[data-size] .ec-panel { position: fixed; top: 24px; bottom: 24px; left: 0; right: 0; margin: auto; width: 720px; height: auto; max-height: none; transform-origin: center; }
|
|
340
|
+
.ec-root[data-size="docked"] .ec-panel { top: 0; bottom: 0; left: auto; width: 400px; max-width: 100vw; border-radius: 0; }
|
|
341
|
+
.ec-root[data-size] .ec-trigger[aria-expanded="true"] { display: none; }
|
|
382
342
|
.ec-panel[data-dodge] { height: auto; }
|
|
343
|
+
.ec-root[data-size] .ec-panel[data-dodge] { top: auto; }
|
|
383
344
|
.ec-panel[data-dodge] .ec-log,
|
|
384
345
|
.ec-panel[data-dodge] .ec-queue,
|
|
385
346
|
.ec-panel[data-dodge] .ec-form,
|
|
386
347
|
.ec-panel[data-dodge] .ec-pop,
|
|
348
|
+
.ec-panel[data-dodge] .ec-menu,
|
|
387
349
|
.ec-panel[data-dodge] .ec-view,
|
|
388
350
|
.ec-panel[data-dodge] .ec-tabs { display: none; }
|
|
389
351
|
|
|
390
352
|
.ec-head {
|
|
391
353
|
display: flex;
|
|
392
354
|
align-items: center;
|
|
393
|
-
gap:
|
|
394
|
-
padding:
|
|
395
|
-
border-bottom: 1px solid var(--c-
|
|
355
|
+
gap: 2px;
|
|
356
|
+
padding: 12px 10px 12px 16px;
|
|
357
|
+
border-bottom: 1px solid var(--c-line);
|
|
396
358
|
}
|
|
397
359
|
.ec-avatar {
|
|
398
|
-
width:
|
|
399
|
-
height:
|
|
360
|
+
width: 34px;
|
|
361
|
+
height: 34px;
|
|
362
|
+
margin-right: 8px;
|
|
400
363
|
border-radius: 999px;
|
|
401
364
|
display: grid;
|
|
402
365
|
place-items: center;
|
|
403
366
|
flex: none;
|
|
404
367
|
overflow: hidden;
|
|
405
368
|
background: var(--c-accent-tint);
|
|
406
|
-
color: var(--c-accent
|
|
369
|
+
color: var(--c-accent);
|
|
407
370
|
}
|
|
408
|
-
.ec-avatar img { width:
|
|
371
|
+
.ec-avatar img { width: 34px; height: 34px; object-fit: cover; }
|
|
409
372
|
.ec-who { flex: 1; min-width: 0; }
|
|
410
373
|
.ec-title {
|
|
411
374
|
margin: 0;
|
|
412
|
-
font-size:
|
|
375
|
+
font-size: 14.5px;
|
|
413
376
|
font-weight: 600;
|
|
414
377
|
overflow: hidden;
|
|
415
378
|
text-overflow: ellipsis;
|
|
416
379
|
white-space: nowrap;
|
|
417
380
|
}
|
|
418
|
-
.ec-status { margin: 0; font-size: 12px; color: var(--c-ink2); display: flex; align-items: center; gap:
|
|
419
|
-
.ec-status::before { content: ''; width:
|
|
420
|
-
.ec-status[hidden] { display: none; }
|
|
381
|
+
.ec-status { margin: 0; font-size: 12px; color: var(--c-ink2); display: flex; align-items: center; gap: 6px; }
|
|
382
|
+
.ec-status::before { content: ''; width: 7px; height: 7px; border-radius: 999px; background: var(--c-green); }
|
|
421
383
|
.ec-icon {
|
|
422
|
-
width:
|
|
423
|
-
height:
|
|
424
|
-
border-radius:
|
|
384
|
+
width: 36px;
|
|
385
|
+
height: 36px;
|
|
386
|
+
border-radius: 12px;
|
|
425
387
|
display: grid;
|
|
426
388
|
place-items: center;
|
|
427
389
|
color: var(--c-ink2);
|
|
428
390
|
transition: background-color 0.15s, color 0.15s;
|
|
429
391
|
}
|
|
430
392
|
.ec-icon:hover,
|
|
431
|
-
.ec-icon[aria-expanded="true"] { background: var(--c-
|
|
432
|
-
.ec-
|
|
393
|
+
.ec-icon[aria-expanded="true"] { background: var(--c-field); color: var(--c-ink); }
|
|
394
|
+
.ec-min svg { transform: rotate(90deg); }
|
|
395
|
+
|
|
396
|
+
/* El men\xFA M\xE1s */
|
|
397
|
+
.ec-menu {
|
|
398
|
+
position: absolute;
|
|
399
|
+
top: 58px;
|
|
400
|
+
right: 10px;
|
|
401
|
+
z-index: 3;
|
|
402
|
+
min-width: 236px;
|
|
403
|
+
padding: 6px;
|
|
404
|
+
border-radius: 14px;
|
|
405
|
+
background: var(--c-surface);
|
|
406
|
+
box-shadow: var(--c-overlay);
|
|
407
|
+
display: flex;
|
|
408
|
+
flex-direction: column;
|
|
409
|
+
gap: 2px;
|
|
410
|
+
animation: ec-fade-up 0.14s ease both;
|
|
411
|
+
}
|
|
412
|
+
.ec-mi {
|
|
413
|
+
min-height: 38px;
|
|
414
|
+
padding: 0 10px;
|
|
415
|
+
border-radius: 10px;
|
|
416
|
+
font-size: 13.5px;
|
|
417
|
+
display: flex;
|
|
418
|
+
align-items: center;
|
|
419
|
+
gap: 10px;
|
|
420
|
+
text-align: left;
|
|
421
|
+
transition: background-color 0.15s;
|
|
422
|
+
}
|
|
423
|
+
.ec-mi svg { color: var(--c-ink2); }
|
|
424
|
+
.ec-mi:hover, .ec-mi:focus-visible { background: var(--c-field); }
|
|
433
425
|
|
|
434
426
|
/* La conversaci\xF3n */
|
|
435
427
|
.ec-log {
|
|
@@ -441,81 +433,140 @@ svg { display: block; flex: none; }
|
|
|
441
433
|
gap: 14px;
|
|
442
434
|
scrollbar-width: thin;
|
|
443
435
|
}
|
|
436
|
+
.ec-log > * { width: 100%; max-width: 680px; margin-inline: auto; flex: none; }
|
|
444
437
|
.ec-msg { overflow-wrap: anywhere; }
|
|
438
|
+
.ec-u { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; animation: ec-fade-up 0.3s var(--c-ease) both; }
|
|
439
|
+
.ec-u-row { display: flex; align-items: center; justify-content: flex-end; gap: 4px; width: 100%; }
|
|
445
440
|
.ec-msg[data-role="user"] {
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
441
|
+
max-width: 78%;
|
|
442
|
+
padding: 9px 13px;
|
|
443
|
+
border-radius: 16px 16px 6px 16px;
|
|
444
|
+
background: var(--c-accent);
|
|
445
|
+
color: var(--c-on-accent);
|
|
451
446
|
white-space: pre-wrap;
|
|
452
|
-
animation: ec-fade-up 0.3s var(--c-ease) both;
|
|
453
447
|
}
|
|
454
|
-
.ec-
|
|
455
|
-
.ec-msg
|
|
448
|
+
.ec-u[data-failed] .ec-msg { opacity: 0.55; }
|
|
449
|
+
.ec-msg[data-role="assistant"] { line-height: 1.55; animation: ec-fade-up 0.4s var(--c-ease) both; }
|
|
450
|
+
.ec-msg p, .ec-msg ul, .ec-msg ol, .ec-msg pre, .ec-code { margin: 0 0 10px; }
|
|
456
451
|
.ec-msg > :last-child { margin-bottom: 0; }
|
|
457
452
|
.ec-msg ul, .ec-msg ol { padding-left: 20px; }
|
|
458
|
-
.ec-msg li + li { margin-top:
|
|
453
|
+
.ec-msg li + li { margin-top: 4px; }
|
|
459
454
|
.ec-msg strong { font-weight: 600; }
|
|
460
455
|
.ec-msg code,
|
|
461
456
|
.ec-doc code {
|
|
462
457
|
font-family: var(--c-mono);
|
|
463
|
-
font-size:
|
|
464
|
-
padding: 1px
|
|
465
|
-
border-radius:
|
|
466
|
-
background: var(--c-
|
|
467
|
-
box-shadow: 0 0 0 1px var(--c-
|
|
458
|
+
font-size: 12.5px;
|
|
459
|
+
padding: 1px 5px;
|
|
460
|
+
border-radius: 6px;
|
|
461
|
+
background: var(--c-field);
|
|
462
|
+
box-shadow: 0 0 0 1px var(--c-line);
|
|
468
463
|
}
|
|
469
464
|
.ec-msg pre,
|
|
470
465
|
.ec-doc pre {
|
|
471
|
-
padding:
|
|
472
|
-
border-radius:
|
|
466
|
+
padding: 12px;
|
|
467
|
+
border-radius: 12px;
|
|
473
468
|
background: var(--c-inset);
|
|
474
|
-
box-shadow: 0 0 0 1px var(--c-
|
|
469
|
+
box-shadow: 0 0 0 1px var(--c-line2);
|
|
475
470
|
overflow-x: auto;
|
|
476
|
-
line-height: 1.
|
|
471
|
+
line-height: 1.6;
|
|
477
472
|
}
|
|
478
473
|
.ec-msg pre code,
|
|
479
474
|
.ec-doc pre code { padding: 0; background: none; box-shadow: none; white-space: pre; }
|
|
475
|
+
.ec-code { border-radius: 12px; overflow: hidden; background: var(--c-inset); box-shadow: 0 0 0 1px var(--c-line2); }
|
|
476
|
+
.ec-code pre { margin: 0; border-radius: 0; box-shadow: none; }
|
|
477
|
+
.ec-code-head { display: flex; justify-content: flex-end; padding: 2px 4px; border-bottom: 1px solid var(--c-line); }
|
|
478
|
+
.ec-code-copy {
|
|
479
|
+
height: 32px;
|
|
480
|
+
padding: 0 10px;
|
|
481
|
+
border-radius: 9px;
|
|
482
|
+
font-size: 12.5px;
|
|
483
|
+
font-weight: 500;
|
|
484
|
+
color: var(--c-ink2);
|
|
485
|
+
display: flex;
|
|
486
|
+
align-items: center;
|
|
487
|
+
gap: 6px;
|
|
488
|
+
transition: background-color 0.15s, color 0.15s;
|
|
489
|
+
}
|
|
490
|
+
.ec-code-copy:hover { background: var(--c-field); color: var(--c-ink); }
|
|
491
|
+
[data-copied] svg { color: var(--c-green); }
|
|
480
492
|
.ec-caret {
|
|
481
493
|
display: inline-block;
|
|
482
|
-
width:
|
|
483
|
-
height:
|
|
494
|
+
width: 7px;
|
|
495
|
+
height: 15px;
|
|
484
496
|
margin-left: 2px;
|
|
485
|
-
vertical-align: -
|
|
486
|
-
border-radius:
|
|
487
|
-
background: var(--c-
|
|
497
|
+
vertical-align: -2px;
|
|
498
|
+
border-radius: 2px;
|
|
499
|
+
background: var(--c-accent);
|
|
488
500
|
}
|
|
489
501
|
.ec-caret[data-end] { animation: ec-fade-in 0.3s 1s reverse both, ec-caret 1s; }
|
|
490
502
|
|
|
503
|
+
/* Las acciones de cada mensaje: se ven al pasar; las del \xFAltimo, siempre */
|
|
504
|
+
.ec-acts, .ec-bar { display: flex; align-items: center; gap: 2px; flex: none; }
|
|
505
|
+
.ec-bar { margin: -8px 0 -6px -8px; }
|
|
506
|
+
.ec-acts .ec-icon, .ec-bar .ec-icon { width: auto; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 10px; display: flex; gap: 5px; color: var(--c-ink3); font-size: 12px; font-weight: 600; }
|
|
507
|
+
.ec-acts .ec-icon:hover, .ec-bar .ec-icon:hover { color: var(--c-ink); }
|
|
508
|
+
.ec-bar [aria-pressed="true"] { background: var(--c-accent-tint); color: var(--c-accent); }
|
|
509
|
+
.ec-bar [data-down] svg { transform: rotate(180deg); }
|
|
510
|
+
.ec-acts, .ec-bar { opacity: 0; transition: opacity 0.14s ease; }
|
|
511
|
+
.ec-u:hover .ec-acts, .ec-acts:focus-within, .ec-bar:hover, .ec-bar:focus-within, .ec-bar[data-on], :hover + .ec-bar { opacity: 1; }
|
|
512
|
+
@media (hover: none) { .ec-acts, .ec-bar { opacity: 1; } }
|
|
513
|
+
.ec-fail { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--c-red); }
|
|
514
|
+
.ec-fail span { font-weight: 600; }
|
|
515
|
+
.ec-fail .ec-btn { height: 32px; margin-left: 2px; padding: 0 10px; font-size: 12.5px; }
|
|
516
|
+
.ec-stopped { margin: -4px 0 0; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--c-ink3); }
|
|
517
|
+
.ec-stopped i { width: 8px; height: 8px; border-radius: 2px; background: currentColor; }
|
|
518
|
+
.ec-regen { height: 32px; padding: 0 8px; margin-left: -4px; border-radius: 9px; color: var(--c-accent); font-weight: 600; }
|
|
519
|
+
.ec-regen::before { content: '\\00b7'; margin-right: 8px; color: var(--c-ink3); }
|
|
520
|
+
.ec-regen:hover { background: var(--c-accent-tint); }
|
|
521
|
+
.ec-bar .ec-regen { margin: 0; color: var(--c-ink3); }
|
|
522
|
+
.ec-bar .ec-regen::before { content: none; }
|
|
523
|
+
.ec-jump {
|
|
524
|
+
position: relative;
|
|
525
|
+
z-index: 1;
|
|
526
|
+
align-self: center;
|
|
527
|
+
margin: -46px 0 12px;
|
|
528
|
+
height: 34px;
|
|
529
|
+
padding: 0 13px 0 10px;
|
|
530
|
+
border-radius: 999px;
|
|
531
|
+
background: var(--c-surface);
|
|
532
|
+
box-shadow: 0 0 0 1px var(--c-line2), var(--c-shadow);
|
|
533
|
+
display: flex;
|
|
534
|
+
align-items: center;
|
|
535
|
+
gap: 6px;
|
|
536
|
+
font-size: 12.5px;
|
|
537
|
+
font-weight: 600;
|
|
538
|
+
animation: ec-fade-up 0.18s ease both;
|
|
539
|
+
}
|
|
540
|
+
.ec-jump svg { transform: rotate(180deg); }
|
|
541
|
+
|
|
491
542
|
.ec-suggest { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
492
543
|
.ec-chip {
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
544
|
+
min-height: 32px;
|
|
545
|
+
padding: 7px 12px;
|
|
546
|
+
border-radius: 999px;
|
|
547
|
+
font-size: 13px;
|
|
496
548
|
text-align: left;
|
|
497
549
|
background: var(--c-surface);
|
|
498
550
|
box-shadow: 0 0 0 1px var(--c-line2);
|
|
499
551
|
animation: ec-fade-up 0.3s var(--c-ease) both;
|
|
500
552
|
transition: background-color 0.15s;
|
|
501
553
|
}
|
|
502
|
-
.ec-chip:hover { background: var(--c-
|
|
554
|
+
.ec-chip:hover { background: var(--c-field); }
|
|
503
555
|
|
|
504
556
|
.ec-thinking {
|
|
505
557
|
display: flex;
|
|
506
558
|
align-items: center;
|
|
507
559
|
gap: 8px;
|
|
560
|
+
font-size: 13.5px;
|
|
508
561
|
color: var(--c-ink2);
|
|
509
562
|
animation: ec-fade-in 0.2s 0.15s both;
|
|
510
563
|
}
|
|
511
|
-
.ec-thinking[hidden] { display: none; }
|
|
512
564
|
.ec-dots { display: flex; gap: 3px; }
|
|
513
565
|
.ec-dots i {
|
|
514
566
|
width: 5px;
|
|
515
567
|
height: 5px;
|
|
516
568
|
border-radius: 999px;
|
|
517
|
-
background: var(--c-
|
|
518
|
-
opacity: 0.6;
|
|
569
|
+
background: var(--c-accent);
|
|
519
570
|
animation: ec-pulse 1.1s ease-in-out infinite;
|
|
520
571
|
}
|
|
521
572
|
.ec-dots i:nth-child(2) { animation-delay: 0.15s; }
|
|
@@ -528,12 +579,12 @@ svg { display: block; flex: none; }
|
|
|
528
579
|
animation: ec-shimmer 1.4s linear infinite;
|
|
529
580
|
}
|
|
530
581
|
.ec-time, .ec-mono { font-family: var(--c-mono); font-size: 11.5px; font-variant-numeric: tabular-nums; }
|
|
582
|
+
.ec-time { color: var(--c-ink3); }
|
|
531
583
|
|
|
532
584
|
/* Las acciones */
|
|
533
585
|
.ec-tools {
|
|
534
|
-
border-radius:
|
|
535
|
-
|
|
536
|
-
background: var(--c-surface);
|
|
586
|
+
border-radius: 12px;
|
|
587
|
+
background: var(--c-field);
|
|
537
588
|
animation: ec-fade-up 0.3s var(--c-ease) both;
|
|
538
589
|
}
|
|
539
590
|
.ec-tools-head {
|
|
@@ -542,11 +593,10 @@ svg { display: block; flex: none; }
|
|
|
542
593
|
align-items: center;
|
|
543
594
|
gap: 6px;
|
|
544
595
|
padding: 8px 10px;
|
|
545
|
-
font-size:
|
|
596
|
+
font-size: 13px;
|
|
546
597
|
color: var(--c-ink2);
|
|
547
|
-
border-radius:
|
|
598
|
+
border-radius: 12px 12px 0 0;
|
|
548
599
|
}
|
|
549
|
-
.ec-tools-head[hidden] { display: none; }
|
|
550
600
|
.ec-tools-head:hover { color: var(--c-ink); }
|
|
551
601
|
.ec-chev { color: var(--c-ink2); transition: transform 0.2s var(--c-ease); }
|
|
552
602
|
[aria-expanded="true"] > .ec-chev { transform: rotate(90deg); }
|
|
@@ -555,48 +605,49 @@ svg { display: block; flex: none; }
|
|
|
555
605
|
.ec-fold > * { min-height: 0; overflow: hidden; }
|
|
556
606
|
.ec-tool { animation: ec-fade-up 0.3s var(--c-ease) both; }
|
|
557
607
|
.ec-tool + .ec-tool,
|
|
558
|
-
.ec-tools-head:not([hidden]) + .ec-fold .ec-tool:first-child { border-top: 1px solid var(--c-
|
|
608
|
+
.ec-tools-head:not([hidden]) + .ec-fold .ec-tool:first-child { border-top: 1px solid var(--c-line2); }
|
|
559
609
|
.ec-tool-row {
|
|
560
610
|
width: 100%;
|
|
611
|
+
min-height: 38px;
|
|
561
612
|
display: flex;
|
|
562
613
|
align-items: center;
|
|
563
614
|
gap: 8px;
|
|
564
|
-
padding: 8px 10px;
|
|
615
|
+
padding: 8px 10px 8px 11px;
|
|
616
|
+
font-size: 13px;
|
|
565
617
|
text-align: left;
|
|
566
|
-
transition: background-color 0.15s;
|
|
567
618
|
}
|
|
568
|
-
.ec-
|
|
569
|
-
.ec-tool:first-child .ec-tool-row { border-radius: 10px 10px 0 0; }
|
|
570
|
-
.ec-tool-row[hidden] { display: none; }
|
|
571
|
-
.ec-state { width: 16px; height: 16px; display: grid; place-items: center; flex: none; }
|
|
619
|
+
.ec-state { width: 18px; height: 18px; display: grid; place-items: center; flex: none; }
|
|
572
620
|
.ec-spin {
|
|
573
|
-
width:
|
|
574
|
-
height:
|
|
621
|
+
width: 18px;
|
|
622
|
+
height: 18px;
|
|
575
623
|
border-radius: 999px;
|
|
576
|
-
border: 2px solid var(--c-
|
|
577
|
-
border-top-color: var(--c-
|
|
624
|
+
border: 2px solid var(--c-accent-line);
|
|
625
|
+
border-top-color: var(--c-accent);
|
|
578
626
|
animation: ec-spin 0.8s linear infinite;
|
|
579
627
|
}
|
|
580
|
-
.ec-state svg { width:
|
|
581
|
-
.ec-tool[data-state="done"] .ec-state svg { background: var(--c-green); color:
|
|
582
|
-
.ec-tool[data-state="error"] .ec-state svg { background: var(--c-red); color:
|
|
583
|
-
.ec-tool[data-state="declined"] .ec-state svg { background: var(--c-
|
|
628
|
+
.ec-state svg { width: 18px; height: 18px; padding: 3px; border-radius: 999px; animation: ec-pop-in 0.25s var(--c-ease) both; }
|
|
629
|
+
.ec-tool[data-state="done"] .ec-state svg { background: var(--c-green); color: var(--c-on-accent); stroke-width: 3.5; }
|
|
630
|
+
.ec-tool[data-state="error"] .ec-state svg { background: var(--c-red); color: var(--c-on-accent); stroke-width: 3.5; }
|
|
631
|
+
.ec-tool[data-state="declined"] .ec-state svg { background: var(--c-ink3); color: var(--c-surface); stroke-width: 3.5; }
|
|
584
632
|
.ec-tool-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
585
633
|
.ec-pill {
|
|
586
634
|
flex: none;
|
|
587
|
-
font-size:
|
|
588
|
-
font-weight:
|
|
589
|
-
padding: 1px
|
|
590
|
-
border-radius:
|
|
591
|
-
background: var(--c-
|
|
635
|
+
font-size: 11.5px;
|
|
636
|
+
font-weight: 600;
|
|
637
|
+
padding: 1px 8px;
|
|
638
|
+
border-radius: 999px;
|
|
639
|
+
background: var(--c-line);
|
|
592
640
|
color: var(--c-ink2);
|
|
593
641
|
}
|
|
594
|
-
.ec-tool[data-state="
|
|
595
|
-
.ec-tool[data-state="
|
|
596
|
-
.ec-
|
|
597
|
-
.ec-
|
|
642
|
+
.ec-tool[data-state="running"] .ec-pill, .ec-pill[data-tone="accent"] { background: var(--c-accent-tint); color: var(--c-accent); }
|
|
643
|
+
.ec-tool[data-state="done"] .ec-pill, .ec-pill[data-tone="good"] { background: var(--c-green-tint); color: var(--c-green); }
|
|
644
|
+
.ec-tool[data-state="error"] .ec-pill { background: var(--c-red-tint); color: var(--c-red); }
|
|
645
|
+
.ec-pill[data-tone="warn"] { background: var(--c-warn-tint); color: var(--c-warn); }
|
|
646
|
+
.ec-detail { font-size: 12.5px; color: var(--c-ink3); }
|
|
647
|
+
.ec-detail > div > p { margin: 0; padding: 0 11px 4px 37px; overflow-wrap: anywhere; }
|
|
598
648
|
.ec-detail > div > p:last-child { padding-bottom: 10px; }
|
|
599
|
-
.ec-detail b { font-weight:
|
|
649
|
+
.ec-detail b { font-weight: 400; margin-right: 12px; }
|
|
650
|
+
.ec-detail span { color: var(--c-ink); }
|
|
600
651
|
|
|
601
652
|
/* La tarjeta de confirmaci\xF3n */
|
|
602
653
|
.ec-sr {
|
|
@@ -612,129 +663,144 @@ svg { display: block; flex: none; }
|
|
|
612
663
|
.ec-card:focus { outline: 2px solid var(--c-accent); outline-offset: 2px; }
|
|
613
664
|
.ec-card {
|
|
614
665
|
margin: 8px;
|
|
615
|
-
padding:
|
|
616
|
-
border-radius:
|
|
666
|
+
padding: 14px;
|
|
667
|
+
border-radius: 16px;
|
|
617
668
|
background: var(--c-surface);
|
|
618
|
-
box-shadow: 0 0 0 1px var(--c-
|
|
619
|
-
animation: ec-fade-up 0.
|
|
669
|
+
box-shadow: 0 0 0 1px var(--c-accent-line), var(--c-shadow);
|
|
670
|
+
animation: ec-fade-up 0.25s ease both;
|
|
620
671
|
}
|
|
621
672
|
.ec-card p { margin: 0 0 8px; overflow-wrap: anywhere; }
|
|
622
|
-
.ec-card-title { font-size:
|
|
623
|
-
.ec-card-what { font-weight:
|
|
673
|
+
.ec-card-title { font-size: 12.5px; color: var(--c-ink2); }
|
|
674
|
+
.ec-card-what { font-size: 14.5px; font-weight: 600; }
|
|
624
675
|
.ec-card-value {
|
|
625
676
|
white-space: pre-wrap;
|
|
626
677
|
font-family: var(--c-mono);
|
|
627
|
-
font-size:
|
|
678
|
+
font-size: 12.5px;
|
|
628
679
|
padding: 8px 10px;
|
|
629
|
-
border-radius:
|
|
680
|
+
border-radius: 10px;
|
|
630
681
|
background: var(--c-inset);
|
|
631
|
-
box-shadow: 0 0 0 1px var(--c-
|
|
682
|
+
box-shadow: 0 0 0 1px var(--c-line);
|
|
632
683
|
}
|
|
633
|
-
.ec-actions { display: flex; flex-wrap: wrap; gap:
|
|
634
|
-
.ec-actions .ec-btn { flex: 1 1 auto; }
|
|
684
|
+
.ec-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
|
|
635
685
|
.ec-btn {
|
|
636
|
-
height:
|
|
637
|
-
padding: 0
|
|
638
|
-
border-radius:
|
|
639
|
-
font-
|
|
686
|
+
height: 36px;
|
|
687
|
+
padding: 0 14px;
|
|
688
|
+
border-radius: 11px;
|
|
689
|
+
font-size: 13.5px;
|
|
690
|
+
font-weight: 600;
|
|
640
691
|
color: var(--c-ink);
|
|
692
|
+
background: var(--c-surface);
|
|
641
693
|
box-shadow: 0 0 0 1px var(--c-line2);
|
|
642
694
|
transition: background-color 0.15s, transform 0.1s;
|
|
643
695
|
}
|
|
644
|
-
.ec-btn:hover { background: var(--c-
|
|
696
|
+
.ec-btn:hover { background: var(--c-field); }
|
|
645
697
|
.ec-btn:active { transform: scale(0.96); }
|
|
646
|
-
.ec-btn[data-primary] { background: var(--c-
|
|
647
|
-
.ec-btn[data-primary]:hover {
|
|
698
|
+
.ec-btn[data-primary] { background: var(--c-accent); color: var(--c-on-accent); box-shadow: none; }
|
|
699
|
+
.ec-btn[data-primary]:hover { filter: brightness(1.06); }
|
|
648
700
|
|
|
649
|
-
.ec-
|
|
650
|
-
|
|
651
|
-
|
|
701
|
+
.ec-alert {
|
|
702
|
+
display: flex;
|
|
703
|
+
gap: 10px;
|
|
704
|
+
align-items: flex-start;
|
|
705
|
+
padding: 12px;
|
|
706
|
+
border-radius: 14px;
|
|
652
707
|
background: var(--c-red-tint);
|
|
653
|
-
color: var(--c-red
|
|
654
|
-
animation: ec-fade-up 0.
|
|
655
|
-
}
|
|
656
|
-
.ec-
|
|
657
|
-
.ec-
|
|
708
|
+
color: var(--c-red);
|
|
709
|
+
animation: ec-fade-up 0.25s ease both;
|
|
710
|
+
}
|
|
711
|
+
.ec-alert[data-tone="warn"] { background: var(--c-warn-tint); color: var(--c-warn); }
|
|
712
|
+
.ec-alert > svg { width: 28px; height: 28px; padding: 6px; border-radius: 999px; background: var(--c-surface); }
|
|
713
|
+
.ec-alert > div { flex: 1; min-width: 0; color: var(--c-ink2); font-size: 13px; }
|
|
714
|
+
.ec-alert .ec-btn { height: 32px; margin: 8px 8px 0 0; padding: 0 12px; font-size: 13px; }
|
|
715
|
+
.ec-error p { margin: 3px 0 0; overflow-wrap: anywhere; }
|
|
658
716
|
|
|
659
717
|
/* La cola: lo que la persona escribi\xF3 mientras el asistente trabajaba */
|
|
660
718
|
.ec-queue {
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
719
|
+
width: calc(100% - 24px);
|
|
720
|
+
max-width: 680px;
|
|
721
|
+
margin: 0 auto 8px;
|
|
722
|
+
border-radius: 14px;
|
|
723
|
+
background: var(--c-surface);
|
|
724
|
+
box-shadow: 0 0 0 1px var(--c-line2), var(--c-shadow);
|
|
725
|
+
overflow: hidden;
|
|
726
|
+
animation: ec-fade-up 0.2s ease both;
|
|
667
727
|
}
|
|
668
|
-
.ec-queue
|
|
669
|
-
.ec-queue-head { display: flex; align-items: center; gap: 6px; min-height: 26px; padding-left: 8px; font-size: 12px; color: var(--c-ink2); }
|
|
728
|
+
.ec-queue-head { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 4px 4px 12px; font-size: 13px; font-weight: 600; }
|
|
670
729
|
.ec-queue-head p { flex: 1; margin: 0; }
|
|
671
|
-
.ec-queue-head .ec-btn { height:
|
|
672
|
-
.ec-
|
|
673
|
-
.ec-q
|
|
674
|
-
.ec-q-
|
|
730
|
+
.ec-queue-head .ec-btn { height: 32px; padding: 0 11px; font-size: 12.5px; box-shadow: none; background: var(--c-accent-tint); color: var(--c-accent); }
|
|
731
|
+
.ec-queue-head .ec-btn + .ec-btn { background: none; color: var(--c-ink2); }
|
|
732
|
+
.ec-q { display: flex; align-items: center; gap: 2px; padding: 2px 4px 2px 12px; border-top: 1px solid var(--c-line); }
|
|
733
|
+
.ec-q .ec-icon { width: 32px; height: 32px; border-radius: 10px; color: var(--c-ink3); }
|
|
734
|
+
.ec-q-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
|
|
675
735
|
.ec-queue[data-paused] .ec-q-text { color: var(--c-ink2); }
|
|
676
736
|
|
|
677
737
|
/* El compositor */
|
|
678
|
-
.ec-form { padding:
|
|
738
|
+
.ec-form { padding: 10px 12px 12px; }
|
|
739
|
+
.ec-form > * { max-width: 680px; margin-inline: auto; }
|
|
679
740
|
.ec-field {
|
|
680
741
|
display: flex;
|
|
681
742
|
align-items: flex-end;
|
|
682
743
|
gap: 8px;
|
|
683
|
-
padding:
|
|
684
|
-
border-radius:
|
|
744
|
+
padding: 6px 6px 6px 14px;
|
|
745
|
+
border-radius: 14px;
|
|
685
746
|
background: var(--c-field);
|
|
686
|
-
box-shadow: 0 0 0 1px var(--c-
|
|
747
|
+
box-shadow: 0 0 0 1px var(--c-line2);
|
|
687
748
|
transition: box-shadow 0.15s;
|
|
688
749
|
}
|
|
689
|
-
.ec-field:focus-within { box-shadow: 0 0 0 1px var(--c-
|
|
750
|
+
.ec-field:focus-within { box-shadow: 0 0 0 1px var(--c-accent); }
|
|
690
751
|
.ec-input {
|
|
691
752
|
flex: 1;
|
|
753
|
+
min-width: 0;
|
|
692
754
|
resize: none;
|
|
693
755
|
border: 0;
|
|
694
756
|
outline: 0;
|
|
695
|
-
padding:
|
|
757
|
+
padding: 7px 0;
|
|
696
758
|
font: inherit;
|
|
697
|
-
line-height:
|
|
759
|
+
line-height: 20px;
|
|
698
760
|
color: var(--c-ink);
|
|
699
761
|
background: transparent;
|
|
700
|
-
min-height:
|
|
762
|
+
min-height: 34px;
|
|
701
763
|
max-height: 120px;
|
|
702
764
|
}
|
|
703
765
|
.ec-input:focus-visible { outline: 0; }
|
|
704
|
-
.ec-input::placeholder { color: var(--c-
|
|
766
|
+
.ec-input::placeholder { color: var(--c-ink3); }
|
|
705
767
|
.ec-send {
|
|
706
|
-
width:
|
|
707
|
-
height:
|
|
708
|
-
border-radius:
|
|
768
|
+
width: 34px;
|
|
769
|
+
height: 34px;
|
|
770
|
+
border-radius: 10px;
|
|
709
771
|
display: grid;
|
|
710
772
|
place-items: center;
|
|
711
|
-
background: var(--c-
|
|
712
|
-
color: var(--c-on-
|
|
773
|
+
background: var(--c-accent);
|
|
774
|
+
color: var(--c-on-accent);
|
|
713
775
|
transition: opacity 0.15s, transform 0.1s;
|
|
714
776
|
}
|
|
777
|
+
.ec-send[data-stop] { background: var(--c-ink); color: var(--c-on-ink); }
|
|
715
778
|
.ec-send:active { transform: scale(0.96); }
|
|
716
|
-
.ec-send:disabled { opacity: 0.
|
|
717
|
-
.ec-send i { width:
|
|
779
|
+
.ec-send:disabled { opacity: 0.45; cursor: default; transform: none; }
|
|
780
|
+
.ec-send i { width: 12px; height: 12px; border-radius: 3px; background: currentColor; }
|
|
781
|
+
.ec-hint { display: none; justify-content: space-between; gap: 10px; margin-block: 0; padding: 6px 4px 0; font-size: 11.5px; color: var(--c-ink3); }
|
|
782
|
+
.ec-form:focus-within .ec-hint, .ec-form[data-typed] .ec-hint { display: flex; }
|
|
718
783
|
|
|
719
784
|
/* Lo que el asistente puede hacer */
|
|
720
785
|
.ec-pop {
|
|
721
786
|
position: absolute;
|
|
722
|
-
top:
|
|
723
|
-
|
|
724
|
-
|
|
787
|
+
top: 58px;
|
|
788
|
+
right: 10px;
|
|
789
|
+
width: 320px;
|
|
790
|
+
max-width: calc(100% - 20px);
|
|
725
791
|
max-height: calc(100% - 70px);
|
|
726
792
|
overflow-y: auto;
|
|
727
793
|
z-index: 2;
|
|
728
|
-
padding:
|
|
729
|
-
border-radius:
|
|
794
|
+
padding: 8px;
|
|
795
|
+
border-radius: 16px;
|
|
730
796
|
background: var(--c-surface);
|
|
731
797
|
box-shadow: var(--c-overlay);
|
|
732
|
-
transform-origin: top
|
|
798
|
+
transform-origin: top right;
|
|
733
799
|
transition: opacity 0.18s var(--c-ease), transform 0.18s var(--c-ease), display 0.18s allow-discrete;
|
|
734
800
|
}
|
|
735
801
|
.ec-pop[hidden] { display: none; opacity: 0; transform: scale(0.96); }
|
|
736
802
|
@starting-style { .ec-pop { opacity: 0; transform: scale(0.95); } }
|
|
737
|
-
.ec-pop-title { margin: 0; padding: 6px 10px
|
|
803
|
+
.ec-pop-title { margin: 0; padding: 6px 10px; font-size: 14.5px; font-weight: 600; }
|
|
738
804
|
.ec-opts { position: relative; }
|
|
739
805
|
.ec-glide {
|
|
740
806
|
position: absolute;
|
|
@@ -742,8 +808,8 @@ svg { display: block; flex: none; }
|
|
|
742
808
|
right: 0;
|
|
743
809
|
top: 0;
|
|
744
810
|
height: 0;
|
|
745
|
-
border-radius:
|
|
746
|
-
background: var(--c-
|
|
811
|
+
border-radius: 10px;
|
|
812
|
+
background: var(--c-field);
|
|
747
813
|
opacity: 0;
|
|
748
814
|
transition: top 0.22s var(--c-ease), height 0.22s var(--c-ease), opacity 0.15s;
|
|
749
815
|
}
|
|
@@ -763,17 +829,17 @@ svg { display: block; flex: none; }
|
|
|
763
829
|
background: var(--c-field);
|
|
764
830
|
color: var(--c-ink2);
|
|
765
831
|
}
|
|
766
|
-
.ec-opt-name { margin: 0; font-weight:
|
|
832
|
+
.ec-opt-name { margin: 0; font-size: 13.5px; font-weight: 600; }
|
|
767
833
|
.ec-opt-desc { margin: 1px 0 0; font-size: 12px; color: var(--c-ink2); }
|
|
768
|
-
.ec-ask { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size:
|
|
834
|
+
.ec-ask { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; color: var(--c-ink2); }
|
|
769
835
|
.ec-opt[data-off] .ec-ask { opacity: 0.45; }
|
|
770
|
-
.ec-pop-hint { margin: 4px 0 0; padding: 8px 10px 4px; border-top: 1px solid var(--c-
|
|
836
|
+
.ec-pop-hint { margin: 4px 0 0; padding: 8px 10px 4px; border-top: 1px solid var(--c-line); font-size: 12px; color: var(--c-ink2); }
|
|
771
837
|
.ec-switch {
|
|
772
838
|
position: relative;
|
|
773
|
-
width:
|
|
774
|
-
height:
|
|
839
|
+
width: 36px;
|
|
840
|
+
height: 20px;
|
|
775
841
|
border-radius: 999px;
|
|
776
|
-
background: var(--c-
|
|
842
|
+
background: var(--c-ink3);
|
|
777
843
|
flex: none;
|
|
778
844
|
transition: background-color 0.2s var(--c-ease);
|
|
779
845
|
}
|
|
@@ -782,195 +848,201 @@ svg { display: block; flex: none; }
|
|
|
782
848
|
position: absolute;
|
|
783
849
|
top: 2px;
|
|
784
850
|
left: 2px;
|
|
785
|
-
width:
|
|
786
|
-
height:
|
|
851
|
+
width: 16px;
|
|
852
|
+
height: 16px;
|
|
787
853
|
border-radius: 999px;
|
|
788
|
-
background:
|
|
789
|
-
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.
|
|
854
|
+
background: var(--c-surface);
|
|
855
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
|
|
790
856
|
transition: transform 0.2s var(--c-ease);
|
|
791
857
|
}
|
|
792
858
|
.ec-switch[aria-checked="true"] { background: var(--c-accent); }
|
|
793
|
-
.ec-switch[aria-checked="true"]::after { transform: translateX(
|
|
859
|
+
.ec-switch[aria-checked="true"]::after { transform: translateX(16px); }
|
|
794
860
|
.ec-switch:disabled { cursor: default; }
|
|
795
861
|
|
|
796
862
|
/* Las secciones: cada vista llena el panel y la barra va abajo */
|
|
797
863
|
.ec-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
|
|
798
|
-
.ec-
|
|
799
|
-
.ec-page { overflow-y: auto; padding: 16px; gap: 12px; scrollbar-width: thin; }
|
|
864
|
+
.ec-page { overflow-y: auto; padding: 14px; gap: 12px; background: var(--c-page); scrollbar-width: thin; }
|
|
800
865
|
.ec-page > * { flex: none; }
|
|
801
866
|
.ec-tabs {
|
|
802
867
|
display: grid;
|
|
803
868
|
grid-auto-flow: column;
|
|
804
869
|
grid-auto-columns: 1fr;
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
border-top: 1px solid var(--c-hair);
|
|
870
|
+
padding: 6px 6px 8px;
|
|
871
|
+
border-top: 1px solid var(--c-line);
|
|
808
872
|
}
|
|
809
|
-
.ec-tabs[hidden] { display: none; }
|
|
810
873
|
.ec-tab {
|
|
874
|
+
position: relative;
|
|
875
|
+
height: 54px;
|
|
811
876
|
display: flex;
|
|
812
877
|
flex-direction: column;
|
|
813
878
|
align-items: center;
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
border-radius:
|
|
879
|
+
justify-content: center;
|
|
880
|
+
gap: 3px;
|
|
881
|
+
border-radius: 13px;
|
|
817
882
|
font-size: 11.5px;
|
|
818
883
|
font-weight: 500;
|
|
819
884
|
color: var(--c-ink2);
|
|
820
|
-
transition:
|
|
885
|
+
transition: color 0.15s;
|
|
821
886
|
}
|
|
822
|
-
.ec-tab {
|
|
887
|
+
.ec-tab svg { width: 48px; height: 28px; padding: 5px 15px; border-radius: 999px; transition: background-color 0.15s; }
|
|
823
888
|
.ec-tab:hover { color: var(--c-ink); }
|
|
889
|
+
.ec-tab[aria-current="page"] { color: var(--c-accent); font-weight: 600; }
|
|
890
|
+
.ec-tab[aria-current="page"] svg { background: var(--c-accent-tint); }
|
|
824
891
|
.ec-count {
|
|
825
892
|
position: absolute;
|
|
826
|
-
top:
|
|
827
|
-
left: calc(50% +
|
|
893
|
+
top: 3px;
|
|
894
|
+
left: calc(50% + 6px);
|
|
828
895
|
min-width: 16px;
|
|
829
896
|
padding: 0 4px;
|
|
830
897
|
border-radius: 999px;
|
|
831
|
-
font-size:
|
|
832
|
-
line-height:
|
|
833
|
-
font-weight:
|
|
898
|
+
font-size: 10px;
|
|
899
|
+
line-height: 12px;
|
|
900
|
+
font-weight: 700;
|
|
834
901
|
background: var(--c-accent);
|
|
835
|
-
color:
|
|
902
|
+
color: var(--c-on-accent);
|
|
903
|
+
border: 2px solid var(--c-surface);
|
|
836
904
|
}
|
|
837
|
-
.ec-
|
|
838
|
-
.ec-hello { margin: 6px 2px 4px; font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
|
|
905
|
+
.ec-hello { margin: 8px 2px 6px; font-size: 27px; font-weight: 600; line-height: 1.15; letter-spacing: -0.025em; }
|
|
839
906
|
.ec-hello span { display: block; }
|
|
840
|
-
.ec-hello span + span { color: var(--c-
|
|
841
|
-
.ec-h { margin: 0; font-size:
|
|
907
|
+
.ec-hello span + span { color: var(--c-ink3); }
|
|
908
|
+
.ec-h { margin: 0; font-size: 21px; font-weight: 600; line-height: 1.3; letter-spacing: -0.02em; }
|
|
842
909
|
.ec-box {
|
|
843
910
|
display: flex;
|
|
844
911
|
flex-direction: column;
|
|
845
|
-
gap:
|
|
846
|
-
padding:
|
|
847
|
-
border-radius:
|
|
912
|
+
gap: 10px;
|
|
913
|
+
padding: 14px;
|
|
914
|
+
border-radius: 18px;
|
|
848
915
|
background: var(--c-surface);
|
|
849
|
-
box-shadow: 0 0 0 1px var(--c-
|
|
916
|
+
box-shadow: 0 0 0 1px var(--c-line2), var(--c-shadow);
|
|
850
917
|
animation: ec-fade-up 0.3s var(--c-ease) both;
|
|
851
918
|
}
|
|
852
919
|
.ec-box-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
|
|
853
|
-
.ec-box-title { margin: 0; font-size:
|
|
854
|
-
.ec-box-sub { margin: -
|
|
855
|
-
.ec-muted { margin: 0; font-size: 12px; color: var(--c-
|
|
920
|
+
.ec-box-title { margin: 0; font-size: 15px; font-weight: 600; }
|
|
921
|
+
.ec-box-sub { margin: -8px 0 0; font-size: 13px; color: var(--c-ink2); }
|
|
922
|
+
.ec-muted { margin: 0; font-size: 12px; color: var(--c-ink3); }
|
|
856
923
|
.ec-fake {
|
|
857
924
|
display: flex;
|
|
858
925
|
align-items: center;
|
|
859
926
|
gap: 8px;
|
|
860
|
-
height:
|
|
861
|
-
padding: 0 6px 0
|
|
862
|
-
border-radius:
|
|
927
|
+
height: 42px;
|
|
928
|
+
padding: 0 6px 0 14px;
|
|
929
|
+
border-radius: 12px;
|
|
863
930
|
text-align: left;
|
|
864
|
-
color: var(--c-
|
|
931
|
+
color: var(--c-ink3);
|
|
865
932
|
background: var(--c-field);
|
|
866
|
-
box-shadow: 0 0 0 1px var(--c-line);
|
|
867
933
|
transition: box-shadow 0.15s;
|
|
868
934
|
}
|
|
869
935
|
.ec-fake > span { flex: 1; }
|
|
870
|
-
.ec-fake:hover { box-shadow: 0 0 0 1px var(--c-
|
|
871
|
-
.ec-fake-go { width:
|
|
936
|
+
.ec-fake:hover { box-shadow: 0 0 0 1px var(--c-accent-line); }
|
|
937
|
+
.ec-fake-go { width: 30px; height: 30px; padding: 8px; border-radius: 9px; background: var(--c-accent); color: var(--c-on-accent); }
|
|
872
938
|
.ec-stack { display: flex; flex-direction: column; gap: 10px; }
|
|
873
939
|
.ec-list { display: flex; flex-direction: column; margin: 0 -6px; }
|
|
874
940
|
.ec-row {
|
|
875
941
|
display: flex;
|
|
876
942
|
align-items: center;
|
|
877
943
|
gap: 10px;
|
|
878
|
-
padding:
|
|
879
|
-
border-radius:
|
|
944
|
+
padding: 11px 12px;
|
|
945
|
+
border-radius: 12px;
|
|
880
946
|
text-align: left;
|
|
881
947
|
transition: background-color 0.15s;
|
|
882
948
|
}
|
|
883
|
-
.ec-row:hover { background: var(--c-
|
|
949
|
+
.ec-row:hover { background: var(--c-field); }
|
|
884
950
|
.ec-row-main { flex: 1; min-width: 0; }
|
|
885
951
|
.ec-row-main > span { display: block; overflow: hidden; text-overflow: ellipsis; }
|
|
886
|
-
.ec-row-title {
|
|
887
|
-
.ec-row-sub { font-size:
|
|
888
|
-
.ec-row-aside, .ec-kicker { font-size:
|
|
889
|
-
.ec-kicker { margin: 4px 0 -
|
|
952
|
+
.ec-row-title { white-space: nowrap; }
|
|
953
|
+
.ec-row-sub { font-size: 12.5px; color: var(--c-ink2); display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
|
|
954
|
+
.ec-row-aside, .ec-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--c-ink3); }
|
|
955
|
+
.ec-kicker { margin: 4px 0 -6px; }
|
|
890
956
|
.ec-search {
|
|
891
957
|
display: flex;
|
|
892
958
|
align-items: center;
|
|
893
|
-
gap:
|
|
894
|
-
height:
|
|
959
|
+
gap: 10px;
|
|
960
|
+
height: 44px;
|
|
895
961
|
padding: 0 14px;
|
|
896
962
|
border-radius: 999px;
|
|
897
|
-
color: var(--c-
|
|
963
|
+
color: var(--c-ink3);
|
|
898
964
|
background: var(--c-field);
|
|
899
|
-
box-shadow: 0 0 0 1px var(--c-
|
|
965
|
+
box-shadow: 0 0 0 1px var(--c-line2);
|
|
900
966
|
transition: box-shadow 0.15s;
|
|
901
967
|
}
|
|
902
|
-
.ec-search:focus-within { box-shadow: 0 0 0 1px var(--c-
|
|
968
|
+
.ec-search:focus-within { box-shadow: 0 0 0 1px var(--c-accent); }
|
|
903
969
|
.ec-search input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 0; font: inherit; color: var(--c-ink); background: transparent; }
|
|
904
|
-
.ec-search input::placeholder { color: var(--c-
|
|
970
|
+
.ec-search input::placeholder { color: var(--c-ink3); }
|
|
971
|
+
.ec-skels { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 18px; background: var(--c-surface); box-shadow: 0 0 0 1px var(--c-line2); }
|
|
972
|
+
.ec-skel { display: block; height: 12px; border-radius: 8px; background: linear-gradient(90deg, var(--c-skel) 25%, var(--c-skel-hi) 50%, var(--c-skel) 75%) 0 0 / 200% 100%; animation: ec-shimmer 1.4s linear infinite; }
|
|
905
973
|
/* Tickets */
|
|
906
974
|
.ec-filters { display: flex; gap: 6px; }
|
|
907
975
|
.ec-filter {
|
|
908
|
-
height:
|
|
909
|
-
padding: 0
|
|
976
|
+
height: 34px;
|
|
977
|
+
padding: 0 14px;
|
|
910
978
|
border-radius: 999px;
|
|
911
|
-
font-size:
|
|
912
|
-
font-weight:
|
|
979
|
+
font-size: 13px;
|
|
980
|
+
font-weight: 600;
|
|
913
981
|
color: var(--c-ink2);
|
|
982
|
+
background: var(--c-surface);
|
|
914
983
|
box-shadow: 0 0 0 1px var(--c-line2);
|
|
915
984
|
transition: background-color 0.15s, color 0.15s;
|
|
916
985
|
}
|
|
917
|
-
.ec-filter:hover { background: var(--c-
|
|
918
|
-
.ec-filter[aria-pressed="true"] { background: var(--c-accent); color:
|
|
919
|
-
.ec-ticket { display: flex; flex-direction: column; gap:
|
|
920
|
-
article.ec-ticket { padding:
|
|
921
|
-
button.ec-ticket { margin: 0 -6px; padding: 8px 6px; border-radius:
|
|
922
|
-
button.ec-ticket:hover { background: var(--c-
|
|
986
|
+
.ec-filter:hover { background: var(--c-field); }
|
|
987
|
+
.ec-filter[aria-pressed="true"] { background: var(--c-accent); color: var(--c-on-accent); box-shadow: none; }
|
|
988
|
+
.ec-ticket { display: flex; flex-direction: column; gap: 8px; text-align: left; }
|
|
989
|
+
article.ec-ticket { padding: 14px; border-radius: 18px; background: var(--c-surface); box-shadow: 0 0 0 1px var(--c-line2); animation: ec-fade-up 0.25s ease both; }
|
|
990
|
+
button.ec-ticket { margin: 0 -6px; padding: 8px 6px; border-radius: 12px; transition: background-color 0.15s; }
|
|
991
|
+
button.ec-ticket:hover { background: var(--c-field); }
|
|
923
992
|
.ec-ticket > span { display: block; overflow: hidden; text-overflow: ellipsis; }
|
|
924
993
|
.ec-ticket .ec-tmeta { display: flex; align-items: center; gap: 8px; }
|
|
925
994
|
.ec-tmeta .ec-muted { margin-left: auto; }
|
|
926
|
-
.ec-
|
|
927
|
-
.ec-
|
|
928
|
-
.ec-pill[data-tone="good"] { background: var(--c-green-tint); color: var(--c-green-ink); }
|
|
929
|
-
.ec-ticket .ec-tfoot { display: flex; align-items: center; gap: 6px; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--c-hair); font-size: 12px; color: var(--c-ink2); }
|
|
930
|
-
.ec-note { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; color: var(--c-ink2); }
|
|
995
|
+
.ec-ticket .ec-tfoot { display: flex; align-items: center; gap: 6px; padding-top: 8px; border-top: 1px solid var(--c-line); font-size: 12.5px; color: var(--c-ink2); }
|
|
996
|
+
.ec-note { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px; border-radius: 18px; text-align: center; font-size: 13.5px; color: var(--c-ink2); box-shadow: inset 0 0 0 1px var(--c-line2); }
|
|
931
997
|
.ec-note p { margin: 0; }
|
|
932
998
|
.ec-back {
|
|
933
999
|
align-self: flex-start;
|
|
934
1000
|
display: flex;
|
|
935
1001
|
align-items: center;
|
|
936
|
-
gap:
|
|
937
|
-
height:
|
|
938
|
-
margin: -
|
|
939
|
-
padding: 0
|
|
940
|
-
border-radius:
|
|
1002
|
+
gap: 4px;
|
|
1003
|
+
height: 36px;
|
|
1004
|
+
margin: -6px 0 0 -8px;
|
|
1005
|
+
padding: 0 10px 0 6px;
|
|
1006
|
+
border-radius: 12px;
|
|
1007
|
+
font-size: 13.5px;
|
|
941
1008
|
color: var(--c-ink2);
|
|
942
1009
|
transition: background-color 0.15s, color 0.15s;
|
|
943
1010
|
}
|
|
944
|
-
.ec-back:hover { background: var(--c-
|
|
945
|
-
.ec-doc { line-height: 1.
|
|
1011
|
+
.ec-back:hover { background: var(--c-field); color: var(--c-ink); }
|
|
1012
|
+
.ec-doc { line-height: 1.55; overflow-wrap: anywhere; }
|
|
946
1013
|
.ec-doc > * { margin: 0 0 10px; }
|
|
947
1014
|
.ec-doc > :first-child { margin-top: 0; }
|
|
948
1015
|
.ec-doc > :last-child { margin-bottom: 0; }
|
|
949
|
-
.ec-doc h1, .ec-doc h2, .ec-doc h3, .ec-doc h4 { margin: 16px 0 6px; line-height: 1.
|
|
950
|
-
.ec-doc h1 { font-size:
|
|
951
|
-
.ec-doc h2 { font-size:
|
|
952
|
-
.ec-doc h3 { font-size:
|
|
953
|
-
.ec-doc h4 { font-size:
|
|
1016
|
+
.ec-doc h1, .ec-doc h2, .ec-doc h3, .ec-doc h4 { margin: 16px 0 6px; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
|
|
1017
|
+
.ec-doc h1 { font-size: 22px; }
|
|
1018
|
+
.ec-doc h2 { font-size: 17px; }
|
|
1019
|
+
.ec-doc h3 { font-size: 15px; }
|
|
1020
|
+
.ec-doc h4 { font-size: 14px; }
|
|
954
1021
|
.ec-doc ul, .ec-doc ol { padding-left: 20px; }
|
|
955
1022
|
.ec-doc li > ul, .ec-doc li > ol { margin: 2px 0; }
|
|
956
1023
|
.ec-doc strong { font-weight: 600; }
|
|
957
|
-
.ec-doc a { color: var(--c-accent
|
|
958
|
-
.ec-doc img { max-width: 100%; height: auto; border-radius:
|
|
1024
|
+
.ec-doc a { color: var(--c-accent); text-decoration: underline; text-underline-offset: 2px; }
|
|
1025
|
+
.ec-doc img { max-width: 100%; height: auto; border-radius: 12px; }
|
|
959
1026
|
.ec-doc blockquote { padding-left: 12px; border-left: 3px solid var(--c-line2); color: var(--c-ink2); }
|
|
960
1027
|
.ec-doc hr { border: 0; border-top: 1px solid var(--c-line); }
|
|
961
1028
|
.ec-table { overflow-x: auto; }
|
|
962
|
-
.ec-doc table { border-collapse: collapse; font-size:
|
|
963
|
-
.ec-doc th, .ec-doc td { padding: 6px 8px; border: 1px solid var(--c-
|
|
1029
|
+
.ec-doc table { border-collapse: collapse; font-size: 12.5px; }
|
|
1030
|
+
.ec-doc th, .ec-doc td { padding: 6px 8px; border: 1px solid var(--c-line2); text-align: left; vertical-align: top; }
|
|
964
1031
|
.ec-doc th { font-weight: 600; background: var(--c-inset); }
|
|
965
|
-
.ec-vote { padding
|
|
1032
|
+
.ec-vote { padding: 14px; border-radius: 14px; background: var(--c-field); color: var(--c-ink2); }
|
|
966
1033
|
.ec-vote:empty { display: none; }
|
|
967
1034
|
.ec-vote p { margin: 0; }
|
|
968
|
-
.ec-vote > .ec-btn { margin
|
|
1035
|
+
.ec-vote > .ec-btn { height: 34px; margin: 10px 6px 0 0; border-radius: 999px; font-weight: 400; }
|
|
1036
|
+
|
|
1037
|
+
.ec-status[hidden], .ec-icon[hidden], .ec-mi[hidden], .ec-menu[hidden], .ec-view[hidden], .ec-tabs[hidden], .ec-thinking[hidden],
|
|
1038
|
+
.ec-tools-head[hidden], .ec-tool-row[hidden], .ec-jump[hidden] { display: none; }
|
|
969
1039
|
|
|
970
1040
|
@media (max-width: 520px) {
|
|
971
|
-
.ec-panel { width: calc(100vw - 16px); max-width: none; height: min(80vh,
|
|
1041
|
+
.ec-panel { width: calc(100vw - 16px); max-width: none; height: min(80vh, 600px); max-height: calc(100vh - 88px); }
|
|
972
1042
|
:host([data-corner$="right"]) .ec-panel { right: -8px; }
|
|
973
1043
|
:host([data-corner$="left"]) .ec-panel { left: -8px; }
|
|
1044
|
+
.ec-root[data-size] .ec-panel { top: 8px; bottom: 8px; left: 0; right: 0; width: calc(100vw - 16px); height: auto; max-height: none; }
|
|
1045
|
+
.ec-root[data-size="docked"] .ec-panel { top: 0; bottom: 0; left: auto; right: 0; width: 100vw; }
|
|
974
1046
|
}
|
|
975
1047
|
|
|
976
1048
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -978,7 +1050,7 @@ button.ec-ticket:hover { background: var(--c-hover); }
|
|
|
978
1050
|
.ec-shimmer { color: var(--c-ink2); background: none; }
|
|
979
1051
|
.ec-caret[data-end] { opacity: 0; }
|
|
980
1052
|
}
|
|
981
|
-
`;var
|
|
1053
|
+
`;var Sr=["team","you","resolved"],dt=e=>typeof e=="string"&&e?e:null;function Mr(e){let i=e,t=dt(i?.key),o=dt(i?.title),s=i?.status;if(!t||!o||!Sr.includes(s))return null;let r=i.last_message,c=dt(i.updated_at)??"";return{key:t,title:o,status:s,state_label:dt(i.state_label)??"",created_at:dt(i.created_at)??c,updated_at:c,last_message:r&&typeof r=="object"&&typeof r.excerpt=="string"?{at:dt(r.at)??"",excerpt:r.excerpt.slice(0,an.excerpt),from_team:r.from_team===!0}:null,has_recording:i.has_recording===!0}}function no(e){let i=(e.baseUrl||ht).replace(/\/+$/,""),t=e.fetch??((c,p)=>globalThis.fetch(c,p)),o=e.identity,s=new Map,r=async(c,p)=>{let l=null;try{let m=await t(`${i}${Li.list}?status=${c}`,{headers:{"x-espejo-key":e.key,...sn(o)},credentials:"omit"});if(m.status===404)return{status:"hidden"};if(m.status===401)return{status:"denied"};m.ok&&(l=await m.json())}catch{}if(!l||!Array.isArray(l.tickets))return p.delete(c),{status:"error"};let f=l.tickets.slice(0,an.list).map(Mr).filter(m=>!!m),g=l.waiting,b=typeof g=="number"&&g>=0?Math.floor(g):0;return p===s&&c==="all"&&e.onWaiting(b),{status:"ready",data:{tickets:f,waiting:b}}};return{list(c){if(!o)return Promise.resolve({status:"denied"});let p=s,l=p.get(c);return l||p.set(c,l=r(c,p)),l},identify(c){o=c,s=new Map,e.onWaiting(null)}}}var xn="data-espejo-chat",io=["click","fill","navigate"],Hr=1500,Nr=4,Rr=80,Pr=500,oo=200,_r=/^e\d+$/,ro=["pointerdown","mousedown","pointerup","mouseup","touchstart","touchend","focusin"],ao={capture:!0,passive:!0},Ir=80,qr=["network","rate_limited","unavailable","conversation_busy"],Gr=1500,so=e=>typeof e=="string"?e.trim().slice(0,40):"";function Dr(e){let i=e.doc??(typeof document<"u"?document:null);if(!i||!e.key)return null;try{return Or(i,e)}catch{return null}}function Or(e,i){let t={...vt(i.lang),...i.text};i.greeting!==void 0&&(t.greeting=i.greeting);let o=i.position??"bottom-right",{host:s,shadow:r}=Si(e,xn,o,"light");s.setAttribute(at,""),r.innerHTML=`<style>${to}</style>
|
|
982
1054
|
<div class="ec-root">
|
|
983
1055
|
<div class="ec-panel" id="ec-panel" role="dialog" aria-labelledby="ec-title" hidden>
|
|
984
1056
|
<div class="ec-head">
|
|
@@ -987,9 +1059,15 @@ button.ec-ticket:hover { background: var(--c-hover); }
|
|
|
987
1059
|
<p class="ec-title" id="ec-title"></p>
|
|
988
1060
|
<p class="ec-status" id="ec-status" hidden></p>
|
|
989
1061
|
</div>
|
|
990
|
-
<button type="button" class="ec-icon" id="ec-opts" aria-expanded="false" aria-controls="ec-pop"></button>
|
|
991
1062
|
<button type="button" class="ec-icon" id="ec-new"></button>
|
|
992
|
-
<button type="button" class="ec-icon" id="ec-
|
|
1063
|
+
<button type="button" class="ec-icon" id="ec-dock"></button>
|
|
1064
|
+
<button type="button" class="ec-icon" id="ec-expand"></button>
|
|
1065
|
+
<button type="button" class="ec-icon" id="ec-more" aria-haspopup="menu" aria-expanded="false" aria-controls="ec-menu"></button>
|
|
1066
|
+
<button type="button" class="ec-icon ec-min" id="ec-close"></button>
|
|
1067
|
+
</div>
|
|
1068
|
+
<div class="ec-menu" id="ec-menu" role="menu" hidden>
|
|
1069
|
+
<button type="button" class="ec-mi" id="ec-dock-item" role="menuitem"></button>
|
|
1070
|
+
<button type="button" class="ec-mi" id="ec-opts" role="menuitem" aria-haspopup="dialog" aria-expanded="false" aria-controls="ec-pop"></button>
|
|
993
1071
|
</div>
|
|
994
1072
|
<div class="ec-pop" id="ec-pop" role="dialog" aria-labelledby="ec-pop-title" hidden></div>
|
|
995
1073
|
<p class="ec-sr" id="ec-alert" aria-live="assertive"></p>
|
|
@@ -1001,6 +1079,7 @@ button.ec-ticket:hover { background: var(--c-hover); }
|
|
|
1001
1079
|
<span class="ec-time" id="ec-time" aria-hidden="true"></span>
|
|
1002
1080
|
</div>
|
|
1003
1081
|
</div>
|
|
1082
|
+
<button type="button" class="ec-jump" id="ec-jump" hidden></button>
|
|
1004
1083
|
<div class="ec-queue" id="ec-queue" hidden>
|
|
1005
1084
|
<div class="ec-queue-head" id="ec-queue-head"></div>
|
|
1006
1085
|
<div role="list" id="ec-queue-list" aria-labelledby="ec-queue-title"></div>
|
|
@@ -1011,6 +1090,7 @@ button.ec-ticket:hover { background: var(--c-hover); }
|
|
|
1011
1090
|
<textarea class="ec-input" id="ec-input" rows="1" maxlength="4000"></textarea>
|
|
1012
1091
|
<button type="button" class="ec-send" id="ec-send" disabled></button>
|
|
1013
1092
|
</div>
|
|
1093
|
+
<p class="ec-hint" aria-hidden="true"><span id="ec-hint"></span><span id="ec-hint2"></span></p>
|
|
1014
1094
|
</form>
|
|
1015
1095
|
</div>
|
|
1016
1096
|
<div class="ec-view ec-page" id="ec-view-home" hidden></div>
|
|
@@ -1023,8 +1103,10 @@ button.ec-ticket:hover { background: var(--c-hover); }
|
|
|
1023
1103
|
<span class="ec-glyph" id="ec-glyph"></span>
|
|
1024
1104
|
<span class="ec-x" id="ec-x"></span>
|
|
1025
1105
|
</button>
|
|
1026
|
-
</div>`;let s=n=>r.getElementById(n),d=r.querySelector(".ec-root"),l=s("ec-panel"),g=s("ec-log"),f=s("ec-thinking"),x=s("ec-time"),v=s("ec-form"),m=s("ec-input"),A=s("ec-send"),C=s("ec-trigger"),W=s("ec-glyph"),P=s("ec-avatar"),z=s("ec-title"),O=s("ec-status"),B=s("ec-opts"),H=s("ec-pop"),N=s("ec-new"),I=s("ec-close"),K=s("ec-alert"),oe=s("ec-queue"),Ee=s("ec-queue-head"),de=s("ec-queue-list"),X=s("ec-queue-live"),re={home:s("ec-view-home"),support:s("ec-view-support"),tickets:s("ec-view-tickets"),guides:s("ec-view-guides"),article:s("ec-view-article")},ee=s("ec-tabs");ee.setAttribute("aria-label",t.tabs);let ue=(n,c,u)=>{n.appendChild(te(e,c)),n.setAttribute("aria-label",u),n.title=u};ue(B,"sliders",t.options),ue(N,"restart",t.newChat),ue(I,"close",t.close),s("ec-x").appendChild(te(e,"close",22)),s("ec-thinking-label").textContent=t.thinking,O.textContent=t.online,m.setAttribute("aria-label",t.inputLabel),m.placeholder=t.placeholder;let V=e.defaultView,me=(()=>{if(i.storage!==void 0)return i.storage;try{return V?.sessionStorage??null}catch{return null}})(),p=!1,b=!1,E,_=0,$=0,j=null,U=null,ae=null,fe=null,Te=0,pe=new Set,Y=["support"],Ne=Y,Ae=i.identity?ut(i.identity.email,i.identity.hash):null,rt=!1,Ue=0,ve="support",We=null,Qe=null,ke=null,Re=i.agent??Jt(i.allow),y=Re.policy(),T=!1,k=`espejo:chat:prefs:${i.key}`,S={off:[]},G="",q=()=>{S={off:[]},G=F.conversationId;try{let n=JSON.parse(me?.getItem(k)??"null");n&&n.c===F.conversationId&&Array.isArray(n.off)&&(S={off:Xe.filter(c=>n.off.includes(c))})}catch{}},D=()=>{try{me?.setItem(k,JSON.stringify({c:F.conversationId,...S}))}catch{}},Z=`espejo:chat:allow:${i.key}`,se=(()=>{if(i.storage!==void 0)return i.storage;try{return V?.localStorage??null}catch{return null}})(),Se=()=>{try{let n=JSON.parse(se?.getItem(Z)??"null");return Array.isArray(n)?Hi.filter(c=>n.includes(c)):[]}catch{return[]}},Ge=(n,c)=>{try{let u=Se().filter(h=>h!==n);se?.setItem(Z,JSON.stringify(c?[...u,n]:u))}catch{}},Le=`espejo:chat:last:${i.key}`,at=()=>{try{let n=JSON.parse(me?.getItem(Le)??"null");return n&&n.c===F.conversationId&&typeof n.t=="string"&&typeof n.at=="number"?{text:n.t,at:n.at}:null}catch{return null}},st=n=>{try{me?.setItem(Le,JSON.stringify({c:F.conversationId,t:at()?.text??n.slice(0,Xo),at:Date.now()}))}catch{}},vt=()=>E?Xe.filter(n=>y.allow.includes(n)&&E.allowed_actions.includes(n)):[],qe=()=>{if(T)return;let n=E?vt():y.allow;Re.policy({allow:n.filter(c=>!S.off.includes(c))})},ln=()=>{if(G!==F.conversationId){try{me?.removeItem(k)}catch{}q(),qe(),H.hidden||Dt()}},ct=()=>{g.scrollTop=g.scrollHeight},lt=n=>(g.insertBefore(n,f),ct(),n),L=(n,c,u)=>{let h=e.createElement(n);return h.className=c,u!==void 0&&(h.textContent=u),h},he=(n,c)=>{let u=L("button",n,c);return u.type="button",u},dn=(n,c)=>{let u=L("div",`ec-fold ${n}`);u.id=`ec-f${++Te}`;let h=u.appendChild(L("div",""));return un(u,!c),{fold:u,inner:h}};function un(n,c){n.toggleAttribute("data-closed",!c),n.firstElementChild?.toggleAttribute("inert",!c)}let Ke=(n,c,u)=>{n.setAttribute("aria-expanded",String(u)),n.setAttribute("aria-controls",c.id),un(c,u)},pn=n=>{let c=L("div","ec-msg");return c.setAttribute("data-role","assistant"),rn(e,c,n),lt(c)},_i=n=>{let c=L("span","ec-caret");c.setAttribute("aria-hidden","true");let u=n,h=n.lastElementChild;return h&&(u=h.tagName==="UL"||h.tagName==="OL"||h.tagName==="PRE"?h.lastElementChild??h:h),u.appendChild(c),c},Ye=()=>{let n=!!m.value.trim(),c=F.busy&&!n;A.replaceChildren(c?L("i",""):te(e,"up",16)),A.toggleAttribute("data-stop",c),A.setAttribute("aria-label",c?t.stop:t.send),A.title=c?t.stop:t.send,A.disabled=!c&&!n},fn=()=>{let n=Math.floor((Date.now()-$)/1e3);return n<60?`${n}s`:`${Math.floor(n/60)}m${n%60}s`},Pe=n=>{f.hidden=!n,Qe!==null&&V?.clearInterval(Qe),Qe=null,n&&(g.appendChild(f),x.textContent=fn(),Qe=V?.setInterval(()=>x.textContent=fn(),100)??null,ct())},De=()=>{if(g.removeAttribute("aria-busy"),!j)return;let n=j.el.querySelector(".ec-caret");n&&(n.setAttribute("data-end",""),V?.setTimeout(()=>n.remove(),1400)),j=null},hn=()=>{t.greeting&&pn(t.greeting);let n=(i.suggestions??[]).map(c=>String(c).trim().slice(0,Yo)).filter(Boolean).slice(0,Ko);n.length&&(fe=L("div","ec-suggest"),fe.setAttribute("role","group"),fe.setAttribute("aria-label",t.suggestions),n.forEach((c,u)=>{let h=he("ec-chip",c);h.style.animationDelay=`${u*90}ms`,h.addEventListener("click",()=>{m.value=c,bt()}),fe.appendChild(h)}),lt(fe))},gn=()=>{for(let n of[...pe])n(!1)},Oe=()=>{We!==null&&V?.clearTimeout(We),We=null,l.removeAttribute("data-dodge")},Ii=()=>{let n=e.querySelector(`[${et}]:not([${cn}]):not([${Pt}])`);if(!n||l.hidden)return;let c=n.getBoundingClientRect(),u=l.getBoundingClientRect();c.width>0&&u.width>0&&c.left<u.right&&u.left<c.right&&c.top<u.bottom&&u.top<c.bottom&&(Oe(),l.setAttribute("data-dodge",""),We=V?.setTimeout(Oe,ii)??null)},mn=n=>n&&!Zo.test(n)?n:void 0,Gi=()=>{if(U)return U;let n=L("div","ec-tools"),c=he("ec-tools-head");c.hidden=!0;let{fold:u,inner:h}=dn("",!1);return Ke(c,u,!0),c.addEventListener("click",()=>Ke(c,u,c.getAttribute("aria-expanded")!=="true")),n.append(c,u),U={el:n,head:c,fold:u,list:h,rows:0},lt(n),U},_t=(n,c)=>{let u=Gi(),h=L("div","ec-tool");h.style.animationDelay=`${Math.min(u.rows,4)*50}ms`;let R=he("ec-tool-row"),M=L("span","ec-state"),J=L("span","ec-tool-text"),ce=L("span","ec-pill"),Q=te(e,"chevron",14);Q.setAttribute("class","ec-chev"),R.append(M,J,ce,Q);let{fold:be,inner:Me}=dn("ec-detail",!0);Ke(R,be,!1),R.addEventListener("click",()=>Ke(R,be,R.getAttribute("aria-expanded")!=="true")),h.append(R,be),u.list.appendChild(h),u.rows++,u.head.hidden=u.rows<2,u.head.replaceChildren(te(e,"chevron",12),e.createTextNode(t.actionsCount.replace("{n}",String(u.rows)))),u.head.firstChild.setAttribute("class","ec-chev"),ct();let le={el:h,btn:R,stateBox:M,text:J,pill:ce,fold:be,detail:Me,callId:c,parts:n};return It(le,"running"),le},It=(n,c,u)=>{n.parts.target=mn(n.parts.target),n.el.setAttribute("data-state",c);let{type:h}=n.parts;n.text.textContent=Ht(t,c==="done"?"done":"confirm",n.parts).replace(/:$/,""),n.pill.textContent=c==="done"?t.done:c==="error"?t.failed:c==="declined"?t.declined:t.running,n.stateBox.replaceChildren(c==="done"?te(e,"check"):c==="error"?te(e,"close"):c==="declined"?te(e,"minus"):L("span","ec-spin"));let R=[];n.parts.target&&h!=="navigate"&&R.push([t.detailTarget,`\xAB${n.parts.target}\xBB`]),n.parts.destination&&R.push([t.detailDestination,n.parts.destination,!0]),h==="fill"&&n.parts.value!==void 0&&R.push([t.detailValue,mt(t,n.parts.value),!0]),(c==="error"||c==="declined")&&R.push(["",an(t,u)]),n.detail.replaceChildren(...R.map(([M,J,ce])=>{let Q=L("p","");return M&&Q.appendChild(L("b","",M)),Q.appendChild(L("span",ce?"ec-mono":"",J)),Q})),c==="error"&&Ke(n.btn,n.fold,!0)},qi=n=>!!n&&(n.tagName==="INPUT"||n.tagName==="TEXTAREA"||n.tagName==="SELECT"||n.isContentEditable||!!n.closest('[contenteditable]:not([contenteditable="false"])')),Di=()=>{let n=e.activeElement;return n===a?!qi(r.activeElement):!n||n===e.body||n===e.documentElement},Oi=n=>{if(!p)return Promise.resolve(!1);ln();let c=n.action.type;if(Se().includes(c))return Promise.resolve(!0);Oe(),De(),Pe(!1);let u={type:c,target:mn(n.target),destination:n.destination,value:n.value},h=ae??_t(u,null);Object.assign(h.parts,u),U&&Ke(U.head,U.fold,!0),h.el.setAttribute("data-state","ask"),h.btn.hidden=!0;let R=`ec-c${++Te}`,M=L("div","ec-card");M.setAttribute("role","alertdialog"),M.setAttribute("aria-labelledby",`${R}t`),M.setAttribute("aria-describedby",`${R}w`);let J=M.appendChild(L("p","ec-card-title",t.confirmTitle));J.id=`${R}t`;let ce=M.appendChild(L("p","ec-card-what",Ht(t,"confirm",u)));ce.id=`${R}w`,c==="fill"&&M.append(L("p","ec-card-value",mt(t,n.value??"")));let Q=L("div","ec-actions"),be=he("ec-btn",t.allow),Me=he("ec-btn",t.allowAlways),le=he("ec-btn",t.decline);be.setAttribute("data-primary",""),Q.append(be,Me,le),M.append(Q),M.tabIndex=-1,h.el.appendChild(M),ct();let we=`${t.confirmTitle} ${ce.textContent}`;if(c==="fill"){let dt=mt(t,n.value??"");we+=` ${dt.length>Ni?`${dt.slice(0,Ni)}\u2026`:dt}`}K.textContent=we,Di()&&M.focus();let Ie=Date.now()+Jo;return new Promise(dt=>{let Ct=Et=>{if(!pe.delete(Ct))return;let Tt=M.contains(r.activeElement);p&&Tt&&m.focus(),M.remove(),K.textContent="",h.btn.hidden=!1,It(h,Et?"running":"declined","declined");let At=e.activeElement;p&&!Tt&&(!At||At===e.body)&&m.focus(),dt(Et)},Ut=(Et,Tt=!1)=>At=>{if(Date.now()<Ie){At.preventDefault();return}Tt&&pe.has(Ct)&&Ge(c,!0),Ct(Et)};pe.add(Ct),be.addEventListener("click",Ut(!0)),Me.addEventListener("click",Ut(!0,!0)),le.addEventListener("click",Ut(!1))})},$i=n=>{let c=n==="no_agent"||n==="forbidden"||n==="unavailable"?t.errorNoAgent:n==="daily_cap"?t.errorDailyCap:n==="rate_limited"?t.errorRateLimited:n==="conversation_limit"||n==="conversation_expired"?t.errorConversationLimit:n==="conversation_busy"?t.errorBusy:n==="network"?t.errorNetwork:t.errorGeneric,u=L("div","ec-error");if(u.setAttribute("data-code",n),u.append(L("p","",c)),n==="conversation_limit"||n==="conversation_expired"){let h=he("ec-btn",t.startOver);h.addEventListener("click",qt),u.append(h)}lt(u)},Fi=n=>{if(n.type==="queue")return Vi(n.queue,n.paused);if(F.busy)if(ln(),n.type==="dequeued")vn(n.message);else if(n.type==="text"){if(Pe(!1),U=null,!j){let c=pn("");g.setAttribute("aria-busy","true"),j={el:c,src:""}}j.src+=n.delta,rn(e,j.el,j.src),_i(j.el),ct()}else if(n.type==="tool_start")De(),Pe(!1),wt?.start(),ae=_t({type:n.call.name,target:n.target,destination:n.destination,value:n.value},n.call.id);else if(n.type==="tool"){De();let{result:c,call:u}=n,h=ae&&ae.callId===u.id?ae:_t({type:u.name},u.id);Object.assign(h.parts,{type:u.name,target:n.target??h.parts.target,destination:n.destination??h.parts.destination,value:n.value??h.parts.value}),It(h,c.ok?"done":c.error==="declined"||c.error==="confirmation_required"?"declined":"error",c.error),ae=null,c.ok&&u.name==="highlight"&&Ii(),Pe(!0)}else De(),Pe(!1),U=null,n.type==="error"&&$i(n.code)},F=Yt({key:i.key,baseUrl:i.baseUrl,agent:Re,fetch:i.fetch,storage:i.storage,identity:Ae,onConfirm:Oi,onEvent:Fi});function vn(n){De(),fe?.remove(),fe=null,U=null,ae=null;let c=L("div","ec-msg",n);c.setAttribute("data-role","user"),lt(c),st(n),$=Date.now(),Ye(),Pe(!0)}let Gt=async n=>{let c=++_;await n,c===_&&(wt?.end(),Pe(!1),De(),U=null,Ye())},bn=()=>{m.value="",m.style.height="",Ye()},bt=()=>{let n=m.value.trim();if(!n)return;if(F.busy||pe.size){F.enqueue(n)?bn():X.textContent=t.queueFull;return}bn();let c=F.send(n);vn(n),F.resumeQueue(),Gt(c)},Bi=n=>{let c=F.sendQueuedNow(n);gn(),Gt(c)},ji=()=>{F.busy?F.resumeQueue():Gt(F.resumeQueue())};function Vi(n,c){let u=oe.contains(r.activeElement);oe.hidden=!n.length,oe.toggleAttribute("data-paused",c);let h=L("p","",c?t.queuePaused:t.queueTitle.replace("{n}",String(n.length)));h.id="ec-queue-title";let R=[h];if(c){let M=he("ec-btn",t.queueResume);M.addEventListener("click",ji);let J=he("ec-btn",t.queueClear);J.addEventListener("click",()=>F.clearQueue()),R.push(M,J)}Ee.replaceChildren(...R),de.replaceChildren(...n.map(({id:M,text:J})=>{let ce=L("div","ec-q");ce.setAttribute("role","listitem");let Q=ce.appendChild(L("span","ec-q-text",J));Q.title=J;let be=[["up",t.queueSendNow,()=>Bi(M)],["fill",t.queueEdit,()=>{F.removeQueued(M),m.value=m.value.trim()?`${m.value}
|
|
1027
|
-
${J}`:J,m.focus(),Bt()}],["close",t.queueRemove,()=>F.removeQueued(M)]];for(let[Me,le,we]of be){let Ie=ce.appendChild(he("ec-icon"));ue(Ie,Me,le),Ie.addEventListener("click",we)}return ce})),X.textContent=n.length?h.textContent:"",u&&!oe.contains(r.activeElement)&&m.focus()}let Je=()=>{_++,F.abort(),gn(),wt?.end(),De(),Pe(!1),U=null,ae=null,Ye()};function xn(n){Je(),_e(!1),n();try{me?.removeItem(k)}catch{}q(),qe();for(let c of[...g.children])c!==f&&c.remove();hn()}function qt(){xn(()=>F.reset()),m.focus()}let zi={highlight:[t.nameHighlight,t.descHighlight],scroll_to:[t.nameScroll,t.descScroll],click:[t.nameClick,t.descClick],fill:[t.nameFill,t.descFill],navigate:[t.nameNavigate,t.descNavigate]},Ze=null,xt=n=>{if(!Ze)return;let c=n?.closest(".ec-opt");if(!c){Ze.style.opacity="0";return}Ze.style.top=`${c.offsetTop}px`,Ze.style.height=`${c.offsetHeight}px`,Ze.style.opacity="1"},yn=(n,c,u)=>{let h=he("ec-switch");return h.setAttribute("role","switch"),h.setAttribute("aria-checked",String(c)),h.setAttribute("aria-label",n),h.addEventListener("click",()=>{let R=h.getAttribute("aria-checked")!=="true";h.setAttribute("aria-checked",String(R)),u(R)}),h},Dt=()=>{let n=L("p","ec-pop-title",t.optionsTitle);n.id="ec-pop-title";let c=L("div","ec-opts");if(Ze=c.appendChild(L("span","ec-glide")),!E){H.replaceChildren(n,L("p","ec-pop-hint",t.optionsUnavailable));return}let u=vt(),h=Re.policy().confirm;for(let M of u){let[J,ce]=zi[M],Q=L("div","ec-opt");Q.toggleAttribute("data-off",S.off.includes(M)),Q.appendChild(L("span","ec-opt-icon")).appendChild(te(e,M));let Me=Q.appendChild(L("div",""));Me.append(L("p","ec-opt-name",J),L("p","ec-opt-desc",ce));let le=null;if(Hi.includes(M)&&h.includes(M)){let we=Me.appendChild(L("div","ec-ask"));le=yn(`${t.askFirst}: ${J}`,!Se().includes(M),Ie=>{Ge(M,!Ie),le.setAttribute("aria-checked",String(!Se().includes(M)))}),le.disabled=S.off.includes(M),we.append(le,L("span","",t.askFirst))}Q.appendChild(yn(J,!S.off.includes(M),we=>{S.off=we?S.off.filter(Ie=>Ie!==M):[...S.off,M],Q.toggleAttribute("data-off",!we),le&&(le.disabled=!we),D(),qe()})),Q.addEventListener("pointerenter",()=>xt(Q)),c.appendChild(Q)}c.addEventListener("pointerleave",()=>xt(r.activeElement));let R=[n];u.length?R.push(c,L("p","ec-pop-hint",t.optionsHint)):R.push(L("p","ec-pop-hint",t.optionsEmpty)),H.replaceChildren(...R)},kn=()=>Array.from(H.querySelectorAll("button")).filter(n=>!n.disabled),Ui=()=>{Dt(),H.hidden=!1,B.setAttribute("aria-expanded","true");let n=kn()[0];n?(n.focus(),xt(n)):(H.tabIndex=-1,H.focus())};function _e(n=!0){H.hidden||(H.hidden=!0,B.setAttribute("aria-expanded","false"),n&&B.focus())}let wn=n=>{let c=kn(),u=c.indexOf(r.activeElement),h=-1;n.key==="ArrowDown"?h=(u+1)%c.length:n.key==="ArrowUp"?h=(u-1+c.length)%c.length:n.key==="Home"?h=0:n.key==="End"&&(h=c.length-1),!(h<0||!c.length)&&(n.preventDefault(),c[h].focus())},$e=n=>Ne.includes(n),yt=ai({key:i.key,baseUrl:i.baseUrl,fetch:i.fetch}),Ot=()=>Fe("support",!0),Cn="",En=(n,c)=>{if(yt.peek()?.render==="link"&&n.url){V?.open(n.url,"_blank","noopener,noreferrer");return}Cn=n.id,Fe("article"),Wi.show(n,c)},Tn=()=>{Y=Y.filter(n=>n!=="guides"),kt()},$t=yi({doc:e,TEXT:t,source:yt,root:re.guides,hasSupport:()=>$e("support"),openSupport:Ot,openGuide:En,onHidden:Tn}),Ft=Mi({key:i.key,baseUrl:i.baseUrl,fetch:i.fetch,identity:Ae,onWaiting:n=>{Ue=n??0,Rn()}}),An=n=>{n==="hidden"?Y=Y.filter(c=>c!=="tickets"):rt=!0,kt()},Sn=()=>{let n=V?.espejo;return typeof n?.canOpenReport=="function"?n:null},Ln=wi({doc:e,TEXT:t,source:Ft,root:re.tickets,canReport:()=>!!Sn()?.canOpenReport(),report:()=>{Sn()?.openReport()&&Be(!1)},onGone:An}),Wi=bi({doc:e,TEXT:t,source:yt,root:re.article,hasSupport:()=>$e("support"),openSupport:Ot,back:()=>{Fe("guides"),$t.focusGuide(Cn)||Hn()}}),Mn=n=>{if(ve==="home")Ci({doc:e,TEXT:t,root:re.home,source:yt,support:$e("support"),guides:$e("guides"),last:at(),openSupport:Ot,searchGuides:()=>Fe("guides",!0),openGuide:En,onHidden:Tn,tickets:$e("tickets")?Ft:null,openTickets:()=>Fe("tickets",!0),onTicketsGone:An});else if(ve==="tickets"){Ln.show(n);return}else if(ve==="guides"){$t.show(n);return}n&&Hn()};function Hn(){ve==="support"?m.focus():_n(re[ve])[0]?.focus()}function Fe(n,c=!1){n!=="support"&&_e(!1),ve=n;for(let h of Object.keys(re))re[h].hidden=h!==n;B.hidden=N.hidden=n!=="support";let u=n==="article"?"guides":n;for(let h of ee.querySelectorAll("button"))h.getAttribute("data-view")===u?h.setAttribute("aria-current","page"):h.removeAttribute("aria-current");p&&Mn(c)}let Nn={home:["home",t.tabHome],support:["chat",t.tabSupport],tickets:["ticket",t.tabTickets],guides:["book",t.tabGuides]};function Rn(){let n=ee.querySelector('[data-view="tickets"]');if(n?.querySelector(".ec-count")?.remove(),!n||!Ue)return;let c=n.appendChild(L("span","ec-count"));c.append(L("span","",String(Ue)),L("span","ec-sr",t.ticketsWaiting.replace("{n}",String(Ue)))),c.firstElementChild.setAttribute("aria-hidden","true")}let Qi=()=>{Be(),b=!0,d.hidden=!0,ke?.(),ke=null};function kt(){if(Ne=Y.filter(c=>c!=="tickets"||Ae&&!rt),!Ne.some(c=>c!=="home"))return Qi();b&&(b=!1,d.hidden=!1,Vt()),$e("support")||Je(),ee.hidden=Ne.length<2,ee.replaceChildren(...Ne.map(c=>{let u=he("ec-tab");return u.setAttribute("data-view",c),u.append(te(e,Nn[c][0],18),L("span","",Nn[c][1])),u.addEventListener("click",()=>{Fe(c),u.focus()}),u})),Rn(),Fe(p&&$e(ve==="article"?"guides":ve)?ve:Ne[0])}let Pn=()=>{p||b||(p=!0,l.hidden=!1,Wn(),C.setAttribute("aria-expanded","true"),Mn(!0))},Be=(n=!0)=>{p&&(p=!1,Je(),_e(!1),Oe(),l.hidden=!0,C.setAttribute("aria-expanded","false"),n&&C.focus())},_n=n=>Array.from(n.querySelectorAll("button, textarea, input, a[href]")).filter(c=>!c.hasAttribute("disabled")&&!c.closest("[hidden], [inert]")),In=n=>{if(!p)return;if(n.key==="Escape"){n.preventDefault(),H.hidden?Be():_e();return}if(n.key!=="Tab")return;let c=_n(H.hidden?l:H);if(c.length===0)return;let u=c[0],h=c[c.length-1],R=r.activeElement;n.shiftKey&&(R===u||!c.includes(R))?(n.preventDefault(),h.focus()):!n.shiftKey&&(R===h||!c.includes(R))&&(n.preventDefault(),u.focus())},Gn=n=>{n.key!=="Enter"||n.shiftKey||n.isComposing||(n.preventDefault(),bt())},Bt=()=>{m.style.height="",m.style.height=`${Math.min(m.scrollHeight,120)}px`,Ye()},qn=n=>{n.preventDefault(),bt()},Dn=()=>{F.busy&&!m.value.trim()?Je():bt()},On=()=>{p?Be():Pn()},$n=()=>{H.hidden?Ui():_e()},Fn=n=>{if(H.hidden)return;let c=n.composedPath();!c.includes(H)&&!c.includes(B)&&_e(!1)},Bn=n=>{!H.hidden&&!n.composedPath().includes(a)&&_e(!1)},jn=n=>xt(n.target),jt=!1,Ki=n=>{if(n.type==="focusin")return jt||!!r.activeElement?.closest(".ec-card");let c="changedTouches"in n?n.changedTouches[0]:n;return!!(c&&typeof r.elementFromPoint=="function"?r.elementFromPoint(c.clientX,c.clientY):null)?.closest(".ec-card")},Vn=n=>{if(!n.composedPath().includes(a)||!pe.size)return;let c=Ki(n);n.type==="pointerdown"||n.type==="touchstart"||n.type==="mousedown"?jt=c:n.type==="mouseup"&&(jt=!1),c&&(n.stopPropagation(),n.type==="pointerdown"&&_e(!1))},zn=()=>i.theme??E?.theme??"auto",Un=()=>{let n=C.getBoundingClientRect(),c=V?.innerWidth??0,u=V?.innerHeight??0,h=n.width?n.left+n.width/2:o.endsWith("left")?40:c-40,R=n.height?n.top+n.height/2:o.startsWith("top")?40:u-40;a.setAttribute("data-theme",Rt(e,a,h,R))},Vt=()=>{let n=zn();n!=="auto"?(ke?.(),ke=null,a.setAttribute("data-theme",n)):Wn()};function Wn(){zn()==="auto"&&(ke?Un():ke=Si(e,Un))}let Qn=n=>{let c=u=>{if(n&&/^https:\/\//i.test(n)){let h=e.createElement("img");return h.alt="",h.referrerPolicy="no-referrer",h.decoding="async",h.width=h.height=u,h.addEventListener("error",()=>h.replaceWith(te(e,"chat",u===52?24:16)),{once:!0}),h.src=n,h}return te(e,vi(n)?n:"chat",u===52?24:16)};W.replaceChildren(c(52)),P.replaceChildren(c(30))},Kn=()=>{let n=i.title||E?.name||t.title;z.textContent=n,C.setAttribute("aria-label",i.title||E?.name?`${t.open} (${n})`:t.open),O.hidden=!E?.enabled,Vt()},zt=()=>{b||T||(C.removeAttribute("data-pending"),C.removeAttribute("inert"))},Yi=n=>{T||(E=n,Y=n?n.sections:["support"],n?.icon&&Qn(n.icon),Kn(),qe(),H.hidden||Dt(),kt(),zt())};q(),qe(),Qn(null),Kn(),Ye(),hn();let Ji=Lt(d);d.addEventListener("keydown",In),d.addEventListener("pointerdown",Fn),e.addEventListener("pointerdown",Bn,!0);for(let n of Ri)V?.addEventListener(n,Vn,Pi);H.addEventListener("keydown",wn),H.addEventListener("focusin",jn),m.addEventListener("keydown",Gn),m.addEventListener("input",Bt),v.addEventListener("submit",qn),A.addEventListener("click",Dn),C.addEventListener("click",On),B.addEventListener("click",$n),I.addEventListener("click",Be),N.addEventListener("click",qt),l.addEventListener("pointerenter",Oe),e.body.appendChild(a);let wt=i.presence===!1?null:sn(Re,{lang:i.lang,text:{presenceNotice:t.presenceNotice,presenceNoticeNamed:t.presenceNoticeNamed,stop:t.stop},idleMs:0,onStop:Je,doc:e,themeOf:()=>a.getAttribute("data-theme")==="dark"?"dark":"light",nameOf:()=>i.title||E?.name,origin:()=>{let n=(p?l:C).getBoundingClientRect(),c=ee.hidden?0:ee.offsetHeight;return n.width?{x:n.left+n.width/2,y:p?n.bottom-60-c:n.top+n.height/2}:null}});Vt();let Yn=V?.setTimeout(zt,Qo);return F.getConfig().then(Yi),{open:Pn,close:()=>Be(),identify(n,c){let u=ut(n,c);T||u?.email===Ae?.email&&u?.hash===Ae?.hash||(Ae=u,rt=!1,Ft.identify(u),Ln.reset(),re.home.replaceChildren(),xn(()=>F.identify(u)),kt(),E!==void 0&&zt())},destroy(){Je(),Oe(),ke?.(),ke=null,T=!0,$t.destroy(),wt?.destroy(),Re.policy({allow:y.allow,confirm:y.confirm}),Yn!==void 0&&V?.clearTimeout(Yn),F.destroy(),Ji(),d.removeEventListener("keydown",In),d.removeEventListener("pointerdown",Fn),e.removeEventListener("pointerdown",Bn,!0);for(let n of Ri)V?.removeEventListener(n,Vn,Pi);H.removeEventListener("keydown",wn),H.removeEventListener("focusin",jn),m.removeEventListener("keydown",Gn),m.removeEventListener("input",Bt),v.removeEventListener("submit",qn),A.removeEventListener("click",Dn),C.removeEventListener("click",On),B.removeEventListener("click",$n),I.removeEventListener("click",Be),N.removeEventListener("click",qt),l.removeEventListener("pointerenter",Oe),a.remove()},client:F}}export{cn as CHAT_HOST_ATTRIBUTE,Ei as DEFAULT_CHAT_TEXT,Pt as PRESENCE_HOST_ATTRIBUTE,gt as chatTextFor,Yt as createChatClient,Ht as describeAction,an as describeError,mt as describeValue,er as installChatWidget,Vo as installPresence};
|
|
1106
|
+
</div>`;let c=n=>r.getElementById(n),p=r.querySelector(".ec-root"),l=c("ec-panel"),f=c("ec-log"),g=c("ec-thinking"),b=c("ec-time"),m=c("ec-form"),h=c("ec-input"),M=c("ec-send"),C=c("ec-trigger"),U=c("ec-glyph"),I=c("ec-avatar"),j=c("ec-title"),B=c("ec-status"),F=c("ec-opts"),_=c("ec-pop"),R=c("ec-new"),$=c("ec-close"),K=c("ec-dock"),de=c("ec-expand"),ne=c("ec-more"),V=c("ec-menu"),ie=c("ec-dock-item"),ve=c("ec-jump"),Te=c("ec-hint"),be=c("ec-alert"),ge=c("ec-queue"),tt=c("ec-queue-head"),v=c("ec-queue-list"),x=c("ec-queue-live"),A={home:c("ec-view-home"),support:c("ec-view-support"),tickets:c("ec-view-tickets"),guides:c("ec-view-guides"),article:c("ec-view-article")},N=c("ec-tabs");N.setAttribute("aria-label",t.tabs);let D=(n,a,d)=>{n.replaceChildren(Q(e,a)),n.setAttribute("aria-label",d),n.title=d};F.append(Q(e,"sliders"),t.options),D(R,"restart",t.newChat),D(ne,"more",t.more),D($,"chevron",t.minimize),c("ec-x").appendChild(Q(e,"close",22)),c("ec-hint2").textContent=t.hintNewline,ve.append(Q(e,"up",15),t.jumpLatest),c("ec-thinking-label").textContent=t.thinking,B.textContent=t.online,h.setAttribute("aria-label",t.inputLabel),h.placeholder=t.placeholder;let q=e.defaultView,oe=(()=>{if(i.storage!==void 0)return i.storage;try{return q?.sessionStorage??null}catch{return null}})(),J=!1,Ae=!1,X,Le=0,pe=0,ue=null,ee=null,Ve=!0,Se="",se=null,Me=null,Pe=null,xt=0,He=new Set,y=["support"],L=y,k=i.identity?ft(i.identity.email,i.identity.hash):null,H=k?so(i.identity?.name):"",O=!1,z=0,P="support",Z=null,re=null,fe=null,xe=i.agent??ln(i.allow),ye=xe.policy(),_e=!1,De=`espejo:chat:prefs:${i.key}`,he={off:[]},yt="",zt=()=>{he={off:[]},yt=G.conversationId;try{let n=JSON.parse(oe?.getItem(De)??"null");n&&n.c===G.conversationId&&Array.isArray(n.off)&&(he={off:rt.filter(a=>n.off.includes(a))})}catch{}},co=()=>{try{oe?.setItem(De,JSON.stringify({c:G.conversationId,...he}))}catch{}},yn=`espejo:chat:allow:${i.key}`,kn=(()=>{if(i.storage!==void 0)return i.storage;try{return q?.localStorage??null}catch{return null}})(),kt=()=>{try{let n=JSON.parse(kn?.getItem(yn)??"null");return Array.isArray(n)?io.filter(a=>n.includes(a)):[]}catch{return[]}},wn=(n,a)=>{try{let d=kt().filter(u=>u!==n);kn?.setItem(yn,JSON.stringify(a?[...d,n]:d))}catch{}},En=`espejo:chat:last:${i.key}`,Cn=()=>{try{let n=JSON.parse(oe?.getItem(En)??"null");return n&&n.c===G.conversationId&&typeof n.t=="string"&&typeof n.at=="number"?{text:n.t,at:n.at}:null}catch{return null}},lo=n=>{try{oe?.setItem(En,JSON.stringify({c:G.conversationId,t:Cn()?.text??n.slice(0,Ir),at:Date.now()}))}catch{}},Tn=()=>X?rt.filter(n=>ye.allow.includes(n)&&X.allowed_actions.includes(n)):[],pt=()=>{if(_e)return;let n=X?Tn():ye.allow;xe.policy({allow:n.filter(a=>!he.off.includes(a))})},An=()=>{if(yt!==G.conversationId){try{oe?.removeItem(De)}catch{}zt(),pt(),_.hidden||Wt()}},nt=()=>{Ve&&(f.scrollTop=f.scrollHeight)},Ue=n=>(f.insertBefore(n,g),ee?.nodes.push(n),nt(),n),T=(n,a,d)=>{let u=e.createElement(n);return u.className=a,d!==void 0&&(u.textContent=d),u},te=(n,a)=>{let d=T("button",n,a);return d.type="button",d},Ln=(n,a)=>{let d=T("div",`ec-fold ${n}`);d.id=`ec-f${++xt}`;let u=d.appendChild(T("div",""));return Sn(d,!a),{fold:d,inner:u}};function Sn(n,a){n.toggleAttribute("data-closed",!a),n.firstElementChild?.toggleAttribute("inert",!a)}let it=(n,a,d)=>{n.setAttribute("aria-expanded",String(d)),n.setAttribute("aria-controls",a.id),Sn(a,d)},Mn=n=>{let a=T("div","ec-msg");return a.setAttribute("data-role","assistant"),mn(e,a,n),Ue(a)},po=n=>{let a=T("span","ec-caret");a.setAttribute("aria-hidden","true");let d=n,u=n.lastElementChild;return u&&(d=u.tagName==="UL"||u.tagName==="OL"||u.tagName==="PRE"?u.lastElementChild??u:u),d.appendChild(a),a},We=()=>{let n=!!h.value.trim(),a=G.busy&&!n;M.replaceChildren(a?T("i",""):Q(e,"up",16)),M.toggleAttribute("data-stop",a),M.setAttribute("aria-label",a?t.stop:t.send),M.title=a?t.stop:t.send,M.disabled=!a&&!n,m.toggleAttribute("data-typed",n),Te.textContent=G.busy?t.hintQueue:t.hintSend,uo()};function uo(){let n=g.previousElementSibling,a=!G.busy&&!He.size;for(let d of f.querySelectorAll(".ec-regen"))d.hidden=!a||d.parentElement!==n;for(let d of f.querySelectorAll("[data-again]"))d.hidden=!a||(d.closest(".ec-alert")??d.closest(".ec-u")?.nextElementSibling)!==n;for(let d of f.querySelectorAll(".ec-bar"))d.toggleAttribute("data-on",d===n)}let fo=(n,a)=>{let d=()=>{let u=r.activeElement,w=p.appendChild(T("textarea","ec-sr"));w.value=n,w.select();let S=!1;try{S=e.execCommand("copy")}catch{}w.remove(),u?.focus(),S&&a()};try{let u=q?.navigator.clipboard?.writeText(n);u?u.then(a,d):d()}catch{d()}},Bt=(n,a)=>{let d=te(a?"ec-code-copy":"ec-icon"),u,w=S=>{d.replaceChildren(Q(e,S?"check":"copy",15),...S?[T("span","",t.copied)]:a?[a]:[]),d.toggleAttribute("data-copied",S),!a&&(d.setAttribute("aria-label",S?t.copied:t.copy),d.title=t.copy)};return w(!1),d.addEventListener("click",()=>fo(n(),()=>{w(!0),q?.clearTimeout(u),u=q?.setTimeout(()=>w(!1),Gr)})),d},wt=(n,a,d)=>{let u=te("ec-icon");return D(u,n,a),u.addEventListener("click",d),u},go=n=>{let a=T("div","ec-code");n.replaceWith(a),a.append(T("div","ec-code-head"),n),a.firstChild.appendChild(Bt(()=>n.textContent??"",t.copyCode))},Hn=()=>{let n=Math.floor((Date.now()-pe)/1e3);return n<60?`${n}s`:`${Math.floor(n/60)}m${n%60}s`},Oe=n=>{g.hidden=!n,re!==null&&q?.clearInterval(re),re=null,n&&(f.appendChild(g),b.textContent=Hn(),re=q?.setInterval(()=>b.textContent=Hn(),100)??null,nt())},Qe=()=>{if(f.removeAttribute("aria-busy"),!ue)return;let n=ue.el.querySelector(".ec-caret");n&&(n.setAttribute("data-end",""),q?.setTimeout(()=>n.remove(),1400));for(let a of ue.el.querySelectorAll("pre"))go(a);ue=null},Nn=()=>{t.greeting&&Mn(t.greeting);let n=(i.suggestions??[]).map(a=>String(a).trim().slice(0,Rr)).filter(Boolean).slice(0,Nr);n.length&&(Pe=T("div","ec-suggest"),Pe.setAttribute("role","group"),Pe.setAttribute("aria-label",t.suggestions),n.forEach((a,d)=>{let u=te("ec-chip",a);u.style.animationDelay=`${d*90}ms`,u.addEventListener("click",()=>{h.value=a,Ct()}),Pe.appendChild(u)}),Ue(Pe))},Rn=()=>{for(let n of[...He])n(!1)},Ke=()=>{Z!==null&&q?.clearTimeout(Z),Z=null,l.removeAttribute("data-dodge")},ho=()=>{let n=e.querySelector(`[${at}]:not([${xn}]):not([${$t}])`);if(!n||l.hidden)return;let a=n.getBoundingClientRect(),d=l.getBoundingClientRect();a.width>0&&d.width>0&&a.left<d.right&&d.left<a.right&&a.top<d.bottom&&d.top<a.bottom&&(Ke(),l.setAttribute("data-dodge",""),Z=q?.setTimeout(Ke,Hi)??null)},Pn=n=>n&&!_r.test(n)?n:void 0,mo=()=>{if(se)return se;let n=T("div","ec-tools"),a=te("ec-tools-head");a.hidden=!0;let{fold:d,inner:u}=Ln("",!1);return it(a,d,!0),a.addEventListener("click",()=>it(a,d,a.getAttribute("aria-expanded")!=="true")),n.append(a,d),se={el:n,head:a,fold:d,list:u,rows:0},Ue(n),se},Ft=(n,a)=>{let d=mo(),u=T("div","ec-tool");u.style.animationDelay=`${Math.min(d.rows,4)*50}ms`;let w=te("ec-tool-row"),S=T("span","ec-state"),W=T("span","ec-tool-text"),ce=T("span","ec-pill"),Y=Q(e,"chevron",14);Y.setAttribute("class","ec-chev"),w.append(S,W,ce,Y);let{fold:ke,inner:qe}=Ln("ec-detail",!0);it(w,ke,!1),w.addEventListener("click",()=>it(w,ke,w.getAttribute("aria-expanded")!=="true")),u.append(w,ke),d.list.appendChild(u),d.rows++,d.head.hidden=d.rows<2,d.head.replaceChildren(Q(e,"chevron",12),e.createTextNode(t.actionsCount.replace("{n}",String(d.rows)))),d.head.firstChild.setAttribute("class","ec-chev"),nt();let le={el:u,btn:w,stateBox:S,text:W,pill:ce,fold:ke,detail:qe,callId:a,parts:n};return jt(le,"running"),le},jt=(n,a,d)=>{n.parts.target=Pn(n.parts.target),n.el.setAttribute("data-state",a);let{type:u}=n.parts;n.text.textContent=Gt(t,a==="done"?"done":"confirm",n.parts).replace(/:$/,""),n.pill.textContent=a==="done"?t.done:a==="error"?t.failed:a==="declined"?t.declined:t.running,n.stateBox.replaceChildren(a==="done"?Q(e,"check"):a==="error"?Q(e,"close"):a==="declined"?Q(e,"minus"):T("span","ec-spin"));let w=[];n.parts.target&&u!=="navigate"&&w.push([t.detailTarget,`\xAB${n.parts.target}\xBB`]),n.parts.destination&&w.push([t.detailDestination,n.parts.destination,!0]),u==="fill"&&n.parts.value!==void 0&&w.push([t.detailValue,bt(t,n.parts.value),!0]),(a==="error"||a==="declined")&&w.push(["",vn(t,d)]),n.detail.replaceChildren(...w.map(([S,W,ce])=>{let Y=T("p","");return S&&Y.appendChild(T("b","",S)),Y.appendChild(T("span",ce?"ec-mono":"",W)),Y})),a==="error"&&it(n.btn,n.fold,!0)},vo=n=>!!n&&(n.tagName==="INPUT"||n.tagName==="TEXTAREA"||n.tagName==="SELECT"||n.isContentEditable||!!n.closest('[contenteditable]:not([contenteditable="false"])')),bo=()=>{let n=e.activeElement;return n===s?!vo(r.activeElement):!n||n===e.body||n===e.documentElement},xo=n=>{if(_e)return Promise.resolve(!1);An();let a=n.action.type;if(kt().includes(a))return Promise.resolve(!0);Ke(),Qe(),Oe(!1);let d={type:a,target:Pn(n.target),destination:n.destination,value:n.value},u=Me??Ft(d,null);Object.assign(u.parts,d),se&&it(se.head,se.fold,!0),u.el.setAttribute("data-state","ask"),u.btn.hidden=!0;let w=`ec-c${++xt}`,S=T("div","ec-card");S.setAttribute("role","alertdialog"),S.setAttribute("aria-labelledby",`${w}t`),S.setAttribute("aria-describedby",`${w}w`);let W=S.appendChild(T("p","ec-card-title",t.confirmTitle));W.id=`${w}t`;let ce=S.appendChild(T("p","ec-card-what",Gt(t,"confirm",d)));ce.id=`${w}w`,a==="fill"&&S.append(T("p","ec-card-value",bt(t,n.value??"")));let Y=T("div","ec-actions"),ke=te("ec-btn",t.allow),qe=te("ec-btn",t.allowAlways),le=te("ec-btn",t.decline);ke.setAttribute("data-primary",""),Y.append(ke,qe,le),S.append(Y),S.tabIndex=-1,u.el.appendChild(S),nt();let Ne=`${t.confirmTitle} ${ce.textContent}`;if(a==="fill"){let ut=bt(t,n.value??"");Ne+=` ${ut.length>oo?`${ut.slice(0,oo)}\u2026`:ut}`}be.textContent=Ne,bo()&&S.focus();let Fe=Date.now()+Pr;return new Promise(ut=>{let Ht=Nt=>{if(!He.delete(Ht))return;let Rt=S.contains(r.activeElement);J&&Rt&&h.focus(),S.remove(),be.textContent="",u.btn.hidden=!1,jt(u,Nt?"running":"declined","declined");let Pt=e.activeElement;J&&!Rt&&(!Pt||Pt===e.body)&&h.focus(),ut(Nt)},on=(Nt,Rt=!1)=>Pt=>{if(Date.now()<Fe){Pt.preventDefault();return}Rt&&He.has(Ht)&&wn(a,!0),Ht(Nt)};He.add(Ht),ke.addEventListener("click",on(!0)),qe.addEventListener("click",on(!0,!0)),le.addEventListener("click",on(!1))})},yo=n=>{let a=n==="no_agent"||n==="forbidden"?t.errorNoAgent:n==="unavailable"?t.errorUnavailable:n==="daily_cap"?t.errorDailyCap:n==="rate_limited"?t.errorRateLimited:n==="conversation_limit"||n==="conversation_expired"?t.errorConversationLimit:n==="conversation_busy"?t.errorBusy:n==="network"?t.errorNetwork:t.errorGeneric,d=ee,u=T("div","ec-alert");u.setAttribute("data-tone",n==="network"||n==="no_agent"||n==="forbidden"?"bad":"warn");let w=T("div","");u.append(Q(e,"alert"),w);let S=w.appendChild(T("div","ec-error"));if(S.setAttribute("data-code",n),S.append(T("p","",a)),n==="conversation_limit"||n==="conversation_expired"){let W=te("ec-btn",t.startOver);W.addEventListener("click",Ut),S.append(W)}d&&n==="network"&&!d.got?ko(d):d&&qr.includes(n)?_n(w.appendChild(te("ec-btn",t.retry)),d):n==="daily_cap"&&ze("tickets")&&w.appendChild(te("ec-btn",t.reportProblem)).addEventListener("click",()=>Be("tickets",!0)),Ue(u),ee=null},ko=n=>{n.user.setAttribute("data-failed","");let a=n.user.appendChild(T("div","ec-fail"));a.append(Q(e,"alert",14),T("span","",t.notSent)),_n(a.appendChild(te("ec-btn",t.resend)),n)},_n=(n,a)=>{n.setAttribute("data-again",""),n.addEventListener("click",()=>Vt(a))},wo=()=>{let n=ee;if(!n?.bubbles.length)return void(ee=null);let a=T("div","ec-bar"),d=wt("thumb",t.goodResponse,()=>In(d,u)),u=wt("thumb",t.badResponse,()=>In(u,d));d.setAttribute("aria-pressed","false"),u.setAttribute("aria-pressed","false"),u.setAttribute("data-down","");let w=wt("restart",t.regenerate,()=>Vt(n));w.classList.add("ec-regen"),a.append(Bt(()=>n.bubbles.map(S=>S.src).join(`
|
|
1107
|
+
|
|
1108
|
+
`)),w,d,u),Ue(a),ee=null},In=(n,a)=>{n.setAttribute("aria-pressed",String(n.getAttribute("aria-pressed")!=="true")),a.setAttribute("aria-pressed","false")},Eo=n=>{if(n.type==="queue")return Ao(n.queue,n.paused);if(G.busy)if(An(),n.type==="dequeued")qn(n.message);else if(n.type==="text"){if(Oe(!1),se=null,!ue){let a=Mn("");f.setAttribute("aria-busy","true"),ue={el:a,src:""},ee&&(ee.bubbles.push(ue),ee.got=!0)}ue.src+=n.delta,mn(e,ue.el,ue.src),po(ue.el),nt()}else if(n.type==="tool_start")ee&&(ee.got=!0),Qe(),Oe(!1),Mt?.start(),Me=Ft({type:n.call.name,target:n.target,destination:n.destination,value:n.value},n.call.id);else if(n.type==="tool"){Qe();let{result:a,call:d}=n,u=Me&&Me.callId===d.id?Me:Ft({type:d.name},d.id);Object.assign(u.parts,{type:d.name,target:n.target??u.parts.target,destination:n.destination??u.parts.destination,value:n.value??u.parts.value}),jt(u,a.ok?"done":a.error==="declined"||a.error==="confirmation_required"?"declined":"error",a.error),Me=null,a.ok&&d.name==="highlight"&&ho(),Oe(!0)}else Qe(),Oe(!1),se=null,n.type==="error"?yo(n.code):n.type==="done"&&wo()},G=cn({key:i.key,baseUrl:i.baseUrl,agent:xe,fetch:i.fetch,storage:i.storage,identity:k,onConfirm:xo,onEvent:Eo});function qn(n){ee=null;let a={prompt:n,user:T("div","ec-u"),nodes:[],bubbles:[],got:!1},d=a.user.appendChild(T("div","ec-u-row"));d.appendChild(T("div","ec-acts")).append(Bt(()=>n),wt("fill",t.queueEdit,()=>{if(a.user.hasAttribute("data-failed"))for(let w of[a.user,...a.nodes])w.remove();h.value=n,h.focus(),St()})),d.appendChild(T("div","ec-msg",n)).setAttribute("data-role","user"),Ue(a.user),lo(n),Gn(a)}function Gn(n){Qe(),Pe?.remove(),Pe=null,se=null,Me=null,ee=n,n.got=!1,Ve=!0,pe=Date.now(),We(),Oe(!0)}function Vt(n){if(G.busy||He.size)return;for(let d of n.nodes)d.remove();n.nodes=[],n.bubbles=[],n.user.removeAttribute("data-failed"),n.user.querySelector(".ec-fail")?.remove();let a=G.send(n.prompt);Gn(n),G.resumeQueue(),Et(a)}let Et=async n=>{let a=++Le;await n,a===Le&&(Mt?.end(),Oe(!1),Qe(),se=null,We())},Dn=()=>{h.value="",h.style.height="",We()},Ct=()=>{let n=h.value.trim();if(!n)return;if(G.busy||He.size){G.enqueue(n)?Dn():x.textContent=t.queueFull;return}Dn();let a=G.send(n);qn(n),G.resumeQueue(),Et(a)},Co=n=>{let a=G.sendQueuedNow(n);Rn(),Et(a)},To=()=>{G.busy?G.resumeQueue():Et(G.resumeQueue())};function Ao(n,a){let d=ge.contains(r.activeElement);ge.hidden=!n.length,ge.toggleAttribute("data-paused",a);let u=T("p","",a?t.queuePaused:t.queueTitle.replace("{n}",String(n.length)));u.id="ec-queue-title";let w=[u];if(a){let S=te("ec-btn",t.queueResume);S.addEventListener("click",To);let W=te("ec-btn",t.queueClear);W.addEventListener("click",()=>G.clearQueue()),w.push(S,W)}tt.replaceChildren(...w),v.replaceChildren(...n.map(({id:S,text:W})=>{let ce=T("div","ec-q");ce.setAttribute("role","listitem");let Y=ce.appendChild(T("span","ec-q-text",W));Y.title=W;let ke=[["up",t.queueSendNow,()=>Co(S)],["fill",t.queueEdit,()=>{G.removeQueued(S),h.value=h.value.trim()?`${h.value}
|
|
1109
|
+
${W}`:W,h.focus(),St()}],["close",t.queueRemove,()=>G.removeQueued(S)]];for(let[qe,le,Ne]of ke){let Fe=ce.appendChild(te("ec-icon"));D(Fe,qe,le),Fe.addEventListener("click",Ne)}return ce})),x.textContent=n.length?u.textContent:"",d&&!ge.contains(r.activeElement)&&h.focus()}let Ye=()=>{let n=G.busy?ee:null;if(Le++,G.abort(),Rn(),Mt?.end(),Qe(),Oe(!1),se=null,Me=null,ee=null,n){let a=T("p","ec-stopped");a.append(T("i",""),t.stopped),a.appendChild(te("ec-regen",t.regenerateShort)).addEventListener("click",()=>Vt(n)),n.nodes.push(Ue(a))}We()};function On(n){Ye(),Ie(!1),n();try{oe?.removeItem(De)}catch{}zt(),pt();for(let a of[...f.children])a!==g&&a.remove();Nn(),We()}function Ut(){On(()=>G.reset()),h.focus()}let Lo={highlight:[t.nameHighlight,t.descHighlight],scroll_to:[t.nameScroll,t.descScroll],click:[t.nameClick,t.descClick],fill:[t.nameFill,t.descFill],navigate:[t.nameNavigate,t.descNavigate]},ot=null,Tt=n=>{if(!ot)return;let a=n?.closest(".ec-opt");if(!a){ot.style.opacity="0";return}ot.style.top=`${a.offsetTop}px`,ot.style.height=`${a.offsetHeight}px`,ot.style.opacity="1"},$n=(n,a,d)=>{let u=te("ec-switch");return u.setAttribute("role","switch"),u.setAttribute("aria-checked",String(a)),u.setAttribute("aria-label",n),u.addEventListener("click",()=>{let w=u.getAttribute("aria-checked")!=="true";u.setAttribute("aria-checked",String(w)),d(w)}),u},Wt=()=>{let n=T("p","ec-pop-title",t.optionsTitle);n.id="ec-pop-title";let a=T("div","ec-opts");if(ot=a.appendChild(T("span","ec-glide")),!X){_.replaceChildren(n,T("p","ec-pop-hint",t.optionsUnavailable));return}let d=Tn(),u=xe.policy().confirm;for(let S of d){let[W,ce]=Lo[S],Y=T("div","ec-opt");Y.toggleAttribute("data-off",he.off.includes(S)),Y.appendChild(T("span","ec-opt-icon")).appendChild(Q(e,S));let qe=Y.appendChild(T("div",""));qe.append(T("p","ec-opt-name",W),T("p","ec-opt-desc",ce));let le=null;if(io.includes(S)&&u.includes(S)){let Ne=qe.appendChild(T("div","ec-ask"));le=$n(`${t.askFirst}: ${W}`,!kt().includes(S),Fe=>{wn(S,!Fe),le.setAttribute("aria-checked",String(!kt().includes(S)))}),le.disabled=he.off.includes(S),Ne.append(le,T("span","",t.askFirst))}Y.appendChild($n(W,!he.off.includes(S),Ne=>{he.off=Ne?he.off.filter(Fe=>Fe!==S):[...he.off,S],Y.toggleAttribute("data-off",!Ne),le&&(le.disabled=!Ne),co(),pt()})),Y.addEventListener("pointerenter",()=>Tt(Y)),a.appendChild(Y)}a.addEventListener("pointerleave",()=>Tt(r.activeElement));let w=[n];d.length?w.push(a,T("p","ec-pop-hint",t.optionsHint)):w.push(T("p","ec-pop-hint",t.optionsEmpty)),_.replaceChildren(...w)},zn=()=>Array.from(_.querySelectorAll("button")).filter(n=>!n.disabled),So=()=>{Wt(),_.hidden=!1,F.setAttribute("aria-expanded","true");let n=zn()[0];n?(n.focus(),Tt(n)):(_.tabIndex=-1,_.focus())};function Ie(n=!0){_.hidden||(_.hidden=!0,F.setAttribute("aria-expanded","false"),n&&ne.focus())}let Bn=()=>Array.from(V.querySelectorAll("button")),Mo=()=>{Ie(!1),V.hidden=!1,ne.setAttribute("aria-expanded","true"),Bn()[0].focus()};function $e(n=!0){V.hidden||(V.hidden=!0,ne.setAttribute("aria-expanded","false"),n&&ne.focus())}let Qt=n=>{Se=n,Se?p.setAttribute("data-size",Se):p.removeAttribute("data-size"),D(de,Se==="expanded"?"collapse":"expand",Se==="expanded"?t.collapse:t.expand);let a=Se==="docked"?t.undock:t.dock;D(K,"dock",a),ie.replaceChildren(Q(e,"dock"),a)},Fn=()=>Qt(Se==="expanded"?"":"expanded"),Kt=()=>Qt(Se==="docked"?"":"docked"),jn=()=>{Kt(),$e()},Vn=()=>{V.hidden?Mo():$e()},Un=n=>a=>{let d=n(),u=d.indexOf(r.activeElement),w=-1;a.key==="ArrowDown"?w=(u+1)%d.length:a.key==="ArrowUp"?w=(u-1+d.length)%d.length:a.key==="Home"?w=0:a.key==="End"&&(w=d.length-1),!(w<0||!d.length)&&(a.preventDefault(),d[w].focus())},Wn=Un(Bn),Qn=Un(zn),ze=n=>L.includes(n),At=Pi({key:i.key,baseUrl:i.baseUrl,fetch:i.fetch}),Yt=()=>Be("support",!0),Kn="",Yn=(n,a)=>{if(At.peek()?.render==="link"&&n.url){q?.open(n.url,"_blank","noopener,noreferrer");return}Kn=n.id,Be("article"),Ho.show(n,a)},Jn=()=>{y=y.filter(n=>n!=="guides"),Lt()},Jt=Wi({doc:e,TEXT:t,source:At,root:A.guides,hasSupport:()=>ze("support"),openSupport:Yt,openGuide:Yn,onHidden:Jn}),Zt=no({key:i.key,baseUrl:i.baseUrl,fetch:i.fetch,identity:k,onWaiting:n=>{z=n??0,ii()}}),Zn=n=>{n==="hidden"?y=y.filter(a=>a!=="tickets"):(O=!0,H=""),Lt()},Xn=()=>{let n=q?.espejo;return typeof n?.canOpenReport=="function"?n:null},ei=Ki({doc:e,TEXT:t,source:Zt,root:A.tickets,canReport:()=>!!Xn()?.canOpenReport(),report:()=>{Xn()?.openReport()&&(Ye(),Je(!1))},onGone:Zn}),Ho=Vi({doc:e,TEXT:t,source:At,root:A.article,hasSupport:()=>ze("support"),openSupport:Yt,back:()=>{Be("guides"),Jt.focusGuide(Kn)||ti()}}),Xt=n=>{if(P==="home")Yi({doc:e,TEXT:t,root:A.home,name:H,source:At,support:ze("support"),guides:ze("guides"),last:Cn(),openSupport:Yt,searchGuides:()=>Be("guides",!0),openGuide:Yn,onHidden:Jn,tickets:ze("tickets")?Zt:null,openTickets:()=>Be("tickets",!0),onTicketsGone:Zn});else if(P==="tickets"){ei.show(n);return}else if(P==="guides"){Jt.show(n);return}n&&ti()};function ti(){P==="support"?h.focus():ri(A[P])[0]?.focus()}function Be(n,a=!1){n!=="support"&&(Ie(!1),$e(!1)),P=n;for(let u of Object.keys(A))A[u].hidden=u!==n;F.hidden=R.hidden=ne.hidden=n!=="support",K.hidden=n==="support";let d=n==="article"?"guides":n;for(let u of N.querySelectorAll("button"))u.getAttribute("data-view")===d?u.setAttribute("aria-current","page"):u.removeAttribute("aria-current");J&&Xt(a)}let ni={home:["home",t.tabHome],support:["chat",t.tabSupport],tickets:["ticket",t.tabTickets],guides:["book",t.tabGuides]};function ii(){let n=N.querySelector('[data-view="tickets"]');if(n?.querySelector(".ec-count")?.remove(),!n||!z)return;let a=n.appendChild(T("span","ec-count"));a.append(T("span","",String(z)),T("span","ec-sr",t.ticketsWaiting.replace("{n}",String(z)))),a.firstElementChild.setAttribute("aria-hidden","true")}let No=()=>{Ye(),Je(),Ae=!0,p.hidden=!0,fe?.(),fe=null};function Lt(){if(L=y.filter(a=>a!=="tickets"||k&&!O),!L.some(a=>a!=="home"))return No();Ae&&(Ae=!1,p.hidden=!1,tn()),ze("support")||Ye(),N.hidden=L.length<2,N.replaceChildren(...L.map(a=>{let d=te("ec-tab");return d.setAttribute("data-view",a),d.append(Q(e,ni[a][0],18),T("span","",ni[a][1])),d.addEventListener("click",()=>{Be(a),d.focus()}),d})),ii(),Be(J&&ze(P==="article"?"guides":P)?P:L[0])}let oi=()=>{J||Ae||(J=!0,l.hidden=!1,yi(),C.setAttribute("aria-expanded","true"),Xt(!0))},Je=(n=!0)=>{J&&(J=!1,Ie(!1),$e(!1),Ke(),l.hidden=!0,C.setAttribute("aria-expanded","false"),n&&C.focus())},ri=n=>Array.from(n.querySelectorAll("button, textarea, input, a[href]")).filter(a=>!a.hasAttribute("disabled")&&!a.closest("[hidden], [inert]")),ai=n=>{if(!J)return;if(n.key==="Escape"){n.preventDefault(),V.hidden?_.hidden?Je():Ie():$e();return}if(n.key!=="Tab")return;let a=ri(_.hidden?l:_);if(a.length===0)return;let d=a[0],u=a[a.length-1],w=r.activeElement;n.shiftKey&&(w===d||!a.includes(w))?(n.preventDefault(),u.focus()):!n.shiftKey&&(w===u||!a.includes(w))&&(n.preventDefault(),d.focus())},si=n=>{n.key!=="Enter"||n.shiftKey||n.isComposing||(n.preventDefault(),Ct())},St=()=>{h.style.height="",h.style.height=`${Math.min(h.scrollHeight,120)}px`,We()},ci=n=>{n.preventDefault(),Ct()},li=()=>{G.busy&&!h.value.trim()?Ye():Ct()},di=()=>{J?Je():oi()},pi=()=>{$e(!1),_.hidden?So():Ie()},ui=n=>{let a=n.composedPath();!a.includes(V)&&!a.includes(ne)&&$e(!1),!_.hidden&&!a.includes(_)&&!a.includes(F)&&Ie(!1)},fi=n=>{n.composedPath().includes(s)||(Ie(!1),$e(!1))},gi=()=>{Ve=f.scrollHeight-f.scrollTop-f.clientHeight<=60,ve.hidden=Ve},hi=()=>{Ve=!0,nt(),ve.hidden=!0,h.focus()},mi=n=>Tt(n.target),en=!1,Ro=n=>{if(n.type==="focusin")return en||!!r.activeElement?.closest(".ec-card");let a="changedTouches"in n?n.changedTouches[0]:n;return!!(a&&typeof r.elementFromPoint=="function"?r.elementFromPoint(a.clientX,a.clientY):null)?.closest(".ec-card")},vi=n=>{if(!n.composedPath().includes(s)||!He.size)return;let a=Ro(n);n.type==="pointerdown"||n.type==="touchstart"||n.type==="mousedown"?en=a:n.type==="mouseup"&&(en=!1),a&&(n.stopPropagation(),n.type==="pointerdown"&&Ie(!1))},bi=()=>i.theme??X?.theme??"auto",xi=()=>{let n=C.getBoundingClientRect(),a=q?.innerWidth??0,d=q?.innerHeight??0,u=n.width?n.left+n.width/2:o.endsWith("left")?40:a-40,w=n.height?n.top+n.height/2:o.startsWith("top")?40:d-40;s.setAttribute("data-theme",Ot(e,s,u,w))},tn=()=>{let n=bi();n!=="auto"?(fe?.(),fe=null,s.setAttribute("data-theme",n)):yi()};function yi(){bi()==="auto"&&(fe?xi():fe=eo(e,xi))}let ki=n=>{let a=d=>{if(n&&/^https:\/\//i.test(n)){let u=e.createElement("img");return u.alt="",u.referrerPolicy="no-referrer",u.decoding="async",u.width=u.height=d,u.addEventListener("error",()=>u.replaceWith(Q(e,"chat",d===52?24:16)),{once:!0}),u.src=n,u}return Q(e,ji(n)?n:"chat",d===52?24:16)};U.replaceChildren(a(52)),I.replaceChildren(a(30))},wi=()=>{let n=i.title||X?.name||t.title;j.textContent=n,C.setAttribute("aria-label",i.title||X?.name?`${t.open} (${n})`:t.open),B.hidden=!X?.enabled,tn()},nn=()=>{Ae||_e||(C.removeAttribute("data-pending"),C.removeAttribute("inert"))},Po=n=>{_e||(X=n,y=n?n.sections:["support"],n?.icon&&ki(n.icon),wi(),pt(),_.hidden||Wt(),Lt(),nn())};zt(),pt(),ki(null),wi(),Qt(""),V.setAttribute("aria-label",t.more),We(),Nn();let _o=It(p);p.addEventListener("keydown",ai),p.addEventListener("pointerdown",ui),e.addEventListener("pointerdown",fi,!0);for(let n of ro)q?.addEventListener(n,vi,ao);_.addEventListener("keydown",Qn),_.addEventListener("focusin",mi),h.addEventListener("keydown",si),h.addEventListener("input",St),m.addEventListener("submit",ci),M.addEventListener("click",li),C.addEventListener("click",di),F.addEventListener("click",pi),$.addEventListener("click",Je),R.addEventListener("click",Ut),l.addEventListener("pointerenter",Ke),de.addEventListener("click",Fn),K.addEventListener("click",Kt),ie.addEventListener("click",jn),ne.addEventListener("click",Vn),V.addEventListener("keydown",Wn),f.addEventListener("scroll",gi),ve.addEventListener("click",hi),e.body.appendChild(s);let Mt=i.presence===!1?null:bn(xe,{lang:i.lang,text:{presenceNotice:t.presenceNotice,presenceNoticeNamed:t.presenceNoticeNamed,stop:t.stop},idleMs:0,onStop:Ye,doc:e,themeOf:()=>s.getAttribute("data-theme")==="dark"?"dark":"light",nameOf:()=>i.title||X?.name,origin:()=>{let n=(J?l:C).getBoundingClientRect(),a=N.hidden?0:N.offsetHeight;return n.width?{x:n.left+n.width/2,y:J?n.bottom-60-a:n.top+n.height/2}:null}});tn();let Ei=q?.setTimeout(nn,Hr);return G.getConfig().then(Po),{open:oi,close:()=>Je(),identify(n,a,d){let u=ft(n,a);if(_e)return;let w=u?so(d):"";w!==H&&(H=w,J&&P==="home"&&Xt(!1)),!(u?.email===k?.email&&u?.hash===k?.hash)&&(k=u,O=!1,Zt.identify(u),ei.reset(),A.home.replaceChildren(),On(()=>G.identify(u)),Lt(),X!==void 0&&nn())},destroy(){Ye(),Ke(),fe?.(),fe=null,_e=!0,Jt.destroy(),Mt?.destroy(),xe.policy({allow:ye.allow,confirm:ye.confirm}),Ei!==void 0&&q?.clearTimeout(Ei),G.destroy(),_o(),p.removeEventListener("keydown",ai),p.removeEventListener("pointerdown",ui),e.removeEventListener("pointerdown",fi,!0);for(let n of ro)q?.removeEventListener(n,vi,ao);_.removeEventListener("keydown",Qn),_.removeEventListener("focusin",mi),h.removeEventListener("keydown",si),h.removeEventListener("input",St),m.removeEventListener("submit",ci),M.removeEventListener("click",li),C.removeEventListener("click",di),F.removeEventListener("click",pi),$.removeEventListener("click",Je),R.removeEventListener("click",Ut),l.removeEventListener("pointerenter",Ke),de.removeEventListener("click",Fn),K.removeEventListener("click",Kt),ie.removeEventListener("click",jn),ne.removeEventListener("click",Vn),V.removeEventListener("keydown",Wn),f.removeEventListener("scroll",gi),ve.removeEventListener("click",hi),s.remove()},client:G}}export{xn as CHAT_HOST_ATTRIBUTE,Ji as DEFAULT_CHAT_TEXT,$t as PRESENCE_HOST_ATTRIBUTE,vt as chatTextFor,cn as createChatClient,Gt as describeAction,vn as describeError,bt as describeValue,Dr as installChatWidget,Ar as installPresence};
|
|
1028
1110
|
/*! Chat styles adapted from Beautiful UI (https://github.com/slev12397/beautiful-ui)
|
|
1029
1111
|
*
|
|
1030
1112
|
* MIT License
|