@cas0570/chat-widget 0.0.7 → 0.0.8
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.
- package/dist/components/ChatWidget.d.ts +1 -1
- package/dist/components/Icons.d.ts +0 -6
- package/dist/components/index.d.ts +1 -2
- package/dist/geoapps-chat-widget.js +617 -578
- package/dist/geoapps-chat-widget.umd.cjs +9 -9
- package/dist/hooks/__tests__/useAuth.test.d.ts +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useAuth.d.ts +29 -0
- package/dist/types.d.ts +8 -0
- package/package.json +1 -1
|
@@ -1,287 +1,329 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode(':root{--gcw-color-white: #fff;--gcw-color-gray-50: #f9fafb;--gcw-color-gray-100: #f3f4f6;--gcw-color-gray-200: #e5e7eb;--gcw-color-gray-300: #d1d5db;--gcw-color-gray-400: #9ca3af;--gcw-color-gray-500: #6b7280;--gcw-color-gray-600: #4b5563;--gcw-color-gray-700: #374151;--gcw-color-gray-800: #1f2937;--gcw-color-gray-900: #111827;--gcw-color-primary: #3b82f6;--gcw-color-primary-hover: #2563eb;--gcw-color-primary-light: #eff6ff;--gcw-color-error: #ef4444;--gcw-color-success: #22c55e;--gcw-font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;--gcw-font-size-xs: .625rem;--gcw-font-size-sm: .75rem;--gcw-font-size-base: .875rem;--gcw-font-size-lg: 1rem;--gcw-spacing-1: .25rem;--gcw-spacing-2: .5rem;--gcw-spacing-3: .75rem;--gcw-spacing-4: 1rem;--gcw-spacing-6: 1.5rem;--gcw-spacing-8: 2rem;--gcw-spacing-10: 2.5rem;--gcw-spacing-12: 3rem;--gcw-spacing-16: 4rem;--gcw-spacing-20: 5rem;--gcw-radius-sm: .25rem;--gcw-radius-md: .5rem;--gcw-radius-lg: .75rem;--gcw-radius-xl: 1rem;--gcw-radius-2xl: 1.25rem;--gcw-radius-full: 9999px;--gcw-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .05);--gcw-shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--gcw-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--gcw-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--gcw-shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / .25);--gcw-transition-fast: .15s ease;--gcw-transition-base: .2s ease;--gcw-transition-slow: .3s ease;--gcw-z-widget: 9999}.gcw-widget,.gcw-widget *,.gcw-widget *:before,.gcw-widget *:after{box-sizing:border-box;margin:0;padding:0;font-family:var(--gcw-font-family);line-height:1.5}.gcw-widget{font-family:var(--gcw-font-family);font-size:var(--gcw-font-size-base);line-height:1.5;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:var(--gcw-color-gray-800);text-align:left;letter-spacing:normal;word-spacing:normal;text-transform:none;text-indent:0;text-shadow:none;font-weight:400;font-style:normal}.gcw-container{position:fixed;z-index:var(--gcw-z-widget);display:flex;gap:var(--gcw-spacing-4)}.gcw-container--bottom-right{right:var(--gcw-spacing-4);bottom:var(--gcw-spacing-4);flex-direction:column-reverse;align-items:flex-end}.gcw-container--bottom-left{left:var(--gcw-spacing-4);bottom:var(--gcw-spacing-4);flex-direction:column-reverse;align-items:flex-start}.gcw-container--top-right{right:var(--gcw-spacing-4);top:var(--gcw-spacing-4);flex-direction:column;align-items:flex-end}.gcw-container--top-left{left:var(--gcw-spacing-4);top:var(--gcw-spacing-4);flex-direction:column;align-items:flex-start}.gcw-container--custom{flex-direction:column-reverse;align-items:flex-end}.gcw-container--custom.gcw-container--align-left{align-items:flex-start}.gcw-container--custom.gcw-container--flow-down{flex-direction:column}.gcw-toggle{position:relative;width:3.5rem;height:3.5rem;border:none;border-radius:var(--gcw-radius-full);background-color:var(--gcw-color-primary);color:var(--gcw-color-white);cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:var(--gcw-shadow-lg);transition:transform var(--gcw-transition-base),box-shadow var(--gcw-transition-base)}.gcw-toggle:hover{transform:scale(1.1);box-shadow:var(--gcw-shadow-xl)}.gcw-toggle:active{transform:scale(.95)}.gcw-toggle__icon{width:1.5rem;height:1.5rem;transition:transform var(--gcw-transition-slow)}.gcw-toggle__badge{position:absolute;top:-.25rem;right:-.25rem;width:1rem;height:1rem;border-radius:var(--gcw-radius-full);display:flex;align-items:center;justify-content:center;font-size:var(--gcw-font-size-xs);font-weight:700;animation:gcw-pulse 2s infinite}.gcw-toggle__badge--unread{background-color:var(--gcw-color-error);color:var(--gcw-color-white)}.gcw-toggle__badge--popout{background-color:var(--gcw-color-success)}.gcw-window{position:relative;display:flex;flex-direction:column;background-color:var(--gcw-color-white);border-radius:var(--gcw-radius-2xl);box-shadow:var(--gcw-shadow-2xl);border:1px solid var(--gcw-color-gray-200);overflow:hidden;animation:gcw-slide-up var(--gcw-transition-slow) ease-out}.gcw-window--small{width:365px;height:450px}.gcw-window--medium{width:380px;height:560px}.gcw-window--large{width:480px;height:680px}.gcw-window--fullscreen{width:calc(100vw - 2rem);height:calc(100vh - 6rem);max-width:56rem}.gcw-window{max-height:90vh;transition:width var(--gcw-transition-base),height var(--gcw-transition-base)}.gcw-header{display:flex;align-items:center;justify-content:space-between;padding:var(--gcw-spacing-3) var(--gcw-spacing-4);color:var(--gcw-color-white);flex-shrink:0}.gcw-header__left{display:flex;align-items:center;gap:var(--gcw-spacing-3)}.gcw-header__avatar{width:2.5rem;height:2.5rem;border-radius:var(--gcw-radius-full);background-color:#fff3;display:flex;align-items:center;justify-content:center}.gcw-header__avatar-icon{width:1.25rem;height:1.25rem}.gcw-header__info{display:flex;flex-direction:column;min-width:0;flex:1}.gcw-header__title{font-size:var(--gcw-font-size-base);font-weight:600;line-height:1.4;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gcw-header__subtitle{font-size:var(--gcw-font-size-sm);font-weight:400;line-height:1.4;opacity:.9;margin:0;word-wrap:break-word;overflow-wrap:break-word}.gcw-header__actions{display:flex;align-items:center;gap:.125rem}.gcw-header__btn{width:2rem;height:2rem;border:none;border-radius:var(--gcw-radius-full);background-color:transparent;color:inherit;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background-color var(--gcw-transition-fast)}.gcw-header__btn:hover{background-color:#fff3}.gcw-header__btn-icon{width:1rem;height:1rem}.gcw-header-menu{position:relative}.gcw-header-menu__dropdown{position:absolute;top:calc(100% + .25rem);right:0;min-width:12rem;background-color:var(--gcw-color-white);border-radius:var(--gcw-radius-lg);box-shadow:var(--gcw-shadow-xl);border:1px solid var(--gcw-color-gray-200);padding:var(--gcw-spacing-1) 0;z-index:10;animation:gcw-menu-appear var(--gcw-transition-fast) ease-out}.gcw-header-menu__item{display:flex;align-items:center;gap:var(--gcw-spacing-3);width:100%;padding:var(--gcw-spacing-2) var(--gcw-spacing-3);border:none;background:none;color:var(--gcw-color-gray-700);font-family:var(--gcw-font-family);font-size:var(--gcw-font-size-sm);cursor:pointer;transition:background-color var(--gcw-transition-fast);text-align:left;white-space:nowrap}.gcw-header-menu__item:hover{background-color:var(--gcw-color-gray-100)}.gcw-header-menu__item--danger{color:var(--gcw-color-error)}.gcw-header-menu__item--danger:hover{background-color:#fef2f2}.gcw-header-menu__icon{width:1rem;height:1rem;flex-shrink:0}.gcw-header-menu__divider{height:1px;background-color:var(--gcw-color-gray-200);margin:var(--gcw-spacing-1) 0}@keyframes gcw-menu-appear{0%{opacity:0;transform:translateY(-.25rem)}to{opacity:1;transform:translateY(0)}}.gcw-messages{flex:1;overflow-y:auto;padding:var(--gcw-spacing-4);display:flex;flex-direction:column;gap:var(--gcw-spacing-4)}.gcw-messages::-webkit-scrollbar{width:6px}.gcw-messages::-webkit-scrollbar-track{background:transparent}.gcw-messages::-webkit-scrollbar-thumb{background-color:var(--gcw-color-gray-300);border-radius:3px}.gcw-messages::-webkit-scrollbar-thumb:hover{background-color:var(--gcw-color-gray-400)}.gcw-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:var(--gcw-spacing-6);color:var(--gcw-color-gray-400);text-align:center}.gcw-empty__icon{width:4rem;height:4rem;margin-bottom:var(--gcw-spacing-4);opacity:.5}.gcw-empty__text{font-size:var(--gcw-font-size-base);font-weight:400;line-height:1.5;margin:0}.gcw-session-loading{display:flex;flex-direction:column;align-items:center;gap:var(--gcw-spacing-3)}.gcw-session-loading__spinner{width:2rem;height:2rem;border:3px solid var(--gcw-color-gray-200);border-top-color:var(--gcw-color-primary);border-radius:50%;animation:gcw-spin .8s linear infinite}@keyframes gcw-spin{to{transform:rotate(360deg)}}.gcw-bubble-row{display:flex}.gcw-bubble-row--user{justify-content:flex-end}.gcw-bubble-row--assistant{justify-content:flex-start}.gcw-bubble-wrapper{max-width:85%;display:flex;flex-direction:column}.gcw-bubble-wrapper--user{align-items:flex-end}.gcw-bubble-wrapper--assistant{align-items:flex-start}.gcw-bubble{padding:var(--gcw-spacing-2) var(--gcw-spacing-4);border-radius:var(--gcw-radius-2xl);font-size:var(--gcw-font-size-base);font-weight:400;line-height:1.6;letter-spacing:normal;word-wrap:break-word}.gcw-bubble--user{color:var(--gcw-color-white);border-bottom-right-radius:var(--gcw-radius-sm)}.gcw-bubble--assistant{background-color:var(--gcw-color-gray-100);color:var(--gcw-color-gray-800);border-bottom-left-radius:var(--gcw-radius-sm)}.gcw-bubble__timestamp{font-size:var(--gcw-font-size-xs);color:var(--gcw-color-gray-400);margin-top:var(--gcw-spacing-1);padding:0 var(--gcw-spacing-1)}.gcw-content p{margin-bottom:var(--gcw-spacing-2)}.gcw-content p:last-child{margin-bottom:0}.gcw-content strong{font-weight:600}.gcw-content em{font-style:italic}.gcw-content ul,.gcw-content ol{margin:var(--gcw-spacing-2) 0;padding-left:var(--gcw-spacing-6)}.gcw-content li{margin-bottom:var(--gcw-spacing-1)}.gcw-content code{background-color:#0000001a;padding:.125rem .375rem;border-radius:var(--gcw-radius-sm);font-size:.875em;font-family:SF Mono,Monaco,Consolas,monospace}.gcw-bubble--user .gcw-content code{background-color:#fff3}.gcw-content pre{background-color:var(--gcw-color-gray-800);color:var(--gcw-color-gray-100);padding:var(--gcw-spacing-3);border-radius:var(--gcw-radius-md);overflow-x:auto;margin:var(--gcw-spacing-2) 0}.gcw-content pre code{background-color:transparent;padding:0;font-size:var(--gcw-font-size-sm)}.gcw-content a{color:var(--gcw-color-primary);text-decoration:underline}.gcw-content a:hover{color:var(--gcw-color-primary-hover)}.gcw-bubble--user .gcw-content a{color:#ffffffe6}.gcw-md-heading{font-weight:600;margin-top:var(--gcw-spacing-3);margin-bottom:var(--gcw-spacing-1)}.gcw-md-heading--h2{font-size:var(--gcw-font-size-lg);font-weight:700}.gcw-md-heading--h3,.gcw-md-heading--h4{font-size:var(--gcw-font-size-base)}.gcw-md-heading--h5{font-size:var(--gcw-font-size-sm)}.gcw-md-paragraph{margin-bottom:var(--gcw-spacing-2)}.gcw-md-paragraph:last-child{margin-bottom:0}.gcw-md-list{margin:var(--gcw-spacing-2) 0;padding-left:var(--gcw-spacing-4)}.gcw-md-list--ul{list-style-type:disc}.gcw-md-list--ol{list-style-type:decimal}.gcw-md-list__item{font-size:var(--gcw-font-size-base);margin-bottom:var(--gcw-spacing-1)}.gcw-md-bold{font-weight:600}.gcw-md-italic{font-style:italic}.gcw-md-code{background-color:var(--gcw-color-gray-200);padding:.125rem var(--gcw-spacing-2);border-radius:var(--gcw-radius-sm);font-size:var(--gcw-font-size-sm);font-family:SF Mono,Monaco,Consolas,monospace}.gcw-bubble--user .gcw-md-code{background-color:#fff3}.gcw-md-code-block{background-color:var(--gcw-color-gray-800);color:var(--gcw-color-gray-100);padding:var(--gcw-spacing-3);border-radius:var(--gcw-radius-lg);font-size:var(--gcw-font-size-sm);overflow-x:auto;margin:var(--gcw-spacing-2) 0}.gcw-md-code-block code{font-family:SF Mono,Monaco,Consolas,monospace}.gcw-md-link{color:var(--gcw-color-primary);text-decoration:underline}.gcw-md-link:hover{color:var(--gcw-color-primary-hover)}.gcw-bubble--user .gcw-md-link{color:#ffffffe6}.gcw-sources{display:flex;flex-wrap:wrap;gap:var(--gcw-spacing-2);margin-top:var(--gcw-spacing-2)}.gcw-source{display:inline-flex;align-items:center;gap:var(--gcw-spacing-1);padding:var(--gcw-spacing-1) var(--gcw-spacing-2);border-radius:var(--gcw-radius-full);background-color:var(--gcw-color-primary-light);color:var(--gcw-color-primary);font-size:var(--gcw-font-size-sm);text-decoration:none;transition:background-color var(--gcw-transition-fast)}.gcw-source:hover{background-color:#dbeafe}.gcw-source__icon{width:.75rem;height:.75rem}.gcw-typing{display:flex;justify-content:flex-start}.gcw-typing__bubble{background-color:var(--gcw-color-gray-100);padding:var(--gcw-spacing-3) var(--gcw-spacing-4);border-radius:var(--gcw-radius-2xl);border-bottom-left-radius:var(--gcw-radius-sm)}.gcw-typing__dots{display:flex;gap:var(--gcw-spacing-1)}.gcw-typing__dot{width:.5rem;height:.5rem;background-color:var(--gcw-color-gray-400);border-radius:var(--gcw-radius-full);animation:gcw-typing-bounce 1.4s infinite ease-in-out both}.gcw-typing__dot:nth-child(1){animation-delay:-.32s}.gcw-typing__dot:nth-child(2){animation-delay:-.16s}.gcw-input-area{padding:var(--gcw-spacing-3);border-top:1px solid var(--gcw-color-gray-200);background-color:var(--gcw-color-white);flex-shrink:0}.gcw-input-row{display:flex;align-items:flex-end;gap:var(--gcw-spacing-2)}.gcw-input{flex:1;min-height:44px;max-height:120px;padding:var(--gcw-spacing-2) var(--gcw-spacing-4);border:1px solid var(--gcw-color-gray-200);border-radius:var(--gcw-radius-xl);background-color:var(--gcw-color-white);color:var(--gcw-color-gray-800);font-family:var(--gcw-font-family);font-size:var(--gcw-font-size-base);font-weight:400;line-height:1.5;letter-spacing:normal;resize:none;outline:none;transition:border-color var(--gcw-transition-fast),box-shadow var(--gcw-transition-fast)}.gcw-input:focus{border-color:var(--gcw-color-primary);box-shadow:0 0 0 3px #3b82f61a}.gcw-input:disabled{background-color:var(--gcw-color-gray-50);cursor:not-allowed}.gcw-input::placeholder{color:var(--gcw-color-gray-400)}.gcw-send-btn{width:2.5rem;height:2.5rem;flex-shrink:0;border:none;border-radius:var(--gcw-radius-lg);color:var(--gcw-color-white);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:opacity var(--gcw-transition-fast),transform var(--gcw-transition-fast)}.gcw-send-btn:hover:not(:disabled){opacity:.9}.gcw-send-btn:active:not(:disabled){transform:scale(.95)}.gcw-send-btn:disabled{opacity:.5;cursor:not-allowed}.gcw-send-btn__icon{width:1.25rem;height:1.25rem}.gcw-input-hint{font-size:var(--gcw-font-size-xs);color:var(--gcw-color-gray-400);text-align:center;margin-top:var(--gcw-spacing-2)}@keyframes gcw-slide-up{0%{opacity:0;transform:translateY(1rem)}to{opacity:1;transform:translateY(0)}}@keyframes gcw-pulse{0%,to{opacity:1}50%{opacity:.5}}@keyframes gcw-typing-bounce{0%,80%,to{transform:scale(0)}40%{transform:scale(1)}}@keyframes gcw-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.gcw-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.gcw-spin{animation:gcw-spin 1s linear infinite}.gcw-history{display:flex;flex-direction:column;flex:1;overflow:hidden;animation:gcw-slide-in-left var(--gcw-transition-base) ease-out}.gcw-history__header{display:flex;align-items:center;gap:var(--gcw-spacing-3);padding:var(--gcw-spacing-2) var(--gcw-spacing-3);color:var(--gcw-color-white);flex-shrink:0}.gcw-history__title{flex:1;font-size:var(--gcw-font-size-base);font-weight:600;margin:0}.gcw-history__list{flex:1;overflow-y:auto;padding:var(--gcw-spacing-2) 0}.gcw-history__list::-webkit-scrollbar{width:6px}.gcw-history__list::-webkit-scrollbar-track{background:transparent}.gcw-history__list::-webkit-scrollbar-thumb{background-color:var(--gcw-color-gray-300);border-radius:3px}.gcw-history__loading{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--gcw-spacing-3);padding:var(--gcw-spacing-8);color:var(--gcw-color-gray-400);font-size:var(--gcw-font-size-sm)}.gcw-history__empty{display:flex;align-items:center;justify-content:center;padding:var(--gcw-spacing-8);color:var(--gcw-color-gray-400);font-size:var(--gcw-font-size-sm)}.gcw-history__item{display:flex;align-items:center;justify-content:space-between;gap:var(--gcw-spacing-2);width:100%;padding:var(--gcw-spacing-3) var(--gcw-spacing-4);border:none;border-left:3px solid transparent;background:none;cursor:pointer;text-align:left;transition:background-color var(--gcw-transition-fast);font-family:var(--gcw-font-family)}.gcw-history__item:hover{background-color:var(--gcw-color-gray-50)}.gcw-history__item--active{background-color:var(--gcw-color-primary-light)}.gcw-history__item-content{display:flex;flex-direction:column;gap:.125rem;min-width:0;flex:1}.gcw-history__item-title{font-size:var(--gcw-font-size-sm);font-weight:500;color:var(--gcw-color-gray-800);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gcw-history__item-meta{font-size:var(--gcw-font-size-xs);color:var(--gcw-color-gray-400)}.gcw-history__item-delete{flex-shrink:0;width:1.75rem;height:1.75rem;border:none;border-radius:var(--gcw-radius-md);background:transparent;color:var(--gcw-color-gray-300);cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity var(--gcw-transition-fast),color var(--gcw-transition-fast),background-color var(--gcw-transition-fast)}.gcw-history__item:hover .gcw-history__item-delete{opacity:1}.gcw-history__item-delete:hover{color:var(--gcw-color-error);background-color:#ef44441a}.gcw-history__item-delete-icon{width:.875rem;height:.875rem}@keyframes gcw-slide-in-left{0%{opacity:0;transform:translate(-1rem)}to{opacity:1;transform:translate(0)}}.gcw-modal-overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:#0006;display:flex;align-items:center;justify-content:center;z-index:100;animation:gcw-fade-in .15s ease-out;border-radius:var(--gcw-radius-2xl)}.gcw-modal{background:#fff;border-radius:.75rem;padding:1.25rem;margin:1rem;max-width:20rem;width:100%;box-shadow:0 8px 24px #00000026;animation:gcw-scale-in .15s ease-out}.gcw-modal__title{font-size:.9375rem;font-weight:600;color:#1f2937;margin:0 0 .5rem}.gcw-modal__message{font-size:.8125rem;color:#6b7280;line-height:1.5;margin:0 0 1.25rem}.gcw-modal__actions{display:flex;gap:.5rem;justify-content:flex-end}.gcw-modal__btn{padding:.4375rem .875rem;border-radius:.375rem;font-size:.8125rem;font-weight:500;cursor:pointer;border:1px solid #e5e7eb;transition:background-color .15s,border-color .15s}.gcw-modal__btn--cancel{background:#fff;color:#374151}.gcw-modal__btn--cancel:hover{background:#f9fafb;border-color:#d1d5db}.gcw-modal__btn--confirm{background:#3b82f6;color:#fff;border-color:#3b82f6}.gcw-modal__btn--confirm:hover{background:#2563eb;border-color:#2563eb}.gcw-modal__btn--danger{background:#ef4444;border-color:#ef4444}.gcw-modal__btn--danger:hover{background:#dc2626;border-color:#dc2626}@keyframes gcw-fade-in{0%{opacity:0}to{opacity:1}}@keyframes gcw-scale-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}')),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var r=document.createElement("style");r.appendChild(document.createTextNode(':root{--gcw-color-white: #fff;--gcw-color-gray-50: #f9fafb;--gcw-color-gray-100: #f3f4f6;--gcw-color-gray-200: #e5e7eb;--gcw-color-gray-300: #d1d5db;--gcw-color-gray-400: #9ca3af;--gcw-color-gray-500: #6b7280;--gcw-color-gray-600: #4b5563;--gcw-color-gray-700: #374151;--gcw-color-gray-800: #1f2937;--gcw-color-gray-900: #111827;--gcw-color-primary: #3b82f6;--gcw-color-primary-hover: #2563eb;--gcw-color-primary-light: #eff6ff;--gcw-color-error: #ef4444;--gcw-color-success: #22c55e;--gcw-font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;--gcw-font-size-xs: .625rem;--gcw-font-size-sm: .75rem;--gcw-font-size-base: .875rem;--gcw-font-size-lg: 1rem;--gcw-spacing-1: .25rem;--gcw-spacing-2: .5rem;--gcw-spacing-3: .75rem;--gcw-spacing-4: 1rem;--gcw-spacing-6: 1.5rem;--gcw-spacing-8: 2rem;--gcw-spacing-10: 2.5rem;--gcw-spacing-12: 3rem;--gcw-spacing-16: 4rem;--gcw-spacing-20: 5rem;--gcw-radius-sm: .25rem;--gcw-radius-md: .5rem;--gcw-radius-lg: .75rem;--gcw-radius-xl: 1rem;--gcw-radius-2xl: 1.25rem;--gcw-radius-full: 9999px;--gcw-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / .05);--gcw-shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--gcw-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--gcw-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--gcw-shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / .25);--gcw-transition-fast: .15s ease;--gcw-transition-base: .2s ease;--gcw-transition-slow: .3s ease;--gcw-z-widget: 9999}.gcw-widget,.gcw-widget *,.gcw-widget *:before,.gcw-widget *:after{box-sizing:border-box;margin:0;padding:0;font-family:var(--gcw-font-family);line-height:1.5}.gcw-widget{font-family:var(--gcw-font-family);font-size:var(--gcw-font-size-base);line-height:1.5;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:var(--gcw-color-gray-800);text-align:left;letter-spacing:normal;word-spacing:normal;text-transform:none;text-indent:0;text-shadow:none;font-weight:400;font-style:normal}.gcw-container{position:fixed;z-index:var(--gcw-z-widget);display:flex;gap:var(--gcw-spacing-4)}.gcw-container--bottom-right{right:var(--gcw-spacing-4);bottom:var(--gcw-spacing-4);flex-direction:column-reverse;align-items:flex-end}.gcw-container--bottom-left{left:var(--gcw-spacing-4);bottom:var(--gcw-spacing-4);flex-direction:column-reverse;align-items:flex-start}.gcw-container--top-right{right:var(--gcw-spacing-4);top:var(--gcw-spacing-4);flex-direction:column;align-items:flex-end}.gcw-container--top-left{left:var(--gcw-spacing-4);top:var(--gcw-spacing-4);flex-direction:column;align-items:flex-start}.gcw-container--custom{flex-direction:column-reverse;align-items:flex-end}.gcw-container--custom.gcw-container--align-left{align-items:flex-start}.gcw-container--custom.gcw-container--flow-down{flex-direction:column}.gcw-toggle{position:relative;width:3.5rem;height:3.5rem;border:none;border-radius:var(--gcw-radius-full);background-color:var(--gcw-color-primary);color:var(--gcw-color-white);cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:var(--gcw-shadow-lg);transition:transform var(--gcw-transition-base),box-shadow var(--gcw-transition-base)}.gcw-toggle:hover{transform:scale(1.1);box-shadow:var(--gcw-shadow-xl)}.gcw-toggle:active{transform:scale(.95)}.gcw-toggle__icon{width:1.5rem;height:1.5rem;transition:transform var(--gcw-transition-slow)}.gcw-toggle__badge{position:absolute;top:-.25rem;right:-.25rem;width:1rem;height:1rem;border-radius:var(--gcw-radius-full);display:flex;align-items:center;justify-content:center;font-size:var(--gcw-font-size-xs);font-weight:700;animation:gcw-pulse 2s infinite}.gcw-toggle__badge--unread{background-color:var(--gcw-color-error);color:var(--gcw-color-white)}.gcw-toggle__badge--popout{background-color:var(--gcw-color-success)}.gcw-window{position:relative;display:flex;flex-direction:column;background-color:var(--gcw-color-white);border-radius:var(--gcw-radius-2xl);box-shadow:var(--gcw-shadow-2xl);border:1px solid var(--gcw-color-gray-200);overflow:hidden;animation:gcw-slide-up var(--gcw-transition-slow) ease-out}.gcw-window--small{width:365px;height:450px}.gcw-window--medium{width:380px;height:560px}.gcw-window--large{width:480px;height:680px}.gcw-window--fullscreen{width:calc(100vw - 2rem);height:calc(100vh - 6rem);max-width:56rem}.gcw-window{max-height:90vh;transition:width var(--gcw-transition-base),height var(--gcw-transition-base)}.gcw-header{display:flex;align-items:center;justify-content:space-between;padding:var(--gcw-spacing-3) var(--gcw-spacing-4);color:var(--gcw-color-white);flex-shrink:0}.gcw-header__left{display:flex;align-items:center;gap:var(--gcw-spacing-3)}.gcw-header__avatar{width:2.5rem;height:2.5rem;border-radius:var(--gcw-radius-full);background-color:#fff3;display:flex;align-items:center;justify-content:center}.gcw-header__avatar-icon{width:1.25rem;height:1.25rem}.gcw-header__info{display:flex;flex-direction:column;min-width:0;flex:1}.gcw-header__title{font-size:var(--gcw-font-size-base);font-weight:600;line-height:1.4;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gcw-header__subtitle{font-size:var(--gcw-font-size-sm);font-weight:400;line-height:1.4;opacity:.9;margin:0;word-wrap:break-word;overflow-wrap:break-word}.gcw-header__actions{display:flex;align-items:center;gap:.125rem}.gcw-header__btn{width:2rem;height:2rem;border:none;border-radius:var(--gcw-radius-full);background-color:transparent;color:inherit;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background-color var(--gcw-transition-fast)}.gcw-header__btn:hover{background-color:#fff3}.gcw-header__btn-icon{width:1rem;height:1rem}.gcw-header-menu{position:relative}.gcw-header-menu__dropdown{position:absolute;top:calc(100% + .25rem);right:0;min-width:12rem;background-color:var(--gcw-color-white);border-radius:var(--gcw-radius-lg);box-shadow:var(--gcw-shadow-xl);border:1px solid var(--gcw-color-gray-200);padding:var(--gcw-spacing-1) 0;z-index:10;animation:gcw-menu-appear var(--gcw-transition-fast) ease-out}.gcw-header-menu__item{display:flex;align-items:center;gap:var(--gcw-spacing-3);width:100%;padding:var(--gcw-spacing-2) var(--gcw-spacing-3);border:none;background:none;color:var(--gcw-color-gray-700);font-family:var(--gcw-font-family);font-size:var(--gcw-font-size-sm);cursor:pointer;transition:background-color var(--gcw-transition-fast);text-align:left;white-space:nowrap}.gcw-header-menu__item:hover{background-color:var(--gcw-color-gray-100)}.gcw-header-menu__item--danger{color:var(--gcw-color-error)}.gcw-header-menu__item--danger:hover{background-color:#fef2f2}.gcw-header-menu__icon{width:1rem;height:1rem;flex-shrink:0}.gcw-header-menu__divider{height:1px;background-color:var(--gcw-color-gray-200);margin:var(--gcw-spacing-1) 0}@keyframes gcw-menu-appear{0%{opacity:0;transform:translateY(-.25rem)}to{opacity:1;transform:translateY(0)}}.gcw-messages{flex:1;overflow-y:auto;padding:var(--gcw-spacing-4);display:flex;flex-direction:column;gap:var(--gcw-spacing-4)}.gcw-messages::-webkit-scrollbar{width:6px}.gcw-messages::-webkit-scrollbar-track{background:transparent}.gcw-messages::-webkit-scrollbar-thumb{background-color:var(--gcw-color-gray-300);border-radius:3px}.gcw-messages::-webkit-scrollbar-thumb:hover{background-color:var(--gcw-color-gray-400)}.gcw-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:var(--gcw-spacing-6);color:var(--gcw-color-gray-400);text-align:center}.gcw-empty__icon{width:4rem;height:4rem;margin-bottom:var(--gcw-spacing-4);opacity:.5}.gcw-empty__text{font-size:var(--gcw-font-size-base);font-weight:400;line-height:1.5;margin:0}.gcw-session-loading{display:flex;flex-direction:column;align-items:center;gap:var(--gcw-spacing-3)}.gcw-session-loading__spinner{width:2rem;height:2rem;border:3px solid var(--gcw-color-gray-200);border-top-color:var(--gcw-color-primary);border-radius:50%;animation:gcw-spin .8s linear infinite}.gcw-bubble-row{display:flex}.gcw-bubble-row--user{justify-content:flex-end}.gcw-bubble-row--assistant{justify-content:flex-start}.gcw-bubble-wrapper{max-width:85%;display:flex;flex-direction:column}.gcw-bubble-wrapper--user{align-items:flex-end}.gcw-bubble-wrapper--assistant{align-items:flex-start}.gcw-bubble{padding:var(--gcw-spacing-2) var(--gcw-spacing-4);border-radius:var(--gcw-radius-2xl);font-size:var(--gcw-font-size-base);font-weight:400;line-height:1.6;letter-spacing:normal;word-wrap:break-word}.gcw-bubble--user{color:var(--gcw-color-white);border-bottom-right-radius:var(--gcw-radius-sm)}.gcw-bubble--assistant{background-color:var(--gcw-color-gray-100);color:var(--gcw-color-gray-800);border-bottom-left-radius:var(--gcw-radius-sm)}.gcw-bubble__timestamp{font-size:var(--gcw-font-size-xs);color:var(--gcw-color-gray-400);margin-top:var(--gcw-spacing-1);padding:0 var(--gcw-spacing-1)}.gcw-content p{margin-bottom:var(--gcw-spacing-2)}.gcw-content p:last-child{margin-bottom:0}.gcw-content strong{font-weight:600}.gcw-content em{font-style:italic}.gcw-content ul,.gcw-content ol{margin:var(--gcw-spacing-2) 0;padding-left:var(--gcw-spacing-6)}.gcw-content li{margin-bottom:var(--gcw-spacing-1)}.gcw-content code{background-color:#0000001a;padding:.125rem .375rem;border-radius:var(--gcw-radius-sm);font-size:.875em;font-family:SF Mono,Monaco,Consolas,monospace}.gcw-bubble--user .gcw-content code{background-color:#fff3}.gcw-content pre{background-color:var(--gcw-color-gray-800);color:var(--gcw-color-gray-100);padding:var(--gcw-spacing-3);border-radius:var(--gcw-radius-md);overflow-x:auto;margin:var(--gcw-spacing-2) 0}.gcw-content pre code{background-color:transparent;padding:0;font-size:var(--gcw-font-size-sm)}.gcw-content a{color:var(--gcw-color-primary);text-decoration:underline}.gcw-content a:hover{color:var(--gcw-color-primary-hover)}.gcw-bubble--user .gcw-content a{color:#ffffffe6}.gcw-md-heading{font-weight:600;margin-top:var(--gcw-spacing-3);margin-bottom:var(--gcw-spacing-1)}.gcw-md-heading--h2{font-size:var(--gcw-font-size-lg);font-weight:700}.gcw-md-heading--h3,.gcw-md-heading--h4{font-size:var(--gcw-font-size-base)}.gcw-md-heading--h5{font-size:var(--gcw-font-size-sm)}.gcw-md-paragraph{margin-bottom:var(--gcw-spacing-2)}.gcw-md-paragraph:last-child{margin-bottom:0}.gcw-md-list{margin:var(--gcw-spacing-2) 0;padding-left:var(--gcw-spacing-4)}.gcw-md-list--ul{list-style-type:disc}.gcw-md-list--ol{list-style-type:decimal}.gcw-md-list__item{font-size:var(--gcw-font-size-base);margin-bottom:var(--gcw-spacing-1)}.gcw-md-bold{font-weight:600}.gcw-md-italic{font-style:italic}.gcw-md-code{background-color:var(--gcw-color-gray-200);padding:.125rem var(--gcw-spacing-2);border-radius:var(--gcw-radius-sm);font-size:var(--gcw-font-size-sm);font-family:SF Mono,Monaco,Consolas,monospace}.gcw-bubble--user .gcw-md-code{background-color:#fff3}.gcw-md-code-block{background-color:var(--gcw-color-gray-800);color:var(--gcw-color-gray-100);padding:var(--gcw-spacing-3);border-radius:var(--gcw-radius-lg);font-size:var(--gcw-font-size-sm);overflow-x:auto;margin:var(--gcw-spacing-2) 0}.gcw-md-code-block code{font-family:SF Mono,Monaco,Consolas,monospace}.gcw-md-link{color:var(--gcw-color-primary);text-decoration:underline}.gcw-md-link:hover{color:var(--gcw-color-primary-hover)}.gcw-bubble--user .gcw-md-link{color:#ffffffe6}.gcw-sources{display:flex;flex-wrap:wrap;gap:var(--gcw-spacing-2);margin-top:var(--gcw-spacing-2)}.gcw-source{display:inline-flex;align-items:center;gap:var(--gcw-spacing-1);padding:var(--gcw-spacing-1) var(--gcw-spacing-2);border-radius:var(--gcw-radius-full);background-color:var(--gcw-color-primary-light);color:var(--gcw-color-primary);font-size:var(--gcw-font-size-sm);text-decoration:none;transition:background-color var(--gcw-transition-fast)}.gcw-source:hover{background-color:#dbeafe}.gcw-source__icon{width:.75rem;height:.75rem}.gcw-typing{display:flex;justify-content:flex-start}.gcw-typing__bubble{background-color:var(--gcw-color-gray-100);padding:var(--gcw-spacing-3) var(--gcw-spacing-4);border-radius:var(--gcw-radius-2xl);border-bottom-left-radius:var(--gcw-radius-sm)}.gcw-typing__dots{display:flex;gap:var(--gcw-spacing-1)}.gcw-typing__dot{width:.5rem;height:.5rem;background-color:var(--gcw-color-gray-400);border-radius:var(--gcw-radius-full);animation:gcw-typing-bounce 1.4s infinite ease-in-out both}.gcw-typing__dot:nth-child(1){animation-delay:-.32s}.gcw-typing__dot:nth-child(2){animation-delay:-.16s}.gcw-input-area{padding:var(--gcw-spacing-3);border-top:1px solid var(--gcw-color-gray-200);background-color:var(--gcw-color-white);flex-shrink:0}.gcw-input-row{display:flex;align-items:flex-end;gap:var(--gcw-spacing-2)}.gcw-input{flex:1;min-height:44px;max-height:120px;padding:var(--gcw-spacing-2) var(--gcw-spacing-4);border:1px solid var(--gcw-color-gray-200);border-radius:var(--gcw-radius-xl);background-color:var(--gcw-color-white);color:var(--gcw-color-gray-800);font-family:var(--gcw-font-family);font-size:var(--gcw-font-size-base);font-weight:400;line-height:1.5;letter-spacing:normal;resize:none;outline:none;transition:border-color var(--gcw-transition-fast),box-shadow var(--gcw-transition-fast)}.gcw-input:focus{border-color:var(--gcw-color-primary);box-shadow:0 0 0 3px #3b82f61a}.gcw-input:disabled{background-color:var(--gcw-color-gray-50);cursor:not-allowed}.gcw-input::placeholder{color:var(--gcw-color-gray-400)}.gcw-send-btn{width:2.5rem;height:2.5rem;flex-shrink:0;border:none;border-radius:var(--gcw-radius-lg);color:var(--gcw-color-white);cursor:pointer;display:flex;align-items:center;justify-content:center;transition:opacity var(--gcw-transition-fast),transform var(--gcw-transition-fast)}.gcw-send-btn:hover:not(:disabled){opacity:.9}.gcw-send-btn:active:not(:disabled){transform:scale(.95)}.gcw-send-btn:disabled{opacity:.5;cursor:not-allowed}.gcw-send-btn__icon{width:1.25rem;height:1.25rem}.gcw-input-hint{font-size:var(--gcw-font-size-xs);color:var(--gcw-color-gray-400);text-align:center;margin-top:var(--gcw-spacing-2)}@keyframes gcw-slide-up{0%{opacity:0;transform:translateY(1rem)}to{opacity:1;transform:translateY(0)}}@keyframes gcw-pulse{0%,to{opacity:1}50%{opacity:.5}}@keyframes gcw-typing-bounce{0%,80%,to{transform:scale(0)}40%{transform:scale(1)}}@keyframes gcw-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.gcw-spin{animation:gcw-spin 1s linear infinite}.gcw-history{display:flex;flex-direction:column;flex:1;overflow:hidden;animation:gcw-slide-in-left var(--gcw-transition-base) ease-out}.gcw-history__header{display:flex;align-items:center;gap:var(--gcw-spacing-3);padding:var(--gcw-spacing-2) var(--gcw-spacing-3);color:var(--gcw-color-white);flex-shrink:0}.gcw-history__title{flex:1;font-size:var(--gcw-font-size-base);font-weight:600;margin:0}.gcw-history__list{flex:1;overflow-y:auto;padding:var(--gcw-spacing-2) 0}.gcw-history__list::-webkit-scrollbar{width:6px}.gcw-history__list::-webkit-scrollbar-track{background:transparent}.gcw-history__list::-webkit-scrollbar-thumb{background-color:var(--gcw-color-gray-300);border-radius:3px}.gcw-history__loading{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--gcw-spacing-3);padding:var(--gcw-spacing-8);color:var(--gcw-color-gray-400);font-size:var(--gcw-font-size-sm)}.gcw-history__empty{display:flex;align-items:center;justify-content:center;padding:var(--gcw-spacing-8);color:var(--gcw-color-gray-400);font-size:var(--gcw-font-size-sm)}.gcw-history__item{display:flex;align-items:center;justify-content:space-between;gap:var(--gcw-spacing-2);width:100%;padding:var(--gcw-spacing-3) var(--gcw-spacing-4);border:none;border-left:3px solid transparent;background:none;cursor:pointer;text-align:left;transition:background-color var(--gcw-transition-fast);font-family:var(--gcw-font-family)}.gcw-history__item:hover{background-color:var(--gcw-color-gray-50)}.gcw-history__item--active{background-color:var(--gcw-color-primary-light)}.gcw-history__item-content{display:flex;flex-direction:column;gap:.125rem;min-width:0;flex:1}.gcw-history__item-title{font-size:var(--gcw-font-size-sm);font-weight:500;color:var(--gcw-color-gray-800);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gcw-history__item-meta{font-size:var(--gcw-font-size-xs);color:var(--gcw-color-gray-400)}.gcw-history__item-delete{flex-shrink:0;width:1.75rem;height:1.75rem;border:none;border-radius:var(--gcw-radius-md);background:transparent;color:var(--gcw-color-gray-300);cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity var(--gcw-transition-fast),color var(--gcw-transition-fast),background-color var(--gcw-transition-fast)}.gcw-history__item:hover .gcw-history__item-delete{opacity:1}.gcw-history__item-delete:hover{color:var(--gcw-color-error);background-color:#ef44441a}.gcw-history__item-delete-icon{width:.875rem;height:.875rem}@keyframes gcw-slide-in-left{0%{opacity:0;transform:translate(-1rem)}to{opacity:1;transform:translate(0)}}.gcw-modal-overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:#0006;display:flex;align-items:center;justify-content:center;z-index:100;animation:gcw-fade-in .15s ease-out;border-radius:var(--gcw-radius-2xl)}.gcw-modal{background:#fff;border-radius:.75rem;padding:1.25rem;margin:1rem;max-width:20rem;width:100%;box-shadow:0 8px 24px #00000026;animation:gcw-scale-in .15s ease-out}.gcw-modal__title{font-size:.9375rem;font-weight:600;color:#1f2937;margin:0 0 .5rem}.gcw-modal__message{font-size:.8125rem;color:#6b7280;line-height:1.5;margin:0 0 1.25rem}.gcw-modal__actions{display:flex;gap:.5rem;justify-content:flex-end}.gcw-modal__btn{padding:.4375rem .875rem;border-radius:.375rem;font-size:.8125rem;font-weight:500;cursor:pointer;border:1px solid #e5e7eb;transition:background-color .15s,border-color .15s}.gcw-modal__btn--cancel{background:#fff;color:#374151}.gcw-modal__btn--cancel:hover{background:#f9fafb;border-color:#d1d5db}.gcw-modal__btn--confirm{background:#3b82f6;color:#fff;border-color:#3b82f6}.gcw-modal__btn--confirm:hover{background:#2563eb;border-color:#2563eb}.gcw-modal__btn--danger{background:#ef4444;border-color:#ef4444}.gcw-modal__btn--danger:hover{background:#dc2626;border-color:#dc2626}@keyframes gcw-fade-in{0%{opacity:0}to{opacity:1}}@keyframes gcw-scale-in{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}')),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
|
+
import { jsxs as h, jsx as n, Fragment as ve } from "react/jsx-runtime";
|
|
3
|
+
import ye, { useState as v, useRef as H, useCallback as L, useEffect as M } from "react";
|
|
4
|
+
function ke({ authUrl: e, headers: s = {} }) {
|
|
5
|
+
const [t, a] = v(!e), [i, o] = v(!!e), [r, u] = v(null), [c, l] = v(null), m = H(s);
|
|
6
|
+
m.current = s;
|
|
7
|
+
const f = L(async (S) => {
|
|
8
|
+
if (!e) return !0;
|
|
9
|
+
try {
|
|
10
|
+
const p = await fetch(e, {
|
|
11
|
+
method: "GET",
|
|
12
|
+
headers: {
|
|
13
|
+
Accept: "application/json",
|
|
14
|
+
...m.current
|
|
15
|
+
},
|
|
16
|
+
credentials: "include",
|
|
17
|
+
signal: S
|
|
18
|
+
});
|
|
19
|
+
if (p.ok) {
|
|
20
|
+
const g = await p.json(), y = {
|
|
21
|
+
id: g.Id ?? g.id ?? "",
|
|
22
|
+
email: g.Email ?? g.email ?? "",
|
|
23
|
+
fullName: g.FullName ?? g.fullName ?? "",
|
|
24
|
+
roles: Array.isArray(g.Roles ?? g.roles) ? (g.Roles ?? g.roles).map(
|
|
25
|
+
(d) => typeof d == "string" ? d : d.name ?? ""
|
|
26
|
+
) : []
|
|
27
|
+
};
|
|
28
|
+
return u(y), a(!0), l(null), !0;
|
|
29
|
+
}
|
|
30
|
+
return u(null), a(!1), l(p.status === 401 ? "Niet ingelogd" : "Geen toegang"), !1;
|
|
31
|
+
} catch (p) {
|
|
32
|
+
return p instanceof DOMException && p.name === "AbortError" || (u(null), a(!1), l("Authenticatie verificatie mislukt")), !1;
|
|
33
|
+
}
|
|
34
|
+
}, [e]);
|
|
35
|
+
M(() => {
|
|
36
|
+
if (!e) return;
|
|
37
|
+
const S = new AbortController();
|
|
38
|
+
return (async () => {
|
|
39
|
+
o(!0), await f(S.signal), S.signal.aborted || o(!1);
|
|
40
|
+
})(), () => {
|
|
41
|
+
S.abort();
|
|
42
|
+
};
|
|
43
|
+
}, [e, f]);
|
|
44
|
+
const N = L(async () => f(), [f]);
|
|
45
|
+
return { isAuthenticated: t, isLoading: i, user: r, error: c, recheckAuth: N };
|
|
46
|
+
}
|
|
47
|
+
const _e = "gcw_session_", xe = "gcw_popout_", Ne = "gcw_read_";
|
|
48
|
+
function Q(e) {
|
|
49
|
+
return `${_e}${e || "default"}`;
|
|
7
50
|
}
|
|
8
|
-
function
|
|
51
|
+
function Se(e, s) {
|
|
9
52
|
try {
|
|
10
|
-
const
|
|
11
|
-
e ? localStorage.setItem(
|
|
12
|
-
} catch (
|
|
13
|
-
console.warn("Failed to save session ID:",
|
|
53
|
+
const t = Q(s);
|
|
54
|
+
e ? localStorage.setItem(t, e) : localStorage.removeItem(t);
|
|
55
|
+
} catch (t) {
|
|
56
|
+
console.warn("Failed to save session ID:", t);
|
|
14
57
|
}
|
|
15
58
|
}
|
|
16
|
-
function
|
|
59
|
+
function Me(e) {
|
|
17
60
|
try {
|
|
18
|
-
return localStorage.getItem(
|
|
61
|
+
return localStorage.getItem(Q(e));
|
|
19
62
|
} catch {
|
|
20
63
|
return null;
|
|
21
64
|
}
|
|
22
65
|
}
|
|
23
|
-
function
|
|
66
|
+
function O(e) {
|
|
24
67
|
try {
|
|
25
|
-
localStorage.removeItem(
|
|
68
|
+
localStorage.removeItem(Q(e)), localStorage.removeItem(Z(e));
|
|
26
69
|
} catch (s) {
|
|
27
70
|
console.warn("Failed to clear session:", s);
|
|
28
71
|
}
|
|
29
72
|
}
|
|
30
|
-
function
|
|
31
|
-
const
|
|
32
|
-
i.key ===
|
|
73
|
+
function Ce(e, s) {
|
|
74
|
+
const t = Q(e), a = (i) => {
|
|
75
|
+
i.key === t && s(i.newValue);
|
|
33
76
|
};
|
|
34
77
|
return window.addEventListener("storage", a), () => window.removeEventListener("storage", a);
|
|
35
78
|
}
|
|
36
|
-
function
|
|
37
|
-
return `${
|
|
79
|
+
function ne(e) {
|
|
80
|
+
return `${xe}${e || "default"}`;
|
|
38
81
|
}
|
|
39
|
-
function
|
|
82
|
+
function J(e, s) {
|
|
40
83
|
try {
|
|
41
|
-
e ? localStorage.setItem(
|
|
42
|
-
} catch (
|
|
43
|
-
console.warn("Failed to save popout state:",
|
|
84
|
+
e ? localStorage.setItem(ne(s), "true") : localStorage.removeItem(ne(s));
|
|
85
|
+
} catch (t) {
|
|
86
|
+
console.warn("Failed to save popout state:", t);
|
|
44
87
|
}
|
|
45
88
|
}
|
|
46
|
-
function
|
|
89
|
+
function Ie(e) {
|
|
47
90
|
try {
|
|
48
|
-
return localStorage.getItem(
|
|
91
|
+
return localStorage.getItem(ne(e)) === "true";
|
|
49
92
|
} catch {
|
|
50
93
|
return !1;
|
|
51
94
|
}
|
|
52
95
|
}
|
|
53
|
-
function
|
|
54
|
-
return `${
|
|
96
|
+
function Z(e) {
|
|
97
|
+
return `${Ne}${e || "default"}`;
|
|
55
98
|
}
|
|
56
|
-
function
|
|
99
|
+
function Y(e, s) {
|
|
57
100
|
try {
|
|
58
|
-
e > 0 ? localStorage.setItem(
|
|
59
|
-
} catch (
|
|
60
|
-
console.warn("Failed to save read state:",
|
|
101
|
+
e > 0 ? localStorage.setItem(Z(s), String(e)) : localStorage.removeItem(Z(s));
|
|
102
|
+
} catch (t) {
|
|
103
|
+
console.warn("Failed to save read state:", t);
|
|
61
104
|
}
|
|
62
105
|
}
|
|
63
|
-
function
|
|
106
|
+
function Le(e) {
|
|
64
107
|
try {
|
|
65
|
-
const s = localStorage.getItem(
|
|
108
|
+
const s = localStorage.getItem(Z(e));
|
|
66
109
|
return s && parseInt(s, 10) || 0;
|
|
67
110
|
} catch {
|
|
68
111
|
return 0;
|
|
69
112
|
}
|
|
70
113
|
}
|
|
71
|
-
function
|
|
72
|
-
const { apiUrl: s, tenantId:
|
|
114
|
+
function Ee(e) {
|
|
115
|
+
const { apiUrl: s, tenantId: t, sessionId: a, headers: i = {}, onError: o, persist: r = !0 } = e, [u, c] = v([]), [l, m] = v(!1), [f, N] = v(!1), [S, p] = v(null), [g, y] = v(() => a || (r ? Me(t) : null)), d = H(null), k = H(!1), w = L(() => s.replace(/\/chat\/?$/, ""), [s]), z = L(async (b) => {
|
|
73
116
|
N(!0);
|
|
74
117
|
try {
|
|
75
|
-
const
|
|
118
|
+
const _ = w(), T = await fetch(`${_}/sessions/${b}`, {
|
|
76
119
|
method: "GET",
|
|
77
120
|
headers: {
|
|
78
121
|
"Content-Type": "application/json",
|
|
79
|
-
...
|
|
122
|
+
...t && { "X-Tenant-ID": t },
|
|
80
123
|
...i
|
|
81
124
|
}
|
|
82
125
|
});
|
|
83
|
-
if (
|
|
126
|
+
if (T.status === 500)
|
|
84
127
|
return console.error("Server error while loading session, will retry later"), !1;
|
|
85
|
-
if (
|
|
86
|
-
return console.info("Unauthorized while loading session, clearing session"), r &&
|
|
87
|
-
if (
|
|
88
|
-
return console.info("Session not found, starting fresh"), r &&
|
|
89
|
-
if (
|
|
128
|
+
if (T.status === 401)
|
|
129
|
+
return console.info("Unauthorized while loading session, clearing session"), r && O(t), y(null), !1;
|
|
130
|
+
if (T.status === 404)
|
|
131
|
+
return console.info("Session not found, starting fresh"), r && O(t), y(null), !1;
|
|
132
|
+
if (T.status === 429)
|
|
90
133
|
return console.info("Rate limited while loading session, will retry later"), !1;
|
|
91
|
-
if (!
|
|
92
|
-
throw new Error(`Failed to load session: ${
|
|
93
|
-
const
|
|
94
|
-
var
|
|
134
|
+
if (!T.ok)
|
|
135
|
+
throw new Error(`Failed to load session: ${T.status}`);
|
|
136
|
+
const $ = (await T.json()).messages.map((A) => {
|
|
137
|
+
var R;
|
|
95
138
|
return {
|
|
96
|
-
id:
|
|
97
|
-
role:
|
|
98
|
-
content:
|
|
99
|
-
timestamp: new Date(
|
|
100
|
-
sources: (
|
|
101
|
-
title:
|
|
102
|
-
url:
|
|
103
|
-
relevance:
|
|
139
|
+
id: A.id,
|
|
140
|
+
role: A.role,
|
|
141
|
+
content: A.content,
|
|
142
|
+
timestamp: new Date(A.timestamp),
|
|
143
|
+
sources: (R = A.citations) == null ? void 0 : R.map((I) => ({
|
|
144
|
+
title: I.title,
|
|
145
|
+
url: I.url,
|
|
146
|
+
relevance: I.relevance_score
|
|
104
147
|
}))
|
|
105
148
|
};
|
|
106
149
|
});
|
|
107
|
-
return c(
|
|
108
|
-
} catch (
|
|
109
|
-
return console.error("Failed to load session:",
|
|
150
|
+
return c($), y(b), !0;
|
|
151
|
+
} catch (_) {
|
|
152
|
+
return console.error("Failed to load session:", _), r && O(t), y(null), !1;
|
|
110
153
|
} finally {
|
|
111
154
|
N(!1);
|
|
112
155
|
}
|
|
113
|
-
}, [
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}, []),
|
|
117
|
-
r &&
|
|
118
|
-
}, [g,
|
|
119
|
-
|
|
120
|
-
}) : void 0, [
|
|
121
|
-
const
|
|
122
|
-
var
|
|
123
|
-
if (!
|
|
124
|
-
|
|
125
|
-
const
|
|
156
|
+
}, [w, t, i, r]);
|
|
157
|
+
M(() => {
|
|
158
|
+
k.current || (k.current = !0, g && z(g));
|
|
159
|
+
}, []), M(() => {
|
|
160
|
+
r && Se(g, t);
|
|
161
|
+
}, [g, t, r]), M(() => r ? Ce(t, (_) => {
|
|
162
|
+
_ && _ !== g ? z(_) : _ || (c([]), y(null));
|
|
163
|
+
}) : void 0, [t, r, g, z]);
|
|
164
|
+
const W = L(async (b) => {
|
|
165
|
+
var T;
|
|
166
|
+
if (!b.trim() || l) return;
|
|
167
|
+
d.current && d.current.abort(), d.current = new AbortController();
|
|
168
|
+
const _ = {
|
|
126
169
|
id: `temp_${Date.now()}`,
|
|
127
170
|
role: "user",
|
|
128
|
-
content:
|
|
171
|
+
content: b.trim(),
|
|
129
172
|
timestamp: /* @__PURE__ */ new Date()
|
|
130
173
|
};
|
|
131
|
-
c((
|
|
174
|
+
c((C) => [...C, _]), m(!0), p(null);
|
|
132
175
|
try {
|
|
133
|
-
const
|
|
176
|
+
const C = await fetch(s, {
|
|
134
177
|
method: "POST",
|
|
135
178
|
headers: {
|
|
136
179
|
"Content-Type": "application/json",
|
|
137
|
-
...
|
|
180
|
+
...t && { "X-Tenant-ID": t },
|
|
138
181
|
...i
|
|
139
182
|
},
|
|
140
183
|
body: JSON.stringify({
|
|
141
|
-
message:
|
|
184
|
+
message: b.trim(),
|
|
142
185
|
session_id: g
|
|
143
186
|
}),
|
|
144
|
-
signal:
|
|
187
|
+
signal: d.current.signal
|
|
145
188
|
});
|
|
146
|
-
if (!
|
|
147
|
-
if (
|
|
148
|
-
|
|
149
|
-
const O = {
|
|
189
|
+
if (!C.ok) {
|
|
190
|
+
if (C.status === 500) {
|
|
191
|
+
const j = {
|
|
150
192
|
id: `temp_${Date.now()}_servererror`,
|
|
151
193
|
role: "assistant",
|
|
152
194
|
content: "Er is een fout opgetreden bij het verwerken van je bericht. Probeer het later opnieuw.",
|
|
153
195
|
timestamp: /* @__PURE__ */ new Date()
|
|
154
196
|
};
|
|
155
|
-
c((
|
|
197
|
+
c((P) => [...P, j]);
|
|
156
198
|
return;
|
|
157
199
|
}
|
|
158
|
-
if (
|
|
159
|
-
const
|
|
200
|
+
if (C.status === 401) {
|
|
201
|
+
const j = {
|
|
160
202
|
id: `temp_${Date.now()}_unauthorized`,
|
|
161
203
|
role: "assistant",
|
|
162
204
|
content: "Je sessie is verlopen of je hebt geen toegang. Vernieuw de pagina om opnieuw te verbinden.",
|
|
163
205
|
timestamp: /* @__PURE__ */ new Date()
|
|
164
206
|
};
|
|
165
|
-
c((
|
|
207
|
+
c((P) => [...P, j]), r && O(t), y(null);
|
|
166
208
|
return;
|
|
167
209
|
}
|
|
168
|
-
if (
|
|
169
|
-
const
|
|
210
|
+
if (C.status === 429) {
|
|
211
|
+
const j = {
|
|
170
212
|
id: `temp_${Date.now()}_ratelimit`,
|
|
171
213
|
role: "assistant",
|
|
172
214
|
content: "Je stuurt te veel berichten achter elkaar. Wacht even en probeer het dan opnieuw.",
|
|
173
215
|
timestamp: /* @__PURE__ */ new Date()
|
|
174
216
|
};
|
|
175
|
-
c((
|
|
217
|
+
c((P) => [...P, j]);
|
|
176
218
|
return;
|
|
177
219
|
}
|
|
178
|
-
const
|
|
179
|
-
throw new Error(
|
|
220
|
+
const I = await C.json().catch(() => ({}));
|
|
221
|
+
throw new Error(I.detail || `Request failed with status ${C.status}`);
|
|
180
222
|
}
|
|
181
|
-
const
|
|
182
|
-
title:
|
|
183
|
-
url:
|
|
184
|
-
relevance:
|
|
185
|
-
})),
|
|
223
|
+
const $ = await C.json(), A = (T = $.message.citations) == null ? void 0 : T.map((I) => ({
|
|
224
|
+
title: I.title,
|
|
225
|
+
url: I.url,
|
|
226
|
+
relevance: I.relevance_score
|
|
227
|
+
})), R = {
|
|
186
228
|
id: `temp_${Date.now()}_assistant`,
|
|
187
229
|
role: "assistant",
|
|
188
|
-
content:
|
|
230
|
+
content: $.message.content,
|
|
189
231
|
timestamp: /* @__PURE__ */ new Date(),
|
|
190
|
-
sources:
|
|
232
|
+
sources: A
|
|
191
233
|
};
|
|
192
|
-
c((
|
|
193
|
-
} catch (
|
|
194
|
-
if (
|
|
234
|
+
c((I) => [...I, R]), $.session_id && y($.session_id);
|
|
235
|
+
} catch (C) {
|
|
236
|
+
if (C.name === "AbortError")
|
|
195
237
|
return;
|
|
196
|
-
const
|
|
197
|
-
|
|
238
|
+
const $ = C instanceof Error ? C : new Error("An error occurred");
|
|
239
|
+
p($), o == null || o($);
|
|
198
240
|
} finally {
|
|
199
|
-
m(!1),
|
|
241
|
+
m(!1), d.current = null;
|
|
200
242
|
}
|
|
201
|
-
}, [s,
|
|
202
|
-
c([]),
|
|
203
|
-
}, [r,
|
|
243
|
+
}, [s, t, g, i, l, o]), U = L(() => {
|
|
244
|
+
c([]), y(null), p(null), k.current = !1, r && O(t);
|
|
245
|
+
}, [r, t]), F = L(async () => {
|
|
204
246
|
if (g)
|
|
205
247
|
try {
|
|
206
|
-
const
|
|
207
|
-
await fetch(`${
|
|
248
|
+
const b = w();
|
|
249
|
+
await fetch(`${b}/sessions/${g}`, {
|
|
208
250
|
method: "DELETE",
|
|
209
251
|
headers: {
|
|
210
252
|
"Content-Type": "application/json",
|
|
211
|
-
...
|
|
253
|
+
...t && { "X-Tenant-ID": t },
|
|
212
254
|
...i
|
|
213
255
|
}
|
|
214
256
|
});
|
|
215
|
-
} catch (
|
|
216
|
-
console.error("Failed to delete session:",
|
|
257
|
+
} catch (b) {
|
|
258
|
+
console.error("Failed to delete session:", b);
|
|
217
259
|
}
|
|
218
|
-
c([]),
|
|
219
|
-
}, [g,
|
|
260
|
+
c([]), y(null), p(null), k.current = !1, r && O(t);
|
|
261
|
+
}, [g, w, t, i, r]), B = L(async (b) => {
|
|
220
262
|
try {
|
|
221
|
-
const
|
|
222
|
-
await fetch(`${
|
|
263
|
+
const _ = w();
|
|
264
|
+
await fetch(`${_}/sessions/${b}`, {
|
|
223
265
|
method: "DELETE",
|
|
224
266
|
headers: {
|
|
225
267
|
"Content-Type": "application/json",
|
|
226
|
-
...
|
|
268
|
+
...t && { "X-Tenant-ID": t },
|
|
227
269
|
...i
|
|
228
270
|
}
|
|
229
271
|
});
|
|
230
|
-
} catch (
|
|
231
|
-
console.error("Failed to delete session:",
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
}, [
|
|
235
|
-
c([]),
|
|
236
|
-
}, [r,
|
|
237
|
-
await
|
|
238
|
-
}, [
|
|
272
|
+
} catch (_) {
|
|
273
|
+
console.error("Failed to delete session:", _);
|
|
274
|
+
}
|
|
275
|
+
b === g && (c([]), y(null), p(null), k.current = !1, r && O(t));
|
|
276
|
+
}, [w, t, i, g, r]), x = L(() => {
|
|
277
|
+
c([]), y(null), p(null), k.current = !1, r && O(t);
|
|
278
|
+
}, [r, t]), ee = L(async (b) => {
|
|
279
|
+
await z(b);
|
|
280
|
+
}, [z]), te = L(async () => {
|
|
239
281
|
try {
|
|
240
|
-
const
|
|
282
|
+
const b = w(), _ = await fetch(`${b}/sessions`, {
|
|
241
283
|
method: "GET",
|
|
242
284
|
headers: {
|
|
243
285
|
"Content-Type": "application/json",
|
|
244
|
-
...
|
|
286
|
+
...t && { "X-Tenant-ID": t },
|
|
245
287
|
...i
|
|
246
288
|
}
|
|
247
289
|
});
|
|
248
|
-
return
|
|
249
|
-
} catch (
|
|
250
|
-
return console.error("Failed to list sessions:",
|
|
290
|
+
return _.ok ? await _.json() : (console.error("Failed to list sessions:", _.status), []);
|
|
291
|
+
} catch (b) {
|
|
292
|
+
return console.error("Failed to list sessions:", b), [];
|
|
251
293
|
}
|
|
252
|
-
}, [
|
|
294
|
+
}, [w, t, i]);
|
|
253
295
|
return {
|
|
254
|
-
messages:
|
|
296
|
+
messages: u,
|
|
255
297
|
isLoading: l,
|
|
256
298
|
isLoadingSession: f,
|
|
257
|
-
error:
|
|
258
|
-
sendMessage:
|
|
259
|
-
clearMessages:
|
|
260
|
-
deleteSession:
|
|
261
|
-
deleteSessionById:
|
|
262
|
-
startNewSession:
|
|
263
|
-
switchSession:
|
|
264
|
-
listSessions:
|
|
299
|
+
error: S,
|
|
300
|
+
sendMessage: W,
|
|
301
|
+
clearMessages: U,
|
|
302
|
+
deleteSession: F,
|
|
303
|
+
deleteSessionById: B,
|
|
304
|
+
startNewSession: x,
|
|
305
|
+
switchSession: ee,
|
|
306
|
+
listSessions: te,
|
|
265
307
|
sessionId: g
|
|
266
308
|
};
|
|
267
309
|
}
|
|
268
|
-
let
|
|
269
|
-
function
|
|
270
|
-
const [a, i] =
|
|
271
|
-
|
|
310
|
+
let X = null;
|
|
311
|
+
function Te(e, s, t) {
|
|
312
|
+
const [a, i] = v(() => Ie(e.tenantId)), o = H(X);
|
|
313
|
+
M(() => {
|
|
272
314
|
if (a && !o.current) {
|
|
273
315
|
const l = window.open("", "GeoAppsChatPopout");
|
|
274
|
-
l && l.location.href !== "about:blank" && !l.closed ? (o.current = l,
|
|
316
|
+
l && l.location.href !== "about:blank" && !l.closed ? (o.current = l, X = l) : (i(!1), J(!1, e.tenantId));
|
|
275
317
|
}
|
|
276
|
-
}, [a, e.tenantId]),
|
|
318
|
+
}, [a, e.tenantId]), M(() => {
|
|
277
319
|
if (!o.current) return;
|
|
278
320
|
const l = setInterval(() => {
|
|
279
321
|
var m;
|
|
280
|
-
(m = o.current) != null && m.closed && (i(!1), o.current = null,
|
|
322
|
+
(m = o.current) != null && m.closed && (i(!1), o.current = null, X = null, J(!1, e.tenantId), t == null || t());
|
|
281
323
|
}, 500);
|
|
282
324
|
return () => clearInterval(l);
|
|
283
|
-
}, [e.tenantId,
|
|
284
|
-
const r =
|
|
325
|
+
}, [e.tenantId, t]);
|
|
326
|
+
const r = L(() => {
|
|
285
327
|
if (o.current && !o.current.closed) {
|
|
286
328
|
o.current.focus();
|
|
287
329
|
return;
|
|
@@ -291,240 +333,253 @@ function Ne(e, s, n) {
|
|
|
291
333
|
medium: { width: 440, height: 660 },
|
|
292
334
|
large: { width: 560, height: 780 },
|
|
293
335
|
fullscreen: { width: 700, height: 800 }
|
|
294
|
-
}, { width: m, height: f } = l[s], N = (window.screen.width - m) / 2,
|
|
336
|
+
}, { width: m, height: f } = l[s], N = (window.screen.width - m) / 2, S = (window.screen.height - f) / 2, p = window.open(
|
|
295
337
|
"",
|
|
296
338
|
"GeoAppsChatPopout",
|
|
297
|
-
`width=${m},height=${f},left=${N},top=${
|
|
339
|
+
`width=${m},height=${f},left=${N},top=${S},resizable=yes,scrollbars=no`
|
|
298
340
|
);
|
|
299
|
-
if (!
|
|
341
|
+
if (!p) {
|
|
300
342
|
console.error("Failed to open popup window. Check if popups are blocked.");
|
|
301
343
|
return;
|
|
302
344
|
}
|
|
303
|
-
|
|
304
|
-
}, [e, s]),
|
|
305
|
-
o.current && !o.current.closed && o.current.close(), o.current = null,
|
|
306
|
-
}, [e.tenantId]), c =
|
|
345
|
+
p.__CHAT_CONFIG__ = e, p.document.write(Xe(e)), p.document.close(), o.current = p, X = p, i(!0), J(!0, e.tenantId);
|
|
346
|
+
}, [e, s]), u = L(() => {
|
|
347
|
+
o.current && !o.current.closed && o.current.close(), o.current = null, X = null, i(!1), J(!1, e.tenantId);
|
|
348
|
+
}, [e.tenantId]), c = L(() => {
|
|
307
349
|
o.current && !o.current.closed && o.current.focus();
|
|
308
350
|
}, []);
|
|
309
351
|
return {
|
|
310
352
|
isPoppedOut: a,
|
|
311
353
|
openPopout: r,
|
|
312
|
-
closePopout:
|
|
354
|
+
closePopout: u,
|
|
313
355
|
focusPopout: c
|
|
314
356
|
};
|
|
315
357
|
}
|
|
316
|
-
const
|
|
317
|
-
function
|
|
318
|
-
return typeof e == "string" &&
|
|
358
|
+
const $e = ["bottom-right", "bottom-left", "top-right", "top-left"];
|
|
359
|
+
function je(e) {
|
|
360
|
+
return typeof e == "string" && $e.includes(e);
|
|
319
361
|
}
|
|
320
|
-
function
|
|
321
|
-
if (
|
|
362
|
+
function De(e) {
|
|
363
|
+
if (je(e))
|
|
322
364
|
return { className: `gcw-container--${e}`, style: {} };
|
|
323
|
-
const s = e,
|
|
324
|
-
return s.top != null && (
|
|
365
|
+
const s = e, t = {}, a = ["gcw-container--custom"];
|
|
366
|
+
return s.top != null && (t.top = s.top), s.bottom != null && (t.bottom = s.bottom), s.left != null && (t.left = s.left), s.right != null && (t.right = s.right), s.top != null && s.bottom == null && a.push("gcw-container--flow-down"), s.left != null && s.right == null && a.push("gcw-container--align-left"), { className: a.join(" "), style: t };
|
|
325
367
|
}
|
|
326
|
-
function
|
|
368
|
+
function it({
|
|
327
369
|
apiUrl: e,
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
370
|
+
authUrl: s,
|
|
371
|
+
tenantId: t,
|
|
372
|
+
title: a = "Chat Assistent",
|
|
373
|
+
subtitle: i = "Hoe kan ik je helpen?",
|
|
374
|
+
placeholder: o = "Typ een bericht...",
|
|
375
|
+
greeting: r,
|
|
376
|
+
primaryColor: u = "#3b82f6",
|
|
377
|
+
position: c = "bottom-right",
|
|
378
|
+
defaultOpen: l = !1,
|
|
379
|
+
defaultSize: m = "medium",
|
|
380
|
+
headers: f,
|
|
381
|
+
onOpen: N,
|
|
382
|
+
onClose: S,
|
|
383
|
+
onMessageSent: p,
|
|
384
|
+
onResponseReceived: g
|
|
342
385
|
}) {
|
|
343
|
-
const [
|
|
386
|
+
const { isAuthenticated: y, isLoading: d, recheckAuth: k } = ke({ authUrl: s, headers: f }), [w, z] = v(l), [W, U] = v(m), [F, B] = v(!1), { messages: x, isLoading: ee, isLoadingSession: te, sendMessage: b, deleteSession: _, deleteSessionById: T, startNewSession: C, switchSession: $, listSessions: A, sessionId: R } = Ee({
|
|
344
387
|
apiUrl: e,
|
|
345
|
-
tenantId:
|
|
346
|
-
headers:
|
|
347
|
-
}), [
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
}, [
|
|
351
|
-
|
|
352
|
-
}, [
|
|
353
|
-
|
|
388
|
+
tenantId: t,
|
|
389
|
+
headers: f
|
|
390
|
+
}), [I, j] = v(() => x.length > 0), [P, K] = v([]);
|
|
391
|
+
M(() => {
|
|
392
|
+
w && r && !I && x.length === 0 && j(!0);
|
|
393
|
+
}, [w, r, I, x.length]), M(() => {
|
|
394
|
+
x.length > 0 && j(!0);
|
|
395
|
+
}, [x.length]), M(() => {
|
|
396
|
+
I && r && x.length === 0 ? K([
|
|
354
397
|
{
|
|
355
398
|
id: "greeting",
|
|
356
399
|
role: "assistant",
|
|
357
|
-
content:
|
|
400
|
+
content: r,
|
|
358
401
|
timestamp: /* @__PURE__ */ new Date()
|
|
359
402
|
}
|
|
360
|
-
]) :
|
|
403
|
+
]) : r && x.length > 0 ? K([
|
|
361
404
|
{
|
|
362
405
|
id: "greeting",
|
|
363
406
|
role: "assistant",
|
|
364
|
-
content:
|
|
407
|
+
content: r,
|
|
365
408
|
timestamp: /* @__PURE__ */ new Date()
|
|
366
409
|
},
|
|
367
|
-
...
|
|
368
|
-
]) :
|
|
369
|
-
}, [
|
|
370
|
-
const { isPoppedOut:
|
|
410
|
+
...x
|
|
411
|
+
]) : K(x);
|
|
412
|
+
}, [x, I, r]);
|
|
413
|
+
const { isPoppedOut: V, openPopout: le, focusPopout: ce } = Te(
|
|
371
414
|
{
|
|
372
415
|
apiUrl: e,
|
|
373
|
-
tenantId:
|
|
374
|
-
title:
|
|
375
|
-
subtitle:
|
|
376
|
-
placeholder:
|
|
377
|
-
primaryColor:
|
|
378
|
-
sessionId:
|
|
379
|
-
messages:
|
|
380
|
-
headers:
|
|
416
|
+
tenantId: t,
|
|
417
|
+
title: a,
|
|
418
|
+
subtitle: i,
|
|
419
|
+
placeholder: o,
|
|
420
|
+
primaryColor: u,
|
|
421
|
+
sessionId: R,
|
|
422
|
+
messages: P,
|
|
423
|
+
headers: f
|
|
381
424
|
},
|
|
382
|
-
|
|
425
|
+
W,
|
|
383
426
|
() => {
|
|
384
427
|
}
|
|
385
428
|
);
|
|
386
|
-
|
|
387
|
-
const
|
|
388
|
-
if (
|
|
389
|
-
|
|
429
|
+
M(() => {
|
|
430
|
+
const E = x.filter((D) => D.role === "assistant").length;
|
|
431
|
+
if (E === 0) {
|
|
432
|
+
B(!1);
|
|
390
433
|
return;
|
|
391
434
|
}
|
|
392
|
-
if (
|
|
393
|
-
|
|
435
|
+
if (w || V)
|
|
436
|
+
Y(E, t), B(!1);
|
|
394
437
|
else {
|
|
395
|
-
const D =
|
|
396
|
-
|
|
438
|
+
const D = Le(t);
|
|
439
|
+
B(E > D);
|
|
397
440
|
}
|
|
398
|
-
}, [
|
|
399
|
-
const
|
|
400
|
-
if (
|
|
401
|
-
|
|
441
|
+
}, [w, V, x, t]);
|
|
442
|
+
const se = () => {
|
|
443
|
+
if (V) {
|
|
444
|
+
ce();
|
|
402
445
|
return;
|
|
403
446
|
}
|
|
404
|
-
const
|
|
405
|
-
if (
|
|
406
|
-
f == null || f();
|
|
407
|
-
const D = b.filter((he) => he.role === "assistant").length;
|
|
408
|
-
D > 0 && X(D, s), L(!1);
|
|
409
|
-
} else
|
|
447
|
+
const E = !w;
|
|
448
|
+
if (z(E), E) {
|
|
410
449
|
N == null || N();
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
},
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
450
|
+
const D = x.filter((re) => re.role === "assistant").length;
|
|
451
|
+
D > 0 && Y(D, t), B(!1);
|
|
452
|
+
} else
|
|
453
|
+
S == null || S();
|
|
454
|
+
}, de = async (E) => {
|
|
455
|
+
if (s && !await k()) {
|
|
456
|
+
K((be) => [
|
|
457
|
+
...be,
|
|
458
|
+
{
|
|
459
|
+
id: `auth-error-${Date.now()}`,
|
|
460
|
+
role: "assistant",
|
|
461
|
+
content: "Je sessie is verlopen of je hebt geen toegang. Vernieuw de pagina om opnieuw te verbinden.",
|
|
462
|
+
timestamp: /* @__PURE__ */ new Date()
|
|
463
|
+
}
|
|
464
|
+
]);
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
p == null || p(E), await b(E);
|
|
468
|
+
const D = x[x.length - 1];
|
|
469
|
+
(D == null ? void 0 : D.role) === "assistant" && (g == null || g(D.content));
|
|
470
|
+
}, ue = async () => {
|
|
471
|
+
await _(), j(!1), K([]), B(!1), Y(0, t);
|
|
472
|
+
}, me = () => {
|
|
473
|
+
C(), j(!1), K([]), B(!1), Y(0, t);
|
|
474
|
+
}, he = async (E) => {
|
|
475
|
+
await $(E), j(!0);
|
|
476
|
+
}, ge = (E) => {
|
|
477
|
+
U(E);
|
|
478
|
+
}, pe = () => {
|
|
479
|
+
z(!1), le();
|
|
480
|
+
}, { className: fe, style: we } = De(c);
|
|
481
|
+
return d || !y ? null : /* @__PURE__ */ h("div", { className: `gcw-widget gcw-container ${fe}`, style: we, children: [
|
|
482
|
+
/* @__PURE__ */ n(
|
|
483
|
+
Re,
|
|
429
484
|
{
|
|
430
|
-
isOpen:
|
|
431
|
-
onClick:
|
|
432
|
-
primaryColor:
|
|
433
|
-
hasUnread:
|
|
434
|
-
isPoppedOut:
|
|
485
|
+
isOpen: w,
|
|
486
|
+
onClick: se,
|
|
487
|
+
primaryColor: u,
|
|
488
|
+
hasUnread: F && !w && !V,
|
|
489
|
+
isPoppedOut: V
|
|
435
490
|
}
|
|
436
491
|
),
|
|
437
|
-
|
|
438
|
-
|
|
492
|
+
w && !V && /* @__PURE__ */ n(
|
|
493
|
+
Be,
|
|
439
494
|
{
|
|
440
|
-
title:
|
|
441
|
-
subtitle:
|
|
442
|
-
placeholder:
|
|
443
|
-
messages:
|
|
444
|
-
isLoading:
|
|
445
|
-
isLoadingSession:
|
|
446
|
-
onSendMessage:
|
|
447
|
-
onClose:
|
|
448
|
-
onClear:
|
|
449
|
-
onSizeChange:
|
|
450
|
-
onPopout:
|
|
451
|
-
onNewSession:
|
|
452
|
-
onSelectSession:
|
|
453
|
-
onListSessions:
|
|
454
|
-
onDeleteSession:
|
|
455
|
-
currentSessionId:
|
|
456
|
-
primaryColor:
|
|
457
|
-
size:
|
|
495
|
+
title: a,
|
|
496
|
+
subtitle: i,
|
|
497
|
+
placeholder: o,
|
|
498
|
+
messages: P,
|
|
499
|
+
isLoading: ee,
|
|
500
|
+
isLoadingSession: te,
|
|
501
|
+
onSendMessage: de,
|
|
502
|
+
onClose: se,
|
|
503
|
+
onClear: ue,
|
|
504
|
+
onSizeChange: ge,
|
|
505
|
+
onPopout: pe,
|
|
506
|
+
onNewSession: me,
|
|
507
|
+
onSelectSession: he,
|
|
508
|
+
onListSessions: A,
|
|
509
|
+
onDeleteSession: T,
|
|
510
|
+
currentSessionId: R,
|
|
511
|
+
primaryColor: u,
|
|
512
|
+
size: W
|
|
458
513
|
}
|
|
459
514
|
)
|
|
460
515
|
] });
|
|
461
516
|
}
|
|
462
|
-
const
|
|
517
|
+
const ze = {
|
|
463
518
|
small: "gcw-window--small",
|
|
464
519
|
medium: "gcw-window--medium",
|
|
465
520
|
large: "gcw-window--large",
|
|
466
521
|
fullscreen: "gcw-window--fullscreen"
|
|
467
522
|
};
|
|
468
|
-
function
|
|
523
|
+
function Be({
|
|
469
524
|
title: e,
|
|
470
525
|
subtitle: s,
|
|
471
|
-
placeholder:
|
|
526
|
+
placeholder: t,
|
|
472
527
|
messages: a,
|
|
473
528
|
isLoading: i,
|
|
474
529
|
isLoadingSession: o = !1,
|
|
475
530
|
onSendMessage: r,
|
|
476
|
-
onClose:
|
|
531
|
+
onClose: u,
|
|
477
532
|
onClear: c,
|
|
478
533
|
onSizeChange: l,
|
|
479
534
|
onPopout: m,
|
|
480
535
|
onNewSession: f,
|
|
481
536
|
onSelectSession: N,
|
|
482
|
-
onListSessions:
|
|
483
|
-
onDeleteSession:
|
|
537
|
+
onListSessions: S,
|
|
538
|
+
onDeleteSession: p,
|
|
484
539
|
currentSessionId: g,
|
|
485
|
-
primaryColor:
|
|
486
|
-
size:
|
|
540
|
+
primaryColor: y,
|
|
541
|
+
size: d
|
|
487
542
|
}) {
|
|
488
|
-
const [
|
|
489
|
-
const
|
|
490
|
-
l(
|
|
543
|
+
const [k, w] = v(!1), [z, W] = v(!1), U = () => {
|
|
544
|
+
const F = ["small", "medium", "large", "fullscreen"], x = (F.indexOf(d) + 1) % F.length;
|
|
545
|
+
l(F[x]);
|
|
491
546
|
};
|
|
492
|
-
return /* @__PURE__ */
|
|
493
|
-
/* @__PURE__ */
|
|
494
|
-
/* @__PURE__ */
|
|
495
|
-
/* @__PURE__ */
|
|
496
|
-
/* @__PURE__ */
|
|
497
|
-
/* @__PURE__ */
|
|
498
|
-
/* @__PURE__ */
|
|
547
|
+
return /* @__PURE__ */ h("div", { className: `gcw-window ${ze[d]}`, children: [
|
|
548
|
+
/* @__PURE__ */ h("div", { className: "gcw-header", style: { backgroundColor: y }, children: [
|
|
549
|
+
/* @__PURE__ */ h("div", { className: "gcw-header__left", children: [
|
|
550
|
+
/* @__PURE__ */ n("div", { className: "gcw-header__avatar", children: /* @__PURE__ */ n(tt, { className: "gcw-header__avatar-icon" }) }),
|
|
551
|
+
/* @__PURE__ */ h("div", { className: "gcw-header__info", children: [
|
|
552
|
+
/* @__PURE__ */ n("h3", { className: "gcw-header__title", children: e }),
|
|
553
|
+
/* @__PURE__ */ n("p", { className: "gcw-header__subtitle", children: s })
|
|
499
554
|
] })
|
|
500
555
|
] }),
|
|
501
|
-
/* @__PURE__ */
|
|
502
|
-
/* @__PURE__ */
|
|
503
|
-
|
|
556
|
+
/* @__PURE__ */ h("div", { className: "gcw-header__actions", children: [
|
|
557
|
+
/* @__PURE__ */ n(
|
|
558
|
+
qe,
|
|
504
559
|
{
|
|
505
|
-
size:
|
|
506
|
-
onCycleSize:
|
|
560
|
+
size: d,
|
|
561
|
+
onCycleSize: U,
|
|
507
562
|
onPopout: m,
|
|
508
|
-
onClear: () =>
|
|
563
|
+
onClear: () => W(!0),
|
|
509
564
|
onNewSession: () => {
|
|
510
|
-
f(),
|
|
565
|
+
f(), w(!1);
|
|
511
566
|
},
|
|
512
|
-
onShowHistory: () =>
|
|
567
|
+
onShowHistory: () => w(!0)
|
|
513
568
|
}
|
|
514
569
|
),
|
|
515
|
-
/* @__PURE__ */
|
|
570
|
+
/* @__PURE__ */ n(
|
|
516
571
|
"button",
|
|
517
572
|
{
|
|
518
|
-
onClick:
|
|
573
|
+
onClick: u,
|
|
519
574
|
className: "gcw-header__btn",
|
|
520
575
|
title: "Sluiten",
|
|
521
|
-
children: /* @__PURE__ */
|
|
576
|
+
children: /* @__PURE__ */ n(et, { className: "gcw-header__btn-icon" })
|
|
522
577
|
}
|
|
523
578
|
)
|
|
524
579
|
] })
|
|
525
580
|
] }),
|
|
526
|
-
|
|
527
|
-
|
|
581
|
+
z && /* @__PURE__ */ n(
|
|
582
|
+
oe,
|
|
528
583
|
{
|
|
529
584
|
title: "Chat verwijderen",
|
|
530
585
|
message: "Weet je zeker dat je dit gesprek wilt verwijderen? Dit kan niet ongedaan worden gemaakt.",
|
|
@@ -532,65 +587,65 @@ function Ee({
|
|
|
532
587
|
cancelLabel: "Annuleren",
|
|
533
588
|
variant: "danger",
|
|
534
589
|
onConfirm: () => {
|
|
535
|
-
|
|
590
|
+
W(!1), c();
|
|
536
591
|
},
|
|
537
|
-
onCancel: () =>
|
|
592
|
+
onCancel: () => W(!1)
|
|
538
593
|
}
|
|
539
594
|
),
|
|
540
|
-
|
|
541
|
-
|
|
595
|
+
k ? /* @__PURE__ */ n(
|
|
596
|
+
Ke,
|
|
542
597
|
{
|
|
543
598
|
currentSessionId: g,
|
|
544
|
-
onBack: () =>
|
|
599
|
+
onBack: () => w(!1),
|
|
545
600
|
onSelectSession: N,
|
|
546
601
|
onNewSession: f,
|
|
547
|
-
onListSessions:
|
|
548
|
-
onDeleteSession:
|
|
549
|
-
primaryColor:
|
|
602
|
+
onListSessions: S,
|
|
603
|
+
onDeleteSession: p,
|
|
604
|
+
primaryColor: y
|
|
550
605
|
}
|
|
551
|
-
) : /* @__PURE__ */
|
|
552
|
-
/* @__PURE__ */
|
|
553
|
-
|
|
606
|
+
) : /* @__PURE__ */ h(ve, { children: [
|
|
607
|
+
/* @__PURE__ */ n(
|
|
608
|
+
Oe,
|
|
554
609
|
{
|
|
555
610
|
messages: a,
|
|
556
611
|
isLoading: i,
|
|
557
612
|
isLoadingSession: o,
|
|
558
|
-
primaryColor:
|
|
613
|
+
primaryColor: y
|
|
559
614
|
}
|
|
560
615
|
),
|
|
561
|
-
/* @__PURE__ */
|
|
562
|
-
|
|
616
|
+
/* @__PURE__ */ n(
|
|
617
|
+
Fe,
|
|
563
618
|
{
|
|
564
|
-
placeholder:
|
|
619
|
+
placeholder: t,
|
|
565
620
|
isLoading: i,
|
|
566
621
|
onSendMessage: r,
|
|
567
|
-
primaryColor:
|
|
622
|
+
primaryColor: y
|
|
568
623
|
}
|
|
569
624
|
)
|
|
570
625
|
] })
|
|
571
626
|
] });
|
|
572
627
|
}
|
|
573
|
-
function
|
|
574
|
-
return /* @__PURE__ */
|
|
628
|
+
function Ae({ className: e }) {
|
|
629
|
+
return /* @__PURE__ */ n("svg", { className: e, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1" }) });
|
|
575
630
|
}
|
|
576
|
-
function
|
|
631
|
+
function He(e) {
|
|
577
632
|
return e.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
|
|
578
633
|
}
|
|
579
|
-
function
|
|
634
|
+
function We(e, s) {
|
|
580
635
|
return e.length <= s ? e : e.slice(0, s - 3) + "...";
|
|
581
636
|
}
|
|
582
|
-
function
|
|
583
|
-
const
|
|
584
|
-
return /* @__PURE__ */
|
|
585
|
-
/* @__PURE__ */
|
|
637
|
+
function Pe({ message: e, primaryColor: s }) {
|
|
638
|
+
const t = e.role === "user", a = t ? "user" : "assistant";
|
|
639
|
+
return /* @__PURE__ */ n("div", { className: `gcw-bubble-row gcw-bubble-row--${a}`, children: /* @__PURE__ */ h("div", { className: `gcw-bubble-wrapper gcw-bubble-wrapper--${a}`, children: [
|
|
640
|
+
/* @__PURE__ */ n(
|
|
586
641
|
"div",
|
|
587
642
|
{
|
|
588
643
|
className: `gcw-bubble gcw-bubble--${a}`,
|
|
589
|
-
style:
|
|
590
|
-
children: /* @__PURE__ */
|
|
644
|
+
style: t ? { backgroundColor: s } : void 0,
|
|
645
|
+
children: /* @__PURE__ */ n(Ve, { content: e.content, className: "gcw-content" })
|
|
591
646
|
}
|
|
592
647
|
),
|
|
593
|
-
e.sources && e.sources.length > 0 && /* @__PURE__ */
|
|
648
|
+
e.sources && e.sources.length > 0 && /* @__PURE__ */ n("div", { className: "gcw-sources", children: e.sources.slice(0, 3).map((i, o) => /* @__PURE__ */ h(
|
|
594
649
|
"a",
|
|
595
650
|
{
|
|
596
651
|
href: i.url,
|
|
@@ -598,59 +653,59 @@ function De({ message: e, primaryColor: s }) {
|
|
|
598
653
|
rel: "noopener noreferrer",
|
|
599
654
|
className: "gcw-source",
|
|
600
655
|
children: [
|
|
601
|
-
/* @__PURE__ */
|
|
602
|
-
|
|
656
|
+
/* @__PURE__ */ n(Ae, { className: "gcw-source__icon" }),
|
|
657
|
+
We(i.title, 25)
|
|
603
658
|
]
|
|
604
659
|
},
|
|
605
660
|
o
|
|
606
661
|
)) }),
|
|
607
|
-
/* @__PURE__ */
|
|
662
|
+
/* @__PURE__ */ n("span", { className: "gcw-bubble__timestamp", children: He(e.timestamp) })
|
|
608
663
|
] }) });
|
|
609
664
|
}
|
|
610
|
-
function
|
|
665
|
+
function Oe({ messages: e, isLoading: s, isLoadingSession: t = !1, primaryColor: a }) {
|
|
611
666
|
var o;
|
|
612
667
|
const i = H(null);
|
|
613
|
-
return
|
|
668
|
+
return M(() => {
|
|
614
669
|
var r;
|
|
615
670
|
(r = i.current) == null || r.scrollIntoView({ behavior: "smooth" });
|
|
616
|
-
}, [e, s]),
|
|
617
|
-
/* @__PURE__ */
|
|
618
|
-
/* @__PURE__ */
|
|
619
|
-
] }) }) : e.length === 0 && !s ? /* @__PURE__ */
|
|
620
|
-
/* @__PURE__ */
|
|
621
|
-
/* @__PURE__ */
|
|
622
|
-
] }) : /* @__PURE__ */
|
|
623
|
-
e.map((r) => /* @__PURE__ */
|
|
624
|
-
|
|
671
|
+
}, [e, s]), t ? /* @__PURE__ */ n("div", { className: "gcw-empty", children: /* @__PURE__ */ h("div", { className: "gcw-session-loading", children: [
|
|
672
|
+
/* @__PURE__ */ n("div", { className: "gcw-session-loading__spinner" }),
|
|
673
|
+
/* @__PURE__ */ n("p", { className: "gcw-empty__text", children: "Chatgeschiedenis laden..." })
|
|
674
|
+
] }) }) : e.length === 0 && !s ? /* @__PURE__ */ h("div", { className: "gcw-empty", children: [
|
|
675
|
+
/* @__PURE__ */ n("svg", { className: "gcw-empty__icon", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }),
|
|
676
|
+
/* @__PURE__ */ n("p", { className: "gcw-empty__text", children: "Begin een gesprek door hieronder een bericht te typen" })
|
|
677
|
+
] }) : /* @__PURE__ */ h("div", { className: "gcw-messages", children: [
|
|
678
|
+
e.map((r) => /* @__PURE__ */ n(
|
|
679
|
+
Pe,
|
|
625
680
|
{
|
|
626
681
|
message: r,
|
|
627
682
|
primaryColor: a
|
|
628
683
|
},
|
|
629
684
|
r.id
|
|
630
685
|
)),
|
|
631
|
-
s && ((o = e[e.length - 1]) == null ? void 0 : o.role) !== "assistant" && /* @__PURE__ */
|
|
632
|
-
/* @__PURE__ */
|
|
686
|
+
s && ((o = e[e.length - 1]) == null ? void 0 : o.role) !== "assistant" && /* @__PURE__ */ n(Je, {}),
|
|
687
|
+
/* @__PURE__ */ n("div", { ref: i })
|
|
633
688
|
] });
|
|
634
689
|
}
|
|
635
|
-
function
|
|
636
|
-
const [i, o] =
|
|
637
|
-
|
|
690
|
+
function Fe({ placeholder: e, isLoading: s, onSendMessage: t, primaryColor: a }) {
|
|
691
|
+
const [i, o] = v(""), r = H(null);
|
|
692
|
+
M(() => {
|
|
638
693
|
const l = r.current;
|
|
639
694
|
l && (l.style.height = "auto", l.style.height = `${Math.min(l.scrollHeight, 120)}px`);
|
|
640
695
|
}, [i]);
|
|
641
|
-
const
|
|
642
|
-
i.trim() && !s && (
|
|
696
|
+
const u = () => {
|
|
697
|
+
i.trim() && !s && (t(i), o(""), r.current && (r.current.style.height = "auto"));
|
|
643
698
|
};
|
|
644
|
-
return /* @__PURE__ */
|
|
645
|
-
/* @__PURE__ */
|
|
646
|
-
/* @__PURE__ */
|
|
699
|
+
return /* @__PURE__ */ h("div", { className: "gcw-input-area", children: [
|
|
700
|
+
/* @__PURE__ */ h("div", { className: "gcw-input-row", children: [
|
|
701
|
+
/* @__PURE__ */ n(
|
|
647
702
|
"textarea",
|
|
648
703
|
{
|
|
649
704
|
ref: r,
|
|
650
705
|
value: i,
|
|
651
706
|
onChange: (l) => o(l.target.value),
|
|
652
707
|
onKeyDown: (l) => {
|
|
653
|
-
l.key === "Enter" && !l.shiftKey && (l.preventDefault(),
|
|
708
|
+
l.key === "Enter" && !l.shiftKey && (l.preventDefault(), u());
|
|
654
709
|
},
|
|
655
710
|
placeholder: e,
|
|
656
711
|
disabled: s,
|
|
@@ -658,84 +713,84 @@ function ze({ placeholder: e, isLoading: s, onSendMessage: n, primaryColor: a })
|
|
|
658
713
|
className: "gcw-input"
|
|
659
714
|
}
|
|
660
715
|
),
|
|
661
|
-
/* @__PURE__ */
|
|
716
|
+
/* @__PURE__ */ n(
|
|
662
717
|
"button",
|
|
663
718
|
{
|
|
664
|
-
onClick:
|
|
719
|
+
onClick: u,
|
|
665
720
|
disabled: !i.trim() || s,
|
|
666
721
|
className: "gcw-send-btn",
|
|
667
722
|
style: { backgroundColor: a },
|
|
668
723
|
title: "Verstuur bericht",
|
|
669
|
-
children: s ? /* @__PURE__ */
|
|
670
|
-
/* @__PURE__ */
|
|
671
|
-
/* @__PURE__ */
|
|
672
|
-
] }) : /* @__PURE__ */
|
|
724
|
+
children: s ? /* @__PURE__ */ h("svg", { className: "gcw-send-btn__icon gcw-spin", fill: "none", viewBox: "0 0 24 24", children: [
|
|
725
|
+
/* @__PURE__ */ n("circle", { style: { opacity: 0.25 }, cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
|
|
726
|
+
/* @__PURE__ */ n("path", { style: { opacity: 0.75 }, fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
|
|
727
|
+
] }) : /* @__PURE__ */ n("svg", { className: "gcw-send-btn__icon", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 19l9 2-9-18-9 18 9-2zm0 0v-8" }) })
|
|
673
728
|
}
|
|
674
729
|
)
|
|
675
730
|
] }),
|
|
676
|
-
/* @__PURE__ */
|
|
731
|
+
/* @__PURE__ */ n("p", { className: "gcw-input-hint", children: "Druk op Enter om te verzenden, Shift+Enter voor een nieuwe regel" })
|
|
677
732
|
] });
|
|
678
733
|
}
|
|
679
|
-
function
|
|
680
|
-
return /* @__PURE__ */
|
|
734
|
+
function Re({ isOpen: e, onClick: s, primaryColor: t, hasUnread: a, isPoppedOut: i }) {
|
|
735
|
+
return /* @__PURE__ */ h(
|
|
681
736
|
"button",
|
|
682
737
|
{
|
|
683
738
|
onClick: s,
|
|
684
739
|
className: "gcw-toggle",
|
|
685
|
-
style: { backgroundColor:
|
|
740
|
+
style: { backgroundColor: t },
|
|
686
741
|
title: i ? "Chat is open in een ander venster" : e ? "Sluit chat" : "Open chat",
|
|
687
742
|
children: [
|
|
688
|
-
a && !e && /* @__PURE__ */
|
|
689
|
-
i && /* @__PURE__ */
|
|
690
|
-
/* @__PURE__ */
|
|
743
|
+
a && !e && /* @__PURE__ */ n("span", { className: "gcw-toggle__badge gcw-toggle__badge--unread", children: "!" }),
|
|
744
|
+
i && /* @__PURE__ */ n("span", { className: "gcw-toggle__badge gcw-toggle__badge--popout" }),
|
|
745
|
+
/* @__PURE__ */ n("div", { className: "gcw-toggle__icon", children: i ? /* @__PURE__ */ n("svg", { fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" }) }) : e ? /* @__PURE__ */ n("svg", { fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) : /* @__PURE__ */ n("svg", { fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }) })
|
|
691
746
|
]
|
|
692
747
|
}
|
|
693
748
|
);
|
|
694
749
|
}
|
|
695
|
-
function
|
|
750
|
+
function Ge(e) {
|
|
696
751
|
const s = new Date(e), a = (/* @__PURE__ */ new Date()).getTime() - s.getTime(), i = Math.floor(a / 6e4), o = Math.floor(a / 36e5), r = Math.floor(a / 864e5);
|
|
697
752
|
return i < 1 ? "Zojuist" : i < 60 ? `${i} min geleden` : o < 24 ? `${o} uur geleden` : r < 7 ? `${r} ${r === 1 ? "dag" : "dagen"} geleden` : s.toLocaleDateString("nl-NL", { day: "numeric", month: "short" });
|
|
698
753
|
}
|
|
699
|
-
function
|
|
754
|
+
function Ke({
|
|
700
755
|
currentSessionId: e,
|
|
701
756
|
onBack: s,
|
|
702
|
-
onSelectSession:
|
|
757
|
+
onSelectSession: t,
|
|
703
758
|
onNewSession: a,
|
|
704
759
|
onDeleteSession: i,
|
|
705
760
|
onListSessions: o,
|
|
706
761
|
primaryColor: r
|
|
707
762
|
}) {
|
|
708
|
-
const [
|
|
709
|
-
|
|
710
|
-
let
|
|
711
|
-
return m(!0), o().then((
|
|
712
|
-
|
|
763
|
+
const [u, c] = v([]), [l, m] = v(!0), [f, N] = v(null);
|
|
764
|
+
M(() => {
|
|
765
|
+
let d = !1;
|
|
766
|
+
return m(!0), o().then((k) => {
|
|
767
|
+
d || (c(k), m(!1));
|
|
713
768
|
}), () => {
|
|
714
|
-
|
|
769
|
+
d = !0;
|
|
715
770
|
};
|
|
716
771
|
}, [o]);
|
|
717
|
-
const
|
|
718
|
-
|
|
719
|
-
},
|
|
720
|
-
|
|
772
|
+
const S = (d) => {
|
|
773
|
+
t(d), s();
|
|
774
|
+
}, p = (d, k) => {
|
|
775
|
+
d.stopPropagation(), N(k);
|
|
721
776
|
}, g = async () => {
|
|
722
777
|
if (!f) return;
|
|
723
|
-
const
|
|
724
|
-
N(null), await i(
|
|
778
|
+
const d = f;
|
|
779
|
+
N(null), await i(d), c((k) => k.filter((w) => w.id !== d));
|
|
725
780
|
};
|
|
726
|
-
return /* @__PURE__ */
|
|
727
|
-
/* @__PURE__ */
|
|
728
|
-
/* @__PURE__ */
|
|
781
|
+
return /* @__PURE__ */ h("div", { className: "gcw-history", children: [
|
|
782
|
+
/* @__PURE__ */ h("div", { className: "gcw-history__header", style: { backgroundColor: r }, children: [
|
|
783
|
+
/* @__PURE__ */ n(
|
|
729
784
|
"button",
|
|
730
785
|
{
|
|
731
786
|
className: "gcw-header__btn",
|
|
732
787
|
onClick: s,
|
|
733
788
|
title: "Terug",
|
|
734
|
-
children: /* @__PURE__ */
|
|
789
|
+
children: /* @__PURE__ */ n(st, { className: "gcw-header__btn-icon" })
|
|
735
790
|
}
|
|
736
791
|
),
|
|
737
|
-
/* @__PURE__ */
|
|
738
|
-
/* @__PURE__ */
|
|
792
|
+
/* @__PURE__ */ n("h3", { className: "gcw-history__title", children: "Gesprekken" }),
|
|
793
|
+
/* @__PURE__ */ n(
|
|
739
794
|
"button",
|
|
740
795
|
{
|
|
741
796
|
className: "gcw-header__btn",
|
|
@@ -743,50 +798,50 @@ function Pe({
|
|
|
743
798
|
a(), s();
|
|
744
799
|
},
|
|
745
800
|
title: "Nieuw gesprek",
|
|
746
|
-
children: /* @__PURE__ */
|
|
801
|
+
children: /* @__PURE__ */ n(ae, { className: "gcw-header__btn-icon" })
|
|
747
802
|
}
|
|
748
803
|
)
|
|
749
804
|
] }),
|
|
750
|
-
/* @__PURE__ */
|
|
751
|
-
/* @__PURE__ */
|
|
752
|
-
/* @__PURE__ */
|
|
753
|
-
] }) :
|
|
805
|
+
/* @__PURE__ */ n("div", { className: "gcw-history__list", children: l ? /* @__PURE__ */ h("div", { className: "gcw-history__loading", children: [
|
|
806
|
+
/* @__PURE__ */ n("div", { className: "gcw-session-loading__spinner" }),
|
|
807
|
+
/* @__PURE__ */ n("span", { children: "Gesprekken laden..." })
|
|
808
|
+
] }) : u.length === 0 ? /* @__PURE__ */ n("div", { className: "gcw-history__empty", children: /* @__PURE__ */ n("p", { children: "Geen eerdere gesprekken" }) }) : u.map((d) => /* @__PURE__ */ h(
|
|
754
809
|
"div",
|
|
755
810
|
{
|
|
756
|
-
className: `gcw-history__item ${
|
|
757
|
-
onClick: () =>
|
|
758
|
-
style:
|
|
811
|
+
className: `gcw-history__item ${d.id === e ? "gcw-history__item--active" : ""}`,
|
|
812
|
+
onClick: () => S(d.id),
|
|
813
|
+
style: d.id === e ? { borderLeftColor: r } : void 0,
|
|
759
814
|
role: "button",
|
|
760
815
|
tabIndex: 0,
|
|
761
|
-
onKeyDown: (
|
|
762
|
-
|
|
816
|
+
onKeyDown: (k) => {
|
|
817
|
+
k.key === "Enter" && S(d.id);
|
|
763
818
|
},
|
|
764
819
|
children: [
|
|
765
|
-
/* @__PURE__ */
|
|
766
|
-
/* @__PURE__ */
|
|
767
|
-
/* @__PURE__ */
|
|
768
|
-
|
|
820
|
+
/* @__PURE__ */ h("div", { className: "gcw-history__item-content", children: [
|
|
821
|
+
/* @__PURE__ */ n("span", { className: "gcw-history__item-title", children: d.title || "Naamloos gesprek" }),
|
|
822
|
+
/* @__PURE__ */ h("span", { className: "gcw-history__item-meta", children: [
|
|
823
|
+
d.message_count,
|
|
769
824
|
" ",
|
|
770
|
-
|
|
825
|
+
d.message_count === 1 ? "bericht" : "berichten",
|
|
771
826
|
" · ",
|
|
772
|
-
|
|
827
|
+
Ge(d.updated_at)
|
|
773
828
|
] })
|
|
774
829
|
] }),
|
|
775
|
-
/* @__PURE__ */
|
|
830
|
+
/* @__PURE__ */ n(
|
|
776
831
|
"button",
|
|
777
832
|
{
|
|
778
833
|
className: "gcw-history__item-delete",
|
|
779
|
-
onClick: (
|
|
834
|
+
onClick: (k) => p(k, d.id),
|
|
780
835
|
title: "Verwijder gesprek",
|
|
781
|
-
children: /* @__PURE__ */
|
|
836
|
+
children: /* @__PURE__ */ n(ie, { className: "gcw-history__item-delete-icon" })
|
|
782
837
|
}
|
|
783
838
|
)
|
|
784
839
|
]
|
|
785
840
|
},
|
|
786
|
-
|
|
841
|
+
d.id
|
|
787
842
|
)) }),
|
|
788
|
-
f && /* @__PURE__ */
|
|
789
|
-
|
|
843
|
+
f && /* @__PURE__ */ n(
|
|
844
|
+
oe,
|
|
790
845
|
{
|
|
791
846
|
title: "Gesprek verwijderen",
|
|
792
847
|
message: "Weet je zeker dat je dit gesprek wilt verwijderen? Dit kan niet ongedaan worden gemaakt.",
|
|
@@ -799,93 +854,93 @@ function Pe({
|
|
|
799
854
|
)
|
|
800
855
|
] });
|
|
801
856
|
}
|
|
802
|
-
function
|
|
857
|
+
function oe({
|
|
803
858
|
title: e,
|
|
804
859
|
message: s,
|
|
805
|
-
confirmLabel:
|
|
860
|
+
confirmLabel: t = "Bevestigen",
|
|
806
861
|
cancelLabel: a = "Annuleren",
|
|
807
862
|
onConfirm: i,
|
|
808
863
|
onCancel: o,
|
|
809
864
|
variant: r = "default"
|
|
810
865
|
}) {
|
|
811
|
-
const
|
|
812
|
-
return
|
|
866
|
+
const u = H(null), c = H(null);
|
|
867
|
+
return M(() => {
|
|
813
868
|
var m;
|
|
814
869
|
(m = c.current) == null || m.focus();
|
|
815
|
-
}, []),
|
|
870
|
+
}, []), M(() => {
|
|
816
871
|
const m = (f) => {
|
|
817
872
|
f.key === "Escape" && o();
|
|
818
873
|
};
|
|
819
874
|
return document.addEventListener("keydown", m), () => document.removeEventListener("keydown", m);
|
|
820
|
-
}, [o]), /* @__PURE__ */
|
|
821
|
-
m.target ===
|
|
822
|
-
}, children: /* @__PURE__ */
|
|
823
|
-
/* @__PURE__ */
|
|
824
|
-
/* @__PURE__ */
|
|
825
|
-
/* @__PURE__ */
|
|
826
|
-
/* @__PURE__ */
|
|
827
|
-
/* @__PURE__ */
|
|
875
|
+
}, [o]), /* @__PURE__ */ n("div", { className: "gcw-modal-overlay", ref: u, onClick: (m) => {
|
|
876
|
+
m.target === u.current && o();
|
|
877
|
+
}, children: /* @__PURE__ */ h("div", { className: "gcw-modal", role: "dialog", "aria-modal": "true", "aria-labelledby": "gcw-modal-title", children: [
|
|
878
|
+
/* @__PURE__ */ n("h4", { className: "gcw-modal__title", id: "gcw-modal-title", children: e }),
|
|
879
|
+
/* @__PURE__ */ n("p", { className: "gcw-modal__message", children: s }),
|
|
880
|
+
/* @__PURE__ */ h("div", { className: "gcw-modal__actions", children: [
|
|
881
|
+
/* @__PURE__ */ n("button", { className: "gcw-modal__btn gcw-modal__btn--cancel", onClick: o, children: a }),
|
|
882
|
+
/* @__PURE__ */ n(
|
|
828
883
|
"button",
|
|
829
884
|
{
|
|
830
885
|
className: `gcw-modal__btn gcw-modal__btn--confirm ${r === "danger" ? "gcw-modal__btn--danger" : ""}`,
|
|
831
886
|
onClick: i,
|
|
832
887
|
ref: c,
|
|
833
|
-
children:
|
|
888
|
+
children: t
|
|
834
889
|
}
|
|
835
890
|
)
|
|
836
891
|
] })
|
|
837
892
|
] }) });
|
|
838
893
|
}
|
|
839
|
-
function
|
|
894
|
+
function Ve({ content: e, className: s }) {
|
|
840
895
|
if (!e) return null;
|
|
841
|
-
const
|
|
842
|
-
return /* @__PURE__ */
|
|
896
|
+
const t = Ue(e);
|
|
897
|
+
return /* @__PURE__ */ n("div", { className: s, children: t.map((a, i) => /* @__PURE__ */ n(ye.Fragment, { children: a }, i)) });
|
|
843
898
|
}
|
|
844
|
-
function
|
|
899
|
+
function Ue(e) {
|
|
845
900
|
const s = e.split(`
|
|
846
|
-
`),
|
|
901
|
+
`), t = [];
|
|
847
902
|
let a = null;
|
|
848
903
|
const i = () => {
|
|
849
|
-
a && (a.type === "ul" ?
|
|
850
|
-
/* @__PURE__ */
|
|
851
|
-
) :
|
|
852
|
-
/* @__PURE__ */
|
|
904
|
+
a && (a.type === "ul" ? t.push(
|
|
905
|
+
/* @__PURE__ */ n("ul", { className: "gcw-md-list gcw-md-list--ul", children: a.items.map((o, r) => /* @__PURE__ */ n("li", { className: "gcw-md-list__item", children: o }, r)) }, `list-${t.length}`)
|
|
906
|
+
) : t.push(
|
|
907
|
+
/* @__PURE__ */ n("ol", { className: "gcw-md-list gcw-md-list--ol", children: a.items.map((o, r) => /* @__PURE__ */ n("li", { className: "gcw-md-list__item", children: o }, r)) }, `list-${t.length}`)
|
|
853
908
|
), a = null);
|
|
854
909
|
};
|
|
855
910
|
for (let o = 0; o < s.length; o++) {
|
|
856
911
|
const r = s[o];
|
|
857
912
|
if (r.startsWith("#### ")) {
|
|
858
|
-
i(),
|
|
859
|
-
/* @__PURE__ */
|
|
913
|
+
i(), t.push(
|
|
914
|
+
/* @__PURE__ */ n("h5", { className: "gcw-md-heading gcw-md-heading--h5", children: G(r.slice(5)) }, o)
|
|
860
915
|
);
|
|
861
916
|
continue;
|
|
862
917
|
}
|
|
863
918
|
if (r.startsWith("### ")) {
|
|
864
|
-
i(),
|
|
865
|
-
/* @__PURE__ */
|
|
919
|
+
i(), t.push(
|
|
920
|
+
/* @__PURE__ */ n("h4", { className: "gcw-md-heading gcw-md-heading--h4", children: G(r.slice(4)) }, o)
|
|
866
921
|
);
|
|
867
922
|
continue;
|
|
868
923
|
}
|
|
869
924
|
if (r.startsWith("## ")) {
|
|
870
|
-
i(),
|
|
871
|
-
/* @__PURE__ */
|
|
925
|
+
i(), t.push(
|
|
926
|
+
/* @__PURE__ */ n("h3", { className: "gcw-md-heading gcw-md-heading--h3", children: G(r.slice(3)) }, o)
|
|
872
927
|
);
|
|
873
928
|
continue;
|
|
874
929
|
}
|
|
875
930
|
if (r.startsWith("# ")) {
|
|
876
|
-
i(),
|
|
877
|
-
/* @__PURE__ */
|
|
931
|
+
i(), t.push(
|
|
932
|
+
/* @__PURE__ */ n("h2", { className: "gcw-md-heading gcw-md-heading--h2", children: G(r.slice(2)) }, o)
|
|
878
933
|
);
|
|
879
934
|
continue;
|
|
880
935
|
}
|
|
881
|
-
const
|
|
882
|
-
if (
|
|
883
|
-
(!a || a.type !== "ul") && (i(), a = { type: "ul", items: [] }), a.items.push(
|
|
936
|
+
const u = r.match(/^[\s]*[-*•]\s+(.+)/);
|
|
937
|
+
if (u) {
|
|
938
|
+
(!a || a.type !== "ul") && (i(), a = { type: "ul", items: [] }), a.items.push(G(u[1]));
|
|
884
939
|
continue;
|
|
885
940
|
}
|
|
886
941
|
const c = r.match(/^[\s]*(\d+)[.)]\s+(.+)/);
|
|
887
942
|
if (c) {
|
|
888
|
-
(!a || a.type !== "ol") && (i(), a = { type: "ol", items: [] }), a.items.push(
|
|
943
|
+
(!a || a.type !== "ol") && (i(), a = { type: "ol", items: [] }), a.items.push(G(c[2]));
|
|
889
944
|
continue;
|
|
890
945
|
}
|
|
891
946
|
if (r.startsWith("```")) {
|
|
@@ -893,9 +948,9 @@ function Ve(e) {
|
|
|
893
948
|
const l = [];
|
|
894
949
|
for (o++; o < s.length && !s[o].startsWith("```"); )
|
|
895
950
|
l.push(s[o]), o++;
|
|
896
|
-
|
|
897
|
-
/* @__PURE__ */
|
|
898
|
-
`) }) }, `code-${
|
|
951
|
+
t.push(
|
|
952
|
+
/* @__PURE__ */ n("pre", { className: "gcw-md-code-block", children: /* @__PURE__ */ n("code", { children: l.join(`
|
|
953
|
+
`) }) }, `code-${t.length}`)
|
|
899
954
|
);
|
|
900
955
|
continue;
|
|
901
956
|
}
|
|
@@ -903,63 +958,63 @@ function Ve(e) {
|
|
|
903
958
|
i();
|
|
904
959
|
continue;
|
|
905
960
|
}
|
|
906
|
-
i(),
|
|
907
|
-
/* @__PURE__ */
|
|
961
|
+
i(), t.push(
|
|
962
|
+
/* @__PURE__ */ n("p", { className: "gcw-md-paragraph", children: G(r) }, o)
|
|
908
963
|
);
|
|
909
964
|
}
|
|
910
|
-
return i(),
|
|
965
|
+
return i(), t;
|
|
911
966
|
}
|
|
912
|
-
function
|
|
967
|
+
function G(e) {
|
|
913
968
|
if (!e) return null;
|
|
914
969
|
const s = [];
|
|
915
|
-
let
|
|
916
|
-
for (;
|
|
917
|
-
const i =
|
|
970
|
+
let t = e, a = 0;
|
|
971
|
+
for (; t.length > 0; ) {
|
|
972
|
+
const i = t.match(/^\*\*(.+?)\*\*/);
|
|
918
973
|
if (i) {
|
|
919
|
-
s.push(/* @__PURE__ */
|
|
974
|
+
s.push(/* @__PURE__ */ n("strong", { className: "gcw-md-bold", children: i[1] }, a++)), t = t.slice(i[0].length);
|
|
920
975
|
continue;
|
|
921
976
|
}
|
|
922
|
-
const o =
|
|
977
|
+
const o = t.match(/^\*([^*]+?)\*/);
|
|
923
978
|
if (o) {
|
|
924
|
-
s.push(/* @__PURE__ */
|
|
979
|
+
s.push(/* @__PURE__ */ n("em", { className: "gcw-md-italic", children: o[1] }, a++)), t = t.slice(o[0].length);
|
|
925
980
|
continue;
|
|
926
981
|
}
|
|
927
|
-
const r =
|
|
982
|
+
const r = t.match(/^`([^`]+)`/);
|
|
928
983
|
if (r) {
|
|
929
984
|
s.push(
|
|
930
|
-
/* @__PURE__ */
|
|
931
|
-
),
|
|
985
|
+
/* @__PURE__ */ n("code", { className: "gcw-md-code", children: r[1] }, a++)
|
|
986
|
+
), t = t.slice(r[0].length);
|
|
932
987
|
continue;
|
|
933
988
|
}
|
|
934
|
-
const
|
|
935
|
-
if (
|
|
989
|
+
const u = t.match(/^\[([^\]]+)\]\(([^)]+)\)/);
|
|
990
|
+
if (u) {
|
|
936
991
|
s.push(
|
|
937
|
-
/* @__PURE__ */
|
|
992
|
+
/* @__PURE__ */ n(
|
|
938
993
|
"a",
|
|
939
994
|
{
|
|
940
|
-
href:
|
|
995
|
+
href: u[2],
|
|
941
996
|
target: "_blank",
|
|
942
997
|
rel: "noopener noreferrer",
|
|
943
998
|
className: "gcw-md-link",
|
|
944
|
-
children:
|
|
999
|
+
children: u[1]
|
|
945
1000
|
},
|
|
946
1001
|
a++
|
|
947
1002
|
)
|
|
948
|
-
),
|
|
1003
|
+
), t = t.slice(u[0].length);
|
|
949
1004
|
continue;
|
|
950
1005
|
}
|
|
951
|
-
const c =
|
|
1006
|
+
const c = t.search(/[\*`\[]/);
|
|
952
1007
|
if (c === -1) {
|
|
953
|
-
s.push(
|
|
1008
|
+
s.push(t);
|
|
954
1009
|
break;
|
|
955
|
-
} else c === 0 ? (s.push(
|
|
1010
|
+
} else c === 0 ? (s.push(t[0]), t = t.slice(1)) : (s.push(t.slice(0, c)), t = t.slice(c));
|
|
956
1011
|
}
|
|
957
1012
|
return s.length === 1 ? s[0] : s;
|
|
958
1013
|
}
|
|
959
|
-
function
|
|
960
|
-
const s = e.messages.map((
|
|
961
|
-
...
|
|
962
|
-
timestamp:
|
|
1014
|
+
function Xe(e) {
|
|
1015
|
+
const s = e.messages.map((t) => ({
|
|
1016
|
+
...t,
|
|
1017
|
+
timestamp: t.timestamp.toISOString()
|
|
963
1018
|
}));
|
|
964
1019
|
return `
|
|
965
1020
|
<!DOCTYPE html>
|
|
@@ -967,7 +1022,7 @@ function Ae(e) {
|
|
|
967
1022
|
<head>
|
|
968
1023
|
<meta charset="UTF-8">
|
|
969
1024
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
970
|
-
<title>${
|
|
1025
|
+
<title>${q(e.title)}</title>
|
|
971
1026
|
<style>
|
|
972
1027
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
973
1028
|
html, body, #chat-root { height: 100%; width: 100%; }
|
|
@@ -1242,8 +1297,8 @@ function Ae(e) {
|
|
|
1242
1297
|
</svg>
|
|
1243
1298
|
</div>
|
|
1244
1299
|
<div class="popout-header-info">
|
|
1245
|
-
<div class="popout-title">${
|
|
1246
|
-
<div class="popout-subtitle">${
|
|
1300
|
+
<div class="popout-title">${q(e.title)}</div>
|
|
1301
|
+
<div class="popout-subtitle">${q(e.subtitle)}</div>
|
|
1247
1302
|
</div>
|
|
1248
1303
|
</div>
|
|
1249
1304
|
<div class="popout-messages" id="messages-container"></div>
|
|
@@ -1252,7 +1307,7 @@ function Ae(e) {
|
|
|
1252
1307
|
<textarea
|
|
1253
1308
|
class="popout-textarea"
|
|
1254
1309
|
id="message-input"
|
|
1255
|
-
placeholder="${
|
|
1310
|
+
placeholder="${q(e.placeholder)}"
|
|
1256
1311
|
rows="1"
|
|
1257
1312
|
></textarea>
|
|
1258
1313
|
<button
|
|
@@ -1531,199 +1586,183 @@ function Ae(e) {
|
|
|
1531
1586
|
</html>
|
|
1532
1587
|
`;
|
|
1533
1588
|
}
|
|
1534
|
-
function
|
|
1589
|
+
function q(e) {
|
|
1535
1590
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1536
1591
|
}
|
|
1537
|
-
function
|
|
1538
|
-
return /* @__PURE__ */
|
|
1539
|
-
/* @__PURE__ */
|
|
1540
|
-
/* @__PURE__ */
|
|
1541
|
-
/* @__PURE__ */
|
|
1592
|
+
function Je() {
|
|
1593
|
+
return /* @__PURE__ */ n("div", { className: "gcw-typing", children: /* @__PURE__ */ n("div", { className: "gcw-typing__bubble", children: /* @__PURE__ */ h("div", { className: "gcw-typing__dots", children: [
|
|
1594
|
+
/* @__PURE__ */ n("span", { className: "gcw-typing__dot" }),
|
|
1595
|
+
/* @__PURE__ */ n("span", { className: "gcw-typing__dot" }),
|
|
1596
|
+
/* @__PURE__ */ n("span", { className: "gcw-typing__dot" })
|
|
1542
1597
|
] }) }) });
|
|
1543
1598
|
}
|
|
1544
|
-
const
|
|
1599
|
+
const Ye = {
|
|
1545
1600
|
small: "Klein",
|
|
1546
1601
|
medium: "Middel",
|
|
1547
1602
|
large: "Groot",
|
|
1548
1603
|
fullscreen: "Volledig scherm"
|
|
1549
1604
|
};
|
|
1550
|
-
function
|
|
1551
|
-
const [r,
|
|
1552
|
-
|
|
1605
|
+
function qe({ size: e, onCycleSize: s, onPopout: t, onClear: a, onNewSession: i, onShowHistory: o }) {
|
|
1606
|
+
const [r, u] = v(!1), c = H(null);
|
|
1607
|
+
M(() => {
|
|
1553
1608
|
if (!r) return;
|
|
1554
1609
|
const m = (N) => {
|
|
1555
|
-
c.current && !c.current.contains(N.target) &&
|
|
1610
|
+
c.current && !c.current.contains(N.target) && u(!1);
|
|
1556
1611
|
}, f = setTimeout(() => {
|
|
1557
1612
|
document.addEventListener("click", m);
|
|
1558
1613
|
}, 0);
|
|
1559
1614
|
return () => {
|
|
1560
1615
|
clearTimeout(f), document.removeEventListener("click", m);
|
|
1561
1616
|
};
|
|
1562
|
-
}, [r]),
|
|
1617
|
+
}, [r]), M(() => {
|
|
1563
1618
|
if (!r) return;
|
|
1564
1619
|
const m = (f) => {
|
|
1565
|
-
f.key === "Escape" &&
|
|
1620
|
+
f.key === "Escape" && u(!1);
|
|
1566
1621
|
};
|
|
1567
1622
|
return document.addEventListener("keydown", m), () => document.removeEventListener("keydown", m);
|
|
1568
1623
|
}, [r]);
|
|
1569
1624
|
const l = (m) => {
|
|
1570
|
-
m(),
|
|
1625
|
+
m(), u(!1);
|
|
1571
1626
|
};
|
|
1572
|
-
return /* @__PURE__ */
|
|
1573
|
-
/* @__PURE__ */
|
|
1627
|
+
return /* @__PURE__ */ h("div", { className: "gcw-header-menu", ref: c, children: [
|
|
1628
|
+
/* @__PURE__ */ n(
|
|
1574
1629
|
"button",
|
|
1575
1630
|
{
|
|
1576
|
-
onClick: () =>
|
|
1631
|
+
onClick: () => u(!r),
|
|
1577
1632
|
className: "gcw-header__btn",
|
|
1578
1633
|
title: "Menu",
|
|
1579
1634
|
"aria-expanded": r,
|
|
1580
1635
|
"aria-haspopup": "true",
|
|
1581
|
-
children: /* @__PURE__ */
|
|
1582
|
-
/* @__PURE__ */
|
|
1583
|
-
/* @__PURE__ */
|
|
1584
|
-
/* @__PURE__ */
|
|
1636
|
+
children: /* @__PURE__ */ h("svg", { className: "gcw-header__btn-icon", fill: "currentColor", viewBox: "0 0 24 24", children: [
|
|
1637
|
+
/* @__PURE__ */ n("circle", { cx: "12", cy: "5", r: "2" }),
|
|
1638
|
+
/* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "2" }),
|
|
1639
|
+
/* @__PURE__ */ n("circle", { cx: "12", cy: "19", r: "2" })
|
|
1585
1640
|
] })
|
|
1586
1641
|
}
|
|
1587
1642
|
),
|
|
1588
|
-
r && /* @__PURE__ */
|
|
1589
|
-
/* @__PURE__ */
|
|
1643
|
+
r && /* @__PURE__ */ h("div", { className: "gcw-header-menu__dropdown", role: "menu", children: [
|
|
1644
|
+
/* @__PURE__ */ h(
|
|
1590
1645
|
"button",
|
|
1591
1646
|
{
|
|
1592
1647
|
className: "gcw-header-menu__item",
|
|
1593
1648
|
onClick: () => l(i),
|
|
1594
1649
|
role: "menuitem",
|
|
1595
1650
|
children: [
|
|
1596
|
-
/* @__PURE__ */
|
|
1597
|
-
/* @__PURE__ */
|
|
1651
|
+
/* @__PURE__ */ n(ae, { className: "gcw-header-menu__icon" }),
|
|
1652
|
+
/* @__PURE__ */ n("span", { children: "Nieuwe chat" })
|
|
1598
1653
|
]
|
|
1599
1654
|
}
|
|
1600
1655
|
),
|
|
1601
|
-
/* @__PURE__ */
|
|
1656
|
+
/* @__PURE__ */ h(
|
|
1602
1657
|
"button",
|
|
1603
1658
|
{
|
|
1604
1659
|
className: "gcw-header-menu__item",
|
|
1605
1660
|
onClick: () => l(o),
|
|
1606
1661
|
role: "menuitem",
|
|
1607
1662
|
children: [
|
|
1608
|
-
/* @__PURE__ */
|
|
1609
|
-
/* @__PURE__ */
|
|
1663
|
+
/* @__PURE__ */ n(nt, { className: "gcw-header-menu__icon" }),
|
|
1664
|
+
/* @__PURE__ */ n("span", { children: "Chat geschiedenis" })
|
|
1610
1665
|
]
|
|
1611
1666
|
}
|
|
1612
1667
|
),
|
|
1613
|
-
/* @__PURE__ */
|
|
1614
|
-
/* @__PURE__ */
|
|
1668
|
+
/* @__PURE__ */ n("div", { className: "gcw-header-menu__divider" }),
|
|
1669
|
+
/* @__PURE__ */ h(
|
|
1615
1670
|
"button",
|
|
1616
1671
|
{
|
|
1617
1672
|
className: "gcw-header-menu__item",
|
|
1618
1673
|
onClick: () => l(s),
|
|
1619
1674
|
role: "menuitem",
|
|
1620
1675
|
children: [
|
|
1621
|
-
/* @__PURE__ */
|
|
1622
|
-
/* @__PURE__ */
|
|
1676
|
+
/* @__PURE__ */ n(Ze, { size: e, className: "gcw-header-menu__icon" }),
|
|
1677
|
+
/* @__PURE__ */ h("span", { children: [
|
|
1623
1678
|
"Grootte: ",
|
|
1624
|
-
|
|
1679
|
+
Ye[e]
|
|
1625
1680
|
] })
|
|
1626
1681
|
]
|
|
1627
1682
|
}
|
|
1628
1683
|
),
|
|
1629
|
-
/* @__PURE__ */
|
|
1684
|
+
/* @__PURE__ */ h(
|
|
1630
1685
|
"button",
|
|
1631
1686
|
{
|
|
1632
1687
|
className: "gcw-header-menu__item",
|
|
1633
|
-
onClick: () => l(
|
|
1688
|
+
onClick: () => l(t),
|
|
1634
1689
|
role: "menuitem",
|
|
1635
1690
|
children: [
|
|
1636
|
-
/* @__PURE__ */
|
|
1637
|
-
/* @__PURE__ */
|
|
1691
|
+
/* @__PURE__ */ n(Qe, { className: "gcw-header-menu__icon" }),
|
|
1692
|
+
/* @__PURE__ */ n("span", { children: "Open in nieuw venster" })
|
|
1638
1693
|
]
|
|
1639
1694
|
}
|
|
1640
1695
|
),
|
|
1641
|
-
/* @__PURE__ */
|
|
1642
|
-
/* @__PURE__ */
|
|
1696
|
+
/* @__PURE__ */ n("div", { className: "gcw-header-menu__divider" }),
|
|
1697
|
+
/* @__PURE__ */ h(
|
|
1643
1698
|
"button",
|
|
1644
1699
|
{
|
|
1645
1700
|
className: "gcw-header-menu__item gcw-header-menu__item--danger",
|
|
1646
1701
|
onClick: () => l(a),
|
|
1647
1702
|
role: "menuitem",
|
|
1648
1703
|
children: [
|
|
1649
|
-
/* @__PURE__ */
|
|
1650
|
-
/* @__PURE__ */
|
|
1704
|
+
/* @__PURE__ */ n(ie, { className: "gcw-header-menu__icon" }),
|
|
1705
|
+
/* @__PURE__ */ n("span", { children: "Chat verwijderen" })
|
|
1651
1706
|
]
|
|
1652
1707
|
}
|
|
1653
1708
|
)
|
|
1654
1709
|
] })
|
|
1655
1710
|
] });
|
|
1656
1711
|
}
|
|
1657
|
-
function
|
|
1658
|
-
|
|
1659
|
-
case "small":
|
|
1660
|
-
return /* @__PURE__ */ t("svg", { className: s, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4" }) });
|
|
1661
|
-
case "medium":
|
|
1662
|
-
return /* @__PURE__ */ t("svg", { className: s, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4" }) });
|
|
1663
|
-
case "large":
|
|
1664
|
-
return /* @__PURE__ */ t("svg", { className: s, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4" }) });
|
|
1665
|
-
case "fullscreen":
|
|
1666
|
-
return /* @__PURE__ */ t("svg", { className: s, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 9V4.5M9 9H4.5M9 9L3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5l5.25 5.25" }) });
|
|
1667
|
-
}
|
|
1668
|
-
}
|
|
1669
|
-
function tt({ className: e = "gcw-w-4 gcw-h-4" }) {
|
|
1670
|
-
return /* @__PURE__ */ t("svg", { className: e, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4" }) });
|
|
1671
|
-
}
|
|
1672
|
-
function nt({ className: e = "gcw-w-4 gcw-h-4" }) {
|
|
1673
|
-
return /* @__PURE__ */ t("svg", { className: e, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 9V4.5M9 9H4.5M9 9L3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5l5.25 5.25" }) });
|
|
1712
|
+
function Ze({ size: e, className: s }) {
|
|
1713
|
+
return /* @__PURE__ */ n("svg", { className: s, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: e === "fullscreen" ? "M9 9V4.5M9 9H4.5M9 9L3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5l5.25 5.25" : "M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4" }) });
|
|
1674
1714
|
}
|
|
1675
|
-
function
|
|
1676
|
-
return /* @__PURE__ */
|
|
1715
|
+
function Qe({ className: e }) {
|
|
1716
|
+
return /* @__PURE__ */ n("svg", { className: e, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" }) });
|
|
1677
1717
|
}
|
|
1678
|
-
function
|
|
1679
|
-
return /* @__PURE__ */
|
|
1718
|
+
function et({ className: e }) {
|
|
1719
|
+
return /* @__PURE__ */ n("svg", { className: e, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) });
|
|
1680
1720
|
}
|
|
1681
|
-
function
|
|
1682
|
-
return /* @__PURE__ */
|
|
1721
|
+
function ie({ className: e }) {
|
|
1722
|
+
return /* @__PURE__ */ n("svg", { className: e, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" }) });
|
|
1683
1723
|
}
|
|
1684
|
-
function
|
|
1685
|
-
return /* @__PURE__ */
|
|
1724
|
+
function tt({ className: e }) {
|
|
1725
|
+
return /* @__PURE__ */ n("svg", { className: e, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z" }) });
|
|
1686
1726
|
}
|
|
1687
|
-
function
|
|
1688
|
-
return /* @__PURE__ */
|
|
1727
|
+
function ae({ className: e }) {
|
|
1728
|
+
return /* @__PURE__ */ n("svg", { className: e, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" }) });
|
|
1689
1729
|
}
|
|
1690
|
-
function
|
|
1691
|
-
return /* @__PURE__ */
|
|
1730
|
+
function nt({ className: e }) {
|
|
1731
|
+
return /* @__PURE__ */ n("svg", { className: e, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" }) });
|
|
1692
1732
|
}
|
|
1693
|
-
function
|
|
1694
|
-
return /* @__PURE__ */
|
|
1733
|
+
function st({ className: e }) {
|
|
1734
|
+
return /* @__PURE__ */ n("svg", { className: e, fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M10 19l-7-7m0 0l7-7m-7 7h18" }) });
|
|
1695
1735
|
}
|
|
1696
1736
|
export {
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
Oe as
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
Re as
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
Ne as usePopout
|
|
1737
|
+
st as ArrowLeftIcon,
|
|
1738
|
+
Pe as ChatBubble,
|
|
1739
|
+
tt as ChatIcon,
|
|
1740
|
+
it as ChatWidget,
|
|
1741
|
+
Be as ChatWindow,
|
|
1742
|
+
et as CloseIcon,
|
|
1743
|
+
oe as ConfirmModal,
|
|
1744
|
+
qe as HeaderMenu,
|
|
1745
|
+
nt as HistoryIcon,
|
|
1746
|
+
Ve as MarkdownRenderer,
|
|
1747
|
+
Fe as MessageInput,
|
|
1748
|
+
Oe as MessageList,
|
|
1749
|
+
ae as NewChatIcon,
|
|
1750
|
+
Qe as PopoutIcon,
|
|
1751
|
+
Ze as ResizeIcon,
|
|
1752
|
+
Ke as SessionHistory,
|
|
1753
|
+
Re as ToggleButton,
|
|
1754
|
+
ie as TrashIcon,
|
|
1755
|
+
Je as TypingIndicator,
|
|
1756
|
+
O as clearSession,
|
|
1757
|
+
Xe as getPopoutHTML,
|
|
1758
|
+
Ie as loadPopoutState,
|
|
1759
|
+
Le as loadSeenAssistantCount,
|
|
1760
|
+
Me as loadSessionId,
|
|
1761
|
+
J as savePopoutState,
|
|
1762
|
+
Y as saveSeenAssistantCount,
|
|
1763
|
+
Se as saveSessionId,
|
|
1764
|
+
Ce as subscribeToSessionChanges,
|
|
1765
|
+
ke as useAuth,
|
|
1766
|
+
Ee as useChat,
|
|
1767
|
+
Te as usePopout
|
|
1729
1768
|
};
|