1"use strict";(self.webpackChunkPylot_Frontend=self.webpackChunkPylot_Frontend||[]).push([[905,1381,2431,3286,5667,8048],{17070:(e,n,o)=>{o.d(n,{A:()=>l});var r=o(71354),t=o.n(r),a=o(76314),i=o.n(a)()(t());i.push([e.id,".chat-button{width:auto;position:fixed;bottom:1rem;right:1rem;z-index:109;background-color:#2563eb;color:#fff;padding:.75rem 1rem;border:none;border-radius:.375rem;box-shadow:0 2px 6px rgba(0,0,0,.2);cursor:pointer}.chat-button:hover{background-color:#1e40af}#app .chat-container{position:fixed;bottom:0;right:1rem;z-index:110;width:20rem;height:60vh;max-height:500px;background:#fff;border-radius:.5rem;box-shadow:0 4px 12px rgba(0,0,0,.15);display:flex;flex-direction:column;transform:translateY(100%);transition:transform .3s ease-in-out;overflow:hidden}#app .chat-container.open{transform:translateY(0)}#app .chat-container .chat-header{display:flex;justify-content:space-between;padding:1rem;color:#000;background:#f3f4f6;border-bottom:1px solid #e5e7eb}#app .chat-container .chat-header h2{margin:0;font-size:1.125rem}#app .chat-container .chat-header .chat-header-close{width:auto;padding:0 .5rem;background:rgba(0,0,0,0);border:none;font-size:1.25rem;cursor:pointer}#app .chat-container .chat-messages{flex:1;padding:1rem;overflow-y:auto}#app .chat-container .chat-messages .chat-message{margin-bottom:.5rem;max-width:75%;padding:.5rem;border-radius:.375rem}#app .chat-container .chat-messages .chat-message.user{margin-left:auto;background-color:var(--user-bg-color);color:#fff}#app .chat-container .chat-messages .chat-message.bot{margin-right:auto;background-color:#e5e7eb;color:#1f2937}#app .chat-container .chat-messages .chat-message a{text-decoration:underline}#app .chat-container .chat-messages .chat-message ul,#app .chat-container .chat-messages .chat-message ol{padding-left:1.5rem}#app .chat-container .chat-messages .chat-message *:last-child{margin-bottom:0}#app .chat-container .chat-messages .chat-message pre{background:#0f172a;color:#e5e7eb;padding:.5rem;border-radius:.375rem;overflow:auto}#app .chat-container .chat-form{display:flex;padding:.75rem;border-top:1px solid #e5e7eb}#app .chat-container .chat-form .chat-input{flex:1;padding:.5rem;border:1px solid #d1d5db;border-radius:.375rem}#app .chat-container .chat-form .chat-input:focus{outline:none;border-color:#2563eb;box-shadow:0 0 0 2px rgba(37,99,235,.3)}#app .chat-container .chat-form .chat-send-button{min-width:4.6875rem;height:2.625rem;margin-left:.5rem;padding:.5rem 1rem;background-color:#2563eb;color:#fff;border:none;border-radius:.375rem;cursor:pointer}#app .chat-container .chat-form .chat-send-button:hover{background-color:#1e40af}#app .chat-container .chat-form .chat-send-button .loader{font-size:.25rem;margin-bottom:0;top:-2.75em}","",{version:3,sources:["webpack://./src/partials/custom-gpt-chat/ChatWidget.scss"],names:[],mappings:"AAAA,aACE,UAAA,CACA,cAAA,CACA,WAAA,CACA,UAAA,CACA,WAAA,CACA,wBAAA,CACA,UAAA,CACA,mBAAA,CACA,WAAA,CACA,qBAAA,CACA,mCAAA,CACA,cAAA,CAEA,mBACE,wBAAA,CAIJ,qBACE,cAAA,CACA,QAAA,CACA,UAAA,CACA,WAAA,CACA,WAAA,CACA,WAAA,CACA,gBAAA,CACA,eAAA,CACA,mBAAA,CACA,qCAAA,CACA,YAAA,CACA,qBAAA,CACA,0BAAA,CACA,oCAAA,CACA,eAAA,CAEA,0BACE,uBAAA,CAGF,kCACE,YAAA,CACA,6BAAA,CACA,YAAA,CACA,UAAA,CACA,kBAAA,CACA,+BAAA,CAEA,qCACE,QAAA,CACA,kBAAA,CAGF,qDACE,UAAA,CACA,eAAA,CACA,wBAAA,CACA,WAAA,CACA,iBAAA,CACA,cAAA,CAIJ,oCACE,MAAA,CACA,YAAA,CACA,eAAA,CAEA,kDACE,mBAAA,CACA,aAAA,CACA,aAAA,CACA,qBAAA,CAEA,uDACE,gBAAA,CACA,qCAAA,CACA,UAAA,CAGF,sDACE,iBAAA,CACA,wBAAA,CACA,aAAA,CAIF,oDAAA,yBAAA,CAEA,0GACE,mBAAA,CAGF,+DACE,eAAA,CAGF,sDACE,kBAAA,CACA,aAAA,CACA,aAAA,CACA,qBAAA,CACA,aAAA,CAKN,gCACE,YAAA,CACA,cAAA,CACA,4BAAA,CAEA,4CACE,MAAA,CACA,aAAA,CACA,wBAAA,CACA,qBAAA,CAEA,kDACE,YAAA,CACA,oBAAA,CACA,uCAAA,CAIJ,kDACE,mBAAA,CACA,eAAA,CACA,iBAAA,CACA,kBAAA,CACA,wBAAA,CACA,UAAA,CACA,WAAA,CACA,qBAAA,CACA,cAAA,CAEA,wDACE,wBAAA,CAIF,0DACE,gBAAA,CACA,eAAA,CACA,WAAA",sourcesContent:[".chat-button {\n width: auto;\n position: fixed;\n bottom: 1rem;\n right: 1rem;\n z-index: 109;\n background-color: #2563eb;\n color: #fff;\n padding: 0.75rem 1rem;\n border: none;\n border-radius: 0.375rem;\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);\n cursor: pointer;\n\n &:hover {\n background-color: #1e40af;\n }\n}\n\n#app .chat-container {\n position: fixed;\n bottom: 0;\n right: 1rem;\n z-index: 110;\n width: 20rem;\n height: 60vh;\n max-height: 500px;\n background: #fff;\n border-radius: 0.5rem;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n display: flex;\n flex-direction: column;\n transform: translateY(100%);\n transition: transform 0.3s ease-in-out;\n overflow: hidden;\n\n &.open {\n transform: translateY(0);\n }\n\n .chat-header {\n display: flex;\n justify-content: space-between;\n padding: 1rem;\n color: #000;\n background: #f3f4f6;\n border-bottom: 1px solid #e5e7eb;\n\n h2 {\n margin: 0;\n font-size: 1.125rem;\n }\n\n .chat-header-close {\n width: auto;\n padding: 0 .5rem;\n background: transparent;\n border: none;\n font-size: 1.25rem;\n cursor: pointer;\n }\n }\n\n .chat-messages {\n flex: 1;\n padding: 1rem;\n overflow-y: auto;\n\n .chat-message {\n margin-bottom: 0.5rem;\n max-width: 75%;\n padding: 0.5rem;\n border-radius: 0.375rem;\n\n &.user {\n margin-left: auto;\n background-color: var(--user-bg-color);\n color: #fff;\n }\n\n &.bot {\n margin-right: auto;\n background-color: #e5e7eb;\n color: #1f2937;\n }\n\n /* Style HTML inside a response */\n a { text-decoration: underline; }\n \n ul, ol { \n padding-left: 1.5rem;\n }\n\n *:last-child {\n margin-bottom: 0;\n }\n\n pre {\n background: #0f172a;\n color: #e5e7eb;\n padding: .5rem;\n border-radius: .375rem;\n overflow: auto;\n }\n }\n }\n\n .chat-form {\n display: flex;\n padding: 0.75rem;\n border-top: 1px solid #e5e7eb;\n\n .chat-input {\n flex: 1;\n padding: 0.5rem;\n border: 1px solid #d1d5db;\n border-radius: 0.375rem;\n\n &:focus {\n outline: none;\n border-color: #2563eb;\n box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);\n }\n }\n\n .chat-send-button {\n min-width: 4.6875rem;\n height: 2.625rem;\n margin-left: 0.5rem;\n padding: 0.5rem 1rem;\n background-color: #2563eb;\n color: #fff;\n border: none;\n border-radius: 0.375rem;\n cursor: pointer;\n\n &:hover {\n background-color: #1e40af;\n }\n \n /* shrink dots from default size */\n .loader {\n font-size: .25rem;\n margin-bottom: 0;\n top: -2.75em;\n }\n }\n }\n}\n"],sourceRoot:""}]);const l=i},30905:(e,n,o)=>{o.d(n,{Nf:()=>v,Q1:()=>A,VH:()=>i,VS:()=>s,i0:()=>h,lx:()=>p,sK:()=>g,vB:()=>b});var r=o(80296),t=o(96540),a=o(94518),i=function(e,n){return e&&"dark"===e.toLowerCase()?c(n):l(n)},l=function(e){var n,o,i,l,c,s,d,u,A,m,f,h,p,g=(0,t.useContext)(a.lj),v=(0,r.A)(g,2),b=v[0];switch(v[1],e){case"solid-fill-primary":case"outline-primary":case"solid-fill-monochrome-primary":case"outline-monochrome-primary":return"".concat(null!==(n=b.mvk_theme_config.other)&&void 0!==n&&n.button_outline_width?null===(o=b.mvk_theme_config.other)||void 0===o?void 0:o.button_outline_width:"3","px solid ").concat(null===(i=b.design)||void 0===i||null===(i=i.colors)||void 0===i?void 0:i.primary_color);case"solid-fill-secondary":case"outline-secondary":case"solid-fill-monochrome-secondary":case"outline-monochrome-secondary":return"".concat(null!==(l=b.mvk_theme_config.other)&&void 0!==l&&l.button_outline_width?null===(c=b.mvk_theme_config.other)||void 0===c?void 0:c.button_outline_width:"3","px solid ").concat(null===(s=b.design)||void 0===s||null===(s=s.colors)||void 0===s?void 0:s.secondary_color);case"solid-fill-tertiary":case"outline-tertiary":return"".concat(null!==(d=b.mvk_theme_config.other)&&void 0!==d&&d.button_outline_width?null===(u=b.mvk_theme_config.other)||void 0===u?void 0:u.button_outline_width:"3","px solid ").concat(null===(A=b.design)||void 0===A||null===(A=A.colors)||void 0===A?void 0:A.tertiary_color);case"solid-fill-gradient":return"".concat(null!==(m=b.mvk_theme_config.other)&&void 0!==m&&m.button_outline_width?null===(f=b.mvk_theme_config.other)||void 0===f?void 0:f.button_outline_width:"3","px solid transparent");case"outline-gradient":case"outline-gradient-persistent":return"linear-gradient(90deg, ".concat(null===(h=b.design)||void 0===h||null===(h=h.colors)||void 0===h?void 0:h.gradient_color_1,", ").concat(null===(p=b.design)||void 0===p||null===(p=p.colors)||void 0===p?void 0:p.gradient_color_2,")");default:return"none"}},c=function(e){var n,o,i,l,c=(0,t.useContext)(a.lj),s=(0,r.A)(c,2),d=s[0];switch(s[1],e){case"solid-fill-primary":case"solid-fill-secondary":case"solid-fill-tertiary":case"solid-fill-monochrome-primary":case"solid-fill-monochrome-secondary":case"outline-primary":case"outline-secondary":case"outline-tertiary":case"outline-gradient":case"outline-monochrome-primary":case"outline-monochrome-secondary":return"".concat(null!==(n=d.mvk_theme_config.other)&&void 0!==n&&n.button_outline_width?null===(o=d.mvk_theme_config.other)||void 0===o?void 0:o.button_outline_width:"3","px solid white");case"outline-gradient-persistent":return"linear-gradient(90deg, ".concat(null===(i=d.design)||void 0===i||null===(i=i.colors)||void 0===i?void 0:i.gradient_color_1,", ").concat(null===(l=d.design)||void 0===l||null===(l=l.colors)||void 0===l?void 0:l.gradient_color_2,")");default:return"none"}},s=function(e,n){return"dark"===e?u(n):d(n)},d=function(e){var n,o,i,l,c,s=(0,t.useContext)(a.lj),d=(0,r.A)(s,2),u=d[0];switch(d[1],e){case"solid-fill-primary":case"solid-fill-monochrome-primary":return"".concat(null===(n=u.design)||void 0===n||null===(n=n.colors)||void 0===n?void 0:n.primary_color);case"solid-fill-secondary":case"solid-fill-monochrome-secondary":return"".concat(null===(o=u.design)||void 0===o||null===(o=o.colors)||void 0===o?void 0:o.secondary_color);case"solid-fill-tertiary":return"".concat(null===(i=u.design)||void 0===i||null===(i=i.colors)||void 0===i?void 0:i.tertiary_color);case"solid-fill-gradient":case"solid-fill-gradient-persistent":return"linear-gradient(to right, ".concat(null===(l=u.design)||void 0===l||null===(l=l.colors)||void 0===l?void 0:l.gradient_color_1,", ").concat(null===(c=u.design)||void 0===c||null===(c=c.colors)||void 0===c?void 0:c.gradient_color_2,")");case"outline-primary":case"outline-secondary":case"outline-tertiary":case"outline-gradient":case"outline-gradient-persistent":case"outline-monochrome-primary":case"outline-monochrome-secondary":return"transparent";default:return"white"}},u=function(e){var n,o,i=(0,t.useContext)(a.lj),l=(0,r.A)(i,2),c=l[0];switch(l[1],e){case"solid-fill-primary":case"solid-fill-secondary":case"solid-fill-tertiary":case"solid-fill-gradient":case"solid-fill-monochrome-primary":case"solid-fill-monochrome-secondary":default:return"white";case"solid-fill-gradient-persistent":return"linear-gradient(to right, ".concat(null===(n=c.design)||void 0===n||null===(n=n.colors)||void 0===n?void 0:n.gradient_color_1,", ").concat(null===(o=c.design)||void 0===o||null===(o=o.colors)||void 0===o?void 0:o.gradient_color_2,")");case"outline-primary":case"outline-secondary":case"outline-tertiary":case"outline-gradient":case"outline-gradient-persistent":case"outline-monochrome-primary":case"outline-monochrome-secondary":return"transparent"}},A=function(e,n){return"dark"===e?f(n):m(n)},m=function(e){var n,o,i,l=(0,t.useContext)(a.lj),c=(0,r.A)(l,2),s=c[0];switch(c[1],e){case"solid-fill-primary":case"solid-fill-secondary":case"solid-fill-monochrome-primary":case"solid-fill-monochrome-secondary":default:return"white";case"solid-fill-tertiary":case"outline-primary":case"outline-secondary":case"outline-tertiary":case"outline-gradient":case"outline-gradient-persistent":return"".concat(null===(n=s.design)||void 0===n||null===(n=n.colors)||void 0===n?void 0:n.body_copy_color);case"outline-monochrome-primary":return"".concat(null===(o=s.design)||void 0===o||null===(o=o.colors)||void 0===o?void 0:o.primary_color);case"outline-monochrome-secondary":return"".concat(null===(i=s.design)||void 0===i||null===(i=i.colors)||void 0===i?void 0:i.secondary_color)}},f=function(e){var n,o,i,l=(0,t.useContext)(a.lj),c=(0,r.A)(l,2),s=c[0];switch(c[1],e){case"solid-fill-primary":case"solid-fill-secondary":case"solid-fill-tertiary":case"solid-fill-gradient":return"".concat(null===(n=s.design)||void 0===n||null===(n=n.colors)||void 0===n?void 0:n.body_copy_color);case"solid-fill-monochrome-primary":return"".concat(null===(o=s.design)||void 0===o||null===(o=o.colors)||void 0===o?void 0:o.primary_color);case"solid-fill-monochrome-secondary":return"".concat(null===(i=s.design)||void 0===i||null===(i=i.colors)||void 0===i?void 0:i.secondary_color);default:return"white"}},h=function(e){var n,o,i,l,c,s=(0,t.useContext)(a.lj),d=(0,r.A)(s,2),u=d[0];switch(d[1],e){case"background_color":return"".concat(null===(n=u.design)||void 0===n||null===(n=n.colors)||void 0===n?void 0:n.background_color);case"primary_color":return"".concat(null===(o=u.design)||void 0===o||null===(o=o.colors)||void 0===o?void 0:o.primary_color);case"secondary_color":return"".concat(null===(i=u.design)||void 0===i||null===(i=i.colors)||void 0===i?void 0:i.secondary_color);case"tertiary_color":return"".concat(null===(l=u.design)||void 0===l||null===(l=l.colors)||void 0===l?void 0:l.tertiary_color);case"body_copy_color":return"".concat(null===(c=u.design)||void 0===c||null===(c=c.colors)||void 0===c?void 0:c.body_copy_color);default:return""}},p=function(e){switch(e){case"background_color":return"background-bg";case"primary_color":return"primary-bg";case"secondary_color":return"secondary-bg";case"tertiary_color":return"tertiary-bg";case"body_copy_color":return"body-copy-bg";case"white":return"white-bg";default:return""}},g=function(e){switch(e){case"dark":return"white-txt";case"light":return"body-copy-txt";default:return""}},v=function(e){var n,o,i,l,c,s=(0,t.useContext)(a.lj),d=(0,r.A)(s,2),u=d[0];switch(d[1],e){case"primary-bg":return"".concat(null===(n=u.design)||void 0===n||null===(n=n.colors)||void 0===n?void 0:n.primary_color);case"secondary-bg":return"".concat(null===(o=u.design)||void 0===o||null===(o=o.colors)||void 0===o?void 0:o.secondary_color);case"tertiary-bg":return"".concat(null===(i=u.design)||void 0===i||null===(i=i.colors)||void 0===i?void 0:i.tertiary_color);
1case"custom":return"".concat(null===(l=u.mvk_theme_config.other)||void 0===l?void 0:l.cs_custom_color);default:return"".concat(null===(c=u.design)||void 0===c||null===(c=c.colors)||void 0===c?void 0:c.body_copy_color)}},b=function(e){switch(e){case"solid-fill-primary":return"outline-primary";case"solid-fill-secondary":return"outline-secondary";case"solid-fill-tertiary":return"outline-tertiary";case"solid-fill-gradient":return"outline-gradient";case"solid-fill-gradient-persistent":return"outline-gradient-persistent";case"solid-fill-monochrome-primary":return"outline-monochrome-primary";case"solid-fill-monochrome-secondary":return"outline-monochrome-secondary";case"outline-primary":return"solid-fill-primary";case"outline-secondary":return"solid-fill-secondary";case"outline-tertiary":return"solid-fill-tertiary";case"outline-gradient":return"solid-fill-gradient";case"outline-gradient-persistent":return"solid-fill-gradient-persistent";case"outline-monochrome-primary":return"solid-fill-monochrome-primary";case"outline-monochrome-secondary":return"solid-fill-monochrome-secondary"}}},42431:(e,n,o)=>{o.r(n),o.d(n,{default:()=>U});var r=o(80296),t=o(96540),a=o(85692),i=o(94518),l=o(64467),c=o(10467),s=o(54756),d=o.n(s),u=o(32573),A=o(60023),m=o(99418),f=o(15474),h=o(85072),p=o.n(h),g=o(97825),v=o.n(g),b=o(77659),C=o.n(b),y=o(55056),_=o.n(y),x=o(10540),w=o.n(x),k=o(41113),E=o.n(k),B=o(17070),S={};S.styleTagTransform=E(),S.setAttributes=_(),S.insert=C().bind(null,"head"),S.domAPI=v(),S.insertStyleElement=w(),p()(B.A,S),B.A&&B.A.locals&&B.A.locals;var j=o(30905);function O(e,n){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),o.push.apply(o,r)}return o}function D(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?O(Object(o),!0).forEach((function(n){(0,l.A)(e,n,o[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):O(Object(o)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(o,n))}))}return e}function I(e,n){var o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!o){if(Array.isArray(e)||(o=function(e,n){if(e){if("string"==typeof e)return z(e,n);var o={}.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?z(e,n):void 0}}(e))||n&&e&&"number"==typeof e.length){o&&(e=o);var r=0,t=function(){};return{s:t,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==o.return||o.return()}finally{if(l)throw a}}}}function z(e,n){(null==n||n>e.length)&&(n=e.length);for(var o=0,r=Array(n);o<n;o++)r[o]=e[o];return r}A.xI.setOptions({gfm:!0,breaks:!0});var F=new A.xI.Renderer;function P(e){var n,o,a,l,s,h=e.heading,p=void 0===h?"Chat":h,g=e.placeholder,v=void 0===g?"Ask a question":g,b=(0,t.useContext)(i.lj),C=(0,r.A)(b,2),y=C[0],_=(C[1],f.A.base),x=(0,t.useState)(!1),w=(0,r.A)(x,2),k=w[0],E=w[1],B=(0,t.useState)([]),S=(0,r.A)(B,2),O=S[0],z=S[1],P=(0,t.useState)(""),W=(0,r.A)(P,2),N=W[0],q=W[1],U=(0,t.useState)(null),Y=(0,r.A)(U,2),T=Y[0],V=Y[1],R=(0,t.useState)(!1),G=(0,r.A)(R,2),H=G[0],M=G[1],J=(0,t.useRef)(null),L=(0,t.useRef)(null),Q=(0,t.useRef)(null),K=function(){return E((function(e){return!e}))},$=function(e,n){var o,r=e.split(/\n\n/),t=r.pop(),a=I(r);try{for(a.s();!(o=a.n()).done;){var i,l=o.value.split(/\n/),c=[],s="message",d=I(l);try{for(d.s();!(i=d.n()).done;){var u=i.value;u.startsWith("data:")?c.push(u.slice(5).trimStart()):u.startsWith("event:")&&(s=u.slice(6).trim())}}catch(e){d.e(e)}finally{d.f()}n({type:s,data:c.join("\n")})}}catch(e){a.e(e)}finally{a.f()}return t||""},X=function(){var e=(0,c.A)(d().mark((function e(n){var o,r,t,a,i,l,c,s,u,A,m,f;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.preventDefault(),N.trim()&&!H){e.
1next=3;break}return e.abrupt("return");case 3:return o={sender:"user",text:N},z((function(e){var n=[].concat(e,[o,{sender:"bot",text:""}]);return Q.current=n.length-1,n})),(r=new FormData).append("prompt",N),r.append("stream",1),T&&r.append("session_id",T),q(""),e.prev=10,M(!0),t=new AbortController,L.current=t,e.next=16,fetch("https://".concat(_,"/mvk-api/v1/customgpt-agent/post-chat"),{method:"POST",headers:{Accept:"text/event-stream"},body:r,signal:t.signal});case 16:if(((a=e.sent).headers.get("content-type")||"").includes("text/event-stream")){e.next=26;break}return e.next=21,a.json();case 21:return(i=e.sent).session_id&&V(i.session_id),l=i.success?i.openai_response||"":"Sorry, an error has occurred.",z((function(e){var n,o=null!==(n=Q.current)&&void 0!==n?n:e.length-1,r=[].concat(e);return r[o]=D(D({},r[o]),{},{text:l}),r})),e.abrupt("return");case 26:c=a.body.getReader(),s=new TextDecoder("utf-8"),u="",A=function(e){z((function(n){var o,r=null!==(o=Q.current)&&void 0!==o?o:n.length-1,t=[].concat(n),a=t[r]||{sender:"bot",text:""};return t[r]=D(D({},a),{},{text:(a.text||"")+(e||"")}),t})),setTimeout((function(){var e;null===(e=J.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})}),0)};case 30:return e.next=33,c.read();case 33:if(m=e.sent,f=m.value,!m.done){e.next=38;break}return e.abrupt("break",42);case 38:u+=s.decode(f,{stream:!0}),u=$(u,(function(e){var n=e.type,o=e.data;if(o&&"[DONE]"!==o&&"done"!==n)try{var r=JSON.parse(o);if(r.session_id&&!T&&V(r.session_id),r.status&&"error"==r.status)A("Sorry, an error has occurred.");else{var t="string"==typeof r.message?r.message:r.openai_response||"";t&&A(t)}}catch(e){A(o)}})),e.next=30;break;case 42:e.next=48;break;case 44:e.prev=44,e.t0=e.catch(10),console.error(e.t0),z((function(e){var n,o=null!==(n=Q.current)&&void 0!==n?n:e.length-1,r=[].concat(e);return r[o]={sender:"bot",text:"Sorry, something went wrong."},r}));case 48:return e.prev=48,M(!1),L.current=null,setTimeout((function(){var e;null===(e=J.current)||void 0===e||e.scrollIntoView({behavior:"smooth"})}),50),e.finish(48);case 53:case"end":return e.stop()}}),e,null,[[10,44,48,53]])})));return function(n){return e.apply(this,arguments)}}(),Z=null===(n=y.mvk_theme_config.other)||void 0===n?void 0:n.primary_button_style,ee={fontFamily:"".concat(null===(o=y.design)||void 0===o?void 0:o.fonts.body.body_google_font_name,", sans-serif"),backgroundColor:(0,j.VS)("light",Z),color:(0,j.Q1)("light",Z),borderRadius:null!==(a=y.mvk_theme_config.other)&&void 0!==a&&a.enable_border_radius?"".concat(null===(l=y.mvk_theme_config.other)||void 0===l?void 0:l.border_radius_size,"px"):"0px",border:(0,j.VH)("light",Z),fontWeight:null===(s=y.mvk_theme_config.other)||void 0===s?void 0:s.button_font_weight,transition:".3s"},ne={"--user-bg-color":(0,j.VS)("light",Z)};return t.createElement(t.Fragment,null,t.createElement("button",{className:"chat-button",style:ee,onClick:K},k?"Close":"Chat"),t.createElement("div",{className:"chat-container ".concat(k?"open":"")},t.createElement("div",{className:"chat-header"},t.createElement("h2",null,p),t.createElement("button",{className:"chat-header-close",onClick:K},"Ã")),t.createElement("div",{className:"chat-messages",style:ne},O.map((function(e,n){return t.createElement("div",{key:n,className:"chat-message ".concat(e.sender),dangerouslySetInnerHTML:{__html:(o=e.text,r=A.xI.parse(o||"",{renderer:F}),m.A.sanitize(r,{USE_PROFILES:{html:!0}}))}});var o,r})),t.createElement("div",{ref:J})),t.createElement("form",{className:"chat-form",onSubmit:X},t.createElement("input",{className:"chat-input",name:"chat-input",value:N,onChange:function(e){return q(e.target.value)},placeholder:v}),t.createElement("button",{type:"submit",className:"chat-send-button",style:ee,disabled:H},H?t.createElement(u.default,{type:"dot-pulse",dotColor:"#fff"}):"Send"))))}F.link=function(e){var n=e.title?' title="'.concat(e.title,'"'):"";return'<a href="'.concat(e.href,'"').concat(n,' target="_blank" rel="noopener noreferrer">').concat(e.text,"</a>")};var W=t.lazy((function(){return Promise.all([o.e(2376),o.e(982),o.e(4204),o.e(78),o.e(9435),o.e(6053)]).then(o.bind(o,1231))})),N=t.lazy((function(){return o.e(8965).then(o.bind(o,28965))})),q=t.lazy((function(){return o.e(517).then(o.bind(o,70517))}
1));const U=function(e){var n,o,l,c,s=(0,t.useContext)(i.lj),d=(0,r.A)(s,2),u=d[0],A=(d[1],(0,a.Wx)({triggerOnce:!0,fallbackInView:!0,threshold:.01})),m=A.ref,f=A.inView,h=null!=u&&u.chat_agent?t.createElement(P,null):null;return t.createElement(t.Suspense,{fallback:t.createElement("div",null)},t.createElement("div",{ref:m,id:"footer",style:f?null:{minHeight:"375px"}},f?t.createElement(t.Fragment,null,(null==u||null===(n=u.mvk_theme_config)||void 0===n||null===(n=n.footer)||void 0===n?void 0:n.enable_footer_border_image)&&t.createElement(q,{data:null==u||null===(o=u.mvk_theme_config)||void 0===o?void 0:o.footer}),t.createElement(W,{settings:u}),(null==u||null===(l=u.mvk_theme_config)||void 0===l||null===(l=l.footer)||void 0===l?void 0:l.enable_footer_banner)&&t.createElement(N,{settings:u}),(null==u||null===(c=u.mvk_theme_config)||void 0===c||null===(c=c.footer)||void 0===c?void 0:c.enable_footer_bottom_border)&&t.createElement("div",{class:"footer__bottom-border"})):null),h)}}}]); 2//# sourceMappingURL=b8264c7646d819cd4b8b.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.