@bridgeline-digital/hawkai-assistant 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +453 -0
- package/dist/api/client.d.ts +11 -0
- package/dist/api/types.d.ts +73 -0
- package/dist/bridge.d.ts +7 -0
- package/dist/components/App.d.ts +2 -0
- package/dist/components/AssistantButton.d.ts +7 -0
- package/dist/components/AssistantForm.d.ts +2 -0
- package/dist/components/AssistantWindow.d.ts +7 -0
- package/dist/components/LoadingIndicator.d.ts +2 -0
- package/dist/components/Message.d.ts +8 -0
- package/dist/components/MessageList.d.ts +2 -0
- package/dist/components/ProductCarousel.d.ts +7 -0
- package/dist/components/PromptOptions.d.ts +2 -0
- package/dist/components/RenderedTool.d.ts +7 -0
- package/dist/contexts/AssistantContext.d.ts +21 -0
- package/dist/hawkai-assistant.js +97 -0
- package/dist/hooks/useSendMessage.d.ts +7 -0
- package/dist/hooks/useTheme.d.ts +4 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3948 -0
- package/dist/main.d.ts +7 -0
- package/dist/session-manager.d.ts +8 -0
- package/dist/tools/display-products-tool.d.ts +6 -0
- package/dist/tools/page-context-tool.d.ts +12 -0
- package/dist/types.d.ts +81 -0
- package/dist/utilities/parseMarkdown.d.ts +28 -0
- package/package.json +54 -0
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
var HawkAIAssistant=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,ee={},g=[],_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,te=Array.isArray;function v(e,t){for(var n in t)e[n]=t[n];return e}function ne(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function y(e,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?t.call(arguments,2):r),typeof e==`function`&&e.defaultProps!=null)for(o in e.defaultProps)s[o]===void 0&&(s[o]=e.defaultProps[o]);return b(e,s,i,a,null)}function b(e,t,i,a,o){var s={type:e,props:t,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++r,__i:-1,__u:0};return o==null&&n.vnode!=null&&n.vnode(s),s}function x(e){return e.children}function S(e,t){this.props=e,this.context=t}function C(e,t){if(t==null)return e.__?C(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`?C(e):null}function re(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,i=[],a=[],o=v({},t);o.__v=t.__v+1,n.vnode&&n.vnode(o),pe(e.__P,o,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,i,r??C(t),!!(32&t.__u),a),o.__v=t.__v,o.__.__k[o.__i]=o,me(i,o,a),t.__e=t.__=null,o.__e!=r&&ie(o)}}function ie(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}),ie(e)}function ae(e){(!e.__d&&(e.__d=!0)&&i.push(e)&&!w.__r++||a!=n.debounceRendering)&&((a=n.debounceRendering)||o)(w)}function w(){try{for(var e,t=1;i.length;)i.length>t&&i.sort(s),e=i.shift(),t=i.length,re(e)}finally{i.length=w.__r=0}}function oe(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,_,te,v=r&&r.__k||g,ne=t.length;for(c=se(n,t,v,c,ne),d=0;d<ne;d++)(p=n.__k[d])!=null&&(f=p.__i!=-1&&v[p.__i]||ee,p.__i=d,_=pe(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&O(f.ref,null,p),u.push(p.ref,p.__c||m,p)),h==null&&m!=null&&(h=m),(te=!!(4&p.__u))||f.__k===p.__k?(c=T(p,c,e,te),te&&f.__e&&(f.__e=null)):typeof p.type==`function`&&_!==void 0?c=_:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=h,c}function se(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]=b(null,o,null,null,null):te(o)?o=e.__k[a]=b(x,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[a]=b(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=le(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=C(s)),ge(s,s));return r}function T(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=T(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=C(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function ce(e,t){return t||=[],e==null||typeof e==`boolean`||(te(e)?e.some(function(e){ce(e,t)}):t.push(e)),t}function le(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;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 ue(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||_.test(t)?n:n+`px`}function de(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||ue(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||ue(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(d,`$1`)),o=t.toLowerCase(),t=o in e||t==`onFocusOut`||t==`onFocusIn`?o.slice(2):t.slice(2),e.l||={},e.l[t+a]=n,n?r?n[u]=r[u]:(n[u]=f,e.addEventListener(t,a?m:p,a)):e.removeEventListener(t,a?m:p,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 fe(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t[l]==null)t[l]=f++;else if(t[l]<r[u])return;return r(n.event?n.event(t):t)}}}function pe(e,t,r,i,a,o,s,c,l,u){var d,f,p,m,h,ee,_,y,b,C,re,ie,ae,w,se,T=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),o=[c=t.__e=r.__e]),(d=n.__b)&&d(t);n:if(typeof T==`function`)try{if(y=t.props,b=T.prototype&&T.prototype.render,C=(d=T.contextType)&&i[d.__c],re=d?C?C.props.value:d.__:i,r.__c?_=(f=t.__c=r.__c).__=f.__E:(b?t.__c=f=new T(y,re):(t.__c=f=new S(y,re),f.constructor=T,f.render=_e),C&&C.sub(f),f.state||={},f.__n=i,p=f.__d=!0,f.__h=[],f._sb=[]),b&&f.__s==null&&(f.__s=f.state),b&&T.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=v({},f.__s)),v(f.__s,T.getDerivedStateFromProps(y,f.__s))),m=f.props,h=f.state,f.__v=t,p)b&&T.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),b&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(b&&T.getDerivedStateFromProps==null&&y!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(y,re),t.__v==r.__v||!f.__e&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(y,f.__s,re)){t.__v!=r.__v&&(f.props=y,f.state=f.__s,f.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(e){e&&(e.__=t)}),g.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&s.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(y,f.__s,re),b&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,ee)})}if(f.context=re,f.props=y,f.__P=e,f.__e=!1,ie=n.__r,ae=0,b)f.state=f.__s,f.__d=!1,ie&&ie(t),d=f.render(f.props,f.state,f.context),g.push.apply(f.__h,f._sb),f._sb=[];else do f.__d=!1,ie&&ie(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++ae<25);f.state=f.__s,f.getChildContext!=null&&(i=v(v({},i),f.getChildContext())),b&&!p&&f.getSnapshotBeforeUpdate!=null&&(ee=f.getSnapshotBeforeUpdate(m,h)),w=d!=null&&d.type===x&&d.key==null?D(d.props.children):d,c=oe(e,te(w)?w:[w],t,r,i,a,o,s,c,l,u),f.base=t.__e,t.__u&=-161,f.__h.length&&s.push(f),_&&(f.__E=f.__=null)}catch(e){if(t.__v=null,l||o!=null)if(e.then){for(t.__u|=l?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;o[o.indexOf(c)]=null,t.__e=c}else{for(se=o.length;se--;)ne(o[se]);E(t)}else t.__e=r.__e,t.__k=r.__k,e.then||E(t);n.__e(e,t,r)}else o==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):c=t.__e=he(r.__e,t,r,i,a,o,s,l,u);return(d=n.diffed)&&d(t),128&t.__u?void 0:c}function E(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(E))}function me(e,t,r){for(var i=0;i<r.length;i++)O(r[i],r[++i],r[++i]);n.__c&&n.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){n.__e(e,t.__v)}})}function D(e){return typeof e!=`object`||!e||e.__b>0?e:te(e)?e.map(D):e.constructor===void 0?v({},e):null}function he(e,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v=i.props||ee,y=r.props,b=r.type;if(b==`svg`?o=`http://www.w3.org/2000/svg`:b==`math`?o=`http://www.w3.org/1998/Math/MathML`:o||=`http://www.w3.org/1999/xhtml`,s!=null){for(d=0;d<s.length;d++)if((h=s[d])&&`setAttribute`in h==!!b&&(b?h.localName==b:h.nodeType==3)){e=h,s[d]=null;break}}if(e==null){if(b==null)return document.createTextNode(y);e=document.createElementNS(o,b,y.is&&y),l&&=(n.__m&&n.__m(r,s),!1),s=null}if(b==null)v===y||l&&e.data==y||(e.data=y);else{if(s=b==`textarea`&&y.defaultValue!=null?null:s&&t.call(e.childNodes),!l&&s!=null)for(v={},d=0;d<e.attributes.length;d++)v[(h=e.attributes[d]).name]=h.value;for(d in v)h=v[d],d==`dangerouslySetInnerHTML`?p=h:d==`children`||d in y||d==`value`&&`defaultValue`in y||d==`checked`&&`defaultChecked`in y||de(e,d,null,h,o);for(d in y)h=y[d],d==`children`?m=h:d==`dangerouslySetInnerHTML`?f=h:d==`value`?g=h:d==`checked`?_=h:l&&typeof h!=`function`||v[d]===h||de(e,d,h,v[d],o);if(f)l||p&&(f.__html==p.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),r.__k=[];else if(p&&(e.innerHTML=``),oe(r.type==`template`?e.content:e,te(m)?m:[m],r,i,a,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:o,s,c,s?s[0]:i.__k&&C(i,0),l,u),s!=null)for(d=s.length;d--;)ne(s[d]);l&&b!=`textarea`||(d=`value`,b==`progress`&&g==null?e.removeAttribute(`value`):g!=null&&(g!==e[d]||b==`progress`&&!g||b==`option`&&g!=v[d])&&de(e,d,g,v[d],o),d=`checked`,_!=null&&_!=e[d]&&de(e,d,_,v[d],o))}return e}function O(e,t,r){try{if(typeof e==`function`){var i=typeof e.__u==`function`;i&&e.__u(),i&&t==null||(e.__u=e(t))}else e.current=t}catch(e){n.__e(e,r)}}function ge(e,t,r){var i,a;if(n.unmount&&n.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||O(i,null,t)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){n.__e(e,t)}i.base=i.__P=null}if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&ge(i[a],t,r||typeof e.type!=`function`);r||ne(e.__e),e.__c=e.__=e.__e=void 0}function _e(e,t,n){return this.constructor(e,n)}function ve(e,r,i){var a,o,s,c;r==document&&(r=document.documentElement),n.__&&n.__(e,r),o=(a=typeof i==`function`)?null:i&&i.__k||r.__k,s=[],c=[],pe(r,e=(!a&&i||r).__k=y(x,null,[e]),o||ee,ee,r.namespaceURI,!a&&i?[i]:o?null:r.firstChild?t.call(r.childNodes):null,s,!a&&i?i:o?o.__e:r.firstChild,a,c),me(s,e,c)}function ye(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,ae(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c=`__cC`+ h++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}t=g.slice,n={__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}},r=0,S.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),ae(this))},S.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ae(this))},S.prototype.render=x,i=[],o=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,s=function(e,t){return e.__v.__b-t.__v.__b},w.__r=0,c=Math.random().toString(8),l=`__d`+c,u=`__a`+c,d=/(PointerCapture)$|Capture$/i,f=0,p=fe(!1),m=fe(!0),h=0;var k={setActorId:void 0,toggle:void 0,sendMessage:void 0,clearChat:void 0},be,A,j,xe,M=0,Se=[],N=n,Ce=N.__b,we=N.__r,Te=N.diffed,Ee=N.__c,De=N.unmount,Oe=N.__;function ke(e,t){N.__h&&N.__h(A,e,M||t),M=0;var n=A.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function P(e){return M=1,Ae(ze,e)}function Ae(e,t,n){var r=ke(be++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):ze(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=A,!A.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.some(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),a&&a.call(this,e,t,n)||o};A.__f=!0;var a=A.shouldComponentUpdate,o=A.componentWillUpdate;A.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)},A.shouldComponentUpdate=i}return r.__N||r.__}function F(e,t){var n=ke(be++,3);!N.__s&&Re(n.__H,t)&&(n.__=e,n.u=t,A.__H.__h.push(n))}function je(e){return M=5,Me(function(){return{current:e}},[])}function Me(e,t){var n=ke(be++,7);return Re(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Ne(e){var t=A.context[e.__c],n=ke(be++,9);return n.c=e,t?(n.__??(n.__=!0,t.sub(A)),t.props.value):e.__}function Pe(){for(var e;e=Se.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Le),t.__h.some(I),t.__h=[]}catch(n){t.__h=[],N.__e(n,e.__v)}}}N.__b=function(e){A=null,Ce&&Ce(e)},N.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Oe&&Oe(e,t)},N.__r=function(e){we&&we(e),be=0;var t=(A=e.__c).__H;t&&(j===A?(t.__h=[],A.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(Le),t.__h.some(I),t.__h=[],be=0)),j=A},N.diffed=function(e){Te&&Te(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Se.push(t)!==1&&xe===N.requestAnimationFrame||((xe=N.requestAnimationFrame)||Ie)(Pe)),t.__H.__.some(function(e){e.u&&(e.__H=e.u),e.u=void 0})),j=A=null},N.__c=function(e,t){t.some(function(e){try{e.__h.some(Le),e.__h=e.__h.filter(function(e){return!e.__||I(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],N.__e(n,e.__v)}}),Ee&&Ee(e,t)},N.unmount=function(e){De&&De(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{Le(e)}catch(e){t=e}}),n.__H=void 0,t&&N.__e(t,n.__v))};var Fe=typeof requestAnimationFrame==`function`;function Ie(e){var t,n=function(){clearTimeout(r),Fe&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Fe&&(t=requestAnimationFrame(n))}function Le(e){var t=A,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),A=t}function I(e){var t=A;e.__c=e.__(),A=t}function Re(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function ze(e,t){return typeof t==`function`?t(e):t}var Be=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}},Ve=10,He=13,Ue=32;function We(e){}function Ge(e){if(typeof e==`function`)throw TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:t=We,onError:n=We,onRetry:r=We,onComment:i}=e,a=[],o=!0,s,c=``,l=0,u;function d(e){if(o&&(o=!1,e.charCodeAt(0)===239&&e.charCodeAt(1)===187&&e.charCodeAt(2)===191&&(e=e.slice(3))),a.length===0){let t=f(e);t!==``&&a.push(t);return}if(e.indexOf(`
|
|
2
|
+
`)===-1&&e.indexOf(`\r`)===-1){a.push(e);return}a.push(e);let t=a.join(``);a.length=0;let n=f(t);n!==``&&a.push(n)}function f(e){let n=0;if(e.indexOf(`\r`)===-1){let r=e.indexOf(`
|
|
3
|
+
`,n);for(;r!==-1;){if(n===r){l>0&&t({id:s,event:u,data:c}),s=void 0,c=``,l=0,u=void 0,n=r+1,r=e.indexOf(`
|
|
4
|
+
`,n);continue}let i=e.charCodeAt(n);if(Ke(e,n,i)){let i=e.charCodeAt(n+5)===Ue?n+6:n+5,a=e.slice(i,r);if(l===0&&e.charCodeAt(r+1)===Ve){t({id:s,event:u,data:a}),s=void 0,c=``,u=void 0,n=r+2,r=e.indexOf(`
|
|
5
|
+
`,n);continue}c=l===0?a:`${c}
|
|
6
|
+
${a}`,l++}else L(e,n,i)?u=e.slice(e.charCodeAt(n+6)===Ue?n+7:n+6,r)||void 0:p(e,n,r);n=r+1,r=e.indexOf(`
|
|
7
|
+
`,n)}return e.slice(n)}for(;n<e.length;){let t=e.indexOf(`\r`,n),r=e.indexOf(`
|
|
8
|
+
`,n),i=-1;if(t!==-1&&r!==-1?i=t<r?t:r:t===-1?r!==-1&&(i=r):i=t===e.length-1?-1:t,i===-1)break;p(e,n,i),n=i+1,e.charCodeAt(n-1)===He&&e.charCodeAt(n)===Ve&&n++}return e.slice(n)}function p(e,t,n){if(t===n){h();return}let r=e.charCodeAt(t);if(Ke(e,t,r)){let r=e.charCodeAt(t+5)===Ue?t+6:t+5,i=e.slice(r,n);c=l===0?i:`${c}
|
|
9
|
+
${i}`,l++;return}if(L(e,t,r)){u=e.slice(e.charCodeAt(t+6)===Ue?t+7:t+6,n)||void 0;return}if(r===105&&e.charCodeAt(t+1)===100&&e.charCodeAt(t+2)===58){let r=e.slice(e.charCodeAt(t+3)===Ue?t+4:t+3,n);s=r.includes(`\0`)?void 0:r;return}if(r===58){i&&i(e.slice(t,n).slice(e.charCodeAt(t+1)===Ue?2:1));return}let a=e.slice(t,n),o=a.indexOf(`:`);if(o===-1){m(a,``,a);return}let d=a.slice(0,o),f=a.charCodeAt(o+1)===Ue?2:1;m(d,a.slice(o+f),a)}function m(e,t,i){switch(e){case`event`:u=t||void 0;break;case`data`:c=l===0?t:`${c}
|
|
10
|
+
${t}`,l++;break;case`id`:s=t.includes(`\0`)?void 0:t;break;case`retry`:/^\d+$/.test(t)?r(parseInt(t,10)):n(new Be(`Invalid \`retry\` value: "${t}"`,{type:`invalid-retry`,value:t,line:i}));break;default:n(new Be(`Unknown field "${e.length>20?`${e.slice(0,20)}\u2026`:e}"`,{type:`unknown-field`,field:e,value:t,line:i}));break}}function h(){l>0&&t({id:s,event:u,data:c}),s=void 0,c=``,l=0,u=void 0}function ee(e={}){if(e.consume&&a.length>0){let e=a.join(``);p(e,0,e.length)}o=!0,s=void 0,c=``,l=0,u=void 0,a.length=0}return{feed:d,reset:ee}}function Ke(e,t,n){return n===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function L(e,t,n){return n===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}var R=[];for(let e=0;e<256;++e)R.push((e+256).toString(16).slice(1));function qe(e,t=0){return(R[e[t+0]]+R[e[t+1]]+R[e[t+2]]+R[e[t+3]]+`-`+R[e[t+4]]+R[e[t+5]]+`-`+R[e[t+6]]+R[e[t+7]]+`-`+R[e[t+8]]+R[e[t+9]]+`-`+R[e[t+10]]+R[e[t+11]]+R[e[t+12]]+R[e[t+13]]+R[e[t+14]]+R[e[t+15]]).toLowerCase()}var Je=new Uint8Array(16);function Ye(){return crypto.getRandomValues(Je)}function Xe(e,t,n){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():Ze(e,t,n)}function Ze(e,t,n){e||={};let r=e.random??e.rng?.()??Ye();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return qe(r)}var Qe=`hawkai-assistant:sessionId`,$e=`hawkai-assistant:actorId`,z=``,et=``,tt,nt=e=>{try{return localStorage.getItem(e)}catch{return null}},rt=(e,t)=>{try{localStorage.setItem(e,t)}catch{return}},it=()=>{let e=nt(Qe);e&&(z=e),et=nt($e)||window.HawkAI.Assistant.config.actorId||Xe(),rt($e,et),tt=window.HawkAI.Assistant.config.context},B=()=>z,at=()=>et,ot=()=>{z=Xe(),rt(Qe,z)},st=()=>{z||(z=Xe(),rt(Qe,z))},ct=e=>{et=e||Xe(),rt($e,et)},lt=()=>tt,ut=e=>{tt=e},dt=(e,t)=>e instanceof Error&&e.message?e.message:t,ft=async e=>{let t=(await e.text()).trim();return t?`Assistant API error ${e.status}: ${t}`:`Assistant API error ${e.status}`},pt=async(e,t,n,r)=>{st();let i=window.HawkAI.Assistant.config,a=`${i.apiUrl}/invocations`,o=await fetch(a,{method:`POST`,headers:{"Content-Type":`application/json`,Accept:`text/event-stream`,Connection:`keep-alive`},body:JSON.stringify({accountId:i.accountId,agentId:i.agentId,sessionId:B(),actorId:at(),prompt:e.text,files:e.files,context:lt(),toolResults:e.toolResults?.map(({toolUseId:e,output:t,status:n})=>({toolUseId:e,content:t===void 0?[]:[n===`error`||typeof t==`string`?{text:String(t)}:{json:t}],status:n})),stream:!0,tools:t.map(({name:e,description:t,inputSchema:n})=>({name:e,description:t,inputSchema:n}))}),signal:r});if(!o.ok)throw Error(await ft(o));let s=``,c=[],l=Ge({onEvent:e=>{if(!e.data||e.data===`[DONE]`)return;let t;try{t=JSON.parse(e.data)}catch{throw Error(`Assistant API returned invalid JSON in the stream.`)}if(e.event===`text`)s+=t.delta,n(s);else if(e.event===`frontendTool`){let e=t;c.push(e)}}});if(!o.body)return{role:`assistant`};let u=o.body.getReader(),d=new TextDecoder;for(;;){let{done:e,value:t}=await u.read();if(e)break;try{l.feed(d.decode(t,{stream:!0}))}catch(e){throw Error(dt(e,`Assistant API returned an invalid stream.`))}}let f={role:`assistant`};return s&&(f.text=s),c.length>0&&(f.toolUses=c.map(({toolUseId:e,tool:t,args:n})=>({id:e,name:t,input:n}))),f},mt=async(e,t,n,r)=>{let i=e;for(;!r?.aborted;){n.onAssistantTurnStart();let e=await pt(i,t,n.onAssistantTextDelta,r);if(n.onAssistantTurnComplete(e),!e.toolUses?.length)break;let a={role:`user`,toolResults:await Promise.all(e.toolUses.map(async e=>{let r=t.find(t=>t.name===e.name);if(r)try{let t=await r.execute(e.input??{});return n.onToolResult(e.id,t,`success`),{toolUseId:e.id,output:t,status:`success`}}catch(t){let r=dt(t,`Tool "${e.name}" failed.`);return n.onToolResult(e.id,r,`error`),{toolUseId:e.id,output:r,status:`error`}}let i=`Tool "${e.name}" not found.`;return n.onToolResult(e.id,i,`error`),{toolUseId:e.id,output:i,status:`error`}}))};n.onToolResultsTurn(a),i=a}},ht=async()=>{if(!B())return[];let e=window.HawkAI.Assistant.config,t=`${e.apiUrl}/invocations`,n=B(),r=await fetch(t,{method:`POST`,headers:{"Content-Type":`application/json`,"x-agent-id":e.agentId},body:JSON.stringify({accountId:e.accountId,agentId:e.agentId,sessionId:n,actorId:at(),action:`getHistory`})});return r.ok?(await r.json()).turns:(console.error(`[HawkAI Assistant] Failed to retrieve conversation history for session:`,n),[])},gt=0;Array.isArray;function V(e,t,r,i,a,o){t||={};var s,c,l=t;if(`ref`in l)for(c in l={},t)c==`ref`?s=t[c]:l[c]=t[c];var u={type:e,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--gt,__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 n.vnode&&n.vnode(u),u}var _t=({product:e})=>{let t=e.salePrice??e.price,n=window.HawkAI.Assistant.config.addToCart;return V(`div`,{className:`hawkai-assistant__product flex w-32 shrink-0 flex-col overflow-hidden rounded-lg border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 text-xs text-gray-700 dark:text-gray-300`,children:[V(`a`,{href:e.url,target:`_top`,rel:`noreferrer`,className:`flex flex-col hover:shadow-md`,children:[e.imageUrl&&V(`img`,{src:e.imageUrl,alt:e.title,className:`hawkai-assistant__product__image h-20 w-full object-cover`}),V(`div`,{className:`hawkai-assistant__product__info flex flex-col gap-1 p-2`,children:[V(`span`,{className:`hawkai-assistant__product__title line-clamp-2 font-medium leading-tight`,children:e.title}),t!==void 0&&V(`span`,{className:`hawkai-assistant__product__price font-semibold text-primary`,children:[`$`,t.toFixed(2)]})]})]}),n&&V(`button`,{type:`button`,className:`hawkai-assistant__product__add-to-cart-button w-full px-2 py-1 text-xs font-medium text-white bg-primary cursor-pointer hover:opacity-90`,onClick:t=>{t.stopPropagation(),n(e)},children:`Add to Cart`})]})},vt=({products:e})=>V(`div`,{className:`hawkai-assistant__carousel flex gap-2 overflow-x-auto py-1`,children:e.map(e=>V(_t,{product:e},e.id))}),yt=()=>({name:`display_products`,description:`Render a visual product carousel that is immediately visible to the user in the chat.
|
|
11
|
+
Call this after a product search to show products that directly match what the user asked for.
|
|
12
|
+
Only include products that are genuinely relevant — if the user asked for shoes, exclude shoe organizers, shoe racks, or other accessories.
|
|
13
|
+
When in doubt, omit the result rather than showing something tangentially related.
|
|
14
|
+
|
|
15
|
+
You may call this multiple times in a single response — once per product category when handling multi-part queries.
|
|
16
|
+
Use your judgment on how to group results:
|
|
17
|
+
- If a category search returns multiple relevant options for the user to choose between, give it its own labeled carousel (e.g. "Hiking Boots:").
|
|
18
|
+
- If a category search returns only one clear match, do not give it its own carousel — instead, collect all such single picks together and show them in one combined carousel (e.g. "Complete Hiking Outfit:").
|
|
19
|
+
The goal is that a carousel represents either a set of options to choose from, or a curated complete set — never a sequence of single-item carousels one per category.
|
|
20
|
+
|
|
21
|
+
Write a short label (e.g. "Hiking Boots:") in your text before each carousel so the user knows what they're looking at.
|
|
22
|
+
The product cards are fully visible to the user including names, images, prices, and descriptions — do not follow up with tables, bullet lists, or summaries of the products shown.
|
|
23
|
+
Your text after a carousel should only add context, comparisons, or recommendations beyond what the cards already show.
|
|
24
|
+
|
|
25
|
+
CRITICAL — DO NOT REPEAT
|
|
26
|
+
Never call display_products again with the same or substantially overlapping products that you already displayed in a prior turn of this conversation. Once a toolResult confirms a previous
|
|
27
|
+
display_products succeeded, your next assistant response must be CONVERSATIONAL TEXT ONLY — a follow-up question, recommendation, comparison, or a different tool call (e.g. add_to_cart).
|
|
28
|
+
Only call display_products again when the user explicitly asks for NEW or DIFFERENT products — e.g. "show me goggles instead", "what about boots?", "filter by brand X", "add more".
|
|
29
|
+
If the user submits a toolResult after a successful display_products call without asking for anything new, respond with text only.`,inputSchema:{type:`object`,properties:{products:{type:`array`,description:`The products to display.`,items:{type:`object`,properties:{id:{type:`string`,description:`Unique product identifier.`},title:{type:`string`,description:`Product name.`},url:{type:`string`,description:`URL of the product page.`},imageUrl:{type:`string`,description:`URL of the product image.`},price:{type:`number`,description:`Regular price.`},salePrice:{type:`number`,description:`Sale price, if discounted.`},rating:{type:`number`,description:`Average rating (0–5).`},brand:{type:`string`,description:`Brand name.`},sku:{type:`string`,description:`SKU or part number.`},description:{type:`string`,description:`Short product description.`}},required:[`id`,`title`,`url`]}}},required:[`products`]},execute:async e=>`Product cards have been displayed for products with IDs: ${e.products.map(e=>e.id).join(`, `)}`,render:({input:e})=>{let t=e.products??[];return t.length===0?null:y(vt,{products:t})}}),bt=()=>({name:`retrieve_page_context`,description:`Get information about the page the user is currently viewing: URL, title, headings, and main content. Call this when the user asks about the current page or when page details would materially improve the answer.`,inputSchema:{type:`object`,properties:{}},execute:async e=>{let t=e=>document.querySelector(`meta[name="${e}"]`)?.content||document.querySelector(`meta[property="${e}"]`)?.content||``,n=document.title||``,r=t(`description`)||t(`og:description`)||``,i=t(`og:title`)||``,a=document.querySelector(`h1`)?.textContent?.trim()||``,o=[];document.querySelectorAll(`script[type="application/ld+json"]`).forEach(e=>{try{o.push(JSON.parse(e.textContent??``))}catch{}});let s=document.querySelector(`main`)||document.querySelector(`[role="main"]`)||document.querySelector(`article`)||document.querySelector(`.content`)||document.querySelector(`#content`),c=1700,l=(s?.textContent?.trim()||``).replace(/\n{3,}/g,`
|
|
30
|
+
|
|
31
|
+
`),u=o.length?JSON.stringify(o).slice(0,300):``,d=l.slice(0,c)+(l.length>c?`…`:``);return{url:location.href,title:n,description:r,ogTitle:i,h1:a,mainContent:d,structuredData:u}}}),xt=ye(null),St=`hawkai-assistant-closed`,Ct=()=>{try{return localStorage.getItem(St)===`true`}catch{return!1}},wt=({children:e})=>{let[t,n]=P([]),[r,i]=P(!1),[a,o]=P(!1),[s,c]=P(Ct);F(()=>{ht().then(n).finally(()=>i(!0))},[]),F(()=>{try{localStorage.setItem(St,String(s))}catch{return}},[s]);let l=e=>{n(t=>[...t,e])},u=e=>{n(t=>t.length===0?[e]:[...t.slice(0,-1),e])},d=e=>{n(t=>{if(t.length===0)return t;let n=t[t.length-1];return n.role===`assistant`?[...t.slice(0,-1),{...n,text:e}]:t})},f=[bt(),yt(),...window.HawkAI.Assistant.config.tools??[]],p=()=>{ot(),n([])};return F(()=>(k.setActorId=e=>{ct(e),p()},()=>{k.setActorId=void 0}),[]),r?V(xt.Provider,{value:{turns:t,tools:f,isStreaming:a,setIsStreaming:o,userClosed:s,setUserClosed:c,appendTurn:l,replaceLastTurn:u,updateLastAssistantText:d,updateToolUse:(e,t)=>{n(n=>n.map(n=>{if(n.role!==`assistant`||!n.toolUses?.length)return n;let r=n.toolUses.findIndex(t=>t.id===e);if(r===-1)return n;let i=n.toolUses.slice();return i[r]={...i[r],...t},{...n,toolUses:i}}))},clearChat:p},children:e}):null},Tt=()=>{let e=Ne(xt);if(e===null)throw Error(`useAssistant must be used inside AssistantProvider`);return e},Et=()=>window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`,Dt=(e=`automatic`)=>{let[t,n]=P(()=>e===`light`||e===`dark`?e:Et());return F(()=>{if(e===`light`||e===`dark`){n(e);return}n(Et());let t=window.matchMedia(`(prefers-color-scheme: dark)`),r=e=>{n(e.matches?`dark`:`light`)};return t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t};function Ot(e,t){for(var n in t)e[n]=t[n];return e}function kt(e,t){for(var n in e)if(n!==`__source`&&!(n in t))return!0;for(var r in t)if(r!==`__source`&&e[r]!==t[r])return!0;return!1}function At(e,t){this.props=e,this.context=t}(At.prototype=new S).isPureReactComponent=!0,At.prototype.shouldComponentUpdate=function(e,t){return kt(this.props,e)||kt(this.state,t)};var jt=n.__b;n.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),jt&&jt(e)};var Mt=typeof Symbol<`u`&&Symbol.for&&Symbol.for(`react.forward_ref`)||3911;function Nt(e){function t(t){var n=Ot({},t);return delete n.ref,e(n,t.ref||null)}return t.$$typeof=Mt,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName=`ForwardRef(`+(e.displayName||e.name)+`)`,t}var Pt=n.__e;n.__e=function(e,t,n,r){if(e.then){for(var i,a=t;a=a.__;)if((i=a.__c)&&i.__c)return t.__e??(t.__e=n.__e,t.__k=n.__k),i.__c(e,t)}Pt(e,t,n,r)};var Ft=n.unmount;function It(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){typeof e.__c==`function`&&e.__c()}),e.__c.__H=null),(e=Ot({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return It(e,t,n)})),e}function Lt(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return Lt(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Rt(){this.__u=0,this.o=null,this.__b=null}function zt(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function Bt(){this.i=null,this.l=null}n.unmount=function(e){var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Ft&&Ft(e)},(Rt.prototype=new S).__c=function(e,t){var n=t.__c,r=this;r.o??=[],r.o.push(n);var i=zt(r.__v),a=!1,o=function(){a||r.__z||(a=!0,n.__R=null,i?i(c):c())};n.__R=o;var s=n.__P;n.__P=null;var c=function(){if(!--r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=Lt(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.__P=s,t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(o,o)},Rt.prototype.componentWillUnmount=function(){this.o=[]},Rt.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement(`div`),r=this.__v.__k[0].__c;this.__v.__k[0]=It(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&y(x,null,e.fallback);return i&&(i.__u&=-33),[y(x,null,t.__a?null:e.children),i]};var Vt=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!==`t`||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(Bt.prototype=new S).__a=function(e){var t=this,n=zt(t.__v),r=t.l.get(e);return r[0]++,function(i){var a=function(){t.props.revealOrder?(r.push(i),Vt(t,e,r)):i()};n?n(a):a()}},Bt.prototype.render=function(e){this.i=null,this.l=new Map;var t=ce(e.children);e.revealOrder&&e.revealOrder[0]===`b`&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Bt.prototype.componentDidUpdate=Bt.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){Vt(e,n,t)})};var Ht=typeof Symbol<`u`&&Symbol.for&&Symbol.for(`react.element`)||60103,Ut=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Wt=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Gt=/[A-Z0-9]/g,Kt=typeof document<`u`,qt=function(e){return(typeof Symbol<`u`&&typeof Symbol()==`symbol`?/fil|che|rad/:/fil|che|ra/).test(e)};S.prototype.isReactComponent=!0,[`componentWillMount`,`componentWillReceiveProps`,`componentWillUpdate`].forEach(function(e){Object.defineProperty(S.prototype,e,{configurable:!0,get:function(){return this[`UNSAFE_`+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Jt=n.event;n.event=function(e){return Jt&&(e=Jt(e)),e.persist=function(){},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var Yt={configurable:!0,get:function(){return this.class}},Xt=n.vnode;n.vnode=function(e){typeof e.type==`string`&&function(e){var t=e.props,n=e.type,r={},i=n.indexOf(`-`)==-1;for(var a in t){var o=t[a];if(!(a===`value`&&`defaultValue`in t&&o==null||Kt&&a===`children`&&n===`noscript`||a===`class`||a===`className`)){var s=a.toLowerCase();a===`defaultValue`&&`value`in t&&t.value==null?a=`value`:a===`download`&&!0===o?o=``:s===`translate`&&o===`no`?o=!1:s[0]===`o`&&s[1]===`n`?s===`ondoubleclick`?a=`ondblclick`:s!==`onchange`||n!==`input`&&n!==`textarea`||qt(t.type)?s===`onfocus`?a=`onfocusin`:s===`onblur`?a=`onfocusout`:Wt.test(a)&&(a=s):s=a=`oninput`:i&&Ut.test(a)?a=a.replace(Gt,`-$&`).toLowerCase():o===null&&(o=void 0),s===`oninput`&&r[a=s]&&(a=`oninputCapture`),r[a]=o}}n==`select`&&(r.multiple&&Array.isArray(r.value)&&(r.value=ce(t.children).forEach(function(e){e.props.selected=r.value.indexOf(e.props.value)!=-1})),r.defaultValue!=null&&(r.value=ce(t.children).forEach(function(e){e.props.selected=r.multiple?r.defaultValue.indexOf(e.props.value)!=-1:r.defaultValue==e.props.value}))),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,`className`,Yt)):t.className&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=Ht,Xt&&Xt(e)};var Zt=n.__r;n.__r=function(e){Zt&&Zt(e),e.__c};var Qt=n.diffed;n.diffed=function(e){Qt&&Qt(e);var t=e.props,n=e.__e;n!=null&&e.type===`textarea`&&`value`in t&&t.value!==n.value&&(n.value=t.value==null?``:t.value)};function $t({title:e,titleId:t,...n},r){return y(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?y(`title`,{id:t},e):null,y(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M8.625 12a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H8.25m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H12m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0h-.375M21 12c0 4.556-4.03 8.25-9 8.25a9.764 9.764 0 0 1-2.555-.337A5.972 5.972 0 0 1 5.41 20.97a5.969 5.969 0 0 1-.474-.065 4.48 4.48 0 0 0 .978-2.025c.09-.457-.133-.901-.467-1.226C3.93 16.178 3 14.189 3 12c0-4.556 4.03-8.25 9-8.25s9 3.694 9 8.25Z`}))}var en=Nt($t);function tn({title:e,titleId:t,...n},r){return y(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?y(`title`,{id:t},e):null,y(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13`}))}var nn=Nt(tn);function rn({title:e,titleId:t,...n},r){return y(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,strokeWidth:1.5,stroke:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?y(`title`,{id:t},e):null,y(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 18 18 6M6 6l12 12`}))}var an=Nt(rn);function on(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=on(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function sn(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=on(e))&&(r&&(r+=` `),r+=t);return r}var cn=({isOpen:e,onClick:t})=>{let n=window.HawkAI.Assistant.config?.ui?.position??`right`;return V(`button`,{type:`button`,onClick:t,className:sn({"hawkai-assistant__trigger fixed bottom-6 z-50 flex h-14 w-14 cursor-pointer items-center justify-center rounded-full bg-primary text-white shadow-lg/30 hover:bg-primary-hover focus:outline-none":!0,"hawkai-assistant__trigger--open":e,"hawkai-assistant__trigger--right right-6":n===`right`,"hawkai-assistant__trigger--left left-6":n===`left`}),title:e?`Close Assistant`:`Open Assistant`,"aria-label":e?`Close Assistant`:`Open Assistant`,children:V(e?an:en,{className:`size-6`,strokeWidth:2,"aria-hidden":!0})})};function ln({title:e,titleId:t,...n},r){return y(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?y(`title`,{id:t},e):null,y(`path`,{d:`M3.28 2.22a.75.75 0 0 0-1.06 1.06L5.44 6.5H2.75a.75.75 0 0 0 0 1.5h4.5A.75.75 0 0 0 8 7.25v-4.5a.75.75 0 0 0-1.5 0v2.69L3.28 2.22ZM13.5 2.75a.75.75 0 0 0-1.5 0v4.5c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-2.69l3.22-3.22a.75.75 0 0 0-1.06-1.06L13.5 5.44V2.75ZM3.28 17.78l3.22-3.22v2.69a.75.75 0 0 0 1.5 0v-4.5a.75.75 0 0 0-.75-.75h-4.5a.75.75 0 0 0 0 1.5h2.69l-3.22 3.22a.75.75 0 1 0 1.06 1.06ZM13.5 14.56l3.22 3.22a.75.75 0 1 0 1.06-1.06l-3.22-3.22h2.69a.75.75 0 0 0 0-1.5h-4.5a.75.75 0 0 0-.75.75v4.5a.75.75 0 0 0 1.5 0v-2.69Z`}))}var un=Nt(ln);function dn({title:e,titleId:t,...n},r){return y(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?y(`title`,{id:t},e):null,y(`path`,{d:`m13.28 7.78 3.22-3.22v2.69a.75.75 0 0 0 1.5 0v-4.5a.75.75 0 0 0-.75-.75h-4.5a.75.75 0 0 0 0 1.5h2.69l-3.22 3.22a.75.75 0 0 0 1.06 1.06ZM2 17.25v-4.5a.75.75 0 0 1 1.5 0v2.69l3.22-3.22a.75.75 0 0 1 1.06 1.06L4.56 16.5h2.69a.75.75 0 0 1 0 1.5h-4.5a.747.747 0 0 1-.75-.75ZM12.22 13.28l3.22 3.22h-2.69a.75.75 0 0 0 0 1.5h4.5a.747.747 0 0 0 .75-.75v-4.5a.75.75 0 0 0-1.5 0v2.69l-3.22-3.22a.75.75 0 1 0-1.06 1.06ZM3.5 4.56l3.22 3.22a.75.75 0 0 0 1.06-1.06L4.56 3.5h2.69a.75.75 0 0 0 0-1.5h-4.5a.75.75 0 0 0-.75.75v4.5a.75.75 0 0 0 1.5 0V4.56Z`}))}var fn=Nt(dn);function pn({title:e,titleId:t,...n},r){return y(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?y(`title`,{id:t},e):null,y(`path`,{d:`M10.75 4.75a.75.75 0 0 0-1.5 0v4.5h-4.5a.75.75 0 0 0 0 1.5h4.5v4.5a.75.75 0 0 0 1.5 0v-4.5h4.5a.75.75 0 0 0 0-1.5h-4.5v-4.5Z`}))}var mn=Nt(pn);function hn({title:e,titleId:t,...n},r){return y(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?y(`title`,{id:t},e):null,y(`path`,{d:`M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z`}))}var gn=Nt(hn);function _n({title:e,titleId:t,...n},r){return y(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?y(`title`,{id:t},e):null,y(`path`,{d:`M3.478 2.404a.75.75 0 0 0-.926.941l2.432 7.905H13.5a.75.75 0 0 1 0 1.5H4.984l-2.432 7.905a.75.75 0 0 0 .926.94 60.519 60.519 0 0 0 18.445-8.986.75.75 0 0 0 0-1.218A60.517 60.517 0 0 0 3.478 2.404Z`}))}var vn=Nt(_n);function yn({title:e,titleId:t,...n},r){return y(`svg`,Object.assign({xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":`true`,"data-slot":`icon`,ref:r,"aria-labelledby":t},n),e?y(`title`,{id:t},e):null,y(`path`,{fillRule:`evenodd`,d:`M4.5 7.5a3 3 0 0 1 3-3h9a3 3 0 0 1 3 3v9a3 3 0 0 1-3 3h-9a3 3 0 0 1-3-3v-9Z`,clipRule:`evenodd`}))}var bn=Nt(yn),xn=e=>e instanceof Error&&e.message?`Sorry, something went wrong: ${e.message}`:`Sorry, something went wrong while generating a response.`,Sn=e=>new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(r.result.split(`,`)[1]),r.onerror=n,r.readAsDataURL(e)}),Cn=()=>{let{tools:e,isStreaming:t,setIsStreaming:n,appendTurn:r,replaceLastTurn:i,updateLastAssistantText:a,updateToolUse:o}=Tt(),s=je(null);return{isStreaming:t,sendMessage:async(c,l=[])=>{let u=c?.trim()??``;if(!u&&!l.length||t)return;let d=await Promise.all(l.map(async e=>({name:e.name,mediaType:e.type,data:await Sn(e)}))),f={role:`user`,text:u||void 0,files:d.length>0?d:void 0},p=new AbortController;s.current=p,r(f),n(!0);try{await mt(f,e,{onAssistantTurnStart:()=>r({role:`assistant`,text:``}),onAssistantTextDelta:e=>a(e),onAssistantTurnComplete:e=>i(e),onToolResultsTurn:e=>r(e),onToolResult:(e,t,n)=>o(e,{output:t,status:n})},p.signal)}catch(e){if(e instanceof DOMException&&e.name===`AbortError`)return;a(xn(e))}finally{s.current=null,n(!1)}},stopMessage:()=>{s.current?.abort()}}},wn=3,Tn=()=>{let[e,t]=P(``),[n,r]=P([]),i=je(null),{isStreaming:a,sendMessage:o,stopMessage:s}=Cn(),c=window.HawkAI.Assistant.config.ui,l=c?.allowFileUpload!==!1;F(()=>(k.sendMessage=o,()=>{k.sendMessage=void 0}),[o]);let u=e=>{let t=Array.from(e.target.files??[]),i=wn-n.length;r(e=>[...e,...t.slice(0,i)]),e.target.value=``},d=e=>{r(t=>t.filter((t,n)=>n!==e))},f=async i=>{i.preventDefault();let a=e,s=n;t(``),r([]),await o(a,s)},p=e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),f(e))},m=e.trim()!==``||n.length>0;return V(`form`,{onSubmit:f,className:`hawkai-assistant__form flex flex-col border-t border-solid border-gray-200 dark:border-gray-700 p-3 mt-auto gap-2`,children:[n.length>0&&V(`div`,{className:`hawkai-assistant__form__file-list flex flex-wrap gap-1`,children:n.map((e,t)=>V(`div`,{className:`hawkai-assistant__form__file flex items-center gap-1 rounded-full bg-gray-100 dark:bg-gray-800 px-2 py-1 text-xs text-gray-700 dark:text-gray-300`,children:[V(`span`,{className:`hawkai-assistant__form__file__name max-w-32 truncate`,children:e.name}),V(`button`,{type:`button`,onClick:()=>d(t),title:`Remove ${e.name}`,"aria-label":`Remove ${e.name}`,className:`hawkai-assistant__form__file__remove-button shrink-0 text-gray-400 dark:text-gray-500 cursor-pointer hover:text-gray-700 dark:hover:text-gray-300 focus:outline-none`,children:V(an,{className:`h-3 w-3`})})]},t))}),V(`div`,{className:`hawkai-assistant__form__input-row flex items-end gap-2`,children:[V(`label`,{htmlFor:`assistant-message`,className:`hawkai-assistant__form__label sr-only`,children:`Message`}),V(`textarea`,{id:`assistant-message`,className:`hawkai-assistant__form__text-input h-21 flex-1 resize-none rounded-lg border border-gray-200 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100 p-2 text-sm focus:outline-none focus:ring-2 focus:ring-primary`,placeholder:c?.placeholder||`Enter your message here`,value:e,onInput:e=>t(e.target.value),onKeyDown:p,"aria-required":`true`}),V(`div`,{className:`hawkai-assistant__form__actions flex shrink-0 flex-col gap-1`,children:[l&&V(x,{children:[V(`input`,{ref:i,type:`file`,accept:`application/pdf,image/gif,image/jpeg,image/png,image/webp,text/csv,text/plain`,multiple:!0,"aria-label":`Attach files`,className:`hawkai-assistant__form__file-input hidden`,onChange:u}),V(`button`,{type:`button`,disabled:n.length>=wn||a,title:`Attach files`,"aria-label":`Attach files`,onClick:()=>i.current?.click(),className:`hawkai-assistant__form__attach-button flex h-10 w-10 items-center justify-center rounded-lg border border-gray-200 dark:border-gray-700 text-gray-500 dark:text-gray-400 cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-transparent`,children:V(nn,{className:`h-5 w-5`})})]}),a?V(`button`,{type:`button`,onClick:s,title:`Stop`,"aria-label":`Stop`,className:`hawkai-assistant__form__stop-button flex h-10 w-10 items-center justify-center rounded-lg bg-primary text-white cursor-pointer hover:bg-primary-hover focus:outline-none`,children:V(bn,{className:`h-5 w-5`})}):V(`button`,{type:`submit`,disabled:!m,title:`Send`,"aria-label":`Send`,className:`hawkai-assistant__form__send-button flex h-10 w-10 items-center justify-center rounded-lg bg-primary text-white cursor-pointer hover:bg-primary-hover focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:bg-primary`,children:V(vn,{className:`h-5 w-5`})})]})]})]})},En=()=>V(`div`,{className:`hawkai-assistant__loading-indicator w-fit rounded-2xl rounded-bl-sm bg-gray-100 dark:bg-gray-800 px-3 py-2 text-sm text-gray-900 dark:text-gray-100`,children:V(`span`,{className:`inline-flex gap-1`,children:[V(`span`,{className:`animate-bounce`,style:{animationDelay:`0ms`},children:`•`}),V(`span`,{className:`animate-bounce`,style:{animationDelay:`150ms`},children:`•`}),V(`span`,{className:`animate-bounce`,style:{animationDelay:`300ms`},children:`•`})]})});function Dn(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function On(e){if(Array.isArray(e))return e}function kn(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function An(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
32
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jn(e,t){return On(e)||kn(e,t)||Mn(e,t)||An()}function Mn(e,t){if(e){if(typeof e==`string`)return Dn(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Dn(e,t):void 0}}var Nn=Object.entries,Pn=Object.setPrototypeOf,Fn=Object.isFrozen,In=Object.getPrototypeOf,Ln=Object.getOwnPropertyDescriptor,H=Object.freeze,U=Object.seal,Rn=Object.create,zn=typeof Reflect<`u`&&Reflect,Bn=zn.apply,Vn=zn.construct;H||=function(e){return e},U||=function(e){return e},Bn||=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.apply(t,r)},Vn||=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)};var Hn=q(Array.prototype.forEach),Un=q(Array.prototype.lastIndexOf),Wn=q(Array.prototype.pop),Gn=q(Array.prototype.push),Kn=q(Array.prototype.splice),W=Array.isArray,qn=q(String.prototype.toLowerCase),Jn=q(String.prototype.toString),Yn=q(String.prototype.match),Xn=q(String.prototype.replace),Zn=q(String.prototype.indexOf),Qn=q(String.prototype.trim),$n=q(Number.prototype.toString),er=q(Boolean.prototype.toString),tr=typeof BigInt>`u`?null:q(BigInt.prototype.toString),nr=typeof Symbol>`u`?null:q(Symbol.prototype.toString),G=q(Object.prototype.hasOwnProperty),rr=q(Object.prototype.toString),K=q(RegExp.prototype.test),ir=ar(TypeError);function q(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Bn(e,t,r)}}function ar(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return Vn(e,n)}}function J(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:qn;if(Pn&&Pn(e,null),!W(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(Fn(t)||(t[r]=e),i=e)}e[i]=!0}return e}function or(e){for(let t=0;t<e.length;t++)G(e,t)||(e[t]=null);return e}function Y(e){let t=Rn(null);for(let r of Nn(e)){var n=jn(r,2);let i=n[0],a=n[1];G(e,i)&&(W(a)?t[i]=or(a):a&&typeof a==`object`&&a.constructor===Object?t[i]=Y(a):t[i]=a)}return t}function sr(e){switch(typeof e){case`string`:return e;case`number`:return $n(e);case`boolean`:return er(e);case`bigint`:return tr?tr(e):`0`;case`symbol`:return nr?nr(e):`Symbol()`;case`undefined`:return rr(e);case`function`:case`object`:{if(e===null)return rr(e);let t=e,n=cr(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:rr(e)}return rr(e)}default:return rr(e)}}function cr(e,t){for(;e!==null;){let n=Ln(e,t);if(n){if(n.get)return q(n.get);if(typeof n.value==`function`)return q(n.value)}e=In(e)}function n(){return null}return n}function lr(e){try{return K(e,``),!0}catch{return!1}}var ur=H(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),dr=H(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),fr=H([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),pr=H([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),mr=H(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),hr=H([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),gr=H([`#text`]),_r=H(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),vr=H(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),yr=H(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),br=H([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),xr=U(/{{[\w\W]*|^[\w\W]*}}/g),Sr=U(/<%[\w\W]*|^[\w\W]*%>/g),Cr=U(/\${[\w\W]*/g),wr=U(/^data-[\-\w.\u00B7-\uFFFF]+$/),Tr=U(/^aria-[\-\w]+$/),Er=U(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Dr=U(/^(?:\w+script|data):/i),Or=U(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),kr=U(/^html$/i),Ar=U(/^[a-z][.\w]*(-[.\w]+)+$/i),jr={element:1,text:3,progressingInstruction:7,comment:8,document:9},Mr=function(){return typeof window>`u`?null:window},Nr=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Pr=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Fr(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Mr(),t=e=>Fr(e);if(t.version=`3.4.5`,t.removed=[],!e||!e.document||e.document.nodeType!==jr.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript,a=e.DocumentFragment,o=e.HTMLTemplateElement,s=e.Node,c=e.Element,l=e.NodeFilter,u=e.NamedNodeMap,d=u===void 0?e.NamedNodeMap||e.MozNamedAttrMap:u,f=e.HTMLFormElement,p=e.DOMParser,m=e.trustedTypes,h=c.prototype,ee=cr(h,`cloneNode`),g=cr(h,`remove`),_=cr(h,`nextSibling`),te=cr(h,`childNodes`),v=cr(h,`parentNode`),ne=s&&s.prototype?cr(s.prototype,`nodeType`):null;if(typeof o==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let y,b=``,x=n,S=x.implementation,C=x.createNodeIterator,re=x.createDocumentFragment,ie=x.getElementsByTagName,ae=r.importNode,w=Pr();t.isSupported=typeof Nn==`function`&&typeof v==`function`&&S&&S.createHTMLDocument!==void 0;let oe=xr,se=Sr,T=Cr,ce=wr,le=Tr,ue=Dr,de=Or,fe=Ar,pe=Er,E=null,me=J({},[...ur,...dr,...fr,...mr,...gr]),D=null,he=J({},[..._r,...vr,...yr,...br]),O=Object.seal(Rn(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ge=null,_e=null,ve=Object.seal(Rn(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ye=!0,k=!0,be=!1,A=!0,j=!1,xe=!0,M=!1,Se=!1,N=!1,Ce=!1,we=!1,Te=!1,Ee=!0,De=!1,Oe=`user-content-`,ke=!0,P=!1,Ae={},F=null,je=J({},[`annotation-xml`,`audio`,`colgroup`,`desc`,`foreignobject`,`head`,`iframe`,`math`,`mi`,`mn`,`mo`,`ms`,`mtext`,`noembed`,`noframes`,`noscript`,`plaintext`,`script`,`style`,`svg`,`template`,`thead`,`title`,`video`,`xmp`]),Me=null,Ne=J({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Pe=null,Fe=J({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ie=`http://www.w3.org/1998/Math/MathML`,Le=`http://www.w3.org/2000/svg`,I=`http://www.w3.org/1999/xhtml`,Re=I,ze=!1,Be=null,Ve=J({},[Ie,Le,I],Jn),He=J({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Ue=J({},[`annotation-xml`]),We=J({},[`title`,`style`,`font`,`a`,`script`]),Ge=null,Ke=[`application/xhtml+xml`,`text/html`],L=null,R=null,qe=n.createElement(`form`),Je=function(e){return e instanceof RegExp||e instanceof Function},Ye=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(R&&R===e)return;(!e||typeof e!=`object`)&&(e={}),e=Y(e),Ge=Ke.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,L=Ge===`application/xhtml+xml`?Jn:qn,E=G(e,`ALLOWED_TAGS`)&&W(e.ALLOWED_TAGS)?J({},e.ALLOWED_TAGS,L):me,D=G(e,`ALLOWED_ATTR`)&&W(e.ALLOWED_ATTR)?J({},e.ALLOWED_ATTR,L):he,Be=G(e,`ALLOWED_NAMESPACES`)&&W(e.ALLOWED_NAMESPACES)?J({},e.ALLOWED_NAMESPACES,Jn):Ve,Pe=G(e,`ADD_URI_SAFE_ATTR`)&&W(e.ADD_URI_SAFE_ATTR)?J(Y(Fe),e.ADD_URI_SAFE_ATTR,L):Fe,Me=G(e,`ADD_DATA_URI_TAGS`)&&W(e.ADD_DATA_URI_TAGS)?J(Y(Ne),e.ADD_DATA_URI_TAGS,L):Ne,F=G(e,`FORBID_CONTENTS`)&&W(e.FORBID_CONTENTS)?J({},e.FORBID_CONTENTS,L):je,ge=G(e,`FORBID_TAGS`)&&W(e.FORBID_TAGS)?J({},e.FORBID_TAGS,L):Y({}),_e=G(e,`FORBID_ATTR`)&&W(e.FORBID_ATTR)?J({},e.FORBID_ATTR,L):Y({}),Ae=G(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Y(e.USE_PROFILES):e.USE_PROFILES:!1,ye=e.ALLOW_ARIA_ATTR!==!1,k=e.ALLOW_DATA_ATTR!==!1,be=e.ALLOW_UNKNOWN_PROTOCOLS||!1,A=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,j=e.SAFE_FOR_TEMPLATES||!1,xe=e.SAFE_FOR_XML!==!1,M=e.WHOLE_DOCUMENT||!1,Ce=e.RETURN_DOM||!1,we=e.RETURN_DOM_FRAGMENT||!1,Te=e.RETURN_TRUSTED_TYPE||!1,N=e.FORCE_BODY||!1,Ee=e.SANITIZE_DOM!==!1,De=e.SANITIZE_NAMED_PROPS||!1,ke=e.KEEP_CONTENT!==!1,P=e.IN_PLACE||!1,pe=lr(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Er,Re=typeof e.NAMESPACE==`string`?e.NAMESPACE:I,He=G(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?Y(e.MATHML_TEXT_INTEGRATION_POINTS):J({},[`mi`,`mo`,`mn`,`ms`,`mtext`]),Ue=G(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?Y(e.HTML_INTEGRATION_POINTS):J({},[`annotation-xml`]);let t=G(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?Y(e.CUSTOM_ELEMENT_HANDLING):Rn(null);if(O=Rn(null),G(t,`tagNameCheck`)&&Je(t.tagNameCheck)&&(O.tagNameCheck=t.tagNameCheck),G(t,`attributeNameCheck`)&&Je(t.attributeNameCheck)&&(O.attributeNameCheck=t.attributeNameCheck),G(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(O.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),j&&(k=!1),we&&(Ce=!0),Ae&&(E=J({},gr),D=Rn(null),Ae.html===!0&&(J(E,ur),J(D,_r)),Ae.svg===!0&&(J(E,dr),J(D,vr),J(D,br)),Ae.svgFilters===!0&&(J(E,fr),J(D,vr),J(D,br)),Ae.mathMl===!0&&(J(E,mr),J(D,yr),J(D,br))),ve.tagCheck=null,ve.attributeCheck=null,G(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?ve.tagCheck=e.ADD_TAGS:W(e.ADD_TAGS)&&(E===me&&(E=Y(E)),J(E,e.ADD_TAGS,L))),G(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?ve.attributeCheck=e.ADD_ATTR:W(e.ADD_ATTR)&&(D===he&&(D=Y(D)),J(D,e.ADD_ATTR,L))),G(e,`ADD_URI_SAFE_ATTR`)&&W(e.ADD_URI_SAFE_ATTR)&&J(Pe,e.ADD_URI_SAFE_ATTR,L),G(e,`FORBID_CONTENTS`)&&W(e.FORBID_CONTENTS)&&(F===je&&(F=Y(F)),J(F,e.FORBID_CONTENTS,L)),G(e,`ADD_FORBID_CONTENTS`)&&W(e.ADD_FORBID_CONTENTS)&&(F===je&&(F=Y(F)),J(F,e.ADD_FORBID_CONTENTS,L)),ke&&(E[`#text`]=!0),M&&J(E,[`html`,`head`,`body`]),E.table&&(J(E,[`tbody`]),delete ge.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw ir(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw ir(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);y=e.TRUSTED_TYPES_POLICY,b=y.createHTML(``)}else y===void 0&&(y=Nr(m,i)),y!==null&&typeof b==`string`&&(b=y.createHTML(``));H&&H(e),R=e},Xe=J({},[...dr,...fr,...pr]),Ze=J({},[...mr,...hr]),Qe=function(e){let t=v(e);(!t||!t.tagName)&&(t={namespaceURI:Re,tagName:`template`});let n=qn(e.tagName),r=qn(t.tagName);return Be[e.namespaceURI]?e.namespaceURI===Le?t.namespaceURI===I?n===`svg`:t.namespaceURI===Ie?n===`svg`&&(r===`annotation-xml`||He[r]):!!Xe[n]:e.namespaceURI===Ie?t.namespaceURI===I?n===`math`:t.namespaceURI===Le?n===`math`&&Ue[r]:!!Ze[n]:e.namespaceURI===I?t.namespaceURI===Le&&!Ue[r]||t.namespaceURI===Ie&&!He[r]?!1:!Ze[n]&&(We[n]||!Xe[n]):!!(Ge===`application/xhtml+xml`&&Be[e.namespaceURI]):!1},$e=function(e){Gn(t.removed,{element:e});try{v(e).removeChild(e)}catch{g(e)}},z=function(e,n){try{Gn(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{Gn(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`)if(Ce||we)try{$e(n)}catch{}else try{n.setAttribute(e,``)}catch{}},et=function(e){let t=null,r=null;if(N)e=`<remove></remove>`+e;else{let t=Yn(e,/^[\r\n\t ]+/);r=t&&t[0]}Ge===`application/xhtml+xml`&&Re===I&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=y?y.createHTML(e):e;if(Re===I)try{t=new p().parseFromString(i,Ge)}catch{}if(!t||!t.documentElement){t=S.createDocument(Re,`template`,null);try{t.documentElement.innerHTML=ze?b:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Re===I?ie.call(t,M?`html`:`body`)[0]:M?t.documentElement:a},tt=function(e){return C.call(e.ownerDocument||e,e,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},nt=function(e){e.normalize();let t=C.call(e.ownerDocument||e,e,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null),n=t.nextNode();for(;n;){let e=n.data;Hn([oe,se,T],t=>{e=Xn(e,t,` `)}),n.data=e,n=t.nextNode()}},rt=function(e){return e instanceof f&&(typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||!(e.attributes instanceof d)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`)},it=function(e){if(!ne||typeof e!=`object`||!e)return!1;try{return typeof ne(e)==`number`}catch{return!1}};function B(e,n,r){Hn(e,e=>{e.call(t,n,r,R)})}let at=function(e){let n=null;if(B(w.beforeSanitizeElements,e,null),rt(e))return $e(e),!0;let r=L(e.nodeName);if(B(w.uponSanitizeElement,e,{tagName:r,allowedTags:E}),xe&&e.hasChildNodes()&&!it(e.firstElementChild)&&K(/<[/\w!]/g,e.innerHTML)&&K(/<[/\w!]/g,e.textContent)||xe&&e.namespaceURI===I&&r===`style`&&it(e.firstElementChild)||e.nodeType===jr.progressingInstruction||xe&&e.nodeType===jr.comment&&K(/<[/\w]/g,e.data))return $e(e),!0;if(ge[r]||!(ve.tagCheck instanceof Function&&ve.tagCheck(r))&&!E[r]){if(!ge[r]&&ct(r)&&(O.tagNameCheck instanceof RegExp&&K(O.tagNameCheck,r)||O.tagNameCheck instanceof Function&&O.tagNameCheck(r)))return!1;if(ke&&!F[r]){let t=v(e)||e.parentNode,n=te(e)||e.childNodes;if(n&&t){let r=n.length;for(let i=r-1;i>=0;--i){let r=ee(n[i],!0);t.insertBefore(r,_(e))}}}return $e(e),!0}return e instanceof c&&!Qe(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&K(/<\/no(script|embed|frames)/i,e.innerHTML)?($e(e),!0):(j&&e.nodeType===jr.text&&(n=e.textContent,Hn([oe,se,T],e=>{n=Xn(n,e,` `)}),e.textContent!==n&&(Gn(t.removed,{element:e.cloneNode()}),e.textContent=n)),B(w.afterSanitizeElements,e,null),!1)},ot=function(e,t,r){if(_e[t]||Ee&&(t===`id`||t===`name`)&&(r in n||r in qe))return!1;let i=D[t]||ve.attributeCheck instanceof Function&&ve.attributeCheck(t,e);if(!(k&&!_e[t]&&K(ce,t))&&!(ye&&K(le,t))){if(!i||_e[t]){if(!(ct(e)&&(O.tagNameCheck instanceof RegExp&&K(O.tagNameCheck,e)||O.tagNameCheck instanceof Function&&O.tagNameCheck(e))&&(O.attributeNameCheck instanceof RegExp&&K(O.attributeNameCheck,t)||O.attributeNameCheck instanceof Function&&O.attributeNameCheck(t,e))||t===`is`&&O.allowCustomizedBuiltInElements&&(O.tagNameCheck instanceof RegExp&&K(O.tagNameCheck,r)||O.tagNameCheck instanceof Function&&O.tagNameCheck(r))))return!1}else if(!Pe[t]&&!K(pe,Xn(r,de,``))&&!((t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Zn(r,`data:`)===0&&Me[e])&&!(be&&!K(ue,Xn(r,de,``)))&&r)return!1}return!0},st=J({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),ct=function(e){return!st[qn(e)]&&K(fe,e)},lt=function(e){B(w.beforeSanitizeAttributes,e,null);let n=e.attributes;if(!n||rt(e))return;let r={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:D,forceKeepAttr:void 0},i=n.length;for(;i--;){let a=n[i],o=a.name,s=a.namespaceURI,c=a.value,l=L(o),u=c,d=o===`value`?u:Qn(u);if(r.attrName=l,r.attrValue=d,r.keepAttr=!0,r.forceKeepAttr=void 0,B(w.uponSanitizeAttribute,e,r),d=r.attrValue,De&&(l===`id`||l===`name`)&&Zn(d,Oe)!==0&&(z(o,e),d=Oe+d),xe&&K(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)){z(o,e);continue}if(l===`attributename`&&Yn(d,`href`)){z(o,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){z(o,e);continue}if(!A&&K(/\/>/i,d)){z(o,e);continue}j&&Hn([oe,se,T],e=>{d=Xn(d,e,` `)});let f=L(e.nodeName);if(!ot(f,l,d)){z(o,e);continue}if(y&&typeof m==`object`&&typeof m.getAttributeType==`function`&&!s)switch(m.getAttributeType(f,l)){case`TrustedHTML`:d=y.createHTML(d);break;case`TrustedScriptURL`:d=y.createScriptURL(d);break}if(d!==u)try{s?e.setAttributeNS(s,o,d):e.setAttribute(o,d),rt(e)?$e(e):Wn(t.removed)}catch{z(o,e)}}B(w.afterSanitizeAttributes,e,null)},ut=function(e){let t=null,n=tt(e);for(B(w.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)B(w.uponSanitizeShadowNode,t,null),at(t),lt(t),t.content instanceof a&&ut(t.content);B(w.afterSanitizeShadowDOM,e,null)},dt=function(e){if(e.nodeType===jr.element&&e.shadowRoot instanceof a){let t=e.shadowRoot;dt(t),ut(t)}let t=e.childNodes;if(!t)return;let n=[];Hn(t,e=>{Gn(n,e)});for(let e of n)dt(e)};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,o=null,s=null,c=null;if(ze=!e,ze&&(e=`<!-->`),typeof e!=`string`&&!it(e)&&(e=sr(e),typeof e!=`string`))throw ir(`dirty is not a string, aborting`);if(!t.isSupported)return e;if(Se||Ye(n),t.removed=[],typeof e==`string`&&(P=!1),P){let t=e.nodeName;if(typeof t==`string`){let e=L(t);if(!E[e]||ge[e])throw ir(`root node is forbidden and cannot be sanitized in-place`)}dt(e)}else if(it(e))i=et(`<!---->`),o=i.ownerDocument.importNode(e,!0),o.nodeType===jr.element&&o.nodeName===`BODY`||o.nodeName===`HTML`?i=o:i.appendChild(o),dt(o);else{if(!Ce&&!j&&!M&&e.indexOf(`<`)===-1)return y&&Te?y.createHTML(e):e;if(i=et(e),!i)return Ce?null:Te?b:``}i&&N&&$e(i.firstChild);let l=tt(P?e:i);for(;s=l.nextNode();)at(s),lt(s),s.content instanceof a&&ut(s.content);if(P)return j&&nt(e),e;if(Ce){if(j&&nt(i),we)for(c=re.call(i.ownerDocument);i.firstChild;)c.appendChild(i.firstChild);else c=i;return(D.shadowroot||D.shadowrootmode)&&(c=ae.call(r,c,!0)),c}let u=M?i.outerHTML:i.innerHTML;return M&&E[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&K(kr,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
33
|
+
`+u),j&&Hn([oe,se,T],e=>{u=Xn(u,e,` `)}),y&&Te?y.createHTML(u):u},t.setConfig=function(){Ye(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),Se=!0},t.clearConfig=function(){R=null,Se=!1},t.isValidAttribute=function(e,t,n){return R||Ye({}),ot(L(e),L(t),n)},t.addHook=function(e,t){typeof t==`function`&&Gn(w[e],t)},t.removeHook=function(e,t){if(t!==void 0){let n=Un(w[e],t);return n===-1?void 0:Kn(w[e],n,1)[0]}return Wn(w[e])},t.removeHooks=function(e){w[e]=[]},t.removeAllHooks=function(){w=Pr()},t}var Ir=Fr();function Lr(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Rr=Lr();function zr(e){Rr=e}var Br={exec:()=>null};function Vr(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function X(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(Z.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Hr=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),Z={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Vr(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Vr(e=>RegExp(`^ {0,${e}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Vr(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:Vr(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:Vr(e=>RegExp(`^ {0,${e}}<(?:[a-z].*>|!--)`,`i`)),blockquoteBeginRegex:Vr(e=>RegExp(`^ {0,${e}}>`))},Ur=/^(?:[ \t]*(?:\n|$))+/,Wr=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Gr=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Kr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,qr=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Jr=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Yr=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Xr=X(Yr).replace(/bull/g,Jr).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),Zr=X(Yr).replace(/bull/g,Jr).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Qr=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,$r=/^[^\n]+/,ei=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ti=X(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,ei).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ni=X(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Jr).getRegex(),ri=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,ii=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ai=X(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,ii).replace(`tag`,ri).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),oi=X(Qr).replace(`hr`,Kr).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,ri).getRegex(),si={blockquote:X(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,oi).getRegex(),code:Wr,def:ti,fences:Gr,heading:qr,hr:Kr,html:ai,lheading:Xr,list:ni,newline:Ur,paragraph:oi,table:Br,text:$r},ci=X(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Kr).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,ri).getRegex(),li={...si,lheading:Zr,table:ci,paragraph:X(Qr).replace(`hr`,Kr).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,ci).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,ri).getRegex()},ui={...si,html:X(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,ii).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Br,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:X(Qr).replace(`hr`,Kr).replace(`heading`,` *#{1,6} *[^
|
|
34
|
+
]`).replace(`lheading`,Xr).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},di=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,fi=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,pi=/^( {2,}|\\)\n(?!\s*$)/,mi=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,hi=/[\p{P}\p{S}]/u,gi=/[\s\p{P}\p{S}]/u,_i=/[^\s\p{P}\p{S}]/u,vi=X(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,gi).getRegex(),yi=/(?!~)[\p{P}\p{S}]/u,bi=/(?!~)[\s\p{P}\p{S}]/u,xi=/(?:[^\s\p{P}\p{S}]|~)/u,Si=X(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Hr?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),Ci=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,wi=X(Ci,`u`).replace(/punct/g,hi).getRegex(),Ti=X(Ci,`u`).replace(/punct/g,yi).getRegex(),Ei=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,Di=X(Ei,`gu`).replace(/notPunctSpace/g,_i).replace(/punctSpace/g,gi).replace(/punct/g,hi).getRegex(),Oi=X(Ei,`gu`).replace(/notPunctSpace/g,xi).replace(/punctSpace/g,bi).replace(/punct/g,yi).getRegex(),ki=X(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,_i).replace(/punctSpace/g,gi).replace(/punct/g,hi).getRegex(),Ai=X(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,hi).getRegex(),ji=X(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,_i).replace(/punctSpace/g,gi).replace(/punct/g,hi).getRegex(),Mi=X(/\\(punct)/,`gu`).replace(/punct/g,hi).getRegex(),Ni=X(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Pi=X(ii).replace(`(?:-->|$)`,`-->`).getRegex(),Fi=X(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,Pi).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ii=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Li=X(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,Ii).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ri=X(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Ii).replace(`ref`,ei).getRegex(),zi=X(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,ei).getRegex(),Bi=X(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Ri).replace(`nolink`,zi).getRegex(),Vi=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Hi={_backpedal:Br,anyPunctuation:Mi,autolink:Ni,blockSkip:Si,br:pi,code:fi,del:Br,delLDelim:Br,delRDelim:Br,emStrongLDelim:wi,emStrongRDelimAst:Di,emStrongRDelimUnd:ki,escape:di,link:Li,nolink:zi,punctuation:vi,reflink:Ri,reflinkSearch:Bi,tag:Fi,text:mi,url:Br},Ui={...Hi,link:X(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Ii).getRegex(),reflink:X(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Ii).getRegex()},Wi={...Hi,emStrongRDelimAst:Oi,emStrongLDelim:Ti,delLDelim:Ai,delRDelim:ji,url:X(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,Vi).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:X(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,Vi).getRegex()},Gi={...Wi,br:X(pi).replace(`{2,}`,`*`).getRegex(),text:X(Wi.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Ki={normal:si,gfm:li,pedantic:ui},qi={normal:Hi,gfm:Wi,breaks:Gi,pedantic:Ui},Ji={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},Yi=e=>Ji[e];function Xi(e,t){if(t){if(Z.escapeTest.test(e))return e.replace(Z.escapeReplace,Yi)}else if(Z.escapeTestNoEncode.test(e))return e.replace(Z.escapeReplaceNoEncode,Yi);return e}function Zi(e){try{e=encodeURI(e).replace(Z.percentDecode,`%`)}catch{return null}return e}function Qi(e,t){let n=e.replace(Z.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(Z.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``);for(;r<n.length;r++)n[r]=n[r].trim().replace(Z.slashPipe,`|`);return n}function $i(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function ea(e){let t=e.split(`
|
|
35
|
+
`),n=t.length-1;for(;n>=0&&Z.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
|
36
|
+
`)}function ta(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function na(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function ra(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function ia(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
37
|
+
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
|
|
38
|
+
`)}var aa=class{options;rules;lexer;constructor(e){this.options=e||Rr}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:ea(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=ia(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=$i(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:$i(t[0],`
|
|
39
|
+
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:$i(t[0],`
|
|
40
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=$i(t[0],`
|
|
41
|
+
`).split(`
|
|
42
|
+
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o;for(o=0;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
43
|
+
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
44
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
45
|
+
${s}`:s,r=r?`${r}
|
|
46
|
+
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
|
|
47
|
+
`+e.join(`
|
|
48
|
+
`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}else if(u?.type===`list`){let t=u,a=t.raw+`
|
|
49
|
+
`+e.join(`
|
|
50
|
+
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
51
|
+
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=na(t[2].split(`
|
|
52
|
+
`,1)[0],t[1].length),l=e.split(`
|
|
53
|
+
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
|
|
54
|
+
`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
|
|
55
|
+
`,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
|
|
56
|
+
`+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
57
|
+
`+l}u=!l.trim(),r+=p+`
|
|
58
|
+
`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]);let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1;if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=ea(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:$i(t[0],`
|
|
59
|
+
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Qi(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
60
|
+
`):[],a={type:`table`,raw:$i(t[0],`
|
|
61
|
+
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Qi(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:$i(t[0],`
|
|
62
|
+
`),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
63
|
+
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=$i(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=ta(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),ra(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return ra(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}else if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},Q=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Rr,this.options.tokenizer=this.options.tokenizer||new aa,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:Z,block:Ki.normal,inline:qi.normal};this.options.pedantic?(t.block=Ki.pedantic,t.inline=qi.pedantic):this.options.gfm&&(t.block=Ki.gfm,this.options.breaks?t.inline=qi.breaks:t.inline=qi.gfm),this.tokenizer.rules=t}static get rules(){return{block:Ki,inline:qi}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(Z.carriageReturn,`
|
|
64
|
+
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(Z.tabCharGlobal,` `).replace(Z.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
|
|
65
|
+
`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
66
|
+
`)?``:`
|
|
67
|
+
`)+i.raw,n.text+=`
|
|
68
|
+
`+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
69
|
+
`)?``:`
|
|
70
|
+
`)+i.raw,n.text+=`
|
|
71
|
+
`+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
|
|
72
|
+
`)?``:`
|
|
73
|
+
`)+i.raw,r.text+=`
|
|
74
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
75
|
+
`)?``:`
|
|
76
|
+
`)+i.raw,n.text+=`
|
|
77
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``,s=1/0;for(;e;){if(e.length<s)s=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},oa=class{options;parser;constructor(e){this.options=e||Rr}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(Z.notSpaceStart)?.[0],i=e.replace(Z.endingNewline,``)+`
|
|
78
|
+
`;return r?`<pre><code class="language-`+Xi(r)+`">`+(n?i:Xi(i,!0))+`</code></pre>
|
|
79
|
+
`:`<pre><code>`+(n?i:Xi(i,!0))+`</code></pre>
|
|
80
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
81
|
+
${this.parser.parse(e)}</blockquote>
|
|
82
|
+
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
83
|
+
`}hr(e){return`<hr>
|
|
84
|
+
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
85
|
+
`+r+`</`+i+`>
|
|
86
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
87
|
+
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
88
|
+
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
89
|
+
<thead>
|
|
90
|
+
`+t+`</thead>
|
|
91
|
+
`+r+`</table>
|
|
92
|
+
`}tablerow({text:e}){return`<tr>
|
|
93
|
+
${e}</tr>
|
|
94
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
95
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Xi(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Zi(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+Xi(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Zi(e);if(i===null)return Xi(n);e=i;let a=`<img src="${e}" alt="${Xi(n)}"`;return t&&(a+=` title="${Xi(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Xi(e.text)}},sa=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},ca=class e{options;renderer;textRenderer;constructor(e){this.options=e||Rr,this.options.renderer=this.options.renderer||new oa,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new sa}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},la=class{options;block;constructor(e){this.options=e||Rr}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Q.lex:Q.lexInline}provideParser(e=this.block){return e?ca.parse:ca.parseInline}},ua=class{defaults=Lr();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=ca;Renderer=oa;TextRenderer=sa;Lexer=Q;Tokenizer=aa;Hooks=la;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new oa(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new aa(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new la;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];la.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async&&la.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:t[r]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Q.lex(e,t??this.defaults)}parser(e,t){return ca.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?Q.lex:Q.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?ca.parse:ca.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?Q.lex:Q.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?ca.parse:ca.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
96
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+Xi(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},da=new ua;function $(e,t){return da.parse(e,t)}$.options=$.setOptions=function(e){return da.setOptions(e),$.defaults=da.defaults,zr($.defaults),$},$.getDefaults=Lr,$.defaults=Rr,$.use=function(...e){return da.use(...e),$.defaults=da.defaults,zr($.defaults),$},$.walkTokens=function(e,t){return da.walkTokens(e,t)},$.parseInline=da.parseInline,$.Parser=ca,$.parser=ca.parse,$.Renderer=oa,$.TextRenderer=sa,$.Lexer=Q,$.lexer=Q.lex,$.Tokenizer=aa,$.Hooks=la,$.parse=$,$.options,$.setOptions,$.use,$.walkTokens,$.parseInline,ca.parse,Q.lex;var fa={a:`text-blue-600 underline hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300`,blockquote:`border-l-4 border-gray-300 dark:border-gray-700 pl-3 italic mb-2`,code:`bg-gray-100 dark:bg-gray-800 dark:text-gray-200 rounded px-1 font-mono text-xs`,em:`italic`,h1:`text-2xl font-bold mb-2`,h2:`text-xl font-bold mb-2`,h3:`text-lg font-bold mb-2`,h4:`font-bold mb-2`,h5:`font-bold mb-2`,h6:`font-bold mb-2`,hr:`border-gray-300 dark:border-gray-700 mb-2`,li:``,ol:`list-decimal pl-4 mb-2 last:mb-0`,p:`mb-2 last:mb-0`,pre:`bg-gray-100 dark:bg-gray-800 rounded p-2 mb-2 overflow-x-auto`,strong:`font-bold`,table:`border-collapse mb-2 w-full`,tbody:``,td:`border border-gray-300 dark:border-gray-700 px-2 py-1`,th:`border border-gray-300 dark:border-gray-700 px-2 py-1 font-bold`,thead:``,tr:``,ul:`list-disc pl-4 mb-2 last:mb-0`},pa=[`a`,`blockquote`,`code`,`em`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`hr`,`li`,`ol`,`p`,`pre`,`strong`,`table`,`tbody`,`td`,`th`,`thead`,`tr`,`ul`],ma=new ua,ha=(e,t)=>{let n={...fa,...t},r=ma.parse(e),i=Ir.sanitize(r,{ADD_ATTR:[`target`]}),a=document.createElement(`div`);a.innerHTML=i;for(let e of pa){let t=n[e];t&&a.querySelectorAll(e).forEach(e=>{e.classList.add(...t.split(` `).filter(Boolean))})}return a.querySelectorAll(`a`).forEach(e=>{e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`)}),V(`div`,{dangerouslySetInnerHTML:{__html:a.innerHTML}})},ga=({children:e})=>{let t=je(null),n=e instanceof Promise,[r,i]=P(n?null:e),[a,o]=P(n);return F(()=>{if(!(e instanceof Promise)){i(e),o(!1);return}let t=!1;return e.then(e=>{t||(i(e),o(!1))}),()=>{t=!0}},[e]),F(()=>{let e=t.current;if(!(!e||!(r instanceof HTMLElement)))return e.appendChild(r),()=>{e.contains(r)&&e.removeChild(r)}},[r]),a?V(En,{}):r===null?null:typeof r==`string`?V(`div`,{className:`hawkai-assistant__tool__text w-fit rounded-2xl rounded-bl-sm bg-gray-100 dark:bg-gray-800 px-3 py-2 text-sm text-gray-900 dark:text-gray-100`,children:ha(r)}):r instanceof HTMLElement?V(`div`,{ref:t,className:`hawkai-assistant__tool__element`}):V(x,{children:r})},_a=({turn:e,isLoading:t})=>{let n=e.role===`user`,{tools:r}=Tt(),{sendMessage:i}=Cn();if(n&&!e.text&&!e.files?.length)return null;let a={sendMessage:i},o=e.role===`assistant`&&e.toolUses?e.toolUses.map(e=>{let t=r.find(t=>t.name===e.name);if(!t?.render)return null;let n=t.render({input:e.input,status:e.status},a);return n===null?null:{id:e.id,result:n}}).filter(e=>e!==null):[],s=!!e.text;return V(`div`,{className:sn({"hawkai-assistant__message flex flex-col max-w-[90%]":!0,"hawkai-assistant__message--user items-end self-end":n,"hawkai-assistant__message--assistant items-start":!n}),children:[n&&e.files?.map((e,t)=>e.mediaType.startsWith(`image/`)&&e.data?V(`img`,{src:`data:${e.mediaType};base64,${e.data}`,alt:e.name,className:`hawkai-assistant__message__image my-1 max-w-full rounded-xl max-h-32 object-contain`},t):V(`div`,{className:`hawkai-assistant__message__file my-1 flex items-center gap-1 rounded-lg bg-gray-100 dark:bg-gray-800 px-3 py-2 text-xs text-gray-700 dark:text-gray-300`,children:V(`span`,{children:e.name})},t)),t&&!n&&!e.text?V(En,{}):s&&V(`div`,{className:sn({"hawkai-assistant__message__bubble rounded-2xl px-3 py-2 text-sm":!0,"hawkai-assistant__message__bubble--user bg-primary text-white rounded-br-sm whitespace-pre-wrap":n,"hawkai-assistant__message__bubble--assistant bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-gray-100 rounded-bl-sm":!n}),children:n?e.text:ha(e.text)}),o.map(({id:e,result:t})=>V(`div`,{className:`hawkai-assistant__message__tool-result my-2 last:mb-0 w-full`,children:V(ga,{children:t})},e))]})},va=`Hi - how can I help you search for what you need?`,ya=()=>{let{turns:e,isStreaming:t}=Tt(),n=je(null),r=window.HawkAI.Assistant.config.ui,i=e[e.length-1],a=t&&!(i?.role===`assistant`&&!i?.text);return F(()=>{n.current&&(n.current.scrollTop=n.current.scrollHeight)},[e,t]),V(`div`,{ref:n,className:`hawkai-assistant__message-list flex flex-1 flex-col gap-2 overflow-y-auto p-3`,children:[V(_a,{turn:{role:`assistant`,text:r?.initialMessage??va}}),e.map((n,r)=>{let i=r===e.length-1;return V(_a,{turn:n,isLoading:t&&i&&n.role===`assistant`&&!n.text},r)}),a&&V(`div`,{className:`hawkai-assistant__loading-wrapper flex flex-col items-start`,children:V(En,{})})]})},ba=()=>{let{turns:e}=Tt(),{sendMessage:t}=Cn(),n=window.HawkAI.Assistant.config.ui?.promptOptions;return!n?.length||e.length>0?null:V(`div`,{className:`hawkai-assistant__prompt-options flex flex-wrap gap-2 px-4 py-3`,children:n.map(e=>V(`button`,{type:`button`,onClick:()=>t(e),className:`hawkai-assistant__prompt-options__button cursor-pointer rounded-2xl rounded-br-sm bg-primary px-3 py-2 text-left text-sm text-white focus:outline-none hover:opacity-90`,children:e},e))})},xa=({visible:e,onClose:t})=>{let[n,r]=P(!1),{clearChat:i,isStreaming:a}=Tt();if(!e)return null;let o=window.HawkAI.Assistant.config?.ui,s=o?.logoUrl,c=o?.heading||`Assistant`,l=o?.position??`right`,u=o?.allowFullScreen!==!1,d=o?.display===`drawer`,f=!d,p=`size-5`;return V(`div`,{className:sn({"hawkai-assistant__window fixed z-50 flex flex-col bg-white dark:bg-gray-900":!0,"hawkai-assistant__window--fullscreen inset-0":n,"hawkai-assistant__window--window":f,"hawkai-assistant__window--drawer":d,"hawkai-assistant__window--right":l===`right`,"hawkai-assistant__window--left":l===`left`},f&&!n&&{"inset-x-2 top-4 bottom-24 rounded-xl shadow-2xl ring-1 ring-black/5 dark:ring-white/10":!0,"sm:inset-x-auto sm:top-auto sm:h-160 sm:w-120":!0,"sm:right-6":l===`right`,"sm:left-6":l===`left`},d&&!n&&{"inset-y-0 w-full shadow-2xl sm:w-120":!0,"right-0":l===`right`,"left-0":l===`left`}),children:[V(`header`,{className:sn({"hawkai-assistant__window__header flex items-center justify-between bg-primary px-4 py-3":!0,"hawkai-assistant__window__header--fullscreen":n,"rounded-t-xl":!n&&!d}),children:[s&&V(`img`,{src:s,alt:``,className:`hawkai-assistant__window__logo max-h-10 max-w-25`}),V(`span`,{className:`hawkai-assistant__window__title text-md font-semibold text-white`,children:c}),V(`div`,{className:`hawkai-assistant__window__actions flex items-center gap-2`,children:[V(`button`,{type:`button`,onClick:i,disabled:a,className:`hawkai-assistant__window__clear-button cursor-pointer text-white/90 hover:text-white focus:outline-none disabled:cursor-not-allowed disabled:opacity-40`,title:`New conversation`,"aria-label":`New conversation`,children:V(mn,{className:p,"aria-hidden":!0})}),u&&V(`button`,{type:`button`,onClick:()=>r(e=>!e),className:sn({"hawkai-assistant__window__fullscreen-button cursor-pointer text-white/90 hover:text-white focus:outline-none":!0,"hawkai-assistant__window__fullscreen-button--active":n}),title:n?`Exit fullscreen`:`Enter fullscreen`,"aria-label":n?`Exit fullscreen`:`Enter fullscreen`,children:V(n?un:fn,{className:p,"aria-hidden":!0})}),d&&V(`button`,{type:`button`,onClick:t,className:`hawkai-assistant__window__close-button cursor-pointer text-white/90 hover:text-white focus:outline-none`,title:`Close`,"aria-label":`Close`,children:V(gn,{className:p,"aria-hidden":!0})})]})]}),V(`div`,{className:`hawkai-assistant__window__body flex flex-1 flex-col overflow-hidden`,children:[V(ya,{}),V(ba,{}),V(Tn,{})]})]})},Sa=()=>{let{turns:e,userClosed:t,setUserClosed:n,clearChat:r}=Tt(),[i,a]=P(()=>(e.length>0||window.HawkAI.Assistant.config.ui?.open===!0)&&!t),o=()=>{a(!0),n(!1)},s=()=>{a(!1),n(!0)};return F(()=>(k.toggle=e=>{e?o():s()},()=>{k.toggle=void 0}),[]),F(()=>(k.clearChat=r,()=>{k.clearChat=void 0}),[r]),V(x,{children:[V(cn,{isOpen:i,onClick:()=>i?s():o()}),V(xa,{visible:i,onClose:s})]})},Ca=()=>V(`div`,{className:`hawkai-assistant`,"data-theme":Dt(window.HawkAI.Assistant.config.ui?.theme),children:V(wt,{children:V(Sa,{})})}),wa=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
|
|
97
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-800:oklch(42.4% .199 265.638);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--leading-tight:1.25;--radius-sm:.25rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--animate-bounce:bounce 1s infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-primary:#333;--color-primary-hover:#444}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}::marker{color:currentColor}}@layer components;@layer utilities{.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.fixed{position:fixed}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.inset-x-2{inset-inline:calc(var(--spacing) * 2)}.inset-y-0{inset-block:calc(var(--spacing) * 0)}.top-4{top:calc(var(--spacing) * 4)}.right-0{right:calc(var(--spacing) * 0)}.right-6{right:calc(var(--spacing) * 6)}.bottom-6{bottom:calc(var(--spacing) * 6)}.bottom-24{bottom:calc(var(--spacing) * 24)}.left-0{left:calc(var(--spacing) * 0)}.left-6{left:calc(var(--spacing) * 6)}.z-50{z-index:50}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.my-1{margin-block:calc(var(--spacing) * 1)}.my-2{margin-block:calc(var(--spacing) * 2)}.mt-auto{margin-top:auto}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.flex{display:flex}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.table{display:table}.size-5{width:calc(var(--spacing) * 5);height:calc(var(--spacing) * 5)}.size-6{width:calc(var(--spacing) * 6);height:calc(var(--spacing) * 6)}.h-3{height:calc(var(--spacing) * 3)}.h-5{height:calc(var(--spacing) * 5)}.h-10{height:calc(var(--spacing) * 10)}.h-14{height:calc(var(--spacing) * 14)}.h-20{height:calc(var(--spacing) * 20)}.h-21{height:calc(var(--spacing) * 21)}.max-h-10{max-height:calc(var(--spacing) * 10)}.max-h-32{max-height:calc(var(--spacing) * 32)}.w-3{width:calc(var(--spacing) * 3)}.w-5{width:calc(var(--spacing) * 5)}.w-10{width:calc(var(--spacing) * 10)}.w-14{width:calc(var(--spacing) * 14)}.w-32{width:calc(var(--spacing) * 32)}.w-fit{width:fit-content}.w-full{width:100%}.max-w-25{max-width:calc(var(--spacing) * 25)}.max-w-32{max-width:calc(var(--spacing) * 32)}.max-w-\\[90\\%\\]{max-width:90%}.max-w-full{max-width:100%}.flex-1{flex:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.animate-bounce{animation:var(--animate-bounce)}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-1{gap:calc(var(--spacing) * 1)}.gap-2{gap:calc(var(--spacing) * 2)}.self-end{align-self:flex-end}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-t-xl{border-top-left-radius:var(--radius-xl);border-top-right-radius:var(--radius-xl)}.rounded-br-sm{border-bottom-right-radius:var(--radius-sm)}.rounded-bl-sm{border-bottom-left-radius:var(--radius-sm)}.border{border-style:var(--tw-border-style);border-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-solid{--tw-border-style:solid;border-style:solid}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-300{border-color:var(--color-gray-300)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-primary{background-color:var(--color-primary)}.bg-white{background-color:var(--color-white)}.object-contain{object-fit:contain}.object-cover{object-fit:cover}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-3{padding-block:calc(var(--spacing) * 3)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.text-left{text-align:left}.font-mono{font-family:var(--font-mono)}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.whitespace-pre-wrap{white-space:pre-wrap}.text-blue-600{color:var(--color-blue-600)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-700{color:var(--color-gray-700)}.text-gray-900{color:var(--color-gray-900)}.text-primary{color:var(--color-primary)}.text-white{color:var(--color-white)}.text-white\\/90{color:#ffffffe6}@supports (color:color-mix(in lab, red, red)){.text-white\\/90{color:color-mix(in oklab, var(--color-white) 90%, transparent)}}.italic{font-style:italic}.underline{text-decoration-line:underline}.shadow-lg\\/30{--tw-shadow-alpha:30%;--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,oklab(0% 0 0/.3)), 0 4px 6px -4px var(--tw-shadow-color,oklab(0% 0 0/.3));box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-black\\/5{--tw-ring-color:#0000000d}@supports (color:color-mix(in lab, red, red)){.ring-black\\/5{--tw-ring-color:color-mix(in oklab, var(--color-black) 5%, transparent)}}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.last\\:mb-0:last-child{margin-bottom:calc(var(--spacing) * 0)}@media (hover:hover){.hover\\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\\:bg-primary-hover:hover{background-color:var(--color-primary-hover)}.hover\\:text-blue-800:hover{color:var(--color-blue-800)}.hover\\:text-gray-700:hover{color:var(--color-gray-700)}.hover\\:text-white:hover{color:var(--color-white)}.hover\\:opacity-90:hover{opacity:.9}.hover\\:shadow-md:hover{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}}.focus\\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\\:ring-primary:focus{--tw-ring-color:var(--color-primary)}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-40:disabled{opacity:.4}.disabled\\:opacity-50:disabled{opacity:.5}@media (hover:hover){.disabled\\:hover\\:bg-primary:disabled:hover{background-color:var(--color-primary)}.disabled\\:hover\\:bg-transparent:disabled:hover{background-color:#0000}}@media (width>=40rem){.sm\\:inset-x-auto{inset-inline:auto}.sm\\:top-auto{top:auto}.sm\\:right-6{right:calc(var(--spacing) * 6)}.sm\\:left-6{left:calc(var(--spacing) * 6)}.sm\\:h-160{height:calc(var(--spacing) * 160)}.sm\\:w-120{width:calc(var(--spacing) * 120)}}.dark\\:border-gray-700:where([data-theme=dark],[data-theme=dark] *){border-color:var(--color-gray-700)}.dark\\:bg-gray-800:where([data-theme=dark],[data-theme=dark] *){background-color:var(--color-gray-800)}.dark\\:bg-gray-900:where([data-theme=dark],[data-theme=dark] *){background-color:var(--color-gray-900)}.dark\\:text-blue-400:where([data-theme=dark],[data-theme=dark] *){color:var(--color-blue-400)}.dark\\:text-gray-100:where([data-theme=dark],[data-theme=dark] *){color:var(--color-gray-100)}.dark\\:text-gray-200:where([data-theme=dark],[data-theme=dark] *){color:var(--color-gray-200)}.dark\\:text-gray-300:where([data-theme=dark],[data-theme=dark] *){color:var(--color-gray-300)}.dark\\:text-gray-400:where([data-theme=dark],[data-theme=dark] *){color:var(--color-gray-400)}.dark\\:text-gray-500:where([data-theme=dark],[data-theme=dark] *){color:var(--color-gray-500)}.dark\\:ring-white\\/10:where([data-theme=dark],[data-theme=dark] *){--tw-ring-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.dark\\:ring-white\\/10:where([data-theme=dark],[data-theme=dark] *){--tw-ring-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}@media (hover:hover){.dark\\:hover\\:bg-gray-800:where([data-theme=dark],[data-theme=dark] *):hover{background-color:var(--color-gray-800)}.dark\\:hover\\:text-blue-300:where([data-theme=dark],[data-theme=dark] *):hover{color:var(--color-blue-300)}.dark\\:hover\\:text-gray-300:where([data-theme=dark],[data-theme=dark] *):hover{color:var(--color-gray-300)}}}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@keyframes bounce{0%,to{animation-timing-function:cubic-bezier(.8,0,1,1);transform:translateY(-25%)}50%{animation-timing-function:cubic-bezier(0,0,.2,1);transform:none}}`,Ta=!1,Ea=e=>{let t=[];if((!e.apiUrl||typeof e.apiUrl!=`string`)&&t.push(`apiUrl`),(!e.agentId||typeof e.agentId!=`string`)&&t.push(`agentId`),t.length>0)throw Error(`[HawkAI Assistant] invalid or missing configuration properties: ${t.join(`, `)}`)},Da=()=>{let e=new CSSStyleSheet;e.replaceSync(wa.replace(/:root/gu,`:host`));let t=[];for(let n of Array.from(e.cssRules))n instanceof CSSPropertyRule&&n.initialValue&&t.push(`${n.name}: ${n.initialValue}`);t.length>0&&e.insertRule(`:host { ${t.join(`; `)} }`);let n=window.HawkAI.Assistant.config.ui?.colors;return n?.primary&&e.insertRule(`:host { --color-primary: ${n.primary.default}; --color-primary-hover: ${n.primary.hover}; }`,e.cssRules.length),e},Oa=e=>{if(Ea(e),Ta)return;Ta=!0,window.HawkAI.Assistant.config=e,Object.freeze(window.HawkAI.Assistant),it();let t=document.createElement(`div`);document.body.appendChild(t);let n=t.attachShadow({mode:`open`}),r=[Da()];if(e.ui?.styles){let t=new CSSStyleSheet;t.replaceSync(e.ui.styles),r.push(t)}n.adoptedStyleSheets=r,ve(y(Ca,null),n),e.ui?.stylesheetUrl&&fetch(e.ui.stylesheetUrl).then(e=>e.text()).then(e=>{let t=new CSSStyleSheet;t.replaceSync(e),n.adoptedStyleSheets=[...n.adoptedStyleSheets,t]})},ka=e=>{k.setActorId?.(e)},Aa=e=>{ut(e)},ja=e=>{k.toggle?.(e)},Ma=async(e,t)=>{k.toggle?.(!0),setTimeout(()=>{k.sendMessage?.(e,t)},250)},Na=()=>{k.clearChat?.()};return window.HawkAI=window.HawkAI??{},window.HawkAI.Assistant={config:void 0,initialize:Oa,setActorId:ka,setContext:Aa,toggle:ja,sendMessage:Ma,clearChat:Na},e.clearChat=Na,e.initialize=Oa,e.sendMessage=Ma,e.setActorId=ka,e.setContext=Aa,e.toggle=ja,e})({});
|
package/dist/index.d.ts
ADDED