deep-chat-dev 9.0.206 → 9.0.208
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 +2038 -1995
- package/dist/deepChat.bundle.js +1 -1
- package/dist/deepChat.d.ts +3 -1
- package/dist/deepChat.d.ts.map +1 -1
- package/dist/deepChat.js +186 -182
- package/dist/views/chat/messages/messagesBase.d.ts +2 -1
- package/dist/views/chat/messages/messagesBase.d.ts.map +1 -1
- package/dist/views/chat/messages/remarkable/remarkableConfig.d.ts +2 -2
- package/dist/views/chat/messages/remarkable/remarkableConfig.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/deepChat.js
CHANGED
@@ -536,7 +536,7 @@ var pt = /*#__PURE__*/function () {
|
|
536
536
|
}]);
|
537
537
|
}();
|
538
538
|
pt.BUBBLE_CLASS = "deep-chat-loading-message-bubble", pt.DOTS_CONTAINER_CLASS = "deep-chat-loading-message-dots-container";
|
539
|
-
var
|
539
|
+
var Pe = pt;
|
540
540
|
var le = /*#__PURE__*/function () {
|
541
541
|
function le() {
|
542
542
|
_classCallCheck(this, le);
|
@@ -777,11 +777,11 @@ var Dn = "deep-chat-temporary-message",
|
|
777
777
|
}
|
778
778
|
},
|
779
779
|
js = Object.keys(ls);
|
780
|
-
var
|
781
|
-
function
|
782
|
-
_classCallCheck(this,
|
780
|
+
var Oe = /*#__PURE__*/function () {
|
781
|
+
function Oe() {
|
782
|
+
_classCallCheck(this, Oe);
|
783
783
|
}
|
784
|
-
return _createClass(
|
784
|
+
return _createClass(Oe, null, [{
|
785
785
|
key: "applySuggestionEvent",
|
786
786
|
value: function applySuggestionEvent(e, t) {
|
787
787
|
setTimeout(function () {
|
@@ -836,13 +836,13 @@ var Pe = /*#__PURE__*/function () {
|
|
836
836
|
js.forEach(function (r) {
|
837
837
|
var o = i.getElementsByClassName(r);
|
838
838
|
Array.from(o || []).forEach(function (a) {
|
839
|
-
var l =
|
840
|
-
ie.applyStylesToElement(a, l),
|
839
|
+
var l = Oe.getProcessedStyles(t, a, r);
|
840
|
+
ie.applyStylesToElement(a, l), Oe.applyEvents(a, r);
|
841
841
|
});
|
842
842
|
});
|
843
843
|
var s = i.getElementsByClassName(Bn);
|
844
844
|
Array.from(s).forEach(function (r) {
|
845
|
-
return
|
845
|
+
return Oe.applySuggestionEvent(e, r);
|
846
846
|
});
|
847
847
|
}
|
848
848
|
}]);
|
@@ -870,7 +870,7 @@ var ie = /*#__PURE__*/function () {
|
|
870
870
|
value: function applyClassUtilitiesToElement(e, t) {
|
871
871
|
var i = t.events,
|
872
872
|
s = t.styles;
|
873
|
-
i && ie.applyEventsToElement(e, i), s && !
|
873
|
+
i && ie.applyEventsToElement(e, i), s && !Oe.doesElementContainDeepChatClass(e) && ie.applyStylesToElement(e, s);
|
874
874
|
}
|
875
875
|
}, {
|
876
876
|
key: "applyCustomClassUtilities",
|
@@ -885,7 +885,7 @@ var ie = /*#__PURE__*/function () {
|
|
885
885
|
}, {
|
886
886
|
key: "apply",
|
887
887
|
value: function apply(e, t) {
|
888
|
-
|
888
|
+
Oe.applyDeepChatUtilities(e, e.htmlClassUtilities, t), ie.applyCustomClassUtilities(e.htmlClassUtilities, t);
|
889
889
|
}
|
890
890
|
}, {
|
891
891
|
key: "traverseNodes",
|
@@ -905,11 +905,11 @@ var ie = /*#__PURE__*/function () {
|
|
905
905
|
}
|
906
906
|
}]);
|
907
907
|
}();
|
908
|
-
var
|
909
|
-
function
|
910
|
-
_classCallCheck(this,
|
908
|
+
var Te = /*#__PURE__*/function () {
|
909
|
+
function Te() {
|
910
|
+
_classCallCheck(this, Te);
|
911
911
|
}
|
912
|
-
return _createClass(
|
912
|
+
return _createClass(Te, null, [{
|
913
913
|
key: "addElement",
|
914
914
|
value: function addElement(e, t) {
|
915
915
|
e.elementRef.appendChild(t), e.elementRef.scrollTop = e.elementRef.scrollHeight;
|
@@ -918,7 +918,7 @@ var Ce = /*#__PURE__*/function () {
|
|
918
918
|
key: "createElements",
|
919
919
|
value: function createElements(e, t, i, s) {
|
920
920
|
var r = e.createMessageElementsOnOrientation("", i, s);
|
921
|
-
return r.bubbleElement.classList.add(
|
921
|
+
return r.bubbleElement.classList.add(Te.HTML_BUBBLE_CLASS), r.bubbleElement.innerHTML = t, r;
|
922
922
|
}
|
923
923
|
}, {
|
924
924
|
key: "overwriteElements",
|
@@ -930,15 +930,15 @@ var Ce = /*#__PURE__*/function () {
|
|
930
930
|
key: "overwrite",
|
931
931
|
value: function overwrite(e, t, i, s) {
|
932
932
|
var r = e.messageToElements,
|
933
|
-
o = b.overwriteMessage(r, s, t, i, "html",
|
934
|
-
return o &&
|
933
|
+
o = b.overwriteMessage(r, s, t, i, "html", Te.HTML_BUBBLE_CLASS);
|
934
|
+
return o && Te.overwriteElements(e, t, o), o;
|
935
935
|
}
|
936
936
|
}, {
|
937
937
|
key: "create",
|
938
938
|
value: function create(e, t, i) {
|
939
939
|
var s = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
940
940
|
var o;
|
941
|
-
var r =
|
941
|
+
var r = Te.createElements(e, t, i, s);
|
942
942
|
return b.fillEmptyMessageElement(r.bubbleElement, t), ie.apply(e, r.outerContainer), ne.flagHTMLUpdateClass(r.bubbleElement), e.applyCustomStyles(r, i, !1, (o = e.messageStyles) == null ? void 0 : o.html), r;
|
943
943
|
}
|
944
944
|
// prettier-ignore
|
@@ -951,13 +951,13 @@ var Ce = /*#__PURE__*/function () {
|
|
951
951
|
if (l) return l;
|
952
952
|
r.status = !1;
|
953
953
|
}
|
954
|
-
var a =
|
955
|
-
return o ||
|
954
|
+
var a = Te.create(e, t, i, o);
|
955
|
+
return o || Te.addElement(e, a.outerContainer), a;
|
956
956
|
}
|
957
957
|
}]);
|
958
958
|
}();
|
959
|
-
|
960
|
-
var Ee =
|
959
|
+
Te.HTML_BUBBLE_CLASS = "html-message";
|
960
|
+
var Ee = Te;
|
961
961
|
var oi;
|
962
962
|
function bn(n) {
|
963
963
|
return oi = oi || document.createElement("textarea"), oi.innerHTML = "&" + n + ";", oi.value;
|
@@ -2796,34 +2796,34 @@ var go = {
|
|
2796
2796
|
function Tn(n, e, t) {
|
2797
2797
|
this.src = e, this.env = t, this.options = n.options, this.tokens = [], this.inlineMode = !1, this.inline = n.inline, this.block = n.block, this.renderer = n.renderer, this.typographer = n.typographer;
|
2798
2798
|
}
|
2799
|
-
function
|
2799
|
+
function Se(n, e) {
|
2800
2800
|
typeof n != "string" && (e = n, n = "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 Bi(), this.block = new As(), this.core = new wn(), this.renderer = new Ts(), this.ruler = new re(), this.options = {}, this.configure(yo[n]), this.set(e || {});
|
2801
2801
|
}
|
2802
|
-
|
2802
|
+
Se.prototype.set = function (n) {
|
2803
2803
|
vn(this.options, n);
|
2804
2804
|
};
|
2805
|
-
|
2805
|
+
Se.prototype.configure = function (n) {
|
2806
2806
|
var e = this;
|
2807
2807
|
if (!n) throw new Error("Wrong `remarkable` preset, check name/content");
|
2808
2808
|
n.options && e.set(n.options), n.components && Object.keys(n.components).forEach(function (t) {
|
2809
2809
|
n.components[t].rules && e[t].ruler.enable(n.components[t].rules, !0);
|
2810
2810
|
});
|
2811
2811
|
};
|
2812
|
-
|
2812
|
+
Se.prototype.use = function (n, e) {
|
2813
2813
|
return n(this, e), this;
|
2814
2814
|
};
|
2815
|
-
|
2815
|
+
Se.prototype.parse = function (n, e) {
|
2816
2816
|
var t = new Tn(this, n, e);
|
2817
2817
|
return this.core.process(t), t.tokens;
|
2818
2818
|
};
|
2819
|
-
|
2819
|
+
Se.prototype.render = function (n, e) {
|
2820
2820
|
return e = e || {}, this.renderer.render(this.parse(n, e), this.options, e);
|
2821
2821
|
};
|
2822
|
-
|
2822
|
+
Se.prototype.parseInline = function (n, e) {
|
2823
2823
|
var t = new Tn(this, n, e);
|
2824
2824
|
return t.inlineMode = !0, this.core.process(t), t.tokens;
|
2825
2825
|
};
|
2826
|
-
|
2826
|
+
Se.prototype.renderInline = function (n, e) {
|
2827
2827
|
return e = e || {}, this.renderer.render(this.parseInline(n, e), this.options, e);
|
2828
2828
|
};
|
2829
2829
|
var zt = /*#__PURE__*/function () {
|
@@ -2832,35 +2832,38 @@ var zt = /*#__PURE__*/function () {
|
|
2832
2832
|
}
|
2833
2833
|
return _createClass(zt, null, [{
|
2834
2834
|
key: "instantiate",
|
2835
|
-
value: function instantiate() {
|
2836
|
-
|
2837
|
-
|
2838
|
-
|
2839
|
-
|
2840
|
-
|
2841
|
-
|
2842
|
-
|
2843
|
-
|
2844
|
-
|
2845
|
-
|
2846
|
-
|
2847
|
-
|
2848
|
-
|
2849
|
-
|
2850
|
-
|
2851
|
-
|
2852
|
-
|
2853
|
-
|
2854
|
-
|
2855
|
-
|
2856
|
-
|
2857
|
-
|
2858
|
-
|
2859
|
-
|
2860
|
-
|
2861
|
-
|
2862
|
-
|
2863
|
-
|
2835
|
+
value: function instantiate(e) {
|
2836
|
+
if (e) return new Se(e);
|
2837
|
+
if (window.hljs) {
|
2838
|
+
var t = window.hljs;
|
2839
|
+
return new Se({
|
2840
|
+
highlight: function highlight(i, s) {
|
2841
|
+
if (s && t.getLanguage(s)) try {
|
2842
|
+
return t.highlight(s, i).value;
|
2843
|
+
} catch (_unused4) {
|
2844
|
+
console.error("failed to setup the highlight dependency");
|
2845
|
+
}
|
2846
|
+
try {
|
2847
|
+
return t.highlightAuto(i).value;
|
2848
|
+
} catch (_unused5) {
|
2849
|
+
console.error("failed to automatically highlight messages");
|
2850
|
+
}
|
2851
|
+
return "";
|
2852
|
+
},
|
2853
|
+
html: !1,
|
2854
|
+
// Enable HTML tags in source
|
2855
|
+
xhtmlOut: !1,
|
2856
|
+
// Use '/' to close single tags (<br />)
|
2857
|
+
breaks: !0,
|
2858
|
+
// Convert '\n' in paragraphs into <br>
|
2859
|
+
langPrefix: "language-",
|
2860
|
+
// CSS language prefix for fenced blocks
|
2861
|
+
linkTarget: "_blank",
|
2862
|
+
// set target to open in a new tab
|
2863
|
+
typographer: !0
|
2864
|
+
// Enable smartypants and other sweet transforms
|
2865
|
+
});
|
2866
|
+
} else return new Se({
|
2864
2867
|
breaks: !0,
|
2865
2868
|
linkTarget: "_blank"
|
2866
2869
|
// set target to open in a new tab
|
@@ -2868,11 +2871,11 @@ var zt = /*#__PURE__*/function () {
|
|
2868
2871
|
}
|
2869
2872
|
}, {
|
2870
2873
|
key: "createNew",
|
2871
|
-
value: function createNew() {
|
2872
|
-
var
|
2873
|
-
return
|
2874
|
+
value: function createNew(e) {
|
2875
|
+
var t = zt.instantiate(e);
|
2876
|
+
return t.inline.validateLink = function () {
|
2874
2877
|
return !0;
|
2875
|
-
},
|
2878
|
+
}, t;
|
2876
2879
|
}
|
2877
2880
|
}]);
|
2878
2881
|
}();
|
@@ -2979,7 +2982,7 @@ var F = /*#__PURE__*/function () {
|
|
2979
2982
|
}, {
|
2980
2983
|
key: "apply",
|
2981
2984
|
value: function apply(e, t, i) {
|
2982
|
-
|
2985
|
+
Pe.setRing(t.bubbleElement, i == null ? void 0 : i.bubble), i != null && i.bubble && (i = JSON.parse(JSON.stringify(i)), delete i.bubble), e.applyCustomStyles(t, "history", !1, i);
|
2983
2986
|
}
|
2984
2987
|
}, {
|
2985
2988
|
key: "addLoadHistoryMessage",
|
@@ -3025,15 +3028,15 @@ var F = /*#__PURE__*/function () {
|
|
3025
3028
|
}();
|
3026
3029
|
F.CLASS = "loading-history-message", F.FULL_VIEW_CLASS = "loading-history-message-full-view", F.SMALL_CLASS = "loading-history-message-small";
|
3027
3030
|
var et = F;
|
3028
|
-
var
|
3029
|
-
function
|
3031
|
+
var Ae = /*#__PURE__*/function () {
|
3032
|
+
function Ae(e) {
|
3030
3033
|
var _this3 = this;
|
3031
|
-
_classCallCheck(this,
|
3032
|
-
this.messageElementRefs = [], this.htmlClassUtilities = {}, this.messageToElements = [], this.elementRef =
|
3034
|
+
_classCallCheck(this, Ae);
|
3035
|
+
this.messageElementRefs = [], this.htmlClassUtilities = {}, this.messageToElements = [], this.elementRef = Ae.createContainerElement(), this.messageStyles = ne.processMessageStyles(e.messageStyles), this._remarkable = zt.createNew(e.remarkable), this._avatars = e.avatars, this._names = e.names, this._onMessage = pi.onMessage.bind(this, e), e.htmlClassUtilities && (this.htmlClassUtilities = e.htmlClassUtilities), setTimeout(function () {
|
3033
3036
|
_this3.submitUserMessage = e.submitUserMessage;
|
3034
3037
|
});
|
3035
3038
|
}
|
3036
|
-
return _createClass(
|
3039
|
+
return _createClass(Ae, [{
|
3037
3040
|
key: "addNewTextMessage",
|
3038
3041
|
value: function addNewTextMessage(e, t, i) {
|
3039
3042
|
var s = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : !1;
|
@@ -3043,13 +3046,13 @@ var Te = /*#__PURE__*/function () {
|
|
3043
3046
|
i.status = !1;
|
3044
3047
|
}
|
3045
3048
|
var r = s ? this.createAndPrependNewMessageElement(e, t, s) : this.createAndAppendNewMessageElement(e, t);
|
3046
|
-
return r.bubbleElement.classList.add(
|
3049
|
+
return r.bubbleElement.classList.add(Ae.TEXT_BUBBLE_CLASS), this.applyCustomStyles(r, t, !1), b.fillEmptyMessageElement(r.bubbleElement, e), r;
|
3047
3050
|
}
|
3048
3051
|
// prettier-ignore
|
3049
3052
|
}, {
|
3050
3053
|
key: "overwriteText",
|
3051
3054
|
value: function overwriteText(e, t, i) {
|
3052
|
-
var s = b.overwriteMessage(this.messageToElements, i, t, e, "text",
|
3055
|
+
var s = b.overwriteMessage(this.messageToElements, i, t, e, "text", Ae.TEXT_BUBBLE_CLASS);
|
3053
3056
|
return s && this.renderText(s.bubbleElement, t), s;
|
3054
3057
|
}
|
3055
3058
|
}, {
|
@@ -3085,7 +3088,7 @@ var Te = /*#__PURE__*/function () {
|
|
3085
3088
|
var r;
|
3086
3089
|
(r = this._introPanel) == null || r.hide();
|
3087
3090
|
var s = this.messageElementRefs[this.messageElementRefs.length - 1];
|
3088
|
-
return et.changeFullViewToSmall(this, s),
|
3091
|
+
return et.changeFullViewToSmall(this, s), Ae.isTemporaryElement(s) && (this.revealRoleElementsIfTempRemoved(s, t), s.outerContainer.remove(), this.messageElementRefs.pop()), this.createMessageElements(e, t, i);
|
3089
3092
|
}
|
3090
3093
|
// this can be tested by having an ai message, then a temp ai message with html that submits new user message:
|
3091
3094
|
// https://github.com/OvidijusParsiunas/deep-chat/issues/258
|
@@ -3093,7 +3096,7 @@ var Te = /*#__PURE__*/function () {
|
|
3093
3096
|
}, {
|
3094
3097
|
key: "revealRoleElementsIfTempRemoved",
|
3095
3098
|
value: function revealRoleElementsIfTempRemoved(e, t) {
|
3096
|
-
if ((this._avatars || this._names) &&
|
3099
|
+
if ((this._avatars || this._names) && Oe.isElementTemporary(e)) {
|
3097
3100
|
var i = this.messageElementRefs[this.messageElementRefs.length - 2];
|
3098
3101
|
i && this.messageToElements.length > 0 && !e.bubbleElement.classList.contains(b.getRoleClass(t)) && b.revealRoleElements(i.innerContainer, this._avatars, this._names);
|
3099
3102
|
}
|
@@ -3101,7 +3104,7 @@ var Te = /*#__PURE__*/function () {
|
|
3101
3104
|
}, {
|
3102
3105
|
key: "createElements",
|
3103
3106
|
value: function createElements(e, t) {
|
3104
|
-
var i =
|
3107
|
+
var i = Ae.createBaseElements(t),
|
3105
3108
|
s = i.outerContainer,
|
3106
3109
|
r = i.innerContainer,
|
3107
3110
|
o = i.bubbleElement;
|
@@ -3165,10 +3168,10 @@ var Te = /*#__PURE__*/function () {
|
|
3165
3168
|
// this is mostly used for enabling highlight.js to highlight code if it downloads later
|
3166
3169
|
}, {
|
3167
3170
|
key: "refreshTextMessages",
|
3168
|
-
value: function refreshTextMessages() {
|
3171
|
+
value: function refreshTextMessages(e) {
|
3169
3172
|
var _this5 = this;
|
3170
|
-
this._remarkable = zt.createNew(), this.messageToElements.forEach(function (
|
3171
|
-
|
3173
|
+
this._remarkable = zt.createNew(e), this.messageToElements.forEach(function (t) {
|
3174
|
+
t[1].text && t[0].text && _this5.renderText(t[1].text.bubbleElement, t[0].text);
|
3172
3175
|
});
|
3173
3176
|
}
|
3174
3177
|
}], [{
|
@@ -3180,7 +3183,7 @@ var Te = /*#__PURE__*/function () {
|
|
3180
3183
|
}, {
|
3181
3184
|
key: "isTemporaryElement",
|
3182
3185
|
value: function isTemporaryElement(e) {
|
3183
|
-
return
|
3186
|
+
return Ae.isLoadingMessage(e) || Oe.isElementTemporary(e);
|
3184
3187
|
}
|
3185
3188
|
}, {
|
3186
3189
|
key: "createBaseElements",
|
@@ -3211,12 +3214,12 @@ var Te = /*#__PURE__*/function () {
|
|
3211
3214
|
}, {
|
3212
3215
|
key: "isLoadingMessage",
|
3213
3216
|
value: function isLoadingMessage(e) {
|
3214
|
-
return e == null ? void 0 : e.bubbleElement.classList.contains(
|
3217
|
+
return e == null ? void 0 : e.bubbleElement.classList.contains(Pe.BUBBLE_CLASS);
|
3215
3218
|
}
|
3216
3219
|
}]);
|
3217
3220
|
}();
|
3218
|
-
|
3219
|
-
var wt =
|
3221
|
+
Ae.TEXT_BUBBLE_CLASS = "text-message";
|
3222
|
+
var wt = Ae;
|
3220
3223
|
var Eo = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3csvg%20fill='%23000000'%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%2032%2032'%20xml:space='preserve'%3e%3cpath%20d='M23,30.36H9c-2.404,0-4.36-1.956-4.36-4.36V15c0-2.404,1.956-4.36,4.36-4.36h3.659%20c0.167-1.566,1.415-2.813,2.981-2.981V5.333c-1.131-0.174-2-1.154-2-2.333c0-1.301,1.059-2.36,2.36-2.36%20c1.302,0,2.36,1.059,2.36,2.36c0,1.179-0.869,2.159-2,2.333V7.66c1.566,0.167,2.814,1.415,2.981,2.981H23%20c2.404,0,4.36,1.956,4.36,4.36v11C27.36,28.404,25.404,30.36,23,30.36z%20M9,11.36c-2.007,0-3.64,1.633-3.64,3.64v11%20c0,2.007,1.633,3.64,3.64,3.64h14c2.007,0,3.64-1.633,3.64-3.64V15c0-2.007-1.633-3.64-3.64-3.64H9z%20M13.384,10.64h5.231%20C18.439,9.354,17.334,8.36,16,8.36C14.667,8.36,13.561,9.354,13.384,10.64z%20M16,1.36c-0.904,0-1.64,0.736-1.64,1.64%20S15.096,4.64,16,4.64c0.904,0,1.64-0.736,1.64-1.64S16.904,1.36,16,1.36z%20M20,27.36h-8c-1.301,0-2.36-1.059-2.36-2.36%20s1.059-2.36,2.36-2.36h8c1.302,0,2.36,1.059,2.36,2.36S21.302,27.36,20,27.36z%20M12,23.36c-0.904,0-1.64,0.735-1.64,1.64%20s0.736,1.64,1.64,1.64h8c0.904,0,1.64-0.735,1.64-1.64s-0.735-1.64-1.64-1.64H12z%20M31,23.86h-2c-0.199,0-0.36-0.161-0.36-0.36V15%20c0-0.199,0.161-0.36,0.36-0.36h2c0.199,0,0.36,0.161,0.36,0.36v8.5C31.36,23.699,31.199,23.86,31,23.86z%20M29.36,23.14h1.279v-7.78%20H29.36V23.14z%20M3,23.86H1c-0.199,0-0.36-0.161-0.36-0.36V15c0-0.199,0.161-0.36,0.36-0.36h2c0.199,0,0.36,0.161,0.36,0.36v8.5%20C3.36,23.699,3.199,23.86,3,23.86z%20M1.36,23.14h1.28v-7.78H1.36V23.14z%20M20,20.36c-1.302,0-2.36-1.059-2.36-2.36%20s1.059-2.36,2.36-2.36s2.36,1.059,2.36,2.36C22.36,19.302,21.302,20.36,20,20.36z%20M20,16.36c-0.904,0-1.64,0.736-1.64,1.64%20s0.735,1.64,1.64,1.64s1.64-0.735,1.64-1.64S20.904,16.36,20,16.36z%20M12,20.36c-1.301,0-2.36-1.059-2.36-2.36s1.059-2.36,2.36-2.36%20s2.36,1.059,2.36,2.36C14.36,19.302,13.301,20.36,12,20.36z%20M12,16.36c-0.904,0-1.64,0.736-1.64,1.64s0.736,1.64,1.64,1.64%20s1.64-0.735,1.64-1.64S12.904,16.36,12,16.36z'/%3e%3crect%20style='fill:none;'%20width='32'%20height='32'/%3e%3c/svg%3e",
|
3221
3224
|
So = "data:image/png;base64,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",
|
3222
3225
|
Q = /*#__PURE__*/function () {
|
@@ -3376,7 +3379,7 @@ var w = /*#__PURE__*/function () {
|
|
3376
3379
|
}, {
|
3377
3380
|
key: "overwriteMessage",
|
3378
3381
|
value: function overwriteMessage(e, t, i, s, r, o) {
|
3379
|
-
var a = w.getLastElementsByClass(t, [w.getRoleClass(s), o], [
|
3382
|
+
var a = w.getLastElementsByClass(t, [w.getRoleClass(s), o], [Pe.BUBBLE_CLASS]),
|
3380
3383
|
l = w.getLastMessage(e, s, r);
|
3381
3384
|
return l && (l[r] = i), a;
|
3382
3385
|
}
|
@@ -3590,7 +3593,7 @@ var mt = /*#__PURE__*/function () {
|
|
3590
3593
|
}]);
|
3591
3594
|
}();
|
3592
3595
|
mt.MESSAGE_CLASS = "streamed-message";
|
3593
|
-
var
|
3596
|
+
var xe = mt;
|
3594
3597
|
var Ke = /*#__PURE__*/function () {
|
3595
3598
|
function Ke() {
|
3596
3599
|
_classCallCheck(this, Ke);
|
@@ -3969,15 +3972,15 @@ var A = /*#__PURE__*/function () {
|
|
3969
3972
|
_context7.next = 17;
|
3970
3973
|
break;
|
3971
3974
|
}
|
3972
|
-
return _context7.abrupt("return",
|
3975
|
+
return _context7.abrupt("return", Ie.stream(e, a, i));
|
3973
3976
|
case 17:
|
3974
|
-
if (!(((y = e.connectSettings) == null ? void 0 : y.url) ===
|
3977
|
+
if (!(((y = e.connectSettings) == null ? void 0 : y.url) === _e.URL)) {
|
3975
3978
|
_context7.next = 19;
|
3976
3979
|
break;
|
3977
3980
|
}
|
3978
|
-
return _context7.abrupt("return",
|
3981
|
+
return _context7.abrupt("return", _e.requestStream(i, e.streamHandlers));
|
3979
3982
|
case 19:
|
3980
|
-
f = new
|
3983
|
+
f = new xe(i), m = E.fetch.bind(this, e, l, s);
|
3981
3984
|
return _context7.abrupt("return", (ko(((P = e.connectSettings) == null ? void 0 : P.url) || e.url || "", {
|
3982
3985
|
method: ((V = e.connectSettings) == null ? void 0 : V.method) || "POST",
|
3983
3986
|
headers: l,
|
@@ -4085,12 +4088,12 @@ var A = /*#__PURE__*/function () {
|
|
4085
4088
|
}, i), !1), i.text) {
|
4086
4089
|
t.onOpen();
|
4087
4090
|
var r = i.text.split("");
|
4088
|
-
A.populateMessages(r, new
|
4091
|
+
A.populateMessages(r, new xe(e), s, "text");
|
4089
4092
|
}
|
4090
4093
|
if (i.html) {
|
4091
4094
|
t.onOpen();
|
4092
4095
|
var _r2 = ie.splitHTML(i.html);
|
4093
|
-
_r2.length === 0 && (_r2 = i.html.split("")), A.populateMessages(_r2, new
|
4096
|
+
_r2.length === 0 && (_r2 = i.html.split("")), A.populateMessages(_r2, new xe(e), s, "html");
|
4094
4097
|
}
|
4095
4098
|
}
|
4096
4099
|
// prettier-ignore
|
@@ -4212,7 +4215,7 @@ var Je = /*#__PURE__*/function () {
|
|
4212
4215
|
}]);
|
4213
4216
|
}();
|
4214
4217
|
Je.URL = "deep-chat-demo";
|
4215
|
-
var
|
4218
|
+
var _e = Je;
|
4216
4219
|
var U = /*#__PURE__*/function () {
|
4217
4220
|
function U() {
|
4218
4221
|
_classCallCheck(this, U);
|
@@ -4220,7 +4223,7 @@ var U = /*#__PURE__*/function () {
|
|
4220
4223
|
return _createClass(U, null, [{
|
4221
4224
|
key: "setup",
|
4222
4225
|
value: function setup(e) {
|
4223
|
-
e.connectSettings.url !==
|
4226
|
+
e.connectSettings.url !== _e.URL && (e.permittedErrorPrefixes = ["Connection error", "Error in server message"], e.websocket = "pending");
|
4224
4227
|
}
|
4225
4228
|
}, {
|
4226
4229
|
key: "isElementPresentInDOM",
|
@@ -4235,7 +4238,7 @@ var U = /*#__PURE__*/function () {
|
|
4235
4238
|
if (!U.isElementPresentInDOM(e.deepChat)) return;
|
4236
4239
|
var i = e.connectSettings.websocket;
|
4237
4240
|
if (i) {
|
4238
|
-
if (e.connectSettings.handler) return
|
4241
|
+
if (e.connectSettings.handler) return Ie.websocket(e, t);
|
4239
4242
|
try {
|
4240
4243
|
var s = typeof i != "boolean" ? i : void 0,
|
4241
4244
|
r = new WebSocket(e.connectSettings.url || "", s);
|
@@ -4367,11 +4370,11 @@ var U = /*#__PURE__*/function () {
|
|
4367
4370
|
return _context10.abrupt("return", r.newUserMessage.listener(a));
|
4368
4371
|
case 14:
|
4369
4372
|
c = s ? JSON.stringify(a) : a;
|
4370
|
-
if (!(((h = e.connectSettings) == null ? void 0 : h.url) ===
|
4373
|
+
if (!(((h = e.connectSettings) == null ? void 0 : h.url) === _e.URL)) {
|
4371
4374
|
_context10.next = 17;
|
4372
4375
|
break;
|
4373
4376
|
}
|
4374
|
-
return _context10.abrupt("return",
|
4377
|
+
return _context10.abrupt("return", _e.request(e, i));
|
4375
4378
|
case 17:
|
4376
4379
|
r.readyState === void 0 || r.readyState !== r.OPEN ? (console.error("Connection is not open"), i.isLastMessageError() || i.addNewErrorMessage("service", "Connection error")) : (r.send(JSON.stringify(c)), e.completionsHandlers.onFinish());
|
4377
4380
|
case 18:
|
@@ -4405,16 +4408,16 @@ var U = /*#__PURE__*/function () {
|
|
4405
4408
|
var _i$o;
|
4406
4409
|
var o = s.role || b.AI_ROLE,
|
4407
4410
|
a = i[o];
|
4408
|
-
s.text === r || s.html === r ? (a == null || a.finaliseStreamedMessage(), delete i[o]) : ((_i$o = i[o]) !== null && _i$o !== void 0 ? _i$o : i[o] = new
|
4411
|
+
s.text === r || s.html === r ? (a == null || a.finaliseStreamedMessage(), delete i[o]) : ((_i$o = i[o]) !== null && _i$o !== void 0 ? _i$o : i[o] = new xe(t), i[o].upsertStreamedMessage(s));
|
4409
4412
|
} else A.simulate(t, e.streamHandlers, s);
|
4410
4413
|
}
|
4411
4414
|
}]);
|
4412
4415
|
}();
|
4413
|
-
var
|
4414
|
-
function
|
4415
|
-
_classCallCheck(this,
|
4416
|
+
var Ie = /*#__PURE__*/function () {
|
4417
|
+
function Ie() {
|
4418
|
+
_classCallCheck(this, Ie);
|
4416
4419
|
}
|
4417
|
-
return _createClass(
|
4420
|
+
return _createClass(Ie, null, [{
|
4418
4421
|
key: "request",
|
4419
4422
|
value: function () {
|
4420
4423
|
var _request2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee12(e, t, i) {
|
@@ -4457,7 +4460,7 @@ var Re = /*#__PURE__*/function () {
|
|
4457
4460
|
return function r(_x24) {
|
4458
4461
|
return _ref6.apply(this, arguments);
|
4459
4462
|
};
|
4460
|
-
}(), o =
|
4463
|
+
}(), o = Ie.generateOptionalSignals();
|
4461
4464
|
(l = (a = e.connectSettings).handler) == null || l.call(a, t, _objectSpread(_objectSpread({}, o), {}, {
|
4462
4465
|
onResponse: r
|
4463
4466
|
}));
|
@@ -4489,12 +4492,12 @@ var Re = /*#__PURE__*/function () {
|
|
4489
4492
|
var h, u;
|
4490
4493
|
var s = !0,
|
4491
4494
|
r = !1;
|
4492
|
-
var o = new
|
4495
|
+
var o = new xe(i),
|
4493
4496
|
a = function a() {
|
4494
4497
|
r || !s || (e.streamHandlers.onOpen(), r = !0);
|
4495
4498
|
},
|
4496
4499
|
l = function l() {
|
4497
|
-
s && (
|
4500
|
+
s && (Ie.attemptToFinaliseStream(o, i), e.streamHandlers.onClose(), s = !1);
|
4498
4501
|
},
|
4499
4502
|
c = /*#__PURE__*/function () {
|
4500
4503
|
var _ref7 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee13(f) {
|
@@ -4531,9 +4534,9 @@ var Re = /*#__PURE__*/function () {
|
|
4531
4534
|
};
|
4532
4535
|
}();
|
4533
4536
|
e.streamHandlers.abortStream.abort = function () {
|
4534
|
-
|
4537
|
+
Ie.attemptToFinaliseStream(o, i), e.streamHandlers.onClose(), s = !1;
|
4535
4538
|
};
|
4536
|
-
var d =
|
4539
|
+
var d = Ie.generateOptionalSignals();
|
4537
4540
|
(u = (h = e.connectSettings).handler) == null || u.call(h, t, _objectSpread(_objectSpread({}, d), {}, {
|
4538
4541
|
onOpen: a,
|
4539
4542
|
onResponse: c,
|
@@ -4598,7 +4601,7 @@ var Re = /*#__PURE__*/function () {
|
|
4598
4601
|
return _ref8.apply(this, arguments);
|
4599
4602
|
};
|
4600
4603
|
}(),
|
4601
|
-
a =
|
4604
|
+
a = Ie.generateOptionalSignals();
|
4602
4605
|
(c = (l = e.connectSettings).handler) == null || c.call(l, void 0, _objectSpread(_objectSpread({}, a), {}, {
|
4603
4606
|
onOpen: s,
|
4604
4607
|
onResponse: o,
|
@@ -4670,13 +4673,13 @@ var T = /*#__PURE__*/function () {
|
|
4670
4673
|
_context16.next = 13;
|
4671
4674
|
break;
|
4672
4675
|
}
|
4673
|
-
return _context16.abrupt("return",
|
4676
|
+
return _context16.abrupt("return", Ie.request(e, o, i));
|
4674
4677
|
case 13:
|
4675
|
-
if (!(((m = e.connectSettings) == null ? void 0 : m.url) ===
|
4678
|
+
if (!(((m = e.connectSettings) == null ? void 0 : m.url) === _e.URL)) {
|
4676
4679
|
_context16.next = 15;
|
4677
4680
|
break;
|
4678
4681
|
}
|
4679
|
-
return _context16.abrupt("return",
|
4682
|
+
return _context16.abrupt("return", _e.request(e, i));
|
4680
4683
|
case 15:
|
4681
4684
|
d = !0;
|
4682
4685
|
h = E.fetch.bind(this, e, a, s);
|
@@ -5208,7 +5211,7 @@ var O = /*#__PURE__*/function () {
|
|
5208
5211
|
key: "set",
|
5209
5212
|
value: function set(e, t, i) {
|
5210
5213
|
O.populateDefaultFileIO(i == null ? void 0 : i.audio, ".4a,.mp3,.webm,.mp4,.mpga,.wav,.mpeg,.m4a"), O.populateDefaultFileIO(i == null ? void 0 : i.images, ".png,.jpg");
|
5211
|
-
var s = zt.createNew();
|
5214
|
+
var s = zt.createNew(e.remarkable);
|
5212
5215
|
O.processImagesConfig(t, s, e.images, i == null ? void 0 : i.images), O.processCamera(t, s, e.camera, e.images), O.processGifConfig(t, s, e.gifs, i == null ? void 0 : i.gifs), O.processAudioConfig(t, s, e.audio, i == null ? void 0 : i.audio), O.processMicrophone(t, s, e.microphone, e.audio), O.processMixedFiles(t, s, e.mixedFiles);
|
5213
5216
|
}
|
5214
5217
|
}]);
|
@@ -5218,7 +5221,7 @@ var st = /*#__PURE__*/function () {
|
|
5218
5221
|
var _a$url;
|
5219
5222
|
_classCallCheck(this, st);
|
5220
5223
|
var s, r, o, a, l;
|
5221
|
-
this.rawBody = {}, this.validateKeyProperty = !1, this.canSendMessage = st.canSendMessage, this.connectSettings = {}, this.fileTypes = {}, this.completionsHandlers = {}, this.streamHandlers = {}, this.deepChat = e, this.demo = i, Object.assign(this.rawBody, (s = e.connect) == null ? void 0 : s.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, O.set(e, this, t), e.connect && (this.connectSettings = e.connect), this.demo && ((_a$url = (a = this.connectSettings).url) !== null && _a$url !== void 0 ? _a$url : a.url =
|
5224
|
+
this.rawBody = {}, this.validateKeyProperty = !1, this.canSendMessage = st.canSendMessage, this.connectSettings = {}, this.fileTypes = {}, this.completionsHandlers = {}, this.streamHandlers = {}, this.deepChat = e, this.demo = i, Object.assign(this.rawBody, (s = e.connect) == null ? void 0 : s.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, O.set(e, this, t), e.connect && (this.connectSettings = e.connect), this.demo && ((_a$url = (a = this.connectSettings).url) !== null && _a$url !== void 0 ? _a$url : a.url = _e.URL), this.connectSettings.websocket && U.setup(this), this.stream = ((l = this.deepChat.connect) == null ? void 0 : l.stream) || ne.checkForStream(this.deepChat), e.loadHistory && Gt.addErrorPrefix(this);
|
5222
5225
|
}
|
5223
5226
|
return _createClass(st, [{
|
5224
5227
|
key: "verifyKey",
|
@@ -5498,19 +5501,19 @@ var mi = /*#__PURE__*/function () {
|
|
5498
5501
|
}
|
5499
5502
|
}]);
|
5500
5503
|
}();
|
5501
|
-
var
|
5504
|
+
var ke = /*#__PURE__*/function (_HTMLElement) {
|
5502
5505
|
// If this is not working, try using propertyName directly
|
5503
|
-
function
|
5506
|
+
function ke() {
|
5504
5507
|
var _this14;
|
5505
|
-
_classCallCheck(this,
|
5506
|
-
_this14 = _callSuper(this,
|
5507
|
-
var t =
|
5508
|
+
_classCallCheck(this, ke);
|
5509
|
+
_this14 = _callSuper(this, ke), _this14._waitingToRender_ = !1, _this14._propUpdated_ = !1, Object.keys(ke._attributeToProperty_).forEach(function (e) {
|
5510
|
+
var t = ke._attributeToProperty_[e];
|
5508
5511
|
_this14.constructPropertyAccessors(t), _this14.hasOwnProperty(e) || _this14.constructPropertyAccessors(t, e);
|
5509
5512
|
});
|
5510
5513
|
return _this14;
|
5511
5514
|
}
|
5512
|
-
_inherits(
|
5513
|
-
return _createClass(
|
5515
|
+
_inherits(ke, _HTMLElement);
|
5516
|
+
return _createClass(ke, [{
|
5514
5517
|
key: "constructPropertyAccessors",
|
5515
5518
|
value:
|
5516
5519
|
// need to be called here as accessors need to be set for the class instance
|
@@ -5529,8 +5532,8 @@ var Ae = /*#__PURE__*/function (_HTMLElement) {
|
|
5529
5532
|
key: "attributeChangedCallback",
|
5530
5533
|
value: function attributeChangedCallback(e, t, i) {
|
5531
5534
|
if (t === i) return;
|
5532
|
-
var s =
|
5533
|
-
r =
|
5535
|
+
var s = ke._attributes_[e](i),
|
5536
|
+
r = ke._attributeToProperty_[e];
|
5534
5537
|
this[r] = s;
|
5535
5538
|
}
|
5536
5539
|
}, {
|
@@ -5539,12 +5542,12 @@ var Ae = /*#__PURE__*/function (_HTMLElement) {
|
|
5539
5542
|
}], [{
|
5540
5543
|
key: "observedAttributes",
|
5541
5544
|
get: function get() {
|
5542
|
-
return Object.keys(
|
5545
|
+
return Object.keys(ke._attributes_) || [];
|
5543
5546
|
}
|
5544
5547
|
}]);
|
5545
5548
|
}(/*#__PURE__*/_wrapNativeSuper(HTMLElement));
|
5546
|
-
|
5547
|
-
var us =
|
5549
|
+
ke._attributes_ = {}, ke._attributeToProperty_ = {};
|
5550
|
+
var us = ke;
|
5548
5551
|
var Ro = "<?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",
|
5549
5552
|
Io = "<?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";
|
5550
5553
|
var se = /*#__PURE__*/function () {
|
@@ -6198,7 +6201,7 @@ var Ys = {
|
|
6198
6201
|
this.streamHandlers.abortStream.abort = function () {
|
6199
6202
|
i.interruptGenerate();
|
6200
6203
|
}, this.streamHandlers.onOpen();
|
6201
|
-
s = new
|
6204
|
+
s = new xe(e);
|
6202
6205
|
_context36.next = 4;
|
6203
6206
|
return i.generate(t, /*#__PURE__*/function () {
|
6204
6207
|
var _ref14 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee35(r, o) {
|
@@ -6679,11 +6682,11 @@ var Po = /*#__PURE__*/function (_Yt2) {
|
|
6679
6682
|
}]);
|
6680
6683
|
}(Yt);
|
6681
6684
|
var Qt = "data:image/png;base64,";
|
6682
|
-
var
|
6683
|
-
function
|
6684
|
-
_classCallCheck(this,
|
6685
|
+
var we = /*#__PURE__*/function () {
|
6686
|
+
function we() {
|
6687
|
+
_classCallCheck(this, we);
|
6685
6688
|
}
|
6686
|
-
return _createClass(
|
6689
|
+
return _createClass(we, null, [{
|
6687
6690
|
key: "buildHeaders",
|
6688
6691
|
value: function buildHeaders(e) {
|
6689
6692
|
return {
|
@@ -6703,7 +6706,7 @@ var _e = /*#__PURE__*/function () {
|
|
6703
6706
|
return {
|
6704
6707
|
url: "https://api.stability.ai/v1/engines/list",
|
6705
6708
|
method: "GET",
|
6706
|
-
handleVerificationResult:
|
6709
|
+
handleVerificationResult: we.handleVerificationResult
|
6707
6710
|
};
|
6708
6711
|
}
|
6709
6712
|
}]);
|
@@ -6734,7 +6737,7 @@ var vi = /*#__PURE__*/function (_Fi) {
|
|
6734
6737
|
}
|
6735
6738
|
}
|
6736
6739
|
};
|
6737
|
-
_this24 = _callSuper(this, vi, [e,
|
6740
|
+
_this24 = _callSuper(this, vi, [e, we.buildKeyVerificationDetails(), we.buildHeaders, i, s]), _this24.url = "https://api.stability.ai/v1/generation/esrgan-v1-x2plus/image-to-image/upscale", _this24.textInputPlaceholderText = "Describe image changes", _this24.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>";
|
6738
6741
|
var r = (o = t == null ? void 0 : t.stabilityAI) == null ? void 0 : o.imageToImageUpscale;
|
6739
6742
|
_typeof(r) == "object" && (r.engine_id && (_this24.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/upscale")), vi.cleanConfig(r), Object.assign(_this24.rawBody, r)), _this24.canSendMessage = vi.canSendFileMessage;
|
6740
6743
|
return _this24;
|
@@ -6841,7 +6844,7 @@ var yi = /*#__PURE__*/function (_Fi2) {
|
|
6841
6844
|
}
|
6842
6845
|
}
|
6843
6846
|
};
|
6844
|
-
_this25 = _callSuper(this, yi, [e,
|
6847
|
+
_this25 = _callSuper(this, yi, [e, we.buildKeyVerificationDetails(), we.buildHeaders, i, s]), _this25.url = "https://api.stability.ai/v1/generation/stable-diffusion-xl-1024-v1-0/image-to-image/masking", _this25._maskSource = "MASK_IMAGE_WHITE", _this25.textInputPlaceholderText = "Describe image changes", _this25.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>";
|
6845
6848
|
var r = (o = t == null ? void 0 : t.stabilityAI) == null ? void 0 : o.imageToImageMasking;
|
6846
6849
|
_typeof(r) == "object" && (r.engine_id && (_this25.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/image-to-image/masking")), r.weight !== void 0 && r.weight !== null && (_this25._imageWeight = r.weight), r.mask_source !== void 0 && r.mask_source !== null && (_this25._maskSource = r.mask_source), yi.cleanConfig(r), Object.assign(_this25.rawBody, r)), _this25.canSendMessage = yi.canSendFileTextMessage;
|
6847
6850
|
return _this25;
|
@@ -7210,7 +7213,7 @@ var Ei = /*#__PURE__*/function (_Fi3) {
|
|
7210
7213
|
}
|
7211
7214
|
}
|
7212
7215
|
};
|
7213
|
-
_this28 = _callSuper(this, Ei, [e,
|
7216
|
+
_this28 = _callSuper(this, Ei, [e, we.buildKeyVerificationDetails(), we.buildHeaders, i, s]), _this28.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-6/image-to-image", _this28.textInputPlaceholderText = "Describe image changes", _this28.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>";
|
7214
7217
|
var r = (o = t.stabilityAI) == null ? void 0 : o.imageToImage;
|
7215
7218
|
_typeof(r) == "object" && (r.engine_id && (_this28.url = "https://api.stability.ai/v1/generation/".concat(r.engine_id, "/text-to-image")), r.weight !== void 0 && r.weight !== null && (_this28._imageWeight = r.weight), Ei.cleanConfig(r), Object.assign(_this28.rawBody, r)), _this28.canSendMessage = Ei.canSendFileTextMessage;
|
7216
7219
|
return _this28;
|
@@ -7348,7 +7351,7 @@ var Si = /*#__PURE__*/function (_Fi4) {
|
|
7348
7351
|
var r;
|
7349
7352
|
var t = JSON.parse(JSON.stringify(e.directConnection)),
|
7350
7353
|
i = t.stabilityAI;
|
7351
|
-
_this29 = _callSuper(this, Si, [e,
|
7354
|
+
_this29 = _callSuper(this, Si, [e, we.buildKeyVerificationDetails(), we.buildHeaders, i]), _this29.url = "https://api.stability.ai/v1/generation/stable-diffusion-v1-6/text-to-image", _this29.textInputPlaceholderText = "Describe an image", _this29.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>";
|
7352
7355
|
var s = (r = t.stabilityAI) == null ? void 0 : r.textToImage;
|
7353
7356
|
_typeof(s) == "object" && (s.engine_id && (_this29.url = "https://api.stability.ai/v1/generation/".concat(s.engine_id, "/text-to-image")), s.weight !== void 0 && s.weight !== null && (_this29._imageWeight = s.weight), Si.cleanConfig(s), Object.assign(_this29.rawBody, s)), _this29.canSendMessage = Si.canSendTextMessage;
|
7354
7357
|
return _this29;
|
@@ -7856,7 +7859,7 @@ var te = /*#__PURE__*/function () {
|
|
7856
7859
|
}]);
|
7857
7860
|
}();
|
7858
7861
|
te.FILES_WITH_TEXT_ERROR = "content with type `text` must have `text` values", te.FUNCTION_TOOL_RESP_ERROR = "Response must contain an array of strings for each individual function/tool_call, see https://deepchat.dev/docs/directConnection/OpenAI/#assistant-functions.";
|
7859
|
-
var
|
7862
|
+
var Ce = te;
|
7860
7863
|
var Fe = /*#__PURE__*/function (_G3) {
|
7861
7864
|
// prettier-ignore
|
7862
7865
|
function Fe(e, t, i, s, r, o) {
|
@@ -8003,7 +8006,7 @@ var Fe = /*#__PURE__*/function (_G3) {
|
|
8003
8006
|
break;
|
8004
8007
|
}
|
8005
8008
|
_context71.next = 16;
|
8006
|
-
return
|
8009
|
+
return Ce.storeFiles(this, e, i, this.urlSegments.storeFiles);
|
8007
8010
|
case 16:
|
8008
8011
|
_context71.t1 = _context71.sent;
|
8009
8012
|
_context71.next = 20;
|
@@ -8086,7 +8089,7 @@ var Fe = /*#__PURE__*/function (_G3) {
|
|
8086
8089
|
_context73.next = 6;
|
8087
8090
|
break;
|
8088
8091
|
}
|
8089
|
-
throw e.error.message.startsWith(
|
8092
|
+
throw e.error.message.startsWith(Ce.FILES_WITH_TEXT_ERROR) ? Error("Please send text with your file(s)") : e.error.message;
|
8090
8093
|
case 6:
|
8091
8094
|
_context73.next = 8;
|
8092
8095
|
return this.assignThreadAndRun(e);
|
@@ -8170,7 +8173,7 @@ var Fe = /*#__PURE__*/function (_G3) {
|
|
8170
8173
|
case 9:
|
8171
8174
|
i = _context75.sent;
|
8172
8175
|
case 10:
|
8173
|
-
return _context75.abrupt("return",
|
8176
|
+
return _context75.abrupt("return", Ce.processAPIMessages(this, i, t, this.urlSegments));
|
8174
8177
|
case 11:
|
8175
8178
|
case "end":
|
8176
8179
|
return _context75.stop();
|
@@ -8271,7 +8274,7 @@ var Fe = /*#__PURE__*/function (_G3) {
|
|
8271
8274
|
_context77.next = 8;
|
8272
8275
|
break;
|
8273
8276
|
}
|
8274
|
-
throw Error(
|
8277
|
+
throw Error(Ce.FUNCTION_TOOL_RESP_ERROR);
|
8275
8278
|
case 8:
|
8276
8279
|
_context77.next = 10;
|
8277
8280
|
return Promise.all(i);
|
@@ -8283,7 +8286,7 @@ var Fe = /*#__PURE__*/function (_G3) {
|
|
8283
8286
|
_context77.next = 13;
|
8284
8287
|
break;
|
8285
8288
|
}
|
8286
|
-
throw Error(
|
8289
|
+
throw Error(Ce.FUNCTION_TOOL_RESP_ERROR);
|
8287
8290
|
case 13:
|
8288
8291
|
r = s.map(function (l, c) {
|
8289
8292
|
return {
|
@@ -8388,7 +8391,7 @@ var Fe = /*#__PURE__*/function (_G3) {
|
|
8388
8391
|
}
|
8389
8392
|
l = e.content.find(function (d) {
|
8390
8393
|
return !!d.text;
|
8391
|
-
}) || e.content[0], c =
|
8394
|
+
}) || e.content[0], c = Ce.getFilesAndText.bind(this, this, {
|
8392
8395
|
role: "assistant",
|
8393
8396
|
content: e.content
|
8394
8397
|
}, this.urlSegments, l);
|
@@ -8412,7 +8415,7 @@ var Fe = /*#__PURE__*/function (_G3) {
|
|
8412
8415
|
break;
|
8413
8416
|
}
|
8414
8417
|
_context79.next = 11;
|
8415
|
-
return
|
8418
|
+
return Ce.processStreamMessages(this, e.delta.content, this.urlSegments);
|
8416
8419
|
case 11:
|
8417
8420
|
_l = _context79.sent;
|
8418
8421
|
return _context79.abrupt("return", {
|
@@ -10747,7 +10750,7 @@ var de = /*#__PURE__*/function (_wt) {
|
|
10747
10750
|
c = _ref31[0];
|
10748
10751
|
return c;
|
10749
10752
|
})));
|
10750
|
-
}, e.clearMessages = _this52.clearMessages.bind(_this52, t), e.refreshMessages = _this52.refreshTextMessages.bind(_this52), e.scrollToBottom = Z.scrollToBottom.bind(_this52, _this52.elementRef), e.addMessage = function (c, d) {
|
10753
|
+
}, e.clearMessages = _this52.clearMessages.bind(_this52, t), e.refreshMessages = _this52.refreshTextMessages.bind(_this52, e.remarkable), e.scrollToBottom = Z.scrollToBottom.bind(_this52, _this52.elementRef), e.addMessage = function (c, d) {
|
10751
10754
|
_this52.addAnyMessage(_objectSpread(_objectSpread({}, c), {}, {
|
10752
10755
|
sendUpdate: !!d
|
10753
10756
|
}), !d);
|
@@ -10818,7 +10821,7 @@ var de = /*#__PURE__*/function (_wt) {
|
|
10818
10821
|
};
|
10819
10822
|
if (!e.ignoreText && s.text !== void 0 && e.text !== null && (this.addNewTextMessage(s.text, s.role, r, i), !t && this.textToSpeech && s.role !== b.USER_ROLE && yt.speak(s.text, this.textToSpeech)), s.files && Array.isArray(s.files) && Ti.addMessages(this, s.files, s.role, i), s.html !== void 0 && s.html !== null) {
|
10820
10823
|
var o = Ee.add(this, s.html, s.role, this.messageElementRefs, r, i);
|
10821
|
-
|
10824
|
+
Oe.isElementTemporary(o) && delete s.html;
|
10822
10825
|
}
|
10823
10826
|
return this.isValidMessageContent(s) && !i && this.updateStateOnMessage(s, e.overwrite, e.sendUpdate, t), s;
|
10824
10827
|
}
|
@@ -10844,7 +10847,7 @@ var de = /*#__PURE__*/function (_wt) {
|
|
10844
10847
|
value: function removeMessageOnError() {
|
10845
10848
|
var e = this.messageElementRefs[this.messageElementRefs.length - 1],
|
10846
10849
|
t = e == null ? void 0 : e.bubbleElement;
|
10847
|
-
(t != null && t.classList.contains(
|
10850
|
+
(t != null && t.classList.contains(xe.MESSAGE_CLASS) && t.textContent === "" || de.isTemporaryElement(e)) && this.removeLastMessage();
|
10848
10851
|
}
|
10849
10852
|
// prettier-ignore
|
10850
10853
|
}, {
|
@@ -10889,9 +10892,9 @@ var de = /*#__PURE__*/function (_wt) {
|
|
10889
10892
|
value: function addDefaultLoadingMessage() {
|
10890
10893
|
var e = this.createMessageElements("", b.AI_ROLE),
|
10891
10894
|
t = e.bubbleElement;
|
10892
|
-
e.bubbleElement.classList.add(
|
10895
|
+
e.bubbleElement.classList.add(Pe.DOTS_CONTAINER_CLASS);
|
10893
10896
|
var i = document.createElement("div");
|
10894
|
-
return i.classList.add("loading-message-dots"), t.appendChild(i),
|
10897
|
+
return i.classList.add("loading-message-dots"), t.appendChild(i), Pe.setDots(t, this.messageStyles), e;
|
10895
10898
|
}
|
10896
10899
|
}, {
|
10897
10900
|
key: "addLoadingMessage",
|
@@ -10900,7 +10903,7 @@ var de = /*#__PURE__*/function (_wt) {
|
|
10900
10903
|
if (!this._displayLoadingMessage) return;
|
10901
10904
|
var e = (r = (s = (i = this.messageStyles) == null ? void 0 : i.loading) == null ? void 0 : s.message) == null ? void 0 : r.html,
|
10902
10905
|
t = e ? Ee.createElements(this, e, b.AI_ROLE, !1) : this.addDefaultLoadingMessage();
|
10903
|
-
this.elementRef.appendChild(t.outerContainer), t.bubbleElement.classList.add(
|
10906
|
+
this.elementRef.appendChild(t.outerContainer), t.bubbleElement.classList.add(Pe.BUBBLE_CLASS), this.applyCustomStyles(t, b.AI_ROLE, !1, (l = (a = (o = this.messageStyles) == null ? void 0 : o.loading) == null ? void 0 : a.message) == null ? void 0 : l.styles), Z.scrollToBottom(this.elementRef);
|
10904
10907
|
}
|
10905
10908
|
}, {
|
10906
10909
|
key: "populateIntroPanel",
|
@@ -10985,7 +10988,7 @@ var de = /*#__PURE__*/function (_wt) {
|
|
10985
10988
|
}, {
|
10986
10989
|
key: "isActiveElement",
|
10987
10990
|
value: function isActiveElement(e) {
|
10988
|
-
return e ? e.contains(
|
10991
|
+
return e ? e.contains(Pe.BUBBLE_CLASS) || e.contains(et.CLASS) || e.contains(xe.MESSAGE_CLASS) : !1;
|
10989
10992
|
}
|
10990
10993
|
}]);
|
10991
10994
|
}(wt);
|
@@ -12896,32 +12899,32 @@ var jt = /*#__PURE__*/function (_Wt) {
|
|
12896
12899
|
}(Wt);
|
12897
12900
|
jt.MICROPHONE_RESET_TIMEOUT_MS = 300;
|
12898
12901
|
var Jt = jt;
|
12899
|
-
var
|
12902
|
+
var Le = /*#__PURE__*/function () {
|
12900
12903
|
// prettier-ignore
|
12901
|
-
function
|
12904
|
+
function Le(e, t, i, s) {
|
12902
12905
|
var _this65 = this;
|
12903
|
-
_classCallCheck(this,
|
12906
|
+
_classCallCheck(this, Le);
|
12904
12907
|
this._attachments = [], this._fileCountLimit = 99, this._acceptedFormat = "", t.maxNumberOfFiles && (this._fileCountLimit = t.maxNumberOfFiles), this._toggleContainerDisplay = i, this._fileAttachmentsContainerRef = s, t.acceptedFormats && (this._acceptedFormat = t.acceptedFormats), setTimeout(function () {
|
12905
12908
|
_this65._validationHandler = e._validationHandler;
|
12906
12909
|
});
|
12907
12910
|
}
|
12908
|
-
return _createClass(
|
12911
|
+
return _createClass(Le, [{
|
12909
12912
|
key: "attemptAddFile",
|
12910
12913
|
value: function attemptAddFile(e, t) {
|
12911
|
-
return
|
12914
|
+
return Le.isFileTypeValid(e, this._acceptedFormat) ? (this.addAttachmentBasedOnType(e, t, !0), !0) : !1;
|
12912
12915
|
}
|
12913
12916
|
}, {
|
12914
12917
|
key: "addAttachmentBasedOnType",
|
12915
12918
|
value: function addAttachmentBasedOnType(e, t, i) {
|
12916
|
-
var s =
|
12919
|
+
var s = Le.getTypeFromBlob(e);
|
12917
12920
|
if (s === "image") {
|
12918
|
-
var r =
|
12921
|
+
var r = Le.createImageAttachment(t);
|
12919
12922
|
this.addFileAttachment(e, "image", r, i);
|
12920
12923
|
} else if (s === "audio") {
|
12921
12924
|
var _r3 = Zt.createAudioAttachment(t);
|
12922
12925
|
this.addFileAttachment(e, "audio", _r3, i);
|
12923
12926
|
} else {
|
12924
|
-
var _r4 =
|
12927
|
+
var _r4 = Le.createAnyFileAttachment(e.name);
|
12925
12928
|
this.addFileAttachment(e, "any", _r4, i);
|
12926
12929
|
}
|
12927
12930
|
}
|
@@ -12929,7 +12932,7 @@ var Ie = /*#__PURE__*/function () {
|
|
12929
12932
|
key: "addFileAttachment",
|
12930
12933
|
value: function addFileAttachment(e, t, i, s) {
|
12931
12934
|
var a;
|
12932
|
-
var r =
|
12935
|
+
var r = Le.createContainer(i);
|
12933
12936
|
if (this._attachments.length >= this._fileCountLimit) {
|
12934
12937
|
var l = this._attachments[this._attachments.length - 1].removeButton;
|
12935
12938
|
l == null || l.click();
|
@@ -13031,19 +13034,19 @@ var Ie = /*#__PURE__*/function () {
|
|
13031
13034
|
}();
|
13032
13035
|
var xa = "<?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>",
|
13033
13036
|
gn = "<?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>",
|
13034
|
-
|
13037
|
+
Me = /*#__PURE__*/function (_Le) {
|
13035
13038
|
// prettier-ignore
|
13036
|
-
function
|
13037
|
-
_classCallCheck(this,
|
13038
|
-
return _callSuper(this,
|
13039
|
+
function Me(e, t, i, s) {
|
13040
|
+
_classCallCheck(this, Me);
|
13041
|
+
return _callSuper(this, Me, [e, t, i, s]);
|
13039
13042
|
}
|
13040
|
-
_inherits(
|
13041
|
-
return _createClass(
|
13043
|
+
_inherits(Me, _Le);
|
13044
|
+
return _createClass(Me, [{
|
13042
13045
|
key: "createTimer",
|
13043
13046
|
value: function createTimer(e, t) {
|
13044
13047
|
var _this66 = this;
|
13045
13048
|
var i = 0;
|
13046
|
-
var s = t !== void 0 && t <
|
13049
|
+
var s = t !== void 0 && t < Me.TIMER_LIMIT_S ? t : Me.TIMER_LIMIT_S;
|
13047
13050
|
return setInterval(function () {
|
13048
13051
|
var a;
|
13049
13052
|
i += 1, i === s && ((a = _this66.stopPlaceholderCallback) == null || a.call(_this66), _this66.clearTimer()), i === 600 && e.classList.add("audio-placeholder-text-4-digits");
|
@@ -13055,7 +13058,7 @@ var xa = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
13055
13058
|
}, {
|
13056
13059
|
key: "createPlaceholderAudioAttachment",
|
13057
13060
|
value: function createPlaceholderAudioAttachment(e) {
|
13058
|
-
var t =
|
13061
|
+
var t = Me.createAudioContainer(),
|
13059
13062
|
i = document.createElement("div");
|
13060
13063
|
i.classList.add("audio-placeholder-text-3-digits");
|
13061
13064
|
var s = document.createElement("div");
|
@@ -13092,7 +13095,7 @@ var xa = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
13092
13095
|
key: "completePlaceholderAttachment",
|
13093
13096
|
value: function completePlaceholderAttachment(e, t) {
|
13094
13097
|
var i = this._activePlaceholderAttachment;
|
13095
|
-
i && (i.file = e,
|
13098
|
+
i && (i.file = e, Me.addAudioElements(i.attachmentContainerElement.children[0], t), i.removeButton = this.createRemoveAttachmentButton(i), i.attachmentContainerElement.appendChild(i.removeButton), this._activePlaceholderAttachment = void 0, this.clearTimer());
|
13096
13099
|
}
|
13097
13100
|
}, {
|
13098
13101
|
key: "removePlaceholderAttachment",
|
@@ -13132,8 +13135,8 @@ var xa = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
13132
13135
|
}, {
|
13133
13136
|
key: "createAudioAttachment",
|
13134
13137
|
value: function createAudioAttachment(e) {
|
13135
|
-
var t =
|
13136
|
-
return
|
13138
|
+
var t = Me.createAudioContainer();
|
13139
|
+
return Me.addAudioElements(t, e), t;
|
13137
13140
|
}
|
13138
13141
|
}, {
|
13139
13142
|
key: "stopAttachmentPlayback",
|
@@ -13142,9 +13145,9 @@ var xa = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<svg viewBox=\"0 0 32 32\"
|
|
13142
13145
|
(s = (i = (t = e.children[0]) == null ? void 0 : t.children) == null ? void 0 : i[0]) != null && s.classList.contains("stop-icon") && e.children[0].click();
|
13143
13146
|
}
|
13144
13147
|
}]);
|
13145
|
-
}(
|
13146
|
-
|
13147
|
-
var Zt =
|
13148
|
+
}(Le);
|
13149
|
+
Me.TIMER_LIMIT_S = 5999;
|
13150
|
+
var Zt = Me;
|
13148
13151
|
var _a = /*#__PURE__*/function () {
|
13149
13152
|
function _a() {
|
13150
13153
|
_classCallCheck(this, _a);
|
@@ -13154,7 +13157,7 @@ var _a = /*#__PURE__*/function () {
|
|
13154
13157
|
value:
|
13155
13158
|
// prettier-ignore
|
13156
13159
|
function create(e, t, i, s, r) {
|
13157
|
-
return r === "audio" ? new Zt(e, t, i, s) : new
|
13160
|
+
return r === "audio" ? new Zt(e, t, i, s) : new Le(e, t, i, s);
|
13158
13161
|
}
|
13159
13162
|
}]);
|
13160
13163
|
}();
|
@@ -13435,15 +13438,15 @@ var Dt = /*#__PURE__*/function (_ei3) {
|
|
13435
13438
|
}
|
13436
13439
|
}]);
|
13437
13440
|
}(ei);
|
13438
|
-
var
|
13439
|
-
function
|
13440
|
-
_classCallCheck(this,
|
13441
|
+
var Re = /*#__PURE__*/function () {
|
13442
|
+
function Re() {
|
13443
|
+
_classCallCheck(this, Re);
|
13441
13444
|
}
|
13442
|
-
return _createClass(
|
13445
|
+
return _createClass(Re, null, [{
|
13443
13446
|
key: "create",
|
13444
13447
|
value: function create(e, t, i) {
|
13445
|
-
var s =
|
13446
|
-
|
13448
|
+
var s = Re.createElement(i);
|
13449
|
+
Re.addEvents(s, e, t), e.appendChild(s);
|
13447
13450
|
}
|
13448
13451
|
}, {
|
13449
13452
|
key: "createElement",
|
@@ -13455,13 +13458,13 @@ var Me = /*#__PURE__*/function () {
|
|
13455
13458
|
key: "addEvents",
|
13456
13459
|
value: function addEvents(e, t, i) {
|
13457
13460
|
t.ondragenter = function (s) {
|
13458
|
-
s.preventDefault(),
|
13461
|
+
s.preventDefault(), Re.display(e);
|
13459
13462
|
}, e.ondragleave = function (s) {
|
13460
|
-
s.preventDefault(),
|
13463
|
+
s.preventDefault(), Re.hide(e);
|
13461
13464
|
}, e.ondragover = function (s) {
|
13462
13465
|
s.preventDefault();
|
13463
13466
|
}, e.ondrop = function (s) {
|
13464
|
-
s.preventDefault(),
|
13467
|
+
s.preventDefault(), Re.uploadFile(i, s), Re.hide(e);
|
13465
13468
|
};
|
13466
13469
|
}
|
13467
13470
|
}, {
|
@@ -13867,7 +13870,7 @@ var k = /*#__PURE__*/function (_ei4) {
|
|
13867
13870
|
e.files && (t.files = Array.from(e.files).map(function (i) {
|
13868
13871
|
return {
|
13869
13872
|
file: i,
|
13870
|
-
type:
|
13873
|
+
type: Le.getTypeFromBlob(i)
|
13871
13874
|
};
|
13872
13875
|
})), setTimeout(function () {
|
13873
13876
|
return _this78.attemptSubmit(t, !0);
|
@@ -14235,7 +14238,7 @@ var Bt = /*#__PURE__*/function () {
|
|
14235
14238
|
button: new wa(_d, t.recordAudio)
|
14236
14239
|
};
|
14237
14240
|
}
|
14238
|
-
return
|
14241
|
+
return Re.isEnabled(r, e.dragAndDrop) && Re.create(i, r, e.dragAndDrop), r;
|
14239
14242
|
}
|
14240
14243
|
// prettier-ignore
|
14241
14244
|
}], [{
|
@@ -14375,6 +14378,7 @@ _([x("object")], S.prototype, "mixedFiles");
|
|
14375
14378
|
_([x("object")], S.prototype, "dragAndDrop");
|
14376
14379
|
_([x("object")], S.prototype, "introPanelStyle");
|
14377
14380
|
_([x("object")], S.prototype, "htmlClassUtilities");
|
14381
|
+
_([x("object")], S.prototype, "remarkable");
|
14378
14382
|
_([x("function")], S.prototype, "onMessage");
|
14379
14383
|
_([x("function")], S.prototype, "onClearMessages");
|
14380
14384
|
_([x("function")], S.prototype, "onComponentRender");
|