2 Zeilen
18 KiB
JavaScript

function a0_0x5755(){let e=["error","classList","position","white","getRandomValues","70vw","0 4px 8px 0 rgba(0, 0, 0, 0.2)","assistant-message","listeners","contentWindow","http://","location","postMessage","-7px","round","100dvh","button_color","maxHeight","setItem",'"/>\n</svg> \n',"has","Invalid parameters for update",'" width="24" height="24">\n<path stroke-linecap="round" stroke-linejoin="round" d="M19.5 8.25l-7.5 7.5-7.5-7.5" />\n</svg>\n','"/>\n<path d="M771.545 755.99C832.175 755.17 881.17 706.175 881.99 645.545L804.595 674.184C802.551 674.94 800.94 676.551 800.184 678.595L771.545 755.99Z" fill="',"tool-call","CHATBOT_TOOL_RESULT","setInitialMessages","scale(0.9)","16px","fontSize","src","getElementsByTagName","open","get","fontFamily","function","https://qa.chatbase.co","domain","initialized","justifyContent","searchParams","abs","push","all .2s ease-in-out","currentScript","5749163BVImBG","resize","chatbaseConfig"," characters and will be truncated","12px","chatbase-message-bubbles","microphone","charAt","message","height","substring","alignItems","padding","866155JCLYBI"," not found","Tool keys must be strings","object","scale(1.08)","parseInt",'" alt="',"chatbase_anon_id","cursor","dispatchEvent","22px","addEventListener","style","width","flex","/api/get-chatbot-styles/","2135012yDdjBS","querySelector","column","removeEventListener","unset","email","?theme=dark","scrollTo","; domain=","includes","&#10005;","yes","log","min","toString","\n#chatbase-bubble-button,\n#chatbase-bubble-button * {\nmargin: 0;\npadding: 0;\nbox-sizing: border-box;\n}\nhtml.","then","application/json","[CHATBASE]: Invalid parameters for setInitialMessages","string","opacity 0.5s ease, transform 0.5s ease","substr","forEach","cookie","Error decoding chatbase_anon_id cookie:","innerHTML","transition","85px","registerTools","chatbotId","rgba(150, 150, 150, 0.2) 0px 10px 30px 0px, rgba(150, 150, 150, 0.2) 0px 0px 0px 1px","click","GET","right","chatbase-bubble-window","chatbase","du0qa2uPjCtO9BXlg4l8X","Chatbot","mouseleave","flexDirection","chatbase.fyi","8XVjiEM","none","type","indexOf","endsWith","innerWidth","getAttribute","hidden","sans-serif","backgroundColor","text/javascript","chatbase_anon_id=","center","onerror","createElement","display_name","85dvh","Lax","scrollX","length","CHATBOT_TOOL_CALL","chatbase-bubble-button","black","max","10px","html","448px","update","fixed","user-message","origin","body","6OmsviW","button","__cb_widget_active","flex-end","https://www.chatbase.co","left","user_metadata","boxShadow","http://localhost:3000",'<img src="https://backend.chatbase.co/storage/v1/object/public/chat-icons/',"split","set","Tools must be an object","isArray","iframeReady","complete","replace","20px","[CHATBASE]: Initial messages exceed ","color","1rem","tool-result","true","scale(1)","user_hash","div","filter",'\n<svg id="closeIcon" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2.3" stroke="',"24474627YILjEc","border","appendChild","align_chat_button","iframe","add","display","scrollY","getElementById","remove","join","data","zIndex","textAlign","ariaLabel","Tool ","readyState","theme","borderRadius","setAttribute","chatbaseUserConfig","8px","Tool values must be functions","close","; path=/; SameSite=","every","embeddedChatbotConfig","scrolling","opacity","padStart","100%","bottom","0.75rem","resolve","reduce","embedSuccess","5rem","dark",'" \n style="width:30px;height:30px;"\n>\n <g>\n <rect x="11" y="1" width="2" height="5" opacity=".14" />\n <rect\n x="11"\n y="1"\n width="1"\n height="5"\n transform="rotate(30 12 12)"\n opacity=".29"\n />\n <rect\n x="11"\n y="1"\n width="1"\n height="5"\n transform="rotate(60 12 12)"\n opacity=".43"\n />\n <rect\n x="11"\n y="1"\n width="1"\n height="5"\n transform="rotate(90 12 12)"\n opacity=".57"\n />\n <rect\n x="11"\n y="1"\n width="1"\n height="5"\n transform="rotate(120 12 12)"\n opacity=".71"\n />\n <rect\n x="11"\n y="1"\n width="1"\n height="5"\n transform="rotate(150 12 12)"\n opacity=".86"\n />\n <rect\n x="11"\n y="1"\n width="1"\n height="5"\n transform="rotate(180 12 12)"\n />\n <animateTransform\n attributeName="transform"\n type="rotate"\n calcMode="discrete"\n dur="0.75s"\n values="0 12 12;30 12 12;60 12 12;90 12 12;120 12 12;150 12 12;180 12 12;210 12 12;240 12 12;270 12 12;300 12 12;330 12 12;360 12 12"\n repeatCount="indefinite"\n />\n </g>\n</svg>',"user_id","/chatbot-iframe/","localhost"," body {\nposition: fixed !important;\ntop: 0;\nleft: 0;\noverscroll-behavior: none;\nwidth: 0 !important;\nheight: 0 !important;\nmargin: 0 !important;\noverflow: hidden !important;\noverflow-y: hidden !important;\noverflow-x: hidden !important;\ntransform: none !important;\n}\n","#000000","message_bubbles_have_been_shown","identify",'<svg\n viewBox="0 0 30 30"\n xmlns="http://www.w3.org/2000/svg"\n stroke="',"641160hytRJe","auto_open_chat_window_after","name","517029iYbQOR","top","script","transform","pointer","7063000GjETZl",",\nhtml.","getState","50%"];return(a0_0x5755=function(){return e})()}function a0_0x128b(e,t){let n=a0_0x5755();return(a0_0x128b=function(e,t){return e-=212,n[e]})(e,t)}(()=>{for(var e=a0_0x128b,t=a0_0x5755();;)try{if(563457==-parseInt(e(323))+parseInt(e(380))/2*(-parseInt(e(256))/3)+-parseInt(e(339))/4+-parseInt(e(253))/5+-parseInt(e(412))/6*(parseInt(e(310))/7)+parseInt(e(261))/8+parseInt(e(440))/9)break;t.push(t.shift())}catch(e){t.push(t.shift())}})(),(()=>{let s=a0_0x128b;let e=[s(289),s(433)],t=[s(409)],n=[s(272)],o=[...t,...n,...e],d=[...o],f=new class{constructor(){this.listeners=new Map}[s(334)](e,t){var n=s;this[n(273)][n(285)](e)||this[n(273)][n(423)](e,new Set),this[n(273)][n(298)](e)[n(445)](t)}[s(342)](e,t){var n=s;this.listeners.has(e)&&this[n(273)][n(298)](e).delete(t)}[s(332)](t){var e=s;return this[e(273)][e(285)](t[e(382)])&&this[e(273)][e(298)](t[e(382)])[e(361)](e=>{e(t)}),o[e(348)](t[e(382)])&&this[e(273)].has(e(318))&&this[e(273)][e(298)](e(318))[e(361)](e=>{e(t)}),!0}},y={},v=null,l=1e3;function i(r){let i=s;window[i(374)]=(e,...n)=>{let a=i;switch(e){case a(263):return a(303);case"identify":n?.[0]&&r.contentWindow.postMessage({type:a(251),params:{user_id:n[0].user_id,user_hash:n[0][a(436)],user_metadata:n[0][a(418)],chatbase_anon_id:(()=>{var e,t=a0_0x128b,n=t(391);for(e of document[t(362)][t(422)](";"))if(0===(e=e.trim())[t(383)](n))try{return decodeURIComponent(e[t(320)](n.length))}catch(e){return console.error(t(363),e),""}return""})()}},"*");break;case"update":n&&typeof n[0]===a(326)?r[a(274)].postMessage({type:a(407),params:n[0]}):console[a(265)](a(286));break;case"shutdown":break;case a(334):d[a(348)](n[0])&&f[a(334)](n[0],n[1]);break;case"removeEventListener":d[a(348)](n[0])&&f[a(342)](n[0],n[1]);break;case a(367):if(typeof n[0]!==a(326)||null===n[0])console[a(265)](a(424));else{for(var[t,o]of Object.entries(n[0])){if(typeof t!==a(358))return void console[a(265)](a(325));if(typeof o!==a(300))return void console[a(265)](a(228))}y=n[0]}break;case a(291):if(n&&Array[a(425)](n[0])&&n[0][a(231)](e=>"string"==typeof e&&0<e[a(399)])){let e=n[0],t=e[a(216)]("")[a(399)];if(t>l){console.warn(a(430)+l+a(313));let o=l;e=e[a(240)]((e,t)=>{var n=a;return 0<o&&(t=t.slice(0,o),o-=t[n(399)],e[n(307)](t)),e},[])}r[a(274)][a(277)]({type:a(291),messages:e},"*")}else console[a(265)](a(357));break;case a(297):return void W();case a(229):return void j();default:console[a(265)]("Unknown action:",e)}},window[i(374)]=new Proxy(window[i(374)],{get(t,n){return(...e)=>t(n,...e)}})}var a,r,c=document[s(309)];let h=null,x=new URL(c.src);try{h=x[s(305)][s(298)]("chatbotId")}catch(e){console[s(351)](e)}let _=c[s(386)](s(368))||window[s(232)]?.[s(368)]||c.id||window[s(312)]?.[s(368)]||h,u=c[s(386)](s(302))||window[s(232)]?.[s(302)],C=u?u[s(348)]("localhost")?s(275)+u:"https://"+u:x.origin,L=s(414),I=s(268),k=null,E=!1;function w(){var e=s;return document[e(214)](e(373))}function m(){var e=s;return document[e(214)](e(401))[e(340)](e(437))}function T(){var e=s,e='<svg width="55" height="55" viewBox="0 0 1120 1120" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M252 434C252 372.144 302.144 322 364 322H770C831.856 322 882 372.144 882 434V614.459L804.595 585.816C802.551 585.06 800.94 583.449 800.184 581.405L763.003 480.924C760.597 474.424 751.403 474.424 748.997 480.924L711.816 581.405C711.06 583.449 709.449 585.06 707.405 585.816L606.924 622.997C600.424 625.403 600.424 634.597 606.924 637.003L707.405 674.184C709.449 674.94 711.06 676.551 711.816 678.595L740.459 756H629.927C629.648 756.476 629.337 756.945 628.993 757.404L578.197 825.082C572.597 832.543 561.403 832.543 555.803 825.082L505.007 757.404C504.663 756.945 504.352 756.476 504.073 756H364C302.144 756 252 705.856 252 644V434ZM633.501 471.462C632.299 468.212 627.701 468.212 626.499 471.462L619.252 491.046C618.874 492.068 618.068 492.874 617.046 493.252L597.462 500.499C594.212 501.701 594.212 506.299 597.462 507.501L617.046 514.748C618.068 515.126 618.874 515.932 619.252 516.954L626.499 536.538C627.701 539.788 632.299 539.788 633.501 536.538L640.748 516.954C641.126 515.932 641.932 515.126 642.954 514.748L662.538 507.501C665.788 506.299 665.788 501.701 662.538 500.499L642.954 493.252C641.932 492.874 641.126 492.068 640.748 491.046L633.501 471.462Z" fill="'+I+e(288)+I+e(284);return k||e}function M(){var e=s;return e(439)+I+e(287)}let S=async()=>{var e=s,t=(t=s,document.getElementById(t(373))[t(340)](t(444))),n=w();t[e(295)]||(t[e(295)]=C+e(246)+_+e(345)),n.style[e(212)]=e(337)},p=window[s(398)],b=window[s(213)],W=()=>{var e=s,t=(t=s,document[t(214)](t(315))),n=m();E=!0,t[e(335)][e(212)]=e(381),window.innerWidth<640&&(p=window.scrollX,b=window[e(213)],document[e(340)](e(405))?.[e(266)].add(L)),S(),n.innerHTML=M()},j=()=>{var e=s;w()[e(335)].display="none",document[e(340)](e(405))?.[e(266)][e(215)](L),window[e(385)]<640&&window[e(346)](p,b,{behavior:"instant"}),m()[e(364)]=T()};async function g(){let l=s;if(window[l(312)]?.embedSuccess)return;let o=l(402),a=l(416);(x[l(410)]===l(420)||x[l(410)]===l(301)||x[l(410)][l(384)](l(379))||x[l(410)][l(348)](l(247)))&&(a=x[l(410)]);var e=document[l(394)](l(335));e[l(364)]=l(354)+L+l(262)+L+l(248),document[l(411)][l(442)](e);let r=l(372),c=document.createElement(l(413)),h=(c[l(382)]=l(413),c.setAttribute("id",l(401)),c[l(335)].position="fixed",c[l(335)].border="0",c[l(335)][l(237)]=l(432),c[l(335)][l(372)]=l(432),c[l(335)][l(336)]="55px",c[l(335)][l(319)]="55px",c.style[l(224)]="27.5px",c.style.backgroundColor=o,c[l(335)][l(419)]=l(271),c[l(335)][l(331)]=l(260),c[l(335)][l(218)]=2147483645,c[l(335)][l(365)]=l(308),c[l(220)]="chat-button",document[l(394)](l(437))),u=(h.setAttribute("id",l(315)),h[l(335)][l(267)]=l(408),h[l(335)][l(237)]=l(366),h[l(335)].borderRadius=l(404),h[l(335)][l(299)]=l(388),h.style[l(294)]=l(293),h[l(335)].zIndex=2147483644,h[l(335)].cursor=l(260),h[l(335)][l(378)]=l(341),h.style.gap="50px",h[l(335)].maxWidth=l(270),h[l(335)][l(212)]=l(381),document[l(394)](l(437))),w=(u[l(364)]=l(349),u[l(335)][l(267)]="absolute",u[l(335)][l(257)]=l(278),u[l(335)][l(372)]=l(278),u.style.fontWeight="bold",u.style[l(212)]="none",u[l(335)][l(304)]="center",u[l(335)][l(321)]="center",u[l(335)][l(218)]=2147483643,u.style[l(336)]=l(333),u.style[l(319)]=l(333),u[l(335)].borderRadius=l(264),u[l(335)][l(219)]=l(392),u[l(335)][l(294)]=l(314),u[l(335)][l(331)]=l(260),h[l(442)](u),document.body.appendChild(h),c.addEventListener("mouseenter",e=>{var t=l;c[t(335)][t(259)]=t(327)}),c[l(334)](l(377),e=>{var t=l;c[t(335)][t(259)]=t(435)}),document[l(394)]("div"));w.style[l(212)]=l(337),w.style.alignItems=l(392),w[l(335)][l(304)]=l(392),w[l(335)][l(336)]=l(236),w[l(335)][l(319)]=l(236),w.style[l(218)]=2147483646,c[l(442)](w);c.addEventListener(l(370),()=>{var e=l;(b[e(335)][e(212)]===e(381)?W:j)()}),window[l(334)]("message",o=>{let a=l;if(o[a(217)][a(382)]===a(426)){m.contentWindow[a(277)]({windowInnerWidth:window[a(385)]},"*");var e=window.chatbase?.q||[],r=window[a(226)];if((r?.[a(245)]||r?.email||r?.[a(255)]||r?.user_hash||r?.[a(418)])&&e.unshift(["identify",{user_id:r?.[a(245)],email:r?.[a(344)],name:r?.[a(255)],user_hash:r?.[a(436)],user_metadata:r?.[a(418)]}]),i(m),0<e?.[a(399)])for(var t of e){var[t,...n]=t;"open"!==t&&t!==a(229)&&window[a(374)](t,...n)}}if(d[a(348)](o.data[a(382)])&&f[a(332)](o[a(217)]),o[a(410)]===C&&(o.data[a(382)]===a(229)&&j(),o[a(217)][a(382)]===a(400))){let{toolName:n,args:e,user:t}=o[a(217)];n in y?(r=y[n],Promise[a(239)](r(e,t))[a(355)](e=>{var t=a;m[t(274)][t(277)]({type:t(290),toolName:n,result:e},"*")})):(console[a(265)](a(221)+n+a(324)),m[a(274)][a(277)]({type:a(290),toolName:n,result:{error:a(221)+n+a(324),status:a(265)}},"*"))}}),h.addEventListener("click",()=>{var e=l;E=!0,h[e(335)][e(212)]=e(381),S(),w[e(364)]=M()});let m=document[l(394)]("iframe"),p=(_===l(375)&&(m.allow=l(316)),m.style.height=l(236),m[l(335)][l(336)]=l(236),m[l(335)][l(441)]="none",m[l(335)][l(212)]="none",document[l(394)](l(437))),b=(p[l(335)][l(212)]=l(337),p[l(335)][l(304)]=l(392),p[l(335)].height=l(236),p[l(335)][l(321)]=l(392),document[l(394)]("div"));b.scrolling=l(350),setTimeout(()=>{var e=l;b[e(233)]=e(350)},3e3),b[l(225)]("id",l(373)),b[l(335)][l(441)]="none",b[l(335)][l(267)]=l(408),b[l(335)][l(378)]=l(341),b[l(335)][l(304)]="space-between",b[l(335)][l(419)]=l(369),b[l(335)][l(237)]=window[l(385)]<640?"0":l(366),b[l(335)][l(372)]=window.innerWidth<640?"0":l(432),b[l(335)][l(336)]=window[l(385)]<640?"100%":"458px",b[l(335)][l(319)]=window[l(385)]<640?l(280):l(396),b[l(335)][l(282)]=window.innerWidth<640?"":"824px",b.style.borderRadius=window[l(385)]<640?"0":l(238),b[l(335)][l(212)]="none",b.style.zIndex=2147483646,b[l(335)].overflow=l(387),b.appendChild(p),b[l(442)](m),document[l(411)][l(442)](b),window[l(334)](l(311),()=>{var e=l;"right"===r?(b[e(335)][e(372)]=window[e(385)]<640?0:e(432),b[e(335)][e(417)]=e(343)):(b[e(335)][e(417)]=window.innerWidth<640?0:e(432),b[e(335)].right=e(343)),b.style[e(237)]=window.innerWidth<640?0:e(242),b[e(335)][e(257)]=window.innerWidth<640?0:e(343),b[e(335)][e(336)]=window[e(385)]<640?e(236):e(406),b[e(335)][e(319)]=window[e(385)]<640?e(280):e(396),b[e(335)][e(224)]=window[e(385)]<640?"0":e(238),b[e(335)][e(212)]!==e(381)&&(window[e(385)]<640?document[e(411)][e(266)][e(445)](L):document[e(411)].classList[e(215)](L)),m.contentWindow[e(277)]({windowInnerWidth:window[e(385)]},"*")});function g(e,t){let n=l,o=e;"#"===o[n(317)](0)&&(o=o[n(360)](1));var e=e=>{var t=n;return Math[t(352)](255,Math[t(403)](0,e))},a=Number[n(328)](o.substr(0,2),16),r=Number[n(328)](o[n(360)](2,2),16),i=Number[n(328)](o.substr(4,2),16),t=.5<(.299*a+.587*r+.114*i)/255?-1*Math[n(306)](t):Math.abs(t),a=e(a+Math[n(279)](255*t)),r=e(r+Math[n(279)](255*t)),e=e(i+Math[n(279)](255*t));return"#"+a.toString(16)[n(235)](2,"0")+r.toString(16)[n(235)](2,"0")+e.toString(16)[n(235)](2,"0")}m.onload=()=>{var e=l;m.style[e(212)]="block",p[e(335)][e(212)]="none"};var e=window[l(374)]?.q??[],t=e.find(e=>"setInitialMessages"===e[0]),t=(t&&(v=t[1]),await(async()=>{let i=l,e=await fetch(a+i(338)+_,{method:i(371),headers:{"Content-Type":i(356)}}),{styles:s,initialMessages:t}=await e.json(),d=v||t;m.title=s?.[i(395)]||i(376),b.style[i(389)]="dark"===s[i(223)]?i(402):"white",c[i(335)][i(389)]=s[i(281)]||o,s.align_chat_button===i(417)?(r=i(417),c.style.left=i(432),c[i(335)][i(372)]="unset",h[i(335)][i(417)]="1rem",h[i(335)][i(372)]=i(343),b[i(335)][i(417)]=window[i(385)]<640?0:i(432),b.style[i(372)]="unset"):(c.style[i(372)]=i(432),c[i(335)][i(417)]=i(343),h.style.right=i(432),h[i(335)].left=i(343),b.style[i(372)]=window[i(385)]<640?0:"1rem",b[i(335)][i(417)]=i(343)),b.insertAdjacentElement("beforebegin",c),s.chat_icon&&(k=i(421)+s.chat_icon+i(329)+(s[i(395)]??"chatbot icon")+"\" style='width: 55px; height: 55px; border-radius: 50%;' />");var n=(e=>{let t=l,n=e;"#"===n[t(317)](0)&&(n=n[t(360)](1));var e=Number[t(328)](n.substr(0,2),16),o=Number[t(328)](n.substr(2,2),16),a=Number.parseInt(n[t(360)](4,2),16);return.5<(e=(.299*e+.587*o+.114*a)/255)?"black":t(268)})(s[i(281)]||o),n=(I=n,w[i(364)]=T(),d.forEach((e,t)=>{let n=i,o=document[n(394)](n(437)),a=(o.style[n(212)]=n(337),o.style.justifyContent=s[n(443)]===n(417)?"flex-start":n(415),document.createElement(n(437)));a[n(335)][n(389)]="dark"===s[n(223)]?n(402):n(268),a[n(335)][n(431)]=s[n(223)]===n(243)?n(268):"black",a[n(335)][n(419)]=n(369),a.style[n(224)]="10px",a[n(335)][n(322)]=n(429),a.style.margin=n(227),a[n(335)][n(294)]="14px";var r;a.innerHTML=e;for(r of a[n(296)]("a"))r[n(335)][n(431)]="dark"===s.theme?"white":n(402);a.style[n(234)]=0,a[n(335)][n(259)]=n(292),a[n(335)][n(365)]=n(359),o[n(442)](a),h[n(442)](o),0<=s[n(254)]&&setTimeout(()=>{var e=n;E||window.innerWidth<840||sessionStorage.getItem(e(250))!==e(434)&&(0===t&&(h.style[e(212)]="block"),a.style[e(234)]=1,a.style.transform=e(435),t===d.length-1)&&sessionStorage[e(283)](e(250),e(434))},1e3*s[n(254)]+100*t)}),u[i(335)][i(389)]="dark"===s.theme?g(i(249),.2):g("#FFFFFF",.12),u[i(335)][i(431)]=s.theme===i(243)?i(268):i(402),u[i(335)].boxShadow="rgba(150, 150, 150, 0.15) 0px 6px 24px 0px, rgba(150, 150, 150, 0.15) 0px 0px 0px 1px",h[i(334)]("mouseenter",()=>{var e=i;u[e(335)][e(212)]=e(337)}),h.addEventListener("mouseleave",()=>{var e=i;u[e(335)].display=e(381)}),u[i(334)]("click",e=>{var t=i;e.stopPropagation(),h[t(335)].display="none"}),s[i(223)]===i(243)?i(268):i(402));p[i(364)]=i(252)+n+i(244)})(),window[l(312)]&&(window.chatbaseConfig[l(241)]=!0),e[l(438)](e=>e[0]===l(297)||e[0]===l(229)));t.length&&t[t[l(399)]-1]?.[0]===l(297)&&W();{t=e.filter(e=>e[0]!==l(297)&&e[0]!==l(229));let o=s;window[o(374)]=(e,...t)=>{var n=o;switch(e){case n(297):return void W?.();case n(229):return void j?.();default:window[n(374)].q[n(307)]([e,...t])}},window[o(374)].q=t,window.chatbase=new Proxy(window[o(374)],{get(t,n){return"q"===n?t.q:(...e)=>t(n,...e)}})}}document[s(222)]===s(427)?g():window[s(334)]("load",()=>{g()}),c=a0_0x128b,document[c(362)][c(348)](c(330))||(r=window[c(276)].hostname,a=c(397),r=c(391)+(()=>{let t=a0_0x128b;return([1e7]+-1e3+-4e3+-8e3+-1e11)[t(428)](/[018]/g,e=>(e^crypto[t(269)](new Uint8Array(1))[0]&15>>e/4)[t(353)](16))})()+c(347)+r+c(230)+a,document[c(362)]=r)})();