jinni-chatbot
Version:
Jinni Chatbot engages with visitors, captures all the required details, and filters motivated vendors and landlords through AI-powered fully customisable conversations. It automatically books valuations and callbacks, and even enables you to chat with pot
1 lines • 4.58 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("React"),require("react-dom")):"function"==typeof define&&define.amd?define(["React","react-dom"],e):"object"==typeof exports?exports.JinniChatbot=e(require("React"),require("react-dom")):t.JinniChatbot=e(t.React,t["react-dom"])}(self,((t,e)=>(()=>{"use strict";var n={745:(t,e,n)=>{var o=n(111);e.createRoot=o.createRoot,e.hydrateRoot=o.hydrateRoot},24:e=>{e.exports=t},111:t=>{t.exports=e}},o={};function r(t){var e=o[t];if(void 0!==e)return e.exports;var i=o[t]={exports:{}};return n[t](i,i.exports,r),i.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};return(()=>{r.r(i),r.d(i,{default:()=>y});var t=r(24),e=r.n(t),n=r(745),o=Object.defineProperty,s=(t,e,n)=>(((t,e,n)=>{e in t?o(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,"symbol"!=typeof e?e+"":e,n),n);const c={string:{stringify:t=>t,parse:t=>t},number:{stringify:t=>`${t}`,parse:t=>parseFloat(t)},boolean:{stringify:t=>t?"true":"false",parse:t=>/^[ty1-9]/i.test(t)},function:{stringify:t=>t.name,parse:(t,e)=>{const n=typeof window<"u"&&t in window?window[t]:typeof global<"u"&&t in global?global[t]:void 0;return"function"==typeof n?n.bind(e):void 0}},json:{stringify:t=>JSON.stringify(t),parse:t=>JSON.parse(t)}},a=Symbol.for("r2wc.render"),u=Symbol.for("r2wc.connected"),d=Symbol.for("r2wc.context"),p=Symbol.for("r2wc.props");function f(t,e,n){var o,r,i;e.props||(e.props=t.propTypes?Object.keys(t.propTypes):[]);const f=(Array.isArray(e.props)?e.props.slice():Object.keys(e.props)).filter((t=>"container"!==t)),b={},y={},h={};for(const t of f){b[t]=Array.isArray(e.props)?"string":e.props[t];const n=l(t);y[t]=n,h[n]=t}class m extends HTMLElement{constructor(){super(),s(this,o,!0),s(this,r),s(this,i,{}),s(this,"container"),e.shadow?this.container=this.attachShadow({mode:e.shadow}):this.container=this,this[p].container=this.container;for(const t of f){const e=y[t],n=this.getAttribute(e),o=b[t],r=c[o];n&&null!=r&&r.parse&&(this[p][t]=r.parse(n,this))}}static get observedAttributes(){return Object.keys(h)}connectedCallback(){this[u]=!0,this[a]()}disconnectedCallback(){this[u]=!1,this[d]&&n.unmount(this[d]),delete this[d]}attributeChangedCallback(t,e,n){const o=h[t],r=b[o],i=c[r];o in b&&null!=i&&i.parse&&(this[p][o]=i.parse(n,this),this[a]())}[(o=u,r=d,i=p,a)](){this[u]&&(this[d]?n.update(this[d],this[p]):this[d]=n.mount(this.container,t,this[p]))}}for(const t of f){const e=y[t],n=b[t];Object.defineProperty(m.prototype,t,{enumerable:!0,configurable:!0,get(){return this[p][t]},set(o){this[p][t]=o;const r=c[n];if(null!=r&&r.stringify){const t=r.stringify(o);this.getAttribute(e)!==t&&this.setAttribute(e,t)}}})}return m}function l(t=""){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}const b=(t,e,n)=>{const o=document.createElement(t);Object.entries(e).forEach((t=>{let[e,n]=t;return o.setAttribute(e,n)})),n.appendChild(o)};"undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof self&&customElements.define("jinni-chatbot",function(t,e,n,o={}){return f(t,o,{mount:function(t,o,r){const i=e.createElement(o,r);if("createRoot"in n){const e=n.createRoot(t);return e.render(i),{container:t,root:e,ReactComponent:o}}if("render"in n)return n.render(i,t),{container:t,ReactComponent:o};throw new Error("Invalid ReactDOM instance provided.")},unmount:function({container:t,root:e}){e?e.unmount():"unmountComponentAtNode"in n&&n.unmountComponentAtNode(t)},update:function({container:t,root:o,ReactComponent:r},i){const s=e.createElement(r,i);o?o.render(s):"render"in n&&n.render(s,t)}})}((()=>{const t=document.querySelector("jinni-chatbot"),e=t.getAttribute("botId"),n=t.getAttribute("appHost"),o=t.getAttribute("visible"),r=t.getAttribute("botTheme");return b("script",{src:"https://dze9g4ipzy6n3.cloudfront.net/static/js/main.min.js",async:!0},document.body),b("link",{rel:"stylesheet",href:"https://dze9g4ipzy6n3.cloudfront.net/static/css/main.min.css"},document.head),b("react-counter",{id:"react-counter",template:r,app_host:n,bot_id:e,visible:o},document.body),!0}),e(),n));const y=t=>"undefined"==typeof window||"undefined"==typeof self?null:e().createElement("jinni-chatbot",t)})(),i})()));