From db77498a63f760aee821a53d533c9c3e1e66991c Mon Sep 17 00:00:00 2001 From: prtkjakhar Date: Thu, 14 Dec 2023 19:01:59 +0530 Subject: [PATCH] new ui --- packages/chat-ui/dist/index.js | 2 +- packages/chat-ui/es/components/Chat/index.js | 2 ++ packages/chat-ui/lib/components/Chat/index.js | 2 ++ packages/chat-ui/src/components/Chat/index.tsx | 3 +++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/chat-ui/dist/index.js b/packages/chat-ui/dist/index.js index ee3c7616..e1e66b2c 100644 --- a/packages/chat-ui/dist/index.js +++ b/packages/chat-ui/dist/index.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ChatUI={},e.React,e.ReactDOM)}(this,(function(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}e.version="0.0.0";var o=r(t),a=r(n);function i(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0}});else{var e=function(e){for(var t=window.document,n=o(t);n;)n=o(t=n.ownerDocument);return t}(),t=[],n=null,r=null;i.prototype.THROTTLE_TIMEOUT=100,i.prototype.POLL_INTERVAL=null,i.prototype.USE_MUTATION_OBSERVER=!0,i._setupCrossOriginUpdater=function(){return n||(n=function(e,n){r=e&&n?f(e,n):{top:0,bottom:0,left:0,right:0,width:0,height:0},t.forEach((function(e){e._checkForIntersections()}))}),n},i._resetCrossOriginUpdater=function(){n=null,r=null},i.prototype.observe=function(e){if(!this._observationTargets.some((function(t){return t.element==e}))){if(!e||1!=e.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:e,entry:null}),this._monitorIntersections(e.ownerDocument),this._checkForIntersections()}},i.prototype.unobserve=function(e){this._observationTargets=this._observationTargets.filter((function(t){return t.element!=e})),this._unmonitorIntersections(e.ownerDocument),0==this._observationTargets.length&&this._unregisterInstance()},i.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorAllIntersections(),this._unregisterInstance()},i.prototype.takeRecords=function(){var e=this._queuedEntries.slice();return this._queuedEntries=[],e},i.prototype._initThresholds=function(e){var t=e||[0];return Array.isArray(t)||(t=[t]),t.sort().filter((function(e,t,n){if("number"!=typeof e||isNaN(e)||e<0||e>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return e!==n[t-1]}))},i.prototype._parseRootMargin=function(e){var t=(e||"0px").split(/\s+/).map((function(e){var t=/^(-?\d*\.?\d+)(px|%)$/.exec(e);if(!t)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(t[1]),unit:t[2]}}));return t[1]=t[1]||t[0],t[2]=t[2]||t[0],t[3]=t[3]||t[1],t},i.prototype._monitorIntersections=function(t){var n=t.defaultView;if(n&&-1==this._monitoringDocuments.indexOf(t)){var r=this._checkForIntersections,a=null,i=null;this.POLL_INTERVAL?a=n.setInterval(r,this.POLL_INTERVAL):(c(n,"resize",r,!0),c(t,"scroll",r,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in n&&(i=new n.MutationObserver(r)).observe(t,{attributes:!0,childList:!0,characterData:!0,subtree:!0})),this._monitoringDocuments.push(t),this._monitoringUnsubscribes.push((function(){var e=t.defaultView;e&&(a&&e.clearInterval(a),u(e,"resize",r,!0)),u(t,"scroll",r,!0),i&&i.disconnect()}));var l=this.root&&(this.root.ownerDocument||this.root)||e;if(t!=l){var s=o(t);s&&this._monitorIntersections(s.ownerDocument)}}},i.prototype._unmonitorIntersections=function(t){var n=this._monitoringDocuments.indexOf(t);if(-1!=n){var r=this.root&&(this.root.ownerDocument||this.root)||e,a=this._observationTargets.some((function(e){var n=e.element.ownerDocument;if(n==t)return!0;for(;n&&n!=r;){var a=o(n);if((n=a&&a.ownerDocument)==t)return!0}return!1}));if(!a){var i=this._monitoringUnsubscribes[n];if(this._monitoringDocuments.splice(n,1),this._monitoringUnsubscribes.splice(n,1),i(),t!=r){var c=o(t);c&&this._unmonitorIntersections(c.ownerDocument)}}}},i.prototype._unmonitorAllIntersections=function(){var e=this._monitoringUnsubscribes.slice(0);this._monitoringDocuments.length=0,this._monitoringUnsubscribes.length=0;for(var t=0;t=0&&h>=0&&{top:u,bottom:s,left:d,right:m,width:v,height:h}||null),!g)break;y=y&&p(y)}return g}},i.prototype._getRootRect=function(){var t;if(this.root&&!m(this.root))t=l(this.root);else{var n=m(this.root)?this.root:e,r=n.documentElement,o=n.body;t={top:0,left:0,right:r.clientWidth||o.clientWidth,width:r.clientWidth||o.clientWidth,bottom:r.clientHeight||o.clientHeight,height:r.clientHeight||o.clientHeight}}return this._expandRectByRootMargin(t)},i.prototype._expandRectByRootMargin=function(e){var t=this._rootMarginValues.map((function(t,n){return"px"==t.unit?t.value:t.value*(n%2?e.width:e.height)/100})),n={top:e.top-t[0],right:e.right+t[1],bottom:e.bottom+t[2],left:e.left-t[3]};return n.width=n.right-n.left,n.height=n.bottom-n.top,n},i.prototype._hasCrossedThreshold=function(e,t){var n=e&&e.isIntersecting?e.intersectionRatio||0:-1,r=t.isIntersecting?t.intersectionRatio||0:-1;if(n!==r)for(var o=0;o1?n-1:0),o=1;o/gm),Z=b(/\${[\w\W]*}/gm),ee=b(/^data-[\-\w.\u00B7-\uFFFF]/),te=b(/^aria-[\-\w]+$/),ne=b(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),re=b(/^(?:\w+script|data):/i),oe=b(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ae=b(/^html$/i),ie=function(){return"undefined"==typeof window?null:window};var ce=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ie(),n=function(t){return e(t)};if(n.version="2.4.7",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;var r=t.document,o=t.document,a=t.DocumentFragment,i=t.HTMLTemplateElement,c=t.Node,l=t.Element,s=t.NodeFilter,d=t.NamedNodeMap,p=void 0===d?t.NamedNodeMap||t.MozNamedAttrMap:d,m=t.HTMLFormElement,v=t.DOMParser,h=t.trustedTypes,g=l.prototype,b=H(g,"cloneNode"),E=H(g,"nextSibling"),w=H(g,"childNodes"),x=H(g,"parentNode");if("function"==typeof i){var S=o.createElement("template");S.content&&S.content.ownerDocument&&(o=S.content.ownerDocument)}var N=function(e,t){if("object"!==u(e)||"function"!=typeof e.createPolicy)return null;var n=null,r="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(r)&&(n=t.currentScript.getAttribute(r));var o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return null}}(h,r),P=N?N.createHTML(""):"",ce=o,ue=ce.implementation,le=ce.createNodeIterator,se=ce.createDocumentFragment,fe=ce.getElementsByTagName,de=r.importNode,pe={};try{pe=F(o).documentMode?o.documentMode:{}}catch(e){}var me={};n.isSupported="function"==typeof x&&ue&&void 0!==ue.createHTMLDocument&&9!==pe;var ve,he,ge=J,ye=Q,be=Z,Ee=ee,we=te,xe=re,Se=oe,Ne=ne,Te=null,Ce=D({},[].concat(f(B),f(U),f(z),f(V),f(Y))),Oe=null,ke=D({},[].concat(f(X),f(q),f(K),f($))),Re=Object.seal(Object.create(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}})),Ie=null,Ae=null,Me=!0,_e=!0,Le=!1,je=!0,Pe=!1,De=!1,Fe=!1,He=!1,Be=!1,Ue=!1,ze=!1,Ge=!0,Ve=!1,We=!0,Ye=!1,Xe={},qe=null,Ke=D({},["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"]),$e=null,Je=D({},["audio","video","img","source","image","track"]),Qe=null,Ze=D({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),et="http://www.w3.org/1998/Math/MathML",tt="http://www.w3.org/2000/svg",nt="http://www.w3.org/1999/xhtml",rt=nt,ot=!1,at=null,it=D({},[et,tt,nt],R),ct=["application/xhtml+xml","text/html"],ut=null,lt=o.createElement("form"),st=function(e){return e instanceof RegExp||e instanceof Function},ft=function(e){ut&&ut===e||(e&&"object"===u(e)||(e={}),e=F(e),ve=ve=-1===ct.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,he="application/xhtml+xml"===ve?R:k,Te="ALLOWED_TAGS"in e?D({},e.ALLOWED_TAGS,he):Ce,Oe="ALLOWED_ATTR"in e?D({},e.ALLOWED_ATTR,he):ke,at="ALLOWED_NAMESPACES"in e?D({},e.ALLOWED_NAMESPACES,R):it,Qe="ADD_URI_SAFE_ATTR"in e?D(F(Ze),e.ADD_URI_SAFE_ATTR,he):Ze,$e="ADD_DATA_URI_TAGS"in e?D(F(Je),e.ADD_DATA_URI_TAGS,he):Je,qe="FORBID_CONTENTS"in e?D({},e.FORBID_CONTENTS,he):Ke,Ie="FORBID_TAGS"in e?D({},e.FORBID_TAGS,he):{},Ae="FORBID_ATTR"in e?D({},e.FORBID_ATTR,he):{},Xe="USE_PROFILES"in e&&e.USE_PROFILES,Me=!1!==e.ALLOW_ARIA_ATTR,_e=!1!==e.ALLOW_DATA_ATTR,Le=e.ALLOW_UNKNOWN_PROTOCOLS||!1,je=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Pe=e.SAFE_FOR_TEMPLATES||!1,De=e.WHOLE_DOCUMENT||!1,Be=e.RETURN_DOM||!1,Ue=e.RETURN_DOM_FRAGMENT||!1,ze=e.RETURN_TRUSTED_TYPE||!1,He=e.FORCE_BODY||!1,Ge=!1!==e.SANITIZE_DOM,Ve=e.SANITIZE_NAMED_PROPS||!1,We=!1!==e.KEEP_CONTENT,Ye=e.IN_PLACE||!1,Ne=e.ALLOWED_URI_REGEXP||Ne,rt=e.NAMESPACE||nt,Re=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&st(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Re.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&st(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Re.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Re.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Pe&&(_e=!1),Ue&&(Be=!0),Xe&&(Te=D({},f(Y)),Oe=[],!0===Xe.html&&(D(Te,B),D(Oe,X)),!0===Xe.svg&&(D(Te,U),D(Oe,q),D(Oe,$)),!0===Xe.svgFilters&&(D(Te,z),D(Oe,q),D(Oe,$)),!0===Xe.mathMl&&(D(Te,V),D(Oe,K),D(Oe,$))),e.ADD_TAGS&&(Te===Ce&&(Te=F(Te)),D(Te,e.ADD_TAGS,he)),e.ADD_ATTR&&(Oe===ke&&(Oe=F(Oe)),D(Oe,e.ADD_ATTR,he)),e.ADD_URI_SAFE_ATTR&&D(Qe,e.ADD_URI_SAFE_ATTR,he),e.FORBID_CONTENTS&&(qe===Ke&&(qe=F(qe)),D(qe,e.FORBID_CONTENTS,he)),We&&(Te["#text"]=!0),De&&D(Te,["html","head","body"]),Te.table&&(D(Te,["tbody"]),delete Ie.tbody),y&&y(e),ut=e)},dt=D({},["mi","mo","mn","ms","mtext"]),pt=D({},["foreignobject","desc","title","annotation-xml"]),mt=D({},["title","style","font","a","script"]),vt=D({},U);D(vt,z),D(vt,G);var ht=D({},V);D(ht,W);var gt=function(e){O(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=P}catch(t){e.remove()}}},yt=function(e,t){try{O(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){O(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Oe[e])if(Be||Ue)try{gt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},bt=function(e){var t,n;if(He)e=""+e;else{var r=I(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===ve&&rt===nt&&(e=''+e+"");var a=N?N.createHTML(e):e;if(rt===nt)try{t=(new v).parseFromString(a,ve)}catch(e){}if(!t||!t.documentElement){t=ue.createDocument(rt,"template",null);try{t.documentElement.innerHTML=ot?P:a}catch(e){}}var i=t.body||t.documentElement;return e&&n&&i.insertBefore(o.createTextNode(n),i.childNodes[0]||null),rt===nt?fe.call(t,De?"html":"body")[0]:De?t.documentElement:i},Et=function(e){return le.call(e.ownerDocument||e,e,s.SHOW_ELEMENT|s.SHOW_COMMENT|s.SHOW_TEXT,null,!1)},wt=function(e){return"object"===u(c)?e instanceof c:e&&"object"===u(e)&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},xt=function(e,t,r){me[e]&&T(me[e],(function(e){e.call(n,t,r,ut)}))},St=function(e){var t,r;if(xt("beforeSanitizeElements",e,null),(r=e)instanceof m&&("string"!=typeof r.nodeName||"string"!=typeof r.textContent||"function"!=typeof r.removeChild||!(r.attributes instanceof p)||"function"!=typeof r.removeAttribute||"function"!=typeof r.setAttribute||"string"!=typeof r.namespaceURI||"function"!=typeof r.insertBefore||"function"!=typeof r.hasChildNodes))return gt(e),!0;if(L(/[\u0080-\uFFFF]/,e.nodeName))return gt(e),!0;var o=he(e.nodeName);if(xt("uponSanitizeElement",e,{tagName:o,allowedTags:Te}),e.hasChildNodes()&&!wt(e.firstElementChild)&&(!wt(e.content)||!wt(e.content.firstElementChild))&&L(/<[/\w]/g,e.innerHTML)&&L(/<[/\w]/g,e.textContent))return gt(e),!0;if("select"===o&&L(/