ai12z 3.16.1-alpha.1 → 3.16.1-alpha.2
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/cjs/{SearchResult-DirxAsMi.js → SearchResult-CvTJr55G.js} +1 -1
- package/dist/cjs/ai12z-bot.cjs.entry.js +40 -18
- package/dist/cjs/ai12z-category_2.cjs.entry.js +7 -7
- package/dist/cjs/ai12z-chat-message.cjs.entry.js +3 -3
- package/dist/cjs/ai12z-chat_2.cjs.entry.js +163 -46
- package/dist/cjs/ai12z-container.cjs.entry.js +4 -4
- package/dist/cjs/ai12z-cta.cjs.entry.js +15 -13
- package/dist/cjs/ai12z-form.cjs.entry.js +9 -6
- package/dist/cjs/ai12z-inline-search.cjs.entry.js +8 -8
- package/dist/cjs/ai12z-knowledge-box.cjs.entry.js +11 -11
- package/dist/cjs/ai12z-search-panel.cjs.entry.js +8 -8
- package/dist/cjs/ai12z-spinner.cjs.entry.js +2 -2
- package/dist/cjs/{app-store-D249GRTi.js → app-store-BtkiHvcw.js} +1 -1
- package/dist/cjs/chat-avatar_6.cjs.entry.js +4 -4
- package/dist/cjs/chatbot-history_2.cjs.entry.js +1 -1
- package/dist/cjs/{ctaHelpers-C155mCQE.js → ctaHelpers-DUPj5SnE.js} +1 -1
- package/dist/cjs/dynamic-form.cjs.entry.js +4 -4
- package/dist/cjs/image-uploader_2.cjs.entry.js +2 -2
- package/dist/cjs/{index-7yvwbcAl.js → index-CKLC7f4y.js} +1 -1
- package/dist/cjs/{index-Ct2DwlDF.js → index-v8T1EJAJ.js} +1 -1
- package/dist/cjs/index.cjs.js +15 -15
- package/dist/cjs/item-list.cjs.entry.js +7 -4
- package/dist/cjs/{keyboard-shortcuts-WOyQOe62.js → keyboard-shortcuts-BWprLtLj.js} +2 -2
- package/dist/cjs/library.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{logger-B_JTV5L8.js → logger-2ZBZCKdM.js} +1 -1
- package/dist/cjs/{parseHelper-DjDPCQ3f.js → parseHelper-5fRVefLm.js} +2 -2
- package/dist/cjs/{processCarouselData-6FLCPOVT.js → processCarouselData-kCVPE4mw.js} +1 -1
- package/dist/cjs/{reCaptchaHelpers-BIbBtULr.js → reCaptchaHelpers-sfktrnTF.js} +1 -1
- package/dist/cjs/{scriptStyleLoader-8VXGYoY8.js → scriptStyleLoader-D-bqKqSb.js} +4 -2
- package/dist/cjs/search-results-page.cjs.entry.js +20 -20
- package/dist/cjs/{socket-service-CUHVVM8r.js → socket-service-5mM7NSYN.js} +2 -2
- package/dist/cjs/{styleSheetRegistry-Cf6kOnS3.js → styleSheetRegistry-CaWjqgX7.js} +1 -1
- package/dist/cjs/{surveyHelpers-CnSWyzvp.js → surveyHelpers-DohugkWP.js} +1 -1
- package/dist/cjs/{utils-BkemWeq3.js → utils-7C5_GnyF.js} +1 -1
- package/dist/collection/components/ai12z-bot/ai12z-bot.js +5 -2
- package/dist/collection/components/ai12z-bot/ai12z-chatbot.css +17 -17
- package/dist/collection/components/ai12z-bot/privacy-modal.js +2 -2
- package/dist/collection/components/ai12z-cta/ai12z-cta.css +34 -38
- package/dist/collection/components/ai12z-cta/ai12z-cta.js +6 -6
- package/dist/collection/components/ai12z-cta/components/Chat.js +3 -6
- package/dist/collection/components/ai12z-cta/components/DynamicForm.js +3 -3
- package/dist/collection/components/ai12z-cta/components/ai12z-chat.css +17 -17
- package/dist/collection/components/ai12z-cta/components/itemlist/item-list.js +5 -2
- package/dist/collection/components/ai12z-form/ai12z-form.js +5 -2
- package/dist/collection/components/ai12z-inline-search/ai12z-inline-search.js +4 -4
- package/dist/collection/components/ai12z-knowledge-box/ai12z-knowledge-box.css +3 -3
- package/dist/collection/components/ai12z-knowledge-box/ai12z-knowledge-box.js +4 -4
- package/dist/collection/components/ai12z-search-panel/ai12z-search-panel.css +17 -17
- package/dist/collection/components/ai12z-search-panel/ai12z-search-panel.js +4 -4
- package/dist/collection/components/ai12z-search-panel/search-results-view.css +31 -31
- package/dist/collection/components/ai12z-search-panel/search-results-view.js +14 -14
- package/dist/collection/components/input/Input.js +148 -28
- package/dist/collection/components/input/input.css +151 -15
- package/dist/collection/components/spinner/Spinner.js +1 -1
- package/dist/collection/global/tailwind.css +1 -0
- package/dist/collection/utils/liveagents/providers/salesforce.js +22 -3
- package/dist/collection/utils/scriptStyleLoader.js +3 -2
- package/dist/components/ai12z-bot.js +1 -1
- package/dist/components/ai12z-category.js +1 -1
- package/dist/components/ai12z-chat-message.js +1 -1
- package/dist/components/ai12z-chat.js +1 -1
- package/dist/components/ai12z-container.js +1 -1
- package/dist/components/ai12z-cta.js +1 -1
- package/dist/components/ai12z-form.js +1 -1
- package/dist/components/ai12z-inline-search.js +1 -1
- package/dist/components/ai12z-input-form.js +1 -1
- package/dist/components/ai12z-knowledge-box.js +1 -1
- package/dist/components/ai12z-search-panel.js +1 -1
- package/dist/components/ai12z-spinner.js +1 -1
- package/dist/components/audio-recorder.js +1 -1
- package/dist/components/chat-avatar.js +1 -1
- package/dist/components/chatbot-history.js +1 -1
- package/dist/components/delete-confirmation-modal.js +1 -1
- package/dist/components/dynamic-form.js +1 -1
- package/dist/components/hamburger-menu.js +1 -1
- package/dist/components/image-uploader.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/interaction-buttons.js +1 -1
- package/dist/components/item-list.js +1 -1
- package/dist/components/keyboard-shortcuts-dialog.js +1 -1
- package/dist/components/live-agent-chat.js +1 -1
- package/dist/components/p-9ZSKFUQq.js +1 -0
- package/dist/components/p-B8jSr9lW.js +1 -0
- package/dist/components/{p-Bi-REV5s.js → p-BBkc2Zz3.js} +1 -1
- package/dist/components/{p-BczaHEQv.js → p-BGqU6S_C.js} +1 -1
- package/dist/components/p-BHZ4-nkE.js +1 -0
- package/dist/components/{p-BX6jfJVh.js → p-BOiNZwPJ.js} +1 -1
- package/dist/components/{p-Cul4gRY4.js → p-BugQD-4q.js} +1 -1
- package/dist/components/p-C0caR14R.js +1 -0
- package/dist/components/{p-BNRHkg-z.js → p-C2pbHN4a.js} +1 -1
- package/dist/components/{p-CLPdxk7O.js → p-C3JmvA9z.js} +1 -1
- package/dist/components/{p-DPq7OOGr.js → p-C3hnDJ1x.js} +1 -1
- package/dist/components/{p-DOqH37Pm.js → p-C5rVF0zE.js} +2 -2
- package/dist/components/{p-Cem5FyPk.js → p-CGQBDC3e.js} +2 -2
- package/dist/components/{p-DpEYThNR.js → p-COOdy5C-.js} +1 -1
- package/dist/components/p-CcfettiK.js +1 -0
- package/dist/components/p-CfmVopBG.js +1 -0
- package/dist/components/{p-BvDN-lhu.js → p-Cv-HbFj1.js} +1 -1
- package/dist/components/p-D-mcIUO8.js +1 -0
- package/dist/components/{p-U4xTjAZs.js → p-DEkZRvM1.js} +1 -1
- package/dist/components/p-DQKllbP7.js +1 -0
- package/dist/components/{p-ZGVz1_9H.js → p-De--d4FT.js} +2 -2
- package/dist/components/{p-C3NXZJ8l.js → p-DiUq1_cL.js} +1 -1
- package/dist/components/{p-BwTPnzKJ.js → p-DlmdK220.js} +1 -1
- package/dist/components/p-DndtP5Bd.js +1 -0
- package/dist/components/{p-CBiDiWMi.js → p-DvJUX5RM.js} +1 -1
- package/dist/components/p-GhhnA1Fw.js +1 -0
- package/dist/components/{p-fJE54v21.js → p-NQcpUWMC.js} +1 -1
- package/dist/components/{p-D2lp8C5d.js → p-Q3uBgncp.js} +1 -1
- package/dist/components/p-ZQeNPv0R.js +1 -0
- package/dist/components/{p-VKmtVBdp.js → p-hbJqzZAj.js} +1 -1
- package/dist/components/p-jD70af30.js +1 -0
- package/dist/components/{p-DV6vheeJ.js → p-k5IjpIIA.js} +1 -1
- package/dist/components/p-tEjcbjhZ.js +1 -0
- package/dist/components/privacy-modal.js +1 -1
- package/dist/components/search-results-page.js +1 -1
- package/dist/components/typing-indicator.js +1 -1
- package/dist/esm/{SearchResult-zLaEhc3L.js → SearchResult-C3g6BSvv.js} +1 -1
- package/dist/esm/ai12z-bot.entry.js +40 -18
- package/dist/esm/ai12z-category_2.entry.js +7 -7
- package/dist/esm/ai12z-chat-message.entry.js +3 -3
- package/dist/esm/ai12z-chat_2.entry.js +163 -46
- package/dist/esm/ai12z-container.entry.js +4 -4
- package/dist/esm/ai12z-cta.entry.js +15 -13
- package/dist/esm/ai12z-form.entry.js +9 -6
- package/dist/esm/ai12z-inline-search.entry.js +8 -8
- package/dist/esm/ai12z-knowledge-box.entry.js +11 -11
- package/dist/esm/ai12z-search-panel.entry.js +8 -8
- package/dist/esm/ai12z-spinner.entry.js +2 -2
- package/dist/esm/{app-store-DYN4CiXV.js → app-store-BSQPOUME.js} +1 -1
- package/dist/esm/chat-avatar_6.entry.js +4 -4
- package/dist/esm/chatbot-history_2.entry.js +1 -1
- package/dist/esm/{ctaHelpers-C4e51qnO.js → ctaHelpers-BOdS23pG.js} +1 -1
- package/dist/esm/dynamic-form.entry.js +4 -4
- package/dist/esm/image-uploader_2.entry.js +2 -2
- package/dist/esm/{index-BNpVu1WU.js → index-B9OPtxv2.js} +1 -1
- package/dist/esm/{index-B1TMiWhO.js → index-CZVgVfgd.js} +1 -1
- package/dist/esm/index.js +15 -15
- package/dist/esm/item-list.entry.js +7 -4
- package/dist/esm/{keyboard-shortcuts-Bk21yvRt.js → keyboard-shortcuts-9ySnK42C.js} +2 -2
- package/dist/esm/library.js +2 -2
- package/dist/esm/loader.js +2 -2
- package/dist/esm/{logger-DUcx64Gz.js → logger-C0PEnW3T.js} +1 -1
- package/dist/esm/{parseHelper-gVIHT7hQ.js → parseHelper-TNZZ7pZJ.js} +2 -2
- package/dist/esm/{processCarouselData-DVQDRd62.js → processCarouselData-BbqNSwni.js} +1 -1
- package/dist/esm/{reCaptchaHelpers-OYM0kzvt.js → reCaptchaHelpers-BRdKn-CM.js} +1 -1
- package/dist/esm/{scriptStyleLoader-DXBxSLgN.js → scriptStyleLoader-_-YNtQPs.js} +4 -2
- package/dist/esm/search-results-page.entry.js +20 -20
- package/dist/esm/{socket-service-Cg81jrif.js → socket-service-BaSfS-C4.js} +2 -2
- package/dist/esm/{styleSheetRegistry-CE8gVmmQ.js → styleSheetRegistry-BccKic5X.js} +1 -1
- package/dist/esm/{surveyHelpers-AQCMAhqW.js → surveyHelpers-BeCs_jb6.js} +1 -1
- package/dist/esm/{utils-CULbS8sV.js → utils-C75qrx0v.js} +1 -1
- package/dist/library/index.esm.js +1 -1
- package/dist/library/library.esm.js +1 -1
- package/dist/library/p-03e6c526.entry.js +1 -0
- package/dist/library/p-09ccce13.entry.js +1 -0
- package/dist/library/{p-2d001378.entry.js → p-0a6d1461.entry.js} +1 -1
- package/dist/library/p-1174b3f9.entry.js +1 -0
- package/dist/library/{p-834a8cbd.entry.js → p-21e30d74.entry.js} +1 -1
- package/dist/library/p-48be863a.entry.js +1 -0
- package/dist/library/p-4b1b23ad.entry.js +1 -0
- package/dist/library/p-4f5c680e.entry.js +1 -0
- package/dist/library/{p-0f3e9ab9.entry.js → p-6c81c334.entry.js} +2 -2
- package/dist/library/p-74379d4c.entry.js +1 -0
- package/dist/library/p-8f41d206.entry.js +1 -0
- package/dist/library/p-97c4b33d.entry.js +1 -0
- package/dist/library/{p-CV0mPAnV.js → p-B18nLcR3.js} +1 -1
- package/dist/library/{p-BNpVu1WU.js → p-B9OPtxv2.js} +2 -2
- package/dist/library/{p-Ct8sQ1U7.js → p-BdtAdObU.js} +1 -1
- package/dist/library/{p-BQ6J3hmg.js → p-C33Bq1u3.js} +1 -1
- package/dist/library/{p-eEaKza-p.js → p-C7dGy5Bg.js} +1 -1
- package/dist/library/{p-C-TEC3kM.js → p-C7riVXol.js} +1 -1
- package/dist/library/{p-CkF7XHob.js → p-CVoJ6Qcc.js} +1 -1
- package/dist/library/{p-uxR195i6.js → p-CZ_3jJSY.js} +1 -1
- package/dist/library/{p-t-IIK8Lf.js → p-CfHNdl7N.js} +1 -1
- package/dist/library/{p-CCX5tDch.js → p-CqE4eXes.js} +1 -1
- package/dist/library/{p-C0mTjqwo.js → p-CsG0EN7R.js} +1 -1
- package/dist/library/{p-K29FTcpc.js → p-D5B5YlEl.js} +1 -1
- package/dist/library/{p-9vi1mn3E.js → p-DginFHFR.js} +1 -1
- package/dist/library/{p-8-Jaom_c.js → p-SsXpfHmP.js} +1 -1
- package/dist/library/p-_4Q98Hn5.js +1 -0
- package/dist/library/p-ac9bbba9.entry.js +1 -0
- package/dist/library/p-b744339c.entry.js +1 -0
- package/dist/library/p-cd6d00c7.entry.js +1 -0
- package/dist/library/p-d20ffcd1.entry.js +1 -0
- package/dist/library/{p-45a98c22.entry.js → p-d39e26f2.entry.js} +1 -1
- package/dist/types/components/input/Input.d.ts +17 -1
- package/package.json +3 -2
- package/dist/components/p-BKtxX2NI.js +0 -1
- package/dist/components/p-BLccTHb0.js +0 -1
- package/dist/components/p-BPDEFLRB.js +0 -1
- package/dist/components/p-Bbl-20Mv.js +0 -1
- package/dist/components/p-CC8cite0.js +0 -1
- package/dist/components/p-CigYNDIu.js +0 -1
- package/dist/components/p-DXBxSLgN.js +0 -1
- package/dist/components/p-DXCT5yQi.js +0 -1
- package/dist/components/p-DXrJp_Oi.js +0 -1
- package/dist/components/p-Df9qc2ID.js +0 -1
- package/dist/components/p-Dq1olnpE.js +0 -1
- package/dist/components/p-DurEFI7x.js +0 -1
- package/dist/components/p-Q_-aQ2HA.js +0 -1
- package/dist/library/p-0e878a47.entry.js +0 -1
- package/dist/library/p-1b526a0b.entry.js +0 -1
- package/dist/library/p-20244e8e.entry.js +0 -1
- package/dist/library/p-31191f51.entry.js +0 -1
- package/dist/library/p-352117bd.entry.js +0 -1
- package/dist/library/p-35d4d829.entry.js +0 -1
- package/dist/library/p-3ec86817.entry.js +0 -1
- package/dist/library/p-4db922ec.entry.js +0 -1
- package/dist/library/p-84168066.entry.js +0 -1
- package/dist/library/p-8c5400c6.entry.js +0 -1
- package/dist/library/p-DXBxSLgN.js +0 -1
- package/dist/library/p-cfc2295e.entry.js +0 -1
- package/dist/library/p-d30afe73.entry.js +0 -1
- package/dist/library/p-ffd7e67a.entry.js +0 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-v8T1EJAJ.js');
|
|
4
4
|
var responseAdapter = require('./response-adapter-CKKyyhMj.js');
|
|
5
|
-
var processCarouselData = require('./processCarouselData-
|
|
6
|
-
var logger$1 = require('./logger-
|
|
7
|
-
var utils = require('./utils-
|
|
8
|
-
var index$1 = require('./index-
|
|
5
|
+
var processCarouselData = require('./processCarouselData-kCVPE4mw.js');
|
|
6
|
+
var logger$1 = require('./logger-2ZBZCKdM.js');
|
|
7
|
+
var utils = require('./utils-7C5_GnyF.js');
|
|
8
|
+
var index$1 = require('./index-CKLC7f4y.js');
|
|
9
9
|
var globalStore = require('./global-store-R6x06KvJ.js');
|
|
10
|
-
var reCaptchaHelpers = require('./reCaptchaHelpers-
|
|
10
|
+
var reCaptchaHelpers = require('./reCaptchaHelpers-sfktrnTF.js');
|
|
11
11
|
var botHelpers = require('./botHelpers-D5Dj7TRA.js');
|
|
12
|
-
var surveyHelpers = require('./surveyHelpers-
|
|
13
|
-
var scriptStyleLoader = require('./scriptStyleLoader-
|
|
14
|
-
var keyboardShortcuts = require('./keyboard-shortcuts-
|
|
15
|
-
var ctaHelpers = require('./ctaHelpers-
|
|
16
|
-
var appStore = require('./app-store-
|
|
17
|
-
var parseHelper = require('./parseHelper-
|
|
12
|
+
var surveyHelpers = require('./surveyHelpers-DohugkWP.js');
|
|
13
|
+
var scriptStyleLoader = require('./scriptStyleLoader-D-bqKqSb.js');
|
|
14
|
+
var keyboardShortcuts = require('./keyboard-shortcuts-BWprLtLj.js');
|
|
15
|
+
var ctaHelpers = require('./ctaHelpers-DUPj5SnE.js');
|
|
16
|
+
var appStore = require('./app-store-BtkiHvcw.js');
|
|
17
|
+
var parseHelper = require('./parseHelper-5fRVefLm.js');
|
|
18
18
|
require('./_commonjsHelpers-MBWFX2dn.js');
|
|
19
19
|
|
|
20
20
|
// ILiveAgentProvider.ts
|
|
@@ -450,9 +450,17 @@ class SalesforceLiveAgentProvider {
|
|
|
450
450
|
throw new Error("Failed to create EventSource");
|
|
451
451
|
}
|
|
452
452
|
this.eventSource = eventSource;
|
|
453
|
-
eventSource.onerror = () => {
|
|
454
|
-
|
|
455
|
-
//
|
|
453
|
+
eventSource.onerror = (event) => {
|
|
454
|
+
// Native EventSource routes BOTH transport failures and any server-sent
|
|
455
|
+
// `event: error` frame to this same "error" channel (WHATWG spec: a frame
|
|
456
|
+
// with `event: error` dispatches a MessageEvent of type "error"). A server
|
|
457
|
+
// frame carries `.data`; a transport failure is a bare Event. Read the data
|
|
458
|
+
// when present so an upstream rejection is logged with its status rather
|
|
459
|
+
// than as a generic "connection lost". (The proxy also sends a dedicated
|
|
460
|
+
// `upstream_error` event — see below — which is the preferred, unambiguous
|
|
461
|
+
// channel; this stays as a defensive fallback.)
|
|
462
|
+
const data = event === null || event === void 0 ? void 0 : event.data;
|
|
463
|
+
logger.error(typeof data === "string" && data ? `❌ SSE server error frame: ${data}` : "❌ SSE Error: Connection lost or error occurred");
|
|
456
464
|
ChatEventBus.emit("AGENT_ERROR", true);
|
|
457
465
|
// Optionally, you can close the EventSource if needed
|
|
458
466
|
eventSource.close();
|
|
@@ -553,6 +561,17 @@ class SalesforceLiveAgentProvider {
|
|
|
553
561
|
};
|
|
554
562
|
Object.values(SF_ENTRY_EVENT_MAP).forEach(type => eventSource.addEventListener(type, handleSSEMessage));
|
|
555
563
|
eventSource.onmessage = handleSSEMessage;
|
|
564
|
+
// The SSE proxy signals a Salesforce upstream rejection (non-200) with a
|
|
565
|
+
// dedicated named event carrying a plain-text reason. It is deliberately NOT
|
|
566
|
+
// named `error`, which would collide with EventSource's native error channel
|
|
567
|
+
// (onerror) and be indistinguishable from a transport failure. Handle it here
|
|
568
|
+
// so the specific status is logged and the user is notified. NOTE: the data is
|
|
569
|
+
// plain text ("upstream returned 503"), so do NOT JSON.parse it.
|
|
570
|
+
eventSource.addEventListener("upstream_error", (event) => {
|
|
571
|
+
logger.error("❌ Live agent SSE upstream error:", event.data);
|
|
572
|
+
ChatEventBus.emit("AGENT_ERROR", true);
|
|
573
|
+
eventSource.close();
|
|
574
|
+
});
|
|
556
575
|
}
|
|
557
576
|
/** Interface Implementation */
|
|
558
577
|
/**
|
|
@@ -1009,7 +1028,7 @@ function deleteJsonCookie(name, options = {}) {
|
|
|
1009
1028
|
|
|
1010
1029
|
const ai12zBotCss = () => `:host{font-family:var(--ai12zBot-v2-font-family) !important;font-size:var(--ai12zBot-v2-font-size) !important;color:var(--ai12zBot-v2-font-color, black);text-align:var(--ai12zBot-v2-text-align, left)}.chat-body{height:100%;overflow-y:auto;display:flex;flex-direction:column;gap:10px;overflow-x:hidden}.chat-body::-webkit-scrollbar{width:5px;height:5px;}.chat-body::-webkit-scrollbar-thumb{background-color:#888;border-radius:10px;}.message{padding:10px;border-radius:15px;font-size:14px;line-height:1.4;word-wrap:break-word}span.prose{font-size:14px;}.image-Container{position:relative;display:inline-block;margin-right:10px}.delete-image{opacity:3;position:absolute;right:3px;top:0;cursor:pointer;line-height:10px}.ai12zBtn{background-color:var(--ai12zBot-v2-button-background) !important;color:var(--ai12zBot-v2-button-font-color);padding:5px 10px;border:none;border-radius:5px;cursor:pointer;text-decoration:none;margin:5px}.ai12z-btn{background-color:var(--ai12zBot-v2-button-background) !important;color:var(--ai12zBot-v2-button-font-color);padding:5px 10px;border:none;border-radius:5px;cursor:pointer;text-decoration:none;margin:5px}.custom-privacy{color:var(--ai12z-bot-privacy-color);padding-bottom:10px;padding-left:5px;margin-top:auto;}@media (max-width: 768px){.hide-chatbot{display:none !important}}`;
|
|
1011
1030
|
|
|
1012
|
-
const ai12zChatbotCss = () => `:host{--wes-c-icon-color:#fff;--fab-bottom:26px;--xsf-ai12z-zindex-isexpanded-10:20020;--ai-toolbar-icon-color:#2095ae;--xsf-ai12z-zindex-0:19979;--xsf-ai12z-zindex-10:19989;--xsf-ai12z-fab-bottom:26px}.modal-overlay{position:absolute;height:100%;width:100%;z-index:var(--xsf-ai12z-zindex-0);background-color:#2e2e2e99}.layout{pointer-events:none;position:fixed;inset:0;height:100dvh;width:99dvw;justify-content:flex-end;grid-template-rows:auto 1fr auto;grid-template-areas:"left toolbar right" "left main right" "left footer right";padding-top:96px;transition-property:grid-template-columns, padding-top;z-index:19979}.layout.is-open .modal{pointer-events:auto}.layout.is-expanded ai12z-bot{pointer-events:auto}.layout.is-open.is-expanded .modal{border-top-left-radius:
|
|
1031
|
+
const ai12zChatbotCss = () => `:host{--wes-c-icon-color:#fff;--fab-bottom:26px;--xsf-ai12z-zindex-isexpanded-10:20020;--ai-toolbar-icon-color:#2095ae;--xsf-ai12z-zindex-0:19979;--xsf-ai12z-zindex-10:19989;--xsf-ai12z-fab-bottom:26px}.modal-overlay{position:absolute;height:100%;width:100%;z-index:var(--xsf-ai12z-zindex-0);background-color:#2e2e2e99}.layout{pointer-events:none;position:fixed;inset:0;height:100dvh;width:99dvw;justify-content:flex-end;grid-template-rows:auto 1fr auto;grid-template-areas:"left toolbar right" "left main right" "left footer right";padding-top:96px;transition-property:grid-template-columns, padding-top;z-index:19979}.layout.is-open .modal{pointer-events:auto}.layout.is-expanded ai12z-bot{pointer-events:auto}.layout.is-open.is-expanded .modal{border-top-left-radius:12px;border-top-right-radius:12px;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);z-index:var(--xsf-ai12z-zindex-isexpanded-10)}.layout.is-open .user-input-fieldset{background-image:none;padding:0px;background:none}.layout.is-expanded .user-input-fieldset{border-top-left-radius:12px;border-top-right-radius:12px}.layout.is-open .grow-wrap>.textarea,.layout.is-open .grow-wrap>button,.layout.is-open .grow-wrap:after{border-color:var(--ai12zBot-v2-searchbar-open-border-color);}.layout.is-expanded .grow-wrap:after{display:none}.layout.is-open.is-expanded .user-input{z-index:var(--xsf-ai12z-zindex-isexpanded-10)}.layout.is-open .user-input{z-index:var(--xsf-ai12z-zindex-10)}.text-body2{font-size:16px;line-height:1.5;letter-spacing:-0.12px;font-weight:400}.modal-toolbar-icon{color:var(--ai12zBot-v2-toolbar-icon-color, inherit);width:16px;height:16px}.search-flex{flex:1 1 0%}.show-grid{display:grid}.hide-title{padding:0px;opacity:0;height:0px}.user-msg{background-color:var(--ai12zBot-v2-user-bubble-background);color:var(--ai12zBot-v2-user-bubble-font-color)}.text-body4{font-size:var(--ai12zBot-v2-timestamp-font-size);line-height:1.5;letter-spacing:0.03px;font-weight:400;color:var(--ai12zBot-v2-timestamp-font-color)}.isContent{background:var(--ai12zBot-v2-content-background);padding:10px}.default-botAvatar{color:var(--ai12zBot-v2-default-avatar-color)}.searchform{opacity:1;transform:none}.user-input{margin-left:auto;margin-right:auto;width:100%;max-width:840px;min-width:340px;grid-area:footer}.main{margin-left:auto;margin-right:auto;width:100%;max-width:840px;min-width:340px;margin-top:7px}.heading{color:var(--ai12zBot-v2-title-color)}.dropdown-item-button{display:flex;width:100%;cursor:pointer;align-items:center;-moz-column-gap:8px;column-gap:8px;border-radius:4px;--tw-border-opacity:1;--tw-bg-opacity:1;background-color:var(--ai12zBot-v2-dropdown-bgcolor);padding:8px 24px;font-weight:500;--tw-text-opacity:1;color:var(--ai12zBot-v2-dropdown-font-color);transition-property:color, background-color, border-color, text-decoration-color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:75ms}.helptext{padding:0px;opacity:0;height:0px}.minimize-input{transform:translateY(calc(-100% - 4px))}.ai-text-caption{font-size:12px;line-height:1.5;letter-spacing:0.2px;font-weight:400}.fab>button{background:var(--ai12zBot-v2-fab-button-background);}.user-input-fieldset{background:var(--ai12zBot-v2-searchbar-background)}.return-text-color{color:rgb(255, 255, 255)}.ai-minimize-icon svg{fill:currentColor;height:1em;width:1em}.hide-form{opacity:0;transform:none}.show-form{opacity:1;transform:none}.ai-minimize-icon{color:var(--wes-c-icon-color, inherit)}.fab{bottom:var(--fab-bottom, 30px)}.text-body1{font-size:var(--ai12zBot-v2-title-font-size);line-height:1.5;letter-spacing:-0.12px;font-weight:400}#message-submit{margin-right:6px;margin-bottom:7px;background-color:var(--ai12zBot-v2-searchbar-submit-bgcolor)}.ai-icon{color:var(--ai12zBot-v2-searchbar-submit-color);font-size:24px;width:24px;height:24px}.plus-icon{color:var(--ai12zBot-v2-searchbar-plus-icon-color);font-size:24px;width:24px;height:24px}.grow-wrap>.textarea,.grow-wrap:after{min-height:48px;align-content:center;border-radius:24px;border-width:1px;border-style:solid;border:1px solid var(--ai12zBot-v2-searchbar-border-color);--tw-bg-opacity:1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1));padding:8px 48px;text-indent:2px;font-size:16px;line-height:1.5;letter-spacing:-0.12px;font-weight:400;--tw-text-opacity:1;color:rgb(46 46 46 / var(--tw-text-opacity, 1));--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);--tw-ring-inset:inset;--tw-ring-offset-width:0px;transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:0.15s}.grow-wrap>.textarea,.grow-wrap:after{grid-area:1 / 1 / 2 / 2}.modal{position:relative;grid-column:span 1 / span 1;grid-column-start:2;grid-row:span 3 / span 3;grid-row-start:1;display:grid;border-top-left-radius:0;border-top-right-radius:0;background-position:center;box-shadow:0 16px 32px -4px #18181829, 0 12px 24px -4px #18181814;background-image:var(--ai12zBot-v2-modal-backgroundImage);background-repeat:no-repeat;background-size:100vw 100vh;grid-template-columns:subgrid;grid-template-rows:subgrid;z-index:var(--xsf-ai12z-zindex-10);transition:0.3sease-out;transition-property:grid-template-columns}.dropdown-menu{pointer-events:none;opacity:0;z-index:10;background-color:var(--ai12zBot-v2-dropdown-bgcolor);transform:translateY(-10px);transition:opacity 0.3s ease, transform 0.3s ease}.dropdown-menu.show{pointer-events:auto;opacity:1;pointer-events:auto;transform:translateY(0);background-color:var(--ai12zBot-v2-dropdown-bgcolor)}.copy-btn{color:var(--ai12zBot-v2-copy-btn-color)}.thumbs-up{fill:var(--ai12zBot-v2-feedback-selected);width:24px}.thumbs-down{fill:var( --ai12zBot-v2-feedback-selected);width:24px}.chat-thumbs-up{color:var(--ai12zBot-v2-feedback-color)}.thumbs-container{justify-content:flex-start;align-items:center}.back-btn svg{fill:var(--ai12zBot-v2-back-button-color)}.dropdown-item{background-color:var(--ai12zBot-v2-dropdown-bgcolor)}button:focus-visible{outline:2px solid var(--ai12zBot-v2-focus-visible-color, #0A2A43);outline-offset:2px}button.bot-btn-primary:focus-visible{outline:2px solid var(--ai12zBot-v2-focus-visible-color-primary, var(--ai12zBot-v2-focus-visible-color, #0A2A43));outline-offset:2px}button.bot-btn-secondary:focus-visible{outline:2px solid var(--ai12zBot-v2-focus-visible-color-secondary, var(--ai12zBot-v2-focus-visible-color, #0A2A43))}.bot-name{color:var(--ai12zBot-v2-fab-name-color, var(--ai12zBot-v2-bot-name-color));font-weight:var(--ai12zBot-v2-fab-font-weight, var(--ai12zBot-v2-bot-name-font-weight))}.ai12z-link{color:var(--ai12zBot-v2-link-color);text-decoration:underline}.ai12z-link:hover{color:var(--ai12zBot-v2-link-hover-color);text-decoration:underline}.toolbar{height:52px;border:#fff;grid-area:toolbar}.skip-link{position:absolute;left:-999px;top:auto;width:1px;height:1px;overflow:hidden}.skip-link:focus{left:10px;top:10px;width:auto;height:auto;z-index:1000}.enter-tip{font-size:12px;color:#666;margin-left:10px}.skip-links.hidden{position:absolute;left:-9999px;}.skip-links.visible{left:auto;position:static;}.error-message-container{margin-top:4px}.error-msg{color:#dc2626;font-size:12px;display:block;animation:slideIn 0.2s ease-out}.ai12z-form-honeypot{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}@keyframes slideIn{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@media (min-width: 1024px){.modal{background-size:80vw 100vh}}@media (min-width: 1024px){.layout.is-expanded{grid-template-columns:1fr minmax(340px, 80dvw) 1fr !important}}@media (min-width: 768px){.layout.is-expanded{-moz-column-gap:48px;column-gap:48px}}@media (max-width: 767px){.layout.is-open{padding-top:0px !important;grid-template-columns:0fr minmax(340px, 1fr) 0fr !important}}@media (max-width: 767px){.fab{right:30px;bottom:var(--xsf-ai12z-fab-bottom, 26px)}}`;
|
|
1013
1032
|
|
|
1014
1033
|
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
1015
1034
|
var t = {};
|
|
@@ -1036,7 +1055,10 @@ const Ai12zBot = class {
|
|
|
1036
1055
|
this.isElementAvailable = index.createEvent(this, "isElementAvailable", 7);
|
|
1037
1056
|
this.cdnPath = "https://cdn.ai12z.net/assets/bot";
|
|
1038
1057
|
this.surveyCDNPath = "https://cdn.ai12z.net/pkg/surveyjs";
|
|
1039
|
-
this.styles = [
|
|
1058
|
+
this.styles = [
|
|
1059
|
+
`https://cdn.jsdelivr.net/npm/@highlightjs/cdn-assets@11.11.1/styles/default.min.css`,
|
|
1060
|
+
`https://cdn.ai12z.net/assets/bot/${index.Env.CDN_PATH}/tailwind.min.css`
|
|
1061
|
+
];
|
|
1040
1062
|
this.liveAgentEventHandler = new LiveAgentEventHandler();
|
|
1041
1063
|
this.customStyle = "";
|
|
1042
1064
|
this.customJS = "";
|
|
@@ -3037,7 +3059,7 @@ const Ai12zBot = class {
|
|
|
3037
3059
|
this.errorMessage = errorMsg.detail;
|
|
3038
3060
|
this.showErrorMessage = true;
|
|
3039
3061
|
this.announce(errorMsg.detail || "Image upload failed");
|
|
3040
|
-
}, ref: el => (this.imageUploaderRef = el) })))))), index.h("div", { class: `textarea` }, this.imagesBase64List.length > 0 && (index.h("div", { class: "flex flex-wrap gap-2 mx-1 mt-2.5 mb-1" }, this.imagesBase64List.map((img, idx) => (index.h("div", { class: "image-Container sc-ai12z-input-form", key: idx }, index.h("img", { src: img, style: { width: "70px", height: "50px", borderRadius: "
|
|
3062
|
+
}, ref: el => (this.imageUploaderRef = el) })))))), index.h("div", { class: `textarea` }, this.imagesBase64List.length > 0 && (index.h("div", { class: "flex flex-wrap gap-2 mx-1 mt-2.5 mb-1" }, this.imagesBase64List.map((img, idx) => (index.h("div", { class: "image-Container sc-ai12z-input-form", key: idx }, index.h("img", { src: img, style: { width: "70px", height: "50px", borderRadius: "12px" }, alt: "uploaded image" }), index.h("span", { class: "delete-image sc-ai12z-input-form cursor-pointer ml-1", onClick: () => {
|
|
3041
3063
|
this.imagesBase64List = this.imagesBase64List.filter((_, i) => i !== idx);
|
|
3042
3064
|
// console.log("upload imageuloaderred", this.imageUploaderRef)
|
|
3043
3065
|
if (this.imageUploaderRef && typeof this.imageUploaderRef.removeImageAtIndex === "function") {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var SearchResult = require('./SearchResult-
|
|
5
|
-
var utils = require('./utils-
|
|
3
|
+
var index = require('./index-v8T1EJAJ.js');
|
|
4
|
+
var SearchResult = require('./SearchResult-CvTJr55G.js');
|
|
5
|
+
var utils = require('./utils-7C5_GnyF.js');
|
|
6
6
|
var _commonjsHelpers = require('./_commonjsHelpers-MBWFX2dn.js');
|
|
7
|
-
var appStore = require('./app-store-
|
|
8
|
-
var parseHelper = require('./parseHelper-
|
|
9
|
-
require('./ctaHelpers-
|
|
10
|
-
require('./logger-
|
|
7
|
+
var appStore = require('./app-store-BtkiHvcw.js');
|
|
8
|
+
var parseHelper = require('./parseHelper-5fRVefLm.js');
|
|
9
|
+
require('./ctaHelpers-DUPj5SnE.js');
|
|
10
|
+
require('./logger-2ZBZCKdM.js');
|
|
11
11
|
|
|
12
12
|
const categoryCss = () => `ai12z-category{font-family:var(--ai12z-font-family) !important;font-size:var(--ai12z-search-font-size, var(--ai12z-font-size)) !important}.custom-title{font-size:var(--ai12z-category-font-size);color:var(--ai12z-category-font-color)}`;
|
|
13
13
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-v8T1EJAJ.js');
|
|
4
4
|
var botHelpers = require('./botHelpers-D5Dj7TRA.js');
|
|
5
|
-
var styleSheetRegistry = require('./styleSheetRegistry-
|
|
6
|
-
require('./utils-
|
|
5
|
+
var styleSheetRegistry = require('./styleSheetRegistry-CaWjqgX7.js');
|
|
6
|
+
require('./utils-7C5_GnyF.js');
|
|
7
7
|
|
|
8
8
|
const ai12zChatMessageCss = () => `.show-more-btn{background:none;color:var(--ai12z-knowledge-box-show-more-color, #4a8aff);font-size:16px;cursor:pointer;font-weight:500;border-radius:6px;transition:color 0.2s ease, background 0.2s ease;border:1px solid var(--ai12z-knowledge-box-show-more-border, blue);padding:10px;border-radius:20px;align-items:center;justify-content:center;margin:auto;display:block;z-index:20;position:relative;width:30%}.show-more-btn:hover{color:var(--ai12z-knowledge-box-show-more-hover-color, #1a73e8);background:rgba(74, 138, 255, 0.08)}.show-more-btn:active{background:rgba(74, 138, 255, 0.15)}.show-more-btn svg{vertical-align:middle;gap:5px;transition:transform 0.3s ease-in-out;display:inline-block;margin-left:10px;font-size:20}.message-text{line-height:1.55;font-size:15px;color:var(--ai12z-knowledge-box-text-color, #1e1e1e);transition:max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);overflow:hidden}.fade-overlay{position:absolute;bottom:0;left:0;right:0;height:100px;z-index:10;pointer-events:none;opacity:1;transition:opacity 0.3s ease-in-out;background:linear-gradient( to bottom, rgba(255, 255, 255, 0) 0%, var(--ai12z-knowledge-box-bg-color, #ffffff) 85% )}.chat-message{position:relative;}.custom-line-clamp{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:var(--line-clamp);line-clamp:var(--line-clamp)}.ai12z-form-honeypot{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}.ai12zBtn{background-color:var(--ai12z-knowledge-box-primary-color);color:white;padding:5px 10px;border:none;border-radius:5px;cursor:pointer;text-decoration:none;margin:5px}`;
|
|
9
9
|
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var processCarouselData = require('./processCarouselData-
|
|
5
|
-
var parseHelper = require('./parseHelper-
|
|
6
|
-
var utils = require('./utils-
|
|
7
|
-
var ctaHelpers = require('./ctaHelpers-
|
|
8
|
-
var index$1 = require('./index-
|
|
9
|
-
var socketService = require('./socket-service-
|
|
10
|
-
var surveyHelpers = require('./surveyHelpers-
|
|
11
|
-
var keyboardShortcuts = require('./keyboard-shortcuts-
|
|
3
|
+
var index = require('./index-v8T1EJAJ.js');
|
|
4
|
+
var processCarouselData = require('./processCarouselData-kCVPE4mw.js');
|
|
5
|
+
var parseHelper = require('./parseHelper-5fRVefLm.js');
|
|
6
|
+
var utils = require('./utils-7C5_GnyF.js');
|
|
7
|
+
var ctaHelpers = require('./ctaHelpers-DUPj5SnE.js');
|
|
8
|
+
var index$1 = require('./index-CKLC7f4y.js');
|
|
9
|
+
var socketService = require('./socket-service-5mM7NSYN.js');
|
|
10
|
+
var surveyHelpers = require('./surveyHelpers-DohugkWP.js');
|
|
11
|
+
var keyboardShortcuts = require('./keyboard-shortcuts-BWprLtLj.js');
|
|
12
12
|
var analyticsService = require('./analyticsService-CkAva47S.js');
|
|
13
13
|
var botHelpers = require('./botHelpers-D5Dj7TRA.js');
|
|
14
14
|
require('./_commonjsHelpers-MBWFX2dn.js');
|
|
15
|
-
require('./logger-
|
|
15
|
+
require('./logger-2ZBZCKdM.js');
|
|
16
16
|
require('./response-adapter-CKKyyhMj.js');
|
|
17
17
|
|
|
18
|
-
const ai12zChatCss = () => `:host{font-family:var(--ai12z-font-family) !important;font-size:var(--ai12z-font-size) !important;color:var(--ai12z-font-color, black);text-align:var(--ai12z-text-align, left)}.not-allowed{cursor:not-allowed}.prose.custom-prose{--tw-prose-body:var(--ai12z-bubble-font-color);--tw-prose-bold:var(--ai12z-bubble-font-color);--tw-prose-links:var(--ai12z-link-color);--tw-prose-headings:var(--ai12z-bubble-font-color)}.ai12z-cta-link{color:var(--ai12z-link-color);text-decoration:underline}.ai12z-cta-link:hover{color:var(--ai12z-link-hover-color)}@media (max-width: 768px){.chat-align-list{padding:
|
|
18
|
+
const ai12zChatCss = () => `:host{font-family:var(--ai12z-font-family) !important;font-size:var(--ai12z-font-size) !important;color:var(--ai12z-font-color, black);text-align:var(--ai12z-text-align, left)}.not-allowed{cursor:not-allowed}.prose.custom-prose{--tw-prose-body:var(--ai12z-bubble-font-color);--tw-prose-bold:var(--ai12z-bubble-font-color);--tw-prose-links:var(--ai12z-link-color);--tw-prose-headings:var(--ai12z-bubble-font-color)}.ai12z-cta-link{color:var(--ai12z-link-color);text-decoration:underline}.ai12z-cta-link:hover{color:var(--ai12z-link-hover-color)}@media (max-width: 768px){.chat-align-list{padding:16px 16px 16px 0px !important}.chat-not-user-list{padding-inline-start:40px !important}}.thumbs-up{fill:var(--ai12z-feedback-selected);width:24px}.thumbs-down{fill:var(--ai12z-feedback-selected);width:24px}.chat-thumbs-up{color:var(--ai12z-feedback-color)}.default-avatar{color:var(--ai12z-default-avatar-color, var(--ai12z-primary-color))}.chat-list{margin-top:20px;overflow-y:auto;display:flex;flex-direction:column}.custom-chat-top-height{max-height:100vh}@media (max-width: 768px){.custom-chat-bottom-height{max-height:700px}.default-avatar{display:none !important}}.custom-chat-bottom-height{max-height:100%}.custom-chat-above-height{max-height:80vh;margin-bottom:20px}.custom-list{overflow-y:auto}.chat-list-item{padding:32px 8px 0 4px;display:flex;position:relative;color:var(--ai12z-bubble-font-color);font-size:var(--ai12z-bubble-font-size)}.chat-align-list{justify-content:flex-start;padding-inline-end:40px}.chat-not-user-list{justify-content:flex-end;padding-inline-start:80px}.chat-inner-list{display:flex;align-items:flex-end;padding-right:8px}.pending-chat{display:flex;justify-content:center;align-items:center;border-width:1px;padding:20px;line-height:28px;border-radius:8px}.non-pending-user{line-height:28px;border-radius:8px}.chat-not-user-list #parent-element .non-pending-user{background-color:var(--ai12z-user-bubble-background, var(--ai12z-bubble-background))}.chat-align-list #parent-element .non-pending-user{background-color:var(--ai12z-ai-bubble-background, var(--ai12z-bubble-background));border:var(--ai12z-ai-bubble-border)}#parent-element{position:relative}.non-user-container{position:absolute;right:0;top:0;width:176px}.thumbnail{margin-bottom:30px;width:70%}.ai12z_image_result{max-width:500px;width:100%;border-radius:5%;padding:20px}.ai12z_image_caption{margin:20px;padding:1px;background-color:#f0f0f0;border-radius:5px;text-align:center}.resize{width:100%}.prose.prose-w-none *{all:unset;}.non-pending-user .ai12zBtn{background-color:var(--ai12z-primary-color);color:white;padding:5px 10px;border:none;border-radius:5px;cursor:pointer;text-decoration:none;margin:5px}.ai12zBtn:active{background-color:rgb(118 135 214)}::-webkit-scrollbar{width:12px;height:12px}::-webkit-scrollbar-track{background:#f1f1f1;border-radius:10px}::-webkit-scrollbar-thumb{background-color:#888;border-radius:10px;border:2px solid #f1f1f1}::-webkit-scrollbar-thumb:hover{background:#555}.copy-btn{color:var(--ai12z-feedback-color)}.list-btn{background-color:#007bff;color:white;padding:5px 10px;border:none;border-radius:5px;cursor:pointer;text-decoration:none;margin:5px;max-width:100%;}.pagination-controls{display:flex;justify-content:space-between;margin-top:20px}.pagination-controls button{padding:10px 20px;border:none;background-color:#007bff;color:white;cursor:pointer;border-radius:5px}.pagination-controls button:disabled{background-color:#ccc;cursor:not-allowed}.pagination-controls span{align-self:center;font-size:1.1em}.hidden{display:none}.carousel-container{position:relative;display:flex;overflow:hidden;margin:0 auto;width:100%;max-width:100%}.carousel-items{display:flex;transition:transform 0.3s ease-in-out;width:100%}.carousel-card{flex-shrink:0;width:100%}.card img{width:100%;height:auto}.card-body{margin:15px}.prev,.next{background:#007bff;border:none;color:white;padding:10px;cursor:pointer;border-radius:50%;position:absolute;top:50%;transform:translateY(-50%);z-index:10}.prev{cursor:pointer;left:0px}.next{cursor:pointer;right:0px}.carousel-indicators{display:flex;justify-content:center;margin-top:10px;bottom:4px;left:50%}.indicator{width:10px;height:10px;background-color:gray;border-radius:50%;margin:0 5px;cursor:pointer}button:focus-visible{outline:2px solid var(--ai12z-focus-visible-color, #0A2A43);outline-offset:2px}button.chat-btn-primary:focus-visible{outline:2px solid var(--ai12z-focus-visible-color-primary, --ai12z-focus-visible-color);outline-offset:2px}button.chat-btn-secondary:focus-visible{outline:2px solid var(--ai12z-focus-visible-color-secondary, --ai12z-focus-visible-color)}.ai12z-form-honeypot{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}`;
|
|
19
19
|
|
|
20
20
|
const MyChat = class {
|
|
21
21
|
constructor(hostRef) {
|
|
@@ -45,10 +45,7 @@ const MyChat = class {
|
|
|
45
45
|
this.focusedIndex = -1;
|
|
46
46
|
this.chatItemRefs = [];
|
|
47
47
|
this.styles = [
|
|
48
|
-
`https://cdn.ai12z.net/assets/bot/
|
|
49
|
-
// `${this.cdnPath}/v1/survey.min.css`,
|
|
50
|
-
// `https://unpkg.com/survey-core/defaultV2.min.css`,
|
|
51
|
-
// `${this.cdnPath}/v1/survey-core.min.css`,
|
|
48
|
+
`https://cdn.ai12z.net/assets/bot/${index.Env.CDN_PATH}/tailwind.min.css`,
|
|
52
49
|
`https://unpkg.com/@highlightjs/cdn-assets@11.11.1/styles/default.min.css`,
|
|
53
50
|
`https://cdn.ai12z.net/pkg/surveyjs/survey-core@2.3.4/survey-core.min.css`,
|
|
54
51
|
];
|
|
@@ -1141,7 +1138,7 @@ const MyChat = class {
|
|
|
1141
1138
|
render() {
|
|
1142
1139
|
var _a;
|
|
1143
1140
|
const email = "";
|
|
1144
|
-
return (index.h("div", { key: '
|
|
1141
|
+
return (index.h("div", { key: '32b9166470e94d75232ce06a80ab7cd190a69608' }, index.h("ul", { key: 'f27b1585ab1cc2ffe7de945e075b3803980965a9', id: "main-content", tabindex: "-1", class: {
|
|
1145
1142
|
"chat-list": true,
|
|
1146
1143
|
"custom-list": this.componentType === "search",
|
|
1147
1144
|
// "custom-chat-top-height": this.componentType === "search",
|
|
@@ -1208,7 +1205,7 @@ const MyChat = class {
|
|
|
1208
1205
|
projectId: this.getProjectId(),
|
|
1209
1206
|
questionText: analyticsService.getQuestionText(this.chats, chat.insightId) || "",
|
|
1210
1207
|
}), class: "chat-thumbs-up", "aria-label": "Thumbs Down", tabindex: "0" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor", class: "w-6 h-6" }, index.h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M7.498 15.25H4.372c-1.026 0-1.945-.694-2.054-1.715a12.137 12.137 0 0 1-.068-1.285c0-2.848.992-5.464 2.649-7.521C5.287 4.247 5.886 4 6.504 4h4.016a4.5 4.5 0 0 1 1.423.23l3.114 1.04a4.5 4.5 0 0 0 1.423.23h1.294M7.498 15.25c.618 0 .991.724.725 1.282A7.471 7.471 0 0 0 7.5 19.75 2.25 2.25 0 0 0 9.75 22a.75.75 0 0 0 .75-.75v-.633c0-.573.11-1.14.322-1.672.304-.76.93-1.33 1.653-1.715a9.04 9.04 0 0 0 2.86-2.4c.498-.634 1.226-1.08 2.032-1.08h.384m-10.253 1.5H9.7m8.075-9.75c.01.05.027.1.05.148.593 1.2.925 2.55.925 3.977 0 1.487-.36 2.89-.999 4.125m.023-8.25c-.076-.365.183-.75.575-.75h.908c.889 0 1.713.518 1.972 1.368.339 1.11.521 2.287.521 3.507 0 1.553-.295 3.036-.831 4.398-.306.774-1.086 1.227-1.918 1.227h-1.053c-.472 0-.745-.556-.5-.96a8.95 8.95 0 0 0 .303-.54" }))), index.h("button", { class: "copy-btn", tabindex: "0", "aria-label": "Send Email" }, index.h("a", { href: `mailto:${email}?subject=${encodeURIComponent((_e = this.chats[idx - 1]) === null || _e === void 0 ? void 0 : _e.message)}&body=${encodeURIComponent(this.removeHtmlTags(chat.clipboard))}`, target: "_blank", "aria-label": "Send Email" }, index.h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", stroke: "currentColor", "stroke-width": "0.3", class: "w-6 h-6" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M3.75 5.25L3 6V18L3.75 18.75H20.25L21 18V6L20.25 5.25H3.75ZM4.5 7.6955V17.25H19.5V7.69525L11.9999 14.5136L4.5 7.6955ZM18.3099 6.75H5.68986L11.9999 12.4864L18.3099 6.75Z", fill: "currentColor" }), " "))))))));
|
|
1211
|
-
}), index.h("div", { key: '
|
|
1208
|
+
}), index.h("div", { key: 'c13d17836d81d6c0a1df953bf819c71b0d03575c', class: "scroll-bottom" }))));
|
|
1212
1209
|
}
|
|
1213
1210
|
get element() { return index.getElement(this); }
|
|
1214
1211
|
static get watchers() { return {
|
|
@@ -1219,13 +1216,15 @@ const MyChat = class {
|
|
|
1219
1216
|
};
|
|
1220
1217
|
MyChat.style = ai12zChatCss();
|
|
1221
1218
|
|
|
1222
|
-
const inputCss = () => `:host{font-family:var(--ai12z-font-family) !important;font-size:var(--ai12z-font-size) !important}.input-form{display:flex;flex-direction:column;width:100%;margin-bottom:
|
|
1219
|
+
const inputCss = () => `:host{font-family:var(--ai12z-font-family) !important;font-size:var(--ai12z-font-size) !important}.input-form{display:flex;flex-direction:column;width:100%;margin-bottom:16px}.input-container{margin-right:16px;position:relative;border-radius:64px;border-width:1px;align-items:stretch;display:flex;}.inner-container{flex-grow:1;padding:12px}.custom-input{color:black;border-width:0;max-height:300px;resize:none;overflow:hidden;background-color:inherit}.custom-input::-moz-placeholder{color:var(--ai12z-input-placeholder-color);opacity:1;font-size:var(--ai12z-input-placeholder-font-size)}.custom-input::placeholder{color:var(--ai12z-input-placeholder-color);opacity:1;font-size:var(--ai12z-input-placeholder-font-size)}.custom-input:focus{outline:none;box-shadow:var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--ai12z-border-color)}.input-focus-color{border-color:rgb(59 130 246) !important}.plus-icon{color:var(--ai12z-plus-icon-color)}.ai12z-plus-anchor{position:relative;display:inline-block}.ai12z-plus-menu{position:absolute;top:100%;left:0;margin-top:0.5rem;width:var(--ai12z-menu-width, 15rem);z-index:30;padding:0.375rem;background-color:var(--ai12z-menu-bg, #fff);border:1px solid var(--ai12z-menu-border-color, rgba(17, 24, 39, 0.08));border-radius:var(--ai12z-menu-radius, 0.875rem);box-shadow:var( --ai12z-menu-shadow, 0 12px 28px -12px rgba(17, 24, 39, 0.28), 0 4px 10px -6px rgba(17, 24, 39, 0.15) );transform-origin:top left;transition:opacity 0.16s ease, transform 0.16s ease}.ai12z-plus-menu[data-open="false"]{opacity:0;transform:scale(0.95);pointer-events:none}.ai12z-plus-menu[data-open="true"]{opacity:1;transform:scale(1);pointer-events:auto}.ai12z-menu-list{display:flex;flex-direction:column;gap:0.125rem;margin:0;padding:0;list-style:none}.ai12z-menu-item,.ai12z-menu-item--uploader .image-uploader>button{display:flex;align-items:center;gap:0.625rem;width:100%;padding:0.5rem 0.625rem;border:0;background:transparent;border-radius:0.5rem;font-family:inherit;font-size:var(--ai12z-menu-item-font-size, 0.875rem);line-height:1.25rem;color:var(--ai12z-menu-item-color, #374151);text-align:left;cursor:pointer;transition:background-color 0.15s ease, color 0.15s ease}.ai12z-menu-item:hover:not([disabled]):not([aria-disabled="true"]),.ai12z-menu-item:focus-visible,.ai12z-menu-item--uploader .image-uploader>button:hover:not([disabled]){background-color:var(--ai12z-menu-item-hover-bg, #f3f4f6)}.ai12z-menu-item:focus-visible,.ai12z-menu-item--uploader .image-uploader>button:focus-visible{outline:2px solid transparent;box-shadow:0 0 0 2px var(--ai12z-menu-focus-ring, rgba(59, 130, 246, 0.55))}.ai12z-menu-item[disabled],.ai12z-menu-item[aria-disabled="true"]{opacity:0.45;cursor:not-allowed}.ai12z-menu-item__icon,.ai12z-menu-item--uploader .image-uploader>button svg{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:1.25rem;height:1.25rem;color:var(--ai12z-menu-icon-color, #6b7280)}.ai12z-menu-item__label{flex:1 1 auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.ai12z-menu-item--uploader{padding:0}.ai12z-menu-item--uploader .image-uploader,.ai12z-menu-item--uploader .image-uploader>button{width:100%}@media (prefers-color-scheme: dark){.ai12z-plus-menu{--ai12z-menu-bg:#1f2937;--ai12z-menu-border-color:rgba(255, 255, 255, 0.08);--ai12z-menu-shadow:0 14px 34px -12px rgba(0, 0, 0, 0.65), 0 4px 12px -6px rgba(0, 0, 0, 0.5);--ai12z-menu-item-color:#e5e7eb;--ai12z-menu-item-hover-bg:rgba(55, 65, 81, 0.7);--ai12z-menu-icon-color:#9ca3af}}.ai-button{border-left-width:1px;padding-left:16px;padding-right:16px;white-space:nowrap;display:inline-flex;place-items:center;color:var(--ai12z-button-font-color);font-size:var(--ai12z-button-font-size);}.ai-button:hover{background-color:var(--ai12z-primary-color);color:rgb(255 255 255)}.custom-svg-checkbox{margin-top:4px;width:16px;height:16px;position:absolute}.hide-svg{display:none}.icon-width{width:28px}.custom-attachment{border-right-width:1px;padding-top:10px;padding-left:16px;padding-right:32px;cursor:pointer;width:5%}#fileInput{display:none}.error-msg{color:red;font-size:12px;margin-top:4px;text-align:center}.image-Container{position:relative;display:inline-block;margin-right:10px}.delete-image{opacity:3;position:absolute;right:3px;top:0;cursor:pointer;line-height:10px}.btn-bg-color{background-color:var(--ai12z-button-bgcolor)}.searchbar-bgcolor{background-color:var(--ai12z-searchbar-bgcolor)}.inline-searchbar-bgcolor{border-color:var(--ai12z-inlinesearchbar-border-color);background-color:var(--ai12z-inlinesearchbar-bgcolor);border-width:1px}.enter-tip{font-size:12px;color:#666;margin-left:10px}#message-error{margin-left:10px}`;
|
|
1223
1220
|
|
|
1224
1221
|
const InputForm = class {
|
|
1225
1222
|
constructor(hostRef) {
|
|
1226
1223
|
index.registerInstance(this, hostRef);
|
|
1227
1224
|
this.action = index.createEvent(this, "action", 7);
|
|
1228
1225
|
this.capturedImgUpload = index.createEvent(this, "capturedImgUpload", 7);
|
|
1226
|
+
this.pendingMenuFocus = null;
|
|
1227
|
+
this.hasAutoFocused = false;
|
|
1229
1228
|
// private customWidth = "100%"
|
|
1230
1229
|
// private icon_width: string
|
|
1231
1230
|
// private icon_height: string
|
|
@@ -1260,10 +1259,17 @@ const InputForm = class {
|
|
|
1260
1259
|
}
|
|
1261
1260
|
};
|
|
1262
1261
|
this.handleClickOutside = (event) => {
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1262
|
+
if (!this.isOpen)
|
|
1263
|
+
return;
|
|
1264
|
+
// Use composedPath() rather than event.target: inside the shadow-DOM host
|
|
1265
|
+
// (ai12z-cta / ai12z-inline-search) the target is retargeted to the host, so
|
|
1266
|
+
// a click on a menu row would look "outside" the menu and dismiss it mid-
|
|
1267
|
+
// interaction. The path contains the real elements crossing shadow roots.
|
|
1268
|
+
const path = event.composedPath();
|
|
1269
|
+
if ((this.menuElem && path.includes(this.menuElem)) || (this.plusButtonElem && path.includes(this.plusButtonElem))) {
|
|
1270
|
+
return;
|
|
1266
1271
|
}
|
|
1272
|
+
this.closeMenu(false);
|
|
1267
1273
|
};
|
|
1268
1274
|
this.handleFormSubmit = (e) => {
|
|
1269
1275
|
e.preventDefault();
|
|
@@ -1329,9 +1335,60 @@ const InputForm = class {
|
|
|
1329
1335
|
this.errorMessage = event.detail;
|
|
1330
1336
|
this.showErrorMessage = true;
|
|
1331
1337
|
};
|
|
1332
|
-
this.toggleBox = e => {
|
|
1333
|
-
e.stopPropagation();
|
|
1334
|
-
|
|
1338
|
+
this.toggleBox = (e) => {
|
|
1339
|
+
e === null || e === void 0 ? void 0 : e.stopPropagation();
|
|
1340
|
+
if (this.isOpen)
|
|
1341
|
+
this.closeMenu(false);
|
|
1342
|
+
else
|
|
1343
|
+
this.openMenu("first");
|
|
1344
|
+
};
|
|
1345
|
+
// Keyboard support for the "+" options menu (WAI-ARIA menu button pattern).
|
|
1346
|
+
this.handleTriggerKeyDown = (e) => {
|
|
1347
|
+
// Enter/Space open via the button's native click -> toggleBox; only the
|
|
1348
|
+
// arrow keys need handling here (and open with focus in the menu).
|
|
1349
|
+
if (e.key === "ArrowDown") {
|
|
1350
|
+
e.preventDefault();
|
|
1351
|
+
this.openMenu("first");
|
|
1352
|
+
}
|
|
1353
|
+
else if (e.key === "ArrowUp") {
|
|
1354
|
+
e.preventDefault();
|
|
1355
|
+
this.openMenu("last");
|
|
1356
|
+
}
|
|
1357
|
+
};
|
|
1358
|
+
this.handleMenuKeyDown = (e) => {
|
|
1359
|
+
const items = this.getMenuItems();
|
|
1360
|
+
if (!items.length)
|
|
1361
|
+
return;
|
|
1362
|
+
const current = items.indexOf(this.deepActiveElement());
|
|
1363
|
+
switch (e.key) {
|
|
1364
|
+
case "ArrowDown":
|
|
1365
|
+
e.preventDefault();
|
|
1366
|
+
items[current < 0 ? 0 : (current + 1) % items.length].focus();
|
|
1367
|
+
break;
|
|
1368
|
+
case "ArrowUp":
|
|
1369
|
+
e.preventDefault();
|
|
1370
|
+
items[current < 0 ? items.length - 1 : (current - 1 + items.length) % items.length].focus();
|
|
1371
|
+
break;
|
|
1372
|
+
case "Home":
|
|
1373
|
+
e.preventDefault();
|
|
1374
|
+
items[0].focus();
|
|
1375
|
+
break;
|
|
1376
|
+
case "End":
|
|
1377
|
+
e.preventDefault();
|
|
1378
|
+
items[items.length - 1].focus();
|
|
1379
|
+
break;
|
|
1380
|
+
case "Escape":
|
|
1381
|
+
// Close and hand focus back to the + button. Stop propagation so a host
|
|
1382
|
+
// modal listening for Escape doesn't also close.
|
|
1383
|
+
e.preventDefault();
|
|
1384
|
+
e.stopPropagation();
|
|
1385
|
+
this.closeMenu(true);
|
|
1386
|
+
break;
|
|
1387
|
+
case "Tab":
|
|
1388
|
+
// Menus close on Tab; let focus continue to the next control naturally.
|
|
1389
|
+
this.closeMenu(false);
|
|
1390
|
+
break;
|
|
1391
|
+
}
|
|
1335
1392
|
};
|
|
1336
1393
|
// Replace your existing handlePaste method with this enhanced version
|
|
1337
1394
|
this.handlePaste = (event) => {
|
|
@@ -1366,10 +1423,9 @@ const InputForm = class {
|
|
|
1366
1423
|
// Image upload logic moved to ImageUploader component
|
|
1367
1424
|
}
|
|
1368
1425
|
componentDidLoad() {
|
|
1369
|
-
//
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
// const preivewContainer = this.el.querySelector(".custom-input")
|
|
1426
|
+
// Register unconditionally: the options menu renders regardless of
|
|
1427
|
+
// isImageUpload, so click-outside dismiss must work for every deployment
|
|
1428
|
+
// (not only image-upload ones).
|
|
1373
1429
|
document.addEventListener("click", this.handleClickOutside);
|
|
1374
1430
|
}
|
|
1375
1431
|
stateChangedHandler(_state) {
|
|
@@ -1403,6 +1459,63 @@ const InputForm = class {
|
|
|
1403
1459
|
this.announceMessage = "";
|
|
1404
1460
|
}, 1000);
|
|
1405
1461
|
}
|
|
1462
|
+
openMenu(focusTarget = "first") {
|
|
1463
|
+
this.pendingMenuFocus = focusTarget;
|
|
1464
|
+
this.isOpen = true;
|
|
1465
|
+
}
|
|
1466
|
+
closeMenu(returnFocus = true) {
|
|
1467
|
+
var _a;
|
|
1468
|
+
this.pendingMenuFocus = null;
|
|
1469
|
+
this.isOpen = false;
|
|
1470
|
+
// Focus the trigger synchronously. Safe now that the textarea autofocuses
|
|
1471
|
+
// once (see its ref) instead of on every render, so it no longer steals it.
|
|
1472
|
+
if (returnFocus)
|
|
1473
|
+
(_a = this.plusButtonElem) === null || _a === void 0 ? void 0 : _a.focus();
|
|
1474
|
+
}
|
|
1475
|
+
/** Actionable rows in the menu, in DOM order, excluding disabled ones. */
|
|
1476
|
+
getMenuItems() {
|
|
1477
|
+
if (!this.menuElem)
|
|
1478
|
+
return [];
|
|
1479
|
+
// Keep aria-disabled items in the sequence (APG: disabled menuitems stay
|
|
1480
|
+
// focusable); only native-disabled elements are skipped.
|
|
1481
|
+
return Array.from(this.menuElem.querySelectorAll('[role="menuitem"]')).filter(el => !el.hasAttribute("disabled"));
|
|
1482
|
+
}
|
|
1483
|
+
/**
|
|
1484
|
+
* The truly focused element. This widget is embedded in a shadow-DOM host
|
|
1485
|
+
* (ai12z-cta / ai12z-inline-search), so document.activeElement stops at the
|
|
1486
|
+
* shadow host — walk into shadow roots to reach the real focused menu item.
|
|
1487
|
+
*/
|
|
1488
|
+
deepActiveElement() {
|
|
1489
|
+
var _a;
|
|
1490
|
+
let el = document.activeElement;
|
|
1491
|
+
while ((_a = el === null || el === void 0 ? void 0 : el.shadowRoot) === null || _a === void 0 ? void 0 : _a.activeElement) {
|
|
1492
|
+
el = el.shadowRoot.activeElement;
|
|
1493
|
+
}
|
|
1494
|
+
return el;
|
|
1495
|
+
}
|
|
1496
|
+
componentDidRender() {
|
|
1497
|
+
if (!this.menuElem)
|
|
1498
|
+
return;
|
|
1499
|
+
// The image-uploader renders its own <button>; promote it into the menu
|
|
1500
|
+
// semantics so keyboard navigation treats it like the other rows.
|
|
1501
|
+
const upBtn = this.menuElem.querySelector(".ai12z-menu-item--uploader button");
|
|
1502
|
+
if (upBtn && upBtn.getAttribute("role") !== "menuitem") {
|
|
1503
|
+
upBtn.setAttribute("role", "menuitem");
|
|
1504
|
+
upBtn.setAttribute("tabindex", "-1");
|
|
1505
|
+
}
|
|
1506
|
+
// While closed, take the popover out of tab order and the a11y tree.
|
|
1507
|
+
if (this.isOpen)
|
|
1508
|
+
this.menuElem.removeAttribute("inert");
|
|
1509
|
+
else
|
|
1510
|
+
this.menuElem.setAttribute("inert", "");
|
|
1511
|
+
// Move focus into the menu right after it opens.
|
|
1512
|
+
if (this.isOpen && this.pendingMenuFocus) {
|
|
1513
|
+
const items = this.getMenuItems();
|
|
1514
|
+
const target = this.pendingMenuFocus === "last" ? items[items.length - 1] : items[0];
|
|
1515
|
+
this.pendingMenuFocus = null;
|
|
1516
|
+
target === null || target === void 0 ? void 0 : target.focus();
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1406
1519
|
async captureScreen() {
|
|
1407
1520
|
try {
|
|
1408
1521
|
const stream = await navigator.mediaDevices.getDisplayMedia({
|
|
@@ -1450,29 +1563,33 @@ const InputForm = class {
|
|
|
1450
1563
|
// this.icon_width = url.searchParams.get("w") || "28"
|
|
1451
1564
|
// this.icon_height = url.searchParams.get("h") || "28"
|
|
1452
1565
|
// }
|
|
1453
|
-
return (index.h("div", { key: '
|
|
1454
|
-
|
|
1455
|
-
this.captureScreen();
|
|
1566
|
+
return (index.h("div", { key: '7c42e9070f1c5d7cc138693c1ddcb587684a6c70' }, index.h("form", { key: 'dc2169e6d3f3a7c44eed880d29a69d3616c64280', class: "w-full flex flex-col gap-1.5 sticky", onSubmit: this.handleFormSubmit }, index.h("div", { key: 'b8ba078963ce77b650e2d3f1f8ccfbdd397ee8b7', class: `flex-1 flex flex-col relative w-full rounded-3xl px-1 ${this.componentType === "inline" ? "inline-searchbar-bgcolor" : "searchbar-bgcolor"}`, dir: "LTR", ref: el => (this.searchFormElem = el) }, index.h("div", { key: '79b20c40c94bc652ddd6f5f372fa97a2f3646d1a', class: "flex items-center" }, index.h("div", { key: '48f6dc8ead7b4297d18725d5fc13525eeebb4b08', class: "ml-1 self-center flex space-x-1" }, !this.hideAllButtons && (index.h("div", { key: '4f44318b1fe3b4a9a360d51721e1ebaf80f8817f', class: "ai12z-plus-anchor relative inline-block", style: { width: "5%" } }, index.h("button", { key: '226ab1dde47a5cd76cb515caad6653a626d9f4eb', class: "plus-icon", "aria-label": "Options", title: "Add images or capture screen", tabindex: "0", "aria-haspopup": "menu", "aria-expanded": this.isOpen ? "true" : "false", "aria-controls": `ai12z-options-menu-${this.instanceId}`, ref: el => (this.plusButtonElem = el), onKeyDown: this.handleTriggerKeyDown, onClick: e => {
|
|
1567
|
+
e.stopPropagation();
|
|
1456
1568
|
this.toggleBox(e);
|
|
1457
|
-
} }, index.h("
|
|
1569
|
+
} }, index.h("svg", { key: '58a5e1a2fa3419e101b0fb73065145af4fe2f283', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", width: "20", height: "20" }, index.h("path", { key: '84444d3d1f7436456d2d0004ee1f2ec6371fca08', d: "M10.75 4.75a.75.75 0 0 0-1.5 0v4.5h-4.5a.75.75 0 0 0 0 1.5h4.5v4.5a.75.75 0 0 0 1.5 0v-4.5h4.5a.75.75 0 0 0 0-1.5h-4.5v-4.5Z" }))), index.h("div", { key: '382ce6992a13ba4e9db4a854044863702dab4c7f', class: "ai12z-plus-menu", id: `ai12z-options-menu-${this.instanceId}`, "data-open": this.isOpen ? "true" : "false", role: "menu", "aria-orientation": "vertical", "aria-label": "Input options", onKeyDown: this.handleMenuKeyDown, ref: el => (this.menuElem = el) }, index.h("ul", { key: 'ca290a730cb52512440929d5115c80a8c2f8e403', class: "ai12z-menu-list" }, this.isImageUpload && (index.h("li", { key: 'fe7ba6eb4663da261cc50bbdb8fdaf9f78284548', role: "none", class: "ai12z-menu-item--uploader" }, index.h("image-uploader", { key: '8552b458871e39417131a20aac81df027560c992', maxImages: 10, images: this.imagesBase64List, targetElement: this.searchInputElem, onImagesChange: this.handleImageChange, onError: this.handleImageError, ref: el => (this.imageUploaderRef = el) }))), index.h("li", { key: '566f3aa616e36b58fd8bcb515222bc79811b1ad9', role: "none" }, index.h("button", { key: '66662889c49e4261caf3d0f25bed7b7d711b8484', type: "button", role: "menuitem", tabindex: -1, class: "ai12z-menu-item", "aria-label": "Capture screen", onClick: () => {
|
|
1570
|
+
this.captureScreen();
|
|
1571
|
+
this.closeMenu(true);
|
|
1572
|
+
} }, index.h("span", { key: 'e52ccaaea1c2a073b5a8c8001078c7f6ad54e1da', class: "ai12z-menu-item__icon" }, index.h("svg", { key: 'e20629230e327c40eb099f93445bdc33ceb744de', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", width: "20", height: "20" }, index.h("path", { key: '82b207ca09ca982100faba929365544930592c3b', d: "M12 9a3.75 3.75 0 1 0 0 7.5A3.75 3.75 0 0 0 12 9Z" }), index.h("path", { key: '9de2f9701c7e2f2519bd9874d05c1756abf08b35', "fill-rule": "evenodd", d: "M9.344 3.071a49.52 49.52 0 0 1 5.312 0c.967.052 1.83.585 2.332 1.39l.821 1.317c.24.383.645.643 1.11.71.386.054.77.113 1.152.177 1.432.239 2.429 1.493 2.429 2.909V18a3 3 0 0 1-3 3h-15a3 3 0 0 1-3-3V9.574c0-1.416.997-2.67 2.429-2.909.382-.064.766-.123 1.151-.178a1.56 1.56 0 0 0 1.11-.71l.822-1.315a2.942 2.942 0 0 1 2.332-1.39ZM6.75 12.75a5.25 5.25 0 1 1 10.5 0 5.25 5.25 0 0 1-10.5 0Zm12-1.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z", "clip-rule": "evenodd" }))), index.h("span", { key: '1107d24b22754416215ebf0487d4d5531744ad7b', class: "ai12z-menu-item__label" }, "Capture"))), index.h("li", { key: '941057003ca2b61f602076a2fcfcca852c594b22', role: "none" }, index.h("button", { key: '2d953a40091bc1163c239730acb3e56e7d761947', type: "button", role: "menuitem", tabindex: -1, class: "ai12z-menu-item", "aria-label": "Start Over", "aria-disabled": this.chatLength === 0 ? "true" : "false", onClick: e => {
|
|
1458
1573
|
if (this.chatLength === 0)
|
|
1459
1574
|
return;
|
|
1460
|
-
// const escapeEvent = new KeyboardEvent("keydown", { key: "Escape" })
|
|
1461
|
-
// document.dispatchEvent(escapeEvent)
|
|
1462
1575
|
this.handleFollowUp(e);
|
|
1463
|
-
this.
|
|
1464
|
-
} }, index.h("
|
|
1465
|
-
// console.log("View Recent Chat")
|
|
1576
|
+
this.closeMenu(true);
|
|
1577
|
+
} }, index.h("span", { key: '89bf46b6102b75ac998f8592dd081b3d7ac80e30', class: "ai12z-menu-item__icon" }, index.h("svg", { key: '9a4624eafe2563d792232a7040f799a4c90f0743', width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, index.h("path", { key: '857d6181fc1252bcaff8986348766903f7145db8', d: "M21.5 2v6h-6M2.5 22v-6h6M2 11.5a10 10 0 0 1 18.8-4.3M22 12.5a10 10 0 0 1-18.8 4.2" }))), index.h("span", { key: '4342314590af5c52dee8dd8cc9c37da5f890bc2c', class: "ai12z-menu-item__label" }, "Start Over"))), index.h("li", { key: 'ff2793104059d88ea8ccd580794b9bfee25cffbc', role: "none" }, index.h("button", { key: '1ae65047698825425967ae6217ae96ae8ce0af01', type: "button", role: "menuitem", tabindex: -1, class: "ai12z-menu-item", "aria-label": "View Recent Chat", onClick: e => {
|
|
1466
1578
|
this.handleRecentChat(e);
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
this.toggleBox(e);
|
|
1470
|
-
} }, index.h("svg", { key: '123d73fdd31ea56f503df593818a05f5574c6fdb', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 20 20", fill: "currentColor", width: "20", height: "20" }, index.h("path", { key: 'cded16c28c1421bc4c9d4b9f18af6411309a22ba', d: "M10.75 4.75a.75.75 0 0 0-1.5 0v4.5h-4.5a.75.75 0 0 0 0 1.5h4.5v4.5a.75.75 0 0 0 1.5 0v-4.5h4.5a.75.75 0 0 0 0-1.5h-4.5v-4.5Z" })))))), !this.hideAllButtons && (index.h("div", { key: '9b0213ad6586daecb71c46941b17108f13c58048', class: "scrollbar-hidden text-left bg-transparent dark:text-gray-100 outline-none w-full rounded-xl resize-none h-fit max-h-80 overflow-auto" }, index.h("div", { key: '619ef140b69574f9b5f6b56d3d7dc8355163fbc1', class: "relative w-full min-w-full h-full min-h-fit flex items-center input-prose" }, index.h("div", { key: 'a972c24cc5748376eedced77c91dffd331054293', id: `previewContainer-${this.instanceId}`, draggable: true }), index.h("label", { key: 'b515979270ffdbf8024951c04a826888539a0e64', htmlFor: `searchInput-${this.instanceId}`, class: "sr-only" }, "Your message"), index.h("textarea", { key: '32123cab1fb36680b6e62a53e975988434721974', readOnly: this.submitted, "aria-describedby": this.emptyMessageError ? `message-error-${this.instanceId} search-hint-${this.instanceId}` : `search-hint-${this.instanceId}`, "aria-invalid": this.emptyMessageError, id: `searchInput-${this.instanceId}`, ref: el => {
|
|
1579
|
+
this.closeMenu(true);
|
|
1580
|
+
} }, index.h("span", { key: '7ddc54280e621560399fbce8fb9b827c8fb42abb', class: "ai12z-menu-item__icon" }, index.h("svg", { key: '9d1876b8331a59e4b49fb96dd5cf263d8c2e1cad', xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, index.h("path", { key: '185bb67ad4cdf45749d2eff12a059b980a1a8052', d: "M21 15a4 4 0 0 1-4 4H7l-4 4V7a4 4 0 0 1 4-4h10a4 4 0 0 1 4 4z" }), index.h("path", { key: 'd22013e8057604e4d73c253c34408e3576430e58', d: "M12 7v5l3 2" }))), index.h("span", { key: 'e2453013820e91872f19efd4f840796366d46c77', class: "ai12z-menu-item__label" }, "View Recent Chat")))))))), !this.hideAllButtons && (index.h("div", { key: 'befa212132aa56e7c83aee675c62a8e26e65036c', class: "scrollbar-hidden text-left bg-transparent dark:text-gray-100 outline-none w-full rounded-xl resize-none h-fit max-h-80 overflow-auto" }, index.h("div", { key: '1ba4a975f882d789d913a43a175808d8d39d38d1', class: "relative w-full min-w-full h-full min-h-fit flex items-center input-prose" }, index.h("div", { key: '936c01b9fc7e998800517cd8c84203888be85e90', id: `previewContainer-${this.instanceId}`, draggable: true }), index.h("label", { key: 'f724dc8a7ecedfb3b0744b9640298805edf03e82', htmlFor: `searchInput-${this.instanceId}`, class: "sr-only" }, "Your message"), index.h("textarea", { key: '7e29fb0e770efe7f2d1522b9132c5198c4f14fa1', readOnly: this.submitted, "aria-describedby": this.emptyMessageError ? `message-error-${this.instanceId} search-hint-${this.instanceId}` : `search-hint-${this.instanceId}`, "aria-invalid": this.emptyMessageError, id: `searchInput-${this.instanceId}`, ref: el => {
|
|
1471
1581
|
this.searchInputElem = el;
|
|
1472
|
-
|
|
1582
|
+
// Autofocus once on first mount, and never while the
|
|
1583
|
+
// options menu is open — otherwise unrelated re-renders
|
|
1584
|
+
// (announce/error-message timers, chatLength updates)
|
|
1585
|
+
// yank focus out of the menu on every render.
|
|
1586
|
+
if (el && !this.hasAutoFocused && !this.isOpen) {
|
|
1587
|
+
this.hasAutoFocused = true;
|
|
1588
|
+
el.focus();
|
|
1589
|
+
}
|
|
1473
1590
|
}, placeholder: this.placeholder, autoComplete: "off", class: "w-full p-1 custom-input", value: this.searchInput, rows: 1, onInput: utils.debounce(e => this.handleInputChange(e), 500), onKeyUp: this.adjustHeight, onKeyDown: this.handleKeyDown, onFocus: () => this.searchFormElem.classList.add("input-focus-color"), onBlur: () => this.searchFormElem.classList.remove("input-focus-color"), onPaste: e => {
|
|
1474
1591
|
this.handlePaste(e);
|
|
1475
|
-
} }), index.h("div", { key: '
|
|
1592
|
+
} }), index.h("div", { key: 'afc7aaa56b3522d9c8669f00ff4825f063b5383e', role: "status", "aria-live": "polite", "aria-atomic": "true", class: "sr-only" }, this.announceMessage), index.h("span", { key: 'f75e54c74c0c4ec11a623d039e561b0f5d884260', id: `search-hint-${this.instanceId}`, class: "sr-only" }, "Press Enter to send, Shift+Enter for new line")))), index.h("div", { key: 'b2c706fd8ec405d7b2e2627638ba13a8c00ddb2a', class: "p-1 self-end flex space-x-1 flex-row", style: { width: this.hideAllButtons ? "100%" : "auto" } }, index.h("div", { key: 'a32b1ffc262aa2682e7a661ffb1d33bf75cbea57', "aria-label": "Record voice", class: "flex self-center", style: { width: this.hideAllButtons ? "100%" : "auto" } }, this.isEnableMic && (index.h("audio-recorder", { key: '15b4fa7e527dc01d3b5ee4c5578dd8f535fec6c8', "component-type": "cta", onStartRecord: _ev => {
|
|
1476
1593
|
// console.log("test", ev)
|
|
1477
1594
|
this.hideAllButtons = true;
|
|
1478
1595
|
}, onStopRecord: _ev => {
|
|
@@ -1490,14 +1607,14 @@ const InputForm = class {
|
|
|
1490
1607
|
});
|
|
1491
1608
|
}
|
|
1492
1609
|
}, 1000);
|
|
1493
|
-
}, style: { width: "100%" } }))), " ", !this.hideAllButtons && (index.h("div", { key: '
|
|
1610
|
+
}, style: { width: "100%" } }))), " ", !this.hideAllButtons && (index.h("div", { key: '818c0dc10014f80b7606a73789ca067ec4860ae5', class: "flex items-center" }, index.h("div", { key: '4e9f59fc6c4c7d424ddb46563b447a241a1b998d', "aria-label": "Send message", class: "flex" }, index.h("button", { key: 'a19da51b9119cda37555c66420ba79f73843f832', id: `send-message-button-${this.instanceId}`, class: "btn-bg-color text-white transition rounded-full p-1.5 self-center",
|
|
1494
1611
|
// type="submit"
|
|
1495
|
-
disabled: this.submitted, onClick: this.handleAskAI, tabindex: "0", "aria-label": "Send Message", title: "Send Message" }, index.h("svg", { key: '
|
|
1612
|
+
disabled: this.submitted, onClick: this.handleAskAI, tabindex: "0", "aria-label": "Send Message", title: "Send Message" }, index.h("svg", { key: '69e383d261ffb92f93aed72be1daad0f8573db23', xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", fill: "currentColor", class: "size-6" }, index.h("path", { key: '6c3eb5a3055dfe9a3056f23e5d408150b63b30ed', "fill-rule": "evenodd", d: "M8 14a.75.75 0 0 1-.75-.75V4.56L4.03 7.78a.75.75 0 0 1-1.06-1.06l4.5-4.5a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1-1.06 1.06L8.75 4.56v8.69A.75.75 0 0 1 8 14Z", "clip-rule": "evenodd" })))))))), this.imagesBase64List.length > 0 && (index.h("div", { key: 'a6e55fc7c0eeae9a3350e84e3bd7fcc3eea5e06e', class: "flex flex-wrap gap-2 mx-1 mt-2.5 mb-1" }, this.imagesBase64List.map((img, idx) => (index.h("div", { class: "image-Container sc-ai12z-input-form", key: idx }, index.h("img", { src: img, style: { width: "70px", height: "50px", borderRadius: "12px" } }), index.h("span", { class: "delete-image sc-ai12z-input-form cursor-pointer ml-1", onClick: () => {
|
|
1496
1613
|
this.imagesBase64List = this.imagesBase64List.filter((_, i) => i !== idx);
|
|
1497
1614
|
if (this.imageUploaderRef && typeof this.imageUploaderRef.removeImageAtIndex === "function") {
|
|
1498
1615
|
this.imageUploaderRef.removeImageAtIndex(idx);
|
|
1499
1616
|
}
|
|
1500
|
-
} }, "\u00D7"))))))), this.showErrorMessage && (index.h("div", { key: '
|
|
1617
|
+
} }, "\u00D7"))))))), this.showErrorMessage && (index.h("div", { key: '703e617f0e374c0c9d83c3d744b258b43f49c540', class: "flex" }, " ", index.h("p", { key: '5224231ef0d8bcaf4f39b6a3ac100c6b4a0959f2', class: "error-msg", innerHTML: this.errorMessage }))), this.emptyMessageError && (index.h("div", { key: '3d933dbf56bde332066f40a838b2903314e73c52', class: "flex" }, index.h("p", { key: '98423eb51cbc01287e2ed3104b1eb3951c388a8f', id: `message-error-${this.instanceId}`, class: "error-msg", role: "alert" }, "Message cannot be empty. Please enter a message to send."))), this.chatLength === 0 && (index.h("div", { key: '3eaca3f631eb04755fa9e6623a7c5814878f1254', class: "enter-tip", role: "tooltip" }, "Tip: Press Enter to send, Shift+Enter for new line", " ", index.h("button", { key: 'cfdc4b2eb43641a781585e3e999ac54302da0d44', onClick: () => (this.showShortcutsDialog = true), class: "keyboard-shortcuts-btn", "aria-label": "Show keyboard shortcuts", title: "Keyboard shortcuts (?)", tabindex: "0" }, index.h("svg", { key: 'fa85440cb0fcdd8ca01e6ceccb06af38ffad8fd7', width: "13", height: "13", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }, index.h("circle", { key: '847f62af182e0f12ded557395ea99f132314f4d3', cx: "12", cy: "12", r: "10" }), index.h("path", { key: '275bd98694c58a21f2e481a9128a3c6c1b9de7cd', d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }), index.h("line", { key: '6bac5d6dd7180ca06b68c631cc22c52e6cba556a', x1: "12", y1: "17", x2: "12.01", y2: "17" })))))), this.showShortcutsDialog && (index.h("keyboard-shortcuts-dialog", { key: 'd3b4532e028a0e69c34681fc80c2c8b6afe219c5', show: this.showShortcutsDialog, shortcuts: this.shortcuts, onCloseDialog: () => (this.showShortcutsDialog = false) }))));
|
|
1501
1618
|
}
|
|
1502
1619
|
get el() { return index.getElement(this); }
|
|
1503
1620
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
4
|
-
var utils = require('./utils-
|
|
5
|
-
var processCarouselData = require('./processCarouselData-
|
|
3
|
+
var index = require('./index-v8T1EJAJ.js');
|
|
4
|
+
var utils = require('./utils-7C5_GnyF.js');
|
|
5
|
+
var processCarouselData = require('./processCarouselData-kCVPE4mw.js');
|
|
6
6
|
var botHelpers = require('./botHelpers-D5Dj7TRA.js');
|
|
7
|
-
var index$1 = require('./index-
|
|
7
|
+
var index$1 = require('./index-CKLC7f4y.js');
|
|
8
8
|
require('./_commonjsHelpers-MBWFX2dn.js');
|
|
9
9
|
|
|
10
10
|
/*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */
|