@crestapps/ai-chat-ui 1.0.0-preview.90 → 1.0.0-preview.96

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.
@@ -154,8 +154,29 @@
154
154
  border-top: 1px solid rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.08);
155
155
  }
156
156
 
157
+ .ai-chat-widget-messages .ai-chat-message-heading {
158
+ font-size: 0.75rem;
159
+ margin-bottom: 0.35rem;
160
+ }
161
+
162
+ .ai-chat-widget-messages .ai-chat-message-heading .ai-chat-msg-role {
163
+ margin-bottom: 0;
164
+ text-transform: uppercase;
165
+ letter-spacing: 0.03em;
166
+ }
167
+
168
+ .ai-chat-widget-messages .ai-chat-message-heading-assistant .ai-chat-msg-role {
169
+ display: inline-flex;
170
+ align-items: center;
171
+ gap: 0.35rem;
172
+ }
173
+
174
+ .ai-chat-widget-messages .ai-chat-message-role-label {
175
+ display: inline-block;
176
+ text-transform: inherit;
177
+ }
178
+
157
179
  .ai-chat-widget-messages .ai-chat-msg-role {
158
- font-size: 0.7rem;
159
180
  font-weight: 600;
160
181
  margin-bottom: 2px;
161
182
  }
@@ -168,12 +189,28 @@
168
189
  color: var(--ai-widget-primary, #6f42c1);
169
190
  }
170
191
 
171
- .ai-chat-widget-messages .ai-chat-msg-role-assistant i.ai-streaming-icon {
172
- animation: ai-widget-pulse 1.5s infinite;
192
+ .ai-chat-widget-messages .ai-bot-icon {
193
+ color: currentColor;
194
+ display: inline-block;
195
+ animation: none;
196
+ }
197
+
198
+ @keyframes ai-widget-streaming-effect {
199
+ 0% { opacity: 1; transform: rotate(0deg); }
200
+ 10% { opacity: 0.3; transform: rotate(0deg); }
201
+ 20% { opacity: 1; transform: rotate(0deg); }
202
+ 30% { opacity: 0.3; transform: rotate(0deg); }
203
+ 40% { opacity: 1; transform: rotate(0deg); }
204
+ 50% { opacity: 0.3; transform: rotate(0deg); }
205
+ 60% { opacity: 1; transform: rotate(0deg); }
206
+ 80% { opacity: 1; transform: rotate(360deg); }
207
+ 100% { opacity: 1; transform: rotate(360deg); }
173
208
  }
174
209
 
175
- .ai-chat-widget-messages .ai-chat-msg-role-assistant i.ai-bot-icon {
210
+ .ai-chat-widget-messages .ai-streaming-icon {
176
211
  color: currentColor;
212
+ display: inline-block;
213
+ animation: ai-widget-streaming-effect 4s ease-in-out infinite;
177
214
  }
178
215
 
179
216
  .ai-chat-widget-messages .ai-chat-message-body {
@@ -244,6 +281,19 @@
244
281
  .ai-chat-widget-messages .message-buttons-container > .button-message-toolbox:hover,
245
282
  .ai-chat-widget-messages .message-buttons-container > .button-message-toolbox:focus {
246
283
  color: var(--bs-body-color, #212529) !important;
284
+ text-decoration: none;
285
+ }
286
+
287
+ .ai-chat-widget-messages .message-buttons-container > .button-message-toolbox.text-success,
288
+ .ai-chat-widget-messages .message-buttons-container > .button-message-toolbox.text-success:hover,
289
+ .ai-chat-widget-messages .message-buttons-container > .button-message-toolbox.text-success:focus {
290
+ color: var(--bs-success, #198754) !important;
291
+ text-decoration: none;
292
+ }
293
+
294
+ .ai-chat-widget-messages .message-buttons-container > .button-message-toolbox.text-success svg {
295
+ color: inherit !important;
296
+ fill: currentColor;
247
297
  }
248
298
 
249
299
  .ai-chat-widget-messages .message-buttons-container > .button-message-toolbox.tts-playing {
@@ -374,11 +424,6 @@
374
424
  font-size: 0.85em;
375
425
  }
376
426
 
377
- @keyframes ai-widget-pulse {
378
- 0%, 100% { opacity: 1; }
379
- 50% { opacity: 0.4; }
380
- }
381
-
382
427
  .ai-chat-widget-input {
383
428
  border-top: 1px solid var(--bs-border-color, #dee2e6);
384
429
  padding: 0.5rem 0.75rem;
@@ -1 +1 @@
1
- {"version":3,"sources":["chat-widget.css"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"chat-widget.css","sourcesContent":["/* CrestApps AI Chat Widget */\n:root {\n --ai-widget-primary: var(--bs-secondary, #6c757d);\n --ai-widget-primary-rgb: var(--bs-secondary-rgb, 108, 117, 125);\n --ai-widget-width: 380px;\n --ai-widget-height: 520px;\n}\n\n.ai-chat-widget-toggle {\n position: fixed;\n bottom: 1.25rem;\n right: 1.25rem;\n z-index: 10000;\n width: 52px;\n height: 52px;\n border-radius: 50%;\n background: var(--ai-widget-primary);\n color: var(--bs-white, #fff);\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 1.5rem;\n box-shadow: 0 4px 12px rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.2);\n transition: transform 0.2s, box-shadow 0.2s;\n}\n\n.ai-chat-widget-toggle:hover {\n transform: scale(1.1);\n box-shadow: 0 6px 16px rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.3);\n}\n\n.ai-chat-widget-container {\n position: fixed;\n bottom: 5rem;\n right: 1.25rem;\n z-index: 10001;\n width: var(--ai-widget-width);\n height: var(--ai-widget-height);\n background: var(--bs-body-bg, #fff);\n color: var(--bs-body-color, #212529);\n border: 1px solid var(--bs-border-color, #dee2e6);\n border-radius: 12px;\n box-shadow: 0 8px 32px rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.18);\n display: none;\n flex-direction: column;\n overflow: hidden;\n}\n\n.ai-chat-widget-container.ai-chat-widget-resizable {\n resize: both;\n min-width: 320px;\n min-height: 420px;\n max-width: min(90vw, 960px);\n max-height: min(90vh, 960px);\n}\n\n.ai-chat-widget-container.open {\n display: flex;\n}\n\n.ai-chat-widget-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0.75rem 1rem;\n background: var(--ai-widget-primary);\n color: var(--bs-white, #fff);\n}\n\n.ai-chat-widget-header.ai-chat-widget-drag-handle {\n cursor: move;\n user-select: none;\n touch-action: none;\n}\n\n.ai-chat-widget-header-actions {\n display: flex;\n align-items: center;\n gap: 0.15rem;\n}\n\n.ai-chat-widget-toggle.ai-chat-widget-draggable {\n touch-action: none;\n}\n\n.ai-chat-widget-container.ai-chat-widget-dragging,\n.ai-chat-widget-toggle.ai-chat-widget-dragging {\n transition: none;\n}\n\n.ai-chat-widget-toggle.ai-chat-widget-dragging:hover {\n transform: none;\n}\n\n.ai-chat-widget-header .title {\n font-weight: 600;\n font-size: 0.95rem;\n}\n\n.ai-chat-widget-header button {\n background: none;\n border: none;\n color: var(--bs-white, #fff);\n cursor: pointer;\n font-size: 1rem;\n padding: 0 0.25rem;\n opacity: 0.8;\n}\n\n.ai-chat-widget-header button:hover {\n opacity: 1;\n}\n\n.ai-chat-widget-profile-select {\n padding: 0.5rem 0.75rem;\n border-bottom: 1px solid var(--bs-border-color, #dee2e6);\n background: var(--bs-tertiary-bg, #f8f9fa);\n}\n\n.ai-chat-widget-profile-select select {\n width: 100%;\n padding: 0.35rem 0.5rem;\n color: var(--bs-body-color, #212529);\n background-color: var(--bs-body-bg, #fff);\n border: 1px solid var(--bs-border-color, #ced4da);\n border-radius: 6px;\n font-size: 0.85rem;\n}\n\n.ai-chat-widget-messages {\n flex: 1;\n overflow-y: auto;\n padding: 0.75rem;\n font-size: 0.9rem;\n}\n\n/* ── Widget message items (ai-chat.js Vue template) ── */\n.ai-chat-widget-messages .ai-chat-messages {\n padding: 0.5rem;\n}\n\n.ai-chat-widget-messages .ai-chat-message-item {\n position: relative;\n padding: 0.5rem 0;\n}\n\n.ai-chat-widget-messages .ai-chat-message-item + .ai-chat-message-item::before {\n content: '';\n display: block;\n width: 100%;\n margin-bottom: 0.5rem;\n border-top: 1px solid rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.08);\n}\n\n.ai-chat-widget-messages .ai-chat-msg-role {\n font-size: 0.7rem;\n font-weight: 600;\n margin-bottom: 2px;\n}\n\n.ai-chat-widget-messages .ai-chat-msg-role-user {\n color: var(--bs-primary, #0d6efd);\n}\n\n.ai-chat-widget-messages .ai-chat-msg-role-assistant {\n color: var(--ai-widget-primary, #6f42c1);\n}\n\n.ai-chat-widget-messages .ai-chat-msg-role-assistant i.ai-streaming-icon {\n animation: ai-widget-pulse 1.5s infinite;\n}\n\n.ai-chat-widget-messages .ai-chat-msg-role-assistant i.ai-bot-icon {\n color: currentColor;\n}\n\n.ai-chat-widget-messages .ai-chat-message-body {\n position: relative;\n padding: 0;\n overflow-wrap: break-word;\n word-break: break-word;\n min-width: 0;\n}\n\n.ai-chat-widget-messages .ai-chat-message-body p:last-child {\n margin-bottom: 0;\n}\n\n/* ── Message action buttons (copy, thumbs up/down) ── */\n.ai-chat-widget-messages .message-buttons-container {\n position: absolute;\n right: 0.1rem;\n bottom: 0;\n display: inline-flex;\n align-items: center;\n gap: 0.35rem;\n width: auto;\n max-width: max-content;\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.15s ease-in-out;\n background: rgba(var(--bs-body-bg-rgb, 255, 255, 255), 0.96);\n padding: 0.2rem 0.35rem;\n border-radius: 999px;\n box-shadow: 0 1px 3px rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.08);\n margin-bottom: 1rem;\n transform: translateY(50%);\n z-index: 1;\n}\n\n.ai-chat-widget-messages .ai-chat-message-item:hover .message-buttons-container,\n.ai-chat-widget-messages .ai-chat-message-item:focus-within .message-buttons-container {\n opacity: 1;\n pointer-events: auto;\n}\n\n.ai-chat-widget-messages .message-buttons-container:has(.tts-playing) {\n opacity: 1;\n pointer-events: auto;\n}\n\n.ai-chat-widget-messages .message-buttons-container > .button-message-toolbox {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n width: 1.75rem;\n height: 1.75rem;\n margin: 0 !important;\n padding: 0 !important;\n border-radius: 50%;\n color: var(--bs-secondary-color, #6c757d) !important;\n text-decoration: none;\n}\n\n.ai-chat-widget-messages .message-buttons-container .ai-chat-message-assistant-feedback {\n display: inline-flex;\n align-items: center;\n gap: 0.35rem;\n}\n\n.ai-chat-widget-messages .message-buttons-container > .button-message-toolbox:hover,\n.ai-chat-widget-messages .message-buttons-container > .button-message-toolbox:focus {\n color: var(--bs-body-color, #212529) !important;\n}\n\n.ai-chat-widget-messages .message-buttons-container > .button-message-toolbox.tts-playing {\n color: var(--ai-widget-primary, #6f42c1) !important;\n opacity: 1;\n pointer-events: auto;\n}\n\n.ai-chat-widget-history-panel {\n position: absolute;\n top: 3.5rem;\n left: 0;\n right: 0;\n bottom: 0;\n background: var(--bs-body-bg, #fff);\n padding: 1rem;\n z-index: 10;\n display: none;\n overflow-y: auto;\n flex-direction: column;\n}\n\n.ai-chat-widget-history-panel.show {\n display: flex;\n}\n\n.ai-chat-widget-history-panel .history-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 0.75rem;\n flex-shrink: 0;\n}\n\n.ai-chat-widget-history-panel .history-header h5 {\n margin: 0;\n font-size: 1rem;\n}\n\n.ai-chat-widget-history-list {\n list-style: none;\n padding: 0;\n margin: 0;\n overflow-y: auto;\n flex: 1 1 auto;\n}\n\n.ai-chat-widget-history-list li {\n margin-bottom: 0;\n}\n\n.ai-chat-widget-history-list .chat-session-history-item {\n display: block;\n padding: 0.5rem 0.75rem;\n text-decoration: none;\n color: var(--bs-body-color, #212529);\n font-size: 0.85rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: background 0.15s;\n cursor: pointer;\n border-bottom: 1px solid var(--bs-border-color, #dee2e6);\n}\n\n.ai-chat-widget-history-list li:last-child .chat-session-history-item {\n border-bottom: none;\n}\n\n.ai-chat-widget-history-list .chat-session-history-item:hover {\n background: var(--bs-tertiary-bg, #f8f9fa);\n}\n\n/* ── Notifications ── */\n.ai-chat-widget-messages .ai-chat-notification {\n margin: 0.75rem 0.5rem 0;\n padding: 0.625rem 0.75rem;\n border: 1px solid rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.12);\n border-radius: 0.5rem;\n background: rgba(var(--bs-tertiary-bg-rgb, 248, 249, 250), 0.98);\n}\n\n.ai-chat-widget-messages .ai-chat-notification-content {\n display: flex;\n align-items: flex-start;\n gap: 0.5rem;\n}\n\n.ai-chat-widget-messages .ai-chat-notification-icon {\n margin-top: 0.1rem;\n color: var(--bs-secondary-color, #6c757d);\n}\n\n.ai-chat-widget-messages .ai-chat-notification-text {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.ai-chat-widget-messages .ai-chat-notification-dismiss {\n margin-left: auto !important;\n color: var(--bs-secondary-color, #6c757d) !important;\n}\n\n.ai-chat-widget-messages .ai-chat-notification-actions {\n display: flex;\n gap: 0.5rem;\n margin-top: 0.5rem;\n}\n\n/* ── Chart containers inside widget ── */\n.ai-chat-widget-messages .chart-container {\n width: 100%;\n max-width: 100% !important;\n min-height: 280px;\n}\n\n/* ── Code blocks & inline code ── */\n.ai-chat-widget-messages .ai-chat-message-body pre {\n background: var(--bs-dark-bg-subtle, #2d2d2d);\n color: var(--bs-emphasis-color, #f8f8f2);\n padding: 0.5rem;\n border-radius: 4px;\n overflow-x: auto;\n font-size: 0.8rem;\n}\n\n.ai-chat-widget-messages .ai-chat-message-body code {\n font-size: 0.85em;\n}\n\n@keyframes ai-widget-pulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.4; }\n}\n\n.ai-chat-widget-input {\n border-top: 1px solid var(--bs-border-color, #dee2e6);\n padding: 0.5rem 0.75rem;\n display: flex;\n flex-wrap: wrap;\n gap: 0.5rem;\n align-items: flex-end;\n}\n\n.ai-chat-widget-input .ai-chat-doc-bar {\n flex: 0 0 100%;\n margin: -0.5rem -0.75rem 0.5rem;\n padding: 0.5rem 0.75rem;\n max-height: 4.5rem;\n overflow-y: auto;\n}\n\n.ai-chat-widget-input textarea {\n flex: 1;\n min-width: 0;\n color: var(--bs-body-color, #212529);\n background-color: var(--bs-body-bg, #fff);\n border: 1px solid var(--bs-border-color, #ced4da);\n border-radius: 8px;\n padding: 0.4rem 0.6rem;\n font-size: 0.9rem;\n resize: none;\n max-height: 80px;\n min-height: 36px;\n line-height: 1.4;\n outline: none;\n}\n\n.ai-chat-widget-input textarea:focus {\n border-color: var(--ai-widget-primary);\n box-shadow: 0 0 0 2px rgba(var(--ai-widget-primary-rgb, 108, 117, 125), 0.15);\n}\n\n.ai-chat-widget-input button {\n background: var(--ai-widget-primary);\n color: var(--bs-white, #fff);\n border: none;\n border-radius: 8px;\n padding: 0.4rem 0.75rem;\n cursor: pointer;\n font-size: 0.9rem;\n white-space: nowrap;\n}\n\n.ai-chat-widget-input .btn {\n background: var(--bs-body-bg, #fff);\n color: var(--bs-body-color, #212529);\n border: 1px solid var(--bs-border-color, #ced4da);\n}\n\n.ai-chat-widget-input .btn.btn-link {\n background: transparent;\n color: var(--bs-secondary-color, #6c757d);\n border: none;\n padding: 0.4rem;\n}\n\n.ai-chat-widget-input .btn.btn-outline-dark {\n background: var(--bs-dark, #212529);\n color: var(--bs-white, #fff);\n border-color: var(--bs-dark, #212529);\n}\n\n.ai-chat-widget-input .btn.btn-outline-secondary {\n color: var(--bs-secondary-color, #6c757d);\n}\n\n.ai-chat-widget-input button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.ai-chat-widget-status {\n padding: 0.25rem 0.75rem;\n font-size: 0.8rem;\n color: var(--bs-secondary-color, #6c757d);\n display: none;\n}\n\n.ai-chat-widget-status.visible {\n display: block;\n}\n\n.ai-chat-widget-welcome {\n text-align: center;\n color: var(--bs-secondary-color, #6c757d);\n padding: 2rem 1rem;\n font-size: 0.9rem;\n}\n\n@media (max-width: 576px) {\n .ai-chat-widget-container {\n width: calc(100vw - 1rem);\n height: calc(100vh - 6rem);\n right: 0.5rem;\n bottom: 4.5rem;\n }\n}\n"]}
1
+ {"version":3,"sources":["chat-widget.css"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"chat-widget.css","sourcesContent":["/* CrestApps AI Chat Widget */\n:root {\n --ai-widget-primary: var(--bs-secondary, #6c757d);\n --ai-widget-primary-rgb: var(--bs-secondary-rgb, 108, 117, 125);\n --ai-widget-width: 380px;\n --ai-widget-height: 520px;\n}\n\n.ai-chat-widget-toggle {\n position: fixed;\n bottom: 1.25rem;\n right: 1.25rem;\n z-index: 10000;\n width: 52px;\n height: 52px;\n border-radius: 50%;\n background: var(--ai-widget-primary);\n color: var(--bs-white, #fff);\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 1.5rem;\n box-shadow: 0 4px 12px rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.2);\n transition: transform 0.2s, box-shadow 0.2s;\n}\n\n.ai-chat-widget-toggle:hover {\n transform: scale(1.1);\n box-shadow: 0 6px 16px rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.3);\n}\n\n.ai-chat-widget-container {\n position: fixed;\n bottom: 5rem;\n right: 1.25rem;\n z-index: 10001;\n width: var(--ai-widget-width);\n height: var(--ai-widget-height);\n background: var(--bs-body-bg, #fff);\n color: var(--bs-body-color, #212529);\n border: 1px solid var(--bs-border-color, #dee2e6);\n border-radius: 12px;\n box-shadow: 0 8px 32px rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.18);\n display: none;\n flex-direction: column;\n overflow: hidden;\n}\n\n.ai-chat-widget-container.ai-chat-widget-resizable {\n resize: both;\n min-width: 320px;\n min-height: 420px;\n max-width: min(90vw, 960px);\n max-height: min(90vh, 960px);\n}\n\n.ai-chat-widget-container.open {\n display: flex;\n}\n\n.ai-chat-widget-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0.75rem 1rem;\n background: var(--ai-widget-primary);\n color: var(--bs-white, #fff);\n}\n\n.ai-chat-widget-header.ai-chat-widget-drag-handle {\n cursor: move;\n user-select: none;\n touch-action: none;\n}\n\n.ai-chat-widget-header-actions {\n display: flex;\n align-items: center;\n gap: 0.15rem;\n}\n\n.ai-chat-widget-toggle.ai-chat-widget-draggable {\n touch-action: none;\n}\n\n.ai-chat-widget-container.ai-chat-widget-dragging,\n.ai-chat-widget-toggle.ai-chat-widget-dragging {\n transition: none;\n}\n\n.ai-chat-widget-toggle.ai-chat-widget-dragging:hover {\n transform: none;\n}\n\n.ai-chat-widget-header .title {\n font-weight: 600;\n font-size: 0.95rem;\n}\n\n.ai-chat-widget-header button {\n background: none;\n border: none;\n color: var(--bs-white, #fff);\n cursor: pointer;\n font-size: 1rem;\n padding: 0 0.25rem;\n opacity: 0.8;\n}\n\n.ai-chat-widget-header button:hover {\n opacity: 1;\n}\n\n.ai-chat-widget-profile-select {\n padding: 0.5rem 0.75rem;\n border-bottom: 1px solid var(--bs-border-color, #dee2e6);\n background: var(--bs-tertiary-bg, #f8f9fa);\n}\n\n.ai-chat-widget-profile-select select {\n width: 100%;\n padding: 0.35rem 0.5rem;\n color: var(--bs-body-color, #212529);\n background-color: var(--bs-body-bg, #fff);\n border: 1px solid var(--bs-border-color, #ced4da);\n border-radius: 6px;\n font-size: 0.85rem;\n}\n\n.ai-chat-widget-messages {\n flex: 1;\n overflow-y: auto;\n padding: 0.75rem;\n font-size: 0.9rem;\n}\n\n/* ── Widget message items (ai-chat.js Vue template) ── */\n.ai-chat-widget-messages .ai-chat-messages {\n padding: 0.5rem;\n}\n\n.ai-chat-widget-messages .ai-chat-message-item {\n position: relative;\n padding: 0.5rem 0;\n}\n\n.ai-chat-widget-messages .ai-chat-message-item + .ai-chat-message-item::before {\n content: '';\n display: block;\n width: 100%;\n margin-bottom: 0.5rem;\n border-top: 1px solid rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.08);\n}\n\n.ai-chat-widget-messages .ai-chat-message-heading {\n font-size: 0.75rem;\n margin-bottom: 0.35rem;\n}\n\n.ai-chat-widget-messages .ai-chat-message-heading .ai-chat-msg-role {\n margin-bottom: 0;\n text-transform: uppercase;\n letter-spacing: 0.03em;\n}\n\n.ai-chat-widget-messages .ai-chat-message-heading-assistant .ai-chat-msg-role {\n display: inline-flex;\n align-items: center;\n gap: 0.35rem;\n}\n\n.ai-chat-widget-messages .ai-chat-message-role-label {\n display: inline-block;\n text-transform: inherit;\n}\n\n.ai-chat-widget-messages .ai-chat-msg-role {\n font-weight: 600;\n margin-bottom: 2px;\n}\n\n.ai-chat-widget-messages .ai-chat-msg-role-user {\n color: var(--bs-primary, #0d6efd);\n}\n\n.ai-chat-widget-messages .ai-chat-msg-role-assistant {\n color: var(--ai-widget-primary, #6f42c1);\n}\n\n.ai-chat-widget-messages .ai-bot-icon {\n color: currentColor;\n display: inline-block;\n animation: none;\n}\n\n@keyframes ai-widget-streaming-effect {\n 0% { opacity: 1; transform: rotate(0deg); }\n 10% { opacity: 0.3; transform: rotate(0deg); }\n 20% { opacity: 1; transform: rotate(0deg); }\n 30% { opacity: 0.3; transform: rotate(0deg); }\n 40% { opacity: 1; transform: rotate(0deg); }\n 50% { opacity: 0.3; transform: rotate(0deg); }\n 60% { opacity: 1; transform: rotate(0deg); }\n 80% { opacity: 1; transform: rotate(360deg); }\n 100% { opacity: 1; transform: rotate(360deg); }\n}\n\n.ai-chat-widget-messages .ai-streaming-icon {\n color: currentColor;\n display: inline-block;\n animation: ai-widget-streaming-effect 4s ease-in-out infinite;\n}\n\n.ai-chat-widget-messages .ai-chat-message-body {\n position: relative;\n padding: 0;\n overflow-wrap: break-word;\n word-break: break-word;\n min-width: 0;\n}\n\n.ai-chat-widget-messages .ai-chat-message-body p:last-child {\n margin-bottom: 0;\n}\n\n/* ── Message action buttons (copy, thumbs up/down) ── */\n.ai-chat-widget-messages .message-buttons-container {\n position: absolute;\n right: 0.1rem;\n bottom: 0;\n display: inline-flex;\n align-items: center;\n gap: 0.35rem;\n width: auto;\n max-width: max-content;\n opacity: 0;\n pointer-events: none;\n transition: opacity 0.15s ease-in-out;\n background: rgba(var(--bs-body-bg-rgb, 255, 255, 255), 0.96);\n padding: 0.2rem 0.35rem;\n border-radius: 999px;\n box-shadow: 0 1px 3px rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.08);\n margin-bottom: 1rem;\n transform: translateY(50%);\n z-index: 1;\n}\n\n.ai-chat-widget-messages .ai-chat-message-item:hover .message-buttons-container,\n.ai-chat-widget-messages .ai-chat-message-item:focus-within .message-buttons-container {\n opacity: 1;\n pointer-events: auto;\n}\n\n.ai-chat-widget-messages .message-buttons-container:has(.tts-playing) {\n opacity: 1;\n pointer-events: auto;\n}\n\n.ai-chat-widget-messages .message-buttons-container > .button-message-toolbox {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n width: 1.75rem;\n height: 1.75rem;\n margin: 0 !important;\n padding: 0 !important;\n border-radius: 50%;\n color: var(--bs-secondary-color, #6c757d) !important;\n text-decoration: none;\n}\n\n.ai-chat-widget-messages .message-buttons-container .ai-chat-message-assistant-feedback {\n display: inline-flex;\n align-items: center;\n gap: 0.35rem;\n}\n\n.ai-chat-widget-messages .message-buttons-container > .button-message-toolbox:hover,\n.ai-chat-widget-messages .message-buttons-container > .button-message-toolbox:focus {\n color: var(--bs-body-color, #212529) !important;\n text-decoration: none;\n}\n\n.ai-chat-widget-messages .message-buttons-container > .button-message-toolbox.text-success,\n.ai-chat-widget-messages .message-buttons-container > .button-message-toolbox.text-success:hover,\n.ai-chat-widget-messages .message-buttons-container > .button-message-toolbox.text-success:focus {\n color: var(--bs-success, #198754) !important;\n text-decoration: none;\n}\n\n.ai-chat-widget-messages .message-buttons-container > .button-message-toolbox.text-success svg {\n color: inherit !important;\n fill: currentColor;\n}\n\n.ai-chat-widget-messages .message-buttons-container > .button-message-toolbox.tts-playing {\n color: var(--ai-widget-primary, #6f42c1) !important;\n opacity: 1;\n pointer-events: auto;\n}\n\n.ai-chat-widget-history-panel {\n position: absolute;\n top: 3.5rem;\n left: 0;\n right: 0;\n bottom: 0;\n background: var(--bs-body-bg, #fff);\n padding: 1rem;\n z-index: 10;\n display: none;\n overflow-y: auto;\n flex-direction: column;\n}\n\n.ai-chat-widget-history-panel.show {\n display: flex;\n}\n\n.ai-chat-widget-history-panel .history-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 0.75rem;\n flex-shrink: 0;\n}\n\n.ai-chat-widget-history-panel .history-header h5 {\n margin: 0;\n font-size: 1rem;\n}\n\n.ai-chat-widget-history-list {\n list-style: none;\n padding: 0;\n margin: 0;\n overflow-y: auto;\n flex: 1 1 auto;\n}\n\n.ai-chat-widget-history-list li {\n margin-bottom: 0;\n}\n\n.ai-chat-widget-history-list .chat-session-history-item {\n display: block;\n padding: 0.5rem 0.75rem;\n text-decoration: none;\n color: var(--bs-body-color, #212529);\n font-size: 0.85rem;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n transition: background 0.15s;\n cursor: pointer;\n border-bottom: 1px solid var(--bs-border-color, #dee2e6);\n}\n\n.ai-chat-widget-history-list li:last-child .chat-session-history-item {\n border-bottom: none;\n}\n\n.ai-chat-widget-history-list .chat-session-history-item:hover {\n background: var(--bs-tertiary-bg, #f8f9fa);\n}\n\n/* ── Notifications ── */\n.ai-chat-widget-messages .ai-chat-notification {\n margin: 0.75rem 0.5rem 0;\n padding: 0.625rem 0.75rem;\n border: 1px solid rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.12);\n border-radius: 0.5rem;\n background: rgba(var(--bs-tertiary-bg-rgb, 248, 249, 250), 0.98);\n}\n\n.ai-chat-widget-messages .ai-chat-notification-content {\n display: flex;\n align-items: flex-start;\n gap: 0.5rem;\n}\n\n.ai-chat-widget-messages .ai-chat-notification-icon {\n margin-top: 0.1rem;\n color: var(--bs-secondary-color, #6c757d);\n}\n\n.ai-chat-widget-messages .ai-chat-notification-text {\n flex: 1 1 auto;\n min-width: 0;\n}\n\n.ai-chat-widget-messages .ai-chat-notification-dismiss {\n margin-left: auto !important;\n color: var(--bs-secondary-color, #6c757d) !important;\n}\n\n.ai-chat-widget-messages .ai-chat-notification-actions {\n display: flex;\n gap: 0.5rem;\n margin-top: 0.5rem;\n}\n\n/* ── Chart containers inside widget ── */\n.ai-chat-widget-messages .chart-container {\n width: 100%;\n max-width: 100% !important;\n min-height: 280px;\n}\n\n/* ── Code blocks & inline code ── */\n.ai-chat-widget-messages .ai-chat-message-body pre {\n background: var(--bs-dark-bg-subtle, #2d2d2d);\n color: var(--bs-emphasis-color, #f8f8f2);\n padding: 0.5rem;\n border-radius: 4px;\n overflow-x: auto;\n font-size: 0.8rem;\n}\n\n.ai-chat-widget-messages .ai-chat-message-body code {\n font-size: 0.85em;\n}\n\n.ai-chat-widget-input {\n border-top: 1px solid var(--bs-border-color, #dee2e6);\n padding: 0.5rem 0.75rem;\n display: flex;\n flex-wrap: wrap;\n gap: 0.5rem;\n align-items: flex-end;\n}\n\n.ai-chat-widget-input .ai-chat-doc-bar {\n flex: 0 0 100%;\n margin: -0.5rem -0.75rem 0.5rem;\n padding: 0.5rem 0.75rem;\n max-height: 4.5rem;\n overflow-y: auto;\n}\n\n.ai-chat-widget-input textarea {\n flex: 1;\n min-width: 0;\n color: var(--bs-body-color, #212529);\n background-color: var(--bs-body-bg, #fff);\n border: 1px solid var(--bs-border-color, #ced4da);\n border-radius: 8px;\n padding: 0.4rem 0.6rem;\n font-size: 0.9rem;\n resize: none;\n max-height: 80px;\n min-height: 36px;\n line-height: 1.4;\n outline: none;\n}\n\n.ai-chat-widget-input textarea:focus {\n border-color: var(--ai-widget-primary);\n box-shadow: 0 0 0 2px rgba(var(--ai-widget-primary-rgb, 108, 117, 125), 0.15);\n}\n\n.ai-chat-widget-input button {\n background: var(--ai-widget-primary);\n color: var(--bs-white, #fff);\n border: none;\n border-radius: 8px;\n padding: 0.4rem 0.75rem;\n cursor: pointer;\n font-size: 0.9rem;\n white-space: nowrap;\n}\n\n.ai-chat-widget-input .btn {\n background: var(--bs-body-bg, #fff);\n color: var(--bs-body-color, #212529);\n border: 1px solid var(--bs-border-color, #ced4da);\n}\n\n.ai-chat-widget-input .btn.btn-link {\n background: transparent;\n color: var(--bs-secondary-color, #6c757d);\n border: none;\n padding: 0.4rem;\n}\n\n.ai-chat-widget-input .btn.btn-outline-dark {\n background: var(--bs-dark, #212529);\n color: var(--bs-white, #fff);\n border-color: var(--bs-dark, #212529);\n}\n\n.ai-chat-widget-input .btn.btn-outline-secondary {\n color: var(--bs-secondary-color, #6c757d);\n}\n\n.ai-chat-widget-input button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.ai-chat-widget-status {\n padding: 0.25rem 0.75rem;\n font-size: 0.8rem;\n color: var(--bs-secondary-color, #6c757d);\n display: none;\n}\n\n.ai-chat-widget-status.visible {\n display: block;\n}\n\n.ai-chat-widget-welcome {\n text-align: center;\n color: var(--bs-secondary-color, #6c757d);\n padding: 2rem 1rem;\n font-size: 0.9rem;\n}\n\n@media (max-width: 576px) {\n .ai-chat-widget-container {\n width: calc(100vw - 1rem);\n height: calc(100vh - 6rem);\n right: 0.5rem;\n bottom: 4.5rem;\n }\n}\n"]}
@@ -1 +1 @@
1
- :root{--ai-widget-primary:var(--bs-secondary, #6c757d);--ai-widget-primary-rgb:var(--bs-secondary-rgb, 108, 117, 125);--ai-widget-width:380px;--ai-widget-height:520px}.ai-chat-widget-toggle{position:fixed;bottom:1.25rem;right:1.25rem;z-index:10000;width:52px;height:52px;border-radius:50%;background:var(--ai-widget-primary);color:var(--bs-white,#fff);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:1.5rem;box-shadow:0 4px 12px rgba(var(--bs-body-color-rgb,33,37,41),.2);transition:transform .2s,box-shadow .2s}.ai-chat-widget-toggle:hover{transform:scale(1.1);box-shadow:0 6px 16px rgba(var(--bs-body-color-rgb,33,37,41),.3)}.ai-chat-widget-container{position:fixed;bottom:5rem;right:1.25rem;z-index:10001;width:var(--ai-widget-width);height:var(--ai-widget-height);background:var(--bs-body-bg,#fff);color:var(--bs-body-color,#212529);border:1px solid var(--bs-border-color,#dee2e6);border-radius:12px;box-shadow:0 8px 32px rgba(var(--bs-body-color-rgb,33,37,41),.18);display:none;flex-direction:column;overflow:hidden}.ai-chat-widget-container.ai-chat-widget-resizable{resize:both;min-width:320px;min-height:420px;max-width:min(90vw,960px);max-height:min(90vh,960px)}.ai-chat-widget-container.open{display:flex}.ai-chat-widget-header{display:flex;align-items:center;justify-content:space-between;padding:.75rem 1rem;background:var(--ai-widget-primary);color:var(--bs-white,#fff)}.ai-chat-widget-header.ai-chat-widget-drag-handle{cursor:move;user-select:none;touch-action:none}.ai-chat-widget-header-actions{display:flex;align-items:center;gap:.15rem}.ai-chat-widget-toggle.ai-chat-widget-draggable{touch-action:none}.ai-chat-widget-container.ai-chat-widget-dragging,.ai-chat-widget-toggle.ai-chat-widget-dragging{transition:none}.ai-chat-widget-toggle.ai-chat-widget-dragging:hover{transform:none}.ai-chat-widget-header .title{font-weight:600;font-size:.95rem}.ai-chat-widget-header button{background:0 0;border:none;color:var(--bs-white,#fff);cursor:pointer;font-size:1rem;padding:0 .25rem;opacity:.8}.ai-chat-widget-header button:hover{opacity:1}.ai-chat-widget-profile-select{padding:.5rem .75rem;border-bottom:1px solid var(--bs-border-color,#dee2e6);background:var(--bs-tertiary-bg,#f8f9fa)}.ai-chat-widget-profile-select select{width:100%;padding:.35rem .5rem;color:var(--bs-body-color,#212529);background-color:var(--bs-body-bg,#fff);border:1px solid var(--bs-border-color,#ced4da);border-radius:6px;font-size:.85rem}.ai-chat-widget-messages{flex:1;overflow-y:auto;padding:.75rem;font-size:.9rem}.ai-chat-widget-messages .ai-chat-messages{padding:.5rem}.ai-chat-widget-messages .ai-chat-message-item{position:relative;padding:.5rem 0}.ai-chat-widget-messages .ai-chat-message-item+.ai-chat-message-item::before{content:'';display:block;width:100%;margin-bottom:.5rem;border-top:1px solid rgba(var(--bs-body-color-rgb,33,37,41),.08)}.ai-chat-widget-messages .ai-chat-msg-role{font-size:.7rem;font-weight:600;margin-bottom:2px}.ai-chat-widget-messages .ai-chat-msg-role-user{color:var(--bs-primary,#0d6efd)}.ai-chat-widget-messages .ai-chat-msg-role-assistant{color:var(--ai-widget-primary,#6f42c1)}.ai-chat-widget-messages .ai-chat-msg-role-assistant i.ai-streaming-icon{animation:ai-widget-pulse 1.5s infinite}.ai-chat-widget-messages .ai-chat-msg-role-assistant i.ai-bot-icon{color:currentColor}.ai-chat-widget-messages .ai-chat-message-body{position:relative;padding:0;overflow-wrap:break-word;word-break:break-word;min-width:0}.ai-chat-widget-messages .ai-chat-message-body p:last-child{margin-bottom:0}.ai-chat-widget-messages .message-buttons-container{position:absolute;right:.1rem;bottom:0;display:inline-flex;align-items:center;gap:.35rem;width:auto;max-width:max-content;opacity:0;pointer-events:none;transition:opacity .15s ease-in-out;background:rgba(var(--bs-body-bg-rgb,255,255,255),.96);padding:.2rem .35rem;border-radius:999px;box-shadow:0 1px 3px rgba(var(--bs-body-color-rgb,33,37,41),.08);margin-bottom:1rem;transform:translateY(50%);z-index:1}.ai-chat-widget-messages .ai-chat-message-item:focus-within .message-buttons-container,.ai-chat-widget-messages .ai-chat-message-item:hover .message-buttons-container{opacity:1;pointer-events:auto}.ai-chat-widget-messages .message-buttons-container:has(.tts-playing){opacity:1;pointer-events:auto}.ai-chat-widget-messages .message-buttons-container>.button-message-toolbox{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:1.75rem;height:1.75rem;margin:0!important;padding:0!important;border-radius:50%;color:var(--bs-secondary-color,#6c757d)!important;text-decoration:none}.ai-chat-widget-messages .message-buttons-container .ai-chat-message-assistant-feedback{display:inline-flex;align-items:center;gap:.35rem}.ai-chat-widget-messages .message-buttons-container>.button-message-toolbox:focus,.ai-chat-widget-messages .message-buttons-container>.button-message-toolbox:hover{color:var(--bs-body-color,#212529)!important}.ai-chat-widget-messages .message-buttons-container>.button-message-toolbox.tts-playing{color:var(--ai-widget-primary,#6f42c1)!important;opacity:1;pointer-events:auto}.ai-chat-widget-history-panel{position:absolute;top:3.5rem;left:0;right:0;bottom:0;background:var(--bs-body-bg,#fff);padding:1rem;z-index:10;display:none;overflow-y:auto;flex-direction:column}.ai-chat-widget-history-panel.show{display:flex}.ai-chat-widget-history-panel .history-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:.75rem;flex-shrink:0}.ai-chat-widget-history-panel .history-header h5{margin:0;font-size:1rem}.ai-chat-widget-history-list{list-style:none;padding:0;margin:0;overflow-y:auto;flex:1 1 auto}.ai-chat-widget-history-list li{margin-bottom:0}.ai-chat-widget-history-list .chat-session-history-item{display:block;padding:.5rem .75rem;text-decoration:none;color:var(--bs-body-color,#212529);font-size:.85rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:background .15s;cursor:pointer;border-bottom:1px solid var(--bs-border-color,#dee2e6)}.ai-chat-widget-history-list li:last-child .chat-session-history-item{border-bottom:none}.ai-chat-widget-history-list .chat-session-history-item:hover{background:var(--bs-tertiary-bg,#f8f9fa)}.ai-chat-widget-messages .ai-chat-notification{margin:.75rem .5rem 0;padding:.625rem .75rem;border:1px solid rgba(var(--bs-body-color-rgb,33,37,41),.12);border-radius:.5rem;background:rgba(var(--bs-tertiary-bg-rgb,248,249,250),.98)}.ai-chat-widget-messages .ai-chat-notification-content{display:flex;align-items:flex-start;gap:.5rem}.ai-chat-widget-messages .ai-chat-notification-icon{margin-top:.1rem;color:var(--bs-secondary-color,#6c757d)}.ai-chat-widget-messages .ai-chat-notification-text{flex:1 1 auto;min-width:0}.ai-chat-widget-messages .ai-chat-notification-dismiss{margin-left:auto!important;color:var(--bs-secondary-color,#6c757d)!important}.ai-chat-widget-messages .ai-chat-notification-actions{display:flex;gap:.5rem;margin-top:.5rem}.ai-chat-widget-messages .chart-container{width:100%;max-width:100%!important;min-height:280px}.ai-chat-widget-messages .ai-chat-message-body pre{background:var(--bs-dark-bg-subtle,#2d2d2d);color:var(--bs-emphasis-color,#f8f8f2);padding:.5rem;border-radius:4px;overflow-x:auto;font-size:.8rem}.ai-chat-widget-messages .ai-chat-message-body code{font-size:.85em}@keyframes ai-widget-pulse{0%,100%{opacity:1}50%{opacity:.4}}.ai-chat-widget-input{border-top:1px solid var(--bs-border-color,#dee2e6);padding:.5rem .75rem;display:flex;flex-wrap:wrap;gap:.5rem;align-items:flex-end}.ai-chat-widget-input .ai-chat-doc-bar{flex:0 0 100%;margin:-.5rem -.75rem .5rem;padding:.5rem .75rem;max-height:4.5rem;overflow-y:auto}.ai-chat-widget-input textarea{flex:1;min-width:0;color:var(--bs-body-color,#212529);background-color:var(--bs-body-bg,#fff);border:1px solid var(--bs-border-color,#ced4da);border-radius:8px;padding:.4rem .6rem;font-size:.9rem;resize:none;max-height:80px;min-height:36px;line-height:1.4;outline:0}.ai-chat-widget-input textarea:focus{border-color:var(--ai-widget-primary);box-shadow:0 0 0 2px rgba(var(--ai-widget-primary-rgb,108,117,125),.15)}.ai-chat-widget-input button{background:var(--ai-widget-primary);color:var(--bs-white,#fff);border:none;border-radius:8px;padding:.4rem .75rem;cursor:pointer;font-size:.9rem;white-space:nowrap}.ai-chat-widget-input .btn{background:var(--bs-body-bg,#fff);color:var(--bs-body-color,#212529);border:1px solid var(--bs-border-color,#ced4da)}.ai-chat-widget-input .btn.btn-link{background:0 0;color:var(--bs-secondary-color,#6c757d);border:none;padding:.4rem}.ai-chat-widget-input .btn.btn-outline-dark{background:var(--bs-dark,#212529);color:var(--bs-white,#fff);border-color:var(--bs-dark,#212529)}.ai-chat-widget-input .btn.btn-outline-secondary{color:var(--bs-secondary-color,#6c757d)}.ai-chat-widget-input button:disabled{opacity:.5;cursor:not-allowed}.ai-chat-widget-status{padding:.25rem .75rem;font-size:.8rem;color:var(--bs-secondary-color,#6c757d);display:none}.ai-chat-widget-status.visible{display:block}.ai-chat-widget-welcome{text-align:center;color:var(--bs-secondary-color,#6c757d);padding:2rem 1rem;font-size:.9rem}@media (max-width:576px){.ai-chat-widget-container{width:calc(100vw - 1rem);height:calc(100vh - 6rem);right:.5rem;bottom:4.5rem}}
1
+ :root{--ai-widget-primary:var(--bs-secondary, #6c757d);--ai-widget-primary-rgb:var(--bs-secondary-rgb, 108, 117, 125);--ai-widget-width:380px;--ai-widget-height:520px}.ai-chat-widget-toggle{position:fixed;bottom:1.25rem;right:1.25rem;z-index:10000;width:52px;height:52px;border-radius:50%;background:var(--ai-widget-primary);color:var(--bs-white,#fff);border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:1.5rem;box-shadow:0 4px 12px rgba(var(--bs-body-color-rgb,33,37,41),.2);transition:transform .2s,box-shadow .2s}.ai-chat-widget-toggle:hover{transform:scale(1.1);box-shadow:0 6px 16px rgba(var(--bs-body-color-rgb,33,37,41),.3)}.ai-chat-widget-container{position:fixed;bottom:5rem;right:1.25rem;z-index:10001;width:var(--ai-widget-width);height:var(--ai-widget-height);background:var(--bs-body-bg,#fff);color:var(--bs-body-color,#212529);border:1px solid var(--bs-border-color,#dee2e6);border-radius:12px;box-shadow:0 8px 32px rgba(var(--bs-body-color-rgb,33,37,41),.18);display:none;flex-direction:column;overflow:hidden}.ai-chat-widget-container.ai-chat-widget-resizable{resize:both;min-width:320px;min-height:420px;max-width:min(90vw,960px);max-height:min(90vh,960px)}.ai-chat-widget-container.open{display:flex}.ai-chat-widget-header{display:flex;align-items:center;justify-content:space-between;padding:.75rem 1rem;background:var(--ai-widget-primary);color:var(--bs-white,#fff)}.ai-chat-widget-header.ai-chat-widget-drag-handle{cursor:move;user-select:none;touch-action:none}.ai-chat-widget-header-actions{display:flex;align-items:center;gap:.15rem}.ai-chat-widget-toggle.ai-chat-widget-draggable{touch-action:none}.ai-chat-widget-container.ai-chat-widget-dragging,.ai-chat-widget-toggle.ai-chat-widget-dragging{transition:none}.ai-chat-widget-toggle.ai-chat-widget-dragging:hover{transform:none}.ai-chat-widget-header .title{font-weight:600;font-size:.95rem}.ai-chat-widget-header button{background:0 0;border:none;color:var(--bs-white,#fff);cursor:pointer;font-size:1rem;padding:0 .25rem;opacity:.8}.ai-chat-widget-header button:hover{opacity:1}.ai-chat-widget-profile-select{padding:.5rem .75rem;border-bottom:1px solid var(--bs-border-color,#dee2e6);background:var(--bs-tertiary-bg,#f8f9fa)}.ai-chat-widget-profile-select select{width:100%;padding:.35rem .5rem;color:var(--bs-body-color,#212529);background-color:var(--bs-body-bg,#fff);border:1px solid var(--bs-border-color,#ced4da);border-radius:6px;font-size:.85rem}.ai-chat-widget-messages{flex:1;overflow-y:auto;padding:.75rem;font-size:.9rem}.ai-chat-widget-messages .ai-chat-messages{padding:.5rem}.ai-chat-widget-messages .ai-chat-message-item{position:relative;padding:.5rem 0}.ai-chat-widget-messages .ai-chat-message-item+.ai-chat-message-item::before{content:'';display:block;width:100%;margin-bottom:.5rem;border-top:1px solid rgba(var(--bs-body-color-rgb,33,37,41),.08)}.ai-chat-widget-messages .ai-chat-message-heading{font-size:.75rem;margin-bottom:.35rem}.ai-chat-widget-messages .ai-chat-message-heading .ai-chat-msg-role{margin-bottom:0;text-transform:uppercase;letter-spacing:.03em}.ai-chat-widget-messages .ai-chat-message-heading-assistant .ai-chat-msg-role{display:inline-flex;align-items:center;gap:.35rem}.ai-chat-widget-messages .ai-chat-message-role-label{display:inline-block;text-transform:inherit}.ai-chat-widget-messages .ai-chat-msg-role{font-weight:600;margin-bottom:2px}.ai-chat-widget-messages .ai-chat-msg-role-user{color:var(--bs-primary,#0d6efd)}.ai-chat-widget-messages .ai-chat-msg-role-assistant{color:var(--ai-widget-primary,#6f42c1)}.ai-chat-widget-messages .ai-bot-icon{color:currentColor;display:inline-block;animation:none}@keyframes ai-widget-streaming-effect{0%{opacity:1;transform:rotate(0)}10%{opacity:.3;transform:rotate(0)}20%{opacity:1;transform:rotate(0)}30%{opacity:.3;transform:rotate(0)}40%{opacity:1;transform:rotate(0)}50%{opacity:.3;transform:rotate(0)}60%{opacity:1;transform:rotate(0)}80%{opacity:1;transform:rotate(360deg)}100%{opacity:1;transform:rotate(360deg)}}.ai-chat-widget-messages .ai-streaming-icon{color:currentColor;display:inline-block;animation:ai-widget-streaming-effect 4s ease-in-out infinite}.ai-chat-widget-messages .ai-chat-message-body{position:relative;padding:0;overflow-wrap:break-word;word-break:break-word;min-width:0}.ai-chat-widget-messages .ai-chat-message-body p:last-child{margin-bottom:0}.ai-chat-widget-messages .message-buttons-container{position:absolute;right:.1rem;bottom:0;display:inline-flex;align-items:center;gap:.35rem;width:auto;max-width:max-content;opacity:0;pointer-events:none;transition:opacity .15s ease-in-out;background:rgba(var(--bs-body-bg-rgb,255,255,255),.96);padding:.2rem .35rem;border-radius:999px;box-shadow:0 1px 3px rgba(var(--bs-body-color-rgb,33,37,41),.08);margin-bottom:1rem;transform:translateY(50%);z-index:1}.ai-chat-widget-messages .ai-chat-message-item:focus-within .message-buttons-container,.ai-chat-widget-messages .ai-chat-message-item:hover .message-buttons-container{opacity:1;pointer-events:auto}.ai-chat-widget-messages .message-buttons-container:has(.tts-playing){opacity:1;pointer-events:auto}.ai-chat-widget-messages .message-buttons-container>.button-message-toolbox{display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto;width:1.75rem;height:1.75rem;margin:0!important;padding:0!important;border-radius:50%;color:var(--bs-secondary-color,#6c757d)!important;text-decoration:none}.ai-chat-widget-messages .message-buttons-container .ai-chat-message-assistant-feedback{display:inline-flex;align-items:center;gap:.35rem}.ai-chat-widget-messages .message-buttons-container>.button-message-toolbox:focus,.ai-chat-widget-messages .message-buttons-container>.button-message-toolbox:hover{color:var(--bs-body-color,#212529)!important;text-decoration:none}.ai-chat-widget-messages .message-buttons-container>.button-message-toolbox.text-success,.ai-chat-widget-messages .message-buttons-container>.button-message-toolbox.text-success:focus,.ai-chat-widget-messages .message-buttons-container>.button-message-toolbox.text-success:hover{color:var(--bs-success,#198754)!important;text-decoration:none}.ai-chat-widget-messages .message-buttons-container>.button-message-toolbox.text-success svg{color:inherit!important;fill:currentColor}.ai-chat-widget-messages .message-buttons-container>.button-message-toolbox.tts-playing{color:var(--ai-widget-primary,#6f42c1)!important;opacity:1;pointer-events:auto}.ai-chat-widget-history-panel{position:absolute;top:3.5rem;left:0;right:0;bottom:0;background:var(--bs-body-bg,#fff);padding:1rem;z-index:10;display:none;overflow-y:auto;flex-direction:column}.ai-chat-widget-history-panel.show{display:flex}.ai-chat-widget-history-panel .history-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:.75rem;flex-shrink:0}.ai-chat-widget-history-panel .history-header h5{margin:0;font-size:1rem}.ai-chat-widget-history-list{list-style:none;padding:0;margin:0;overflow-y:auto;flex:1 1 auto}.ai-chat-widget-history-list li{margin-bottom:0}.ai-chat-widget-history-list .chat-session-history-item{display:block;padding:.5rem .75rem;text-decoration:none;color:var(--bs-body-color,#212529);font-size:.85rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:background .15s;cursor:pointer;border-bottom:1px solid var(--bs-border-color,#dee2e6)}.ai-chat-widget-history-list li:last-child .chat-session-history-item{border-bottom:none}.ai-chat-widget-history-list .chat-session-history-item:hover{background:var(--bs-tertiary-bg,#f8f9fa)}.ai-chat-widget-messages .ai-chat-notification{margin:.75rem .5rem 0;padding:.625rem .75rem;border:1px solid rgba(var(--bs-body-color-rgb,33,37,41),.12);border-radius:.5rem;background:rgba(var(--bs-tertiary-bg-rgb,248,249,250),.98)}.ai-chat-widget-messages .ai-chat-notification-content{display:flex;align-items:flex-start;gap:.5rem}.ai-chat-widget-messages .ai-chat-notification-icon{margin-top:.1rem;color:var(--bs-secondary-color,#6c757d)}.ai-chat-widget-messages .ai-chat-notification-text{flex:1 1 auto;min-width:0}.ai-chat-widget-messages .ai-chat-notification-dismiss{margin-left:auto!important;color:var(--bs-secondary-color,#6c757d)!important}.ai-chat-widget-messages .ai-chat-notification-actions{display:flex;gap:.5rem;margin-top:.5rem}.ai-chat-widget-messages .chart-container{width:100%;max-width:100%!important;min-height:280px}.ai-chat-widget-messages .ai-chat-message-body pre{background:var(--bs-dark-bg-subtle,#2d2d2d);color:var(--bs-emphasis-color,#f8f8f2);padding:.5rem;border-radius:4px;overflow-x:auto;font-size:.8rem}.ai-chat-widget-messages .ai-chat-message-body code{font-size:.85em}.ai-chat-widget-input{border-top:1px solid var(--bs-border-color,#dee2e6);padding:.5rem .75rem;display:flex;flex-wrap:wrap;gap:.5rem;align-items:flex-end}.ai-chat-widget-input .ai-chat-doc-bar{flex:0 0 100%;margin:-.5rem -.75rem .5rem;padding:.5rem .75rem;max-height:4.5rem;overflow-y:auto}.ai-chat-widget-input textarea{flex:1;min-width:0;color:var(--bs-body-color,#212529);background-color:var(--bs-body-bg,#fff);border:1px solid var(--bs-border-color,#ced4da);border-radius:8px;padding:.4rem .6rem;font-size:.9rem;resize:none;max-height:80px;min-height:36px;line-height:1.4;outline:0}.ai-chat-widget-input textarea:focus{border-color:var(--ai-widget-primary);box-shadow:0 0 0 2px rgba(var(--ai-widget-primary-rgb,108,117,125),.15)}.ai-chat-widget-input button{background:var(--ai-widget-primary);color:var(--bs-white,#fff);border:none;border-radius:8px;padding:.4rem .75rem;cursor:pointer;font-size:.9rem;white-space:nowrap}.ai-chat-widget-input .btn{background:var(--bs-body-bg,#fff);color:var(--bs-body-color,#212529);border:1px solid var(--bs-border-color,#ced4da)}.ai-chat-widget-input .btn.btn-link{background:0 0;color:var(--bs-secondary-color,#6c757d);border:none;padding:.4rem}.ai-chat-widget-input .btn.btn-outline-dark{background:var(--bs-dark,#212529);color:var(--bs-white,#fff);border-color:var(--bs-dark,#212529)}.ai-chat-widget-input .btn.btn-outline-secondary{color:var(--bs-secondary-color,#6c757d)}.ai-chat-widget-input button:disabled{opacity:.5;cursor:not-allowed}.ai-chat-widget-status{padding:.25rem .75rem;font-size:.8rem;color:var(--bs-secondary-color,#6c757d);display:none}.ai-chat-widget-status.visible{display:block}.ai-chat-widget-welcome{text-align:center;color:var(--bs-secondary-color,#6c757d);padding:2rem 1rem;font-size:.9rem}@media (max-width:576px){.ai-chat-widget-container{width:calc(100vw - 1rem);height:calc(100vh - 6rem);right:.5rem;bottom:4.5rem}}
@@ -6,6 +6,7 @@
6
6
  (function (window, document) {
7
7
  'use strict';
8
8
 
9
+ var dropZoneStateKey = '__documentDropZoneState';
9
10
  function assignFiles(fileInput, files) {
10
11
  if (!fileInput || !files) {
11
12
  return;
@@ -29,6 +30,9 @@
29
30
  if (!dropZone || !fileInput) {
30
31
  return;
31
32
  }
33
+ if (dropZone[dropZoneStateKey] && typeof dropZone[dropZoneStateKey].dispose === 'function') {
34
+ dropZone[dropZoneStateKey].dispose();
35
+ }
32
36
  function openPicker() {
33
37
  fileInput.click();
34
38
  }
@@ -39,40 +43,114 @@
39
43
  function setDragState(isActive) {
40
44
  dropZone.classList.toggle('document-drop-zone--dragover', isActive);
41
45
  }
42
- ['dragenter', 'dragover', 'dragleave', 'drop'].forEach(function (eventName) {
43
- dropZone.addEventListener(eventName, preventDefaults);
44
- });
45
- dropZone.addEventListener('dragenter', function () {
46
+ function handleDragEnter() {
46
47
  setDragState(true);
47
- });
48
- dropZone.addEventListener('dragover', function () {
48
+ }
49
+ function handleDragOver() {
49
50
  setDragState(true);
50
- });
51
- dropZone.addEventListener('dragleave', function (event) {
51
+ }
52
+ function handleDragLeave(event) {
52
53
  if (!dropZone.contains(event.relatedTarget)) {
53
54
  setDragState(false);
54
55
  }
55
- });
56
- dropZone.addEventListener('drop', function (event) {
56
+ }
57
+ function handleDrop(event) {
57
58
  setDragState(false);
58
59
  var files = event.dataTransfer ? event.dataTransfer.files : null;
59
60
  if (files && files.length > 0) {
60
61
  assignFiles(fileInput, files);
61
62
  }
63
+ }
64
+ ['dragenter', 'dragover', 'dragleave', 'drop'].forEach(function (eventName) {
65
+ dropZone.addEventListener(eventName, preventDefaults);
62
66
  });
67
+ dropZone.addEventListener('dragenter', handleDragEnter);
68
+ dropZone.addEventListener('dragover', handleDragOver);
69
+ dropZone.addEventListener('dragleave', handleDragLeave);
70
+ dropZone.addEventListener('drop', handleDrop);
71
+ var handleBrowseClick = null;
63
72
  if (browseButton) {
64
- browseButton.addEventListener('click', function (event) {
73
+ handleBrowseClick = function handleBrowseClick(event) {
65
74
  event.preventDefault();
66
75
  event.stopPropagation();
67
76
  openPicker();
68
- });
77
+ };
78
+ browseButton.addEventListener('click', handleBrowseClick);
69
79
  }
70
- dropZone.addEventListener('click', function (event) {
80
+ function handleClick(event) {
71
81
  if (event.target.closest('[data-drop-zone-browse]')) {
72
82
  return;
73
83
  }
74
84
  openPicker();
75
- });
85
+ }
86
+ dropZone.addEventListener('click', handleClick);
87
+ dropZone[dropZoneStateKey] = {
88
+ dispose: function dispose() {
89
+ ['dragenter', 'dragover', 'dragleave', 'drop'].forEach(function (eventName) {
90
+ dropZone.removeEventListener(eventName, preventDefaults);
91
+ });
92
+ dropZone.removeEventListener('dragenter', handleDragEnter);
93
+ dropZone.removeEventListener('dragover', handleDragOver);
94
+ dropZone.removeEventListener('dragleave', handleDragLeave);
95
+ dropZone.removeEventListener('drop', handleDrop);
96
+ dropZone.removeEventListener('click', handleClick);
97
+ if (browseButton && handleBrowseClick) {
98
+ browseButton.removeEventListener('click', handleBrowseClick);
99
+ }
100
+ }
101
+ };
102
+ return dropZone[dropZoneStateKey];
76
103
  };
104
+ function initializeFromElement(element) {
105
+ if (!element || element.dataset.documentDropZoneInitialized === 'true') {
106
+ return element ? element[dropZoneStateKey] || null : null;
107
+ }
108
+ var options = {
109
+ dropZone: element,
110
+ fileInput: element.getAttribute('data-document-drop-zone-file-input'),
111
+ browseButton: element.getAttribute('data-document-drop-zone-browse-button')
112
+ };
113
+ var state = window.initDocumentDropZone(options);
114
+ if (!state) {
115
+ return null;
116
+ }
117
+ element.dataset.documentDropZoneInitialized = 'true';
118
+ return state;
119
+ }
120
+ function scanForAutoInitialization(root) {
121
+ if (!root || typeof root.querySelectorAll !== 'function') {
122
+ return;
123
+ }
124
+ if (typeof root.matches === 'function' && root.matches('[data-document-drop-zone-file-input]')) {
125
+ initializeFromElement(root);
126
+ }
127
+ root.querySelectorAll('[data-document-drop-zone-file-input]').forEach(initializeFromElement);
128
+ }
129
+ function startAutoInitialization() {
130
+ scanForAutoInitialization(document);
131
+ if (typeof MutationObserver === 'undefined') {
132
+ return;
133
+ }
134
+ var observer = new MutationObserver(function (mutations) {
135
+ mutations.forEach(function (mutation) {
136
+ mutation.addedNodes.forEach(function (node) {
137
+ if (node && node.nodeType === 1) {
138
+ scanForAutoInitialization(node);
139
+ }
140
+ });
141
+ });
142
+ });
143
+ observer.observe(document.body, {
144
+ childList: true,
145
+ subtree: true
146
+ });
147
+ }
148
+ if (document.readyState === 'loading') {
149
+ document.addEventListener('DOMContentLoaded', startAutoInitialization, {
150
+ once: true
151
+ });
152
+ } else {
153
+ startAutoInitialization();
154
+ }
77
155
  })(window, document);
78
156
  //# sourceMappingURL=document-drop-zone.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["document-drop-zone.js"],"names":["window","document","assignFiles","fileInput","files","dataTransfer","DataTransfer","Array","prototype","forEach","call","file","items","add","dispatchEvent","Event","bubbles","initDocumentDropZone","options","dropZone","querySelector","browseButton","openPicker","click","preventDefaults","event","preventDefault","stopPropagation","setDragState","isActive","classList","toggle","eventName","addEventListener","contains","relatedTarget","length","target","closest"],"mappings":";;;;;AAAA,CAAC,UAAUA,MAAM,EAAEC,QAAQ,EAAE;EACzB,YAAY;;EAEZ,SAASC,WAAWA,CAACC,SAAS,EAAEC,KAAK,EAAE;IACnC,IAAI,CAACD,SAAS,IAAI,CAACC,KAAK,EAAE;MACtB;IACJ;IAEA,IAAIC,YAAY,GAAG,IAAIC,YAAY,CAAC,CAAC;IAErCC,KAAK,CAACC,SAAS,CAACC,OAAO,CAACC,IAAI,CAACN,KAAK,EAAE,UAAUO,IAAI,EAAE;MAChDN,YAAY,CAACO,KAAK,CAACC,GAAG,CAACF,IAAI,CAAC;IAChC,CAAC,CAAC;IAEFR,SAAS,CAACC,KAAK,GAAGC,YAAY,CAACD,KAAK;IACpCD,SAAS,CAACW,aAAa,CAAC,IAAIC,KAAK,CAAC,QAAQ,EAAE;MAAEC,OAAO,EAAE;IAAK,CAAC,CAAC,CAAC;EACnE;EAEAhB,MAAM,CAACiB,oBAAoB,GAAG,SAASA,oBAAoBA,CAACC,OAAO,EAAE;IACjE,IAAI,CAACA,OAAO,EAAE;MACV;IACJ;IAEA,IAAIC,QAAQ,GAAG,OAAOD,OAAO,CAACC,QAAQ,KAAK,QAAQ,GAC7ClB,QAAQ,CAACmB,aAAa,CAACF,OAAO,CAACC,QAAQ,CAAC,GACxCD,OAAO,CAACC,QAAQ;IACtB,IAAIhB,SAAS,GAAG,OAAOe,OAAO,CAACf,SAAS,KAAK,QAAQ,GAC/CF,QAAQ,CAACmB,aAAa,CAACF,OAAO,CAACf,SAAS,CAAC,GACzCe,OAAO,CA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,KAAK,GAAGqB,KAAK,CAACpB,YAAY,GAAGoB,KAAK,CAACpB,YAAY,CAACD,KAAK,GAAG,IAAI;MAChE,IAAIA,KAAK,IAAIA,KAAK,CAACgC,MAAM,GAAG,CAAC,EAAE;QAC3BlC,WAAW,CAACC,SAAS,EAAEC,KAAK,CAAC;MACjC;IACJ,CAAC,CAAC;IAEF,IAAIiB,YAAY,EAAE;MACdA,YAAY,CAACY,gBAAgB,CAAC,OAAO,EAAE,UAAUR,KAAK,EAAE;QACpDA,KAAK,CAACC,cAAc,CAAC,CAAC;QACtBD,KAAK,CAACE,eAAe,CAAC,CAAC;QACvBL,UAAU,CAAC,CAAC;MAChB,CAAC,CAAC;IACN;IAEAH,QAAQ,CAACc,gBAAgB,CAAC,OAAO,EAAE,UAAUR,KAAK,EAAE;MAChD,IAAIA,KAAK,CAACY,MAAM,CAACC,OAAO,CAAC,yBAAyB,CAAC,EAAE;QACjD;MACJ;MAEAhB,UAAU,CAAC,CAAC;IAChB,CAAC,CAAC;EACN,CAAC;AACL,CAAC,EAAEtB,MAAM,EAAEC,QAAQ,CAAC","file":"document-drop-zone.js","sourcesContent":["(function (window, document) {\n 'use strict';\n\n function assignFiles(fileInput, files) {\n if (!fileInput || !files) {\n return;\n }\n\n var dataTransfer = new DataTransfer();\n\n Array.prototype.forEach.call(files, function (file) {\n dataTransfer.items.add(file);\n });\n\n fileInput.files = dataTransfer.files;\n fileInput.dispatchEvent(new Event('change', { bubbles: true }));\n }\n\n window.initDocumentDropZone = function initDocumentDropZone(options) {\n if (!options) {\n return;\n }\n\n var dropZone = typeof options.dropZone === 'string'\n ? document.querySelector(options.dropZone)\n : options.dropZone;\n var fileInput = typeof options.fileInput === 'string'\n ? document.querySelector(options.fileInput)\n : options.fileInput;\n var browseButton = typeof options.browseButton === 'string'\n ? document.querySelector(options.browseButton)\n : options.browseButton;\n\n if (!dropZone || !fileInput) {\n return;\n }\n\n function openPicker() {\n fileInput.click();\n }\n\n function preventDefaults(event) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n function setDragState(isActive) {\n dropZone.classList.toggle('document-drop-zone--dragover', isActive);\n }\n\n ['dragenter', 'dragover', 'dragleave', 'drop'].forEach(function (eventName) {\n dropZone.addEventListener(eventName, preventDefaults);\n });\n\n dropZone.addEventListener('dragenter', function () { setDragState(true); });\n dropZone.addEventListener('dragover', function () { setDragState(true); });\n dropZone.addEventListener('dragleave', function (event) {\n if (!dropZone.contains(event.relatedTarget)) {\n setDragState(false);\n }\n });\n dropZone.addEventListener('drop', function (event) {\n setDragState(false);\n var files = event.dataTransfer ? event.dataTransfer.files : null;\n if (files && files.length > 0) {\n assignFiles(fileInput, files);\n }\n });\n\n if (browseButton) {\n browseButton.addEventListener('click', function (event) {\n event.preventDefault();\n event.stopPropagation();\n openPicker();\n });\n }\n\n dropZone.addEventListener('click', function (event) {\n if (event.target.closest('[data-drop-zone-browse]')) {\n return;\n }\n\n openPicker();\n });\n };\n})(window, document);\n"]}
1
+ {"version":3,"sources":["document-drop-zone.js"],"names":["window","document","dropZoneStateKey","assignFiles","fileInput","files","dataTransfer","DataTransfer","Array","prototype","forEach","call","file","items","add","dispatchEvent","Event","bubbles","initDocumentDropZone","options","dropZone","querySelector","browseButton","dispose","openPicker","click","preventDefaults","event","preventDefault","stopPropagation","setDragState","isActive","classList","toggle","handleDragEnter","handleDragOver","handleDragLeave","contains","relatedTarget","handleDrop","length","eventName","addEventListener","handleBrowseClick","handleClick","target","closest","removeEventListener","initializeFromElement","element","dataset","documentDropZoneInitialized","getAttribute","state","scanForAutoInitialization","root","querySelectorAll","matches","startAutoInitialization","MutationObserver","observer","mutations","mutation","addedNodes","node","nodeType","observe","body","childList","subtree","readyState","once"],"mappings":";;;;;AAAA,CAAC,UAAUA,MAAM,EAAEC,QAAQ,EAAE;EACzB,YAAY;;EAEZ,IAAIC,gBAAgB,GAAG,yBAAyB;EAEhD,SAASC,WAAWA,CAACC,SAAS,EAAEC,KAAK,EAAE;IACnC,IAAI,CAACD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C;IACJ;IAEA,IAAIC,QAAQ,GAAG,IAAID,gBAAgB,CAAC,UAAUE,SAAS,EAAE;MACrDA,SAAS,CAACnD,OAAO,CAAC,UAAUoD,QAAQ,EAAE;QAClCA,QAAQ,CAACC,UAAU,CAACrD,OAAO,CAAC,UAAUsD,IAAI,EAAE;UACxC,IAAIA,IAAI,IAAIA,IAAI,CAACC,QAAQ,KAAK,CAAC,EAAE;YAC7BX,yBAAyB,CAACU,IAAI,CAAC;UACnC;QACJ,CAAC,CAAC;MACN,CAAC,CAAC;IACN,CAAC,CAAC;IAEFJ,QAAQ,CAACM,OAAO,CAACjE,QAAQ,CAACkE,IAAI,EAAE;MAC5BC,SAAS,EAAE,IAAI;MACfC,OAAO,EAAE;IACb,CAAC,CAAC;EACN;EAEA,IAAIpE,QAAQ,CAACqE,UAAU,KAAK,SAAS,EAAE;IACnCrE,QAAQ,CAACyC,gBAAgB,CAAC,kBAAkB,EAAEgB,uBAAuB,EAAE;MAAEa,IAAI,EAAE;IAAK,CAAC,CAAC;EAC1F,CAAC,MAAM;IACHb,uBAAuB,CAAC,CAAC;EAC7B;AACJ,CAAC,EAAE1D,MAAM,EAAEC,QAAQ,CAAC","file":"document-drop-zone.js","sourcesContent":["(function (window, document) {\n 'use strict';\n\n var dropZoneStateKey = '__documentDropZoneState';\n\n function assignFiles(fileInput, files) {\n if (!fileInput || !files) {\n return;\n }\n\n var dataTransfer = new DataTransfer();\n\n Array.prototype.forEach.call(files, function (file) {\n dataTransfer.items.add(file);\n });\n\n fileInput.files = dataTransfer.files;\n fileInput.dispatchEvent(new Event('change', { bubbles: true }));\n }\n\n window.initDocumentDropZone = function initDocumentDropZone(options) {\n if (!options) {\n return;\n }\n\n var dropZone = typeof options.dropZone === 'string'\n ? document.querySelector(options.dropZone)\n : options.dropZone;\n var fileInput = typeof options.fileInput === 'string'\n ? document.querySelector(options.fileInput)\n : options.fileInput;\n var browseButton = typeof options.browseButton === 'string'\n ? document.querySelector(options.browseButton)\n : options.browseButton;\n\n if (!dropZone || !fileInput) {\n return;\n }\n\n if (dropZone[dropZoneStateKey] && typeof dropZone[dropZoneStateKey].dispose === 'function') {\n dropZone[dropZoneStateKey].dispose();\n }\n\n function openPicker() {\n fileInput.click();\n }\n\n function preventDefaults(event) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n function setDragState(isActive) {\n dropZone.classList.toggle('document-drop-zone--dragover', isActive);\n }\n\n function handleDragEnter() {\n setDragState(true);\n }\n\n function handleDragOver() {\n setDragState(true);\n }\n\n function handleDragLeave(event) {\n if (!dropZone.contains(event.relatedTarget)) {\n setDragState(false);\n }\n }\n\n function handleDrop(event) {\n setDragState(false);\n var files = event.dataTransfer ? event.dataTransfer.files : null;\n if (files && files.length > 0) {\n assignFiles(fileInput, files);\n }\n }\n\n ['dragenter', 'dragover', 'dragleave', 'drop'].forEach(function (eventName) {\n dropZone.addEventListener(eventName, preventDefaults);\n });\n\n dropZone.addEventListener('dragenter', handleDragEnter);\n dropZone.addEventListener('dragover', handleDragOver);\n dropZone.addEventListener('dragleave', handleDragLeave);\n dropZone.addEventListener('drop', handleDrop);\n\n var handleBrowseClick = null;\n if (browseButton) {\n handleBrowseClick = function (event) {\n event.preventDefault();\n event.stopPropagation();\n openPicker();\n };\n\n browseButton.addEventListener('click', handleBrowseClick);\n }\n\n function handleClick(event) {\n if (event.target.closest('[data-drop-zone-browse]')) {\n return;\n }\n\n openPicker();\n }\n\n dropZone.addEventListener('click', handleClick);\n\n dropZone[dropZoneStateKey] = {\n dispose: function () {\n ['dragenter', 'dragover', 'dragleave', 'drop'].forEach(function (eventName) {\n dropZone.removeEventListener(eventName, preventDefaults);\n });\n\n dropZone.removeEventListener('dragenter', handleDragEnter);\n dropZone.removeEventListener('dragover', handleDragOver);\n dropZone.removeEventListener('dragleave', handleDragLeave);\n dropZone.removeEventListener('drop', handleDrop);\n dropZone.removeEventListener('click', handleClick);\n\n if (browseButton && handleBrowseClick) {\n browseButton.removeEventListener('click', handleBrowseClick);\n }\n }\n };\n\n return dropZone[dropZoneStateKey];\n };\n\n function initializeFromElement(element) {\n if (!element || element.dataset.documentDropZoneInitialized === 'true') {\n return element ? element[dropZoneStateKey] || null : null;\n }\n\n var options = {\n dropZone: element,\n fileInput: element.getAttribute('data-document-drop-zone-file-input'),\n browseButton: element.getAttribute('data-document-drop-zone-browse-button'),\n };\n\n var state = window.initDocumentDropZone(options);\n if (!state) {\n return null;\n }\n\n element.dataset.documentDropZoneInitialized = 'true';\n\n return state;\n }\n\n function scanForAutoInitialization(root) {\n if (!root || typeof root.querySelectorAll !== 'function') {\n return;\n }\n\n if (typeof root.matches === 'function' && root.matches('[data-document-drop-zone-file-input]')) {\n initializeFromElement(root);\n }\n\n root.querySelectorAll('[data-document-drop-zone-file-input]').forEach(initializeFromElement);\n }\n\n function startAutoInitialization() {\n scanForAutoInitialization(document);\n\n if (typeof MutationObserver === 'undefined') {\n return;\n }\n\n var observer = new MutationObserver(function (mutations) {\n mutations.forEach(function (mutation) {\n mutation.addedNodes.forEach(function (node) {\n if (node && node.nodeType === 1) {\n scanForAutoInitialization(node);\n }\n });\n });\n });\n\n observer.observe(document.body, {\n childList: true,\n subtree: true,\n });\n }\n\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', startAutoInitialization, { once: true });\n } else {\n startAutoInitialization();\n }\n})(window, document);\n"]}
@@ -1,2 +1,2 @@
1
- !function(e,t){"use strict";e.initDocumentDropZone=function(e){if(e){var n="string"==typeof e.dropZone?t.querySelector(e.dropZone):e.dropZone,r="string"==typeof e.fileInput?t.querySelector(e.fileInput):e.fileInput,o="string"==typeof e.browseButton?t.querySelector(e.browseButton):e.browseButton;n&&r&&(["dragenter","dragover","dragleave","drop"].forEach(function(e){n.addEventListener(e,i)}),n.addEventListener("dragenter",function(){d(!0)}),n.addEventListener("dragover",function(){d(!0)}),n.addEventListener("dragleave",function(e){n.contains(e.relatedTarget)||d(!1)}),n.addEventListener("drop",function(e){d(!1);var t=e.dataTransfer?e.dataTransfer.files:null;t&&t.length>0&&function(e,t){if(e&&t){var n=new DataTransfer;Array.prototype.forEach.call(t,function(e){n.items.add(e)}),e.files=n.files,e.dispatchEvent(new Event("change",{bubbles:!0}))}}(r,t)}),o&&o.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),a()}),n.addEventListener("click",function(e){e.target.closest("[data-drop-zone-browse]")||a()}))}function a(){r.click()}function i(e){e.preventDefault(),e.stopPropagation()}function d(e){n.classList.toggle("document-drop-zone--dragover",e)}}}(window,document);
1
+ !function(e,t){"use strict";var n="__documentDropZoneState";function o(t){if(!t||"true"===t.dataset.documentDropZoneInitialized)return t&&t[n]||null;var o={dropZone:t,fileInput:t.getAttribute("data-document-drop-zone-file-input"),browseButton:t.getAttribute("data-document-drop-zone-browse-button")},r=e.initDocumentDropZone(o);return r?(t.dataset.documentDropZoneInitialized="true",r):null}function r(e){e&&"function"==typeof e.querySelectorAll&&("function"==typeof e.matches&&e.matches("[data-document-drop-zone-file-input]")&&o(e),e.querySelectorAll("[data-document-drop-zone-file-input]").forEach(o))}function i(){(r(t),"undefined"!=typeof MutationObserver)&&new MutationObserver(function(e){e.forEach(function(e){e.addedNodes.forEach(function(e){e&&1===e.nodeType&&r(e)})})}).observe(t.body,{childList:!0,subtree:!0})}e.initDocumentDropZone=function(e){if(e){var o="string"==typeof e.dropZone?t.querySelector(e.dropZone):e.dropZone,r="string"==typeof e.fileInput?t.querySelector(e.fileInput):e.fileInput,i="string"==typeof e.browseButton?t.querySelector(e.browseButton):e.browseButton;if(o&&r){o[n]&&"function"==typeof o[n].dispose&&o[n].dispose(),["dragenter","dragover","dragleave","drop"].forEach(function(e){o.addEventListener(e,u)}),o.addEventListener("dragenter",s),o.addEventListener("dragover",f),o.addEventListener("dragleave",l),o.addEventListener("drop",p);var a=null;return i&&(a=function(e){e.preventDefault(),e.stopPropagation(),d()},i.addEventListener("click",a)),o.addEventListener("click",v),o[n]={dispose:function(){["dragenter","dragover","dragleave","drop"].forEach(function(e){o.removeEventListener(e,u)}),o.removeEventListener("dragenter",s),o.removeEventListener("dragover",f),o.removeEventListener("dragleave",l),o.removeEventListener("drop",p),o.removeEventListener("click",v),i&&a&&i.removeEventListener("click",a)}},o[n]}}function d(){r.click()}function u(e){e.preventDefault(),e.stopPropagation()}function c(e){o.classList.toggle("document-drop-zone--dragover",e)}function s(){c(!0)}function f(){c(!0)}function l(e){o.contains(e.relatedTarget)||c(!1)}function p(e){c(!1);var t=e.dataTransfer?e.dataTransfer.files:null;t&&t.length>0&&function(e,t){if(e&&t){var n=new DataTransfer;Array.prototype.forEach.call(t,function(e){n.items.add(e)}),e.files=n.files,e.dispatchEvent(new Event("change",{bubbles:!0}))}}(r,t)}function v(e){e.target.closest("[data-drop-zone-browse]")||d()}},"loading"===t.readyState?t.addEventListener("DOMContentLoaded",i,{once:!0}):i()}(window,document);
2
2
  //# sourceMappingURL=document-drop-zone.min.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["document-drop-zone.js"],"names":["window","document","initDocumentDropZone","options","dropZone","querySelector","fileInput","browseButton","forEach","eventName","addEventListener","preventDefaults","setDragState","event","contains","relatedTarget","files","dataTransfer","length","DataTransfer","Array","prototype","call","file","items","add","dispatchEvent","Event","bubbles","assignFiles","preventDefault","stopPropagation","openPicker","target","closest","click","isActive","classList","toggle"],"mappings":"CAAA,SAAWA,EAAQC,GACf,aAiBAD,EAAOE,qBAAuB,SAA8BC,GACxD,GAAKA,EAAL,CAIA,IAAIC,EAAuC,iBAArBD,EAAQC,SACxBH,EAASI,cAAcF,EAAQC,UAC/BD,EAAQC,SACVE,EAAyC,iBAAtBH,EAAQG,UACzBL,EAASI,cAAcF,EAAQG,WAC/BH,EAAQG,UACVC,EAA+C,iBAAzBJ,EAAQI,aAC5BN,EAASI,cAAcF,EAAQI,cAC/BJ,EAAQI,aAETH,GAAaE,IAiBlB,CAAC,YAAa,WAAY,YAAa,QAAQE,QAAQ,SAAUC,GAC7DL,EAASM,iBAAiBD,EAAWE,EACzC,GAEAP,EAASM,iBAAiB,YAAa,WAAcE,GAAa,EAAO,GACzER,EAASM,iBAAiB,WAAY,WAAcE,GAAa,EAAO,GACxER,EAASM,iBAAiB,YAAa,SAAUG,GACxCT,EAASU,SAASD,EAAME,gBACzBH,GAAa,EAErB,GACAR,EAASM,iBAAiB,OAAQ,SAAUG,GACxCD,GAAa,GACb,IAAII,EAAQH,EAAMI,aAAeJ,EAAMI,aAAaD,MAAQ,KACxDA,GAASA,EAAME,OAAS,GA7DpC,SAAqBZ,EAAWU,GAC5B,GAAKV,GAAcU,EAAnB,CAIA,IAAIC,EAAe,IAAIE,aAEvBC,MAAMC,UAAUb,QAAQc,KAAKN,EAAO,SAAUO,GAC1CN,EAAaO,MAAMC,IAAIF,EAC3B,GAEAjB,EAAUU,MAAQC,EAAaD,MAC/BV,EAAUoB,cAAc,IAAIC,MAAM,SAAU,CAAEC,SAAS,IATvD,CAUJ,CAiDYC,CAAYvB,EAAWU,EAE/B,GAEIT,GACAA,EAAaG,iBAAiB,QAAS,SAAUG,GAC7CA,EAAMiB,iBACNjB,EAAMkB,kBACNC,GACJ,GAGJ5B,EAASM,iBAAiB,QAAS,SAAUG,GACrCA,EAAMoB,OAAOC,QAAQ,4BAIzBF,GACJ,GA9DA,CAgBA,SAASA,IACL1B,EAAU6B,OACd,CAEA,SAASxB,EAAgBE,GACrBA,EAAMiB,iBACNjB,EAAMkB,iBACV,CAEA,SAASnB,EAAawB,GAClBhC,EAASiC,UAAUC,OAAO,+BAAgCF,EAC9D,CAoCJ,CACH,CArFD,CAqFGpC,OAAQC","file":"document-drop-zone.min.js","sourcesContent":["(function (window, document) {\n 'use strict';\n\n function assignFiles(fileInput, files) {\n if (!fileInput || !files) {\n return;\n }\n\n var dataTransfer = new DataTransfer();\n\n Array.prototype.forEach.call(files, function (file) {\n dataTransfer.items.add(file);\n });\n\n fileInput.files = dataTransfer.files;\n fileInput.dispatchEvent(new Event('change', { bubbles: true }));\n }\n\n window.initDocumentDropZone = function initDocumentDropZone(options) {\n if (!options) {\n return;\n }\n\n var dropZone = typeof options.dropZone === 'string'\n ? document.querySelector(options.dropZone)\n : options.dropZone;\n var fileInput = typeof options.fileInput === 'string'\n ? document.querySelector(options.fileInput)\n : options.fileInput;\n var browseButton = typeof options.browseButton === 'string'\n ? document.querySelector(options.browseButton)\n : options.browseButton;\n\n if (!dropZone || !fileInput) {\n return;\n }\n\n function openPicker() {\n fileInput.click();\n }\n\n function preventDefaults(event) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n function setDragState(isActive) {\n dropZone.classList.toggle('document-drop-zone--dragover', isActive);\n }\n\n ['dragenter', 'dragover', 'dragleave', 'drop'].forEach(function (eventName) {\n dropZone.addEventListener(eventName, preventDefaults);\n });\n\n dropZone.addEventListener('dragenter', function () { setDragState(true); });\n dropZone.addEventListener('dragover', function () { setDragState(true); });\n dropZone.addEventListener('dragleave', function (event) {\n if (!dropZone.contains(event.relatedTarget)) {\n setDragState(false);\n }\n });\n dropZone.addEventListener('drop', function (event) {\n setDragState(false);\n var files = event.dataTransfer ? event.dataTransfer.files : null;\n if (files && files.length > 0) {\n assignFiles(fileInput, files);\n }\n });\n\n if (browseButton) {\n browseButton.addEventListener('click', function (event) {\n event.preventDefault();\n event.stopPropagation();\n openPicker();\n });\n }\n\n dropZone.addEventListener('click', function (event) {\n if (event.target.closest('[data-drop-zone-browse]')) {\n return;\n }\n\n openPicker();\n });\n };\n})(window, document);\n"]}
1
+ {"version":3,"sources":["document-drop-zone.js"],"names":["window","document","dropZoneStateKey","initializeFromElement","element","dataset","documentDropZoneInitialized","options","dropZone","fileInput","getAttribute","browseButton","state","initDocumentDropZone","scanForAutoInitialization","root","querySelectorAll","matches","forEach","startAutoInitialization","MutationObserver","mutations","mutation","addedNodes","node","nodeType","observe","body","childList","subtree","querySelector","dispose","eventName","addEventListener","preventDefaults","handleDragEnter","handleDragOver","handleDragLeave","handleDrop","handleBrowseClick","event","preventDefault","stopPropagation","openPicker","handleClick","removeEventListener","click","setDragState","isActive","classList","toggle","contains","relatedTarget","files","dataTransfer","length","DataTransfer","Array","prototype","call","file","items","add","dispatchEvent","Event","bubbles","assignFiles","target","closest","readyState","once"],"mappings":"CAAA,SAAWA,EAAQC,GACf,aAEA,IAAIC,EAAmB,0BA8HvB,SAASC,EAAsBC,GAC3B,IAAKA,GAA2D,SAAhDA,EAAQC,QAAQC,4BAC5B,OAAOF,GAAUA,EAAQF,IAA4B,KAGzD,IAAIK,EAAU,CACVC,SAAUJ,EACVK,UAAWL,EAAQM,aAAa,sCAChCC,aAAcP,EAAQM,aAAa,0CAGnCE,EAAQZ,EAAOa,qBAAqBN,GACxC,OAAKK,GAILR,EAAQC,QAAQC,4BAA8B,OAEvCM,GALI,IAMf,CAEA,SAASE,EAA0BC,GAC1BA,GAAyC,mBAA1BA,EAAKC,mBAIG,mBAAjBD,EAAKE,SAA0BF,EAAKE,QAAQ,yCACnDd,EAAsBY,GAG1BA,EAAKC,iBAAiB,wCAAwCE,QAAQf,GAC1E,CAEA,SAASgB,KACLL,EAA0Bb,GAEM,oBAArBmB,mBAII,IAAIA,iBAAiB,SAAUC,GAC1CA,EAAUH,QAAQ,SAAUI,GACxBA,EAASC,WAAWL,QAAQ,SAAUM,GAC9BA,GAA0B,IAAlBA,EAAKC,UACbX,EAA0BU,EAElC,EACJ,EACJ,GAESE,QAAQzB,EAAS0B,KAAM,CAC5BC,WAAW,EACXC,SAAS,GAEjB,CAnKA7B,EAAOa,qBAAuB,SAA8BN,GACxD,GAAKA,EAAL,CAIA,IAAIC,EAAuC,iBAArBD,EAAQC,SACxBP,EAAS6B,cAAcvB,EAAQC,UAC/BD,EAAQC,SACVC,EAAyC,iBAAtBF,EAAQE,UACzBR,EAAS6B,cAAcvB,EAAQE,WAC/BF,EAAQE,UACVE,EAA+C,iBAAzBJ,EAAQI,aAC5BV,EAAS6B,cAAcvB,EAAQI,cAC/BJ,EAAQI,aAEd,GAAKH,GAAaC,EAAlB,CAIID,EAASN,IAAmE,m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K5C,GAAc4C,EAAnB,CAIA,IAAIC,EAAe,IAAIE,aAEvBC,MAAMC,UAAUxC,QAAQyC,KAAKN,EAAO,SAAUO,GAC1CN,EAAaO,MAAMC,IAAIF,EAC3B,GAEAnD,EAAU4C,MAAQC,EAAaD,MAC/B5C,EAAUsD,cAAc,IAAIC,MAAM,SAAU,CAAEC,SAAS,IATvD,CAUJ,CAwDYC,CAAYzD,EAAW4C,EAE/B,CAsBA,SAAST,EAAYJ,GACbA,EAAM2B,OAAOC,QAAQ,4BAIzBzB,GACJ,CAuBJ,EA0D4B,YAAxB1C,EAASoE,WACTpE,EAASgC,iBAAiB,mBAAoBd,EAAyB,CAAEmD,MAAM,IAE/EnD,GAEP,CA9LD,CA8LGnB,OAAQC","file":"document-drop-zone.min.js","sourcesContent":["(function (window, document) {\n 'use strict';\n\n var dropZoneStateKey = '__documentDropZoneState';\n\n function assignFiles(fileInput, files) {\n if (!fileInput || !files) {\n return;\n }\n\n var dataTransfer = new DataTransfer();\n\n Array.prototype.forEach.call(files, function (file) {\n dataTransfer.items.add(file);\n });\n\n fileInput.files = dataTransfer.files;\n fileInput.dispatchEvent(new Event('change', { bubbles: true }));\n }\n\n window.initDocumentDropZone = function initDocumentDropZone(options) {\n if (!options) {\n return;\n }\n\n var dropZone = typeof options.dropZone === 'string'\n ? document.querySelector(options.dropZone)\n : options.dropZone;\n var fileInput = typeof options.fileInput === 'string'\n ? document.querySelector(options.fileInput)\n : options.fileInput;\n var browseButton = typeof options.browseButton === 'string'\n ? document.querySelector(options.browseButton)\n : options.browseButton;\n\n if (!dropZone || !fileInput) {\n return;\n }\n\n if (dropZone[dropZoneStateKey] && typeof dropZone[dropZoneStateKey].dispose === 'function') {\n dropZone[dropZoneStateKey].dispose();\n }\n\n function openPicker() {\n fileInput.click();\n }\n\n function preventDefaults(event) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n function setDragState(isActive) {\n dropZone.classList.toggle('document-drop-zone--dragover', isActive);\n }\n\n function handleDragEnter() {\n setDragState(true);\n }\n\n function handleDragOver() {\n setDragState(true);\n }\n\n function handleDragLeave(event) {\n if (!dropZone.contains(event.relatedTarget)) {\n setDragState(false);\n }\n }\n\n function handleDrop(event) {\n setDragState(false);\n var files = event.dataTransfer ? event.dataTransfer.files : null;\n if (files && files.length > 0) {\n assignFiles(fileInput, files);\n }\n }\n\n ['dragenter', 'dragover', 'dragleave', 'drop'].forEach(function (eventName) {\n dropZone.addEventListener(eventName, preventDefaults);\n });\n\n dropZone.addEventListener('dragenter', handleDragEnter);\n dropZone.addEventListener('dragover', handleDragOver);\n dropZone.addEventListener('dragleave', handleDragLeave);\n dropZone.addEventListener('drop', handleDrop);\n\n var handleBrowseClick = null;\n if (browseButton) {\n handleBrowseClick = function (event) {\n event.preventDefault();\n event.stopPropagation();\n openPicker();\n };\n\n browseButton.addEventListener('click', handleBrowseClick);\n }\n\n function handleClick(event) {\n if (event.target.closest('[data-drop-zone-browse]')) {\n return;\n }\n\n openPicker();\n }\n\n dropZone.addEventListener('click', handleClick);\n\n dropZone[dropZoneStateKey] = {\n dispose: function () {\n ['dragenter', 'dragover', 'dragleave', 'drop'].forEach(function (eventName) {\n dropZone.removeEventListener(eventName, preventDefaults);\n });\n\n dropZone.removeEventListener('dragenter', handleDragEnter);\n dropZone.removeEventListener('dragover', handleDragOver);\n dropZone.removeEventListener('dragleave', handleDragLeave);\n dropZone.removeEventListener('drop', handleDrop);\n dropZone.removeEventListener('click', handleClick);\n\n if (browseButton && handleBrowseClick) {\n browseButton.removeEventListener('click', handleBrowseClick);\n }\n }\n };\n\n return dropZone[dropZoneStateKey];\n };\n\n function initializeFromElement(element) {\n if (!element || element.dataset.documentDropZoneInitialized === 'true') {\n return element ? element[dropZoneStateKey] || null : null;\n }\n\n var options = {\n dropZone: element,\n fileInput: element.getAttribute('data-document-drop-zone-file-input'),\n browseButton: element.getAttribute('data-document-drop-zone-browse-button'),\n };\n\n var state = window.initDocumentDropZone(options);\n if (!state) {\n return null;\n }\n\n element.dataset.documentDropZoneInitialized = 'true';\n\n return state;\n }\n\n function scanForAutoInitialization(root) {\n if (!root || typeof root.querySelectorAll !== 'function') {\n return;\n }\n\n if (typeof root.matches === 'function' && root.matches('[data-document-drop-zone-file-input]')) {\n initializeFromElement(root);\n }\n\n root.querySelectorAll('[data-document-drop-zone-file-input]').forEach(initializeFromElement);\n }\n\n function startAutoInitialization() {\n scanForAutoInitialization(document);\n\n if (typeof MutationObserver === 'undefined') {\n return;\n }\n\n var observer = new MutationObserver(function (mutations) {\n mutations.forEach(function (mutation) {\n mutation.addedNodes.forEach(function (node) {\n if (node && node.nodeType === 1) {\n scanForAutoInitialization(node);\n }\n });\n });\n });\n\n observer.observe(document.body, {\n childList: true,\n subtree: true,\n });\n }\n\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', startAutoInitialization, { once: true });\n } else {\n startAutoInitialization();\n }\n})(window, document);\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crestapps/ai-chat-ui",
3
- "version": "1.0.0-preview.90",
3
+ "version": "1.0.0-preview.96",
4
4
  "description": "Browser-ready JavaScript widgets and CSS for CrestApps AI chat sessions and chat interactions. Supports streaming responses, image generation, Chart.js interactive charts, document uploads, copy-to-clipboard, and feedback buttons.",
5
5
  "license": "MIT",
6
6
  "author": "CrestApps",