@squadico/chatbot 1.5.2 → 1.7.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.
Files changed (45) hide show
  1. package/README.md +4 -4
  2. package/dist/{answer-Bi8GWLyA.cjs → answer-BO2Hs9k1.cjs} +2 -2
  3. package/dist/{answer-Bi8GWLyA.cjs.map → answer-BO2Hs9k1.cjs.map} +1 -1
  4. package/dist/{answer-BDuY6oLY.js → answer-DF91dBOx.js} +2 -2
  5. package/dist/{answer-BDuY6oLY.js.map → answer-DF91dBOx.js.map} +1 -1
  6. package/dist/chatbot-widgets.global.js +3 -3
  7. package/dist/chatbot-widgets.global.js.map +1 -1
  8. package/dist/chatbot.global.js +11 -11
  9. package/dist/chatbot.global.js.map +1 -1
  10. package/dist/components/AgentRail.d.ts +3 -3
  11. package/dist/components/AgentRail.d.ts.map +1 -1
  12. package/dist/components/ChatbotWidget.d.ts.map +1 -1
  13. package/dist/extras-BeCZR-6X.cjs +4 -0
  14. package/dist/extras-BeCZR-6X.cjs.map +1 -0
  15. package/dist/{extras-BSCTuiit.js → extras-D94278IT.js} +135 -112
  16. package/dist/extras-D94278IT.js.map +1 -0
  17. package/dist/index.cjs +1 -1
  18. package/dist/index.js +2 -2
  19. package/dist/lib/client.d.ts +4 -0
  20. package/dist/lib/client.d.ts.map +1 -1
  21. package/dist/lib/conversation.d.ts +10 -4
  22. package/dist/lib/conversation.d.ts.map +1 -1
  23. package/dist/lib/useChat.d.ts +10 -2
  24. package/dist/lib/useChat.d.ts.map +1 -1
  25. package/dist/react.cjs +1 -1
  26. package/dist/react.js +1 -1
  27. package/dist/{src-B7GLD1Xs.js → src-Bm_aRvFA.js} +604 -539
  28. package/dist/src-Bm_aRvFA.js.map +1 -0
  29. package/dist/src-DcPZdalT.cjs +7 -0
  30. package/dist/src-DcPZdalT.cjs.map +1 -0
  31. package/dist/types.d.ts +2 -0
  32. package/dist/types.d.ts.map +1 -1
  33. package/dist/widgets/approval/SqcApproval.d.ts.map +1 -1
  34. package/dist/widgets/extras-loader.d.ts +1 -1
  35. package/dist/widgets.cjs +1 -1
  36. package/dist/widgets.js +2 -2
  37. package/package.json +1 -1
  38. package/dist/extras-BAqWS9pU.cjs +0 -4
  39. package/dist/extras-BAqWS9pU.cjs.map +0 -1
  40. package/dist/extras-BSCTuiit.js.map +0 -1
  41. package/dist/lib/rail.d.ts +0 -20
  42. package/dist/lib/rail.d.ts.map +0 -1
  43. package/dist/src-B7GLD1Xs.js.map +0 -1
  44. package/dist/src-DuYhMbNf.cjs +0 -7
  45. package/dist/src-DuYhMbNf.cjs.map +0 -1
package/README.md CHANGED
@@ -314,7 +314,7 @@ and [unpkg](https://unpkg.com) as soon as a version is published — there is
314
314
  nothing else to deploy. Add the script, then the tag, anywhere in the page:
315
315
 
316
316
  ```html
317
- <script src="https://cdn.jsdelivr.net/npm/@squadico/chatbot@1.5.2/dist/chatbot.global.js"></script>
317
+ <script src="https://cdn.jsdelivr.net/npm/@squadico/chatbot@1.7.0/dist/chatbot.global.js"></script>
318
318
  <squadico-chatbot
319
319
  embed-key="sq_pub_paste_yours_here"
320
320
  context='{"workspaceId":"WS-1"}'
@@ -322,7 +322,7 @@ nothing else to deploy. Add the script, then the tag, anywhere in the page:
322
322
  ```
323
323
 
324
324
  unpkg works the same way:
325
- `https://unpkg.com/@squadico/chatbot@1.5.2/dist/chatbot.global.js`.
325
+ `https://unpkg.com/@squadico/chatbot@1.7.0/dist/chatbot.global.js`.
326
326
 
327
327
  The form an agent may ask the visitor to fill in, the charts it draws and the
328
328
  Yes / No card of a tool call waiting on the visitor's approval live
@@ -330,14 +330,14 @@ in a second file, `chatbot-widgets.global.js`, published next to
330
330
  `chatbot.global.js` in `dist/`. The chat loads it on its own, from the same
331
331
  folder as its own script, the first time an answer holds a form, a chart or an approval — so it is never fetched by a conversation that does
332
332
  not need it. A self-hosted copy must therefore keep both files side by side.
333
- The short CDN URL (`https://cdn.jsdelivr.net/npm/@squadico/chatbot@1.5.2`,
333
+ The short CDN URL (`https://cdn.jsdelivr.net/npm/@squadico/chatbot@1.7.0`,
334
334
  served through the package's `jsdelivr` / `unpkg` fields) works too: a script URL
335
335
  that does not end in `.js` is taken as the package root, and the extras file is
336
336
  fetched from its `dist/` folder. The injected script carries the main script's
337
337
  `nonce`, so a CSP built on nonces covers it. Until the file arrives — or if it
338
338
  cannot — a form shows its field labels and a chart its filename, as plain text.
339
339
 
340
- **Pin the version.** `@1.5.2` never changes, so a release cannot alter a
340
+ **Pin the version.** `@1.7.0` never changes, so a release cannot alter a
341
341
  customer page. Leaving it out (`@squadico/chatbot/dist/…`) serves the latest
342
342
  version, cached by jsDelivr for up to 12 hours; a range such as `@1` follows the
343
343
  newest `1.x.y`. Prefer a pinned version in production.
@@ -1,8 +1,8 @@
1
1
  var e,t,n,r,i,a,o,s,c,l,u,d,f,p,m={},h=[],g=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,_=Array.isArray;function v(e,t){for(var n in t)e[n]=t[n];return e}function y(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function b(t,n,r){var i,a,o,s={};for(o in n)o==`key`?i=n[o]:o==`ref`?a=n[o]:s[o]=n[o];if(arguments.length>2&&(s.children=arguments.length>3?e.call(arguments,2):r),typeof t==`function`&&t.defaultProps!=null)for(o in t.defaultProps)s[o]===void 0&&(s[o]=t.defaultProps[o]);return x(t,s,i,a,null)}function x(e,r,i,a,o){var s={type:e,props:r,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++n,__i:-1,__u:0};return o==null&&t.vnode!=null&&t.vnode(s),s}function S(e){return e.children}function C(e,t){this.props=e,this.context=t}function w(e,t){if(t==null)return e.__?w(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?w(e):null}function ee(e){if(e.__P&&e.__d){var n=e.__v,r=n.__e,i=[],a=[],o=v({},n);o.__v=n.__v+1,t.vnode&&t.vnode(o),re(e.__P,o,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,i,r??w(n),!!(32&n.__u),a),o.__v=n.__v,o.__.__k[o.__i]=o,ae(i,o,a),n.__e=n.__=null,o.__e!=r&&T(o)}}function T(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),T(e)}function E(e){(!e.__d&&(e.__d=!0)&&r.push(e)&&!D.__r++||i!=t.debounceRendering)&&((i=t.debounceRendering)||a)(D)}function D(){try{for(var e,t=1;r.length;)r.length>t&&r.sort(o),e=r.shift(),t=r.length,ee(e)}finally{r.length=D.__r=0}}function te(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,g,_,v,y=r&&r.__k||h,b=t.length;for(c=O(n,t,y,c,b),d=0;d<b;d++)(p=n.__k[d])!=null&&(f=p.__i!=-1&&y[p.__i]||m,p.__i=d,v=re(e,p,f,i,a,o,s,c,l,u),g=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&N(f.ref,null,p),u.push(p.ref,p.__c||g,p)),_==null&&g!=null&&(_=g),4&p.__u?(c=k(p,c,e),f.__e&&(f.__e=null)):typeof p.type==`function`&&v!==void 0?c=v:g&&(c=g.nextSibling),p.__u&=-7);return n.__e=_,c}function O(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?o=e.__k[a]=x(null,o,null,null,null):_(o)?o=e.__k[a]=x(S,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[a]=x(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[a]=o,c=a+f,o.__=e,o.__b=e.__b+1,s=null,(l=o.__i=ne(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=w(s)),ce(s,s));return r}function k(e,t,n){var r,i;if(typeof e.type==`function`){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=k(r[i],t,n));return t}e.__e!=t&&(t&&e.type&&!t.parentNode&&(t=w(e)),t=n.insertBefore(e.__e,t||null));do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function ne(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&!(2&l.__u);if(l===null&&s==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function A(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||g.test(t)?n:n+`px`}function j(e,t,n,r,i){var a,o;n:if(t==`style`){if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||A(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||A(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(u,`$1`)),o=t.toLowerCase(),t=o in e||t==`onFocusOut`||t==`onFocusIn`?o.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=n,n?r?n[l]=r[l]:(n[l]=d,e.addEventListener(t,a?p:f,a)):e.removeEventListener(t,a?p:f,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function M(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n[c]==null)n[c]=d++;else if(n[c]<r[l])return;return r(t.event?t.event(n):n)}}}function re(e,n,r,i,a,o,s,c,l,u){var d,f,p,m,g,b,x,ee,T,E,D,O,k,ne,A,j,M=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),o=[c=n.__e=r.__e]),(d=t.__b)&&d(n);n:if(typeof M==`function`){f=s.length;try{if(T=n.props,E=M.prototype&&M.prototype.render,D=(d=M.contextType)&&i[d.__c],O=d?D?D.props.value:d.__:i,r.__c?ee=(p=n.__c=r.__c).__=p.__E:(E?n.__c=p=new M(T,O):(n.__c=p=new C(T,O),p.constructor=M,p.render=le),D&&D.sub(p),p.state||(p.state={}),p.__n=i,m=p.__d=!0,p.__h=[],p._sb=[]),E&&p.__s==null&&(p.__s=p.state),E&&M.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=v({},p.__s)),v(p.__s,M.getDerivedStateFromProps(T,p.__s))),g=p.props,b=p.state,p.__v=n,m)E&&M.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),E&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(E&&M.getDerivedStateFromProps==null&&T!==g&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(T,O),n.__v==r.__v||!p.__e&&p.shouldComponentUpdate!=null&&!1===p.shouldComponentUpdate(T,p.__s,O)){n.__v!=r.__v&&(p.props=T,p.state=p.__s,p.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(e){e&&(e.__=n)}),h.push.apply(p.__h,p._sb),p._sb=[],p.__h.length&&s.push(p),c=w(r);break n}p.componentWillUpdate!=null&&p.componentWillUpdate(T,p.__s,O),E&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(g,b,x)})}if(p.context=O,p.props=T,p.__P=e,p.__e=!1,k=t.__r,ne=0,E)p.state=p.__s,p.__d=!1,k&&k(n),d=p.render(p.props,p.state,p.context),h.push.apply(p.__h,p._sb),p._sb=[];else do p.__d=!1,k&&k(n),d=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++ne<25);p.state=p.__s,p.getChildContext!=null&&(i=v(v({},i),p.getChildContext())),E&&!m&&p.getSnapshotBeforeUpdate!=null&&(x=p.getSnapshotBeforeUpdate(g,b)),A=d!=null&&d.type===S&&d.key==null?oe(d.props.children):d,c=te(e,_(A)?A:[A],n,r,i,a,o,s,c,l,u),p.base=n.__e,n.__u&=-161,p.__h.length&&s.push(p),ee&&(p.__E=p.__=null)}catch(e){if(s.length=f,n.__v=null,l||o!=null){if(e.then){for(n.__u|=l?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;o!=null&&(o[o.indexOf(c)]=null),n.__e=c}else if(o!=null)for(j=o.length;j--;)y(o[j])}else n.__e=r.__e;n.__k??(n.__k=r.__k||[]),e.then||ie(n),t.__e(e,n,r)}}else o==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):c=n.__e=se(r.__e,n,r,i,a,o,s,l,u);return(d=t.diffed)&&d(n),128&n.__u?void 0:c}function ie(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(ie))}function ae(e,n,r){for(var i=0;i<r.length;i++)N(r[i],r[++i],r[++i]);t.__c&&t.__c(n,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(e){e.call(n)})}catch(e){t.__e(e,n.__v)}})}function oe(e){return typeof e!=`object`||!e||e.__b>0?e:_(e)?e.map(oe):e.constructor===void 0?v({},e):null}function se(n,r,i,a,o,s,c,l,u){var d,f,p,h,g,v,b,x=i.props||m,S=r.props,C=r.type;if(C==`svg`?o=`http://www.w3.org/2000/svg`:C==`math`?o=`http://www.w3.org/1998/Math/MathML`:o||(o=`http://www.w3.org/1999/xhtml`),s!=null){for(d=0;d<s.length;d++)if((g=s[d])&&`setAttribute`in g==!!C&&(C?g.localName==C:g.nodeType==3)){n=g,s[d]=null;break}}if(n==null){if(C==null)return document.createTextNode(S);n=document.createElementNS(o,C,S.is&&S),l&&(t.__m&&t.__m(r,s),l=!1),s=null}if(C==null)x===S||l&&n.data==S||(n.data=S);else{if(s=C==`textarea`&&S.defaultValue!=null?null:s&&e.call(n.childNodes),!l&&s!=null)for(x={},d=0;d<n.attributes.length;d++)x[(g=n.attributes[d]).name]=g.value;for(d in x)g=x[d],d==`dangerouslySetInnerHTML`?p=g:d==`children`||d in S||d==`value`&&`defaultValue`in S||d==`checked`&&`defaultChecked`in S||j(n,d,null,g,o);for(d in S)g=S[d],d==`children`?h=g:d==`dangerouslySetInnerHTML`?f=g:d==`value`?v=g:d==`checked`?b=g:l&&typeof g!=`function`||x[d]===g||j(n,d,g,x[d],o);if(f)l||p&&(f.__html==p.__html||f.__html==n.innerHTML)||(n.innerHTML=f.__html),r.__k=[];else if(p&&(n.innerHTML=``),te(r.type==`template`?n.content:n,_(h)?h:[h],r,i,a,C==`foreignObject`?`http://www.w3.org/1999/xhtml`:o,s,c,s?s[0]:i.__k&&w(i,0),l,u),s!=null)for(d=s.length;d--;)y(s[d]);l&&C!=`textarea`||(d=`value`,C==`progress`&&v==null?n.removeAttribute(`value`):v!=null&&(v!==n[d]||C==`progress`&&!v||C==`option`&&v!=x[d])&&j(n,d,v,x[d],o),d=`checked`,b!=null&&b!=n[d]&&j(n,d,b,x[d],o))}return n}function N(e,n,r){try{if(typeof e==`function`){var i=typeof e.__u==`function`;i&&e.__u(),i&&n==null||(e.__u=e(n))}else e.current=n}catch(e){t.__e(e,r)}}function ce(e,n,r){var i,a;if(t.unmount&&t.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||N(i,null,n)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){t.__e(e,n)}i.base=i.__P=i.__n=null}if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&ce(i[a],n,r||typeof e.type!=`function`);r||y(e.__e),e.__c=e.__=e.__e=void 0}function le(e,t,n){return this.constructor(e,n)}function ue(n,r,i){var a,o,s,c;r==document&&(r=document.documentElement),t.__&&t.__(n,r),o=(a=typeof i==`function`)?null:i&&i.__k||r.__k,s=[],c=[],re(r,n=(!a&&i||r).__k=b(S,null,[n]),o||m,m,r.namespaceURI,!a&&i?[i]:o?null:r.firstChild?e.call(r.childNodes):null,s,!a&&i?i:o?o.__e:r.firstChild,a,c),ae(s,n,c),n.props.children=null}e=h.slice,t={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},n=0,C.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=v({},this.state);typeof e==`function`&&(e=e(v({},n),this.props)),e&&v(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),E(this))},C.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),E(this))},C.prototype.render=S,r=[],a=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,o=function(e,t){return e.__v.__b-t.__v.__b},D.__r=0,s=Math.random().toString(8),c=`__d`+s,l=`__a`+s,u=/(PointerCapture)$|Capture$/i,d=0,f=M(!1),p=M(!0);var P,F,de,fe,I=0,pe=[],L=t,me=L.__b,he=L.__r,ge=L.diffed,_e=L.__c,ve=L.unmount,ye=L.__;function R(e,t){L.__h&&L.__h(F,e,I||t),I=0;var n=F.__H||(F.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function z(e){return I=1,be(Ae,e)}function be(e,t,n){var r=R(P++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Ae(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=F,!F.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=!1,o=r.__c.props!==e;if(r.__c.__H.__.some(function(e){if(e.__N){i=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),a){var s=a.call(this,e,t,n);return i?s||o:s}return!i||o};F.__f=!0;var a=F.shouldComponentUpdate,o=F.componentWillUpdate;F.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},F.shouldComponentUpdate=i}return r.__N||r.__}function xe(e,t){var n=R(P++,3);!L.__s&&ke(n.__H,t)&&(n.__=e,n.u=t,F.__H.__h.push(n))}function Se(e,t){var n=R(P++,4);!L.__s&&ke(n.__H,t)&&(n.__=e,n.u=t,F.__h.push(n))}function Ce(e){return I=5,B(function(){return{current:e}},[])}function B(e,t){var n=R(P++,7);return ke(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function we(e,t){return I=8,B(function(){return e},t)}function Te(){for(var e;e=pe.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(V),t.__h.some(Oe),t.__h=[]}catch(n){t.__h=[],L.__e(n,e.__v)}}}L.__b=function(e){F=null,me&&me(e)},L.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ye&&ye(e,t)},L.__r=function(e){he&&he(e),P=0;var t=(F=e.__c).__H;t&&(de===F?(t.__h=[],F.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(V),t.__h.some(Oe),t.__h=[],P=0)),de=F},L.diffed=function(e){ge&&ge(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(pe.push(t)!==1&&fe===L.requestAnimationFrame||((fe=L.requestAnimationFrame)||De)(Te)),t.__H.__.some(function(e){e.u&&(e.__H=e.u,e.u=void 0)})),de=F=null},L.__c=function(e,t){t.some(function(e){try{e.__h.some(V),e.__h=e.__h.filter(function(e){return!e.__||Oe(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],L.__e(n,e.__v)}}),_e&&_e(e,t)},L.unmount=function(e){ve&&ve(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{V(e)}catch(e){t=e}}),n.__H=void 0,t&&L.__e(t,n.__v))};var Ee=typeof requestAnimationFrame==`function`;function De(e){var t,n=function(){clearTimeout(r),Ee&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Ee&&(t=requestAnimationFrame(n))}function V(e){var t=F,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),F=t}function Oe(e){var t=F;e.__c=e.__(),F=t}function ke(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Ae(e,t){return typeof t==`function`?t(e):t}var je=`en`,Me=[`en`,`fr`,`es`],Ne={en:{heading:`Assistant`,subheading:`Squadico`,placeholder:`Ask your question…`,greeting:`Hello! I am your assistant. What would you like to do?`,hint:`The assistant proposes an action; nothing is applied without your confirmation.`,assistant:`Assistant`,typing:`The assistant is writing its answer`,activity:{knowledge:`Searching the knowledge base…`,skill:`Following a procedure…`,delegation:`Asking a colleague…`,tool:`Looking it up…`},newConversation:`New conversation`,close:`Close the assistant`,closeTitle:`Close`,history:{open:`Conversation history`,menu:`Previous conversations`,loading:`Loading…`,empty:`No previous conversation.`,untitled:`Conversation`},context:{region:`Context sent to the assistant`},approval:{group:`Write confirmation`,approve:`Yes, apply`,reject:`No, cancel`,request:`The agent wants to use {tool}.`,arguments:`With`,edit:`Change…`,correction:`What to change — e.g. “the due date is next Monday”`,correctionLabel:`Correction to make before approving`,send:`Send`},confirm:{group:`Confirmation`,yes:`Yes`,no:`No`,yesValue:`yes`,noValue:`no`,other:`Propose something else`},choices:`Suggested options`,table:{copy:`Copy`,copied:`Copied`,more:`{count} more rows`},form:{submit:`Send`,required:`Required`,email:`Enter a valid email address`,number:`Enter a number`},poweredBy:`Powered by Squadico`,handles:{picker:`Agents you can address`,unknown:`Nobody answers to that name here:`,instead:`You can address:`,rail:`Agents`},selection:{group:`Suggested choice`,single:`Pick one option.`,multiple:`Pick one or more options, then validate.`,validate:`Validate`},composer:{label:`Your message`,send:`Send the message`,sendTitle:`Send`,stop:`Stop the answer`,stopTitle:`Stop`,attach:`Attach a file`,attachTitle:`Attach`,remove:`Remove {name}`},attachments:{unsupported:`This kind of file cannot be attached to a message.`,tooLarge:`This file is too large.`,tooMany:`This message already carries as many files as it may.`,unreadable:`This file could not be read.`,failed:`This file could not be attached.`},error:`Something went wrong, the assistant could not answer. Try again in a moment.`,withHuman:`A member of the team will reply to you here.`},fr:{heading:`Assistant`,subheading:`Squadico`,placeholder:`Posez votre question…`,greeting:`Bonjour ! Je suis votre assistant. Que souhaitez-vous faire ?`,hint:`L'assistant propose une action ; rien n'est appliqué sans votre confirmation.`,assistant:`Assistant`,typing:`L'assistant rédige sa réponse`,activity:{knowledge:`Recherche dans la base de connaissances…`,skill:`Application d'une procédure…`,delegation:`Consultation d'un collègue…`,tool:`Recherche en cours…`},newConversation:`Nouvelle conversation`,close:`Fermer l'assistant`,closeTitle:`Fermer`,history:{open:`Historique des conversations`,menu:`Conversations précédentes`,loading:`Chargement…`,empty:`Aucune conversation précédente.`,untitled:`Conversation`},context:{region:`Contexte transmis à l'assistant`},approval:{group:`Validation de l'écriture`,approve:`Oui, appliquer`,reject:`Non, annuler`,request:`L'agent souhaite utiliser {tool}.`,arguments:`Avec`,edit:`Modifier…`,correction:`Ce qu'il faut changer — ex. « l'échéance est lundi prochain »`,correctionLabel:`Correction à apporter avant validation`,send:`Envoyer`},confirm:{group:`Confirmation`,yes:`Oui`,no:`Non`,yesValue:`oui`,noValue:`non`,other:`Proposer autre chose`},choices:`Options proposées`,table:{copy:`Copier`,copied:`Copié`,more:`{count} lignes de plus`},form:{submit:`Envoyer`,required:`Obligatoire`,email:`Saisissez une adresse e-mail valide`,number:`Saisissez un nombre`},poweredBy:`Propulsé par Squadico`,handles:{picker:`Agents que vous pouvez adresser`,unknown:`Personne ne répond à ce nom ici :`,instead:`Vous pouvez adresser :`,rail:`Agents`},selection:{group:`Choix proposé`,single:`Sélectionnez une option.`,multiple:`Sélectionnez une ou plusieurs options, puis validez.`,validate:`Valider`},composer:{label:`Votre message`,send:`Envoyer le message`,sendTitle:`Envoyer`,stop:`Interrompre la réponse`,stopTitle:`Interrompre`,attach:`Joindre un fichier`,attachTitle:`Joindre`,remove:`Retirer {name}`},attachments:{unsupported:`Ce format de fichier ne peut pas être joint à un message.`,tooLarge:`Ce fichier est trop volumineux.`,tooMany:`Ce message porte déjà autant de fichiers qu'il le peut.`,unreadable:`Ce fichier n'a pas pu être lu.`,failed:`Impossible de joindre ce fichier.`},error:`Une erreur est survenue, l'assistant n'a pas pu répondre. Réessayez dans un instant.`,withHuman:`Un membre de l'équipe va vous répondre ici.`},es:{heading:`Asistente`,subheading:`Squadico`,placeholder:`Haga su pregunta…`,greeting:`¡Hola! Soy su asistente. ¿Qué desea hacer?`,hint:`El asistente propone una acción; no se aplica nada sin su confirmación.`,assistant:`Asistente`,typing:`El asistente está redactando su respuesta`,activity:{knowledge:`Buscando en la base de conocimientos…`,skill:`Siguiendo un procedimiento…`,delegation:`Consultando a un compañero…`,tool:`Consultando…`},newConversation:`Nueva conversación`,close:`Cerrar el asistente`,closeTitle:`Cerrar`,history:{open:`Historial de conversaciones`,menu:`Conversaciones anteriores`,loading:`Cargando…`,empty:`Ninguna conversación anterior.`,untitled:`Conversación`},context:{region:`Contexto enviado al asistente`},approval:{group:`Validación de la escritura`,approve:`Sí, aplicar`,reject:`No, cancelar`,request:`El agente quiere usar {tool}.`,arguments:`Con`,edit:`Modificar…`,correction:`Lo que hay que cambiar — p. ej. «el vencimiento es el lunes»`,correctionLabel:`Corrección antes de validar`,send:`Enviar`},confirm:{group:`Confirmación`,yes:`Sí`,no:`No`,yesValue:`sí`,noValue:`no`,other:`Proponer otra cosa`},choices:`Opciones propuestas`,table:{copy:`Copiar`,copied:`Copiado`,more:`{count} filas más`},form:{submit:`Enviar`,required:`Obligatorio`,email:`Introduzca un correo electrónico válido`,number:`Introduzca un número`},poweredBy:`Con la tecnología de Squadico`,handles:{picker:`Agentes a los que puedes dirigirte`,unknown:`Nadie responde a ese nombre aquí:`,instead:`Puedes dirigirte a:`,rail:`Agentes`},selection:{group:`Opción propuesta`,single:`Seleccione una opción.`,multiple:`Seleccione una o varias opciones y valide.`,validate:`Validar`},composer:{label:`Su mensaje`,send:`Enviar el mensaje`,sendTitle:`Enviar`,stop:`Interrumpir la respuesta`,stopTitle:`Interrumpir`,attach:`Adjuntar un archivo`,attachTitle:`Adjuntar`,remove:`Quitar {name}`},attachments:{unsupported:`Este tipo de archivo no se puede adjuntar a un mensaje.`,tooLarge:`Este archivo es demasiado grande.`,tooMany:`Este mensaje ya lleva todos los archivos que puede llevar.`,unreadable:`No se ha podido leer este archivo.`,failed:`No se ha podido adjuntar este archivo.`},error:`Se ha producido un error, el asistente no ha podido responder. Inténtelo de nuevo.`,withHuman:`Un miembro del equipo le responderá aquí.`}},Pe={en:`en-GB`,fr:`fr-FR`,es:`es-ES`};function Fe(e){let t=e?.trim().toLowerCase().split(/[-_]/)[0];return t&&t in Ne?t:void 0}function Ie(){return typeof navigator>`u`?[]:navigator.languages?.length?navigator.languages:[navigator.language]}function Le(e){let t=e?.trim(),n=(t?[t]:Ie()).find(Fe),r=Fe(n)??`en`;return{code:r,tag:n?.includes(`-`)?n:Pe[r],t:Ne[r]}}var Re=0;Array.isArray;function H(e,n,r,i,a,o){n||(n={});var s,c,l=n;if(`ref`in l)for(c in l={},n)c==`ref`?s=n[c]:l[c]=n[c];var u={type:e,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Re,__i:-1,__u:0,__source:a,__self:o};if(typeof e==`function`&&(s=e.defaultProps))for(c in s)l[c]===void 0&&(l[c]=s[c]);return t.vnode&&t.vnode(u),u}function ze(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function Be(e,t){ze(e,t),t.add(e)}function U(e,t,n){ze(e,t),t.set(e,n)}function W(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function G(e,t){return e.get(W(e,t))}function K(e,t,n){return e.set(W(e,t),n),n}var Ve=new Map;function He(e){if(Ve.has(e))return Ve.get(e)??null;let t;try{t=new CSSStyleSheet,t.replaceSync(e)}catch{t=null}return Ve.set(e,t),t}function q(e,t,n){let r=[...t,`locked`,`language`];var i=new WeakMap,a=new WeakMap,o=new WeakMap,s=new WeakMap,c=new WeakSet;class l extends HTMLElement{constructor(){super(),Be(this,c),U(this,i,{locked:!1,language:`en`}),U(this,a,void 0),U(this,o,!1),U(this,s,e=>{G(i,this).locked||(this.set(`locked`,!0),this.dispatchEvent(new CustomEvent(`sqc-reply`,{detail:{text:e},bubbles:!0,composed:!0})))});let e=this.attachShadow({mode:`open`}),t=He(n);if(t)e.adoptedStyleSheets=[t];else{let t=document.createElement(`style`);t.textContent=n,e.append(t)}K(a,this,document.createElement(`div`)),e.append(G(a,this));for(let e of r){if(!Object.hasOwn(this,e))continue;let t=this[e];delete this[e],this[e]=t}}connectedCallback(){K(o,this,!0),W(c,this,u).call(this)}disconnectedCallback(){K(o,this,!1),ue(null,G(a,this))}set(e,t){G(i,this)[e]=t,W(c,this,u).call(this)}get(e){return G(i,this)[e]}}function u(){G(o,this)&&ue(b(e,{...G(i,this),reply:G(s,this)}),G(a,this))}for(let e of r)Object.defineProperty(l.prototype,e,{get(){return this.get(e)},set(t){this.set(e,t)},configurable:!0});return l}var J={table:`sqc-table`,choices:`sqc-choices`,confirm:`sqc-confirm`,form:`sqc-form`,chart:`sqc-chart`,approval:`sqc-approval`};function Y(e){return Le(e).t}var Ue=/(\*\*[^*\n]+\*\*|`[^`\n]+`|~~[^~\n]+~~|\[[^\]\n]+\]\([^)\s]+\)|\*[^*\n]+\*|https?:\/\/[^\s<>()]+)/g,We=/^\[([^\]\n]+)\]\(([^)\s]+)\)$/,Ge=/^(https?:|mailto:|\/(?!\/))/i;function Ke(e){if(typeof location>`u`)return!1;try{return new URL(e,location.href).origin===location.origin}catch{return!1}}function qe(e,t,n){return Ge.test(e)?Ke(e)?H(`a`,{href:e,children:t},n):H(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,children:t},n):t}function X(e,t){let n=e.split(Ue),r=[];return n.forEach((e,n)=>{if(!e)return;let i=`${t}-${n}`,a=We.exec(e);e.startsWith(`**`)&&e.endsWith(`**`)&&e.length>4?r.push(H(`strong`,{children:e.slice(2,-2)},i)):e.startsWith("`")&&e.endsWith("`")&&e.length>2?r.push(H(`code`,{children:e.slice(1,-1)},i)):e.startsWith(`~~`)&&e.endsWith(`~~`)&&e.length>4?r.push(H(`del`,{children:e.slice(2,-2)},i)):a?r.push(qe(a[2],a[1],i)):e.startsWith(`*`)&&e.endsWith(`*`)&&e.length>2?r.push(H(`em`,{children:e.slice(1,-1)},i)):/^https?:\/\//.test(e)?r.push(qe(e,e,i)):r.push(e)}),r}function Je(e){return e.replace(/\[([^\]\n]+)\]\([^)\s]+\)/g,`$1`).replace(/\*\*|~~|`|\*/g,``).trim()}function Ye(){return H(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.2`,"aria-hidden":`true`,children:H(`path`,{d:`M3.5 8.5l3 3 6-7`,"stroke-linecap":`round`,"stroke-linejoin":`round`})})}function Xe({options:e=[],multiple:t,checked:n,locked:r,language:i,reply:a}){let o=Y(i),s=e.map(Je),[c,l]=z(null),u=e.flatMap((e,t)=>n?.includes(e)?[t]:[]),d=c??(t?u:u.slice(0,1)),f=e=>{if(!r){if(!t){l([e]),a(s[e]);return}l(d.includes(e)?d.filter(t=>t!==e):[...d,e])}};return H(`div`,{class:`choices`,role:`group`,"aria-label":o.choices,children:[e.map((e,t)=>H(`button`,{type:`button`,class:`choice`,"aria-pressed":d.includes(t),disabled:r,onClick:()=>f(t),children:[H(`span`,{class:`box${d.includes(t)?` on`:``}`,"aria-hidden":`true`,children:d.includes(t)&&H(Ye,{})}),H(`span`,{class:`label`,children:X(e,`o${t}`)})]},`${t}-${s[t]}`)),t&&H(`button`,{type:`button`,class:`send`,disabled:r||d.length===0,onClick:()=>{l(d),a([...d].sort((e,t)=>e-t).map(e=>s[e]).join(`, `))},children:o.selection.validate})]})}function Ze({locked:e,language:t,reply:n}){let[r,i]=z(null),{confirm:a}=Y(t),o=[{value:a.yesValue,label:a.yes,kind:`yes`},{value:a.noValue,label:a.no,kind:`no`}];return H(`div`,{class:`confirm`,role:`group`,"aria-label":a.group,children:[o.map(t=>H(`button`,{type:`button`,class:t.kind,"aria-pressed":r===t.value,disabled:e,onClick:()=>{i(t.value),n(t.value)},children:t.label},t.kind)),H(`button`,{type:`button`,class:`other`,disabled:e,onClick:e=>e.currentTarget.dispatchEvent(new CustomEvent(`sqc-compose`,{bubbles:!0,composed:!0})),children:a.other})]})}var Qe=200,$e=new Intl.Collator(void 0,{numeric:!0,sensitivity:`base`}),Z=e=>Je(e??``).replace(/[\t\r\n]+/g,` `);function et({table:e,language:t}){let n=Y(t),{header:r=[],rows:i=[]}=e??{},[a,o]=z(null),[s,c]=z(!1),l=B(()=>{if(!a)return i;let e=a.descending?-1:1;return[...i].sort((t,n)=>e*$e.compare(Z(t[a.column]),Z(n[a.column])))},[i,a]),u=()=>{let e=[r,...l].map(e=>r.map((t,n)=>Z(e[n])).join(` `));navigator.clipboard?.writeText(e.join(`
2
2
  `)).then(()=>{c(!0),setTimeout(()=>c(!1),2e3)},()=>void 0)},d=l.length-Qe;return H(`div`,{children:[H(`div`,{class:`table`,children:H(`table`,{children:[H(`thead`,{children:H(`tr`,{children:r.map((e,t)=>H(`th`,{"aria-sort":a?.column===t?a.descending?`descending`:`ascending`:`none`,children:H(`button`,{type:`button`,onClick:()=>o({column:t,descending:a?.column===t&&!a.descending}),children:X(e,`h${t}`)})},t))})}),H(`tbody`,{children:l.slice(0,Qe).map((e,t)=>H(`tr`,{children:r.map((n,r)=>H(`td`,{children:X(e[r]??``,`r${t}c${r}`)},r))},t))})]})}),H(`div`,{class:`foot`,children:[d>0&&H(`span`,{children:n.table.more.replace(`{count}`,String(d))}),H(`button`,{type:`button`,class:`copy`,onClick:u,children:s?n.table.copied:n.table.copy})]})]})}var tt=`.choices{flex-direction:column;gap:7px;margin:10px 0 2px;display:flex}.choice{text-align:left;width:100%;color:var(--w-text);background:var(--w-bg);border:1px solid var(--w-border);cursor:pointer;border-radius:12px;align-items:center;gap:8px;padding:8px 11px;font-size:12.5px;display:flex}.choice:hover:not(:disabled){border-color:var(--w-border-strong);background:var(--w-surface)}.choice:disabled{cursor:default}.choice:disabled[aria-pressed=false]{opacity:.55}.choice[aria-pressed=true]{border-color:var(--w-border-strong);background:var(--w-selected)}.box{border:1.5px solid var(--w-border-strong);border-radius:4px;flex:none;justify-content:center;align-items:center;width:15px;height:15px;display:inline-flex}.choices:not(:has(.send)) .box{border-radius:50%}.box.on{color:var(--w-on-accent);background:var(--w-accent);border-color:var(--w-accent)}.box svg{width:11px;height:11px}.label{overflow-wrap:anywhere}.send{background:var(--w-accent);height:32px;color:var(--w-on-accent);cursor:pointer;border:0;border-radius:12px;align-self:flex-end;padding:0 14px;font-size:13px;font-weight:600}.send:disabled{opacity:.4;cursor:default}`,nt=`.confirm{flex-wrap:wrap;gap:8px;margin:11px 0 2px;display:flex}.confirm button{border:1px solid var(--w-border);background:var(--w-bg);height:32px;color:var(--w-text);cursor:pointer;border-radius:12px;flex:1 1 0;padding:0 12px;font-size:13px;font-weight:500}.confirm .other{flex-basis:100%}.confirm .yes:not(:disabled){background:var(--w-accent);color:var(--w-on-accent);border-color:#0000;font-weight:600}.confirm button:hover:not(:disabled){border-color:var(--w-border-strong);background:var(--w-surface)}.confirm .yes:hover:not(:disabled){background:var(--w-accent-hover);border-color:#0000}.confirm button:disabled{cursor:default}.confirm button:disabled:not([aria-pressed=true]){opacity:.45}.confirm button[aria-pressed=true]{border-color:var(--w-border-strong);background:var(--w-selected);color:var(--w-text);font-weight:600}`,rt=`.table{scrollbar-width:thin;margin:0 0 8px;overflow-x:auto}table{border-collapse:collapse;white-space:nowrap;min-width:100%;font-size:12.5px}th,td{text-align:left;vertical-align:top;border-bottom:1px solid color-mix(in srgb, currentColor 18%, transparent);padding:6px 10px 6px 0}thead th{text-transform:uppercase;letter-spacing:.05em;font-size:10.5px;font-weight:600}thead button{font:inherit;text-transform:inherit;letter-spacing:inherit;opacity:.7;cursor:pointer;background:0 0;border:0;padding:0}thead button:hover{opacity:1}tbody tr:last-child td{border-bottom:0}.foot{opacity:.8;align-items:center;gap:10px;font-size:11.5px;display:flex}.copy{border:1px solid var(--w-border);cursor:pointer;background:0 0;border-radius:8px;padding:2px 8px;font-size:11.5px}`,it=`:host{--w-bg:var(--sqc-bg,#fff);--w-surface:var(--sqc-surface,#f8fafc);--w-selected:var(--sqc-selected,#f1f5f9);--w-border:var(--sqc-border,#e2e8f0);--w-border-strong:var(--sqc-border-strong,#cbd5e1);--w-text:var(--sqc-text,#0f172a);--w-muted:var(--sqc-text-muted,#64748b);--w-accent:var(--sqc-accent-color,var(--sqc-accent,#000));--w-on-accent:var(--sqc-on-accent,#fff);--w-accent-hover:var(--sqc-accent-hover,color-mix(in oklab, var(--w-accent) 84%, var(--w-on-accent)));--w-focus:var(--sqc-focus,0 0 0 2px #fff, 0 0 0 4px #0f172a4d);--w-font:var(--sqc-font-family,system-ui, sans-serif);font-family:var(--w-font);display:block}:host([hidden]){display:none}button{color:inherit;font-family:inherit}button:focus-visible{box-shadow:var(--w-focus);outline:none}`,Q=[it,rt,tt,nt].join(`
3
- `);function at(){if(typeof customElements>`u`)return;let e=[[J.table,()=>q(et,[`table`],Q)],[J.choices,()=>q(Xe,[`options`,`multiple`,`checked`],Q)],[J.confirm,()=>q(Ze,[],Q)]];for(let[t,n]of e)customElements.get(t)||customElements.define(t,n())}var ot=/^(?:mcp|custom|a2a)_[0-9a-f]{8}_/;function st(e){let t=e.replace(ot,``).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[_-]+/g,` `).trim().toLowerCase();return t?t.charAt(0).toUpperCase()+t.slice(1):e}function ct(e){let t;return()=>t??(t=e().catch(e=>{t=void 0,console.warn(e instanceof Error?e.message:e)}))}var lt=ct(()=>Promise.resolve().then(()=>require("./extras-BAqWS9pU.cjs")).then(e=>e.n).then(({defineWidgetExtras:e})=>e()));function ut(e,t){let n=t[e];return e===t.length-1&&n?.role===`assistant`&&!n.streaming}var $={fr:/\br[ée]ponde?z? +«?\s*oui\b/i,en:/\b(?:reply|answer|respond) +[“"']?\s*yes\b/i,es:/\bresponda?e?d? +«?\s*s[íi](?!\p{L})/iu},dt={fr:[/\b(?:confirmes?[- ]tu|confirmez[- ]vous)\b/i,/\b(?:valides?[- ]tu|validez[- ]vous)\b/i,/(?<!\p{L})(?:es[- ]tu s[ûu]re?|[êe]tes[- ]vous s[ûu]re?s?)(?!\p{L})/iu,/\b(?:dois[- ]je|puis[- ]je)\b/i,/\b(?:je continue|on continue|on y va|je lance)\b/i,$.fr],en:[/\bdo you confirm\b/i,/\bdo you (?:want|wish) me to\b/i,/\b(?:shall|should) I\b/i,/\bare you sure\b/i,/\b(?:shall we|should I) (?:proceed|continue|go ahead)\b/i,$.en],es:[/\b(?:confirmas|confirma|confirm[áa]is)\b/i,/\b(?:validas|valida|valid[áa]is)\b/i,/\best[áa]s? seguro\b/i,/\b(?:contin[úu]o|procedo|lo lanzo|lo hago)\b/i,/\bquieres? que\b/i,$.es]},ft=/^\s*(?:[-*•]\s+)?(?:\[[ xX]\]|\([ xX]\))\s+/m,pt=/[ \t]*\(\s*(?:yes|oui|s[íi])\s*\/\s*non?\s*\)\s*$/i;function mt(e){return e.replace(pt,``)}function ht(e,t=`en`){if(ft.test(e))return!1;let n=e.split(`
3
+ `);function at(){if(typeof customElements>`u`)return;let e=[[J.table,()=>q(et,[`table`],Q)],[J.choices,()=>q(Xe,[`options`,`multiple`,`checked`],Q)],[J.confirm,()=>q(Ze,[],Q)]];for(let[t,n]of e)customElements.get(t)||customElements.define(t,n())}var ot=/^(?:mcp|custom|a2a)_[0-9a-f]{8}_/;function st(e){let t=e.replace(ot,``).replace(/([a-z0-9])([A-Z])/g,`$1 $2`).replace(/[_-]+/g,` `).trim().toLowerCase();return t?t.charAt(0).toUpperCase()+t.slice(1):e}function ct(e){let t;return()=>t??(t=e().catch(e=>{t=void 0,console.warn(e instanceof Error?e.message:e)}))}var lt=ct(()=>Promise.resolve().then(()=>require("./extras-BeCZR-6X.cjs")).then(e=>e.n).then(({defineWidgetExtras:e})=>e()));function ut(e,t){let n=t[e];return e===t.length-1&&n?.role===`assistant`&&!n.streaming}var $={fr:/\br[ée]ponde?z? +«?\s*oui\b/i,en:/\b(?:reply|answer|respond) +[“"']?\s*yes\b/i,es:/\bresponda?e?d? +«?\s*s[íi](?!\p{L})/iu},dt={fr:[/\b(?:confirmes?[- ]tu|confirmez[- ]vous)\b/i,/\b(?:valides?[- ]tu|validez[- ]vous)\b/i,/(?<!\p{L})(?:es[- ]tu s[ûu]re?|[êe]tes[- ]vous s[ûu]re?s?)(?!\p{L})/iu,/\b(?:dois[- ]je|puis[- ]je)\b/i,/\b(?:je continue|on continue|on y va|je lance)\b/i,$.fr],en:[/\bdo you confirm\b/i,/\bdo you (?:want|wish) me to\b/i,/\b(?:shall|should) I\b/i,/\bare you sure\b/i,/\b(?:shall we|should I) (?:proceed|continue|go ahead)\b/i,$.en],es:[/\b(?:confirmas|confirma|confirm[áa]is)\b/i,/\b(?:validas|valida|valid[áa]is)\b/i,/\best[áa]s? seguro\b/i,/\b(?:contin[úu]o|procedo|lo lanzo|lo hago)\b/i,/\bquieres? que\b/i,$.es]},ft=/^\s*(?:[-*•]\s+)?(?:\[[ xX]\]|\([ xX]\))\s+/m,pt=/[ \t]*\(\s*(?:yes|oui|s[íi])\s*\/\s*non?\s*\)\s*$/i;function mt(e){return e.replace(pt,``)}function ht(e,t=`en`){if(ft.test(e))return!1;let n=e.split(`
4
4
  `).map(e=>e.trim()).filter(Boolean),r=n[n.length-1];return r?pt.test(r)?!0:!r.includes(`?`)&&!$[t].test(r)?!1:dt[t].some(e=>e.test(r)):!1}var gt=[`text`,`number`,`date`,`email`,`select`];function _t(e){try{return JSON.parse(e)}catch{return null}}function vt(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function yt(e){return!Array.isArray(e)||e.length===0||e.length>20||!e.every(e=>typeof e==`string`&&e.trim())?null:e}function bt(e){if(!vt(e))return null;let{name:t,label:n,type:r}=e;if(typeof t!=`string`||!t.trim()||typeof n!=`string`||!n.trim()||typeof r!=`string`||!gt.includes(r))return null;let i={name:t,label:n,type:r,required:e.required===!0};if(r===`select`){let t=yt(e.options);if(!t)return null;i.options=t}return i}function xt(e){let t=_t(e);if(!vt(t)||!Array.isArray(t.fields)||t.fields.length===0||t.fields.length>12)return null;let n=[];for(let e of t.fields){let t=bt(e);if(!t||n.some(e=>e.name===t.name))return null;n.push(t)}let r={fields:n};return typeof t.title==`string`&&(r.title=t.title),typeof t.submit==`string`&&(r.submit=t.submit),r}var St=/^\s*(?:[-*•]\s+)?(?:\[([ xX])\]|\(([ xX])\))\s+(.+)$/,Ct=/^\s*\|.*\|\s*$/,wt=/^\s*\|(?:\s*:?-{1,}:?\s*\|)+\s*$/,Tt=/^\s*```/;function Et(e){return e.replace(/^\s*\|/,``).replace(/\|\s*$/,``).split(`|`).map(e=>e.trim())}function Dt(e,t,n=!0){let r=n&&ht(e,t),i=(r?mt(e):e).split(`
5
5
  `),a=[],o=[],s=()=>{let e=o.join(`
6
6
  `).replace(/^\n+|\n+$/g,``);e.trim()&&a.push({kind:`markdown`,text:e}),o=[]};for(let e=0;e<i.length;e+=1){let t=i[e];if(Tt.test(t)){let n=e+1;for(;n<i.length&&!Tt.test(i[n]);)n+=1;let r=n<i.length,c=t.replace(/^\s*```/,``).trim().toLowerCase(),l=i.slice(e+1,n).join(`
7
7
  `),u=null;if(r&&c===`form`){let e=xt(l);e&&(u={kind:`form`,form:e})}u?(s(),a.push(u)):o.push(...i.slice(e,r?n+1:n)),e=r?n:n-1;continue}if(Ct.test(t)&&e+1<i.length&&wt.test(i[e+1])){s();let n=Et(t),r=[];for(e+=2;e<i.length&&Ct.test(i[e]);)r.push(Et(i[e])),e+=1;--e,a.push({kind:`table`,header:n,rows:r});continue}let n=St.exec(t);if(n){let t=n[1]!==void 0,r=[],c=[],l=e,u=n;for(;u&&u[1]!==void 0===t;){let e=u[3].trim();r.push(e),(u[1]??u[2])!==` `&&(t||!c.length)&&c.push(e),l+=1,u=l<i.length?St.exec(i[l]):null}if(r.length>20)o.push(...i.slice(e,l));else{s();let e={kind:`choices`,options:r,multiple:t};c.length&&(e.checked=c),a.push(e)}e=l-1;continue}o.push(t)}return s(),{blocks:a,confirm:r}}Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return ue}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return Se}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return we}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return je}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return at}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return Be}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return st}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return ut}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return it}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return lt}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Dt}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return xe}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return Le}});
8
- //# sourceMappingURL=answer-Bi8GWLyA.cjs.map
8
+ //# sourceMappingURL=answer-BO2Hs9k1.cjs.map