1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5667],{45667:(e,t,n)=>{n.r(t),n.d(t,{default:()=>J});var i=n(5820),r=n(19127),o=n(54756),a=n.n(o),c=n(96540),s=n(44404),l=n(37750),d=n(64721),b=n(36474),u=n(40303),p=n(70782),h=n(74848);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var f=s.Ay.div.withConfig({displayName:"EmbedOnSite__Embed2Container",componentId:"sc-5d36wm-0"})(["display:flex;background:#fff;border-radius:10px;display:",";flex-direction:column;"],function(e){return e.isPublic?"flex":"none"}),x=s.Ay.pre.withConfig({displayName:"EmbedOnSite__CodeSnippet2Container",componentId:"sc-5d36wm-1"})(["background:#f1f1f1;border:1px solid #e1e1e1;border-radius:8px;padding:10px;margin-bottom:20px;font-family:'Courier New',Courier,monospace;max-width:800px;font-size:15px;color:black;white-space:pre-wrap;justify-content:center;align-items:center;font-weight:700;margin:0 auto;"]),y=s.Ay.button.withConfig({displayName:"EmbedOnSite__Copy2Button",componentId:"sc-5d36wm-2"})(["background-color:#1194ff;color:white;border:none;border-radius:4px;padding:10px 15px;cursor:pointer;&:hover{background-color:#007bff;}justify-content:center;align-items:center;"]),v=s.Ay.p.withConfig({displayName:"EmbedOnSite__Instructions2",componentId:"sc-5d36wm-3"})(["margin-bottom:20px;"]),w=s.Ay.div.withConfig({displayName:"EmbedOnSite__EmbedContainer",componentId:"sc-5d36wm-4"})(["display:",";padding:20px;background:#fff;border-radius:30px;border:1px solid black;box-shadow:0 2px 4px rgba(0,0,0,0.1);margin:20px;margin-top:0px;padding-bottom:5px;flex-direction:row;max-height:80%;overflow:hidden;"," @media (max-width:1000px){flex-direction:column;margin-right:5px;margin-left:5px;margin-bottom:20px;overflow-y:auto;}"],function(e){return e.$isPublic?"flex":"none"},function(e){return e.disabled&&(0,s.AH)(["opacity:0.5;pointer-events:none;"])}),j=s.Ay.div.withConfig({displayName:"EmbedOnSite__LeftSide",componentId:"sc-5d36wm-5"})(["flex:1;display:flex;flex-direction:column;margin-right:20px;width:100%;@media (max-width:1000px){height:100%;padding-bottom:10px;}"]),C=s.Ay.div.withConfig({displayName:"EmbedOnSite__RightSide",componentId:"sc-5d36wm-6"})(["flex:1;display:flex;justify-content:center;align-items:center;@media (max-width:1000px){height:100%;}"]),k=s.Ay.div.withConfig({displayName:"EmbedOnSite__Tab",componentId:"sc-5d36wm-7"})(["padding:10px 20px;padding-top:0;cursor:pointer;margin:0 10px;border-bottom:2px solid transparent;&:hover,&.active{border-bottom:2px solid #1194ff;}"," @media (max-width:1000px){margin-right:5px;margin-left:5px;}@media (max-width:500px){padding-left:10px;padding-right:10px;}"],function(e){return e.disabled&&(0,s.AH)(["pointer-events:none;color:grey;"])}),O=s.Ay.div.withConfig({displayName:"EmbedOnSite__TabContainer",componentId:"sc-5d36wm-8"})(["display:flex;justify-content:flex-start;margin-bottom:5px;"]),S=s.Ay.div.withConfig({displayName:"EmbedOnSite__PreviewContainer",componentId:"sc-5d36wm-9"})(["margin:0;padding:0;margin-left:15px;width:100%;height:0;align-self:start;padding-bottom:62.5%;position:relative;border:2px dotted #1194ff;border-radius:15px;background:#f1f1f1;"]),I=s.Ay.div.withConfig({displayName:"EmbedOnSite__BubblePreview",componentId:"sc-5d36wm-10"})(["position:absolute;top:",";left:",";right:",";bottom:",";width:","px;height:","px;background:",";border:",";border-radius:",";filter:blur(","px);cursor:",";",""],function(e){return e.bubble.alignBubble.top||"auto"},function(e){return e.bubble.alignBubble.left||"auto"},function(e){return e.bubble.alignBubble.right||"auto"},function(e){return e.bubble.alignBubble.bottom||"auto"},function(e){return 100*e.bubble.size},function(e){return 100*e.bubble.size},function(e){return e.bubble.background},function(e){return"".concat((e.bubble.border.width+.1)*.11,"px ").concat(e.bubble.border.style," ").concat(e.bubble.border.color)},function(e){return"circle"===e.bubble.shape?"50%":"15px"},function(e){return e.bubble.blur-10>0?e.bubble.blur-10:0},function(e){return e.draggable?"move":"auto"},function(e){var t,n;return(null===(t=e.bubble.pulse)||void 0===t?void 0:t.enabled)&&(0,s.AH)([""," animation:pulse ","s infinite;"],M,null===(n=e.bubble.pulse)||void 0===n?void 0:n.speed)}),B=s.Ay.div.withConfig({displayName:"EmbedOnSite__CustomPositionContainer",componentId:"sc-5d36wm-11"})(["border:1px solid #ddd;border-radius:8px;padding:10px;margin-bottom:10px;background:#f1f1f1;margin-left:30px;margin-right:5px;"]);s.Ay.pre.withConfig({displayName:"EmbedOnSite__CodeSnippetContainer",componentId:"sc-5d36wm-12"})(["background:#222;border:1px solid #e1e1e1;border-radius:8px;padding:10px;margin-bottom:20px;font-family:'Courier New',Courier,monospace;max-width:500px;font-size:15px;color:white;white-space:pre-wrap;"]);var E=s.Ay.button.withConfig({displayName:"EmbedOnSite__CopyButton",componentId:"sc-5d36wm-13"})(["background-color:#1194ff;color:white;border:none;border-radius:4px;padding:10px 15px;cursor:pointer;&:hover{background-color:#007bff;}",""],function(e){return e.disabled&&(0,s.AH)(["pointer-events:none;background-color:grey;"])});s.Ay.p.withConfig({displayName:"EmbedOnSite__Instructions",componentId:"sc-5d36wm-14"})(["margin-bottom:20px;"]);var A=s.Ay.div.withConfig({displayName:"EmbedOnSite__SettingItem",componentId:"sc-5d36wm-15"})(["display:flex;margin-bottom:0px;"]),T=s.Ay.label.withConfig({displayName:"EmbedOnSite__Label",componentId:"sc-5d36wm-16"})(["display:block;margin-bottom:5px;font-weight:bold;flex:1;"]),_=s.Ay.input.withConfig({displayName:"EmbedOnSite__InputComponent",componentId:"sc-5d36wm-17"})(["width:100%;padding:8px;margin-bottom:10px;border:1px solid #ccc;border-radius:4px;flex:2;@media (max-width:768px){font-size:12px;}"]),N=s.Ay.select.withConfig({displayName:"EmbedOnSite__SelectComponent",componentId:"sc-5d36wm-18"})(["width:100%;padding:8px;margin-bottom:10px;border:1px solid #ccc;border-radius:4px;flex:2;@media (max-width:768px){font-size:12px;}"]),F=s.Ay.div.withConfig({displayName:"EmbedOnSite__ModalOverlay",componentId:"sc-5d36wm-19"})(["position:fixed;top:-80px;left:0;right:0;bottom:0;padding-top:30px;background:rgba(0,0,0,0.5);display:flex;justify-content:center;z-index:1;@media (max-width:630px){top:-74px;}@media (max-width:380px){top:-90px;}"]),L=s.Ay.div.withConfig({displayName:"EmbedOnSite__ModalContent",componentId:"sc-5d36wm-20"})(["display:flex;flex-direction:column;align-items:center;background:white;border-radius:8px;max-width:400px;height:650px;max-height:80%;padding-bottom:20px;overflow:auto;width:100%;box-shadow:0 2px 10px rgba(0,0,0,0.1);@media (max-width:800px){transform:scale(0.9);padding-bottom:100px;max-height:70%;}@media (max-width:600px){transform:scale(0.85);}@media (max-width:450px){transform:scale(0.8);margin-top:90px;max-height:70%;}@media (max-width:390px){transform:scale(0.7);}"]),z=s.Ay.div.withConfig({displayName:"EmbedOnSite__ViewPreview",componentId:"sc-5d36wm-21"})(["position:absolute;top:55%;left:",";width:30%;height:70%;background-color:grey;border-radius:15px;transform:translate(-50%,-50%);opacity:0.5;"],function(e){return"left"===e.bubble.alignBubble?"20%":"80%"}),D=s.Ay.div.withConfig({displayName:"EmbedOnSite__ColorBox",componentId:"sc-5d36wm-22"})(["width:36px;height:36px;border:1px solid #ccc;background:",";cursor:pointer;margin-right:61.5%;margin-top:-5px;margin-bottom:5px;"],function(e){return e.color}),P=s.Ay.select.withConfig({displayName:"EmbedOnSite__SelectUnit",componentId:"sc-5d36wm-23"})(["padding:8px;border:1px solid #ccc;border-radius:4px;margin-left:8px;"]),M=(0,s.AH)(["@keyframes pulse{0%{transform:scale(1);opacity:1;}100%{transform:scale(1.5);opacity:0;}}"]),R=s.Ay.button.withConfig({displayName:"EmbedOnSite__UpdateButton",componentId:"sc-5d36wm-24"})(["background-color:",";transition:background-color 0.3s ease-in;color:white;border:none;border-radius:4px;padding:10px 15px;cursor:pointer;&:hover{background-color:",";}",""],function(e){return e.hasChanges?"#28a745":"#1194ff"},function(e){return e.hasChanges?"#218838":"#007bff"},function(e){return e.disabled&&(0,s.AH)(["pointer-events:none;background-color:grey;"])}),H=s.Ay.div.withConfig({displayName:"EmbedOnSite__TriggersCard",componentId:"sc-5d36wm-25"})(["background:#eee;border:1px solid #000;border-radius:10px;padding:15px;margin-top:10px;"]);function U(e,t){if(null==e||null==t)return e===t;if(typeof e!=typeof t)return!1;if("string"==typeof e||"number"==typeof e||"boolean"==typeof e)return e===t;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!U(e[n],t[n]))return!1;return!0}if("object"==typeof e){if("object"!=typeof t||Array.isArray(t))return!1;var i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(var o=0;o<i.length;o++){var a=i[o];if(!Object.prototype.hasOwnProperty.call(t,a)||!U(e[a],t[a]))return!1}return!0}return!1}let J=function(e){var t,n,o,s,m,M,J,X,Y=e.user,G=e.chatbotData,Z=e.chatbotId,W=e.updateHostedgptsData,$=e.updateChatbotsData,V=e.setChatbotData,q=e.teamId,K=e.isHosted,Q=e.permissions,ee={name:"",logo:"",chatIcon:"",color:"",bubble:{alignBubble:{type:"BOTTOM-RIGHT",top:"",left:"",right:"",bottom:""},pulse:{speed:2,enabled:!1,disableOnClick:!0},blur:0,background:"rgba(255, 255, 255, 1)",shape:"circle",size:.5,text:"",texture:"",border:{color:"rgba(0,0,0,1)",style:"solid",width:0},hoverEffect:{background:"rgba(0,0,255,0.1)",color:"rgba(0,0,255,1)",displacement:{x:0,y:0}},shadow:{blurRadius:8,color:"rgba(0,0,0,0)",offsetX:0,offsetY:4,spreadRadius:0}},sfx:{chatResponse:"",chimeOnLoad:!1},haptic:{enabled:!1,triggers:[{name:"onMessage",enabled:!1,intensity:"medium",duration:200,pattern:"single"},{name:"onFirstMessage",enabled:!1,intensity:"low",duration:150,pattern:"single"}]},uid:""};G=G||ee;var et=(0,c.useState)(!1),en=et[0],ei=et[1],er=(0,c.useState)("vanilla"),eo=er[0];er[1];var ea=(0,c.useState)(G.isPublic),ec=ea[0],es=ea[1],el="https://www.splutter.ai/chatbot-iframe/".concat(Z),ed=(0,c.useState)("code"),eb=ed[0],eu=ed[1],ep=(0,c.useState)(G.bubble),eh=ep[0],em=ep[1],eg=(0,c.useState)(G.sfx),ef=eg[0],ex=eg[1],ey=(0,c.useState)(G.haptic?JSON.parse(JSON.stringify(G.haptic)):ee.haptic),ev=ey[0],ew=ey[1],ej=(0,c.useState)(G.haptic?JSON.parse(JSON.stringify(G.haptic)):ee.haptic),eC=ej[0],ek=ej[1],eO=(0,c.useState)(G.sfx),eS=eO[0],eI=eO[1],eB=(0,c.useState)(!1),eE=eB[0],eA=eB[1],eT=(0,c.useState)(!1),e_=eT[0],eN=eT[1],eF=(0,c.useState)("vanilla"),eL=eF[0],ez=eF[1],eD=(0,c.useState)(!0),eP=eD[0],eM=eD[1],eR=(0,c.useState)("ALL"),eH=eR[0],eU=eR[1],eJ=(0,c.useRef)(null);(0,c.useEffect)(function(){ek(G.haptic?JSON.parse(JSON.stringify(G.haptic)):ee.haptic)},[G.haptic]),(0,c.useEffect)(function(){eI(G.sfx)}
1,[G.sfx]);var eX=function(e){var t;switch(e){case"BOTTOM-LEFT":t={type:e,top:"",left:"15px",right:"",bottom:"15px"};break;case"BOTTOM-RIGHT":t={type:e,top:"",left:"",right:"15px",bottom:"15px"};break;case"MIDDLE-LEFT":t={type:e,top:"45%",left:"15px",right:"",bottom:""};break;case"MIDDLE-RIGHT":t={type:e,top:"45%",left:"",right:"15px",bottom:""};break;case"TOP-LEFT":t={type:e,top:"15px",left:"15px",right:"",bottom:""};break;case"TOP-RIGHT":t={type:e,top:"15px",left:"",right:"15px",bottom:""};break;case"CUSTOM":t={type:e,top:eh.alignBubble.top,left:eh.alignBubble.left,right:eh.alignBubble.right,bottom:eh.alignBubble.bottom};break;default:t={type:e,top:"",left:"",right:"",bottom:""}}em(function(e){return g(g({},e),{},{alignBubble:t})})};(0,c.useEffect)(function(){em(G.bubble),ex(G.sfx),eX(G.bubble.alignBubble.type)},[G.bubble,G.sfx]),(0,c.useEffect)(function(){var e=function(e){if("CUSTOM"===eh.alignBubble.type&&eJ.current&&eJ.current.contains(e.target)){var t=e.clientX,n=e.clientY,i=eJ.current.offsetTop,r=eJ.current.offsetLeft,o=function(e){var o=i+e.clientY-n,a=r+e.clientX-t,c=eJ.current.parentElement.clientHeight,s=eJ.current.parentElement.clientWidth,l=o/c*100,d=a/s*100;em(function(e){return g(g({},e),{},{alignBubble:g(g({},e.alignBubble),{},{top:l<=50?"".concat(l.toFixed(2),"%"):"",left:d<=50?"".concat(d.toFixed(2),"%"):"",bottom:l>50?"".concat((100-l).toFixed(2),"%"):"",right:d>50?"".concat((100-d).toFixed(2),"%"):""})})})};document.addEventListener("mousemove",o),document.addEventListener("mouseup",function e(){document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",e)})}};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[eh]);var eY='<script>\n window.embeddedChatbotConfig = {\n chatbotId: "'.concat(Z,'",\n domain: "https://splutter.ai",\n align: "').concat(G.bubble.alignBubble.type,'",\n background: "').concat(G.bubble.background,'",\n blur: "').concat(G.bubble.blur,'",\n size: "').concat(G.bubble.size,'",\n draggable: "').concat(G.bubble.draggable,'",\n launch: "').concat(eP,'",\n monitor: "').concat(eH,'",\n iframeZIndex: "10"\n };\n</script>\n<script src="https://splutter.ai/embed.min.js" defer></script>'),eG='<iframe\n id="chatbot-iframe-'.concat(Z,'"\n src="https://splutter.ai/chatbot-iframe/').concat(Z,'"\n allow="microphone; clipboard-read; clipboard-write"\n width="100%"\n style="height: 100%; min-height: 700px; border: none; background-color: transparent; z-index: 10;"\n allowTransparency="true"\n frameborder="0"\n ></iframe>'),eZ={vanilla:eY,react:"<script \n dangerouslySetInnerHTML={{ \n __html: \"window.embeddedChatbotConfig = {chatbotId: '".concat(Z,"', domain: 'https://splutter.ai', align: '").concat(G.bubble.alignBubble.type,"', background: '").concat(G.bubble.background,"', blur: '").concat(G.bubble.blur,"', size: '").concat(G.bubble.size,"', draggable: '").concat(G.bubble.draggable,"', iframeZIndex: '10'};\" \n }} />\n\n<script src=\"https://splutter.ai/embed.min.js\" defer></script>"),wordpress:'<!-- WordPress integration code will go here, for example:\n<script>\n window.embeddedChatbotConfig = {\n chatbotId: "'.concat(Z,'",\n domain: "https://splutter.ai",\n align: "').concat(G.bubble.alignBubble.type,'",\n background: "').concat(G.bubble.background,'",\n blur: "').concat(G.bubble.blur,'",\n size: "').concat(G.bubble.size,'",\n draggable: "').concat(G.bubble.draggable,'",\n launch: "').concat(eP,'",\n monitor: "').concat(eH,'",\n iframeZIndex: "10"\n };\n</script>\n<script src="https://splutter.ai/embed.min.js" defer></script>\n-->'),angular:'<script>\n window.embeddedChatbotConfig = {\n chatbotId: "'.concat(Z,'",\n domain: "https://splutter.ai",\n align: "').concat(G.bubble.alignBubble.type,'",\n background: "').concat(G.bubble.background,'",\n blur: "').concat(G.bubble.blur,'",\n size: "').concat(G.bubble.size,'",\n draggable: "').concat(G.bubble.draggable,'",\n launch: "').concat(eP,'",\n monitor: "').concat(eH,'",\n iframeZIndex: "10"\n };\n</script>\n<script src="https://splutter.ai/embed.min.js" defer></script>'),vue:'<template>\n <div id="chatbot-container"></div>\n</template>\n\n<script>\nexport default {\n mounted() {\n window.embeddedChatbotConfig = {\n chatbotId: "'.concat(Z,'",\n domain: "https://splutter.ai",\n align: "').concat(G.bubble.alignBubble.type,'",\n background: "').concat(G.bubble.background,'",\n blur: "').concat(G.bubble.blur,'",\n size: "').concat(G.bubble.size,'",\n draggable: "').concat(G.bubble.draggable,'",\n launch: "').concat(eP,'",\n monitor: "').concat(eH,'",\n iframeZIndex: "10"\n };\n \n const script = document.createElement(\'script\');\n script.src = "https://splutter.ai/embed.min.js";\n script.defer = true;\n document.body.appendChild(script);\n },\n};\n</script>'),shopify:'<!-- Shopify integration code snippet -->\n<script>\n window.embeddedChatbotConfig = {\n chatbotId: "'.concat(Z,'",\n domain: "https://splutter.ai",\n al
1ign: "').concat(G.bubble.alignBubble.type,'",\n background: "').concat(G.bubble.background,'",\n blur: "').concat(G.bubble.blur,'",\n size: "').concat(G.bubble.size,'",\n draggable: "').concat(G.bubble.draggable,'",\n launch: "').concat(eP,'",\n monitor: "').concat(eH,'",\n iframeZIndex: "10"\n };\n</script>\n<script src="https://splutter.ai/embed.min.js" defer></script>'),next:"<script \n dangerouslySetInnerHTML={{ \n __html: \"window.embeddedChatbotConfig = {chatbotId: '".concat(Z,"', domain: 'https://splutter.ai', align: '").concat(G.bubble.alignBubble.type,"', background: '").concat(G.bubble.background,"', blur: '").concat(G.bubble.blur,"', size: '").concat(G.bubble.size,"', draggable: '").concat(G.bubble.draggable,"', iframeZIndex: '10'};\" \n }} />\n\n<script src=\"https://splutter.ai/embed.min.js\" defer></script>"),bubbleio:'<!-- Bubble.io integration code snippet -->\n<script>\n window.embeddedChatbotConfig = {\n chatbotId: "'.concat(Z,'",\n domain: "https://splutter.ai",\n align: "').concat(G.bubble.alignBubble.type,'",\n background: "').concat(G.bubble.background,'",\n blur: "').concat(G.bubble.blur,'",\n size: "').concat(G.bubble.size,'",\n draggable: "').concat(G.bubble.draggable,'",\n launch: "').concat(eP,'",\n monitor: "').concat(eH,'",\n iframeZIndex: "10"\n };\n</script>\n<script src="https://splutter.ai/embed.min.js" defer></script>')},eW=eZ[eo],e$=function(e){var t=e.match(/^(\d+)(px|rem|%)$/);return t?{number:t[1],unit:t[2]}:{number:"",unit:"px"}},eV=function(e,t){return"".concat(e).concat(t)},eq=(0,c.useState)({top:e$(eh.alignBubble.top).unit,left:e$(eh.alignBubble.left).unit,right:e$(eh.alignBubble.right).unit,bottom:e$(eh.alignBubble.bottom).unit}),eK=eq[0],eQ=eq[1];(0,c.useEffect)(function(){eQ({top:e$(eh.alignBubble.top).unit,left:e$(eh.alignBubble.left).unit,right:e$(eh.alignBubble.right).unit,bottom:e$(eh.alignBubble.bottom).unit})},[eh]);var e0=function(e){var t=e.target,n=t.name,i=t.value;"alignBubble"===n?eX(i):"size"===n?(em(function(e){return g(g({},e),{},(0,r.A)({},n,parseFloat(i)))}),console.log(eh)):"blur"===n?em(function(e){return g(g({},e),{},(0,r.A)({},n,parseInt(i)))}):em(function(e){return g(g({},e),{},(0,r.A)({},n,i))})},e1=function(e){var t=e.target,n=t.name,i=t.value;em(function(e){return g(g({},e),{},{border:g(g({},e.border),{},(0,r.A)({},n,i))})})},e5=function(e){var t=e.target,n=t.name,i=t.value,o=eK[n];em(function(e){return g(g({},e),{},{alignBubble:g(g({},e.alignBubble),{},(0,r.A)({},n,eV(i,o)))})})},e2=function(e,t){var n=e.target.value,i=eh.alignBubble[t].replace(/[^\d]/g,"");eQ(function(e){return g(g({},e),{},(0,r.A)({},t,n))}),em(function(e){return g(g({},e),{},{alignBubble:g(g({},e.alignBubble),{},(0,r.A)({},t,eV(i,n)))})})},e3=(t=(0,i.A)(a().mark(function e(){var t,n,i;return a().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(q&&Q&&!1==Q.u)){e.next=3;break}return d.o.error("[TEAM] You do not have permission to update chatbots!"),e.abrupt("return");case 3:return eN(!0),e.prev=4,e.next=7,Y.getIdToken();case 7:return t=e.sent,e.next=10,fetch("/api/v1/chatbots/update",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},body:JSON.stringify({chatbotUid:Z,bubble:eh,sfx:ef,teamId:q})});case 10:return n=e.sent,e.next=13,n.json();case 13:if(!(i=e.sent).success){e.next=20;break}V(g(g({},G),{},{bubble:eh,sfx:ef})),K?W(Z,g(g({},G),{},{bubble:eh,sfx:ef})):$(Z,g(g({},G),{},{bubble:eh,sfx:ef})),d.o.success("Bubble and SFX settings updated!"),e.next=21;break;case 20:throw Error(i.error||"Failed to update bubble and SFX settings");case 21:e.next=27;break;case 23:e.prev=23,e.t0=e.catch(4),console.error("Error updating bubble and SFX settings:",e.t0),d.o.error("Error: ".concat(e.t0.message));case 27:return e.prev=27,eN(!1),e.finish(27);case 30:case"end":return e.stop()}},e,null,[[4,23,27,30]])})),function(){return t.apply(this,arguments)}),e7=(n=(0,i.A)(a().mark(function e(){var t,n,i;return a().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(q&&Q&&!1==Q.u)){e.next=3;break}return d.o.error("[TEAM] You do not have permission to update chatbots!"),e.abrupt("return");case 3:return eN(!0),e.prev=4,e.next=7,Y.getIdToken();case 7:return t=e.sent,e.next=10,fetch("/api/v1/chatbots/update",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},body:JSON.stringify({chatbotUid:Z,haptic:ev,teamId:q})});case 10:return n=e.sent,e.next=13,n.json();case 13:if(!(i=e.sent).success){e.next=20;break}V(g(g({},G),{},{haptic:ev})),ek(ev),d.o.success("Haptic settings updated!"),e.next=21;break;case 20:throw Error(i.error||"Failed to update haptic settings");case 21:e.next=27;break;case 23:e.prev=23,e.t0=e.catch(4),console.error("Error updating haptic settings:",e.t0),d.o.error("Error: ".concat(e.t0.message));case 27:return e.prev=27,eN(!1),e.finish(27);case 30:case"end":return e.stop()}},e,null,[[4,23,27,30]])})),function(){return n.apply(this,arguments)}),e6=(o=(0,i.A)(a().mark(function e(){var t,n,i;return a().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(q&&Q&&!1==Q.u)){e.next=3;break}return d.o.error("[TEAM] You do not have permission to update chatbots!"),e.abrupt("return");case 3:return eN(!0),e.prev=4,e.next=7,Y.getIdToken();case 7:return t=e.sent,e.next=10,fetch("/api/v1/chatbots/update",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)},body:JSON.stringify({chatbotUid:Z,sfx:ef,teamId:q})});case 10:return n=e.sent,e.next=13,n.json();case 13:if(!(i=e.sent).success){e.next=20;break}V(g(g({},G),{},{sfx:ef})),eI(ef),d.o.success("SFX settings updated!"),e.next=21;break;case 20:throw Error(i.error||"Failed to update SFX settings");case 21:e.next=27;break;case 23:e.prev=23,e.t0=e.catch(4),console.error("Error updating SFX settings:",e.t0),d.o.error("Error: ".concat(e.t0.message));case 27:return e.prev=27,eN(!1),e.finish(27);case 30:case"end":return e.stop()}},e,null,[[4,23,27,30]])})),function(){return o.apply(this,arguments)});return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(l.A,{user:Y,isPublic:ec,chatbotId:Z,setIsPublic:es,toast:d.o,updateChatbotsData:$,setChatbotData:V,chatbotData:G,teamId:q,permissions:Q}),(0,h.jsx)(d.l,{position:"bottom-left",richColors:!0,style:{marginBottom:"80px"}}),(0,h.jsxs)(w,{$isPublic:ec,disabled:e_,children:[(0,h.jsxs)(j,{children:[(0,h.jsxs)(O,{children:[(0,h.jsx)(k,{className:"bubble"===eb?"active":"",onClick:function(){return eu("bubble")},disabled:e_,children:"Bubble"}),(0,h.jsx)(k,{className:"sfx"===eb?"active":"",onClick:function(){return eu("sfx")},disabled:e_,children:"SFX"}),(0,h.jsx)(k,{className:"haptic"===eb?"active":"",onClick:function(){return eu("haptic")},disabled:e_,children:"Haptic"}),(0,h.jsx)(k,{className:"code"===eb?"active":"",onClick:function(){return eu("code")},disabled:e_,children:"Code"}),(0,h.jsx)(k,{className:"share"===eb?"active":"",onClick:function(){return eu("share")},disabled:e_,children:"Share"})]}),"bubble"===eb&&(0,h.jsxs)("div",{style:{overflowY:"auto",paddingBottom:"25px"},children:[(0,h.jsxs)(A,{children:[(0,h.jsx)(T,{htmlFor:"alignBubble",children:"Align Bubble:"}),(0,h.jsxs)(N,{id:"alignBubble",name:"alignBubble",value:eh.alignBubble.type,onCh
1ange:e0,disabled:e_,children:[(0,h.jsx)("option",{value:"BOTTOM-LEFT",children:"Bottom Left"}),(0,h.jsx)("option",{value:"BOTTOM-RIGHT",children:"Bottom Right"}),(0,h.jsx)("option",{value:"MIDDLE-LEFT",children:"Middle Left"}),(0,h.jsx)("option",{value:"MIDDLE-RIGHT",children:"Middle Right"}),(0,h.jsx)("option",{value:"TOP-LEFT",children:"Top Left"}),(0,h.jsx)("option",{value:"TOP-RIGHT",children:"Top Right"}),(0,h.jsx)("option",{value:"CUSTOM",children:"Custom"})]})]}),"CUSTOM"===eh.alignBubble.type&&(0,h.jsx)(B,{children:["top","left","right","bottom"].map(function(e){return(0,h.jsxs)(A,{children:[(0,h.jsxs)(T,{htmlFor:"alignBubble".concat(e.charAt(0).toUpperCase()+e.slice(1)),children:[e.charAt(0).toUpperCase()+e.slice(1),":"]}),(0,h.jsx)(_,{id:"alignBubble".concat(e.charAt(0).toUpperCase()+e.slice(1)),name:e,type:"number",value:e$(eh.alignBubble[e]).number,onChange:e5,disabled:e_}),(0,h.jsxs)(P,{value:eK[e],onChange:function(t){return e2(t,e)},disabled:e_,children:[(0,h.jsx)("option",{value:"px",children:"px"}),(0,h.jsx)("option",{value:"%",children:"%"}),(0,h.jsx)("option",{value:"rem",children:"rem"})]})]},e)})}),(0,h.jsxs)(A,{children:[(0,h.jsx)(T,{htmlFor:"background",children:"Backgroun
1d:"}),(0,h.jsx)(D,{color:eh.background,onClick:function(){eA(!0)}})]}),(0,h.jsxs)(A,{children:[(0,h.jsx)(T,{htmlFor:"blur",children:"Blur:"}),(0,h.jsx)(_,{id:"blur",name:"blur",type:"number",step:"0.1",min:"0",max:"50",value:eh.blur,onChange:e0,disabled:e_})]}),(0,h.jsxs)(A,{children:[(0,h.jsx)(T,{htmlFor:"size",children:"Size:"}),(0,h.jsx)(_,{id:"size",name:"size",type:"number",step:"0.1",min:"0.1",max:"2",value:eh.size,onChange:e0,disabled:e_})]}),(0,h.jsxs)(A,{children:[(0,h.jsx)(T,{htmlFor:"borderColor",children:"Border Color:"}),(0,h.jsx)(_,{id:"borderColor",name:"color",type:"color",value:eh.border.color,onChange:e1,disabled:e_})]}),(0,h.jsxs)(A,{children:[(0,h.jsx)(T,{htmlFor:"borderWidth",children:"Border Width:"}),(0,h.jsx)(_,{id:"borderWidth",name:"width",type:"number",step:"1",min:"0",max:"10",value:eh.border.width,onChange:e1,disabled:e_})]}),(0,h.jsxs)(A,{children:[(0,h.jsx)(T,{htmlFor:"draggable",children:"Enable Dragging:"}),(0,h.jsx)("input",{type:"checkbox",checked:eh.draggable,onChange:function(e){return em(function(t){return g(g({},t),{},{draggable:e.target.checked})})},disabled:e_})]}),(0,h.jsxs)(A,{children:[(0,h.jsx)(T,{htmlFor:"pulseEnabled",children:"Enable Pulse:"}),(0,h.jsx)("input",{type:"checkbox",id:"pulseEnabled",name:"pulseEnabled",checked:(null===(s=eh.pulse)||void 0===s?void 0:s.enabled)||!1,onChange:function(e){return em(function(t){return g(g({},t),{},{pulse:g(g({},t.pulse),{},{enabled:e.target.checked})})})},disabled:e_})]}),(0,h.jsxs)(A,{children:[(0,h.jsx)(T,{htmlFor:"pulseSpeed",children:"Pulse Speed (seconds):"}),(0,h.jsx)(_,{id:"pulseSpeed",name:"pulseSpeed",type:"number",step:"0.1",min:"0.5",max:"10",value:(null===(m=eh.pulse)||void 0===m?void 0:m.speed)||2,onChange:function(e){return em(function(t){return g(g({},t),{},{pulse:g(g({},t.pulse),{},{speed:parseFloat(e.target.value)})})})},disabled:e_||!(null!==(M=eh.pulse)&&void 0!==M&&M.enabled)})]}),(0,h.jsxs)(A,{children:[(0,h.jsx)(T,{htmlFor:"pulseDisableOnClick",children:"Disable Pulse on Click:"}),(0,h.jsx)("input",{type:"checkbox",id:"pulseDisableOnClick",name:"pulseDisableOnClick",checked:(null===(J=eh.pulse)||void 0===J?void 0:J.disableOnClick)||!1,onChange:function(e){return em(function(t){return g(g({},t),{},{pulse:g(g({},t.pulse),{},{disableOnClick:e.target.checked})})})},disabled:e_||!(null!==(X=eh.pulse)&&void 0!==X&&X.enabled)})]}),(0,h.jsx)(E,{onClick:e3,disabled:e_,children:"Update Bubble Settings"}),(0,h.jsx)(E,{onClick:function(){eX("BOTTOM-RIGHT"),em(function(e){return g(g({},e),{},{alignBubble:{type:"BOTTOM-RIGHT",top:"",left:"",right:"15px",bottom:"15px"},background:"rgba(255, 255, 255, 1)",blur:0,size:.5,draggable:!1,border:g(g({},e.border),{},{color:"rgba(0,0,0,1)",width:0})})})},style:{marginLeft:"10px"},disabled:e_,children:"Reset to Default"})]}),"sfx"===eb&&(0,h.jsxs)("div",{style:{overflowY:"auto",paddingBottom:"15px"},children:[(0,h.jsxs)(A,{children:[(0,h.jsx)(T,{htmlFor:"chatResponse",children:"Chat Response:"}),(0,h.jsxs)(N,{id:"chatResponse",name:"chatResponse",value:ef.chatResponse,onChange:function(e){var t=e.target,n=t.name,i=t.value;ex(function(e){return g(g({},e),{},(0,r.A)({},n,"None"===i?"":i))})},disabled:e_,children:[(0,h.jsx)("option",{value:"None",children:"None"}),(0,h.jsx)("option",{value:"msg1",children:"Message 1"}),(0,h.jsx)("option",{value:"msg2",children:"Message 2"})]})]}),(0,h.jsxs)(A,{children:[(0,h.jsx)(T,{htmlFor:"chimeOnLoad",children:"SFX Chime on Chatbot Load:"}),(0,h.jsx)(u.A,{id:"chimeOnLoad",name:"chimeOnLoad",checked:ef.chimeOnLoad,onChange:function(e){return ex(function(t){return g(g({},t),{},{chimeOnLoad:e})})},disabled:e_})]}),(0,h.jsxs)("div",{style:{display:"flex",marginTop:"10px"},children:[(0,h.jsx)(R,{onClick:e6,disabled:e_,hasChanges:!U(ef,eS),children:"Update SFX Settings"}),(0,h.jsx)(E,{onClick:function(){ex(ee.sfx)},style:{marginLeft:"10px"},disabled:e_,children:"Reset to Default"}),(0,h.jsx)(E,{onClick:function(){ex(eS)},style:{marginLeft:"10px"},disabled:e_,children:"Undo Changes"})]})]}),"code"===eb&&(0,h.jsx)("div",{style:{display:"flex",alignItems:"flex-start",flexDirection:"row",overflowY:"auto"},children:(0,h.jsx)(p.u,{selectedOption:eL,setSelectedOption:ez,setLaunchBot:eM,setMonitorLevel:eU,launchBot:eP,monitorLevel:eH})}),"share"===eb&&(0,h.jsxs)("div",{style:{display:"flex",alignItems:"center",flexDirection:"column",overflowY:"auto",paddingBottom:"15px"},children:[(0,h.jsx)(l.A,{user:Y,isPublic:ec,chatbotId:Z,setIsPublic:es,toast:d.o,updateChatbotsData:$,setChatbotData:V,chatbotData:G,teamId:q,permissions:Q}),(0,h.jsx)(d.l,{position:"bottom-left",richColors:!0,style:{marginBottom:"80px"}}),(0,h.jsxs)(f,{isPublic:ec,children:[(0,h.jsx)(v,{children:"Copy the URL to share your chatbot:"}),(0,h.jsx)(x,{children:el}),(0,h.jsxs)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",marginTop:"10px",gap:"10px"},children:[(0,h.jsx)(y,{onClick:function(){navigator.clipboard.writeText(el).then(function(){ei(!0),setTimeout(function(){return ei(!1)},2e3)},function(e){console.error("Could not copy text: ",e)})},children:en?"Copied!":"Copy to Clipboard"}),(0,h.jsx)(y,{style:{backgroundColor:"rgba(255, 180, 0, 1)",color:"white",cursor:"pointer"},onClick:function(){return window.open(el,"_blank")},children:"Open Tab"})]})]})]}),"haptic"===eb&&(0,h.jsxs)("div",{style:{overflowY:"auto",paddingBottom:"15px"},children:[(0,h.jsxs)(A,{children:[(0,h.jsx)(T,{htmlFor:"hapticEnabled",children:"Enable Haptic:"}),(0,h.jsx)(u.A,{id:"hapticEnabled",name:"hapticEnabled",checked:ev.enabled,onChange:function(e){return ew(function(t){return g(g({},t),{},{enabled:e})})},disabled:e_})]}),ev.enabled&&(0,h.jsx)(h.Fragment,{children:ev.triggers.map(function(e,t){return(0,h.jsxs)(H,{children:[(0,h.jsx)("div",{style:{marginBottom:"10px",textTransform:"capitalize",fontWeight:"bold",fontSize:"1.1rem"},children:e.name}),(0,h.jsxs)(A,{children:[(0,h.jsx)(T,{htmlFor:"".concat(e.name,"-en
1abled"),children:"Enabled:"}),(0,h.jsx)("input",{type:"checkbox",id:"".concat(e.name,"-enabled"),checked:e.enabled,onChange:function(e){var n=ev.triggers.map(function(n,i){return i===t?g(g({},n),{},{enabled:e.target.checked}):n});ew(function(e){return g(g({},e),{},{triggers:n})})},disabled:e_})]}),(0,h.jsxs)(A,{children:[(0,h.jsx)(T,{htmlFor:"".concat(e.name,"-intensity"),children:"Intensity:"}),(0,h.jsxs)(N,{id:"".concat(e.name,"-intensity"),value:e.intensity,onChange:function(e){var n=ev.triggers.map(function(n,i){return i===t?g(g({},n),{},{intensity:e.target.value}):n});ew(function(e){return g(g({},e),{},{triggers:n})})},disabled:e_,children:[(0,h.jsx)("option",{value:"low",children:"Low"}),(0,h.jsx)("option",{value:"medium",children:"Medium"}),(0,h.jsx)("option",{value:"high",children:"High"})]})]}),(0,h.jsxs)(A,{children:[(0,h.jsx)(T,{htmlFor:"".concat(e.name,"-duration"),children:"Duration (ms):"}),(0,h.jsx)(_,{id:"".concat(e.name,"-duration"),type:"number",value:e.duration,onChange:function(e){var n=ev.triggers.map(function(n,i){return i===t?g(g({},n),{},{duration:parseInt(e.target.value)}):n});ew(function(e){return g(g({},e),{},{triggers:n})})},disabled:e_})]}),(0,h.jsxs)(A,{children:[(0,h.jsx)(T,{htmlFor:"".concat(e.name,"-pattern"),children:"Pattern:"}),(0,h.jsxs)(N,{id:"".concat(e.name,"-pattern"),value:e.pattern,onChange:function(e){var n=ev.triggers.map(function(n,i){return i===t?g(g({},n),{},{pattern:e.target.value}):n});ew(function(e){return g(g({},e),{},{triggers:n})})},disabled:e_,children:[(0,h.jsx)("option",{value:"single",children:"Single"}),(0,h.jsx)("option",{value:"double",children:"Double"}),(0,h.jsx)("option",{value:"long",children:"Long"})]})]})]},e.name)})}),(0,h.jsxs)("div",{style:{display:"flex",marginTop:"10px"},children:[(0,h.jsx)(R,{onClick:e7,disabled:e_,hasChanges:!U(ev,eC),children:"Update Haptic Settings"}),(0,h.jsx)(E,{onClick:function(){ew(G.haptic?JSON.parse(JSON.stringify(G.haptic)):ee.haptic)},style:{marginLeft:"10px"},disabled:e_,children:"Reset to Default"}),(0,h.jsx)(E,{onClick:function(){ew(JSON.parse(JSON.stringify(eC)))},style:{marginLeft:"10px"},disabled:e_,children:"Undo Changes"})]})]})]}),(0,h.jsxs)(C,{style:{flex:"share"===eb?0:1},children:["bubble"===eb&&(0,h.jsx)(S,{children:(0,h.jsx)(I,{ref:eJ,bubble:eh,draggable:!1},eh.alignBubble.type)}),"view"===eb&&(0,h.jsx)(S,{children:(0,h.jsx)(z,{bubble:eh})}),"code"===eb&&(0,h.jsx)("div",{style:{display:"flex",alignItems:"flex-start",flexDirection:"row",overflowY:"auto",height:"100%"},children:(0,h.jsx)(p.x,{selectedOption:eL,embedCode:eZ[eL],integrationCodes:eZ,iframeEmbedCode:eG,isCopied:en,handleCopyClick:function(){navigator.clipboard.writeText(eW).then(function(){ei(!0),setTimeout(function(){return ei(!1)},2e3)},function(e){console.error("Could not copy text: ",e)})},isLoading:e_,chatbotId:Z})})]})]}),eE&&(0,h.jsx)(F,{onClick:function(){eA(!1)},children:(0,h.jsxs)(L,{onClick:function(e){return e.stopPropagation()},children:[(0,h.jsx)("h2",{style:{textAlign:"center"},children:"Edit Background Color"}),(0,h.jsx)(b.A,{value:eh.background,onChange:function(e){em(function(t){return g(g({},t),{},{background:e})})}})]})})]})}}}]);
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.