UNPKG

@cognigy/rest-api-client

Version:

Cognigy REST-Client

36 lines 5.8 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getQuestionText = void 0; function getQuestionText(config) { var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35; if (((_a = config === null || config === void 0 ? void 0 : config.say) === null || _a === void 0 ? void 0 : _a.type) === "quickReplies") { return ((_f = (_e = (_d = (_c = (_b = config === null || config === void 0 ? void 0 : config.say) === null || _b === void 0 ? void 0 : _b._data) === null || _c === void 0 ? void 0 : _c._cognigy) === null || _d === void 0 ? void 0 : _d._default) === null || _e === void 0 ? void 0 : _e._quickReplies) === null || _f === void 0 ? void 0 : _f.text) || ((_l = (_k = (_j = (_h = (_g = config === null || config === void 0 ? void 0 : config.say) === null || _g === void 0 ? void 0 : _g._data) === null || _h === void 0 ? void 0 : _h._cognigy) === null || _j === void 0 ? void 0 : _j._default) === null || _k === void 0 ? void 0 : _k._quickReplies) === null || _l === void 0 ? void 0 : _l.fallbackText) || ((_m = config === null || config === void 0 ? void 0 : config.say) === null || _m === void 0 ? void 0 : _m.text); } else if (((_o = config === null || config === void 0 ? void 0 : config.say) === null || _o === void 0 ? void 0 : _o.type) === "list") { return ((_t = (_s = (_r = (_q = (_p = config === null || config === void 0 ? void 0 : config.say) === null || _p === void 0 ? void 0 : _p._data) === null || _q === void 0 ? void 0 : _q._cognigy) === null || _r === void 0 ? void 0 : _r._default) === null || _s === void 0 ? void 0 : _s._list) === null || _t === void 0 ? void 0 : _t.fallbackText) || ((_u = config === null || config === void 0 ? void 0 : config.say) === null || _u === void 0 ? void 0 : _u.text); } else if (((_v = config === null || config === void 0 ? void 0 : config.say) === null || _v === void 0 ? void 0 : _v.type) === "gallery") { return ((_0 = (_z = (_y = (_x = (_w = config === null || config === void 0 ? void 0 : config.say) === null || _w === void 0 ? void 0 : _w._data) === null || _x === void 0 ? void 0 : _x._cognigy) === null || _y === void 0 ? void 0 : _y._default) === null || _z === void 0 ? void 0 : _z._gallery) === null || _0 === void 0 ? void 0 : _0.fallbackText) || ((_1 = config === null || config === void 0 ? void 0 : config.say) === null || _1 === void 0 ? void 0 : _1.text); } else if (((_2 = config === null || config === void 0 ? void 0 : config.say) === null || _2 === void 0 ? void 0 : _2.type) === "audio") { return ((_7 = (_6 = (_5 = (_4 = (_3 = config === null || config === void 0 ? void 0 : config.say) === null || _3 === void 0 ? void 0 : _3._data) === null || _4 === void 0 ? void 0 : _4._cognigy) === null || _5 === void 0 ? void 0 : _5._default) === null || _6 === void 0 ? void 0 : _6._audio) === null || _7 === void 0 ? void 0 : _7.fallbackText) || ((_8 = config === null || config === void 0 ? void 0 : config.say) === null || _8 === void 0 ? void 0 : _8.text); } else if (((_9 = config === null || config === void 0 ? void 0 : config.say) === null || _9 === void 0 ? void 0 : _9.type) === "video") { return ((_14 = (_13 = (_12 = (_11 = (_10 = config === null || config === void 0 ? void 0 : config.say) === null || _10 === void 0 ? void 0 : _10._data) === null || _11 === void 0 ? void 0 : _11._cognigy) === null || _12 === void 0 ? void 0 : _12._default) === null || _13 === void 0 ? void 0 : _13._video) === null || _14 === void 0 ? void 0 : _14.fallbackText) || ((_15 = config === null || config === void 0 ? void 0 : config.say) === null || _15 === void 0 ? void 0 : _15.text); } else if (((_16 = config === null || config === void 0 ? void 0 : config.say) === null || _16 === void 0 ? void 0 : _16.type) === "buttons") { return ((_21 = (_20 = (_19 = (_18 = (_17 = config === null || config === void 0 ? void 0 : config.say) === null || _17 === void 0 ? void 0 : _17._data) === null || _18 === void 0 ? void 0 : _18._cognigy) === null || _19 === void 0 ? void 0 : _19._default) === null || _20 === void 0 ? void 0 : _20._buttons) === null || _21 === void 0 ? void 0 : _21.text) || ((_26 = (_25 = (_24 = (_23 = (_22 = config === null || config === void 0 ? void 0 : config.say) === null || _22 === void 0 ? void 0 : _22._data) === null || _23 === void 0 ? void 0 : _23._cognigy) === null || _24 === void 0 ? void 0 : _24._default) === null || _25 === void 0 ? void 0 : _25._buttons) === null || _26 === void 0 ? void 0 : _26.fallbackText) || ((_27 = config === null || config === void 0 ? void 0 : config.say) === null || _27 === void 0 ? void 0 : _27.text); } else if (((_28 = config === null || config === void 0 ? void 0 : config.say) === null || _28 === void 0 ? void 0 : _28.type) === "image") { return ((_33 = (_32 = (_31 = (_30 = (_29 = config === null || config === void 0 ? void 0 : config.say) === null || _29 === void 0 ? void 0 : _29._data) === null || _30 === void 0 ? void 0 : _30._cognigy) === null || _31 === void 0 ? void 0 : _31._default) === null || _32 === void 0 ? void 0 : _32._image) === null || _33 === void 0 ? void 0 : _33.fallbackText) || ((_34 = config === null || config === void 0 ? void 0 : config.say) === null || _34 === void 0 ? void 0 : _34.text); } else { return (_35 = config === null || config === void 0 ? void 0 : config.say) === null || _35 === void 0 ? void 0 : _35.text; } } exports.getQuestionText = getQuestionText; //# sourceMappingURL=getQuestionText.js.map