@appbaseio/reactivesearch-vue 3.0.0-rc.3 → 3.0.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@appbaseio/reactivesearch-vue.umd.js +36340 -39779
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +32 -32
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/{Button-9e179864.js → Button-d4da7470.js} +6 -13
- package/dist/cjs/{ComponentWrapper-0b9ffb1a.js → ComponentWrapper-9146d811.js} +0 -3
- package/dist/cjs/{DropDown-aef75c14.js → DropDown-b16418e9.js} +4 -7
- package/dist/cjs/DynamicRangeSlider.js +1 -1
- package/dist/cjs/{Input-56eba499.js → Input-497be42a.js} +1 -71
- package/dist/cjs/MultiDropdownList.js +5 -6
- package/dist/cjs/MultiList.js +3 -3
- package/dist/cjs/MultiRange.js +2 -2
- package/dist/cjs/{Pagination-58a0cf3f.js → Pagination-b953a80a.js} +2 -2
- package/dist/cjs/RangeInput.js +3 -3
- package/dist/cjs/RangeSlider.js +2 -2
- package/dist/cjs/ReactiveBase.js +4 -4
- package/dist/cjs/ReactiveComponent.js +2 -2
- package/dist/cjs/ReactiveGoogleMap.js +5 -6
- package/dist/cjs/ReactiveList.js +4 -4
- package/dist/cjs/ResultCard.js +1 -1
- package/dist/cjs/ResultList.js +1 -1
- package/dist/cjs/SelectedFilters.js +2 -3
- package/dist/cjs/SingleDropdownList.js +5 -6
- package/dist/cjs/SingleList.js +3 -3
- package/dist/cjs/SingleRange.js +2 -2
- package/dist/cjs/ToggleButton.js +3 -4
- package/dist/cjs/index.js +8 -11
- package/dist/cjs/{install-b495bb2c.js → install-7cdf6798.js} +158 -1301
- package/dist/cjs/install.js +7 -9
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/{vueTypes-a5f1745e.js → vueTypes-1bf00978.js} +0 -18
- package/dist/es/{Button-c2ff5178.js → Button-fd869491.js} +6 -13
- package/dist/es/{ComponentWrapper-a2635cfc.js → ComponentWrapper-8a3c388d.js} +0 -3
- package/dist/es/{DropDown-39fedff8.js → DropDown-fc1fef02.js} +4 -7
- package/dist/es/DynamicRangeSlider.js +1 -1
- package/dist/es/{Input-11d211d2.js → Input-f7499ef8.js} +2 -71
- package/dist/es/MultiDropdownList.js +5 -6
- package/dist/es/MultiList.js +3 -3
- package/dist/es/MultiRange.js +2 -2
- package/dist/es/{Pagination-ae401c33.js → Pagination-c2745bec.js} +2 -2
- package/dist/es/RangeInput.js +3 -3
- package/dist/es/RangeSlider.js +2 -2
- package/dist/es/ReactiveBase.js +4 -4
- package/dist/es/ReactiveComponent.js +2 -2
- package/dist/es/ReactiveGoogleMap.js +5 -6
- package/dist/es/ReactiveList.js +4 -4
- package/dist/es/ResultCard.js +1 -1
- package/dist/es/ResultList.js +1 -1
- package/dist/es/SelectedFilters.js +2 -3
- package/dist/es/SingleDropdownList.js +5 -6
- package/dist/es/SingleList.js +3 -3
- package/dist/es/SingleRange.js +2 -2
- package/dist/es/ToggleButton.js +3 -4
- package/dist/es/index.js +9 -11
- package/dist/es/{install-6011bce3.js → install-0c7962bc.js} +164 -1306
- package/dist/es/install.js +7 -9
- package/dist/es/version.js +1 -1
- package/dist/es/{vueTypes-09cab4d3.js → vueTypes-f1923c72.js} +0 -18
- package/package.json +5 -7
|
@@ -11,26 +11,22 @@ var VueTypes = _interopDefault(require('vue-types'));
|
|
|
11
11
|
var helper = require('@appbaseio/reactivecore/lib/utils/helper');
|
|
12
12
|
var vueEmotion = require('@appbaseio/vue-emotion');
|
|
13
13
|
var css = require('@emotion/css');
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var vueTypes = require('./vueTypes-a5f1745e.js');
|
|
14
|
+
var Button = require('./Button-d4da7470.js');
|
|
15
|
+
var vueTypes = require('./vueTypes-1bf00978.js');
|
|
17
16
|
var ReactiveList = require('./ReactiveList.js');
|
|
18
17
|
var transform = require('@appbaseio/reactivecore/lib/utils/transform');
|
|
19
18
|
var index = require('./index-779ed366.js');
|
|
20
|
-
var ComponentWrapper = require('./ComponentWrapper-
|
|
19
|
+
var ComponentWrapper = require('./ComponentWrapper-9146d811.js');
|
|
21
20
|
var PreferencesConsumer = require('./PreferencesConsumer-85dee673.js');
|
|
22
21
|
var Title = require('./Title-8802a218.js');
|
|
23
22
|
var ListItem = require('./ListItem-7a682970.js');
|
|
24
23
|
var Flex = require('./Flex-ddde6d26.js');
|
|
25
|
-
var analytics = require('@appbaseio/reactivecore/lib/actions/analytics');
|
|
26
24
|
var ReactiveBase = require('./ReactiveBase.js');
|
|
27
25
|
var hotkeys = _interopDefault(require('hotkeys-js'));
|
|
28
|
-
var
|
|
29
|
-
var
|
|
30
|
-
var Input = require('./Input-56eba499.js');
|
|
26
|
+
var DropDown = require('./DropDown-b16418e9.js');
|
|
27
|
+
var Input = require('./Input-497be42a.js');
|
|
31
28
|
var Container = require('./Container-29f049b2.js');
|
|
32
29
|
var Highlight = _interopDefault(require('vue-highlight-words'));
|
|
33
|
-
var query = require('@appbaseio/reactivecore/lib/actions/query');
|
|
34
30
|
var suggestions = require('@appbaseio/reactivecore/lib/utils/suggestions');
|
|
35
31
|
var FormControlList = require('./FormControlList-fadd792f.js');
|
|
36
32
|
var utils = require('./utils-c9bd5628.js');
|
|
@@ -52,7 +48,7 @@ var ResultList = require('./ResultList.js');
|
|
|
52
48
|
var StateProvider = require('./StateProvider.js');
|
|
53
49
|
|
|
54
50
|
var _templateObject;
|
|
55
|
-
var InputGroup = vueEmotion.styled('div')(_templateObject || (_templateObject = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n
|
|
51
|
+
var InputGroup = vueEmotion.styled('div')(_templateObject || (_templateObject = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n display: flex;\n align-items: stretch;\n width: 100%;\n"])));
|
|
56
52
|
InputGroup.defaultProps = {
|
|
57
53
|
className: 'input-group'
|
|
58
54
|
};
|
|
@@ -760,305 +756,9 @@ var _templateObject$7, _templateObject2;
|
|
|
760
756
|
var TagsContainer = vueEmotion.styled('div')(_templateObject$7 || (_templateObject$7 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tmargin-top: 10px;\n\twidth: 100%;\n"])));
|
|
761
757
|
var TagItem = vueEmotion.styled('span')(_templateObject2 || (_templateObject2 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tcursor: default;\n\tbox-sizing: border-box;\n\tmargin: 0 4px 4px 0;\n\tcolor: #000000d9;\n\tfont-size: 14px;\n\tfont-variant: tabular-nums;\n\tline-height: 1.5715;\n\tlist-style: none;\n\tfont-feature-settings: 'tnum';\n\tdisplay: inline-block;\n\theight: auto;\n\tpadding: 0 2px 0 7px;\n\tfont-size: 12px;\n\tline-height: 22px;\n\twhite-space: nowrap;\n\tbackground: #fafafa;\n\tborder: 1px solid #d9d9d9;\n\tborder-radius: 2px;\n\topacity: 1;\n\ttransition: all 0.3s;\n\n\tspan.close-icon {\n\t\tsvg {\n\t\t\tcursor: pointer;\n\t\t\theight: 15px;\n\t\t\tposition: relative;\n\t\t\ttop: 4px;\n\t\t\tfill: #262626;\n\t\t}\n\t}\n"])));
|
|
762
758
|
|
|
763
|
-
var _templateObject$8, _templateObject2$1, _templateObject3;
|
|
764
|
-
var skeletonAnimation = css.keyframes(_templateObject$8 || (_templateObject$8 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n 0% {\n background-position: 100% 0;\n }\n 100% {\n background-position: -200% 0;\n }\n"])));
|
|
765
|
-
var SkeletonLoader = vueEmotion.styled('div')(_templateObject2$1 || (_templateObject2$1 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 10px;\n"])));
|
|
766
|
-
var SkeletonLine = vueEmotion.styled('div')(_templateObject3 || (_templateObject3 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\theight: 20px;\n\tbackground: linear-gradient(\n\t\t90deg,\n\t\trgba(220, 220, 220, 0.5) 25%,\n\t\trgba(240, 240, 240, 0.9) 50%,\n\t\trgba(220, 220, 220, 0.5) 75%\n\t);\n\tbackground-size: 200% 100%;\n\tanimation: ", " 1.5s infinite;\n"])), skeletonAnimation);
|
|
767
|
-
var HorizontalSkeletonLoader = vue.defineComponent({
|
|
768
|
-
name: 'HorizontalSkeletonLoader',
|
|
769
|
-
render: function render() {
|
|
770
|
-
return vue.createVNode(SkeletonLoader, null, {
|
|
771
|
-
"default": function _default() {
|
|
772
|
-
return [vue.createVNode(SkeletonLine, null, null), vue.createVNode(SkeletonLine, null, null), vue.createVNode(SkeletonLine, null, null), vue.createVNode(SkeletonLine, null, null)];
|
|
773
|
-
}
|
|
774
|
-
});
|
|
775
|
-
}
|
|
776
|
-
});
|
|
777
|
-
|
|
778
|
-
var _templateObject$9, _templateObject2$2, _templateObject3$1, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
|
|
779
|
-
var Chatbox = vueEmotion.styled('div')(_templateObject$9 || (_templateObject$9 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tposition: relative;\n\tmargin: 0 auto;\n\tpadding: 10px;\n\tbackground-color: #fafafa;\n\twidth: 100%;\n\tbox-shadow: rgb(0 0 0 / 20%) 0px 0px 6px;\n\tborder-radius: 6px;\n\tmargin-bottom: 20px;\n\tbackground-color: ", ";\n"])), function (props) {
|
|
780
|
-
return props.theme && props.theme.colors ? props.theme.colors.backgroundColor : '#fff';
|
|
781
|
-
});
|
|
782
|
-
var ChatContainer = vueEmotion.styled('div')(_templateObject2$2 || (_templateObject2$2 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-direction: column;\n\theight: 100%;\n\tposition: relative;\n\t.--ai-answer-error-container {\n\t\ttext-align: center;\n\t\tposition: absolute;\n\t\tbottom: 0px;\n\t\t", ";\n\t\tz-index: 1;\n\t\tleft: 50%;\n\t\ttransform: translateX(-50%);\n\t\twidth: 100%;\n\n\t\t.--default-error-element {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tpadding: 10px;\n\t\t\tbackground-color: ", ";\n\t\t\tbox-shadow: 0 -5px 5px -2px\n\t\t\t\t", ";\n\n\t\t\tspan {\n\t\t\t\tmargin-bottom: 5px;\n\t\t\t}\n\n\t\t\tbutton {\n\t\t\t}\n\t\t}\n\t}\n\n\t", ";\n"])), function (props) {
|
|
783
|
-
return props.showInput ? 'bottom: 48px;' : '';
|
|
784
|
-
}, function (props) {
|
|
785
|
-
return props.theme && props.theme.colors && props.theme.colors.backgroundColor ? props.theme.colors.backgroundColor : '#fff';
|
|
786
|
-
}, function (props) {
|
|
787
|
-
return props.theme && props.theme.colors && props.theme.colors.backgroundColor ? props.theme.colors.backgroundColor : '#fff';
|
|
788
|
-
}, function (props) {
|
|
789
|
-
return props.showInput ? ".--ai-answer-feedback-container {\n\t\tmargin-top: 15px;\n\t\tmargin-bottom: -10px;\n\t}" : ".--ai-answer-feedback-container {\n\t\tmargin-top: 4px;\n\t}";
|
|
790
|
-
});
|
|
791
|
-
var MessagesContainer = vueEmotion.styled('div')(_templateObject3$1 || (_templateObject3$1 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tmax-height: 400px;\n overflow-y: auto;\n\tpadding: 10px;\n\tdisplay: flex;\n\tflex-direction: column;\n\tmin-height: 200px;\n\n}};\n"])));
|
|
792
|
-
var typingDots = css.keyframes(_templateObject4 || (_templateObject4 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n 0% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-70%);\n }\n 100% {\n transform: translateY(0);\n }\n"])));
|
|
793
|
-
var TypingIndicator = vueEmotion.styled('div')(_templateObject5 || (_templateObject5 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmargin: 5px !important;\n"])));
|
|
794
|
-
var TypingDot = vueEmotion.styled('div')(_templateObject6 || (_templateObject6 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\twidth: 6px;\n\theight: 6px;\n\tbackground-color: ", ";\n\tborder-radius: 50%;\n\tmargin: 0 2px !important;\n\tanimation: ", " 1s infinite;\n\t&:nth-child(2) {\n\t\tanimation-delay: 0.2s;\n\t}\n\t&:nth-child(3) {\n\t\tanimation-delay: 0.4s;\n\t}\n"])), function (props) {
|
|
795
|
-
var finalColor;
|
|
796
|
-
if (props.isSender) {
|
|
797
|
-
finalColor = props.themePreset !== 'dark' ? props.theme.colors.primaryTextColor : props.theme.colors.textColor;
|
|
798
|
-
} else {
|
|
799
|
-
finalColor = props.themePreset !== 'dark' ? props.theme.colors.borderColor : props.theme.colors.textColor;
|
|
800
|
-
}
|
|
801
|
-
return finalColor;
|
|
802
|
-
}, typingDots);
|
|
803
|
-
var resetCSS = function resetCSS(props) {
|
|
804
|
-
return "\n\thtml,\n\tbody,\n\tdiv,\n\tspan,\n\tapplet,\n\tobject,\n\tiframe,\n\th1,\n\th2,\n\th3,\n\th4,\n\th5,\n\th6,\n\tp,\n\tblockquote,\n\tpre,\n\ta,\n\tabbr,\n\tacronym,\n\taddress,\n\tbig,\n\tcite,\n\tcode,\n\tdel,\n\tdfn,\n\tem,\n\timg,\n\tins,\n\tkbd,\n\tq,\n\ts,\n\tsamp,\n\tsmall,\n\tstrike,\n\tstrong,\n\tsub,\n\tsup,\n\ttt,\n\tvar,\n\tb,\n\tu,\n\ti,\n\tcenter,\n\tdl,\n\tdt,\n\tdd,\n\tol,\n\tul,\n\tli,\n\tfieldset,\n\tform,\n\tlabel,\n\tlegend,\n\ttable,\n\tcaption,\n\ttbody,\n\ttfoot,\n\tthead,\n\ttr,\n\tth,\n\ttd,\n\tarticle,\n\taside,\n\tcanvas,\n\tdetails,\n\tembed,\n\tfigure,\n\tfigcaption,\n\tfooter,\n\theader,\n\thgroup,\n\tmenu,\n\tnav,\n\toutput,\n\truby,\n\tsection,\n\tsummary,\n\ttime,\n\tmark,\n\taudio,\n\tvideo {\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\tborder: 0;\n\t\tfont-size: 100%;\n\t\tfont: inherit;\n\t\tvertical-align: baseline;\n\t\toverflow-wrap: anywhere;\n\t}\n\tpre {\n\t\tmargin: 10px auto;\n\t}\n\ttable {\n\t\tmargin: 10px auto;\n\t\tborder-collapse: collapse;\n\t\tborder-spacing: 0;\n\t}\n\ttr {\n\t\tborder-bottom: 1px solid #ccc;\n\t}\n\tth,\n\ttd {\n\t\ttext-align: left;\n\t\tpadding: 4px;\n\t\tborder: 1px solid;\n\t\tborder-collapse: collapse;\n\t}\n\tpre,\n\tcode {\n\t\tpadding: 0.6em 0.4em;\n\t\tbackground: " + (
|
|
805
|
-
// eslint-disable-next-line no-nested-ternary
|
|
806
|
-
props.isSender ? props.themePreset !== 'dark' ? props.theme.colors.primaryColor : props.theme.colors.borderColor : props.theme.colors.borderColor) + ";\n\t}\n\n\tcode {\n\t\tline-height: normal;\n\n\t\tcolor: " + (
|
|
807
|
-
// eslint-disable-next-line no-nested-ternary
|
|
808
|
-
props.isSender ? props.themePreset !== 'dark' ? props.theme.colors.primaryTextColor : props.theme.colors.textColor : props.theme.colors.primaryTextColor) + ";\n\t\tborder-radius: 3px;\n\t\tfont-size: 85%;\n\t\tpadding: 0.2em 0.4em;\n\t\tmargin-top: 5px;\n\t\tdisplay: inline-block;\n\t\toverflow: auto;\n\t\twidth: fit-content;\n\t\tmax-width: 100%;\n\t}\n\tul,\n\tol {\n\t\tlist-style-position: inside;\n\n\t}\n\n\tli{\n\t\tdisplay: unset;\n\t\tcursor: default;\n\t\tpadding: initial;\n\n\t\t&:hover{\n\t\t\tbackground-color: initial;\n\t\t}\n\t}\n";
|
|
809
|
-
};
|
|
810
|
-
var messageBGColor = function messageBGColor(props) {
|
|
811
|
-
var finalBGColor;
|
|
812
|
-
if (props.isSender) {
|
|
813
|
-
finalBGColor = props.themePreset !== 'dark' ? props.theme.colors.primaryColor : props.theme.colors.borderColor;
|
|
814
|
-
} else {
|
|
815
|
-
finalBGColor = props.themePreset !== 'dark' ? polished.lighten(0.53, props.theme.colors.borderColor) : props.theme.colors.backgroundColor;
|
|
816
|
-
}
|
|
817
|
-
return finalBGColor;
|
|
818
|
-
};
|
|
819
|
-
var Message = vueEmotion.styled('div')(_templateObject7 || (_templateObject7 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tbackground-color: ", ";\n\tcolor: ", ";\n\tborder: 1px solid\n\t\t", ";\n\tpadding: 10px;\n\tborder-radius: 7px;\n\tmargin-bottom: 10px;\n\tmax-width: 80%;\n\talign-self: ", ";\n\tdisplay: inline-block;\n\tposition: relative;\n\toverflow-wrap: anywhere;\n\t", "\n"])), function (props) {
|
|
820
|
-
return messageBGColor(props);
|
|
821
|
-
}, function (props) {
|
|
822
|
-
var finalColor;
|
|
823
|
-
if (props.isSender) {
|
|
824
|
-
finalColor = props.themePreset !== 'dark' ? props.theme.colors.primaryTextColor : props.theme.colors.textColor;
|
|
825
|
-
} else {
|
|
826
|
-
finalColor = props.themePreset !== 'dark' ? props.theme.colors.borderColor : props.theme.colors.textColor;
|
|
827
|
-
}
|
|
828
|
-
return finalColor;
|
|
829
|
-
}, function (props) {
|
|
830
|
-
return props.themePreset === 'dark' ? 'currentColor' : messageBGColor(props);
|
|
831
|
-
}, function (props) {
|
|
832
|
-
return props.isSender ? 'flex-end' : 'flex-start';
|
|
833
|
-
}, function (props) {
|
|
834
|
-
return resetCSS(props);
|
|
835
|
-
});
|
|
836
|
-
var MessageInputContainer = vueEmotion.styled('form')(_templateObject8 || (_templateObject8 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tpadding-top: 12px;\n\talign-items: stretch;\n\tmargin-top: 10px;\n\t.ai-enter-button-wrapper {\n\t\talign-self: baseline;\n\t\theight: 41px;\n\t}\n"])));
|
|
837
|
-
var MessageInput = vueEmotion.styled(Input.TextArea)(_templateObject9 || (_templateObject9 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\twidth: 100%;\n\tborder-radius: 5px;\n\tborder: 1px solid #ccc;\n\tbackground-color: ", ";\n\tcolor: ", ";\n\n\t::placeholder {\n\t\tcolor: ", ";\n\t}\n\n\t:-ms-input-placeholder {\n\t\tcolor: ", ";\n\t}\n\n\t::-ms-input-placeholder {\n\t\tcolor: ", ";\n\t}\n\t", "\n"])), function (props) {
|
|
838
|
-
return props.themePreset === 'dark' ? props.theme.colors.borderColor : '#fff';
|
|
839
|
-
}, function (props) {
|
|
840
|
-
return props.themePreset === 'dark' ? props.theme.colors.titleColor : props.theme.colors.textColor;
|
|
841
|
-
}, function (props) {
|
|
842
|
-
return props.theme.colors.textColor;
|
|
843
|
-
}, function (props) {
|
|
844
|
-
return props.theme.colors.textColor;
|
|
845
|
-
}, function (props) {
|
|
846
|
-
return props.theme.colors.textColor;
|
|
847
|
-
}, function (_ref) {
|
|
848
|
-
var enterButton = _ref.enterButton;
|
|
849
|
-
return enterButton && "\n\t\t border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n\t";
|
|
850
|
-
});
|
|
851
|
-
var SendButton = vueEmotion.styled(Button.Button)(_templateObject10 || (_templateObject10 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tborder: none;\n\tcolor: #ffffff;\n\tcursor: pointer;\n\tfont-size: 16px;\n\tmargin-left: 8px;\n\toutline: none;\n\tpadding: 10px;\n\ttext-align: center;\n"])));
|
|
852
|
-
var AIFeedbackContainer = vueEmotion.styled('div')(_templateObject11 || (_templateObject11 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t.--feedback-svgs-wrapper {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: flex-end;\n\t\tgap: 5px;\n\n\t\tsvg {\n\t\t\tcursor: pointer;\n\t\t\ttransition: all ease-in 0.1s;\n\t\t\t&.selected {\n\t\t\t\ttransform: scale(1.1);\n\t\t\t\tcursor: default;\n\t\t\t}\n\n\t\t\t&:hover {\n\t\t\t\ttransform: scale(1.1);\n\t\t\t}\n\t\t}\n\t}\n\n\t.--feedback-input-wrapper {\n\t\tdisplay: flex;\n\t\tgap: 7px;\n\t}\n"])));
|
|
853
|
-
|
|
854
|
-
var _templateObject$a, _templateObject2$3, _templateObject3$2, _templateObject4$1, _templateObject5$1, _templateObject6$1, _templateObject7$1;
|
|
855
|
-
var fadeInFromBottom = css.keyframes(_templateObject$a || (_templateObject$a = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n 0% {\n opacity: 0;\n transform: translateY(20px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n"])));
|
|
856
|
-
var fadeInFromTop = css.keyframes(_templateObject2$3 || (_templateObject2$3 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n 0% {\n opacity: 0;\n transform: translateY(-20px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n"])));
|
|
857
|
-
var SearchBoxAISection = vueEmotion.styled('div')(_templateObject3$2 || (_templateObject3$2 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tpadding: 10px;\n\tborder-radius: 4px;\n\tmin-height: 200px;\n\tpadding-top: 20px;\n\tposition: relative;\n\tdisplay: flex;\n\tflex-direction: column;\n\tjustify-content: space-between;\n\tbackground-color: ", ";\n\tcolor: ", ";\n\t.--ai-answer-error-container {\n\t\tposition: absolute;\n\t\ttop: 50%;\n\t\tleft: 50%;\n\t\ttransform: translate(-50%, -50%);\n\t\t.--default-error-element {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tgap: 10px;\n\t\t}\n\t}\n"])), function (_ref) {
|
|
858
|
-
var themePreset = _ref.themePreset,
|
|
859
|
-
theme = _ref.theme;
|
|
860
|
-
return themePreset === 'dark' ? '#424242' : theme.colors.backgroundColor;
|
|
861
|
-
}, function (_ref2) {
|
|
862
|
-
var theme = _ref2.theme;
|
|
863
|
-
return theme.colors.textColor;
|
|
864
|
-
});
|
|
865
|
-
var Question = vueEmotion.styled('div')(_templateObject4$1 || (_templateObject4$1 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tfont-weight: bold;\n\tmargin-bottom: 5px;\n\tanimation: ", " 0.5s ease-out;\n"])), fadeInFromTop);
|
|
866
|
-
var Answer = vueEmotion.styled('div')(_templateObject5$1 || (_templateObject5$1 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\t", "\n\tposition: relative;\n\tmargin-bottom: 5px;\n\tmin-height: 100px;\n\toverflow: auto;\n\twhite-space: pre-wrap;\n\tpre {\n\t\twhite-space: pre-wrap;\n\t}\n\tcode,\n\tpre {\n\t\tdisplay: revert;\n\t}\n"])), function (props) {
|
|
867
|
-
return resetCSS(props);
|
|
868
|
-
});
|
|
869
|
-
var Footer = vueEmotion.styled('div')(_templateObject6$1 || (_templateObject6$1 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tcolor: #777;\n\tdisplay: inline-flex;\n\talign-items: center;\n\tgap: 1rem;\n\tflex-wrap: wrap;\n\tanimation: ", " 0.5s ease-out;\n\tpadding: 10px 0;\n\tbackground: white;\n\tbackground-color: ", ";\n\tcolor: ", ";\n"])), fadeInFromBottom, function (_ref3) {
|
|
870
|
-
var themePreset = _ref3.themePreset,
|
|
871
|
-
theme = _ref3.theme;
|
|
872
|
-
return themePreset === 'dark' ? '#424242' : theme.colors.backgroundColor;
|
|
873
|
-
}, function (_ref4) {
|
|
874
|
-
var theme = _ref4.theme;
|
|
875
|
-
return theme.colors.textColor;
|
|
876
|
-
});
|
|
877
|
-
var SourceTags = vueEmotion.styled('div')(_templateObject7$1 || (_templateObject7$1 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tgap: 8px;\n\tflex-wrap: wrap;\n\t.--ai-source-tag {\n\t\tdisplay: inline-block;\n\t\tmax-width: 200px;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t}\n"])));
|
|
878
|
-
|
|
879
|
-
var ThumbsUpSvg = {
|
|
880
|
-
name: 'ThumbsUpSvg',
|
|
881
|
-
props: ['clickHandler', 'className'],
|
|
882
|
-
render: function render() {
|
|
883
|
-
return vue.createVNode("svg", {
|
|
884
|
-
"stroke": "currentColor",
|
|
885
|
-
"fill": "none",
|
|
886
|
-
"strokeWidth": "2",
|
|
887
|
-
"viewBox": "0 0 24 24",
|
|
888
|
-
"strokeLinecap": "round",
|
|
889
|
-
"strokeLinejoin": "round",
|
|
890
|
-
"class": this.$props.className,
|
|
891
|
-
"height": "1em",
|
|
892
|
-
"width": "1em",
|
|
893
|
-
"xmlns": "http://www.w3.org/2000/svg",
|
|
894
|
-
"onClick": this.$props.clickHandler
|
|
895
|
-
}, [vue.createVNode("path", {
|
|
896
|
-
"d": "M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"
|
|
897
|
-
}, null)]);
|
|
898
|
-
}
|
|
899
|
-
};
|
|
900
|
-
|
|
901
|
-
var ThumbsDownSvg = {
|
|
902
|
-
name: 'ThumbsDownSvg',
|
|
903
|
-
props: ['clickHandler', 'className'],
|
|
904
|
-
render: function render() {
|
|
905
|
-
return vue.createVNode("svg", {
|
|
906
|
-
"stroke": "currentColor",
|
|
907
|
-
"fill": "none",
|
|
908
|
-
"strokeWidth": "2",
|
|
909
|
-
"viewBox": "0 0 24 24",
|
|
910
|
-
"strokeLinecap": "round",
|
|
911
|
-
"strokeLinejoin": "round",
|
|
912
|
-
"class": this.$props.className,
|
|
913
|
-
"height": "1em",
|
|
914
|
-
"width": "1em",
|
|
915
|
-
"xmlns": "http://www.w3.org/2000/svg",
|
|
916
|
-
"onClick": this.$props.clickHandler
|
|
917
|
-
}, [vue.createVNode("path", {
|
|
918
|
-
"d": "M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17"
|
|
919
|
-
}, null), ' ']);
|
|
920
|
-
}
|
|
921
|
-
};
|
|
922
|
-
|
|
923
|
-
var AIFeedback = vue.defineComponent({
|
|
924
|
-
name: 'FeedbackComponent',
|
|
925
|
-
props: {
|
|
926
|
-
onFeedbackSubmit: {
|
|
927
|
-
type: Function,
|
|
928
|
-
"default": function _default() {}
|
|
929
|
-
},
|
|
930
|
-
hideUI: {
|
|
931
|
-
type: Boolean,
|
|
932
|
-
"default": false
|
|
933
|
-
},
|
|
934
|
-
overrideState: {
|
|
935
|
-
type: Object,
|
|
936
|
-
"default": function _default() {
|
|
937
|
-
return {};
|
|
938
|
-
}
|
|
939
|
-
}
|
|
940
|
-
},
|
|
941
|
-
setup: function setup(props, _ref) {
|
|
942
|
-
var emit = _ref.emit;
|
|
943
|
-
var showInput = vue.ref(false);
|
|
944
|
-
var feedbackType = vue.ref(null);
|
|
945
|
-
var feedbackText = vue.ref('');
|
|
946
|
-
var feedbackRecorded = vue.ref(false);
|
|
947
|
-
var handleButtonClick = function handleButtonClick(type) {
|
|
948
|
-
if (feedbackType.value === type) {
|
|
949
|
-
feedbackType.value = null;
|
|
950
|
-
showInput.value = false;
|
|
951
|
-
} else {
|
|
952
|
-
feedbackType.value = type;
|
|
953
|
-
showInput.value = true;
|
|
954
|
-
}
|
|
955
|
-
};
|
|
956
|
-
var handleInputChange = function handleInputChange(e) {
|
|
957
|
-
feedbackText.value = e.target.value;
|
|
958
|
-
};
|
|
959
|
-
var handleSubmit = function handleSubmit() {
|
|
960
|
-
emit('feedback-submit', feedbackType.value === 'positive', feedbackText.value);
|
|
961
|
-
feedbackText.value = '';
|
|
962
|
-
showInput.value = false;
|
|
963
|
-
feedbackRecorded.value = true;
|
|
964
|
-
};
|
|
965
|
-
var handleCancel = function handleCancel() {
|
|
966
|
-
feedbackType.value = null;
|
|
967
|
-
feedbackText.value = '';
|
|
968
|
-
showInput.value = false;
|
|
969
|
-
};
|
|
970
|
-
vue.watch(function () {
|
|
971
|
-
return props.overrideState;
|
|
972
|
-
}, function (newValue) {
|
|
973
|
-
if (newValue && newValue.isRecorded) {
|
|
974
|
-
feedbackRecorded.value = true;
|
|
975
|
-
feedbackType.value = newValue.feedbackType || 'positive';
|
|
976
|
-
}
|
|
977
|
-
});
|
|
978
|
-
if (props.overrideState && props.overrideState.isRecorded) {
|
|
979
|
-
feedbackRecorded.value = true;
|
|
980
|
-
feedbackType.value = props.overrideState.feedbackType || 'positive';
|
|
981
|
-
}
|
|
982
|
-
return {
|
|
983
|
-
showInput: showInput,
|
|
984
|
-
feedbackType: feedbackType,
|
|
985
|
-
feedbackText: feedbackText,
|
|
986
|
-
feedbackRecorded: feedbackRecorded,
|
|
987
|
-
handleButtonClick: handleButtonClick,
|
|
988
|
-
handleInputChange: handleInputChange,
|
|
989
|
-
handleSubmit: handleSubmit,
|
|
990
|
-
handleCancel: handleCancel
|
|
991
|
-
};
|
|
992
|
-
},
|
|
993
|
-
render: function render() {
|
|
994
|
-
var _this = this;
|
|
995
|
-
if (this.$props.hideUI) {
|
|
996
|
-
return null;
|
|
997
|
-
}
|
|
998
|
-
if (this.feedbackRecorded) {
|
|
999
|
-
return vue.createVNode(AIFeedbackContainer, null, {
|
|
1000
|
-
"default": function _default() {
|
|
1001
|
-
return [vue.createVNode("div", {
|
|
1002
|
-
"class": "--feedback-svgs-wrapper"
|
|
1003
|
-
}, [_this.feedbackType === 'positive' ? vue.createVNode(ThumbsUpSvg, {
|
|
1004
|
-
"class": "selected"
|
|
1005
|
-
}, null) : vue.createVNode(ThumbsDownSvg, {
|
|
1006
|
-
"class": "selected"
|
|
1007
|
-
}, null)])];
|
|
1008
|
-
}
|
|
1009
|
-
});
|
|
1010
|
-
}
|
|
1011
|
-
return vue.createVNode(AIFeedbackContainer, null, {
|
|
1012
|
-
"default": function _default() {
|
|
1013
|
-
return [!_this.showInput && vue.createVNode("div", {
|
|
1014
|
-
"class": "--feedback-svgs-wrapper"
|
|
1015
|
-
}, [vue.createVNode(ThumbsUpSvg, {
|
|
1016
|
-
"class": _this.feedbackType === 'positive' ? 'selected' : '',
|
|
1017
|
-
"onClick": function onClick() {
|
|
1018
|
-
return _this.handleButtonClick('positive');
|
|
1019
|
-
}
|
|
1020
|
-
}, null), vue.createVNode(ThumbsDownSvg, {
|
|
1021
|
-
"class": _this.feedbackType === 'negative' ? 'selected' : '',
|
|
1022
|
-
"onClick": function onClick() {
|
|
1023
|
-
return _this.handleButtonClick('negative');
|
|
1024
|
-
}
|
|
1025
|
-
}, null)]), _this.showInput && vue.createVNode("div", {
|
|
1026
|
-
"class": "--feedback-input-wrapper"
|
|
1027
|
-
}, [vue.createVNode(Input.Input, {
|
|
1028
|
-
"show": _this.showInput,
|
|
1029
|
-
"placeholder": _this.feedbackType === 'positive' ? 'What do you like about the response?' : 'What was the issue with the response? How can it be improved?',
|
|
1030
|
-
"value": _this.feedbackText,
|
|
1031
|
-
"onInput": _this.handleInputChange
|
|
1032
|
-
}, null), vue.createVNode(Button.Button, {
|
|
1033
|
-
"primary": true,
|
|
1034
|
-
"onClick": _this.handleSubmit
|
|
1035
|
-
}, {
|
|
1036
|
-
"default": function _default() {
|
|
1037
|
-
return [vue.createTextVNode("Submit")];
|
|
1038
|
-
}
|
|
1039
|
-
}), vue.createVNode(Button.Button, {
|
|
1040
|
-
"onClick": _this.handleCancel
|
|
1041
|
-
}, {
|
|
1042
|
-
"default": function _default() {
|
|
1043
|
-
return [vue.createTextVNode("Cancel")];
|
|
1044
|
-
}
|
|
1045
|
-
})])];
|
|
1046
|
-
}
|
|
1047
|
-
});
|
|
1048
|
-
}
|
|
1049
|
-
});
|
|
1050
|
-
|
|
1051
|
-
var _excluded = ["_source"];
|
|
1052
759
|
function _isSlot(s) {
|
|
1053
760
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
1054
761
|
}
|
|
1055
|
-
var md = new remarkable.Remarkable();
|
|
1056
|
-
md.set({
|
|
1057
|
-
html: true,
|
|
1058
|
-
breaks: true,
|
|
1059
|
-
xhtmlOut: true
|
|
1060
|
-
});
|
|
1061
|
-
var _dropdownULRef = 'dropdownULRef';
|
|
1062
762
|
var updateQuery = reactivecore.Actions.updateQuery,
|
|
1063
763
|
setCustomQuery = reactivecore.Actions.setCustomQuery,
|
|
1064
764
|
setDefaultQuery = reactivecore.Actions.setDefaultQuery,
|
|
@@ -1079,11 +779,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1079
779
|
currentValue: '',
|
|
1080
780
|
selectedTags: [],
|
|
1081
781
|
isOpen: false,
|
|
1082
|
-
normalizedSuggestions: []
|
|
1083
|
-
showAIScreen: false,
|
|
1084
|
-
showAIScreenFooter: false,
|
|
1085
|
-
showFeedbackComponent: false,
|
|
1086
|
-
feedbackState: null
|
|
782
|
+
normalizedSuggestions: []
|
|
1087
783
|
};
|
|
1088
784
|
this.internalComponent = props.componentId + "__internal";
|
|
1089
785
|
return this.__state;
|
|
@@ -1205,10 +901,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1205
901
|
mode: VueTypes.oneOf(['select', 'tag']).def('select'),
|
|
1206
902
|
renderSelectedTags: VueTypes.any,
|
|
1207
903
|
searchboxId: VueTypes.string,
|
|
1208
|
-
endpoint: vueTypes.types.endpointConfig
|
|
1209
|
-
enableAI: vueTypes.types.bool,
|
|
1210
|
-
AIConfig: vueTypes.types.AIConfig,
|
|
1211
|
-
AIUIConfig: vueTypes.types.AIUIConfig
|
|
904
|
+
endpoint: vueTypes.types.endpointConfig
|
|
1212
905
|
},
|
|
1213
906
|
mounted: function mounted() {
|
|
1214
907
|
this.listenForFocusShortcuts();
|
|
@@ -1315,47 +1008,6 @@ var SearchBox = vue.defineComponent({
|
|
|
1315
1008
|
if (!isEqual(newVal, oldVal)) {
|
|
1316
1009
|
this.handleTextChange = _debounce(this.handleText, newVal);
|
|
1317
1010
|
}
|
|
1318
|
-
},
|
|
1319
|
-
isAITyping: function isAITyping(newVal, oldVal) {
|
|
1320
|
-
var _this = this;
|
|
1321
|
-
var scrollAIContainer = function scrollAIContainer() {
|
|
1322
|
-
var dropdownEle = _this.$refs[_dropdownULRef];
|
|
1323
|
-
if (dropdownEle) {
|
|
1324
|
-
dropdownEle.scrollTo({
|
|
1325
|
-
top: dropdownEle.scrollHeight,
|
|
1326
|
-
behavior: 'smooth'
|
|
1327
|
-
});
|
|
1328
|
-
}
|
|
1329
|
-
};
|
|
1330
|
-
if (!newVal && oldVal) {
|
|
1331
|
-
this.showAIScreenFooter = true;
|
|
1332
|
-
if (this.$props.AIUIConfig && typeof this.$props.AIUIConfig.showFeedback === 'boolean' ? this.$props.AIUIConfig.showFeedback : true) {
|
|
1333
|
-
this.showFeedbackComponent = true;
|
|
1334
|
-
}
|
|
1335
|
-
setTimeout(function () {
|
|
1336
|
-
scrollAIContainer();
|
|
1337
|
-
}, 500);
|
|
1338
|
-
} else if (newVal) {
|
|
1339
|
-
this.scrollTimerRef = setTimeout(function () {
|
|
1340
|
-
scrollAIContainer();
|
|
1341
|
-
}, 2000);
|
|
1342
|
-
}
|
|
1343
|
-
},
|
|
1344
|
-
showAIScreen: function showAIScreen(newVal) {
|
|
1345
|
-
if (newVal) {
|
|
1346
|
-
var _this$$refs;
|
|
1347
|
-
if ((_this$$refs = this.$refs) != null && _this$$refs[this.$props.innerRef] && this.$refs[this.$props.innerRef].$el) {
|
|
1348
|
-
this.$refs[this.$props.innerRef].$el.blur();
|
|
1349
|
-
}
|
|
1350
|
-
} else {
|
|
1351
|
-
this.feedbackState = null;
|
|
1352
|
-
this.showFeedbackComponent = false;
|
|
1353
|
-
}
|
|
1354
|
-
},
|
|
1355
|
-
currentValue: function currentValue() {
|
|
1356
|
-
if (this.$props.autosuggest && this.$props.enableAI) {
|
|
1357
|
-
this.handleTextAreaHeightChange();
|
|
1358
|
-
}
|
|
1359
1011
|
}
|
|
1360
1012
|
},
|
|
1361
1013
|
methods: {
|
|
@@ -1381,14 +1033,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1381
1033
|
data: this.normalizedSuggestions,
|
|
1382
1034
|
rawData: this.rawData,
|
|
1383
1035
|
value: currentValue,
|
|
1384
|
-
resultStats: this.stats
|
|
1385
|
-
AIData: {
|
|
1386
|
-
question: this.AIResponse && this.AIResponse.response && this.AIResponse.response.question,
|
|
1387
|
-
answer: this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.text,
|
|
1388
|
-
documentIds: this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.documentIds || [],
|
|
1389
|
-
showAIScreen: this.showAIScreen,
|
|
1390
|
-
sources: this.getAISourceObjects()
|
|
1391
|
-
}
|
|
1036
|
+
resultStats: this.stats
|
|
1392
1037
|
};
|
|
1393
1038
|
return index.getComponent(data, this);
|
|
1394
1039
|
},
|
|
@@ -1412,7 +1057,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1412
1057
|
}
|
|
1413
1058
|
},
|
|
1414
1059
|
setValue: function setValue(value, isDefaultValue, props, cause, toggleIsOpen, categoryValue) {
|
|
1415
|
-
var
|
|
1060
|
+
var _this = this;
|
|
1416
1061
|
if (isDefaultValue === void 0) {
|
|
1417
1062
|
isDefaultValue = false;
|
|
1418
1063
|
}
|
|
@@ -1426,65 +1071,60 @@ var SearchBox = vue.defineComponent({
|
|
|
1426
1071
|
categoryValue = undefined;
|
|
1427
1072
|
}
|
|
1428
1073
|
var performUpdate = function performUpdate() {
|
|
1429
|
-
if (
|
|
1074
|
+
if (_this.$options.isTagsMode && isEqual(value, _this.selectedTags)) {
|
|
1430
1075
|
return;
|
|
1431
1076
|
}
|
|
1432
|
-
if (
|
|
1433
|
-
if (Array.isArray(
|
|
1077
|
+
if (_this.$options.isTagsMode && cause === reactivecore.causes.SUGGESTION_SELECT) {
|
|
1078
|
+
if (Array.isArray(_this.selectedTags) && _this.selectedTags.length) {
|
|
1434
1079
|
// check if value already present in selectedTags
|
|
1435
|
-
if (typeof value === 'string' &&
|
|
1436
|
-
|
|
1080
|
+
if (typeof value === 'string' && _this.selectedTags.includes(value)) {
|
|
1081
|
+
_this.isOpen = false;
|
|
1437
1082
|
return;
|
|
1438
1083
|
}
|
|
1439
|
-
|
|
1084
|
+
_this.selectedTags = [].concat(_this.selectedTags);
|
|
1440
1085
|
if (typeof value === 'string' && !!value) {
|
|
1441
|
-
|
|
1442
|
-
} else if (Array.isArray(value) && !isEqual(
|
|
1443
|
-
|
|
1086
|
+
_this.selectedTags.push(value);
|
|
1087
|
+
} else if (Array.isArray(value) && !isEqual(_this.selectedTags, value)) {
|
|
1088
|
+
_this.selectedTags = value;
|
|
1444
1089
|
}
|
|
1445
1090
|
} else if (value) {
|
|
1446
|
-
|
|
1091
|
+
_this.selectedTags = typeof value !== 'string' ? value : [].concat(value);
|
|
1447
1092
|
}
|
|
1448
|
-
|
|
1093
|
+
_this.currentValue = '';
|
|
1449
1094
|
} else {
|
|
1450
|
-
|
|
1095
|
+
_this.currentValue = index.decodeHtml(value);
|
|
1451
1096
|
}
|
|
1452
1097
|
var queryHandlerValue = value;
|
|
1453
|
-
if (
|
|
1454
|
-
queryHandlerValue = Array.isArray(
|
|
1098
|
+
if (_this.$options.isTagsMode && cause === reactivecore.causes.SUGGESTION_SELECT) {
|
|
1099
|
+
queryHandlerValue = Array.isArray(_this.selectedTags) && _this.selectedTags.length ? _this.selectedTags : undefined;
|
|
1455
1100
|
}
|
|
1456
1101
|
if (isDefaultValue) {
|
|
1457
|
-
if (
|
|
1102
|
+
if (_this.$props.autosuggest) {
|
|
1458
1103
|
if (toggleIsOpen) {
|
|
1459
|
-
|
|
1104
|
+
_this.isOpen = false;
|
|
1460
1105
|
}
|
|
1461
|
-
if (typeof
|
|
1462
|
-
enableAI: true
|
|
1463
|
-
} : {});
|
|
1106
|
+
if (typeof _this.currentValue === 'string') _this.triggerDefaultQuery(_this.currentValue);
|
|
1464
1107
|
} // in case of strict selection only SUGGESTION_SELECT should be able
|
|
1465
1108
|
// to set the query otherwise the value should reset
|
|
1466
1109
|
if (props.strictSelection) {
|
|
1467
|
-
if (cause === reactivecore.causes.SUGGESTION_SELECT || (
|
|
1468
|
-
|
|
1110
|
+
if (cause === reactivecore.causes.SUGGESTION_SELECT || (_this.$options.isTagsMode ? _this.selectedTags.length === 0 : value === '')) {
|
|
1111
|
+
_this.triggerCustomQuery(queryHandlerValue, _this.$options.isTagsMode ? undefined : categoryValue);
|
|
1469
1112
|
} else {
|
|
1470
|
-
|
|
1113
|
+
_this.setValue('', true);
|
|
1471
1114
|
}
|
|
1472
1115
|
} else if (props.value === undefined || cause === reactivecore.causes.SUGGESTION_SELECT || cause === reactivecore.causes.CLEAR_VALUE) {
|
|
1473
|
-
|
|
1116
|
+
_this.triggerCustomQuery(queryHandlerValue, _this.$options.isTagsMode ? undefined : categoryValue);
|
|
1474
1117
|
}
|
|
1475
1118
|
} else {
|
|
1476
1119
|
// debounce for handling text while typing
|
|
1477
|
-
|
|
1120
|
+
_this.handleTextChange(value, cause);
|
|
1478
1121
|
}
|
|
1479
|
-
|
|
1480
|
-
|
|
1122
|
+
_this.$emit('valueChange', value);
|
|
1123
|
+
_this.$emit('value-change', value);
|
|
1481
1124
|
};
|
|
1482
1125
|
checkValueChange(props.componentId, value, props.beforeValueChange, performUpdate);
|
|
1483
1126
|
},
|
|
1484
|
-
triggerDefaultQuery: function triggerDefaultQuery(paramValue
|
|
1485
|
-
if (meta === void 0) {
|
|
1486
|
-
meta = {};
|
|
1487
|
-
}
|
|
1127
|
+
triggerDefaultQuery: function triggerDefaultQuery(paramValue) {
|
|
1488
1128
|
if (!this.$props.autosuggest) {
|
|
1489
1129
|
return;
|
|
1490
1130
|
}
|
|
@@ -1503,8 +1143,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1503
1143
|
componentId: this.internalComponent,
|
|
1504
1144
|
query: query,
|
|
1505
1145
|
value: value,
|
|
1506
|
-
componentType: constants.componentTypes.searchBox
|
|
1507
|
-
meta: meta
|
|
1146
|
+
componentType: constants.componentTypes.searchBox
|
|
1508
1147
|
});
|
|
1509
1148
|
},
|
|
1510
1149
|
triggerCustomQuery: function triggerCustomQuery(paramValue, categoryValue) {
|
|
@@ -1588,8 +1227,8 @@ var SearchBox = vue.defineComponent({
|
|
|
1588
1227
|
this.recordSuggestionClick(searchPosition, docId);
|
|
1589
1228
|
},
|
|
1590
1229
|
clearValue: function clearValue() {
|
|
1591
|
-
this.setValue('', false, this.$props,
|
|
1592
|
-
this.onValueSelectedHandler('',
|
|
1230
|
+
this.setValue('', false, this.$props, reactivecore.causes.CLEAR_VALUE, false);
|
|
1231
|
+
this.onValueSelectedHandler('', reactivecore.causes.CLEAR_VALUE);
|
|
1593
1232
|
},
|
|
1594
1233
|
handleKeyDown: function handleKeyDown(event, highlightedIndex) {
|
|
1595
1234
|
if (highlightedIndex === void 0) {
|
|
@@ -1600,12 +1239,9 @@ var SearchBox = vue.defineComponent({
|
|
|
1600
1239
|
if (this.$props.autosuggest === false) {
|
|
1601
1240
|
this.enterButtonOnClick();
|
|
1602
1241
|
} else if (highlightedIndex === null) {
|
|
1603
|
-
this.setValue(event.target.value, true, this.$props, this.$options.isTagsMode ? reactivecore.causes.SUGGESTION_SELECT : undefined
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
if (this.$props.enableAI && !this.showAIScreen) {
|
|
1607
|
-
this.showAIScreen = true;
|
|
1608
|
-
}
|
|
1242
|
+
this.setValue(event.target.value, true, this.$props, this.$options.isTagsMode ? reactivecore.causes.SUGGESTION_SELECT : undefined // to handle tags
|
|
1243
|
+
);
|
|
1244
|
+
|
|
1609
1245
|
this.onValueSelectedHandler(event.target.value, reactivecore.causes.ENTER_PRESS);
|
|
1610
1246
|
}
|
|
1611
1247
|
}
|
|
@@ -1615,21 +1251,18 @@ var SearchBox = vue.defineComponent({
|
|
|
1615
1251
|
this.$emit('key-down', event, this.triggerQuery);
|
|
1616
1252
|
},
|
|
1617
1253
|
onInputChange: function onInputChange(e) {
|
|
1618
|
-
var
|
|
1254
|
+
var _this2 = this;
|
|
1619
1255
|
var inputValue = e.target.value;
|
|
1620
1256
|
if (!this.$data.isOpen && this.$props.autosuggest) {
|
|
1621
1257
|
this.isOpen = true;
|
|
1622
1258
|
}
|
|
1623
|
-
if (this.showAIScreen) {
|
|
1624
|
-
this.showAIScreen = false;
|
|
1625
|
-
}
|
|
1626
1259
|
var value = this.$props.value;
|
|
1627
1260
|
if (value === undefined) {
|
|
1628
|
-
this.setValue(inputValue, false, this.$props, undefined);
|
|
1261
|
+
this.setValue(inputValue, false, this.$props, inputValue === '' ? reactivecore.causes.CLEAR_VALUE : undefined);
|
|
1629
1262
|
} else {
|
|
1630
1263
|
this.$emit('change', inputValue, function (_ref3) {
|
|
1631
1264
|
var isOpen = _ref3.isOpen;
|
|
1632
|
-
return
|
|
1265
|
+
return _this2.triggerQuery({
|
|
1633
1266
|
defaultQuery: true,
|
|
1634
1267
|
customQuery: true,
|
|
1635
1268
|
value: inputValue,
|
|
@@ -1639,10 +1272,8 @@ var SearchBox = vue.defineComponent({
|
|
|
1639
1272
|
}
|
|
1640
1273
|
},
|
|
1641
1274
|
onSuggestionSelected: function onSuggestionSelected(suggestion) {
|
|
1642
|
-
var
|
|
1643
|
-
|
|
1644
|
-
this.showAIScreen = true;
|
|
1645
|
-
}
|
|
1275
|
+
var _this3 = this;
|
|
1276
|
+
this.isOpen = false;
|
|
1646
1277
|
var value = this.$props.value;
|
|
1647
1278
|
// Record analytics for selected suggestions
|
|
1648
1279
|
this.triggerClickAnalytics(suggestion._click_id);
|
|
@@ -1662,10 +1293,10 @@ var SearchBox = vue.defineComponent({
|
|
|
1662
1293
|
this.setValue(emitValue, true, this.$props, reactivecore.causes.SUGGESTION_SELECT, false, suggestion._category);
|
|
1663
1294
|
this.$emit('change', emitValue, function (_ref4) {
|
|
1664
1295
|
var isOpen = _ref4.isOpen;
|
|
1665
|
-
return
|
|
1296
|
+
return _this3.triggerQuery(_rollupPluginBabelHelpers._extends({
|
|
1666
1297
|
isOpen: isOpen,
|
|
1667
1298
|
value: emitValue
|
|
1668
|
-
}, !
|
|
1299
|
+
}, !_this3.$options.isTagsMode && {
|
|
1669
1300
|
categoryValue: suggestion._category
|
|
1670
1301
|
}));
|
|
1671
1302
|
});
|
|
@@ -1699,26 +1330,9 @@ var SearchBox = vue.defineComponent({
|
|
|
1699
1330
|
}
|
|
1700
1331
|
return null;
|
|
1701
1332
|
},
|
|
1702
|
-
renderErrorComponent: function renderErrorComponent(
|
|
1703
|
-
var
|
|
1704
|
-
if (isAIError === void 0) {
|
|
1705
|
-
isAIError = false;
|
|
1706
|
-
}
|
|
1333
|
+
renderErrorComponent: function renderErrorComponent() {
|
|
1334
|
+
var _this4 = this;
|
|
1707
1335
|
var renderError = this.$slots.renderError || this.$props.renderError;
|
|
1708
|
-
if (isAIError) {
|
|
1709
|
-
if (this.showAIScreen && this.AIResponseError && !this.isAIResponseLoading) {
|
|
1710
|
-
if (renderError) {
|
|
1711
|
-
return vue.createVNode("div", {
|
|
1712
|
-
"class": "--ai-answer-error-container " + (getClassName$1(this.$props.innerClass, 'ai-error') || '')
|
|
1713
|
-
}, [renderError(this.AIResponseError)]);
|
|
1714
|
-
}
|
|
1715
|
-
return vue.createVNode("div", {
|
|
1716
|
-
"class": "--ai-answer-error-container " + (getClassName$1(this.$props.innerClass, 'ai-error') || '')
|
|
1717
|
-
}, [vue.createVNode("div", {
|
|
1718
|
-
"class": "--default-error-element"
|
|
1719
|
-
}, [vue.createVNode("span", null, [typeof this.AIResponseError === 'string' ? this.AIResponseError : this.AIResponseError.message ? this.AIResponseError.message : 'There was an error in generating the response.', this.AIResponseError.code ? "Code:\n\t\t\t\t\t\t\t" + this.AIResponseError.code : ''])])]);
|
|
1720
|
-
}
|
|
1721
|
-
}
|
|
1722
1336
|
if (this.error && renderError && this.$data.currentValue && !this.isLoading) {
|
|
1723
1337
|
return vue.createVNode(SuggestionWrapper, {
|
|
1724
1338
|
"innerClass": this.$props.innerClass,
|
|
@@ -1727,7 +1341,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1727
1341
|
"themePreset": this.themePreset
|
|
1728
1342
|
}, {
|
|
1729
1343
|
"default": function _default() {
|
|
1730
|
-
return [index.isFunction(renderError) ? renderError(
|
|
1344
|
+
return [index.isFunction(renderError) ? renderError(_this4.error) : renderError];
|
|
1731
1345
|
}
|
|
1732
1346
|
});
|
|
1733
1347
|
}
|
|
@@ -1792,7 +1406,6 @@ var SearchBox = vue.defineComponent({
|
|
|
1792
1406
|
return null;
|
|
1793
1407
|
},
|
|
1794
1408
|
enterButtonOnClick: function enterButtonOnClick() {
|
|
1795
|
-
this.showAIScreen = false;
|
|
1796
1409
|
this.triggerQuery({
|
|
1797
1410
|
isOpen: false,
|
|
1798
1411
|
value: this.currentValue,
|
|
@@ -1800,7 +1413,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1800
1413
|
});
|
|
1801
1414
|
},
|
|
1802
1415
|
renderEnterButtonElement: function renderEnterButtonElement() {
|
|
1803
|
-
var
|
|
1416
|
+
var _this5 = this;
|
|
1804
1417
|
var _this$$props2 = this.$props,
|
|
1805
1418
|
enterButton = _this$$props2.enterButton,
|
|
1806
1419
|
innerClass = _this$$props2.innerClass;
|
|
@@ -1808,12 +1421,12 @@ var SearchBox = vue.defineComponent({
|
|
|
1808
1421
|
if (enterButton) {
|
|
1809
1422
|
var getEnterButtonMarkup = function getEnterButtonMarkup() {
|
|
1810
1423
|
if (renderEnterButton) {
|
|
1811
|
-
return renderEnterButton(
|
|
1424
|
+
return renderEnterButton(_this5.enterButtonOnClick);
|
|
1812
1425
|
}
|
|
1813
1426
|
return vue.createVNode(Button.Button, {
|
|
1814
1427
|
"class": "enter-btn " + getClassName$1(innerClass, 'enter-button'),
|
|
1815
1428
|
"primary": true,
|
|
1816
|
-
"onClick":
|
|
1429
|
+
"onClick": _this5.enterButtonOnClick
|
|
1817
1430
|
}, {
|
|
1818
1431
|
"default": function _default() {
|
|
1819
1432
|
return [vue.createTextVNode("Search")];
|
|
@@ -1827,7 +1440,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1827
1440
|
return null;
|
|
1828
1441
|
},
|
|
1829
1442
|
renderIcons: function renderIcons() {
|
|
1830
|
-
var
|
|
1443
|
+
var _this6 = this;
|
|
1831
1444
|
var _slot3, _slot4, _slot5;
|
|
1832
1445
|
var _this$$props3 = this.$props,
|
|
1833
1446
|
iconPosition = _this$$props3.iconPosition,
|
|
@@ -1844,21 +1457,21 @@ var SearchBox = vue.defineComponent({
|
|
|
1844
1457
|
}, {
|
|
1845
1458
|
"default": function _default() {
|
|
1846
1459
|
return [currentValue && showClear && vue.createVNode(DropDown.IconWrapper, {
|
|
1847
|
-
"onClick":
|
|
1460
|
+
"onClick": _this6.clearValue,
|
|
1848
1461
|
"showIcon": showIcon,
|
|
1849
1462
|
"isClearIcon": true
|
|
1850
|
-
}, _isSlot(_slot3 =
|
|
1463
|
+
}, _isSlot(_slot3 = _this6.renderCancelIcon()) ? _slot3 : {
|
|
1851
1464
|
"default": function _default() {
|
|
1852
1465
|
return [_slot3];
|
|
1853
1466
|
}
|
|
1854
1467
|
}), showVoiceSearch && vue.createVNode(Mic, {
|
|
1855
1468
|
"getInstance": getMicInstance,
|
|
1856
1469
|
"render": renderMic,
|
|
1857
|
-
"handleResult":
|
|
1470
|
+
"handleResult": _this6.handleVoiceResults,
|
|
1858
1471
|
"className": getClassName$1(innerClass, 'mic') || null
|
|
1859
1472
|
}, null), iconPosition === 'right' && showIcon && vue.createVNode(DropDown.IconWrapper, {
|
|
1860
|
-
"onClick":
|
|
1861
|
-
}, _isSlot(_slot4 =
|
|
1473
|
+
"onClick": _this6.handleSearchIconClick
|
|
1474
|
+
}, _isSlot(_slot4 = _this6.renderIcon()) ? _slot4 : {
|
|
1862
1475
|
"default": function _default() {
|
|
1863
1476
|
return [_slot4];
|
|
1864
1477
|
}
|
|
@@ -1870,8 +1483,8 @@ var SearchBox = vue.defineComponent({
|
|
|
1870
1483
|
}, {
|
|
1871
1484
|
"default": function _default() {
|
|
1872
1485
|
return [iconPosition === 'left' && showIcon && vue.createVNode(DropDown.IconWrapper, {
|
|
1873
|
-
"onClick":
|
|
1874
|
-
}, _isSlot(_slot5 =
|
|
1486
|
+
"onClick": _this6.handleSearchIconClick
|
|
1487
|
+
}, _isSlot(_slot5 = _this6.renderIcon()) ? _slot5 : {
|
|
1875
1488
|
"default": function _default() {
|
|
1876
1489
|
return [_slot5];
|
|
1877
1490
|
}
|
|
@@ -1880,17 +1493,17 @@ var SearchBox = vue.defineComponent({
|
|
|
1880
1493
|
})]);
|
|
1881
1494
|
},
|
|
1882
1495
|
focusSearchBox: function focusSearchBox(event) {
|
|
1883
|
-
var _this$$
|
|
1496
|
+
var _this$$refs, _this$$refs$this$$pro;
|
|
1884
1497
|
var elt = event.target || event.srcElement;
|
|
1885
1498
|
var tagName = elt.tagName;
|
|
1886
1499
|
if (elt.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA') {
|
|
1887
1500
|
// already in an input
|
|
1888
1501
|
return;
|
|
1889
1502
|
}
|
|
1890
|
-
(_this$$
|
|
1503
|
+
(_this$$refs = this.$refs) == null ? void 0 : (_this$$refs$this$$pro = _this$$refs[this.$props.innerRef]) == null ? void 0 : _this$$refs$this$$pro.focus(); // eslint-disable-line
|
|
1891
1504
|
},
|
|
1892
1505
|
listenForFocusShortcuts: function listenForFocusShortcuts() {
|
|
1893
|
-
var
|
|
1506
|
+
var _this7 = this;
|
|
1894
1507
|
var _this$$props$focusSho = this.$props.focusShortcuts,
|
|
1895
1508
|
focusShortcuts = _this$$props$focusSho === void 0 ? ['/'] : _this$$props$focusSho;
|
|
1896
1509
|
if (index.isEmpty(focusShortcuts)) {
|
|
@@ -1905,7 +1518,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1905
1518
|
function (event, handler) {
|
|
1906
1519
|
// Prevent the default refresh event under WINDOWS system
|
|
1907
1520
|
event.preventDefault();
|
|
1908
|
-
|
|
1521
|
+
_this7.focusSearchBox(event);
|
|
1909
1522
|
});
|
|
1910
1523
|
|
|
1911
1524
|
// if one of modifier keys are used, they are handled below
|
|
@@ -1915,7 +1528,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1915
1528
|
for (var index$1 = 0; index$1 < modifierKeys.length; index$1 += 1) {
|
|
1916
1529
|
var element = modifierKeys[index$1];
|
|
1917
1530
|
if (hotkeys[element]) {
|
|
1918
|
-
|
|
1531
|
+
_this7.focusSearchBox(event);
|
|
1919
1532
|
break;
|
|
1920
1533
|
}
|
|
1921
1534
|
}
|
|
@@ -1928,10 +1541,10 @@ var SearchBox = vue.defineComponent({
|
|
|
1928
1541
|
this.triggerDefaultQuery(value);
|
|
1929
1542
|
},
|
|
1930
1543
|
renderAutoFill: function renderAutoFill(suggestion) {
|
|
1931
|
-
var
|
|
1544
|
+
var _this8 = this;
|
|
1932
1545
|
var handleAutoFillClick = function handleAutoFillClick(e) {
|
|
1933
1546
|
e.stopPropagation();
|
|
1934
|
-
|
|
1547
|
+
_this8.onAutofillClick(suggestion);
|
|
1935
1548
|
};
|
|
1936
1549
|
/* 👇 avoid showing autofill for category suggestions👇 */
|
|
1937
1550
|
return suggestion._category ? null : vue.createVNode(AutoFillSvg, {
|
|
@@ -1939,7 +1552,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1939
1552
|
}, null);
|
|
1940
1553
|
},
|
|
1941
1554
|
renderTag: function renderTag(item) {
|
|
1942
|
-
var
|
|
1555
|
+
var _this9 = this;
|
|
1943
1556
|
var innerClass = this.$props.innerClass;
|
|
1944
1557
|
return vue.createVNode(TagItem, {
|
|
1945
1558
|
"class": getClassName$1(innerClass, 'selected-tag') || ''
|
|
@@ -1950,7 +1563,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1950
1563
|
"aria-label": "delete-tag",
|
|
1951
1564
|
"class": "close-icon",
|
|
1952
1565
|
"onClick": function onClick() {
|
|
1953
|
-
return
|
|
1566
|
+
return _this9.clearTag(item);
|
|
1954
1567
|
}
|
|
1955
1568
|
}, [vue.createVNode(DropDown.CancelSvg, null, null)])];
|
|
1956
1569
|
}
|
|
@@ -1973,7 +1586,7 @@ var SearchBox = vue.defineComponent({
|
|
|
1973
1586
|
}
|
|
1974
1587
|
},
|
|
1975
1588
|
renderTags: function renderTags() {
|
|
1976
|
-
var
|
|
1589
|
+
var _this10 = this;
|
|
1977
1590
|
if (!Array.isArray(this.selectedTags)) {
|
|
1978
1591
|
return null;
|
|
1979
1592
|
}
|
|
@@ -1987,189 +1600,25 @@ var SearchBox = vue.defineComponent({
|
|
|
1987
1600
|
}) : vue.createVNode(TagsContainer, null, {
|
|
1988
1601
|
"default": function _default() {
|
|
1989
1602
|
return [tagsList.map(function (item) {
|
|
1990
|
-
return
|
|
1603
|
+
return _this10.renderTag(item);
|
|
1991
1604
|
}), shouldRenderClearAllTag && vue.createVNode(TagItem, {
|
|
1992
|
-
"class": getClassName$1(
|
|
1605
|
+
"class": getClassName$1(_this10.$props.innerClass, 'selected-tag') || ''
|
|
1993
1606
|
}, {
|
|
1994
1607
|
"default": function _default() {
|
|
1995
1608
|
return [vue.createVNode("span", null, [vue.createTextVNode("Clear All")]), vue.createVNode("span", {
|
|
1996
1609
|
"role": "img",
|
|
1997
1610
|
"aria-label": "delete-tag",
|
|
1998
1611
|
"class": "close-icon",
|
|
1999
|
-
"onClick":
|
|
1612
|
+
"onClick": _this10.clearAllTags
|
|
2000
1613
|
}, [vue.createVNode(DropDown.CancelSvg, null, null)])];
|
|
2001
1614
|
}
|
|
2002
1615
|
})];
|
|
2003
1616
|
}
|
|
2004
1617
|
});
|
|
2005
|
-
},
|
|
2006
|
-
getAISourceObjects: function getAISourceObjects() {
|
|
2007
|
-
var localCache = helper.getObjectFromLocalStorage(constants.AI_LOCAL_CACHE_KEY) && helper.getObjectFromLocalStorage(constants.AI_LOCAL_CACHE_KEY)[this.componentId];
|
|
2008
|
-
var sourceObjects = [];
|
|
2009
|
-
if (!this.AIResponse) return sourceObjects;
|
|
2010
|
-
var docIds = this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.documentIds || [];
|
|
2011
|
-
if (localCache && localCache.meta && localCache.meta.hits && localCache.meta.hits.hits) {
|
|
2012
|
-
docIds.forEach(function (id) {
|
|
2013
|
-
var foundSourceObj = localCache.meta.hits.hits.find(function (hit) {
|
|
2014
|
-
return hit._id === id;
|
|
2015
|
-
}) || {};
|
|
2016
|
-
if (foundSourceObj) {
|
|
2017
|
-
var _foundSourceObj$_sour = foundSourceObj._source,
|
|
2018
|
-
_source = _foundSourceObj$_sour === void 0 ? {} : _foundSourceObj$_sour,
|
|
2019
|
-
rest = _rollupPluginBabelHelpers._objectWithoutPropertiesLoose(foundSourceObj, _excluded);
|
|
2020
|
-
sourceObjects.push(_rollupPluginBabelHelpers._extends({}, rest, _source));
|
|
2021
|
-
}
|
|
2022
|
-
});
|
|
2023
|
-
} else {
|
|
2024
|
-
sourceObjects.push.apply(sourceObjects, docIds.map(function (id) {
|
|
2025
|
-
return {
|
|
2026
|
-
_id: id
|
|
2027
|
-
};
|
|
2028
|
-
}));
|
|
2029
|
-
}
|
|
2030
|
-
return sourceObjects;
|
|
2031
|
-
},
|
|
2032
|
-
renderAIScreenLoader: function renderAIScreenLoader() {
|
|
2033
|
-
var _this$$props$AIUIConf = this.$props.AIUIConfig,
|
|
2034
|
-
AIUIConfig = _this$$props$AIUIConf === void 0 ? {} : _this$$props$AIUIConf;
|
|
2035
|
-
var _ref5 = AIUIConfig || {},
|
|
2036
|
-
loaderMessage = _ref5.loaderMessage;
|
|
2037
|
-
if (loaderMessage) {
|
|
2038
|
-
return loaderMessage;
|
|
2039
|
-
}
|
|
2040
|
-
if (this.$slots.AILoaderMessage) {
|
|
2041
|
-
return this.$slots.AILoaderMessage();
|
|
2042
|
-
}
|
|
2043
|
-
return vue.createVNode(HorizontalSkeletonLoader, null, null);
|
|
2044
|
-
},
|
|
2045
|
-
renderAIScreenFooter: function renderAIScreenFooter() {
|
|
2046
|
-
var _slot6;
|
|
2047
|
-
var _this12 = this;
|
|
2048
|
-
var _this$$props$AIUIConf2 = this.$props.AIUIConfig,
|
|
2049
|
-
AIUIConfig = _this$$props$AIUIConf2 === void 0 ? {} : _this$$props$AIUIConf2;
|
|
2050
|
-
var _ref6 = AIUIConfig || {},
|
|
2051
|
-
_ref6$showSourceDocum = _ref6.showSourceDocuments,
|
|
2052
|
-
showSourceDocuments = _ref6$showSourceDocum === void 0 ? true : _ref6$showSourceDocum,
|
|
2053
|
-
_ref6$sourceDocumentL = _ref6.sourceDocumentLabel,
|
|
2054
|
-
sourceDocumentLabel = _ref6$sourceDocumentL === void 0 ? '_id' : _ref6$sourceDocumentL,
|
|
2055
|
-
_ref6$onSourceClick = _ref6.onSourceClick,
|
|
2056
|
-
onSourceClick = _ref6$onSourceClick === void 0 ? function () {} : _ref6$onSourceClick;
|
|
2057
|
-
return showSourceDocuments && this.showAIScreenFooter && this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.documentIds ? vue.createVNode(Footer, {
|
|
2058
|
-
"themePreset": this.$props.themePreset
|
|
2059
|
-
}, {
|
|
2060
|
-
"default": function _default() {
|
|
2061
|
-
return [vue.createTextVNode("Summary generated using the following sources:"), ' ', vue.createVNode(SourceTags, null, _isSlot(_slot6 = _this12.getAISourceObjects().map(function (el) {
|
|
2062
|
-
return vue.createVNode(Button.Button, {
|
|
2063
|
-
"class": "--ai-source-tag " + (getClassName$1(_this12.$props.innerClass, 'ai-source-tag') || ''),
|
|
2064
|
-
"title": el[sourceDocumentLabel],
|
|
2065
|
-
"info": true,
|
|
2066
|
-
"onClick": function onClick() {
|
|
2067
|
-
return onSourceClick && onSourceClick(el);
|
|
2068
|
-
}
|
|
2069
|
-
}, {
|
|
2070
|
-
"default": function _default() {
|
|
2071
|
-
return [el[sourceDocumentLabel]];
|
|
2072
|
-
}
|
|
2073
|
-
});
|
|
2074
|
-
})) ? _slot6 : {
|
|
2075
|
-
"default": function _default() {
|
|
2076
|
-
return [_slot6];
|
|
2077
|
-
}
|
|
2078
|
-
})];
|
|
2079
|
-
}
|
|
2080
|
-
}) : null;
|
|
2081
|
-
},
|
|
2082
|
-
renderAIScreen: function renderAIScreen() {
|
|
2083
|
-
var _this13 = this;
|
|
2084
|
-
var customAIRenderer = this.$props.renderAIAnswer || this.$slots.renderAIAnswer;
|
|
2085
|
-
if (customAIRenderer) {
|
|
2086
|
-
return customAIRenderer({
|
|
2087
|
-
question: this.AIResponse && this.AIResponse.response && this.AIResponse.response.question,
|
|
2088
|
-
answer: this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.text,
|
|
2089
|
-
documentIds: this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.documentIds || [],
|
|
2090
|
-
loading: this.isAIResponseLoading || this.isLoading,
|
|
2091
|
-
sources: this.getAISourceObjects(),
|
|
2092
|
-
error: this.AIResponseError
|
|
2093
|
-
});
|
|
2094
|
-
}
|
|
2095
|
-
if (this.isAIResponseLoading || this.isLoading) {
|
|
2096
|
-
return this.renderAIScreenLoader();
|
|
2097
|
-
}
|
|
2098
|
-
return vue.createVNode("div", null, [vue.createVNode(Answer, {
|
|
2099
|
-
"innerHTML": md.render(this.AIResponse && this.AIResponse.response && this.AIResponse.response.answer && this.AIResponse.response.answer.text)
|
|
2100
|
-
}, null), this.renderAIScreenFooter(), this.showFeedbackComponent && vue.createVNode("div", {
|
|
2101
|
-
"class": "" + (getClassName$1(this.$props.innerClass, 'ai-feedback') || '')
|
|
2102
|
-
}, [vue.createVNode(AIFeedback, {
|
|
2103
|
-
"overrideState": this.feedbackState,
|
|
2104
|
-
"hideUI": this.isAIResponseLoading || this.isLoading || !this.sessionIdFromStore,
|
|
2105
|
-
"key": this.sessionIdFromStore,
|
|
2106
|
-
"onFeedbackSubmit": function onFeedbackSubmit(useful, reason) {
|
|
2107
|
-
_this13.feedbackState = {
|
|
2108
|
-
isRecorded: true,
|
|
2109
|
-
feedbackType: useful ? 'positive' : 'negative'
|
|
2110
|
-
};
|
|
2111
|
-
_this13.recordAISessionUsefulness(_this13.sessionIdFromStore, {
|
|
2112
|
-
useful: useful,
|
|
2113
|
-
reason: reason
|
|
2114
|
-
});
|
|
2115
|
-
}
|
|
2116
|
-
}, null)])]);
|
|
2117
|
-
},
|
|
2118
|
-
handleTextAreaHeightChange: function handleTextAreaHeightChange() {
|
|
2119
|
-
var _this$$refs$this$$pro;
|
|
2120
|
-
var textArea = (_this$$refs$this$$pro = this.$refs[this.$props.innerRef]) == null ? void 0 : _this$$refs$this$$pro.$el;
|
|
2121
|
-
if (textArea) {
|
|
2122
|
-
textArea.style.height = '42px';
|
|
2123
|
-
var lineHeight = parseInt(getComputedStyle(textArea).lineHeight, 10);
|
|
2124
|
-
var maxHeight = lineHeight * 4; // max height for 3 lines
|
|
2125
|
-
var height = Math.min(textArea.scrollHeight, maxHeight);
|
|
2126
|
-
textArea.style.height = height + "px";
|
|
2127
|
-
textArea.style.overflowY = height === maxHeight ? 'auto' : 'hidden';
|
|
2128
|
-
var dropdownEle = this.$refs[_dropdownULRef];
|
|
2129
|
-
if (dropdownEle) {
|
|
2130
|
-
dropdownEle.style.top = height + "px";
|
|
2131
|
-
}
|
|
2132
|
-
}
|
|
2133
|
-
},
|
|
2134
|
-
askButtonOnClick: function askButtonOnClick() {
|
|
2135
|
-
this.showAIScreen = true;
|
|
2136
|
-
this.isOpen = true;
|
|
2137
|
-
this.triggerDefaultQuery(this.currentValue, {
|
|
2138
|
-
enableAI: true
|
|
2139
|
-
});
|
|
2140
|
-
},
|
|
2141
|
-
renderAskButtonElement: function renderAskButtonElement() {
|
|
2142
|
-
var _this14 = this;
|
|
2143
|
-
var _this$$props4 = this.$props,
|
|
2144
|
-
AIUIConfig = _this$$props4.AIUIConfig,
|
|
2145
|
-
innerClass = _this$$props4.innerClass;
|
|
2146
|
-
var _ref7 = AIUIConfig || {},
|
|
2147
|
-
askButton = _ref7.askButton;
|
|
2148
|
-
var renderAskButton = this.$slots.renderAskButton;
|
|
2149
|
-
if (askButton) {
|
|
2150
|
-
var getEnterButtonMarkup = function getEnterButtonMarkup() {
|
|
2151
|
-
if (renderAskButton) {
|
|
2152
|
-
return renderAskButton(_this14.askButtonOnClick);
|
|
2153
|
-
}
|
|
2154
|
-
return vue.createVNode(Button.Button, {
|
|
2155
|
-
"class": "enter-btn " + getClassName$1(innerClass, 'ask-button'),
|
|
2156
|
-
"info": true,
|
|
2157
|
-
"onClick": _this14.askButtonOnClick
|
|
2158
|
-
}, {
|
|
2159
|
-
"default": function _default() {
|
|
2160
|
-
return [vue.createTextVNode("Ask")];
|
|
2161
|
-
}
|
|
2162
|
-
});
|
|
2163
|
-
};
|
|
2164
|
-
return vue.createVNode("div", {
|
|
2165
|
-
"class": "enter-button-wrapper"
|
|
2166
|
-
}, [getEnterButtonMarkup()]);
|
|
2167
|
-
}
|
|
2168
|
-
return null;
|
|
2169
1618
|
}
|
|
2170
1619
|
},
|
|
2171
1620
|
render: function render() {
|
|
2172
|
-
var
|
|
1621
|
+
var _this11 = this;
|
|
2173
1622
|
var expandSuggestionsContainer = this.$props.expandSuggestionsContainer;
|
|
2174
1623
|
var _this$$slots = this.$slots,
|
|
2175
1624
|
recentSearchesIcon = _this$$slots.recentSearchesIcon,
|
|
@@ -2180,26 +1629,26 @@ var SearchBox = vue.defineComponent({
|
|
|
2180
1629
|
"class": this.$props.className
|
|
2181
1630
|
}, {
|
|
2182
1631
|
"default": function _default() {
|
|
2183
|
-
return [
|
|
2184
|
-
"class": getClassName$1(
|
|
1632
|
+
return [_this11.$props.title && vue.createVNode(Title.Title, {
|
|
1633
|
+
"class": getClassName$1(_this11.$props.innerClass, 'title') || ''
|
|
2185
1634
|
}, {
|
|
2186
1635
|
"default": function _default() {
|
|
2187
|
-
return [
|
|
1636
|
+
return [_this11.$props.title];
|
|
2188
1637
|
}
|
|
2189
|
-
}),
|
|
2190
|
-
"id":
|
|
2191
|
-
"handleChange":
|
|
2192
|
-
"handleMouseup":
|
|
2193
|
-
"isOpen":
|
|
1638
|
+
}), _this11.$props.autosuggest ? vue.createVNode(DropDown.Downshift, {
|
|
1639
|
+
"id": _this11.$props.componentId + "-downshift",
|
|
1640
|
+
"handleChange": _this11.onSuggestionSelected,
|
|
1641
|
+
"handleMouseup": _this11.handleStateChange,
|
|
1642
|
+
"isOpen": _this11.$data.isOpen
|
|
2194
1643
|
}, {
|
|
2195
|
-
"default": function _default(
|
|
2196
|
-
var getInputEvents =
|
|
2197
|
-
getInputProps =
|
|
2198
|
-
getItemProps =
|
|
2199
|
-
getItemEvents =
|
|
2200
|
-
isOpen =
|
|
2201
|
-
highlightedIndex =
|
|
2202
|
-
setHighlightedIndex =
|
|
1644
|
+
"default": function _default(_ref5) {
|
|
1645
|
+
var getInputEvents = _ref5.getInputEvents,
|
|
1646
|
+
getInputProps = _ref5.getInputProps,
|
|
1647
|
+
getItemProps = _ref5.getItemProps,
|
|
1648
|
+
getItemEvents = _ref5.getItemEvents,
|
|
1649
|
+
isOpen = _ref5.isOpen,
|
|
1650
|
+
highlightedIndex = _ref5.highlightedIndex,
|
|
1651
|
+
setHighlightedIndex = _ref5.setHighlightedIndex;
|
|
2203
1652
|
var renderSuggestionsDropdown = function renderSuggestionsDropdown() {
|
|
2204
1653
|
var getIcon = function getIcon(iconType) {
|
|
2205
1654
|
switch (iconType) {
|
|
@@ -2211,21 +1660,14 @@ var SearchBox = vue.defineComponent({
|
|
|
2211
1660
|
return null;
|
|
2212
1661
|
}
|
|
2213
1662
|
};
|
|
2214
|
-
return vue.createVNode("div", null, [
|
|
1663
|
+
return vue.createVNode("div", null, [_this11.hasCustomRenderer && _this11.getComponent({
|
|
2215
1664
|
isOpen: isOpen,
|
|
2216
1665
|
getItemProps: getItemProps,
|
|
2217
1666
|
getItemEvents: getItemEvents,
|
|
2218
1667
|
highlightedIndex: highlightedIndex
|
|
2219
|
-
}),
|
|
2220
|
-
"class": Input.suggestions(
|
|
2221
|
-
|
|
2222
|
-
}, [_this15.showAIScreen && vue.createVNode(SearchBoxAISection, {
|
|
2223
|
-
"themePreset": _this15.$props.themePreset
|
|
2224
|
-
}, {
|
|
2225
|
-
"default": function _default() {
|
|
2226
|
-
return [_this15.renderAIScreen(), ' ', _this15.renderErrorComponent(true)];
|
|
2227
|
-
}
|
|
2228
|
-
}), !_this15.showAIScreen && _this15.normalizedSuggestions.map(function (item, index) {
|
|
1668
|
+
}), _this11.renderErrorComponent(), !_this11.hasCustomRenderer && isOpen && hasSuggestions ? vue.createVNode("ul", {
|
|
1669
|
+
"class": Input.suggestions(_this11.themePreset, _this11.theme) + " " + getClassName$1(_this11.$props.innerClass, 'list')
|
|
1670
|
+
}, [_this11.normalizedSuggestions.map(function (item, index) {
|
|
2229
1671
|
return renderItem ? vue.createVNode("li", vue.mergeProps(getItemProps({
|
|
2230
1672
|
item: item
|
|
2231
1673
|
}), getItemEvents({
|
|
@@ -2233,7 +1675,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2233
1675
|
}), {
|
|
2234
1676
|
"key": index + 1 + "-" + item.value,
|
|
2235
1677
|
"style": {
|
|
2236
|
-
backgroundColor:
|
|
1678
|
+
backgroundColor: _this11.getBackgroundColor(highlightedIndex, index),
|
|
2237
1679
|
justifyContent: 'flex-start',
|
|
2238
1680
|
alignItems: 'center'
|
|
2239
1681
|
}
|
|
@@ -2244,7 +1686,7 @@ var SearchBox = vue.defineComponent({
|
|
|
2244
1686
|
})), {
|
|
2245
1687
|
"key": index + 1 + "-" + item.value,
|
|
2246
1688
|
"style": {
|
|
2247
|
-
backgroundColor:
|
|
1689
|
+
backgroundColor: _this11.getBackgroundColor(highlightedIndex, index),
|
|
2248
1690
|
justifyContent: 'flex-start',
|
|
2249
1691
|
alignItems: 'center'
|
|
2250
1692
|
}
|
|
@@ -2254,133 +1696,97 @@ var SearchBox = vue.defineComponent({
|
|
|
2254
1696
|
display: 'flex'
|
|
2255
1697
|
}
|
|
2256
1698
|
}, [vue.createVNode(CustomSvg, {
|
|
2257
|
-
"className": getClassName$1(
|
|
1699
|
+
"className": getClassName$1(_this11.$props.innerClass, item._suggestion_type + "-search-icon") || null,
|
|
2258
1700
|
"icon": getIcon(item._suggestion_type),
|
|
2259
1701
|
"type": item._suggestion_type + "-search-icon"
|
|
2260
1702
|
}, null)]), vue.createVNode(SuggestionItem, {
|
|
2261
|
-
"currentValue":
|
|
1703
|
+
"currentValue": _this11.currentValue,
|
|
2262
1704
|
"suggestion": item
|
|
2263
|
-
}, null),
|
|
2264
|
-
})]) :
|
|
1705
|
+
}, null), _this11.renderAutoFill(item)]);
|
|
1706
|
+
})]) : _this11.renderNoSuggestions(_this11.normalizedSuggestions)]);
|
|
2265
1707
|
};
|
|
2266
1708
|
return vue.createVNode("div", {
|
|
2267
1709
|
"class": Input.suggestionsContainer
|
|
2268
1710
|
}, [vue.createVNode(InputGroup, null, {
|
|
2269
1711
|
"default": function _default() {
|
|
2270
|
-
return [
|
|
1712
|
+
return [_this11.renderInputAddonBefore(), vue.createVNode(DropDown.InputWrapper, null, {
|
|
2271
1713
|
"default": function _default() {
|
|
2272
|
-
return [
|
|
2273
|
-
onInput:
|
|
1714
|
+
return [vue.createVNode(Input.Input, vue.mergeProps(_transformOn(getInputEvents({
|
|
1715
|
+
onInput: _this11.onInputChange,
|
|
2274
1716
|
onBlur: function onBlur(e) {
|
|
2275
|
-
|
|
1717
|
+
_this11.$emit('blur', e, _this11.triggerQuery);
|
|
2276
1718
|
},
|
|
2277
|
-
onFocus:
|
|
1719
|
+
onFocus: _this11.handleFocus,
|
|
2278
1720
|
onKeyPress: function onKeyPress(e) {
|
|
2279
|
-
|
|
2280
|
-
|
|
1721
|
+
_this11.$emit('keyPress', e, _this11.triggerQuery);
|
|
1722
|
+
_this11.$emit('key-press', e, _this11.triggerQuery);
|
|
2281
1723
|
},
|
|
2282
1724
|
onKeyDown: function onKeyDown(e) {
|
|
2283
|
-
return
|
|
1725
|
+
return _this11.handleKeyDown(e, highlightedIndex);
|
|
2284
1726
|
},
|
|
2285
1727
|
onKeyUp: function onKeyUp(e) {
|
|
2286
|
-
|
|
2287
|
-
|
|
1728
|
+
_this11.$emit('keyUp', e, _this11.triggerQuery);
|
|
1729
|
+
_this11.$emit('key-up', e, _this11.triggerQuery);
|
|
2288
1730
|
},
|
|
2289
1731
|
onClick: function onClick() {
|
|
2290
1732
|
setHighlightedIndex(null);
|
|
2291
1733
|
}
|
|
2292
1734
|
})), {
|
|
2293
|
-
"id":
|
|
2294
|
-
"showIcon":
|
|
2295
|
-
"showClear":
|
|
2296
|
-
"iconPosition":
|
|
2297
|
-
"ref":
|
|
2298
|
-
"class": getClassName$1(
|
|
2299
|
-
"placeholder":
|
|
2300
|
-
"autoFocus":
|
|
2301
|
-
"showFocusShortcutsIcon": _this15.$props.showFocusShortcutsIcon,
|
|
2302
|
-
"showVoiceSearch": _this15.$props.showVoiceSearch
|
|
1735
|
+
"id": _this11.$props.componentId + "-input",
|
|
1736
|
+
"showIcon": _this11.$props.showIcon,
|
|
1737
|
+
"showClear": _this11.$props.showClear,
|
|
1738
|
+
"iconPosition": _this11.$props.iconPosition,
|
|
1739
|
+
"ref": _this11.$props.innerRef,
|
|
1740
|
+
"class": getClassName$1(_this11.$props.innerClass, 'input'),
|
|
1741
|
+
"placeholder": _this11.$props.placeholder,
|
|
1742
|
+
"autoFocus": _this11.$props.autoFocus
|
|
2303
1743
|
}, getInputProps({
|
|
2304
|
-
value:
|
|
1744
|
+
value: _this11.$data.currentValue === null ? '' : _this11.$data.currentValue
|
|
2305
1745
|
}), {
|
|
2306
|
-
"themePreset":
|
|
1746
|
+
"themePreset": _this11.themePreset,
|
|
2307
1747
|
"autocomplete": "off"
|
|
2308
|
-
}), null)
|
|
2309
|
-
onInput: _this15.onInputChange,
|
|
2310
|
-
onBlur: function onBlur(e) {
|
|
2311
|
-
_this15.$emit('blur', e, _this15.triggerQuery);
|
|
2312
|
-
},
|
|
2313
|
-
onFocus: _this15.handleFocus,
|
|
2314
|
-
onKeyPress: function onKeyPress(e) {
|
|
2315
|
-
_this15.$emit('keyPress', e, _this15.triggerQuery);
|
|
2316
|
-
_this15.$emit('key-press', e, _this15.triggerQuery);
|
|
2317
|
-
},
|
|
2318
|
-
onKeyDown: function onKeyDown(e) {
|
|
2319
|
-
return _this15.handleKeyDown(e, highlightedIndex);
|
|
2320
|
-
},
|
|
2321
|
-
onKeyUp: function onKeyUp(e) {
|
|
2322
|
-
_this15.$emit('keyUp', e, _this15.triggerQuery);
|
|
2323
|
-
_this15.$emit('key-up', e, _this15.triggerQuery);
|
|
2324
|
-
},
|
|
2325
|
-
onClick: function onClick() {
|
|
2326
|
-
setHighlightedIndex(null);
|
|
2327
|
-
}
|
|
2328
|
-
})), {
|
|
2329
|
-
"id": _this15.$props.componentId + "-input",
|
|
2330
|
-
"showIcon": _this15.$props.showIcon,
|
|
2331
|
-
"showClear": _this15.$props.showClear,
|
|
2332
|
-
"iconPosition": _this15.$props.iconPosition,
|
|
2333
|
-
"ref": _this15.$props.innerRef,
|
|
2334
|
-
"class": getClassName$1(_this15.$props.innerClass, 'input'),
|
|
2335
|
-
"placeholder": _this15.$props.placeholder,
|
|
2336
|
-
"autoFocus": _this15.$props.autoFocus
|
|
2337
|
-
}, getInputProps({
|
|
2338
|
-
value: _this15.$data.currentValue === null ? '' : _this15.$data.currentValue
|
|
2339
|
-
}), {
|
|
2340
|
-
"themePreset": _this15.themePreset,
|
|
2341
|
-
"autocomplete": "off"
|
|
2342
|
-
}), null), _this15.renderIcons(), !expandSuggestionsContainer && renderSuggestionsDropdown()];
|
|
1748
|
+
}), null), _this11.renderIcons(), !expandSuggestionsContainer && renderSuggestionsDropdown()];
|
|
2343
1749
|
}
|
|
2344
|
-
}),
|
|
1750
|
+
}), _this11.renderInputAddonAfter(), _this11.renderEnterButtonElement()];
|
|
2345
1751
|
}
|
|
2346
|
-
}), expandSuggestionsContainer && renderSuggestionsDropdown(),
|
|
1752
|
+
}), expandSuggestionsContainer && renderSuggestionsDropdown(), _this11.renderTags()]);
|
|
2347
1753
|
}
|
|
2348
1754
|
}) : vue.createVNode("div", {
|
|
2349
1755
|
"class": Input.suggestionsContainer
|
|
2350
1756
|
}, [vue.createVNode(InputGroup, null, {
|
|
2351
1757
|
"default": function _default() {
|
|
2352
|
-
return [
|
|
1758
|
+
return [_this11.renderInputAddonBefore(), vue.createVNode(DropDown.InputWrapper, null, {
|
|
2353
1759
|
"default": function _default() {
|
|
2354
1760
|
return [vue.createVNode(Input.Input, vue.mergeProps(_transformOn({
|
|
2355
1761
|
blur: function blur(e) {
|
|
2356
|
-
|
|
1762
|
+
_this11.$emit('blur', e, _this11.triggerQuery);
|
|
2357
1763
|
},
|
|
2358
1764
|
keypress: function keypress(e) {
|
|
2359
|
-
|
|
2360
|
-
|
|
1765
|
+
_this11.$emit('keyPress', e, _this11.triggerQuery);
|
|
1766
|
+
_this11.$emit('key-press', e, _this11.triggerQuery);
|
|
2361
1767
|
},
|
|
2362
|
-
input:
|
|
1768
|
+
input: _this11.onInputChange,
|
|
2363
1769
|
focus: function focus(e) {
|
|
2364
|
-
|
|
1770
|
+
_this11.$emit('focus', e, _this11.triggerQuery);
|
|
2365
1771
|
},
|
|
2366
|
-
keydown:
|
|
1772
|
+
keydown: _this11.handleKeyDown,
|
|
2367
1773
|
keyup: function keyup(e) {
|
|
2368
|
-
|
|
2369
|
-
|
|
1774
|
+
_this11.$emit('keyUp', e, _this11.triggerQuery);
|
|
1775
|
+
_this11.$emit('key-up', e, _this11.triggerQuery);
|
|
2370
1776
|
}
|
|
2371
1777
|
}), {
|
|
2372
|
-
"class": getClassName$1(
|
|
2373
|
-
"placeholder":
|
|
2374
|
-
"autofocus":
|
|
2375
|
-
"value":
|
|
2376
|
-
"iconPosition":
|
|
2377
|
-
"showIcon":
|
|
2378
|
-
"showClear":
|
|
2379
|
-
"ref":
|
|
2380
|
-
"themePreset":
|
|
2381
|
-
}), null),
|
|
1778
|
+
"class": getClassName$1(_this11.$props.innerClass, 'input') || '',
|
|
1779
|
+
"placeholder": _this11.$props.placeholder,
|
|
1780
|
+
"autofocus": _this11.$props.autoFocus,
|
|
1781
|
+
"value": _this11.$data.currentValue ? _this11.$data.currentValue : '',
|
|
1782
|
+
"iconPosition": _this11.$props.iconPosition,
|
|
1783
|
+
"showIcon": _this11.$props.showIcon,
|
|
1784
|
+
"showClear": _this11.$props.showClear,
|
|
1785
|
+
"ref": _this11.$props.innerRef,
|
|
1786
|
+
"themePreset": _this11.themePreset
|
|
1787
|
+
}), null), _this11.renderIcons()];
|
|
2382
1788
|
}
|
|
2383
|
-
}),
|
|
1789
|
+
}), _this11.renderInputAddonAfter(), _this11.renderEnterButtonElement()];
|
|
2384
1790
|
}
|
|
2385
1791
|
})])];
|
|
2386
1792
|
}
|
|
@@ -2433,24 +1839,18 @@ var mapStateToProps = function mapStateToProps(state, props) {
|
|
|
2433
1839
|
rawData: state.rawData[props.componentId],
|
|
2434
1840
|
aggregationData: state.compositeAggregations[props.componentId] || [],
|
|
2435
1841
|
themePreset: state.config.themePreset,
|
|
2436
|
-
isLoading: !!state.isLoading[
|
|
1842
|
+
isLoading: !!state.isLoading[props.componentId + "_active"],
|
|
2437
1843
|
error: state.error[props.componentId],
|
|
2438
1844
|
time: state.hits[props.componentId] && state.hits[props.componentId].time || 0,
|
|
2439
1845
|
total: state.hits[props.componentId] && state.hits[props.componentId].total,
|
|
2440
|
-
hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden
|
|
2441
|
-
AIResponse: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].response || null,
|
|
2442
|
-
isAIResponseLoading: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].isLoading,
|
|
2443
|
-
AIResponseError: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].error,
|
|
2444
|
-
sessionIdFromStore: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].response && state.AIResponses[props.componentId].response.sessionId || '',
|
|
2445
|
-
isAITyping: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].response && state.AIResponses[props.componentId].response.isTyping || false
|
|
1846
|
+
hidden: state.hits[props.componentId] && state.hits[props.componentId].hidden
|
|
2446
1847
|
};
|
|
2447
1848
|
};
|
|
2448
1849
|
var mapDispatchToProps = {
|
|
2449
1850
|
updateQuery: updateQuery,
|
|
2450
1851
|
setCustomQuery: setCustomQuery,
|
|
2451
1852
|
setDefaultQuery: setDefaultQuery,
|
|
2452
|
-
recordSuggestionClick: recordSuggestionClick
|
|
2453
|
-
recordAISessionUsefulness: analytics.recordAISessionUsefulness
|
|
1853
|
+
recordSuggestionClick: recordSuggestionClick
|
|
2454
1854
|
};
|
|
2455
1855
|
var SBConnected = PreferencesConsumer.PreferencesConsumer(ComponentWrapper.ComponentWrapper(index.connect(mapStateToProps, mapDispatchToProps)(SearchBox), {
|
|
2456
1856
|
componentType: constants.componentTypes.searchBox,
|
|
@@ -2466,551 +1866,9 @@ SBConnected.install = function (Vue) {
|
|
|
2466
1866
|
// Add componentType for SSR
|
|
2467
1867
|
SBConnected.componentType = constants.componentTypes.searchBox;
|
|
2468
1868
|
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
}
|
|
2472
|
-
var md$1 = new remarkable.Remarkable();
|
|
2473
|
-
md$1.set({
|
|
2474
|
-
html: true,
|
|
2475
|
-
breaks: true,
|
|
2476
|
-
xhtmlOut: true
|
|
2477
|
-
});
|
|
2478
|
-
var _inputWrapperRef = 'inputWrapperRef';
|
|
2479
|
-
var _inputRef = 'inputRef';
|
|
2480
|
-
var _errorContainerRef = 'errorContainerRef';
|
|
2481
|
-
var AIAnswer = vue.defineComponent({
|
|
2482
|
-
name: 'AIAnswer',
|
|
2483
|
-
data: function data() {
|
|
2484
|
-
var props = this.$props;
|
|
2485
|
-
this.__state = {
|
|
2486
|
-
messages: [],
|
|
2487
|
-
inputMessage: '',
|
|
2488
|
-
AISessionId: '',
|
|
2489
|
-
error: null
|
|
2490
|
-
};
|
|
2491
|
-
this.internalComponent = props.componentId + "__internal";
|
|
2492
|
-
return this.__state;
|
|
2493
|
-
},
|
|
2494
|
-
inject: {
|
|
2495
|
-
theme: {
|
|
2496
|
-
from: 'theme_reactivesearch'
|
|
2497
|
-
}
|
|
2498
|
-
},
|
|
2499
|
-
created: function created() {},
|
|
2500
|
-
computed: {
|
|
2501
|
-
hasCustomRenderer: function hasCustomRenderer() {
|
|
2502
|
-
return index.hasCustomRenderer(this);
|
|
2503
|
-
},
|
|
2504
|
-
isLoadingState: function isLoadingState() {
|
|
2505
|
-
return this.isAIResponseLoading || this.isLoading;
|
|
2506
|
-
},
|
|
2507
|
-
shouldShowComponent: function shouldShowComponent() {
|
|
2508
|
-
return this.showComponent;
|
|
2509
|
-
}
|
|
2510
|
-
},
|
|
2511
|
-
props: {
|
|
2512
|
-
componentId: vueTypes.types.string.isRequired,
|
|
2513
|
-
showVoiceInput: VueTypes.bool.def(false),
|
|
2514
|
-
showFeedback: VueTypes.bool.def(true),
|
|
2515
|
-
showIcon: VueTypes.bool.def(true),
|
|
2516
|
-
onData: vueTypes.types.func,
|
|
2517
|
-
innerRef: VueTypes.string.def('AISearchInputField'),
|
|
2518
|
-
react: vueTypes.types.react,
|
|
2519
|
-
enableAI: VueTypes.bool.def(true),
|
|
2520
|
-
AIConfig: vueTypes.types.AIConfig,
|
|
2521
|
-
iconPosition: vueTypes.types.iconPosition.def('left'),
|
|
2522
|
-
themePreset: vueTypes.types.themePreset,
|
|
2523
|
-
theme: vueTypes.types.style,
|
|
2524
|
-
icon: vueTypes.types.children,
|
|
2525
|
-
iconURL: VueTypes.string.def(''),
|
|
2526
|
-
renderMic: vueTypes.types.func,
|
|
2527
|
-
getMicInstance: vueTypes.types.func,
|
|
2528
|
-
innerClass: vueTypes.types.style,
|
|
2529
|
-
placeholder: VueTypes.string.def('Ask a question'),
|
|
2530
|
-
title: vueTypes.types.title,
|
|
2531
|
-
AIResponse: vueTypes.types.componentObject,
|
|
2532
|
-
isAIResponseLoading: VueTypes.bool.def(false),
|
|
2533
|
-
AIResponseError: vueTypes.types.componentObject,
|
|
2534
|
-
getAIResponse: vueTypes.types.func.isRequired,
|
|
2535
|
-
enterButton: vueTypes.types.bool,
|
|
2536
|
-
renderEnterButton: vueTypes.types.title,
|
|
2537
|
-
showInput: VueTypes.bool.def(true),
|
|
2538
|
-
clearSessionOnDestroy: VueTypes.bool.def(true),
|
|
2539
|
-
rawData: vueTypes.types.rawData,
|
|
2540
|
-
render: vueTypes.types.func,
|
|
2541
|
-
onError: vueTypes.types.func,
|
|
2542
|
-
renderError: vueTypes.types.title,
|
|
2543
|
-
isLoading: vueTypes.types.boolRequired,
|
|
2544
|
-
sessionIdFromStore: VueTypes.string,
|
|
2545
|
-
showComponent: vueTypes.types.boolRequired
|
|
2546
|
-
},
|
|
2547
|
-
mounted: function mounted() {},
|
|
2548
|
-
watch: {
|
|
2549
|
-
AIResponse: function AIResponse(newVal) {
|
|
2550
|
-
if (newVal) {
|
|
2551
|
-
this.AISessionId = ((helper.getObjectFromLocalStorage(constants.AI_LOCAL_CACHE_KEY) || {})[this.$props.componentId] || {}).sessionId || null;
|
|
2552
|
-
var messagesHistory = newVal.messages,
|
|
2553
|
-
response = newVal.response;
|
|
2554
|
-
var finalMessages = [];
|
|
2555
|
-
if (response && response.error) {
|
|
2556
|
-
this.error = {
|
|
2557
|
-
message: response.error
|
|
2558
|
-
};
|
|
2559
|
-
}
|
|
2560
|
-
|
|
2561
|
-
// pushing message history so far
|
|
2562
|
-
if (messagesHistory && messagesHistory && Array.isArray(messagesHistory)) {
|
|
2563
|
-
finalMessages.push.apply(finalMessages, messagesHistory.filter(function (msg) {
|
|
2564
|
-
return msg.role !== constants.AI_ROLES.SYSTEM;
|
|
2565
|
-
}));
|
|
2566
|
-
}
|
|
2567
|
-
// fresh response
|
|
2568
|
-
if (response && response.answer) ;
|
|
2569
|
-
this.messages = finalMessages;
|
|
2570
|
-
} else if (!newVal && !this.error) {
|
|
2571
|
-
this.messages = [];
|
|
2572
|
-
}
|
|
2573
|
-
},
|
|
2574
|
-
rawData: function rawData(newVal) {
|
|
2575
|
-
this.$emit('on-data', {
|
|
2576
|
-
data: this.messages,
|
|
2577
|
-
rawData: newVal,
|
|
2578
|
-
loading: this.$props.isAIResponseLoading || this.$props.isLoading,
|
|
2579
|
-
error: this.$props.AIResponseError
|
|
2580
|
-
});
|
|
2581
|
-
},
|
|
2582
|
-
isAIResponseLoading: function isAIResponseLoading(newVal) {
|
|
2583
|
-
this.isLoadingState = newVal;
|
|
2584
|
-
this.$emit('on-data', {
|
|
2585
|
-
data: this.messages,
|
|
2586
|
-
rawData: this.$props.rawData,
|
|
2587
|
-
loading: newVal || this.$props.isLoading,
|
|
2588
|
-
error: this.$props.AIResponseError
|
|
2589
|
-
});
|
|
2590
|
-
},
|
|
2591
|
-
isLoading: function isLoading(newVal) {
|
|
2592
|
-
this.isLoadingState = newVal;
|
|
2593
|
-
this.$emit('on-data', {
|
|
2594
|
-
data: this.messages,
|
|
2595
|
-
rawData: this.$props.rawData,
|
|
2596
|
-
loading: newVal || this.$props.isLoading,
|
|
2597
|
-
error: this.$props.AIResponseError
|
|
2598
|
-
});
|
|
2599
|
-
},
|
|
2600
|
-
sessionIdFromStore: function sessionIdFromStore(newVal) {
|
|
2601
|
-
if (newVal) {
|
|
2602
|
-
this.sessionId = newVal;
|
|
2603
|
-
}
|
|
2604
|
-
},
|
|
2605
|
-
AIResponseError: function AIResponseError(newVal) {
|
|
2606
|
-
this.error = newVal;
|
|
2607
|
-
this.AISessionId = ((helper.getObjectFromLocalStorage(constants.AI_LOCAL_CACHE_KEY) || {})[this.$props.componentId] || {}).sessionId || null;
|
|
2608
|
-
this.$emit('on-data', {
|
|
2609
|
-
data: this.messages,
|
|
2610
|
-
rawData: this.$props.rawData,
|
|
2611
|
-
loading: this.$props.isAIResponseLoading || this.$props.isLoading,
|
|
2612
|
-
error: newVal
|
|
2613
|
-
});
|
|
2614
|
-
},
|
|
2615
|
-
messages: function messages() {
|
|
2616
|
-
this.scrollToBottom();
|
|
2617
|
-
}
|
|
2618
|
-
},
|
|
2619
|
-
methods: {
|
|
2620
|
-
scrollToBottom: function scrollToBottom() {
|
|
2621
|
-
var _this = this;
|
|
2622
|
-
this.$nextTick(function () {
|
|
2623
|
-
var _this$$refs;
|
|
2624
|
-
var messageContainer = (_this$$refs = _this.$refs) == null ? void 0 : _this$$refs[_this.$props.innerRef];
|
|
2625
|
-
if (messageContainer && messageContainer.$el) {
|
|
2626
|
-
messageContainer.$el.scrollTo({
|
|
2627
|
-
top: messageContainer.$el.scrollHeight,
|
|
2628
|
-
behavior: 'smooth'
|
|
2629
|
-
});
|
|
2630
|
-
}
|
|
2631
|
-
});
|
|
2632
|
-
},
|
|
2633
|
-
handleMessageInputChange: function handleMessageInputChange(e) {
|
|
2634
|
-
this.inputMessage = e.target.value;
|
|
2635
|
-
this.handleTextAreaHeightChange();
|
|
2636
|
-
},
|
|
2637
|
-
handleSendMessage: function handleSendMessage(e, isRetry, text) {
|
|
2638
|
-
if (isRetry === void 0) {
|
|
2639
|
-
isRetry = false;
|
|
2640
|
-
}
|
|
2641
|
-
if (text === void 0) {
|
|
2642
|
-
text = this.inputMessage;
|
|
2643
|
-
}
|
|
2644
|
-
if (typeof e === 'object') e.preventDefault();
|
|
2645
|
-
if (text.trim()) {
|
|
2646
|
-
if (this.isLoadingState) {
|
|
2647
|
-
return;
|
|
2648
|
-
}
|
|
2649
|
-
if (this.AISessionId) {
|
|
2650
|
-
if (!isRetry) this.messages = [].concat(this.messages, [{
|
|
2651
|
-
content: text,
|
|
2652
|
-
role: constants.AI_ROLES.USER
|
|
2653
|
-
}]);
|
|
2654
|
-
this.getAIResponse(this.AISessionId, this.componentId, text);
|
|
2655
|
-
} else {
|
|
2656
|
-
console.error("AISessionId for " + this.$props.componentId + " is missing! AIAnswer component requires an AISession to function. Try reloading the App.");
|
|
2657
|
-
this.error = {
|
|
2658
|
-
message: "AISessionId for " + this.$props.componentId + " is missing! AIAnswer component requires an AISession to function. Trying reloading the App."
|
|
2659
|
-
};
|
|
2660
|
-
}
|
|
2661
|
-
this.inputMessage = '';
|
|
2662
|
-
}
|
|
2663
|
-
},
|
|
2664
|
-
handleRetryRequest: function handleRetryRequest() {
|
|
2665
|
-
if (this.messages && !this.isLoadingState) {
|
|
2666
|
-
var _this$messages;
|
|
2667
|
-
var lastUserRequestMessage = (_this$messages = this.messages[this.messages.length - 1]) == null ? void 0 : _this$messages.content;
|
|
2668
|
-
if (this.AISessionId) {
|
|
2669
|
-
this.getAIResponse(this.AISessionId, this.componentId, lastUserRequestMessage);
|
|
2670
|
-
this.inputMessage = '';
|
|
2671
|
-
} else {
|
|
2672
|
-
console.error("AISessionId for " + this.componentId + " is missing! AIAnswer component requires an AISession to function. Try reloading the App.");
|
|
2673
|
-
}
|
|
2674
|
-
}
|
|
2675
|
-
},
|
|
2676
|
-
renderErrorComponent: function renderErrorComponent() {
|
|
2677
|
-
var renderError = this.$slots.renderError || this.$props.renderError;
|
|
2678
|
-
if (this.error && !this.isLoadingState) {
|
|
2679
|
-
var _this$error, _this$error2;
|
|
2680
|
-
if (renderError) {
|
|
2681
|
-
return vue.createVNode("div", {
|
|
2682
|
-
"ref": _errorContainerRef,
|
|
2683
|
-
"class": "--ai-answer-error-container " + (helper.getClassName(this.$props.innerClass, 'ai-error') || '')
|
|
2684
|
-
}, [index.isFunction(renderError) ? renderError(this.error, this.handleRetryRequest) : renderError]);
|
|
2685
|
-
}
|
|
2686
|
-
return vue.createVNode("div", {
|
|
2687
|
-
"ref": _errorContainerRef,
|
|
2688
|
-
"class": "--ai-answer-error-container " + (helper.getClassName(this.$props.innerClass, 'ai-error') || '')
|
|
2689
|
-
}, [vue.createVNode("div", {
|
|
2690
|
-
"class": "--default-error-element"
|
|
2691
|
-
}, [vue.createVNode("span", null, [(_this$error = this.error) != null && _this$error.message ? this.error.message : 'There was an error in generating the response.', ' ', (_this$error2 = this.error) != null && _this$error2.code ? "Code:\n\t\t\t\t\t\t\t" + this.error.code : '']), this.AISessionId && vue.createVNode(Button.Button, {
|
|
2692
|
-
"primary": true,
|
|
2693
|
-
"onClick": this.handleRetryRequest
|
|
2694
|
-
}, {
|
|
2695
|
-
"default": function _default() {
|
|
2696
|
-
return [vue.createTextVNode("Try again")];
|
|
2697
|
-
}
|
|
2698
|
-
})])]);
|
|
2699
|
-
}
|
|
2700
|
-
return null;
|
|
2701
|
-
},
|
|
2702
|
-
handleKeyPress: function handleKeyPress(e) {
|
|
2703
|
-
if (e.key === 'Enter') {
|
|
2704
|
-
this.handleSendMessage(e);
|
|
2705
|
-
this.inputMessage = '';
|
|
2706
|
-
}
|
|
2707
|
-
},
|
|
2708
|
-
renderIcon: function renderIcon() {
|
|
2709
|
-
if (this.$props.showIcon) {
|
|
2710
|
-
if (this.$props.icon) {
|
|
2711
|
-
return this.$props.icon;
|
|
2712
|
-
}
|
|
2713
|
-
if (this.$slots.icon) {
|
|
2714
|
-
return this.$slots.icon();
|
|
2715
|
-
}
|
|
2716
|
-
if (this.$props.iconURL) {
|
|
2717
|
-
return vue.createVNode("img", {
|
|
2718
|
-
"style": {
|
|
2719
|
-
maxHeight: '25px'
|
|
2720
|
-
},
|
|
2721
|
-
"src": this.$props.iconURL,
|
|
2722
|
-
"alt": "search-icon"
|
|
2723
|
-
}, null);
|
|
2724
|
-
}
|
|
2725
|
-
return vue.createVNode(SearchSvg, null, null);
|
|
2726
|
-
}
|
|
2727
|
-
return null;
|
|
2728
|
-
},
|
|
2729
|
-
shouldMicRender: function shouldMicRender(showVoiceSearch) {
|
|
2730
|
-
// checks for SSR
|
|
2731
|
-
if (typeof window === 'undefined') return false;
|
|
2732
|
-
return showVoiceSearch && (window.webkitSpeechRecognition || window.SpeechRecognition);
|
|
2733
|
-
},
|
|
2734
|
-
handleVoiceResults: function handleVoiceResults(_ref) {
|
|
2735
|
-
var results = _ref.results;
|
|
2736
|
-
if (results && results[0] && results[0].isFinal && results[0][0] && results[0][0].transcript && results[0][0].transcript.trim()) {
|
|
2737
|
-
this.handleSendMessage(null, false, results[0][0].transcript.trim());
|
|
2738
|
-
}
|
|
2739
|
-
},
|
|
2740
|
-
renderIcons: function renderIcons() {
|
|
2741
|
-
var _this2 = this;
|
|
2742
|
-
var _slot, _slot2;
|
|
2743
|
-
var _this$$props = this.$props,
|
|
2744
|
-
getMicInstance = _this$$props.getMicInstance,
|
|
2745
|
-
showVoiceInput = _this$$props.showVoiceInput,
|
|
2746
|
-
iconPosition = _this$$props.iconPosition,
|
|
2747
|
-
innerClass = _this$$props.innerClass;
|
|
2748
|
-
var renderMic = this.$slots.renderMic || this.$props.renderMic;
|
|
2749
|
-
return vue.createVNode("div", null, [vue.createVNode(DropDown.IconGroup, {
|
|
2750
|
-
"enableAI": true,
|
|
2751
|
-
"groupPosition": "right",
|
|
2752
|
-
"positionType": "absolute"
|
|
2753
|
-
}, {
|
|
2754
|
-
"default": function _default() {
|
|
2755
|
-
return [_this2.shouldMicRender(showVoiceInput) && vue.createVNode(Mic, {
|
|
2756
|
-
"getInstance": getMicInstance,
|
|
2757
|
-
"render": renderMic,
|
|
2758
|
-
"onResult": _this2.handleVoiceResults,
|
|
2759
|
-
"class": helper.getClassName(innerClass, 'ai-search-mic') || null
|
|
2760
|
-
}, null), iconPosition === 'right' && vue.createVNode(DropDown.IconWrapper, null, _isSlot$1(_slot = _this2.renderIcon()) ? _slot : {
|
|
2761
|
-
"default": function _default() {
|
|
2762
|
-
return [_slot];
|
|
2763
|
-
}
|
|
2764
|
-
})];
|
|
2765
|
-
}
|
|
2766
|
-
}), vue.createVNode(DropDown.IconGroup, {
|
|
2767
|
-
"enableAI": true,
|
|
2768
|
-
"groupPosition": "left",
|
|
2769
|
-
"positionType": "absolute"
|
|
2770
|
-
}, {
|
|
2771
|
-
"default": function _default() {
|
|
2772
|
-
return [iconPosition === 'left' && vue.createVNode(DropDown.IconWrapper, null, _isSlot$1(_slot2 = _this2.renderIcon()) ? _slot2 : {
|
|
2773
|
-
"default": function _default() {
|
|
2774
|
-
return [_slot2];
|
|
2775
|
-
}
|
|
2776
|
-
})];
|
|
2777
|
-
}
|
|
2778
|
-
})]);
|
|
2779
|
-
},
|
|
2780
|
-
enterButtonOnClick: function enterButtonOnClick(e) {
|
|
2781
|
-
this.handleSendMessage(e);
|
|
2782
|
-
},
|
|
2783
|
-
renderEnterButtonElement: function renderEnterButtonElement() {
|
|
2784
|
-
var _this3 = this;
|
|
2785
|
-
var _this$$props2 = this.$props,
|
|
2786
|
-
enterButton = _this$$props2.enterButton,
|
|
2787
|
-
innerClass = _this$$props2.innerClass;
|
|
2788
|
-
var renderEnterButton = this.$slots.renderEnterButton;
|
|
2789
|
-
if (enterButton) {
|
|
2790
|
-
var getEnterButtonMarkup = function getEnterButtonMarkup() {
|
|
2791
|
-
if (renderEnterButton) {
|
|
2792
|
-
return renderEnterButton(_this3.enterButtonOnClick);
|
|
2793
|
-
}
|
|
2794
|
-
return vue.createVNode(SendButton, {
|
|
2795
|
-
"primary": true,
|
|
2796
|
-
"type": "submit",
|
|
2797
|
-
"tabIndex": 0,
|
|
2798
|
-
"onClick": _this3.handleSendMessage,
|
|
2799
|
-
"onKeyPress": _this3.handleKeyPress,
|
|
2800
|
-
"class": "enter-btn " + helper.getClassName(innerClass, 'ai-enter-button')
|
|
2801
|
-
}, {
|
|
2802
|
-
"default": function _default() {
|
|
2803
|
-
return [vue.createTextVNode("Send")];
|
|
2804
|
-
}
|
|
2805
|
-
});
|
|
2806
|
-
};
|
|
2807
|
-
return vue.createVNode("div", {
|
|
2808
|
-
"class": "ai-enter-button-wrapper"
|
|
2809
|
-
}, [getEnterButtonMarkup()]);
|
|
2810
|
-
}
|
|
2811
|
-
return null;
|
|
2812
|
-
},
|
|
2813
|
-
getComponent: function getComponent() {
|
|
2814
|
-
var data = {
|
|
2815
|
-
error: this.AIResponseError,
|
|
2816
|
-
loading: this.isAIResponseLoading,
|
|
2817
|
-
data: this.messages,
|
|
2818
|
-
rawData: this.rawData
|
|
2819
|
-
};
|
|
2820
|
-
return index.getComponent(data, this);
|
|
2821
|
-
},
|
|
2822
|
-
handleTextAreaHeightChange: function handleTextAreaHeightChange() {
|
|
2823
|
-
var _this$$refs2, _this$$refs2$_inputRe, _this$$refs3, _this$$refs3$_inputWr, _this$$refs4;
|
|
2824
|
-
var textArea = (_this$$refs2 = this.$refs) == null ? void 0 : (_this$$refs2$_inputRe = _this$$refs2[_inputRef]) == null ? void 0 : _this$$refs2$_inputRe.$el;
|
|
2825
|
-
var inputWrapper = (_this$$refs3 = this.$refs) == null ? void 0 : (_this$$refs3$_inputWr = _this$$refs3[_inputWrapperRef]) == null ? void 0 : _this$$refs3$_inputWr.$el;
|
|
2826
|
-
var errorContainer = (_this$$refs4 = this.$refs) == null ? void 0 : _this$$refs4[_errorContainerRef];
|
|
2827
|
-
if (textArea) {
|
|
2828
|
-
textArea.style.height = '42px';
|
|
2829
|
-
var lineHeight = parseInt(getComputedStyle(textArea).lineHeight, 10);
|
|
2830
|
-
var maxHeight = lineHeight * 11; // max height for 10 lines
|
|
2831
|
-
var height = Math.min(textArea.scrollHeight, maxHeight);
|
|
2832
|
-
textArea.style.height = height + "px";
|
|
2833
|
-
textArea.style.overflowY = height === maxHeight ? 'auto' : 'hidden';
|
|
2834
|
-
// wrapper around input/ textarea
|
|
2835
|
-
inputWrapper.style.height = height + "px";
|
|
2836
|
-
// adjust error-container
|
|
2837
|
-
|
|
2838
|
-
if (errorContainer) {
|
|
2839
|
-
errorContainer.style.bottom = height + "px";
|
|
2840
|
-
}
|
|
2841
|
-
this.$forceUpdate();
|
|
2842
|
-
}
|
|
2843
|
-
}
|
|
2844
|
-
},
|
|
2845
|
-
beforeUnmount: function beforeUnmount() {
|
|
2846
|
-
if (this.$props.clearSessionOnDestroy) {
|
|
2847
|
-
// cleanup logic
|
|
2848
|
-
// final Object to store in local storage cache
|
|
2849
|
-
var finalCacheObj = helper.getObjectFromLocalStorage(constants.AI_LOCAL_CACHE_KEY) || {};
|
|
2850
|
-
// delete current component's cache
|
|
2851
|
-
delete finalCacheObj[this.$props.componentId];
|
|
2852
|
-
// update local cache
|
|
2853
|
-
helper.setObjectInLocalStorage(constants.AI_LOCAL_CACHE_KEY, finalCacheObj);
|
|
2854
|
-
}
|
|
2855
|
-
},
|
|
2856
|
-
render: function render() {
|
|
2857
|
-
var _slot3;
|
|
2858
|
-
var _this4 = this;
|
|
2859
|
-
var props = this.$props;
|
|
2860
|
-
if (!this.shouldShowComponent) {
|
|
2861
|
-
return null;
|
|
2862
|
-
}
|
|
2863
|
-
return vue.createVNode(Chatbox, null, {
|
|
2864
|
-
"default": function _default() {
|
|
2865
|
-
return [_this4.$props.title && vue.createVNode(Title.Title, {
|
|
2866
|
-
"class": helper.getClassName(_this4.$props.innerClass, 'title') || ''
|
|
2867
|
-
}, {
|
|
2868
|
-
"default": function _default() {
|
|
2869
|
-
return [_this4.$props.title];
|
|
2870
|
-
}
|
|
2871
|
-
}), vue.createVNode(ChatContainer, {
|
|
2872
|
-
"theme": props.theme,
|
|
2873
|
-
"showInput": props.showInput
|
|
2874
|
-
}, {
|
|
2875
|
-
"default": function _default() {
|
|
2876
|
-
return [_this4.hasCustomRenderer && vue.createVNode(MessagesContainer, {
|
|
2877
|
-
"themePreset": _this4.themePreset,
|
|
2878
|
-
"theme": props.theme,
|
|
2879
|
-
"ref": _this4.$props.innerRef,
|
|
2880
|
-
"class": "--ai-message-container " + (helper.getClassName(props.innerClass, 'ai-message-container') || '')
|
|
2881
|
-
}, _isSlot$1(_slot3 = _this4.getComponent()) ? _slot3 : {
|
|
2882
|
-
"default": function _default() {
|
|
2883
|
-
return [_slot3];
|
|
2884
|
-
}
|
|
2885
|
-
}), !_this4.hasCustomRenderer && vue.createVNode(MessagesContainer, {
|
|
2886
|
-
"themePreset": _this4.themePreset,
|
|
2887
|
-
"theme": props.theme,
|
|
2888
|
-
"ref": _this4.$props.innerRef,
|
|
2889
|
-
"class": "--ai-message-container " + (helper.getClassName(props.innerClass, 'ai-message-container') || '')
|
|
2890
|
-
}, {
|
|
2891
|
-
"default": function _default() {
|
|
2892
|
-
return [_this4.messages.map(function (message, index) {
|
|
2893
|
-
return vue.createVNode(Message, {
|
|
2894
|
-
"key": index,
|
|
2895
|
-
"isSender": message.role === constants.AI_ROLES.USER,
|
|
2896
|
-
"innerHTML": md$1.render(message.content),
|
|
2897
|
-
"themePreset": _this4.themePreset,
|
|
2898
|
-
"theme": props.theme,
|
|
2899
|
-
"class": "--ai-answer-message " + (helper.getClassName(props.innerClass, 'ai-message') || '')
|
|
2900
|
-
}, null);
|
|
2901
|
-
}), _this4.isLoadingState && vue.createVNode(Message, {
|
|
2902
|
-
"themePreset": _this4.themePreset,
|
|
2903
|
-
"theme": props.theme,
|
|
2904
|
-
"isSender": false,
|
|
2905
|
-
"class": "--ai-answer-message " + (helper.getClassName(props.innerClass, 'ai-message') || null)
|
|
2906
|
-
}, {
|
|
2907
|
-
"default": function _default() {
|
|
2908
|
-
return [vue.createVNode(TypingIndicator, null, {
|
|
2909
|
-
"default": function _default() {
|
|
2910
|
-
return [vue.createVNode(TypingDot, {
|
|
2911
|
-
"themePreset": _this4.themePreset
|
|
2912
|
-
}, null), vue.createVNode(TypingDot, {
|
|
2913
|
-
"themePreset": _this4.themePreset
|
|
2914
|
-
}, null), vue.createVNode(TypingDot, {
|
|
2915
|
-
"themePreset": _this4.themePreset
|
|
2916
|
-
}, null)];
|
|
2917
|
-
}
|
|
2918
|
-
})];
|
|
2919
|
-
}
|
|
2920
|
-
})];
|
|
2921
|
-
}
|
|
2922
|
-
}), _this4.renderErrorComponent(), ' ', props.showFeedback && vue.createVNode("div", {
|
|
2923
|
-
"class": "--ai-answer-feedback-container " + (helper.getClassName(props.innerClass, 'ai-feedback') || '')
|
|
2924
|
-
}, [vue.createVNode(AIFeedback, {
|
|
2925
|
-
"hideUI": _this4.isLoadingState || !_this4.sessionId,
|
|
2926
|
-
"key": _this4.sessionId,
|
|
2927
|
-
"onFeedbackSubmit": function onFeedbackSubmit(useful, reason) {
|
|
2928
|
-
_this4.trackUsefullness(_this4.sessionId, {
|
|
2929
|
-
useful: useful,
|
|
2930
|
-
reason: reason
|
|
2931
|
-
});
|
|
2932
|
-
}
|
|
2933
|
-
}, null)]), props.showInput && vue.createVNode(MessageInputContainer, {
|
|
2934
|
-
"class": "--ai-input-container",
|
|
2935
|
-
"onSubmit": _this4.handleSendMessage
|
|
2936
|
-
}, {
|
|
2937
|
-
"default": function _default() {
|
|
2938
|
-
return [vue.createVNode(InputGroup, {
|
|
2939
|
-
"enableAI": true,
|
|
2940
|
-
"isOpen": false
|
|
2941
|
-
}, {
|
|
2942
|
-
"default": function _default() {
|
|
2943
|
-
return [vue.createVNode(DropDown.InputWrapper, {
|
|
2944
|
-
"ref": _inputWrapperRef
|
|
2945
|
-
}, {
|
|
2946
|
-
"default": function _default() {
|
|
2947
|
-
return [vue.createVNode(MessageInput, {
|
|
2948
|
-
"ref": _inputRef,
|
|
2949
|
-
"type": "text",
|
|
2950
|
-
"placeholder": props.placeholder,
|
|
2951
|
-
"enterButton": props.enterButton,
|
|
2952
|
-
"value": _this4.inputMessage,
|
|
2953
|
-
"onInput": _this4.handleMessageInputChange,
|
|
2954
|
-
"onKeyPress": _this4.handleKeyPress,
|
|
2955
|
-
"id": props.componentId + "-ai-input",
|
|
2956
|
-
"showIcon": props.showIcon,
|
|
2957
|
-
"iconPosition": props.iconPosition,
|
|
2958
|
-
"themePreset": _this4.themePreset,
|
|
2959
|
-
"disabled": _this4.isLoadingState,
|
|
2960
|
-
"class": helper.getClassName(props.innerClass, 'ai-input') || null
|
|
2961
|
-
}, null), ' ', _this4.renderIcons()];
|
|
2962
|
-
}
|
|
2963
|
-
})];
|
|
2964
|
-
}
|
|
2965
|
-
}), _this4.renderEnterButtonElement()];
|
|
2966
|
-
}
|
|
2967
|
-
}), ' '];
|
|
2968
|
-
}
|
|
2969
|
-
})];
|
|
2970
|
-
}
|
|
2971
|
-
});
|
|
2972
|
-
}
|
|
2973
|
-
});
|
|
2974
|
-
AIAnswer.hasInternalComponent = function () {
|
|
2975
|
-
return true;
|
|
2976
|
-
};
|
|
2977
|
-
var mapStateToProps$1 = function mapStateToProps(state, props) {
|
|
2978
|
-
var dependencyComponent = Object.values(props.react)[0];
|
|
2979
|
-
if (Array.isArray(dependencyComponent)) {
|
|
2980
|
-
// eslint-disable-next-line prefer-destructuring
|
|
2981
|
-
dependencyComponent = dependencyComponent[0];
|
|
2982
|
-
}
|
|
2983
|
-
var showComponent = state.selectedValues[dependencyComponent] && state.selectedValues[dependencyComponent].value;
|
|
2984
|
-
return {
|
|
2985
|
-
showComponent: showComponent,
|
|
2986
|
-
AIResponse: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].response,
|
|
2987
|
-
isAIResponseLoading: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].isLoading,
|
|
2988
|
-
AIResponseError: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].error,
|
|
2989
|
-
rawData: state.rawData[props.componentId],
|
|
2990
|
-
themePreset: state.config.themePreset,
|
|
2991
|
-
isLoading: state.isLoading[props.componentId] || false,
|
|
2992
|
-
sessionIdFromStore: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].response && state.AIResponses[props.componentId].response.sessionId || ''
|
|
2993
|
-
};
|
|
2994
|
-
};
|
|
2995
|
-
var mapDispatchToProps$1 = {
|
|
2996
|
-
getAIResponse: query.fetchAIResponse,
|
|
2997
|
-
trackUsefullness: analytics.recordAISessionUsefulness
|
|
2998
|
-
};
|
|
2999
|
-
var AIConnected = PreferencesConsumer.PreferencesConsumer(ComponentWrapper.ComponentWrapper(index.connect(mapStateToProps$1, mapDispatchToProps$1)(AIAnswer), {
|
|
3000
|
-
componentType: constants.componentTypes.AIAnswer,
|
|
3001
|
-
internalComponent: true
|
|
3002
|
-
}));
|
|
3003
|
-
AIConnected.name = AIAnswer.name;
|
|
3004
|
-
AIConnected.hasInternalComponent = AIAnswer.hasInternalComponent;
|
|
3005
|
-
AIConnected.install = function (Vue) {
|
|
3006
|
-
Vue.component(AIConnected.name, AIConnected);
|
|
3007
|
-
};
|
|
3008
|
-
// Add componentType for SSR
|
|
3009
|
-
AIConnected.componentType = constants.componentTypes.AIAnswer;
|
|
3010
|
-
|
|
3011
|
-
var _templateObject$b, _templateObject2$4;
|
|
3012
|
-
var HierarchicalMenuList = vueEmotion.styled('ul')(_templateObject$b || (_templateObject$b = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\tmax-height: 0;\n\toverflow: hidden;\n\n\t&.--open {\n\t\tmax-height: 100%;\n\t}\n"])));
|
|
3013
|
-
var HierarchicalMenuListItem = vueEmotion.styled('li')(_templateObject2$4 || (_templateObject2$4 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tfont-weight: 400;\n\tline-height: 1.5;\n\tbox-sizing: border-box;\n\n\ta {\n\t\tcolor: #424242;\n\t\ttext-decoration: none;\n\t\tgap: 5px;\n\t\t.--leaf-icon,\n\t\t.--folder-icon {\n\t\t\tline-height: 15px;\n\t\t\tsvg {\n\t\t\t\theight: 15px;\n\t\t\t}\n\t\t}\n\n\t\tinput {\n\t\t\tmargin: 0;\n\t\t\tcursor: pointer;\n\t\t}\n\t}\n\n\t.--switcher-icon {\n\t\ttransition: all 0.2s ease-in;\n\t\tmargin-right: 2px;\n\t}\n\t.--list-child {\n\t\tpadding-left: 1rem;\n\t\tposition: relative;\n\t\t&:before {\n\t\t\theight: 100%;\n\t\t\tcontent: '';\n\t\t\tposition: absolute;\n\t\t\tborder-left: 1px solid #787878;\n\t\t\twidth: 0;\n\t\t\tleft: 19px;\n\t\t\t", ";\n\t\t}\n\n\t\t&.--show-switcher-icon {\n\t\t\tpadding-left: 36px;\n\t\t}\n\t}\n\t.--list-item-label {\n\t\tline-height: 100%;\n\t}\n\t.--list-item-count {\n\t\tmargin-left: 10px;\n\t\tpadding: 0.1rem 0.4rem;\n\t\tfont-size: 0.8rem;\n\t\tcolor: #424242;\n\t\tbackground-color: #dee1e6;\n\t\tborder-radius: 8px;\n\t}\n\t&.-selected-item {\n\t\tfont-weight: 700 !important;\n\t}\n\t&.-expanded-item {\n\t\t& > a {\n\t\t\t& div > .--switcher-icon {\n\t\t\t\ttransform: rotate(90deg);\n\t\t\t}\n\t\t}\n\t}\n\t.--list-item-label-count-wrapper {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\t&:hover {\n\t\t\t.--list-item-count,\n\t\t\t.--list-item-label {\n\t\t\t\tfont-weight: 700;\n\t\t\t}\n\t\t}\n\t}\n"])), function (props) {
|
|
1869
|
+
var _templateObject$8, _templateObject2$1;
|
|
1870
|
+
var HierarchicalMenuList = vueEmotion.styled('ul')(_templateObject$8 || (_templateObject$8 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\tmax-height: 0;\n\toverflow: hidden;\n\n\t&.--open {\n\t\tmax-height: 100%;\n\t}\n"])));
|
|
1871
|
+
var HierarchicalMenuListItem = vueEmotion.styled('li')(_templateObject2$1 || (_templateObject2$1 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tfont-weight: 400;\n\tline-height: 1.5;\n\tbox-sizing: border-box;\n\n\ta {\n\t\tcolor: #424242;\n\t\ttext-decoration: none;\n\t\tgap: 5px;\n\t\t.--leaf-icon,\n\t\t.--folder-icon {\n\t\t\tline-height: 15px;\n\t\t\tsvg {\n\t\t\t\theight: 15px;\n\t\t\t}\n\t\t}\n\n\t\tinput {\n\t\t\tmargin: 0;\n\t\t\tcursor: pointer;\n\t\t}\n\t}\n\n\t.--switcher-icon {\n\t\ttransition: all 0.2s ease-in;\n\t\tmargin-right: 2px;\n\t}\n\t.--list-child {\n\t\tpadding-left: 1rem;\n\t\tposition: relative;\n\t\t&:before {\n\t\t\theight: 100%;\n\t\t\tcontent: '';\n\t\t\tposition: absolute;\n\t\t\tborder-left: 1px solid #787878;\n\t\t\twidth: 0;\n\t\t\tleft: 19px;\n\t\t\t", ";\n\t\t}\n\n\t\t&.--show-switcher-icon {\n\t\t\tpadding-left: 36px;\n\t\t}\n\t}\n\t.--list-item-label {\n\t\tline-height: 100%;\n\t}\n\t.--list-item-count {\n\t\tmargin-left: 10px;\n\t\tpadding: 0.1rem 0.4rem;\n\t\tfont-size: 0.8rem;\n\t\tcolor: #424242;\n\t\tbackground-color: #dee1e6;\n\t\tborder-radius: 8px;\n\t}\n\t&.-selected-item {\n\t\tfont-weight: 700 !important;\n\t}\n\t&.-expanded-item {\n\t\t& > a {\n\t\t\t& div > .--switcher-icon {\n\t\t\t\ttransform: rotate(90deg);\n\t\t\t}\n\t\t}\n\t}\n\t.--list-item-label-count-wrapper {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\t&:hover {\n\t\t\t.--list-item-count,\n\t\t\t.--list-item-label {\n\t\t\t\tfont-weight: 700;\n\t\t\t}\n\t\t}\n\t}\n"])), function (props) {
|
|
3014
1872
|
return !props.showLine && "\n\t\t\t\t\tdisplay: none;\n\t\t\t\t";
|
|
3015
1873
|
});
|
|
3016
1874
|
|
|
@@ -3223,7 +2081,7 @@ var HierarchicalMenuListItemComponent = {
|
|
|
3223
2081
|
}
|
|
3224
2082
|
};
|
|
3225
2083
|
|
|
3226
|
-
function _isSlot$
|
|
2084
|
+
function _isSlot$1(s) {
|
|
3227
2085
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
3228
2086
|
}
|
|
3229
2087
|
var HierarchicalMenuComponent = {
|
|
@@ -3248,7 +2106,7 @@ var HierarchicalMenuComponent = {
|
|
|
3248
2106
|
return vue.createVNode(HierarchicalMenuList, {
|
|
3249
2107
|
"class": "" + (isExpanded ? '--open' : ''),
|
|
3250
2108
|
"isSelected": isExpanded
|
|
3251
|
-
}, _isSlot$
|
|
2109
|
+
}, _isSlot$1(_slot = listArray.map(function (listItem) {
|
|
3252
2110
|
return vue.createVNode(HierarchicalMenuListItemComponent, vue.mergeProps({
|
|
3253
2111
|
"key": parentPath + "__" + JSON.stringify(listItem),
|
|
3254
2112
|
"parentPath": parentPath,
|
|
@@ -3262,7 +2120,7 @@ var HierarchicalMenuComponent = {
|
|
|
3262
2120
|
}
|
|
3263
2121
|
};
|
|
3264
2122
|
|
|
3265
|
-
function _isSlot$
|
|
2123
|
+
function _isSlot$2(s) {
|
|
3266
2124
|
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !vue.isVNode(s);
|
|
3267
2125
|
}
|
|
3268
2126
|
var updateQueryAction = reactivecore.Actions.updateQuery,
|
|
@@ -3712,7 +2570,7 @@ var TreeList = {
|
|
|
3712
2570
|
"default": function _default() {
|
|
3713
2571
|
return [props.title && vue.createVNode(Title.Title, {
|
|
3714
2572
|
"class": helper.getClassName(innerClass, 'title') || null
|
|
3715
|
-
}, _isSlot$
|
|
2573
|
+
}, _isSlot$2(title) ? title : {
|
|
3716
2574
|
"default": function _default() {
|
|
3717
2575
|
return [title];
|
|
3718
2576
|
}
|
|
@@ -3741,7 +2599,7 @@ var TreeList = {
|
|
|
3741
2599
|
});
|
|
3742
2600
|
}
|
|
3743
2601
|
};
|
|
3744
|
-
var mapStateToProps$
|
|
2602
|
+
var mapStateToProps$1 = function mapStateToProps(state, props) {
|
|
3745
2603
|
return {
|
|
3746
2604
|
selectedValue: state.selectedValues[props.componentId] && state.selectedValues[props.componentId].value || null,
|
|
3747
2605
|
rawData: state.rawData[props.componentId] || {},
|
|
@@ -3759,7 +2617,7 @@ var mapDispatchtoProps = {
|
|
|
3759
2617
|
TreeList.hasInternalComponent = function () {
|
|
3760
2618
|
return true;
|
|
3761
2619
|
};
|
|
3762
|
-
var TreeListConnected = PreferencesConsumer.PreferencesConsumer(ComponentWrapper.ComponentWrapper(index.connect(mapStateToProps$
|
|
2620
|
+
var TreeListConnected = PreferencesConsumer.PreferencesConsumer(ComponentWrapper.ComponentWrapper(index.connect(mapStateToProps$1, mapDispatchtoProps)(TreeList), {
|
|
3763
2621
|
componentType: constants.componentTypes.treeList,
|
|
3764
2622
|
internalComponent: TreeList.hasInternalComponent()
|
|
3765
2623
|
}));
|
|
@@ -3827,7 +2685,7 @@ RcConnected.install = function (Vue) {
|
|
|
3827
2685
|
Vue.component(RcConnected.name, RcConnected);
|
|
3828
2686
|
};
|
|
3829
2687
|
|
|
3830
|
-
var components = [ReactiveList.default, ResultCard.default, ResultList.default, ReactiveBase.default, SBConnected, SingleList.default, MultiList.default, SingleRange.default, MultiRange.default, RangeSlider.default, DynamicRangeSlider.default, ReactiveComponent.default, RcConnected, SelectedFilters.default, ToggleButton.default, SingleDropdownList.default, MultiDropdownList.default, StateProvider.default, RangeInput.default, TreeListConnected
|
|
2688
|
+
var components = [ReactiveList.default, ResultCard.default, ResultList.default, ReactiveBase.default, SBConnected, SingleList.default, MultiList.default, SingleRange.default, MultiRange.default, RangeSlider.default, DynamicRangeSlider.default, ReactiveComponent.default, RcConnected, SelectedFilters.default, ToggleButton.default, SingleDropdownList.default, MultiDropdownList.default, StateProvider.default, RangeInput.default, TreeListConnected];
|
|
3831
2689
|
function install (Vue) {
|
|
3832
2690
|
components.map(function (component) {
|
|
3833
2691
|
Vue.use(component);
|
|
@@ -3835,7 +2693,6 @@ function install (Vue) {
|
|
|
3835
2693
|
});
|
|
3836
2694
|
}
|
|
3837
2695
|
|
|
3838
|
-
exports.AIAnswer = AIConnected;
|
|
3839
2696
|
exports.ReactiveComponentPrivate = RcConnected;
|
|
3840
2697
|
exports.SearchBox = SBConnected;
|
|
3841
2698
|
exports.TreeList = TreeListConnected;
|