@headwai/chat-bubble 6.6.0 → 6.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
.chat-header.svelte-
|
|
1
|
+
.chat-header.svelte-17nh75y.svelte-17nh75y{color:#fff;padding:16px 20px;border-radius:12px 12px 0 0;box-shadow:0 2px 4px #0000001a;flex-shrink:0}.chat-header-content.svelte-17nh75y.svelte-17nh75y{display:flex;align-items:center;justify-content:space-between;gap:12px}.chat-header-icon.svelte-17nh75y.svelte-17nh75y{width:24px;height:24px;object-fit:contain;flex-shrink:0}.chat-title.svelte-17nh75y.svelte-17nh75y{margin:0;font-size:16px;font-weight:600;text-align:center;font-family:inherit;flex:1}.chat-header-buttons.svelte-17nh75y.svelte-17nh75y{display:flex;gap:8px;align-items:center;flex-shrink:0}.chat-new-button.svelte-17nh75y.svelte-17nh75y,.chat-download-button.svelte-17nh75y.svelte-17nh75y,.chat-close-button.svelte-17nh75y.svelte-17nh75y{background:none;border:none;color:#fff;cursor:pointer;padding:4px;border-radius:4px;display:flex;align-items:center;justify-content:center;transition:all .2s ease;flex-shrink:0;width:24px;height:24px}.chat-new-button.svelte-17nh75y.svelte-17nh75y:hover,.chat-download-button.svelte-17nh75y.svelte-17nh75y:hover,.chat-close-button.svelte-17nh75y.svelte-17nh75y:hover{background-color:#ffffff1a;transform:scale(1.05)}.chat-new-button.svelte-17nh75y.svelte-17nh75y:active,.chat-download-button.svelte-17nh75y.svelte-17nh75y:active,.chat-close-button.svelte-17nh75y.svelte-17nh75y:active{background-color:#fff3;transform:scale(.95)}.chat-new-button.svelte-17nh75y.svelte-17nh75y:focus,.chat-download-button.svelte-17nh75y.svelte-17nh75y:focus,.chat-close-button.svelte-17nh75y.svelte-17nh75y:focus{outline:2px solid rgba(255,255,255,.5);outline-offset:2px}.chat-download-button.svelte-17nh75y.svelte-17nh75y:disabled{opacity:.5;cursor:not-allowed}.chat-download-button.svelte-17nh75y.svelte-17nh75y:disabled:hover{background-color:transparent;transform:none}@media (max-width: 768px){.chat-header.svelte-17nh75y.svelte-17nh75y{border-radius:0;padding-top:calc(16px + env(safe-area-inset-top,0px));padding-left:calc(20px + env(safe-area-inset-left,0px));padding-right:calc(20px + env(safe-area-inset-right,0px));position:relative;z-index:1000}.chat-header-buttons.svelte-17nh75y.svelte-17nh75y{gap:12px}.chat-new-button.svelte-17nh75y.svelte-17nh75y,.chat-download-button.svelte-17nh75y.svelte-17nh75y,.chat-close-button.svelte-17nh75y.svelte-17nh75y{width:40px;height:40px;padding:8px;-webkit-tap-highlight-color:transparent;touch-action:manipulation;min-width:44px;min-height:44px}.chat-new-button.svelte-17nh75y.svelte-17nh75y:hover,.chat-download-button.svelte-17nh75y.svelte-17nh75y:hover,.chat-close-button.svelte-17nh75y.svelte-17nh75y:hover{background-color:transparent;transform:none}.chat-new-button.svelte-17nh75y.svelte-17nh75y:active,.chat-download-button.svelte-17nh75y.svelte-17nh75y:active,.chat-close-button.svelte-17nh75y.svelte-17nh75y:active{background-color:#fff3;transform:scale(.9);transition:all .1s ease}.chat-title.svelte-17nh75y.svelte-17nh75y{font-size:18px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}}@media screen and (max-width: 768px){.chat-header-buttons.svelte-17nh75y button.svelte-17nh75y{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}}.ai-assistant-icon.svelte-1qxp0ze.svelte-1qxp0ze{position:fixed;bottom:20px;right:20px;width:60px;height:60px;border-radius:50%;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 6px #0000001a;cursor:pointer;pointer-events:auto;z-index:998;transition:transform .2s ease,box-shadow .2s ease}.ai-assistant-icon.svelte-1qxp0ze.svelte-1qxp0ze:hover{transform:scale(1.1);box-shadow:0 6px 8px #00000026}.ai-assistant-icon.svelte-1qxp0ze.svelte-1qxp0ze:active{transform:scale(.95);box-shadow:0 2px 4px #0000001a}.ai-assistant-icon.svelte-1qxp0ze img.svelte-1qxp0ze{width:75%;height:75%;object-fit:contain}@media (max-width: 768px){.ai-assistant-icon.svelte-1qxp0ze.svelte-1qxp0ze{width:56px;height:56px;bottom:calc(16px + env(safe-area-inset-bottom,0px));right:calc(16px + env(safe-area-inset-right,0px));-webkit-tap-highlight-color:transparent;touch-action:manipulation;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-touch-callout:none;z-index:9998}.ai-assistant-icon.svelte-1qxp0ze.svelte-1qxp0ze:hover{transform:none}.ai-assistant-icon.svelte-1qxp0ze.svelte-1qxp0ze:active{transform:scale(.9);transition:transform .1s ease}}@media (max-width: 480px){.ai-assistant-icon.svelte-1qxp0ze.svelte-1qxp0ze{width:64px;height:64px;min-width:44px;min-height:44px}}.chat-content.svelte-nmr4np{flex:1;display:flex;flex-direction:column;overflow:hidden}.chat-content.svelte-nmr4np deep-chat{width:100%!important;height:100%!important;position:relative!important;display:block!important;top:0!important;left:0!important;box-sizing:border-box!important}.chat-content.svelte-nmr4np deep-chat>*{width:100%!important;height:100%!important;box-sizing:border-box!important}@media (max-width: 768px){.chat-content.svelte-nmr4np{position:relative;min-height:0;flex:1 1 auto}.chat-content.svelte-nmr4np deep-chat{max-height:100%!important;overflow:hidden!important}.chat-content.svelte-nmr4np deep-chat [class*=input],.chat-content.svelte-nmr4np deep-chat [class*=text-input],.chat-content.svelte-nmr4np deep-chat input,.chat-content.svelte-nmr4np deep-chat textarea{position:relative!important;z-index:1000!important;margin-bottom:env(safe-area-inset-bottom,0px)!important;font-size:16px!important;-webkit-text-size-adjust:100%!important}.chat-content.svelte-nmr4np deep-chat [class*=messages],.chat-content.svelte-nmr4np deep-chat [class*=message-container]{padding-bottom:80px!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important}}@media screen and (max-width: 768px) and (max-height: 600px){.chat-content.svelte-nmr4np deep-chat{height:100%!important;max-height:none!important}}html,body{margin:0;padding:0;width:100%;height:100%}main.svelte-rzw9x0{font-family:sans-serif;margin:0;padding:0;pointer-events:none}.chat-container.svelte-rzw9x0{position:fixed;bottom:20px;right:20px;width:400px;height:600px;border-radius:12px;box-shadow:0 8px 32px #00000026;overflow:hidden;z-index:999;background:#fff;pointer-events:auto;animation:svelte-rzw9x0-slideIn .3s ease-out;display:flex;flex-direction:column}@keyframes svelte-rzw9x0-slideIn{0%{opacity:0;transform:translateY(20px) scale(.95)}to{opacity:1;transform:translateY(0) scale(1)}}@media (max-width: 768px){.chat-container.svelte-rzw9x0{position:fixed;top:0;left:0;right:0;bottom:0;width:100vw;max-height:100dvh;height:100dvh;border-radius:0;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px);padding-left:env(safe-area-inset-left,0px);padding-right:env(safe-area-inset-right,0px);box-sizing:border-box;-webkit-text-size-adjust:100%;z-index:9999}@media (orientation: portrait){.chat-container.svelte-rzw9x0{min-height:100dvh;max-height:100dvh}}}
|
|
@@ -222,7 +222,7 @@ new Remarkable().use(linkify)
|
|
|
222
222
|
Maintainer: @ericwbailey
|
|
223
223
|
|
|
224
224
|
Based on the Tomorrow Night Eighties theme: https://github.com/isagalaev/highlight.js/blob/master/src/styles/tomorrow-night-eighties.css
|
|
225
|
-
*/.hljs{background:#2b2b2b;color:#f8f8f2}.hljs-comment,.hljs-quote{color:#d4d0ab}.hljs-deletion,.hljs-name,.hljs-regexp,.hljs-selector-class,.hljs-selector-id,.hljs-tag,.hljs-template-variable,.hljs-variable{color:#ffa07a}.hljs-built_in,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-type{color:#f5ab35}.hljs-attribute{color:gold}.hljs-addition,.hljs-bullet,.hljs-string,.hljs-symbol{color:#abe338}.hljs-section,.hljs-title{color:#00e0e0}.hljs-keyword,.hljs-selector-tag{color:#dcc6e0}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}@media screen and (-ms-high-contrast:active){.hljs-addition,.hljs-attribute,.hljs-built_in,.hljs-bullet,.hljs-comment,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-quote,.hljs-string,.hljs-symbol,.hljs-type{color:highlight}.hljs-keyword,.hljs-selector-tag{font-weight:700}}#messages{overflow:auto;overflow-anchor:none}.outer-message-container:last-child{margin-bottom:5px}.inner-message-container{display:flex;margin-left:auto;margin-right:auto;width:calc(97.5% - 24px);max-width:100%}.message-bubble{margin-top:10px;word-wrap:break-word;width:fit-content;max-width:60%;border-radius:10px;padding:.42em .55em;height:fit-content;line-height:1.26em}.user-message-text{color:#fff;background-color:#0084ff;margin-right:0;margin-left:auto}.ai-message-text{color:#000;background-color:#e4e6eb;margin-left:0;margin-right:auto}.deep-chat-last-group-messages-active{height:100%}.loading-history-message-full-view{position:absolute;height:70%;width:100%;display:flex;align-items:center}.loading-history-message-small{height:20px;margin-bottom:30px}.loading-history-message-small>div>div{scale:.6}.loading-history-message{margin-top:0;width:100%;max-width:100%;display:flex;justify-content:center;background-color:unset}.loading-history{width:70px}.loading-history div{position:absolute;width:var(--loading-history-width);height:var(--loading-history-height);margin:var(--loading-history-margin);border:var(--loading-history-border);border-radius:50%;animation:loading-spinner 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:var(--loading-history-color) transparent transparent transparent}.loading-history div:nth-child(1){animation-delay:-.45s}.loading-history div:nth-child(2){animation-delay:-.3s}.loading-history div:nth-child(3){animation-delay:-.15s}.html-message{max-width:unset}.error-message-text{margin:14px auto 10px;background-color:#f4c0c0;color:#474747;text-align:center;max-width:95%}.deep-chat-loading-message-dots-container{width:1em;padding:.6em .75em .6em 1.3em}.loading-message-dots{position:relative;width:.45em;height:.45em;border-radius:5px;background-color:var(--loading-message-color);color:var(--loading-message-color);animation:loading-message-dots 1s infinite linear alternate;animation-delay:.5s}.loading-message-dots:before,.loading-message-dots:after{content:"";display:inline-block;position:absolute;top:0}.loading-message-dots:before{left:-.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--loading-message-color);color:var(--loading-message-color);animation:loading-message-dots 1s infinite alternate;animation-delay:0s}.loading-message-dots:after{left:.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--loading-message-color);color:var(--loading-message-color);animation:loading-message-dots 1s infinite alternate;animation-delay:1s}@keyframes loading-message-dots{0%{background-color:var(--loading-message-color)}50%,to{background-color:var(--loading-message-color-fade)}}.message-bubble>p:first-child,.message-bubble>.partial-render-message>p:first-child,.html-wrapper>p:first-child{margin-top:0}.message-bubble>p:last-child,.message-bubble>.partial-render-message:last-child>p,.html-wrapper>p:last-child{margin-bottom:0}pre{overflow:auto;display:block;word-break:break-all;word-wrap:break-word;border-radius:7px;background:#2b2b2b;color:#f8f8f2;margin-top:.8em;margin-bottom:.8em;padding:.6em;font-size:.9em;line-height:1.5em}.image-message{padding:0;display:flex;background-color:#ddd}.image-message>*,.image-message>*>*{width:100%;border-radius:8px;display:flex}.audio-message{width:60%;max-width:300px;height:2.2em;max-height:54px;padding:0;background-color:unset}.audio-player{width:100%;height:100%}.audio-player-safari{height:fit-content;width:40px}.audio-player-safari-left{float:left}.audio-player-safari-right{float:right}.any-file-message{padding:1px}.any-file-message-contents{display:flex}.any-file-message-icon-container{width:1.3em;min-width:1.3em;position:relative;border-radius:4px;margin-left:6px;margin-right:2px}.any-file-message-icon{background-color:#fff;border-radius:4px;position:absolute;width:1em;height:1.25em;padding:1px;margin-top:auto;margin-bottom:auto;top:0;bottom:0}.any-file-message-text{padding-top:5px;overflow-wrap:anywhere;padding-bottom:5px;padding-right:7px}.message-bubble>a{color:inherit}.left-item-position{margin-right:10px}.right-item-position{margin-left:10px}.role-hidden{display:none}.avatar{padding-top:5px;width:1.5em;height:1.5em;border-radius:1px}.avatar-container{margin-top:9px}.name{margin-top:16px;font-size:15px}#drag-and-drop{position:absolute;display:none;z-index:10;height:calc(100% - 10px);width:calc(100% - 10px);background-color:#70c6ff4d;border:5px dashed #6dafff}#file-attachment-container{position:absolute;height:3.6em;width:calc(80% - 4px);top:-2.5em;border-radius:5px;overflow:auto;text-align:left;background-color:#d7d7d73b;padding-left:4px}.file-attachment{width:2.85em;height:2.85em;display:inline-flex;margin-right:.6em;margin-bottom:.44em;margin-top:4px;position:relative;background-color:#fff;border-radius:5px}.image-attachment{width:100%;height:100%;object-fit:cover;border-radius:5px}.border-bound-attachment{width:calc(100% - 2px);height:calc(100% - 2px);border:1px solid #c3c3c3;border-radius:5px;overflow:hidden}.border-bound-attachment-safari{width:calc(100% - 1px);height:calc(100% - 1px)}.audio-attachment-icon-container{cursor:pointer}.audio-attachment-icon-container:hover{background-color:#f8f8f8}.attachment-icon{left:0;right:0;bottom:0;top:2px;margin:auto;position:absolute;width:25px;-webkit-user-select:none;user-select:none}.not-removable-attachment-icon{top:0;right:0;bottom:0;left:0}.play-icon{filter:brightness(0) saturate(100%) invert(17%) sepia(0%) saturate(1392%) hue-rotate(67deg) brightness(98%) contrast(97%)}.stop-icon{filter:brightness(0) saturate(100%) invert(29%) sepia(90%) saturate(1228%) hue-rotate(198deg) brightness(93%) contrast(98%)}.audio-placeholder-text-3-digits{padding-left:.26rem}.audio-placeholder-text-4-digits{padding-left:.1rem}.any-file-attachment{padding:2px 0}.file-attachment-text-container{position:absolute;width:inherit;display:flex;align-items:center;height:100%;top:-1px}.audio-placeholder-text-3-digits-container{padding-top:1px;cursor:default}.any-file-attachment-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding-left:.13em;margin-left:auto;margin-right:auto}.remove-file-attachment-button{height:1.25em;width:1.25em;border:1px solid #cfcfcf;border-radius:25px;background-color:#fff;top:-4px;right:-5px;position:absolute;display:flex;justify-content:center;cursor:pointer;-webkit-user-select:none;user-select:none}.remove-file-attachment-button:hover{background-color:#e4e4e4}.remove-file-attachment-button:active{background-color:#d7d7d7}.x-icon{color:#4e4e4e;top:-.075em;position:relative;font-size:1.05em}.modal{display:none;flex-direction:column;align-items:center;justify-content:center;position:absolute;width:80%;max-width:420px;max-height:80%;margin:auto;top:0;right:0;bottom:0;left:0;z-index:3}.modal-content{border-top:1px solid rgb(217,217,217);border-left:1px solid rgb(217,217,217);border-right:1px solid rgb(217,217,217);border-top-left-radius:inherit;border-top-right-radius:inherit;background-color:#fff;overflow-y:auto;height:fit-content;max-height:calc(100% - 3.3em);width:100%}.modal-content>p{margin-left:1em;margin-right:1em}.modal-content>ul{margin-right:1em}.modal-button-panel{height:3.3em;border:1px solid;border-color:rgb(223,223,223) rgb(217,217,217) rgb(217,217,217);border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;background-color:#fff;text-align:center;justify-content:center;display:flex;width:100%}.modal-button{min-width:2.5em;text-align:center;color:#fff;border-radius:5px;padding:.4em .4em .3em;height:1.25em;background-color:#3279b2;top:0;bottom:0;cursor:pointer;-webkit-user-select:none;user-select:none;margin:auto .31em}.modal-button:hover{background-color:#276da7}.modal-button:active{background-color:#1b5687}.modal-svg-button{padding:0 0 2px;width:2em;height:1.8em}.modal-svg-button-icon{width:100%;height:100%;filter:brightness(0) saturate(100%) invert(100%) sepia(15%) saturate(4%) hue-rotate(346deg) brightness(101%) contrast(102%)}#modal-background-panel{position:absolute;width:100%;height:100%;background-color:#00000042;z-index:2;display:none}.show-modal-background{animation:fadeInBackground .3s ease-in-out}@keyframes fadeInBackground{0%{opacity:0}to{opacity:1}}.show-modal{animation:fadeInModal .3s ease-in-out}@keyframes fadeInModal{0%{opacity:0;scale:.95}to{opacity:1;scale:1}}.hide-modal-background{animation:fadeOutBackground .2s ease-in-out}@keyframes fadeOutBackground{0%{opacity:1}to{opacity:0}}.hide-modal{animation:fadeOutModal .2s ease-in-out}@keyframes fadeOutModal{0%{opacity:1;scale:1}to{opacity:0;scale:.95}}.modal-camera-content{overflow:hidden;text-align:center;border:unset;height:100%;background-color:#2a2a2a;display:flex;justify-content:center}.camera-modal-canvas{max-width:100%;max-height:100%;margin-top:auto;margin-bottom:auto}.modal-svg-submit-button{background-color:green}.modal-svg-submit-button:hover{background-color:#007500}.modal-svg-submit-button:active{background-color:#006500}.modal-svg-submit-disabled{pointer-events:none;background-color:#747474}.modal-svg-close-button{height:1.56em;padding-top:.37em;padding-bottom:0;background-color:#c13e3e}.modal-svg-close-button:hover{background-color:#b43434}.modal-svg-close-button:active{background-color:#972929}.modal-svg-close-icon{width:80%;height:80%}.modal-svg-camera-button{height:1.6em;padding-top:.38em;padding-bottom:0}.modal-svg-camera-icon{height:76%}.modal-svg-refresh-icon{height:105%}.modal-svg-refresh-button{height:1.66em;padding-top:.11em;padding-bottom:.21em}.input-button-container{position:relative;z-index:1}.inside-right{position:absolute;right:calc(10% + .35em);bottom:.85em}.inside-left{position:absolute;left:calc(10% + .35em);bottom:.85em}.outside-left{position:absolute;right:calc(11px - .55em);bottom:.88em}.outside-right{position:absolute;left:calc(11px - .55em);bottom:.88em}#upload-images-icon{position:absolute;pointer-events:none;width:1.45em;height:1.45em;left:.11em;bottom:.08em;filter:brightness(0) saturate(100%) invert(43%) sepia(0%) saturate(740%) hue-rotate(77deg) brightness(99%) contrast(92%)}#upload-gifs-icon{position:absolute;pointer-events:none;width:1.5em;height:1.48em;left:.07em;bottom:.08em;filter:brightness(0) saturate(100%) invert(49%) sepia(0%) saturate(2586%) hue-rotate(12deg) brightness(93%) contrast(90%)}#upload-audio-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.17em;bottom:.2em;filter:brightness(0) saturate(100%) invert(15%) sepia(0%) saturate(337%) hue-rotate(125deg) brightness(91%) contrast(94%);transform:scaleX(.95)}#camera-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.23em;bottom:.2em;filter:brightness(0) saturate(100%) invert(52%) sepia(0%) saturate(161%) hue-rotate(164deg) brightness(91%) contrast(92%);transform:scaleX(.95)}#upload-mixed-files-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.25em;bottom:.2em;filter:brightness(0) saturate(100%) invert(53%) sepia(0%) saturate(36%) hue-rotate(74deg) brightness(98%) contrast(93%);transform:scaleX(.95)}#interim-text{color:gray}#microphone-button{padding-top:.5px}.outer-button-container>#microphone-button{padding-bottom:1px}#microphone-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.25em;bottom:.25em}.default-microphone-icon{filter:brightness(0) saturate(100%) invert(32%) sepia(0%) saturate(924%) hue-rotate(46deg) brightness(95%) contrast(99%)}.active-microphone-icon{filter:brightness(0) saturate(100%) invert(10%) sepia(97%) saturate(7495%) hue-rotate(0deg) brightness(101%) contrast(107%);border-radius:10px}.command-microphone-icon{filter:brightness(0) saturate(100%) invert(42%) sepia(96%) saturate(1067%) hue-rotate(77deg) brightness(99%) contrast(102%)}.unsupported-microphone{display:none}#submit-icon{height:100%;filter:brightness(0) saturate(100%) invert(32%) sepia(0%) saturate(924%) hue-rotate(46deg) brightness(95%) contrast(99%);width:1.21em}#stop-icon{background-color:#acacac;position:absolute;width:.95em;height:.95em;left:.35em;bottom:.35em;border-radius:2px}.submit-button-enlarged{scale:1.1;margin-right:.3em;margin-left:.3em}.loading-submit-button{position:relative;left:calc(-9990px + .275em);width:.22em;height:.22em;border-radius:5px;background-color:#848484;color:#848484;box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484;animation:loading-submit-button 1.5s infinite linear;bottom:-.75em}@keyframes loading-submit-button{0%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}16.667%{box-shadow:9990px -6px #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}33.333%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}50%{box-shadow:9990px 0 #848484,calc(9990px + .44em) -6px 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}66.667%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}83.333%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) -6px 0 0 #848484}to{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}}.tooltip{position:absolute;visibility:hidden;z-index:1;pointer-events:none;padding:5px 7px;background-color:#333;border-radius:5px;width:max-content}.tooltip-text{color:#fff;font-size:13px}.input-button{border-radius:4px;cursor:pointer;margin-bottom:.2em;-webkit-user-select:none;user-select:none}.input-button-svg{width:1.65em;height:1.65em}.input-button-svg-text{padding:1px;height:1.65em;display:flex}.input-button-svg-text>svg{padding:.22rem}.input-button-svg-text>div{margin-left:2px}.input-button:hover,.input-button:focus-visible{background-color:#9c9c9c2e}.input-button:active{background-color:#9c9c9c5e}.input-button:active:not(:hover){background-color:transparent}.loading-button{cursor:auto}.loading-button:hover{background-color:unset}.text-button{filter:unset!important;display:flex;justify-content:center;align-items:center;margin-left:4px;margin-right:4px;height:1.6em;width:max-content}#custom-icon{height:100%;width:1.2em}.custom-button-container-default{color:#505050}.custom-button-container-default>.dropup-menu-item-icon{color:unset}.custom-button-container-default>svg{filter:brightness(0) saturate(100%) invert(39%) sepia(1%) saturate(0%) hue-rotate(83deg) brightness(93%) contrast(90%)}.custom-button-container-default>.dropup-menu-item-icon>svg{position:absolute;left:.2em}.custom-button-container-active{background-color:#edf7ff;color:#0285ff}.custom-button-container-active:hover,.custom-button-container-active:focus-visible{background-color:#def0ff}.custom-button-container-active:active{background-color:#d2eaff}.custom-button-container-active>svg{filter:brightness(0) saturate(100%) invert(32%) sepia(34%) saturate(4196%) hue-rotate(196deg) brightness(107%) contrast(104%)}.custom-button-container-disabled{color:#aeaeae;cursor:auto}.custom-button-container-disabled>div{pointer-events:none}.custom-button-container-disabled:hover,.custom-button-container-disabled:focus-visible{background-color:transparent}.custom-button-container-disabled:active{background-color:transparent}.custom-button-container-disabled>svg{filter:brightness(0) saturate(100%) invert(67%) sepia(0%) saturate(818%) hue-rotate(28deg) brightness(102%) contrast(100%)}#text-input-container{background-color:#fff;width:80%;display:flex;border:1px solid #0000001a;border-radius:5px;margin-top:.8em;margin-bottom:.8em;box-shadow:#959da533 0 1px 12px;overflow-y:auto;max-height:200px;position:relative}.text-input-container-left-adjustment{margin-left:1.5em}.text-input-container-right-adjustment{margin-right:1.5em}.text-input-container-left-small-adjustment{margin-left:1.1em}.text-input-container-left-small-adjustment>.outside-left{right:calc(14px - .55em)}.text-input-container-right-small-adjustment{margin-right:1.1em}.text-input-container-right-small-adjustment>.outside-right{left:calc(14px - .55em)}#text-input{text-align:left;outline:none;word-wrap:break-word;line-break:auto}.text-input-styling{padding:.4em .5em;overflow:overlay;width:100%}.text-input-inner-left-adjustment{padding-left:2.2em}.text-input-inner-right-adjustment{padding-right:2em}.text-input-disabled{pointer-events:none;-webkit-user-select:none;user-select:none}[contenteditable]:empty:before{content:attr(deep-chat-placeholder-text);pointer-events:none}[contenteditable][textcolor]:empty:before{color:gray}.outside-right>#dropup-menu,.inside-right>#dropup-menu{right:0}#dropup-icon{position:absolute;pointer-events:none;width:1.16em;height:1.2em;left:.265em;bottom:.43em;filter:brightness(0) saturate(100%) invert(54%) sepia(0%) saturate(724%) hue-rotate(6deg) brightness(92%) contrast(90%)}.dropup-button>*{pointer-events:none}#dropup-menu{background-color:#fff;position:absolute;transform:translateY(-100%);border-radius:5px;z-index:1;top:-.49em;box-shadow:#0003 -1px 2px 10px,#0000001a 0 2px 4px;cursor:pointer;-webkit-user-select:none;user-select:none}.dropup-menu-item{height:1.4em;padding:.28em .84em .28em .35em;display:flex;position:relative}.dropup-menu-item:hover,.dropup-menu-item:focus-visible{background-color:#f3f3f3}.dropup-menu-item:active{background-color:#ebebeb}.dropup-menu-item:active:not(:hover){background-color:transparent}.dropup-menu-item:first-child{padding-top:.49em;border-top-left-radius:inherit;border-top-right-radius:inherit}.dropup-menu-item:last-child{padding-bottom:.45em;border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.dropup-menu-item-icon{width:1.39em;position:relative}.dropup-menu-item-icon>svg{bottom:0!important;top:0!important;margin-bottom:auto;margin-top:auto}#dropup-menu-item-icon-element-custom{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.28em;filter:brightness(0) saturate(100%) invert(15%) sepia(0%) saturate(337%) hue-rotate(125deg) brightness(91%) contrast(94%)}.dropup-menu-item-text{margin-left:.56em;margin-top:.08em;width:max-content}#input{width:100%;display:inline-flex;text-align:center;margin-left:auto;margin-right:auto;margin-top:auto;position:relative;justify-content:center}#chat-view{height:100%;display:grid;grid-template-columns:100%}::-webkit-scrollbar{width:9px;height:9px}::-webkit-scrollbar-thumb{background-color:#d0d0d0;border-radius:5px}::-webkit-scrollbar-track{background-color:#f2f2f2}.deep-chat-web-model-button{margin-top:10px;margin-bottom:5px;margin-left:1px}:host{all:initial;display:table-cell}#container{height:inherit;width:inherit;overflow:hidden}`,Nf=Object.defineProperty,ne=function(s,t,e,n){for(var r=void 0,i=s.length-1,o;i>=0;i--)(o=s[i])&&(r=o(t,e,r)||r);return r&&Nf(t,e,r),r},ee=function(a){function s(){var t;C(this,s);var e;return t=D(this,s),t.getMessages=function(){return[]},t.submitUserMessage=function(){return console.warn("submitUserMessage failed - please wait for chat view to render before calling this property.")},t.addMessage=function(){return console.warn("addMessage failed - please wait for chat view to render before calling this property.")},t.updateMessage=function(){},t.clearMessages=function(){},t.focusInput=function(){return $n.focusFromParentElement(t._elementRef)},t.refreshMessages=function(){},t.scrollToBottom=function(){},t.disableSubmitButton=function(){},t.setPlaceholderText=function(){},t._hasBeenRendered=!1,t._auxiliaryStyleApplied=!1,t._elementRef=P(),t._elementRef.id="container",t.attachShadow({mode:"open"}).appendChild(t._elementRef),(e=t.shadowRoot)==null||e.appendChild(gt.buildElement()),ta.apply(Lf,t.shadowRoot),setTimeout(function(){t._hasBeenRendered||t.onRender()},20),t}return U(s,a),E(s,[{key:"changeToChatView",value:function(){this._activeService&&(this._activeService.validateKeyProperty=!1),this.onRender()}},{key:"onRender",value:function(){var e;Ci.attemptAppendStyleSheetToHead(this.style),De.processConnect(this),(!this._activeService||this._activeService.demo)&&(this._activeService=Uh.create(this)),this.auxiliaryStyle&&!this._auxiliaryStyleApplied&&(ta.apply(this.auxiliaryStyle,this.shadowRoot),this._auxiliaryStyleApplied=!0),ta.applyDefaultStyleToComponent(this.style,this.chatStyle),De.checkForContainerStyles(this,this._elementRef),this._activeService.key&&this._activeService.validateKeyProperty?Ml.render(this._elementRef,this.changeToChatView.bind(this),this._activeService):!(this._activeService instanceof Y)||this._activeService.key?((e=this._childElement)!==null&&e!==void 0||(this._childElement=this.children[0]),Bf.render(this,this._elementRef,this._activeService,this._childElement)):this._activeService instanceof Y&&zc.render(this._elementRef,this.changeToChatView.bind(this),this._activeService),this._hasBeenRendered||Ft.onRender(this),this._hasBeenRendered=!0}},{key:"disconnectedCallback",value:function(){Xa.chat=void 0}}])}(Uc);ne([te("object")],ee.prototype,"connect");ne([te("object")],ee.prototype,"directConnection");ne([te("object")],ee.prototype,"webModel");ne([te("object")],ee.prototype,"requestBodyLimits");ne([te("function")],ee.prototype,"requestInterceptor");ne([te("function")],ee.prototype,"responseInterceptor");ne([te("function")],ee.prototype,"validateInput");ne([te("function")],ee.prototype,"loadHistory");ne([te("object")],ee.prototype,"chatStyle");ne([te("object")],ee.prototype,"attachmentContainerStyle");ne([te("object")],ee.prototype,"dropupStyles");ne([te("object")],ee.prototype,"inputAreaStyle");ne([te("object")],ee.prototype,"textInput");ne([te("object")],ee.prototype,"submitButtonStyles");ne([te("object")],ee.prototype,"customButtons");ne([te("string")],ee.prototype,"auxiliaryStyle");ne([te("array")],ee.prototype,"history");ne([te("object")],ee.prototype,"browserStorage");ne([te("object")],ee.prototype,"introMessage");ne([te("object")],ee.prototype,"avatars");ne([te("object")],ee.prototype,"names");ne([te("object")],ee.prototype,"displayLoadingBubble");ne([te("object")],ee.prototype,"errorMessages");ne([te("object")],ee.prototype,"messageStyles");ne([te("object")],ee.prototype,"textToSpeech");ne([te("object")],ee.prototype,"speechToText");ne([te("object")],ee.prototype,"images");ne([te("object")],ee.prototype,"gifs");ne([te("object")],ee.prototype,"camera");ne([te("object")],ee.prototype,"audio");ne([te("object")],ee.prototype,"microphone");ne([te("object")],ee.prototype,"mixedFiles");ne([te("object")],ee.prototype,"dragAndDrop");ne([te("object")],ee.prototype,"htmlWrappers");ne([te("object")],ee.prototype,"htmlClassUtilities");ne([te("object")],ee.prototype,"remarkable");ne([te("object")],ee.prototype,"focusMode");ne([te("function")],ee.prototype,"onMessage");ne([te("function")],ee.prototype,"onClearMessages");ne([te("function")],ee.prototype,"onComponentRender");ne([te("function")],ee.prototype,"onInput");ne([te("function")],ee.prototype,"onError");ne([te("object")],ee.prototype,"demo");ne([te("object")],ee.prototype,"_insertKeyViewStyles");customElements.define("deep-chat",ee);const Ff="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Ebene_1'%20data-name='Ebene%201'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20314.6457%20314.6457'%3e%3cpath%20d='M154.6988,312.7649C15.7605,269.2769,1.4766,105.0702.0081,71.7664c-.1559-3.5354,1.938-6.7841,5.2624-8.1581L153.9777,2.1453c2.139-.8841,4.5512-.8841,6.6903,0l148.7071,61.4631c3.3244,1.374,5.4182,4.6227,5.2624,8.1581-1.4685,33.3036-15.7523,197.5104-154.6907,240.9984-1.6985.5316-3.5495.5316-5.248,0h0Z'%20fill='%23002b53'/%3e%3cg%3e%3cpath%20d='M158.9429,217.83l35.7915,35.7915c.8926.8926.8926,2.3419,0,3.2345l-35.7915,35.7915c-.8926.8926-2.3419.8926-3.2345,0l-36.398-36.398c-.5578-.5578-.5578-1.4637,0-2.0216l36.398-36.398c.8926-.8926,2.3419-.8926,3.2345,0h0Z'%20fill='%23f8ae4e'/%3e%3cpath%20d='M274.4005,177.1874l-9.7408,9.7408-104.8815-104.8814c-1.3471-1.3471-3.5311-1.3471-4.8782,0l-104.8962,104.8962-9.7586-9.7586c-10.7768-10.7767-10.7768-28.2493,0-39.0261L154.8822,23.5214c1.3471-1.3471,3.5311-1.3471,4.8782,0l114.64,114.64c10.7768,10.7767,10.7768,28.2493,0,39.0261h.0001Z'%20fill='%2379bd6f'/%3e%3cpath%20d='M230.4944,221.0845l-14.6352,14.6352-56.0902-56.0901c-1.3471-1.3471-3.5311-1.3471-4.8782,0l-56.1073,56.1073-14.6361-14.6361c-8.0826-8.0826-8.0826-21.187,0-29.2696l70.7425-70.7425c1.3471-1.3471,3.5311-1.3471,4.8782,0l70.7262,70.7262c8.0826,8.0826,8.0826,21.187,0,29.2696h0Z'%20fill='%23d1d834'/%3e%3c/g%3e%3c/svg%3e",Vt=[];function Tt(a,s=Xe){let t;const e=new Set;function n(o){if(sr(a,o)&&(a=o,t)){const l=!Vt.length;for(const u of e)u[1](),Vt.push(u,a);if(l){for(let u=0;u<Vt.length;u+=2)Vt[u][0](Vt[u+1]);Vt.length=0}}}function r(o){n(o(a))}function i(o,l=Xe){const u=[o,l];return e.add(u),e.size===1&&(t=s(n,r)||Xe),o(a),()=>{e.delete(u),e.size===0&&t&&(t(),t=null)}}return{set:n,update:r,subscribe:i}}const Un=Tt(""),jn=Tt(""),Hn=Tt([]),qn=Tt([]),Vn=Tt(null),Kn=Tt([]),ar=Tt(!1),W={log:(...a)=>{},error:(...a)=>{},warn:(...a)=>{},info:(...a)=>{},debug:(...a)=>{},group:(a,...s)=>{},groupEnd:()=>{},table:a=>{}},Kt="assistant",di="user",Rr="ai",lt="feedback";function Df(a){let s,t,e,n,r,i,o,l,u,c,d,h,f,v,p,b,w,T,A,x,L,N,H,q,K,J,V,j,ve,re,Ee;return{c(){s=Ve("div"),t=Ve("div"),e=Ve("img"),r=Qt(),i=Ve("h3"),o=yi(a[1]),l=Qt(),u=Ve("div"),c=Ve("button"),d=_t("svg"),h=_t("path"),p=Qt(),b=Ve("button"),w=_t("svg"),T=_t("path"),A=_t("polyline"),x=_t("line"),q=Qt(),K=Ve("button"),J=_t("svg"),V=_t("path"),xr(e.src,n=a[0])||F(e,"src",n),F(e,"alt","Headwai Chat Bubble"),F(e,"class","chat-header-icon svelte-1dl0fot"),F(i,"class","chat-title svelte-1dl0fot"),$t(i,"font-family",a[2]),F(h,"d","M12 5V19M5 12H19"),F(h,"stroke","currentColor"),F(h,"stroke-width","2"),F(h,"stroke-linecap","round"),F(h,"stroke-linejoin","round"),F(d,"width","16"),F(d,"height","16"),F(d,"viewBox","0 0 24 24"),F(d,"fill","none"),F(d,"xmlns","http://www.w3.org/2000/svg"),F(c,"class","chat-new-button svelte-1dl0fot"),F(c,"aria-label",f=a[5]("chat.header.newChat")),F(c,"title",v=a[5]("chat.header.newChat")),F(T,"d","M21 15V19A2 2 0 0 1 19 21H5A2 2 0 0 1 3 19V15"),F(T,"stroke","currentColor"),F(T,"stroke-width","2"),F(T,"stroke-linecap","round"),F(T,"stroke-linejoin","round"),F(A,"points","7,10 12,15 17,10"),F(A,"stroke","currentColor"),F(A,"stroke-width","2"),F(A,"stroke-linecap","round"),F(A,"stroke-linejoin","round"),F(x,"x1","12"),F(x,"y1","15"),F(x,"x2","12"),F(x,"y2","3"),F(x,"stroke","currentColor"),F(x,"stroke-width","2"),F(x,"stroke-linecap","round"),F(x,"stroke-linejoin","round"),F(w,"width","16"),F(w,"height","16"),F(w,"viewBox","0 0 24 24"),F(w,"fill","none"),F(w,"xmlns","http://www.w3.org/2000/svg"),F(b,"class","chat-download-button svelte-1dl0fot"),F(b,"aria-label",L=a[5]("chat.header.downloadHistory")),F(b,"title",N=a[5]("chat.header.downloadHistory")),b.disabled=H=!a[4]||a[6].length===0,F(V,"d","M18 6L6 18M6 6L18 18"),F(V,"stroke","currentColor"),F(V,"stroke-width","2"),F(V,"stroke-linecap","round"),F(V,"stroke-linejoin","round"),F(J,"width","16"),F(J,"height","16"),F(J,"viewBox","0 0 24 24"),F(J,"fill","none"),F(J,"xmlns","http://www.w3.org/2000/svg"),F(K,"class","chat-close-button svelte-1dl0fot"),F(K,"aria-label",j=a[5]("chat.header.closeChat")),F(K,"title",ve=a[5]("chat.header.closeChat")),F(u,"class","chat-header-buttons svelte-1dl0fot"),F(t,"class","chat-header-content svelte-1dl0fot"),F(s,"class","chat-header svelte-1dl0fot"),$t(s,"background",a[3])},m($,fe){ir($,s,fe),Se(s,t),Se(t,e),Se(t,r),Se(t,i),Se(i,o),Se(t,l),Se(t,u),Se(u,c),Se(c,d),Se(d,h),Se(u,p),Se(u,b),Se(b,w),Se(w,T),Se(w,A),Se(w,x),Se(u,q),Se(u,K),Se(K,J),Se(J,V),re||(Ee=[wt(c,"click",a[9]),wt(c,"keydown",a[13]),wt(b,"click",a[10]),wt(b,"keydown",a[14]),wt(K,"click",a[8]),wt(K,"keydown",a[15])],re=!0)},p($,[fe]){fe&1&&!xr(e.src,n=$[0])&&F(e,"src",n),fe&2&&ol(o,$[1]),fe&4&&$t(i,"font-family",$[2]),fe&32&&f!==(f=$[5]("chat.header.newChat"))&&F(c,"aria-label",f),fe&32&&v!==(v=$[5]("chat.header.newChat"))&&F(c,"title",v),fe&32&&L!==(L=$[5]("chat.header.downloadHistory"))&&F(b,"aria-label",L),fe&32&&N!==(N=$[5]("chat.header.downloadHistory"))&&F(b,"title",N),fe&80&&H!==(H=!$[4]||$[6].length===0)&&(b.disabled=H),fe&32&&j!==(j=$[5]("chat.header.closeChat"))&&F(K,"aria-label",j),fe&32&&ve!==(ve=$[5]("chat.header.closeChat"))&&F(K,"title",ve),fe&8&&$t(s,"background",$[3])},i:Xe,o:Xe,d($){$&&on(s),re=!1,Dt(Ee)}}}function Uf(a,s,t){let e,n,r;Je(a,Vn,A=>t(4,e=A)),Je(a,Kn,A=>t(6,r=A));let{iconPath:i}=s,{chatTitle:o}=s,{fontFamily:l}=s,{chatHeaderBackground:u}=s,{initialHistory:c}=s,{deepChatRef:d}=s;const h=_i("i18n");Je(a,h,A=>t(5,n=A));function f(){ar.set(!1)}function v(){Vn.set(null),Kn.set([]),qn.set([]),jn.set(""),Un.set(""),Hn.set([]),d&&(d.clearMessages(),d.addMessage(c[0],!1))}function p(){if(!e||d.getMessages().length===0)return;let A=`Chat ID: ${e}
|
|
225
|
+
*/.hljs{background:#2b2b2b;color:#f8f8f2}.hljs-comment,.hljs-quote{color:#d4d0ab}.hljs-deletion,.hljs-name,.hljs-regexp,.hljs-selector-class,.hljs-selector-id,.hljs-tag,.hljs-template-variable,.hljs-variable{color:#ffa07a}.hljs-built_in,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-type{color:#f5ab35}.hljs-attribute{color:gold}.hljs-addition,.hljs-bullet,.hljs-string,.hljs-symbol{color:#abe338}.hljs-section,.hljs-title{color:#00e0e0}.hljs-keyword,.hljs-selector-tag{color:#dcc6e0}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}@media screen and (-ms-high-contrast:active){.hljs-addition,.hljs-attribute,.hljs-built_in,.hljs-bullet,.hljs-comment,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-quote,.hljs-string,.hljs-symbol,.hljs-type{color:highlight}.hljs-keyword,.hljs-selector-tag{font-weight:700}}#messages{overflow:auto;overflow-anchor:none}.outer-message-container:last-child{margin-bottom:5px}.inner-message-container{display:flex;margin-left:auto;margin-right:auto;width:calc(97.5% - 24px);max-width:100%}.message-bubble{margin-top:10px;word-wrap:break-word;width:fit-content;max-width:60%;border-radius:10px;padding:.42em .55em;height:fit-content;line-height:1.26em}.user-message-text{color:#fff;background-color:#0084ff;margin-right:0;margin-left:auto}.ai-message-text{color:#000;background-color:#e4e6eb;margin-left:0;margin-right:auto}.deep-chat-last-group-messages-active{height:100%}.loading-history-message-full-view{position:absolute;height:70%;width:100%;display:flex;align-items:center}.loading-history-message-small{height:20px;margin-bottom:30px}.loading-history-message-small>div>div{scale:.6}.loading-history-message{margin-top:0;width:100%;max-width:100%;display:flex;justify-content:center;background-color:unset}.loading-history{width:70px}.loading-history div{position:absolute;width:var(--loading-history-width);height:var(--loading-history-height);margin:var(--loading-history-margin);border:var(--loading-history-border);border-radius:50%;animation:loading-spinner 1.2s cubic-bezier(.5,0,.5,1) infinite;border-color:var(--loading-history-color) transparent transparent transparent}.loading-history div:nth-child(1){animation-delay:-.45s}.loading-history div:nth-child(2){animation-delay:-.3s}.loading-history div:nth-child(3){animation-delay:-.15s}.html-message{max-width:unset}.error-message-text{margin:14px auto 10px;background-color:#f4c0c0;color:#474747;text-align:center;max-width:95%}.deep-chat-loading-message-dots-container{width:1em;padding:.6em .75em .6em 1.3em}.loading-message-dots{position:relative;width:.45em;height:.45em;border-radius:5px;background-color:var(--loading-message-color);color:var(--loading-message-color);animation:loading-message-dots 1s infinite linear alternate;animation-delay:.5s}.loading-message-dots:before,.loading-message-dots:after{content:"";display:inline-block;position:absolute;top:0}.loading-message-dots:before{left:-.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--loading-message-color);color:var(--loading-message-color);animation:loading-message-dots 1s infinite alternate;animation-delay:0s}.loading-message-dots:after{left:.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--loading-message-color);color:var(--loading-message-color);animation:loading-message-dots 1s infinite alternate;animation-delay:1s}@keyframes loading-message-dots{0%{background-color:var(--loading-message-color)}50%,to{background-color:var(--loading-message-color-fade)}}.message-bubble>p:first-child,.message-bubble>.partial-render-message>p:first-child,.html-wrapper>p:first-child{margin-top:0}.message-bubble>p:last-child,.message-bubble>.partial-render-message:last-child>p,.html-wrapper>p:last-child{margin-bottom:0}pre{overflow:auto;display:block;word-break:break-all;word-wrap:break-word;border-radius:7px;background:#2b2b2b;color:#f8f8f2;margin-top:.8em;margin-bottom:.8em;padding:.6em;font-size:.9em;line-height:1.5em}.image-message{padding:0;display:flex;background-color:#ddd}.image-message>*,.image-message>*>*{width:100%;border-radius:8px;display:flex}.audio-message{width:60%;max-width:300px;height:2.2em;max-height:54px;padding:0;background-color:unset}.audio-player{width:100%;height:100%}.audio-player-safari{height:fit-content;width:40px}.audio-player-safari-left{float:left}.audio-player-safari-right{float:right}.any-file-message{padding:1px}.any-file-message-contents{display:flex}.any-file-message-icon-container{width:1.3em;min-width:1.3em;position:relative;border-radius:4px;margin-left:6px;margin-right:2px}.any-file-message-icon{background-color:#fff;border-radius:4px;position:absolute;width:1em;height:1.25em;padding:1px;margin-top:auto;margin-bottom:auto;top:0;bottom:0}.any-file-message-text{padding-top:5px;overflow-wrap:anywhere;padding-bottom:5px;padding-right:7px}.message-bubble>a{color:inherit}.left-item-position{margin-right:10px}.right-item-position{margin-left:10px}.role-hidden{display:none}.avatar{padding-top:5px;width:1.5em;height:1.5em;border-radius:1px}.avatar-container{margin-top:9px}.name{margin-top:16px;font-size:15px}#drag-and-drop{position:absolute;display:none;z-index:10;height:calc(100% - 10px);width:calc(100% - 10px);background-color:#70c6ff4d;border:5px dashed #6dafff}#file-attachment-container{position:absolute;height:3.6em;width:calc(80% - 4px);top:-2.5em;border-radius:5px;overflow:auto;text-align:left;background-color:#d7d7d73b;padding-left:4px}.file-attachment{width:2.85em;height:2.85em;display:inline-flex;margin-right:.6em;margin-bottom:.44em;margin-top:4px;position:relative;background-color:#fff;border-radius:5px}.image-attachment{width:100%;height:100%;object-fit:cover;border-radius:5px}.border-bound-attachment{width:calc(100% - 2px);height:calc(100% - 2px);border:1px solid #c3c3c3;border-radius:5px;overflow:hidden}.border-bound-attachment-safari{width:calc(100% - 1px);height:calc(100% - 1px)}.audio-attachment-icon-container{cursor:pointer}.audio-attachment-icon-container:hover{background-color:#f8f8f8}.attachment-icon{left:0;right:0;bottom:0;top:2px;margin:auto;position:absolute;width:25px;-webkit-user-select:none;user-select:none}.not-removable-attachment-icon{top:0;right:0;bottom:0;left:0}.play-icon{filter:brightness(0) saturate(100%) invert(17%) sepia(0%) saturate(1392%) hue-rotate(67deg) brightness(98%) contrast(97%)}.stop-icon{filter:brightness(0) saturate(100%) invert(29%) sepia(90%) saturate(1228%) hue-rotate(198deg) brightness(93%) contrast(98%)}.audio-placeholder-text-3-digits{padding-left:.26rem}.audio-placeholder-text-4-digits{padding-left:.1rem}.any-file-attachment{padding:2px 0}.file-attachment-text-container{position:absolute;width:inherit;display:flex;align-items:center;height:100%;top:-1px}.audio-placeholder-text-3-digits-container{padding-top:1px;cursor:default}.any-file-attachment-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding-left:.13em;margin-left:auto;margin-right:auto}.remove-file-attachment-button{height:1.25em;width:1.25em;border:1px solid #cfcfcf;border-radius:25px;background-color:#fff;top:-4px;right:-5px;position:absolute;display:flex;justify-content:center;cursor:pointer;-webkit-user-select:none;user-select:none}.remove-file-attachment-button:hover{background-color:#e4e4e4}.remove-file-attachment-button:active{background-color:#d7d7d7}.x-icon{color:#4e4e4e;top:-.075em;position:relative;font-size:1.05em}.modal{display:none;flex-direction:column;align-items:center;justify-content:center;position:absolute;width:80%;max-width:420px;max-height:80%;margin:auto;top:0;right:0;bottom:0;left:0;z-index:3}.modal-content{border-top:1px solid rgb(217,217,217);border-left:1px solid rgb(217,217,217);border-right:1px solid rgb(217,217,217);border-top-left-radius:inherit;border-top-right-radius:inherit;background-color:#fff;overflow-y:auto;height:fit-content;max-height:calc(100% - 3.3em);width:100%}.modal-content>p{margin-left:1em;margin-right:1em}.modal-content>ul{margin-right:1em}.modal-button-panel{height:3.3em;border:1px solid;border-color:rgb(223,223,223) rgb(217,217,217) rgb(217,217,217);border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;background-color:#fff;text-align:center;justify-content:center;display:flex;width:100%}.modal-button{min-width:2.5em;text-align:center;color:#fff;border-radius:5px;padding:.4em .4em .3em;height:1.25em;background-color:#3279b2;top:0;bottom:0;cursor:pointer;-webkit-user-select:none;user-select:none;margin:auto .31em}.modal-button:hover{background-color:#276da7}.modal-button:active{background-color:#1b5687}.modal-svg-button{padding:0 0 2px;width:2em;height:1.8em}.modal-svg-button-icon{width:100%;height:100%;filter:brightness(0) saturate(100%) invert(100%) sepia(15%) saturate(4%) hue-rotate(346deg) brightness(101%) contrast(102%)}#modal-background-panel{position:absolute;width:100%;height:100%;background-color:#00000042;z-index:2;display:none}.show-modal-background{animation:fadeInBackground .3s ease-in-out}@keyframes fadeInBackground{0%{opacity:0}to{opacity:1}}.show-modal{animation:fadeInModal .3s ease-in-out}@keyframes fadeInModal{0%{opacity:0;scale:.95}to{opacity:1;scale:1}}.hide-modal-background{animation:fadeOutBackground .2s ease-in-out}@keyframes fadeOutBackground{0%{opacity:1}to{opacity:0}}.hide-modal{animation:fadeOutModal .2s ease-in-out}@keyframes fadeOutModal{0%{opacity:1;scale:1}to{opacity:0;scale:.95}}.modal-camera-content{overflow:hidden;text-align:center;border:unset;height:100%;background-color:#2a2a2a;display:flex;justify-content:center}.camera-modal-canvas{max-width:100%;max-height:100%;margin-top:auto;margin-bottom:auto}.modal-svg-submit-button{background-color:green}.modal-svg-submit-button:hover{background-color:#007500}.modal-svg-submit-button:active{background-color:#006500}.modal-svg-submit-disabled{pointer-events:none;background-color:#747474}.modal-svg-close-button{height:1.56em;padding-top:.37em;padding-bottom:0;background-color:#c13e3e}.modal-svg-close-button:hover{background-color:#b43434}.modal-svg-close-button:active{background-color:#972929}.modal-svg-close-icon{width:80%;height:80%}.modal-svg-camera-button{height:1.6em;padding-top:.38em;padding-bottom:0}.modal-svg-camera-icon{height:76%}.modal-svg-refresh-icon{height:105%}.modal-svg-refresh-button{height:1.66em;padding-top:.11em;padding-bottom:.21em}.input-button-container{position:relative;z-index:1}.inside-right{position:absolute;right:calc(10% + .35em);bottom:.85em}.inside-left{position:absolute;left:calc(10% + .35em);bottom:.85em}.outside-left{position:absolute;right:calc(11px - .55em);bottom:.88em}.outside-right{position:absolute;left:calc(11px - .55em);bottom:.88em}#upload-images-icon{position:absolute;pointer-events:none;width:1.45em;height:1.45em;left:.11em;bottom:.08em;filter:brightness(0) saturate(100%) invert(43%) sepia(0%) saturate(740%) hue-rotate(77deg) brightness(99%) contrast(92%)}#upload-gifs-icon{position:absolute;pointer-events:none;width:1.5em;height:1.48em;left:.07em;bottom:.08em;filter:brightness(0) saturate(100%) invert(49%) sepia(0%) saturate(2586%) hue-rotate(12deg) brightness(93%) contrast(90%)}#upload-audio-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.17em;bottom:.2em;filter:brightness(0) saturate(100%) invert(15%) sepia(0%) saturate(337%) hue-rotate(125deg) brightness(91%) contrast(94%);transform:scaleX(.95)}#camera-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.23em;bottom:.2em;filter:brightness(0) saturate(100%) invert(52%) sepia(0%) saturate(161%) hue-rotate(164deg) brightness(91%) contrast(92%);transform:scaleX(.95)}#upload-mixed-files-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.25em;bottom:.2em;filter:brightness(0) saturate(100%) invert(53%) sepia(0%) saturate(36%) hue-rotate(74deg) brightness(98%) contrast(93%);transform:scaleX(.95)}#interim-text{color:gray}#microphone-button{padding-top:.5px}.outer-button-container>#microphone-button{padding-bottom:1px}#microphone-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.25em;bottom:.25em}.default-microphone-icon{filter:brightness(0) saturate(100%) invert(32%) sepia(0%) saturate(924%) hue-rotate(46deg) brightness(95%) contrast(99%)}.active-microphone-icon{filter:brightness(0) saturate(100%) invert(10%) sepia(97%) saturate(7495%) hue-rotate(0deg) brightness(101%) contrast(107%);border-radius:10px}.command-microphone-icon{filter:brightness(0) saturate(100%) invert(42%) sepia(96%) saturate(1067%) hue-rotate(77deg) brightness(99%) contrast(102%)}.unsupported-microphone{display:none}#submit-icon{height:100%;filter:brightness(0) saturate(100%) invert(32%) sepia(0%) saturate(924%) hue-rotate(46deg) brightness(95%) contrast(99%);width:1.21em}#stop-icon{background-color:#acacac;position:absolute;width:.95em;height:.95em;left:.35em;bottom:.35em;border-radius:2px}.submit-button-enlarged{scale:1.1;margin-right:.3em;margin-left:.3em}.loading-submit-button{position:relative;left:calc(-9990px + .275em);width:.22em;height:.22em;border-radius:5px;background-color:#848484;color:#848484;box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484;animation:loading-submit-button 1.5s infinite linear;bottom:-.75em}@keyframes loading-submit-button{0%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}16.667%{box-shadow:9990px -6px #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}33.333%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}50%{box-shadow:9990px 0 #848484,calc(9990px + .44em) -6px 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}66.667%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}83.333%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) -6px 0 0 #848484}to{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}}.tooltip{position:absolute;visibility:hidden;z-index:1;pointer-events:none;padding:5px 7px;background-color:#333;border-radius:5px;width:max-content}.tooltip-text{color:#fff;font-size:13px}.input-button{border-radius:4px;cursor:pointer;margin-bottom:.2em;-webkit-user-select:none;user-select:none}.input-button-svg{width:1.65em;height:1.65em}.input-button-svg-text{padding:1px;height:1.65em;display:flex}.input-button-svg-text>svg{padding:.22rem}.input-button-svg-text>div{margin-left:2px}.input-button:hover,.input-button:focus-visible{background-color:#9c9c9c2e}.input-button:active{background-color:#9c9c9c5e}.input-button:active:not(:hover){background-color:transparent}.loading-button{cursor:auto}.loading-button:hover{background-color:unset}.text-button{filter:unset!important;display:flex;justify-content:center;align-items:center;margin-left:4px;margin-right:4px;height:1.6em;width:max-content}#custom-icon{height:100%;width:1.2em}.custom-button-container-default{color:#505050}.custom-button-container-default>.dropup-menu-item-icon{color:unset}.custom-button-container-default>svg{filter:brightness(0) saturate(100%) invert(39%) sepia(1%) saturate(0%) hue-rotate(83deg) brightness(93%) contrast(90%)}.custom-button-container-default>.dropup-menu-item-icon>svg{position:absolute;left:.2em}.custom-button-container-active{background-color:#edf7ff;color:#0285ff}.custom-button-container-active:hover,.custom-button-container-active:focus-visible{background-color:#def0ff}.custom-button-container-active:active{background-color:#d2eaff}.custom-button-container-active>svg{filter:brightness(0) saturate(100%) invert(32%) sepia(34%) saturate(4196%) hue-rotate(196deg) brightness(107%) contrast(104%)}.custom-button-container-disabled{color:#aeaeae;cursor:auto}.custom-button-container-disabled>div{pointer-events:none}.custom-button-container-disabled:hover,.custom-button-container-disabled:focus-visible{background-color:transparent}.custom-button-container-disabled:active{background-color:transparent}.custom-button-container-disabled>svg{filter:brightness(0) saturate(100%) invert(67%) sepia(0%) saturate(818%) hue-rotate(28deg) brightness(102%) contrast(100%)}#text-input-container{background-color:#fff;width:80%;display:flex;border:1px solid #0000001a;border-radius:5px;margin-top:.8em;margin-bottom:.8em;box-shadow:#959da533 0 1px 12px;overflow-y:auto;max-height:200px;position:relative}.text-input-container-left-adjustment{margin-left:1.5em}.text-input-container-right-adjustment{margin-right:1.5em}.text-input-container-left-small-adjustment{margin-left:1.1em}.text-input-container-left-small-adjustment>.outside-left{right:calc(14px - .55em)}.text-input-container-right-small-adjustment{margin-right:1.1em}.text-input-container-right-small-adjustment>.outside-right{left:calc(14px - .55em)}#text-input{text-align:left;outline:none;word-wrap:break-word;line-break:auto}.text-input-styling{padding:.4em .5em;overflow:overlay;width:100%}.text-input-inner-left-adjustment{padding-left:2.2em}.text-input-inner-right-adjustment{padding-right:2em}.text-input-disabled{pointer-events:none;-webkit-user-select:none;user-select:none}[contenteditable]:empty:before{content:attr(deep-chat-placeholder-text);pointer-events:none}[contenteditable][textcolor]:empty:before{color:gray}.outside-right>#dropup-menu,.inside-right>#dropup-menu{right:0}#dropup-icon{position:absolute;pointer-events:none;width:1.16em;height:1.2em;left:.265em;bottom:.43em;filter:brightness(0) saturate(100%) invert(54%) sepia(0%) saturate(724%) hue-rotate(6deg) brightness(92%) contrast(90%)}.dropup-button>*{pointer-events:none}#dropup-menu{background-color:#fff;position:absolute;transform:translateY(-100%);border-radius:5px;z-index:1;top:-.49em;box-shadow:#0003 -1px 2px 10px,#0000001a 0 2px 4px;cursor:pointer;-webkit-user-select:none;user-select:none}.dropup-menu-item{height:1.4em;padding:.28em .84em .28em .35em;display:flex;position:relative}.dropup-menu-item:hover,.dropup-menu-item:focus-visible{background-color:#f3f3f3}.dropup-menu-item:active{background-color:#ebebeb}.dropup-menu-item:active:not(:hover){background-color:transparent}.dropup-menu-item:first-child{padding-top:.49em;border-top-left-radius:inherit;border-top-right-radius:inherit}.dropup-menu-item:last-child{padding-bottom:.45em;border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.dropup-menu-item-icon{width:1.39em;position:relative}.dropup-menu-item-icon>svg{bottom:0!important;top:0!important;margin-bottom:auto;margin-top:auto}#dropup-menu-item-icon-element-custom{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.28em;filter:brightness(0) saturate(100%) invert(15%) sepia(0%) saturate(337%) hue-rotate(125deg) brightness(91%) contrast(94%)}.dropup-menu-item-text{margin-left:.56em;margin-top:.08em;width:max-content}#input{width:100%;display:inline-flex;text-align:center;margin-left:auto;margin-right:auto;margin-top:auto;position:relative;justify-content:center}#chat-view{height:100%;display:grid;grid-template-columns:100%}::-webkit-scrollbar{width:9px;height:9px}::-webkit-scrollbar-thumb{background-color:#d0d0d0;border-radius:5px}::-webkit-scrollbar-track{background-color:#f2f2f2}.deep-chat-web-model-button{margin-top:10px;margin-bottom:5px;margin-left:1px}:host{all:initial;display:table-cell}#container{height:inherit;width:inherit;overflow:hidden}`,Nf=Object.defineProperty,ne=function(s,t,e,n){for(var r=void 0,i=s.length-1,o;i>=0;i--)(o=s[i])&&(r=o(t,e,r)||r);return r&&Nf(t,e,r),r},ee=function(a){function s(){var t;C(this,s);var e;return t=D(this,s),t.getMessages=function(){return[]},t.submitUserMessage=function(){return console.warn("submitUserMessage failed - please wait for chat view to render before calling this property.")},t.addMessage=function(){return console.warn("addMessage failed - please wait for chat view to render before calling this property.")},t.updateMessage=function(){},t.clearMessages=function(){},t.focusInput=function(){return $n.focusFromParentElement(t._elementRef)},t.refreshMessages=function(){},t.scrollToBottom=function(){},t.disableSubmitButton=function(){},t.setPlaceholderText=function(){},t._hasBeenRendered=!1,t._auxiliaryStyleApplied=!1,t._elementRef=P(),t._elementRef.id="container",t.attachShadow({mode:"open"}).appendChild(t._elementRef),(e=t.shadowRoot)==null||e.appendChild(gt.buildElement()),ta.apply(Lf,t.shadowRoot),setTimeout(function(){t._hasBeenRendered||t.onRender()},20),t}return U(s,a),E(s,[{key:"changeToChatView",value:function(){this._activeService&&(this._activeService.validateKeyProperty=!1),this.onRender()}},{key:"onRender",value:function(){var e;Ci.attemptAppendStyleSheetToHead(this.style),De.processConnect(this),(!this._activeService||this._activeService.demo)&&(this._activeService=Uh.create(this)),this.auxiliaryStyle&&!this._auxiliaryStyleApplied&&(ta.apply(this.auxiliaryStyle,this.shadowRoot),this._auxiliaryStyleApplied=!0),ta.applyDefaultStyleToComponent(this.style,this.chatStyle),De.checkForContainerStyles(this,this._elementRef),this._activeService.key&&this._activeService.validateKeyProperty?Ml.render(this._elementRef,this.changeToChatView.bind(this),this._activeService):!(this._activeService instanceof Y)||this._activeService.key?((e=this._childElement)!==null&&e!==void 0||(this._childElement=this.children[0]),Bf.render(this,this._elementRef,this._activeService,this._childElement)):this._activeService instanceof Y&&zc.render(this._elementRef,this.changeToChatView.bind(this),this._activeService),this._hasBeenRendered||Ft.onRender(this),this._hasBeenRendered=!0}},{key:"disconnectedCallback",value:function(){Xa.chat=void 0}}])}(Uc);ne([te("object")],ee.prototype,"connect");ne([te("object")],ee.prototype,"directConnection");ne([te("object")],ee.prototype,"webModel");ne([te("object")],ee.prototype,"requestBodyLimits");ne([te("function")],ee.prototype,"requestInterceptor");ne([te("function")],ee.prototype,"responseInterceptor");ne([te("function")],ee.prototype,"validateInput");ne([te("function")],ee.prototype,"loadHistory");ne([te("object")],ee.prototype,"chatStyle");ne([te("object")],ee.prototype,"attachmentContainerStyle");ne([te("object")],ee.prototype,"dropupStyles");ne([te("object")],ee.prototype,"inputAreaStyle");ne([te("object")],ee.prototype,"textInput");ne([te("object")],ee.prototype,"submitButtonStyles");ne([te("object")],ee.prototype,"customButtons");ne([te("string")],ee.prototype,"auxiliaryStyle");ne([te("array")],ee.prototype,"history");ne([te("object")],ee.prototype,"browserStorage");ne([te("object")],ee.prototype,"introMessage");ne([te("object")],ee.prototype,"avatars");ne([te("object")],ee.prototype,"names");ne([te("object")],ee.prototype,"displayLoadingBubble");ne([te("object")],ee.prototype,"errorMessages");ne([te("object")],ee.prototype,"messageStyles");ne([te("object")],ee.prototype,"textToSpeech");ne([te("object")],ee.prototype,"speechToText");ne([te("object")],ee.prototype,"images");ne([te("object")],ee.prototype,"gifs");ne([te("object")],ee.prototype,"camera");ne([te("object")],ee.prototype,"audio");ne([te("object")],ee.prototype,"microphone");ne([te("object")],ee.prototype,"mixedFiles");ne([te("object")],ee.prototype,"dragAndDrop");ne([te("object")],ee.prototype,"htmlWrappers");ne([te("object")],ee.prototype,"htmlClassUtilities");ne([te("object")],ee.prototype,"remarkable");ne([te("object")],ee.prototype,"focusMode");ne([te("function")],ee.prototype,"onMessage");ne([te("function")],ee.prototype,"onClearMessages");ne([te("function")],ee.prototype,"onComponentRender");ne([te("function")],ee.prototype,"onInput");ne([te("function")],ee.prototype,"onError");ne([te("object")],ee.prototype,"demo");ne([te("object")],ee.prototype,"_insertKeyViewStyles");customElements.define("deep-chat",ee);const Ff="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Ebene_1'%20data-name='Ebene%201'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20314.6457%20314.6457'%3e%3cpath%20d='M154.6988,312.7649C15.7605,269.2769,1.4766,105.0702.0081,71.7664c-.1559-3.5354,1.938-6.7841,5.2624-8.1581L153.9777,2.1453c2.139-.8841,4.5512-.8841,6.6903,0l148.7071,61.4631c3.3244,1.374,5.4182,4.6227,5.2624,8.1581-1.4685,33.3036-15.7523,197.5104-154.6907,240.9984-1.6985.5316-3.5495.5316-5.248,0h0Z'%20fill='%23002b53'/%3e%3cg%3e%3cpath%20d='M158.9429,217.83l35.7915,35.7915c.8926.8926.8926,2.3419,0,3.2345l-35.7915,35.7915c-.8926.8926-2.3419.8926-3.2345,0l-36.398-36.398c-.5578-.5578-.5578-1.4637,0-2.0216l36.398-36.398c.8926-.8926,2.3419-.8926,3.2345,0h0Z'%20fill='%23f8ae4e'/%3e%3cpath%20d='M274.4005,177.1874l-9.7408,9.7408-104.8815-104.8814c-1.3471-1.3471-3.5311-1.3471-4.8782,0l-104.8962,104.8962-9.7586-9.7586c-10.7768-10.7767-10.7768-28.2493,0-39.0261L154.8822,23.5214c1.3471-1.3471,3.5311-1.3471,4.8782,0l114.64,114.64c10.7768,10.7767,10.7768,28.2493,0,39.0261h.0001Z'%20fill='%2379bd6f'/%3e%3cpath%20d='M230.4944,221.0845l-14.6352,14.6352-56.0902-56.0901c-1.3471-1.3471-3.5311-1.3471-4.8782,0l-56.1073,56.1073-14.6361-14.6361c-8.0826-8.0826-8.0826-21.187,0-29.2696l70.7425-70.7425c1.3471-1.3471,3.5311-1.3471,4.8782,0l70.7262,70.7262c8.0826,8.0826,8.0826,21.187,0,29.2696h0Z'%20fill='%23d1d834'/%3e%3c/g%3e%3c/svg%3e",Vt=[];function Tt(a,s=Xe){let t;const e=new Set;function n(o){if(sr(a,o)&&(a=o,t)){const l=!Vt.length;for(const u of e)u[1](),Vt.push(u,a);if(l){for(let u=0;u<Vt.length;u+=2)Vt[u][0](Vt[u+1]);Vt.length=0}}}function r(o){n(o(a))}function i(o,l=Xe){const u=[o,l];return e.add(u),e.size===1&&(t=s(n,r)||Xe),o(a),()=>{e.delete(u),e.size===0&&t&&(t(),t=null)}}return{set:n,update:r,subscribe:i}}const Un=Tt(""),jn=Tt(""),Hn=Tt([]),qn=Tt([]),Vn=Tt(null),Kn=Tt([]),ar=Tt(!1),W={log:(...a)=>{},error:(...a)=>{},warn:(...a)=>{},info:(...a)=>{},debug:(...a)=>{},group:(a,...s)=>{},groupEnd:()=>{},table:a=>{}},Kt="assistant",di="user",Rr="ai",lt="feedback";function Df(a){let s,t,e,n,r,i,o,l,u,c,d,h,f,v,p,b,w,T,A,x,L,N,H,q,K,J,V,j,ve,re,Ee;return{c(){s=Ve("div"),t=Ve("div"),e=Ve("img"),r=Qt(),i=Ve("h3"),o=yi(a[1]),l=Qt(),u=Ve("div"),c=Ve("button"),d=_t("svg"),h=_t("path"),p=Qt(),b=Ve("button"),w=_t("svg"),T=_t("path"),A=_t("polyline"),x=_t("line"),q=Qt(),K=Ve("button"),J=_t("svg"),V=_t("path"),xr(e.src,n=a[0])||F(e,"src",n),F(e,"alt","Headwai Chat Bubble"),F(e,"class","chat-header-icon svelte-17nh75y"),F(i,"class","chat-title svelte-17nh75y"),$t(i,"font-family",a[2]),F(h,"d","M12 5V19M5 12H19"),F(h,"stroke","currentColor"),F(h,"stroke-width","2"),F(h,"stroke-linecap","round"),F(h,"stroke-linejoin","round"),F(d,"width","16"),F(d,"height","16"),F(d,"viewBox","0 0 24 24"),F(d,"fill","none"),F(d,"xmlns","http://www.w3.org/2000/svg"),F(c,"class","chat-new-button svelte-17nh75y"),F(c,"aria-label",f=a[5]("chat.header.newChat")),F(c,"title",v=a[5]("chat.header.newChat")),F(T,"d","M21 15V19A2 2 0 0 1 19 21H5A2 2 0 0 1 3 19V15"),F(T,"stroke","currentColor"),F(T,"stroke-width","2"),F(T,"stroke-linecap","round"),F(T,"stroke-linejoin","round"),F(A,"points","7,10 12,15 17,10"),F(A,"stroke","currentColor"),F(A,"stroke-width","2"),F(A,"stroke-linecap","round"),F(A,"stroke-linejoin","round"),F(x,"x1","12"),F(x,"y1","15"),F(x,"x2","12"),F(x,"y2","3"),F(x,"stroke","currentColor"),F(x,"stroke-width","2"),F(x,"stroke-linecap","round"),F(x,"stroke-linejoin","round"),F(w,"width","16"),F(w,"height","16"),F(w,"viewBox","0 0 24 24"),F(w,"fill","none"),F(w,"xmlns","http://www.w3.org/2000/svg"),F(b,"class","chat-download-button svelte-17nh75y"),F(b,"aria-label",L=a[5]("chat.header.downloadHistory")),F(b,"title",N=a[5]("chat.header.downloadHistory")),b.disabled=H=!a[4]||a[6].length===0,F(V,"d","M18 6L6 18M6 6L18 18"),F(V,"stroke","currentColor"),F(V,"stroke-width","2"),F(V,"stroke-linecap","round"),F(V,"stroke-linejoin","round"),F(J,"width","16"),F(J,"height","16"),F(J,"viewBox","0 0 24 24"),F(J,"fill","none"),F(J,"xmlns","http://www.w3.org/2000/svg"),F(K,"class","chat-close-button svelte-17nh75y"),F(K,"aria-label",j=a[5]("chat.header.closeChat")),F(K,"title",ve=a[5]("chat.header.closeChat")),F(u,"class","chat-header-buttons svelte-17nh75y"),F(t,"class","chat-header-content svelte-17nh75y"),F(s,"class","chat-header svelte-17nh75y"),$t(s,"background",a[3])},m($,fe){ir($,s,fe),Se(s,t),Se(t,e),Se(t,r),Se(t,i),Se(i,o),Se(t,l),Se(t,u),Se(u,c),Se(c,d),Se(d,h),Se(u,p),Se(u,b),Se(b,w),Se(w,T),Se(w,A),Se(w,x),Se(u,q),Se(u,K),Se(K,J),Se(J,V),re||(Ee=[wt(c,"click",a[9]),wt(c,"keydown",a[13]),wt(b,"click",a[10]),wt(b,"keydown",a[14]),wt(K,"click",a[8]),wt(K,"keydown",a[15])],re=!0)},p($,[fe]){fe&1&&!xr(e.src,n=$[0])&&F(e,"src",n),fe&2&&ol(o,$[1]),fe&4&&$t(i,"font-family",$[2]),fe&32&&f!==(f=$[5]("chat.header.newChat"))&&F(c,"aria-label",f),fe&32&&v!==(v=$[5]("chat.header.newChat"))&&F(c,"title",v),fe&32&&L!==(L=$[5]("chat.header.downloadHistory"))&&F(b,"aria-label",L),fe&32&&N!==(N=$[5]("chat.header.downloadHistory"))&&F(b,"title",N),fe&80&&H!==(H=!$[4]||$[6].length===0)&&(b.disabled=H),fe&32&&j!==(j=$[5]("chat.header.closeChat"))&&F(K,"aria-label",j),fe&32&&ve!==(ve=$[5]("chat.header.closeChat"))&&F(K,"title",ve),fe&8&&$t(s,"background",$[3])},i:Xe,o:Xe,d($){$&&on(s),re=!1,Dt(Ee)}}}function Uf(a,s,t){let e,n,r;Je(a,Vn,A=>t(4,e=A)),Je(a,Kn,A=>t(6,r=A));let{iconPath:i}=s,{chatTitle:o}=s,{fontFamily:l}=s,{chatHeaderBackground:u}=s,{initialHistory:c}=s,{deepChatRef:d}=s;const h=_i("i18n");Je(a,h,A=>t(5,n=A));function f(){ar.set(!1)}function v(){Vn.set(null),Kn.set([]),qn.set([]),jn.set(""),Un.set(""),Hn.set([]),d&&(d.clearMessages(),d.addMessage(c[0],!1))}function p(){if(!e||d.getMessages().length===0)return;let A=`Chat ID: ${e}
|
|
226
226
|
|
|
227
227
|
`;d.getMessages().forEach(H=>{if(W.log("Processing message for download:",H),H.role!==lt){const q=H.role.toUpperCase();if(W.log(`Adding ${q} message to download content`),H.custom&&H.custom.timestamp){const K=new Date(H.custom.timestamp*1e3).toLocaleString();A+=`[${K}]
|
|
228
228
|
|
|
@@ -232,7 +232,7 @@ ${H.text}
|
|
|
232
232
|
`,W.log(`Message timestamp: ${K}, content: ${A}`)}else A+=`[${q}]:
|
|
233
233
|
${H.text}
|
|
234
234
|
|
|
235
|
-
`,W.log(`Message content: ${A}`)}});const x=new Blob([A],{type:"text/plain"}),L=URL.createObjectURL(x),N=document.createElement("a");N.href=L,N.download=`chat-history-${e}.txt`,document.body.appendChild(N),N.click(),document.body.removeChild(N),URL.revokeObjectURL(L),W.log("Message history downloaded")}const b=A=>A.key==="Enter"&&v(),w=A=>A.key==="Enter"&&p(),T=A=>A.key==="Enter"&&f();return a.$$set=A=>{"iconPath"in A&&t(0,i=A.iconPath),"chatTitle"in A&&t(1,o=A.chatTitle),"fontFamily"in A&&t(2,l=A.fontFamily),"chatHeaderBackground"in A&&t(3,u=A.chatHeaderBackground),"initialHistory"in A&&t(11,c=A.initialHistory),"deepChatRef"in A&&t(12,d=A.deepChatRef)},[i,o,l,u,e,n,r,h,f,v,p,c,d,b,w,T]}class jf extends jr{constructor(s){super(),Ur(this,s,Uf,Df,sr,{iconPath:0,chatTitle:1,fontFamily:2,chatHeaderBackground:3,initialHistory:11,deepChatRef:12})}}function Hf(a){let s,t,e,n,r;return{c(){s=Ve("div"),t=Ve("img"),xr(t.src,e=a[1])||F(t,"src",e),F(t,"alt","Headwai Chat Bubble"),F(t,"class","svelte-
|
|
235
|
+
`,W.log(`Message content: ${A}`)}});const x=new Blob([A],{type:"text/plain"}),L=URL.createObjectURL(x),N=document.createElement("a");N.href=L,N.download=`chat-history-${e}.txt`,document.body.appendChild(N),N.click(),document.body.removeChild(N),URL.revokeObjectURL(L),W.log("Message history downloaded")}const b=A=>A.key==="Enter"&&v(),w=A=>A.key==="Enter"&&p(),T=A=>A.key==="Enter"&&f();return a.$$set=A=>{"iconPath"in A&&t(0,i=A.iconPath),"chatTitle"in A&&t(1,o=A.chatTitle),"fontFamily"in A&&t(2,l=A.fontFamily),"chatHeaderBackground"in A&&t(3,u=A.chatHeaderBackground),"initialHistory"in A&&t(11,c=A.initialHistory),"deepChatRef"in A&&t(12,d=A.deepChatRef)},[i,o,l,u,e,n,r,h,f,v,p,c,d,b,w,T]}class jf extends jr{constructor(s){super(),Ur(this,s,Uf,Df,sr,{iconPath:0,chatTitle:1,fontFamily:2,chatHeaderBackground:3,initialHistory:11,deepChatRef:12})}}function Hf(a){let s,t,e,n,r;return{c(){s=Ve("div"),t=Ve("img"),xr(t.src,e=a[1])||F(t,"src",e),F(t,"alt","Headwai Chat Bubble"),F(t,"class","svelte-1qxp0ze"),F(s,"class","ai-assistant-icon svelte-1qxp0ze"),$t(s,"background",a[0]),F(s,"role","button"),F(s,"tabindex","0")},m(i,o){ir(i,s,o),Se(s,t),n||(r=[wt(s,"click",a[2]),wt(s,"keydown",a[3])],n=!0)},p(i,[o]){o&2&&!xr(t.src,e=i[1])&&F(t,"src",e),o&1&&$t(s,"background",i[0])},i:Xe,o:Xe,d(i){i&&on(s),n=!1,Dt(r)}}}function qf(a,s,t){let e;Je(a,ar,l=>t(4,e=l));let{faviconBackgroundColor:n}=s,{iconPath:r}=s;function i(){ar.set(!e)}const o=l=>l.key==="Enter"&&i();return a.$$set=l=>{"faviconBackgroundColor"in l&&t(0,n=l.faviconBackgroundColor),"iconPath"in l&&t(1,r=l.iconPath)},[n,r,i,o]}class zf extends jr{constructor(s){super(),Ur(this,s,qf,Hf,sr,{faviconBackgroundColor:0,iconPath:1})}}function zn(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var s=Math.random()*16|0,t=a=="x"?s:s&3|8;return t.toString(16)})}function Gf(a){if(!a.sources||!Array.isArray(a.sources)||a.sources.length===0)return[];const s=a.sources[0];if(!s.metadata||!Array.isArray(s.metadata))return[];W.log("Found sources metadata:",s.metadata);const t=new Map;s.metadata.forEach((n,r)=>{if(!n||typeof n!="object")return;const i=n.title||n.name||n.filename||"",o=n.url||n.link||n.uri||"",l=n.source||n.type||"",u=JSON.stringify({title:i.trim(),url:o.trim(),source:l.trim()});!t.has(u)&&(i||o)&&t.set(u,{title:i||"Untitled",url:o,source:l,description:n.description||n.snippet||n.content||"",page:n.page||"",...n})});const e=Array.from(t.values());return W.log(`Extracted ${e.length} unique references from ${s.metadata.length} metadata items`),e}function Wf(a,s=""){if(!a||a.length===0)return"";const t=s.match(/\[(\d+)\]/g);if(!t)return"";const e=new Set;return t.forEach(r=>{const i=parseInt(r.slice(1,-1));i>0&&i<=a.length&&e.add(i-1)}),e.size===0?"":`
|
|
236
236
|
|
|
237
237
|
---
|
|
238
238
|
|
|
@@ -240,7 +240,7 @@ ${H.text}
|
|
|
240
240
|
|
|
241
241
|
${Array.from(e).sort((r,i)=>r-i).map(r=>{const o=a[r].name||"Untitled Reference";return`**[${r+1}]** ${o}`}).join(`
|
|
242
242
|
|
|
243
|
-
`)}`}function Jf(a){if(!a||typeof a!="string")return a;const s=/\n\n---\n\n\*\*References:\*\*[\s\S]*$/;return a.replace(s,"").trim()}function gr(a){if(W.group("Message History"),a.length===0){W.log("No messages in history");return}a.forEach((s,t)=>{const e=s.content||s.html||"",n=e.length>50?e.substring(0,50)+"...":e;W.log(`${t+1}. ${s.role.toUpperCase()}: ${n}`)})}class Vf{constructor(s){this.baseUrl=s}async post(s,t,e={}){try{const n=`${this.baseUrl}${s}`,r={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",...e.headers},body:JSON.stringify(t),...e};W.log(`API POST Request to ${n}`,{data:t});const i=await fetch(n,r);if(i.ok){const o=await i.json();return W.log(`API POST Success for ${s}:`,o),o}else{const o=await i.json().catch(()=>null);return W.error(`API POST Failed for ${s}:`,i.status,i.statusText,o),null}}catch{return null}}async get(s,t={}){try{const e=`${this.baseUrl}${s}`,n={method:"GET",headers:{Accept:"application/json",...t.headers},...t};W.log(`API GET Request to ${e}`);const r=await fetch(e,n);if(r.ok){const i=await r.json();return W.log(`API GET Success for ${s}:`,i),i}else{const i=await r.json().catch(()=>null);return W.error(`API GET Failed for ${s}:`,r.status,r.statusText,i),null}}catch{return null}}}function Do(a){return new Vf(a)}class Kf{constructor(s){this.client=Do(s)}async createNewChat(s,t){const e=Math.floor(Date.now()/1e3),n=[s],r=[],i={},o=zn(),l={id:o,parentId:null,childrenIds:[],role:"assistant",content:t,model:n[0],modelId:n[0],modelIdx:0,timestamp:e,models:n};r.push(l),i[o]=l;const u={assistantId:s,chat:{id:"",title:"New Chatbubble Chat",models:n,params:{},history:{messages:i,currentId:o},messages:r,tags:[],timestamp:Date.now()},folder_id:null},c=await this.client.post("/api/v1/chats/new",u);return c?{id:c.id,messages:r}:null}async storeChatHistory(s,t,e){if(!s)throw new Error("No chat ID available to store history");const n=this.filterFeedbackMessagesAndFixRelationships(e),r={};n.forEach(c=>{r[c.id]=c});const i=n.filter(c=>c.role==="assistant"),o=i[i.length-1],l={assistantId:t,chat:{models:[t],history:{messages:r,currentId:(o==null?void 0:o.id)||null},messages:n,params:{}}};return await this.client.post(`/api/v1/chats/${s}`,l)!==null}filterFeedbackMessagesAndFixRelationships(s){const e=s.filter(i=>i.role!==lt).map(i=>({...i,childrenIds:[...i.childrenIds||[]]})),n=new Map,r=new Set;return s.forEach(i=>{n.set(i.id,i),i.role===lt&&r.add(i.id)}),e.forEach(i=>{const o=[];if((i.childrenIds||[]).forEach(l=>{if(r.has(l)){const u=n.get(l);u&&u.childrenIds&&u.childrenIds.forEach(c=>{r.has(c)||o.push(c)})}else o.push(l)}),i.childrenIds=o,i.parentId&&r.has(i.parentId)){let l=n.get(i.parentId);for(;l&&r.has(l.id);)l=l.parentId?n.get(l.parentId):null;i.parentId=l?l.id:null}}),e}async updateAssistantMessageWithFeedback(s,t,e){return this.storeChatHistory(s,t,e)}}class Xf{constructor(s){this.client=Do(s)}async sendFeedback({assistantId:s,messageId:t,rating:e,chatId:n,messageHistory:r}){var d;if(!n)throw new Error("No chat ID available to send feedback");if(!r.find(h=>h.id===t))throw new Error(`Message not found in history for feedback ID: ${t}`);const o=r.findIndex(h=>h.id===t),l={assistantId:s,type:"rating",data:{rating:e,model_id:s},meta:{model_id:s,message_id:t,message_index:o,chat_id:n,base_models:{[s]:s}},snapshot:{chat:{id:n,user_id:null,title:"New Chatbubble Chat",chat:{id:"",title:"New Chatbubble Chat",models:[s],params:{},history:{messages:{},currentId:t},messages:r,params:{}},updated_at:Date.now(),created_at:Date.now(),share_id:null,archived:!1,pinned:!1,meta:{},folder_id:null}}},u={};return r.forEach(h=>{u[h.id]=h}),l.snapshot.chat.chat.history.messages=u,l.snapshot.chat.chat.history.currentId=(d=r[r.length-1])==null?void 0:d.id,await this.client.post("/api/v1/evaluations/feedback",l)}}function Zf(a){return{chats:new Kf(a),evaluations:new Xf(a)}}function Yf(a){let s,t;return{c(){s=Ve("div"),t=Ve("deep-chat"),it(t,"demo","false"),it(t,"textInput",a[3]),it(t,"messageStyles",a[4]),it(t,"history",a[1]),it(t,"connect",a[5]),it(t,"requestBodyLimits",a[6]),it(t,"requestInterceptor",a[7]),it(t,"responseInterceptor",a[8]),it(t,"onMessage",a[9]),F(s,"class","chat-content svelte-
|
|
243
|
+
`)}`}function Jf(a){if(!a||typeof a!="string")return a;const s=/\n\n---\n\n\*\*References:\*\*[\s\S]*$/;return a.replace(s,"").trim()}function gr(a){if(W.group("Message History"),a.length===0){W.log("No messages in history");return}a.forEach((s,t)=>{const e=s.content||s.html||"",n=e.length>50?e.substring(0,50)+"...":e;W.log(`${t+1}. ${s.role.toUpperCase()}: ${n}`)})}class Vf{constructor(s){this.baseUrl=s}async post(s,t,e={}){try{const n=`${this.baseUrl}${s}`,r={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",...e.headers},body:JSON.stringify(t),...e};W.log(`API POST Request to ${n}`,{data:t});const i=await fetch(n,r);if(i.ok){const o=await i.json();return W.log(`API POST Success for ${s}:`,o),o}else{const o=await i.json().catch(()=>null);return W.error(`API POST Failed for ${s}:`,i.status,i.statusText,o),null}}catch{return null}}async get(s,t={}){try{const e=`${this.baseUrl}${s}`,n={method:"GET",headers:{Accept:"application/json",...t.headers},...t};W.log(`API GET Request to ${e}`);const r=await fetch(e,n);if(r.ok){const i=await r.json();return W.log(`API GET Success for ${s}:`,i),i}else{const i=await r.json().catch(()=>null);return W.error(`API GET Failed for ${s}:`,r.status,r.statusText,i),null}}catch{return null}}}function Do(a){return new Vf(a)}class Kf{constructor(s){this.client=Do(s)}async createNewChat(s,t){const e=Math.floor(Date.now()/1e3),n=[s],r=[],i={},o=zn(),l={id:o,parentId:null,childrenIds:[],role:"assistant",content:t,model:n[0],modelId:n[0],modelIdx:0,timestamp:e,models:n};r.push(l),i[o]=l;const u={assistantId:s,chat:{id:"",title:"New Chatbubble Chat",models:n,params:{},history:{messages:i,currentId:o},messages:r,tags:[],timestamp:Date.now()},folder_id:null},c=await this.client.post("/api/v1/chats/new",u);return c?{id:c.id,messages:r}:null}async storeChatHistory(s,t,e){if(!s)throw new Error("No chat ID available to store history");const n=this.filterFeedbackMessagesAndFixRelationships(e),r={};n.forEach(c=>{r[c.id]=c});const i=n.filter(c=>c.role==="assistant"),o=i[i.length-1],l={assistantId:t,chat:{models:[t],history:{messages:r,currentId:(o==null?void 0:o.id)||null},messages:n,params:{}}};return await this.client.post(`/api/v1/chats/${s}`,l)!==null}filterFeedbackMessagesAndFixRelationships(s){const e=s.filter(i=>i.role!==lt).map(i=>({...i,childrenIds:[...i.childrenIds||[]]})),n=new Map,r=new Set;return s.forEach(i=>{n.set(i.id,i),i.role===lt&&r.add(i.id)}),e.forEach(i=>{const o=[];if((i.childrenIds||[]).forEach(l=>{if(r.has(l)){const u=n.get(l);u&&u.childrenIds&&u.childrenIds.forEach(c=>{r.has(c)||o.push(c)})}else o.push(l)}),i.childrenIds=o,i.parentId&&r.has(i.parentId)){let l=n.get(i.parentId);for(;l&&r.has(l.id);)l=l.parentId?n.get(l.parentId):null;i.parentId=l?l.id:null}}),e}async updateAssistantMessageWithFeedback(s,t,e){return this.storeChatHistory(s,t,e)}}class Xf{constructor(s){this.client=Do(s)}async sendFeedback({assistantId:s,messageId:t,rating:e,chatId:n,messageHistory:r}){var d;if(!n)throw new Error("No chat ID available to send feedback");if(!r.find(h=>h.id===t))throw new Error(`Message not found in history for feedback ID: ${t}`);const o=r.findIndex(h=>h.id===t),l={assistantId:s,type:"rating",data:{rating:e,model_id:s},meta:{model_id:s,message_id:t,message_index:o,chat_id:n,base_models:{[s]:s}},snapshot:{chat:{id:n,user_id:null,title:"New Chatbubble Chat",chat:{id:"",title:"New Chatbubble Chat",models:[s],params:{},history:{messages:{},currentId:t},messages:r,params:{}},updated_at:Date.now(),created_at:Date.now(),share_id:null,archived:!1,pinned:!1,meta:{},folder_id:null}}},u={};return r.forEach(h=>{u[h.id]=h}),l.snapshot.chat.chat.history.messages=u,l.snapshot.chat.chat.history.currentId=(d=r[r.length-1])==null?void 0:d.id,await this.client.post("/api/v1/evaluations/feedback",l)}}function Zf(a){return{chats:new Kf(a),evaluations:new Xf(a)}}function Yf(a){let s,t;return{c(){s=Ve("div"),t=Ve("deep-chat"),it(t,"demo","false"),it(t,"textInput",a[3]),it(t,"messageStyles",a[4]),it(t,"history",a[1]),it(t,"connect",a[5]),it(t,"requestBodyLimits",a[6]),it(t,"requestInterceptor",a[7]),it(t,"responseInterceptor",a[8]),it(t,"onMessage",a[9]),F(s,"class","chat-content svelte-nmr4np")},m(e,n){ir(e,s,n),Se(s,t),a[26](t)},p(e,n){n[0]&2&&it(t,"history",e[1])},i:Xe,o:Xe,d(e){e&&on(s),a[26](null)}}}function Qf(a,s,t){let e,n,r,i,o,l,u,c;Je(a,Vn,I=>t(23,e=I)),Je(a,ar,I=>t(24,n=I)),Je(a,Kn,I=>t(25,r=I)),Je(a,Hn,I=>t(28,o=I)),Je(a,jn,I=>t(29,l=I)),Je(a,Un,I=>t(30,u=I)),Je(a,qn,I=>t(31,c=I));let{deepChatRef:d}=s,{placeholderText:h}=s,{fontFamily:f}=s,{fontSize:v}=s,{userMessageBackgroundColor:p}=s,{userMessageTextColor:b}=s,{aiMessageBackgroundColor:w}=s,{aiMessageTextColor:T}=s,{feedbackMessageBackgroundColor:A}=s,{feedbackMessageTextColor:x}=s,{initialHistory:L}=s,{apiUrl:N}=s,{assistantId:H}=s,{maxMessages:q}=s;const K=Zf(N),J=_i("i18n");Je(a,J,I=>t(27,i=I));const V={placeholder:{text:h},styles:{container:{fontFamily:f,fontSize:v}}},j={default:{shared:{bubble:{fontFamily:f,fontSize:v}},user:{bubble:{backgroundColor:p,color:b}},ai:{bubble:{backgroundColor:w,color:T}},feedback:{bubble:{backgroundColor:A,color:x}}}};function ve(I){return I.map(G=>({...Yr(G),custom:{timestamp:G.timestamp||Math.floor(Date.now()/1e3)}}))}let re=L;const Ee={type:"websocket",url:`${N}/api/chat/completions`,headers:{"Content-Type":"application/json"},additionalBodyProps:{model:H,stream:!0,params:{},tool_servers:[],features:{image_generation:!1,code_interpreter:!1,web_search:!1,memory:!1},variables:{"{{USER_NAME}}":"David Schneebauer | headwAI GmbH","{{USER_LOCATION}}":"Unknown","{{CURRENT_DATETIME}}":new Date().toISOString().slice(0,19).replace("T"," "),"{{CURRENT_DATE}}":new Date().toISOString().slice(0,10),"{{CURRENT_TIME}}":new Date().toTimeString().slice(0,8),"{{CURRENT_WEEKDAY}}":new Date().toLocaleDateString("en-US",{weekday:"long"}),"{{CURRENT_TIMEZONE}}":Intl.DateTimeFormat().resolvedOptions().timeZone,"{{USER_LANGUAGE}}":"en-GB"},...e&&{chat_id:e},background_tasks:{title_generation:!0,tags_generation:!0,follow_up_generation:!1}},stream:!0},$={maxMessages:q};function fe(I){return I.map(G=>({role:G.role===Rr?Kt:G.role,content:G.text||""}))}function Z(I){return I.map(G=>(G.role===Kt&&G.content&&(G.content=Jf(G.content)),G))}function bt(I){return I.filter(G=>G.role!==lt)}function jo(I){const G=I.filter(pe=>pe.role===di);return G.length>0?G[G.length-1].content:null}function Yr(I){return I.role===lt&&I.html?{role:lt,html:I.html}:{role:I.role===Kt?Rr:I.role,text:I.content}}function Ho(I){if(c.length>0&&d){W.log("📚 Formatting and updating AI message with references");const G=Wf(c,I);return I+G}return I}function qo(){const I=r.filter(fn=>fn.role===Kt).pop();W.log("Last assistant message:",I);const G=I?I.id:zn();W.log("Using assistant message ID for feedback:",G);const pe=d.getMessages().length,be=`
|
|
244
244
|
<div class="feedback">
|
|
245
245
|
<div class="feedback-icons">
|
|
246
246
|
<span class="feedback-icon feedback-icon-positive" title="${i("chat.content.feedback.positive")}" onclick="window.handleFeedback('${G}', 'positive', '${pe}')" style="cursor: pointer;">
|
|
@@ -357,4 +357,4 @@ ${Array.from(e).sort((r,i)=>r-i).map(r=>{const o=a[r].name||"Untitled Reference"
|
|
|
357
357
|
</span>
|
|
358
358
|
</div>
|
|
359
359
|
</div>
|
|
360
|
-
`,d.updateMessage({html:be,role:lt},pe),r.forEach(Ye=>{Ye.role===lt&&Ye.associatedMessageId===I&&(Ye.html=be,Ye.feedbackType=G)}),zo()}async function Qo(I,G){if(!(!e||!G||!I||(r.forEach(be=>{be.id===I&&be.role===Kt&&(be.feedbackId=G.id,be.annotation={rating:G.data.rating})}),!r.find(be=>be.id===I))))try{await K.chats.updateAssistantMessageWithFeedback(e,H,r)?(W.log("Assistant message updated with feedback successfully"),gr(r)):W.error("Failed to update assistant message with feedback")}catch{}}typeof window<"u"&&(window.handleFeedback=Xo),bi(()=>{W.log("ChatContent mounted - checking state",{chatId:e,messageHistoryLength:r.length}),e&&r.length>0?(t(1,re=ve(r)),W.log("ChatContent mounted with existing history",re)):e||(W.log("ChatContent mounted - initializing fresh state"),Vn.set(null),Kn.set([]),qn.set([]),jn.set(""),Un.set(""),Hn.set([]),t(1,re=L))});function $o(I){Or[I?"unshift":"push"](()=>{d=I,t(0,d)})}return a.$$set=I=>{"deepChatRef"in I&&t(0,d=I.deepChatRef),"placeholderText"in I&&t(10,h=I.placeholderText),"fontFamily"in I&&t(11,f=I.fontFamily),"fontSize"in I&&t(12,v=I.fontSize),"userMessageBackgroundColor"in I&&t(13,p=I.userMessageBackgroundColor),"userMessageTextColor"in I&&t(14,b=I.userMessageTextColor),"aiMessageBackgroundColor"in I&&t(15,w=I.aiMessageBackgroundColor),"aiMessageTextColor"in I&&t(16,T=I.aiMessageTextColor),"feedbackMessageBackgroundColor"in I&&t(17,A=I.feedbackMessageBackgroundColor),"feedbackMessageTextColor"in I&&t(18,x=I.feedbackMessageTextColor),"initialHistory"in I&&t(19,L=I.initialHistory),"apiUrl"in I&&t(20,N=I.apiUrl),"assistantId"in I&&t(21,H=I.assistantId),"maxMessages"in I&&t(22,q=I.maxMessages)},a.$$.update=()=>{a.$$.dirty[0]&59244544&&(!e&&r.length===0?(t(1,re=L),W.log("Reset deep-chat history for new chat")):n&&e&&W.log("Chat reopened with existing session"))},[d,re,J,V,j,Ee,$,Go,Wo,Vo,h,f,v,p,b,w,T,A,x,L,N,H,q,e,n,r,$o]}class $f extends jr{constructor(s){super(),Ur(this,s,Qf,Yf,sr,{deepChatRef:0,placeholderText:10,fontFamily:11,fontSize:12,userMessageBackgroundColor:13,userMessageTextColor:14,aiMessageBackgroundColor:15,aiMessageTextColor:16,feedbackMessageBackgroundColor:17,feedbackMessageTextColor:18,initialHistory:19,apiUrl:20,assistantId:21,maxMessages:22},null,[-1,-1])}}const ep="modulepreload",tp=function(a){return"/"+a},hi={},la=function(s,t,e){let n=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),o=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));n=Promise.allSettled(t.map(l=>{if(l=tp(l),l in hi)return;hi[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":ep,u||(d.as="script"),d.crossOrigin="",d.href=l,o&&d.setAttribute("nonce",o),document.head.appendChild(d),u)return new Promise((h,f)=>{d.addEventListener("load",h),d.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${l}`)))})}))}function r(i){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=i,window.dispatchEvent(o),!o.defaultPrevented)throw i}return n.then(i=>{for(const o of i||[])o.status==="rejected"&&r(o.reason);return s().catch(r)})},fi="en-GB",ua=["en-GB","de-DE","de-AT"];function np(a=null){if(a&&ua.includes(a))return W.log(`Using configured locale: ${a}`),a;if(typeof navigator<"u"){let s=navigator.language;if(ua.includes(s))return W.log(`Detected browser locale: ${s}`),s;if(navigator.languages){for(const e of navigator.languages)if(ua.includes(e))return W.log(`Detected browser locale from languages array: ${e}`),e}const t=s.split("-")[0];if(t==="de")return W.log("Detected German language, using de-DE as default"),"de-DE";if(t==="en")return W.log("Detected English language, using en-GB as default"),"en-GB"}return W.log(`Using default locale: ${fi}`),fi}async function rp(a){try{let s;switch(a){case"de-DE":case"de-AT":const{default:t}=await la(async()=>{const{default:n}=await import("./chat-bubble-CESt-Aj9.js");return{default:n}},[]);s=t;break;case"en-GB":default:const{default:e}=await la(async()=>{const{default:n}=await import("./chat-bubble-CRCX5RHi.js");return{default:n}},[]);s=e;break}return W.log(`Loaded messages for locale: ${a}`),s}catch{try{const{default:t}=await la(async()=>{const{default:e}=await import("./chat-bubble-CRCX5RHi.js");return{default:e}},[]);return W.log("Fallback to English messages"),t}catch{return{}}}}function ap(a,s){function t(e,n={}){const r=e.split(".");let i=a;for(const l of r)if(i&&typeof i=="object"&&l in i)i=i[l];else return e;if(typeof i!="string")return e;let o=i;return Object.keys(n).forEach(l=>{const u=`{${l}}`;o=o.replace(new RegExp(u,"g"),n[l])}),o}return t.locale=s,t}async function sp(a=null){const s=np(a),t=await rp(s),e=ap(t,s);return W.log(`I18n initialized with locale: ${s}`),e}function pi(a){let s,t;return s=new zf({props:{faviconBackgroundColor:a[16],iconPath:a[14]}}),{c(){fa(s.$$.fragment)},m(e,n){Pr(s,e,n),t=!0},p:Xe,i(e){t||(ut(s.$$.fragment,e),t=!0)},o(e){Rt(s.$$.fragment,e),t=!1},d(e){Br(s,e)}}}function mi(a){let s,t,e,n,r,i;t=new jf({props:{iconPath:a[14],chatTitle:a[11],fontFamily:a[15],chatHeaderBackground:a[16],initialHistory:a[9],deepChatRef:a[8]}});function o(u){a[30](u)}let l={placeholderText:a[10],fontFamily:a[15],fontSize:a[7]||void 0||"inherit",userMessageBackgroundColor:a[1]||void 0||"#007bff",userMessageTextColor:a[3]||void 0||"#000000",aiMessageBackgroundColor:a[2]||void 0||"#f1f3f4",aiMessageTextColor:a[4]||void 0||"#000000",feedbackMessageBackgroundColor:a[5]||void 0||"#ffffff",feedbackMessageTextColor:a[6]||void 0||"#000000",initialHistory:a[9],apiUrl:a[18],assistantId:a[17],maxMessages:parseInt(a[0]||void 0)||0};return a[8]!==void 0&&(l.deepChatRef=a[8]),n=new $f({props:l}),Or.push(()=>pl(n,"deepChatRef",o)),{c(){s=Ve("div"),fa(t.$$.fragment),e=Qt(),fa(n.$$.fragment),F(s,"class","chat-container svelte-15hazy1")},m(u,c){ir(u,s,c),Pr(t,s,null),Se(s,e),Pr(n,s,null),i=!0},p(u,c){const d={};c&2048&&(d.chatTitle=u[11]),c&512&&(d.initialHistory=u[9]),c&256&&(d.deepChatRef=u[8]),t.$set(d);const h={};c&1024&&(h.placeholderText=u[10]),c&128&&(h.fontSize=u[7]||void 0||"inherit"),c&2&&(h.userMessageBackgroundColor=u[1]||void 0||"#007bff"),c&8&&(h.userMessageTextColor=u[3]||void 0||"#000000"),c&4&&(h.aiMessageBackgroundColor=u[2]||void 0||"#f1f3f4"),c&16&&(h.aiMessageTextColor=u[4]||void 0||"#000000"),c&32&&(h.feedbackMessageBackgroundColor=u[5]||void 0||"#ffffff"),c&64&&(h.feedbackMessageTextColor=u[6]||void 0||"#000000"),c&512&&(h.initialHistory=u[9]),c&1&&(h.maxMessages=parseInt(u[0]||void 0)||0),!r&&c&256&&(r=!0,h.deepChatRef=u[8],dl(()=>r=!1)),n.$set(h)},i(u){i||(ut(t.$$.fragment,u),ut(n.$$.fragment,u),i=!0)},o(u){Rt(t.$$.fragment,u),Rt(n.$$.fragment,u),i=!1},d(u){u&&on(s),Br(t),Br(n)}}}function ip(a){let s,t,e,n=!a[12]&&pi(a),r=a[12]&&mi(a);return{c(){s=Ve("main"),n&&n.c(),t=Qt(),r&&r.c(),F(s,"class","svelte-15hazy1")},m(i,o){ir(i,s,o),n&&n.m(s,null),Se(s,t),r&&r.m(s,null),e=!0},p(i,[o]){i[12]?n&&(os(),Rt(n,1,1,()=>{n=null}),ls()):n?(n.p(i,o),o&4096&&ut(n,1)):(n=pi(i),n.c(),ut(n,1),n.m(s,t)),i[12]?r?(r.p(i,o),o&4096&&ut(r,1)):(r=mi(i),r.c(),ut(r,1),r.m(s,null)):r&&(os(),Rt(r,1,1,()=>{r=null}),ls())},i(i){e||(ut(n),ut(r),e=!0)},o(i){Rt(n),Rt(r),e=!1},d(i){i&&on(s),n&&n.d(),r&&r.d()}}}function op(a,s,t){let e,n,r,i,o,l;Je(a,ar,Z=>t(12,l=Z));let{apiUrl:u=void 0}=s,{assistantId:c=void 0}=s,{maxMessages:d=void 0}=s,{placeholderText:h=void 0}=s,{faviconPath:f=void 0}=s,{initialMessage:v=void 0}=s,{userMessageBackgroundColor:p=void 0}=s,{aiMessageBackgroundColor:b=void 0}=s,{userMessageTextColor:w=void 0}=s,{aiMessageTextColor:T=void 0}=s,{feedbackMessageBackgroundColor:A=void 0}=s,{feedbackMessageTextColor:x=void 0}=s,{faviconBackgroundColor:L=void 0}=s,{fontFamily:N=void 0}=s,{fontSize:H=void 0}=s,{chatTitle:q=void 0}=s,{locale:K=void 0}=s,J;const V=Tt(Z=>Z);Je(a,V,Z=>t(29,o=Z)),ll("i18n",V),bi(async()=>{try{const bt=await sp(K||void 0);V.set(bt)}catch{}});const j=f||void 0||Ff,ve=N||void 0||"inherit",re=L||void 0||"#667eea",Ee=c||void 0||"test-model",$=(u||void 0||"https://localhost").replace(/\/$/,"");function fe(Z){J=Z,t(8,J)}return a.$$set=Z=>{"apiUrl"in Z&&t(19,u=Z.apiUrl),"assistantId"in Z&&t(20,c=Z.assistantId),"maxMessages"in Z&&t(0,d=Z.maxMessages),"placeholderText"in Z&&t(21,h=Z.placeholderText),"faviconPath"in Z&&t(22,f=Z.faviconPath),"initialMessage"in Z&&t(23,v=Z.initialMessage),"userMessageBackgroundColor"in Z&&t(1,p=Z.userMessageBackgroundColor),"aiMessageBackgroundColor"in Z&&t(2,b=Z.aiMessageBackgroundColor),"userMessageTextColor"in Z&&t(3,w=Z.userMessageTextColor),"aiMessageTextColor"in Z&&t(4,T=Z.aiMessageTextColor),"feedbackMessageBackgroundColor"in Z&&t(5,A=Z.feedbackMessageBackgroundColor),"feedbackMessageTextColor"in Z&&t(6,x=Z.feedbackMessageTextColor),"faviconBackgroundColor"in Z&&t(24,L=Z.faviconBackgroundColor),"fontFamily"in Z&&t(25,N=Z.fontFamily),"fontSize"in Z&&t(7,H=Z.fontSize),"chatTitle"in Z&&t(26,q=Z.chatTitle),"locale"in Z&&t(27,K=Z.locale)},a.$$.update=()=>{a.$$.dirty&545259520&&t(28,e=v||void 0||o("chat.content.initialMessage")),a.$$.dirty&603979776&&t(11,n=q||void 0||o("chat.header.title")),a.$$.dirty&538968064&&t(10,r=h||void 0||o("chat.content.placeholder")),a.$$.dirty&268435456&&t(9,i=[{role:Rr,text:e,custom:{timestamp:Math.floor(Date.now()/1e3)}}])},[d,p,b,w,T,A,x,H,J,i,r,n,l,V,j,ve,re,Ee,$,u,c,h,f,v,L,N,q,K,e,o,fe]}class Pa extends jr{constructor(s){super(),Ur(this,s,op,ip,sr,{apiUrl:19,assistantId:20,maxMessages:0,placeholderText:21,faviconPath:22,initialMessage:23,userMessageBackgroundColor:1,aiMessageBackgroundColor:2,userMessageTextColor:3,aiMessageTextColor:4,feedbackMessageBackgroundColor:5,feedbackMessageTextColor:6,faviconBackgroundColor:24,fontFamily:25,fontSize:7,chatTitle:26,locale:27})}}function Uo(){const a={apiUrl:void 0,assistantId:void 0,maxMessages:void 0,placeholderText:void 0,userMessageBackgroundColor:void 0,aiMessageBackgroundColor:void 0,userMessageTextColor:void 0,aiMessageTextColor:void 0,faviconBackgroundColor:void 0,chatTitle:void 0,locale:void 0},s=typeof window<"u"&&window.HEADWAI_CHAT_BUBBLE_CONFIG||{};return{...a,...s}}typeof window<"u"&&window.document&&document.addEventListener("DOMContentLoaded",()=>{const a=Uo(),s=document.querySelectorAll("[data-chat-bubble]");if(s.length===0){const t=document.getElementById("chat-bubble-container");t&&new Pa({target:t,props:a})}else s.forEach(t=>{const e={...a},n={chatBubbleApiUrl:"apiUrl",chatBubbleAssistantId:"assistantId",chatBubbleMaxMessages:"maxMessages",chatBubblePlaceholderText:"placeholderText",chatBubbleFaviconPath:"faviconPath",chatBubbleInitialMessage:"initialMessage",chatBubbleUserMessageBackgroundColor:"userMessageBackgroundColor",chatBubbleAiMessageBackgroundColor:"aiMessageBackgroundColor",chatBubbleUserMessageTextColor:"userMessageTextColor",chatBubbleAiMessageTextColor:"aiMessageTextColor",chatBubbleFaviconBackgroundColor:"faviconBackgroundColor",chatBubbleChatTitle:"chatTitle",chatBubbleLocale:"locale"};Object.keys(t.dataset).forEach(r=>{n[r]&&(e[n[r]]=t.dataset[r])}),new Pa({target:t,props:e})})});window.ChatBubble={init:(a,s={})=>new Pa({target:a,props:{...Uo(),...s}})};
|
|
360
|
+
`,d.updateMessage({html:be,role:lt},pe),r.forEach(Ye=>{Ye.role===lt&&Ye.associatedMessageId===I&&(Ye.html=be,Ye.feedbackType=G)}),zo()}async function Qo(I,G){if(!(!e||!G||!I||(r.forEach(be=>{be.id===I&&be.role===Kt&&(be.feedbackId=G.id,be.annotation={rating:G.data.rating})}),!r.find(be=>be.id===I))))try{await K.chats.updateAssistantMessageWithFeedback(e,H,r)?(W.log("Assistant message updated with feedback successfully"),gr(r)):W.error("Failed to update assistant message with feedback")}catch{}}typeof window<"u"&&(window.handleFeedback=Xo),bi(()=>{W.log("ChatContent mounted - checking state",{chatId:e,messageHistoryLength:r.length}),e&&r.length>0?(t(1,re=ve(r)),W.log("ChatContent mounted with existing history",re)):e||(W.log("ChatContent mounted - initializing fresh state"),Vn.set(null),Kn.set([]),qn.set([]),jn.set(""),Un.set(""),Hn.set([]),t(1,re=L))});function $o(I){Or[I?"unshift":"push"](()=>{d=I,t(0,d)})}return a.$$set=I=>{"deepChatRef"in I&&t(0,d=I.deepChatRef),"placeholderText"in I&&t(10,h=I.placeholderText),"fontFamily"in I&&t(11,f=I.fontFamily),"fontSize"in I&&t(12,v=I.fontSize),"userMessageBackgroundColor"in I&&t(13,p=I.userMessageBackgroundColor),"userMessageTextColor"in I&&t(14,b=I.userMessageTextColor),"aiMessageBackgroundColor"in I&&t(15,w=I.aiMessageBackgroundColor),"aiMessageTextColor"in I&&t(16,T=I.aiMessageTextColor),"feedbackMessageBackgroundColor"in I&&t(17,A=I.feedbackMessageBackgroundColor),"feedbackMessageTextColor"in I&&t(18,x=I.feedbackMessageTextColor),"initialHistory"in I&&t(19,L=I.initialHistory),"apiUrl"in I&&t(20,N=I.apiUrl),"assistantId"in I&&t(21,H=I.assistantId),"maxMessages"in I&&t(22,q=I.maxMessages)},a.$$.update=()=>{a.$$.dirty[0]&59244544&&(!e&&r.length===0?(t(1,re=L),W.log("Reset deep-chat history for new chat")):n&&e&&W.log("Chat reopened with existing session"))},[d,re,J,V,j,Ee,$,Go,Wo,Vo,h,f,v,p,b,w,T,A,x,L,N,H,q,e,n,r,$o]}class $f extends jr{constructor(s){super(),Ur(this,s,Qf,Yf,sr,{deepChatRef:0,placeholderText:10,fontFamily:11,fontSize:12,userMessageBackgroundColor:13,userMessageTextColor:14,aiMessageBackgroundColor:15,aiMessageTextColor:16,feedbackMessageBackgroundColor:17,feedbackMessageTextColor:18,initialHistory:19,apiUrl:20,assistantId:21,maxMessages:22},null,[-1,-1])}}const ep="modulepreload",tp=function(a){return"/"+a},hi={},la=function(s,t,e){let n=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),o=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));n=Promise.allSettled(t.map(l=>{if(l=tp(l),l in hi)return;hi[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":ep,u||(d.as="script"),d.crossOrigin="",d.href=l,o&&d.setAttribute("nonce",o),document.head.appendChild(d),u)return new Promise((h,f)=>{d.addEventListener("load",h),d.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${l}`)))})}))}function r(i){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=i,window.dispatchEvent(o),!o.defaultPrevented)throw i}return n.then(i=>{for(const o of i||[])o.status==="rejected"&&r(o.reason);return s().catch(r)})},fi="en-GB",ua=["en-GB","de-DE","de-AT"];function np(a=null){if(a&&ua.includes(a))return W.log(`Using configured locale: ${a}`),a;if(typeof navigator<"u"){let s=navigator.language;if(ua.includes(s))return W.log(`Detected browser locale: ${s}`),s;if(navigator.languages){for(const e of navigator.languages)if(ua.includes(e))return W.log(`Detected browser locale from languages array: ${e}`),e}const t=s.split("-")[0];if(t==="de")return W.log("Detected German language, using de-DE as default"),"de-DE";if(t==="en")return W.log("Detected English language, using en-GB as default"),"en-GB"}return W.log(`Using default locale: ${fi}`),fi}async function rp(a){try{let s;switch(a){case"de-DE":case"de-AT":const{default:t}=await la(async()=>{const{default:n}=await import("./chat-bubble-CESt-Aj9.js");return{default:n}},[]);s=t;break;case"en-GB":default:const{default:e}=await la(async()=>{const{default:n}=await import("./chat-bubble-CRCX5RHi.js");return{default:n}},[]);s=e;break}return W.log(`Loaded messages for locale: ${a}`),s}catch{try{const{default:t}=await la(async()=>{const{default:e}=await import("./chat-bubble-CRCX5RHi.js");return{default:e}},[]);return W.log("Fallback to English messages"),t}catch{return{}}}}function ap(a,s){function t(e,n={}){const r=e.split(".");let i=a;for(const l of r)if(i&&typeof i=="object"&&l in i)i=i[l];else return e;if(typeof i!="string")return e;let o=i;return Object.keys(n).forEach(l=>{const u=`{${l}}`;o=o.replace(new RegExp(u,"g"),n[l])}),o}return t.locale=s,t}async function sp(a=null){const s=np(a),t=await rp(s),e=ap(t,s);return W.log(`I18n initialized with locale: ${s}`),e}function pi(a){let s,t;return s=new zf({props:{faviconBackgroundColor:a[16],iconPath:a[14]}}),{c(){fa(s.$$.fragment)},m(e,n){Pr(s,e,n),t=!0},p:Xe,i(e){t||(ut(s.$$.fragment,e),t=!0)},o(e){Rt(s.$$.fragment,e),t=!1},d(e){Br(s,e)}}}function mi(a){let s,t,e,n,r,i;t=new jf({props:{iconPath:a[14],chatTitle:a[11],fontFamily:a[15],chatHeaderBackground:a[16],initialHistory:a[9],deepChatRef:a[8]}});function o(u){a[30](u)}let l={placeholderText:a[10],fontFamily:a[15],fontSize:a[7]||void 0||"inherit",userMessageBackgroundColor:a[1]||void 0||"#007bff",userMessageTextColor:a[3]||void 0||"#000000",aiMessageBackgroundColor:a[2]||void 0||"#f1f3f4",aiMessageTextColor:a[4]||void 0||"#000000",feedbackMessageBackgroundColor:a[5]||void 0||"#ffffff",feedbackMessageTextColor:a[6]||void 0||"#000000",initialHistory:a[9],apiUrl:a[18],assistantId:a[17],maxMessages:parseInt(a[0]||void 0)||0};return a[8]!==void 0&&(l.deepChatRef=a[8]),n=new $f({props:l}),Or.push(()=>pl(n,"deepChatRef",o)),{c(){s=Ve("div"),fa(t.$$.fragment),e=Qt(),fa(n.$$.fragment),F(s,"class","chat-container svelte-rzw9x0")},m(u,c){ir(u,s,c),Pr(t,s,null),Se(s,e),Pr(n,s,null),i=!0},p(u,c){const d={};c&2048&&(d.chatTitle=u[11]),c&512&&(d.initialHistory=u[9]),c&256&&(d.deepChatRef=u[8]),t.$set(d);const h={};c&1024&&(h.placeholderText=u[10]),c&128&&(h.fontSize=u[7]||void 0||"inherit"),c&2&&(h.userMessageBackgroundColor=u[1]||void 0||"#007bff"),c&8&&(h.userMessageTextColor=u[3]||void 0||"#000000"),c&4&&(h.aiMessageBackgroundColor=u[2]||void 0||"#f1f3f4"),c&16&&(h.aiMessageTextColor=u[4]||void 0||"#000000"),c&32&&(h.feedbackMessageBackgroundColor=u[5]||void 0||"#ffffff"),c&64&&(h.feedbackMessageTextColor=u[6]||void 0||"#000000"),c&512&&(h.initialHistory=u[9]),c&1&&(h.maxMessages=parseInt(u[0]||void 0)||0),!r&&c&256&&(r=!0,h.deepChatRef=u[8],dl(()=>r=!1)),n.$set(h)},i(u){i||(ut(t.$$.fragment,u),ut(n.$$.fragment,u),i=!0)},o(u){Rt(t.$$.fragment,u),Rt(n.$$.fragment,u),i=!1},d(u){u&&on(s),Br(t),Br(n)}}}function ip(a){let s,t,e,n=!a[12]&&pi(a),r=a[12]&&mi(a);return{c(){s=Ve("main"),n&&n.c(),t=Qt(),r&&r.c(),F(s,"class","svelte-rzw9x0")},m(i,o){ir(i,s,o),n&&n.m(s,null),Se(s,t),r&&r.m(s,null),e=!0},p(i,[o]){i[12]?n&&(os(),Rt(n,1,1,()=>{n=null}),ls()):n?(n.p(i,o),o&4096&&ut(n,1)):(n=pi(i),n.c(),ut(n,1),n.m(s,t)),i[12]?r?(r.p(i,o),o&4096&&ut(r,1)):(r=mi(i),r.c(),ut(r,1),r.m(s,null)):r&&(os(),Rt(r,1,1,()=>{r=null}),ls())},i(i){e||(ut(n),ut(r),e=!0)},o(i){Rt(n),Rt(r),e=!1},d(i){i&&on(s),n&&n.d(),r&&r.d()}}}function op(a,s,t){let e,n,r,i,o,l;Je(a,ar,Z=>t(12,l=Z));let{apiUrl:u=void 0}=s,{assistantId:c=void 0}=s,{maxMessages:d=void 0}=s,{placeholderText:h=void 0}=s,{faviconPath:f=void 0}=s,{initialMessage:v=void 0}=s,{userMessageBackgroundColor:p=void 0}=s,{aiMessageBackgroundColor:b=void 0}=s,{userMessageTextColor:w=void 0}=s,{aiMessageTextColor:T=void 0}=s,{feedbackMessageBackgroundColor:A=void 0}=s,{feedbackMessageTextColor:x=void 0}=s,{faviconBackgroundColor:L=void 0}=s,{fontFamily:N=void 0}=s,{fontSize:H=void 0}=s,{chatTitle:q=void 0}=s,{locale:K=void 0}=s,J;const V=Tt(Z=>Z);Je(a,V,Z=>t(29,o=Z)),ll("i18n",V),bi(async()=>{try{const bt=await sp(K||void 0);V.set(bt)}catch{}});const j=f||void 0||Ff,ve=N||void 0||"inherit",re=L||void 0||"#667eea",Ee=c||void 0||"test-model",$=(u||void 0||"https://localhost").replace(/\/$/,"");function fe(Z){J=Z,t(8,J)}return a.$$set=Z=>{"apiUrl"in Z&&t(19,u=Z.apiUrl),"assistantId"in Z&&t(20,c=Z.assistantId),"maxMessages"in Z&&t(0,d=Z.maxMessages),"placeholderText"in Z&&t(21,h=Z.placeholderText),"faviconPath"in Z&&t(22,f=Z.faviconPath),"initialMessage"in Z&&t(23,v=Z.initialMessage),"userMessageBackgroundColor"in Z&&t(1,p=Z.userMessageBackgroundColor),"aiMessageBackgroundColor"in Z&&t(2,b=Z.aiMessageBackgroundColor),"userMessageTextColor"in Z&&t(3,w=Z.userMessageTextColor),"aiMessageTextColor"in Z&&t(4,T=Z.aiMessageTextColor),"feedbackMessageBackgroundColor"in Z&&t(5,A=Z.feedbackMessageBackgroundColor),"feedbackMessageTextColor"in Z&&t(6,x=Z.feedbackMessageTextColor),"faviconBackgroundColor"in Z&&t(24,L=Z.faviconBackgroundColor),"fontFamily"in Z&&t(25,N=Z.fontFamily),"fontSize"in Z&&t(7,H=Z.fontSize),"chatTitle"in Z&&t(26,q=Z.chatTitle),"locale"in Z&&t(27,K=Z.locale)},a.$$.update=()=>{a.$$.dirty&545259520&&t(28,e=v||void 0||o("chat.content.initialMessage")),a.$$.dirty&603979776&&t(11,n=q||void 0||o("chat.header.title")),a.$$.dirty&538968064&&t(10,r=h||void 0||o("chat.content.placeholder")),a.$$.dirty&268435456&&t(9,i=[{role:Rr,text:e,custom:{timestamp:Math.floor(Date.now()/1e3)}}])},[d,p,b,w,T,A,x,H,J,i,r,n,l,V,j,ve,re,Ee,$,u,c,h,f,v,L,N,q,K,e,o,fe]}class Pa extends jr{constructor(s){super(),Ur(this,s,op,ip,sr,{apiUrl:19,assistantId:20,maxMessages:0,placeholderText:21,faviconPath:22,initialMessage:23,userMessageBackgroundColor:1,aiMessageBackgroundColor:2,userMessageTextColor:3,aiMessageTextColor:4,feedbackMessageBackgroundColor:5,feedbackMessageTextColor:6,faviconBackgroundColor:24,fontFamily:25,fontSize:7,chatTitle:26,locale:27})}}function Uo(){const a={apiUrl:void 0,assistantId:void 0,maxMessages:void 0,placeholderText:void 0,userMessageBackgroundColor:void 0,aiMessageBackgroundColor:void 0,userMessageTextColor:void 0,aiMessageTextColor:void 0,faviconBackgroundColor:void 0,chatTitle:void 0,locale:void 0},s=typeof window<"u"&&window.HEADWAI_CHAT_BUBBLE_CONFIG||{};return{...a,...s}}typeof window<"u"&&window.document&&document.addEventListener("DOMContentLoaded",()=>{const a=Uo(),s=document.querySelectorAll("[data-chat-bubble]");if(s.length===0){const t=document.getElementById("chat-bubble-container");t&&new Pa({target:t,props:a})}else s.forEach(t=>{const e={...a},n={chatBubbleApiUrl:"apiUrl",chatBubbleAssistantId:"assistantId",chatBubbleMaxMessages:"maxMessages",chatBubblePlaceholderText:"placeholderText",chatBubbleFaviconPath:"faviconPath",chatBubbleInitialMessage:"initialMessage",chatBubbleUserMessageBackgroundColor:"userMessageBackgroundColor",chatBubbleAiMessageBackgroundColor:"aiMessageBackgroundColor",chatBubbleUserMessageTextColor:"userMessageTextColor",chatBubbleAiMessageTextColor:"aiMessageTextColor",chatBubbleFaviconBackgroundColor:"faviconBackgroundColor",chatBubbleChatTitle:"chatTitle",chatBubbleLocale:"locale"};Object.keys(t.dataset).forEach(r=>{n[r]&&(e[n[r]]=t.dataset[r])}),new Pa({target:t,props:e})})});window.ChatBubble={init:(a,s={})=>new Pa({target:a,props:{...Uo(),...s}})};
|