deep-chat-dev 9.0.114 → 9.0.116
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/custom-elements.json +2389 -2365
- package/dist/deepChat.bundle.js +1 -1
- package/dist/deepChat.d.ts +1 -1
- package/dist/deepChat.d.ts.map +1 -1
- package/dist/deepChat.js +927 -878
- package/dist/services/openAI/openAIAssistantIO.d.ts +3 -0
- package/dist/services/openAI/openAIAssistantIO.d.ts.map +1 -1
- package/dist/types/openAI.d.ts +17 -1
- package/dist/types/openAI.d.ts.map +1 -1
- package/dist/types/openAIResult.d.ts +3 -0
- package/dist/types/openAIResult.d.ts.map +1 -1
- package/dist/utils/HTTP/requestUtils.d.ts +1 -1
- package/dist/utils/HTTP/requestUtils.d.ts.map +1 -1
- package/dist/webModel/webModelConfig.d.ts +18 -0
- package/dist/webModel/webModelConfig.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/deepChat.js
CHANGED
@@ -6,15 +6,15 @@ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol
|
|
6
6
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
7
7
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
8
8
|
function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
|
9
|
-
function _construct(
|
9
|
+
function _construct(t, e, r) { if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); var o = [null]; o.push.apply(o, e); var p = new (t.bind.apply(t, o))(); return r && _setPrototypeOf(p, r.prototype), p; }
|
10
10
|
function _isNativeFunction(fn) { try { return Function.toString.call(fn).indexOf("[native code]") !== -1; } catch (e) { return typeof fn === "function"; } }
|
11
|
-
function
|
12
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
13
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
11
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
14
12
|
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
15
13
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
16
|
-
function _isNativeReflectConstruct() {
|
14
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
17
15
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
16
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
17
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
18
18
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
19
19
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
20
20
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
@@ -182,7 +182,7 @@ zn.DEFAULT_COMPONENT_STYLE = {
|
|
182
182
|
// this is also causing the chat to squeeze when there is no space
|
183
183
|
overflow: "hidden"
|
184
184
|
};
|
185
|
-
var
|
185
|
+
var Si = zn;
|
186
186
|
var R = /* @__PURE__ */function (s) {
|
187
187
|
return s.ESCAPE = "Escape", s.ENTER = "Enter", s.TAB = "Tab", s.ARROW_UP = "ArrowUp", s.ARROW_DOWN = "ArrowDown", s.ARROW_RIGHT = "ArrowRight", s.ARROW_LEFT = "ArrowLeft", s.BACKSPACE = "Backspace", s.DELETE = "Delete", s.META = "Meta", s.CONTROL = "Control", s;
|
188
188
|
}(R || {});
|
@@ -191,7 +191,7 @@ var be = /*#__PURE__*/_createClass(function be() {
|
|
191
191
|
});
|
192
192
|
be.IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
193
193
|
be.IS_CHROMIUM = window.chrome;
|
194
|
-
var
|
194
|
+
var qn = /*#__PURE__*/function () {
|
195
195
|
function rt() {
|
196
196
|
_classCallCheck(this, rt);
|
197
197
|
}
|
@@ -223,8 +223,8 @@ var Un = /*#__PURE__*/function () {
|
|
223
223
|
}]);
|
224
224
|
return rt;
|
225
225
|
}();
|
226
|
-
|
227
|
-
var ys =
|
226
|
+
qn.PERMITTED_KEYS = /* @__PURE__ */new Set([R.BACKSPACE, R.DELETE, R.ARROW_RIGHT, R.ARROW_LEFT, R.ARROW_DOWN, R.ARROW_UP, R.META, R.CONTROL, R.ENTER]);
|
227
|
+
var ys = qn;
|
228
228
|
var xs = /*#__PURE__*/function () {
|
229
229
|
function xs() {
|
230
230
|
_classCallCheck(this, xs);
|
@@ -240,7 +240,7 @@ var xs = /*#__PURE__*/function () {
|
|
240
240
|
}]);
|
241
241
|
return xs;
|
242
242
|
}();
|
243
|
-
var
|
243
|
+
var Un = /*#__PURE__*/function () {
|
244
244
|
function He(e, t) {
|
245
245
|
var _this = this;
|
246
246
|
_classCallCheck(this, He);
|
@@ -336,8 +336,8 @@ var qn = /*#__PURE__*/function () {
|
|
336
336
|
}]);
|
337
337
|
return He;
|
338
338
|
}();
|
339
|
-
|
340
|
-
var
|
339
|
+
Un.TEXT_INPUT_ID = "text-input";
|
340
|
+
var Gi = Un;
|
341
341
|
var ti = /*#__PURE__*/function () {
|
342
342
|
function ti() {
|
343
343
|
_classCallCheck(this, ti);
|
@@ -353,7 +353,7 @@ var ti = /*#__PURE__*/function () {
|
|
353
353
|
}, {
|
354
354
|
key: "focusFromParentElement",
|
355
355
|
value: function focusFromParentElement(e) {
|
356
|
-
var t = e.querySelector("#".concat(
|
356
|
+
var t = e.querySelector("#".concat(Gi.TEXT_INPUT_ID));
|
357
357
|
t && ti.focusEndOfInput(t);
|
358
358
|
}
|
359
359
|
}]);
|
@@ -365,28 +365,28 @@ function an(s) {
|
|
365
365
|
function Es(s) {
|
366
366
|
return s && JSON.stringify(s);
|
367
367
|
}
|
368
|
-
function
|
368
|
+
function Vi(s, e, t, i) {
|
369
369
|
var n = "\n".concat(an(e), " message: ").concat(JSON.stringify(s), " \n"),
|
370
370
|
r = t ? "".concat(an(e), " message after interceptor: ").concat(Es(i), " \n") : "";
|
371
371
|
return n + r;
|
372
372
|
}
|
373
|
-
function
|
374
|
-
return "".concat(
|
373
|
+
function _s(s, e, t, i) {
|
374
|
+
return "".concat(Vi(s, e, t, i), "Make sure the ").concat(e, " message is using the Response format: https://deepchat.dev/docs/connect/#Response \nYou can also augment it using the responseInterceptor property: https://deepchat.dev/docs/interceptors#responseInterceptor");
|
375
375
|
}
|
376
376
|
function ws(s, e, t) {
|
377
377
|
var i = "response";
|
378
|
-
return "".concat(
|
378
|
+
return "".concat(Vi(s, i, e, t), "Make sure the ").concat(i, " message is using the {text: string} format, e.g: {text: \"Model Response\"}");
|
379
379
|
}
|
380
|
-
function
|
380
|
+
function Ss(s, e) {
|
381
381
|
var t = "request";
|
382
|
-
return "".concat(
|
382
|
+
return "".concat(Vi(s, t, e), "Make sure the ").concat(t, " message is using the {body: {text: string}} format, e.g: {body: {text: \"Model Response\"}}");
|
383
383
|
}
|
384
384
|
var ln = "Make sure the events are using {text: string} or {html: string} format.\nYou can also augment them using the responseInterceptor property: https://deepchat.dev/docs/interceptors#responseInterceptor",
|
385
385
|
C = {
|
386
386
|
INVALID_KEY: "Invalid API Key",
|
387
387
|
CONNECTION_FAILED: "Failed to connect",
|
388
|
-
INVALID_RESPONSE:
|
389
|
-
INVALID_MODEL_REQUEST:
|
388
|
+
INVALID_RESPONSE: _s,
|
389
|
+
INVALID_MODEL_REQUEST: Ss,
|
390
390
|
INVALID_MODEL_RESPONSE: ws,
|
391
391
|
INVALID_STREAM_EVENT: ln,
|
392
392
|
INVALID_STREAM_EVENT_MIX: "Cannot mix {text: string} and {html: string} responses.",
|
@@ -468,11 +468,11 @@ var Vn = /*#__PURE__*/function () {
|
|
468
468
|
}();
|
469
469
|
Vn.LOAD_VOICES_MS = 200;
|
470
470
|
var jt = Vn;
|
471
|
-
var
|
472
|
-
function
|
473
|
-
_classCallCheck(this,
|
471
|
+
var Ie = /*#__PURE__*/function () {
|
472
|
+
function Ie() {
|
473
|
+
_classCallCheck(this, Ie);
|
474
474
|
}
|
475
|
-
_createClass(
|
475
|
+
_createClass(Ie, null, [{
|
476
476
|
key: "checkForContainerStyles",
|
477
477
|
value: function checkForContainerStyles(e, t) {
|
478
478
|
var i = e.containerStyle;
|
@@ -510,13 +510,13 @@ var Le = /*#__PURE__*/function () {
|
|
510
510
|
(t = e.children[0]) != null && t.classList.contains("deep-chat-update-message") && (console.error('The "deep-chat-update-message" html class is deprecated since version 1.4.4.'), console.error("Please change to using {..., overwrite: true} object: https://deepchat.dev/docs/connect#Response"));
|
511
511
|
}
|
512
512
|
}]);
|
513
|
-
return
|
513
|
+
return Ie;
|
514
514
|
}();
|
515
515
|
var ii = /*#__PURE__*/function () {
|
516
|
-
function
|
517
|
-
_classCallCheck(this,
|
516
|
+
function _e() {
|
517
|
+
_classCallCheck(this, _e);
|
518
518
|
}
|
519
|
-
_createClass(
|
519
|
+
_createClass(_e, null, [{
|
520
520
|
key: "getLastElementsByClass",
|
521
521
|
value: function getLastElementsByClass(e, t, i) {
|
522
522
|
var _loop = function _loop() {
|
@@ -557,8 +557,8 @@ var ii = /*#__PURE__*/function () {
|
|
557
557
|
}, {
|
558
558
|
key: "overwriteMessage",
|
559
559
|
value: function overwriteMessage(e, t, i, n, r, o) {
|
560
|
-
var a =
|
561
|
-
l =
|
560
|
+
var a = _e.getLastElementsByClass(t, [_e.getRoleClass(n), o], ["loading-message-text"]),
|
561
|
+
l = _e.getLastMessage(e, n, r);
|
562
562
|
return l && (l[r] = i), a;
|
563
563
|
}
|
564
564
|
}, {
|
@@ -570,18 +570,18 @@ var ii = /*#__PURE__*/function () {
|
|
570
570
|
}, {
|
571
571
|
key: "fillEmptyMessageElement",
|
572
572
|
value: function fillEmptyMessageElement(e, t) {
|
573
|
-
t.trim().length === 0 && (e.classList.add(
|
573
|
+
t.trim().length === 0 && (e.classList.add(_e.EMPTY_MESSAGE_CLASS), e.innerHTML = '<div style="color:#00000000">.</div>');
|
574
574
|
}
|
575
575
|
}, {
|
576
576
|
key: "unfillEmptyMessageElement",
|
577
577
|
value: function unfillEmptyMessageElement(e, t) {
|
578
|
-
e.classList.contains(
|
578
|
+
e.classList.contains(_e.EMPTY_MESSAGE_CLASS) && t.trim().length > 0 && e.replaceChildren();
|
579
579
|
}
|
580
580
|
}, {
|
581
581
|
key: "getLastMessageBubbleElement",
|
582
582
|
value: function getLastMessageBubbleElement(e) {
|
583
583
|
var t, i, n;
|
584
|
-
return Array.from(((n = (i = (t =
|
584
|
+
return Array.from(((n = (i = (t = _e.getLastMessageElement(e)) == null ? void 0 : t.children) == null ? void 0 : i[0]) == null ? void 0 : n.children) || []).find(function (r) {
|
585
585
|
return r.classList.contains("message-bubble");
|
586
586
|
});
|
587
587
|
}
|
@@ -591,7 +591,7 @@ var ii = /*#__PURE__*/function () {
|
|
591
591
|
return e.children[e.children.length - 1];
|
592
592
|
}
|
593
593
|
}]);
|
594
|
-
return
|
594
|
+
return _e;
|
595
595
|
}();
|
596
596
|
ii.AI_ROLE = "ai";
|
597
597
|
ii.USER_ROLE = "user";
|
@@ -631,7 +631,7 @@ var Ae = /*#__PURE__*/function () {
|
|
631
631
|
}();
|
632
632
|
var Ms = "deep-chat-temporary-message",
|
633
633
|
Ts = "deep-chat-suggestion-button",
|
634
|
-
|
634
|
+
Pi = {
|
635
635
|
"deep-chat-button": {
|
636
636
|
styles: {
|
637
637
|
"default": {
|
@@ -652,7 +652,7 @@ var Ms = "deep-chat-temporary-message",
|
|
652
652
|
}
|
653
653
|
}
|
654
654
|
},
|
655
|
-
cn = Object.keys(
|
655
|
+
cn = Object.keys(Pi);
|
656
656
|
var ve = /*#__PURE__*/function () {
|
657
657
|
function ve() {
|
658
658
|
_classCallCheck(this, ve);
|
@@ -685,7 +685,7 @@ var ve = /*#__PURE__*/function () {
|
|
685
685
|
}, {
|
686
686
|
key: "applyEvents",
|
687
687
|
value: function applyEvents(e, t) {
|
688
|
-
var i =
|
688
|
+
var i = Pi[t].events;
|
689
689
|
Object.keys(i || []).forEach(function (n) {
|
690
690
|
e.addEventListener(n, i == null ? void 0 : i[n]);
|
691
691
|
});
|
@@ -698,7 +698,7 @@ var ve = /*#__PURE__*/function () {
|
|
698
698
|
var c = (d = e[l]) == null ? void 0 : d.styles;
|
699
699
|
return c && e[l].styles && a.push(c), a;
|
700
700
|
}, []),
|
701
|
-
r =
|
701
|
+
r = Pi[i].styles;
|
702
702
|
if (r) {
|
703
703
|
var a = JSON.parse(JSON.stringify(r));
|
704
704
|
a["default"] && T.overwriteDefaultWithAlreadyApplied(a, t), n.unshift(a);
|
@@ -713,7 +713,7 @@ var ve = /*#__PURE__*/function () {
|
|
713
713
|
var o = i.getElementsByClassName(r);
|
714
714
|
Array.from(o || []).forEach(function (a) {
|
715
715
|
var l = ve.getProcessedStyles(t, a, r);
|
716
|
-
|
716
|
+
re.applyStylesToElement(a, l), ve.applyEvents(a, r);
|
717
717
|
});
|
718
718
|
});
|
719
719
|
var n = i.getElementsByClassName(Ts);
|
@@ -724,11 +724,11 @@ var ve = /*#__PURE__*/function () {
|
|
724
724
|
}]);
|
725
725
|
return ve;
|
726
726
|
}();
|
727
|
-
var
|
728
|
-
function
|
729
|
-
_classCallCheck(this,
|
727
|
+
var re = /*#__PURE__*/function () {
|
728
|
+
function re() {
|
729
|
+
_classCallCheck(this, re);
|
730
730
|
}
|
731
|
-
_createClass(
|
731
|
+
_createClass(re, null, [{
|
732
732
|
key: "applyStylesToElement",
|
733
733
|
value: function applyStylesToElement(e, t) {
|
734
734
|
var i = T.processStateful(t, {}, {});
|
@@ -747,7 +747,7 @@ var se = /*#__PURE__*/function () {
|
|
747
747
|
value: function applyClassUtilitiesToElement(e, t) {
|
748
748
|
var i = t.events,
|
749
749
|
n = t.styles;
|
750
|
-
i &&
|
750
|
+
i && re.applyEventsToElement(e, i), n && !ve.doesElementContainDeepChatClass(e) && re.applyStylesToElement(e, n);
|
751
751
|
}
|
752
752
|
}, {
|
753
753
|
key: "applyCustomClassUtilities",
|
@@ -755,17 +755,17 @@ var se = /*#__PURE__*/function () {
|
|
755
755
|
Object.keys(e).forEach(function (i) {
|
756
756
|
var n = t.getElementsByClassName(i);
|
757
757
|
Array.from(n).forEach(function (r) {
|
758
|
-
e[i] &&
|
758
|
+
e[i] && re.applyClassUtilitiesToElement(r, e[i]);
|
759
759
|
});
|
760
760
|
});
|
761
761
|
}
|
762
762
|
}, {
|
763
763
|
key: "apply",
|
764
764
|
value: function apply(e, t) {
|
765
|
-
ve.applyDeepChatUtilities(e, e.htmlClassUtilities, t),
|
765
|
+
ve.applyDeepChatUtilities(e, e.htmlClassUtilities, t), re.applyCustomClassUtilities(e.htmlClassUtilities, t);
|
766
766
|
}
|
767
767
|
}]);
|
768
|
-
return
|
768
|
+
return re;
|
769
769
|
}();
|
770
770
|
var Xe = /*#__PURE__*/function () {
|
771
771
|
function Xe() {
|
@@ -787,7 +787,7 @@ var Xe = /*#__PURE__*/function () {
|
|
787
787
|
value: function overwrite(e, t, i, n) {
|
788
788
|
var r = e.messages,
|
789
789
|
o = v.overwriteMessage(r, n, t, i, "html", "html-message");
|
790
|
-
return o && (o.bubbleElement.innerHTML = t,
|
790
|
+
return o && (o.bubbleElement.innerHTML = t, re.apply(e, o.outerContainer), Ie.flagHTMLUpdateClass(o.bubbleElement)), o;
|
791
791
|
}
|
792
792
|
// prettier-ignore
|
793
793
|
}, {
|
@@ -800,7 +800,7 @@ var Xe = /*#__PURE__*/function () {
|
|
800
800
|
r.status = !1;
|
801
801
|
}
|
802
802
|
var o = Xe.createElements(e, t, i);
|
803
|
-
return v.fillEmptyMessageElement(o.bubbleElement, t),
|
803
|
+
return v.fillEmptyMessageElement(o.bubbleElement, t), re.apply(e, o.outerContainer), Ie.flagHTMLUpdateClass(o.bubbleElement), e.applyCustomStyles(o, i, !1, (a = e.messageStyles) == null ? void 0 : a.html), Xe.addElement(e, o.outerContainer), o;
|
804
804
|
}
|
805
805
|
}]);
|
806
806
|
return Xe;
|
@@ -831,7 +831,7 @@ function gt(s) {
|
|
831
831
|
function $n(s) {
|
832
832
|
return !(s >= 55296 && s <= 57343 || s >= 64976 && s <= 65007 || (s & 65535) === 65535 || (s & 65535) === 65534 || s >= 0 && s <= 8 || s === 11 || s >= 14 && s <= 31 || s >= 127 && s <= 159 || s > 1114111);
|
833
833
|
}
|
834
|
-
function
|
834
|
+
function Di(s) {
|
835
835
|
if (s > 65535) {
|
836
836
|
s -= 65536;
|
837
837
|
var e = 55296 + (s >> 10),
|
@@ -840,15 +840,15 @@ function Pi(s) {
|
|
840
840
|
}
|
841
841
|
return String.fromCharCode(s);
|
842
842
|
}
|
843
|
-
var
|
844
|
-
|
843
|
+
var Ls = /&([a-z#][a-z0-9]{1,31});/gi,
|
844
|
+
Is = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;
|
845
845
|
function Rs(s, e) {
|
846
846
|
var t = 0,
|
847
847
|
i = Kn(e);
|
848
|
-
return e !== i ? i : e.charCodeAt(0) === 35 &&
|
848
|
+
return e !== i ? i : e.charCodeAt(0) === 35 && Is.test(e) && (t = e[1].toLowerCase() === "x" ? parseInt(e.slice(2), 16) : parseInt(e.slice(1), 10), $n(t)) ? Di(t) : s;
|
849
849
|
}
|
850
850
|
function Re(s) {
|
851
|
-
return s.indexOf("&") < 0 ? s : s.replace(
|
851
|
+
return s.indexOf("&") < 0 ? s : s.replace(Ls, Rs);
|
852
852
|
}
|
853
853
|
var Ns = /[&<>"]/,
|
854
854
|
Os = /[&<>"]/g,
|
@@ -1083,14 +1083,14 @@ function Yn(s, e) {
|
|
1083
1083
|
var Oe = m.getBreak = function (e, t) {
|
1084
1084
|
return t = Yn(e, t), t < e.length && e[t].type === "list_item_close" ? "" : "\n";
|
1085
1085
|
};
|
1086
|
-
function
|
1086
|
+
function Wi() {
|
1087
1087
|
this.rules = Jn({}, m), this.getBreak = m.getBreak;
|
1088
1088
|
}
|
1089
|
-
|
1089
|
+
Wi.prototype.renderInline = function (s, e, t) {
|
1090
1090
|
for (var i = this.rules, n = s.length, r = 0, o = ""; n--;) o += i[s[r].type](s, r++, e, t, this);
|
1091
1091
|
return o;
|
1092
1092
|
};
|
1093
|
-
|
1093
|
+
Wi.prototype.render = function (s, e, t) {
|
1094
1094
|
for (var i = this.rules, n = s.length, r = -1, o = ""; ++r < n;) s[r].type === "inline" ? o += this.renderInline(s[r].children, e, t) : o += i[s[r].type](s, r, e, t, this);
|
1095
1095
|
return o;
|
1096
1096
|
};
|
@@ -1237,7 +1237,7 @@ function Bs(s) {
|
|
1237
1237
|
}
|
1238
1238
|
}
|
1239
1239
|
}
|
1240
|
-
function
|
1240
|
+
function ji(s) {
|
1241
1241
|
var e = Re(s);
|
1242
1242
|
try {
|
1243
1243
|
e = decodeURI(e);
|
@@ -1253,7 +1253,7 @@ function Zn(s, e) {
|
|
1253
1253
|
if (s.src.charCodeAt(e) === 60) {
|
1254
1254
|
for (e++; e < o;) {
|
1255
1255
|
if (t = s.src.charCodeAt(e), t === 10) return !1;
|
1256
|
-
if (t === 62) return n =
|
1256
|
+
if (t === 62) return n = ji(gt(s.src.slice(r + 1, e))), s.parser.validateLink(n) ? (s.pos = e + 1, s.linkContent = n, !0) : !1;
|
1257
1257
|
if (t === 92 && e + 1 < o) {
|
1258
1258
|
e += 2;
|
1259
1259
|
continue;
|
@@ -1303,7 +1303,7 @@ function zs(s, e, t, i) {
|
|
1303
1303
|
href: d
|
1304
1304
|
}), o);
|
1305
1305
|
}
|
1306
|
-
function
|
1306
|
+
function qs(s) {
|
1307
1307
|
var e = s.tokens,
|
1308
1308
|
t,
|
1309
1309
|
i,
|
@@ -1316,7 +1316,7 @@ function Us(s) {
|
|
1316
1316
|
}
|
1317
1317
|
}
|
1318
1318
|
}
|
1319
|
-
function
|
1319
|
+
function Us(s) {
|
1320
1320
|
var e = s.tokens,
|
1321
1321
|
t,
|
1322
1322
|
i,
|
@@ -1378,7 +1378,7 @@ function Hs(s) {
|
|
1378
1378
|
}
|
1379
1379
|
}
|
1380
1380
|
var dn = " \n()[]'\".,!?-";
|
1381
|
-
function
|
1381
|
+
function Mi(s) {
|
1382
1382
|
return s.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, "\\$1");
|
1383
1383
|
}
|
1384
1384
|
function Gs(s) {
|
@@ -1396,11 +1396,11 @@ function Gs(s) {
|
|
1396
1396
|
p,
|
1397
1397
|
h = s.tokens;
|
1398
1398
|
if (s.env.abbreviations) {
|
1399
|
-
for (s.env.abbrRegExp || (p = "(^|[" + dn.split("").map(
|
1399
|
+
for (s.env.abbrRegExp || (p = "(^|[" + dn.split("").map(Mi).join("") + "])(" + Object.keys(s.env.abbreviations).map(function (g) {
|
1400
1400
|
return g.substr(1);
|
1401
1401
|
}).sort(function (g, f) {
|
1402
1402
|
return f.length - g.length;
|
1403
|
-
}).map(
|
1403
|
+
}).map(Mi).join("|") + ")($|[" + dn.split("").map(Mi).join("") + "])", s.env.abbrRegExp = new RegExp(p, "g")), d = s.env.abbrRegExp, t = 0, i = h.length; t < i; t++) if (h[t].type === "inline") {
|
1404
1404
|
for (n = h[t].children, e = n.length - 1; e >= 0; e--) if (r = n[e], r.type === "text") {
|
1405
1405
|
for (l = 0, o = r.content, d.lastIndex = 0, c = r.level, a = []; u = d.exec(o);) d.lastIndex > l && a.push({
|
1406
1406
|
type: "text",
|
@@ -1453,24 +1453,24 @@ var Ys = /['"]/,
|
|
1453
1453
|
function pn(s, e) {
|
1454
1454
|
return e < 0 || e >= s.length ? !1 : !Zs.test(s[e]);
|
1455
1455
|
}
|
1456
|
-
function
|
1456
|
+
function qe(s, e, t) {
|
1457
1457
|
return s.substr(0, e) + t + s.substr(e + 1);
|
1458
1458
|
}
|
1459
1459
|
function Xs(s) {
|
1460
|
-
var e, t, i, n, r, o, a, l, c, d, u, p, h, g, f,
|
1460
|
+
var e, t, i, n, r, o, a, l, c, d, u, p, h, g, f, _, w;
|
1461
1461
|
if (s.options.typographer) {
|
1462
1462
|
for (w = [], f = s.tokens.length - 1; f >= 0; f--) if (s.tokens[f].type === "inline") {
|
1463
|
-
for (
|
1464
|
-
for (a =
|
1463
|
+
for (_ = s.tokens[f].children, w.length = 0, e = 0; e < _.length; e++) if (t = _[e], !(t.type !== "text" || Ys.test(t.text))) {
|
1464
|
+
for (a = _[e].level, h = w.length - 1; h >= 0 && !(w[h].level <= a); h--);
|
1465
1465
|
w.length = h + 1, i = t.content, r = 0, o = i.length;
|
1466
1466
|
e: for (; r < o && (un.lastIndex = r, n = un.exec(i), !!n);) {
|
1467
1467
|
if (l = !pn(i, n.index - 1), r = n.index + 1, g = n[0] === "'", c = !pn(i, r), !c && !l) {
|
1468
|
-
g && (t.content =
|
1468
|
+
g && (t.content = qe(t.content, n.index, hn));
|
1469
1469
|
continue;
|
1470
1470
|
}
|
1471
1471
|
if (u = !c, p = !l, p) {
|
1472
1472
|
for (h = w.length - 1; h >= 0 && (d = w[h], !(w[h].level < a)); h--) if (d.single === g && w[h].level === a) {
|
1473
|
-
d = w[h], g ? (
|
1473
|
+
d = w[h], g ? (_[d.token].content = qe(_[d.token].content, d.pos, s.options.quotes[2]), t.content = qe(t.content, n.index, s.options.quotes[3])) : (_[d.token].content = qe(_[d.token].content, d.pos, s.options.quotes[0]), t.content = qe(t.content, n.index, s.options.quotes[1])), w.length = h;
|
1474
1474
|
continue e;
|
1475
1475
|
}
|
1476
1476
|
}
|
@@ -1479,16 +1479,16 @@ function Xs(s) {
|
|
1479
1479
|
pos: n.index,
|
1480
1480
|
single: g,
|
1481
1481
|
level: a
|
1482
|
-
}) : p && g && (t.content =
|
1482
|
+
}) : p && g && (t.content = qe(t.content, n.index, hn));
|
1483
1483
|
}
|
1484
1484
|
}
|
1485
1485
|
}
|
1486
1486
|
}
|
1487
1487
|
}
|
1488
|
-
var
|
1488
|
+
var Ti = [["block", js], ["abbr", Bs], ["references", qs], ["inline", Us], ["footnote_tail", Hs], ["abbr2", Gs], ["replacements", $s], ["smartquotes", Xs]];
|
1489
1489
|
function es() {
|
1490
1490
|
this.options = {}, this.ruler = new G();
|
1491
|
-
for (var s = 0; s <
|
1491
|
+
for (var s = 0; s < Ti.length; s++) this.ruler.push(Ti[s][0], Ti[s][1]);
|
1492
1492
|
}
|
1493
1493
|
es.prototype.process = function (s) {
|
1494
1494
|
var e, t, i;
|
@@ -1595,12 +1595,12 @@ function tr(s, e, t, i) {
|
|
1595
1595
|
h,
|
1596
1596
|
g,
|
1597
1597
|
f = s.bMarks[e] + s.tShift[e],
|
1598
|
-
|
1599
|
-
if (f >
|
1598
|
+
_ = s.eMarks[e];
|
1599
|
+
if (f > _ || s.src.charCodeAt(f++) !== 62 || s.level >= s.options.maxNesting) return !1;
|
1600
1600
|
if (i) return !0;
|
1601
|
-
for (s.src.charCodeAt(f) === 32 && f++, l = s.blkIndent, s.blkIndent = 0, a = [s.bMarks[e]], s.bMarks[e] = f, f = f <
|
1601
|
+
for (s.src.charCodeAt(f) === 32 && f++, l = s.blkIndent, s.blkIndent = 0, a = [s.bMarks[e]], s.bMarks[e] = f, f = f < _ ? s.skipSpaces(f) : f, r = f >= _, o = [s.tShift[e]], s.tShift[e] = f - s.bMarks[e], u = s.parser.ruler.getRules("blockquote"), n = e + 1; n < t && (f = s.bMarks[n] + s.tShift[n], _ = s.eMarks[n], !(f >= _)); n++) {
|
1602
1602
|
if (s.src.charCodeAt(f++) === 62) {
|
1603
|
-
s.src.charCodeAt(f) === 32 && f++, a.push(s.bMarks[n]), s.bMarks[n] = f, f = f <
|
1603
|
+
s.src.charCodeAt(f) === 32 && f++, a.push(s.bMarks[n]), s.bMarks[n] = f, f = f < _ ? s.skipSpaces(f) : f, r = f >= _, o.push(s.tShift[n]), s.tShift[n] = f - s.bMarks[n];
|
1604
1604
|
continue;
|
1605
1605
|
}
|
1606
1606
|
if (r) break;
|
@@ -1675,21 +1675,21 @@ function sr(s, e, t, i) {
|
|
1675
1675
|
h,
|
1676
1676
|
g,
|
1677
1677
|
f,
|
1678
|
-
|
1678
|
+
_,
|
1679
1679
|
w,
|
1680
1680
|
V,
|
1681
1681
|
A,
|
1682
1682
|
W,
|
1683
1683
|
Q,
|
1684
|
-
|
1685
|
-
|
1684
|
+
ae = !0,
|
1685
|
+
U,
|
1686
1686
|
O,
|
1687
1687
|
Ee,
|
1688
|
-
|
1689
|
-
if ((u = mn(s, e)) >= 0)
|
1688
|
+
wi;
|
1689
|
+
if ((u = mn(s, e)) >= 0) _ = !0;else if ((u = fn(s, e)) >= 0) _ = !1;else return !1;
|
1690
1690
|
if (s.level >= s.options.maxNesting) return !1;
|
1691
1691
|
if (f = s.src.charCodeAt(u - 1), i) return !0;
|
1692
|
-
for (V = s.tokens.length,
|
1692
|
+
for (V = s.tokens.length, _ ? (d = s.bMarks[e] + s.tShift[e], g = Number(s.src.substr(d, u - d - 1)), s.tokens.push({
|
1693
1693
|
type: "ordered_list_open",
|
1694
1694
|
order: g,
|
1695
1695
|
lines: W = [e, 0],
|
@@ -1698,28 +1698,28 @@ function sr(s, e, t, i) {
|
|
1698
1698
|
type: "bullet_list_open",
|
1699
1699
|
lines: W = [e, 0],
|
1700
1700
|
level: s.level++
|
1701
|
-
}), n = e, A = !1,
|
1701
|
+
}), n = e, A = !1, U = s.parser.ruler.getRules("list"); n < t && (w = s.skipSpaces(u), p = s.eMarks[n], w >= p ? h = 1 : h = w - u, h > 4 && (h = 1), h < 1 && (h = 1), r = u - s.bMarks[n] + h, s.tokens.push({
|
1702
1702
|
type: "list_item_open",
|
1703
1703
|
lines: Q = [e, 0],
|
1704
1704
|
level: s.level++
|
1705
|
-
}), a = s.blkIndent, l = s.tight, o = s.tShift[e], c = s.parentType, s.tShift[e] = w - s.bMarks[e], s.blkIndent = r, s.tight = !0, s.parentType = "list", s.parser.tokenize(s, e, t, !0), (!s.tight || A) && (
|
1705
|
+
}), a = s.blkIndent, l = s.tight, o = s.tShift[e], c = s.parentType, s.tShift[e] = w - s.bMarks[e], s.blkIndent = r, s.tight = !0, s.parentType = "list", s.parser.tokenize(s, e, t, !0), (!s.tight || A) && (ae = !1), A = s.line - e > 1 && s.isEmpty(s.line - 1), s.blkIndent = a, s.tShift[e] = o, s.tight = l, s.parentType = c, s.tokens.push({
|
1706
1706
|
type: "list_item_close",
|
1707
1707
|
level: --s.level
|
1708
1708
|
}), n = e = s.line, Q[1] = n, w = s.bMarks[e], !(n >= t || s.isEmpty(n) || s.tShift[n] < s.blkIndent));) {
|
1709
|
-
for (
|
1710
|
-
|
1709
|
+
for (wi = !1, O = 0, Ee = U.length; O < Ee; O++) if (U[O](s, n, t, !0)) {
|
1710
|
+
wi = !0;
|
1711
1711
|
break;
|
1712
1712
|
}
|
1713
|
-
if (
|
1714
|
-
if (
|
1713
|
+
if (wi) break;
|
1714
|
+
if (_) {
|
1715
1715
|
if (u = mn(s, n), u < 0) break;
|
1716
1716
|
} else if (u = fn(s, n), u < 0) break;
|
1717
1717
|
if (f !== s.src.charCodeAt(u - 1)) break;
|
1718
1718
|
}
|
1719
1719
|
return s.tokens.push({
|
1720
|
-
type:
|
1720
|
+
type: _ ? "ordered_list_close" : "bullet_list_close",
|
1721
1721
|
level: --s.level
|
1722
|
-
}), W[1] = n, s.line = n,
|
1722
|
+
}), W[1] = n, s.line = n, ae && nr(s, V), !0;
|
1723
1723
|
}
|
1724
1724
|
function rr(s, e, t, i) {
|
1725
1725
|
var n,
|
@@ -1825,14 +1825,14 @@ function ur(s, e, t, i) {
|
|
1825
1825
|
content: s.getLines(e, o, 0, !0)
|
1826
1826
|
}), !0;
|
1827
1827
|
}
|
1828
|
-
function
|
1828
|
+
function Ci(s, e) {
|
1829
1829
|
var t = s.bMarks[e] + s.blkIndent,
|
1830
1830
|
i = s.eMarks[e];
|
1831
1831
|
return s.src.substr(t, i - t);
|
1832
1832
|
}
|
1833
1833
|
function hr(s, e, t, i) {
|
1834
1834
|
var n, r, o, a, l, c, d, u, p, h, g;
|
1835
|
-
if (e + 2 > t || (l = e + 1, s.tShift[l] < s.blkIndent) || (o = s.bMarks[l] + s.tShift[l], o >= s.eMarks[l]) || (n = s.src.charCodeAt(o), n !== 124 && n !== 45 && n !== 58) || (r =
|
1835
|
+
if (e + 2 > t || (l = e + 1, s.tShift[l] < s.blkIndent) || (o = s.bMarks[l] + s.tShift[l], o >= s.eMarks[l]) || (n = s.src.charCodeAt(o), n !== 124 && n !== 45 && n !== 58) || (r = Ci(s, e + 1), !/^[-:| ]+$/.test(r)) || (c = r.split("|"), c <= 2)) return !1;
|
1836
1836
|
for (u = [], a = 0; a < c.length; a++) {
|
1837
1837
|
if (p = c[a].trim(), !p) {
|
1838
1838
|
if (a === 0 || a === c.length - 1) continue;
|
@@ -1841,7 +1841,7 @@ function hr(s, e, t, i) {
|
|
1841
1841
|
if (!/^:?-+:?$/.test(p)) return !1;
|
1842
1842
|
p.charCodeAt(p.length - 1) === 58 ? u.push(p.charCodeAt(0) === 58 ? "center" : "right") : p.charCodeAt(0) === 58 ? u.push("left") : u.push("");
|
1843
1843
|
}
|
1844
|
-
if (r =
|
1844
|
+
if (r = Ci(s, e).trim(), r.indexOf("|") === -1 || (c = r.replace(/^\||\|$/g, "").split("|"), u.length !== c.length)) return !1;
|
1845
1845
|
if (i) return !0;
|
1846
1846
|
for (s.tokens.push({
|
1847
1847
|
type: "table_open",
|
@@ -1880,7 +1880,7 @@ function hr(s, e, t, i) {
|
|
1880
1880
|
type: "tbody_open",
|
1881
1881
|
lines: g = [e + 2, 0],
|
1882
1882
|
level: s.level++
|
1883
|
-
}), l = e + 2; l < t && !(s.tShift[l] < s.blkIndent || (r =
|
1883
|
+
}), l = e + 2; l < t && !(s.tShift[l] < s.blkIndent || (r = Ci(s, l).trim(), r.indexOf("|") === -1)); l++) {
|
1884
1884
|
for (c = r.replace(/^\||\|$/g, "").split("|"), s.tokens.push({
|
1885
1885
|
type: "tr_open",
|
1886
1886
|
level: s.level++
|
@@ -1924,7 +1924,7 @@ function pr(s, e) {
|
|
1924
1924
|
for (t = e + 2, i = s.tokens.length - 2; t < i; t++) s.tokens[t].level === n && s.tokens[t].type === "paragraph_open" && (s.tokens[t + 2].tight = !0, s.tokens[t].tight = !0, t += 2);
|
1925
1925
|
}
|
1926
1926
|
function fr(s, e, t, i) {
|
1927
|
-
var n, r, o, a, l, c, d, u, p, h, g, f,
|
1927
|
+
var n, r, o, a, l, c, d, u, p, h, g, f, _, w;
|
1928
1928
|
if (i) return s.ddIndent < 0 ? !1 : Nt(s, e) >= 0;
|
1929
1929
|
if (d = e + 1, s.isEmpty(d) && ++d > t || s.tShift[d] < s.blkIndent || (n = Nt(s, d), n < 0) || s.level >= s.options.maxNesting) return !1;
|
1930
1930
|
c = s.tokens.length, s.tokens.push({
|
@@ -1933,7 +1933,7 @@ function fr(s, e, t, i) {
|
|
1933
1933
|
level: s.level++
|
1934
1934
|
}), o = e, r = d;
|
1935
1935
|
e: for (;;) {
|
1936
|
-
for (w = !0,
|
1936
|
+
for (w = !0, _ = !1, s.tokens.push({
|
1937
1937
|
type: "dt_open",
|
1938
1938
|
lines: [o, o],
|
1939
1939
|
level: s.level++
|
@@ -1951,7 +1951,7 @@ function fr(s, e, t, i) {
|
|
1951
1951
|
type: "dd_open",
|
1952
1952
|
lines: a = [d, 0],
|
1953
1953
|
level: s.level++
|
1954
|
-
}), f = s.tight, p = s.ddIndent, u = s.blkIndent, g = s.tShift[r], h = s.parentType, s.blkIndent = s.ddIndent = s.tShift[r] + 2, s.tShift[r] = n - s.bMarks[r], s.tight = !0, s.parentType = "deflist", s.parser.tokenize(s, r, t, !0), (!s.tight ||
|
1954
|
+
}), f = s.tight, p = s.ddIndent, u = s.blkIndent, g = s.tShift[r], h = s.parentType, s.blkIndent = s.ddIndent = s.tShift[r] + 2, s.tShift[r] = n - s.bMarks[r], s.tight = !0, s.parentType = "deflist", s.parser.tokenize(s, r, t, !0), (!s.tight || _) && (w = !1), _ = s.line - r > 1 && s.isEmpty(s.line - 1), s.tShift[r] = g, s.tight = f, s.parentType = h, s.blkIndent = u, s.ddIndent = p, s.tokens.push({
|
1955
1955
|
type: "dd_close",
|
1956
1956
|
level: --s.level
|
1957
1957
|
}), a[1] = d = s.line, d >= t || s.tShift[d] < s.blkIndent) break e;
|
@@ -2000,13 +2000,13 @@ function mr(s, e) {
|
|
2000
2000
|
})), !0;
|
2001
2001
|
}
|
2002
2002
|
var Ot = [["code", Qs], ["fences", er, ["paragraph", "blockquote", "list"]], ["blockquote", tr, ["paragraph", "blockquote", "list"]], ["hr", ir, ["paragraph", "blockquote", "list"]], ["list", sr, ["paragraph", "blockquote"]], ["footnote", rr, ["paragraph"]], ["heading", or, ["paragraph", "blockquote"]], ["lheading", ar], ["htmlblock", ur, ["paragraph", "blockquote"]], ["table", hr, ["paragraph"]], ["deflist", fr, ["paragraph"]], ["paragraph", mr]];
|
2003
|
-
function
|
2003
|
+
function Ki() {
|
2004
2004
|
this.ruler = new G();
|
2005
2005
|
for (var s = 0; s < Ot.length; s++) this.ruler.push(Ot[s][0], Ot[s][1], {
|
2006
2006
|
alt: (Ot[s][2] || []).slice()
|
2007
2007
|
});
|
2008
2008
|
}
|
2009
|
-
|
2009
|
+
Ki.prototype.tokenize = function (s, e, t) {
|
2010
2010
|
for (var i = this.ruler.getRules(""), n = i.length, r = e, o = !1, a, l; r < t && (s.line = r = s.skipEmptyLines(r), !(r >= t || s.tShift[r] < s.blkIndent));) {
|
2011
2011
|
for (l = 0; l < n && (a = i[l](s, r, t, !1), !a); l++);
|
2012
2012
|
if (s.tight = !o, s.isEmpty(s.line - 1) && (o = !0), r = s.line, r < t && s.isEmpty(r)) {
|
@@ -2018,7 +2018,7 @@ Wi.prototype.tokenize = function (s, e, t) {
|
|
2018
2018
|
var gr = /[\n\t]/g,
|
2019
2019
|
br = /\r[\n\u0085]|[\u2424\u2028\u0085]/g,
|
2020
2020
|
vr = /\u00a0/g;
|
2021
|
-
|
2021
|
+
Ki.prototype.parse = function (s, e, t, i) {
|
2022
2022
|
var n,
|
2023
2023
|
r = 0,
|
2024
2024
|
o = 0;
|
@@ -2086,18 +2086,18 @@ function Er(s, e) {
|
|
2086
2086
|
for (n++; n < i && s.src.charCodeAt(n) === 32;) n++;
|
2087
2087
|
return s.pos = n, !0;
|
2088
2088
|
}
|
2089
|
-
var
|
2090
|
-
for (var gn = 0; gn < 256; gn++)
|
2089
|
+
var Ji = [];
|
2090
|
+
for (var gn = 0; gn < 256; gn++) Ji.push(0);
|
2091
2091
|
"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function (s) {
|
2092
|
-
|
2092
|
+
Ji[s.charCodeAt(0)] = 1;
|
2093
2093
|
});
|
2094
|
-
function
|
2094
|
+
function _r(s, e) {
|
2095
2095
|
var t,
|
2096
2096
|
i = s.pos,
|
2097
2097
|
n = s.posMax;
|
2098
2098
|
if (s.src.charCodeAt(i) !== 92) return !1;
|
2099
2099
|
if (i++, i < n) {
|
2100
|
-
if (t = s.src.charCodeAt(i), t < 256 &&
|
2100
|
+
if (t = s.src.charCodeAt(i), t < 256 && Ji[t] !== 0) return e || (s.pending += s.src[i]), s.pos += 2, !0;
|
2101
2101
|
if (t === 10) {
|
2102
2102
|
for (e || s.push({
|
2103
2103
|
type: "hardbreak",
|
@@ -2129,7 +2129,7 @@ function wr(s, e) {
|
|
2129
2129
|
}
|
2130
2130
|
return e || (s.pending += n), s.pos += n.length, !0;
|
2131
2131
|
}
|
2132
|
-
function
|
2132
|
+
function Sr(s, e) {
|
2133
2133
|
var t,
|
2134
2134
|
i,
|
2135
2135
|
n,
|
@@ -2297,8 +2297,8 @@ function kr(s, e) {
|
|
2297
2297
|
content: i.replace(Ar, "$1")
|
2298
2298
|
}), s.pos = s.posMax + 1, s.posMax = n, !0);
|
2299
2299
|
}
|
2300
|
-
var
|
2301
|
-
function
|
2300
|
+
var Lr = /\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;
|
2301
|
+
function Ir(s, e) {
|
2302
2302
|
var t,
|
2303
2303
|
i,
|
2304
2304
|
n = s.posMax,
|
@@ -2314,7 +2314,7 @@ function Lr(s, e) {
|
|
2314
2314
|
return !t || r + 1 === s.pos || (i = s.src.slice(r + 1, s.pos), i.match(/(^|[^\\])(\\\\)*\s/)) ? (s.pos = r, !1) : (s.posMax = s.pos, s.pos = r + 1, e || s.push({
|
2315
2315
|
type: "sup",
|
2316
2316
|
level: s.level,
|
2317
|
-
content: i.replace(
|
2317
|
+
content: i.replace(Lr, "$1")
|
2318
2318
|
}), s.pos = s.posMax + 1, s.posMax = n, !0);
|
2319
2319
|
}
|
2320
2320
|
function Rr(s, e) {
|
@@ -2408,7 +2408,7 @@ function Fr(s, e) {
|
|
2408
2408
|
r,
|
2409
2409
|
o,
|
2410
2410
|
a = s.pos;
|
2411
|
-
return s.src.charCodeAt(a) !== 60 || (t = s.src.slice(a), t.indexOf(">") < 0) ? !1 : (i = t.match(jr), i ? Pr.indexOf(i[1].toLowerCase()) < 0 || (r = i[0].slice(1, -1), o =
|
2411
|
+
return s.src.charCodeAt(a) !== 60 || (t = s.src.slice(a), t.indexOf(">") < 0) ? !1 : (i = t.match(jr), i ? Pr.indexOf(i[1].toLowerCase()) < 0 || (r = i[0].slice(1, -1), o = ji(r), !s.parser.validateLink(r)) ? !1 : (e || (s.push({
|
2412
2412
|
type: "link_open",
|
2413
2413
|
href: o,
|
2414
2414
|
level: s.level
|
@@ -2419,7 +2419,7 @@ function Fr(s, e) {
|
|
2419
2419
|
}), s.push({
|
2420
2420
|
type: "link_close",
|
2421
2421
|
level: s.level
|
2422
|
-
})), s.pos += i[0].length, !0) : (n = t.match(Dr), n ? (r = n[0].slice(1, -1), o =
|
2422
|
+
})), s.pos += i[0].length, !0) : (n = t.match(Dr), n ? (r = n[0].slice(1, -1), o = ji("mailto:" + r), s.parser.validateLink(o) ? (e || (s.push({
|
2423
2423
|
type: "link_open",
|
2424
2424
|
href: o,
|
2425
2425
|
level: s.level
|
@@ -2439,9 +2439,9 @@ function ni(s, e) {
|
|
2439
2439
|
}
|
2440
2440
|
var Br = /[a-zA-Z_:][a-zA-Z0-9:._-]*/,
|
2441
2441
|
zr = /[^"'=<>`\x00-\x20]+/,
|
2442
|
-
|
2443
|
-
|
2444
|
-
Hr = ni(/(?:unquoted|single_quoted|double_quoted)/)("unquoted", zr)("single_quoted",
|
2442
|
+
qr = /'[^']*'/,
|
2443
|
+
Ur = /"[^"]*"/,
|
2444
|
+
Hr = ni(/(?:unquoted|single_quoted|double_quoted)/)("unquoted", zr)("single_quoted", qr)("double_quoted", Ur)(),
|
2445
2445
|
Gr = ni(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name", Br)("attr_value", Hr)(),
|
2446
2446
|
Vr = ni(/<[A-Za-z][A-Za-z0-9]*attribute*\s*\/?>/)("attribute", Gr)(),
|
2447
2447
|
Wr = /<\/[A-Za-z][A-Za-z0-9]*\s*>/,
|
@@ -2476,7 +2476,7 @@ function io(s, e) {
|
|
2476
2476
|
if (s.src.charCodeAt(r) !== 38) return !1;
|
2477
2477
|
if (r + 1 < o) {
|
2478
2478
|
if (t = s.src.charCodeAt(r + 1), t === 35) {
|
2479
|
-
if (n = s.src.slice(r).match(eo), n) return e || (i = n[1][0].toLowerCase() === "x" ? parseInt(n[1].slice(1), 16) : parseInt(n[1], 10), s.pending += $n(i) ?
|
2479
|
+
if (n = s.src.slice(r).match(eo), n) return e || (i = n[1][0].toLowerCase() === "x" ? parseInt(n[1].slice(1), 16) : parseInt(n[1], 10), s.pending += $n(i) ? Di(i) : Di(65533)), s.pos += n[0].length, !0;
|
2480
2480
|
} else if (n = s.src.slice(r).match(to), n) {
|
2481
2481
|
var a = Kn(n[1]);
|
2482
2482
|
if (n[1] !== a) return e || (s.pending += a), s.pos += n[0].length, !0;
|
@@ -2484,10 +2484,10 @@ function io(s, e) {
|
|
2484
2484
|
}
|
2485
2485
|
return e || (s.pending += "&"), s.pos++, !0;
|
2486
2486
|
}
|
2487
|
-
var
|
2487
|
+
var Ai = [["text", xr], ["newline", Er], ["escape", _r], ["backticks", wr], ["del", Sr], ["ins", Mr], ["mark", Tr], ["emphasis", Cr], ["sub", kr], ["sup", Ir], ["links", Rr], ["footnote_inline", Nr], ["footnote_ref", Or], ["autolink", Fr], ["htmltag", Qr], ["entity", io]];
|
2488
2488
|
function si() {
|
2489
2489
|
this.ruler = new G();
|
2490
|
-
for (var s = 0; s <
|
2490
|
+
for (var s = 0; s < Ai.length; s++) this.ruler.push(Ai[s][0], Ai[s][1]);
|
2491
2491
|
this.validateLink = no;
|
2492
2492
|
}
|
2493
2493
|
si.prototype.skipToken = function (s) {
|
@@ -2644,7 +2644,7 @@ function is(s, e, t) {
|
|
2644
2644
|
this.src = e, this.env = t, this.options = s.options, this.tokens = [], this.inlineMode = !1, this.inline = s.inline, this.block = s.block, this.renderer = s.renderer, this.typographer = s.typographer;
|
2645
2645
|
}
|
2646
2646
|
function he(s, e) {
|
2647
|
-
typeof s != "string" && (e = s, s = "default"), e && e.linkify != null && console.warn("linkify option is removed. Use linkify plugin instead:\n\nimport Remarkable from 'remarkable';\nimport linkify from 'remarkable/linkify';\nnew Remarkable().use(linkify)\n"), this.inline = new si(), this.block = new
|
2647
|
+
typeof s != "string" && (e = s, s = "default"), e && e.linkify != null && console.warn("linkify option is removed. Use linkify plugin instead:\n\nimport Remarkable from 'remarkable';\nimport linkify from 'remarkable/linkify';\nnew Remarkable().use(linkify)\n"), this.inline = new si(), this.block = new Ki(), this.core = new es(), this.renderer = new Wi(), this.ruler = new G(), this.options = {}, this.configure(ao[s]), this.set(e || {});
|
2648
2648
|
}
|
2649
2649
|
he.prototype.set = function (s) {
|
2650
2650
|
Jn(this.options, s);
|
@@ -2795,7 +2795,7 @@ var ns = /*#__PURE__*/function () {
|
|
2795
2795
|
return Ge;
|
2796
2796
|
}();
|
2797
2797
|
ns.DEFAULT_FILE_NAME = "file";
|
2798
|
-
var
|
2798
|
+
var se = ns;
|
2799
2799
|
var Bt = /*#__PURE__*/function () {
|
2800
2800
|
function Bt() {
|
2801
2801
|
_classCallCheck(this, Bt);
|
@@ -2808,7 +2808,7 @@ var Bt = /*#__PURE__*/function () {
|
|
2808
2808
|
message: t,
|
2809
2809
|
isInitial: i
|
2810
2810
|
}));
|
2811
|
-
|
2811
|
+
se.reAddFileRefToObject(t, n), (r = e.onNewMessage) == null || r.call(e, n), e.dispatchEvent(new CustomEvent("new-message", {
|
2812
2812
|
detail: n
|
2813
2813
|
}));
|
2814
2814
|
}
|
@@ -2822,7 +2822,9 @@ var Bt = /*#__PURE__*/function () {
|
|
2822
2822
|
key: "onRender",
|
2823
2823
|
value: function onRender(e) {
|
2824
2824
|
var t;
|
2825
|
-
(t = e.onComponentRender) == null || t.call(e), e.dispatchEvent(new CustomEvent("render"
|
2825
|
+
(t = e.onComponentRender) == null || t.call(e, e), e.dispatchEvent(new CustomEvent("render", {
|
2826
|
+
detail: e
|
2827
|
+
}));
|
2826
2828
|
}
|
2827
2829
|
}, {
|
2828
2830
|
key: "onError",
|
@@ -3112,7 +3114,7 @@ var $e = /*#__PURE__*/function () {
|
|
3112
3114
|
}]);
|
3113
3115
|
return $e;
|
3114
3116
|
}();
|
3115
|
-
var
|
3117
|
+
var $i = /*#__PURE__*/function () {
|
3116
3118
|
// used for extracting at end and for isStreaming
|
3117
3119
|
function ot(e) {
|
3118
3120
|
_classCallCheck(this, ot);
|
@@ -3171,14 +3173,14 @@ var Ji = /*#__PURE__*/function () {
|
|
3171
3173
|
var n = {
|
3172
3174
|
role: this._activeMessageRole || v.AI_ROLE
|
3173
3175
|
};
|
3174
|
-
this._streamType === "text" ? (e[e.length - 1][1] = this._streamedContent, n.text = this._streamedContent, this._messages.textToSpeech && jt.speak(this._streamedContent, this._messages.textToSpeech)) : this._streamType === "html" && (this._streamedContent === ot.HTML_CONTENT_PLACEHOLDER && (this._streamedContent = ((o = v.getLastMessageBubbleElement(t)) == null ? void 0 : o.innerHTML) || ""), this._elements &&
|
3176
|
+
this._streamType === "text" ? (e[e.length - 1][1] = this._streamedContent, n.text = this._streamedContent, this._messages.textToSpeech && jt.speak(this._streamedContent, this._messages.textToSpeech)) : this._streamType === "html" && (this._streamedContent === ot.HTML_CONTENT_PLACEHOLDER && (this._streamedContent = ((o = v.getLastMessageBubbleElement(t)) == null ? void 0 : o.innerHTML) || ""), this._elements && re.apply(this._messages, this._elements.outerContainer), n.html = this._streamedContent), n && (this._messages.messages.push(n), this._messages.sendClientUpdate($e.createMessageContent(n), !1)), this._hasStreamEnded = !0;
|
3175
3177
|
}
|
3176
3178
|
}]);
|
3177
3179
|
return ot;
|
3178
3180
|
}();
|
3179
|
-
|
3180
|
-
|
3181
|
-
var Qe =
|
3181
|
+
$i.MESSAGE_CLASS = "streamed-message";
|
3182
|
+
$i.HTML_CONTENT_PLACEHOLDER = "htmlplaceholder";
|
3183
|
+
var Qe = $i;
|
3182
3184
|
var ss = /*#__PURE__*/function () {
|
3183
3185
|
function at() {
|
3184
3186
|
_classCallCheck(this, at);
|
@@ -3313,29 +3315,29 @@ function uo(_x10, _x11) {
|
|
3313
3315
|
return _uo.apply(this, arguments);
|
3314
3316
|
}
|
3315
3317
|
function _uo() {
|
3316
|
-
_uo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
3318
|
+
_uo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee107(s, e) {
|
3317
3319
|
var t, i;
|
3318
|
-
return _regeneratorRuntime().wrap(function
|
3319
|
-
while (1) switch (
|
3320
|
+
return _regeneratorRuntime().wrap(function _callee107$(_context107) {
|
3321
|
+
while (1) switch (_context107.prev = _context107.next) {
|
3320
3322
|
case 0:
|
3321
3323
|
t = s.getReader();
|
3322
3324
|
case 1:
|
3323
|
-
|
3325
|
+
_context107.next = 3;
|
3324
3326
|
return t.read();
|
3325
3327
|
case 3:
|
3326
|
-
if ((i =
|
3327
|
-
|
3328
|
+
if ((i = _context107.sent).done) {
|
3329
|
+
_context107.next = 7;
|
3328
3330
|
break;
|
3329
3331
|
}
|
3330
3332
|
e(i.value);
|
3331
3333
|
case 5:
|
3332
|
-
|
3334
|
+
_context107.next = 1;
|
3333
3335
|
break;
|
3334
3336
|
case 7:
|
3335
3337
|
case "end":
|
3336
|
-
return
|
3338
|
+
return _context107.stop();
|
3337
3339
|
}
|
3338
|
-
},
|
3340
|
+
}, _callee107);
|
3339
3341
|
}));
|
3340
3342
|
return _uo.apply(this, arguments);
|
3341
3343
|
}
|
@@ -3411,7 +3413,7 @@ var mo = globalThis && globalThis.__rest || function (s, e) {
|
|
3411
3413
|
if (s != null && typeof Object.getOwnPropertySymbols == "function") for (var n = 0, i = Object.getOwnPropertySymbols(s); n < i.length; n++) e.indexOf(i[n]) < 0 && Object.prototype.propertyIsEnumerable.call(s, i[n]) && (t[i[n]] = s[i[n]]);
|
3412
3414
|
return t;
|
3413
3415
|
};
|
3414
|
-
var
|
3416
|
+
var Fi = "text/event-stream",
|
3415
3417
|
go = 1e3,
|
3416
3418
|
xn = "last-event-id";
|
3417
3419
|
function bo(s, e) {
|
@@ -3426,13 +3428,13 @@ function bo(s, e) {
|
|
3426
3428
|
d = mo(e, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
3427
3429
|
return new Promise(function (u, p) {
|
3428
3430
|
var h = Object.assign({}, i);
|
3429
|
-
h.accept || (h.accept =
|
3431
|
+
h.accept || (h.accept = Fi);
|
3430
3432
|
var g;
|
3431
3433
|
function f() {
|
3432
3434
|
g.abort(), document.hidden || Q();
|
3433
3435
|
}
|
3434
3436
|
l || document.addEventListener("visibilitychange", f);
|
3435
|
-
var
|
3437
|
+
var _ = go,
|
3436
3438
|
w = 0;
|
3437
3439
|
function V() {
|
3438
3440
|
document.removeEventListener("visibilitychange", f), window.clearTimeout(w), g.abort();
|
@@ -3447,7 +3449,7 @@ function bo(s, e) {
|
|
3447
3449
|
}
|
3448
3450
|
function _Q() {
|
3449
3451
|
_Q = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
3450
|
-
var
|
3452
|
+
var ae, U, O;
|
3451
3453
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
3452
3454
|
while (1) switch (_context3.prev = _context3.next) {
|
3453
3455
|
case 0:
|
@@ -3459,15 +3461,15 @@ function bo(s, e) {
|
|
3459
3461
|
signal: g.signal
|
3460
3462
|
}));
|
3461
3463
|
case 4:
|
3462
|
-
|
3464
|
+
U = _context3.sent;
|
3463
3465
|
_context3.next = 7;
|
3464
|
-
return W(
|
3466
|
+
return W(U);
|
3465
3467
|
case 7:
|
3466
3468
|
_context3.next = 9;
|
3467
|
-
return uo(
|
3469
|
+
return uo(U.body, ho(po(function (O) {
|
3468
3470
|
O ? h[xn] = O : delete h[xn];
|
3469
3471
|
}, function (O) {
|
3470
|
-
|
3472
|
+
_ = O;
|
3471
3473
|
}, r)));
|
3472
3474
|
case 9:
|
3473
3475
|
o == null || o();
|
@@ -3479,7 +3481,7 @@ function bo(s, e) {
|
|
3479
3481
|
_context3.prev = 14;
|
3480
3482
|
_context3.t0 = _context3["catch"](1);
|
3481
3483
|
if (!g.signal.aborted) try {
|
3482
|
-
O = (
|
3484
|
+
O = (ae = a == null ? void 0 : a(_context3.t0)) !== null && ae !== void 0 ? ae : _;
|
3483
3485
|
window.clearTimeout(w), w = window.setTimeout(Q, O);
|
3484
3486
|
} catch (O) {
|
3485
3487
|
V(), p(O);
|
@@ -3497,7 +3499,7 @@ function bo(s, e) {
|
|
3497
3499
|
}
|
3498
3500
|
function vo(s) {
|
3499
3501
|
var e = s.headers.get("content-type");
|
3500
|
-
if (!(e != null && e.startsWith(
|
3502
|
+
if (!(e != null && e.startsWith(Fi))) throw new Error("Expected content-type to be ".concat(Fi, ", Actual: ").concat(e));
|
3501
3503
|
}
|
3502
3504
|
var rs = /*#__PURE__*/function () {
|
3503
3505
|
function lt() {
|
@@ -3551,7 +3553,7 @@ var rs = /*#__PURE__*/function () {
|
|
3551
3553
|
_context4.t0 = i;
|
3552
3554
|
case 5:
|
3553
3555
|
n = _context4.t0;
|
3554
|
-
n.error ? (t.addNewErrorMessage("service", n.error), e.completionsHandlers.onFinish()) :
|
3556
|
+
n.error ? (t.addNewErrorMessage("service", n.error), e.completionsHandlers.onFinish()) : L.isSimulation(e.deepChat.stream) ? L.simulate(t, e.streamHandlers, n) : (t.addNewMessage(n), e.completionsHandlers.onFinish());
|
3555
3557
|
case 7:
|
3556
3558
|
case "end":
|
3557
3559
|
return _context4.stop();
|
@@ -3565,7 +3567,7 @@ var rs = /*#__PURE__*/function () {
|
|
3565
3567
|
value: function requestStream(e, t) {
|
3566
3568
|
setTimeout(function () {
|
3567
3569
|
var i = lt.getResponse(e);
|
3568
|
-
|
3570
|
+
L.simulate(e, t, i);
|
3569
3571
|
}, 400);
|
3570
3572
|
}
|
3571
3573
|
}]);
|
@@ -3573,11 +3575,11 @@ var rs = /*#__PURE__*/function () {
|
|
3573
3575
|
}();
|
3574
3576
|
rs.URL = "deep-chat-demo";
|
3575
3577
|
var ye = rs;
|
3576
|
-
var
|
3577
|
-
function
|
3578
|
-
_classCallCheck(this,
|
3578
|
+
var L = /*#__PURE__*/function () {
|
3579
|
+
function L() {
|
3580
|
+
_classCallCheck(this, L);
|
3579
3581
|
}
|
3580
|
-
_createClass(
|
3582
|
+
_createClass(L, null, [{
|
3581
3583
|
key: "request",
|
3582
3584
|
value: // prettier-ignore
|
3583
3585
|
function () {
|
@@ -3586,7 +3588,7 @@ var I = /*#__PURE__*/function () {
|
|
3586
3588
|
h,
|
3587
3589
|
g,
|
3588
3590
|
f,
|
3589
|
-
|
3591
|
+
_,
|
3590
3592
|
w,
|
3591
3593
|
V,
|
3592
3594
|
r,
|
@@ -3629,7 +3631,7 @@ var I = /*#__PURE__*/function () {
|
|
3629
3631
|
_context7.next = 16;
|
3630
3632
|
break;
|
3631
3633
|
}
|
3632
|
-
return _context7.abrupt("return",
|
3634
|
+
return _context7.abrupt("return", Le.stream(e, o, i));
|
3633
3635
|
case 16:
|
3634
3636
|
if (!(((f = e.requestSettings) == null ? void 0 : f.url) === ye.URL)) {
|
3635
3637
|
_context7.next = 18;
|
@@ -3638,7 +3640,7 @@ var I = /*#__PURE__*/function () {
|
|
3638
3640
|
return _context7.abrupt("return", ye.requestStream(i, e.streamHandlers));
|
3639
3641
|
case 18:
|
3640
3642
|
p = new Qe(i);
|
3641
|
-
bo(((
|
3643
|
+
bo(((_ = e.requestSettings) == null ? void 0 : _.url) || e.url || "", {
|
3642
3644
|
method: ((w = e.requestSettings) == null ? void 0 : w.method) || "POST",
|
3643
3645
|
headers: a,
|
3644
3646
|
credentials: (V = e.requestSettings) == null ? void 0 : V.credentials,
|
@@ -3669,7 +3671,7 @@ var I = /*#__PURE__*/function () {
|
|
3669
3671
|
},
|
3670
3672
|
onmessage: function onmessage(A) {
|
3671
3673
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
3672
|
-
var W, Q,
|
3674
|
+
var W, Q, ae, U, O;
|
3673
3675
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
3674
3676
|
while (1) switch (_context6.prev = _context6.next) {
|
3675
3677
|
case 0:
|
@@ -3678,22 +3680,22 @@ var I = /*#__PURE__*/function () {
|
|
3678
3680
|
break;
|
3679
3681
|
}
|
3680
3682
|
try {
|
3681
|
-
|
3683
|
+
U = JSON.parse(A.data);
|
3682
3684
|
} catch (_unused6) {
|
3683
|
-
|
3685
|
+
U = {};
|
3684
3686
|
}
|
3685
3687
|
_context6.next = 4;
|
3686
|
-
return (Q = (W = e.deepChat).responseInterceptor) == null ? void 0 : Q.call(W,
|
3688
|
+
return (Q = (W = e.deepChat).responseInterceptor) == null ? void 0 : Q.call(W, U);
|
3687
3689
|
case 4:
|
3688
3690
|
_context6.t0 = _context6.sent;
|
3689
3691
|
if (_context6.t0) {
|
3690
3692
|
_context6.next = 7;
|
3691
3693
|
break;
|
3692
3694
|
}
|
3693
|
-
_context6.t0 =
|
3695
|
+
_context6.t0 = U;
|
3694
3696
|
case 7:
|
3695
3697
|
O = _context6.t0;
|
3696
|
-
(
|
3698
|
+
(ae = e.extractResultData) == null || ae.call(e, O).then(function (Ee) {
|
3697
3699
|
p.upsertStreamedMessage(Ee);
|
3698
3700
|
})["catch"](function (Ee) {
|
3699
3701
|
return E.displayError(i, Ee);
|
@@ -3741,7 +3743,7 @@ var I = /*#__PURE__*/function () {
|
|
3741
3743
|
}, i), !1), i.text) {
|
3742
3744
|
t.onOpen();
|
3743
3745
|
var r = i.text.split("");
|
3744
|
-
|
3746
|
+
L.populateMessages(r, new Qe(e), n);
|
3745
3747
|
}
|
3746
3748
|
}
|
3747
3749
|
}, {
|
@@ -3754,10 +3756,10 @@ var I = /*#__PURE__*/function () {
|
|
3754
3756
|
text: r
|
3755
3757
|
});
|
3756
3758
|
var o = setTimeout(function () {
|
3757
|
-
|
3759
|
+
L.populateMessages(e, t, i, n + 1);
|
3758
3760
|
}, i.simulationInterim || 6);
|
3759
3761
|
i.abortStream.abort = function () {
|
3760
|
-
|
3762
|
+
L.abort(o, t, i.onClose);
|
3761
3763
|
};
|
3762
3764
|
} else t.finaliseStreamedMessage(), i.onClose();
|
3763
3765
|
}
|
@@ -3772,13 +3774,13 @@ var I = /*#__PURE__*/function () {
|
|
3772
3774
|
clearTimeout(e), t.finaliseStreamedMessage(), i();
|
3773
3775
|
}
|
3774
3776
|
}]);
|
3775
|
-
return
|
3777
|
+
return L;
|
3776
3778
|
}();
|
3777
|
-
var
|
3778
|
-
function
|
3779
|
-
_classCallCheck(this,
|
3779
|
+
var Le = /*#__PURE__*/function () {
|
3780
|
+
function Le() {
|
3781
|
+
_classCallCheck(this, Le);
|
3780
3782
|
}
|
3781
|
-
_createClass(
|
3783
|
+
_createClass(Le, null, [{
|
3782
3784
|
key: "request",
|
3783
3785
|
value: function () {
|
3784
3786
|
var _request2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(e, t, i) {
|
@@ -3811,7 +3813,7 @@ var Ie = /*#__PURE__*/function () {
|
|
3811
3813
|
_context8.t0 = c;
|
3812
3814
|
case 8:
|
3813
3815
|
d = _context8.t0;
|
3814
|
-
E.validateResponseFormat(d) ? typeof d.error == "string" ? (console.error(d.error), i.addNewErrorMessage("service", d.error), e.completionsHandlers.onFinish()) :
|
3816
|
+
E.validateResponseFormat(d) ? typeof d.error == "string" ? (console.error(d.error), i.addNewErrorMessage("service", d.error), e.completionsHandlers.onFinish()) : L.isSimulation(e.deepChat.stream) ? L.simulate(i, e.streamHandlers, d) : (i.addNewMessage(d), e.completionsHandlers.onFinish()) : (console.error(C.INVALID_RESPONSE(c, "server", !!e.deepChat.responseInterceptor, d)), i.addNewErrorMessage("service", "Error in server message"), e.completionsHandlers.onFinish());
|
3815
3817
|
case 10:
|
3816
3818
|
case "end":
|
3817
3819
|
return _context8.stop();
|
@@ -3821,7 +3823,7 @@ var Ie = /*#__PURE__*/function () {
|
|
3821
3823
|
return function r(_x18) {
|
3822
3824
|
return _ref2.apply(this, arguments);
|
3823
3825
|
};
|
3824
|
-
}(), o =
|
3826
|
+
}(), o = Le.generateOptionalSignals();
|
3825
3827
|
(l = (a = e.requestSettings).handler) == null || l.call(a, t, _objectSpread(_objectSpread({}, o), {}, {
|
3826
3828
|
onResponse: r
|
3827
3829
|
}));
|
@@ -3855,7 +3857,7 @@ var Ie = /*#__PURE__*/function () {
|
|
3855
3857
|
e.streamHandlers.abortStream.abort = function () {
|
3856
3858
|
o.finaliseStreamedMessage(), e.streamHandlers.onClose(), n = !1;
|
3857
3859
|
};
|
3858
|
-
var d =
|
3860
|
+
var d = Le.generateOptionalSignals();
|
3859
3861
|
(p = (u = e.requestSettings).handler) == null || p.call(u, t, _objectSpread(_objectSpread({}, d), {}, {
|
3860
3862
|
onOpen: a,
|
3861
3863
|
onResponse: c,
|
@@ -3904,7 +3906,7 @@ var Ie = /*#__PURE__*/function () {
|
|
3904
3906
|
_context10.t0 = d;
|
3905
3907
|
case 7:
|
3906
3908
|
u = _context10.t0;
|
3907
|
-
E.validateResponseFormat(u) ? typeof u.error == "string" ? (console.error(u.error), t.isLastMessageError() || t.addNewErrorMessage("service", u.error)) : e.deepChat.stream ?
|
3909
|
+
E.validateResponseFormat(u) ? typeof u.error == "string" ? (console.error(u.error), t.isLastMessageError() || t.addNewErrorMessage("service", u.error)) : e.deepChat.stream ? L.simulate(t, e.streamHandlers, u) : t.addNewMessage(u) : (console.error(C.INVALID_RESPONSE(d, "server", !!e.deepChat.responseInterceptor, u)), t.addNewErrorMessage("service", "Error in server message"));
|
3908
3910
|
case 9:
|
3909
3911
|
case "end":
|
3910
3912
|
return _context10.stop();
|
@@ -3915,7 +3917,7 @@ var Ie = /*#__PURE__*/function () {
|
|
3915
3917
|
return _ref3.apply(this, arguments);
|
3916
3918
|
};
|
3917
3919
|
}(),
|
3918
|
-
a =
|
3920
|
+
a = Le.generateOptionalSignals();
|
3919
3921
|
(c = (l = e.requestSettings).handler) == null || c.call(l, void 0, _objectSpread(_objectSpread({}, a), {}, {
|
3920
3922
|
onOpen: n,
|
3921
3923
|
onResponse: o,
|
@@ -3938,13 +3940,13 @@ var Ie = /*#__PURE__*/function () {
|
|
3938
3940
|
};
|
3939
3941
|
}
|
3940
3942
|
}]);
|
3941
|
-
return
|
3943
|
+
return Le;
|
3942
3944
|
}();
|
3943
|
-
var
|
3944
|
-
function
|
3945
|
-
_classCallCheck(this,
|
3945
|
+
var S = /*#__PURE__*/function () {
|
3946
|
+
function S() {
|
3947
|
+
_classCallCheck(this, S);
|
3946
3948
|
}
|
3947
|
-
_createClass(
|
3949
|
+
_createClass(S, null, [{
|
3948
3950
|
key: "request",
|
3949
3951
|
value: // prettier-ignore
|
3950
3952
|
function () {
|
@@ -3988,7 +3990,7 @@ var _ = /*#__PURE__*/function () {
|
|
3988
3990
|
_context12.next = 13;
|
3989
3991
|
break;
|
3990
3992
|
}
|
3991
|
-
return _context12.abrupt("return",
|
3993
|
+
return _context12.abrupt("return", Le.request(e, o, i));
|
3992
3994
|
case 13:
|
3993
3995
|
if (!(((g = e.requestSettings) == null ? void 0 : g.url) === ye.URL)) {
|
3994
3996
|
_context12.next = 15;
|
@@ -4004,7 +4006,7 @@ var _ = /*#__PURE__*/function () {
|
|
4004
4006
|
return E.processResponseByType(f);
|
4005
4007
|
}).then( /*#__PURE__*/function () {
|
4006
4008
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(f) {
|
4007
|
-
var V, A,
|
4009
|
+
var V, A, _, w;
|
4008
4010
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
4009
4011
|
while (1) switch (_context11.prev = _context11.next) {
|
4010
4012
|
case 0:
|
@@ -4024,9 +4026,9 @@ var _ = /*#__PURE__*/function () {
|
|
4024
4026
|
}
|
4025
4027
|
_context11.t0 = f;
|
4026
4028
|
case 7:
|
4027
|
-
|
4029
|
+
_ = _context11.t0;
|
4028
4030
|
_context11.next = 10;
|
4029
|
-
return e.extractResultData(
|
4031
|
+
return e.extractResultData(_, u, o);
|
4030
4032
|
case 10:
|
4031
4033
|
w = _context11.sent;
|
4032
4034
|
if (d) {
|
@@ -4039,9 +4041,9 @@ var _ = /*#__PURE__*/function () {
|
|
4039
4041
|
_context11.next = 15;
|
4040
4042
|
break;
|
4041
4043
|
}
|
4042
|
-
throw Error(C.INVALID_RESPONSE(f, "response", !!e.deepChat.responseInterceptor,
|
4044
|
+
throw Error(C.INVALID_RESPONSE(f, "response", !!e.deepChat.responseInterceptor, _));
|
4043
4045
|
case 15:
|
4044
|
-
w.makingAnotherRequest || (
|
4046
|
+
w.makingAnotherRequest || (L.isSimulation(e.deepChat.stream) ? L.simulate(i, e.streamHandlers, w) : (i.addNewMessage(w), c()));
|
4045
4047
|
case 16:
|
4046
4048
|
case "end":
|
4047
4049
|
return _context11.stop();
|
@@ -4100,8 +4102,8 @@ var _ = /*#__PURE__*/function () {
|
|
4100
4102
|
case 11:
|
4101
4103
|
a = _context13.sent;
|
4102
4104
|
a.timeoutMS ? setTimeout(function () {
|
4103
|
-
|
4104
|
-
}, a.timeoutMS) :
|
4105
|
+
S.executePollRequest(e, t, i, n);
|
4106
|
+
}, a.timeoutMS) : L.isSimulation(e.deepChat.stream) ? L.simulate(n, e.streamHandlers, a) : (n.addNewMessage(a), r());
|
4105
4107
|
case 13:
|
4106
4108
|
case "end":
|
4107
4109
|
return _context13.stop();
|
@@ -4160,7 +4162,7 @@ var _ = /*#__PURE__*/function () {
|
|
4160
4162
|
body: u,
|
4161
4163
|
headers: a
|
4162
4164
|
};
|
4163
|
-
e.requestSettings.credentials && (p.credentials = e.requestSettings.credentials),
|
4165
|
+
e.requestSettings.credentials && (p.credentials = e.requestSettings.credentials), S.executePollRequest(e, c, p, i);
|
4164
4166
|
case 12:
|
4165
4167
|
case "end":
|
4166
4168
|
return _context14.stop();
|
@@ -4189,7 +4191,7 @@ var _ = /*#__PURE__*/function () {
|
|
4189
4191
|
});
|
4190
4192
|
}
|
4191
4193
|
}]);
|
4192
|
-
return
|
4194
|
+
return S;
|
4193
4195
|
}();
|
4194
4196
|
var et = /*#__PURE__*/function () {
|
4195
4197
|
function et() {
|
@@ -4243,7 +4245,7 @@ var Y = /*#__PURE__*/function () {
|
|
4243
4245
|
if (!document.body.contains(e.deepChat)) return;
|
4244
4246
|
var i = e.requestSettings.websocket;
|
4245
4247
|
if (i) {
|
4246
|
-
if (e.requestSettings.handler) return
|
4248
|
+
if (e.requestSettings.handler) return Le.websocket(e, t);
|
4247
4249
|
try {
|
4248
4250
|
var n = typeof i != "boolean" ? i : void 0,
|
4249
4251
|
r = new WebSocket(e.requestSettings.url || "", n);
|
@@ -4302,7 +4304,7 @@ var Y = /*#__PURE__*/function () {
|
|
4302
4304
|
}
|
4303
4305
|
throw Error(C.INVALID_RESPONSE(a, "server", !!e.deepChat.responseInterceptor, l));
|
4304
4306
|
case 14:
|
4305
|
-
|
4307
|
+
L.isSimulation(e.deepChat.stream) ? L.simulate(i, e.streamHandlers, c) : i.addNewMessage(c);
|
4306
4308
|
_context15.next = 20;
|
4307
4309
|
break;
|
4308
4310
|
case 17:
|
@@ -4402,11 +4404,11 @@ var Y = /*#__PURE__*/function () {
|
|
4402
4404
|
}]);
|
4403
4405
|
return Y;
|
4404
4406
|
}();
|
4405
|
-
var
|
4406
|
-
function
|
4407
|
-
_classCallCheck(this,
|
4407
|
+
var I = /*#__PURE__*/function () {
|
4408
|
+
function I() {
|
4409
|
+
_classCallCheck(this, I);
|
4408
4410
|
}
|
4409
|
-
_createClass(
|
4411
|
+
_createClass(I, null, [{
|
4410
4412
|
key: "parseConfig",
|
4411
4413
|
value:
|
4412
4414
|
// prettier-ignore
|
@@ -4435,7 +4437,7 @@ var L = /*#__PURE__*/function () {
|
|
4435
4437
|
var n = {
|
4436
4438
|
acceptedFormats: ""
|
4437
4439
|
};
|
4438
|
-
e.fileTypes.mixedFiles =
|
4440
|
+
e.fileTypes.mixedFiles = I.parseConfig(e.requestSettings, n, t, i);
|
4439
4441
|
}
|
4440
4442
|
}
|
4441
4443
|
// needs to be set after audio to overwrite maxNumberOfFiles
|
@@ -4448,7 +4450,7 @@ var L = /*#__PURE__*/function () {
|
|
4448
4450
|
var o = _objectSpread({
|
4449
4451
|
acceptedFormats: "audio/*"
|
4450
4452
|
}, ((a = e.fileTypes.audio) == null ? void 0 : a.files) || {});
|
4451
|
-
i && (navigator.mediaDevices.getUserMedia !== void 0 ? (e.recordAudio =
|
4453
|
+
i && (navigator.mediaDevices.getUserMedia !== void 0 ? (e.recordAudio = I.parseConfig(e.requestSettings, o, t, i), _typeof(i) == "object" && i.files && ((_l$files = (l = e.recordAudio).files) !== null && _l$files !== void 0 ? _l$files : l.files = {}, e.recordAudio.files.format = (c = i.files) == null ? void 0 : c.format, e.recordAudio.files.maxDurationSeconds = (d = i.files) == null ? void 0 : d.maxDurationSeconds, (u = e.fileTypes.audio) != null && u.files && ((_p$maxNumberOfFiles = (p = e.fileTypes.audio.files).maxNumberOfFiles) !== null && _p$maxNumberOfFiles !== void 0 ? _p$maxNumberOfFiles : p.maxNumberOfFiles = i.files.maxNumberOfFiles))) : n || (e.fileTypes.audio = I.parseConfig(e.requestSettings, o, t, i)));
|
4452
4454
|
}
|
4453
4455
|
// prettier-ignore
|
4454
4456
|
}, {
|
@@ -4458,7 +4460,7 @@ var L = /*#__PURE__*/function () {
|
|
4458
4460
|
var o = _objectSpread({
|
4459
4461
|
acceptedFormats: "audio/*"
|
4460
4462
|
}, (n == null ? void 0 : n.files) || {});
|
4461
|
-
e.fileTypes.audio =
|
4463
|
+
e.fileTypes.audio = I.parseConfig(e.requestSettings, o, t, i);
|
4462
4464
|
}
|
4463
4465
|
// prettier-ignore
|
4464
4466
|
}, {
|
@@ -4468,7 +4470,7 @@ var L = /*#__PURE__*/function () {
|
|
4468
4470
|
var o = _objectSpread({
|
4469
4471
|
acceptedFormats: "image/gif"
|
4470
4472
|
}, (n == null ? void 0 : n.files) || {});
|
4471
|
-
e.fileTypes.gifs =
|
4473
|
+
e.fileTypes.gifs = I.parseConfig(e.requestSettings, o, t, i);
|
4472
4474
|
}
|
4473
4475
|
// needs to be set after images to overwrite maxNumberOfFiles
|
4474
4476
|
// prettier-ignore
|
@@ -4480,7 +4482,7 @@ var L = /*#__PURE__*/function () {
|
|
4480
4482
|
var o = _objectSpread({
|
4481
4483
|
acceptedFormats: "image/*"
|
4482
4484
|
}, ((a = e.fileTypes.images) == null ? void 0 : a.files) || {});
|
4483
|
-
i && (navigator.mediaDevices.getUserMedia !== void 0 ? (e.camera =
|
4485
|
+
i && (navigator.mediaDevices.getUserMedia !== void 0 ? (e.camera = I.parseConfig(e.requestSettings, o, t, i), _typeof(i) == "object" && (e.camera.modalContainerStyle = i.modalContainerStyle, i.files && ((_l$files2 = (l = e.camera).files) !== null && _l$files2 !== void 0 ? _l$files2 : l.files = {}, e.camera.files.format = (c = i.files) == null ? void 0 : c.format, e.camera.files.dimensions = (d = i.files) == null ? void 0 : d.dimensions))) : n || (e.fileTypes.images = I.parseConfig(e.requestSettings, o, t, i)));
|
4484
4486
|
}
|
4485
4487
|
// prettier-ignore
|
4486
4488
|
}, {
|
@@ -4490,7 +4492,7 @@ var L = /*#__PURE__*/function () {
|
|
4490
4492
|
var o = _objectSpread({
|
4491
4493
|
acceptedFormats: "image/*"
|
4492
4494
|
}, (n == null ? void 0 : n.files) || {});
|
4493
|
-
e.fileTypes.images =
|
4495
|
+
e.fileTypes.images = I.parseConfig(e.requestSettings, o, t, i);
|
4494
4496
|
}
|
4495
4497
|
// default for direct service
|
4496
4498
|
}, {
|
@@ -4503,19 +4505,19 @@ var L = /*#__PURE__*/function () {
|
|
4503
4505
|
}, {
|
4504
4506
|
key: "set",
|
4505
4507
|
value: function set(e, t, i) {
|
4506
|
-
|
4508
|
+
I.populateDefaultFileIO(i == null ? void 0 : i.audio, ".4a,.mp3,.webm,.mp4,.mpga,.wav,.mpeg,.m4a"), I.populateDefaultFileIO(i == null ? void 0 : i.images, ".png,.jpg");
|
4507
4509
|
var n = vt.createNew();
|
4508
|
-
|
4510
|
+
I.processImagesConfig(t, n, e.images, i == null ? void 0 : i.images), I.processCamera(t, n, e.camera, e.images), I.processGifConfig(t, n, e.gifs, i == null ? void 0 : i.gifs), I.processAudioConfig(t, n, e.audio, i == null ? void 0 : i.audio), I.processMicrophone(t, n, e.microphone, e.audio), I.processMixedFiles(t, n, e.mixedFiles);
|
4509
4511
|
}
|
4510
4512
|
}]);
|
4511
|
-
return
|
4513
|
+
return I;
|
4512
4514
|
}();
|
4513
4515
|
var Ne = /*#__PURE__*/function () {
|
4514
4516
|
function Ne(e, t, i) {
|
4515
4517
|
var _a$url;
|
4516
4518
|
_classCallCheck(this, Ne);
|
4517
4519
|
var n, r, o, a;
|
4518
|
-
this.rawBody = {}, this.validateConfigKey = !1, this.canSendMessage = Ne.canSendMessage, this.requestSettings = {}, this.fileTypes = {}, this.completionsHandlers = {}, this.streamHandlers = {}, this.deepChat = e, this.demo = i, Object.assign(this.rawBody, (n = e.request) == null ? void 0 : n.additionalBodyProps), this.totalMessagesMaxCharLength = (r = e == null ? void 0 : e.requestBodyLimits) == null ? void 0 : r.totalMessagesMaxCharLength, this.maxMessages = (o = e == null ? void 0 : e.requestBodyLimits) == null ? void 0 : o.maxMessages,
|
4520
|
+
this.rawBody = {}, this.validateConfigKey = !1, this.canSendMessage = Ne.canSendMessage, this.requestSettings = {}, this.fileTypes = {}, this.completionsHandlers = {}, this.streamHandlers = {}, this.deepChat = e, this.demo = i, Object.assign(this.rawBody, (n = e.request) == null ? void 0 : n.additionalBodyProps), this.totalMessagesMaxCharLength = (r = e == null ? void 0 : e.requestBodyLimits) == null ? void 0 : r.totalMessagesMaxCharLength, this.maxMessages = (o = e == null ? void 0 : e.requestBodyLimits) == null ? void 0 : o.maxMessages, I.set(e, this, t), e.request && (this.requestSettings = e.request), this.demo && ((_a$url = (a = this.requestSettings).url) !== null && _a$url !== void 0 ? _a$url : a.url = ye.URL), this.requestSettings.websocket && Y.setup(this);
|
4519
4521
|
}
|
4520
4522
|
_createClass(Ne, [{
|
4521
4523
|
key: "verifyKey",
|
@@ -4543,7 +4545,7 @@ var Ne = /*#__PURE__*/function () {
|
|
4543
4545
|
case 0:
|
4544
4546
|
i = _args17.length > 2 && _args17[2] !== undefined ? _args17[2] : !0;
|
4545
4547
|
n = this.deepChat.stream;
|
4546
|
-
return _context17.abrupt("return", n && !
|
4548
|
+
return _context17.abrupt("return", n && !L.isSimulation(n) ? L.request(this, e, t) : S.request(this, e, t, i));
|
4547
4549
|
case 3:
|
4548
4550
|
case "end":
|
4549
4551
|
return _context17.stop();
|
@@ -4677,7 +4679,7 @@ var Ne = /*#__PURE__*/function () {
|
|
4677
4679
|
_context22.next = 4;
|
4678
4680
|
break;
|
4679
4681
|
}
|
4680
|
-
return _context22.abrupt("return",
|
4682
|
+
return _context22.abrupt("return", Ie.handleResponseProperty(e));
|
4681
4683
|
case 4:
|
4682
4684
|
if (!E.validateResponseFormat(e)) {
|
4683
4685
|
_context22.next = 6;
|
@@ -4729,18 +4731,17 @@ var Ne = /*#__PURE__*/function () {
|
|
4729
4731
|
}]);
|
4730
4732
|
return Ne;
|
4731
4733
|
}();
|
4732
|
-
var
|
4733
|
-
_inherits(
|
4734
|
-
var _super = _createSuper(U);
|
4734
|
+
var q = /*#__PURE__*/function (_Ne) {
|
4735
|
+
_inherits(q, _Ne);
|
4735
4736
|
// prettier-ignore
|
4736
|
-
function
|
4737
|
+
function q(e, t, i, n, r) {
|
4737
4738
|
var _this6;
|
4738
|
-
_classCallCheck(this,
|
4739
|
+
_classCallCheck(this, q);
|
4739
4740
|
var o;
|
4740
|
-
_this6 =
|
4741
|
+
_this6 = _callSuper(this, q, [e, r]), _this6.insertKeyPlaceholderText = "API Key", _this6.getKeyLink = "", Object.assign(_this6.rawBody, (o = e.request) == null ? void 0 : o.additionalBodyProps), _this6.keyVerificationDetails = t, _this6.buildHeadersFunc = i, n && _this6.setApiKeyProperties(n), _this6.requestSettings = _this6.buildRequestSettings(_this6.key || "", e.request);
|
4741
4742
|
return _this6;
|
4742
4743
|
}
|
4743
|
-
_createClass(
|
4744
|
+
_createClass(q, [{
|
4744
4745
|
key: "setApiKeyProperties",
|
4745
4746
|
value: function setApiKeyProperties(e) {
|
4746
4747
|
this.key = e.key, e.validateKeyProperty && (this.validateConfigKey = e.validateKeyProperty);
|
@@ -4768,7 +4769,7 @@ var U = /*#__PURE__*/function (_Ne) {
|
|
4768
4769
|
o = _this$keyVerification.createHeaders,
|
4769
4770
|
a = _this$keyVerification.body,
|
4770
4771
|
l = (o == null ? void 0 : o(e)) || this.buildHeadersFunc(e);
|
4771
|
-
|
4772
|
+
S.verifyKey(e, i, l, n, this.keyAuthenticated.bind(this, t.onSuccess), t.onFail, t.onLoad, r, a);
|
4772
4773
|
}
|
4773
4774
|
}, {
|
4774
4775
|
key: "isDirectConnection",
|
@@ -4776,7 +4777,7 @@ var U = /*#__PURE__*/function (_Ne) {
|
|
4776
4777
|
return !0;
|
4777
4778
|
}
|
4778
4779
|
}]);
|
4779
|
-
return
|
4780
|
+
return q;
|
4780
4781
|
}(Ne);
|
4781
4782
|
var zt = /*#__PURE__*/function () {
|
4782
4783
|
function zt() {
|
@@ -4797,14 +4798,13 @@ var zt = /*#__PURE__*/function () {
|
|
4797
4798
|
}]);
|
4798
4799
|
return zt;
|
4799
4800
|
}();
|
4800
|
-
var
|
4801
|
+
var Yi = /*#__PURE__*/function (_HTMLElement) {
|
4801
4802
|
_inherits(Ve, _HTMLElement);
|
4802
|
-
var _super2 = _createSuper(Ve);
|
4803
4803
|
// If this is not working, try using propertyName directly
|
4804
4804
|
function Ve() {
|
4805
4805
|
var _this7;
|
4806
4806
|
_classCallCheck(this, Ve);
|
4807
|
-
_this7 =
|
4807
|
+
_this7 = _callSuper(this, Ve), _this7._waitingToRender_ = !1, _this7._propUpdated_ = !1, Object.keys(Ve._attributeToProperty_).forEach(function (e) {
|
4808
4808
|
var t = Ve._attributeToProperty_[e];
|
4809
4809
|
_this7.constructPropertyAccessors(t), _this7.hasOwnProperty(e) || _this7.constructPropertyAccessors(t, e);
|
4810
4810
|
});
|
@@ -4844,9 +4844,9 @@ var $i = /*#__PURE__*/function (_HTMLElement) {
|
|
4844
4844
|
}]);
|
4845
4845
|
return Ve;
|
4846
4846
|
}( /*#__PURE__*/_wrapNativeSuper(HTMLElement));
|
4847
|
-
|
4848
|
-
|
4849
|
-
var yo =
|
4847
|
+
Yi._attributes_ = {};
|
4848
|
+
Yi._attributeToProperty_ = {};
|
4849
|
+
var yo = Yi;
|
4850
4850
|
var xo = "<?xml version=\"1.0\" standalone=\"no\"?>\n<svg version=\"1.1\"\n\txmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\" xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\"\n\txmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"0.9em\" height=\"0.9em\"\n\tviewBox=\"0 0 1200 1200\" enable-background=\"new 0 0 1200 1200\">\n\t\t<path d=\"\n\t\t\tM669.727,273.516c-22.891-2.476-46.15-3.895-69.727-4.248c-103.025,0.457-209.823,25.517-310.913,73.536\n\t\t\tc-75.058,37.122-148.173,89.529-211.67,154.174C46.232,529.978,6.431,577.76,0,628.74c0.76,44.162,48.153,98.67,77.417,131.764\n\t\t\tc59.543,62.106,130.754,113.013,211.67,154.174c2.75,1.335,5.51,2.654,8.276,3.955l-75.072,131.102l102.005,60.286l551.416-960.033\n\t\t\tl-98.186-60.008L669.727,273.516z M902.563,338.995l-74.927,129.857c34.47,44.782,54.932,100.006,54.932,159.888\n\t\t\tc0,149.257-126.522,270.264-282.642,270.264c-6.749,0-13.29-0.728-19.922-1.172l-49.585,85.84c22.868,2.449,45.99,4.233,69.58,4.541\n\t\t\tc103.123-0.463,209.861-25.812,310.84-73.535c75.058-37.122,148.246-89.529,211.743-154.174\n\t\t\tc31.186-32.999,70.985-80.782,77.417-131.764c-0.76-44.161-48.153-98.669-77.417-131.763\n\t\t\tc-59.543-62.106-130.827-113.013-211.743-154.175C908.108,341.478,905.312,340.287,902.563,338.995L902.563,338.995z\n\t\t\tM599.927,358.478c6.846,0,13.638,0.274,20.361,0.732l-58.081,100.561c-81.514,16.526-142.676,85.88-142.676,168.897\n\t\t\tc0,20.854,3.841,40.819,10.913,59.325c0.008,0.021-0.008,0.053,0,0.074l-58.228,100.854\n\t\t\tc-34.551-44.823-54.932-100.229-54.932-160.182C317.285,479.484,443.808,358.477,599.927,358.478L599.927,358.478z M768.896,570.513\n\t\t\tL638.013,797.271c81.076-16.837,141.797-85.875,141.797-168.603C779.81,608.194,775.724,588.729,768.896,570.513L768.896,570.513z\"\n\t\t\t/>\n</svg>\n",
|
4851
4851
|
Eo = "<?xml version=\"1.0\" standalone=\"no\"?>\n<svg version=\"1.1\"\n\txmlns:sodipodi=\"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\" xmlns:inkscape=\"http://www.inkscape.org/namespaces/inkscape\"\n\txmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"0.9em\" height=\"0.9em\"\n\tviewBox=\"0 0 1200 1200\" enable-background=\"new 0 0 1200 1200\">\n\t\t<path id=\"path6686\" inkscape:connector-curvature=\"0\" d=\"M779.843,599.925c0,95.331-80.664,172.612-180.169,172.612\n\t\t\tc-99.504,0-180.168-77.281-180.168-172.612c0-95.332,80.664-172.612,180.168-172.612\n\t\t\tC699.179,427.312,779.843,504.594,779.843,599.925z M600,240.521c-103.025,0.457-209.814,25.538-310.904,73.557\n\t\t\tc-75.058,37.122-148.206,89.496-211.702,154.141C46.208,501.218,6.431,549,0,599.981c0.76,44.161,48.13,98.669,77.394,131.763\n\t\t\tc59.543,62.106,130.786,113.018,211.702,154.179c94.271,45.751,198.616,72.092,310.904,73.557\n\t\t\tc103.123-0.464,209.888-25.834,310.866-73.557c75.058-37.122,148.243-89.534,211.74-154.179\n\t\t\tc31.185-32.999,70.962-80.782,77.394-131.763c-0.76-44.161-48.13-98.671-77.394-131.764\n\t\t\tc-59.543-62.106-130.824-112.979-211.74-154.141C816.644,268.36,712.042,242.2,600,240.521z M599.924,329.769\n\t\t\tc156.119,0,282.675,120.994,282.675,270.251c0,149.256-126.556,270.25-282.675,270.25S317.249,749.275,317.249,600.02\n\t\t\tC317.249,450.763,443.805,329.769,599.924,329.769L599.924,329.769z\"/>\n</svg>\n";
|
4852
4852
|
var H = /*#__PURE__*/function () {
|
@@ -4893,7 +4893,7 @@ var os = /*#__PURE__*/function () {
|
|
4893
4893
|
return We;
|
4894
4894
|
}();
|
4895
4895
|
os.VISIBLE_ICON_ID = "visible-icon";
|
4896
|
-
var
|
4896
|
+
var _o = os;
|
4897
4897
|
var P = /*#__PURE__*/function () {
|
4898
4898
|
function P() {
|
4899
4899
|
_classCallCheck(this, P);
|
@@ -4997,7 +4997,7 @@ var P = /*#__PURE__*/function () {
|
|
4997
4997
|
i.id = "insert-key-contents";
|
4998
4998
|
var n = P.createInput(t.insertKeyPlaceholderText),
|
4999
4999
|
r = n.children[0],
|
5000
|
-
o =
|
5000
|
+
o = _o.create(r);
|
5001
5001
|
n.appendChild(o), i.appendChild(n);
|
5002
5002
|
var a = P.createStartButton(),
|
5003
5003
|
_P$createHelpTextCont = P.createHelpTextContainer(t.getKeyLink, (d = t.deepChat._insertKeyViewStyles) == null ? void 0 : d.displayCautionText),
|
@@ -5022,7 +5022,7 @@ var P = /*#__PURE__*/function () {
|
|
5022
5022
|
}]);
|
5023
5023
|
return P;
|
5024
5024
|
}();
|
5025
|
-
var
|
5025
|
+
var _t = /*#__PURE__*/function () {
|
5026
5026
|
function pe() {
|
5027
5027
|
_classCallCheck(this, pe);
|
5028
5028
|
}
|
@@ -5030,7 +5030,7 @@ var St = /*#__PURE__*/function () {
|
|
5030
5030
|
key: "enableButtons",
|
5031
5031
|
value: function enableButtons(e, t) {
|
5032
5032
|
var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
5033
|
-
window.webLLM ? (e && (e.disabled = !1), t && (t.disabled = !1)) : i <
|
5033
|
+
window.webLLM ? (e && (e.disabled = !1), t && (t.disabled = !1)) : i < Zi.MODULE_SEARCH_LIMIT_S * 4 && setTimeout(function () {
|
5034
5034
|
return pe.enableButtons(e, t, i + 1);
|
5035
5035
|
}, 250);
|
5036
5036
|
}
|
@@ -5087,87 +5087,140 @@ var St = /*#__PURE__*/function () {
|
|
5087
5087
|
}]);
|
5088
5088
|
return pe;
|
5089
5089
|
}();
|
5090
|
-
|
5091
|
-
|
5092
|
-
|
5093
|
-
|
5094
|
-
var En =
|
5095
|
-
var
|
5096
|
-
model_list: [
|
5090
|
+
_t.DOWNLOAD_BUTTON_CLASS = "deep-chat-download-button";
|
5091
|
+
_t.UPLOAD_BUTTON_CLASS = "deep-chat-upload-button";
|
5092
|
+
_t.FILE_INPUT_CLASS = "deep-chat-file-input";
|
5093
|
+
_t.EXPORT_BUTTON_CLASS = "deep-chat-export-button";
|
5094
|
+
var En = _t;
|
5095
|
+
var _n = {
|
5096
|
+
model_list: [
|
5097
|
+
// Llama-2
|
5098
|
+
{
|
5097
5099
|
model_url: "https://huggingface.co/mlc-ai/Llama-2-7b-chat-hf-q4f32_1-MLC/resolve/main/",
|
5098
5100
|
local_id: "Llama-2-7b-chat-hf-q4f32_1",
|
5099
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-7b-chat-hf/Llama-2-7b-chat-hf-q4f32_1-ctx4k_cs1k-webgpu.wasm"
|
5101
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-7b-chat-hf/Llama-2-7b-chat-hf-q4f32_1-ctx4k_cs1k-webgpu.wasm",
|
5102
|
+
vram_required_MB: 9109.03,
|
5103
|
+
low_resource_required: !1
|
5100
5104
|
}, {
|
5101
5105
|
model_url: "https://huggingface.co/mlc-ai/Llama-2-7b-chat-hf-q4f16_1-MLC/resolve/main/",
|
5102
5106
|
local_id: "Llama-2-7b-chat-hf-q4f16_1",
|
5103
5107
|
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-7b-chat-hf/Llama-2-7b-chat-hf-q4f16_1-ctx4k_cs1k-webgpu.wasm",
|
5108
|
+
vram_required_MB: 6749.02,
|
5109
|
+
low_resource_required: !1,
|
5110
|
+
required_features: ["shader-f16"]
|
5111
|
+
}, {
|
5112
|
+
model_url: "https://huggingface.co/mlc-ai/Llama-2-7b-chat-hf-q4f16_1-MLC/resolve/main/",
|
5113
|
+
local_id: "Llama-2-7b-chat-hf-q4f16_1-1k",
|
5114
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-7b-chat-hf/Llama-2-7b-chat-hf-q4f16_1-ctx1k-webgpu.wasm",
|
5115
|
+
vram_required_MB: 4618.52,
|
5116
|
+
low_resource_required: !1,
|
5104
5117
|
required_features: ["shader-f16"]
|
5105
5118
|
}, {
|
5106
5119
|
model_url: "https://huggingface.co/mlc-ai/Llama-2-13b-chat-hf-q4f16_1-MLC/resolve/main/",
|
5107
5120
|
local_id: "Llama-2-13b-chat-hf-q4f16_1",
|
5108
5121
|
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-13b-chat-hf/Llama-2-13b-chat-hf-q4f16_1-ctx4k_cs1k-webgpu.wasm",
|
5122
|
+
vram_required_MB: 11814.09,
|
5123
|
+
low_resource_required: !1,
|
5109
5124
|
required_features: ["shader-f16"]
|
5110
5125
|
}, {
|
5111
5126
|
model_url: "https://huggingface.co/mlc-ai/Llama-2-70b-chat-hf-q4f16_1-MLC/resolve/main/",
|
5112
5127
|
local_id: "Llama-2-70b-chat-hf-q4f16_1",
|
5113
5128
|
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Llama-2-70b-chat-hf/Llama-2-70b-chat-hf-q4f16_1-ctx4k_cs1k-webgpu.wasm",
|
5129
|
+
vram_required_MB: 43729.05,
|
5130
|
+
low_resource_required: !1,
|
5114
5131
|
required_features: ["shader-f16"]
|
5115
|
-
},
|
5132
|
+
},
|
5133
|
+
// RedPajama
|
5134
|
+
{
|
5116
5135
|
model_url: "https://huggingface.co/mlc-ai/RedPajama-INCITE-Chat-3B-v1-q4f16_1-MLC/resolve/main/",
|
5117
5136
|
local_id: "RedPajama-INCITE-Chat-3B-v1-q4f16_1",
|
5118
5137
|
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/RedPajama-INCITE-Chat-3B-v1/RedPajama-INCITE-Chat-3B-v1-q4f16_1-ctx2k-webgpu.wasm",
|
5138
|
+
vram_required_MB: 2972.09,
|
5139
|
+
low_resource_required: !1,
|
5119
5140
|
required_features: ["shader-f16"]
|
5120
5141
|
}, {
|
5121
5142
|
model_url: "https://huggingface.co/mlc-ai/RedPajama-INCITE-Chat-3B-v1-q4f32_1-MLC/resolve/main/",
|
5122
5143
|
local_id: "RedPajama-INCITE-Chat-3B-v1-q4f32_1",
|
5123
|
-
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/RedPajama-INCITE-Chat-3B-v1/RedPajama-INCITE-Chat-3B-v1-q4f32_1-ctx2k-webgpu.wasm"
|
5144
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/RedPajama-INCITE-Chat-3B-v1/RedPajama-INCITE-Chat-3B-v1-q4f32_1-ctx2k-webgpu.wasm",
|
5145
|
+
vram_required_MB: 3928.09,
|
5146
|
+
low_resource_required: !1
|
5147
|
+
}, {
|
5148
|
+
model_url: "https://huggingface.co/mlc-ai/RedPajama-INCITE-Chat-3B-v1-q4f16_1-MLC/resolve/main/",
|
5149
|
+
local_id: "RedPajama-INCITE-Chat-3B-v1-q4f16_1-1k",
|
5150
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/RedPajama-INCITE-Chat-3B-v1/RedPajama-INCITE-Chat-3B-v1-q4f16_1-ctx1k-webgpu.wasm",
|
5151
|
+
vram_required_MB: 2041.09,
|
5152
|
+
low_resource_required: !0,
|
5153
|
+
required_features: ["shader-f16"]
|
5124
5154
|
}, {
|
5155
|
+
model_url: "https://huggingface.co/mlc-ai/RedPajama-INCITE-Chat-3B-v1-q4f32_1-MLC/resolve/main/",
|
5156
|
+
local_id: "RedPajama-INCITE-Chat-3B-v1-q4f32_1-1k",
|
5157
|
+
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/RedPajama-INCITE-Chat-3B-v1/RedPajama-INCITE-Chat-3B-v1-q4f32_1-ctx1k-webgpu.wasm",
|
5158
|
+
vram_required_MB: 2558.09,
|
5159
|
+
low_resource_required: !0
|
5160
|
+
},
|
5161
|
+
// Mistral variants
|
5162
|
+
{
|
5125
5163
|
model_url: "https://huggingface.co/mlc-ai/WizardMath-7B-V1.1-q4f16_1-MLC/resolve/main/",
|
5126
5164
|
local_id: "WizardMath-7B-V1.1-q4f16_1",
|
5127
5165
|
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Mistral-7B-Instruct-v0.2/Mistral-7B-Instruct-v0.2-q4f16_1-sw4k_cs1k-webgpu.wasm",
|
5166
|
+
vram_required_MB: 6079.02,
|
5167
|
+
low_resource_required: !1,
|
5128
5168
|
required_features: ["shader-f16"]
|
5129
5169
|
}, {
|
5130
5170
|
model_url: "https://huggingface.co/mlc-ai/Mistral-7B-Instruct-v0.2-q4f16_1-MLC/resolve/main/",
|
5131
5171
|
local_id: "Mistral-7B-Instruct-v0.2-q4f16_1",
|
5132
5172
|
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Mistral-7B-Instruct-v0.2/Mistral-7B-Instruct-v0.2-q4f16_1-sw4k_cs1k-webgpu.wasm",
|
5173
|
+
vram_required_MB: 6079.02,
|
5174
|
+
low_resource_required: !1,
|
5133
5175
|
required_features: ["shader-f16"]
|
5134
5176
|
}, {
|
5135
5177
|
model_url: "https://huggingface.co/mlc-ai/OpenHermes-2.5-Mistral-7B-q4f16_1-MLC/resolve/main/",
|
5136
5178
|
local_id: "OpenHermes-2.5-Mistral-7B-q4f16_1",
|
5137
5179
|
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Mistral-7B-Instruct-v0.2/Mistral-7B-Instruct-v0.2-q4f16_1-sw4k_cs1k-webgpu.wasm",
|
5180
|
+
vram_required_MB: 6079.02,
|
5181
|
+
low_resource_required: !1,
|
5138
5182
|
required_features: ["shader-f16"]
|
5139
5183
|
}, {
|
5140
5184
|
model_url: "https://huggingface.co/mlc-ai/NeuralHermes-2.5-Mistral-7B-q4f16_1-MLC/resolve/main/",
|
5141
5185
|
local_id: "NeuralHermes-2.5-Mistral-7B-q4f16_1",
|
5142
5186
|
model_lib_url: "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/Mistral-7B-Instruct-v0.2/Mistral-7B-Instruct-v0.2-q4f16_1-sw4k_cs1k-webgpu.wasm",
|
5187
|
+
vram_required_MB: 6079.02,
|
5188
|
+
low_resource_required: !1,
|
5143
5189
|
required_features: ["shader-f16"]
|
5144
5190
|
},
|
5145
|
-
//
|
5191
|
+
// TinyLlama
|
5146
5192
|
{
|
5147
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5148
|
-
local_id: "
|
5149
|
-
model_lib_url: "https://raw.githubusercontent.com/
|
5193
|
+
model_url: "https://huggingface.co/mlc-ai/TinyLlama-1.1B-Chat-v0.4-q0f16-MLC/resolve/main/",
|
5194
|
+
local_id: "TinyLlama-1.1B-Chat-v0.4-q0f16",
|
5195
|
+
model_lib_url: "https://raw.githubusercontent.com/CharlieFRuan/binary-mlc-llm-libs/pr-0116-tinyLlama-wasm/TinyLlama-1.1B-Chat-v0.4/TinyLlama-1.1B-Chat-v0.4-q0f16-ctx2k-webgpu.wasm",
|
5196
|
+
low_resource_required: !1,
|
5150
5197
|
required_features: ["shader-f16"]
|
5151
5198
|
}, {
|
5152
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5153
|
-
local_id: "
|
5154
|
-
model_lib_url: "https://raw.githubusercontent.com/
|
5199
|
+
model_url: "https://huggingface.co/mlc-ai/TinyLlama-1.1B-Chat-v0.4-q0f32-MLC/resolve/main/",
|
5200
|
+
local_id: "TinyLlama-1.1B-Chat-v0.4-q0f32",
|
5201
|
+
model_lib_url: "https://raw.githubusercontent.com/CharlieFRuan/binary-mlc-llm-libs/pr-0116-tinyLlama-wasm/TinyLlama-1.1B-Chat-v0.4/TinyLlama-1.1B-Chat-v0.4-q0f32-ctx2k-webgpu.wasm",
|
5202
|
+
low_resource_required: !1
|
5203
|
+
}, {
|
5204
|
+
model_url: "https://huggingface.co/mlc-ai/TinyLlama-1.1B-Chat-v0.4-q4f16_1-MLC/resolve/main/",
|
5205
|
+
local_id: "TinyLlama-1.1B-Chat-v0.4-q4f16_1-1k",
|
5206
|
+
model_lib_url: "https://raw.githubusercontent.com/CharlieFRuan/binary-mlc-llm-libs/pr-0116-tinyLlama-wasm/TinyLlama-1.1B-Chat-v0.4/TinyLlama-1.1B-Chat-v0.4-q4f16_1-ctx1k-webgpu.wasm",
|
5207
|
+
low_resource_required: !0,
|
5155
5208
|
required_features: ["shader-f16"]
|
5156
5209
|
}, {
|
5157
|
-
model_url: "https://huggingface.co/mlc-ai/
|
5158
|
-
local_id: "
|
5159
|
-
model_lib_url: "https://raw.githubusercontent.com/
|
5210
|
+
model_url: "https://huggingface.co/mlc-ai/TinyLlama-1.1B-Chat-v0.4-q4f32_1-MLC/resolve/main/",
|
5211
|
+
local_id: "TinyLlama-1.1B-Chat-v0.4-q4f32_1-1k",
|
5212
|
+
model_lib_url: "https://raw.githubusercontent.com/CharlieFRuan/binary-mlc-llm-libs/pr-0116-tinyLlama-wasm/TinyLlama-1.1B-Chat-v0.4/TinyLlama-1.1B-Chat-v0.4-q4f32_1-ctx1k-webgpu.wasm",
|
5213
|
+
low_resource_required: !0
|
5160
5214
|
}],
|
5161
5215
|
use_web_worker: !0
|
5162
5216
|
},
|
5163
5217
|
it = /*#__PURE__*/function (_Ne2) {
|
5164
5218
|
_inherits(M, _Ne2);
|
5165
|
-
var _super3 = _createSuper(M);
|
5166
5219
|
function M(e) {
|
5167
5220
|
var _this8;
|
5168
5221
|
_classCallCheck(this, M);
|
5169
5222
|
var t, i;
|
5170
|
-
_this8 =
|
5223
|
+
_this8 = _callSuper(this, M, [e]), _this8._isModelLoaded = !1, _this8._isModelLoading = !1, _this8._loadOnFirstMessage = !1, _this8._webModel = {}, _this8.permittedErrorPrefixes = [M.MULTIPLE_MODELS_ERROR, M.WEB_LLM_NOT_FOUND_ERROR, M.GENERIC_ERROR], _this8._conversationHistory = [], _typeof(e.webModel) == "object" && (_this8._webModel = e.webModel), (t = _this8._webModel.load) != null && t.clearCache && M.clearAllCache(), _this8.findModelInWindow(e), _this8.canSendMessage = _this8.canSubmit.bind(_assertThisInitialized(_this8)), _this8._chatEl = (i = e.shadowRoot) == null ? void 0 : i.children[0], e.initialMessages && M.setUpHistory(_this8._conversationHistory, e.initialMessages);
|
5171
5224
|
return _this8;
|
5172
5225
|
}
|
5173
5226
|
// need ref of messages object as web model exhibits unique behaviour to manipulate chat
|
@@ -5294,7 +5347,7 @@ var Sn = {
|
|
5294
5347
|
}
|
5295
5348
|
if (this._isModelLoaded || this._isModelLoading) return;
|
5296
5349
|
var e = this._webModel.worker;
|
5297
|
-
return
|
5350
|
+
return _n.use_web_worker && e ? new window.webLLM.ChatWorkerClient(e) : new window.webLLM.ChatModule();
|
5298
5351
|
}
|
5299
5352
|
}, {
|
5300
5353
|
key: "getConfig",
|
@@ -5302,7 +5355,7 @@ var Sn = {
|
|
5302
5355
|
var i;
|
5303
5356
|
var e = M.DEFAULT_MODEL;
|
5304
5357
|
this._webModel.model && (e = this._webModel.model);
|
5305
|
-
var t = JSON.parse(JSON.stringify(
|
5358
|
+
var t = JSON.parse(JSON.stringify(_n));
|
5306
5359
|
if (this._webModel.urls) {
|
5307
5360
|
var n = t.model_list.find(function (r) {
|
5308
5361
|
return r.local_id = e;
|
@@ -5700,12 +5753,12 @@ it.MULTIPLE_MODELS_ERROR = "Cannot run multiple web models";
|
|
5700
5753
|
it.WEB_LLM_NOT_FOUND_ERROR = "WebLLM module not found";
|
5701
5754
|
it.DEFAULT_MODEL = "Llama-2-7b-chat-hf-q4f32_1";
|
5702
5755
|
it.MODULE_SEARCH_LIMIT_S = 5;
|
5703
|
-
var
|
5704
|
-
var
|
5705
|
-
function
|
5706
|
-
_classCallCheck(this,
|
5756
|
+
var Zi = it;
|
5757
|
+
var qt = /*#__PURE__*/function () {
|
5758
|
+
function qt() {
|
5759
|
+
_classCallCheck(this, qt);
|
5707
5760
|
}
|
5708
|
-
_createClass(
|
5761
|
+
_createClass(qt, null, [{
|
5709
5762
|
key: "buildHeaders",
|
5710
5763
|
value: function buildHeaders(e) {
|
5711
5764
|
return {
|
@@ -5727,24 +5780,23 @@ var Ut = /*#__PURE__*/function () {
|
|
5727
5780
|
return {
|
5728
5781
|
url: "https://api-inference.huggingface.co/models/gpt2",
|
5729
5782
|
method: "POST",
|
5730
|
-
handleVerificationResult:
|
5783
|
+
handleVerificationResult: qt.handleVerificationResult
|
5731
5784
|
};
|
5732
5785
|
}
|
5733
5786
|
}]);
|
5734
|
-
return
|
5787
|
+
return qt;
|
5735
5788
|
}();
|
5736
|
-
var as = /*#__PURE__*/function (
|
5737
|
-
_inherits(
|
5738
|
-
var _super4 = _createSuper(Fi);
|
5789
|
+
var as = /*#__PURE__*/function (_q) {
|
5790
|
+
_inherits(Bi, _q);
|
5739
5791
|
// prettier-ignore
|
5740
|
-
function
|
5792
|
+
function Bi(e, t, i, n, r, o) {
|
5741
5793
|
var _this14;
|
5742
|
-
_classCallCheck(this,
|
5743
|
-
_this14 =
|
5794
|
+
_classCallCheck(this, Bi);
|
5795
|
+
_this14 = _callSuper(this, Bi, [e, qt.buildKeyVerificationDetails(), qt.buildHeaders, r, o]), _this14.insertKeyPlaceholderText = "Hugging Face Token", _this14.getKeyLink = "https://huggingface.co/settings/tokens", _this14.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Hugging Face</b></div>\n <p>First message may take an extented amount of time to complete as the model needs to be initialized.</p>", _this14.permittedErrorPrefixes = ["Authorization header"], _this14.url = "".concat(Bi.URL_PREFIX).concat(i), _this14.textInputPlaceholderText = t, _typeof(n) == "object" && (n.model && (_this14.url = "".concat(Bi.URL_PREFIX).concat(n.model)), n.options && (_this14.rawBody.options = n.options), n.parameters && (_this14.rawBody.parameters = n.parameters));
|
5744
5796
|
return _this14;
|
5745
5797
|
}
|
5746
5798
|
// prettier-ignore
|
5747
|
-
_createClass(
|
5799
|
+
_createClass(Bi, [{
|
5748
5800
|
key: "preprocessBody",
|
5749
5801
|
value: function preprocessBody(e, t, i) {
|
5750
5802
|
var _n$options;
|
@@ -5769,7 +5821,7 @@ var as = /*#__PURE__*/function (_U) {
|
|
5769
5821
|
throw new Error("Request settings have not been set up");
|
5770
5822
|
case 2:
|
5771
5823
|
n = this.preprocessBody(this.rawBody, t, i);
|
5772
|
-
|
5824
|
+
S.request(this, n, e);
|
5773
5825
|
case 4:
|
5774
5826
|
case "end":
|
5775
5827
|
return _context34.stop();
|
@@ -5782,18 +5834,17 @@ var as = /*#__PURE__*/function (_U) {
|
|
5782
5834
|
return callServiceAPI;
|
5783
5835
|
}()
|
5784
5836
|
}]);
|
5785
|
-
return
|
5786
|
-
}(
|
5837
|
+
return Bi;
|
5838
|
+
}(q);
|
5787
5839
|
as.URL_PREFIX = "https://api-inference.huggingface.co/models/";
|
5788
5840
|
var je = as;
|
5789
5841
|
var wt = /*#__PURE__*/function (_je) {
|
5790
5842
|
_inherits(wt, _je);
|
5791
|
-
var _super5 = _createSuper(wt);
|
5792
5843
|
// prettier-ignore
|
5793
5844
|
function wt(e, t, i, n, r, o) {
|
5794
5845
|
var _this15;
|
5795
5846
|
_classCallCheck(this, wt);
|
5796
|
-
_this15 =
|
5847
|
+
_this15 = _callSuper(this, wt, [e, t, i, n, r, o]), _this15.isTextInputDisabled = !0, _this15.canSendMessage = wt.canSendFile;
|
5797
5848
|
return _this15;
|
5798
5849
|
}
|
5799
5850
|
_createClass(wt, [{
|
@@ -5821,7 +5872,7 @@ var wt = /*#__PURE__*/function (_je) {
|
|
5821
5872
|
}
|
5822
5873
|
throw new Error("No file was added");
|
5823
5874
|
case 4:
|
5824
|
-
|
5875
|
+
S.poll(this, i[0], e, !1);
|
5825
5876
|
case 5:
|
5826
5877
|
case "end":
|
5827
5878
|
return _context35.stop();
|
@@ -5843,16 +5894,15 @@ var wt = /*#__PURE__*/function (_je) {
|
|
5843
5894
|
}(je);
|
5844
5895
|
var wo = /*#__PURE__*/function (_wt) {
|
5845
5896
|
_inherits(wo, _wt);
|
5846
|
-
var _super6 = _createSuper(wo);
|
5847
5897
|
// prettier-ignore
|
5848
5898
|
function wo(e) {
|
5849
5899
|
_classCallCheck(this, wo);
|
5850
5900
|
var n, r, o;
|
5851
5901
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.huggingFace) == null ? void 0 : r.audioClassification,
|
5852
5902
|
i = (o = e.directConnection) == null ? void 0 : o.huggingFace;
|
5853
|
-
return
|
5903
|
+
return _callSuper(this, wo, [e, "Attach an audio file", "ehcalabres/wav2vec2-lg-xlsr-en-speech-emotion-recognition", t, i, {
|
5854
5904
|
audio: {}
|
5855
|
-
});
|
5905
|
+
}]);
|
5856
5906
|
}
|
5857
5907
|
_createClass(wo, [{
|
5858
5908
|
key: "extractPollResultData",
|
@@ -5893,19 +5943,18 @@ var wo = /*#__PURE__*/function (_wt) {
|
|
5893
5943
|
}]);
|
5894
5944
|
return wo;
|
5895
5945
|
}(wt);
|
5896
|
-
var
|
5897
|
-
_inherits(
|
5898
|
-
|
5899
|
-
|
5900
|
-
_classCallCheck(this, _o);
|
5946
|
+
var So = /*#__PURE__*/function (_wt2) {
|
5947
|
+
_inherits(So, _wt2);
|
5948
|
+
function So(e) {
|
5949
|
+
_classCallCheck(this, So);
|
5901
5950
|
var n, r, o;
|
5902
5951
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.huggingFace) == null ? void 0 : r.imageClassification,
|
5903
5952
|
i = (o = e.directConnection) == null ? void 0 : o.huggingFace;
|
5904
|
-
return
|
5953
|
+
return _callSuper(this, So, [e, "Attach an image file", "google/vit-base-patch16-224", t, i, {
|
5905
5954
|
images: {}
|
5906
|
-
});
|
5955
|
+
}]);
|
5907
5956
|
}
|
5908
|
-
_createClass(
|
5957
|
+
_createClass(So, [{
|
5909
5958
|
key: "extractPollResultData",
|
5910
5959
|
value: function () {
|
5911
5960
|
var _extractPollResultData2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37(e) {
|
@@ -5942,14 +5991,14 @@ var _o = /*#__PURE__*/function (_wt2) {
|
|
5942
5991
|
return extractPollResultData;
|
5943
5992
|
}()
|
5944
5993
|
}]);
|
5945
|
-
return
|
5994
|
+
return So;
|
5946
5995
|
}(wt);
|
5947
|
-
var
|
5948
|
-
var
|
5949
|
-
function
|
5950
|
-
_classCallCheck(this,
|
5996
|
+
var St = "data:image/png;base64,";
|
5997
|
+
var oe = /*#__PURE__*/function () {
|
5998
|
+
function oe() {
|
5999
|
+
_classCallCheck(this, oe);
|
5951
6000
|
}
|
5952
|
-
_createClass(
|
6001
|
+
_createClass(oe, null, [{
|
5953
6002
|
key: "buildHeaders",
|
5954
6003
|
value: function buildHeaders(e) {
|
5955
6004
|
return {
|
@@ -5969,30 +6018,28 @@ var re = /*#__PURE__*/function () {
|
|
5969
6018
|
return {
|
5970
6019
|
url: "https://api.stability.ai/v1/engines/list",
|
5971
6020
|
method: "GET",
|
5972
|
-
handleVerificationResult:
|
6021
|
+
handleVerificationResult: oe.handleVerificationResult
|
5973
6022
|
};
|
5974
6023
|
}
|
5975
6024
|
}]);
|
5976
|
-
return
|
6025
|
+
return oe;
|
5977
6026
|
}();
|
5978
|
-
var ri = /*#__PURE__*/function (
|
5979
|
-
_inherits(ri,
|
5980
|
-
var _super8 = _createSuper(ri);
|
6027
|
+
var ri = /*#__PURE__*/function (_q2) {
|
6028
|
+
_inherits(ri, _q2);
|
5981
6029
|
// prettier-ignore
|
5982
6030
|
function ri(e, t, i, n, r) {
|
5983
6031
|
var _this16;
|
5984
6032
|
_classCallCheck(this, ri);
|
5985
|
-
_this16 =
|
6033
|
+
_this16 = _callSuper(this, ri, [e, t, i, n, r]), _this16.insertKeyPlaceholderText = "Stability AI API Key", _this16.getKeyLink = "https://platform.stability.ai/docs/getting-started/authentication", _this16.permittedErrorPrefixes = ["Incorrect", "invalid_"];
|
5986
6034
|
return _this16;
|
5987
6035
|
}
|
5988
6036
|
return _createClass(ri);
|
5989
|
-
}(
|
5990
|
-
var
|
5991
|
-
_inherits(
|
5992
|
-
|
5993
|
-
function qt(e) {
|
6037
|
+
}(q);
|
6038
|
+
var Ut = /*#__PURE__*/function (_ri) {
|
6039
|
+
_inherits(Ut, _ri);
|
6040
|
+
function Ut(e) {
|
5994
6041
|
var _this17;
|
5995
|
-
_classCallCheck(this,
|
6042
|
+
_classCallCheck(this, Ut);
|
5996
6043
|
var o;
|
5997
6044
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
5998
6045
|
i = t == null ? void 0 : t.stabilityAI,
|
@@ -6004,12 +6051,12 @@ var qt = /*#__PURE__*/function (_ri) {
|
|
6004
6051
|
}
|
6005
6052
|
}
|
6006
6053
|
};
|
6007
|
-
_this17 =
|
6054
|
+
_this17 = _callSuper(this, Ut, [e, oe.buildKeyVerificationDetails(), oe.buildHeaders, i, n]), _this17.url = "https://api.stability.ai/v1/generation/esrgan-v1-x2plus/image-to-image/upscale", _this17.textInputPlaceholderText = "Describe image changes", _this17.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI</b></div>\n <div style=\"width: 100%; text-align: center; margin-left: -10px; margin-top: 5px\"><b>Image to Image Upscale</b></div>\n <p>Upload an image to generate a new one with higher resolution.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
|
6008
6055
|
var r = (o = t == null ? void 0 : t.stabilityAI) == null ? void 0 : o.imageToImageUpscale;
|
6009
|
-
_typeof(r) == "object" && (r.engine_id && (_this17.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/upscale")),
|
6056
|
+
_typeof(r) == "object" && (r.engine_id && (_this17.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/upscale")), Ut.cleanConfig(r), Object.assign(_this17.rawBody, r)), _this17.canSendMessage = Ut.canSendFileMessage;
|
6010
6057
|
return _this17;
|
6011
6058
|
}
|
6012
|
-
_createClass(
|
6059
|
+
_createClass(Ut, [{
|
6013
6060
|
key: "createFormDataBody",
|
6014
6061
|
value: function createFormDataBody(e, t) {
|
6015
6062
|
var i = new FormData();
|
@@ -6039,7 +6086,7 @@ var qt = /*#__PURE__*/function (_ri) {
|
|
6039
6086
|
throw new Error("Image was not found");
|
6040
6087
|
case 4:
|
6041
6088
|
n = this.createFormDataBody(this.rawBody, i[0]);
|
6042
|
-
E.tempRemoveContentHeader(this.requestSettings,
|
6089
|
+
E.tempRemoveContentHeader(this.requestSettings, S.request.bind(this, this, n, e), !1);
|
6043
6090
|
case 6:
|
6044
6091
|
case "end":
|
6045
6092
|
return _context38.stop();
|
@@ -6067,7 +6114,7 @@ var qt = /*#__PURE__*/function (_ri) {
|
|
6067
6114
|
return _context39.abrupt("return", {
|
6068
6115
|
files: e.artifacts.map(function (i) {
|
6069
6116
|
return {
|
6070
|
-
src: "".concat(
|
6117
|
+
src: "".concat(St).concat(i.base64),
|
6071
6118
|
type: "image"
|
6072
6119
|
};
|
6073
6120
|
})
|
@@ -6094,11 +6141,10 @@ var qt = /*#__PURE__*/function (_ri) {
|
|
6094
6141
|
return !!(t != null && t[0]);
|
6095
6142
|
}
|
6096
6143
|
}]);
|
6097
|
-
return
|
6144
|
+
return Ut;
|
6098
6145
|
}(ri);
|
6099
6146
|
var Ht = /*#__PURE__*/function (_ri2) {
|
6100
6147
|
_inherits(Ht, _ri2);
|
6101
|
-
var _super10 = _createSuper(Ht);
|
6102
6148
|
function Ht(e) {
|
6103
6149
|
var _this18;
|
6104
6150
|
_classCallCheck(this, Ht);
|
@@ -6113,7 +6159,7 @@ var Ht = /*#__PURE__*/function (_ri2) {
|
|
6113
6159
|
}
|
6114
6160
|
}
|
6115
6161
|
};
|
6116
|
-
_this18 =
|
6162
|
+
_this18 = _callSuper(this, Ht, [e, oe.buildKeyVerificationDetails(), oe.buildHeaders, i, n]), _this18.url = "https://api.stability.ai/v1/generation/stable-diffusion-xl-1024-v1-0/image-to-image/masking", _this18._maskSource = "MASK_IMAGE_WHITE", _this18.textInputPlaceholderText = "Describe image changes", _this18.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI</b></div>\n <div style=\"width: 100%; text-align: center; margin-left: -10px; margin-top: 5px\"><b>Image to Image Masking</b></div>\n <p>Upload an image, its mask image to create a new one based on the changes you have described for the mask area.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
|
6117
6163
|
var r = (o = t == null ? void 0 : t.stabilityAI) == null ? void 0 : o.imageToImageMasking;
|
6118
6164
|
_typeof(r) == "object" && (r.engine_id && (_this18.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/masking")), r.weight !== void 0 && r.weight !== null && (_this18._imageWeight = r.weight), r.mask_source !== void 0 && r.mask_source !== null && (_this18._maskSource = r.mask_source), Ht.cleanConfig(r), Object.assign(_this18.rawBody, r)), _this18.canSendMessage = Ht.canSendFileTextMessage;
|
6119
6165
|
return _this18;
|
@@ -6148,7 +6194,7 @@ var Ht = /*#__PURE__*/function (_ri2) {
|
|
6148
6194
|
throw new Error("Image was not found");
|
6149
6195
|
case 4:
|
6150
6196
|
n = (a = (o = t[t.length - 1]) == null ? void 0 : o.text) == null ? void 0 : a.trim(), r = this.createFormDataBody(this.rawBody, i[0], i[1], n);
|
6151
|
-
E.tempRemoveContentHeader(this.requestSettings,
|
6197
|
+
E.tempRemoveContentHeader(this.requestSettings, S.request.bind(this, this, r, e), !1);
|
6152
6198
|
case 6:
|
6153
6199
|
case "end":
|
6154
6200
|
return _context40.stop();
|
@@ -6176,7 +6222,7 @@ var Ht = /*#__PURE__*/function (_ri2) {
|
|
6176
6222
|
return _context41.abrupt("return", {
|
6177
6223
|
files: e.artifacts.map(function (i) {
|
6178
6224
|
return {
|
6179
|
-
src: "".concat(
|
6225
|
+
src: "".concat(St).concat(i.base64),
|
6180
6226
|
type: "image"
|
6181
6227
|
};
|
6182
6228
|
})
|
@@ -6207,15 +6253,14 @@ var Ht = /*#__PURE__*/function (_ri2) {
|
|
6207
6253
|
}(ri);
|
6208
6254
|
var Mo = /*#__PURE__*/function (_wt3) {
|
6209
6255
|
_inherits(Mo, _wt3);
|
6210
|
-
var _super11 = _createSuper(Mo);
|
6211
6256
|
function Mo(e) {
|
6212
6257
|
_classCallCheck(this, Mo);
|
6213
6258
|
var n, r, o;
|
6214
6259
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.huggingFace) == null ? void 0 : r.audioSpeechRecognition,
|
6215
6260
|
i = (o = e.directConnection) == null ? void 0 : o.huggingFace;
|
6216
|
-
return
|
6261
|
+
return _callSuper(this, Mo, [e, "Attach an audio file", "facebook/wav2vec2-large-960h-lv60-self", t, i, {
|
6217
6262
|
audio: {}
|
6218
|
-
});
|
6263
|
+
}]);
|
6219
6264
|
}
|
6220
6265
|
_createClass(Mo, [{
|
6221
6266
|
key: "extractPollResultData",
|
@@ -6257,13 +6302,12 @@ var Mo = /*#__PURE__*/function (_wt3) {
|
|
6257
6302
|
}(wt);
|
6258
6303
|
var To = /*#__PURE__*/function (_je2) {
|
6259
6304
|
_inherits(To, _je2);
|
6260
|
-
var _super12 = _createSuper(To);
|
6261
6305
|
function To(e) {
|
6262
6306
|
_classCallCheck(this, To);
|
6263
6307
|
var n, r, o;
|
6264
6308
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.huggingFace) == null ? void 0 : r.textGeneration,
|
6265
6309
|
i = (o = e.directConnection) == null ? void 0 : o.huggingFace;
|
6266
|
-
return
|
6310
|
+
return _callSuper(this, To, [e, "Once upon a time", "gpt2", t, i]);
|
6267
6311
|
}
|
6268
6312
|
_createClass(To, [{
|
6269
6313
|
key: "extractResultData",
|
@@ -6297,14 +6341,13 @@ var To = /*#__PURE__*/function (_je2) {
|
|
6297
6341
|
}(je);
|
6298
6342
|
var Co = /*#__PURE__*/function (_je3) {
|
6299
6343
|
_inherits(Co, _je3);
|
6300
|
-
var _super13 = _createSuper(Co);
|
6301
6344
|
function Co(e) {
|
6302
6345
|
var _this19;
|
6303
6346
|
_classCallCheck(this, Co);
|
6304
6347
|
var n, r, o;
|
6305
6348
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.huggingFace) == null ? void 0 : r.questionAnswer,
|
6306
6349
|
i = (o = e.directConnection) == null ? void 0 : o.huggingFace;
|
6307
|
-
_this19 =
|
6350
|
+
_this19 = _callSuper(this, Co, [e, "Ask a question", "bert-large-uncased-whole-word-masking-finetuned-squad", t, i]), _this19.permittedErrorPrefixes = ["Authorization header", "Error in"], _this19.context = t.context;
|
6308
6351
|
return _this19;
|
6309
6352
|
}
|
6310
6353
|
_createClass(Co, [{
|
@@ -6353,13 +6396,12 @@ var Co = /*#__PURE__*/function (_je3) {
|
|
6353
6396
|
}(je);
|
6354
6397
|
var Ao = /*#__PURE__*/function (_je4) {
|
6355
6398
|
_inherits(Ao, _je4);
|
6356
|
-
var _super14 = _createSuper(Ao);
|
6357
6399
|
function Ao(e) {
|
6358
6400
|
_classCallCheck(this, Ao);
|
6359
6401
|
var n, r, o;
|
6360
6402
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.huggingFace) == null ? void 0 : r.summarization,
|
6361
6403
|
i = (o = e.directConnection) == null ? void 0 : o.huggingFace;
|
6362
|
-
return
|
6404
|
+
return _callSuper(this, Ao, [e, "Insert text to summarize", "facebook/bart-large-cnn", t, i]);
|
6363
6405
|
}
|
6364
6406
|
_createClass(Ao, [{
|
6365
6407
|
key: "extractResultData",
|
@@ -6393,7 +6435,6 @@ var Ao = /*#__PURE__*/function (_je4) {
|
|
6393
6435
|
}(je);
|
6394
6436
|
var ko = /*#__PURE__*/function (_je5) {
|
6395
6437
|
_inherits(ko, _je5);
|
6396
|
-
var _super15 = _createSuper(ko);
|
6397
6438
|
function ko(e) {
|
6398
6439
|
var _this20$maxMessages;
|
6399
6440
|
var _this20;
|
@@ -6401,7 +6442,7 @@ var ko = /*#__PURE__*/function (_je5) {
|
|
6401
6442
|
var n, r, o;
|
6402
6443
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.huggingFace) == null ? void 0 : r.conversation,
|
6403
6444
|
i = (o = e.directConnection) == null ? void 0 : o.huggingFace;
|
6404
|
-
_this20 =
|
6445
|
+
_this20 = _callSuper(this, ko, [e, "Ask me anything!", "facebook/blenderbot-400M-distill", t, i]), (_this20$maxMessages = _this20.maxMessages) !== null && _this20$maxMessages !== void 0 ? _this20$maxMessages : _this20.maxMessages = -1;
|
6405
6446
|
return _this20;
|
6406
6447
|
}
|
6407
6448
|
// prettier-ignore
|
@@ -6477,7 +6518,6 @@ var ko = /*#__PURE__*/function (_je5) {
|
|
6477
6518
|
}(je);
|
6478
6519
|
var Gt = /*#__PURE__*/function (_ri3) {
|
6479
6520
|
_inherits(Gt, _ri3);
|
6480
|
-
var _super16 = _createSuper(Gt);
|
6481
6521
|
function Gt(e) {
|
6482
6522
|
var _this21;
|
6483
6523
|
_classCallCheck(this, Gt);
|
@@ -6492,7 +6532,7 @@ var Gt = /*#__PURE__*/function (_ri3) {
|
|
6492
6532
|
}
|
6493
6533
|
}
|
6494
6534
|
};
|
6495
|
-
_this21 =
|
6535
|
+
_this21 = _callSuper(this, Gt, [e, oe.buildKeyVerificationDetails(), oe.buildHeaders, i, n]), _this21.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-6/image-to-image", _this21.textInputPlaceholderText = "Describe image changes", _this21.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI: Image to Image</b></div>\n <p>Upload an image to create a new one with the changes you have described.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
|
6496
6536
|
var r = (o = t.stabilityAI) == null ? void 0 : o.imageToImage;
|
6497
6537
|
_typeof(r) == "object" && (r.engine_id && (_this21.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/text-to-image")), r.weight !== void 0 && r.weight !== null && (_this21._imageWeight = r.weight), Gt.cleanConfig(r), Object.assign(_this21.rawBody, r)), _this21.canSendMessage = Gt.canSendFileTextMessage;
|
6498
6538
|
return _this21;
|
@@ -6527,7 +6567,7 @@ var Gt = /*#__PURE__*/function (_ri3) {
|
|
6527
6567
|
throw new Error("Image was not found");
|
6528
6568
|
case 4:
|
6529
6569
|
n = (a = (o = t[t.length - 1]) == null ? void 0 : o.text) == null ? void 0 : a.trim(), r = this.createFormDataBody(this.rawBody, i[0], n);
|
6530
|
-
E.tempRemoveContentHeader(this.requestSettings,
|
6570
|
+
E.tempRemoveContentHeader(this.requestSettings, S.request.bind(this, this, r, e), !1);
|
6531
6571
|
case 6:
|
6532
6572
|
case "end":
|
6533
6573
|
return _context47.stop();
|
@@ -6555,7 +6595,7 @@ var Gt = /*#__PURE__*/function (_ri3) {
|
|
6555
6595
|
return _context48.abrupt("return", {
|
6556
6596
|
files: e.artifacts.map(function (i) {
|
6557
6597
|
return {
|
6558
|
-
src: "".concat(
|
6598
|
+
src: "".concat(St).concat(i.base64),
|
6559
6599
|
type: "image"
|
6560
6600
|
};
|
6561
6601
|
})
|
@@ -6584,17 +6624,16 @@ var Gt = /*#__PURE__*/function (_ri3) {
|
|
6584
6624
|
}]);
|
6585
6625
|
return Gt;
|
6586
6626
|
}(ri);
|
6587
|
-
var
|
6588
|
-
_inherits(
|
6589
|
-
|
6590
|
-
|
6591
|
-
_classCallCheck(this, Io);
|
6627
|
+
var Lo = /*#__PURE__*/function (_je6) {
|
6628
|
+
_inherits(Lo, _je6);
|
6629
|
+
function Lo(e) {
|
6630
|
+
_classCallCheck(this, Lo);
|
6592
6631
|
var n, r, o;
|
6593
6632
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.huggingFace) == null ? void 0 : r.translation,
|
6594
6633
|
i = (o = e.directConnection) == null ? void 0 : o.huggingFace;
|
6595
|
-
return
|
6634
|
+
return _callSuper(this, Lo, [e, "Insert text to translate", "Helsinki-NLP/opus-tatoeba-en-ja", t, i]);
|
6596
6635
|
}
|
6597
|
-
_createClass(
|
6636
|
+
_createClass(Lo, [{
|
6598
6637
|
key: "extractResultData",
|
6599
6638
|
value: function () {
|
6600
6639
|
var _extractResultData9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee49(e) {
|
@@ -6622,18 +6661,17 @@ var Io = /*#__PURE__*/function (_je6) {
|
|
6622
6661
|
return extractResultData;
|
6623
6662
|
}()
|
6624
6663
|
}]);
|
6625
|
-
return
|
6664
|
+
return Lo;
|
6626
6665
|
}(je);
|
6627
6666
|
var Vt = /*#__PURE__*/function (_ri4) {
|
6628
6667
|
_inherits(Vt, _ri4);
|
6629
|
-
var _super18 = _createSuper(Vt);
|
6630
6668
|
function Vt(e) {
|
6631
6669
|
var _this22;
|
6632
6670
|
_classCallCheck(this, Vt);
|
6633
6671
|
var r;
|
6634
6672
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
6635
6673
|
i = t.stabilityAI;
|
6636
|
-
_this22 =
|
6674
|
+
_this22 = _callSuper(this, Vt, [e, oe.buildKeyVerificationDetails(), oe.buildHeaders, i]), _this22.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-6/text-to-image", _this22.textInputPlaceholderText = "Describe an image", _this22.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Stability AI: Text to Image</b></div>\n <p>Insert text to generate an image.</p>\n <p>Click <a href=\"https://platform.stability.ai/\">here</a> for more info.</p>";
|
6637
6675
|
var n = (r = t.stabilityAI) == null ? void 0 : r.textToImage;
|
6638
6676
|
_typeof(n) == "object" && (n.engine_id && (_this22.url = "https://api.stability.ai/v1/generation/".concat(n.engine_id, "/text-to-image")), n.weight !== void 0 && n.weight !== null && (_this22._imageWeight = n.weight), Vt.cleanConfig(n), Object.assign(_this22.rawBody, n)), _this22.canSendMessage = Vt.canSendTextMessage;
|
6639
6677
|
return _this22;
|
@@ -6662,7 +6700,7 @@ var Vt = /*#__PURE__*/function (_ri4) {
|
|
6662
6700
|
throw new Error("Request settings have not been set up");
|
6663
6701
|
case 2:
|
6664
6702
|
i = this.preprocessBody(this.rawBody, t[t.length - 1].text);
|
6665
|
-
|
6703
|
+
S.request(this, i, e);
|
6666
6704
|
case 4:
|
6667
6705
|
case "end":
|
6668
6706
|
return _context50.stop();
|
@@ -6690,7 +6728,7 @@ var Vt = /*#__PURE__*/function (_ri4) {
|
|
6690
6728
|
return _context51.abrupt("return", {
|
6691
6729
|
files: e.artifacts.map(function (i) {
|
6692
6730
|
return {
|
6693
|
-
src: "".concat(
|
6731
|
+
src: "".concat(St).concat(i.base64),
|
6694
6732
|
type: "image"
|
6695
6733
|
};
|
6696
6734
|
})
|
@@ -6719,19 +6757,18 @@ var Vt = /*#__PURE__*/function (_ri4) {
|
|
6719
6757
|
}]);
|
6720
6758
|
return Vt;
|
6721
6759
|
}(ri);
|
6722
|
-
var
|
6723
|
-
_inherits(
|
6724
|
-
|
6725
|
-
function Lo(e) {
|
6760
|
+
var Io = /*#__PURE__*/function (_je7) {
|
6761
|
+
_inherits(Io, _je7);
|
6762
|
+
function Io(e) {
|
6726
6763
|
var _this23;
|
6727
|
-
_classCallCheck(this,
|
6764
|
+
_classCallCheck(this, Io);
|
6728
6765
|
var n, r, o;
|
6729
6766
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.huggingFace) == null ? void 0 : r.fillMask,
|
6730
6767
|
i = (o = e.directConnection) == null ? void 0 : o.huggingFace;
|
6731
|
-
_this23 =
|
6768
|
+
_this23 = _callSuper(this, Io, [e, "The goal of life is [MASK].", "bert-base-uncased", t, i]), _this23.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Hugging Face</b></div>\n <p>Insert a sentence with the word [MASK] and the model will try to fill it for you. E.g. I want [MASK].</p>\n <p>First message may take an extented amount of time to complete as the model needs to be initialized.</p>", _this23.permittedErrorPrefixes = ["Authorization header", "No mask_token"];
|
6732
6769
|
return _this23;
|
6733
6770
|
}
|
6734
|
-
_createClass(
|
6771
|
+
_createClass(Io, [{
|
6735
6772
|
key: "extractResultData",
|
6736
6773
|
value: function () {
|
6737
6774
|
var _extractResultData11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee52(e) {
|
@@ -6759,7 +6796,7 @@ var Lo = /*#__PURE__*/function (_je7) {
|
|
6759
6796
|
return extractResultData;
|
6760
6797
|
}()
|
6761
6798
|
}]);
|
6762
|
-
return
|
6799
|
+
return Io;
|
6763
6800
|
}(je);
|
6764
6801
|
var Wt = /*#__PURE__*/function () {
|
6765
6802
|
function Wt() {
|
@@ -6796,26 +6833,24 @@ var Wt = /*#__PURE__*/function () {
|
|
6796
6833
|
}]);
|
6797
6834
|
return Wt;
|
6798
6835
|
}();
|
6799
|
-
var
|
6800
|
-
_inherits(
|
6801
|
-
|
6802
|
-
function Zi(e, t, i, n, r) {
|
6836
|
+
var Xi = /*#__PURE__*/function (_q3) {
|
6837
|
+
_inherits(Xi, _q3);
|
6838
|
+
function Xi(e, t, i, n, r) {
|
6803
6839
|
var _this24;
|
6804
|
-
_classCallCheck(this,
|
6805
|
-
_this24 =
|
6840
|
+
_classCallCheck(this, Xi);
|
6841
|
+
_this24 = _callSuper(this, Xi, [e, Wt.buildKeyVerificationDetails(), Wt.buildHeaders, r]), _this24.insertKeyPlaceholderText = "Cohere API Key", _this24.getKeyLink = "https://dashboard.cohere.ai/api-keys", _this24.permittedErrorPrefixes = ["invalid"], _this24.url = t, _this24.textInputPlaceholderText = i, n && _typeof(n) == "object" && Object.assign(_this24.rawBody, n);
|
6806
6842
|
return _this24;
|
6807
6843
|
}
|
6808
|
-
return _createClass(
|
6809
|
-
}(
|
6810
|
-
var Ro = /*#__PURE__*/function (
|
6811
|
-
_inherits(Ro,
|
6812
|
-
var _super21 = _createSuper(Ro);
|
6844
|
+
return _createClass(Xi);
|
6845
|
+
}(q);
|
6846
|
+
var Ro = /*#__PURE__*/function (_Xi) {
|
6847
|
+
_inherits(Ro, _Xi);
|
6813
6848
|
function Ro(e) {
|
6814
6849
|
_classCallCheck(this, Ro);
|
6815
6850
|
var n, r, o;
|
6816
6851
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.cohere) == null ? void 0 : r.textGeneration,
|
6817
6852
|
i = (o = e.directConnection) == null ? void 0 : o.cohere;
|
6818
|
-
return
|
6853
|
+
return _callSuper(this, Ro, [e, "https://api.cohere.ai/v1/generate", "Once upon a time", t, i]);
|
6819
6854
|
}
|
6820
6855
|
_createClass(Ro, [{
|
6821
6856
|
key: "preprocessBody",
|
@@ -6841,7 +6876,7 @@ var Ro = /*#__PURE__*/function (_Zi) {
|
|
6841
6876
|
throw new Error("Request settings have not been set up");
|
6842
6877
|
case 2:
|
6843
6878
|
i = this.preprocessBody(this.rawBody, t);
|
6844
|
-
|
6879
|
+
S.request(this, i, e);
|
6845
6880
|
case 4:
|
6846
6881
|
case "end":
|
6847
6882
|
return _context53.stop();
|
@@ -6883,16 +6918,15 @@ var Ro = /*#__PURE__*/function (_Zi) {
|
|
6883
6918
|
}()
|
6884
6919
|
}]);
|
6885
6920
|
return Ro;
|
6886
|
-
}(
|
6887
|
-
var No = /*#__PURE__*/function (
|
6888
|
-
_inherits(No,
|
6889
|
-
var _super22 = _createSuper(No);
|
6921
|
+
}(Xi);
|
6922
|
+
var No = /*#__PURE__*/function (_Xi2) {
|
6923
|
+
_inherits(No, _Xi2);
|
6890
6924
|
function No(e) {
|
6891
6925
|
_classCallCheck(this, No);
|
6892
6926
|
var n, r, o;
|
6893
6927
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.cohere) == null ? void 0 : r.summarization,
|
6894
6928
|
i = (o = e.directConnection) == null ? void 0 : o.cohere;
|
6895
|
-
return
|
6929
|
+
return _callSuper(this, No, [e, "https://api.cohere.ai/v1/summarize", "Insert text to summarize", t, i]);
|
6896
6930
|
}
|
6897
6931
|
_createClass(No, [{
|
6898
6932
|
key: "preprocessBody",
|
@@ -6918,7 +6952,7 @@ var No = /*#__PURE__*/function (_Zi2) {
|
|
6918
6952
|
throw new Error("Request settings have not been set up");
|
6919
6953
|
case 2:
|
6920
6954
|
i = this.preprocessBody(this.rawBody, t);
|
6921
|
-
|
6955
|
+
S.request(this, i, e);
|
6922
6956
|
case 4:
|
6923
6957
|
case "end":
|
6924
6958
|
return _context55.stop();
|
@@ -6959,7 +6993,7 @@ var No = /*#__PURE__*/function (_Zi2) {
|
|
6959
6993
|
}()
|
6960
6994
|
}]);
|
6961
6995
|
return No;
|
6962
|
-
}(
|
6996
|
+
}(Xi);
|
6963
6997
|
var N = /*#__PURE__*/function () {
|
6964
6998
|
function N() {
|
6965
6999
|
_classCallCheck(this, N);
|
@@ -7028,22 +7062,21 @@ var N = /*#__PURE__*/function () {
|
|
7028
7062
|
}]);
|
7029
7063
|
return N;
|
7030
7064
|
}();
|
7031
|
-
var
|
7032
|
-
_inherits(
|
7033
|
-
|
7034
|
-
function Bi(e) {
|
7065
|
+
var Qi = /*#__PURE__*/function (_q4) {
|
7066
|
+
_inherits(zi, _q4);
|
7067
|
+
function zi(e) {
|
7035
7068
|
var _o$model, _a$voice;
|
7036
7069
|
var _this25;
|
7037
|
-
_classCallCheck(this,
|
7070
|
+
_classCallCheck(this, zi);
|
7038
7071
|
var r, o, a;
|
7039
7072
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
7040
7073
|
i = t == null ? void 0 : t.openAI;
|
7041
|
-
_this25 =
|
7074
|
+
_this25 = _callSuper(this, zi, [e, N.buildKeyVerificationDetails(), N.buildHeaders, i]), _this25.insertKeyPlaceholderText = "OpenAI API Key", _this25.getKeyLink = "https://platform.openai.com/account/api-keys", _this25.url = "https://api.openai.com/v1/audio/speech", _this25.permittedErrorPrefixes = ["Invalid"], _this25.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI : Text To Speech</b></div>\n <p>Generate an audio file based on your text input.</p>\n <p>Click <a href=\"https://platform.openai.com/docs/guides/text-to-speech\">here</a> for more information.</p>";
|
7042
7075
|
var n = (r = t == null ? void 0 : t.openAI) == null ? void 0 : r.textToSpeech;
|
7043
|
-
_typeof(n) == "object" && Object.assign(_this25.rawBody, n), (_o$model = (o = _this25.rawBody).model) !== null && _o$model !== void 0 ? _o$model : o.model =
|
7076
|
+
_typeof(n) == "object" && Object.assign(_this25.rawBody, n), (_o$model = (o = _this25.rawBody).model) !== null && _o$model !== void 0 ? _o$model : o.model = zi.DEFAULT_MODEL, (_a$voice = (a = _this25.rawBody).voice) !== null && _a$voice !== void 0 ? _a$voice : a.voice = zi.DEFAULT_VOIDE, _this25.textInputPlaceholderText = "Insert text to generate audio", _this25.rawBody.response_format = "mp3";
|
7044
7077
|
return _this25;
|
7045
7078
|
}
|
7046
|
-
_createClass(
|
7079
|
+
_createClass(zi, [{
|
7047
7080
|
key: "preprocessBody",
|
7048
7081
|
value: function preprocessBody(e, t) {
|
7049
7082
|
var r, o;
|
@@ -7067,7 +7100,7 @@ var Xi = /*#__PURE__*/function (_U4) {
|
|
7067
7100
|
case 2:
|
7068
7101
|
this.url = this.requestSettings.url || this.url;
|
7069
7102
|
i = this.preprocessBody(this.rawBody, t);
|
7070
|
-
|
7103
|
+
S.request(this, i, e);
|
7071
7104
|
case 5:
|
7072
7105
|
case "end":
|
7073
7106
|
return _context58.stop();
|
@@ -7123,14 +7156,13 @@ var Xi = /*#__PURE__*/function (_U4) {
|
|
7123
7156
|
return extractResultData;
|
7124
7157
|
}()
|
7125
7158
|
}]);
|
7126
|
-
return
|
7127
|
-
}(
|
7128
|
-
|
7129
|
-
|
7130
|
-
var Oo =
|
7131
|
-
var oi = /*#__PURE__*/function (
|
7132
|
-
_inherits(we,
|
7133
|
-
var _super24 = _createSuper(we);
|
7159
|
+
return zi;
|
7160
|
+
}(q);
|
7161
|
+
Qi.DEFAULT_MODEL = "tts-1";
|
7162
|
+
Qi.DEFAULT_VOIDE = "alloy";
|
7163
|
+
var Oo = Qi;
|
7164
|
+
var oi = /*#__PURE__*/function (_q5) {
|
7165
|
+
_inherits(we, _q5);
|
7134
7166
|
function we(e) {
|
7135
7167
|
var _o$model2;
|
7136
7168
|
var _this26;
|
@@ -7138,9 +7170,9 @@ var oi = /*#__PURE__*/function (_U5) {
|
|
7138
7170
|
var r, o;
|
7139
7171
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
7140
7172
|
i = t == null ? void 0 : t.openAI;
|
7141
|
-
_this26 =
|
7173
|
+
_this26 = _callSuper(this, we, [e, N.buildKeyVerificationDetails(), N.buildHeaders, i, {
|
7142
7174
|
audio: {}
|
7143
|
-
}), _this26.insertKeyPlaceholderText = "OpenAI API Key", _this26.getKeyLink = "https://platform.openai.com/account/api-keys", _this26.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI : Speech To Text</b></div>\n <p><b>Upload an audio file</b> to transcribe it into text. You can optionally provide text to guide the audio\n processing.\n <p>Click <a href=\"https://platform.openai.com/docs/guides/speech-to-text\">here</a> for more info.</p>", _this26.url = "", _this26.permittedErrorPrefixes = ["Invalid"], _this26.textInputPlaceholderText = "Upload an audio file", _this26._service_url = we.AUDIO_TRANSCRIPTIONS_URL;
|
7175
|
+
}]), _this26.insertKeyPlaceholderText = "OpenAI API Key", _this26.getKeyLink = "https://platform.openai.com/account/api-keys", _this26.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI : Speech To Text</b></div>\n <p><b>Upload an audio file</b> to transcribe it into text. You can optionally provide text to guide the audio\n processing.\n <p>Click <a href=\"https://platform.openai.com/docs/guides/speech-to-text\">here</a> for more info.</p>", _this26.url = "", _this26.permittedErrorPrefixes = ["Invalid"], _this26.textInputPlaceholderText = "Upload an audio file", _this26._service_url = we.AUDIO_TRANSCRIPTIONS_URL;
|
7144
7176
|
var n = (r = t == null ? void 0 : t.openAI) == null ? void 0 : r.audio;
|
7145
7177
|
_typeof(n) == "object" && (_this26.processConfig(n), we.cleanConfig(n), Object.assign(_this26.rawBody, n)), (_o$model2 = (o = _this26.rawBody).model) !== null && _o$model2 !== void 0 ? _o$model2 : o.model = we.DEFAULT_MODEL, _this26.rawBody.response_format = "json", _this26.canSendMessage = we.canSendFileMessage;
|
7146
7178
|
return _this26;
|
@@ -7181,7 +7213,7 @@ var oi = /*#__PURE__*/function (_U5) {
|
|
7181
7213
|
case 4:
|
7182
7214
|
this.url = this.requestSettings.url || this._service_url;
|
7183
7215
|
n = this.preprocessBody(this.rawBody, t), r = we.createFormDataBody(n, i[0]);
|
7184
|
-
E.tempRemoveContentHeader(this.requestSettings,
|
7216
|
+
E.tempRemoveContentHeader(this.requestSettings, S.request.bind(this, this, r, e), !1);
|
7185
7217
|
case 7:
|
7186
7218
|
case "end":
|
7187
7219
|
return _context60.stop();
|
@@ -7240,7 +7272,7 @@ var oi = /*#__PURE__*/function (_U5) {
|
|
7240
7272
|
}
|
7241
7273
|
}]);
|
7242
7274
|
return we;
|
7243
|
-
}(
|
7275
|
+
}(q);
|
7244
7276
|
oi.AUDIO_TRANSCRIPTIONS_URL = "https://api.openai.com/v1/audio/transcriptions";
|
7245
7277
|
oi.AUDIO_TRANSLATIONS_URL = "https://api.openai.com/v1/audio/translations";
|
7246
7278
|
oi.DEFAULT_MODEL = "whisper-1";
|
@@ -7347,23 +7379,21 @@ var X = /*#__PURE__*/function () {
|
|
7347
7379
|
}]);
|
7348
7380
|
return X;
|
7349
7381
|
}();
|
7350
|
-
var Do = /*#__PURE__*/function (
|
7351
|
-
_inherits(Do,
|
7352
|
-
var _super25 = _createSuper(Do);
|
7382
|
+
var Do = /*#__PURE__*/function (_q6) {
|
7383
|
+
_inherits(Do, _q6);
|
7353
7384
|
// prettier-ignore
|
7354
7385
|
function Do(e, t, i, n, r) {
|
7355
7386
|
var _this27;
|
7356
7387
|
_classCallCheck(this, Do);
|
7357
|
-
_this27 =
|
7388
|
+
_this27 = _callSuper(this, Do, [e, X.buildLanguageKeyVerificationDetails(i), t, n, r]), _this27.insertKeyPlaceholderText = "Azure Language Subscription Key", _this27.getKeyLink =
|
7358
7389
|
// eslint-disable-next-line max-len
|
7359
7390
|
"https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions#create-and-manage-subscriptions-in-azure-portal", _this27.permittedErrorPrefixes = ["Access"];
|
7360
7391
|
return _this27;
|
7361
7392
|
}
|
7362
7393
|
return _createClass(Do);
|
7363
|
-
}(
|
7394
|
+
}(q);
|
7364
7395
|
var jo = /*#__PURE__*/function (_Do) {
|
7365
7396
|
_inherits(jo, _Do);
|
7366
|
-
var _super26 = _createSuper(jo);
|
7367
7397
|
function jo(e) {
|
7368
7398
|
var _a$language;
|
7369
7399
|
var _this28;
|
@@ -7371,7 +7401,7 @@ var jo = /*#__PURE__*/function (_Do) {
|
|
7371
7401
|
var n, r, o, a;
|
7372
7402
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.azure) == null ? void 0 : r.summarization,
|
7373
7403
|
i = (o = e.directConnection) == null ? void 0 : o.azure;
|
7374
|
-
_this28 =
|
7404
|
+
_this28 = _callSuper(this, jo, [e, X.buildSummarizationHeader, t.endpoint, i]), _this28.url = "", _this28.textInputPlaceholderText = "Insert text to summarize", (_a$language = (a = _this28.rawBody).language) !== null && _a$language !== void 0 ? _a$language : a.language = "en", Object.assign(_this28.rawBody, t), _this28.url = "".concat(t.endpoint, "/language/analyze-text/jobs?api-version=2022-10-01-preview");
|
7375
7405
|
return _this28;
|
7376
7406
|
}
|
7377
7407
|
_createClass(jo, [{
|
@@ -7406,7 +7436,7 @@ var jo = /*#__PURE__*/function (_Do) {
|
|
7406
7436
|
throw new Error("Request settings have not been set up");
|
7407
7437
|
case 2:
|
7408
7438
|
i = this.preprocessBody(this.rawBody, t);
|
7409
|
-
|
7439
|
+
S.request(this, i, e), this.messages = e;
|
7410
7440
|
case 4:
|
7411
7441
|
case "end":
|
7412
7442
|
return _context62.stop();
|
@@ -7437,7 +7467,7 @@ var jo = /*#__PURE__*/function (_Do) {
|
|
7437
7467
|
method: "GET",
|
7438
7468
|
headers: (t = this.requestSettings) == null ? void 0 : t.headers
|
7439
7469
|
};
|
7440
|
-
|
7470
|
+
S.executePollRequest(this, _i9, n, this.messages);
|
7441
7471
|
}
|
7442
7472
|
return _context63.abrupt("return", {
|
7443
7473
|
makingAnotherRequest: !0
|
@@ -7622,20 +7652,19 @@ var ut = /*#__PURE__*/function () {
|
|
7622
7652
|
}]);
|
7623
7653
|
return ut;
|
7624
7654
|
}();
|
7625
|
-
var
|
7626
|
-
_inherits(
|
7627
|
-
|
7628
|
-
function Qi(e) {
|
7655
|
+
var en = /*#__PURE__*/function (_q7) {
|
7656
|
+
_inherits(en, _q7);
|
7657
|
+
function en(e) {
|
7629
7658
|
var _this29;
|
7630
|
-
_classCallCheck(this,
|
7659
|
+
_classCallCheck(this, en);
|
7631
7660
|
var i;
|
7632
7661
|
var t = (i = e.directConnection) == null ? void 0 : i.assemblyAI;
|
7633
|
-
_this29 =
|
7662
|
+
_this29 = _callSuper(this, en, [e, ut.buildKeyVerificationDetails(), ut.buildHeaders, t, {
|
7634
7663
|
audio: {}
|
7635
|
-
}), _this29.insertKeyPlaceholderText = "AssemblyAI API Key", _this29.getKeyLink = "https://www.assemblyai.com/app/account", _this29.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>AssemblyAI Audio</b></div>\n <p><b>Upload an audio file</b> to transcribe it into text.\n <p>\n Click <a href=\"https://www.assemblyai.com/docs/Guides/transcribing_an_audio_file#get-started\">here</a> for more info.\n </p>", _this29.url = "https://api.assemblyai.com/v2/upload", _this29.isTextInputDisabled = !0, _this29.textInputPlaceholderText = "Upload an audio file", _this29.permittedErrorPrefixes = ["Authentication", "Invalid"], _this29.canSendMessage =
|
7664
|
+
}]), _this29.insertKeyPlaceholderText = "AssemblyAI API Key", _this29.getKeyLink = "https://www.assemblyai.com/app/account", _this29.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>AssemblyAI Audio</b></div>\n <p><b>Upload an audio file</b> to transcribe it into text.\n <p>\n Click <a href=\"https://www.assemblyai.com/docs/Guides/transcribing_an_audio_file#get-started\">here</a> for more info.\n </p>", _this29.url = "https://api.assemblyai.com/v2/upload", _this29.isTextInputDisabled = !0, _this29.textInputPlaceholderText = "Upload an audio file", _this29.permittedErrorPrefixes = ["Authentication", "Invalid"], _this29.canSendMessage = en.canFileSendMessage;
|
7636
7665
|
return _this29;
|
7637
7666
|
}
|
7638
|
-
_createClass(
|
7667
|
+
_createClass(en, [{
|
7639
7668
|
key: "callServiceAPI",
|
7640
7669
|
value: function () {
|
7641
7670
|
var _callServiceAPI14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee66(e, t, i) {
|
@@ -7655,7 +7684,7 @@ var Qi = /*#__PURE__*/function (_U7) {
|
|
7655
7684
|
}
|
7656
7685
|
throw new Error("No file was added");
|
7657
7686
|
case 4:
|
7658
|
-
|
7687
|
+
S.request(this, i[0], e, !1);
|
7659
7688
|
case 5:
|
7660
7689
|
case "end":
|
7661
7690
|
return _context66.stop();
|
@@ -7706,25 +7735,23 @@ var Qi = /*#__PURE__*/function (_U7) {
|
|
7706
7735
|
return !!(t != null && t[0]);
|
7707
7736
|
}
|
7708
7737
|
}]);
|
7709
|
-
return
|
7710
|
-
}(
|
7711
|
-
var ls = /*#__PURE__*/function (
|
7712
|
-
_inherits(ls,
|
7713
|
-
var _super28 = _createSuper(ls);
|
7738
|
+
return en;
|
7739
|
+
}(q);
|
7740
|
+
var ls = /*#__PURE__*/function (_q8) {
|
7741
|
+
_inherits(ls, _q8);
|
7714
7742
|
// prettier-ignore
|
7715
7743
|
function ls(e, t, i, n, r) {
|
7716
7744
|
var _this30;
|
7717
7745
|
_classCallCheck(this, ls);
|
7718
|
-
_this30 =
|
7746
|
+
_this30 = _callSuper(this, ls, [e, X.buildSpeechKeyVerificationDetails(i), t, n, r]), _this30.insertKeyPlaceholderText = "Azure Speech Subscription Key", _this30.getKeyLink =
|
7719
7747
|
// eslint-disable-next-line max-len
|
7720
7748
|
"https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions#create-and-manage-subscriptions-in-azure-portal";
|
7721
7749
|
return _this30;
|
7722
7750
|
}
|
7723
7751
|
return _createClass(ls);
|
7724
|
-
}(
|
7752
|
+
}(q);
|
7725
7753
|
var cs = /*#__PURE__*/function (_ls) {
|
7726
7754
|
_inherits(ds, _ls);
|
7727
|
-
var _super29 = _createSuper(ds);
|
7728
7755
|
// prettier-ignore
|
7729
7756
|
function ds(e) {
|
7730
7757
|
var _a$lang, _l$name, _c$gender;
|
@@ -7733,7 +7760,7 @@ var cs = /*#__PURE__*/function (_ls) {
|
|
7733
7760
|
var n, r, o, a, l, c;
|
7734
7761
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.azure) == null ? void 0 : r.textToSpeech,
|
7735
7762
|
i = (o = e.directConnection) == null ? void 0 : o.azure;
|
7736
|
-
_this31 =
|
7763
|
+
_this31 = _callSuper(this, ds, [e, X.buildTextToSpeechHeaders.bind({}, (t == null ? void 0 : t.outputFormat) || "audio-16khz-128kbitrate-mono-mp3"), t.region, i]), _this31.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Text To Speech</b></div>\n <p>Insert text to synthesize it to audio.\n <p>\n Click <a href=\"".concat(ds.HELP_LINK, "\">here</a> for more info.\n </p>"), _this31.url = "", Object.assign(_this31.rawBody, t), (_a$lang = (a = _this31.rawBody).lang) !== null && _a$lang !== void 0 ? _a$lang : a.lang = "en-US", (_l$name = (l = _this31.rawBody).name) !== null && _l$name !== void 0 ? _l$name : l.name = "en-US-JennyNeural", (_c$gender = (c = _this31.rawBody).gender) !== null && _c$gender !== void 0 ? _c$gender : c.gender = "Female", _this31.url = "https://".concat(t.region, ".tts.speech.microsoft.com/cognitiveservices/v1");
|
7737
7764
|
return _this31;
|
7738
7765
|
}
|
7739
7766
|
_createClass(ds, [{
|
@@ -7757,7 +7784,7 @@ var cs = /*#__PURE__*/function (_ls) {
|
|
7757
7784
|
throw new Error("Request settings have not been set up");
|
7758
7785
|
case 2:
|
7759
7786
|
i = this.preprocessBody(this.rawBody, t);
|
7760
|
-
|
7787
|
+
S.request(this, i, e, !1);
|
7761
7788
|
case 4:
|
7762
7789
|
case "end":
|
7763
7790
|
return _context68.stop();
|
@@ -7806,11 +7833,10 @@ cs.HELP_LINK =
|
|
7806
7833
|
"https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest";
|
7807
7834
|
var Fo = cs;
|
7808
7835
|
var us = /*#__PURE__*/function (_ls2) {
|
7809
|
-
_inherits(
|
7810
|
-
|
7811
|
-
function zi(e) {
|
7836
|
+
_inherits(qi, _ls2);
|
7837
|
+
function qi(e) {
|
7812
7838
|
var _this32;
|
7813
|
-
_classCallCheck(this,
|
7839
|
+
_classCallCheck(this, qi);
|
7814
7840
|
var o, a, l;
|
7815
7841
|
var t = (a = (o = e.directConnection) == null ? void 0 : o.azure) == null ? void 0 : a.speechToText,
|
7816
7842
|
i = (l = e.directConnection) == null ? void 0 : l.azure,
|
@@ -7821,12 +7847,12 @@ var us = /*#__PURE__*/function (_ls2) {
|
|
7821
7847
|
}
|
7822
7848
|
}
|
7823
7849
|
};
|
7824
|
-
_this32 =
|
7850
|
+
_this32 = _callSuper(this, qi, [e, X.buildSpeechToTextHeaders, t.region, i, n]), _this32.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>Azure Speech To Text</b></div>\n <p><b>Upload a .wav or .ogg audio file</b> to transcribe it into text.\n <p>\n Click <a href=\"".concat(qi.HELP_LINK, "\">here</a> for more info.\n </p>"), _this32.url = "", _this32.isTextInputDisabled = !0, _this32.textInputPlaceholderText = "Upload an audio file", _this32.canSendMessage = qi.canFileSendMessage;
|
7825
7851
|
var r = t.lang || "en-US";
|
7826
7852
|
_this32.url = "https://".concat(t.region, ".stt.speech.microsoft.com/speech/recognition/conversation/cognitiveservices/v1?language=").concat(r, "&format=detailed"), _this32.recordAudio = void 0;
|
7827
7853
|
return _this32;
|
7828
7854
|
}
|
7829
|
-
_createClass(
|
7855
|
+
_createClass(qi, [{
|
7830
7856
|
key: "callServiceAPI",
|
7831
7857
|
value: function () {
|
7832
7858
|
var _callServiceAPI16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee70(e, t, i) {
|
@@ -7846,7 +7872,7 @@ var us = /*#__PURE__*/function (_ls2) {
|
|
7846
7872
|
}
|
7847
7873
|
throw new Error("No file was added");
|
7848
7874
|
case 4:
|
7849
|
-
(r = this.requestSettings) != null && r.headers && (this.requestSettings.headers["Content-Type"] = i[0].name.toLocaleLowerCase().endsWith(".wav") ? "audio/wav; codecs=audio/pcm; samplerate=16000" : "audio/ogg; codecs=opus"),
|
7875
|
+
(r = this.requestSettings) != null && r.headers && (this.requestSettings.headers["Content-Type"] = i[0].name.toLocaleLowerCase().endsWith(".wav") ? "audio/wav; codecs=audio/pcm; samplerate=16000" : "audio/ogg; codecs=opus"), S.request(this, i[0], e, !1);
|
7850
7876
|
case 5:
|
7851
7877
|
case "end":
|
7852
7878
|
return _context70.stop();
|
@@ -7891,15 +7917,14 @@ var us = /*#__PURE__*/function (_ls2) {
|
|
7891
7917
|
return !!(t != null && t[0]);
|
7892
7918
|
}
|
7893
7919
|
}]);
|
7894
|
-
return
|
7920
|
+
return qi;
|
7895
7921
|
}(ls);
|
7896
7922
|
us.HELP_LINK =
|
7897
7923
|
// eslint-disable-next-line max-len
|
7898
7924
|
"https://learn.microsoft.com/en-GB/azure/cognitive-services/speech-service/get-started-text-to-speech?tabs=windows%2Cterminal&pivots=programming-language-rest";
|
7899
7925
|
var Bo = us;
|
7900
|
-
var zo = /*#__PURE__*/function (
|
7901
|
-
_inherits(zo,
|
7902
|
-
var _super31 = _createSuper(zo);
|
7926
|
+
var zo = /*#__PURE__*/function (_q9) {
|
7927
|
+
_inherits(zo, _q9);
|
7903
7928
|
// prettier-ignore
|
7904
7929
|
function zo(e) {
|
7905
7930
|
var _this33;
|
@@ -7907,7 +7932,7 @@ var zo = /*#__PURE__*/function (_U9) {
|
|
7907
7932
|
var n, r, o;
|
7908
7933
|
var t = (r = (n = e.directConnection) == null ? void 0 : n.azure) == null ? void 0 : r.translation,
|
7909
7934
|
i = (o = e.directConnection) == null ? void 0 : o.azure;
|
7910
|
-
_this33 =
|
7935
|
+
_this33 = _callSuper(this, zo, [e, X.buildTranslationKeyVerificationDetails(t.region), X.buildTranslationHeaders.bind({}, t == null ? void 0 : t.region), i]), _this33.insertKeyPlaceholderText = "Azure Translate Subscription Key", _this33.getKeyLink =
|
7911
7936
|
// eslint-disable-next-line max-len
|
7912
7937
|
"https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions#create-and-manage-subscriptions-in-azure-portal", _this33.url = "", _this33.url = "https://api.cognitive.microsofttranslator.com/translate?api-version=3.0&to=".concat(t.language || "es");
|
7913
7938
|
return _this33;
|
@@ -7935,7 +7960,7 @@ var zo = /*#__PURE__*/function (_U9) {
|
|
7935
7960
|
throw new Error("Request settings have not been set up");
|
7936
7961
|
case 2:
|
7937
7962
|
i = this.preprocessBody(t);
|
7938
|
-
|
7963
|
+
S.request(this, i, e);
|
7939
7964
|
case 4:
|
7940
7965
|
case "end":
|
7941
7966
|
return _context72.stop();
|
@@ -7977,7 +8002,7 @@ var zo = /*#__PURE__*/function (_U9) {
|
|
7977
8002
|
}()
|
7978
8003
|
}]);
|
7979
8004
|
return zo;
|
7980
|
-
}(
|
8005
|
+
}(q);
|
7981
8006
|
var ge = /*#__PURE__*/function () {
|
7982
8007
|
function ge() {
|
7983
8008
|
_classCallCheck(this, ge);
|
@@ -8184,20 +8209,21 @@ var ge = /*#__PURE__*/function () {
|
|
8184
8209
|
}]);
|
8185
8210
|
return ge;
|
8186
8211
|
}();
|
8187
|
-
var
|
8188
|
-
_inherits(
|
8189
|
-
|
8190
|
-
function ae(e) {
|
8212
|
+
var ai = /*#__PURE__*/function (_q10) {
|
8213
|
+
_inherits(ne, _q10);
|
8214
|
+
function ne(e) {
|
8191
8215
|
var _l$headers, _c$OpenAIBeta;
|
8192
8216
|
var _this34;
|
8193
|
-
_classCallCheck(this,
|
8217
|
+
_classCallCheck(this, ne);
|
8194
8218
|
var r, o, a, l, c;
|
8195
8219
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
8196
8220
|
i = t.openAI;
|
8197
|
-
_this34 =
|
8221
|
+
_this34 = _callSuper(this, ne, [e, N.buildKeyVerificationDetails(), N.buildHeaders, i]), _this34.insertKeyPlaceholderText = "OpenAI API Key", _this34.getKeyLink = "https://platform.openai.com/account/api-keys", _this34.url = "", _this34.permittedErrorPrefixes = ["Incorrect"], _this34.searchedForThreadId = !1, _this34.newAssistantDetails = {
|
8222
|
+
model: "gpt-4"
|
8223
|
+
};
|
8198
8224
|
var n = (r = t.openAI) == null ? void 0 : r.assistant;
|
8199
8225
|
if (_typeof(n) == "object") {
|
8200
|
-
_this34.rawBody.
|
8226
|
+
_this34.rawBody.assistantId = n.assistant_id, Object.assign(_this34.newAssistantDetails, n.new_assistant);
|
8201
8227
|
var _ref10 = (a = (o = e.directConnection) == null ? void 0 : o.openAI) == null ? void 0 : a.assistant,
|
8202
8228
|
d = _ref10.function_handler;
|
8203
8229
|
d && (_this34._functionHandler = d);
|
@@ -8205,7 +8231,7 @@ var en = /*#__PURE__*/function (_U10) {
|
|
8205
8231
|
(_l$headers = (l = _this34.requestSettings).headers) !== null && _l$headers !== void 0 ? _l$headers : l.headers = {}, (_c$OpenAIBeta = (c = _this34.requestSettings.headers)["OpenAI-Beta"]) !== null && _c$OpenAIBeta !== void 0 ? _c$OpenAIBeta : c["OpenAI-Beta"] = "assistants=v1", _this34.maxMessages = 1;
|
8206
8232
|
return _this34;
|
8207
8233
|
}
|
8208
|
-
_createClass(
|
8234
|
+
_createClass(ne, [{
|
8209
8235
|
key: "processMessage",
|
8210
8236
|
value: function processMessage(e, t) {
|
8211
8237
|
var i = this.totalMessagesMaxCharLength || -1;
|
@@ -8228,13 +8254,13 @@ var en = /*#__PURE__*/function (_U10) {
|
|
8228
8254
|
key: "callService",
|
8229
8255
|
value: function callService(e, t, i) {
|
8230
8256
|
if (this.sessionId) {
|
8231
|
-
this.url = "".concat(
|
8257
|
+
this.url = "".concat(ne.THREAD_PREFIX, "/").concat(this.sessionId, "/messages");
|
8232
8258
|
var n = this.processMessage(t, i);
|
8233
|
-
|
8259
|
+
S.request(this, n, e);
|
8234
8260
|
} else {
|
8235
|
-
this.url = "".concat(
|
8261
|
+
this.url = "".concat(ne.THREAD_PREFIX, "/runs");
|
8236
8262
|
var _n2 = this.createNewThreadMessages(this.rawBody, t, i);
|
8237
|
-
|
8263
|
+
S.request(this, _n2, e);
|
8238
8264
|
}
|
8239
8265
|
this.messages = e;
|
8240
8266
|
}
|
@@ -8252,23 +8278,31 @@ var en = /*#__PURE__*/function (_U10) {
|
|
8252
8278
|
}
|
8253
8279
|
throw new Error("Request settings have not been set up");
|
8254
8280
|
case 2:
|
8255
|
-
|
8256
|
-
if (
|
8257
|
-
_context79.next =
|
8281
|
+
_context79.t0 = this.rawBody.assistant_id;
|
8282
|
+
if (_context79.t0) {
|
8283
|
+
_context79.next = 6;
|
8258
8284
|
break;
|
8259
8285
|
}
|
8260
8286
|
_context79.next = 6;
|
8261
|
-
return
|
8287
|
+
return this.createNewAssistant();
|
8262
8288
|
case 6:
|
8263
|
-
|
8289
|
+
this.searchedForThreadId || this.searchPreviousMessagesForThreadId(e.messages);
|
8290
|
+
if (!i) {
|
8291
|
+
_context79.next = 13;
|
8292
|
+
break;
|
8293
|
+
}
|
8264
8294
|
_context79.next = 10;
|
8265
|
-
|
8266
|
-
case 9:
|
8267
|
-
_context79.t0 = void 0;
|
8295
|
+
return ge.storeFiles(this, e, i);
|
8268
8296
|
case 10:
|
8269
|
-
|
8297
|
+
_context79.t1 = _context79.sent;
|
8298
|
+
_context79.next = 14;
|
8299
|
+
break;
|
8300
|
+
case 13:
|
8301
|
+
_context79.t1 = void 0;
|
8302
|
+
case 14:
|
8303
|
+
n = _context79.t1;
|
8270
8304
|
this.requestSettings.method = "POST", this.callService(e, t, n);
|
8271
|
-
case
|
8305
|
+
case 16:
|
8272
8306
|
case "end":
|
8273
8307
|
return _context79.stop();
|
8274
8308
|
}
|
@@ -8279,6 +8313,38 @@ var en = /*#__PURE__*/function (_U10) {
|
|
8279
8313
|
}
|
8280
8314
|
return callServiceAPI;
|
8281
8315
|
}()
|
8316
|
+
}, {
|
8317
|
+
key: "createNewAssistant",
|
8318
|
+
value: function () {
|
8319
|
+
var _createNewAssistant = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee80() {
|
8320
|
+
var e;
|
8321
|
+
return _regeneratorRuntime().wrap(function _callee80$(_context80) {
|
8322
|
+
while (1) switch (_context80.prev = _context80.next) {
|
8323
|
+
case 0:
|
8324
|
+
_context80.prev = 0;
|
8325
|
+
this.url = ne.NEW_ASSISTANT_URL;
|
8326
|
+
_context80.next = 4;
|
8327
|
+
return N.directFetch(this, JSON.parse(JSON.stringify(this.newAssistantDetails)), "POST");
|
8328
|
+
case 4:
|
8329
|
+
e = _context80.sent;
|
8330
|
+
this.rawBody.assistant_id = e.id;
|
8331
|
+
_context80.next = 11;
|
8332
|
+
break;
|
8333
|
+
case 8:
|
8334
|
+
_context80.prev = 8;
|
8335
|
+
_context80.t0 = _context80["catch"](0);
|
8336
|
+
console.error(_context80.t0), console.error("Failed to create a new assistant");
|
8337
|
+
case 11:
|
8338
|
+
case "end":
|
8339
|
+
return _context80.stop();
|
8340
|
+
}
|
8341
|
+
}, _callee80, this, [[0, 8]]);
|
8342
|
+
}));
|
8343
|
+
function createNewAssistant() {
|
8344
|
+
return _createNewAssistant.apply(this, arguments);
|
8345
|
+
}
|
8346
|
+
return createNewAssistant;
|
8347
|
+
}()
|
8282
8348
|
}, {
|
8283
8349
|
key: "searchPreviousMessagesForThreadId",
|
8284
8350
|
value: function searchPreviousMessagesForThreadId(e) {
|
@@ -8290,32 +8356,32 @@ var en = /*#__PURE__*/function (_U10) {
|
|
8290
8356
|
}, {
|
8291
8357
|
key: "extractResultData",
|
8292
8358
|
value: function () {
|
8293
|
-
var _extractResultData21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
8359
|
+
var _extractResultData21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee81(e) {
|
8294
8360
|
var n, t, i;
|
8295
|
-
return _regeneratorRuntime().wrap(function
|
8296
|
-
while (1) switch (
|
8361
|
+
return _regeneratorRuntime().wrap(function _callee81$(_context81) {
|
8362
|
+
while (1) switch (_context81.prev = _context81.next) {
|
8297
8363
|
case 0:
|
8298
8364
|
if (!e.error) {
|
8299
|
-
|
8365
|
+
_context81.next = 2;
|
8300
8366
|
break;
|
8301
8367
|
}
|
8302
8368
|
throw e.error.message;
|
8303
8369
|
case 2:
|
8304
|
-
|
8370
|
+
_context81.next = 4;
|
8305
8371
|
return this.assignThreadAndRun(e);
|
8306
8372
|
case 4:
|
8307
|
-
t = "".concat(
|
8373
|
+
t = "".concat(ne.THREAD_PREFIX, "/").concat(this.sessionId, "/runs/").concat(this.run_id), i = {
|
8308
8374
|
method: "GET",
|
8309
8375
|
headers: (n = this.requestSettings) == null ? void 0 : n.headers
|
8310
8376
|
};
|
8311
|
-
return
|
8377
|
+
return _context81.abrupt("return", (S.executePollRequest(this, t, i, this.messages), {
|
8312
8378
|
makingAnotherRequest: !0
|
8313
8379
|
}));
|
8314
8380
|
case 6:
|
8315
8381
|
case "end":
|
8316
|
-
return
|
8382
|
+
return _context81.stop();
|
8317
8383
|
}
|
8318
|
-
},
|
8384
|
+
}, _callee81, this);
|
8319
8385
|
}));
|
8320
8386
|
function extractResultData(_x151) {
|
8321
8387
|
return _extractResultData21.apply(this, arguments);
|
@@ -8325,30 +8391,30 @@ var en = /*#__PURE__*/function (_U10) {
|
|
8325
8391
|
}, {
|
8326
8392
|
key: "assignThreadAndRun",
|
8327
8393
|
value: function () {
|
8328
|
-
var _assignThreadAndRun = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
8394
|
+
var _assignThreadAndRun = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee82(e) {
|
8329
8395
|
var t;
|
8330
|
-
return _regeneratorRuntime().wrap(function
|
8331
|
-
while (1) switch (
|
8396
|
+
return _regeneratorRuntime().wrap(function _callee82$(_context82) {
|
8397
|
+
while (1) switch (_context82.prev = _context82.next) {
|
8332
8398
|
case 0:
|
8333
8399
|
if (!this.sessionId) {
|
8334
|
-
|
8400
|
+
_context82.next = 8;
|
8335
8401
|
break;
|
8336
8402
|
}
|
8337
|
-
this.url = "".concat(
|
8338
|
-
|
8403
|
+
this.url = "".concat(ne.THREAD_PREFIX, "/").concat(this.sessionId, "/runs");
|
8404
|
+
_context82.next = 4;
|
8339
8405
|
return N.directFetch(this, JSON.parse(JSON.stringify(this.rawBody)), "POST");
|
8340
8406
|
case 4:
|
8341
|
-
t =
|
8407
|
+
t = _context82.sent;
|
8342
8408
|
this.run_id = t.id;
|
8343
|
-
|
8409
|
+
_context82.next = 9;
|
8344
8410
|
break;
|
8345
8411
|
case 8:
|
8346
8412
|
this.sessionId = e.thread_id, this.run_id = e.id, this.messages && (this.messages.messages[this.messages.messages.length - 1]._sessionId = this.sessionId);
|
8347
8413
|
case 9:
|
8348
8414
|
case "end":
|
8349
|
-
return
|
8415
|
+
return _context82.stop();
|
8350
8416
|
}
|
8351
|
-
},
|
8417
|
+
}, _callee82, this);
|
8352
8418
|
}));
|
8353
8419
|
function assignThreadAndRun(_x152) {
|
8354
8420
|
return _assignThreadAndRun.apply(this, arguments);
|
@@ -8358,39 +8424,39 @@ var en = /*#__PURE__*/function (_U10) {
|
|
8358
8424
|
}, {
|
8359
8425
|
key: "extractPollResultData",
|
8360
8426
|
value: function () {
|
8361
|
-
var _extractPollResultData5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
8427
|
+
var _extractPollResultData5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee83(e) {
|
8362
8428
|
var r, t, i, a, l, _yield$ge$getFilesAnd, c, d, n;
|
8363
|
-
return _regeneratorRuntime().wrap(function
|
8364
|
-
while (1) switch (
|
8429
|
+
return _regeneratorRuntime().wrap(function _callee83$(_context83) {
|
8430
|
+
while (1) switch (_context83.prev = _context83.next) {
|
8365
8431
|
case 0:
|
8366
8432
|
t = e.status, i = e.required_action;
|
8367
8433
|
if (!(t === "queued" || t === "in_progress")) {
|
8368
|
-
|
8434
|
+
_context83.next = 3;
|
8369
8435
|
break;
|
8370
8436
|
}
|
8371
|
-
return
|
8372
|
-
timeoutMS:
|
8437
|
+
return _context83.abrupt("return", {
|
8438
|
+
timeoutMS: ne.POLLING_TIMEOUT_MS
|
8373
8439
|
});
|
8374
8440
|
case 3:
|
8375
8441
|
if (!(t === "completed" && this.messages)) {
|
8376
|
-
|
8442
|
+
_context83.next = 15;
|
8377
8443
|
break;
|
8378
8444
|
}
|
8379
|
-
this.url = "".concat(
|
8380
|
-
|
8445
|
+
this.url = "".concat(ne.THREAD_PREFIX, "/").concat(e.thread_id, "/messages");
|
8446
|
+
_context83.next = 7;
|
8381
8447
|
return N.directFetch(this, {}, "GET");
|
8382
8448
|
case 7:
|
8383
|
-
a =
|
8449
|
+
a = _context83.sent.data[0];
|
8384
8450
|
l = a.content.find(function (u) {
|
8385
8451
|
return !!u.text || !!u.image_file;
|
8386
8452
|
});
|
8387
|
-
|
8453
|
+
_context83.next = 11;
|
8388
8454
|
return ge.getFilesAndText(this, a, l);
|
8389
8455
|
case 11:
|
8390
|
-
_yield$ge$getFilesAnd =
|
8456
|
+
_yield$ge$getFilesAnd = _context83.sent;
|
8391
8457
|
c = _yield$ge$getFilesAnd.text;
|
8392
8458
|
d = _yield$ge$getFilesAnd.files;
|
8393
|
-
return
|
8459
|
+
return _context83.abrupt("return", {
|
8394
8460
|
text: c,
|
8395
8461
|
_sessionId: this.sessionId,
|
8396
8462
|
files: d
|
@@ -8398,20 +8464,20 @@ var en = /*#__PURE__*/function (_U10) {
|
|
8398
8464
|
case 15:
|
8399
8465
|
n = (r = i == null ? void 0 : i.submit_tool_outputs) == null ? void 0 : r.tool_calls;
|
8400
8466
|
if (!(t === "requires_action" && n)) {
|
8401
|
-
|
8467
|
+
_context83.next = 20;
|
8402
8468
|
break;
|
8403
8469
|
}
|
8404
|
-
|
8470
|
+
_context83.next = 19;
|
8405
8471
|
return this.handleTools(n);
|
8406
8472
|
case 19:
|
8407
|
-
return
|
8473
|
+
return _context83.abrupt("return", _context83.sent);
|
8408
8474
|
case 20:
|
8409
8475
|
throw Error("Thread run status: ".concat(t));
|
8410
8476
|
case 21:
|
8411
8477
|
case "end":
|
8412
|
-
return
|
8478
|
+
return _context83.stop();
|
8413
8479
|
}
|
8414
|
-
},
|
8480
|
+
}, _callee83, this);
|
8415
8481
|
}));
|
8416
8482
|
function extractPollResultData(_x153) {
|
8417
8483
|
return _extractPollResultData5.apply(this, arguments);
|
@@ -8421,13 +8487,13 @@ var en = /*#__PURE__*/function (_U10) {
|
|
8421
8487
|
}, {
|
8422
8488
|
key: "handleTools",
|
8423
8489
|
value: function () {
|
8424
|
-
var _handleTools = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
8490
|
+
var _handleTools = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee84(e) {
|
8425
8491
|
var t, i, n;
|
8426
|
-
return _regeneratorRuntime().wrap(function
|
8427
|
-
while (1) switch (
|
8492
|
+
return _regeneratorRuntime().wrap(function _callee84$(_context84) {
|
8493
|
+
while (1) switch (_context84.prev = _context84.next) {
|
8428
8494
|
case 0:
|
8429
8495
|
if (this._functionHandler) {
|
8430
|
-
|
8496
|
+
_context84.next = 2;
|
8431
8497
|
break;
|
8432
8498
|
}
|
8433
8499
|
throw Error("Please define the `function_handler` property inside the [openAI](https://deepchat.dev/docs/directConnection/openAI#Assistant) object.");
|
@@ -8438,14 +8504,14 @@ var en = /*#__PURE__*/function (_U10) {
|
|
8438
8504
|
arguments: r["function"].arguments
|
8439
8505
|
};
|
8440
8506
|
});
|
8441
|
-
|
8507
|
+
_context84.next = 5;
|
8442
8508
|
return this._functionHandler(t);
|
8443
8509
|
case 5:
|
8444
|
-
i =
|
8510
|
+
i = _context84.sent;
|
8445
8511
|
if (!(!Array.isArray(i) || i.find(function (r) {
|
8446
8512
|
return typeof r != "string";
|
8447
8513
|
}) || e.length !== i.length)) {
|
8448
|
-
|
8514
|
+
_context84.next = 8;
|
8449
8515
|
break;
|
8450
8516
|
}
|
8451
8517
|
throw Error("Response must contain an array of strings for each individual function/tool_call, see https://deepchat.dev/docs/directConnection/OpenAI/#assistant-functions.");
|
@@ -8456,20 +8522,20 @@ var en = /*#__PURE__*/function (_U10) {
|
|
8456
8522
|
output: r
|
8457
8523
|
};
|
8458
8524
|
});
|
8459
|
-
this.url = "".concat(
|
8460
|
-
|
8525
|
+
this.url = "".concat(ne.THREAD_PREFIX, "/").concat(this.sessionId, "/runs/").concat(this.run_id, "/submit_tool_outputs");
|
8526
|
+
_context84.next = 12;
|
8461
8527
|
return N.directFetch(this, {
|
8462
8528
|
tool_outputs: n
|
8463
8529
|
}, "POST");
|
8464
8530
|
case 12:
|
8465
|
-
return
|
8466
|
-
timeoutMS:
|
8531
|
+
return _context84.abrupt("return", {
|
8532
|
+
timeoutMS: ne.POLLING_TIMEOUT_MS
|
8467
8533
|
});
|
8468
8534
|
case 13:
|
8469
8535
|
case "end":
|
8470
|
-
return
|
8536
|
+
return _context84.stop();
|
8471
8537
|
}
|
8472
|
-
},
|
8538
|
+
}, _callee84, this);
|
8473
8539
|
}));
|
8474
8540
|
function handleTools(_x154) {
|
8475
8541
|
return _handleTools.apply(this, arguments);
|
@@ -8477,17 +8543,17 @@ var en = /*#__PURE__*/function (_U10) {
|
|
8477
8543
|
return handleTools;
|
8478
8544
|
}()
|
8479
8545
|
}]);
|
8480
|
-
return
|
8481
|
-
}(
|
8482
|
-
|
8483
|
-
|
8484
|
-
|
8485
|
-
var
|
8486
|
-
|
8487
|
-
|
8488
|
-
function
|
8546
|
+
return ne;
|
8547
|
+
}(q);
|
8548
|
+
ai.THREAD_PREFIX = "https://api.openai.com/v1/threads";
|
8549
|
+
ai.NEW_ASSISTANT_URL = "https://api.openai.com/v1/assistants";
|
8550
|
+
ai.POLLING_TIMEOUT_MS = 800;
|
8551
|
+
var qo = ai;
|
8552
|
+
var li = /*#__PURE__*/function (_q11) {
|
8553
|
+
_inherits(Se, _q11);
|
8554
|
+
function Se(e) {
|
8489
8555
|
var _this35;
|
8490
|
-
_classCallCheck(this,
|
8556
|
+
_classCallCheck(this, Se);
|
8491
8557
|
var o;
|
8492
8558
|
var t = e.directConnection,
|
8493
8559
|
i = t == null ? void 0 : t.openAI,
|
@@ -8499,7 +8565,7 @@ var ai = /*#__PURE__*/function (_U11) {
|
|
8499
8565
|
}
|
8500
8566
|
}
|
8501
8567
|
};
|
8502
|
-
_this35 =
|
8568
|
+
_this35 = _callSuper(this, Se, [e, N.buildKeyVerificationDetails(), N.buildHeaders, i, n]), _this35.insertKeyPlaceholderText = "OpenAI API Key", _this35.getKeyLink = "https://platform.openai.com/account/api-keys", _this35.introPanelMarkUp = "\n <div style=\"width: 100%; text-align: center; margin-left: -10px\"><b>OpenAI DALL\xB7E</b></div>\n <p><b>Insert text</b> to generate an image.</p>\n <p><b>Upload 1</b> PNG image to generate its variation and optionally insert text to specify the change.</p>\n <p><b>Upload 2</b> PNG images where the second is a copy of the first with a transparent area where the edit should\n take place and text to specify the edit.</p>\n <p>Click <a href=\"https://platform.openai.com/docs/guides/images/introduction\">here</a> for more info.</p>", _this35.url = "", _this35.permittedErrorPrefixes = ["Incorrect", "Invalid input image"];
|
8503
8569
|
var r = (o = t == null ? void 0 : t.openAI) == null ? void 0 : o.images;
|
8504
8570
|
if (_this35.camera) {
|
8505
8571
|
var a = _typeof(r) == "object" && r.size ? Number.parseInt(r.size) : 1024;
|
@@ -8510,10 +8576,10 @@ var ai = /*#__PURE__*/function (_U11) {
|
|
8510
8576
|
}
|
8511
8577
|
};
|
8512
8578
|
}
|
8513
|
-
_typeof(r) == "object" && Object.assign(_this35.rawBody, r), _this35.canSendMessage =
|
8579
|
+
_typeof(r) == "object" && Object.assign(_this35.rawBody, r), _this35.canSendMessage = Se.canFileSendMessage;
|
8514
8580
|
return _this35;
|
8515
8581
|
}
|
8516
|
-
_createClass(
|
8582
|
+
_createClass(Se, [{
|
8517
8583
|
key: "preprocessBody",
|
8518
8584
|
value: function preprocessBody(e, t) {
|
8519
8585
|
var i = JSON.parse(JSON.stringify(e));
|
@@ -8527,48 +8593,48 @@ var ai = /*#__PURE__*/function (_U11) {
|
|
8527
8593
|
var n;
|
8528
8594
|
var r = (a = (o = t[t.length - 1]) == null ? void 0 : o.text) == null ? void 0 : a.trim();
|
8529
8595
|
if (i[1] || r && r !== "") {
|
8530
|
-
this.url =
|
8596
|
+
this.url = Se.IMAGE_EDIT_URL;
|
8531
8597
|
var l = this.preprocessBody(this.rawBody, r);
|
8532
|
-
n =
|
8533
|
-
} else this.url =
|
8534
|
-
E.tempRemoveContentHeader(this.requestSettings,
|
8598
|
+
n = Se.createFormDataBody(l, i[0], i[1]);
|
8599
|
+
} else this.url = Se.IMAGE_VARIATIONS_URL, n = Se.createFormDataBody(this.rawBody, i[0]);
|
8600
|
+
E.tempRemoveContentHeader(this.requestSettings, S.request.bind(this, this, n, e), !1);
|
8535
8601
|
}
|
8536
8602
|
}, {
|
8537
8603
|
key: "callServiceAPI",
|
8538
8604
|
value: function () {
|
8539
|
-
var _callServiceAPI19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
8605
|
+
var _callServiceAPI19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee85(e, t, i) {
|
8540
8606
|
var n, r;
|
8541
|
-
return _regeneratorRuntime().wrap(function
|
8542
|
-
while (1) switch (
|
8607
|
+
return _regeneratorRuntime().wrap(function _callee85$(_context85) {
|
8608
|
+
while (1) switch (_context85.prev = _context85.next) {
|
8543
8609
|
case 0:
|
8544
8610
|
if ((n = this.requestSettings) != null && n.headers) {
|
8545
|
-
|
8611
|
+
_context85.next = 2;
|
8546
8612
|
break;
|
8547
8613
|
}
|
8548
8614
|
throw new Error("Request settings have not been set up");
|
8549
8615
|
case 2:
|
8550
8616
|
if (!(i != null && i[0])) {
|
8551
|
-
|
8617
|
+
_context85.next = 6;
|
8552
8618
|
break;
|
8553
8619
|
}
|
8554
8620
|
this.callApiWithImage(e, t, i);
|
8555
|
-
|
8621
|
+
_context85.next = 11;
|
8556
8622
|
break;
|
8557
8623
|
case 6:
|
8558
8624
|
if (this.requestSettings) {
|
8559
|
-
|
8625
|
+
_context85.next = 8;
|
8560
8626
|
break;
|
8561
8627
|
}
|
8562
8628
|
throw new Error("Request settings have not been set up");
|
8563
8629
|
case 8:
|
8564
|
-
this.url =
|
8630
|
+
this.url = Se.IMAGE_GENERATION_URL;
|
8565
8631
|
r = this.preprocessBody(this.rawBody, t[t.length - 1].text);
|
8566
|
-
|
8632
|
+
S.request(this, r, e);
|
8567
8633
|
case 11:
|
8568
8634
|
case "end":
|
8569
|
-
return
|
8635
|
+
return _context85.stop();
|
8570
8636
|
}
|
8571
|
-
},
|
8637
|
+
}, _callee85, this);
|
8572
8638
|
}));
|
8573
8639
|
function callServiceAPI(_x155, _x156, _x157) {
|
8574
8640
|
return _callServiceAPI19.apply(this, arguments);
|
@@ -8578,32 +8644,32 @@ var ai = /*#__PURE__*/function (_U11) {
|
|
8578
8644
|
}, {
|
8579
8645
|
key: "extractResultData",
|
8580
8646
|
value: function () {
|
8581
|
-
var _extractResultData22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
8582
|
-
return _regeneratorRuntime().wrap(function
|
8583
|
-
while (1) switch (
|
8647
|
+
var _extractResultData22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee86(e) {
|
8648
|
+
return _regeneratorRuntime().wrap(function _callee86$(_context86) {
|
8649
|
+
while (1) switch (_context86.prev = _context86.next) {
|
8584
8650
|
case 0:
|
8585
8651
|
if (!e.error) {
|
8586
|
-
|
8652
|
+
_context86.next = 2;
|
8587
8653
|
break;
|
8588
8654
|
}
|
8589
8655
|
throw e.error.message;
|
8590
8656
|
case 2:
|
8591
|
-
return
|
8657
|
+
return _context86.abrupt("return", {
|
8592
8658
|
files: e.data.map(function (i) {
|
8593
8659
|
return i.url ? {
|
8594
8660
|
src: i.url,
|
8595
8661
|
type: "image"
|
8596
8662
|
} : {
|
8597
|
-
src: "".concat(
|
8663
|
+
src: "".concat(St).concat(i.b64_json),
|
8598
8664
|
type: "image"
|
8599
8665
|
};
|
8600
8666
|
})
|
8601
8667
|
});
|
8602
8668
|
case 3:
|
8603
8669
|
case "end":
|
8604
|
-
return
|
8670
|
+
return _context86.stop();
|
8605
8671
|
}
|
8606
|
-
},
|
8672
|
+
}, _callee86);
|
8607
8673
|
}));
|
8608
8674
|
function extractResultData(_x158) {
|
8609
8675
|
return _extractResultData22.apply(this, arguments);
|
@@ -8632,15 +8698,14 @@ var ai = /*#__PURE__*/function (_U11) {
|
|
8632
8698
|
}), n;
|
8633
8699
|
}
|
8634
8700
|
}]);
|
8635
|
-
return
|
8636
|
-
}(
|
8637
|
-
|
8638
|
-
|
8639
|
-
|
8640
|
-
var
|
8641
|
-
var ht = /*#__PURE__*/function (
|
8642
|
-
_inherits(ht,
|
8643
|
-
var _super34 = _createSuper(ht);
|
8701
|
+
return Se;
|
8702
|
+
}(q);
|
8703
|
+
li.IMAGE_GENERATION_URL = "https://api.openai.com/v1/images/generations";
|
8704
|
+
li.IMAGE_VARIATIONS_URL = "https://api.openai.com/v1/images/variations";
|
8705
|
+
li.IMAGE_EDIT_URL = "https://api.openai.com/v1/images/edits";
|
8706
|
+
var Uo = li;
|
8707
|
+
var ht = /*#__PURE__*/function (_q12) {
|
8708
|
+
_inherits(ht, _q12);
|
8644
8709
|
function ht(e) {
|
8645
8710
|
var _this36$maxMessages, _l$model;
|
8646
8711
|
var _this36;
|
@@ -8648,7 +8713,7 @@ var ht = /*#__PURE__*/function (_U12) {
|
|
8648
8713
|
var r, o, a, l;
|
8649
8714
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
8650
8715
|
i = t.openAI;
|
8651
|
-
_this36 =
|
8716
|
+
_this36 = _callSuper(this, ht, [e, N.buildKeyVerificationDetails(), N.buildHeaders, i]), _this36.insertKeyPlaceholderText = "OpenAI API Key", _this36.getKeyLink = "https://platform.openai.com/account/api-keys", _this36.url = "https://api.openai.com/v1/chat/completions", _this36.permittedErrorPrefixes = ["Incorrect"], _this36._systemMessage = ht.generateSystemMessage("You are a helpful assistant.");
|
8652
8717
|
var n = (r = t.openAI) == null ? void 0 : r.chat;
|
8653
8718
|
if (_typeof(n) == "object") {
|
8654
8719
|
n.system_prompt && (_this36._systemMessage = ht.generateSystemMessage(n.system_prompt));
|
@@ -8684,24 +8749,24 @@ var ht = /*#__PURE__*/function (_U12) {
|
|
8684
8749
|
}, {
|
8685
8750
|
key: "callServiceAPI",
|
8686
8751
|
value: function () {
|
8687
|
-
var _callServiceAPI20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
8752
|
+
var _callServiceAPI20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee87(e, t) {
|
8688
8753
|
var i, n;
|
8689
|
-
return _regeneratorRuntime().wrap(function
|
8690
|
-
while (1) switch (
|
8754
|
+
return _regeneratorRuntime().wrap(function _callee87$(_context87) {
|
8755
|
+
while (1) switch (_context87.prev = _context87.next) {
|
8691
8756
|
case 0:
|
8692
8757
|
if (this.requestSettings) {
|
8693
|
-
|
8758
|
+
_context87.next = 2;
|
8694
8759
|
break;
|
8695
8760
|
}
|
8696
8761
|
throw new Error("Request settings have not been set up");
|
8697
8762
|
case 2:
|
8698
8763
|
i = this.preprocessBody(this.rawBody, t), n = this.deepChat.stream;
|
8699
|
-
n && (_typeof(n) != "object" || !n.simulation) || i.stream ? (i.stream = !0,
|
8764
|
+
n && (_typeof(n) != "object" || !n.simulation) || i.stream ? (i.stream = !0, L.request(this, i, e)) : S.request(this, i, e);
|
8700
8765
|
case 4:
|
8701
8766
|
case "end":
|
8702
|
-
return
|
8767
|
+
return _context87.stop();
|
8703
8768
|
}
|
8704
|
-
},
|
8769
|
+
}, _callee87, this);
|
8705
8770
|
}));
|
8706
8771
|
function callServiceAPI(_x159, _x160) {
|
8707
8772
|
return _callServiceAPI20.apply(this, arguments);
|
@@ -8711,17 +8776,17 @@ var ht = /*#__PURE__*/function (_U12) {
|
|
8711
8776
|
}, {
|
8712
8777
|
key: "extractResultData",
|
8713
8778
|
value: function () {
|
8714
|
-
var _extractResultData23 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
8715
|
-
return _regeneratorRuntime().wrap(function
|
8716
|
-
while (1) switch (
|
8779
|
+
var _extractResultData23 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee88(e, t, i) {
|
8780
|
+
return _regeneratorRuntime().wrap(function _callee88$(_context88) {
|
8781
|
+
while (1) switch (_context88.prev = _context88.next) {
|
8717
8782
|
case 0:
|
8718
8783
|
if (!e.error) {
|
8719
|
-
|
8784
|
+
_context88.next = 2;
|
8720
8785
|
break;
|
8721
8786
|
}
|
8722
8787
|
throw e.error.message;
|
8723
8788
|
case 2:
|
8724
|
-
return
|
8789
|
+
return _context88.abrupt("return", e.choices[0].delta ? {
|
8725
8790
|
text: e.choices[0].delta.content || ""
|
8726
8791
|
} : e.choices[0].message ? e.choices[0].message.tool_calls ? this.handleTools(e.choices[0].message, t, i) : {
|
8727
8792
|
text: e.choices[0].message.content
|
@@ -8730,9 +8795,9 @@ var ht = /*#__PURE__*/function (_U12) {
|
|
8730
8795
|
});
|
8731
8796
|
case 3:
|
8732
8797
|
case "end":
|
8733
|
-
return
|
8798
|
+
return _context88.stop();
|
8734
8799
|
}
|
8735
|
-
},
|
8800
|
+
}, _callee88, this);
|
8736
8801
|
}));
|
8737
8802
|
function extractResultData(_x161, _x162, _x163) {
|
8738
8803
|
return _extractResultData23.apply(this, arguments);
|
@@ -8742,13 +8807,13 @@ var ht = /*#__PURE__*/function (_U12) {
|
|
8742
8807
|
}, {
|
8743
8808
|
key: "handleTools",
|
8744
8809
|
value: function () {
|
8745
|
-
var _handleTools2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
8810
|
+
var _handleTools2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee89(e, t, i) {
|
8746
8811
|
var a, n, r, o, l;
|
8747
|
-
return _regeneratorRuntime().wrap(function
|
8748
|
-
while (1) switch (
|
8812
|
+
return _regeneratorRuntime().wrap(function _callee89$(_context89) {
|
8813
|
+
while (1) switch (_context89.prev = _context89.next) {
|
8749
8814
|
case 0:
|
8750
8815
|
if (!(!e.tool_calls || !t || !i || !this._functionHandler)) {
|
8751
|
-
|
8816
|
+
_context89.next = 2;
|
8752
8817
|
break;
|
8753
8818
|
}
|
8754
8819
|
throw Error("Please define the `function_handler` property inside the [openAI](https://deepchat.dev/docs/directConnection/openAI#Chat) object.");
|
@@ -8760,22 +8825,22 @@ var ht = /*#__PURE__*/function (_U12) {
|
|
8760
8825
|
arguments: l["function"].arguments
|
8761
8826
|
};
|
8762
8827
|
});
|
8763
|
-
|
8828
|
+
_context89.next = 6;
|
8764
8829
|
return (a = this._functionHandler) == null ? void 0 : a.call(this, r);
|
8765
8830
|
case 6:
|
8766
|
-
o =
|
8831
|
+
o = _context89.sent;
|
8767
8832
|
if (!o.text) {
|
8768
|
-
|
8833
|
+
_context89.next = 9;
|
8769
8834
|
break;
|
8770
8835
|
}
|
8771
|
-
return
|
8836
|
+
return _context89.abrupt("return", {
|
8772
8837
|
text: o.text
|
8773
8838
|
});
|
8774
8839
|
case 9:
|
8775
8840
|
if (!(n.messages.push(e), Array.isArray(o) && !o.find(function (l) {
|
8776
8841
|
return typeof l != "string";
|
8777
8842
|
}) || r.length === o.length)) {
|
8778
|
-
|
8843
|
+
_context89.next = 17;
|
8779
8844
|
break;
|
8780
8845
|
}
|
8781
8846
|
o.forEach(function (c, d) {
|
@@ -8788,28 +8853,28 @@ var ht = /*#__PURE__*/function (_U12) {
|
|
8788
8853
|
content: c.response
|
8789
8854
|
});
|
8790
8855
|
}), delete n.tools, delete n.tool_choice;
|
8791
|
-
|
8856
|
+
_context89.next = 13;
|
8792
8857
|
return t == null ? void 0 : t(n).then(function (c) {
|
8793
8858
|
return E.processResponseByType(c);
|
8794
8859
|
});
|
8795
8860
|
case 13:
|
8796
|
-
l =
|
8861
|
+
l = _context89.sent;
|
8797
8862
|
if (!l.error) {
|
8798
|
-
|
8863
|
+
_context89.next = 16;
|
8799
8864
|
break;
|
8800
8865
|
}
|
8801
8866
|
throw l.error.message;
|
8802
8867
|
case 16:
|
8803
|
-
return
|
8868
|
+
return _context89.abrupt("return", {
|
8804
8869
|
text: l.choices[0].message.content || ""
|
8805
8870
|
});
|
8806
8871
|
case 17:
|
8807
8872
|
throw Error("Response object must either be {response: string}[] for each individual function or {text: string} for a direct response, see https://deepchat.dev/docs/directConnection/OpenAI#FunctionHandler.");
|
8808
8873
|
case 18:
|
8809
8874
|
case "end":
|
8810
|
-
return
|
8875
|
+
return _context89.stop();
|
8811
8876
|
}
|
8812
|
-
},
|
8877
|
+
}, _callee89, this);
|
8813
8878
|
}));
|
8814
8879
|
function handleTools(_x164, _x165, _x166) {
|
8815
8880
|
return _handleTools2.apply(this, arguments);
|
@@ -8845,10 +8910,9 @@ var ht = /*#__PURE__*/function (_U12) {
|
|
8845
8910
|
}
|
8846
8911
|
}]);
|
8847
8912
|
return ht;
|
8848
|
-
}(
|
8849
|
-
var Ho = /*#__PURE__*/function (
|
8850
|
-
_inherits(Ho,
|
8851
|
-
var _super35 = _createSuper(Ho);
|
8913
|
+
}(q);
|
8914
|
+
var Ho = /*#__PURE__*/function (_Xi3) {
|
8915
|
+
_inherits(Ho, _Xi3);
|
8852
8916
|
function Ho(e) {
|
8853
8917
|
var _this37$maxMessages;
|
8854
8918
|
var _this37;
|
@@ -8857,7 +8921,7 @@ var Ho = /*#__PURE__*/function (_Zi3) {
|
|
8857
8921
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
8858
8922
|
i = (r = t.cohere) == null ? void 0 : r.chat,
|
8859
8923
|
n = t.cohere;
|
8860
|
-
_this37 =
|
8924
|
+
_this37 = _callSuper(this, Ho, [e, "https://api.cohere.ai/v1/chat", "Ask me anything!", i, n]), _typeof(i) == "object" && Object.assign(_this37.rawBody, i), (_this37$maxMessages = _this37.maxMessages) !== null && _this37$maxMessages !== void 0 ? _this37$maxMessages : _this37.maxMessages = -1;
|
8861
8925
|
return _this37;
|
8862
8926
|
}
|
8863
8927
|
_createClass(Ho, [{
|
@@ -8877,24 +8941,24 @@ var Ho = /*#__PURE__*/function (_Zi3) {
|
|
8877
8941
|
}, {
|
8878
8942
|
key: "callServiceAPI",
|
8879
8943
|
value: function () {
|
8880
|
-
var _callServiceAPI21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
8944
|
+
var _callServiceAPI21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee90(e, t) {
|
8881
8945
|
var i;
|
8882
|
-
return _regeneratorRuntime().wrap(function
|
8883
|
-
while (1) switch (
|
8946
|
+
return _regeneratorRuntime().wrap(function _callee90$(_context90) {
|
8947
|
+
while (1) switch (_context90.prev = _context90.next) {
|
8884
8948
|
case 0:
|
8885
8949
|
if (this.requestSettings) {
|
8886
|
-
|
8950
|
+
_context90.next = 2;
|
8887
8951
|
break;
|
8888
8952
|
}
|
8889
8953
|
throw new Error("Request settings have not been set up");
|
8890
8954
|
case 2:
|
8891
8955
|
i = this.preprocessBody(this.rawBody, t);
|
8892
|
-
|
8956
|
+
S.request(this, i, e);
|
8893
8957
|
case 4:
|
8894
8958
|
case "end":
|
8895
|
-
return
|
8959
|
+
return _context90.stop();
|
8896
8960
|
}
|
8897
|
-
},
|
8961
|
+
}, _callee90, this);
|
8898
8962
|
}));
|
8899
8963
|
function callServiceAPI(_x167, _x168) {
|
8900
8964
|
return _callServiceAPI21.apply(this, arguments);
|
@@ -8904,24 +8968,24 @@ var Ho = /*#__PURE__*/function (_Zi3) {
|
|
8904
8968
|
}, {
|
8905
8969
|
key: "extractResultData",
|
8906
8970
|
value: function () {
|
8907
|
-
var _extractResultData24 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
8908
|
-
return _regeneratorRuntime().wrap(function
|
8909
|
-
while (1) switch (
|
8971
|
+
var _extractResultData24 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee91(e) {
|
8972
|
+
return _regeneratorRuntime().wrap(function _callee91$(_context91) {
|
8973
|
+
while (1) switch (_context91.prev = _context91.next) {
|
8910
8974
|
case 0:
|
8911
8975
|
if (!e.message) {
|
8912
|
-
|
8976
|
+
_context91.next = 2;
|
8913
8977
|
break;
|
8914
8978
|
}
|
8915
8979
|
throw e.message;
|
8916
8980
|
case 2:
|
8917
|
-
return
|
8981
|
+
return _context91.abrupt("return", {
|
8918
8982
|
text: e.text
|
8919
8983
|
});
|
8920
8984
|
case 3:
|
8921
8985
|
case "end":
|
8922
|
-
return
|
8986
|
+
return _context91.stop();
|
8923
8987
|
}
|
8924
|
-
},
|
8988
|
+
}, _callee91);
|
8925
8989
|
}));
|
8926
8990
|
function extractResultData(_x169) {
|
8927
8991
|
return _extractResultData24.apply(this, arguments);
|
@@ -8930,7 +8994,7 @@ var Ho = /*#__PURE__*/function (_Zi3) {
|
|
8930
8994
|
}()
|
8931
8995
|
}]);
|
8932
8996
|
return Ho;
|
8933
|
-
}(
|
8997
|
+
}(Xi);
|
8934
8998
|
var Go = /*#__PURE__*/function () {
|
8935
8999
|
function Go() {
|
8936
9000
|
_classCallCheck(this, Go);
|
@@ -8944,19 +9008,19 @@ var Go = /*#__PURE__*/function () {
|
|
8944
9008
|
i = e.request,
|
8945
9009
|
n = e.demo,
|
8946
9010
|
r = e.webModel;
|
8947
|
-
if (r) return new
|
9011
|
+
if (r) return new Zi(e);
|
8948
9012
|
if (t) {
|
8949
|
-
if (t.openAI) return t.openAI.images ? new
|
8950
|
-
if (t.assemblyAI) return new
|
9013
|
+
if (t.openAI) return t.openAI.images ? new Uo(e) : t.openAI.speechToText ? new Po(e) : t.openAI.textToSpeech ? new Oo(e) : t.openAI.assistant ? new qo(e) : new ht(e);
|
9014
|
+
if (t.assemblyAI) return new en(e);
|
8951
9015
|
if (t.cohere) return t.cohere.textGeneration ? new Ro(e) : t.cohere.summarization ? new No(e) : new Ho(e);
|
8952
|
-
if (t.huggingFace) return t.huggingFace.textGeneration ? new To(e) : t.huggingFace.summarization ? new Ao(e) : t.huggingFace.translation ? new
|
9016
|
+
if (t.huggingFace) return t.huggingFace.textGeneration ? new To(e) : t.huggingFace.summarization ? new Ao(e) : t.huggingFace.translation ? new Lo(e) : t.huggingFace.fillMask ? new Io(e) : t.huggingFace.questionAnswer ? new Co(e) : t.huggingFace.audioSpeechRecognition ? new Mo(e) : t.huggingFace.audioClassification ? new wo(e) : t.huggingFace.imageClassification ? new So(e) : new ko(e);
|
8953
9017
|
if (t.azure) {
|
8954
9018
|
if (t.azure.speechToText) return new Bo(e);
|
8955
9019
|
if (t.azure.textToSpeech) return new Fo(e);
|
8956
9020
|
if (t.azure.summarization) return new jo(e);
|
8957
9021
|
if (t.azure.translation) return new zo(e);
|
8958
9022
|
}
|
8959
|
-
if (t.stabilityAI) return t.stabilityAI.imageToImage ? new Gt(e) : t.stabilityAI.imageToImageUpscale ? new
|
9023
|
+
if (t.stabilityAI) return t.stabilityAI.imageToImage ? new Gt(e) : t.stabilityAI.imageToImageUpscale ? new Ut(e) : t.stabilityAI.imageToImageMasking ? new Ht(e) : new Vt(e);
|
8960
9024
|
}
|
8961
9025
|
return i ? new Ne(e) : new Ne(e, void 0, n || !0);
|
8962
9026
|
}
|
@@ -9081,14 +9145,12 @@ var Wo = /*#__PURE__*/function () {
|
|
9081
9145
|
_createClass(Wo, null, [{
|
9082
9146
|
key: "getText",
|
9083
9147
|
value: function getText(e, t) {
|
9084
|
-
var i
|
9148
|
+
var i;
|
9085
9149
|
if (!e.directConnection && !e.request && !e.webModel && !e.demo) return "Connect to any API using the [request](https://deepchat.dev/docs/connect#Request)\n property or a popular service via\n [directConnection](https://deepchat.dev/docs/directConnection/#directConnection).\n \n Host AI entirely on your browser via a [webModel](https://deepchat.dev/docs/webModel).\n \n To get started checkout the [Start](https://deepchat.dev/start) page and\n live code [examples](https://deepchat.dev/examples/frameworks).\n \n To remove this message set the [demo](https://deepchat.dev/docs/demo#demo) property to true.";
|
9086
9150
|
if (e.directConnection) {
|
9087
9151
|
if (!t.isDirectConnection()) return "Please define a valid service inside\n the [directConnection](https://deepchat.dev/docs/directConnection/#directConnection) object.";
|
9088
|
-
var
|
9089
|
-
if (_typeof(
|
9090
|
-
var o = (n = e.directConnection.openAI) == null ? void 0 : n.assistant;
|
9091
|
-
if (typeof o == "boolean" || o && !o.assistant_id) return "Please define the `assistant_id` property inside the openAI [assistant](https://deepchat.dev/docs/directConnection/openAI#Assistant) object.";
|
9152
|
+
var n = (i = e.directConnection.openAI) == null ? void 0 : i.chat;
|
9153
|
+
if (_typeof(n) == "object" && n.tools && !n.function_handler) return "Please define the `function_handler` property inside the openAI [chat](https://deepchat.dev/docs/directConnection/openAI#Chat) object.";
|
9092
9154
|
} else if (e.request && !e.request.url && !e.request.handler) return "Please define a `url` or a `handler` property inside the [request](https://deepchat.dev/docs/connect#Request) object.";
|
9093
9155
|
return null;
|
9094
9156
|
}
|
@@ -9104,24 +9166,24 @@ var fe = /*#__PURE__*/function () {
|
|
9104
9166
|
key: "createImage",
|
9105
9167
|
value: function createImage(e, t) {
|
9106
9168
|
var i = new Image();
|
9107
|
-
return i.src = e.src,
|
9169
|
+
return i.src = e.src, se.scrollDownOnImageLoad(i.src, t), se.processContent("image", i, i.src, e.name);
|
9108
9170
|
}
|
9109
9171
|
// WORK - image still does not scroll down when loaded
|
9110
9172
|
}, {
|
9111
9173
|
key: "addNewImageMessage",
|
9112
9174
|
value: function () {
|
9113
|
-
var _addNewImageMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
9175
|
+
var _addNewImageMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee92(e, t, i) {
|
9114
9176
|
var n, r;
|
9115
|
-
return _regeneratorRuntime().wrap(function
|
9116
|
-
while (1) switch (
|
9177
|
+
return _regeneratorRuntime().wrap(function _callee92$(_context92) {
|
9178
|
+
while (1) switch (_context92.prev = _context92.next) {
|
9117
9179
|
case 0:
|
9118
9180
|
n = fe.createImage(t, e.elementRef), r = e.createNewMessageElement("", i);
|
9119
|
-
r.bubbleElement.appendChild(n), r.bubbleElement.classList.add("image-message"),
|
9181
|
+
r.bubbleElement.appendChild(n), r.bubbleElement.classList.add("image-message"), se.addMessage(e, r, "image", i);
|
9120
9182
|
case 2:
|
9121
9183
|
case "end":
|
9122
|
-
return
|
9184
|
+
return _context92.stop();
|
9123
9185
|
}
|
9124
|
-
},
|
9186
|
+
}, _callee92);
|
9125
9187
|
}));
|
9126
9188
|
function addNewImageMessage(_x170, _x171, _x172) {
|
9127
9189
|
return _addNewImageMessage.apply(this, arguments);
|
@@ -9139,7 +9201,7 @@ var fe = /*#__PURE__*/function () {
|
|
9139
9201
|
value: function addNewAudioMessage(e, t, i) {
|
9140
9202
|
var n = fe.createAudioElement(t, i),
|
9141
9203
|
r = e.createNewMessageElement("", i);
|
9142
|
-
r.bubbleElement.appendChild(n), r.bubbleElement.classList.add("audio-message"),
|
9204
|
+
r.bubbleElement.appendChild(n), r.bubbleElement.classList.add("audio-message"), se.addMessage(e, r, "audio", i);
|
9143
9205
|
}
|
9144
9206
|
}, {
|
9145
9207
|
key: "createAnyFile",
|
@@ -9151,14 +9213,14 @@ var fe = /*#__PURE__*/function () {
|
|
9151
9213
|
var n = H.createSVGElement(Ko);
|
9152
9214
|
n.classList.add("any-file-message-icon"), i.appendChild(n);
|
9153
9215
|
var r = document.createElement("div");
|
9154
|
-
return r.classList.add("any-file-message-text"), r.textContent = e.name ||
|
9216
|
+
return r.classList.add("any-file-message-text"), r.textContent = e.name || se.DEFAULT_FILE_NAME, t.appendChild(i), t.appendChild(r), se.processContent("any", t, e.src, r.textContent);
|
9155
9217
|
}
|
9156
9218
|
}, {
|
9157
9219
|
key: "addNewAnyFileMessage",
|
9158
9220
|
value: function addNewAnyFileMessage(e, t, i) {
|
9159
9221
|
var n = e.createNewMessageElement("", i),
|
9160
9222
|
r = fe.createAnyFile(t);
|
9161
|
-
n.bubbleElement.classList.add("any-file-message-bubble"), n.bubbleElement.appendChild(r),
|
9223
|
+
n.bubbleElement.classList.add("any-file-message-bubble"), n.bubbleElement.appendChild(r), se.addMessage(e, n, "file", i);
|
9162
9224
|
}
|
9163
9225
|
// no overwrite previous message logic as it is complex to track which files are to be overwritten
|
9164
9226
|
}, {
|
@@ -9166,7 +9228,7 @@ var fe = /*#__PURE__*/function () {
|
|
9166
9228
|
value: function addMessages(e, t, i) {
|
9167
9229
|
t.forEach(function (n) {
|
9168
9230
|
var r, o;
|
9169
|
-
n.ref && (n =
|
9231
|
+
n.ref && (n = se.removeFileRef(n)), n.type === "audio" || (r = n.src) != null && r.startsWith("data:audio") ? fe.addNewAudioMessage(e, n, i) : n.type === "image" || (o = n.src) != null && o.startsWith("data:image") ? fe.addNewImageMessage(e, n, i) : fe.addNewAnyFileMessage(e, n, i);
|
9170
9232
|
});
|
9171
9233
|
}
|
9172
9234
|
}]);
|
@@ -9174,12 +9236,11 @@ var fe = /*#__PURE__*/function () {
|
|
9174
9236
|
}();
|
9175
9237
|
var me = /*#__PURE__*/function (_$e) {
|
9176
9238
|
_inherits(me, _$e);
|
9177
|
-
var _super36 = _createSuper(me);
|
9178
9239
|
function me(e, t, i) {
|
9179
9240
|
var _this38;
|
9180
9241
|
_classCallCheck(this, me);
|
9181
9242
|
var a, l;
|
9182
|
-
_this38 =
|
9243
|
+
_this38 = _callSuper(this, me, [e]);
|
9183
9244
|
var n = t.permittedErrorPrefixes,
|
9184
9245
|
r = t.introPanelMarkUp,
|
9185
9246
|
o = t.demo;
|
@@ -9233,7 +9294,7 @@ var me = /*#__PURE__*/function (_$e) {
|
|
9233
9294
|
value: function populateInitialMessages(e) {
|
9234
9295
|
var _this39 = this;
|
9235
9296
|
e.forEach(function (t) {
|
9236
|
-
|
9297
|
+
Ie.processInitialMessageFile(t), _this39.addNewMessage(t, !0);
|
9237
9298
|
}), setTimeout(function () {
|
9238
9299
|
return Z.scrollToBottom(_this39.elementRef);
|
9239
9300
|
}, 0);
|
@@ -9328,19 +9389,19 @@ var me = /*#__PURE__*/function (_$e) {
|
|
9328
9389
|
}, {
|
9329
9390
|
key: "populateIntroPanel",
|
9330
9391
|
value: function populateIntroPanel(e, t, i) {
|
9331
|
-
(e || t) && (this._introPanel = new Kt(e, t, i), this._introPanel._elementRef && (
|
9392
|
+
(e || t) && (this._introPanel = new Kt(e, t, i), this._introPanel._elementRef && (re.apply(this, this._introPanel._elementRef), this.elementRef.appendChild(this._introPanel._elementRef)));
|
9332
9393
|
}
|
9333
9394
|
}, {
|
9334
9395
|
key: "addMultipleFiles",
|
9335
9396
|
value: function () {
|
9336
|
-
var _addMultipleFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
9337
|
-
return _regeneratorRuntime().wrap(function
|
9338
|
-
while (1) switch (
|
9397
|
+
var _addMultipleFiles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee93(e) {
|
9398
|
+
return _regeneratorRuntime().wrap(function _callee93$(_context93) {
|
9399
|
+
while (1) switch (_context93.prev = _context93.next) {
|
9339
9400
|
case 0:
|
9340
|
-
return
|
9401
|
+
return _context93.abrupt("return", Promise.all((e || []).map(function (t) {
|
9341
9402
|
return new Promise(function (i) {
|
9342
9403
|
if (!t.type || t.type === "any") {
|
9343
|
-
var n = t.file.name ||
|
9404
|
+
var n = t.file.name || se.DEFAULT_FILE_NAME;
|
9344
9405
|
i({
|
9345
9406
|
name: n,
|
9346
9407
|
type: "any",
|
@@ -9360,9 +9421,9 @@ var me = /*#__PURE__*/function (_$e) {
|
|
9360
9421
|
})));
|
9361
9422
|
case 1:
|
9362
9423
|
case "end":
|
9363
|
-
return
|
9424
|
+
return _context93.stop();
|
9364
9425
|
}
|
9365
|
-
},
|
9426
|
+
}, _callee93);
|
9366
9427
|
}));
|
9367
9428
|
function addMultipleFiles(_x173) {
|
9368
9429
|
return _addMultipleFiles.apply(this, arguments);
|
@@ -9744,14 +9805,13 @@ var nn = /*#__PURE__*/function () {
|
|
9744
9805
|
}();
|
9745
9806
|
var Ye = /*#__PURE__*/function (_Tt) {
|
9746
9807
|
_inherits(Ye, _Tt);
|
9747
|
-
var _super37 = _createSuper(Ye);
|
9748
9808
|
function Ye(e, t) {
|
9749
9809
|
var _this41;
|
9750
9810
|
_classCallCheck(this, Ye);
|
9751
9811
|
var n;
|
9752
|
-
_this41 =
|
9812
|
+
_this41 = _callSuper(this, Ye, [Ye.createButtonElement(), void 0, {
|
9753
9813
|
styles: (n = t == null ? void 0 : t.button) == null ? void 0 : n.styles
|
9754
|
-
});
|
9814
|
+
}]);
|
9755
9815
|
var i = _this41.createInnerElements(_this41._customStyles);
|
9756
9816
|
_this41._menu = new nn(e, t == null ? void 0 : t.menu), _this41.addClickEvent(), _this41.buttonContainer = Ye.createButtonContainer(), _this41.elementRef.appendChild(i.styles), _this41.buttonContainer.appendChild(_this41.elementRef), _this41.elementRef.classList.add("dropup-icon", "upload-file-button"), _this41.elementRef.children[0].id = "dropup-icon", _this41.buttonContainer.appendChild(_this41._menu.elementRef), _this41.reapplyStateStyle("styles"), _this41.addContainerEvents(e);
|
9757
9817
|
return _this41;
|
@@ -9936,7 +9996,7 @@ var ue = /*#__PURE__*/function () {
|
|
9936
9996
|
var r = ue.createImageAttachment(t);
|
9937
9997
|
this.addFileAttachment(e, "image", r, i);
|
9938
9998
|
} else if (n === "audio") {
|
9939
|
-
var _r2 =
|
9999
|
+
var _r2 = Hi.createAudioAttachment(t);
|
9940
10000
|
this.addFileAttachment(e, "audio", _r2, i);
|
9941
10001
|
} else {
|
9942
10002
|
var _r3 = ue.createAnyFileAttachment(e.name);
|
@@ -9977,7 +10037,7 @@ var ue = /*#__PURE__*/function () {
|
|
9977
10037
|
return r === e;
|
9978
10038
|
}),
|
9979
10039
|
i = this._attachments[t].attachmentContainerElement;
|
9980
|
-
this._attachments.splice(t, 1),
|
10040
|
+
this._attachments.splice(t, 1), Hi.stopAttachmentPlayback(i), i.remove(), this._toggleContainerDisplay(!1), (n = this._validationHandler) == null || n.call(this);
|
9981
10041
|
}
|
9982
10042
|
}, {
|
9983
10043
|
key: "getFiles",
|
@@ -10049,14 +10109,13 @@ var ue = /*#__PURE__*/function () {
|
|
10049
10109
|
return ue;
|
10050
10110
|
}();
|
10051
10111
|
var ta = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <title>play</title>\n <path d=\"M5.92 24.096q0 1.088 0.928 1.728 0.512 0.288 1.088 0.288 0.448 0 0.896-0.224l16.16-8.064q0.48-0.256 0.8-0.736t0.288-1.088-0.288-1.056-0.8-0.736l-16.16-8.064q-0.448-0.224-0.896-0.224-0.544 0-1.088 0.288-0.928 0.608-0.928 1.728v16.16z\"></path>\n</svg>",
|
10052
|
-
|
10112
|
+
Sn = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n<title>stop</title>\n<path d=\"M5.92 24.096q0 0.832 0.576 1.408t1.44 0.608h16.128q0.832 0 1.44-0.608t0.576-1.408v-16.16q0-0.832-0.576-1.44t-1.44-0.576h-16.128q-0.832 0-1.44 0.576t-0.576 1.44v16.16z\"></path>\n</svg>",
|
10053
10113
|
fs = /*#__PURE__*/function (_ue) {
|
10054
10114
|
_inherits(Me, _ue);
|
10055
|
-
var _super38 = _createSuper(Me);
|
10056
10115
|
// prettier-ignore
|
10057
10116
|
function Me(e, t, i, n) {
|
10058
10117
|
_classCallCheck(this, Me);
|
10059
|
-
return
|
10118
|
+
return _callSuper(this, Me, [e, t, i, n]);
|
10060
10119
|
}
|
10061
10120
|
_createClass(Me, [{
|
10062
10121
|
key: "createTimer",
|
@@ -10080,7 +10139,7 @@ var ta = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10080
10139
|
i.classList.add("audio-placeholder-text-3-digits");
|
10081
10140
|
var n = document.createElement("div");
|
10082
10141
|
n.classList.add("file-attachment-text-container", "audio-placeholder-text-3-digits-container"), n.appendChild(i);
|
10083
|
-
var r = H.createSVGElement(
|
10142
|
+
var r = H.createSVGElement(Sn);
|
10084
10143
|
return r.classList.add("attachment-icon", "stop-icon", "not-removable-attachment-icon"), i.textContent = "0:00", this._activePlaceholderTimer = this.createTimer(i, e), t.appendChild(n), this.addPlaceholderAudioAttachmentEvents(t, r, n), t;
|
10085
10144
|
}
|
10086
10145
|
}, {
|
@@ -10138,7 +10197,7 @@ var ta = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10138
10197
|
n.src = t;
|
10139
10198
|
var r = H.createSVGElement(ta);
|
10140
10199
|
r.classList.add("attachment-icon", "play-icon");
|
10141
|
-
var o = H.createSVGElement(
|
10200
|
+
var o = H.createSVGElement(Sn);
|
10142
10201
|
o.classList.add("attachment-icon", "stop-icon"), i.replaceChildren(r), n.onplay = function () {
|
10143
10202
|
i.replaceChildren(o);
|
10144
10203
|
}, n.onpause = function () {
|
@@ -10165,7 +10224,7 @@ var ta = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
10165
10224
|
return Me;
|
10166
10225
|
}(ue);
|
10167
10226
|
fs.TIMER_LIMIT_S = 5999;
|
10168
|
-
var
|
10227
|
+
var Hi = fs;
|
10169
10228
|
var ia = /*#__PURE__*/function () {
|
10170
10229
|
function ia() {
|
10171
10230
|
_classCallCheck(this, ia);
|
@@ -10175,7 +10234,7 @@ var ia = /*#__PURE__*/function () {
|
|
10175
10234
|
value:
|
10176
10235
|
// prettier-ignore
|
10177
10236
|
function create(e, t, i, n, r) {
|
10178
|
-
return r === "audio" ? new
|
10237
|
+
return r === "audio" ? new Hi(e, t, i, n) : new ue(e, t, i, n);
|
10179
10238
|
}
|
10180
10239
|
}]);
|
10181
10240
|
return ia;
|
@@ -10216,23 +10275,23 @@ var Ct = /*#__PURE__*/function () {
|
|
10216
10275
|
}, {
|
10217
10276
|
key: "completePlaceholders",
|
10218
10277
|
value: function () {
|
10219
|
-
var _completePlaceholders = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
10220
|
-
return _regeneratorRuntime().wrap(function
|
10221
|
-
while (1) switch (
|
10278
|
+
var _completePlaceholders = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee95() {
|
10279
|
+
return _regeneratorRuntime().wrap(function _callee95$(_context95) {
|
10280
|
+
while (1) switch (_context95.prev = _context95.next) {
|
10222
10281
|
case 0:
|
10223
|
-
|
10282
|
+
_context95.next = 2;
|
10224
10283
|
return Promise.all(this._fileAttachmentsTypes.map( /*#__PURE__*/function () {
|
10225
|
-
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
10284
|
+
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee94(e) {
|
10226
10285
|
var t;
|
10227
|
-
return _regeneratorRuntime().wrap(function
|
10228
|
-
while (1) switch (
|
10286
|
+
return _regeneratorRuntime().wrap(function _callee94$(_context94) {
|
10287
|
+
while (1) switch (_context94.prev = _context94.next) {
|
10229
10288
|
case 0:
|
10230
|
-
return
|
10289
|
+
return _context94.abrupt("return", (t = e.stopPlaceholderCallback) == null ? void 0 : t.call(e));
|
10231
10290
|
case 1:
|
10232
10291
|
case "end":
|
10233
|
-
return
|
10292
|
+
return _context94.stop();
|
10234
10293
|
}
|
10235
|
-
},
|
10294
|
+
}, _callee94);
|
10236
10295
|
}));
|
10237
10296
|
return function (_x174) {
|
10238
10297
|
return _ref12.apply(this, arguments);
|
@@ -10240,9 +10299,9 @@ var Ct = /*#__PURE__*/function () {
|
|
10240
10299
|
}()));
|
10241
10300
|
case 2:
|
10242
10301
|
case "end":
|
10243
|
-
return
|
10302
|
+
return _context95.stop();
|
10244
10303
|
}
|
10245
|
-
},
|
10304
|
+
}, _callee95, this);
|
10246
10305
|
}));
|
10247
10306
|
function completePlaceholders() {
|
10248
10307
|
return _completePlaceholders.apply(this, arguments);
|
@@ -10395,13 +10454,12 @@ ms.MODAL_CLOSE_TIMEOUT_MS = 190;
|
|
10395
10454
|
var ct = ms;
|
10396
10455
|
var pt = /*#__PURE__*/function (_Tt2) {
|
10397
10456
|
_inherits(pt, _Tt2);
|
10398
|
-
var _super39 = _createSuper(pt);
|
10399
10457
|
// prettier-ignore
|
10400
10458
|
function pt(e, t, i, n, r, o) {
|
10401
10459
|
var _this49;
|
10402
10460
|
_classCallCheck(this, pt);
|
10403
10461
|
var l, c, d, u, p, h;
|
10404
|
-
_this49 =
|
10462
|
+
_this49 = _callSuper(this, pt, [pt.createButtonElement(), (l = i.button) == null ? void 0 : l.position, i.button, o]);
|
10405
10463
|
var a = _this49.createInnerElements(n, r, _this49._customStyles);
|
10406
10464
|
_this49._inputElement = pt.createInputElement((c = i == null ? void 0 : i.files) == null ? void 0 : c.acceptedFormats), _this49.addClickEvent(e, i), _this49.elementRef.replaceChildren(a.styles), _this49.reapplyStateStyle("styles"), _this49._fileAttachmentsType = t, _this49._openModalOnce = ((u = (d = i.files) == null ? void 0 : d.infoModal) == null ? void 0 : u.openModalOnce) === !1 || (h = (p = i.files) == null ? void 0 : p.infoModal) == null ? void 0 : h.openModalOnce;
|
10407
10465
|
return _this49;
|
@@ -10532,24 +10590,24 @@ var Ce = /*#__PURE__*/function () {
|
|
10532
10590
|
}, {
|
10533
10591
|
key: "useValidationFunc",
|
10534
10592
|
value: function () {
|
10535
|
-
var _useValidationFunc = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
10593
|
+
var _useValidationFunc = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee96(e, t, i, n) {
|
10536
10594
|
var r, o, a, l;
|
10537
|
-
return _regeneratorRuntime().wrap(function
|
10538
|
-
while (1) switch (
|
10595
|
+
return _regeneratorRuntime().wrap(function _callee96$(_context96) {
|
10596
|
+
while (1) switch (_context96.prev = _context96.next) {
|
10539
10597
|
case 0:
|
10540
10598
|
r = t.inputElementRef, o = r.classList.contains("text-input-placeholder") ? "" : r.textContent;
|
10541
|
-
|
10599
|
+
_context96.next = 3;
|
10542
10600
|
return i.completePlaceholders();
|
10543
10601
|
case 3:
|
10544
10602
|
a = i.getAllFileData(), l = a == null ? void 0 : a.map(function (c) {
|
10545
10603
|
return c.file;
|
10546
10604
|
});
|
10547
|
-
return
|
10605
|
+
return _context96.abrupt("return", Ce.validate(e, n, o, l));
|
10548
10606
|
case 5:
|
10549
10607
|
case "end":
|
10550
|
-
return
|
10608
|
+
return _context96.stop();
|
10551
10609
|
}
|
10552
|
-
},
|
10610
|
+
}, _callee96);
|
10553
10611
|
}));
|
10554
10612
|
function useValidationFunc(_x175, _x176, _x177, _x178) {
|
10555
10613
|
return _useValidationFunc.apply(this, arguments);
|
@@ -10559,20 +10617,20 @@ var Ce = /*#__PURE__*/function () {
|
|
10559
10617
|
}, {
|
10560
10618
|
key: "useValidationFuncProgrammatic",
|
10561
10619
|
value: function () {
|
10562
|
-
var _useValidationFuncProgrammatic = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
10620
|
+
var _useValidationFuncProgrammatic = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee97(e, t, i) {
|
10563
10621
|
var r, n;
|
10564
|
-
return _regeneratorRuntime().wrap(function
|
10565
|
-
while (1) switch (
|
10622
|
+
return _regeneratorRuntime().wrap(function _callee97$(_context97) {
|
10623
|
+
while (1) switch (_context97.prev = _context97.next) {
|
10566
10624
|
case 0:
|
10567
10625
|
n = (r = t.files) == null ? void 0 : r.map(function (o) {
|
10568
10626
|
return o.file;
|
10569
10627
|
});
|
10570
|
-
return
|
10628
|
+
return _context97.abrupt("return", Ce.validate(e, i, t.text, n, !0));
|
10571
10629
|
case 2:
|
10572
10630
|
case "end":
|
10573
|
-
return
|
10631
|
+
return _context97.stop();
|
10574
10632
|
}
|
10575
|
-
},
|
10633
|
+
}, _callee97);
|
10576
10634
|
}));
|
10577
10635
|
function useValidationFuncProgrammatic(_x179, _x180, _x181) {
|
10578
10636
|
return _useValidationFuncProgrammatic.apply(this, arguments);
|
@@ -10588,26 +10646,26 @@ var Ce = /*#__PURE__*/function () {
|
|
10588
10646
|
}, {
|
10589
10647
|
key: "attach",
|
10590
10648
|
value: function attach(e, t, i, n, r) {
|
10591
|
-
var o = e.validateInput ||
|
10649
|
+
var o = e.validateInput || Ie.processValidateInput(e);
|
10592
10650
|
e._validationHandler = /*#__PURE__*/function () {
|
10593
|
-
var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
10651
|
+
var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee98(a) {
|
10594
10652
|
var l;
|
10595
|
-
return _regeneratorRuntime().wrap(function
|
10596
|
-
while (1) switch (
|
10653
|
+
return _regeneratorRuntime().wrap(function _callee98$(_context98) {
|
10654
|
+
while (1) switch (_context98.prev = _context98.next) {
|
10597
10655
|
case 0:
|
10598
10656
|
if (!(r.status.loadingActive || r.status.requestInProgress || t.isSubmitProgrammaticallyDisabled === !0 || !Ce.validateWebsocket(t, r))) {
|
10599
|
-
|
10657
|
+
_context98.next = 2;
|
10600
10658
|
break;
|
10601
10659
|
}
|
10602
|
-
return
|
10660
|
+
return _context98.abrupt("return", !1);
|
10603
10661
|
case 2:
|
10604
10662
|
l = o || t.canSendMessage;
|
10605
|
-
return
|
10663
|
+
return _context98.abrupt("return", l ? a ? Ce.useValidationFuncProgrammatic(l, a, r) : Ce.useValidationFunc(l, i, n, r) : null);
|
10606
10664
|
case 4:
|
10607
10665
|
case "end":
|
10608
|
-
return
|
10666
|
+
return _context98.stop();
|
10609
10667
|
}
|
10610
|
-
},
|
10668
|
+
}, _callee98);
|
10611
10669
|
}));
|
10612
10670
|
return function (_x182) {
|
10613
10671
|
return _ref13.apply(this, arguments);
|
@@ -10620,11 +10678,10 @@ var Ce = /*#__PURE__*/function () {
|
|
10620
10678
|
var na = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n<svg height=\"1.4em\" width=\"1.4em\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n\t viewBox=\"0 0 490.9 490.9\" xml:space=\"preserve\">\n\t<g>\n\t\t<g>\n\t\t\t<path d=\"M245.5,322.9c53,0,96.2-43.2,96.2-96.2V96.2c0-53-43.2-96.2-96.2-96.2s-96.2,43.2-96.2,96.2v130.5\n\t\t\t\tC149.3,279.8,192.5,322.9,245.5,322.9z M173.8,96.2c0-39.5,32.2-71.7,71.7-71.7s71.7,32.2,71.7,71.7v130.5\n\t\t\t\tc0,39.5-32.2,71.7-71.7,71.7s-71.7-32.2-71.7-71.7V96.2z\"/>\n\t\t\t<path d=\"M94.4,214.5c-6.8,0-12.3,5.5-12.3,12.3c0,85.9,66.7,156.6,151.1,162.8v76.7h-63.9c-6.8,0-12.3,5.5-12.3,12.3\n\t\t\t\ts5.5,12.3,12.3,12.3h152.3c6.8,0,12.3-5.5,12.3-12.3s-5.5-12.3-12.3-12.3h-63.9v-76.7c84.4-6.3,151.1-76.9,151.1-162.8\n\t\t\t\tc0-6.8-5.5-12.3-12.3-12.3s-12.3,5.5-12.3,12.3c0,76.6-62.3,138.9-138.9,138.9s-138.9-62.3-138.9-138.9\n\t\t\t\tC106.6,220,101.2,214.5,94.4,214.5z\"/>\n\t\t</g>\n\t</g>\n</svg>\n";
|
10621
10679
|
var xt = /*#__PURE__*/function (_Tt3) {
|
10622
10680
|
_inherits(xt, _Tt3);
|
10623
|
-
var _super40 = _createSuper(xt);
|
10624
10681
|
function xt(e) {
|
10625
10682
|
var _this50;
|
10626
10683
|
_classCallCheck(this, xt);
|
10627
|
-
(e == null ? void 0 : e.position) === "dropup-menu" && (e.position = "outside-right"), _this50 =
|
10684
|
+
(e == null ? void 0 : e.position) === "dropup-menu" && (e.position = "outside-right"), _this50 = _callSuper(this, xt, [xt.createMicrophoneElement(), e == null ? void 0 : e.position, e]), _this50.isActive = !1, _this50._innerElements = _this50.createInnerElements(_this50._customStyles), _this50.changeToDefault();
|
10628
10685
|
return _this50;
|
10629
10686
|
}
|
10630
10687
|
_createClass(xt, [{
|
@@ -10696,8 +10753,8 @@ var xt = /*#__PURE__*/function (_Tt3) {
|
|
10696
10753
|
return xt;
|
10697
10754
|
}(Tt);
|
10698
10755
|
var gs = {},
|
10699
|
-
li = {},
|
10700
10756
|
ci = {},
|
10757
|
+
di = {},
|
10701
10758
|
At = {},
|
10702
10759
|
Fe = {};
|
10703
10760
|
Object.defineProperty(Fe, "__esModule", {
|
@@ -10758,10 +10815,10 @@ var ra = /*#__PURE__*/function () {
|
|
10758
10815
|
return ra;
|
10759
10816
|
}();
|
10760
10817
|
At.Translate = ra;
|
10761
|
-
Object.defineProperty(
|
10818
|
+
Object.defineProperty(di, "__esModule", {
|
10762
10819
|
value: !0
|
10763
10820
|
});
|
10764
|
-
|
10821
|
+
di.WebSpeechTranscript = void 0;
|
10765
10822
|
var Mn = At;
|
10766
10823
|
var oa = /*#__PURE__*/function () {
|
10767
10824
|
function oa() {
|
@@ -10799,7 +10856,7 @@ var oa = /*#__PURE__*/function () {
|
|
10799
10856
|
}]);
|
10800
10857
|
return oa;
|
10801
10858
|
}();
|
10802
|
-
|
10859
|
+
di.WebSpeechTranscript = oa;
|
10803
10860
|
var nt = {};
|
10804
10861
|
Object.defineProperty(nt, "__esModule", {
|
10805
10862
|
value: !0
|
@@ -10813,11 +10870,11 @@ dt.IS_SAFARI = function () {
|
|
10813
10870
|
return dt._IS_SAFARI === void 0 && (dt._IS_SAFARI = /^((?!chrome|android).)*safari/i.test(navigator.userAgent)), dt._IS_SAFARI;
|
10814
10871
|
};
|
10815
10872
|
var kt = {},
|
10816
|
-
|
10817
|
-
Object.defineProperty(
|
10873
|
+
ui = {};
|
10874
|
+
Object.defineProperty(ui, "__esModule", {
|
10818
10875
|
value: !0
|
10819
10876
|
});
|
10820
|
-
|
10877
|
+
ui.EventListeners = void 0;
|
10821
10878
|
var $ = /*#__PURE__*/function () {
|
10822
10879
|
function $() {
|
10823
10880
|
_classCallCheck(this, $);
|
@@ -10861,13 +10918,13 @@ var $ = /*#__PURE__*/function () {
|
|
10861
10918
|
}]);
|
10862
10919
|
return $;
|
10863
10920
|
}();
|
10864
|
-
|
10921
|
+
ui.EventListeners = $;
|
10865
10922
|
$.KEY_DOWN_TIMEOUT = null;
|
10866
|
-
var
|
10867
|
-
Object.defineProperty(
|
10923
|
+
var hi = {};
|
10924
|
+
Object.defineProperty(hi, "__esModule", {
|
10868
10925
|
value: !0
|
10869
10926
|
});
|
10870
|
-
|
10927
|
+
hi.PreResultUtils = void 0;
|
10871
10928
|
var aa = /*#__PURE__*/function () {
|
10872
10929
|
function aa() {
|
10873
10930
|
_classCallCheck(this, aa);
|
@@ -10883,13 +10940,13 @@ var aa = /*#__PURE__*/function () {
|
|
10883
10940
|
}]);
|
10884
10941
|
return aa;
|
10885
10942
|
}();
|
10886
|
-
|
10887
|
-
var
|
10888
|
-
|
10889
|
-
Object.defineProperty(
|
10943
|
+
hi.PreResultUtils = aa;
|
10944
|
+
var Lt = {},
|
10945
|
+
It = {};
|
10946
|
+
Object.defineProperty(It, "__esModule", {
|
10890
10947
|
value: !0
|
10891
10948
|
});
|
10892
|
-
|
10949
|
+
It.AutoScroll = void 0;
|
10893
10950
|
var sn = /*#__PURE__*/function () {
|
10894
10951
|
function sn() {
|
10895
10952
|
_classCallCheck(this, sn);
|
@@ -10926,7 +10983,7 @@ var sn = /*#__PURE__*/function () {
|
|
10926
10983
|
}]);
|
10927
10984
|
return sn;
|
10928
10985
|
}();
|
10929
|
-
|
10986
|
+
It.AutoScroll = sn;
|
10930
10987
|
var Be = {};
|
10931
10988
|
Object.defineProperty(Be, "__esModule", {
|
10932
10989
|
value: !0
|
@@ -11067,11 +11124,11 @@ var ft = /*#__PURE__*/function () {
|
|
11067
11124
|
return ft;
|
11068
11125
|
}();
|
11069
11126
|
ze.Cursor = ft;
|
11070
|
-
Object.defineProperty(
|
11127
|
+
Object.defineProperty(Lt, "__esModule", {
|
11071
11128
|
value: !0
|
11072
11129
|
});
|
11073
|
-
|
11074
|
-
var Tn =
|
11130
|
+
Lt.CommandUtils = void 0;
|
11131
|
+
var Tn = It,
|
11075
11132
|
ca = Be,
|
11076
11133
|
da = nt,
|
11077
11134
|
Cn = ze,
|
@@ -11171,12 +11228,12 @@ var J = /*#__PURE__*/function () {
|
|
11171
11228
|
}]);
|
11172
11229
|
return J;
|
11173
11230
|
}();
|
11174
|
-
|
11175
|
-
var
|
11176
|
-
Object.defineProperty(
|
11231
|
+
Lt.CommandUtils = J;
|
11232
|
+
var pi = {};
|
11233
|
+
Object.defineProperty(pi, "__esModule", {
|
11177
11234
|
value: !0
|
11178
11235
|
});
|
11179
|
-
|
11236
|
+
pi.Highlight = void 0;
|
11180
11237
|
var ua = Be,
|
11181
11238
|
st = ze;
|
11182
11239
|
var Jt = /*#__PURE__*/function () {
|
@@ -11228,15 +11285,15 @@ var Jt = /*#__PURE__*/function () {
|
|
11228
11285
|
}]);
|
11229
11286
|
return Jt;
|
11230
11287
|
}();
|
11231
|
-
|
11232
|
-
var
|
11233
|
-
Object.defineProperty(
|
11288
|
+
pi.Highlight = Jt;
|
11289
|
+
var fi = {};
|
11290
|
+
Object.defineProperty(fi, "__esModule", {
|
11234
11291
|
value: !0
|
11235
11292
|
});
|
11236
|
-
|
11293
|
+
fi.Padding = void 0;
|
11237
11294
|
var ha = Be,
|
11238
11295
|
kn = ze,
|
11239
|
-
|
11296
|
+
Ue = Fe;
|
11240
11297
|
var $t = /*#__PURE__*/function () {
|
11241
11298
|
function $t() {
|
11242
11299
|
_classCallCheck(this, $t);
|
@@ -11249,11 +11306,11 @@ var $t = /*#__PURE__*/function () {
|
|
11249
11306
|
r = t.value[n - 1],
|
11250
11307
|
o = t.selectionEnd === null ? n : t.selectionEnd,
|
11251
11308
|
a = t.value[o];
|
11252
|
-
|
11309
|
+
Ue.Text.isCharDefined(r) && (e.startPadding = " ", e.numberOfSpacesBeforeNewText = 1), Ue.Text.isCharDefined(a) && (e.endPadding = " ", e.numberOfSpacesAfterNewText = 1), e.isCursorAtEnd = t.value.length === o;
|
11253
11310
|
return;
|
11254
11311
|
}
|
11255
11312
|
var i = t.value[t.value.length - 1];
|
11256
|
-
|
11313
|
+
Ue.Text.isCharDefined(i) && (e.startPadding = " ", e.numberOfSpacesBeforeNewText = 1), e.isCursorAtEnd = !0;
|
11257
11314
|
}
|
11258
11315
|
}, {
|
11259
11316
|
key: "setStateForGenericElement",
|
@@ -11266,12 +11323,12 @@ var $t = /*#__PURE__*/function () {
|
|
11266
11323
|
c = (i = t.textContent) === null || i === void 0 ? void 0 : i[l - 1],
|
11267
11324
|
d = kn.Cursor.getGenericElementCursorOffset(t, a, !1),
|
11268
11325
|
u = (n = t.textContent) === null || n === void 0 ? void 0 : n[d];
|
11269
|
-
|
11326
|
+
Ue.Text.isCharDefined(c) && (e.startPadding = " "), Ue.Text.isCharDefined(u) && (e.endPadding = " "), e.isCursorAtEnd = ((r = t.textContent) === null || r === void 0 ? void 0 : r.length) === d;
|
11270
11327
|
return;
|
11271
11328
|
}
|
11272
11329
|
}
|
11273
11330
|
var o = t.innerText.charAt(t.innerText.length - 1);
|
11274
|
-
|
11331
|
+
Ue.Text.isCharDefined(o) && (e.startPadding = " "), e.isCursorAtEnd = !0;
|
11275
11332
|
}
|
11276
11333
|
}, {
|
11277
11334
|
key: "setState",
|
@@ -11295,18 +11352,18 @@ var $t = /*#__PURE__*/function () {
|
|
11295
11352
|
}]);
|
11296
11353
|
return $t;
|
11297
11354
|
}();
|
11298
|
-
|
11355
|
+
fi.Padding = $t;
|
11299
11356
|
Object.defineProperty(kt, "__esModule", {
|
11300
11357
|
value: !0
|
11301
11358
|
});
|
11302
11359
|
kt.Speech = void 0;
|
11303
|
-
var
|
11304
|
-
pa =
|
11305
|
-
|
11306
|
-
Pt =
|
11307
|
-
Ai = hi,
|
11308
|
-
ie = Be,
|
11360
|
+
var Ln = ui,
|
11361
|
+
pa = hi,
|
11362
|
+
In = Lt,
|
11363
|
+
Pt = It,
|
11309
11364
|
ki = pi,
|
11365
|
+
ie = Be,
|
11366
|
+
Li = fi,
|
11310
11367
|
Rn = nt,
|
11311
11368
|
Nn = ze,
|
11312
11369
|
Ii = Fe;
|
@@ -11319,19 +11376,19 @@ var fa = /*#__PURE__*/function () {
|
|
11319
11376
|
key: "prepareBeforeStart",
|
11320
11377
|
value: function prepareBeforeStart(e) {
|
11321
11378
|
var t, i;
|
11322
|
-
if (e != null && e.element) if (
|
11379
|
+
if (e != null && e.element) if (Ln.EventListeners.add(this, e), Array.isArray(e.element)) {
|
11323
11380
|
var r = e.element.find(function (o) {
|
11324
11381
|
return o === document.activeElement;
|
11325
11382
|
}) || e.element[0];
|
11326
11383
|
if (!r) return;
|
11327
11384
|
this.prepare(r);
|
11328
11385
|
} else this.prepare(e.element);
|
11329
|
-
(e == null ? void 0 : e.displayInterimResults) !== void 0 && (this._displayInterimResults = e.displayInterimResults), e != null && e.textColor && (this._finalTextColor = (t = e == null ? void 0 : e.textColor) === null || t === void 0 ? void 0 : t["final"], ie.Elements.applyCustomColors(this, e.textColor)), (e == null ? void 0 : e.insertInCursorLocation) !== void 0 && (this.insertInCursorLocation = e.insertInCursorLocation), (e == null ? void 0 : e.autoScroll) !== void 0 && (this.autoScroll = e.autoScroll), this._onResult = e == null ? void 0 : e.onResult, this._onPreResult = e == null ? void 0 : e.onPreResult, this._onStart = e == null ? void 0 : e.onStart, this._onStop = e == null ? void 0 : e.onStop, this._onError = e == null ? void 0 : e.onError, this.onCommandModeTrigger = e == null ? void 0 : e.onCommandModeTrigger, this.onPauseTrigger = e == null ? void 0 : e.onPauseTrigger, this._options = e, !((i = this._options) === null || i === void 0) && i.commands && (this.commands =
|
11386
|
+
(e == null ? void 0 : e.displayInterimResults) !== void 0 && (this._displayInterimResults = e.displayInterimResults), e != null && e.textColor && (this._finalTextColor = (t = e == null ? void 0 : e.textColor) === null || t === void 0 ? void 0 : t["final"], ie.Elements.applyCustomColors(this, e.textColor)), (e == null ? void 0 : e.insertInCursorLocation) !== void 0 && (this.insertInCursorLocation = e.insertInCursorLocation), (e == null ? void 0 : e.autoScroll) !== void 0 && (this.autoScroll = e.autoScroll), this._onResult = e == null ? void 0 : e.onResult, this._onPreResult = e == null ? void 0 : e.onPreResult, this._onStart = e == null ? void 0 : e.onStart, this._onStop = e == null ? void 0 : e.onStop, this._onError = e == null ? void 0 : e.onError, this.onCommandModeTrigger = e == null ? void 0 : e.onCommandModeTrigger, this.onPauseTrigger = e == null ? void 0 : e.onPauseTrigger, this._options = e, !((i = this._options) === null || i === void 0) && i.commands && (this.commands = In.CommandUtils.process(this._options.commands));
|
11330
11387
|
}
|
11331
11388
|
}, {
|
11332
11389
|
key: "prepare",
|
11333
11390
|
value: function prepare(e) {
|
11334
|
-
|
11391
|
+
Li.Padding.setState(this, e), ki.Highlight.setState(this, e), this.isTargetInShadow = ie.Elements.isInsideShadowDOM(e), ie.Elements.isPrimitiveElement(e) ? (this._primitiveElement = e, this._originalText = this._primitiveElement.value) : (this._genericElement = e, this._originalText = this._genericElement.textContent);
|
11335
11392
|
}
|
11336
11393
|
// there was an attempt to optimize this by not having to restart the service and just reset state:
|
11337
11394
|
// unfortunately it did not work because the service would still continue firing the intermediate and final results
|
@@ -11349,7 +11406,7 @@ var fa = /*#__PURE__*/function () {
|
|
11349
11406
|
var r = Ii.Text.capitalize(t);
|
11350
11407
|
if (this.finalTranscript === r && e === "") return;
|
11351
11408
|
pa.PreResultUtils.process(this, i, e === "", this._onPreResult, this._options) && (e = "", i = "");
|
11352
|
-
var o = this.commands &&
|
11409
|
+
var o = this.commands && In.CommandUtils.execCommand(this, i, this._options, this._primitiveElement || this._genericElement, this._originalText);
|
11353
11410
|
if (o) {
|
11354
11411
|
if (o.doNotProcessTranscription) return;
|
11355
11412
|
e = "", i = "";
|
@@ -11364,7 +11421,7 @@ var fa = /*#__PURE__*/function () {
|
|
11364
11421
|
}, {
|
11365
11422
|
key: "updatePrimitiveElement",
|
11366
11423
|
value: function updatePrimitiveElement(e, t, i) {
|
11367
|
-
this.isHighlighted &&
|
11424
|
+
this.isHighlighted && ki.Highlight.removeForPrimitive(this, e), this.primitiveTextRecorded || Li.Padding.adjustStateAfterRecodingPrimitiveElement(this, e), i && Li.Padding.adjustSateForNoTextPrimitiveElement(this);
|
11368
11425
|
var n = this.startPadding + this.finalTranscript + t;
|
11369
11426
|
if (e.value = n + this.endPadding, !this.isTargetInShadow) {
|
11370
11427
|
var r = n.length + this.numberOfSpacesAfterNewText;
|
@@ -11375,7 +11432,7 @@ var fa = /*#__PURE__*/function () {
|
|
11375
11432
|
}, {
|
11376
11433
|
key: "updateGenericElement",
|
11377
11434
|
value: function updateGenericElement(e, t, i) {
|
11378
|
-
this.isHighlighted &&
|
11435
|
+
this.isHighlighted && ki.Highlight.removeForGeneric(this, e), this.spansPopulated || ie.Elements.appendSpans(this, e);
|
11379
11436
|
var n = (i ? "" : this.startPadding) + Ii.Text.lineBreak(this.finalTranscript);
|
11380
11437
|
this.finalSpan.innerHTML = n;
|
11381
11438
|
var r = Pt.AutoScroll.isRequired(this.autoScroll, e);
|
@@ -11386,7 +11443,7 @@ var fa = /*#__PURE__*/function () {
|
|
11386
11443
|
}, {
|
11387
11444
|
key: "finalise",
|
11388
11445
|
value: function finalise(e) {
|
11389
|
-
this._genericElement && (e ? (this.finalSpan = ie.Elements.createGenericSpan(), this.setInterimColorToFinal(), this.interimSpan = ie.Elements.createInterimSpan(), this.scrollingSpan = ie.Elements.createGenericSpan()) : this._genericElement.textContent = this._genericElement.textContent, this.spansPopulated = !1),
|
11446
|
+
this._genericElement && (e ? (this.finalSpan = ie.Elements.createGenericSpan(), this.setInterimColorToFinal(), this.interimSpan = ie.Elements.createInterimSpan(), this.scrollingSpan = ie.Elements.createGenericSpan()) : this._genericElement.textContent = this._genericElement.textContent, this.spansPopulated = !1), Ln.EventListeners.remove(this);
|
11390
11447
|
}
|
11391
11448
|
}, {
|
11392
11449
|
key: "setInterimColorToFinal",
|
@@ -11420,19 +11477,18 @@ var fa = /*#__PURE__*/function () {
|
|
11420
11477
|
return fa;
|
11421
11478
|
}();
|
11422
11479
|
kt.Speech = fa;
|
11423
|
-
Object.defineProperty(
|
11480
|
+
Object.defineProperty(ci, "__esModule", {
|
11424
11481
|
value: !0
|
11425
11482
|
});
|
11426
|
-
|
11427
|
-
var On =
|
11483
|
+
ci.WebSpeech = void 0;
|
11484
|
+
var On = di,
|
11428
11485
|
Pn = nt,
|
11429
11486
|
ma = kt;
|
11430
11487
|
var Yt = /*#__PURE__*/function (_ma$Speech) {
|
11431
11488
|
_inherits(Yt, _ma$Speech);
|
11432
|
-
var _super41 = _createSuper(Yt);
|
11433
11489
|
function Yt() {
|
11434
11490
|
_classCallCheck(this, Yt);
|
11435
|
-
return
|
11491
|
+
return _callSuper(this, Yt);
|
11436
11492
|
}
|
11437
11493
|
_createClass(Yt, [{
|
11438
11494
|
key: "start",
|
@@ -11493,12 +11549,12 @@ var Yt = /*#__PURE__*/function (_ma$Speech) {
|
|
11493
11549
|
}]);
|
11494
11550
|
return Yt;
|
11495
11551
|
}(ma.Speech);
|
11496
|
-
|
11497
|
-
var
|
11498
|
-
Object.defineProperty(
|
11552
|
+
ci.WebSpeech = Yt;
|
11553
|
+
var mi = {};
|
11554
|
+
Object.defineProperty(mi, "__esModule", {
|
11499
11555
|
value: !0
|
11500
11556
|
});
|
11501
|
-
|
11557
|
+
mi.GlobalState = void 0;
|
11502
11558
|
var Ze = /*#__PURE__*/function () {
|
11503
11559
|
function Ze() {
|
11504
11560
|
_classCallCheck(this, Ze);
|
@@ -11513,14 +11569,14 @@ var Ze = /*#__PURE__*/function () {
|
|
11513
11569
|
}]);
|
11514
11570
|
return Ze;
|
11515
11571
|
}();
|
11516
|
-
|
11572
|
+
mi.GlobalState = Ze;
|
11517
11573
|
Ze.doubleClickPending = !1;
|
11518
|
-
var
|
11519
|
-
|
11520
|
-
Object.defineProperty(
|
11574
|
+
var gi = {},
|
11575
|
+
bi = {};
|
11576
|
+
Object.defineProperty(bi, "__esModule", {
|
11521
11577
|
value: !0
|
11522
11578
|
});
|
11523
|
-
|
11579
|
+
bi.PreventConnectionStop = void 0;
|
11524
11580
|
var ga = /*#__PURE__*/function () {
|
11525
11581
|
function ga() {
|
11526
11582
|
_classCallCheck(this, ga);
|
@@ -11540,19 +11596,19 @@ var ga = /*#__PURE__*/function () {
|
|
11540
11596
|
}]);
|
11541
11597
|
return ga;
|
11542
11598
|
}();
|
11543
|
-
|
11544
|
-
var
|
11545
|
-
|
11546
|
-
Object.defineProperty(
|
11599
|
+
bi.PreventConnectionStop = ga;
|
11600
|
+
var vi = {},
|
11601
|
+
yi = {};
|
11602
|
+
Object.defineProperty(yi, "__esModule", {
|
11547
11603
|
value: !0
|
11548
11604
|
});
|
11549
|
-
|
11550
|
-
|
11551
|
-
Object.defineProperty(
|
11605
|
+
yi.README_URL = void 0;
|
11606
|
+
yi.README_URL = "https://github.com/OvidijusParsiunas/speech-to-element";
|
11607
|
+
Object.defineProperty(vi, "__esModule", {
|
11552
11608
|
value: !0
|
11553
11609
|
});
|
11554
|
-
|
11555
|
-
var
|
11610
|
+
vi.AzureSpeechConfig = void 0;
|
11611
|
+
var Ri = yi;
|
11556
11612
|
var Zt = /*#__PURE__*/function () {
|
11557
11613
|
function Zt() {
|
11558
11614
|
_classCallCheck(this, Zt);
|
@@ -11560,29 +11616,29 @@ var Zt = /*#__PURE__*/function () {
|
|
11560
11616
|
_createClass(Zt, null, [{
|
11561
11617
|
key: "validateOptions",
|
11562
11618
|
value: function validateOptions(e, t) {
|
11563
|
-
return t ? !t.subscriptionKey && !t.token && !t.retrieveToken ? (e("Please define a 'subscriptionKey', 'token' or 'retrieveToken' property - more info: ".concat(
|
11619
|
+
return t ? !t.subscriptionKey && !t.token && !t.retrieveToken ? (e("Please define a 'subscriptionKey', 'token' or 'retrieveToken' property - more info: ".concat(Ri.README_URL)), !1) : t.region ? !0 : (e("Please define a 'region' property - more info: ".concat(Ri.README_URL)), !1) : (e("Please provide subscription details - more info: ".concat(Ri.README_URL)), !1);
|
11564
11620
|
}
|
11565
11621
|
}, {
|
11566
11622
|
key: "getNewSpeechConfig",
|
11567
11623
|
value: function () {
|
11568
|
-
var _getNewSpeechConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
11569
|
-
return _regeneratorRuntime().wrap(function
|
11570
|
-
while (1) switch (
|
11624
|
+
var _getNewSpeechConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee99(e, t) {
|
11625
|
+
return _regeneratorRuntime().wrap(function _callee99$(_context99) {
|
11626
|
+
while (1) switch (_context99.prev = _context99.next) {
|
11571
11627
|
case 0:
|
11572
11628
|
if (!t.region) {
|
11573
|
-
|
11629
|
+
_context99.next = 2;
|
11574
11630
|
break;
|
11575
11631
|
}
|
11576
|
-
return
|
11632
|
+
return _context99.abrupt("return", t.subscriptionKey ? e.fromSubscription(t.subscriptionKey.trim(), t.region.trim()) : t.token ? e.fromAuthorizationToken(t.token.trim(), t.region.trim()) : t.retrieveToken ? t.retrieveToken().then(function (i) {
|
11577
11633
|
return t.region ? e.fromAuthorizationToken((i == null ? void 0 : i.trim()) || "", t.region.trim()) : null;
|
11578
11634
|
})["catch"](function (i) {
|
11579
11635
|
return console.error(i), null;
|
11580
11636
|
}) : null);
|
11581
11637
|
case 2:
|
11582
11638
|
case "end":
|
11583
|
-
return
|
11639
|
+
return _context99.stop();
|
11584
11640
|
}
|
11585
|
-
},
|
11641
|
+
}, _callee99);
|
11586
11642
|
}));
|
11587
11643
|
function getNewSpeechConfig(_x183, _x184) {
|
11588
11644
|
return _getNewSpeechConfig.apply(this, arguments);
|
@@ -11597,21 +11653,21 @@ var Zt = /*#__PURE__*/function () {
|
|
11597
11653
|
}, {
|
11598
11654
|
key: "get",
|
11599
11655
|
value: function () {
|
11600
|
-
var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
11656
|
+
var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee100(e, t) {
|
11601
11657
|
var i;
|
11602
|
-
return _regeneratorRuntime().wrap(function
|
11603
|
-
while (1) switch (
|
11658
|
+
return _regeneratorRuntime().wrap(function _callee100$(_context100) {
|
11659
|
+
while (1) switch (_context100.prev = _context100.next) {
|
11604
11660
|
case 0:
|
11605
|
-
|
11661
|
+
_context100.next = 2;
|
11606
11662
|
return Zt.getNewSpeechConfig(e, t);
|
11607
11663
|
case 2:
|
11608
|
-
i =
|
11609
|
-
return
|
11664
|
+
i = _context100.sent;
|
11665
|
+
return _context100.abrupt("return", (i && Zt.process(i, t), i));
|
11610
11666
|
case 4:
|
11611
11667
|
case "end":
|
11612
|
-
return
|
11668
|
+
return _context100.stop();
|
11613
11669
|
}
|
11614
|
-
},
|
11670
|
+
}, _callee100);
|
11615
11671
|
}));
|
11616
11672
|
function get(_x185, _x186) {
|
11617
11673
|
return _get.apply(this, arguments);
|
@@ -11621,12 +11677,12 @@ var Zt = /*#__PURE__*/function () {
|
|
11621
11677
|
}]);
|
11622
11678
|
return Zt;
|
11623
11679
|
}();
|
11624
|
-
|
11625
|
-
var
|
11626
|
-
Object.defineProperty(
|
11680
|
+
vi.AzureSpeechConfig = Zt;
|
11681
|
+
var xi = {};
|
11682
|
+
Object.defineProperty(xi, "__esModule", {
|
11627
11683
|
value: !0
|
11628
11684
|
});
|
11629
|
-
|
11685
|
+
xi.StopTimeout = void 0;
|
11630
11686
|
var Et = /*#__PURE__*/function () {
|
11631
11687
|
function Et() {
|
11632
11688
|
_classCallCheck(this, Et);
|
@@ -11646,13 +11702,13 @@ var Et = /*#__PURE__*/function () {
|
|
11646
11702
|
}]);
|
11647
11703
|
return Et;
|
11648
11704
|
}();
|
11649
|
-
|
11705
|
+
xi.StopTimeout = Et;
|
11650
11706
|
Et.DEFAULT_MS = 2e4;
|
11651
|
-
var
|
11652
|
-
Object.defineProperty(
|
11707
|
+
var Ei = {};
|
11708
|
+
Object.defineProperty(Ei, "__esModule", {
|
11653
11709
|
value: !0
|
11654
11710
|
});
|
11655
|
-
|
11711
|
+
Ei.AzureTranscript = void 0;
|
11656
11712
|
var ba = At;
|
11657
11713
|
var va = /*#__PURE__*/function () {
|
11658
11714
|
function va() {
|
@@ -11676,53 +11732,52 @@ var va = /*#__PURE__*/function () {
|
|
11676
11732
|
}]);
|
11677
11733
|
return va;
|
11678
11734
|
}();
|
11679
|
-
|
11680
|
-
Object.defineProperty(
|
11735
|
+
Ei.AzureTranscript = va;
|
11736
|
+
Object.defineProperty(gi, "__esModule", {
|
11681
11737
|
value: !0
|
11682
11738
|
});
|
11683
|
-
|
11684
|
-
var Dn =
|
11685
|
-
jn =
|
11686
|
-
|
11687
|
-
Fn =
|
11739
|
+
gi.Azure = void 0;
|
11740
|
+
var Dn = bi,
|
11741
|
+
jn = vi,
|
11742
|
+
Ni = xi,
|
11743
|
+
Fn = Ei,
|
11688
11744
|
ya = kt;
|
11689
11745
|
var Xt = /*#__PURE__*/function (_ya$Speech) {
|
11690
11746
|
_inherits(Xt, _ya$Speech);
|
11691
|
-
var _super42 = _createSuper(Xt);
|
11692
11747
|
function Xt() {
|
11693
11748
|
var _this53;
|
11694
11749
|
_classCallCheck(this, Xt);
|
11695
|
-
_this53 =
|
11750
|
+
_this53 = _callSuper(this, Xt, arguments), _this53._newTextPadding = "";
|
11696
11751
|
return _this53;
|
11697
11752
|
}
|
11698
11753
|
_createClass(Xt, [{
|
11699
11754
|
key: "start",
|
11700
11755
|
value: function start(e, t) {
|
11701
|
-
this._newTextPadding = "", this.stopTimeout === void 0 &&
|
11756
|
+
this._newTextPadding = "", this.stopTimeout === void 0 && Ni.StopTimeout.reset(this, e == null ? void 0 : e.stopAfterSilenceMs), this.prepareBeforeStart(e), this.startAsync(e), t || Dn.PreventConnectionStop.applyPrevention(this);
|
11702
11757
|
}
|
11703
11758
|
}, {
|
11704
11759
|
key: "startAsync",
|
11705
11760
|
value: function () {
|
11706
|
-
var _startAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
11761
|
+
var _startAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee101(e) {
|
11707
11762
|
var t;
|
11708
|
-
return _regeneratorRuntime().wrap(function
|
11709
|
-
while (1) switch (
|
11763
|
+
return _regeneratorRuntime().wrap(function _callee101$(_context101) {
|
11764
|
+
while (1) switch (_context101.prev = _context101.next) {
|
11710
11765
|
case 0:
|
11711
|
-
|
11712
|
-
if (!
|
11713
|
-
|
11766
|
+
_context101.t0 = this.validate(e);
|
11767
|
+
if (!_context101.t0) {
|
11768
|
+
_context101.next = 6;
|
11714
11769
|
break;
|
11715
11770
|
}
|
11716
|
-
|
11771
|
+
_context101.next = 4;
|
11717
11772
|
return this.instantiateService(e);
|
11718
11773
|
case 4:
|
11719
11774
|
this._translations = e == null ? void 0 : e.translations;
|
11720
11775
|
(t = this._service) === null || t === void 0 || t.startContinuousRecognitionAsync(function () {}, this.error);
|
11721
11776
|
case 6:
|
11722
11777
|
case "end":
|
11723
|
-
return
|
11778
|
+
return _context101.stop();
|
11724
11779
|
}
|
11725
|
-
},
|
11780
|
+
}, _callee101, this);
|
11726
11781
|
}));
|
11727
11782
|
function startAsync(_x187) {
|
11728
11783
|
return _startAsync.apply(this, arguments);
|
@@ -11737,26 +11792,26 @@ var Xt = /*#__PURE__*/function (_ya$Speech) {
|
|
11737
11792
|
}, {
|
11738
11793
|
key: "instantiateService",
|
11739
11794
|
value: function () {
|
11740
|
-
var _instantiateService = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
11795
|
+
var _instantiateService = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee102(e) {
|
11741
11796
|
var t, i, n, r;
|
11742
|
-
return _regeneratorRuntime().wrap(function
|
11743
|
-
while (1) switch (
|
11797
|
+
return _regeneratorRuntime().wrap(function _callee102$(_context102) {
|
11798
|
+
while (1) switch (_context102.prev = _context102.next) {
|
11744
11799
|
case 0:
|
11745
11800
|
t = Xt.getAPI();
|
11746
11801
|
i = t.AudioConfig.fromDefaultMicrophoneInput();
|
11747
|
-
|
11802
|
+
_context102.next = 4;
|
11748
11803
|
return jn.AzureSpeechConfig.get(t.SpeechConfig, e);
|
11749
11804
|
case 4:
|
11750
|
-
n =
|
11805
|
+
n = _context102.sent;
|
11751
11806
|
if (n) {
|
11752
11807
|
r = new t.SpeechRecognizer(n, i);
|
11753
11808
|
this.setEvents(r), this._service = r, e.retrieveToken && this.retrieveTokenInterval(e.retrieveToken);
|
11754
11809
|
} else this.error("Unable to contact Azure server");
|
11755
11810
|
case 6:
|
11756
11811
|
case "end":
|
11757
|
-
return
|
11812
|
+
return _context102.stop();
|
11758
11813
|
}
|
11759
|
-
},
|
11814
|
+
}, _callee102, this);
|
11760
11815
|
}));
|
11761
11816
|
function instantiateService(_x188) {
|
11762
11817
|
return _instantiateService.apply(this, arguments);
|
@@ -11777,7 +11832,7 @@ var Xt = /*#__PURE__*/function (_ya$Speech) {
|
|
11777
11832
|
i = _Fn$AzureTranscript$e.interimTranscript,
|
11778
11833
|
n = _Fn$AzureTranscript$e.finalTranscript,
|
11779
11834
|
r = _Fn$AzureTranscript$e.newText;
|
11780
|
-
|
11835
|
+
Ni.StopTimeout.reset(this, this.stopTimeoutMS), this.updateElements(i, n, r);
|
11781
11836
|
}
|
11782
11837
|
// WORK - huge opportunity to fix this in the repo!!!!!
|
11783
11838
|
// function onRecognized(sender, recognitionEventArgs) {
|
@@ -11798,7 +11853,7 @@ var Xt = /*#__PURE__*/function (_ya$Speech) {
|
|
11798
11853
|
n = _Fn$AzureTranscript$e2.interimTranscript,
|
11799
11854
|
r = _Fn$AzureTranscript$e2.finalTranscript,
|
11800
11855
|
o = _Fn$AzureTranscript$e2.newText;
|
11801
|
-
|
11856
|
+
Ni.StopTimeout.reset(this, this.stopTimeoutMS), this.updateElements(n, r, o), r !== "" && (this._newTextPadding = " ");
|
11802
11857
|
}
|
11803
11858
|
break;
|
11804
11859
|
}
|
@@ -11854,14 +11909,14 @@ var Xt = /*#__PURE__*/function (_ya$Speech) {
|
|
11854
11909
|
}]);
|
11855
11910
|
return Xt;
|
11856
11911
|
}(ya.Speech);
|
11857
|
-
|
11912
|
+
gi.Azure = Xt;
|
11858
11913
|
Object.defineProperty(gs, "__esModule", {
|
11859
11914
|
value: !0
|
11860
11915
|
});
|
11861
|
-
var Bn =
|
11862
|
-
xa =
|
11863
|
-
ee =
|
11864
|
-
Ea =
|
11916
|
+
var Bn = ci,
|
11917
|
+
xa = Lt,
|
11918
|
+
ee = mi,
|
11919
|
+
Ea = gi;
|
11865
11920
|
var Je = /*#__PURE__*/function () {
|
11866
11921
|
function Je() {
|
11867
11922
|
_classCallCheck(this, Je);
|
@@ -11903,19 +11958,18 @@ var Je = /*#__PURE__*/function () {
|
|
11903
11958
|
}]);
|
11904
11959
|
return Je;
|
11905
11960
|
}();
|
11906
|
-
var
|
11961
|
+
var Oi = gs["default"] = Je;
|
11907
11962
|
var Qt = /*#__PURE__*/function (_xt) {
|
11908
11963
|
_inherits(Qt, _xt);
|
11909
|
-
var _super43 = _createSuper(Qt);
|
11910
11964
|
function Qt(e, t, i) {
|
11911
11965
|
var _this55;
|
11912
11966
|
_classCallCheck(this, Qt);
|
11913
11967
|
var o;
|
11914
|
-
_this55 =
|
11968
|
+
_this55 = _callSuper(this, Qt, [_typeof(e.speechToText) == "object" ? (o = e.speechToText) == null ? void 0 : o.button : {}]);
|
11915
11969
|
var _Qt$processConfigurat = Qt.processConfiguration(t, e.speechToText),
|
11916
11970
|
n = _Qt$processConfigurat.serviceName,
|
11917
11971
|
r = _Qt$processConfigurat.processedConfig;
|
11918
|
-
if (_this55._addErrorMessage = i, n === "webspeech" && !
|
11972
|
+
if (_this55._addErrorMessage = i, n === "webspeech" && !Oi.isWebSpeechSupported()) _this55.changeToUnsupported();else {
|
11919
11973
|
var a = !e.textInput || !e.textInput.disabled;
|
11920
11974
|
_this55.elementRef.onclick = _this55.buttonClick.bind(_assertThisInitialized(_this55), t, a, n, r);
|
11921
11975
|
}
|
@@ -11925,7 +11979,7 @@ var Qt = /*#__PURE__*/function (_xt) {
|
|
11925
11979
|
_createClass(Qt, [{
|
11926
11980
|
key: "buttonClick",
|
11927
11981
|
value: function buttonClick(e, t, i, n) {
|
11928
|
-
e.removeTextIfPlaceholder(),
|
11982
|
+
e.removeTextIfPlaceholder(), Oi.toggle(i, _objectSpread({
|
11929
11983
|
insertInCursorLocation: !1,
|
11930
11984
|
element: t ? e.inputElementRef : void 0,
|
11931
11985
|
onError: this.onError.bind(this),
|
@@ -11963,7 +12017,7 @@ var Qt = /*#__PURE__*/function (_xt) {
|
|
11963
12017
|
return d.toLowerCase().includes(a) ? (setTimeout(function () {
|
11964
12018
|
var u;
|
11965
12019
|
return (u = e.submit) == null ? void 0 : u.call(e);
|
11966
|
-
}),
|
12020
|
+
}), Oi.endCommandMode(), {
|
11967
12021
|
restart: !0,
|
11968
12022
|
removeNewText: !0
|
11969
12023
|
}) : null;
|
@@ -11996,17 +12050,16 @@ var bs = /*#__PURE__*/function () {
|
|
11996
12050
|
}]);
|
11997
12051
|
return bs;
|
11998
12052
|
}();
|
11999
|
-
var
|
12000
|
-
_inherits(
|
12001
|
-
|
12002
|
-
function Sa(e, t) {
|
12053
|
+
var _a = /*#__PURE__*/function (_xt2) {
|
12054
|
+
_inherits(_a, _xt2);
|
12055
|
+
function _a(e, t) {
|
12003
12056
|
var _this56;
|
12004
|
-
_classCallCheck(this,
|
12057
|
+
_classCallCheck(this, _a);
|
12005
12058
|
var i, n;
|
12006
|
-
_this56 =
|
12059
|
+
_this56 = _callSuper(this, _a, [t.button]), _this56._waitingForBrowserApproval = !1, _this56._audioType = e, _this56._extension = ((i = t.files) == null ? void 0 : i.format) || "mp3", _this56._maxDurationSeconds = (n = t.files) == null ? void 0 : n.maxDurationSeconds, _this56.elementRef.onclick = _this56.buttonClick.bind(_assertThisInitialized(_this56));
|
12007
12060
|
return _this56;
|
12008
12061
|
}
|
12009
|
-
_createClass(
|
12062
|
+
_createClass(_a, [{
|
12010
12063
|
key: "buttonClick",
|
12011
12064
|
value: function buttonClick() {
|
12012
12065
|
this._waitingForBrowserApproval || (this.isActive ? this.stop() : (this._waitingForBrowserApproval = !0, this.record()));
|
@@ -12057,7 +12110,7 @@ var Sa = /*#__PURE__*/function (_xt2) {
|
|
12057
12110
|
};
|
12058
12111
|
}
|
12059
12112
|
}]);
|
12060
|
-
return
|
12113
|
+
return _a;
|
12061
12114
|
}(xt);
|
12062
12115
|
var wa = "<?xml version=\"1.0\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.0//EN\" \"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\">\n<svg xmlns=\"http://www.w3.org/2000/svg\" stroke=\"currentColor\" fill=\"none\" stroke-width=\"1\" viewBox=\"0 0 24 24\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <line x1=\"22\" y1=\"2\" x2=\"11\" y2=\"14\"></line>\n <polygon points=\"22 2 15 22 11 14 2 10 22 2\"></polygon>\n</svg>\n";
|
12063
12116
|
var B = /*#__PURE__*/function () {
|
@@ -12128,15 +12181,14 @@ var ke = /*#__PURE__*/function () {
|
|
12128
12181
|
}]);
|
12129
12182
|
return ke;
|
12130
12183
|
}();
|
12131
|
-
var
|
12184
|
+
var _i = /*#__PURE__*/function (_Tt4) {
|
12132
12185
|
_inherits(k, _Tt4);
|
12133
|
-
var _super45 = _createSuper(k);
|
12134
12186
|
// prettier-ignore
|
12135
12187
|
function k(e, t, i, n, r) {
|
12136
12188
|
var _this60;
|
12137
12189
|
_classCallCheck(this, k);
|
12138
12190
|
var o = ke.process(e.submitButtonStyles);
|
12139
|
-
_this60 =
|
12191
|
+
_this60 = _callSuper(this, k, [k.createButtonContainerElement(), o == null ? void 0 : o.position, o]), _this60._isSVGLoadingIconOverriden = !1, _this60.status = {
|
12140
12192
|
requestInProgress: !1,
|
12141
12193
|
loadingActive: !1
|
12142
12194
|
}, _this60._messages = i, _this60._inputElementRef = t, _this60._fileAttachments = r, _this60._innerElements = _this60.createInnerElements(), _this60._abortStream = new AbortController(), _this60._stopClicked = {
|
@@ -12200,12 +12252,12 @@ var Ei = /*#__PURE__*/function (_Tt4) {
|
|
12200
12252
|
}, {
|
12201
12253
|
key: "submitFromInput",
|
12202
12254
|
value: function () {
|
12203
|
-
var _submitFromInput = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
12255
|
+
var _submitFromInput = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee103() {
|
12204
12256
|
var t, e, _i18;
|
12205
|
-
return _regeneratorRuntime().wrap(function
|
12206
|
-
while (1) switch (
|
12257
|
+
return _regeneratorRuntime().wrap(function _callee103$(_context103) {
|
12258
|
+
while (1) switch (_context103.prev = _context103.next) {
|
12207
12259
|
case 0:
|
12208
|
-
|
12260
|
+
_context103.next = 2;
|
12209
12261
|
return this._fileAttachments.completePlaceholders();
|
12210
12262
|
case 2:
|
12211
12263
|
e = this._fileAttachments.getAllFileData();
|
@@ -12221,9 +12273,9 @@ var Ei = /*#__PURE__*/function (_Tt4) {
|
|
12221
12273
|
}
|
12222
12274
|
case 4:
|
12223
12275
|
case "end":
|
12224
|
-
return
|
12276
|
+
return _context103.stop();
|
12225
12277
|
}
|
12226
|
-
},
|
12278
|
+
}, _callee103, this);
|
12227
12279
|
}));
|
12228
12280
|
function submitFromInput() {
|
12229
12281
|
return _submitFromInput.apply(this, arguments);
|
@@ -12233,13 +12285,13 @@ var Ei = /*#__PURE__*/function (_Tt4) {
|
|
12233
12285
|
}, {
|
12234
12286
|
key: "programmaticSubmit",
|
12235
12287
|
value: function () {
|
12236
|
-
var _programmaticSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
12288
|
+
var _programmaticSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee104(e) {
|
12237
12289
|
var _this61 = this;
|
12238
12290
|
var t;
|
12239
|
-
return _regeneratorRuntime().wrap(function
|
12240
|
-
while (1) switch (
|
12291
|
+
return _regeneratorRuntime().wrap(function _callee104$(_context104) {
|
12292
|
+
while (1) switch (_context104.prev = _context104.next) {
|
12241
12293
|
case 0:
|
12242
|
-
typeof e == "string" && (e =
|
12294
|
+
typeof e == "string" && (e = Ie.processSubmitUserMessage(e));
|
12243
12295
|
t = {
|
12244
12296
|
text: e.text
|
12245
12297
|
};
|
@@ -12253,9 +12305,9 @@ var Ei = /*#__PURE__*/function (_Tt4) {
|
|
12253
12305
|
});
|
12254
12306
|
case 3:
|
12255
12307
|
case "end":
|
12256
|
-
return
|
12308
|
+
return _context104.stop();
|
12257
12309
|
}
|
12258
|
-
},
|
12310
|
+
}, _callee104);
|
12259
12311
|
}));
|
12260
12312
|
function programmaticSubmit(_x189) {
|
12261
12313
|
return _programmaticSubmit.apply(this, arguments);
|
@@ -12265,50 +12317,50 @@ var Ei = /*#__PURE__*/function (_Tt4) {
|
|
12265
12317
|
}, {
|
12266
12318
|
key: "attemptSubmit",
|
12267
12319
|
value: function () {
|
12268
|
-
var _attemptSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
12320
|
+
var _attemptSubmit = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee105(e) {
|
12269
12321
|
var t,
|
12270
12322
|
r,
|
12271
12323
|
o,
|
12272
12324
|
a,
|
12273
12325
|
i,
|
12274
12326
|
n,
|
12275
|
-
|
12276
|
-
return _regeneratorRuntime().wrap(function
|
12277
|
-
while (1) switch (
|
12327
|
+
_args105 = arguments;
|
12328
|
+
return _regeneratorRuntime().wrap(function _callee105$(_context105) {
|
12329
|
+
while (1) switch (_context105.prev = _context105.next) {
|
12278
12330
|
case 0:
|
12279
|
-
t =
|
12280
|
-
|
12331
|
+
t = _args105.length > 1 && _args105[1] !== undefined ? _args105[1] : !1;
|
12332
|
+
_context105.next = 3;
|
12281
12333
|
return (r = this._validationHandler) == null ? void 0 : r.call(this, t ? e : void 0);
|
12282
12334
|
case 3:
|
12283
|
-
|
12284
|
-
|
12285
|
-
if (!(
|
12286
|
-
|
12335
|
+
_context105.t0 = _context105.sent;
|
12336
|
+
_context105.t1 = !1;
|
12337
|
+
if (!(_context105.t0 === _context105.t1)) {
|
12338
|
+
_context105.next = 7;
|
12287
12339
|
break;
|
12288
12340
|
}
|
12289
|
-
return
|
12341
|
+
return _context105.abrupt("return");
|
12290
12342
|
case 7:
|
12291
12343
|
this.changeToLoadingIcon();
|
12292
|
-
|
12344
|
+
_context105.next = 10;
|
12293
12345
|
return this.addNewMessage(e);
|
12294
12346
|
case 10:
|
12295
12347
|
this._serviceIO.isWebModel() || this._messages.addLoadingMessage();
|
12296
|
-
|
12348
|
+
Gi.clear(this._inputElementRef);
|
12297
12349
|
i = (o = e.files) == null ? void 0 : o.map(function (l) {
|
12298
12350
|
return l.file;
|
12299
12351
|
}), n = {
|
12300
12352
|
text: e.text === "" ? void 0 : e.text,
|
12301
12353
|
files: i
|
12302
12354
|
};
|
12303
|
-
|
12355
|
+
_context105.next = 15;
|
12304
12356
|
return this._serviceIO.callAPI(n, this._messages);
|
12305
12357
|
case 15:
|
12306
12358
|
(a = this._fileAttachments) == null || a.removeAllFiles();
|
12307
12359
|
case 16:
|
12308
12360
|
case "end":
|
12309
|
-
return
|
12361
|
+
return _context105.stop();
|
12310
12362
|
}
|
12311
|
-
},
|
12363
|
+
}, _callee105, this);
|
12312
12364
|
}));
|
12313
12365
|
function attemptSubmit(_x190) {
|
12314
12366
|
return _attemptSubmit.apply(this, arguments);
|
@@ -12318,33 +12370,33 @@ var Ei = /*#__PURE__*/function (_Tt4) {
|
|
12318
12370
|
}, {
|
12319
12371
|
key: "addNewMessage",
|
12320
12372
|
value: function () {
|
12321
|
-
var _addNewMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
12373
|
+
var _addNewMessage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee106(_ref14) {
|
12322
12374
|
var e, t, i;
|
12323
|
-
return _regeneratorRuntime().wrap(function
|
12324
|
-
while (1) switch (
|
12375
|
+
return _regeneratorRuntime().wrap(function _callee106$(_context106) {
|
12376
|
+
while (1) switch (_context106.prev = _context106.next) {
|
12325
12377
|
case 0:
|
12326
12378
|
e = _ref14.text, t = _ref14.files;
|
12327
12379
|
i = {
|
12328
12380
|
role: v.USER_ROLE
|
12329
12381
|
};
|
12330
12382
|
e && (i.text = e);
|
12331
|
-
|
12332
|
-
if (!
|
12333
|
-
|
12383
|
+
_context106.t0 = t;
|
12384
|
+
if (!_context106.t0) {
|
12385
|
+
_context106.next = 8;
|
12334
12386
|
break;
|
12335
12387
|
}
|
12336
|
-
|
12388
|
+
_context106.next = 7;
|
12337
12389
|
return this._messages.addMultipleFiles(t);
|
12338
12390
|
case 7:
|
12339
|
-
i.files =
|
12391
|
+
i.files = _context106.sent;
|
12340
12392
|
case 8:
|
12341
12393
|
this._serviceIO.sessionId && (i._sessionId = this._serviceIO.sessionId);
|
12342
12394
|
Object.keys(i).length > 0 && this._messages.addNewMessage(i);
|
12343
12395
|
case 10:
|
12344
12396
|
case "end":
|
12345
|
-
return
|
12397
|
+
return _context106.stop();
|
12346
12398
|
}
|
12347
|
-
},
|
12399
|
+
}, _callee106, this);
|
12348
12400
|
}));
|
12349
12401
|
function addNewMessage(_x191) {
|
12350
12402
|
return _addNewMessage.apply(this, arguments);
|
@@ -12414,22 +12466,21 @@ var Ei = /*#__PURE__*/function (_Tt4) {
|
|
12414
12466
|
}]);
|
12415
12467
|
return k;
|
12416
12468
|
}(Tt);
|
12417
|
-
|
12418
|
-
|
12419
|
-
|
12420
|
-
var
|
12469
|
+
_i.SUBMIT_CLASS = "submit-button";
|
12470
|
+
_i.LOADING_CLASS = "loading-button";
|
12471
|
+
_i.DISABLED_CLASS = "disabled-button";
|
12472
|
+
var Sa = _i;
|
12421
12473
|
var Ma = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M27.1 14.313V5.396L24.158 8.34c-2.33-2.325-5.033-3.503-8.11-3.503C9.902 4.837 4.901 9.847 4.899 16c.001 6.152 5.003 11.158 11.15 11.16 4.276 0 9.369-2.227 10.836-8.478l.028-.122h-3.23l-.022.068c-1.078 3.242-4.138 5.421-7.613 5.421a8 8 0 0 1-5.691-2.359A7.993 7.993 0 0 1 8 16.001c0-4.438 3.611-8.049 8.05-8.049 2.069 0 3.638.58 5.924 2.573l-3.792 3.789H27.1z\"/>\n</svg>\n",
|
12422
12474
|
Ta = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <title>capture</title>\n <path d=\"M0 16q0 3.264 1.28 6.208t3.392 5.12 5.12 3.424 6.208 1.248 6.208-1.248 5.12-3.424 3.392-5.12 1.28-6.208-1.28-6.208-3.392-5.12-5.088-3.392-6.24-1.28q-3.264 0-6.208 1.28t-5.12 3.392-3.392 5.12-1.28 6.208zM4 16q0-3.264 1.6-6.016t4.384-4.352 6.016-1.632 6.016 1.632 4.384 4.352 1.6 6.016-1.6 6.048-4.384 4.352-6.016 1.6-6.016-1.6-4.384-4.352-1.6-6.048z\"></path>\n</svg>\n",
|
12423
12475
|
Ca = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 1024 1024\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M195.2 195.2a64 64 0 0 1 90.496 0L512 421.504 738.304 195.2a64 64 0 0 1 90.496 90.496L602.496 512 828.8 738.304a64 64 0 0 1-90.496 90.496L512 602.496 285.696 828.8a64 64 0 0 1-90.496-90.496L421.504 512 195.2 285.696a64 64 0 0 1 0-90.496z\"/>\n</svg>",
|
12424
12476
|
Aa = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M4.89163 13.2687L9.16582 17.5427L18.7085 8\" stroke=\"#000000\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>";
|
12425
12477
|
var rn = /*#__PURE__*/function (_ct) {
|
12426
12478
|
_inherits(rn, _ct);
|
12427
|
-
var _super46 = _createSuper(rn);
|
12428
12479
|
// prettier-ignore
|
12429
12480
|
function rn(e, t, i, n) {
|
12430
12481
|
var _this62;
|
12431
12482
|
_classCallCheck(this, rn);
|
12432
|
-
_this62 =
|
12483
|
+
_this62 = _callSuper(this, rn, [e, ["modal-content", "modal-camera-content"], i]), _this62._stopped = !1, _this62._format = "image/png", _this62._canvas = document.createElement("canvas"), _this62._canvas.classList.add("camera-modal-canvas");
|
12433
12484
|
var _this62$addButtonsAnd = _this62.addButtonsAndTheirEvents(t),
|
12434
12485
|
r = _this62$addButtonsAnd.captureButton,
|
12435
12486
|
o = _this62$addButtonsAnd.submitButton;
|
@@ -12540,12 +12591,11 @@ var rn = /*#__PURE__*/function (_ct) {
|
|
12540
12591
|
var ka = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M29 7h-4.599l-2.401-4h-12l-2.4 4h-4.6c-1 0-3 1-3 2.969v16.031c0 1.657 1.5 3 2.792 3h26.271c1.313 0 2.938-1.406 2.938-2.968v-16.032c0-1-1-3-3-3zM30 26.032c0 0.395-0.639 0.947-0.937 0.969h-26.265c-0.232-0.019-0.797-0.47-0.797-1v-16.031c0-0.634 0.851-0.953 1-0.969h5.732l2.4-4h9.802l1.785 3.030 0.55 0.97h5.731c0.705 0 0.99 0.921 1 1v16.032zM16 10c-3.866 0-7 3.134-7 7s3.134 7 7 7 7-3.134 7-7-3.134-7-7-7zM16 22c-2.757 0-5-2.243-5-5s2.243-5 5-5 5 2.243 5 5-2.243 5-5 5z\"></path>\n</svg>";
|
12541
12592
|
var ei = /*#__PURE__*/function (_Tt5) {
|
12542
12593
|
_inherits(ei, _Tt5);
|
12543
|
-
var _super47 = _createSuper(ei);
|
12544
12594
|
function ei(e, t, i) {
|
12545
12595
|
var _this66;
|
12546
12596
|
_classCallCheck(this, ei);
|
12547
12597
|
var r;
|
12548
|
-
_this66 =
|
12598
|
+
_this66 = _callSuper(this, ei, [ei.createButtonElement(), (r = i == null ? void 0 : i.button) == null ? void 0 : r.position, (i == null ? void 0 : i.button) || {}, "Photo"]);
|
12549
12599
|
var n = _this66.createInnerElements(_this66._customStyles);
|
12550
12600
|
i && _this66.addClickEvent(e, t, i.modalContainerStyle, i.files), _this66.elementRef.classList.add("upload-file-button"), _this66.elementRef.appendChild(n.styles), _this66.reapplyStateStyle("styles");
|
12551
12601
|
return _this66;
|
@@ -12589,13 +12639,13 @@ var mt = /*#__PURE__*/function () {
|
|
12589
12639
|
function mt(e, t, i, n) {
|
12590
12640
|
_classCallCheck(this, mt);
|
12591
12641
|
this.elementRef = mt.createPanelElement(e.inputAreaStyle);
|
12592
|
-
var r = new
|
12642
|
+
var r = new Gi(e, i),
|
12593
12643
|
o = {},
|
12594
12644
|
a = this.createFileUploadComponents(e, i, n, o);
|
12595
12645
|
e.speechToText && !o.microphone && (o.microphone = {
|
12596
12646
|
button: new Qt(e, r, t.addNewErrorMessage.bind(t))
|
12597
12647
|
});
|
12598
|
-
var l = new
|
12648
|
+
var l = new Sa(e, r.inputElementRef, t, i, a);
|
12599
12649
|
r.submit = l.submitFromInput.bind(l), Ce.attach(e, i, r, a, l), e.submitUserMessage = l.programmaticSubmit.bind(l), o.submit = {
|
12600
12650
|
button: l
|
12601
12651
|
}, mt.addElements(this.elementRef, r, o, n, a, e.dropupStyles);
|
@@ -12616,7 +12666,7 @@ var mt = /*#__PURE__*/function () {
|
|
12616
12666
|
if ((l = t.recordAudio) != null && l.files) {
|
12617
12667
|
var _d = ((c = n.audio) == null ? void 0 : c.fileType) || r.addType(e, t.recordAudio.files, "audio");
|
12618
12668
|
n.microphone = {
|
12619
|
-
button: new
|
12669
|
+
button: new _a(_d, t.recordAudio)
|
12620
12670
|
};
|
12621
12671
|
}
|
12622
12672
|
return de.isEnabled(r, e.dragAndDrop) && de.create(i, r, e.dragAndDrop), r;
|
@@ -12683,20 +12733,19 @@ var on = /*#__PURE__*/function () {
|
|
12683
12733
|
}]);
|
12684
12734
|
return on;
|
12685
12735
|
}();
|
12686
|
-
var Ia = "#validate-property-key-view{height:100%;position:relative;display:flex;justify-content:center;align-items:center;padding:8px}#large-loading-ring{display:inline-block;width:50px;height:50px}#large-loading-ring:after{content:\" \";display:block;width:38px;height:38px;margin:1px;border-radius:50%;border:5px solid #5fb2ff;border-color:#5fb2ff transparent #5fb2ff transparent;animation:large-loading-ring 1.4s linear infinite}@keyframes large-loading-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}#insert-key-view{height:100%;position:relative}#insert-key-contents{text-align:center;position:absolute;top:44%;left:50%;transform:translate(-50%,-50%);width:82%;display:flex;max-width:700px}#insert-key-title{margin-bottom:15px}#insert-key-input-container{margin-right:2.7em;width:calc(100% - 80px)}#insert-key-input{padding:.3em 1.7em .3em .3em;border-width:1px;border-style:solid;border-radius:3px;width:100%;font-size:inherit}.insert-key-input-valid{border-color:gray}.insert-key-input-invalid{border-color:red}#visibility-icon-container{position:relative;float:right;cursor:pointer;-webkit-user-select:none;user-select:none}.visibility-icon{filter:brightness(0) saturate(100%) invert(63%) sepia(1%) saturate(9%) hue-rotate(43deg) brightness(98%) contrast(92%);position:absolute;right:-1.7em;top:-1.43em}#visible-icon{top:-1.4em}.visibility-icon:hover{filter:unset}.visibility-icon>*{pointer-events:none}#start-button{border:1px solid grey;color:#454545;border-radius:4px;width:3em;display:flex;justify-content:center;align-items:center;cursor:pointer;padding:.28em .3em;-webkit-user-select:none;user-select:none;background-color:#fff}#start-button:hover{background-color:#f2f2f2}#start-button:active{background-color:#d2d2d2}#insert-key-help-text-container{width:100%;position:absolute;margin-top:32px;margin-bottom:20px}#insert-key-help-text-contents{width:100%;position:absolute}#insert-key-input-invalid-text{display:block;margin-top:1em;margin-bottom:.5em;color:red}.insert-key-input-help-text{display:block;margin-top:16px}#loading-ring{display:inline-block;width:16px;height:16px}#loading-ring:after{content:\" \";display:block;width:11px;height:11px;margin:1px;border-radius:50%;border:2px solid #0084ff;border-color:#0084ff transparent #0084ff transparent;animation:loading-ring 1.2s linear infinite}@keyframes loading-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}#error-view{color:red;font-size:1.2em;line-height:1.3em;margin-top:-5px;text-align:center;height:100%;display:flex;justify-content:center;align-items:center;padding-left:8px;padding-right:8px}.intro-panel{position:absolute;display:flex;justify-content:center;right:0;bottom:0;left:0;margin:auto;height:fit-content;top:-2.5em}#internal-intro-panel{width:250px;height:min-content;display:block;border-radius:5px;overflow:auto;border:1px solid rgb(203,203,203);padding:10px;max-height:calc(100% - 6.8em)}#internal-intro-panel>p{margin-block-start:.8em;margin-block-end:.8em}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!\n Theme: a11y-dark\n Author: @ericwbailey\n Maintainer: @ericwbailey\n\n Based on the Tomorrow Night Eighties theme: https://github.com/isagalaev/highlight.js/blob/master/src/styles/tomorrow-night-eighties.css\n*/.hljs{background:#2b2b2b;color:#f8f8f2}.hljs-comment,.hljs-quote{color:#d4d0ab}.hljs-deletion,.hljs-name,.hljs-regexp,.hljs-selector-class,.hljs-selector-id,.hljs-tag,.hljs-template-variable,.hljs-variable{color:#ffa07a}.hljs-built_in,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-type{color:#f5ab35}.hljs-attribute{color:gold}.hljs-addition,.hljs-bullet,.hljs-string,.hljs-symbol{color:#abe338}.hljs-section,.hljs-title{color:#00e0e0}.hljs-keyword,.hljs-selector-tag{color:#dcc6e0}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}@media screen and (-ms-high-contrast: active){.hljs-addition,.hljs-attribute,.hljs-built_in,.hljs-bullet,.hljs-comment,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-quote,.hljs-string,.hljs-symbol,.hljs-type{color:highlight}.hljs-keyword,.hljs-selector-tag{font-weight:700}}#messages{overflow:auto}.outer-message-container:last-child{margin-bottom:5px}.inner-message-container{display:flex;margin-left:auto;margin-right:auto;width:calc(97.5% - 24px);max-width:100%}.message-bubble{margin-top:10px;word-wrap:break-word;width:fit-content;max-width:60%;border-radius:10px;padding:.42em .55em;height:fit-content;line-height:1.26em}.user-message-text{color:#fff;background-color:#0084ff;margin-right:0;margin-left:auto}.ai-message-text{color:#000;background-color:#e4e6eb;margin-left:0;margin-right:auto}.html-message{max-width:unset}.error-message-text{margin:14px auto 10px;background-color:#f4c0c0;color:#474747;text-align:center;max-width:95%}.loading-message-text{width:1em;padding:.6em .75em .6em 1.3em}.message-bubble>p:first-child{margin-top:0}.message-bubble>p:last-child{margin-bottom:0}pre{overflow:auto;display:block;word-break:break-all;word-wrap:break-word;border-radius:7px;background:#2b2b2b;color:#f8f8f2;margin-top:.8em;margin-bottom:.8em;padding:.6em;font-size:.9em;line-height:1.5em}.image-message{padding:0;display:flex;background-color:#ddd}.image-message>*,.image-message>*>*{width:100%;border-radius:8px;display:flex}.audio-message{width:60%;max-width:300px;height:2.2em;max-height:54px;padding:0;background-color:unset}.audio-player{width:100%;height:100%}.audio-player-safari{height:fit-content;width:40px}.audio-player-safari-left{float:left}.audio-player-safari-right{float:right}.any-file-message-bubble{padding:1px}.any-file-message-contents{display:flex}.any-file-message-icon-container{width:1.3em;min-width:1.3em;position:relative;border-radius:4px;margin-left:6px;margin-right:2px}.any-file-message-icon{background-color:#fff;border-radius:4px;position:absolute;width:1em;height:1.25em;padding:1px;margin-top:auto;margin-bottom:auto;top:0;bottom:0}.any-file-message-text{padding-top:5px;overflow-wrap:anywhere;padding-bottom:5px;padding-right:7px}.message-bubble>a{color:inherit}.left-item-position{margin-right:10px}.right-item-position{margin-left:10px}.deep-chat-web-model-button{margin-top:10px;margin-bottom:5px;margin-left:1px}.avatar{padding-top:5px;width:1.5em;height:1.5em;border-radius:1px}.avatar-container{margin-top:9px}.name{margin-top:16px;font-size:15px}#drag-and-drop{position:absolute;display:none;z-index:10;height:calc(100% - 10px);width:calc(100% - 10px);background-color:#70c6ff4d;border:5px dashed #6dafff}#file-attachment-container{position:absolute;height:3.6em;width:calc(80% - 4px);top:-2.5em;border-radius:5px;overflow:auto;text-align:left;background-color:#d7d7d73b;padding-left:4px}.file-attachment{width:2.85em;height:2.85em;display:inline-flex;margin-right:.6em;margin-bottom:.44em;margin-top:4px;position:relative;background-color:#fff;border-radius:5px}.image-attachment{width:100%;height:100%;object-fit:cover;border-radius:5px}.border-bound-attachment{width:calc(100% - 2px);height:calc(100% - 2px);border:1px solid #c3c3c3;border-radius:5px;overflow:hidden}.border-bound-attachment-safari{width:calc(100% - 1px);height:calc(100% - 1px)}.audio-attachment-icon-container{cursor:pointer}.audio-attachment-icon-container:hover{background-color:#f8f8f8}.attachment-icon{left:0;right:0;bottom:0;top:2px;margin:auto;position:absolute;width:25px;-webkit-user-select:none;user-select:none}.not-removable-attachment-icon{top:0;right:0;bottom:0;left:0}.play-icon{filter:brightness(0) saturate(100%) invert(17%) sepia(0%) saturate(1392%) hue-rotate(67deg) brightness(98%) contrast(97%)}.stop-icon{filter:brightness(0) saturate(100%) invert(29%) sepia(90%) saturate(1228%) hue-rotate(198deg) brightness(93%) contrast(98%)}.audio-placeholder-text-3-digits{padding-left:.26rem}.audio-placeholder-text-4-digits{padding-left:.1rem}.any-file-attachment{padding:2px 0}.file-attachment-text-container{position:absolute;width:inherit;display:flex;align-items:center;height:100%;top:-1px}.audio-placeholder-text-3-digits-container{padding-top:1px;cursor:default}.any-file-attachment-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding-left:.13em;margin-left:auto;margin-right:auto}.remove-file-attachment-button{height:1.25em;width:1.25em;border:1px solid #cfcfcf;border-radius:25px;background-color:#fff;top:-4px;right:-5px;position:absolute;display:flex;justify-content:center;cursor:pointer;-webkit-user-select:none;user-select:none}.remove-file-attachment-button:hover{background-color:#e4e4e4}.remove-file-attachment-button:active{background-color:#d7d7d7}.x-icon{color:#4e4e4e;top:-.075em;position:relative;font-size:1.05em}.modal{display:none;flex-direction:column;align-items:center;justify-content:center;position:absolute;width:80%;max-width:420px;max-height:80%;margin:auto;top:0;right:0;bottom:0;left:0;z-index:2}.modal-content{border-top:1px solid rgb(217,217,217);border-left:1px solid rgb(217,217,217);border-right:1px solid rgb(217,217,217);border-top-left-radius:inherit;border-top-right-radius:inherit;background-color:#fff;overflow-y:auto;height:fit-content;max-height:calc(100% - 3.3em);width:100%}.modal-content>p{margin-left:1em;margin-right:1em}.modal-content>ul{margin-right:1em}.modal-button-panel{height:3.3em;border:1px solid;border-color:rgb(223,223,223) rgb(217,217,217) rgb(217,217,217);border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;background-color:#fff;text-align:center;justify-content:center;display:flex;width:100%}.modal-button{min-width:2.5em;text-align:center;color:#fff;border-radius:5px;padding:.4em .4em .3em;height:1.25em;background-color:#3279b2;top:0;bottom:0;cursor:pointer;-webkit-user-select:none;user-select:none;margin:auto .31em}.modal-button:hover{background-color:#276da7}.modal-button:active{background-color:#1b5687}.modal-svg-button{padding:0 0 2px;width:2em;height:1.8em}.modal-svg-button-icon{width:100%;height:100%;filter:brightness(0) saturate(100%) invert(100%) sepia(15%) saturate(4%) hue-rotate(346deg) brightness(101%) contrast(102%)}#modal-background-panel{position:absolute;width:100%;height:100%;background-color:#00000042;z-index:1;display:none}.show-modal-background{animation:fadeInBackground .3s ease-in-out}@keyframes fadeInBackground{0%{opacity:0}to{opacity:1}}.show-modal{animation:fadeInModal .3s ease-in-out}@keyframes fadeInModal{0%{opacity:0;scale:.95}to{opacity:1;scale:1}}.hide-modal-background{animation:fadeOutBackground .2s ease-in-out}@keyframes fadeOutBackground{0%{opacity:1}to{opacity:0}}.hide-modal{animation:fadeOutModal .2s ease-in-out}@keyframes fadeOutModal{0%{opacity:1;scale:1}to{opacity:0;scale:.95}}.modal-camera-content{overflow:hidden;text-align:center;border:unset;height:100%;background-color:#2a2a2a;display:flex;justify-content:center}.camera-modal-canvas{max-width:100%;max-height:100%;margin-top:auto;margin-bottom:auto}.modal-svg-submit-button{background-color:green}.modal-svg-submit-button:hover{background-color:#007500}.modal-svg-submit-button:active{background-color:#006500}.modal-svg-submit-disabled{pointer-events:none;background-color:#747474}.modal-svg-close-button{height:1.56em;padding-top:.37em;padding-bottom:0;background-color:#c13e3e}.modal-svg-close-button:hover{background-color:#b43434}.modal-svg-close-button:active{background-color:#972929}.modal-svg-close-icon{width:80%;height:80%}.modal-svg-camera-button{height:1.6em;padding-top:.38em;padding-bottom:0}.modal-svg-camera-icon{height:76%}.modal-svg-refresh-icon{height:105%}.modal-svg-refresh-button{height:1.66em;padding-top:.11em;padding-bottom:.21em}.input-button-container{position:relative;z-index:1}.inside-right{position:absolute;right:calc(10% + .35em);bottom:.85em}.inside-left{position:absolute;left:calc(10% + .35em);bottom:.85em}.outside-left{position:absolute;right:calc(11px - .55em);bottom:.88em}.outside-right{position:absolute;left:calc(11px - .55em);bottom:.88em}#upload-images-icon{position:absolute;pointer-events:none;width:1.45em;height:1.45em;left:.11em;bottom:.08em;filter:brightness(0) saturate(100%) invert(43%) sepia(0%) saturate(740%) hue-rotate(77deg) brightness(99%) contrast(92%)}#upload-gifs-icon{position:absolute;pointer-events:none;width:1.5em;height:1.48em;left:.07em;bottom:.08em;filter:brightness(0) saturate(100%) invert(49%) sepia(0%) saturate(2586%) hue-rotate(12deg) brightness(93%) contrast(90%)}#upload-audio-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.17em;bottom:.2em;filter:brightness(0) saturate(100%) invert(15%) sepia(0%) saturate(337%) hue-rotate(125deg) brightness(91%) contrast(94%);transform:scaleX(.95)}#camera-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.23em;bottom:.2em;filter:brightness(0) saturate(100%) invert(52%) sepia(0%) saturate(161%) hue-rotate(164deg) brightness(91%) contrast(92%);transform:scaleX(.95)}#upload-mixed-files-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.25em;bottom:.2em;filter:brightness(0) saturate(100%) invert(53%) sepia(0%) saturate(36%) hue-rotate(74deg) brightness(98%) contrast(93%);transform:scaleX(.95)}#interim-text{color:gray}#microphone-button{padding-top:.5px}.outer-button-container>#microphone-button{padding-bottom:1px}#microphone-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.25em;bottom:.25em}.default-microphone-icon{filter:brightness(0) saturate(100%) invert(32%) sepia(0%) saturate(924%) hue-rotate(46deg) brightness(95%) contrast(99%)}.active-microphone-icon{filter:brightness(0) saturate(100%) invert(10%) sepia(97%) saturate(7495%) hue-rotate(0deg) brightness(101%) contrast(107%);border-radius:10px}.command-microphone-icon{filter:brightness(0) saturate(100%) invert(42%) sepia(96%) saturate(1067%) hue-rotate(77deg) brightness(99%) contrast(102%)}.unsupported-microphone{display:none}#submit-icon{height:100%;filter:brightness(0) saturate(100%) invert(32%) sepia(0%) saturate(924%) hue-rotate(46deg) brightness(95%) contrast(99%);width:1.21em}#stop-icon{background-color:#acacac;position:absolute;width:.95em;height:.95em;left:.35em;bottom:.35em;border-radius:2px}.submit-button-enlarged{scale:1.1;margin-right:.3em;margin-left:.3em}.dots-jumping{position:relative;left:calc(-9990px + .275em);width:.22em;height:.22em;border-radius:5px;background-color:#848484;color:#848484;box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484;animation:dots-jumping 1.5s infinite linear;bottom:-.7em}@keyframes dots-jumping{0%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}16.667%{box-shadow:9990px -6px #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}33.333%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}50%{box-shadow:9990px 0 #848484,calc(9990px + .44em) -6px 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}66.667%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}83.333%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) -6px 0 0 #848484}to{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}}.dots-flashing{position:relative;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite linear alternate;animation-delay:.5s}.dots-flashing:before,.dots-flashing:after{content:\"\";display:inline-block;position:absolute;top:0}.dots-flashing:before{left:-.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite alternate;animation-delay:0s}.dots-flashing:after{left:.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite alternate;animation-delay:1s}@keyframes dots-flashing{0%{background-color:var(--message-dots-color)}50%,to{background-color:var(--message-dots-color-fade)}}.input-button{border-radius:4px;cursor:pointer;margin-bottom:.2em;-webkit-user-select:none;user-select:none}.input-button-svg{width:1.65em;height:1.65em}.input-button:hover{background-color:#9c9c9c2e}.input-button:active{background-color:#9c9c9c5e}.loading-button{cursor:auto}.loading-button:hover{background-color:unset}.text-button{filter:unset!important;display:flex;justify-content:center;align-items:center;margin-left:4px;margin-right:4px;height:1.6em}#text-input-container{background-color:#fff;width:80%;display:flex;border:1px solid #0000001a;border-radius:5px;margin-top:.8em;margin-bottom:.8em;box-shadow:#959da533 0 1px 12px;overflow-y:auto;max-height:200px;position:relative}.text-input-container-left-adjustment{margin-left:1.5em}.text-input-container-right-adjustment{margin-right:1.5em}.text-input-container-left-small-adjustment{margin-left:1.1em}.text-input-container-left-small-adjustment>.outside-left{right:calc(14px - .55em)}.text-input-container-right-small-adjustment{margin-right:1.1em}.text-input-container-right-small-adjustment>.outside-right{left:calc(14px - .55em)}#text-input{text-align:left;outline:none;word-wrap:break-word;line-break:auto}.text-input-styling{padding:.4em .5em;overflow:overlay;width:100%}.text-input-inner-left-adjustment{padding-left:2.2em}.text-input-inner-right-adjustment{padding-right:2em}.text-input-disabled{pointer-events:none;-webkit-user-select:none;user-select:none}.text-input-placeholder{color:gray}.outside-right>#dropup-menu,.inside-right>#dropup-menu{right:0}#dropup-icon{position:absolute;pointer-events:none;width:1.16em;height:1.2em;left:.265em;bottom:.43em;filter:brightness(0) saturate(100%) invert(54%) sepia(0%) saturate(724%) hue-rotate(6deg) brightness(92%) contrast(90%)}#dropup-menu{background-color:#fff;position:absolute;transform:translateY(-100%);border-radius:5px;z-index:1;top:-.49em;box-shadow:#0003 -1px 2px 10px,#0000001a 0 2px 4px;cursor:pointer;-webkit-user-select:none;user-select:none}.dropup-menu-item{height:1.4em;padding:.28em .84em .28em .35em;display:flex;position:relative}.dropup-menu-item:first-child{padding-top:.49em;border-top-left-radius:inherit;border-top-right-radius:inherit}.dropup-menu-item:last-child{padding-bottom:.45em;border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.dropup-menu-item-icon{width:1.39em;position:relative;margin-right:.56em}.dropup-menu-item-icon>svg{bottom:0!important;top:0!important;margin-bottom:auto;margin-top:auto}.dropup-menu-item-text{margin-top:.08em;width:max-content}#input{width:100%;display:inline-flex;text-align:center;margin-left:auto;margin-right:auto;margin-top:auto;position:relative;justify-content:center}#chat-view{height:100%;display:grid;grid-template-columns:100%}::-webkit-scrollbar{width:9px;height:9px}::-webkit-scrollbar-thumb{background-color:#d0d0d0;border-radius:5px}::-webkit-scrollbar-track{background-color:#f2f2f2}:host{all:initial;display:table-cell}#container{height:inherit;width:inherit;overflow:hidden}\n";
|
12687
|
-
var
|
12736
|
+
var La = "#validate-property-key-view{height:100%;position:relative;display:flex;justify-content:center;align-items:center;padding:8px}#large-loading-ring{display:inline-block;width:50px;height:50px}#large-loading-ring:after{content:\" \";display:block;width:38px;height:38px;margin:1px;border-radius:50%;border:5px solid #5fb2ff;border-color:#5fb2ff transparent #5fb2ff transparent;animation:large-loading-ring 1.4s linear infinite}@keyframes large-loading-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}#insert-key-view{height:100%;position:relative}#insert-key-contents{text-align:center;position:absolute;top:44%;left:50%;transform:translate(-50%,-50%);width:82%;display:flex;max-width:700px}#insert-key-title{margin-bottom:15px}#insert-key-input-container{margin-right:2.7em;width:calc(100% - 80px)}#insert-key-input{padding:.3em 1.7em .3em .3em;border-width:1px;border-style:solid;border-radius:3px;width:100%;font-size:inherit}.insert-key-input-valid{border-color:gray}.insert-key-input-invalid{border-color:red}#visibility-icon-container{position:relative;float:right;cursor:pointer;-webkit-user-select:none;user-select:none}.visibility-icon{filter:brightness(0) saturate(100%) invert(63%) sepia(1%) saturate(9%) hue-rotate(43deg) brightness(98%) contrast(92%);position:absolute;right:-1.7em;top:-1.43em}#visible-icon{top:-1.4em}.visibility-icon:hover{filter:unset}.visibility-icon>*{pointer-events:none}#start-button{border:1px solid grey;color:#454545;border-radius:4px;width:3em;display:flex;justify-content:center;align-items:center;cursor:pointer;padding:.28em .3em;-webkit-user-select:none;user-select:none;background-color:#fff}#start-button:hover{background-color:#f2f2f2}#start-button:active{background-color:#d2d2d2}#insert-key-help-text-container{width:100%;position:absolute;margin-top:32px;margin-bottom:20px}#insert-key-help-text-contents{width:100%;position:absolute}#insert-key-input-invalid-text{display:block;margin-top:1em;margin-bottom:.5em;color:red}.insert-key-input-help-text{display:block;margin-top:16px}#loading-ring{display:inline-block;width:16px;height:16px}#loading-ring:after{content:\" \";display:block;width:11px;height:11px;margin:1px;border-radius:50%;border:2px solid #0084ff;border-color:#0084ff transparent #0084ff transparent;animation:loading-ring 1.2s linear infinite}@keyframes loading-ring{0%{transform:rotate(0)}to{transform:rotate(360deg)}}#error-view{color:red;font-size:1.2em;line-height:1.3em;margin-top:-5px;text-align:center;height:100%;display:flex;justify-content:center;align-items:center;padding-left:8px;padding-right:8px}.intro-panel{position:absolute;display:flex;justify-content:center;right:0;bottom:0;left:0;margin:auto;height:fit-content;top:-2.5em}#internal-intro-panel{width:250px;height:min-content;display:block;border-radius:5px;overflow:auto;border:1px solid rgb(203,203,203);padding:10px;max-height:calc(100% - 6.8em)}#internal-intro-panel>p{margin-block-start:.8em;margin-block-end:.8em}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!\n Theme: a11y-dark\n Author: @ericwbailey\n Maintainer: @ericwbailey\n\n Based on the Tomorrow Night Eighties theme: https://github.com/isagalaev/highlight.js/blob/master/src/styles/tomorrow-night-eighties.css\n*/.hljs{background:#2b2b2b;color:#f8f8f2}.hljs-comment,.hljs-quote{color:#d4d0ab}.hljs-deletion,.hljs-name,.hljs-regexp,.hljs-selector-class,.hljs-selector-id,.hljs-tag,.hljs-template-variable,.hljs-variable{color:#ffa07a}.hljs-built_in,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-type{color:#f5ab35}.hljs-attribute{color:gold}.hljs-addition,.hljs-bullet,.hljs-string,.hljs-symbol{color:#abe338}.hljs-section,.hljs-title{color:#00e0e0}.hljs-keyword,.hljs-selector-tag{color:#dcc6e0}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}@media screen and (-ms-high-contrast: active){.hljs-addition,.hljs-attribute,.hljs-built_in,.hljs-bullet,.hljs-comment,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-quote,.hljs-string,.hljs-symbol,.hljs-type{color:highlight}.hljs-keyword,.hljs-selector-tag{font-weight:700}}#messages{overflow:auto}.outer-message-container:last-child{margin-bottom:5px}.inner-message-container{display:flex;margin-left:auto;margin-right:auto;width:calc(97.5% - 24px);max-width:100%}.message-bubble{margin-top:10px;word-wrap:break-word;width:fit-content;max-width:60%;border-radius:10px;padding:.42em .55em;height:fit-content;line-height:1.26em}.user-message-text{color:#fff;background-color:#0084ff;margin-right:0;margin-left:auto}.ai-message-text{color:#000;background-color:#e4e6eb;margin-left:0;margin-right:auto}.html-message{max-width:unset}.error-message-text{margin:14px auto 10px;background-color:#f4c0c0;color:#474747;text-align:center;max-width:95%}.loading-message-text{width:1em;padding:.6em .75em .6em 1.3em}.message-bubble>p:first-child{margin-top:0}.message-bubble>p:last-child{margin-bottom:0}pre{overflow:auto;display:block;word-break:break-all;word-wrap:break-word;border-radius:7px;background:#2b2b2b;color:#f8f8f2;margin-top:.8em;margin-bottom:.8em;padding:.6em;font-size:.9em;line-height:1.5em}.image-message{padding:0;display:flex;background-color:#ddd}.image-message>*,.image-message>*>*{width:100%;border-radius:8px;display:flex}.audio-message{width:60%;max-width:300px;height:2.2em;max-height:54px;padding:0;background-color:unset}.audio-player{width:100%;height:100%}.audio-player-safari{height:fit-content;width:40px}.audio-player-safari-left{float:left}.audio-player-safari-right{float:right}.any-file-message-bubble{padding:1px}.any-file-message-contents{display:flex}.any-file-message-icon-container{width:1.3em;min-width:1.3em;position:relative;border-radius:4px;margin-left:6px;margin-right:2px}.any-file-message-icon{background-color:#fff;border-radius:4px;position:absolute;width:1em;height:1.25em;padding:1px;margin-top:auto;margin-bottom:auto;top:0;bottom:0}.any-file-message-text{padding-top:5px;overflow-wrap:anywhere;padding-bottom:5px;padding-right:7px}.message-bubble>a{color:inherit}.left-item-position{margin-right:10px}.right-item-position{margin-left:10px}.deep-chat-web-model-button{margin-top:10px;margin-bottom:5px;margin-left:1px}.avatar{padding-top:5px;width:1.5em;height:1.5em;border-radius:1px}.avatar-container{margin-top:9px}.name{margin-top:16px;font-size:15px}#drag-and-drop{position:absolute;display:none;z-index:10;height:calc(100% - 10px);width:calc(100% - 10px);background-color:#70c6ff4d;border:5px dashed #6dafff}#file-attachment-container{position:absolute;height:3.6em;width:calc(80% - 4px);top:-2.5em;border-radius:5px;overflow:auto;text-align:left;background-color:#d7d7d73b;padding-left:4px}.file-attachment{width:2.85em;height:2.85em;display:inline-flex;margin-right:.6em;margin-bottom:.44em;margin-top:4px;position:relative;background-color:#fff;border-radius:5px}.image-attachment{width:100%;height:100%;object-fit:cover;border-radius:5px}.border-bound-attachment{width:calc(100% - 2px);height:calc(100% - 2px);border:1px solid #c3c3c3;border-radius:5px;overflow:hidden}.border-bound-attachment-safari{width:calc(100% - 1px);height:calc(100% - 1px)}.audio-attachment-icon-container{cursor:pointer}.audio-attachment-icon-container:hover{background-color:#f8f8f8}.attachment-icon{left:0;right:0;bottom:0;top:2px;margin:auto;position:absolute;width:25px;-webkit-user-select:none;user-select:none}.not-removable-attachment-icon{top:0;right:0;bottom:0;left:0}.play-icon{filter:brightness(0) saturate(100%) invert(17%) sepia(0%) saturate(1392%) hue-rotate(67deg) brightness(98%) contrast(97%)}.stop-icon{filter:brightness(0) saturate(100%) invert(29%) sepia(90%) saturate(1228%) hue-rotate(198deg) brightness(93%) contrast(98%)}.audio-placeholder-text-3-digits{padding-left:.26rem}.audio-placeholder-text-4-digits{padding-left:.1rem}.any-file-attachment{padding:2px 0}.file-attachment-text-container{position:absolute;width:inherit;display:flex;align-items:center;height:100%;top:-1px}.audio-placeholder-text-3-digits-container{padding-top:1px;cursor:default}.any-file-attachment-text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding-left:.13em;margin-left:auto;margin-right:auto}.remove-file-attachment-button{height:1.25em;width:1.25em;border:1px solid #cfcfcf;border-radius:25px;background-color:#fff;top:-4px;right:-5px;position:absolute;display:flex;justify-content:center;cursor:pointer;-webkit-user-select:none;user-select:none}.remove-file-attachment-button:hover{background-color:#e4e4e4}.remove-file-attachment-button:active{background-color:#d7d7d7}.x-icon{color:#4e4e4e;top:-.075em;position:relative;font-size:1.05em}.modal{display:none;flex-direction:column;align-items:center;justify-content:center;position:absolute;width:80%;max-width:420px;max-height:80%;margin:auto;top:0;right:0;bottom:0;left:0;z-index:2}.modal-content{border-top:1px solid rgb(217,217,217);border-left:1px solid rgb(217,217,217);border-right:1px solid rgb(217,217,217);border-top-left-radius:inherit;border-top-right-radius:inherit;background-color:#fff;overflow-y:auto;height:fit-content;max-height:calc(100% - 3.3em);width:100%}.modal-content>p{margin-left:1em;margin-right:1em}.modal-content>ul{margin-right:1em}.modal-button-panel{height:3.3em;border:1px solid;border-color:rgb(223,223,223) rgb(217,217,217) rgb(217,217,217);border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;background-color:#fff;text-align:center;justify-content:center;display:flex;width:100%}.modal-button{min-width:2.5em;text-align:center;color:#fff;border-radius:5px;padding:.4em .4em .3em;height:1.25em;background-color:#3279b2;top:0;bottom:0;cursor:pointer;-webkit-user-select:none;user-select:none;margin:auto .31em}.modal-button:hover{background-color:#276da7}.modal-button:active{background-color:#1b5687}.modal-svg-button{padding:0 0 2px;width:2em;height:1.8em}.modal-svg-button-icon{width:100%;height:100%;filter:brightness(0) saturate(100%) invert(100%) sepia(15%) saturate(4%) hue-rotate(346deg) brightness(101%) contrast(102%)}#modal-background-panel{position:absolute;width:100%;height:100%;background-color:#00000042;z-index:1;display:none}.show-modal-background{animation:fadeInBackground .3s ease-in-out}@keyframes fadeInBackground{0%{opacity:0}to{opacity:1}}.show-modal{animation:fadeInModal .3s ease-in-out}@keyframes fadeInModal{0%{opacity:0;scale:.95}to{opacity:1;scale:1}}.hide-modal-background{animation:fadeOutBackground .2s ease-in-out}@keyframes fadeOutBackground{0%{opacity:1}to{opacity:0}}.hide-modal{animation:fadeOutModal .2s ease-in-out}@keyframes fadeOutModal{0%{opacity:1;scale:1}to{opacity:0;scale:.95}}.modal-camera-content{overflow:hidden;text-align:center;border:unset;height:100%;background-color:#2a2a2a;display:flex;justify-content:center}.camera-modal-canvas{max-width:100%;max-height:100%;margin-top:auto;margin-bottom:auto}.modal-svg-submit-button{background-color:green}.modal-svg-submit-button:hover{background-color:#007500}.modal-svg-submit-button:active{background-color:#006500}.modal-svg-submit-disabled{pointer-events:none;background-color:#747474}.modal-svg-close-button{height:1.56em;padding-top:.37em;padding-bottom:0;background-color:#c13e3e}.modal-svg-close-button:hover{background-color:#b43434}.modal-svg-close-button:active{background-color:#972929}.modal-svg-close-icon{width:80%;height:80%}.modal-svg-camera-button{height:1.6em;padding-top:.38em;padding-bottom:0}.modal-svg-camera-icon{height:76%}.modal-svg-refresh-icon{height:105%}.modal-svg-refresh-button{height:1.66em;padding-top:.11em;padding-bottom:.21em}.input-button-container{position:relative;z-index:1}.inside-right{position:absolute;right:calc(10% + .35em);bottom:.85em}.inside-left{position:absolute;left:calc(10% + .35em);bottom:.85em}.outside-left{position:absolute;right:calc(11px - .55em);bottom:.88em}.outside-right{position:absolute;left:calc(11px - .55em);bottom:.88em}#upload-images-icon{position:absolute;pointer-events:none;width:1.45em;height:1.45em;left:.11em;bottom:.08em;filter:brightness(0) saturate(100%) invert(43%) sepia(0%) saturate(740%) hue-rotate(77deg) brightness(99%) contrast(92%)}#upload-gifs-icon{position:absolute;pointer-events:none;width:1.5em;height:1.48em;left:.07em;bottom:.08em;filter:brightness(0) saturate(100%) invert(49%) sepia(0%) saturate(2586%) hue-rotate(12deg) brightness(93%) contrast(90%)}#upload-audio-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.17em;bottom:.2em;filter:brightness(0) saturate(100%) invert(15%) sepia(0%) saturate(337%) hue-rotate(125deg) brightness(91%) contrast(94%);transform:scaleX(.95)}#camera-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.23em;bottom:.2em;filter:brightness(0) saturate(100%) invert(52%) sepia(0%) saturate(161%) hue-rotate(164deg) brightness(91%) contrast(92%);transform:scaleX(.95)}#upload-mixed-files-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.25em;bottom:.2em;filter:brightness(0) saturate(100%) invert(53%) sepia(0%) saturate(36%) hue-rotate(74deg) brightness(98%) contrast(93%);transform:scaleX(.95)}#interim-text{color:gray}#microphone-button{padding-top:.5px}.outer-button-container>#microphone-button{padding-bottom:1px}#microphone-icon{position:absolute;pointer-events:none;width:1.21em;height:1.21em;left:.25em;bottom:.25em}.default-microphone-icon{filter:brightness(0) saturate(100%) invert(32%) sepia(0%) saturate(924%) hue-rotate(46deg) brightness(95%) contrast(99%)}.active-microphone-icon{filter:brightness(0) saturate(100%) invert(10%) sepia(97%) saturate(7495%) hue-rotate(0deg) brightness(101%) contrast(107%);border-radius:10px}.command-microphone-icon{filter:brightness(0) saturate(100%) invert(42%) sepia(96%) saturate(1067%) hue-rotate(77deg) brightness(99%) contrast(102%)}.unsupported-microphone{display:none}#submit-icon{height:100%;filter:brightness(0) saturate(100%) invert(32%) sepia(0%) saturate(924%) hue-rotate(46deg) brightness(95%) contrast(99%);width:1.21em}#stop-icon{background-color:#acacac;position:absolute;width:.95em;height:.95em;left:.35em;bottom:.35em;border-radius:2px}.submit-button-enlarged{scale:1.1;margin-right:.3em;margin-left:.3em}.dots-jumping{position:relative;left:calc(-9990px + .275em);width:.22em;height:.22em;border-radius:5px;background-color:#848484;color:#848484;box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484;animation:dots-jumping 1.5s infinite linear;bottom:-.7em}@keyframes dots-jumping{0%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}16.667%{box-shadow:9990px -6px #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}33.333%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}50%{box-shadow:9990px 0 #848484,calc(9990px + .44em) -6px 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}66.667%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}83.333%{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) -6px 0 0 #848484}to{box-shadow:9990px 0 #848484,calc(9990px + .44em) 0 0 0 #848484,calc(9990px + .8em) 0 0 0 #848484}}.dots-flashing{position:relative;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite linear alternate;animation-delay:.5s}.dots-flashing:before,.dots-flashing:after{content:\"\";display:inline-block;position:absolute;top:0}.dots-flashing:before{left:-.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite alternate;animation-delay:0s}.dots-flashing:after{left:.7em;width:.45em;height:.45em;border-radius:5px;background-color:var(--message-dots-color);color:var(--message-dots-color);animation:dots-flashing 1s infinite alternate;animation-delay:1s}@keyframes dots-flashing{0%{background-color:var(--message-dots-color)}50%,to{background-color:var(--message-dots-color-fade)}}.input-button{border-radius:4px;cursor:pointer;margin-bottom:.2em;-webkit-user-select:none;user-select:none}.input-button-svg{width:1.65em;height:1.65em}.input-button:hover{background-color:#9c9c9c2e}.input-button:active{background-color:#9c9c9c5e}.loading-button{cursor:auto}.loading-button:hover{background-color:unset}.text-button{filter:unset!important;display:flex;justify-content:center;align-items:center;margin-left:4px;margin-right:4px;height:1.6em}#text-input-container{background-color:#fff;width:80%;display:flex;border:1px solid #0000001a;border-radius:5px;margin-top:.8em;margin-bottom:.8em;box-shadow:#959da533 0 1px 12px;overflow-y:auto;max-height:200px;position:relative}.text-input-container-left-adjustment{margin-left:1.5em}.text-input-container-right-adjustment{margin-right:1.5em}.text-input-container-left-small-adjustment{margin-left:1.1em}.text-input-container-left-small-adjustment>.outside-left{right:calc(14px - .55em)}.text-input-container-right-small-adjustment{margin-right:1.1em}.text-input-container-right-small-adjustment>.outside-right{left:calc(14px - .55em)}#text-input{text-align:left;outline:none;word-wrap:break-word;line-break:auto}.text-input-styling{padding:.4em .5em;overflow:overlay;width:100%}.text-input-inner-left-adjustment{padding-left:2.2em}.text-input-inner-right-adjustment{padding-right:2em}.text-input-disabled{pointer-events:none;-webkit-user-select:none;user-select:none}.text-input-placeholder{color:gray}.outside-right>#dropup-menu,.inside-right>#dropup-menu{right:0}#dropup-icon{position:absolute;pointer-events:none;width:1.16em;height:1.2em;left:.265em;bottom:.43em;filter:brightness(0) saturate(100%) invert(54%) sepia(0%) saturate(724%) hue-rotate(6deg) brightness(92%) contrast(90%)}#dropup-menu{background-color:#fff;position:absolute;transform:translateY(-100%);border-radius:5px;z-index:1;top:-.49em;box-shadow:#0003 -1px 2px 10px,#0000001a 0 2px 4px;cursor:pointer;-webkit-user-select:none;user-select:none}.dropup-menu-item{height:1.4em;padding:.28em .84em .28em .35em;display:flex;position:relative}.dropup-menu-item:first-child{padding-top:.49em;border-top-left-radius:inherit;border-top-right-radius:inherit}.dropup-menu-item:last-child{padding-bottom:.45em;border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.dropup-menu-item-icon{width:1.39em;position:relative;margin-right:.56em}.dropup-menu-item-icon>svg{bottom:0!important;top:0!important;margin-bottom:auto;margin-top:auto}.dropup-menu-item-text{margin-top:.08em;width:max-content}#input{width:100%;display:inline-flex;text-align:center;margin-left:auto;margin-right:auto;margin-top:auto;position:relative;justify-content:center}#chat-view{height:100%;display:grid;grid-template-columns:100%}::-webkit-scrollbar{width:9px;height:9px}::-webkit-scrollbar-thumb{background-color:#d0d0d0;border-radius:5px}::-webkit-scrollbar-track{background-color:#f2f2f2}:host{all:initial;display:table-cell}#container{height:inherit;width:inherit;overflow:hidden}\n";
|
12737
|
+
var Ia = Object.defineProperty,
|
12688
12738
|
Ra = Object.getOwnPropertyDescriptor,
|
12689
12739
|
x = function x(s, e, t, i) {
|
12690
12740
|
for (var n = i > 1 ? void 0 : i ? Ra(e, t) : e, r = s.length - 1, o; r >= 0; r--) (o = s[r]) && (n = (i ? o(e, t, n) : o(n)) || n);
|
12691
|
-
return i && n &&
|
12741
|
+
return i && n && Ia(e, t, n), n;
|
12692
12742
|
};
|
12693
12743
|
var b = /*#__PURE__*/function (_yo) {
|
12694
12744
|
_inherits(b, _yo);
|
12695
|
-
var _super48 = _createSuper(b);
|
12696
12745
|
function b() {
|
12697
12746
|
var _this67;
|
12698
12747
|
_classCallCheck(this, b);
|
12699
|
-
_this67 =
|
12748
|
+
_this67 = _callSuper(this, b), _this67.getMessages = function () {
|
12700
12749
|
return [];
|
12701
12750
|
}, _this67.submitUserMessage = function () {
|
12702
12751
|
return console.warn("submitUserMessage failed - please wait for chat view to render before calling this property.");
|
@@ -12706,7 +12755,7 @@ var b = /*#__PURE__*/function (_yo) {
|
|
12706
12755
|
return console.warn("addMessage failed - please wait for chat view to render before calling this property.");
|
12707
12756
|
}, Vo.appendStyleSheetToHead(), _this67._elementRef = document.createElement("div"), _this67._elementRef.id = "container", _this67.attachShadow({
|
12708
12757
|
mode: "open"
|
12709
|
-
}).appendChild(_this67._elementRef),
|
12758
|
+
}).appendChild(_this67._elementRef), Si.apply(La, _this67.shadowRoot), setTimeout(function () {
|
12710
12759
|
_this67._hasBeenRendered || _this67.onRender();
|
12711
12760
|
}, 20);
|
12712
12761
|
return _this67;
|
@@ -12721,12 +12770,12 @@ var b = /*#__PURE__*/function (_yo) {
|
|
12721
12770
|
key: "onRender",
|
12722
12771
|
value: function onRender() {
|
12723
12772
|
var _this$_childElement;
|
12724
|
-
(!this._activeService || this._activeService.demo) && (this._activeService = Go.create(this)), this.auxiliaryStyle && !this._auxiliaryStyleApplied && (
|
12773
|
+
(!this._activeService || this._activeService.demo) && (this._activeService = Go.create(this)), this.auxiliaryStyle && !this._auxiliaryStyleApplied && (Si.apply(this.auxiliaryStyle, this.shadowRoot), this._auxiliaryStyleApplied = !0), Si.applyDefaultStyleToComponent(this.style, this.chatStyle), Ie.checkForContainerStyles(this, this._elementRef), this._activeService.key && this._activeService.validateConfigKey ? Ft.render(this._elementRef, this.changeToChatView.bind(this), this._activeService) : !(this._activeService instanceof q) || this._activeService.key ? ((_this$_childElement = this._childElement) !== null && _this$_childElement !== void 0 ? _this$_childElement : this._childElement = this.children[0], on.render(this, this._elementRef, this._activeService, this._childElement)) : this._activeService instanceof q && P.render(this._elementRef, this.changeToChatView.bind(this), this._activeService), this._hasBeenRendered = !0, Bt.onRender(this);
|
12725
12774
|
}
|
12726
12775
|
}, {
|
12727
12776
|
key: "disconnectedCallback",
|
12728
12777
|
value: function disconnectedCallback() {
|
12729
|
-
|
12778
|
+
Zi.chat = void 0;
|
12730
12779
|
}
|
12731
12780
|
}]);
|
12732
12781
|
return b;
|