!function(t){function n(n){for(var r,i,c=n[0],l=n[1],u=n[2],A=0,d=[];At.length)&&(n=t.length);for(var e=0,r=new Array(n);et.length)&&(n=t.length);for(var e=0,r=new Array(n);e1&&void 0!==arguments[1]?arguments[1]:{};return function(){return function(e){return function(r){var o=n.showSeconds,a=void 0!==o&&o,i=r.activity,c=i.from,l=c.role,u=c.name,s=i.timestamp,A=i.localTimestamp,d=r.sendState,f=r.sameTimestampGroup,b=new Date(s||A).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit",second:a?"2-digit":void 0,hourCycle:"h12"}),p="user"===l?"you":u;return["sending","send failed"].includes(d)?e(r):E.a.createElement(N,{sender:p,formattedTimestamp:b,grouped:t.groupTimestamp&&f})}}}},F=e(42);function U(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var r,o,a,i,c=[],l=!0,u=!1;try{if(a=(e=e.call(t)).next,0===n){if(Object(e)!==e)return;l=!1}else for(;!(l=(r=a.call(e)).done)&&(c.push(r.value),c.length!==n);l=!0);}catch(t){u=!0,o=t}finally{try{if(!l&&null!=e.return&&(i=e.return(),Object(i)!==i))return}finally{if(u)throw o}}return c}}(t,n)||q(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function q(t,n){if(t){if("string"==typeof t)return P(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?P(t,n):void 0}}function P(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,c=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return i=t.done,t},e:function(t){c=!0,a=t},f:function(){try{i||null==e.return||e.return()}finally{if(c)throw a}}}}(U(R(),1)[0]);try{for(e.s();!(n=e.n()).done;){var r=n.value;if("event"===r.type&&"answerFeedback"===r.name){var o=r.value;if(o.sourceActivityId===t.id)return o}}}catch(t){e.e(t)}finally{e.f()}},Q=F.hooks.useSendEvent;function G(t){return(G="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function W(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */W=function(){return t};var t={},n=Object.prototype,e=n.hasOwnProperty,r=Object.defineProperty||function(t,n,e){t[n]=e.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(t,n,e){return Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[n]}try{l({},"")}catch(t){l=function(t,n,e){return t[n]=e}}function u(t,n,e,o){var a=n&&n.prototype instanceof d?n:d,i=Object.create(a.prototype),c=new _(o||[]);return r(i,"_invoke",{value:C(t,e,c)}),i}function s(t,n,e){try{return{type:"normal",arg:t.call(n,e)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var A={};function d(){}function f(){}function b(){}var p={};l(p,a,(function(){return this}));var y=Object.getPrototypeOf,h=y&&y(y(B([])));h&&h!==n&&e.call(h,a)&&(p=h);var v=b.prototype=d.prototype=Object.create(p);function m(t){["next","throw","return"].forEach((function(n){l(t,n,(function(t){return this._invoke(n,t)}))}))}function g(t,n){var o;r(this,"_invoke",{value:function(r,a){function i(){return new n((function(o,i){!function r(o,a,i,c){var l=s(t[o],t,a);if("throw"!==l.type){var u=l.arg,A=u.value;return A&&"object"==G(A)&&e.call(A,"__await")?n.resolve(A.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):n.resolve(A).then((function(t){u.value=t,i(u)}),(function(t){return r("throw",t,i,c)}))}c(l.arg)}(r,a,o,i)}))}return o=o?o.then(i,i):i()}})}function C(t,n,e){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(e.method=o,e.arg=a;;){var i=e.delegate;if(i){var c=E(i,e);if(c){if(c===A)continue;return c}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===r)throw r="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);r="executing";var l=s(t,n,e);if("normal"===l.type){if(r=e.done?"completed":"suspendedYield",l.arg===A)continue;return{value:l.arg,done:e.done}}"throw"===l.type&&(r="completed",e.method="throw",e.arg=l.arg)}}}function E(t,n){var e=n.method,r=t.iterator[e];if(void 0===r)return n.delegate=null,"throw"===e&&t.iterator.return&&(n.method="return",n.arg=void 0,E(t,n),"throw"===n.method)||"return"!==e&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+e+"' method")),A;var o=s(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,A;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,A):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,A)}function w(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function x(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function B(t){if(t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function n(){for(;++r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=e.call(a,"catchLoc"),l=e.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&e.call(o,"finallyLoc")&&this.prev=0;--n){var e=this.tryEntries[n];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),x(e),A}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var e=this.tryEntries[n];if(e.tryLoc===t){var r=e.completion;if("throw"===r.type){var o=r.arg;x(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,e){return this.delegate={iterator:B(t),resultName:n,nextLoc:e},"next"===this.method&&(this.arg=void 0),A}},t}function V(t,n,e,r,o,a,i){try{var c=t[a](i),l=c.value}catch(t){return void e(t)}c.done?n(l):Promise.resolve(l).then(r,o)}var Z=function(t){return Object(C.useCallback)(function(){var n,e=(n=W().mark((function n(e){var r;return W().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,fetch("/api/webchat",{method:"POST",headers:{Authorization:"Bearer ".concat(t.current),"Content-Type":"application/json"},body:JSON.stringify(e)}).then((function(t){return t.ok?t.json():void 0}));case 2:return(r=n.sent)&&r.directLineConfig.continueConversation&&(r.directLineConfig.conversationId=r.directLineConfig.conversationIdForToken),n.abrupt("return",r);case 5:case"end":return n.stop()}}),n)})),function(){var t=this,e=arguments;return new Promise((function(r,o){var a=n.apply(t,e);function i(t){V(a,r,o,i,c,"next",t)}function c(t){V(a,r,o,i,c,"throw",t)}i(void 0)}))});return function(t){return e.apply(this,arguments)}}(),[t])};function X(t){return(X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function H(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */H=function(){return t};var t={},n=Object.prototype,e=n.hasOwnProperty,r=Object.defineProperty||function(t,n,e){t[n]=e.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(t,n,e){return Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[n]}try{l({},"")}catch(t){l=function(t,n,e){return t[n]=e}}function u(t,n,e,o){var a=n&&n.prototype instanceof d?n:d,i=Object.create(a.prototype),c=new _(o||[]);return r(i,"_invoke",{value:C(t,e,c)}),i}function s(t,n,e){try{return{type:"normal",arg:t.call(n,e)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var A={};function d(){}function f(){}function b(){}var p={};l(p,a,(function(){return this}));var y=Object.getPrototypeOf,h=y&&y(y(B([])));h&&h!==n&&e.call(h,a)&&(p=h);var v=b.prototype=d.prototype=Object.create(p);function m(t){["next","throw","return"].forEach((function(n){l(t,n,(function(t){return this._invoke(n,t)}))}))}function g(t,n){var o;r(this,"_invoke",{value:function(r,a){function i(){return new n((function(o,i){!function r(o,a,i,c){var l=s(t[o],t,a);if("throw"!==l.type){var u=l.arg,A=u.value;return A&&"object"==X(A)&&e.call(A,"__await")?n.resolve(A.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):n.resolve(A).then((function(t){u.value=t,i(u)}),(function(t){return r("throw",t,i,c)}))}c(l.arg)}(r,a,o,i)}))}return o=o?o.then(i,i):i()}})}function C(t,n,e){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(e.method=o,e.arg=a;;){var i=e.delegate;if(i){var c=E(i,e);if(c){if(c===A)continue;return c}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===r)throw r="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);r="executing";var l=s(t,n,e);if("normal"===l.type){if(r=e.done?"completed":"suspendedYield",l.arg===A)continue;return{value:l.arg,done:e.done}}"throw"===l.type&&(r="completed",e.method="throw",e.arg=l.arg)}}}function E(t,n){var e=n.method,r=t.iterator[e];if(void 0===r)return n.delegate=null,"throw"===e&&t.iterator.return&&(n.method="return",n.arg=void 0,E(t,n),"throw"===n.method)||"return"!==e&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+e+"' method")),A;var o=s(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,A;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,A):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,A)}function w(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function x(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function B(t){if(t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function n(){for(;++r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=e.call(a,"catchLoc"),l=e.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&e.call(o,"finallyLoc")&&this.prev=0;--n){var e=this.tryEntries[n];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),x(e),A}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var e=this.tryEntries[n];if(e.tryLoc===t){var r=e.completion;if("throw"===r.type){var o=r.arg;x(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,e){return this.delegate={iterator:B(t),resultName:n,nextLoc:e},"next"===this.method&&(this.arg=void 0),A}},t}function J(t,n,e,r,o,a,i){try{var c=t[a](i),l=c.value}catch(t){return void e(t)}c.done?n(l):Promise.resolve(l).then(r,o)}var $=function(t){return Object(C.useCallback)(function(){var n,e=(n=H().mark((function n(e){return H().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,fetch("/api/events/conversationStarted",{method:"POST",body:JSON.stringify(e),headers:{Authorization:"Bearer ".concat(t.current),"Content-Type":"application/json"}}).then((function(t){return t.json()}));case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}),n)})),function(){var t=this,e=arguments;return new Promise((function(r,o){var a=n.apply(t,e);function i(t){J(a,r,o,i,c,"next",t)}function c(t){J(a,r,o,i,c,"throw",t)}i(void 0)}))});return function(t){return e.apply(this,arguments)}}(),[t])};function K(t){return(K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function tt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */tt=function(){return t};var t={},n=Object.prototype,e=n.hasOwnProperty,r=Object.defineProperty||function(t,n,e){t[n]=e.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(t,n,e){return Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[n]}try{l({},"")}catch(t){l=function(t,n,e){return t[n]=e}}function u(t,n,e,o){var a=n&&n.prototype instanceof d?n:d,i=Object.create(a.prototype),c=new _(o||[]);return r(i,"_invoke",{value:C(t,e,c)}),i}function s(t,n,e){try{return{type:"normal",arg:t.call(n,e)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var A={};function d(){}function f(){}function b(){}var p={};l(p,a,(function(){return this}));var y=Object.getPrototypeOf,h=y&&y(y(B([])));h&&h!==n&&e.call(h,a)&&(p=h);var v=b.prototype=d.prototype=Object.create(p);function m(t){["next","throw","return"].forEach((function(n){l(t,n,(function(t){return this._invoke(n,t)}))}))}function g(t,n){var o;r(this,"_invoke",{value:function(r,a){function i(){return new n((function(o,i){!function r(o,a,i,c){var l=s(t[o],t,a);if("throw"!==l.type){var u=l.arg,A=u.value;return A&&"object"==K(A)&&e.call(A,"__await")?n.resolve(A.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):n.resolve(A).then((function(t){u.value=t,i(u)}),(function(t){return r("throw",t,i,c)}))}c(l.arg)}(r,a,o,i)}))}return o=o?o.then(i,i):i()}})}function C(t,n,e){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(e.method=o,e.arg=a;;){var i=e.delegate;if(i){var c=E(i,e);if(c){if(c===A)continue;return c}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===r)throw r="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);r="executing";var l=s(t,n,e);if("normal"===l.type){if(r=e.done?"completed":"suspendedYield",l.arg===A)continue;return{value:l.arg,done:e.done}}"throw"===l.type&&(r="completed",e.method="throw",e.arg=l.arg)}}}function E(t,n){var e=n.method,r=t.iterator[e];if(void 0===r)return n.delegate=null,"throw"===e&&t.iterator.return&&(n.method="return",n.arg=void 0,E(t,n),"throw"===n.method)||"return"!==e&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+e+"' method")),A;var o=s(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,A;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,A):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,A)}function w(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function x(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function B(t){if(t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function n(){for(;++r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=e.call(a,"catchLoc"),l=e.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&e.call(o,"finallyLoc")&&this.prev=0;--n){var e=this.tryEntries[n];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),x(e),A}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var e=this.tryEntries[n];if(e.tryLoc===t){var r=e.completion;if("throw"===r.type){var o=r.arg;x(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,e){return this.delegate={iterator:B(t),resultName:n,nextLoc:e},"next"===this.method&&(this.arg=void 0),A}},t}function nt(t,n,e,r,o,a,i){try{var c=t[a](i),l=c.value}catch(t){return void e(t)}c.done?n(l):Promise.resolve(l).then(r,o)}function et(t){return function(){var n=this,e=arguments;return new Promise((function(r,o){var a=t.apply(n,e);function i(t){nt(a,r,o,i,c,"next",t)}function c(t){nt(a,r,o,i,c,"throw",t)}i(void 0)}))}}var rt=function(t){return Object(C.useCallback)(et(tt().mark((function n(){return tt().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,fetch("/api/events/userActivity",{method:"POST",headers:{Authorization:"Bearer ".concat(t.current),"Content-Type":"application/json"}});case 2:case"end":return n.stop()}}),n)}))),[t])};function ot(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var r,o,a,i,c=[],l=!0,u=!1;try{if(a=(e=e.call(t)).next,0===n){if(Object(e)!==e)return;l=!1}else for(;!(l=(r=a.call(e)).done)&&(c.push(r.value),c.length!==n);l=!0);}catch(t){u=!0,o=t}finally{try{if(!l&&null!=e.return&&(i=e.return(),Object(i)!==i))return}finally{if(u)throw o}}return c}}(t,n)||function(t,n){if(!t)return;if("string"==typeof t)return at(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return at(t,n)}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function at(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);et.length)&&(n=t.length);for(var e=0,r=new Array(n);et.length)&&(n=t.length);for(var e=0,r=new Array(n);e li").forEach((function(t){t.setAttribute("tabindex","0")})),null===(t=document.querySelector(".webchat__keyboard-help"))||void 0===t||t.remove()},dt=function(){Object(C.useEffect)(At,[])},ft={ACTIVITY_STATUS_SEND_STATUS_ALT_SENT_AT:" ",ACTIVITY_INTERACTIVE_LABEL_ALT:" ",ACTIVITY_INTERACTIVE_WITH_LINKS_LABEL_ALT:" ",ACTIVITY_INTERACTIVE_REASON_INTERACTIVE_CONTENT_ALT:" ",TRANSCRIPT_ARIA_LABEL_ALT:"Chat history",TRANSCRIPT_LIVE_REGION_INTERACTIVE_LABEL_ALT:" ",TRANSCRIPT_LIVE_REGION_INTERACTIVE_WITH_LINKS_LABEL_ALT:" "};function bt(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var r,o,a,i,c=[],l=!0,u=!1;try{if(a=(e=e.call(t)).next,0===n){if(Object(e)!==e)return;l=!1}else for(;!(l=(r=a.call(e)).done)&&(c.push(r.value),c.length!==n);l=!0);}catch(t){u=!0,o=t}finally{try{if(!l&&null!=e.return&&(i=e.return(),Object(i)!==i))return}finally{if(u)throw o}}return c}}(t,n)||function(t,n){if(!t)return;if("string"==typeof t)return pt(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return pt(t,n)}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pt(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);et.length)&&(n=t.length);for(var e=0,r=new Array(n);e2&&void 0!==arguments[2]?arguments[2]:0,o=[];do{if(e=t.exec(n)){var a=r>0?e.index+e.slice(1,r).reduce((function(t,n){return t+n.length}),0):e.index;o.push({index:a,text:e[r]})}}while(e);return o}function jt(t){var n=Dt(kt,t),e=t.replace(kt,"_rfm_placeholder_"),r=Dt(Mt,e,2),o=e;return r.forEach((function(t){o=function(t,n,e){return n.substring(0,t.index)+e.padEnd(t.text.length,e)+n.substring(t.index+t.text.length)}(t,o,"*")})),n.forEach((function(t){o=function(t,n,e){return n.substring(0,t.index)+t.text+n.substring(t.index+e.length)}(t,o,"_rfm_placeholder_")})),o}var St=function(){return function(t){return function(n){if(n.type===Bt.SEND_MESSAGE)n.payload.text=jt(n.payload.text);else if(n.type===_t.SEND_EVENT&&"answerFeedback"===n.payload.name){n.payload.value.feedback.forEach((function(t){t.text=jt(t.text)}))}return t(n)}}},Tt=e(220),Ot=e(80);function It(t){var n=!1,e=!1;return function(){return function(r){return function(o){return n||e||!function(t){var n,e,r;return t.type===Tt.INCOMING_ACTIVITY&&"message"===(null===(n=t.payload.activity)||void 0===n?void 0:n.type)&&"user"===(null===(r=null===(e=t.payload.activity)||void 0===e?void 0:e.from)||void 0===r?void 0:r.role)}(o)||(e=!0,t()),n=n||function(t){var n,e,r;return t.type===Ot.POST_ACTIVITY&&"message"===(null===(n=t.payload.activity)||void 0===n?void 0:n.type)&&"user"===(null===(r=null===(e=t.payload.activity)||void 0===e?void 0:e.from)||void 0===r?void 0:r.role)}(o),r(o)}}}}var Lt,Nt=e(253),zt=e(388),Ft=e(389),Ut={type:"DIRECT_LINE/POST_ACTIVITY",meta:{method:"keyboard"},payload:{activity:{type:"typing",from:{role:"user"}}}},qt=function(t){var n=t.dispatch;return function(t){return function(e){return"DIRECT_LINE/CONNECT_FULFILLED"===e.type&&n(Ut),t(e)}}};function Pt(t){return(Pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Rt(t,n,e){return(n=function(t){var n=function(t,n){if("object"!==Pt(t)||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,n||"default");if("object"!==Pt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"===Pt(n)?n:String(n)}(n))in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var Yt=(Rt(Lt={},Ot.POST_ACTIVITY,!0),Rt(Lt,Nt.SET_SEND_BOX,!0),Rt(Lt,zt.START_DICTATE,!0),Rt(Lt,Ft.START_SPEAKING_ACTIVITY,!0),Lt),Qt=function(t){return Yt[t.type]&&!function(t){return t===Ut}(t)};function Gt(t){return function(){return function(n){return function(e){return Qt(e)&&t(e),n(e)}}}}var Wt=e(66),Vt={},Zt={};function Xt(t){if(!(t.idleTimeoutMS<=0)){var n,e,r,o,a=!1,i=new WeakMap,c=(e=function(){for(var e=arguments.length,r=new Array(e),o=0;o=r&&(o=t,e.apply(void 0,arguments))});return{onActivity:function(t){i.set(Vt,t)},onExpired:function(t){i.set(Zt,t)},middleware:Object(Wt.concatMiddleware)(It(c),Gt(c)),destroy:function(){n&&clearTimeout(n),i.delete(Vt),i.delete(Zt)}}}}function Ht(t){return function(t){if(Array.isArray(t))return Kt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||$t(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Jt(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var r,o,a,i,c=[],l=!0,u=!1;try{if(a=(e=e.call(t)).next,0===n){if(Object(e)!==e)return;l=!1}else for(;!(l=(r=a.call(e)).done)&&(c.push(r.value),c.length!==n);l=!0);}catch(t){u=!0,o=t}finally{try{if(!l&&null!=e.return&&(i=e.return(),Object(i)!==i))return}finally{if(u)throw o}}return c}}(t,n)||$t(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $t(t,n){if(t){if("string"==typeof t)return Kt(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Kt(t,n):void 0}}function Kt(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e1&&void 0!==arguments[1]?arguments[1]:400;return function(){return function(e){return function(r){return"DIRECT_LINE/CONNECT_FULFILLED"===r.type&&setTimeout((function(){t()}),n),e(r)}}}}((function(){return n.onDirectLineConnected()}));if(t){var i=[].concat(Ht(null!==(e=n.middleware)&&void 0!==e?e:[]),[qt,xt,a]);if(t.session){var c=Xt(t.session);c&&(c.onActivity((function(){return n.onSessionActivity()})),c.onExpired((function(){c.destroy(),n.onSessionExpired()})),i.push(c.middleware),r=c.destroy)}var l=F.createStore.apply(void 0,[{}].concat(Ht(i)));return o([l,r]),r}}),[t,o]),r};function nn(t){return(nn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function en(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */en=function(){return t};var t={},n=Object.prototype,e=n.hasOwnProperty,r=Object.defineProperty||function(t,n,e){t[n]=e.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function l(t,n,e){return Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[n]}try{l({},"")}catch(t){l=function(t,n,e){return t[n]=e}}function u(t,n,e,o){var a=n&&n.prototype instanceof d?n:d,i=Object.create(a.prototype),c=new _(o||[]);return r(i,"_invoke",{value:C(t,e,c)}),i}function s(t,n,e){try{return{type:"normal",arg:t.call(n,e)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var A={};function d(){}function f(){}function b(){}var p={};l(p,a,(function(){return this}));var y=Object.getPrototypeOf,h=y&&y(y(B([])));h&&h!==n&&e.call(h,a)&&(p=h);var v=b.prototype=d.prototype=Object.create(p);function m(t){["next","throw","return"].forEach((function(n){l(t,n,(function(t){return this._invoke(n,t)}))}))}function g(t,n){var o;r(this,"_invoke",{value:function(r,a){function i(){return new n((function(o,i){!function r(o,a,i,c){var l=s(t[o],t,a);if("throw"!==l.type){var u=l.arg,A=u.value;return A&&"object"==nn(A)&&e.call(A,"__await")?n.resolve(A.__await).then((function(t){r("next",t,i,c)}),(function(t){r("throw",t,i,c)})):n.resolve(A).then((function(t){u.value=t,i(u)}),(function(t){return r("throw",t,i,c)}))}c(l.arg)}(r,a,o,i)}))}return o=o?o.then(i,i):i()}})}function C(t,n,e){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return k()}for(e.method=o,e.arg=a;;){var i=e.delegate;if(i){var c=E(i,e);if(c){if(c===A)continue;return c}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===r)throw r="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);r="executing";var l=s(t,n,e);if("normal"===l.type){if(r=e.done?"completed":"suspendedYield",l.arg===A)continue;return{value:l.arg,done:e.done}}"throw"===l.type&&(r="completed",e.method="throw",e.arg=l.arg)}}}function E(t,n){var e=n.method,r=t.iterator[e];if(void 0===r)return n.delegate=null,"throw"===e&&t.iterator.return&&(n.method="return",n.arg=void 0,E(t,n),"throw"===n.method)||"return"!==e&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+e+"' method")),A;var o=s(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,A;var a=o.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,A):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,A)}function w(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function x(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function B(t){if(t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function n(){for(;++r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=e.call(a,"catchLoc"),l=e.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&e.call(o,"finallyLoc")&&this.prev=0;--n){var e=this.tryEntries[n];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),x(e),A}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var e=this.tryEntries[n];if(e.tryLoc===t){var r=e.completion;if("throw"===r.type){var o=r.arg;x(e)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,e){return this.delegate={iterator:B(t),resultName:n,nextLoc:e},"next"===this.method&&(this.arg=void 0),A}},t}function rn(t,n,e,r,o,a,i){try{var c=t[a](i),l=c.value}catch(t){return void e(t)}c.done?n(l):Promise.resolve(l).then(r,o)}function on(t){return function(){var n=this,e=arguments;return new Promise((function(r,o){var a=t.apply(n,e);function i(t){rn(a,r,o,i,c,"next",t)}function c(t){rn(a,r,o,i,c,"throw",t)}i(void 0)}))}}function an(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=e){var r,o,a,i,c=[],l=!0,u=!1;try{if(a=(e=e.call(t)).next,0===n){if(Object(e)!==e)return;l=!1}else for(;!(l=(r=a.call(e)).done)&&(c.push(r.value),c.length!==n);l=!0);}catch(t){u=!0,o=t}finally{try{if(!l&&null!=e.return&&(i=e.return(),Object(i)!==i))return}finally{if(u)throw o}}return c}}(t,n)||function(t,n){if(!t)return;if("string"==typeof t)return cn(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return cn(t,n)}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cn(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e0&&void 0!==arguments[0]?arguments[0]:mt;if("true"==(null===(t=yt("bootstrap"))||void 0===t?void 0:t.toLowerCase()))return gt;var e=Object(C.useState)({isStarted:!1}),r=ht(e,2),o=r[0],a=r[1];return Object(C.useEffect)((function(){var t=function t(e){o.isStarted||n(e)&&(window.removeEventListener("message",t),a({isStarted:!0,trigger:e}))};return window.addEventListener("message",t),function(){return window.removeEventListener("message",t)}}),[]),o}((function(n){return t.isConversationTrigger(n)})),c=function(){var t=Object(C.useRef)(!1),n=Object(C.useCallback)((function(){return t.current}),[]);return Object(C.useEffect)((function(){return t.current=!0,function(){t.current=!1}}),[]),n}(),l=Object(C.useCallback)(function(){var n=on(en().mark((function n(e){var a;return en().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r(!0),n.next=3,t.getWebChatConfig({newConversation:e});case 3:a=n.sent,c()&&a&&o({type:"setConfig",config:a});case 5:case"end":return n.stop()}}),n)})));return function(t){return n.apply(this,arguments)}}(),[o,r,c]);Object(C.useEffect)((function(){i.isStarted&&on(en().mark((function t(){return en().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,l(!1);case 2:case"end":return t.stop()}}),t)})))()}),[i]),Object(C.useEffect)((function(){t.onComponentMounted()}),[]),Object(C.useEffect)((function(){var n;!e&&a&&i.isStarted&&(null===(n=t.onConversationStarted)||void 0===n||n.call(t,a,i.trigger))}),[e,a,i]);var u=an(tn(a,{onDirectLineConnected:function(){var n;r(!1),null===(n=t.onDirectLineConnected)||void 0===n||n.call(t,a)},onSessionActivity:function(){var n;return null===(n=t.onSessionActivity)||void 0===n?void 0:n.call(t)},onSessionExpired:function(){null==A||A(),o({type:"feedbackClose"}),l(!0)},middleware:t.storeMiddleware}),2),s=u[0],A=u[1],d=function(t){var n=ut(Object(C.useState)(),2),e=n[0],r=n[1];return Object(C.useEffect)((function(){if(t){var n=Object.assign(Object.assign({},t.directLineConfig),{watermark:"-",webSocket:!!t.directLineConfig.webSocket&&void 0});r(Object(F.createDirectLine)(n))}else r(void 0)}),[t]),e}(a);return{webChatConfig:a,loading:e,directLine:d,store:s}},un=function(){return function(t){return function(){var n=arguments.length<=0?void 0:arguments[0],e=n.activity.attachments,r=t.apply(void 0,arguments);return"function"!=typeof r?r:(null==e?void 0:e.some((function(t){return"application/vnd.microsoft.card.adaptive"==t.contentType})))?function(){dt();var t=Object(C.useRef)(null);return Object(C.useLayoutEffect)((function(){var n,e,r,o;null===(n=t.current)||void 0===n||n.querySelectorAll("[aria-roledescription=attachment]").forEach((function(t){t.setAttribute("aria-roledescription","message")})),document.querySelectorAll("[aria-hidden=true][id^=webchat__basic-transcript__active-descendant-label]").forEach((function(t){t.removeAttribute("aria-hidden")})),null===(e=t.current)||void 0===e||e.querySelectorAll("[role=menubar] [role=menuitem]").forEach((function(t){t.setAttribute("role","listitem")})),null===(r=t.current)||void 0===r||r.querySelectorAll("[role=menubar] [role=button]").forEach((function(t){t.setAttribute("role","listitem")})),null===(o=t.current)||void 0===o||o.querySelectorAll("[role=menubar]").forEach((function(t){t.setAttribute("role","list")}))}),[]),E.a.createElement("div",{ref:t},r.apply(void 0,arguments))}:function(){return dt(),E.a.createElement(E.a.Fragment,null,r.apply(void 0,arguments))}}}},sn="webchat__basic-transcript__activity-active-descendant",An=/Linux; Android/.test(navigator.userAgent),dn=function(){return function(t){return function(){var n=t.apply(void 0,arguments);return An&&"function"==typeof n?function(){return Object(C.useLayoutEffect)((function(){document.querySelectorAll("article").forEach((function(t){var n=t.firstChild;if(null===n||!n.className.includes(sn)){var e=document.createElement("DIV");e.className=sn,t.prepend(e)}}))}),[]),E.a.createElement(E.a.Fragment,null,n.apply(void 0,arguments))}:n}}};Wt.hooks.useStyleOptions;var fn=function(t){return Object.assign(Object.assign({},(n=[window.location.host],null!=window.parent&&window!==window.parent&&document.referrer&&n.push(new URL(document.referrer).host),{internalHosts:n,internalLinkTitle:"",externalLinkTitle:"Opens in new window",internalLinkClass:"bff-anchor-int",externalLinkClass:"bff-anchor-ext",internalLinkTarget:"_parent",externalLinkTarget:"_blank",externalLinkIcon:!0,externalLinkIconClass:"bff__webchat__markdown__external-link-icon"})),t);var n};function bn(t,n){if(null!=t){var e=t.value||t.data;if(null!=e&&e.type&&(!n||e.type===n))return e}}var pn=F.hooks.useSendMessageBack,yn=F.hooks.useScrollToEnd,hn=function(){return function(t){return function(){for(var n=arguments.length,e=new Array(n),r=0;rt.length)&&(n=t.length);for(var e=0,r=new Array(n);et.length)&&(n=t.length);for(var e=0,r=new Array(n);et.length)&&(n=t.length);for(var e=0,r=new Array(n);e0&&(o(!0),"user"!==e[0].from.role&&t({scrollTop:0},{}))}}),[n,t]),E.a.createElement(E.a.Fragment,null)},qn=function(t){return E.a.createElement(Ln,Object.assign({},t),E.a.createElement(Nn,{className:"bffWebChat"}),E.a.createElement(Un,null))},Pn=e(314),Rn=e.n(Pn),Yn=e(760),Qn=e(759),Gn=e.n(Qn);function Wn(t){return function(t){if(Array.isArray(t))return Xn(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Zn(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vn(t,n){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=Zn(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,c=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return i=t.done,t},e:function(t){c=!0,a=t},f:function(){try{i||null==e.return||e.return()}finally{if(c)throw a}}}}function Zn(t,n){if(t){if("string"==typeof t)return Xn(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?Xn(t,n):void 0}}function Xn(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e1&&void 0!==arguments[1]?arguments[1]:{};t.use(Gn.a,"bff_markdown_link_target","link_open",(function(t,e){var r,o,a=fn(n),i=t[e],c=i.attrGet("href");if(null!=c&&c.startsWith("http"))if(function(t){var n,e,r=new URL(t).host,o=Vn(null!==(n=a.internalHosts)&&void 0!==n?n:[]);try{for(o.s();!(e=o.n()).done;){var i=e.value;if("string"==typeof i){if(r===i)return!0}else if(i.test(r))return!0}}catch(t){o.e(t)}finally{o.f()}return!1}(c))i.attrSet("rel","noopener"),i.attrSet("target",a.internalLinkTarget),i.attrJoin("class",a.internalLinkClass),a.internalLinkTitle&&i.attrSet("title",a.internalLinkTitle);else if(i.attrSet("rel","noopener noreferrer"),i.attrSet("target",a.externalLinkTarget),i.attrJoin("class",a.externalLinkClass),a.externalLinkTitle&&i.attrSet("title",a.externalLinkTitle),a.externalLinkIcon){var l=null!==(r=Jn.parseInline("![".concat(a.externalLinkTitle,"](").concat(Hn,")"),{})[0].children)&&void 0!==r?r:[];null===(o=l[0])||void 0===o||o.attrJoin("class",a.externalLinkIconClass),t.splice.apply(t,[e+2,0].concat(Wn(l)))}}))},Kn=e(761),te=e.n(Kn),ne={allowedAttributes:{a:["aria-label","href","name","rel","target","title","class","data-contextintentid"],img:["alt","class","src"]},allowedSchemes:["data","http","https","ftp","mailto","sip","tel"],allowedTags:["a","b","blockquote","br","caption","code","del","div","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","li","nl","ol","p","pre","s","span","strike","strong","table","tbody","td","tfoot","th","thead","tr","ul"]},ee=function(t){return function(n){t.respectCRLF&&(n=n.replace(/\n\r|\r\n/g,(function(t){return"\n\r"===t?"\r\n":"\n\r"})));var e=new Rn.a({breaks:!1,html:!1,linkify:!0,typographer:!0,xhtmlOut:!0});return e.use(Yn.default),t.linkTargetPlugin.enabled&&e.use($n,t.linkTargetPlugin.config),function(t){return te()(t,ne)}(e.render(n))}},re=F.Components.AdaptiveCardContent,oe=F.hooks.useSuggestedActions,ae=F.hooks.usePostActivity,ie=F.hooks.useScrollToEnd,ce=function(t,n){if("Action.Submit"===t.type){var e=bn(t,"linkedAnswer");e&&(e.context.activityId=n)}else{(Array.isArray(t)?t:Object.values(t)).filter((function(t){return null!=t&&"object"==typeof t})).forEach((function(t){return ce(t,n)}))}},le={positive:"images/ic_thumb_up_filled_24px.svg",negative:"images/ic_thumb_down_filled_24px.svg"},ue={positive:"images/ic_thumb_up_filled_24px.svg",negative:"images/ic_thumb_down_filled_24px.svg"},se={positive:"Thumbs up",negative:"Thumbs down"},Ae={positive:"Thumbs up selected",negative:"Thumbs down selected"},de=function(t){var n,e,r,o,a,i,c,l=E.a.useState({activity:t.activity,attachment:t.attachment})[0],u=ie(),s=lt();Object(C.useLayoutEffect)((function(){ce(l.attachment.content,l.activity.id)}),[l.activity,l.attachment]);var A=ae(),d=Object(C.useState)(),f=d[0],b=d[1],p=l.activity.channelData||{},y=l.activity.id,h=oe()[0],v=Object(C.useCallback)((function(t){var n=t.currentTarget.getAttribute("data-reaction"),e=t.currentTarget.getAttribute("data-intent-id");null!=n&&null!=e&&(A(function(t,n,e){return{type:"messageReaction",reactionsAdded:[{type:t,intentId:n}],replyToId:e}}(n,e,y)),b(n)),u()}),[p,A,y,b,u]),m=function(t){var n,e,r,o=Q(),a=t.channelData||{},i=null!==(n=t.id)&&void 0!==n?n:"",c=null!==(r=null===(e=a.allowedFeedback)||void 0===e?void 0:e.intentId)&&void 0!==r?r:"";return Object(C.useCallback)((function(t){var n={name:"answerFeedback",value:{sourceActivityId:i,sourceIntentId:c,feedback:t}};o(n.name,n.value)}),[c,i])}(l.activity),g=Object(C.useCallback)((function(t){p.allowedFeedback&&s({type:"feedbackOpen",activity:l.activity,sendAnswerFeedback:m})}),[p]),w=Y(l.activity);return E.a.createElement("div",null,E.a.createElement(re,{content:l.attachment.content}),!!(null===(n=p.allowedReactions)||void 0===n?void 0:n.length)&&E.a.createElement("div",{className:"blueyCardAttachment__buttonBar"},null===(e=p.allowedReactions)||void 0===e?void 0:e.map((function(t,n){return E.a.createElement("button",{onClick:v,key:n,disabled:h.length||f,"aria-label":t.spokenLabel||t.label,"data-reaction":t.type,"data-intent-id":t.intentId,"data-chosen":f==t.type},t.label,E.a.createElement("img",{className:"blueyCardAttachment__buttonIcon",src:f==t.type?ue[t.type]:le[t.type],alt:f==t.type?Ae[t.type]:se[t.type]}))}))),w||!(null===(r=p.allowedFeedback)||void 0===r?void 0:r.feedbackOptions.length)?E.a.createElement(E.a.Fragment,null):E.a.createElement("div",{className:"blueyCardAttachment__buttonBar"},E.a.createElement("button",{onClick:g,"aria-label":null!==(a=null===(o=p.allowedFeedback)||void 0===o?void 0:o.spokenLabel)&&void 0!==a?a:null===(i=p.allowedFeedback)||void 0===i?void 0:i.label},null===(c=p.allowedFeedback)||void 0===c?void 0:c.label)))},fe=function(){return(fe=Object.assign||function(t){for(var n,e=1,r=arguments.length;e0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]

Popular Posts